@visulima/fs 2.1.17 → 2.2.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/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## @visulima/fs [2.2.0](https://github.com/visulima/visulima/compare/@visulima/fs@2.1.18...@visulima/fs@2.2.0) (2024-09-29)
2
+
3
+ ### Features
4
+
5
+ * **fs:** added allowSymlinks to findUp and findUpSync ([1ef8c03](https://github.com/visulima/visulima/commit/1ef8c039e4e7b054177d25f74b98b56d79f2d27b))
6
+
7
+ ## @visulima/fs [2.1.18](https://github.com/visulima/visulima/compare/@visulima/fs@2.1.17...@visulima/fs@2.1.18) (2024-09-24)
8
+
9
+ ### Bug Fixes
10
+
11
+ * update packem to v1 ([05f3bc9](https://github.com/visulima/visulima/commit/05f3bc960df10a1602e24f9066e2b0117951a877))
12
+ * updated esbuild from v0.23 to v0.24 ([3793010](https://github.com/visulima/visulima/commit/3793010d0d549c0d41f85dea04b8436251be5fe8))
13
+
14
+ ### Miscellaneous Chores
15
+
16
+ * updated dev dependencies ([05edb67](https://github.com/visulima/visulima/commit/05edb671285b1cc42875223314b24212e6a12588))
17
+
18
+
19
+ ### Dependencies
20
+
21
+ * **@visulima/path:** upgraded to 1.0.9
22
+ * **@visulima/error:** upgraded to 4.4.5
23
+
1
24
  ## @visulima/fs [2.1.17](https://github.com/visulima/visulima/compare/@visulima/fs@2.1.16...@visulima/fs@2.1.17) (2024-09-11)
2
25
 
3
26
  ### Bug Fixes
package/LICENSE.md CHANGED
@@ -23,14 +23,17 @@ SOFTWARE.
23
23
  <!-- DEPENDENCIES -->
24
24
 
25
25
  # Licenses of bundled dependencies
26
+
26
27
  The published @visulima/fs artifact additionally contains code with the following licenses:
27
28
  MIT
28
29
 
29
30
  # Bundled dependencies:
31
+
30
32
  ## @visulima/error
33
+
31
34
  License: MIT
32
35
  By: Daniel Bannert
33
- Repository: git+https://github.com/visulima/visulima.git
36
+ Repository: https://github.com/visulima/visulima.git
34
37
 
35
38
  > MIT License
36
39
  >
@@ -54,14 +57,15 @@ Repository: git+https://github.com/visulima/visulima.git
54
57
  > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
55
58
  > SOFTWARE.
56
59
  >
57
- >
58
- >
59
60
  > # Licenses of bundled dependencies
61
+ >
60
62
  > The published @visulima/error artifact additionally contains code with the following licenses:
61
63
  > MIT
62
64
  >
63
65
  > # Bundled dependencies:
66
+ >
64
67
  > ## is-plain-obj
68
+ >
65
69
  > License: MIT
66
70
  > By: Sindre Sorhus
67
71
  > Repository: sindresorhus/is-plain-obj
@@ -76,9 +80,10 @@ Repository: git+https://github.com/visulima/visulima.git
76
80
  > >
77
81
  > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
78
82
 
79
- ---------------------------------------
83
+ ---
80
84
 
81
85
  ## detect-indent
86
+
82
87
  License: MIT
83
88
  By: Sindre Sorhus
84
89
  Repository: sindresorhus/detect-indent
@@ -121,14 +126,17 @@ Repository: sindresorhus/detect-indent
121
126
  > <!-- DEPENDENCIES -->
122
127
 
123
128
  # Licenses of bundled dependencies
129
+
124
130
  The published @visulima/fs artifact additionally contains code with the following licenses:
125
131
  MIT
126
132
 
127
133
  # Bundled dependencies:
134
+
128
135
  ## @visulima/error
136
+
129
137
  License: MIT
130
138
  By: Daniel Bannert
131
- Repository: git+https://github.com/visulima/visulima.git
139
+ Repository: https://github.com/visulima/visulima.git
132
140
 
133
141
  > MIT License
134
142
  >
@@ -152,14 +160,15 @@ Repository: git+https://github.com/visulima/visulima.git
152
160
  > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
153
161
  > SOFTWARE.
154
162
  >
155
- >
156
- >
157
163
  > # Licenses of bundled dependencies
164
+ >
158
165
  > The published @visulima/error artifact additionally contains code with the following licenses:
159
166
  > MIT
160
167
  >
161
168
  > # Bundled dependencies:
169
+ >
162
170
  > ## is-plain-obj
171
+ >
163
172
  > License: MIT
164
173
  > By: Sindre Sorhus
165
174
  > Repository: sindresorhus/is-plain-obj
@@ -174,9 +183,10 @@ Repository: git+https://github.com/visulima/visulima.git
174
183
  > >
175
184
  > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
176
185
 
177
- ---------------------------------------
186
+ ---
178
187
 
179
188
  ## detect-indent
189
+
180
190
  License: MIT
181
191
  By: Sindre Sorhus
182
192
  Repository: sindresorhus/detect-indent
@@ -219,14 +229,17 @@ Repository: sindresorhus/detect-indent
219
229
  > <!-- DEPENDENCIES -->
220
230
 
221
231
  # Licenses of bundled dependencies
232
+
222
233
  The published @visulima/fs artifact additionally contains code with the following licenses:
223
234
  MIT
224
235
 
225
236
  # Bundled dependencies:
237
+
226
238
  ## @visulima/error
239
+
227
240
  License: MIT
228
241
  By: Daniel Bannert
229
- Repository: git+https://github.com/visulima/visulima.git
242
+ Repository: https://github.com/visulima/visulima.git
230
243
 
231
244
  > MIT License
232
245
  >
@@ -250,14 +263,15 @@ Repository: git+https://github.com/visulima/visulima.git
250
263
  > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
251
264
  > SOFTWARE.
252
265
  >
253
- >
254
- >
255
266
  > # Licenses of bundled dependencies
267
+ >
256
268
  > The published @visulima/error artifact additionally contains code with the following licenses:
257
269
  > MIT
258
270
  >
259
271
  > # Bundled dependencies:
272
+ >
260
273
  > ## is-plain-obj
274
+ >
261
275
  > License: MIT
262
276
  > By: Sindre Sorhus
263
277
  > Repository: sindresorhus/is-plain-obj
@@ -272,9 +286,10 @@ Repository: git+https://github.com/visulima/visulima.git
272
286
  > >
273
287
  > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
274
288
 
275
- ---------------------------------------
289
+ ---
276
290
 
277
291
  ## detect-indent
292
+
278
293
  License: MIT
279
294
  By: Sindre Sorhus
280
295
  Repository: sindresorhus/detect-indent
@@ -317,14 +332,17 @@ Repository: sindresorhus/detect-indent
317
332
  > <!-- DEPENDENCIES -->
318
333
 
319
334
  # Licenses of bundled dependencies
335
+
320
336
  The published @visulima/fs artifact additionally contains code with the following licenses:
321
337
  MIT
322
338
 
323
339
  # Bundled dependencies:
340
+
324
341
  ## @visulima/error
342
+
325
343
  License: MIT
326
344
  By: Daniel Bannert
327
- Repository: git+https://github.com/visulima/visulima.git
345
+ Repository: https://github.com/visulima/visulima.git
328
346
 
329
347
  > MIT License
330
348
  >
@@ -348,14 +366,15 @@ Repository: git+https://github.com/visulima/visulima.git
348
366
  > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
349
367
  > SOFTWARE.
350
368
  >
351
- >
352
- >
353
369
  > # Licenses of bundled dependencies
370
+ >
354
371
  > The published @visulima/error artifact additionally contains code with the following licenses:
355
372
  > MIT
356
373
  >
357
374
  > # Bundled dependencies:
375
+ >
358
376
  > ## is-plain-obj
377
+ >
359
378
  > License: MIT
360
379
  > By: Sindre Sorhus
361
380
  > Repository: sindresorhus/is-plain-obj
@@ -370,9 +389,10 @@ Repository: git+https://github.com/visulima/visulima.git
370
389
  > >
371
390
  > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
372
391
 
373
- ---------------------------------------
392
+ ---
374
393
 
375
394
  ## detect-indent
395
+
376
396
  License: MIT
377
397
  By: Sindre Sorhus
378
398
  Repository: sindresorhus/detect-indent
@@ -392,11 +412,14 @@ Repository: sindresorhus/detect-indent
392
412
  <!-- TYPE_DEPENDENCIES -->
393
413
 
394
414
  # Licenses of bundled types
415
+
395
416
  The published @visulima/fs artifact additionally contains code with the following licenses:
396
417
  (MIT OR CC0-1.0)
397
418
 
398
419
  # Bundled types:
420
+
399
421
  ## type-fest
422
+
400
423
  License: (MIT OR CC0-1.0)
401
424
  By: Sindre Sorhus
402
425
  Repository: sindresorhus/type-fest
package/README.md CHANGED
@@ -191,7 +191,8 @@ console.log(file);
191
191
 
192
192
  #### name
193
193
 
194
- Type: `string | string[] | (dir: string) => string | symbole | undefined`
194
+ Type: `string[] | string | ((directory: PathLike) => PathLike | Promise<PathLike | typeof FIND_UP_STOP> | typeof FIND_UP_STOP)` \
195
+ Sync Type: `string[] | string | ((directory: PathLike) => PathLike | typeof FIND_UP_STOP)`
195
196
 
196
197
  The name of the file or directory to find.
197
198
 
@@ -227,6 +228,13 @@ Default: Root directory
227
228
 
228
229
  A directory path where the search halts if no matches are found before reaching this point.
229
230
 
231
+ ##### allowSymlinks
232
+
233
+ Type: `boolean`\
234
+ Default: `true`
235
+
236
+ Allow symbolic links to match if they point to the target file or directory.
237
+
230
238
  ## readFile
231
239
 
232
240
  Read a file.
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./packem_shared/F_OK-B8R_JA-Q.cjs"),n=require("./packem_shared/ensureDir-DVHj-_yp.cjs"),i=require("./packem_shared/ensureDirSync-CvjJ3bGq.cjs"),c=require("./packem_shared/ensureFile-CcJ5XIZm.cjs"),s=require("./packem_shared/ensureFileSync-v-PhMLTr.cjs"),t=require("./packem_shared/ensureLink-C-v4AxzH.cjs"),o=require("./packem_shared/ensureLinkSync-C4S-zdVb.cjs"),u=require("./packem_shared/ensureSymlink-C5cy9585.cjs"),l=require("./packem_shared/ensureSymlinkSync-YDRbg9hX.cjs"),r=require("./packem_shared/LF-D4BqIfQm.cjs"),y=require("./packem_shared/collect-4au76gDu.cjs"),S=require("./packem_shared/collectSync-CbKwt8rz.cjs"),q=require("./packem_shared/findUp-DTU501Mn.cjs"),a=require("./packem_shared/findUpSync-C1w6Z_6P.cjs"),m=require("./packem_shared/walk-BJgnJy5d.cjs"),F=require("./packem_shared/walkSync-DYawhxUA.cjs"),d=require("./packem_shared/isAccessible-C58XjRjT.cjs"),w=require("./packem_shared/isAccessibleSync-9njSth1z.cjs"),O=require("./packem_shared/readFile-DIQKBQ0d.cjs"),_=require("./packem_shared/readFileSync-CTVwduD2.cjs"),k=require("./packem_shared/readJson-Cf5QS1cQ.cjs"),L=require("./packem_shared/readJsonSync-Dzu0ErIN.cjs"),D=require("./packem_shared/readYaml-D4PbAXZD.cjs"),p=require("./packem_shared/readYamlSync-Bnyr8iGt.cjs"),K=require("./packem_shared/emptyDir-DKxQHQQb.cjs"),J=require("./packem_shared/emptyDirSync-CLM_zyIb.cjs"),Y=require("./packem_shared/remove-B-9MI2l5.cjs"),f=require("./packem_shared/removeSync-CJPR6M7V.cjs"),b=require("./packem_shared/writeFile-z1NYn8jk.cjs"),U=require("./packem_shared/writeFileSync-rAuaAA6w.cjs"),v=require("./packem_shared/writeJson-BW5_Vr5i.cjs"),P=require("./packem_shared/writeJsonSync-BkoMtNUG.cjs"),A=require("./packem_shared/writeYaml-BO_bcnqK.cjs"),R=require("./packem_shared/writeYamlSync-DozAaY0A.cjs");exports.FIND_UP_STOP=e.FIND_UP_STOP;exports.F_OK=e.F_OK;exports.R_OK=e.R_OK;exports.W_OK=e.W_OK;exports.X_OK=e.X_OK;exports.ensureDir=n;exports.ensureDirSync=i;exports.ensureFile=c;exports.ensureFileSync=s;exports.ensureLink=t;exports.ensureLinkSync=o;exports.ensureSymlink=u;exports.ensureSymlinkSync=l;exports.CRLF=r.CRLF;exports.EOL=r.EOL;exports.LF=r.LF;exports.detect=r.detect;exports.format=r.format;exports.collect=y;exports.collectSync=S;exports.findUp=q;exports.findUpSync=a;exports.walk=m;exports.walkSync=F;exports.isAccessible=d;exports.isAccessibleSync=w;exports.readFile=O;exports.readFileSync=_;exports.readJson=k;exports.readJsonSync=L;exports.readYaml=D;exports.readYamlSync=p;exports.emptyDir=K;exports.emptyDirSync=J;exports.remove=Y;exports.removeSync=f;exports.writeFile=b;exports.writeFileSync=U;exports.writeJson=v;exports.writeJsonSync=P;exports.writeYaml=A;exports.writeYamlSync=R;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./packem_shared/F_OK-B8R_JA-Q.cjs"),n=require("./packem_shared/ensureDir-DVHj-_yp.cjs"),i=require("./packem_shared/ensureDirSync-CvjJ3bGq.cjs"),c=require("./packem_shared/ensureFile-CcJ5XIZm.cjs"),s=require("./packem_shared/ensureFileSync-v-PhMLTr.cjs"),t=require("./packem_shared/ensureLink-C-v4AxzH.cjs"),o=require("./packem_shared/ensureLinkSync-C4S-zdVb.cjs"),u=require("./packem_shared/ensureSymlink-C5cy9585.cjs"),l=require("./packem_shared/ensureSymlinkSync-YDRbg9hX.cjs"),r=require("./packem_shared/LF-D4BqIfQm.cjs"),y=require("./packem_shared/collect-4au76gDu.cjs"),S=require("./packem_shared/collectSync-CbKwt8rz.cjs"),q=require("./packem_shared/findUp-DWKie4QO.cjs"),a=require("./packem_shared/findUpSync-Y1Jpw0nr.cjs"),m=require("./packem_shared/walk-BJgnJy5d.cjs"),F=require("./packem_shared/walkSync-DYawhxUA.cjs"),d=require("./packem_shared/isAccessible-C58XjRjT.cjs"),w=require("./packem_shared/isAccessibleSync-9njSth1z.cjs"),O=require("./packem_shared/readFile-DIQKBQ0d.cjs"),_=require("./packem_shared/readFileSync-CTVwduD2.cjs"),k=require("./packem_shared/readJson-Cf5QS1cQ.cjs"),L=require("./packem_shared/readJsonSync-Dzu0ErIN.cjs"),D=require("./packem_shared/readYaml-D4PbAXZD.cjs"),p=require("./packem_shared/readYamlSync-Bnyr8iGt.cjs"),K=require("./packem_shared/emptyDir-DKxQHQQb.cjs"),J=require("./packem_shared/emptyDirSync-CLM_zyIb.cjs"),Y=require("./packem_shared/remove-B-9MI2l5.cjs"),f=require("./packem_shared/removeSync-CJPR6M7V.cjs"),b=require("./packem_shared/writeFile-z1NYn8jk.cjs"),U=require("./packem_shared/writeFileSync-rAuaAA6w.cjs"),v=require("./packem_shared/writeJson-BW5_Vr5i.cjs"),P=require("./packem_shared/writeJsonSync-BkoMtNUG.cjs"),A=require("./packem_shared/writeYaml-BO_bcnqK.cjs"),R=require("./packem_shared/writeYamlSync-DozAaY0A.cjs");exports.FIND_UP_STOP=e.FIND_UP_STOP;exports.F_OK=e.F_OK;exports.R_OK=e.R_OK;exports.W_OK=e.W_OK;exports.X_OK=e.X_OK;exports.ensureDir=n;exports.ensureDirSync=i;exports.ensureFile=c;exports.ensureFileSync=s;exports.ensureLink=t;exports.ensureLinkSync=o;exports.ensureSymlink=u;exports.ensureSymlinkSync=l;exports.CRLF=r.CRLF;exports.EOL=r.EOL;exports.LF=r.LF;exports.detect=r.detect;exports.format=r.format;exports.collect=y;exports.collectSync=S;exports.findUp=q;exports.findUpSync=a;exports.walk=m;exports.walkSync=F;exports.isAccessible=d;exports.isAccessibleSync=w;exports.readFile=O;exports.readFileSync=_;exports.readJson=k;exports.readJsonSync=L;exports.readYaml=D;exports.readYamlSync=p;exports.emptyDir=K;exports.emptyDirSync=J;exports.remove=Y;exports.removeSync=f;exports.writeFile=b;exports.writeFileSync=U;exports.writeJson=v;exports.writeJsonSync=P;exports.writeYaml=A;exports.writeYamlSync=R;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { W as WalkOptions, M as Match, F as FindUpOptions, a as WalkEntry, R as ReadFileOptions, C as ContentType, J as JsonValue, b as ReadJsonOptions, c as JsonReviver, d as ReadYamlOptions, Y as YamlReviver, E as EmptyDirOptions, e as WriteFileOptions, f as WriteJsonOptions, g as YamlReplacer } from './packem_shared/observable-like.d-CpT5ICZl.cjs';
2
- export { l as CodeFrameLocation, i as FIND_UP_STOP, h as F_OK, m as JsonReplacer, j as R_OK, n as ReadFileEncoding, k as W_OK, X as X_OK } from './packem_shared/observable-like.d-CpT5ICZl.cjs';
1
+ import { W as WalkOptions, F as FindUpName, a as FindUpOptions, b as FindUpNameSync, c as WalkEntry, R as ReadFileOptions, C as ContentType, J as JsonValue, d as ReadJsonOptions, e as JsonReviver, f as ReadYamlOptions, Y as YamlReviver, E as EmptyDirOptions, g as WriteFileOptions, h as WriteJsonOptions, i as YamlReplacer } from './packem_shared/observable-like.d-BIpsmTbZ.cjs';
2
+ export { n as CodeFrameLocation, k as FIND_UP_STOP, j as F_OK, o as JsonReplacer, l as R_OK, p as ReadFileEncoding, m as W_OK, X as X_OK } from './packem_shared/observable-like.d-BIpsmTbZ.cjs';
3
3
  import { symlink } from 'node:fs';
4
4
  import { CreateNodeOptions, DocumentOptions, ParseOptions, SchemaOptions, ToStringOptions } from 'yaml';
5
5
 
@@ -29,9 +29,9 @@ declare const collect: (directory: string, options?: WalkOptions) => Promise<str
29
29
 
30
30
  declare const collectSync: (directory: string, options?: WalkOptions) => string[];
31
31
 
32
- declare const findUp: (name: ReadonlyArray<string> | string[] | string | ((directory: string) => Match | Promise<Match>), options?: FindUpOptions) => Promise<string | undefined>;
32
+ declare const findUp: (name: FindUpName, options?: FindUpOptions) => Promise<string | undefined>;
33
33
 
34
- declare const findUpSync: (name: ReadonlyArray<string> | string[] | string | ((directory: string) => Match), options?: FindUpOptions) => string | undefined;
34
+ declare const findUpSync: (name: FindUpNameSync, options?: FindUpOptions) => string | undefined;
35
35
 
36
36
  declare function walk(directory: URL | string, { extensions, followSymlinks, includeDirs: includeDirectories, includeFiles, includeSymlinks, match, maxDepth, skip, }?: WalkOptions): AsyncIterableIterator<WalkEntry>;
37
37
 
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { W as WalkOptions, M as Match, F as FindUpOptions, a as WalkEntry, R as ReadFileOptions, C as ContentType, J as JsonValue, b as ReadJsonOptions, c as JsonReviver, d as ReadYamlOptions, Y as YamlReviver, E as EmptyDirOptions, e as WriteFileOptions, f as WriteJsonOptions, g as YamlReplacer } from './packem_shared/observable-like.d-CpT5ICZl.mjs';
2
- export { l as CodeFrameLocation, i as FIND_UP_STOP, h as F_OK, m as JsonReplacer, j as R_OK, n as ReadFileEncoding, k as W_OK, X as X_OK } from './packem_shared/observable-like.d-CpT5ICZl.mjs';
1
+ import { W as WalkOptions, F as FindUpName, a as FindUpOptions, b as FindUpNameSync, c as WalkEntry, R as ReadFileOptions, C as ContentType, J as JsonValue, d as ReadJsonOptions, e as JsonReviver, f as ReadYamlOptions, Y as YamlReviver, E as EmptyDirOptions, g as WriteFileOptions, h as WriteJsonOptions, i as YamlReplacer } from './packem_shared/observable-like.d-BIpsmTbZ.mjs';
2
+ export { n as CodeFrameLocation, k as FIND_UP_STOP, j as F_OK, o as JsonReplacer, l as R_OK, p as ReadFileEncoding, m as W_OK, X as X_OK } from './packem_shared/observable-like.d-BIpsmTbZ.mjs';
3
3
  import { symlink } from 'node:fs';
4
4
  import { CreateNodeOptions, DocumentOptions, ParseOptions, SchemaOptions, ToStringOptions } from 'yaml';
5
5
 
@@ -29,9 +29,9 @@ declare const collect: (directory: string, options?: WalkOptions) => Promise<str
29
29
 
30
30
  declare const collectSync: (directory: string, options?: WalkOptions) => string[];
31
31
 
32
- declare const findUp: (name: ReadonlyArray<string> | string[] | string | ((directory: string) => Match | Promise<Match>), options?: FindUpOptions) => Promise<string | undefined>;
32
+ declare const findUp: (name: FindUpName, options?: FindUpOptions) => Promise<string | undefined>;
33
33
 
34
- declare const findUpSync: (name: ReadonlyArray<string> | string[] | string | ((directory: string) => Match), options?: FindUpOptions) => string | undefined;
34
+ declare const findUpSync: (name: FindUpNameSync, options?: FindUpOptions) => string | undefined;
35
35
 
36
36
  declare function walk(directory: URL | string, { extensions, followSymlinks, includeDirs: includeDirectories, includeFiles, includeSymlinks, match, maxDepth, skip, }?: WalkOptions): AsyncIterableIterator<WalkEntry>;
37
37
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { W as WalkOptions, M as Match, F as FindUpOptions, a as WalkEntry, R as ReadFileOptions, C as ContentType, J as JsonValue, b as ReadJsonOptions, c as JsonReviver, d as ReadYamlOptions, Y as YamlReviver, E as EmptyDirOptions, e as WriteFileOptions, f as WriteJsonOptions, g as YamlReplacer } from './packem_shared/observable-like.d-CpT5ICZl.d.mjs';
2
- export { l as CodeFrameLocation, i as FIND_UP_STOP, h as F_OK, m as JsonReplacer, j as R_OK, n as ReadFileEncoding, k as W_OK, X as X_OK } from './packem_shared/observable-like.d-CpT5ICZl.d.mjs';
1
+ import { W as WalkOptions, F as FindUpName, a as FindUpOptions, b as FindUpNameSync, c as WalkEntry, R as ReadFileOptions, C as ContentType, J as JsonValue, d as ReadJsonOptions, e as JsonReviver, f as ReadYamlOptions, Y as YamlReviver, E as EmptyDirOptions, g as WriteFileOptions, h as WriteJsonOptions, i as YamlReplacer } from './packem_shared/observable-like.d-BIpsmTbZ.d.mjs';
2
+ export { n as CodeFrameLocation, k as FIND_UP_STOP, j as F_OK, o as JsonReplacer, l as R_OK, p as ReadFileEncoding, m as W_OK, X as X_OK } from './packem_shared/observable-like.d-BIpsmTbZ.d.mjs';
3
3
  import { symlink } from 'node:fs';
4
4
  import { CreateNodeOptions, DocumentOptions, ParseOptions, SchemaOptions, ToStringOptions } from 'yaml';
5
5
 
@@ -29,9 +29,9 @@ declare const collect: (directory: string, options?: WalkOptions) => Promise<str
29
29
 
30
30
  declare const collectSync: (directory: string, options?: WalkOptions) => string[];
31
31
 
32
- declare const findUp: (name: ReadonlyArray<string> | string[] | string | ((directory: string) => Match | Promise<Match>), options?: FindUpOptions) => Promise<string | undefined>;
32
+ declare const findUp: (name: FindUpName, options?: FindUpOptions) => Promise<string | undefined>;
33
33
 
34
- declare const findUpSync: (name: ReadonlyArray<string> | string[] | string | ((directory: string) => Match), options?: FindUpOptions) => string | undefined;
34
+ declare const findUpSync: (name: FindUpNameSync, options?: FindUpOptions) => string | undefined;
35
35
 
36
36
  declare function walk(directory: URL | string, { extensions, followSymlinks, includeDirs: includeDirectories, includeFiles, includeSymlinks, match, maxDepth, skip, }?: WalkOptions): AsyncIterableIterator<WalkEntry>;
37
37
 
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{FIND_UP_STOP as t,F_OK as a,R_OK as o,W_OK as f,X_OK as l}from"./packem_shared/F_OK-CiLqIeYK.mjs";import{default as m}from"./packem_shared/ensureDir-BtvxsJiS.mjs";import{default as u}from"./packem_shared/ensureDirSync-bGe0QB7d.mjs";import{default as n}from"./packem_shared/ensureFile-C46R6-4l.mjs";import{default as i}from"./packem_shared/ensureFileSync-CwYTIP4G.mjs";import{default as y}from"./packem_shared/ensureLink-63XWiA3I.mjs";import{default as F}from"./packem_shared/ensureLinkSync-D2LVObKd.mjs";import{default as k}from"./packem_shared/ensureSymlink-D36fS4KE.mjs";import{default as _}from"./packem_shared/ensureSymlinkSync-PvWVgeXc.mjs";import{CRLF as L,EOL as J,LF as K,detect as Y,format as U}from"./packem_shared/LF-Dbx0i6a7.mjs";import{default as v}from"./packem_shared/collect-CRzGiRGg.mjs";import{default as P}from"./packem_shared/collectSync-BE8DAOke.mjs";import{default as C}from"./packem_shared/findUp-ik4TWAC2.mjs";import{default as I}from"./packem_shared/findUpSync-DO0R67zX.mjs";import{default as T}from"./packem_shared/walk-DH-95i_B.mjs";import{default as X}from"./packem_shared/walkSync-D4zvt_kM.mjs";import{default as h}from"./packem_shared/isAccessible-vmOjbVOF.mjs";import{default as q}from"./packem_shared/isAccessibleSync-BxoK0UkJ.mjs";import{default as B}from"./packem_shared/readFile-D6U3MP6g.mjs";import{default as H}from"./packem_shared/readFileSync-Bao-E5R8.mjs";import{default as Q}from"./packem_shared/readJson-fgrin-Wb.mjs";import{default as Z}from"./packem_shared/readJsonSync-D2_W7t7m.mjs";import{default as ee}from"./packem_shared/readYaml-BYMJDJU0.mjs";import{default as te}from"./packem_shared/readYamlSync-CdYj75zz.mjs";import{default as oe}from"./packem_shared/emptyDir-D2m8OP8u.mjs";import{default as le}from"./packem_shared/emptyDirSync-CZNcW4wc.mjs";import{default as me}from"./packem_shared/remove-DzfvbZOm.mjs";import{default as ue}from"./packem_shared/removeSync-D165rXSn.mjs";import{default as ne}from"./packem_shared/writeFile-DwkUvAF-.mjs";import{default as ie}from"./packem_shared/writeFileSync-DYhY33yC.mjs";import{default as ye}from"./packem_shared/writeJson-DI_vpDVy.mjs";import{default as Fe}from"./packem_shared/writeJsonSync-DLo6ZPEV.mjs";import{default as ke}from"./packem_shared/writeYaml-B4jtxffY.mjs";import{default as _e}from"./packem_shared/writeYamlSync-BG69YBbH.mjs";export{L as CRLF,J as EOL,t as FIND_UP_STOP,a as F_OK,K as LF,o as R_OK,f as W_OK,l as X_OK,v as collect,P as collectSync,Y as detect,oe as emptyDir,le as emptyDirSync,m as ensureDir,u as ensureDirSync,n as ensureFile,i as ensureFileSync,y as ensureLink,F as ensureLinkSync,k as ensureSymlink,_ as ensureSymlinkSync,C as findUp,I as findUpSync,U as format,h as isAccessible,q as isAccessibleSync,B as readFile,H as readFileSync,Q as readJson,Z as readJsonSync,ee as readYaml,te as readYamlSync,me as remove,ue as removeSync,T as walk,X as walkSync,ne as writeFile,ie as writeFileSync,ye as writeJson,Fe as writeJsonSync,ke as writeYaml,_e as writeYamlSync};
1
+ import{FIND_UP_STOP as t,F_OK as a,R_OK as o,W_OK as f,X_OK as l}from"./packem_shared/F_OK-CiLqIeYK.mjs";import{default as m}from"./packem_shared/ensureDir-BtvxsJiS.mjs";import{default as u}from"./packem_shared/ensureDirSync-bGe0QB7d.mjs";import{default as n}from"./packem_shared/ensureFile-C46R6-4l.mjs";import{default as i}from"./packem_shared/ensureFileSync-CwYTIP4G.mjs";import{default as y}from"./packem_shared/ensureLink-63XWiA3I.mjs";import{default as F}from"./packem_shared/ensureLinkSync-D2LVObKd.mjs";import{default as k}from"./packem_shared/ensureSymlink-D36fS4KE.mjs";import{default as _}from"./packem_shared/ensureSymlinkSync-PvWVgeXc.mjs";import{CRLF as L,EOL as J,LF as K,detect as Y,format as U}from"./packem_shared/LF-Dbx0i6a7.mjs";import{default as v}from"./packem_shared/collect-CRzGiRGg.mjs";import{default as P}from"./packem_shared/collectSync-BE8DAOke.mjs";import{default as C}from"./packem_shared/findUp-DuKqk_9D.mjs";import{default as I}from"./packem_shared/findUpSync-Cal_fll7.mjs";import{default as T}from"./packem_shared/walk-DH-95i_B.mjs";import{default as X}from"./packem_shared/walkSync-D4zvt_kM.mjs";import{default as h}from"./packem_shared/isAccessible-vmOjbVOF.mjs";import{default as q}from"./packem_shared/isAccessibleSync-BxoK0UkJ.mjs";import{default as B}from"./packem_shared/readFile-D6U3MP6g.mjs";import{default as H}from"./packem_shared/readFileSync-Bao-E5R8.mjs";import{default as Q}from"./packem_shared/readJson-fgrin-Wb.mjs";import{default as Z}from"./packem_shared/readJsonSync-D2_W7t7m.mjs";import{default as ee}from"./packem_shared/readYaml-BYMJDJU0.mjs";import{default as te}from"./packem_shared/readYamlSync-CdYj75zz.mjs";import{default as oe}from"./packem_shared/emptyDir-D2m8OP8u.mjs";import{default as le}from"./packem_shared/emptyDirSync-CZNcW4wc.mjs";import{default as me}from"./packem_shared/remove-DzfvbZOm.mjs";import{default as ue}from"./packem_shared/removeSync-D165rXSn.mjs";import{default as ne}from"./packem_shared/writeFile-DwkUvAF-.mjs";import{default as ie}from"./packem_shared/writeFileSync-DYhY33yC.mjs";import{default as ye}from"./packem_shared/writeJson-DI_vpDVy.mjs";import{default as Fe}from"./packem_shared/writeJsonSync-DLo6ZPEV.mjs";import{default as ke}from"./packem_shared/writeYaml-B4jtxffY.mjs";import{default as _e}from"./packem_shared/writeYamlSync-BG69YBbH.mjs";export{L as CRLF,J as EOL,t as FIND_UP_STOP,a as F_OK,K as LF,o as R_OK,f as W_OK,l as X_OK,v as collect,P as collectSync,Y as detect,oe as emptyDir,le as emptyDirSync,m as ensureDir,u as ensureDirSync,n as ensureFile,i as ensureFileSync,y as ensureLink,F as ensureLinkSync,k as ensureSymlink,_ as ensureSymlinkSync,C as findUp,I as findUpSync,U as format,h as isAccessible,q as isAccessibleSync,B as readFile,H as readFileSync,Q as readJson,Z as readJsonSync,ee as readYaml,te as readYamlSync,me as remove,ue as removeSync,T as walk,X as walkSync,ne as writeFile,ie as writeFileSync,ye as writeJson,Fe as writeJsonSync,ke as writeYaml,_e as writeYamlSync};
@@ -0,0 +1 @@
1
+ "use strict";var h=Object.defineProperty;var f=(t,r)=>h(t,"name",{value:r,configurable:!0});const l=require("node:fs/promises"),v=require("node:url"),s=require("@visulima/path"),u=require("@visulima/path/utils"),A=require("./F_OK-B8R_JA-Q.cjs");var P=Object.defineProperty,y=f((t,r)=>P(t,"name",{value:r,configurable:!0}),"s");const q=y(async(t,r={})=>{if(typeof t!="string"&&!Array.isArray(t)&&typeof t!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const p=r.cwd?u.toPath(r.cwd):process.cwd();let o=s.resolve(p);const{root:n}=s.parse(o),w=u.toPath(r.stopAt??n),d=s.resolve(o,w),i=r.type??"file",m=y(async function(e){return typeof t=="function"?[await t(e)]:typeof t=="string"?[t]:Array.isArray(t)?t:[t]},"getMatchers");r.allowSymlinks===void 0&&(r.allowSymlinks=!0);const g=r.allowSymlinks?l.stat:l.lstat;for(;o&&o!==d&&o!==n;){for await(let e of await m(o)){if(e===A.FIND_UP_STOP)return;if(e===void 0)continue;Buffer.isBuffer(e)?e=e.toString():e instanceof URL&&(e=v.fileURLToPath(e));const a=s.isAbsolute(e)?e:s.resolve(o,e);try{const c=await g(a);if(i==="file"&&c.isFile()||i==="directory"&&c.isDirectory())return a}catch{}}o=s.dirname(o)}},"findUp");module.exports=q;
@@ -0,0 +1 @@
1
+ var g=Object.defineProperty;var c=(t,r)=>g(t,"name",{value:r,configurable:!0});import{stat as h,lstat as v}from"node:fs/promises";import{fileURLToPath as A}from"node:url";import{resolve as i,parse as P,isAbsolute as S,dirname as b}from"@visulima/path";import{toPath as l}from"@visulima/path/utils";import{FIND_UP_STOP as k}from"./F_OK-CiLqIeYK.mjs";var T=Object.defineProperty,y=c((t,r)=>T(t,"name",{value:r,configurable:!0}),"s");const R=y(async(t,r={})=>{if(typeof t!="string"&&!Array.isArray(t)&&typeof t!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const m=r.cwd?l(r.cwd):process.cwd();let e=i(m);const{root:n}=P(e),p=l(r.stopAt??n),u=i(e,p),a=r.type??"file",w=y(async function(o){return typeof t=="function"?[await t(o)]:typeof t=="string"?[t]:Array.isArray(t)?t:[t]},"getMatchers");r.allowSymlinks===void 0&&(r.allowSymlinks=!0);const d=r.allowSymlinks?h:v;for(;e&&e!==u&&e!==n;){for await(let o of await w(e)){if(o===k)return;if(o===void 0)continue;Buffer.isBuffer(o)?o=o.toString():o instanceof URL&&(o=A(o));const s=S(o)?o:i(e,o);try{const f=await d(s);if(a==="file"&&f.isFile()||a==="directory"&&f.isDirectory())return s}catch{}}e=b(e)}},"findUp");export{R as default};
@@ -0,0 +1 @@
1
+ var w=Object.defineProperty;var a=(t,r)=>w(t,"name",{value:r,configurable:!0});import{statSync as S,lstatSync as h}from"node:fs";import{fileURLToPath as v}from"node:url";import{resolve as n,parse as A,isAbsolute as P,dirname as b}from"@visulima/path";import{toPath as l}from"@visulima/path/utils";import{FIND_UP_STOP as k}from"./F_OK-CiLqIeYK.mjs";var T=Object.defineProperty,y=a((t,r)=>T(t,"name",{value:r,configurable:!0}),"o");const R=y((t,r={})=>{if(typeof t!="string"&&!Array.isArray(t)&&typeof t!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const m=r.cwd?l(r.cwd):process.cwd();let e=n(m);const{root:i}=A(e),p=l(r.stopAt??i),u=n(e,p),f=r.type??"file",d=y(function(o){return typeof t=="function"?[t(o)]:typeof t=="string"?[t]:Array.isArray(t)?t:[t]},"getMatchers");r.allowSymlinks===void 0&&(r.allowSymlinks=!0);const g=r.allowSymlinks?S:h;for(;e&&e!==u&&e!==i;){for(let o of d(e)){if(o===k)return;if(o===void 0)continue;Buffer.isBuffer(o)?o=o.toString():o instanceof URL&&(o=v(o));const s=P(o)?o:n(e,o);try{const c=g(s);if(f==="file"&&c.isFile()||f==="directory"&&c.isDirectory())return s}catch{}}e=b(e)}},"findUpSync");export{R as default};
@@ -0,0 +1 @@
1
+ "use strict";var v=Object.defineProperty;var a=(t,o)=>v(t,"name",{value:o,configurable:!0});const l=require("node:fs"),w=require("node:url"),n=require("@visulima/path"),u=require("@visulima/path/utils"),S=require("./F_OK-B8R_JA-Q.cjs");var A=Object.defineProperty,y=a((t,o)=>A(t,"name",{value:o,configurable:!0}),"o");const P=y((t,o={})=>{if(typeof t!="string"&&!Array.isArray(t)&&typeof t!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const p=o.cwd?u.toPath(o.cwd):process.cwd();let r=n.resolve(p);const{root:s}=n.parse(r),d=u.toPath(o.stopAt??s),g=n.resolve(r,d),i=o.type??"file",m=y(function(e){return typeof t=="function"?[t(e)]:typeof t=="string"?[t]:Array.isArray(t)?t:[t]},"getMatchers");o.allowSymlinks===void 0&&(o.allowSymlinks=!0);const h=o.allowSymlinks?l.statSync:l.lstatSync;for(;r&&r!==g&&r!==s;){for(let e of m(r)){if(e===S.FIND_UP_STOP)return;if(e===void 0)continue;Buffer.isBuffer(e)?e=e.toString():e instanceof URL&&(e=w.fileURLToPath(e));const c=n.isAbsolute(e)?e:n.resolve(r,e);try{const f=h(c);if(i==="file"&&f.isFile()||i==="directory"&&f.isDirectory())return c}catch{}}r=n.dirname(r)}},"findUpSync");module.exports=P;
@@ -1,4 +1,4 @@
1
- import { Dirent } from 'node:fs';
1
+ import { Dirent, PathLike } from 'node:fs';
2
2
  import { DocumentOptions, ParseOptions, SchemaOptions, ToJSOptions } from 'yaml';
3
3
 
4
4
  declare const F_OK = 0;
@@ -66,11 +66,13 @@ type WriteJsonOptions = WriteFileOptions & {
66
66
  stringify?: (data: unknown, replacer: JsonReplacer, space: number | string | undefined) => string;
67
67
  };
68
68
  type FindUpOptions = {
69
+ allowSymlinks?: boolean;
69
70
  cwd?: URL | string;
70
71
  stopAt?: URL | string;
71
72
  type?: "directory" | "file";
72
73
  };
73
- type Match = string | typeof FIND_UP_STOP | undefined;
74
+ type FindUpName = string[] | string | ((directory: PathLike) => PathLike | Promise<PathLike | typeof FIND_UP_STOP> | typeof FIND_UP_STOP);
75
+ type FindUpNameSync = string[] | string | ((directory: PathLike) => PathLike | typeof FIND_UP_STOP);
74
76
  type EmptyDirOptions = {
75
77
  maxRetries?: number | undefined;
76
78
  retryDelay?: number | undefined;
@@ -117,4 +119,4 @@ declare global {
117
119
  }
118
120
  }
119
121
 
120
- export { type ContentType as C, type EmptyDirOptions as E, type FindUpOptions as F, type JsonValue as J, type Match as M, type ReadFileOptions as R, type WalkOptions as W, X_OK as X, type YamlReviver as Y, type WalkEntry as a, type ReadJsonOptions as b, type JsonReviver as c, type ReadYamlOptions as d, type WriteFileOptions as e, type WriteJsonOptions as f, type YamlReplacer as g, F_OK as h, FIND_UP_STOP as i, R_OK as j, W_OK as k, type CodeFrameLocation as l, type JsonReplacer as m, type ReadFileEncoding as n, type CodeFrameOptions as o };
122
+ export { type ContentType as C, type EmptyDirOptions as E, type FindUpName as F, type JsonValue as J, type ReadFileOptions as R, type WalkOptions as W, X_OK as X, type YamlReviver as Y, type FindUpOptions as a, type FindUpNameSync as b, type WalkEntry as c, type ReadJsonOptions as d, type JsonReviver as e, type ReadYamlOptions as f, type WriteFileOptions as g, type WriteJsonOptions as h, type YamlReplacer as i, F_OK as j, FIND_UP_STOP as k, R_OK as l, W_OK as m, type CodeFrameLocation as n, type JsonReplacer as o, type ReadFileEncoding as p, type CodeFrameOptions as q };
@@ -1,4 +1,4 @@
1
- import { Dirent } from 'node:fs';
1
+ import { Dirent, PathLike } from 'node:fs';
2
2
  import { DocumentOptions, ParseOptions, SchemaOptions, ToJSOptions } from 'yaml';
3
3
 
4
4
  declare const F_OK = 0;
@@ -66,11 +66,13 @@ type WriteJsonOptions = WriteFileOptions & {
66
66
  stringify?: (data: unknown, replacer: JsonReplacer, space: number | string | undefined) => string;
67
67
  };
68
68
  type FindUpOptions = {
69
+ allowSymlinks?: boolean;
69
70
  cwd?: URL | string;
70
71
  stopAt?: URL | string;
71
72
  type?: "directory" | "file";
72
73
  };
73
- type Match = string | typeof FIND_UP_STOP | undefined;
74
+ type FindUpName = string[] | string | ((directory: PathLike) => PathLike | Promise<PathLike | typeof FIND_UP_STOP> | typeof FIND_UP_STOP);
75
+ type FindUpNameSync = string[] | string | ((directory: PathLike) => PathLike | typeof FIND_UP_STOP);
74
76
  type EmptyDirOptions = {
75
77
  maxRetries?: number | undefined;
76
78
  retryDelay?: number | undefined;
@@ -117,4 +119,4 @@ declare global {
117
119
  }
118
120
  }
119
121
 
120
- export { type ContentType as C, type EmptyDirOptions as E, type FindUpOptions as F, type JsonValue as J, type Match as M, type ReadFileOptions as R, type WalkOptions as W, X_OK as X, type YamlReviver as Y, type WalkEntry as a, type ReadJsonOptions as b, type JsonReviver as c, type ReadYamlOptions as d, type WriteFileOptions as e, type WriteJsonOptions as f, type YamlReplacer as g, F_OK as h, FIND_UP_STOP as i, R_OK as j, W_OK as k, type CodeFrameLocation as l, type JsonReplacer as m, type ReadFileEncoding as n, type CodeFrameOptions as o };
122
+ export { type ContentType as C, type EmptyDirOptions as E, type FindUpName as F, type JsonValue as J, type ReadFileOptions as R, type WalkOptions as W, X_OK as X, type YamlReviver as Y, type FindUpOptions as a, type FindUpNameSync as b, type WalkEntry as c, type ReadJsonOptions as d, type JsonReviver as e, type ReadYamlOptions as f, type WriteFileOptions as g, type WriteJsonOptions as h, type YamlReplacer as i, F_OK as j, FIND_UP_STOP as k, R_OK as l, W_OK as m, type CodeFrameLocation as n, type JsonReplacer as o, type ReadFileEncoding as p, type CodeFrameOptions as q };
@@ -1,4 +1,4 @@
1
- import { Dirent } from 'node:fs';
1
+ import { Dirent, PathLike } from 'node:fs';
2
2
  import { DocumentOptions, ParseOptions, SchemaOptions, ToJSOptions } from 'yaml';
3
3
 
4
4
  declare const F_OK = 0;
@@ -66,11 +66,13 @@ type WriteJsonOptions = WriteFileOptions & {
66
66
  stringify?: (data: unknown, replacer: JsonReplacer, space: number | string | undefined) => string;
67
67
  };
68
68
  type FindUpOptions = {
69
+ allowSymlinks?: boolean;
69
70
  cwd?: URL | string;
70
71
  stopAt?: URL | string;
71
72
  type?: "directory" | "file";
72
73
  };
73
- type Match = string | typeof FIND_UP_STOP | undefined;
74
+ type FindUpName = string[] | string | ((directory: PathLike) => PathLike | Promise<PathLike | typeof FIND_UP_STOP> | typeof FIND_UP_STOP);
75
+ type FindUpNameSync = string[] | string | ((directory: PathLike) => PathLike | typeof FIND_UP_STOP);
74
76
  type EmptyDirOptions = {
75
77
  maxRetries?: number | undefined;
76
78
  retryDelay?: number | undefined;
@@ -117,4 +119,4 @@ declare global {
117
119
  }
118
120
  }
119
121
 
120
- export { type ContentType as C, type EmptyDirOptions as E, type FindUpOptions as F, type JsonValue as J, type Match as M, type ReadFileOptions as R, type WalkOptions as W, X_OK as X, type YamlReviver as Y, type WalkEntry as a, type ReadJsonOptions as b, type JsonReviver as c, type ReadYamlOptions as d, type WriteFileOptions as e, type WriteJsonOptions as f, type YamlReplacer as g, F_OK as h, FIND_UP_STOP as i, R_OK as j, W_OK as k, type CodeFrameLocation as l, type JsonReplacer as m, type ReadFileEncoding as n, type CodeFrameOptions as o };
122
+ export { type ContentType as C, type EmptyDirOptions as E, type FindUpName as F, type JsonValue as J, type ReadFileOptions as R, type WalkOptions as W, X_OK as X, type YamlReviver as Y, type FindUpOptions as a, type FindUpNameSync as b, type WalkEntry as c, type ReadJsonOptions as d, type JsonReviver as e, type ReadYamlOptions as f, type WriteFileOptions as g, type WriteJsonOptions as h, type YamlReplacer as i, F_OK as j, FIND_UP_STOP as k, R_OK as l, W_OK as m, type CodeFrameLocation as n, type JsonReplacer as o, type ReadFileEncoding as p, type CodeFrameOptions as q };
package/dist/utils.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { J as JSONError } from './packem_shared/json-error-ZPgZIXcg.cjs';
2
- import { J as JsonValue, o as CodeFrameOptions, c as JsonReviver } from './packem_shared/observable-like.d-CpT5ICZl.cjs';
2
+ import { J as JsonValue, q as CodeFrameOptions, e as JsonReviver } from './packem_shared/observable-like.d-BIpsmTbZ.cjs';
3
3
  export { toPath } from '@visulima/path/utils';
4
4
  import 'node:fs';
5
5
  import 'yaml';
package/dist/utils.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { J as JSONError } from './packem_shared/json-error-ZPgZIXcg.mjs';
2
- import { J as JsonValue, o as CodeFrameOptions, c as JsonReviver } from './packem_shared/observable-like.d-CpT5ICZl.mjs';
2
+ import { J as JsonValue, q as CodeFrameOptions, e as JsonReviver } from './packem_shared/observable-like.d-BIpsmTbZ.mjs';
3
3
  export { toPath } from '@visulima/path/utils';
4
4
  import 'node:fs';
5
5
  import 'yaml';
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { J as JSONError } from './packem_shared/json-error-ZPgZIXcg.d.mjs';
2
- import { J as JsonValue, o as CodeFrameOptions, c as JsonReviver } from './packem_shared/observable-like.d-CpT5ICZl.d.mjs';
2
+ import { J as JsonValue, q as CodeFrameOptions, e as JsonReviver } from './packem_shared/observable-like.d-BIpsmTbZ.d.mjs';
3
3
  export { toPath } from '@visulima/path/utils';
4
4
  import 'node:fs';
5
5
  import 'yaml';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/fs",
3
- "version": "2.1.17",
3
+ "version": "2.2.0",
4
4
  "description": "Human friendly file system utilities for Node.js",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -132,25 +132,25 @@
132
132
  "LICENSE.md"
133
133
  ],
134
134
  "dependencies": {
135
- "@visulima/path": "1.0.8"
135
+ "@visulima/path": "1.0.9"
136
136
  },
137
137
  "devDependencies": {
138
138
  "@anolilab/eslint-config": "^15.0.3",
139
139
  "@anolilab/prettier-config": "^5.0.14",
140
140
  "@anolilab/semantic-release-pnpm": "^1.1.3",
141
141
  "@anolilab/semantic-release-preset": "^9.0.0",
142
- "@arethetypeswrong/cli": "^0.16.2",
142
+ "@arethetypeswrong/cli": "^0.16.4",
143
143
  "@babel/core": "^7.25.2",
144
- "@rushstack/eslint-plugin-security": "^0.8.2",
144
+ "@rushstack/eslint-plugin-security": "^0.8.3",
145
145
  "@types/node": "18.19.15",
146
- "@visulima/error": "4.4.4",
147
- "@visulima/packem": "^1.0.0-alpha.108",
148
- "@vitest/coverage-v8": "^2.0.5",
149
- "@vitest/ui": "^2.0.5",
146
+ "@visulima/error": "4.4.5",
147
+ "@visulima/packem": "1.0.1",
148
+ "@vitest/coverage-v8": "^2.1.1",
149
+ "@vitest/ui": "^2.1.1",
150
150
  "conventional-changelog-conventionalcommits": "8.0.0",
151
151
  "cross-env": "^7.0.3",
152
152
  "detect-indent": "^7.0.1",
153
- "esbuild": "0.23.0",
153
+ "esbuild": "0.24.0",
154
154
  "eslint": "8.57.0",
155
155
  "eslint-plugin-deprecation": "^3.0.0",
156
156
  "eslint-plugin-etc": "^2.0.3",
@@ -167,7 +167,7 @@
167
167
  "tempy": "^3.1.0",
168
168
  "type-fest": "^4.26.1",
169
169
  "typescript": "5.4.5",
170
- "vitest": "^2.0.5",
170
+ "vitest": "^2.1.1",
171
171
  "yaml": "^2.5.1"
172
172
  },
173
173
  "peerDependencies": {
@@ -1 +0,0 @@
1
- "use strict";var g=Object.defineProperty;var f=(r,t)=>g(r,"name",{value:t,configurable:!0});const h=require("node:fs/promises"),i=require("@visulima/path"),u=require("@visulima/path/utils"),v=require("./F_OK-B8R_JA-Q.cjs");var m=Object.defineProperty,y=f((r,t)=>m(r,"name",{value:t,configurable:!0}),"n");const A=y(async(r,t={})=>{if(typeof r!="string"&&!Array.isArray(r)&&typeof r!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const p=t.cwd?u.toPath(t.cwd):process.cwd();let e=i.resolve(p);const{root:s}=i.parse(e),l=u.toPath(t.stopAt??s),d=i.resolve(e,l),n=t.type??"file",w=y(async function(o){return typeof r=="function"?[await r(o)]:typeof r=="string"?[r]:Array.isArray(r)?r:[r]},"getMatchers");for(;e&&e!==d&&e!==s;){for await(const o of await w(e)){if(o===v.FIND_UP_STOP)return;if(o===void 0)continue;const a=i.isAbsolute(o)?o:i.resolve(e,o);try{const c=await h.stat(a);if(n==="file"&&c.isFile()||n==="directory"&&c.isDirectory())return a}catch{}}e=i.dirname(e)}},"findUp");module.exports=A;
@@ -1 +0,0 @@
1
- var w=Object.defineProperty;var c=(r,o)=>w(r,"name",{value:o,configurable:!0});import{stat as g}from"node:fs/promises";import{resolve as i,parse as h,isAbsolute as A,dirname as v}from"@visulima/path";import{toPath as y}from"@visulima/path/utils";import{FIND_UP_STOP as b}from"./F_OK-CiLqIeYK.mjs";var P=Object.defineProperty,p=c((r,o)=>P(r,"name",{value:o,configurable:!0}),"n");const _=p(async(r,o={})=>{if(typeof r!="string"&&!Array.isArray(r)&&typeof r!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const u=o.cwd?y(o.cwd):process.cwd();let t=i(u);const{root:n}=h(t),m=y(o.stopAt??n),d=i(t,m),a=o.type??"file",l=p(async function(e){return typeof r=="function"?[await r(e)]:typeof r=="string"?[r]:Array.isArray(r)?r:[r]},"getMatchers");for(;t&&t!==d&&t!==n;){for await(const e of await l(t)){if(e===b)return;if(e===void 0)continue;const s=A(e)?e:i(t,e);try{const f=await g(s);if(a==="file"&&f.isFile()||a==="directory"&&f.isDirectory())return s}catch{}}t=v(t)}},"findUp");export{_ as default};
@@ -1 +0,0 @@
1
- "use strict";var h=Object.defineProperty;var a=(r,t)=>h(r,"name",{value:t,configurable:!0});const v=require("node:fs"),n=require("@visulima/path"),u=require("@visulima/path/utils"),A=require("./F_OK-B8R_JA-Q.cjs");var m=Object.defineProperty,y=a((r,t)=>m(r,"name",{value:t,configurable:!0}),"o");const w=y((r,t={})=>{if(typeof r!="string"&&!Array.isArray(r)&&typeof r!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const p=t.cwd?u.toPath(t.cwd):process.cwd();let e=n.resolve(p);const{root:s}=n.parse(e),l=u.toPath(t.stopAt??s),d=n.resolve(e,l),i=t.type??"file",g=y(function(o){return typeof r=="function"?[r(o)]:typeof r=="string"?[r]:Array.isArray(r)?r:[r]},"getMatchers");for(;e&&e!==d&&e!==s;){for(const o of g(e)){if(o===A.FIND_UP_STOP)return;if(o===void 0)continue;const c=n.isAbsolute(o)?o:n.resolve(e,o);try{const f=v.statSync(c);if(i==="file"&&f.isFile()||i==="directory"&&f.isDirectory())return c}catch{}}e=n.dirname(e)}},"findUpSync");module.exports=w;
@@ -1 +0,0 @@
1
- var g=Object.defineProperty;var a=(r,t)=>g(r,"name",{value:t,configurable:!0});import{statSync as h}from"node:fs";import{resolve as i,parse as A,isAbsolute as v,dirname as w}from"@visulima/path";import{toPath as p}from"@visulima/path/utils";import{FIND_UP_STOP as b}from"./F_OK-CiLqIeYK.mjs";var P=Object.defineProperty,y=a((r,t)=>P(r,"name",{value:t,configurable:!0}),"o");const U=y((r,t={})=>{if(typeof r!="string"&&!Array.isArray(r)&&typeof r!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const u=t.cwd?p(t.cwd):process.cwd();let o=i(u);const{root:n}=A(o),m=p(t.stopAt??n),d=i(o,m),f=t.type??"file",l=y(function(e){return typeof r=="function"?[r(e)]:typeof r=="string"?[r]:Array.isArray(r)?r:[r]},"getMatchers");for(;o&&o!==d&&o!==n;){for(const e of l(o)){if(e===b)return;if(e===void 0)continue;const s=v(e)?e:i(o,e);try{const c=h(s);if(f==="file"&&c.isFile()||f==="directory"&&c.isDirectory())return s}catch{}}o=w(o)}},"findUpSync");export{U as default};