@visulima/fs 2.1.18 → 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,9 @@
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
+
1
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)
2
8
 
3
9
  ### Bug Fixes
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.18",
3
+ "version": "2.2.0",
4
4
  "description": "Human friendly file system utilities for Node.js",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -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};