@bemoje/path 1.1.1 → 1.1.2

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.
Files changed (63) hide show
  1. package/lib/index.d.cts +149 -16
  2. package/lib/index.d.ts +149 -16
  3. package/package.json +95 -155
  4. package/lib/lib/cwd.cjs +0 -16
  5. package/lib/lib/cwd.d.cts +0 -11
  6. package/lib/lib/cwd.d.ts +0 -11
  7. package/lib/lib/cwd.js +0 -10
  8. package/lib/lib/dirnameDeep.cjs +0 -17
  9. package/lib/lib/dirnameDeep.d.cts +0 -9
  10. package/lib/lib/dirnameDeep.d.ts +0 -9
  11. package/lib/lib/dirnameDeep.js +0 -11
  12. package/lib/lib/hasBasename.cjs +0 -18
  13. package/lib/lib/hasBasename.d.cts +0 -8
  14. package/lib/lib/hasBasename.d.ts +0 -8
  15. package/lib/lib/hasBasename.js +0 -12
  16. package/lib/lib/hasExtname.cjs +0 -60
  17. package/lib/lib/hasExtname.d.cts +0 -15
  18. package/lib/lib/hasExtname.d.ts +0 -15
  19. package/lib/lib/hasExtname.js +0 -58
  20. package/lib/lib/hasParentDirname.cjs +0 -12
  21. package/lib/lib/hasParentDirname.d.cts +0 -6
  22. package/lib/lib/hasParentDirname.d.ts +0 -6
  23. package/lib/lib/hasParentDirname.js +0 -10
  24. package/lib/lib/isDotFile.cjs +0 -12
  25. package/lib/lib/isDotFile.d.cts +0 -8
  26. package/lib/lib/isDotFile.d.ts +0 -8
  27. package/lib/lib/isDotFile.js +0 -10
  28. package/lib/lib/isExtValid.cjs +0 -12
  29. package/lib/lib/isExtValid.d.cts +0 -13
  30. package/lib/lib/isExtValid.d.ts +0 -13
  31. package/lib/lib/isExtValid.js +0 -10
  32. package/lib/lib/isRelative.cjs +0 -16
  33. package/lib/lib/isRelative.d.cts +0 -6
  34. package/lib/lib/isRelative.d.ts +0 -6
  35. package/lib/lib/isRelative.js +0 -10
  36. package/lib/lib/isUnc.cjs +0 -12
  37. package/lib/lib/isUnc.d.cts +0 -8
  38. package/lib/lib/isUnc.d.ts +0 -8
  39. package/lib/lib/isUnc.js +0 -10
  40. package/lib/lib/isValidWin32.cjs +0 -29
  41. package/lib/lib/isValidWin32.d.cts +0 -11
  42. package/lib/lib/isValidWin32.d.ts +0 -11
  43. package/lib/lib/isValidWin32.js +0 -27
  44. package/lib/lib/prefixFilename.cjs +0 -18
  45. package/lib/lib/prefixFilename.d.cts +0 -11
  46. package/lib/lib/prefixFilename.d.ts +0 -11
  47. package/lib/lib/prefixFilename.js +0 -12
  48. package/lib/lib/root.cjs +0 -16
  49. package/lib/lib/root.d.cts +0 -6
  50. package/lib/lib/root.d.ts +0 -6
  51. package/lib/lib/root.js +0 -10
  52. package/lib/lib/suffixFilename.cjs +0 -18
  53. package/lib/lib/suffixFilename.d.cts +0 -11
  54. package/lib/lib/suffixFilename.d.ts +0 -11
  55. package/lib/lib/suffixFilename.js +0 -12
  56. package/lib/lib/toCwdRelative.cjs +0 -16
  57. package/lib/lib/toCwdRelative.d.cts +0 -8
  58. package/lib/lib/toCwdRelative.d.ts +0 -8
  59. package/lib/lib/toCwdRelative.js +0 -10
  60. package/lib/lib/toWin32.cjs +0 -12
  61. package/lib/lib/toWin32.d.cts +0 -6
  62. package/lib/lib/toWin32.d.ts +0 -6
  63. package/lib/lib/toWin32.js +0 -10
package/package.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "@bemoje/path",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Cross-platform path utilities extending upath with validation, manipulation, and inspection helpers.",
5
+ "type": "module",
6
+ "sideEffects": false,
5
7
  "keywords": [
6
8
  "path",
7
9
  "cross-platform",
@@ -12,17 +14,15 @@
12
14
  "utilities",
13
15
  "typescript"
14
16
  ],
15
- "dependencies": {
16
- "upath": "^2.0.1"
17
- },
18
- "type": "module",
19
- "sideEffects": false,
20
- "publishConfig": {
21
- "access": "public"
22
- },
23
17
  "main": "./lib/index.cjs",
24
18
  "module": "./lib/index.js",
25
19
  "types": "./lib/index.d.ts",
20
+ "files": [
21
+ "./lib/index.js",
22
+ "./lib/index.d.ts",
23
+ "./lib/index.cjs",
24
+ "./lib/index.d.cts"
25
+ ],
26
26
  "exports": {
27
27
  ".": {
28
28
  "import": {
@@ -34,232 +34,172 @@
34
34
  "default": "./lib/index.cjs"
35
35
  }
36
36
  },
37
- "./lib/cwd": {
37
+ "./cwd": {
38
38
  "import": {
39
- "types": "./lib/lib/cwd.d.ts",
40
- "default": "./lib/lib/cwd.js"
39
+ "types": "./lib/index.d.ts",
40
+ "default": "./lib/index.js"
41
41
  },
42
42
  "require": {
43
- "types": "./lib/lib/cwd.d.cts",
44
- "default": "./lib/lib/cwd.cjs"
43
+ "types": "./lib/index.d.cts",
44
+ "default": "./lib/index.cjs"
45
45
  }
46
46
  },
47
- "./lib/dirnameDeep": {
47
+ "./dirnameDeep": {
48
48
  "import": {
49
- "types": "./lib/lib/dirnameDeep.d.ts",
50
- "default": "./lib/lib/dirnameDeep.js"
49
+ "types": "./lib/index.d.ts",
50
+ "default": "./lib/index.js"
51
51
  },
52
52
  "require": {
53
- "types": "./lib/lib/dirnameDeep.d.cts",
54
- "default": "./lib/lib/dirnameDeep.cjs"
53
+ "types": "./lib/index.d.cts",
54
+ "default": "./lib/index.cjs"
55
55
  }
56
56
  },
57
- "./lib/hasBasename": {
57
+ "./hasBasename": {
58
58
  "import": {
59
- "types": "./lib/lib/hasBasename.d.ts",
60
- "default": "./lib/lib/hasBasename.js"
59
+ "types": "./lib/index.d.ts",
60
+ "default": "./lib/index.js"
61
61
  },
62
62
  "require": {
63
- "types": "./lib/lib/hasBasename.d.cts",
64
- "default": "./lib/lib/hasBasename.cjs"
63
+ "types": "./lib/index.d.cts",
64
+ "default": "./lib/index.cjs"
65
65
  }
66
66
  },
67
- "./lib/hasExtname": {
67
+ "./hasExtname": {
68
68
  "import": {
69
- "types": "./lib/lib/hasExtname.d.ts",
70
- "default": "./lib/lib/hasExtname.js"
69
+ "types": "./lib/index.d.ts",
70
+ "default": "./lib/index.js"
71
71
  },
72
72
  "require": {
73
- "types": "./lib/lib/hasExtname.d.cts",
74
- "default": "./lib/lib/hasExtname.cjs"
73
+ "types": "./lib/index.d.cts",
74
+ "default": "./lib/index.cjs"
75
75
  }
76
76
  },
77
- "./lib/hasParentDirname": {
77
+ "./hasParentDirname": {
78
78
  "import": {
79
- "types": "./lib/lib/hasParentDirname.d.ts",
80
- "default": "./lib/lib/hasParentDirname.js"
79
+ "types": "./lib/index.d.ts",
80
+ "default": "./lib/index.js"
81
81
  },
82
82
  "require": {
83
- "types": "./lib/lib/hasParentDirname.d.cts",
84
- "default": "./lib/lib/hasParentDirname.cjs"
83
+ "types": "./lib/index.d.cts",
84
+ "default": "./lib/index.cjs"
85
85
  }
86
86
  },
87
- "./lib/isDotFile": {
87
+ "./isDotFile": {
88
88
  "import": {
89
- "types": "./lib/lib/isDotFile.d.ts",
90
- "default": "./lib/lib/isDotFile.js"
89
+ "types": "./lib/index.d.ts",
90
+ "default": "./lib/index.js"
91
91
  },
92
92
  "require": {
93
- "types": "./lib/lib/isDotFile.d.cts",
94
- "default": "./lib/lib/isDotFile.cjs"
93
+ "types": "./lib/index.d.cts",
94
+ "default": "./lib/index.cjs"
95
95
  }
96
96
  },
97
- "./lib/isExtValid": {
97
+ "./isExtValid": {
98
98
  "import": {
99
- "types": "./lib/lib/isExtValid.d.ts",
100
- "default": "./lib/lib/isExtValid.js"
99
+ "types": "./lib/index.d.ts",
100
+ "default": "./lib/index.js"
101
101
  },
102
102
  "require": {
103
- "types": "./lib/lib/isExtValid.d.cts",
104
- "default": "./lib/lib/isExtValid.cjs"
103
+ "types": "./lib/index.d.cts",
104
+ "default": "./lib/index.cjs"
105
105
  }
106
106
  },
107
- "./lib/isRelative": {
107
+ "./isRelative": {
108
108
  "import": {
109
- "types": "./lib/lib/isRelative.d.ts",
110
- "default": "./lib/lib/isRelative.js"
109
+ "types": "./lib/index.d.ts",
110
+ "default": "./lib/index.js"
111
111
  },
112
112
  "require": {
113
- "types": "./lib/lib/isRelative.d.cts",
114
- "default": "./lib/lib/isRelative.cjs"
113
+ "types": "./lib/index.d.cts",
114
+ "default": "./lib/index.cjs"
115
115
  }
116
116
  },
117
- "./lib/isUnc": {
117
+ "./isUnc": {
118
118
  "import": {
119
- "types": "./lib/lib/isUnc.d.ts",
120
- "default": "./lib/lib/isUnc.js"
119
+ "types": "./lib/index.d.ts",
120
+ "default": "./lib/index.js"
121
121
  },
122
122
  "require": {
123
- "types": "./lib/lib/isUnc.d.cts",
124
- "default": "./lib/lib/isUnc.cjs"
123
+ "types": "./lib/index.d.cts",
124
+ "default": "./lib/index.cjs"
125
125
  }
126
126
  },
127
- "./lib/isValidWin32": {
127
+ "./isValidWin32": {
128
128
  "import": {
129
- "types": "./lib/lib/isValidWin32.d.ts",
130
- "default": "./lib/lib/isValidWin32.js"
129
+ "types": "./lib/index.d.ts",
130
+ "default": "./lib/index.js"
131
131
  },
132
132
  "require": {
133
- "types": "./lib/lib/isValidWin32.d.cts",
134
- "default": "./lib/lib/isValidWin32.cjs"
133
+ "types": "./lib/index.d.cts",
134
+ "default": "./lib/index.cjs"
135
135
  }
136
136
  },
137
- "./lib/prefixFilename": {
137
+ "./prefixFilename": {
138
138
  "import": {
139
- "types": "./lib/lib/prefixFilename.d.ts",
140
- "default": "./lib/lib/prefixFilename.js"
139
+ "types": "./lib/index.d.ts",
140
+ "default": "./lib/index.js"
141
141
  },
142
142
  "require": {
143
- "types": "./lib/lib/prefixFilename.d.cts",
144
- "default": "./lib/lib/prefixFilename.cjs"
143
+ "types": "./lib/index.d.cts",
144
+ "default": "./lib/index.cjs"
145
145
  }
146
146
  },
147
- "./lib/root": {
147
+ "./root": {
148
148
  "import": {
149
- "types": "./lib/lib/root.d.ts",
150
- "default": "./lib/lib/root.js"
149
+ "types": "./lib/index.d.ts",
150
+ "default": "./lib/index.js"
151
151
  },
152
152
  "require": {
153
- "types": "./lib/lib/root.d.cts",
154
- "default": "./lib/lib/root.cjs"
153
+ "types": "./lib/index.d.cts",
154
+ "default": "./lib/index.cjs"
155
155
  }
156
156
  },
157
- "./lib/suffixFilename": {
157
+ "./suffixFilename": {
158
158
  "import": {
159
- "types": "./lib/lib/suffixFilename.d.ts",
160
- "default": "./lib/lib/suffixFilename.js"
159
+ "types": "./lib/index.d.ts",
160
+ "default": "./lib/index.js"
161
161
  },
162
162
  "require": {
163
- "types": "./lib/lib/suffixFilename.d.cts",
164
- "default": "./lib/lib/suffixFilename.cjs"
163
+ "types": "./lib/index.d.cts",
164
+ "default": "./lib/index.cjs"
165
165
  }
166
166
  },
167
- "./lib/toCwdRelative": {
167
+ "./toCwdRelative": {
168
168
  "import": {
169
- "types": "./lib/lib/toCwdRelative.d.ts",
170
- "default": "./lib/lib/toCwdRelative.js"
169
+ "types": "./lib/index.d.ts",
170
+ "default": "./lib/index.js"
171
171
  },
172
172
  "require": {
173
- "types": "./lib/lib/toCwdRelative.d.cts",
174
- "default": "./lib/lib/toCwdRelative.cjs"
173
+ "types": "./lib/index.d.cts",
174
+ "default": "./lib/index.cjs"
175
175
  }
176
176
  },
177
- "./lib/toWin32": {
177
+ "./toWin32": {
178
178
  "import": {
179
- "types": "./lib/lib/toWin32.d.ts",
180
- "default": "./lib/lib/toWin32.js"
179
+ "types": "./lib/index.d.ts",
180
+ "default": "./lib/index.js"
181
181
  },
182
182
  "require": {
183
- "types": "./lib/lib/toWin32.d.cts",
184
- "default": "./lib/lib/toWin32.cjs"
183
+ "types": "./lib/index.d.cts",
184
+ "default": "./lib/index.cjs"
185
185
  }
186
186
  }
187
187
  },
188
- "files": [
189
- "./lib/index.js",
190
- "./lib/index.d.ts",
191
- "./lib/index.cjs",
192
- "./lib/index.d.cts",
193
- "./lib/lib/cwd.js",
194
- "./lib/lib/cwd.d.ts",
195
- "./lib/lib/cwd.cjs",
196
- "./lib/lib/cwd.d.cts",
197
- "./lib/lib/dirnameDeep.js",
198
- "./lib/lib/dirnameDeep.d.ts",
199
- "./lib/lib/dirnameDeep.cjs",
200
- "./lib/lib/dirnameDeep.d.cts",
201
- "./lib/lib/hasBasename.js",
202
- "./lib/lib/hasBasename.d.ts",
203
- "./lib/lib/hasBasename.cjs",
204
- "./lib/lib/hasBasename.d.cts",
205
- "./lib/lib/hasExtname.js",
206
- "./lib/lib/hasExtname.d.ts",
207
- "./lib/lib/hasExtname.cjs",
208
- "./lib/lib/hasExtname.d.cts",
209
- "./lib/lib/hasParentDirname.js",
210
- "./lib/lib/hasParentDirname.d.ts",
211
- "./lib/lib/hasParentDirname.cjs",
212
- "./lib/lib/hasParentDirname.d.cts",
213
- "./lib/lib/isDotFile.js",
214
- "./lib/lib/isDotFile.d.ts",
215
- "./lib/lib/isDotFile.cjs",
216
- "./lib/lib/isDotFile.d.cts",
217
- "./lib/lib/isExtValid.js",
218
- "./lib/lib/isExtValid.d.ts",
219
- "./lib/lib/isExtValid.cjs",
220
- "./lib/lib/isExtValid.d.cts",
221
- "./lib/lib/isRelative.js",
222
- "./lib/lib/isRelative.d.ts",
223
- "./lib/lib/isRelative.cjs",
224
- "./lib/lib/isRelative.d.cts",
225
- "./lib/lib/isUnc.js",
226
- "./lib/lib/isUnc.d.ts",
227
- "./lib/lib/isUnc.cjs",
228
- "./lib/lib/isUnc.d.cts",
229
- "./lib/lib/isValidWin32.js",
230
- "./lib/lib/isValidWin32.d.ts",
231
- "./lib/lib/isValidWin32.cjs",
232
- "./lib/lib/isValidWin32.d.cts",
233
- "./lib/lib/prefixFilename.js",
234
- "./lib/lib/prefixFilename.d.ts",
235
- "./lib/lib/prefixFilename.cjs",
236
- "./lib/lib/prefixFilename.d.cts",
237
- "./lib/lib/root.js",
238
- "./lib/lib/root.d.ts",
239
- "./lib/lib/root.cjs",
240
- "./lib/lib/root.d.cts",
241
- "./lib/lib/suffixFilename.js",
242
- "./lib/lib/suffixFilename.d.ts",
243
- "./lib/lib/suffixFilename.cjs",
244
- "./lib/lib/suffixFilename.d.cts",
245
- "./lib/lib/toCwdRelative.js",
246
- "./lib/lib/toCwdRelative.d.ts",
247
- "./lib/lib/toCwdRelative.cjs",
248
- "./lib/lib/toCwdRelative.d.cts",
249
- "./lib/lib/toWin32.js",
250
- "./lib/lib/toWin32.d.ts",
251
- "./lib/lib/toWin32.cjs",
252
- "./lib/lib/toWin32.d.cts"
253
- ],
254
- "repository": {
255
- "type": "git",
256
- "url": "git+https://github.com/bemoje/mono.git",
257
- "directory": "libs/path"
188
+ "dependencies": {
189
+ "upath": "^2.0.1"
258
190
  },
191
+ "publishConfig": {
192
+ "access": "public"
193
+ },
194
+ "license": "MIT",
259
195
  "author": {
260
196
  "name": "Benjamin Møller Jensen",
261
197
  "email": "bemoje@bemoje.net",
262
198
  "url": "https://github.com/bemoje/"
263
199
  },
264
- "license": "MIT"
200
+ "repository": {
201
+ "type": "git",
202
+ "url": "git+https://github.com/bemoje/mono.git",
203
+ "directory": "libs/path"
204
+ }
265
205
  }
package/lib/lib/cwd.cjs DELETED
@@ -1,16 +0,0 @@
1
- 'use strict';
2
-
3
- var upath = require('upath');
4
-
5
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
-
7
- var upath__default = /*#__PURE__*/_interopDefault(upath);
8
-
9
- var __defProp = Object.defineProperty;
10
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
11
- function cwd(...p) {
12
- return upath__default.default.joinSafe(process.cwd(), ...p);
13
- }
14
- __name(cwd, "cwd");
15
-
16
- exports.cwd = cwd;
package/lib/lib/cwd.d.cts DELETED
@@ -1,11 +0,0 @@
1
- /**
2
- * Join paths starting from process.cwd()
3
- *
4
- * @example ```ts
5
- * // equivalent to:
6
- * path.join(process.cwd(), ...p)
7
- * ```
8
- */
9
- declare function cwd(...p: string[]): string;
10
-
11
- export { cwd };
package/lib/lib/cwd.d.ts DELETED
@@ -1,11 +0,0 @@
1
- /**
2
- * Join paths starting from process.cwd()
3
- *
4
- * @example ```ts
5
- * // equivalent to:
6
- * path.join(process.cwd(), ...p)
7
- * ```
8
- */
9
- declare function cwd(...p: string[]): string;
10
-
11
- export { cwd };
package/lib/lib/cwd.js DELETED
@@ -1,10 +0,0 @@
1
- import upath from 'upath';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function cwd(...p) {
6
- return upath.joinSafe(process.cwd(), ...p);
7
- }
8
- __name(cwd, "cwd");
9
-
10
- export { cwd };
@@ -1,17 +0,0 @@
1
- 'use strict';
2
-
3
- var upath = require('upath');
4
-
5
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
-
7
- var upath__default = /*#__PURE__*/_interopDefault(upath);
8
-
9
- var __defProp = Object.defineProperty;
10
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
11
- function dirnameDeep(p, depth) {
12
- const parent = upath__default.default.dirname(p);
13
- return depth && depth > 1 ? dirnameDeep(parent, depth - 1) : parent;
14
- }
15
- __name(dirnameDeep, "dirnameDeep");
16
-
17
- exports.dirnameDeep = dirnameDeep;
@@ -1,9 +0,0 @@
1
- /**
2
- * Returns the absolute path of the parent directory of the given path.
3
- * @param p the path
4
- * @param depth how many times to get the parent directory
5
- * @example dirnameDeep('a/b/c/d', 2) => 'a/b'
6
- */
7
- declare function dirnameDeep(p: string, depth?: number): string;
8
-
9
- export { dirnameDeep };
@@ -1,9 +0,0 @@
1
- /**
2
- * Returns the absolute path of the parent directory of the given path.
3
- * @param p the path
4
- * @param depth how many times to get the parent directory
5
- * @example dirnameDeep('a/b/c/d', 2) => 'a/b'
6
- */
7
- declare function dirnameDeep(p: string, depth?: number): string;
8
-
9
- export { dirnameDeep };
@@ -1,11 +0,0 @@
1
- import upath from 'upath';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function dirnameDeep(p, depth) {
6
- const parent = upath.dirname(p);
7
- return depth && depth > 1 ? dirnameDeep(parent, depth - 1) : parent;
8
- }
9
- __name(dirnameDeep, "dirnameDeep");
10
-
11
- export { dirnameDeep };
@@ -1,18 +0,0 @@
1
- 'use strict';
2
-
3
- var upath = require('upath');
4
-
5
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
-
7
- var upath__default = /*#__PURE__*/_interopDefault(upath);
8
-
9
- var __defProp = Object.defineProperty;
10
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
11
- function hasBasename(tsFilepath, basenames) {
12
- return [
13
- basenames
14
- ].flat(2).includes(upath__default.default.basename(tsFilepath));
15
- }
16
- __name(hasBasename, "hasBasename");
17
-
18
- exports.hasBasename = hasBasename;
@@ -1,8 +0,0 @@
1
- import { A as Arrayable } from '../arrayable.d-1twOP8Y1.cjs';
2
-
3
- /**
4
- * Checks if a file path has any of the specified basenames.
5
- */
6
- declare function hasBasename(tsFilepath: string, basenames: Arrayable<string>): boolean;
7
-
8
- export { hasBasename };
@@ -1,8 +0,0 @@
1
- import { A as Arrayable } from '../arrayable.d-1twOP8Y1.js';
2
-
3
- /**
4
- * Checks if a file path has any of the specified basenames.
5
- */
6
- declare function hasBasename(tsFilepath: string, basenames: Arrayable<string>): boolean;
7
-
8
- export { hasBasename };
@@ -1,12 +0,0 @@
1
- import upath from 'upath';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function hasBasename(tsFilepath, basenames) {
6
- return [
7
- basenames
8
- ].flat(2).includes(upath.basename(tsFilepath));
9
- }
10
- __name(hasBasename, "hasBasename");
11
-
12
- export { hasBasename };
@@ -1,60 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
-
6
- // ../fn/src/setNameAndLength.ts
7
- function setNameAndLength(source, target, lengthDelta = 0) {
8
- return Object.defineProperties(target, {
9
- name: {
10
- configurable: true,
11
- value: source.name
12
- },
13
- length: {
14
- configurable: true,
15
- value: source.length + lengthDelta
16
- }
17
- });
18
- }
19
- __name(setNameAndLength, "setNameAndLength");
20
-
21
- // ../fn/src/bindArg.ts
22
- function bindArg(fn, boundArgIndex, boundArgValue) {
23
- return setNameAndLength(fn, (...args) => {
24
- return fn(...args.slice(0, boundArgIndex), boundArgValue, ...args.slice(boundArgIndex));
25
- }, -1);
26
- }
27
- __name(bindArg, "bindArg");
28
-
29
- // src/lib/hasExtname.ts
30
- function hasExtname(tsFilepath, extnames) {
31
- return new RegExp(`[.](${[
32
- extnames
33
- ].flat(2).join("|")})$`).test(tsFilepath);
34
- }
35
- __name(hasExtname, "hasExtname");
36
- hasExtname.js = bindArg(hasExtname, 1, [
37
- "js",
38
- "mjs",
39
- "jsx",
40
- "cjs"
41
- ]);
42
- hasExtname.json = bindArg(hasExtname, 1, [
43
- "json",
44
- "jsonc"
45
- ]);
46
- hasExtname.yaml = bindArg(hasExtname, 1, [
47
- "yaml",
48
- "yml"
49
- ]);
50
- hasExtname.markdown = bindArg(hasExtname, 1, [
51
- "md",
52
- "markdown"
53
- ]);
54
- hasExtname.ts = bindArg(hasExtname, 1, [
55
- "ts",
56
- "mts",
57
- "tsx"
58
- ]);
59
-
60
- exports.hasExtname = hasExtname;
@@ -1,15 +0,0 @@
1
- import { A as Arrayable } from '../arrayable.d-1twOP8Y1.cjs';
2
-
3
- /**
4
- * Checks if a file path has any of the specified file extensions.
5
- */
6
- declare function hasExtname(tsFilepath: string, extnames: Arrayable<string>): boolean;
7
- declare namespace hasExtname {
8
- var js: (tsFilepath: string) => boolean;
9
- var json: (tsFilepath: string) => boolean;
10
- var yaml: (tsFilepath: string) => boolean;
11
- var markdown: (tsFilepath: string) => boolean;
12
- var ts: (tsFilepath: string) => boolean;
13
- }
14
-
15
- export { hasExtname };
@@ -1,15 +0,0 @@
1
- import { A as Arrayable } from '../arrayable.d-1twOP8Y1.js';
2
-
3
- /**
4
- * Checks if a file path has any of the specified file extensions.
5
- */
6
- declare function hasExtname(tsFilepath: string, extnames: Arrayable<string>): boolean;
7
- declare namespace hasExtname {
8
- var js: (tsFilepath: string) => boolean;
9
- var json: (tsFilepath: string) => boolean;
10
- var yaml: (tsFilepath: string) => boolean;
11
- var markdown: (tsFilepath: string) => boolean;
12
- var ts: (tsFilepath: string) => boolean;
13
- }
14
-
15
- export { hasExtname };
@@ -1,58 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // ../fn/src/setNameAndLength.ts
5
- function setNameAndLength(source, target, lengthDelta = 0) {
6
- return Object.defineProperties(target, {
7
- name: {
8
- configurable: true,
9
- value: source.name
10
- },
11
- length: {
12
- configurable: true,
13
- value: source.length + lengthDelta
14
- }
15
- });
16
- }
17
- __name(setNameAndLength, "setNameAndLength");
18
-
19
- // ../fn/src/bindArg.ts
20
- function bindArg(fn, boundArgIndex, boundArgValue) {
21
- return setNameAndLength(fn, (...args) => {
22
- return fn(...args.slice(0, boundArgIndex), boundArgValue, ...args.slice(boundArgIndex));
23
- }, -1);
24
- }
25
- __name(bindArg, "bindArg");
26
-
27
- // src/lib/hasExtname.ts
28
- function hasExtname(tsFilepath, extnames) {
29
- return new RegExp(`[.](${[
30
- extnames
31
- ].flat(2).join("|")})$`).test(tsFilepath);
32
- }
33
- __name(hasExtname, "hasExtname");
34
- hasExtname.js = bindArg(hasExtname, 1, [
35
- "js",
36
- "mjs",
37
- "jsx",
38
- "cjs"
39
- ]);
40
- hasExtname.json = bindArg(hasExtname, 1, [
41
- "json",
42
- "jsonc"
43
- ]);
44
- hasExtname.yaml = bindArg(hasExtname, 1, [
45
- "yaml",
46
- "yml"
47
- ]);
48
- hasExtname.markdown = bindArg(hasExtname, 1, [
49
- "md",
50
- "markdown"
51
- ]);
52
- hasExtname.ts = bindArg(hasExtname, 1, [
53
- "ts",
54
- "mts",
55
- "tsx"
56
- ]);
57
-
58
- export { hasExtname };