stdin-glob 1.4.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=pipes.test.d.ts.map
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const vitest_1 = require("vitest");
4
+ const pipes_1 = require("./pipes");
5
+ (0, vitest_1.describe)('addLineNumbers', () => {
6
+ (0, vitest_1.it)('adds line numbers to content', () => {
7
+ const content = 'line1\nline2\nline3';
8
+ const result = (0, pipes_1.addLineNumbers)(content);
9
+ (0, vitest_1.expect)(result).toBe('1 | line1\n2 | line2\n3 | line3');
10
+ });
11
+ (0, vitest_1.it)('handles empty content', () => {
12
+ (0, vitest_1.expect)((0, pipes_1.addLineNumbers)('')).toBe('1 | ');
13
+ });
14
+ (0, vitest_1.it)('respects custom start line', () => {
15
+ const content = 'line1\nline2';
16
+ const result = (0, pipes_1.addLineNumbers)(content, 5);
17
+ (0, vitest_1.expect)(result).toBe('5 | line1\n6 | line2');
18
+ });
19
+ (0, vitest_1.it)('pads numbers correctly', () => {
20
+ const content = Array(100).fill('line').join('\n');
21
+ const result = (0, pipes_1.addLineNumbers)(content);
22
+ (0, vitest_1.expect)(result).toContain(' 99 | line');
23
+ (0, vitest_1.expect)(result).toContain('100 | line');
24
+ });
25
+ });
26
+ (0, vitest_1.describe)('formatSizeInMB', () => {
27
+ (0, vitest_1.it)('formats bytes to MB', () => {
28
+ (0, vitest_1.expect)((0, pipes_1.formatSizeInMB)(0)).toBe('0.000 MB');
29
+ (0, vitest_1.expect)((0, pipes_1.formatSizeInMB)(1024 * 1024)).toBe('1.000 MB');
30
+ (0, vitest_1.expect)((0, pipes_1.formatSizeInMB)(1024 * 1024 * 2.5)).toBe('2.500 MB');
31
+ });
32
+ (0, vitest_1.it)('handles small files', () => {
33
+ (0, vitest_1.expect)((0, pipes_1.formatSizeInMB)(1024)).toBe('0.001 MB');
34
+ (0, vitest_1.expect)((0, pipes_1.formatSizeInMB)(512)).toBe('0.000 MB');
35
+ });
36
+ (0, vitest_1.it)('handles large files', () => {
37
+ (0, vitest_1.expect)((0, pipes_1.formatSizeInMB)(1024 * 1024 * 100)).toBe('100.000 MB');
38
+ });
39
+ });
40
+ //# sourceMappingURL=pipes.test.js.map
package/package.json CHANGED
@@ -1,20 +1,25 @@
1
1
  {
2
2
  "name": "stdin-glob",
3
- "version": "1.4.0",
3
+ "version": "1.8.1",
4
4
  "description": "Expand glob patterns and output file contents.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "packageManager": "pnpm@10.0.0",
7
8
  "bin": {
8
- "stdin-glob": "./dist/index.js"
9
+ "stdin-glob": "./bin/stdin-glob.cjs"
9
10
  },
10
11
  "scripts": {
11
12
  "build": "tsc",
12
13
  "prepare": "npm run build",
13
- "prepublishOnly": "npm run build"
14
+ "prepublishOnly": "npm run build",
15
+ "test": "vitest",
16
+ "test:run": "vitest run",
17
+ "test:coverage": "vitest run --coverage"
14
18
  },
15
19
  "files": [
16
20
  "dist/**/*.js",
17
- "dist/**/*.d.ts"
21
+ "dist/**/*.d.ts",
22
+ "bin/*"
18
23
  ],
19
24
  "keywords": [
20
25
  "glob",
@@ -41,6 +46,9 @@
41
46
  },
42
47
  "devDependencies": {
43
48
  "@types/node": "^25.3.3",
44
- "typescript": "^5.9.3"
49
+ "@vitest/coverage-v8": "^4.1.0",
50
+ "prettier": "^3.8.1",
51
+ "typescript": "^5.9.3",
52
+ "vitest": "^4.1.0"
45
53
  }
46
- }
54
+ }