@visulima/fs 5.0.0-alpha.2 → 5.0.0-alpha.21
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 +263 -0
- package/LICENSE.md +208 -131
- package/dist/eol.d.ts +31 -30
- package/dist/eol.js +3 -26
- package/dist/error.d.ts +273 -7
- package/dist/error.js +1 -7
- package/dist/glob-parent.d.ts +35 -0
- package/dist/glob-parent.js +1 -0
- package/dist/glob.d.ts +4 -0
- package/dist/glob.js +1 -0
- package/dist/index.d.ts +858 -36
- package/dist/index.js +1 -33
- package/dist/ini.d.ts +70 -0
- package/dist/ini.js +1 -0
- package/dist/is-glob.d.ts +34 -0
- package/dist/is-glob.js +1 -0
- package/dist/json5.d.ts +36 -0
- package/dist/json5.js +1 -0
- package/dist/jsonc.d.ts +65 -0
- package/dist/jsonc.js +1 -0
- package/dist/match.d.ts +46 -0
- package/dist/match.js +1 -0
- package/dist/packem_shared/AlreadyExistsError-CEu6_Tjb.js +1 -0
- package/dist/packem_shared/DirectoryError-ddlbUV8C.js +1 -0
- package/dist/packem_shared/F_OK-CAwY1qU7.js +1 -0
- package/dist/packem_shared/JSONError-D7h6PNWc.js +4 -0
- package/dist/packem_shared/NotEmptyError-DMh1o7UL.js +1 -0
- package/dist/packem_shared/NotFoundError-BPiW0icm.js +1 -0
- package/dist/packem_shared/PermissionError-B1Emi5a9.js +1 -0
- package/dist/packem_shared/WalkError-Olmh4908.js +1 -0
- package/dist/packem_shared/_commonjsHelpers-D6W6KoPK.js +1 -0
- package/dist/packem_shared/assertValidFileContents-BZFnXa7K.js +1 -0
- package/dist/packem_shared/assertValidFileOrDirectoryPath-DgPIPmZT.js +1 -0
- package/dist/packem_shared/build-rm-options-C1R4reBu.js +1 -0
- package/dist/packem_shared/collect-2KPTpCdX.js +1 -0
- package/dist/packem_shared/collectSync-BX55r_BH.js +1 -0
- package/dist/packem_shared/emptyDir-8utO028L.js +1 -0
- package/dist/packem_shared/emptyDirSync-Bk5fUX73.js +1 -0
- package/dist/packem_shared/ensureDir-CZ4oUFuo.js +1 -0
- package/dist/packem_shared/ensureDirSync-CoPWhbjM.js +1 -0
- package/dist/packem_shared/ensureFile-CF1cAAyh.js +1 -0
- package/dist/packem_shared/ensureFileSync-C3qR6naU.js +1 -0
- package/dist/packem_shared/ensureLink-LLLxlGHn.js +1 -0
- package/dist/packem_shared/ensureLinkSync-Dh_GtT8F.js +1 -0
- package/dist/packem_shared/ensureSymlink-D50kj2zl.js +1 -0
- package/dist/packem_shared/ensureSymlinkSync-BbVDPvI4.js +1 -0
- package/dist/packem_shared/findUp-BT07y_Me.js +1 -0
- package/dist/packem_shared/findUpSync-BvZiYsKJ.js +1 -0
- package/dist/packem_shared/get-file-info-type-CaWGXRjY.js +1 -0
- package/dist/packem_shared/glob-MHJQjR39.js +1 -0
- package/dist/packem_shared/glob-sync.d-ODRbh6wE.d.ts +54 -0
- package/dist/packem_shared/globSync-CwzlELgS.js +1 -0
- package/dist/packem_shared/index-CYIVJA0W.js +1 -0
- package/dist/packem_shared/index-DrapuBsB.js +1 -0
- package/dist/packem_shared/index-K-NNTkpb.js +11 -0
- package/dist/packem_shared/index-yGx8uzZs.js +1 -0
- package/dist/packem_shared/indexToLineColumn-BRSZFC6I-BKj3uzZt.js +6 -0
- package/dist/packem_shared/ini-preserve-CXc_xkpG.js +4 -0
- package/dist/packem_shared/is-stats-identical-CohsLtWy.js +1 -0
- package/dist/packem_shared/isAccessible-CDFxsAAo.js +1 -0
- package/dist/packem_shared/isAccessibleSync-5nzZWgin.js +1 -0
- package/dist/packem_shared/isFsCaseSensitive-CMZVY1A2.js +1 -0
- package/dist/packem_shared/json-error.d-DVILOyHc.d.ts +52 -0
- package/dist/packem_shared/jsonc-merge-CQMjx3Vw.js +2 -0
- package/dist/packem_shared/move-LmP6P9sn.js +1 -0
- package/dist/packem_shared/parseJson-Xx6vHYbv.js +1 -0
- package/dist/packem_shared/readFile-BAVMZg5e.js +1 -0
- package/dist/packem_shared/readFileSync-CGmzMUF2.js +1 -0
- package/dist/packem_shared/readIni-Cfl6HmTS.js +1 -0
- package/dist/packem_shared/readIniSync-DPg4UD0P.js +1 -0
- package/dist/packem_shared/readJson-kPx68Wv1.js +1 -0
- package/dist/packem_shared/readJson5-pXTL9nUE.js +1 -0
- package/dist/packem_shared/readJson5Sync-BedQc292.js +1 -0
- package/dist/packem_shared/readJsonSync-_HXNI3Se.js +1 -0
- package/dist/packem_shared/readJsonc-BzvuAXbT.js +1 -0
- package/dist/packem_shared/readJsoncSync-CVG1_QnX.js +1 -0
- package/dist/packem_shared/readToml-BO5CZK2P.js +1 -0
- package/dist/packem_shared/readTomlSync-1fKo0R52.js +1 -0
- package/dist/packem_shared/readYaml-DjK_Vqj1.js +1 -0
- package/dist/packem_shared/readYamlSync-C3h6KA2c.js +1 -0
- package/dist/packem_shared/remove-DH41Ov_c.js +1 -0
- package/dist/packem_shared/removeSync-50OEdnHd.js +1 -0
- package/dist/packem_shared/resolve-symlink-target-BofZSDIc.js +1 -0
- package/dist/packem_shared/sanitize-CU1xmyrg.js +1 -0
- package/dist/packem_shared/stripJsonComments-CzNR77MF.js +1 -0
- package/dist/packem_shared/to-uint-8-array-DwgaTasY.js +1 -0
- package/dist/packem_shared/types.d-CHp56oCv.d.ts +1660 -0
- package/dist/packem_shared/walk-D01Qmmvz.js +1 -0
- package/dist/packem_shared/walk-include-DCiVAwMP.js +1 -0
- package/dist/packem_shared/walkSync-BknSdmKD.js +1 -0
- package/dist/packem_shared/writeFile-DNGaDOMX.js +1 -0
- package/dist/packem_shared/writeFileSync-CE1i-eMA.js +1 -0
- package/dist/packem_shared/writeIni-DG7U4ji0.js +4 -0
- package/dist/packem_shared/writeIniSync-Ldt6HFLb.js +4 -0
- package/dist/packem_shared/writeJson-BkGlq1Kv.js +4 -0
- package/dist/packem_shared/writeJson5-Btud4sQh.js +4 -0
- package/dist/packem_shared/writeJson5Sync-Iln3i1IV.js +4 -0
- package/dist/packem_shared/writeJsonSync-HndmyvEK.js +4 -0
- package/dist/packem_shared/writeJsonc-9oiamG16.js +4 -0
- package/dist/packem_shared/writeJsoncSync-BHBziPiK.js +4 -0
- package/dist/packem_shared/writeToml-Cj57wZ8B.js +1 -0
- package/dist/packem_shared/writeTomlSync-B34ZZp0e.js +1 -0
- package/dist/packem_shared/writeYaml-BhQX2yN9.js +1 -0
- package/dist/packem_shared/writeYamlSync-DG01FBeC.js +1 -0
- package/dist/size.d.ts +246 -246
- package/dist/size.js +1 -144
- package/dist/toml.d.ts +63 -0
- package/dist/toml.js +1 -0
- package/dist/utils.d.ts +103 -6
- package/dist/utils.js +1 -6
- package/dist/yaml.d.ts +13 -5
- package/dist/yaml.js +1 -4
- package/package.json +89 -36
- package/dist/constants.d.ts +0 -42
- package/dist/ensure/ensure-dir-sync.d.ts +0 -14
- package/dist/ensure/ensure-dir.d.ts +0 -14
- package/dist/ensure/ensure-file-sync.d.ts +0 -15
- package/dist/ensure/ensure-file.d.ts +0 -27
- package/dist/ensure/ensure-link-sync.d.ts +0 -16
- package/dist/ensure/ensure-link.d.ts +0 -16
- package/dist/ensure/ensure-symlink-sync.d.ts +0 -23
- package/dist/ensure/ensure-symlink.d.ts +0 -23
- package/dist/ensure/utils/get-file-info-type.d.ts +0 -7
- package/dist/ensure/utils/is-stats-identical.d.ts +0 -3
- package/dist/ensure/utils/resolve-symlink-target.d.ts +0 -2
- package/dist/error/already-exists-error.d.ts +0 -39
- package/dist/error/directory-error.d.ts +0 -47
- package/dist/error/json-error.d.ts +0 -52
- package/dist/error/not-empty-error.d.ts +0 -51
- package/dist/error/not-found-error.d.ts +0 -44
- package/dist/error/permission-error.d.ts +0 -45
- package/dist/error/walk-error.d.ts +0 -51
- package/dist/find/collect-sync.d.ts +0 -31
- package/dist/find/collect.d.ts +0 -35
- package/dist/find/find-up-sync.d.ts +0 -42
- package/dist/find/find-up.d.ts +0 -46
- package/dist/find/utils/glob-to-regexp.d.ts +0 -2
- package/dist/find/utils/walk-include.d.ts +0 -2
- package/dist/find/walk-sync.d.ts +0 -34
- package/dist/find/walk.d.ts +0 -37
- package/dist/is-accessible-sync.d.ts +0 -3
- package/dist/is-accessible.d.ts +0 -29
- package/dist/move/index.d.ts +0 -68
- package/dist/move/types.d.ts +0 -36
- package/dist/move/utils/internal-move-file-sync.d.ts +0 -3
- package/dist/move/utils/internal-move-file.d.ts +0 -3
- package/dist/move/utils/validate-same-directory.d.ts +0 -2
- package/dist/packem_shared/AlreadyExistsError-6Y9hjgMn.js +0 -27
- package/dist/packem_shared/DirectoryError-BfYPkIYP.js +0 -27
- package/dist/packem_shared/F_OK-MldBaGxb.js +0 -8
- package/dist/packem_shared/JSONError-BkHRnInH.js +0 -26
- package/dist/packem_shared/NotEmptyError-B21RUlVr.js +0 -27
- package/dist/packem_shared/NotFoundError-BIp61X6k.js +0 -27
- package/dist/packem_shared/PermissionError-CjoiJgip.js +0 -27
- package/dist/packem_shared/WalkError-DUdQd6FT.js +0 -24
- package/dist/packem_shared/assertValidFileContents-BmcLtsGd.js +0 -7
- package/dist/packem_shared/assertValidFileOrDirectoryPath-8HANmVjk.js +0 -7
- package/dist/packem_shared/collect-DcBwsYYd.js +0 -14
- package/dist/packem_shared/collectSync-Bkjf9Dbm.js +0 -14
- package/dist/packem_shared/emptyDir-CYB5Tict.js +0 -43
- package/dist/packem_shared/emptyDirSync-BD8-1Ytl.js +0 -41
- package/dist/packem_shared/ensureDir-C_kuQ5Ik.js +0 -53
- package/dist/packem_shared/ensureDirSync-CI5g-uBI.js +0 -53
- package/dist/packem_shared/ensureFile-BUtXGlGT.js +0 -47
- package/dist/packem_shared/ensureFileSync-C8hASR-1.js +0 -47
- package/dist/packem_shared/ensureLink-BPnAG5-P.js +0 -54
- package/dist/packem_shared/ensureLinkSync-B-Z7X0ub.js +0 -54
- package/dist/packem_shared/ensureSymlink-U5B6J0BN.js +0 -73
- package/dist/packem_shared/ensureSymlinkSync-DHnZj-9F.js +0 -74
- package/dist/packem_shared/findUp-BSnyGqer.js +0 -85
- package/dist/packem_shared/findUpSync-jRHbSCMV.js +0 -85
- package/dist/packem_shared/get-file-info-type-FD4-jsyg.js +0 -14
- package/dist/packem_shared/index-CHM-in-V.js +0 -100
- package/dist/packem_shared/is-stats-identical-D8FxpvQU.js +0 -3
- package/dist/packem_shared/isAccessible-DuVrTNFV.js +0 -38
- package/dist/packem_shared/isAccessibleSync-DI8mM0fA.js +0 -38
- package/dist/packem_shared/isFsCaseSensitive-D-ayleCy.js +0 -62
- package/dist/packem_shared/move-DbpW5_vA.js +0 -134
- package/dist/packem_shared/parseJson-C8xb-3LR.js +0 -231
- package/dist/packem_shared/readFile-Iz7kvCCk.js +0 -65
- package/dist/packem_shared/readFileSync-6GEIrOnl.js +0 -53
- package/dist/packem_shared/readJson-vddQ97Ll.js +0 -22
- package/dist/packem_shared/readJsonSync-DzeAdYZl.js +0 -22
- package/dist/packem_shared/readYaml-D5q2a0e1.js +0 -10
- package/dist/packem_shared/readYamlSync-DMV4U-gi.js +0 -10
- package/dist/packem_shared/remove-_oDY3uKo.js +0 -38
- package/dist/packem_shared/removeSync-DETRj7Qn.js +0 -38
- package/dist/packem_shared/resolve-symlink-target-Kh4GovFf.js +0 -16
- package/dist/packem_shared/sanitize-lOzE6k2A.js +0 -205
- package/dist/packem_shared/stripJsonComments-vo4k0mpF.js +0 -19
- package/dist/packem_shared/to-uint-8-array-Dz2nF1y1.js +0 -19
- package/dist/packem_shared/walk-BhTbpr3y.js +0 -115
- package/dist/packem_shared/walk-include-CZco7BvN.js +0 -16
- package/dist/packem_shared/walkSync-DDBq95s8.js +0 -114
- package/dist/packem_shared/writeFile-DSHERs0Z.js +0 -83
- package/dist/packem_shared/writeFileSync-CJp1kXQR.js +0 -83
- package/dist/packem_shared/writeJson-C0OfLDbe.js +0 -50
- package/dist/packem_shared/writeJsonSync-Cs21FE7v.js +0 -50
- package/dist/packem_shared/writeYaml-n4xzYN9a.js +0 -24
- package/dist/packem_shared/writeYamlSync-DnOEnP10.js +0 -24
- package/dist/read/read-file-sync.d.ts +0 -37
- package/dist/read/read-file.d.ts +0 -41
- package/dist/read/read-json-sync.d.ts +0 -5
- package/dist/read/read-json.d.ts +0 -5
- package/dist/read/read-yaml-sync.d.ts +0 -4
- package/dist/read/read-yaml.d.ts +0 -4
- package/dist/remove/empty-dir-sync.d.ts +0 -23
- package/dist/remove/empty-dir.d.ts +0 -28
- package/dist/remove/remove-sync.d.ts +0 -27
- package/dist/remove/remove.d.ts +0 -32
- package/dist/sanitize.d.ts +0 -31
- package/dist/types.d.ts +0 -304
- package/dist/utils/assert-valid-file-contents.d.ts +0 -27
- package/dist/utils/assert-valid-file-or-directory-path.d.ts +0 -26
- package/dist/utils/parse-json.d.ts +0 -5
- package/dist/utils/strip-json-comments.d.ts +0 -44
- package/dist/write/utils/to-uint-8-array.d.ts +0 -2
- package/dist/write/write-file-sync.d.ts +0 -30
- package/dist/write/write-file.d.ts +0 -30
- package/dist/write/write-json-sync.d.ts +0 -29
- package/dist/write/write-json.d.ts +0 -30
- package/dist/write/write-yaml-sync.d.ts +0 -4
- package/dist/write/write-yaml.d.ts +0 -4
package/dist/index.js
CHANGED
|
@@ -1,33 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { default as ensureDir } from './packem_shared/ensureDir-C_kuQ5Ik.js';
|
|
3
|
-
export { default as ensureDirSync } from './packem_shared/ensureDirSync-CI5g-uBI.js';
|
|
4
|
-
export { default as ensureFile } from './packem_shared/ensureFile-BUtXGlGT.js';
|
|
5
|
-
export { default as ensureFileSync } from './packem_shared/ensureFileSync-C8hASR-1.js';
|
|
6
|
-
export { default as ensureLink } from './packem_shared/ensureLink-BPnAG5-P.js';
|
|
7
|
-
export { default as ensureLinkSync } from './packem_shared/ensureLinkSync-B-Z7X0ub.js';
|
|
8
|
-
export { default as ensureSymlink } from './packem_shared/ensureSymlink-U5B6J0BN.js';
|
|
9
|
-
export { default as ensureSymlinkSync } from './packem_shared/ensureSymlinkSync-DHnZj-9F.js';
|
|
10
|
-
export { CRLF, EOL, LF, detect, format } from './eol.js';
|
|
11
|
-
export { default as collect } from './packem_shared/collect-DcBwsYYd.js';
|
|
12
|
-
export { default as collectSync } from './packem_shared/collectSync-Bkjf9Dbm.js';
|
|
13
|
-
export { default as findUp } from './packem_shared/findUp-BSnyGqer.js';
|
|
14
|
-
export { default as findUpSync } from './packem_shared/findUpSync-jRHbSCMV.js';
|
|
15
|
-
export { default as walk } from './packem_shared/walk-BhTbpr3y.js';
|
|
16
|
-
export { default as walkSync } from './packem_shared/walkSync-DDBq95s8.js';
|
|
17
|
-
export { default as isAccessible } from './packem_shared/isAccessible-DuVrTNFV.js';
|
|
18
|
-
export { default as isAccessibleSync } from './packem_shared/isAccessibleSync-DI8mM0fA.js';
|
|
19
|
-
export { move, moveSync, rename, renameSync } from './packem_shared/move-DbpW5_vA.js';
|
|
20
|
-
export { default as readFile } from './packem_shared/readFile-Iz7kvCCk.js';
|
|
21
|
-
export { default as readFileSync } from './packem_shared/readFileSync-6GEIrOnl.js';
|
|
22
|
-
export { default as readJson } from './packem_shared/readJson-vddQ97Ll.js';
|
|
23
|
-
export { default as readJsonSync } from './packem_shared/readJsonSync-DzeAdYZl.js';
|
|
24
|
-
export { default as emptyDir } from './packem_shared/emptyDir-CYB5Tict.js';
|
|
25
|
-
export { default as emptyDirSync } from './packem_shared/emptyDirSync-BD8-1Ytl.js';
|
|
26
|
-
export { default as remove } from './packem_shared/remove-_oDY3uKo.js';
|
|
27
|
-
export { default as removeSync } from './packem_shared/removeSync-DETRj7Qn.js';
|
|
28
|
-
export { sanitize } from './packem_shared/sanitize-lOzE6k2A.js';
|
|
29
|
-
export { default as writeFile } from './packem_shared/writeFile-DSHERs0Z.js';
|
|
30
|
-
export { default as writeFileSync } from './packem_shared/writeFileSync-CJp1kXQR.js';
|
|
31
|
-
export { default as writeJson } from './packem_shared/writeJson-C0OfLDbe.js';
|
|
32
|
-
export { default as writeJsonSync } from './packem_shared/writeJsonSync-Cs21FE7v.js';
|
|
33
|
-
export { isFsCaseSensitive } from './packem_shared/isFsCaseSensitive-D-ayleCy.js';
|
|
1
|
+
import{FIND_UP_STOP as o,F_OK as t,R_OK as a,W_OK as f,X_OK as s}from"./packem_shared/F_OK-CAwY1qU7.js";import{default as m}from"./packem_shared/ensureDir-CZ4oUFuo.js";import{default as n}from"./packem_shared/ensureDirSync-CoPWhbjM.js";import{default as d}from"./packem_shared/ensureFile-CF1cAAyh.js";import{default as i}from"./packem_shared/ensureFileSync-C3qR6naU.js";import{default as y}from"./packem_shared/ensureLink-LLLxlGHn.js";import{default as F}from"./packem_shared/ensureLinkSync-Dh_GtT8F.js";import{default as k}from"./packem_shared/ensureSymlink-D50kj2zl.js";import{default as O}from"./packem_shared/ensureSymlinkSync-BbVDPvI4.js";import{CRLF as v,EOL as D,LF as L,detect as J,format as K}from"./eol.js";import{default as P}from"./packem_shared/collect-2KPTpCdX.js";import{default as h}from"./packem_shared/collectSync-BX55r_BH.js";import{default as C}from"./packem_shared/findUp-BT07y_Me.js";import{default as z}from"./packem_shared/findUpSync-BvZiYsKJ.js";import{default as G}from"./packem_shared/glob-MHJQjR39.js";import{default as N}from"./packem_shared/globSync-CwzlELgS.js";import{default as W}from"./packem_shared/walk-D01Qmmvz.js";import{default as j}from"./packem_shared/walkSync-BknSdmKD.js";import{default as B}from"./glob-parent.js";import{default as M}from"./packem_shared/isAccessible-CDFxsAAo.js";import{default as V}from"./packem_shared/isAccessibleSync-5nzZWgin.js";import{default as Z}from"./is-glob.js";import{match as ee,matcher as re}from"./match.js";import{move as te,moveSync as ae,rename as fe,renameSync as se}from"./packem_shared/move-LmP6P9sn.js";import{default as me}from"./packem_shared/readFile-BAVMZg5e.js";import{default as ne}from"./packem_shared/readFileSync-CGmzMUF2.js";import{default as de}from"./packem_shared/readJson-kPx68Wv1.js";import{default as ie}from"./packem_shared/readJsonSync-_HXNI3Se.js";import{default as ye}from"./packem_shared/emptyDir-8utO028L.js";import{default as Fe}from"./packem_shared/emptyDirSync-Bk5fUX73.js";import{default as ke}from"./packem_shared/remove-DH41Ov_c.js";import{default as Oe}from"./packem_shared/removeSync-50OEdnHd.js";import{sanitize as ve}from"./packem_shared/sanitize-CU1xmyrg.js";import{default as Le}from"./packem_shared/writeFile-DNGaDOMX.js";import{default as Ke}from"./packem_shared/writeFileSync-CE1i-eMA.js";import{default as Pe}from"./packem_shared/writeJson-BkGlq1Kv.js";import{default as he}from"./packem_shared/writeJsonSync-HndmyvEK.js";import{isFsCaseSensitive as Ce}from"./packem_shared/isFsCaseSensitive-CMZVY1A2.js";export{v as CRLF,D as EOL,o as FIND_UP_STOP,t as F_OK,L as LF,a as R_OK,f as W_OK,s as X_OK,P as collect,h as collectSync,J as detect,ye as emptyDir,Fe as emptyDirSync,m as ensureDir,n as ensureDirSync,d as ensureFile,i as ensureFileSync,y as ensureLink,F as ensureLinkSync,k as ensureSymlink,O as ensureSymlinkSync,C as findUp,z as findUpSync,K as format,G as glob,B as globParent,N as globSync,M as isAccessible,V as isAccessibleSync,Ce as isFsCaseSensitive,Z as isGlob,ee as match,re as matcher,te as move,ae as moveSync,me as readFile,ne as readFileSync,de as readJson,ie as readJsonSync,ke as remove,Oe as removeSync,fe as rename,se as renameSync,ve as sanitize,W as walk,j as walkSync,Le as writeFile,Ke as writeFileSync,Pe as writeJson,he as writeJsonSync};
|
package/dist/ini.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { C as CompressionType, d as ReadIniOptions, e as WriteIniOptions } from "./packem_shared/types.d-CHp56oCv.js";
|
|
2
|
+
export { type I as IniEncodeOptions, type f as IniLineEnding } from "./packem_shared/types.d-CHp56oCv.js";
|
|
3
|
+
import 'node:fs';
|
|
4
|
+
import 'tinyglobby';
|
|
5
|
+
/**
|
|
6
|
+
* Asynchronously reads an INI file and parses it into an object.
|
|
7
|
+
* @template R The expected type of the parsed object. Defaults to `Record<string, unknown>`.
|
|
8
|
+
* @param path The path to the INI file. Can be a file URL or a string path.
|
|
9
|
+
* @param options Optional configuration. See {@link ReadIniOptions}.
|
|
10
|
+
* @returns A promise that resolves with the parsed object.
|
|
11
|
+
* @example
|
|
12
|
+
* ```javascript
|
|
13
|
+
* import { readIni } from "@visulima/fs/ini";
|
|
14
|
+
*
|
|
15
|
+
* const config = await readIni("./config.ini");
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
declare const readIni: <R = Record<string, unknown>>(path: URL | string, options?: ReadIniOptions<CompressionType>) => Promise<R>;
|
|
19
|
+
/**
|
|
20
|
+
* Synchronously reads an INI file and parses it into an object.
|
|
21
|
+
* @template R The expected type of the parsed object. Defaults to `Record<string, unknown>`.
|
|
22
|
+
* @param path The path to the INI file. Can be a file URL or a string path.
|
|
23
|
+
* @param options Optional configuration. See {@link ReadIniOptions}.
|
|
24
|
+
* @returns The parsed object.
|
|
25
|
+
* @example
|
|
26
|
+
* ```javascript
|
|
27
|
+
* import { readIniSync } from "@visulima/fs/ini";
|
|
28
|
+
*
|
|
29
|
+
* const config = readIniSync("./config.ini");
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare const readIniSync: (path: URL | string, options?: ReadIniOptions<CompressionType>) => Record<string, unknown>;
|
|
33
|
+
/**
|
|
34
|
+
* Asynchronously writes an object to an INI file.
|
|
35
|
+
*
|
|
36
|
+
* When an existing file is present and `preserveStyle` is `true` (the default), the original file's
|
|
37
|
+
* whitespace-around-`=` style and line endings are auto-detected and retained, and any line whose
|
|
38
|
+
* parsed value is unchanged is kept verbatim — preserving trailing whitespace and inline `;`/`#`
|
|
39
|
+
* comments. Explicit `whitespace` / `eol` options always win over detection.
|
|
40
|
+
* @param path The path to the INI file. Can be a file URL or a string path.
|
|
41
|
+
* @param data The data to serialize.
|
|
42
|
+
* @param options Optional configuration. See {@link WriteIniOptions}.
|
|
43
|
+
* @returns A promise that resolves when the file has been written.
|
|
44
|
+
* @example
|
|
45
|
+
* ```javascript
|
|
46
|
+
* import { writeIni } from "@visulima/fs/ini";
|
|
47
|
+
*
|
|
48
|
+
* await writeIni("./config.ini", { server: { port: 8080 } });
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
declare const writeIni: (path: URL | string, data: Record<string, unknown>, options?: WriteIniOptions) => Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Synchronously writes an object to an INI file.
|
|
54
|
+
*
|
|
55
|
+
* When an existing file is present and `preserveStyle` is `true` (the default), the original file's
|
|
56
|
+
* whitespace-around-`=` style and line endings are auto-detected and retained, and any line whose
|
|
57
|
+
* parsed value is unchanged is kept verbatim — preserving trailing whitespace and inline `;`/`#`
|
|
58
|
+
* comments. Explicit `whitespace` / `eol` options always win over detection.
|
|
59
|
+
* @param path The path to the INI file. Can be a file URL or a string path.
|
|
60
|
+
* @param data The data to serialize.
|
|
61
|
+
* @param options Optional configuration. See {@link WriteIniOptions}.
|
|
62
|
+
* @example
|
|
63
|
+
* ```javascript
|
|
64
|
+
* import { writeIniSync } from "@visulima/fs/ini";
|
|
65
|
+
*
|
|
66
|
+
* writeIniSync("./config.ini", { server: { port: 8080 } });
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
declare const writeIniSync: (path: URL | string, data: Record<string, unknown>, options?: WriteIniOptions) => void;
|
|
70
|
+
export { type ReadIniOptions, type WriteIniOptions, readIni, readIniSync, writeIni, writeIniSync };
|
package/dist/ini.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{default as a}from"./packem_shared/readIni-Cfl6HmTS.js";import{default as f}from"./packem_shared/readIniSync-DPg4UD0P.js";import{default as d}from"./packem_shared/writeIni-DG7U4ji0.js";import{default as n}from"./packem_shared/writeIniSync-Ldt6HFLb.js";export{a as readIni,f as readIniSync,d as writeIni,n as writeIniSync};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options accepted by {@link isGlob}.
|
|
3
|
+
*/
|
|
4
|
+
interface IsGlobOptions {
|
|
5
|
+
/**
|
|
6
|
+
* When `false`, matches more permissively — any string containing unescaped glob
|
|
7
|
+
* meta characters (`*`, `?`, `{}`, `()`, `[]`) is treated as a glob, even when the
|
|
8
|
+
* sequence is not a valid glob expression.
|
|
9
|
+
* @default true
|
|
10
|
+
*/
|
|
11
|
+
strict?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Returns `true` if the given value looks like a glob pattern (including extglobs like `@(foo|bar)`).
|
|
15
|
+
*
|
|
16
|
+
* Escaped meta characters (e.g. `\\*`) are not considered globs. Non-string values always return `false`.
|
|
17
|
+
*
|
|
18
|
+
* Powered by [`is-glob`](https://github.com/micromatch/is-glob) which is bundled into the built output so it does
|
|
19
|
+
* not appear as a runtime dependency of `@visulima/fs`.
|
|
20
|
+
* @param value The value to inspect.
|
|
21
|
+
* @param options Optional configuration. See {@link IsGlobOptions}.
|
|
22
|
+
* @returns `true` if `value` looks like a glob pattern, otherwise `false`.
|
|
23
|
+
* @example
|
|
24
|
+
* ```javascript
|
|
25
|
+
* import { isGlob } from "@visulima/fs";
|
|
26
|
+
*
|
|
27
|
+
* isGlob("src/**\/*.ts"); // true
|
|
28
|
+
* isGlob("src/index.ts"); // false
|
|
29
|
+
* isGlob("src/\\*.ts"); // false — escaped
|
|
30
|
+
* isGlob("!foo.js"); // true — negation
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
declare const isGlob: (value: unknown, options?: IsGlobOptions) => boolean;
|
|
34
|
+
export { type IsGlobOptions, isGlob as default };
|
package/dist/is-glob.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=Object.defineProperty;var e=(r,o)=>t(r,"name",{value:o,configurable:!0});import{g as a}from"./packem_shared/_commonjsHelpers-D6W6KoPK.js";import{r as s}from"./packem_shared/index-K-NNTkpb.js";var i=s();const l=a(i);var f=Object.defineProperty,m=e((r,o)=>f(r,"name",{value:o,configurable:!0}),"s");const b=m((r,o)=>l(r,o),"isGlob");export{b as default};
|
package/dist/json5.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { C as CompressionType, g as ReadJson5Options, h as Json5Reviver, i as WriteJson5Options } from "./packem_shared/types.d-CHp56oCv.js";
|
|
2
|
+
export { type j as Json5Replacer } from "./packem_shared/types.d-CHp56oCv.js";
|
|
3
|
+
import 'node:fs';
|
|
4
|
+
import 'tinyglobby';
|
|
5
|
+
declare function readJson5<R = unknown>(path: URL | string, options?: ReadJson5Options<CompressionType>): Promise<R>;
|
|
6
|
+
declare function readJson5<R = unknown>(path: URL | string, reviver: Json5Reviver, options?: ReadJson5Options<CompressionType>): Promise<R>;
|
|
7
|
+
declare function readJson5Sync(path: URL | string, options?: ReadJson5Options<CompressionType>): unknown;
|
|
8
|
+
declare function readJson5Sync(path: URL | string, reviver: Json5Reviver, options?: ReadJson5Options<CompressionType>): unknown;
|
|
9
|
+
/**
|
|
10
|
+
* Asynchronously writes a value to a JSON5 file.
|
|
11
|
+
* @param path The path to the JSON5 file. Can be a file URL or a string path.
|
|
12
|
+
* @param data The data to serialize.
|
|
13
|
+
* @param options Optional configuration. See {@link WriteJson5Options}.
|
|
14
|
+
* @returns A promise that resolves when the file has been written.
|
|
15
|
+
* @example
|
|
16
|
+
* ```javascript
|
|
17
|
+
* import { writeJson5 } from "@visulima/fs/json5";
|
|
18
|
+
*
|
|
19
|
+
* await writeJson5("./config.json5", { name: "app" }, { indent: 2, quote: "'" });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
declare const writeJson5: (path: URL | string, data: unknown, options?: WriteJson5Options) => Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Synchronously writes a value to a JSON5 file.
|
|
25
|
+
* @param path The path to the JSON5 file. Can be a file URL or a string path.
|
|
26
|
+
* @param data The data to serialize.
|
|
27
|
+
* @param options Optional configuration. See {@link WriteJson5Options}.
|
|
28
|
+
* @example
|
|
29
|
+
* ```javascript
|
|
30
|
+
* import { writeJson5Sync } from "@visulima/fs/json5";
|
|
31
|
+
*
|
|
32
|
+
* writeJson5Sync("./config.json5", { name: "app" }, { indent: 2 });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
declare const writeJson5Sync: (path: URL | string, data: unknown, options?: WriteJson5Options) => void;
|
|
36
|
+
export { type Json5Reviver, type ReadJson5Options, type WriteJson5Options, readJson5, readJson5Sync, writeJson5, writeJson5Sync };
|
package/dist/json5.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{default as r}from"./packem_shared/readJson5-pXTL9nUE.js";import{default as t}from"./packem_shared/readJson5Sync-BedQc292.js";import{default as s}from"./packem_shared/writeJson5-Btud4sQh.js";import{default as n}from"./packem_shared/writeJson5Sync-Iln3i1IV.js";export{r as readJson5,t as readJson5Sync,s as writeJson5,n as writeJson5Sync};
|
package/dist/jsonc.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { C as CompressionType, m as ReadJsoncOptions, n as WriteJsoncOptions } from "./packem_shared/types.d-CHp56oCv.js";
|
|
2
|
+
export { type o as JsoncFormattingOptions, type p as JsoncParseOptions } from "./packem_shared/types.d-CHp56oCv.js";
|
|
3
|
+
import 'node:fs';
|
|
4
|
+
import 'tinyglobby';
|
|
5
|
+
/**
|
|
6
|
+
* Asynchronously reads a JSONC (JSON with comments) file and parses it into a JavaScript value.
|
|
7
|
+
* Supports `//` and `/* *\/` comments and, optionally, trailing commas via `jsonc-parser`.
|
|
8
|
+
* @param path The path to the JSONC file. Can be a file URL or a string path.
|
|
9
|
+
* @param options Optional configuration. See {@link ReadJsoncOptions}.
|
|
10
|
+
* @returns A promise that resolves with the parsed value.
|
|
11
|
+
* @example
|
|
12
|
+
* ```javascript
|
|
13
|
+
* import { readJsonc } from "@visulima/fs/jsonc";
|
|
14
|
+
*
|
|
15
|
+
* const config = await readJsonc("./tsconfig.json", { allowTrailingComma: true });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
declare const readJsonc: (path: URL | string, options?: ReadJsoncOptions<CompressionType>) => Promise<unknown>;
|
|
19
|
+
/**
|
|
20
|
+
* Synchronously reads a JSONC (JSON with comments) file and parses it into a JavaScript value.
|
|
21
|
+
* Supports `//` and `/* *\/` comments and, optionally, trailing commas via `jsonc-parser`.
|
|
22
|
+
* @param path The path to the JSONC file. Can be a file URL or a string path.
|
|
23
|
+
* @param options Optional configuration. See {@link ReadJsoncOptions}.
|
|
24
|
+
* @returns The parsed value.
|
|
25
|
+
* @example
|
|
26
|
+
* ```javascript
|
|
27
|
+
* import { readJsoncSync } from "@visulima/fs/jsonc";
|
|
28
|
+
*
|
|
29
|
+
* const config = readJsoncSync("./tsconfig.json", { allowTrailingComma: true });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare const readJsoncSync: (path: URL | string, options?: ReadJsoncOptions<CompressionType>) => unknown;
|
|
33
|
+
/**
|
|
34
|
+
* Asynchronously writes a value to a JSONC file. When `preserveComments` is `true` (the default)
|
|
35
|
+
* and the target file already exists, existing comments and formatting are preserved by computing
|
|
36
|
+
* a minimal diff against the new value via `jsonc-parser`'s `modify` API.
|
|
37
|
+
* @param path The path to the JSONC file. Can be a file URL or a string path.
|
|
38
|
+
* @param data The data to serialize.
|
|
39
|
+
* @param options Optional configuration. See {@link WriteJsoncOptions}.
|
|
40
|
+
* @returns A promise that resolves when the file has been written.
|
|
41
|
+
* @example
|
|
42
|
+
* ```javascript
|
|
43
|
+
* import { writeJsonc } from "@visulima/fs/jsonc";
|
|
44
|
+
*
|
|
45
|
+
* // Preserves comments inside an existing tsconfig.json
|
|
46
|
+
* await writeJsonc("./tsconfig.json", { ...tsconfig, compilerOptions: { target: "es2024" } });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
declare const writeJsonc: (path: URL | string, data: unknown, options?: WriteJsoncOptions) => Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Synchronously writes a value to a JSONC file. When `preserveComments` is `true` (the default)
|
|
52
|
+
* and the target file already exists, existing comments and formatting are preserved by computing
|
|
53
|
+
* a minimal diff against the new value via `jsonc-parser`'s `modify` API.
|
|
54
|
+
* @param path The path to the JSONC file. Can be a file URL or a string path.
|
|
55
|
+
* @param data The data to serialize.
|
|
56
|
+
* @param options Optional configuration. See {@link WriteJsoncOptions}.
|
|
57
|
+
* @example
|
|
58
|
+
* ```javascript
|
|
59
|
+
* import { writeJsoncSync } from "@visulima/fs/jsonc";
|
|
60
|
+
*
|
|
61
|
+
* writeJsoncSync("./tsconfig.json", updated);
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
declare const writeJsoncSync: (path: URL | string, data: unknown, options?: WriteJsoncOptions) => void;
|
|
65
|
+
export { type ReadJsoncOptions, type WriteJsoncOptions, readJsonc, readJsoncSync, writeJsonc, writeJsoncSync };
|
package/dist/jsonc.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{default as r}from"./packem_shared/readJsonc-BzvuAXbT.js";import{default as t}from"./packem_shared/readJsoncSync-CVG1_QnX.js";import{default as s}from"./packem_shared/writeJsonc-9oiamG16.js";import{default as d}from"./packem_shared/writeJsoncSync-BHBziPiK.js";export{r as readJsonc,t as readJsoncSync,s as writeJsonc,d as writeJsoncSync};
|
package/dist/match.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import picomatch from './lib/picomatch';
|
|
2
|
+
/**
|
|
3
|
+
* Options accepted by {@link match} and {@link matcher}.
|
|
4
|
+
*
|
|
5
|
+
* Passed straight through to [`picomatch`](https://github.com/micromatch/picomatch#options); see its documentation for the full list.
|
|
6
|
+
*/
|
|
7
|
+
type MatchOptions = picomatch.PicomatchOptions;
|
|
8
|
+
/**
|
|
9
|
+
* Tests whether a path matches one or more glob patterns.
|
|
10
|
+
*
|
|
11
|
+
* Powered by [`picomatch`](https://github.com/micromatch/picomatch) which is bundled into the built output so it does
|
|
12
|
+
* not appear as a runtime dependency of `@visulima/fs`.
|
|
13
|
+
*
|
|
14
|
+
* If you match many values against the same pattern, prefer {@link matcher} to compile the pattern once.
|
|
15
|
+
* @param value The path (or paths) to test.
|
|
16
|
+
* @param pattern A single glob or array of globs.
|
|
17
|
+
* @param options Optional picomatch options. See {@link MatchOptions}.
|
|
18
|
+
* @returns `true` if `value` matches any of `pattern`.
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* import { match } from "@visulima/fs";
|
|
22
|
+
*
|
|
23
|
+
* match("src/index.ts", "src/**\/*.ts"); // true
|
|
24
|
+
* match("src/index.ts", ["**\/*.js", "**\/*.ts"]); // true
|
|
25
|
+
* match("src/index.ts", "**\/*.js"); // false
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
declare const match: (value: string | string[], pattern: string | string[], options?: MatchOptions) => boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Compiles a glob pattern into a reusable matcher function.
|
|
31
|
+
*
|
|
32
|
+
* Powered by [`picomatch`](https://github.com/micromatch/picomatch) which is bundled into the built output so it does
|
|
33
|
+
* not appear as a runtime dependency of `@visulima/fs`.
|
|
34
|
+
* @param pattern A single glob or array of globs.
|
|
35
|
+
* @param options Optional picomatch options. See {@link MatchOptions}.
|
|
36
|
+
* @returns A function that returns `true` when its argument matches the compiled pattern.
|
|
37
|
+
* @example
|
|
38
|
+
* ```javascript
|
|
39
|
+
* import { matcher } from "@visulima/fs";
|
|
40
|
+
*
|
|
41
|
+
* const isTs = matcher("**\/*.ts");
|
|
42
|
+
* ["a.ts", "b.js", "c.ts"].filter(isTs); // ["a.ts", "c.ts"]
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
declare const matcher: (pattern: string | string[], options?: MatchOptions) => ((value: string) => boolean);
|
|
46
|
+
export { MatchOptions, match, matcher };
|
package/dist/match.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.defineProperty;var o=(r,e)=>s(r,"name",{value:e,configurable:!0});import{s as c}from"./packem_shared/index-DrapuBsB.js";var i=Object.defineProperty,n=o((r,e)=>i(r,"name",{value:e,configurable:!0}),"i");const f=n((r,e,t)=>{const a=c(e,t);return Array.isArray(r)?r.some(m=>a(m)):a(r)},"match"),p=n((r,e)=>{const t=c(r,e);return a=>t(a)},"matcher");export{f as match,p as matcher};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=Object.defineProperty;var t=(e,r)=>o(e,"name",{value:r,configurable:!0});var a=Object.defineProperty,n=t((e,r)=>a(e,"name",{value:r,configurable:!0}),"t");class E extends Error{static{t(this,"n")}static{n(this,"AlreadyExistsError")}constructor(r){super(`EEXIST: ${r}`)}get code(){return"EEXIST"}set code(r){throw new Error("Cannot overwrite code EEXIST")}get name(){return"AlreadyExistsError"}set name(r){throw new Error("Cannot overwrite name of AlreadyExistsError")}}export{E as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=Object.defineProperty;var o=(e,r)=>t(e,"name",{value:r,configurable:!0});var n=Object.defineProperty,a=o((e,r)=>n(e,"name",{value:r,configurable:!0}),"o");class i extends Error{static{o(this,"n")}static{a(this,"DirectoryError")}constructor(r){super(`EISDIR: Illegal operation on a directory, ${r}`)}get code(){return"EISDIR"}set code(r){throw new Error("Cannot overwrite code EISDIR")}get name(){return"DirectoryError"}set name(r){throw new Error("Cannot overwrite name of DirectoryError")}}export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _=0,O=4,S=2,o=1,K=Symbol("findUpStop"),N=/"(?:[^"\\]|\\.)*"|\/\/[^\r\n]*|\/\*[\s\S]*?\*\//g;export{K as FIND_UP_STOP,_ as F_OK,N as INTERNAL_STRIP_JSON_REGEX,O as R_OK,S as W_OK,o as X_OK};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var s=Object.defineProperty;var t=(r,e)=>s(r,"name",{value:e,configurable:!0});var a=Object.defineProperty,i=t((r,e)=>a(r,"name",{value:e,configurable:!0}),"i");class m extends Error{static{t(this,"t")}static{i(this,"JSONError")}fileName;codeFrame;name="JSONError";#e;constructor(e){super(),this.#e=e}get message(){return`${this.#e}${this.fileName?` in ${this.fileName}`:""}${this.codeFrame?`
|
|
2
|
+
|
|
3
|
+
${this.codeFrame}
|
|
4
|
+
`:""}`}set message(e){this.#e=e}}export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=Object.defineProperty;var t=(e,r)=>o(e,"name",{value:r,configurable:!0});var n=Object.defineProperty,E=t((e,r)=>n(e,"name",{value:r,configurable:!0}),"t");class c extends Error{static{t(this,"n")}static{E(this,"NotEmptyError")}constructor(r){super(`ENOTEMPTY: Directory not empty, ${r}`)}get code(){return"ENOTEMPTY"}set code(r){throw new Error("Cannot overwrite code ENOTEMPTY")}get name(){return"NotEmptyError"}set name(r){throw new Error("Cannot overwrite name of NotEmptyError")}}export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=Object.defineProperty;var o=(e,r)=>t(e,"name",{value:r,configurable:!0});var n=Object.defineProperty,a=o((e,r)=>n(e,"name",{value:r,configurable:!0}),"o");class u extends Error{static{o(this,"n")}static{a(this,"NotFoundError")}constructor(r){super(`ENOENT: ${r}`)}get code(){return"ENOENT"}set code(r){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(r){throw new Error("Cannot overwrite name of NotFoundError")}}export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=Object.defineProperty;var t=(e,r)=>o(e,"name",{value:r,configurable:!0});var n=Object.defineProperty,s=t((e,r)=>n(e,"name",{value:r,configurable:!0}),"o");class i extends Error{static{t(this,"n")}static{s(this,"PermissionError")}constructor(r){super(`EPERM: Operation not permitted, ${r}`)}get code(){return"EPERM"}set code(r){throw new Error("Cannot overwrite code EPERM")}get name(){return"PermissionError"}set name(r){throw new Error("Cannot overwrite name of PermissionError")}}export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=Object.defineProperty;var t=(e,r)=>o(e,"name",{value:r,configurable:!0});var n=Object.defineProperty,s=t((e,r)=>n(e,"name",{value:r,configurable:!0}),"t");class c extends Error{static{t(this,"i")}static{s(this,"WalkError")}root;constructor(r,a){super(`${r instanceof Error?r.message:String(r)} for path "${a}"`),this.cause=r,this.root=a}get name(){return"WalkError"}set name(r){throw new Error("Cannot overwrite name of WalkError")}}export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=Object.defineProperty;var r=(t,e)=>c(t,"name",{value:e,configurable:!0});var p=Object.defineProperty,a=r((t,e)=>p(t,"name",{value:e,configurable:!0}),"t");function f(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}r(f,"getDefaultExportFromCjs");a(f,"getDefaultExportFromCjs");function l(t){return t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}r(l,"getDefaultExportFromNamespaceIfPresent");a(l,"getDefaultExportFromNamespaceIfPresent");function s(t){return t&&Object.prototype.hasOwnProperty.call(t,"default")&&Object.keys(t).length===1?t.default:t}r(s,"getDefaultExportFromNamespaceIfNotNamed");a(s,"getDefaultExportFromNamespaceIfNotNamed");function m(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var o=a(r(function n(){var u=!1;try{u=this instanceof n}catch{}return u?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)},"a"),"a");o.prototype=e.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var u=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,u.get?u:{enumerable:!0,get:a(function(){return t[n]},"get")})}),o}r(m,"getAugmentedNamespace");a(m,"getAugmentedNamespace");export{f as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=Object.defineProperty;var t=(e,r)=>a(e,"name",{value:r,configurable:!0});var f=Object.defineProperty,i=t((e,r)=>f(e,"name",{value:r,configurable:!0}),"e");const o=i(e=>{if(typeof e!="string"&&!(e instanceof ArrayBuffer)&&!ArrayBuffer.isView(e))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")},"assertValidFileContents");export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=Object.defineProperty;var t=(e,r)=>a(e,"name",{value:r,configurable:!0});var n=Object.defineProperty,o=t((e,r)=>n(e,"name",{value:r,configurable:!0}),"n");const s=o(e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")},"assertValidFileOrDirectoryPath");export{s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=Object.defineProperty;var t=(e,r)=>a(e,"name",{value:r,configurable:!0});var i=Object.defineProperty,o=t((e,r)=>i(e,"name",{value:r,configurable:!0}),"t");const n=o(e=>{const r={force:!0,recursive:!0};return e?.maxRetries!==void 0&&(r.maxRetries=e.maxRetries),e?.retryDelay!==void 0&&(r.retryDelay=e.retryDelay),r},"buildRmOptions");export{n as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=Object.defineProperty;var a=(r,e)=>n(r,"name",{value:e,configurable:!0});import o from"./walk-D01Qmmvz.js";var c=Object.defineProperty,i=a((r,e)=>c(r,"name",{value:e,configurable:!0}),"e");const l=i(async(r,e={})=>{Array.isArray(e.extensions)||(e.extensions=["js","mjs","cjs","ts"]);const s=[];for await(const t of o(r,e))s.push(t.path);return s},"collect");export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=Object.defineProperty;var s=(r,e)=>t(r,"name",{value:e,configurable:!0});import a from"./walkSync-BknSdmKD.js";var c=Object.defineProperty,f=s((r,e)=>c(r,"name",{value:e,configurable:!0}),"n");const l=f((r,e={})=>{Array.isArray(e.extensions)||(e.extensions=["js","mjs","cjs","ts"]);const o=[];for(const n of a(r,e))o.push(n.path);return o},"collectSync");export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=Object.defineProperty;var i=(e,r)=>c(e,"name",{value:r,configurable:!0});import{createRequire as f}from"node:module";import{join as _}from"@visulima/path";import{toPath as g}from"@visulima/path/utils";import j from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import{i as v}from"./build-rm-options-C1R4reBu.js";const m=f(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,t=i(e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[r,s]=o.versions.node.split(".").map(Number);if(r>22||r===22&&s>=3||r===20&&s>=16)return o.getBuiltinModule(e)}return m(e)},"__cjs_getBuiltinModule"),{existsSync:u}=t("node:fs"),{mkdir:p,readdir:d,rm:l}=t("node:fs/promises");var y=Object.defineProperty,b=i((e,r)=>y(e,"name",{value:r,configurable:!0}),"o");const B=b(async(e,r)=>{if(j(e),!u(e)){await p(e,{recursive:!0});return}const s=await d(e),n=v(r);for(const a of s)await l(_(g(e),a),n)},"emptyDir");export{B as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=Object.defineProperty;var s=(e,r)=>t(e,"name",{value:r,configurable:!0});import{createRequire as c}from"node:module";import{join as l}from"@visulima/path";import{toPath as _}from"@visulima/path/utils";import y from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import{i as g}from"./build-rm-options-C1R4reBu.js";const f=c(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,m=s(e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[r,i]=o.versions.node.split(".").map(Number);if(r>22||r===22&&i>=3||r===20&&i>=16)return o.getBuiltinModule(e)}return f(e)},"__cjs_getBuiltinModule"),{existsSync:u,mkdirSync:a,readdirSync:p,rmSync:d}=m("node:fs");var j=Object.defineProperty,v=s((e,r)=>j(e,"name",{value:r,configurable:!0}),"o");const x=v((e,r)=>{if(y(e),!u(e)){a(e,{recursive:!0});return}const i=g(r);for(const n of p(e))d(l(_(e),n),i)},"emptyDirSync");export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=Object.defineProperty;var s=(r,e)=>c(r,"name",{value:e,configurable:!0});import{createRequire as a}from"node:module";import d from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import{g as n}from"./get-file-info-type-CaWGXRjY.js";const u=a(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=s(r=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[e,t]=o.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return o.getBuiltinModule(r)}return u(r)},"__cjs_getBuiltinModule"),{lstat:i,mkdir:p}=f("node:fs/promises");var l=Object.defineProperty,m=s((r,e)=>l(r,"name",{value:e,configurable:!0}),"o");const w=m(async r=>{d(r);try{const e=await i(r);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(n(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await p(r,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const t=await i(r);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(n(t))}'`,{cause:e})}},"ensureDir");export{w as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=Object.defineProperty;var s=(r,e)=>c(r,"name",{value:e,configurable:!0});import{createRequire as a}from"node:module";import p from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import{g as n}from"./get-file-info-type-CaWGXRjY.js";const u=a(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=s(r=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[e,t]=o.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return o.getBuiltinModule(r)}return u(r)},"__cjs_getBuiltinModule"),{lstatSync:i,mkdirSync:d}=f("node:fs");var l=Object.defineProperty,g=s((r,e)=>l(r,"name",{value:e,configurable:!0}),"o");const E=g(r=>{p(r);try{const e=i(r);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(n(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{d(r,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const t=i(r);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(n(t))}'`,{cause:e})}},"ensureDirSync");export{E as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.defineProperty;var t=(r,e)=>s(r,"name",{value:e,configurable:!0});import{createRequire as n}from"node:module";import{dirname as l}from"@visulima/path";import{toPath as m}from"@visulima/path/utils";import u from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import d from"./ensureDir-CZ4oUFuo.js";import{g as _}from"./get-file-info-type-CaWGXRjY.js";const a=n(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=t(r=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[e,i]=o.versions.node.split(".").map(Number);if(e>22||e===22&&i>=3||e===20&&i>=16)return o.getBuiltinModule(r)}return a(r)},"__cjs_getBuiltinModule"),{lstat:f,writeFile:p}=c("node:fs/promises");var g=Object.defineProperty,w=t((r,e)=>g(r,"name",{value:e,configurable:!0}),"o");const F=w(async r=>{u(r);try{const e=await f(r);if(!e.isFile())throw new Error(`Ensure path exists, expected 'file', got '${String(_(e))}'`)}catch(e){if(e.code==="ENOENT"){await d(l(m(r))),await p(r,new Uint8Array);return}throw e}},"ensureFile");export{F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.defineProperty;var t=(r,e)=>s(r,"name",{value:e,configurable:!0});import{createRequire as n}from"node:module";import{dirname as p}from"@visulima/path";import{toPath as u}from"@visulima/path/utils";import m from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import d from"./ensureDirSync-CoPWhbjM.js";import{g as _}from"./get-file-info-type-CaWGXRjY.js";const c=n(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,a=t(r=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[e,i]=o.versions.node.split(".").map(Number);if(e>22||e===22&&i>=3||e===20&&i>=16)return o.getBuiltinModule(r)}return c(r)},"__cjs_getBuiltinModule"),{lstatSync:f,writeFileSync:l}=a("node:fs");var g=Object.defineProperty,y=t((r,e)=>g(r,"name",{value:e,configurable:!0}),"o");const F=y(r=>{m(r);try{const e=f(r);if(!e.isFile())throw new Error(`Ensure path exists, expected 'file', got '${String(_(e))}'`)}catch(e){if(e.code==="ENOENT"){d(p(u(r))),l(r,new Uint8Array);return}throw e}},"ensureFileSync");export{F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var i=(t,e)=>f(t,"name",{value:e,configurable:!0});import{createRequire as u}from"node:module";import{toNamespacedPath as c,dirname as h}from"@visulima/path";import{toPath as m}from"@visulima/path/utils";import l from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import y from"./ensureDir-CZ4oUFuo.js";import{l as b}from"./is-stats-identical-CohsLtWy.js";const d=u(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=i(t=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[e,o]=s.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return s.getBuiltinModule(t)}return d(t)},"__cjs_getBuiltinModule"),{lstat:n,link:g}=_("node:fs/promises");var j=Object.defineProperty,v=i((t,e)=>j(t,"name",{value:e,configurable:!0}),"i");const M=v(async(t,e)=>{l(t),l(e),t=c(m(t)),e=c(m(e));let o;try{o=await n(e)}catch{}let a;try{a=await n(t)}catch(p){const r=p;throw r.message=r.message.replace("lstat","ensureLink"),r}o&&b(a,o)||(await y(h(e)),await g(t,e))},"ensureLink");export{M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var u=Object.defineProperty;var n=(o,e)=>u(o,"name",{value:e,configurable:!0});import{createRequire as f}from"node:module";import{toNamespacedPath as c,dirname as y}from"@visulima/path";import{toPath as m}from"@visulima/path/utils";import l from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import h from"./ensureDirSync-CoPWhbjM.js";import{l as b}from"./is-stats-identical-CohsLtWy.js";const d=f(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=n(o=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[e,t]=r.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return r.getBuiltinModule(o)}return d(o)},"__cjs_getBuiltinModule"),{lstatSync:a,linkSync:g}=_("node:fs");var j=Object.defineProperty,v=n((o,e)=>j(o,"name",{value:e,configurable:!0}),"m");const M=v((o,e)=>{l(o),l(e),o=c(m(o)),e=c(m(e));let t;try{t=a(e)}catch{}let i;try{i=a(o)}catch(p){const s=p;throw s.message=s.message.replace("lstat","ensureLink"),s}t&&b(i,t)||(h(y(e)),g(o,e))},"ensureLinkSync");export{M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var b=Object.defineProperty;var m=(i,e)=>b(i,"name",{value:e,configurable:!0});import{createRequire as j}from"node:module";import{toNamespacedPath as l,dirname as $,resolve as q}from"@visulima/path";import{toPath as d}from"@visulima/path/utils";import u from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import x from"./ensureDir-CZ4oUFuo.js";import{g as y}from"./get-file-info-type-CaWGXRjY.js";import{l as w}from"./is-stats-identical-CohsLtWy.js";import{o as E}from"./resolve-symlink-target-BofZSDIc.js";import g from"./AlreadyExistsError-CEu6_Tjb.js";const P=j(import.meta.url),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=m(i=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[e,o]=t.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return t.getBuiltinModule(i)}return P(i)},"__cjs_getBuiltinModule"),{lstat:f,stat:n,symlink:S,readlink:T}=k("node:fs/promises");var L=Object.defineProperty,A=m((i,e)=>L(i,"name",{value:e,configurable:!0}),"m");const B=process.platform==="win32"||/^(?:msys|cygwin)$/.test(process.env.OSTYPE),D=A(async(i,e,o)=>{u(i),u(e);const r=E(i,e);e=l(d(e));try{if((await f(e)).isSymbolicLink()&&w(await n(r),await n(e))){const[s,a]=await Promise.all([n(r),n(e)]);if(w(s,a))return}}catch{}const h=await f(r),_=y(h);await x($(e));let c=o??"file";o||(B?c="junction":c=_==="dir"?"dir":"file");try{await S(l(d(r)),e,c)}catch(s){if(s.code!=="EEXIST")throw s;const a=await f(e);if(!a.isSymbolicLink())throw new g(`A ${String(y(a))} already exists at the path: ${e}`);const v=await T(e),p=l(q(v));if(p!==r)throw new g(`A symlink targeting to an undesired path already exists: ${e} -> ${p}`)}},"ensureSymlink");export{D as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var b=Object.defineProperty;var m=(o,e)=>b(o,"name",{value:e,configurable:!0});import{createRequire as w}from"node:module";import{toNamespacedPath as f,dirname as T,resolve as q}from"@visulima/path";import{toPath as d}from"@visulima/path/utils";import u from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import x from"./ensureDirSync-CoPWhbjM.js";import{g as y}from"./get-file-info-type-CaWGXRjY.js";import{l as g}from"./is-stats-identical-CohsLtWy.js";import{o as E}from"./resolve-symlink-target-BofZSDIc.js";import h from"./AlreadyExistsError-CEu6_Tjb.js";const j=w(import.meta.url),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$=m(o=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[e,r]=t.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return t.getBuiltinModule(o)}return j(o)},"__cjs_getBuiltinModule"),{lstatSync:l,statSync:c,symlinkSync:k,readlinkSync:P}=$("node:fs");var L=Object.defineProperty,A=m((o,e)=>L(o,"name",{value:e,configurable:!0}),"p");const B=process.platform==="win32"||/^(?:msys|cygwin)$/.test(process.env.OSTYPE),D=A((o,e,r)=>{u(o),u(e);const i=E(o,e);e=f(d(e));try{if(l(e).isSymbolicLink()&&g(c(i),c(e))){const n=c(i),s=c(e);if(g(n,s))return}}catch{}const _=l(i),S=y(_);x(T(e));let a=r??"file";r||(B?a="junction":a=S==="dir"?"dir":"file");try{k(f(d(i)),e,a)}catch(n){if(n.code!=="EEXIST")throw n;const s=l(e);if(!s.isSymbolicLink())throw new h(`A ${String(y(s))} already exists at the path: ${e}`);const v=P(e),p=f(q(v));if(p!==i)throw new h(`A symlink targeting to an undesired path already exists: ${e} -> ${p}`)}},"ensureSymlinkSync");export{D as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var b=Object.defineProperty;var a=(r,e)=>b(r,"name",{value:e,configurable:!0});import{createRequire as v}from"node:module";import{resolve as c,parse as B,isAbsolute as R,dirname as S}from"@visulima/path";import{toPath as y}from"@visulima/path/utils";import{FIND_UP_STOP as U}from"./F_OK-CAwY1qU7.js";const T=v(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=a(r=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[e,i]=s.versions.node.split(".").map(Number);if(e>22||e===22&&i>=3||e===20&&i>=16)return s.getBuiltinModule(r)}return T(r)},"__cjs_getBuiltinModule"),{stat:j,lstat:A}=d("node:fs/promises"),{fileURLToPath:P}=d("node:url");var q=Object.defineProperty,m=a((r,e)=>q(r,"name",{value:e,configurable:!0}),"n");const N=m(async(r,e={})=>{if(typeof r!="string"&&!Array.isArray(r)&&typeof r!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const i=e.cwd?y(e.cwd):process.cwd();let t=c(i);const{root:f}=B(t),g=y(e.stopAt??f),_=c(t,g),u=e.type??"file",h=m(async function(n){return typeof r=="function"?[await r(n)]:typeof r=="string"?[r]:Array.isArray(r)?r:[r]},"getMatchers");e.allowSymlinks??=!0;const w=e.allowSymlinks?j:A;for(;t&&t!==_&&t!==f;){const n=await h(t);for(let o of n){if(o===U)return;if(o===void 0)continue;Buffer.isBuffer(o)?o=o.toString():o instanceof URL&&(o=P(o));const l=R(o)?o:c(t,o);try{const p=await w(l);if(u==="file"&&p.isFile()||u==="directory"&&p.isDirectory())return l}catch{}}t=S(t)}},"findUp");export{N as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var b=Object.defineProperty;var i=(e,t)=>b(e,"name",{value:t,configurable:!0});import{createRequire as v}from"node:module";import{resolve as c,parse as A,isAbsolute as P,dirname as B}from"@visulima/path";import{toPath as p}from"@visulima/path/utils";import{FIND_UP_STOP as R}from"./F_OK-CAwY1qU7.js";const w=v(import.meta.url),n=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=i(e=>{if(typeof n<"u"&&n.versions&&n.versions.node){const[t,s]=n.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return n.getBuiltinModule(e)}return w(e)},"__cjs_getBuiltinModule"),{statSync:S,lstatSync:T}=d("node:fs"),{fileURLToPath:j}=d("node:url");var U=Object.defineProperty,y=i((e,t)=>U(e,"name",{value:t,configurable:!0}),"o");const F=y((e,t={})=>{if(typeof e!="string"&&!Array.isArray(e)&&typeof e!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const s=t.cwd?p(t.cwd):process.cwd();let r=c(s);const{root:f}=A(r),m=p(t.stopAt??f),g=c(r,m),a=t.type??"file",_=y(function(o){return typeof e=="function"?[e(o)]:typeof e=="string"?[e]:Array.isArray(e)?e:[e]},"getMatchers");t.allowSymlinks??=!0;const h=t.allowSymlinks?S:T;for(;r&&r!==g&&r!==f;){for(let o of _(r)){if(o===R)return;if(o===void 0)continue;Buffer.isBuffer(o)?o=o.toString():o instanceof URL&&(o=j(o));const u=P(o)?o:c(r,o);try{const l=h(u);if(a==="file"&&l.isFile()||a==="directory"&&l.isDirectory())return u}catch{}}r=B(r)}},"findUpSync");export{F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=Object.defineProperty;var r=(e,i)=>n(e,"name",{value:i,configurable:!0});var t=Object.defineProperty,f=r((e,i)=>t(e,"name",{value:i,configurable:!0}),"i");const o=f(e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"},"getFileInfoType");export{o as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=Object.defineProperty;var r=(a,e)=>t(a,"name",{value:e,configurable:!0});import{b as o}from"./index-yGx8uzZs.js";var n=Object.defineProperty,b=r((a,e)=>n(a,"name",{value:e,configurable:!0}),"r");const f=b(async(a,e)=>await o(a,e),"glob");export{f as default};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { G as GlobOptions } from "./types.d-CHp56oCv.js";
|
|
2
|
+
/**
|
|
3
|
+
* Asynchronously matches files on disk using one or more glob patterns.
|
|
4
|
+
*
|
|
5
|
+
* Powered by [`tinyglobby`](https://github.com/SuperchupuDev/tinyglobby); `tinyglobby` is bundled into the
|
|
6
|
+
* built output so it does not appear as a runtime dependency of `@visulima/fs`.
|
|
7
|
+
*
|
|
8
|
+
* Pattern forms:
|
|
9
|
+
*
|
|
10
|
+
* - Plain glob — `src/**\/*.ts`
|
|
11
|
+
* - Negated pattern — `!src/**\/*.spec.ts` inside `patterns` adds to the internal ignore list (same as passing it via `ignore`).
|
|
12
|
+
* - Negated ignore — a leading `!` inside {@link GlobOptions.ignore} _un-ignores_ entries that an earlier ignore pattern would drop, e.g. `ignore: ["dist/**", "!dist/index.d.ts"]`.
|
|
13
|
+
* @param patterns A single glob pattern or an array of glob patterns.
|
|
14
|
+
* @param options Optional glob options. See {@link GlobOptions}.
|
|
15
|
+
* @returns A promise resolving to the array of matched paths. Paths are relative to {@link GlobOptions.cwd} unless {@link GlobOptions.absolute} is `true`.
|
|
16
|
+
* @example
|
|
17
|
+
* ```javascript
|
|
18
|
+
* import { glob } from "@visulima/fs";
|
|
19
|
+
*
|
|
20
|
+
* const jsFiles = await glob("src/**\/*.{js,ts}", { cwd: process.cwd(), ignore: ["**\/node_modules/**"] });
|
|
21
|
+
* console.log(jsFiles);
|
|
22
|
+
*
|
|
23
|
+
* // Negated ignore: drop everything under `ignored/` except `ignored/keep.ts`.
|
|
24
|
+
* const keep = await glob("**\/*.ts", { ignore: ["ignored/**", "!ignored/keep.ts"] });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare const glob: (patterns: string | ReadonlyArray<string>, options?: GlobOptions) => Promise<string[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Synchronously matches files on disk using one or more glob patterns.
|
|
30
|
+
*
|
|
31
|
+
* Synchronous counterpart of `glob`. Powered by [`tinyglobby`](https://github.com/SuperchupuDev/tinyglobby);
|
|
32
|
+
* bundled into the built output so it does not appear as a runtime dependency of `@visulima/fs`.
|
|
33
|
+
*
|
|
34
|
+
* Pattern forms:
|
|
35
|
+
*
|
|
36
|
+
* - Plain glob — `src/**\/*.ts`
|
|
37
|
+
* - Negated pattern — `!src/**\/*.spec.ts` inside `patterns` adds to the internal ignore list.
|
|
38
|
+
* - Negated ignore — a leading `!` inside {@link GlobOptions.ignore} _un-ignores_ entries that an earlier ignore pattern would drop, e.g. `ignore: ["dist/**", "!dist/index.d.ts"]`.
|
|
39
|
+
* @param patterns A single glob pattern or an array of glob patterns.
|
|
40
|
+
* @param options Optional glob options. See {@link GlobOptions}.
|
|
41
|
+
* @returns The array of matched paths. Paths are relative to {@link GlobOptions.cwd} unless {@link GlobOptions.absolute} is `true`.
|
|
42
|
+
* @example
|
|
43
|
+
* ```javascript
|
|
44
|
+
* import { globSync } from "@visulima/fs";
|
|
45
|
+
*
|
|
46
|
+
* const jsFiles = globSync(["src/**\/*.ts", "!**\/*.spec.ts"]);
|
|
47
|
+
* console.log(jsFiles);
|
|
48
|
+
*
|
|
49
|
+
* // Negated ignore: drop everything under `ignored/` except `ignored/keep.ts`.
|
|
50
|
+
* const keep = globSync("**\/*.ts", { ignore: ["ignored/**", "!ignored/keep.ts"] });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
declare const globSync: (patterns: string | ReadonlyArray<string>, options?: GlobOptions) => string[];
|
|
54
|
+
export { globSync as a, glob as g };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=Object.defineProperty;var a=(e,r)=>t(e,"name",{value:r,configurable:!0});import{x as o}from"./index-yGx8uzZs.js";var n=Object.defineProperty,c=a((e,r)=>n(e,"name",{value:r,configurable:!0}),"n");const s=c((e,r)=>o(e,r),"globSync");export{s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var w=Object.defineProperty;var s=(n,t)=>w(n,"name",{value:t,configurable:!0});var E=Object.defineProperty,i=s((n,t)=>E(n,"name",{value:t,configurable:!0}),"i");const K=/^(?:( )+|\t+)/,f="space";function g(n,t,e){return n&&t===f&&e===1}s(g,"I");i(g,"shouldIgnoreSingleSpace");function y(n,t){const e=new Map;let o=0,c,r;for(const u of n.split(/\n/g)){if(!u)continue;const l=u.match(K);if(l===null)o=0,c="";else{const d=l[0].length,a=l[1]?f:"tab";if(g(t,a,d))continue;a!==c&&(o=0),c=a;let m=1,I=0;const b=d-o;if(o=d,b===0)m=0,I=1;else{const h=Math.abs(b);if(g(t,a,h))continue;r=v(a,h)}const p=e.get(r);e.set(r,p===void 0?[1,0]:[p[0]+m,p[1]+I])}}return e}s(y,"h");i(y,"makeIndentsMap");function v(n,t){return(n===f?"s":"t")+String(t)}s(v,"m");i(v,"encodeIndentsKey");function M(n){const t=n[0]==="s"?f:"tab",e=Number(n.slice(1));return{type:t,amount:e}}s(M,"_");i(M,"decodeIndentsKey");function S(n){let t,e=0,o=0;for(const[c,[r,u]]of n)(r>e||r===e&&u>o)&&(e=r,o=u,t=c);return t}s(S,"k");i(S,"getMostUsedKey");function k(n,t){return(n===f?" ":" ").repeat(t)}s(k,"D");i(k,"makeIndentString");function x(n){if(typeof n!="string")throw new TypeError("Expected a string");let t=y(n,!0);t.size===0&&(t=y(n,!1));const e=S(t);let o,c=0,r="";return e!==void 0&&({type:o,amount:c}=M(e),r=k(o,c)),{amount:c,type:o,indent:r}}s(x,"C");i(x,"detectIndent");export{x as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var It=Object.defineProperty;var ut=(d,A)=>It(d,"name",{value:A,configurable:!0});import{g as Pt}from"./_commonjsHelpers-D6W6KoPK.js";var St={},xt,Ht;function bt(){if(Ht)return xt;Ht=1;const d="[^\\\\/]",A=Symbol("unignore"),H="\\.",v="\\+",D="\\?",p="\\/",x="(?=.)",c="[^/]",o=`(?:${p}|$)`,_=`(?:^|${p})`,g=`${H}{1,2}${o}`,G=`(?!${H})`,$=`(?!${_}${g})`,F=`(?!${H}{0,1}${o})`,M=`(?!${g})`,k=`[^.${p}]`,U=`${c}*?`,it="/",Z={DOT_LITERAL:H,PLUS_LITERAL:v,QMARK_LITERAL:D,SLASH_LITERAL:p,ONE_CHAR:x,QMARK:c,END_ANCHOR:o,DOTS_SLASH:g,NO_DOT:G,NO_DOTS:$,NO_DOT_SLASH:F,NO_DOTS_SLASH:M,QMARK_NO_DOT:k,STAR:U,START_ANCHOR:_,SEP:it},Q={...Z,SLASH_LITERAL:"[\\\\/]",QMARK:d,STAR:`${d}*?`,DOTS_SLASH:`${H}{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!${H})`,NO_DOTS:`(?!(?:^|[\\\\/])${H}{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!${H}{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!${H}{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},i={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return xt={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:i,UNIGNORE:A,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(s){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${s.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(s){return s===!0?Q:Z}},xt}ut(bt,"requireConstants");var Ot;function yt(){return Ot||(Ot=1,(function(d){const{REGEX_BACKSLASH:A,REGEX_REMOVE_BACKSLASH:H,REGEX_SPECIAL_CHARS:v,REGEX_SPECIAL_CHARS_GLOBAL:D}=bt();d.isObject=p=>p!==null&&typeof p=="object"&&!Array.isArray(p),d.hasRegexChars=p=>v.test(p),d.isRegexChar=p=>p.length===1&&d.hasRegexChars(p),d.escapeRegex=p=>p.replace(D,"\\$1"),d.toPosixSlashes=p=>p.replace(A,"/"),d.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const p=navigator.platform.toLowerCase();return p==="win32"||p==="windows"}return process.platform?process.platform==="win32":!1},d.removeBackslashes=p=>p.replace(H,x=>x==="\\"?"":x),d.escapeLast=(p,x,c)=>{const o=p.lastIndexOf(x,c);return o===-1?p:p[o-1]==="\\"?d.escapeLast(p,x,o-1):`${p.slice(0,o)}\\${p.slice(o)}`},d.removePrefix=(p,x={})=>{let c=p;return c.startsWith("./")&&(c=c.slice(2),x.prefix="./"),c},d.wrapOutput=(p,x={},c={})=>{const o=c.contains?"":"^",_=c.contains?"":"$";let g=`${o}(?:${p})${_}`;return x.negated===!0&&(g=`(?:^(?!${g}).*$)`),g},d.basename=(p,{windows:x}={})=>{const c=p.split(x?/[\\/]/:"/"),o=c[c.length-1];return o===""?c[c.length-2]:o}})(St)),St}ut(yt,"requireUtils");var Ct,mt;function wt(){if(mt)return Ct;mt=1;var d=Object.defineProperty,A=ut((s,u)=>d(s,"name",{value:u,configurable:!0}),"k");const H=yt(),{CHAR_ASTERISK:v,CHAR_AT:D,CHAR_BACKWARD_SLASH:p,CHAR_COMMA:x,CHAR_DOT:c,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:_,CHAR_LEFT_CURLY_BRACE:g,CHAR_LEFT_PARENTHESES:G,CHAR_LEFT_SQUARE_BRACKET:$,CHAR_PLUS:F,CHAR_QUESTION_MARK:M,CHAR_RIGHT_CURLY_BRACE:k,CHAR_RIGHT_PARENTHESES:U,CHAR_RIGHT_SQUARE_BRACKET:it}=bt(),Z=A(s=>s===_||s===p,"isPathSeparator"),Q=A(s=>{s.isPrefix!==!0&&(s.depth=s.isGlobstar?1/0:1)},"depth");return Ct=A((s,u)=>{const l=u||{},y=s.length-1,f=l.parts===!0||l.scanToEnd===!0,E=[],h=[],lt=[];let W=s,K=-1,X=0,j=0,J=!1,tt=!1,w=!1,pt=!1,ft=!1,O=!1,Y=!1,Rt=!1,_t=!1,L=!1,V=0,st,R,t={value:"",depth:0,isGlob:!1};const q=A(()=>K>=y,"eos"),rt=A(()=>W.charCodeAt(K+1),"peek"),z=A(()=>(st=R,W.charCodeAt(++K)),"advance");for(;K<y;){R=z();let P;if(R===p){Y=t.backslashes=!0,R=z(),R===g&&(O=!0);continue}if(O===!0||R===g){for(V++;q()!==!0&&(R=z());){if(R===p){Y=t.backslashes=!0,z();continue}if(R===g){V++;continue}if(O!==!0&&R===c&&(R=z())===c){if(J=t.isBrace=!0,w=t.isGlob=!0,L=!0,f===!0)continue;break}if(O!==!0&&R===x){if(J=t.isBrace=!0,w=t.isGlob=!0,L=!0,f===!0)continue;break}if(R===k&&(V--,V===0)){O=!1,J=t.isBrace=!0,L=!0;break}}if(f===!0)continue;break}if(R===_){if(E.push(K),h.push(t),t={value:"",depth:0,isGlob:!1},L===!0)continue;if(st===c&&K===X+1){X+=2;continue}j=K+1;continue}if(l.noext!==!0&&(R===F||R===D||R===v||R===M||R===o)&&rt()===G){if(w=t.isGlob=!0,pt=t.isExtglob=!0,L=!0,R===o&&K===X&&(_t=!0),f===!0){for(;q()!==!0&&(R=z());){if(R===p){Y=t.backslashes=!0,R=z();continue}if(R===U){w=t.isGlob=!0,L=!0;break}}continue}break}if(R===v){if(st===v&&(ft=t.isGlobstar=!0),w=t.isGlob=!0,L=!0,f===!0)continue;break}if(R===M){if(w=t.isGlob=!0,L=!0,f===!0)continue;break}if(R===$){for(;q()!==!0&&(P=z());){if(P===p){Y=t.backslashes=!0,z();continue}if(P===it){tt=t.isBracket=!0,w=t.isGlob=!0,L=!0;break}}if(f===!0)continue;break}if(l.nonegate!==!0&&R===o&&K===X){Rt=t.negated=!0,X++;continue}if(l.noparen!==!0&&R===G){if(w=t.isGlob=!0,f===!0){for(;q()!==!0&&(R=z());){if(R===G){Y=t.backslashes=!0,R=z();continue}if(R===U){L=!0;break}}continue}break}if(w===!0){if(L=!0,f===!0)continue;break}}l.noext===!0&&(pt=!1,w=!1);let e=W,n="",nt="";X>0&&(n=W.slice(0,X),W=W.slice(X),j-=X),e&&w===!0&&j>0?(e=W.slice(0,j),nt=W.slice(j)):w===!0?(e="",nt=W):e=W,e&&e!==""&&e!=="/"&&e!==W&&Z(e.charCodeAt(e.length-1))&&(e=e.slice(0,-1)),l.unescape===!0&&(nt&&(nt=H.removeBackslashes(nt)),e&&Y===!0&&(e=H.removeBackslashes(e)));const m={prefix:n,input:s,start:X,base:e,glob:nt,isBrace:J,isBracket:tt,isGlob:w,isExtglob:pt,isGlobstar:ft,negated:Rt,negatedExtglob:_t};if(l.tokens===!0&&(m.maxDepth=0,Z(R)||h.push(t),m.tokens=h),l.parts===!0||l.tokens===!0){let P;for(let I=0;I<E.length;I++){const et=P?P+1:X,At=E[I],ht=s.slice(et,At);l.tokens&&(I===0&&X!==0?(h[I].isPrefix=!0,h[I].value=n):h[I].value=ht,Q(h[I]),m.maxDepth+=h[I].depth),(I!==0||ht!=="")&<.push(ht),P=At}if(P&&P+1<s.length){const I=s.slice(P+1);lt.push(I),l.tokens&&(h[h.length-1].value=I,Q(h[h.length-1]),m.maxDepth+=h[h.length-1].depth)}m.slashes=E,m.parts=lt}return m},"scan"),Ct}ut(wt,"requireScan");var dt,Lt;function Bt(){if(Lt)return dt;Lt=1;var d=Object.defineProperty,A=ut((i,s)=>d(i,"name",{value:s,configurable:!0}),"y");const H=bt(),v=yt(),{MAX_LENGTH:D,POSIX_REGEX_SOURCE:p,REGEX_NON_SPECIAL_CHARS:x,REGEX_SPECIAL_CHARS_BACKREF:c,REPLACEMENTS:o}=H,_=A((i,s)=>typeof s.expandRange=="function"?s.expandRange(...i,s):(i.sort(),`[${i.join("-")}]`),"expandRange"),g=A((i,s)=>`Missing ${i}: "${s}" - use "\\\\${s}" to match literal characters`,"syntaxError"),G=A(i=>{const s=[];let u=0,l=0,y=0,f="",E=!1;for(const h of i){if(E===!0){f+=h,E=!1;continue}if(h==="\\"){f+=h,E=!0;continue}if(h==='"'){y=y===1?0:1,f+=h;continue}if(y===0){if(h==="[")u++;else if(h==="]"&&u>0)u--;else if(u===0){if(h==="(")l++;else if(h===")"&&l>0)l--;else if(h==="|"&&l===0){s.push(f),f="";continue}}}f+=h}return s.push(f),s},"splitTopLevel"),$=A(i=>{let s=!1;for(const u of i){if(s===!0){s=!1;continue}if(u==="\\"){s=!0;continue}if(/[?*+@!()[\]{}]/.test(u))return!1}return!0},"isPlainBranch"),F=A(i=>{let s=i.trim(),u=!0;for(;u===!0;)u=!1,/^@\([^\\()[\]{}|]+\)$/.test(s)&&(s=s.slice(2,-1),u=!0);if($(s))return s.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),M=A(i=>{const s=i.map(F).filter(Boolean);for(let u=0;u<s.length;u++)for(let l=u+1;l<s.length;l++){const y=s[u],f=s[l],E=y[0];if(!(!E||y!==E.repeat(y.length)||f!==E.repeat(f.length))&&(y===f||y.startsWith(f)||f.startsWith(y)))return!0}return!1},"hasRepeatedCharPrefixOverlap"),k=A((i,s=!0)=>{if(i[0]!=="+"&&i[0]!=="*"||i[1]!=="(")return;let u=0,l=0,y=0,f=!1;for(let E=1;E<i.length;E++){const h=i[E];if(f===!0){f=!1;continue}if(h==="\\"){f=!0;continue}if(h==='"'){y=y===1?0:1;continue}if(y!==1){if(h==="["){u++;continue}if(h==="]"&&u>0){u--;continue}if(!(u>0)){if(h==="("){l++;continue}if(h===")"&&(l--,l===0))return s===!0&&E!==i.length-1?void 0:{type:i[0],body:i.slice(2,E),end:E}}}}},"parseRepeatedExtglob"),U=A(i=>{let s=0;const u=[];for(;s<i.length;){const l=k(i.slice(s),!1);if(!l||l.type!=="*")return;const y=G(l.body).map(E=>E.trim());if(y.length!==1)return;const f=F(y[0]);if(!f||f.length!==1)return;u.push(f),s+=l.end+1}return u.length<1?void 0:`${u.length===1?v.escapeRegex(u[0]):`[${u.map(l=>v.escapeRegex(l)).join("")}]`}*`},"getStarExtglobSequenceOutput"),it=A(i=>{let s=0,u=i.trim(),l=k(u);for(;l;)s++,u=l.body.trim(),l=k(u);return s},"repeatedExtglobRecursion"),Z=A((i,s)=>{if(s.maxExtglobRecursion===!1)return{risky:!1};const u=typeof s.maxExtglobRecursion=="number"?s.maxExtglobRecursion:H.DEFAULT_MAX_EXTGLOB_RECURSION,l=G(i).map(y=>y.trim());if(l.length>1&&(l.some(y=>y==="")||l.some(y=>/^[*?]+$/.test(y))||M(l)))return{risky:!0};for(const y of l){const f=U(y);if(f)return{risky:!0,safeOutput:f};if(it(y)>u)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),Q=A((i,s)=>{if(typeof i!="string")throw new TypeError("Expected a string");i=o[i]||i;const u={...s},l=typeof u.maxLength=="number"?Math.min(D,u.maxLength):D;let y=i.length;if(y>l)throw new SyntaxError(`Input length: ${y}, exceeds maximum allowed length: ${l}`);const f={type:"bos",value:"",output:u.prepend||""},E=[f],h=u.capture?"":"?:",lt=H.globChars(u.windows),W=H.extglobChars(lt),{DOT_LITERAL:K,PLUS_LITERAL:X,SLASH_LITERAL:j,ONE_CHAR:J,DOTS_SLASH:tt,NO_DOT:w,NO_DOT_SLASH:pt,NO_DOTS_SLASH:ft,QMARK:O,QMARK_NO_DOT:Y,STAR:Rt,START_ANCHOR:_t}=lt,L=A(a=>`(${h}(?:(?!${_t}${a.dot?tt:K}).)*?)`,"globstar"),V=u.dot?"":w,st=u.dot?O:Y;let R=u.bash===!0?L(u):Rt;u.capture&&(R=`(${R})`),typeof u.noext=="boolean"&&(u.noextglob=u.noext);const t={input:i,index:-1,start:0,dot:u.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:E};i=v.removePrefix(i,t),y=i.length;const q=[],rt=[],z=[];let e=f,n;const nt=A(()=>t.index===y-1,"eos"),m=t.peek=(a=1)=>i[t.index+a],P=t.advance=()=>i[++t.index]||"",I=A(()=>i.slice(t.index+1),"remaining"),et=A((a="",T=0)=>{t.consumed+=a,t.index+=T},"consume"),At=A(a=>{t.output+=a.output!=null?a.output:a.value,et(a.value)},"append"),ht=A(()=>{let a=1;for(;m()==="!"&&(m(2)!=="("||m(3)==="?");)P(),t.start++,a++;return a%2===0?!1:(t.negated=!0,t.start++,!0)},"negate"),gt=A(a=>{t[a]++,z.push(a)},"increment"),ct=A(a=>{t[a]--,z.pop()},"decrement"),b=A(a=>{if(e.type==="globstar"){const T=t.braces>0&&(a.type==="comma"||a.type==="brace"),r=a.extglob===!0||q.length&&(a.type==="pipe"||a.type==="paren");a.type!=="slash"&&a.type!=="paren"&&!T&&!r&&(t.output=t.output.slice(0,-e.output.length),e.type="star",e.value="*",e.output=R,t.output+=e.output)}if(q.length&&a.type!=="paren"&&(q[q.length-1].inner+=a.value),(a.value||a.output)&&At(a),e&&e.type==="text"&&a.type==="text"){e.output=(e.output||e.value)+a.value,e.value+=a.value;return}a.prev=e,E.push(a),e=a},"push"),Et=A((a,T)=>{const r={...W[T],conditions:1,inner:""};r.prev=e,r.parens=t.parens,r.output=t.output,r.startIndex=t.index,r.tokensIndex=E.length;const S=(u.capture?"(":"")+r.open;gt("parens"),b({type:a,value:T,output:t.output?"":J}),b({type:"paren",extglob:!0,value:P(),output:S}),q.push(r)},"extglobOpen"),Nt=A(a=>{const T=i.slice(a.startIndex,t.index+1),r=i.slice(a.startIndex+2,t.index),S=Z(r,u);if((a.type==="plus"||a.type==="star")&&S.risky){const C=S.safeOutput?(a.output?"":J)+(u.capture?`(${S.safeOutput})`:S.safeOutput):void 0,at=E[a.tokensIndex];at.type="text",at.value=T,at.output=C||v.escapeRegex(T);for(let ot=a.tokensIndex+1;ot<E.length;ot++)E[ot].value="",E[ot].output="",delete E[ot].suffix;t.output=a.output+at.output,t.backtrack=!0,b({type:"paren",extglob:!0,value:n,output:""}),ct("parens");return}let N=a.close+(u.capture?")":""),B;if(a.type==="negate"){let C=R;if(a.inner&&a.inner.length>1&&a.inner.includes("/")&&(C=L(u)),(C!==R||nt()||/^\)+$/.test(I()))&&(N=a.close=`)$))${C}`),a.inner.includes("*")&&(B=I())&&/^\.[^\\/.]+$/.test(B)){const at=Q(B,{...s,fastpaths:!1}).output;N=a.close=`)${at})${C})`}a.prev.type==="bos"&&(t.negatedExtglob=!0)}b({type:"paren",extglob:!0,value:n,output:N}),ct("parens")},"extglobClose");if(u.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(i)){let a=!1,T=i.replace(c,(r,S,N,B,C,at)=>B==="\\"?(a=!0,r):B==="?"?S?S+B+(C?O.repeat(C.length):""):at===0?st+(C?O.repeat(C.length):""):O.repeat(N.length):B==="."?K.repeat(N.length):B==="*"?S?S+B+(C?R:""):R:S?r:`\\${r}`);return a===!0&&(u.unescape===!0?T=T.replace(/\\/g,""):T=T.replace(/\\+/g,r=>r.length%2===0?"\\\\":r?"\\":"")),T===i&&u.contains===!0?(t.output=i,t):(t.output=v.wrapOutput(T,t,s),t)}for(;!nt();){if(n=P(),n==="\0")continue;if(n==="\\"){const r=m();if(r==="/"&&u.bash!==!0||r==="."||r===";")continue;if(!r){n+="\\",b({type:"text",value:n});continue}const S=/^\\+/.exec(I());let N=0;if(S&&S[0].length>2&&(N=S[0].length,t.index+=N,N%2!==0&&(n+="\\")),u.unescape===!0?n=P():n+=P(),t.brackets===0){b({type:"text",value:n});continue}}if(t.brackets>0&&(n!=="]"||e.value==="["||e.value==="[^")){if(u.posix!==!1&&n===":"){const r=e.value.slice(1);if(r.includes("[")&&(e.posix=!0,r.includes(":"))){const S=e.value.lastIndexOf("["),N=e.value.slice(0,S),B=e.value.slice(S+2),C=p[B];if(C){e.value=N+C,t.backtrack=!0,P(),!f.output&&E.indexOf(e)===1&&(f.output=J);continue}}}(n==="["&&m()!==":"||n==="-"&&m()==="]")&&(n=`\\${n}`),n==="]"&&(e.value==="["||e.value==="[^")&&(n=`\\${n}`),u.posix===!0&&n==="!"&&e.value==="["&&(n="^"),e.value+=n,At({value:n});continue}if(t.quotes===1&&n!=='"'){n=v.escapeRegex(n),e.value+=n,At({value:n});continue}if(n==='"'){t.quotes=t.quotes===1?0:1,u.keepQuotes===!0&&b({type:"text",value:n});continue}if(n==="("){gt("parens"),b({type:"paren",value:n});continue}if(n===")"){if(t.parens===0&&u.strictBrackets===!0)throw new SyntaxError(g("opening","("));const r=q[q.length-1];if(r&&t.parens===r.parens+1){Nt(q.pop());continue}b({type:"paren",value:n,output:t.parens?")":"\\)"}),ct("parens");continue}if(n==="["){if(u.nobracket===!0||!I().includes("]")){if(u.nobracket!==!0&&u.strictBrackets===!0)throw new SyntaxError(g("closing","]"));n=`\\${n}`}else gt("brackets");b({type:"bracket",value:n});continue}if(n==="]"){if(u.nobracket===!0||e&&e.type==="bracket"&&e.value.length===1){b({type:"text",value:n,output:`\\${n}`});continue}if(t.brackets===0){if(u.strictBrackets===!0)throw new SyntaxError(g("opening","["));b({type:"text",value:n,output:`\\${n}`});continue}ct("brackets");const r=e.value.slice(1);if(e.posix!==!0&&r[0]==="^"&&!r.includes("/")&&(n=`/${n}`),e.value+=n,At({value:n}),u.literalBrackets===!1||v.hasRegexChars(r))continue;const S=v.escapeRegex(e.value);if(t.output=t.output.slice(0,-e.value.length),u.literalBrackets===!0){t.output+=S,e.value=S;continue}e.value=`(${h}${S}|${e.value})`,t.output+=e.value;continue}if(n==="{"&&u.nobrace!==!0){gt("braces");const r={type:"brace",value:n,output:"(",outputIndex:t.output.length,tokensIndex:t.tokens.length};rt.push(r),b(r);continue}if(n==="}"){const r=rt[rt.length-1];if(u.nobrace===!0||!r){b({type:"text",value:n,output:n});continue}let S=")";if(r.dots===!0){const N=E.slice(),B=[];for(let C=N.length-1;C>=0&&(E.pop(),N[C].type!=="brace");C--)N[C].type!=="dots"&&B.unshift(N[C].value);S=_(B,u),t.backtrack=!0}if(r.comma!==!0&&r.dots!==!0){const N=t.output.slice(0,r.outputIndex),B=t.tokens.slice(r.tokensIndex);r.value=r.output="\\{",n=S="\\}",t.output=N;for(const C of B)t.output+=C.output||C.value}b({type:"brace",value:n,output:S}),ct("braces"),rt.pop();continue}if(n==="|"){q.length>0&&q[q.length-1].conditions++,b({type:"text",value:n});continue}if(n===","){let r=n;const S=rt[rt.length-1];S&&z[z.length-1]==="braces"&&(S.comma=!0,r="|"),b({type:"comma",value:n,output:r});continue}if(n==="/"){if(e.type==="dot"&&t.index===t.start+1){t.start=t.index+1,t.consumed="",t.output="",E.pop(),e=f;continue}b({type:"slash",value:n,output:j});continue}if(n==="."){if(t.braces>0&&e.type==="dot"){e.value==="."&&(e.output=K);const r=rt[rt.length-1];e.type="dots",e.output+=n,e.value+=n,r.dots=!0;continue}if(t.braces+t.parens===0&&e.type!=="bos"&&e.type!=="slash"){b({type:"text",value:n,output:K});continue}b({type:"dot",value:n,output:K});continue}if(n==="?"){if(!(e&&e.value==="(")&&u.noextglob!==!0&&m()==="("&&m(2)!=="?"){Et("qmark",n);continue}if(e&&e.type==="paren"){const r=m();let S=n;(e.value==="("&&!/[!=<:]/.test(r)||r==="<"&&!/<([!=]|\w+>)/.test(I()))&&(S=`\\${n}`),b({type:"text",value:n,output:S});continue}if(u.dot!==!0&&(e.type==="slash"||e.type==="bos")){b({type:"qmark",value:n,output:Y});continue}b({type:"qmark",value:n,output:O});continue}if(n==="!"){if(u.noextglob!==!0&&m()==="("&&(m(2)!=="?"||!/[!=<:]/.test(m(3)))){Et("negate",n);continue}if(u.nonegate!==!0&&t.index===0){ht();continue}}if(n==="+"){if(u.noextglob!==!0&&m()==="("&&m(2)!=="?"){Et("plus",n);continue}if(e&&e.value==="("||u.regex===!1){b({type:"plus",value:n,output:X});continue}if(e&&(e.type==="bracket"||e.type==="paren"||e.type==="brace")||t.parens>0){b({type:"plus",value:n});continue}b({type:"plus",value:X});continue}if(n==="@"){if(u.noextglob!==!0&&m()==="("&&m(2)!=="?"){b({type:"at",extglob:!0,value:n,output:""});continue}b({type:"text",value:n});continue}if(n!=="*"){(n==="$"||n==="^")&&(n=`\\${n}`);const r=x.exec(I());r&&(n+=r[0],t.index+=r[0].length),b({type:"text",value:n});continue}if(e&&(e.type==="globstar"||e.star===!0)){e.type="star",e.star=!0,e.value+=n,e.output=R,t.backtrack=!0,t.globstar=!0,et(n);continue}let a=I();if(u.noextglob!==!0&&/^\([^?]/.test(a)){Et("star",n);continue}if(e.type==="star"){if(u.noglobstar===!0){et(n);continue}const r=e.prev,S=r.prev,N=r.type==="slash"||r.type==="bos",B=S&&(S.type==="star"||S.type==="globstar");if(u.bash===!0&&(!N||a[0]&&a[0]!=="/")){b({type:"star",value:n,output:""});continue}const C=t.braces>0&&(r.type==="comma"||r.type==="brace"),at=q.length&&(r.type==="pipe"||r.type==="paren");if(!N&&r.type!=="paren"&&!C&&!at){b({type:"star",value:n,output:""});continue}for(;a.slice(0,3)==="/**";){const ot=i[t.index+4];if(ot&&ot!=="/")break;a=a.slice(3),et("/**",3)}if(r.type==="bos"&&nt()){e.type="globstar",e.value+=n,e.output=L(u),t.output=e.output,t.globstar=!0,et(n);continue}if(r.type==="slash"&&r.prev.type!=="bos"&&!B&&nt()){t.output=t.output.slice(0,-(r.output+e.output).length),r.output=`(?:${r.output}`,e.type="globstar",e.output=L(u)+(u.strictSlashes?")":"|$)"),e.value+=n,t.globstar=!0,t.output+=r.output+e.output,et(n);continue}if(r.type==="slash"&&r.prev.type!=="bos"&&a[0]==="/"){const ot=a[1]!==void 0?"|$":"";t.output=t.output.slice(0,-(r.output+e.output).length),r.output=`(?:${r.output}`,e.type="globstar",e.output=`${L(u)}${j}|${j}${ot})`,e.value+=n,t.output+=r.output+e.output,t.globstar=!0,et(n+P()),b({type:"slash",value:"/",output:""});continue}if(r.type==="bos"&&a[0]==="/"){e.type="globstar",e.value+=n,e.output=`(?:^|${j}|${L(u)}${j})`,t.output=e.output,t.globstar=!0,et(n+P()),b({type:"slash",value:"/",output:""});continue}if(C&&a[0]==="/"){e.type="globstar",e.value+=n,e.output=`(?:^|${j}|${L(u)}${j})`,t.output+=e.output,t.globstar=!0,et(n+P()),b({type:"slash",value:"/",output:""});continue}t.output=t.output.slice(0,-e.output.length),e.type="globstar",e.output=L(u),e.value+=n,t.output+=e.output,t.globstar=!0,et(n);continue}const T={type:"star",value:n,output:R};if(u.bash===!0){T.output=".*?",(e.type==="bos"||e.type==="slash")&&(T.output=V+T.output),b(T);continue}if(e&&(e.type==="bracket"||e.type==="paren")&&u.regex===!0){T.output=n,b(T);continue}(t.index===t.start||e.type==="slash"||e.type==="dot")&&(e.type==="dot"?(t.output+=pt,e.output+=pt):u.dot===!0?(t.output+=ft,e.output+=ft):(t.output+=V,e.output+=V),m()!=="*"&&(t.output+=J,e.output+=J)),b(T)}for(;t.brackets>0;){if(u.strictBrackets===!0)throw new SyntaxError(g("closing","]"));t.output=v.escapeLast(t.output,"["),ct("brackets")}for(;t.parens>0;){if(u.strictBrackets===!0)throw new SyntaxError(g("closing",")"));t.output=v.escapeLast(t.output,"("),ct("parens")}for(;t.braces>0;){if(u.strictBrackets===!0)throw new SyntaxError(g("closing","}"));t.output=v.escapeLast(t.output,"{"),ct("braces")}if(u.strictSlashes!==!0&&(e.type==="star"||e.type==="bracket")&&b({type:"maybe_slash",value:"",output:`${j}?`}),t.backtrack===!0){t.output="";for(const a of t.tokens)t.output+=a.output!=null?a.output:a.value,a.suffix&&(t.output+=a.suffix)}return t},"parse");return Q.fastpaths=(i,s)=>{const u={...s},l=typeof u.maxLength=="number"?Math.min(D,u.maxLength):D,y=i.length;if(y>l)throw new SyntaxError(`Input length: ${y}, exceeds maximum allowed length: ${l}`);i=o[i]||i;const{DOT_LITERAL:f,SLASH_LITERAL:E,ONE_CHAR:h,DOTS_SLASH:lt,NO_DOT:W,NO_DOTS:K,NO_DOTS_SLASH:X,STAR:j,START_ANCHOR:J}=H.globChars(u.windows),tt=u.dot?K:W,w=u.dot?X:W,pt=u.capture?"":"?:",ft={negated:!1,prefix:""};let O=u.bash===!0?".*?":j;u.capture&&(O=`(${O})`);const Y=A(V=>V.noglobstar===!0?O:`(${pt}(?:(?!${J}${V.dot?lt:f}).)*?)`,"globstar"),Rt=A(V=>{switch(V){case"*":return`${tt}${h}${O}`;case".*":return`${f}${h}${O}`;case"*.*":return`${tt}${O}${f}${h}${O}`;case"*/*":return`${tt}${O}${E}${h}${w}${O}`;case"**":return tt+Y(u);case"**/*":return`(?:${tt}${Y(u)}${E})?${w}${h}${O}`;case"**/*.*":return`(?:${tt}${Y(u)}${E})?${w}${O}${f}${h}${O}`;case"**/.*":return`(?:${tt}${Y(u)}${E})?${f}${h}${O}`;default:{const st=/^(.*?)\.(\w+)$/.exec(V);if(!st)return;const R=Rt(st[1]);return R?R+f+st[2]:void 0}}},"create"),_t=v.removePrefix(i,ft);let L=Rt(_t);return L&&u.strictSlashes!==!0&&(L+=`${E}?`),L},dt=Q,dt}ut(Bt,"requireParse");var vt,Tt;function Gt(){if(Tt)return vt;Tt=1;var d=Object.defineProperty,A=ut((o,_)=>d(o,"name",{value:_,configurable:!0}),"h");const H=wt(),v=Bt(),D=yt(),p=bt(),x=A(o=>o&&typeof o=="object"&&!Array.isArray(o),"isObject"),c=A((o,_,g=!1)=>{if(Array.isArray(o)){const Z=o.map(Q=>c(Q,_,g));return A(Q=>{for(const i of Z){const s=i(Q);if(s)return s}return!1},"arrayMatcher")}const G=x(o)&&o.tokens&&o.input;if(o===""||typeof o!="string"&&!G)throw new TypeError("Expected pattern to be a non-empty string");const $=_||{},F=$.windows,M=G?c.compileRe(o,_):c.makeRe(o,_,!1,!0),k=M.state;delete M.state;let U=A(()=>!1,"isIgnored");if($.ignore){const Z={..._,ignore:null,onMatch:null,onResult:null};U=c($.ignore,Z,g)}const it=A((Z,Q=!1)=>{const{isMatch:i,match:s,output:u}=c.test(Z,M,_,{glob:o,posix:F}),l={glob:o,state:k,regex:M,posix:F,input:Z,output:u,match:s,isMatch:i};if(typeof $.onResult=="function"&&$.onResult(l),i===!1)return l.isMatch=!1,Q?l:!1;t:if(U(Z)){if(typeof $.onIgnore=="function"&&$.onIgnore(l)===p.UNIGNORE){l.isMatch=!0;break t}return l.isMatch=!1,Q?l:!1}return typeof $.onMatch=="function"&&$.onMatch(l),Q?l:!0},"matcher");return g&&(it.state=k),it},"picomatch");return c.test=(o,_,g,{glob:G,posix:$}={})=>{if(typeof o!="string")throw new TypeError("Expected input to be a string");if(o==="")return{isMatch:!1,output:""};const F=g||{},M=F.format||($?D.toPosixSlashes:null);let k=o===G,U=k&&M?M(o):o;return k===!1&&(U=M?M(o):o,k=U===G),(k===!1||F.capture===!0)&&(F.matchBase===!0||F.basename===!0?k=c.matchBase(o,_,g,$):k=_.exec(U)),{isMatch:!!k,match:k,output:U}},c.matchBase=(o,_,g)=>(_ instanceof RegExp?_:c.makeRe(_,g)).test(D.basename(o)),c.isMatch=(o,_,g)=>c(_,g)(o),c.parse=(o,_)=>Array.isArray(o)?o.map(g=>c.parse(g,_)):v(o,{..._,fastpaths:!1}),c.scan=(o,_)=>H(o,_),c.compileRe=(o,_,g=!1,G=!1)=>{if(g===!0)return o.output;const $=_||{},F=$.contains?"":"^",M=$.contains?"":"$";let k=`${F}(?:${o.output})${M}`;o&&o.negated===!0&&(k=`^(?!${k}).*$`);const U=c.toRegex(k,_);return G===!0&&(U.state=o),U},c.makeRe=(o,_={},g=!1,G=!1)=>{if(!o||typeof o!="string")throw new TypeError("Expected a non-empty string");let $={negated:!1,fastpaths:!0};return _.fastpaths!==!1&&(o[0]==="."||o[0]==="*")&&($.output=v.fastpaths(o,_)),$.output||($=v(o,_)),c.compileRe($,_,g,G)},c.toRegex=(o,_)=>{try{const g=_||{};return new RegExp(o,g.flags||(g.nocase?"i":""))}catch(g){if(_&&_.debug===!0)throw g;return/$^/}},c.constants=p,vt=c,vt}ut(Gt,"requirePicomatch$1");var $t,kt;function Mt(){if(kt)return $t;kt=1;var d=Object.defineProperty,A=ut((p,x)=>d(p,"name",{value:x,configurable:!0}),"c");const H=Gt(),v=yt();function D(p,x,c=!1){return x&&(x.windows===null||x.windows===void 0)&&(x={...x,windows:v.isWindows()}),H(p,x,c)}return ut(D,"picomatch"),A(D,"picomatch"),Object.assign(D,H),$t=D,$t}ut(Mt,"requirePicomatch");var Dt=Mt();const Xt=Pt(Dt);export{Xt as s};
|