@robinpath/glob 0.1.0
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.
- package/README.md +89 -0
- package/dist/glob.d.ts +95 -0
- package/dist/glob.d.ts.map +1 -0
- package/dist/glob.js +125 -0
- package/dist/glob.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/package.json +13 -0
package/README.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# @robinpath/glob
|
|
2
|
+
|
|
3
|
+
> File pattern matching: find files by glob patterns, test matches, expand braces
|
|
4
|
+
|
|
5
|
+
   
|
|
6
|
+
|
|
7
|
+
## Why use this module?
|
|
8
|
+
|
|
9
|
+
The `glob` module lets you:
|
|
10
|
+
|
|
11
|
+
- Find files matching a glob pattern
|
|
12
|
+
- Test if a path matches a glob pattern
|
|
13
|
+
- Convert a glob pattern to a regex string
|
|
14
|
+
- Expand brace pattern into array
|
|
15
|
+
- Extract non-glob base directory from pattern
|
|
16
|
+
|
|
17
|
+
All functions are callable directly from RobinPath scripts with a simple, consistent API.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @robinpath/glob
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
No credentials needed — start using it right away:
|
|
28
|
+
|
|
29
|
+
```robinpath
|
|
30
|
+
glob.isMatch "src/index.ts" "**/*.ts"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Available Functions
|
|
34
|
+
|
|
35
|
+
| Function | Description |
|
|
36
|
+
|----------|-------------|
|
|
37
|
+
| `glob.match` | Find files matching a glob pattern |
|
|
38
|
+
| `glob.isMatch` | Test if a path matches a glob pattern |
|
|
39
|
+
| `glob.toRegex` | Convert a glob pattern to a regex string |
|
|
40
|
+
| `glob.expand` | Expand brace pattern into array |
|
|
41
|
+
| `glob.base` | Extract non-glob base directory from pattern |
|
|
42
|
+
| `glob.hasMagic` | Check if string contains glob characters |
|
|
43
|
+
|
|
44
|
+
## Examples
|
|
45
|
+
|
|
46
|
+
### Test if a path matches a glob pattern
|
|
47
|
+
|
|
48
|
+
```robinpath
|
|
49
|
+
glob.isMatch "src/index.ts" "**/*.ts"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Convert a glob pattern to a regex string
|
|
53
|
+
|
|
54
|
+
```robinpath
|
|
55
|
+
glob.toRegex "*.ts"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Expand brace pattern into array
|
|
59
|
+
|
|
60
|
+
```robinpath
|
|
61
|
+
glob.expand "file.{ts,js}"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Integration with RobinPath
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
import { RobinPath } from "@wiredwp/robinpath";
|
|
68
|
+
import Module from "@robinpath/glob";
|
|
69
|
+
|
|
70
|
+
const rp = new RobinPath();
|
|
71
|
+
rp.registerModule(Module.name, Module.functions);
|
|
72
|
+
rp.registerModuleMeta(Module.name, Module.functionMetadata);
|
|
73
|
+
|
|
74
|
+
const result = await rp.executeScript(`
|
|
75
|
+
glob.isMatch "src/index.ts" "**/*.ts"
|
|
76
|
+
`);
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Full API Reference
|
|
80
|
+
|
|
81
|
+
See [MODULE.md](./MODULE.md) for complete documentation including all parameters, return types, error handling, and advanced examples.
|
|
82
|
+
|
|
83
|
+
## Related Modules
|
|
84
|
+
|
|
85
|
+
- [`@robinpath/json`](../json) — JSON module for complementary functionality
|
|
86
|
+
|
|
87
|
+
## License
|
|
88
|
+
|
|
89
|
+
MIT
|
package/dist/glob.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { BuiltinHandler } from "@wiredwp/robinpath";
|
|
2
|
+
export declare const GlobFunctions: Record<string, BuiltinHandler>;
|
|
3
|
+
export declare const GlobFunctionMetadata: {
|
|
4
|
+
match: {
|
|
5
|
+
description: string;
|
|
6
|
+
parameters: ({
|
|
7
|
+
name: string;
|
|
8
|
+
dataType: string;
|
|
9
|
+
description: string;
|
|
10
|
+
formInputType: string;
|
|
11
|
+
required: boolean;
|
|
12
|
+
defaultValue?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
name: string;
|
|
15
|
+
dataType: string;
|
|
16
|
+
description: string;
|
|
17
|
+
formInputType: string;
|
|
18
|
+
required: boolean;
|
|
19
|
+
defaultValue: string;
|
|
20
|
+
})[];
|
|
21
|
+
returnType: string;
|
|
22
|
+
returnDescription: string;
|
|
23
|
+
example: string;
|
|
24
|
+
};
|
|
25
|
+
isMatch: {
|
|
26
|
+
description: string;
|
|
27
|
+
parameters: {
|
|
28
|
+
name: string;
|
|
29
|
+
dataType: string;
|
|
30
|
+
description: string;
|
|
31
|
+
formInputType: string;
|
|
32
|
+
required: boolean;
|
|
33
|
+
}[];
|
|
34
|
+
returnType: string;
|
|
35
|
+
returnDescription: string;
|
|
36
|
+
example: string;
|
|
37
|
+
};
|
|
38
|
+
toRegex: {
|
|
39
|
+
description: string;
|
|
40
|
+
parameters: {
|
|
41
|
+
name: string;
|
|
42
|
+
dataType: string;
|
|
43
|
+
description: string;
|
|
44
|
+
formInputType: string;
|
|
45
|
+
required: boolean;
|
|
46
|
+
}[];
|
|
47
|
+
returnType: string;
|
|
48
|
+
returnDescription: string;
|
|
49
|
+
example: string;
|
|
50
|
+
};
|
|
51
|
+
expand: {
|
|
52
|
+
description: string;
|
|
53
|
+
parameters: {
|
|
54
|
+
name: string;
|
|
55
|
+
dataType: string;
|
|
56
|
+
description: string;
|
|
57
|
+
formInputType: string;
|
|
58
|
+
required: boolean;
|
|
59
|
+
}[];
|
|
60
|
+
returnType: string;
|
|
61
|
+
returnDescription: string;
|
|
62
|
+
example: string;
|
|
63
|
+
};
|
|
64
|
+
base: {
|
|
65
|
+
description: string;
|
|
66
|
+
parameters: {
|
|
67
|
+
name: string;
|
|
68
|
+
dataType: string;
|
|
69
|
+
description: string;
|
|
70
|
+
formInputType: string;
|
|
71
|
+
required: boolean;
|
|
72
|
+
}[];
|
|
73
|
+
returnType: string;
|
|
74
|
+
returnDescription: string;
|
|
75
|
+
example: string;
|
|
76
|
+
};
|
|
77
|
+
hasMagic: {
|
|
78
|
+
description: string;
|
|
79
|
+
parameters: {
|
|
80
|
+
name: string;
|
|
81
|
+
dataType: string;
|
|
82
|
+
description: string;
|
|
83
|
+
formInputType: string;
|
|
84
|
+
required: boolean;
|
|
85
|
+
}[];
|
|
86
|
+
returnType: string;
|
|
87
|
+
returnDescription: string;
|
|
88
|
+
example: string;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
export declare const GlobModuleMetadata: {
|
|
92
|
+
description: string;
|
|
93
|
+
methods: string[];
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=glob.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../src/glob.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAoC,MAAM,oBAAoB,CAAC;AA4G3F,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAExD,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOhC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;CAG9B,CAAC"}
|
package/dist/glob.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { readdirSync } from "node:fs";
|
|
2
|
+
import nodePath from "node:path";
|
|
3
|
+
function globToRegex(pattern) {
|
|
4
|
+
let regex = "";
|
|
5
|
+
let i = 0;
|
|
6
|
+
while (i < pattern.length) {
|
|
7
|
+
const ch = pattern[i];
|
|
8
|
+
if (ch === "*") {
|
|
9
|
+
if (pattern[i + 1] === "*") {
|
|
10
|
+
if (pattern[i + 2] === "/" || i + 2 >= pattern.length) {
|
|
11
|
+
regex += "(?:.+/)?";
|
|
12
|
+
i += pattern[i + 2] === "/" ? 3 : 2;
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
regex += "[^/]*";
|
|
17
|
+
i++;
|
|
18
|
+
}
|
|
19
|
+
else if (ch === "?") {
|
|
20
|
+
regex += "[^/]";
|
|
21
|
+
i++;
|
|
22
|
+
}
|
|
23
|
+
else if (ch === "{") {
|
|
24
|
+
const close = pattern.indexOf("}", i);
|
|
25
|
+
if (close !== -1) {
|
|
26
|
+
const alternatives = pattern.slice(i + 1, close).split(",").map((a) => a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
27
|
+
regex += `(?:${alternatives})`;
|
|
28
|
+
i = close + 1;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
regex += "\\{";
|
|
32
|
+
i++;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else if (ch === "[") {
|
|
36
|
+
const close = pattern.indexOf("]", i);
|
|
37
|
+
if (close !== -1) {
|
|
38
|
+
regex += pattern.slice(i, close + 1);
|
|
39
|
+
i = close + 1;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
regex += "\\[";
|
|
43
|
+
i++;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else if (".+^${}()|[]\\".includes(ch)) {
|
|
47
|
+
regex += "\\" + ch;
|
|
48
|
+
i++;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
regex += ch;
|
|
52
|
+
i++;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return new RegExp("^" + regex + "$");
|
|
56
|
+
}
|
|
57
|
+
function walkDir(dir) {
|
|
58
|
+
const results = [];
|
|
59
|
+
try {
|
|
60
|
+
const entries = readdirSync(dir, { withFileTypes: true });
|
|
61
|
+
for (const entry of entries) {
|
|
62
|
+
const fullPath = nodePath.join(dir, entry.name);
|
|
63
|
+
if (entry.isDirectory()) {
|
|
64
|
+
results.push(...walkDir(fullPath));
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
results.push(fullPath);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch { /* skip inaccessible dirs */ }
|
|
72
|
+
return results;
|
|
73
|
+
}
|
|
74
|
+
const match = (args) => {
|
|
75
|
+
const pattern = String(args[0] ?? "");
|
|
76
|
+
const cwd = String(args[1] ?? ".");
|
|
77
|
+
const regex = globToRegex(pattern);
|
|
78
|
+
const files = walkDir(cwd);
|
|
79
|
+
return files.filter((f) => {
|
|
80
|
+
const relative = nodePath.relative(cwd, f).replace(/\\/g, "/");
|
|
81
|
+
return regex.test(relative);
|
|
82
|
+
}).map((f) => nodePath.relative(cwd, f).replace(/\\/g, "/"));
|
|
83
|
+
};
|
|
84
|
+
const isMatch = (args) => {
|
|
85
|
+
const filePath = String(args[0] ?? "").replace(/\\/g, "/");
|
|
86
|
+
const pattern = String(args[1] ?? "");
|
|
87
|
+
return globToRegex(pattern).test(filePath);
|
|
88
|
+
};
|
|
89
|
+
const toRegex = (args) => globToRegex(String(args[0] ?? "")).source;
|
|
90
|
+
const expand = (args) => {
|
|
91
|
+
const pattern = String(args[0] ?? "");
|
|
92
|
+
const braceMatch = pattern.match(/^(.*)\{([^}]+)\}(.*)$/);
|
|
93
|
+
if (!braceMatch)
|
|
94
|
+
return [pattern];
|
|
95
|
+
const [, prefix, alts, suffix] = braceMatch;
|
|
96
|
+
return alts.split(",").map((alt) => `${prefix}${alt.trim()}${suffix}`);
|
|
97
|
+
};
|
|
98
|
+
const base = (args) => {
|
|
99
|
+
const pattern = String(args[0] ?? "");
|
|
100
|
+
const parts = pattern.split("/");
|
|
101
|
+
const baseParts = [];
|
|
102
|
+
for (const part of parts) {
|
|
103
|
+
if (part.includes("*") || part.includes("?") || part.includes("{") || part.includes("["))
|
|
104
|
+
break;
|
|
105
|
+
baseParts.push(part);
|
|
106
|
+
}
|
|
107
|
+
return baseParts.join("/") || ".";
|
|
108
|
+
};
|
|
109
|
+
const hasMagic = (args) => /[*?{[\]]/.test(String(args[0] ?? ""));
|
|
110
|
+
export const GlobFunctions = {
|
|
111
|
+
match, isMatch, toRegex, expand, base, hasMagic,
|
|
112
|
+
};
|
|
113
|
+
export const GlobFunctionMetadata = {
|
|
114
|
+
match: { description: "Find files matching a glob pattern", parameters: [{ name: "pattern", dataType: "string", description: "Glob pattern (e.g. **/*.ts)", formInputType: "text", required: true }, { name: "cwd", dataType: "string", description: "Working directory (default: .)", formInputType: "text", required: false, defaultValue: "." }], returnType: "array", returnDescription: "Array of matching file paths", example: 'glob.match "src/**/*.ts"' },
|
|
115
|
+
isMatch: { description: "Test if a path matches a glob pattern", parameters: [{ name: "filePath", dataType: "string", description: "File path to test", formInputType: "text", required: true }, { name: "pattern", dataType: "string", description: "Glob pattern", formInputType: "text", required: true }], returnType: "boolean", returnDescription: "True if matches", example: 'glob.isMatch "src/index.ts" "**/*.ts"' },
|
|
116
|
+
toRegex: { description: "Convert a glob pattern to a regex string", parameters: [{ name: "pattern", dataType: "string", description: "Glob pattern", formInputType: "text", required: true }], returnType: "string", returnDescription: "Regex source string", example: 'glob.toRegex "*.ts"' },
|
|
117
|
+
expand: { description: "Expand brace pattern into array", parameters: [{ name: "pattern", dataType: "string", description: "Pattern with braces (e.g. {a,b,c})", formInputType: "text", required: true }], returnType: "array", returnDescription: "Array of expanded strings", example: 'glob.expand "file.{ts,js}"' },
|
|
118
|
+
base: { description: "Extract non-glob base directory from pattern", parameters: [{ name: "pattern", dataType: "string", description: "Glob pattern", formInputType: "text", required: true }], returnType: "string", returnDescription: "Base directory path", example: 'glob.base "src/**/*.ts"' },
|
|
119
|
+
hasMagic: { description: "Check if string contains glob characters", parameters: [{ name: "str", dataType: "string", description: "String to check", formInputType: "text", required: true }], returnType: "boolean", returnDescription: "True if contains glob chars", example: 'glob.hasMagic "*.ts"' },
|
|
120
|
+
};
|
|
121
|
+
export const GlobModuleMetadata = {
|
|
122
|
+
description: "File pattern matching: find files by glob patterns, test matches, expand braces",
|
|
123
|
+
methods: ["match", "isMatch", "toRegex", "expand", "base", "hasMagic"],
|
|
124
|
+
};
|
|
125
|
+
//# sourceMappingURL=glob.js.map
|
package/dist/glob.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glob.js","sourceRoot":"","sources":["../src/glob.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAY,MAAM,SAAS,CAAC;AAChD,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,SAAS,WAAW,CAAC,OAAe;IAClC,IAAI,KAAK,GAAG,EAAE,CAAC;IACf,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;QAC1B,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,CAAE,CAAC;QACvB,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YACf,IAAI,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;gBAC3B,IAAI,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;oBACtD,KAAK,IAAI,UAAU,CAAC;oBACpB,CAAC,IAAI,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACpC,SAAS;gBACX,CAAC;YACH,CAAC;YACD,KAAK,IAAI,OAAO,CAAC;YACjB,CAAC,EAAE,CAAC;QACN,CAAC;aAAM,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YACtB,KAAK,I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AAE,OAAO,EAAE,4BAA4B,EAAE;IACvT,IAAI,EAAE,EAAE,WAAW,EAAE,8CAA8C,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,OAAO,EAAE,yBAAyB,EAAE;IACpS,QAAQ,EAAE,EAAE,WAAW,EAAE,0CAA0C,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,iBAAiB,EAAE,6BAA6B,EAAE,OAAO,EAAE,sBAAsB,EAAE;CAC1S,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,WAAW,EAAE,iFAAiF;IAC9F,OAAO,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC;CACvE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ModuleAdapter } from "@wiredwp/robinpath";
|
|
2
|
+
declare const GlobModule: ModuleAdapter;
|
|
3
|
+
export default GlobModule;
|
|
4
|
+
export { GlobModule };
|
|
5
|
+
export { GlobFunctions, GlobFunctionMetadata, GlobModuleMetadata } from "./glob.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,QAAA,MAAM,UAAU,EAAE,aAMjB,CAAC;AAEF,eAAe,UAAU,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GlobFunctions, GlobFunctionMetadata, GlobModuleMetadata } from "./glob.js";
|
|
2
|
+
const GlobModule = {
|
|
3
|
+
name: "glob",
|
|
4
|
+
functions: GlobFunctions,
|
|
5
|
+
functionMetadata: GlobFunctionMetadata,
|
|
6
|
+
moduleMetadata: GlobModuleMetadata,
|
|
7
|
+
global: false,
|
|
8
|
+
}; // as ModuleAdapter
|
|
9
|
+
export default GlobModule;
|
|
10
|
+
export { GlobModule };
|
|
11
|
+
export { GlobFunctions, GlobFunctionMetadata, GlobModuleMetadata } from "./glob.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpF,MAAM,UAAU,GAAkB;IAChC,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,aAAa;IACxB,gBAAgB,EAAE,oBAA2B;IAC7C,cAAc,EAAE,kBAAyB;IACzC,MAAM,EAAE,KAAK;CACd,CAAC,CAAC,mBAAmB;AAEtB,eAAe,UAAU,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@robinpath/glob",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"publishConfig": { "access": "public" },
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": { ".": { "import": "./dist/index.js", "types": "./dist/index.d.ts" } },
|
|
9
|
+
"files": ["dist"],
|
|
10
|
+
"scripts": { "build": "tsc", "test": "node --import tsx --test tests/*.test.ts" },
|
|
11
|
+
"peerDependencies": { "@wiredwp/robinpath": ">=0.20.0" },
|
|
12
|
+
"devDependencies": { "@wiredwp/robinpath": "^0.30.1", "tsx": "^4.19.0", "typescript": "^5.6.0" }
|
|
13
|
+
}
|