@visulima/fs 5.0.0-alpha.9 → 5.0.1
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 +461 -0
- package/LICENSE.md +81 -4
- package/README.md +65 -0
- package/dist/eol.d.ts +30 -0
- package/dist/eol.js +3 -26
- package/dist/error.d.ts +243 -13
- package/dist/error.js +1 -7
- package/dist/glob-parent.d.ts +30 -0
- package/dist/glob-parent.js +1 -90
- package/dist/glob.d.ts +3 -4
- package/dist/glob.js +1 -2
- package/dist/index.d.ts +877 -28
- package/dist/index.js +1 -38
- package/dist/ini.d.ts +64 -4
- package/dist/ini.js +1 -4
- package/dist/is-glob.d.ts +29 -0
- package/dist/is-glob.js +1 -9
- package/dist/json5.d.ts +28 -4
- package/dist/json5.js +1 -4
- package/dist/jsonc.d.ts +59 -4
- package/dist/jsonc.js +1 -4
- package/dist/match.d.ts +77 -2
- package/dist/match.js +1 -15
- package/dist/packem_shared/AlreadyExistsError-DEb3UWja.js +1 -0
- package/dist/packem_shared/DirectoryError-BtwSTLmT.js +1 -0
- package/dist/packem_shared/FIND_UP_STOP-CAwY1qU7.js +1 -0
- package/dist/packem_shared/JSONError-Cvp9ycba.js +4 -0
- package/dist/packem_shared/NotEmptyError-DZ1Ix089.js +1 -0
- package/dist/packem_shared/NotFoundError-CnRY6lVp.js +1 -0
- package/dist/packem_shared/PermissionError-DJ_2VWEj.js +1 -0
- package/dist/packem_shared/WalkError-B8qTd-v-.js +1 -0
- package/dist/packem_shared/_commonjsHelpers-CWAkuNXM.js +1 -0
- package/dist/packem_shared/assertValidFileContents-CbIN7sy7.js +1 -0
- package/dist/packem_shared/assertValidFileOrDirectoryPath-BTlt945W.js +1 -0
- package/dist/packem_shared/build-rm-options-avnusYx-.js +1 -0
- package/dist/packem_shared/collect-CIKDOMiD.js +1 -0
- package/dist/packem_shared/collectSync-D0FRLLqg.js +1 -0
- package/dist/packem_shared/copy-Beb64BYG.js +1 -0
- package/dist/packem_shared/copySync-CagcIEBi.js +1 -0
- package/dist/packem_shared/emptyDir-C7lyd1lW.js +1 -0
- package/dist/packem_shared/emptyDirSync-B8EYpmO9.js +1 -0
- package/dist/packem_shared/ensureDir-DGarVZw8.js +1 -0
- package/dist/packem_shared/ensureDirSync-CsgPrsDH.js +1 -0
- package/dist/packem_shared/ensureFile-CMugWljp.js +1 -0
- package/dist/packem_shared/ensureFileSync-CJYTEx2r.js +1 -0
- package/dist/packem_shared/ensureLink-ChShf3lf.js +1 -0
- package/dist/packem_shared/ensureLinkSync-DPpq0I2Z.js +1 -0
- package/dist/packem_shared/ensureSymlink-y4FZjfxA.js +1 -0
- package/dist/packem_shared/ensureSymlinkSync-TcHssCH7.js +1 -0
- package/dist/packem_shared/findUp-Cii5ATt5.js +1 -0
- package/dist/packem_shared/findUpSync-C9Lkh7-v.js +1 -0
- package/dist/packem_shared/get-file-info-type-DzWpohDB.js +1 -0
- package/dist/packem_shared/glob-DMbPwGSj.js +1 -0
- package/dist/packem_shared/glob-sync.d-hXe38TnZ.d.ts +54 -0
- package/dist/packem_shared/globSync-DiP2rtGn.js +1 -0
- package/dist/packem_shared/index-B2MhYg3r.js +1 -0
- package/dist/packem_shared/index-BHy3Kcr7.js +11 -0
- package/dist/packem_shared/index-Ct4GqZSP.js +1 -0
- package/dist/packem_shared/index-LUKYN3u3.js +1 -0
- package/dist/packem_shared/ini-preserve-D1DopDLd.js +4 -0
- package/dist/packem_shared/is-stats-identical-l1GRN4Qu.js +1 -0
- package/dist/packem_shared/isAccessible-PmWJhV6I.js +1 -0
- package/dist/packem_shared/isAccessibleSync-BrbOtwdr.js +1 -0
- package/dist/packem_shared/json-error.d-DVILOyHc.d.ts +52 -0
- package/dist/packem_shared/jsonc-merge-Bkw73TLW.js +2 -0
- package/dist/packem_shared/map-read-error-CR3rQUxx.js +1 -0
- package/dist/packem_shared/move-DopmzT-2.js +1 -0
- package/dist/packem_shared/parseJson-EASgP4J9.js +1 -0
- package/dist/packem_shared/readFile-BswaBgM0.js +1 -0
- package/dist/packem_shared/readFileSync-_fDF6Oj1.js +1 -0
- package/dist/packem_shared/readIni-BsXudu2r.js +1 -0
- package/dist/packem_shared/readIniSync-DKwRbbs9.js +1 -0
- package/dist/packem_shared/readJson-CcAsHxE5.js +1 -0
- package/dist/packem_shared/readJson5-CM1TIiHd.js +1 -0
- package/dist/packem_shared/readJson5Sync-Bc26c3Fy.js +1 -0
- package/dist/packem_shared/readJsonSync-DuMMeB3s.js +1 -0
- package/dist/packem_shared/readJsonc-BZjMw_0f.js +1 -0
- package/dist/packem_shared/readJsoncSync-C-xzeZz4.js +1 -0
- package/dist/packem_shared/readToml-D4jpe9q_.js +1 -0
- package/dist/packem_shared/readTomlSync-B5PIYT9z.js +1 -0
- package/dist/packem_shared/readYaml-DvPxndW_.js +1 -0
- package/dist/packem_shared/readYamlSync-DZ-0hSbZ.js +1 -0
- package/dist/packem_shared/remove-CSbrd0dl.js +1 -0
- package/dist/packem_shared/removeSync-BoLAzRQE.js +1 -0
- package/dist/packem_shared/renderError-B3ePOoBG-Bi9WKMjv.js +6 -0
- package/dist/packem_shared/resolve-symlink-target-CWrn0v4P.js +1 -0
- package/dist/packem_shared/sanitize-DGZ3w-_w.js +1 -0
- package/dist/packem_shared/stripJsonComments-Bfcn2PKv.js +1 -0
- package/dist/packem_shared/to-uint-8-array-BImOQNXm.js +1 -0
- package/dist/packem_shared/types.d-BMdL_ygj.d.ts +1773 -0
- package/dist/packem_shared/walk-OX4-6oCP.js +1 -0
- package/dist/packem_shared/walk-include-BXhGSn6t.js +1 -0
- package/dist/packem_shared/walkSync-BPs6czIM.js +1 -0
- package/dist/packem_shared/writeFile-BrMtsJY7.js +1 -0
- package/dist/packem_shared/writeFileSync-W7Mf4BNy.js +1 -0
- package/dist/packem_shared/writeIni-BWX3cP1K.js +4 -0
- package/dist/packem_shared/writeIniSync-fOdgPFfL.js +4 -0
- package/dist/packem_shared/writeJson-bEVi25gX.js +4 -0
- package/dist/packem_shared/writeJson5-Ch8TpNPI.js +4 -0
- package/dist/packem_shared/writeJson5Sync-BrctV_Mk.js +4 -0
- package/dist/packem_shared/writeJsonSync-DkGnd416.js +4 -0
- package/dist/packem_shared/writeJsonc-CefrwsOc.js +4 -0
- package/dist/packem_shared/writeJsoncSync-BskDjn8o.js +4 -0
- package/dist/packem_shared/writeToml-IuMO-yDu.js +1 -0
- package/dist/packem_shared/writeTomlSync-DhL7hHzB.js +1 -0
- package/dist/packem_shared/writeYaml-ClQgvQID.js +1 -0
- package/dist/packem_shared/writeYamlSync-DrXtHQQq.js +1 -0
- package/dist/size.d.ts +244 -0
- package/dist/size.js +1 -146
- package/dist/toml.d.ts +57 -3
- package/dist/toml.js +1 -4
- package/dist/utils.d.ts +92 -4
- package/dist/utils.js +1 -6
- package/dist/yaml.d.ts +3 -4
- package/dist/yaml.js +1 -4
- package/package.json +41 -44
- 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-DER5A43G.js +0 -24
- package/dist/packem_shared/_commonjsHelpers-BqLXS_qQ.js +0 -5
- package/dist/packem_shared/assertValidFileContents-BmcLtsGd.js +0 -7
- package/dist/packem_shared/assertValidFileOrDirectoryPath-8HANmVjk.js +0 -7
- package/dist/packem_shared/build-rm-options-Cl3VDY4O.js +0 -12
- package/dist/packem_shared/collect-CqQ3eVab.js +0 -14
- package/dist/packem_shared/collectSync-noE08NNv.js +0 -14
- package/dist/packem_shared/emptyDir-DnwENOaV.js +0 -46
- package/dist/packem_shared/emptyDirSync-6WiHBo8a.js +0 -43
- package/dist/packem_shared/ensureDir-DNlPftys.js +0 -53
- package/dist/packem_shared/ensureDirSync-DcPZFMy5.js +0 -53
- package/dist/packem_shared/ensureFile-BRQpUOUM.js +0 -47
- package/dist/packem_shared/ensureFileSync-SBY7A9-C.js +0 -47
- package/dist/packem_shared/ensureLink-DJQeauEn.js +0 -55
- package/dist/packem_shared/ensureLinkSync-D9RVAglV.js +0 -55
- package/dist/packem_shared/ensureSymlink-CoRYDRwr.js +0 -80
- package/dist/packem_shared/ensureSymlinkSync-CFimFlgh.js +0 -81
- package/dist/packem_shared/findUp-YcNLKdfV.js +0 -84
- package/dist/packem_shared/findUpSync-BfA5fheN.js +0 -83
- package/dist/packem_shared/get-file-info-type-FD4-jsyg.js +0 -14
- package/dist/packem_shared/glob-DY8l7izD.js +0 -5
- package/dist/packem_shared/glob-sync.d-B83kqwUd.d.ts +0 -4
- package/dist/packem_shared/globSync-5P2KJf_g.js +0 -5
- package/dist/packem_shared/index-C8W8sfzP.js +0 -830
- package/dist/packem_shared/index-CHM-in-V.js +0 -100
- package/dist/packem_shared/index-bhgnhm4u.js +0 -167
- package/dist/packem_shared/index-xe4o3cYi.js +0 -1784
- package/dist/packem_shared/indexToLineColumn-BUb0GPKl-BF770uX7.js +0 -171
- package/dist/packem_shared/ini-preserve-Dq_Q_Jgb.js +0 -251
- 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-DunL7Iry.js +0 -62
- package/dist/packem_shared/json-error.d-DgKaeuIf.d.ts +0 -10
- package/dist/packem_shared/jsonc-merge-C6jWcfWh.js +0 -72
- package/dist/packem_shared/move-DbpW5_vA.js +0 -134
- package/dist/packem_shared/parseJson-BIp89Xjo.js +0 -63
- package/dist/packem_shared/readFile-Iz7kvCCk.js +0 -65
- package/dist/packem_shared/readFileSync-gm9yfIhh.js +0 -54
- package/dist/packem_shared/readIni-CJ2xfpjB.js +0 -10
- package/dist/packem_shared/readIniSync-9LUjaSSp.js +0 -10
- package/dist/packem_shared/readJson-C_rwm-wq.js +0 -22
- package/dist/packem_shared/readJson5-mBoTZppy.js +0 -15
- package/dist/packem_shared/readJson5Sync-8WS2yUok.js +0 -15
- package/dist/packem_shared/readJsonSync-BMEmCcJ6.js +0 -22
- package/dist/packem_shared/readJsonc-j-OS-APg.js +0 -28
- package/dist/packem_shared/readJsoncSync-Aw6EMlWO.js +0 -16
- package/dist/packem_shared/readToml-B2MHaSes.js +0 -9
- package/dist/packem_shared/readTomlSync-DNbK8NEb.js +0 -9
- package/dist/packem_shared/readYaml-D5q2a0e1.js +0 -10
- package/dist/packem_shared/readYamlSync-BKX-PAfq.js +0 -10
- package/dist/packem_shared/remove-C8_gl3jF.js +0 -39
- package/dist/packem_shared/removeSync-BJR_wTwN.js +0 -39
- package/dist/packem_shared/resolve-symlink-target-Kh4GovFf.js +0 -16
- package/dist/packem_shared/sanitize-BZoLN9Fg.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/types.d-dP-lAGNn.d.ts +0 -145
- package/dist/packem_shared/walk-CSZgCuDx.js +0 -124
- package/dist/packem_shared/walk-include-CZco7BvN.js +0 -16
- package/dist/packem_shared/walkSync-C4Cy28xb.js +0 -123
- package/dist/packem_shared/writeFile-B8HX0JIQ.js +0 -81
- package/dist/packem_shared/writeFileSync-DB8vv8xR.js +0 -81
- package/dist/packem_shared/writeIni-i55QrL8y.js +0 -65
- package/dist/packem_shared/writeIniSync-CLqJE5t3.js +0 -64
- package/dist/packem_shared/writeJson-Bo7C2UHw.js +0 -50
- package/dist/packem_shared/writeJson5-vVmHUQOd.js +0 -53
- package/dist/packem_shared/writeJson5Sync-oJ546h5k.js +0 -53
- package/dist/packem_shared/writeJsonSync-BKZ_9Acr.js +0 -50
- package/dist/packem_shared/writeJsonc-BufH_oC5.js +0 -60
- package/dist/packem_shared/writeJsoncSync-DB9be1YL.js +0 -59
- package/dist/packem_shared/writeToml-DgTW_-7F.js +0 -8
- package/dist/packem_shared/writeTomlSync-DiBiE9ja.js +0 -8
- package/dist/packem_shared/writeYaml-BWCOome-.js +0 -24
- package/dist/packem_shared/writeYamlSync-DBVnXmuY.js +0 -24
package/dist/index.js
CHANGED
|
@@ -1,38 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { default as ensureDir } from './packem_shared/ensureDir-DNlPftys.js';
|
|
3
|
-
export { default as ensureDirSync } from './packem_shared/ensureDirSync-DcPZFMy5.js';
|
|
4
|
-
export { default as ensureFile } from './packem_shared/ensureFile-BRQpUOUM.js';
|
|
5
|
-
export { default as ensureFileSync } from './packem_shared/ensureFileSync-SBY7A9-C.js';
|
|
6
|
-
export { default as ensureLink } from './packem_shared/ensureLink-DJQeauEn.js';
|
|
7
|
-
export { default as ensureLinkSync } from './packem_shared/ensureLinkSync-D9RVAglV.js';
|
|
8
|
-
export { default as ensureSymlink } from './packem_shared/ensureSymlink-CoRYDRwr.js';
|
|
9
|
-
export { default as ensureSymlinkSync } from './packem_shared/ensureSymlinkSync-CFimFlgh.js';
|
|
10
|
-
export { CRLF, EOL, LF, detect, format } from './eol.js';
|
|
11
|
-
export { default as collect } from './packem_shared/collect-CqQ3eVab.js';
|
|
12
|
-
export { default as collectSync } from './packem_shared/collectSync-noE08NNv.js';
|
|
13
|
-
export { default as findUp } from './packem_shared/findUp-YcNLKdfV.js';
|
|
14
|
-
export { default as findUpSync } from './packem_shared/findUpSync-BfA5fheN.js';
|
|
15
|
-
export { default as glob } from './packem_shared/glob-DY8l7izD.js';
|
|
16
|
-
export { default as globSync } from './packem_shared/globSync-5P2KJf_g.js';
|
|
17
|
-
export { default as walk } from './packem_shared/walk-CSZgCuDx.js';
|
|
18
|
-
export { default as walkSync } from './packem_shared/walkSync-C4Cy28xb.js';
|
|
19
|
-
export { default as globParent } from './glob-parent.js';
|
|
20
|
-
export { default as isAccessible } from './packem_shared/isAccessible-DuVrTNFV.js';
|
|
21
|
-
export { default as isAccessibleSync } from './packem_shared/isAccessibleSync-DI8mM0fA.js';
|
|
22
|
-
export { default as isGlob } from './is-glob.js';
|
|
23
|
-
export { match, matcher } from './match.js';
|
|
24
|
-
export { move, moveSync, rename, renameSync } from './packem_shared/move-DbpW5_vA.js';
|
|
25
|
-
export { default as readFile } from './packem_shared/readFile-Iz7kvCCk.js';
|
|
26
|
-
export { default as readFileSync } from './packem_shared/readFileSync-gm9yfIhh.js';
|
|
27
|
-
export { default as readJson } from './packem_shared/readJson-C_rwm-wq.js';
|
|
28
|
-
export { default as readJsonSync } from './packem_shared/readJsonSync-BMEmCcJ6.js';
|
|
29
|
-
export { default as emptyDir } from './packem_shared/emptyDir-DnwENOaV.js';
|
|
30
|
-
export { default as emptyDirSync } from './packem_shared/emptyDirSync-6WiHBo8a.js';
|
|
31
|
-
export { default as remove } from './packem_shared/remove-C8_gl3jF.js';
|
|
32
|
-
export { default as removeSync } from './packem_shared/removeSync-BJR_wTwN.js';
|
|
33
|
-
export { sanitize } from './packem_shared/sanitize-BZoLN9Fg.js';
|
|
34
|
-
export { default as writeFile } from './packem_shared/writeFile-B8HX0JIQ.js';
|
|
35
|
-
export { default as writeFileSync } from './packem_shared/writeFileSync-DB8vv8xR.js';
|
|
36
|
-
export { default as writeJson } from './packem_shared/writeJson-Bo7C2UHw.js';
|
|
37
|
-
export { default as writeJsonSync } from './packem_shared/writeJsonSync-BKZ_9Acr.js';
|
|
38
|
-
export { isFsCaseSensitive } from './packem_shared/isFsCaseSensitive-DunL7Iry.js';
|
|
1
|
+
import{createRequire as h}from"node:module";import{FIND_UP_STOP as L,F_OK as P,R_OK as R,W_OK as $,X_OK as J}from"./packem_shared/FIND_UP_STOP-CAwY1qU7.js";import{default as T}from"./packem_shared/copy-Beb64BYG.js";import{default as W}from"./packem_shared/copySync-CagcIEBi.js";import{default as M}from"./packem_shared/ensureDir-DGarVZw8.js";import{default as E}from"./packem_shared/ensureDirSync-CsgPrsDH.js";import{default as z}from"./packem_shared/ensureFile-CMugWljp.js";import{default as I}from"./packem_shared/ensureFileSync-CJYTEx2r.js";import{default as H}from"./packem_shared/ensureLink-ChShf3lf.js";import{default as V}from"./packem_shared/ensureLinkSync-DPpq0I2Z.js";import{default as Z}from"./packem_shared/ensureSymlink-y4FZjfxA.js";import{default as re}from"./packem_shared/ensureSymlinkSync-TcHssCH7.js";import{CRLF as oe,EOL as se,LF as ae,detect as ne,format as ie}from"./eol.js";import{default as le}from"./packem_shared/collect-CIKDOMiD.js";import{default as ue}from"./packem_shared/collectSync-D0FRLLqg.js";import{default as me}from"./packem_shared/findUp-Cii5ATt5.js";import{default as xe}from"./packem_shared/findUpSync-C9Lkh7-v.js";import{default as Se}from"./packem_shared/glob-DMbPwGSj.js";import{default as _e}from"./packem_shared/globSync-DiP2rtGn.js";import{default as Fe}from"./packem_shared/walk-OX4-6oCP.js";import{default as ge}from"./packem_shared/walkSync-BPs6czIM.js";import{default as ke}from"./glob-parent.js";import{default as De}from"./packem_shared/isAccessible-PmWJhV6I.js";import{default as qe}from"./packem_shared/isAccessibleSync-BrbOtwdr.js";import{default as Le}from"./is-glob.js";import{match as Re,matcher as $e}from"./match.js";import{move as Ke,moveSync as Te,rename as Ue,renameSync as We}from"./packem_shared/move-DopmzT-2.js";import{default as Me}from"./packem_shared/readFile-BswaBgM0.js";import{default as Ee}from"./packem_shared/readFileSync-_fDF6Oj1.js";import{default as ze}from"./packem_shared/readJson-CcAsHxE5.js";import{default as Ie}from"./packem_shared/readJsonSync-DuMMeB3s.js";import{default as He}from"./packem_shared/emptyDir-C7lyd1lW.js";import{default as Ve}from"./packem_shared/emptyDirSync-B8EYpmO9.js";import{default as Ze}from"./packem_shared/remove-CSbrd0dl.js";import{default as rr}from"./packem_shared/removeSync-BoLAzRQE.js";import{sanitize as or}from"./packem_shared/sanitize-DGZ3w-_w.js";import{default as ar}from"./packem_shared/writeFile-BrMtsJY7.js";import{default as ir}from"./packem_shared/writeFileSync-W7Mf4BNy.js";import{default as lr}from"./packem_shared/writeJson-bEVi25gX.js";import{default as ur}from"./packem_shared/writeJsonSync-DkGnd416.js";const F=h(import.meta.url),n=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=i=>{if(typeof n<"u"&&n.versions&&n.versions.node){const[s,f]=n.versions.node.split(".").map(Number);if(s>22||s===22&&f>=3||s===20&&f>=16)return n.getBuiltinModule(i)}return F(i)},b=u("fs"),g=u("os"),w=u("path");var c={},x;function k(){if(x)return c;x=1;var i=Object.defineProperty,s=(o,e)=>i(o,"name",{value:e,configurable:!0}),f=b,y=g,S=w;const p=s(o=>{let e="";for(let r=0;r<o.length;r+=1){const t=o[r],a=t.toUpperCase();e+=t===a?t.toLowerCase():a}return e},"invertCase"),l=new Map,m=s((o,e)=>{const r=S.join(o,`.is-fs-case-sensitive-test-${process.pid}`);try{return e.writeFileSync(r,""),!e.existsSync(p(r))}finally{try{e.unlinkSync(r)}catch{}}},"checkDirectoryCaseWithWrite"),v=s((o,e,r)=>{try{return m(o,r)}catch(t){if(e===void 0)return m(y.tmpdir(),r);throw t}},"checkDirectoryCaseWithFallback"),_=s((o,e=f,r=!0)=>{const t=o??process.cwd();if(r&&l.has(t))return l.get(t);let a;const d=p(t);return d!==t&&e.existsSync(t)?a=!e.existsSync(d):a=v(t,o,e),r&&l.set(t,a),a},"isFsCaseSensitive");return c.isFsCaseSensitive=_,c}var C=k();const j=C.isFsCaseSensitive;export{oe as CRLF,se as EOL,L as FIND_UP_STOP,P as F_OK,ae as LF,R as R_OK,$ as W_OK,J as X_OK,le as collect,ue as collectSync,T as copy,W as copySync,ne as detect,He as emptyDir,Ve as emptyDirSync,M as ensureDir,E as ensureDirSync,z as ensureFile,I as ensureFileSync,H as ensureLink,V as ensureLinkSync,Z as ensureSymlink,re as ensureSymlinkSync,me as findUp,xe as findUpSync,ie as format,Se as glob,ke as globParent,_e as globSync,De as isAccessible,qe as isAccessibleSync,j as isFsCaseSensitive,Le as isGlob,Re as match,$e as matcher,Ke as move,Te as moveSync,Me as readFile,Ee as readFileSync,ze as readJson,Ie as readJsonSync,Ze as remove,rr as removeSync,Ue as rename,We as renameSync,or as sanitize,Fe as walk,ge as walkSync,ar as writeFile,ir as writeFileSync,lr as writeJson,ur as writeJsonSync};
|
package/dist/ini.d.ts
CHANGED
|
@@ -1,10 +1,70 @@
|
|
|
1
|
-
import { C as CompressionType,
|
|
2
|
-
export {
|
|
1
|
+
import { C as CompressionType, R as ReadIniOptions, W as WriteIniOptions } from "./packem_shared/types.d-BMdL_ygj.js";
|
|
2
|
+
export type { I as IniEncodeOptions, a as IniLineEnding } from "./packem_shared/types.d-BMdL_ygj.js";
|
|
3
3
|
import 'node:fs';
|
|
4
|
-
import '
|
|
5
|
-
|
|
4
|
+
import 'fdir';
|
|
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
|
+
*/
|
|
6
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
|
+
*/
|
|
7
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
|
+
*/
|
|
8
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
|
+
*/
|
|
9
69
|
declare const writeIniSync: (path: URL | string, data: Record<string, unknown>, options?: WriteIniOptions) => void;
|
|
10
70
|
export { type ReadIniOptions, type WriteIniOptions, readIni, readIniSync, writeIni, writeIniSync };
|
package/dist/ini.js
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { default as readIniSync } from './packem_shared/readIniSync-9LUjaSSp.js';
|
|
3
|
-
export { default as writeIni } from './packem_shared/writeIni-i55QrL8y.js';
|
|
4
|
-
export { default as writeIniSync } from './packem_shared/writeIniSync-CLqJE5t3.js';
|
|
1
|
+
import{default as a}from"./packem_shared/readIni-BsXudu2r.js";import{default as f}from"./packem_shared/readIniSync-DKwRbbs9.js";import{default as d}from"./packem_shared/writeIni-BWX3cP1K.js";import{default as n}from"./packem_shared/writeIniSync-fOdgPFfL.js";export{a as readIni,f as readIniSync,d as writeIni,n as writeIniSync};
|
package/dist/is-glob.d.ts
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options accepted by {@link isGlob}.
|
|
3
|
+
*/
|
|
1
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
|
+
*/
|
|
2
11
|
strict?: boolean;
|
|
3
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
|
+
*/
|
|
4
33
|
declare const isGlob: (value: unknown, options?: IsGlobOptions) => boolean;
|
|
5
34
|
export { type IsGlobOptions, isGlob as default };
|
package/dist/is-glob.js
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { r as requireIsGlob } from './packem_shared/index-bhgnhm4u.js';
|
|
3
|
-
|
|
4
|
-
var isGlobExports = requireIsGlob();
|
|
5
|
-
const isGlobImpl = /*@__PURE__*/getDefaultExportFromCjs(isGlobExports);
|
|
6
|
-
|
|
7
|
-
const isGlob = (value, options) => isGlobImpl(value, options);
|
|
8
|
-
|
|
9
|
-
export { isGlob as default };
|
|
1
|
+
import{g as s}from"./packem_shared/_commonjsHelpers-CWAkuNXM.js";import{r as t}from"./packem_shared/index-BHy3Kcr7.js";var a=t();const e=s(a),f=(o,r)=>e(o,r);export{f as default};
|
package/dist/json5.d.ts
CHANGED
|
@@ -1,12 +1,36 @@
|
|
|
1
|
-
import { C as CompressionType, b as ReadJson5Options,
|
|
2
|
-
export {
|
|
1
|
+
import { C as CompressionType, b as ReadJson5Options, J as Json5Reviver, c as WriteJson5Options } from "./packem_shared/types.d-BMdL_ygj.js";
|
|
2
|
+
export type { d as Json5Replacer } from "./packem_shared/types.d-BMdL_ygj.js";
|
|
3
3
|
import 'node:fs';
|
|
4
|
-
import '
|
|
5
|
-
import './options';
|
|
4
|
+
import 'fdir';
|
|
6
5
|
declare function readJson5<R = unknown>(path: URL | string, options?: ReadJson5Options<CompressionType>): Promise<R>;
|
|
7
6
|
declare function readJson5<R = unknown>(path: URL | string, reviver: Json5Reviver, options?: ReadJson5Options<CompressionType>): Promise<R>;
|
|
8
7
|
declare function readJson5Sync(path: URL | string, options?: ReadJson5Options<CompressionType>): unknown;
|
|
9
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
|
+
*/
|
|
10
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
|
+
*/
|
|
11
35
|
declare const writeJson5Sync: (path: URL | string, data: unknown, options?: WriteJson5Options) => void;
|
|
12
36
|
export { type Json5Reviver, type ReadJson5Options, type WriteJson5Options, readJson5, readJson5Sync, writeJson5, writeJson5Sync };
|
package/dist/json5.js
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { default as readJson5Sync } from './packem_shared/readJson5Sync-8WS2yUok.js';
|
|
3
|
-
export { default as writeJson5 } from './packem_shared/writeJson5-vVmHUQOd.js';
|
|
4
|
-
export { default as writeJson5Sync } from './packem_shared/writeJson5Sync-oJ546h5k.js';
|
|
1
|
+
import{default as r}from"./packem_shared/readJson5-CM1TIiHd.js";import{default as t}from"./packem_shared/readJson5Sync-Bc26c3Fy.js";import{default as s}from"./packem_shared/writeJson5-Ch8TpNPI.js";import{default as n}from"./packem_shared/writeJson5Sync-BrctV_Mk.js";export{r as readJson5,t as readJson5Sync,s as writeJson5,n as writeJson5Sync};
|
package/dist/jsonc.d.ts
CHANGED
|
@@ -1,10 +1,65 @@
|
|
|
1
|
-
import { C as CompressionType,
|
|
2
|
-
export {
|
|
1
|
+
import { C as CompressionType, e as ReadJsoncOptions, f as WriteJsoncOptions } from "./packem_shared/types.d-BMdL_ygj.js";
|
|
2
|
+
export type { g as JsoncFormattingOptions, h as JsoncParseOptions } from "./packem_shared/types.d-BMdL_ygj.js";
|
|
3
3
|
import 'node:fs';
|
|
4
|
-
import '
|
|
5
|
-
|
|
4
|
+
import 'fdir';
|
|
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
|
+
*/
|
|
6
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
|
+
*/
|
|
7
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
|
+
*/
|
|
8
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
|
+
*/
|
|
9
64
|
declare const writeJsoncSync: (path: URL | string, data: unknown, options?: WriteJsoncOptions) => void;
|
|
10
65
|
export { type ReadJsoncOptions, type WriteJsoncOptions, readJsonc, readJsoncSync, writeJsonc, writeJsoncSync };
|
package/dist/jsonc.js
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { default as readJsoncSync } from './packem_shared/readJsoncSync-Aw6EMlWO.js';
|
|
3
|
-
export { default as writeJsonc } from './packem_shared/writeJsonc-BufH_oC5.js';
|
|
4
|
-
export { default as writeJsoncSync } from './packem_shared/writeJsoncSync-DB9be1YL.js';
|
|
1
|
+
import{default as r}from"./packem_shared/readJsonc-BZjMw_0f.js";import{default as t}from"./packem_shared/readJsoncSync-C-xzeZz4.js";import{default as s}from"./packem_shared/writeJsonc-CefrwsOc.js";import{default as d}from"./packem_shared/writeJsoncSync-BskDjn8o.js";export{r as readJsonc,t as readJsoncSync,s as writeJsonc,d as writeJsoncSync};
|
package/dist/match.d.ts
CHANGED
|
@@ -1,5 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Options accepted by {@link match} and {@link matcher}.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors `picomatch.PicomatchOptions`; passed straight through to
|
|
5
|
+
* [`picomatch`](https://github.com/micromatch/picomatch#options); see its
|
|
6
|
+
* documentation for the full list.
|
|
7
|
+
*/
|
|
8
|
+
interface MatchOptions {
|
|
9
|
+
basename?: boolean;
|
|
10
|
+
bash?: boolean;
|
|
11
|
+
capture?: boolean;
|
|
12
|
+
contains?: boolean;
|
|
13
|
+
debug?: boolean;
|
|
14
|
+
dot?: boolean;
|
|
15
|
+
expandRange?: ((from: string, to: string, options: MatchOptions) => string) | ((from: string, to: string, step: string, options: MatchOptions) => string);
|
|
16
|
+
fastpaths?: boolean;
|
|
17
|
+
flags?: string;
|
|
18
|
+
format?: (string_: string) => string;
|
|
19
|
+
ignore?: string | string[];
|
|
20
|
+
keepQuotes?: boolean;
|
|
21
|
+
literalBrackets?: boolean;
|
|
22
|
+
matchBase?: boolean;
|
|
23
|
+
maxLength?: number;
|
|
24
|
+
nobrace?: boolean;
|
|
25
|
+
nobracket?: boolean;
|
|
26
|
+
nocase?: boolean;
|
|
27
|
+
noext?: boolean;
|
|
28
|
+
noextglob?: boolean;
|
|
29
|
+
noglobstar?: boolean;
|
|
30
|
+
nonegate?: boolean;
|
|
31
|
+
onIgnore?: (result: unknown) => void;
|
|
32
|
+
onMatch?: (result: unknown) => void;
|
|
33
|
+
onResult?: (result: unknown) => void;
|
|
34
|
+
posix?: boolean;
|
|
35
|
+
prepend?: boolean;
|
|
36
|
+
regex?: boolean;
|
|
37
|
+
strictBrackets?: boolean;
|
|
38
|
+
strictSlashes?: boolean;
|
|
39
|
+
unescape?: boolean;
|
|
40
|
+
windows?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Tests whether a path matches one or more glob patterns.
|
|
44
|
+
*
|
|
45
|
+
* Powered by [`picomatch`](https://github.com/micromatch/picomatch) which is bundled into the built output so it does
|
|
46
|
+
* not appear as a runtime dependency of `@visulima/fs`.
|
|
47
|
+
*
|
|
48
|
+
* If you match many values against the same pattern, prefer {@link matcher} to compile the pattern once.
|
|
49
|
+
* @param value The path (or paths) to test.
|
|
50
|
+
* @param pattern A single glob or array of globs.
|
|
51
|
+
* @param options Optional picomatch options. See {@link MatchOptions}.
|
|
52
|
+
* @returns `true` if `value` matches any of `pattern`.
|
|
53
|
+
* @example
|
|
54
|
+
* ```javascript
|
|
55
|
+
* import { match } from "@visulima/fs";
|
|
56
|
+
*
|
|
57
|
+
* match("src/index.ts", "src/**\/*.ts"); // true
|
|
58
|
+
* match("src/index.ts", ["**\/*.js", "**\/*.ts"]); // true
|
|
59
|
+
* match("src/index.ts", "**\/*.js"); // false
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
3
62
|
declare const match: (value: string | string[], pattern: string | string[], options?: MatchOptions) => boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Compiles a glob pattern into a reusable matcher function.
|
|
65
|
+
*
|
|
66
|
+
* Powered by [`picomatch`](https://github.com/micromatch/picomatch) which is bundled into the built output so it does
|
|
67
|
+
* not appear as a runtime dependency of `@visulima/fs`.
|
|
68
|
+
* @param pattern A single glob or array of globs.
|
|
69
|
+
* @param options Optional picomatch options. See {@link MatchOptions}.
|
|
70
|
+
* @returns A function that returns `true` when its argument matches the compiled pattern.
|
|
71
|
+
* @example
|
|
72
|
+
* ```javascript
|
|
73
|
+
* import { matcher } from "@visulima/fs";
|
|
74
|
+
*
|
|
75
|
+
* const isTs = matcher("**\/*.ts");
|
|
76
|
+
* ["a.ts", "b.js", "c.ts"].filter(isTs); // ["a.ts", "c.ts"]
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
4
79
|
declare const matcher: (pattern: string | string[], options?: MatchOptions) => (value: string) => boolean;
|
|
5
80
|
export { MatchOptions, match, matcher };
|
package/dist/match.js
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const match = (value, pattern, options) => {
|
|
4
|
-
const isMatch = picomatch(pattern, options);
|
|
5
|
-
if (Array.isArray(value)) {
|
|
6
|
-
return value.some((entry) => isMatch(entry));
|
|
7
|
-
}
|
|
8
|
-
return isMatch(value);
|
|
9
|
-
};
|
|
10
|
-
const matcher = (pattern, options) => {
|
|
11
|
-
const isMatch = picomatch(pattern, options);
|
|
12
|
-
return (value) => isMatch(value);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { match, matcher };
|
|
1
|
+
import{a}from"./packem_shared/index-LUKYN3u3.js";const o=(r,e,n)=>{const t=a(e,n);return Array.isArray(r)?r.some(c=>t(c)):t(r)},s=(r,e)=>{const n=a(r,e);return t=>n(t)};export{o as match,s as matcher};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class t extends Error{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{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class o extends Error{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{o 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 @@
|
|
|
1
|
+
class t extends Error{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{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class o extends Error{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{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class o extends Error{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{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class e extends Error{root;constructor(r,o){super(`${r instanceof Error?r.message:String(r)} for path "${o}"`),this.cause=r,this.root=o}get name(){return"WalkError"}set name(r){throw new Error("Cannot overwrite name of WalkError")}}export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function o(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}export{o as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=r=>{if(typeof r!="string"&&!(r instanceof ArrayBuffer)&&!ArrayBuffer.isView(r))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")};export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=n=>{if(!n||!(n instanceof URL)&&typeof n!="string")throw new TypeError("Path must be a non-empty string or URL.")};export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=r=>{const e={force:!0,recursive:!0};return r?.maxRetries!==void 0&&(e.maxRetries=r.maxRetries),r?.retryDelay!==void 0&&(e.retryDelay=r.retryDelay),e};export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import n from"./walk-OX4-6oCP.js";const e=async(r,s={})=>{Array.isArray(s.extensions)||(s.extensions=["js","mjs","cjs","ts"]);const o=[];for await(const t of n(r,s))o.push(t.path);return o};export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./walkSync-BPs6czIM.js";const a=(r,s={})=>{Array.isArray(s.extensions)||(s.extensions=["js","mjs","cjs","ts"]);const o=[];for(const n of t(r,s))o.push(n.path);return o};export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as v}from"node:module";import{toPath as n}from"@visulima/path/utils";import h from"./AlreadyExistsError-DEb3UWja.js";import c from"./assertValidFileOrDirectoryPath-BTlt945W.js";const y=v(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=r=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[e,t]=s.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return s.getBuiltinModule(r)}return y(r)},{cp:g}=b("node:fs/promises"),x=async(r,e,t={})=>{c(r),c(e);const{dereference:a=!1,errorOnExist:f=!0,filter:m,overwrite:p=!0,preserveTimestamps:l=!1,recursive:u=!0,verbatimSymlinks:d=!1}=t,_=n(r),o=n(e);try{await g(_,o,{dereference:a,errorOnExist:f,filter:m,force:p,preserveTimestamps:l,recursive:u,verbatimSymlinks:d})}catch(i){throw i?.code==="ERR_FS_CP_EEXIST"?new h(`destination already exists, copy '${o}'`):i}};export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as v}from"node:module";import{toPath as n}from"@visulima/path/utils";import g from"./AlreadyExistsError-DEb3UWja.js";import c from"./assertValidFileOrDirectoryPath-BTlt945W.js";const y=v(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=r=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[e,t]=s.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return s.getBuiltinModule(r)}return y(r)},{cpSync:b}=h("node:fs"),x=(r,e,t={})=>{c(r),c(e);const{dereference:a=!1,errorOnExist:f=!0,filter:m,overwrite:l=!0,preserveTimestamps:p=!1,recursive:u=!0,verbatimSymlinks:d=!1}=t,_=n(r),o=n(e);try{b(_,o,{dereference:a,errorOnExist:f,filter:m,force:l,preserveTimestamps:p,recursive:u,verbatimSymlinks:d})}catch(i){throw i?.code==="ERR_FS_CP_EEXIST"?new g(`destination already exists, copy '${o}'`):i}};export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as c}from"node:module";import{join as d}from"@visulima/path";import{toPath as l}from"@visulima/path/utils";import _ from"./assertValidFileOrDirectoryPath-BTlt945W.js";import{t as g}from"./build-rm-options-avnusYx-.js";const a=c(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,i=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[o,s]=r.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return r.getBuiltinModule(e)}return a(e)},{existsSync:f}=i("node:fs"),{mkdir:m,readdir:u,rm:p}=i("node:fs/promises"),q=async(e,o)=>{if(_(e),!f(e)){await m(e,{recursive:!0});return}const s=await u(e),t=g(o);for(const n of s)await p(d(l(e),n),t)};export{q as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as n}from"node:module";import{join as a}from"@visulima/path";import{toPath as d}from"@visulima/path/utils";import l from"./assertValidFileOrDirectoryPath-BTlt945W.js";import{t as _}from"./build-rm-options-avnusYx-.js";const t=n(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[o,s]=r.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return r.getBuiltinModule(e)}return t(e)},{existsSync:f,mkdirSync:m,readdirSync:u,rmSync:p}=c("node:fs"),v=(e,o)=>{if(l(e),!f(e)){m(e,{recursive:!0});return}const s=_(o);for(const i of u(e))p(a(d(e),i),s)};export{v as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as n}from"node:module";import p from"./assertValidFileOrDirectoryPath-BTlt945W.js";import{g as i}from"./get-file-info-type-DzWpohDB.js";const c=n(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,a=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 c(r)},{lstat:s,mkdir:u}=a("node:fs/promises"),m=async r=>{p(r);try{const e=await s(r);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(i(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await u(r,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const t=await s(r);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(i(t))}'`,{cause:e})}};export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as n}from"node:module";import d from"./assertValidFileOrDirectoryPath-BTlt945W.js";import{g as i}from"./get-file-info-type-DzWpohDB.js";const c=n(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=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 c(r)},{lstatSync:s,mkdirSync:a}=u("node:fs"),g=r=>{d(r);try{const e=s(r);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(i(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{a(r,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const t=s(r);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(i(t))}'`,{cause:e})}};export{g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as i}from"node:module";import{dirname as p}from"@visulima/path";import{toPath as f}from"@visulima/path/utils";import m from"./assertValidFileOrDirectoryPath-BTlt945W.js";import l from"./ensureDir-DGarVZw8.js";import{g as u}from"./get-file-info-type-DzWpohDB.js";const s=i(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,n=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 s(r)},{lstat:a,writeFile:c}=n("node:fs/promises"),j=async r=>{m(r);try{const e=await a(r);if(!e.isFile())throw new Error(`Ensure path exists, expected 'file', got '${String(u(e))}'`)}catch(e){if(e.code==="ENOENT"){await l(p(f(r))),await c(r,new Uint8Array);return}throw e}};export{j as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as i}from"node:module";import{dirname as p}from"@visulima/path";import{toPath as a}from"@visulima/path/utils";import m from"./assertValidFileOrDirectoryPath-BTlt945W.js";import l from"./ensureDirSync-CsgPrsDH.js";import{g as u}from"./get-file-info-type-DzWpohDB.js";const s=i(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,n=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 s(r)},{lstatSync:c,writeFileSync:f}=n("node:fs"),w=r=>{m(r);try{const e=c(r);if(!e.isFile())throw new Error(`Ensure path exists, expected 'file', got '${String(u(e))}'`)}catch(e){if(e.code==="ENOENT"){l(p(a(r))),f(r,new Uint8Array);return}throw e}};export{w as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as p}from"node:module";import{toNamespacedPath as n,dirname as _}from"@visulima/path";import{toPath as c}from"@visulima/path/utils";import m from"./assertValidFileOrDirectoryPath-BTlt945W.js";import g from"./ensureDir-DGarVZw8.js";import{d as h}from"./is-stats-identical-l1GRN4Qu.js";const f=p(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=o=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[e,t]=s.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return s.getBuiltinModule(o)}return f(o)},{lstat:a,link:d}=u("node:fs/promises"),P=async(o,e)=>{m(o),m(e),o=n(c(o)),e=n(c(e));let t;try{t=await a(e)}catch{}let i;try{i=await a(o)}catch(l){const r=l;throw r.message=r.message.replace("lstat","ensureLink"),r}t&&h(i,t)||(await g(_(e)),await d(o,e))};export{P as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as p}from"node:module";import{toNamespacedPath as c,dirname as _}from"@visulima/path";import{toPath as a}from"@visulima/path/utils";import m from"./assertValidFileOrDirectoryPath-BTlt945W.js";import g from"./ensureDirSync-CsgPrsDH.js";import{d as h}from"./is-stats-identical-l1GRN4Qu.js";const f=p(import.meta.url),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=o=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[e,s]=t.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return t.getBuiltinModule(o)}return f(o)},{lstatSync:i,linkSync:d}=u("node:fs"),T=(o,e)=>{m(o),m(e),o=c(a(o)),e=c(a(e));let s;try{s=i(e)}catch{}let n;try{n=i(o)}catch(l){const r=l;throw r.message=r.message.replace("lstat","ensureLink"),r}s&&h(n,s)||(g(_(e)),d(o,e))};export{T as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as _}from"node:module";import{toNamespacedPath as m,dirname as v,resolve as P}from"@visulima/path";import{toPath as p}from"@visulima/path/utils";import d from"./assertValidFileOrDirectoryPath-BTlt945W.js";import S from"./ensureDir-DGarVZw8.js";import{g as u}from"./get-file-info-type-DzWpohDB.js";import{d as x}from"./is-stats-identical-l1GRN4Qu.js";import{t as q}from"./resolve-symlink-target-CWrn0v4P.js";import w from"./AlreadyExistsError-DEb3UWja.js";const b=_(import.meta.url),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,j=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 b(i)},{lstat:c,stat:f,symlink:T,readlink:k}=j("node:fs/promises"),E=process.platform==="win32"||/^(?:msys|cygwin)$/.test(process.env.OSTYPE),X=async(i,e,o)=>{d(i),d(e);const r=q(i,e);e=m(p(e));try{if((await c(e)).isSymbolicLink()){const[s,n]=await Promise.all([f(r),f(e)]);if(x(s,n))return}}catch{}const y=await c(r),h=u(y);await S(v(e));let a=o??"file";o||(E?a="junction":a=h==="dir"?"dir":"file");try{await T(m(p(r)),e,a)}catch(s){if(s.code!=="EEXIST")throw s;const n=await c(e);if(!n.isSymbolicLink())throw new w(`A ${String(u(n))} already exists at the path: ${e}`);const g=await k(e),l=m(P(g));if(l!==r)throw new w(`A symlink targeting to an undesired path already exists: ${e} -> ${l}`)}};export{X as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as w}from"node:module";import{toNamespacedPath as f,dirname as v,resolve as x}from"@visulima/path";import{toPath as p}from"@visulima/path/utils";import d from"./assertValidFileOrDirectoryPath-BTlt945W.js";import P from"./ensureDirSync-CsgPrsDH.js";import{g as u}from"./get-file-info-type-DzWpohDB.js";import{d as y}from"./is-stats-identical-l1GRN4Qu.js";import{t as q}from"./resolve-symlink-target-CWrn0v4P.js";import g from"./AlreadyExistsError-DEb3UWja.js";const b=w(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,j=o=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[e,r]=s.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return s.getBuiltinModule(o)}return b(o)},{lstatSync:m,statSync:c,symlinkSync:T,readlinkSync:k}=j("node:fs"),E=process.platform==="win32"||/^(?:msys|cygwin)$/.test(process.env.OSTYPE),X=(o,e,r)=>{d(o),d(e);const i=q(o,e);e=f(p(e));try{if(m(e).isSymbolicLink()&&y(c(i),c(e))){const t=c(i),n=c(e);if(y(t,n))return}}catch{}const h=m(i),_=u(h);P(v(e));let a=r??"file";r||(E?a="junction":a=_==="dir"?"dir":"file");try{T(f(p(i)),e,a)}catch(t){if(t.code!=="EEXIST")throw t;const n=m(e);if(!n.isSymbolicLink())throw new g(`A ${String(u(n))} already exists at the path: ${e}`);const S=k(e),l=f(x(S));if(l!==i)throw new g(`A symlink targeting to an undesired path already exists: ${e} -> ${l}`)}};export{X as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as g}from"node:module";import{resolve as c,parse as T,isAbsolute as j,dirname as v}from"@visulima/path";import{toPath as f}from"@visulima/path/utils";import{FIND_UP_STOP as B}from"./FIND_UP_STOP-CAwY1qU7.js";const w=g(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=t=>{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(t)}return w(t)},{stat:A,lstat:b}=h("node:fs/promises"),k=async(t,e={})=>{if(typeof t!="string"&&!Array.isArray(t)&&typeof t!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const i=e.cwd?f(e.cwd):process.cwd();let r=c(i);const{root:a}=T(r),y=f(e.stopAt??a),m=c(r,y),u=e.type??"file",d=async function(n){return typeof t=="function"?[await t(n)]:typeof t=="string"?[t]:Array.isArray(t)?t:[t]};e.allowSymlinks??=!0;const _=e.allowSymlinks?A:b;for(;r&&r!==m&&r!==a;){const n=await d(r);for(let o of n){if(o===B)return;if(o===void 0)continue;Buffer.isBuffer(o)?o=o.toString():o instanceof URL&&(o=f(o));const l=j(o)?o:c(r,o);try{const p=await _(l);if(u==="file"&&p.isFile()||u==="directory"&&p.isDirectory())return l}catch{}}r=v(r)}};export{k as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as _}from"node:module";import{resolve as i,parse as A,isAbsolute as S,dirname as T}from"@visulima/path";import{toPath as c}from"@visulima/path/utils";import{FIND_UP_STOP as j}from"./FIND_UP_STOP-CAwY1qU7.js";const g=_(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=e=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[o,n]=s.versions.node.split(".").map(Number);if(o>22||o===22&&n>=3||o===20&&n>=16)return s.getBuiltinModule(e)}return g(e)},{statSync:w,lstatSync:b}=h("node:fs"),F=(e,o={})=>{if(typeof e!="string"&&!Array.isArray(e)&&typeof e!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const n=o.cwd?c(o.cwd):process.cwd();let r=i(n);const{root:f}=A(r),p=c(o.stopAt??f),y=i(r,p),u=o.type??"file",m=function(t){return typeof e=="function"?[e(t)]:typeof e=="string"?[e]:Array.isArray(e)?e:[e]};o.allowSymlinks??=!0;const d=o.allowSymlinks?w:b;for(;r&&r!==y&&r!==f;){for(let t of m(r)){if(t===j)return;if(t===void 0)continue;Buffer.isBuffer(t)?t=t.toString():t instanceof URL&&(t=c(t));const a=S(t)?t:i(r,t);try{const l=d(a);if(u==="file"&&l.isFile()||u==="directory"&&l.isDirectory())return a}catch{}}r=T(r)}};export{F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r=i=>{if(i.isFile())return"file";if(i.isDirectory())return"dir";if(i.isSymbolicLink())return"symlink"};export{r as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as o}from"./index-Ct4GqZSP.js";const i=async(a,t)=>await o(a,t);export{i as default};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { G as GlobOptions } from "./types.d-BMdL_ygj.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
|
+
import{E as r}from"./index-Ct4GqZSP.js";const s=(t,o)=>r(t,o);export{s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const b=/^(?:( )+|\t+)/,u="space";function d(n,t,e){return n&&t===u&&e===1}function h(n,t){const e=new Map;let o=0,r,c;for(const i of n.split(/\n/g)){if(!i)continue;const f=i.match(b);if(f===null)o=0,r="";else{const a=f[0].length,s=f[1]?u:"tab";if(d(t,s,a))continue;s!==r&&(o=0),r=s;let p=1,g=0;const m=a-o;if(o=a,m===0)p=0,g=1;else{const y=Math.abs(m);if(d(t,s,y))continue;c=w(s,y)}const l=e.get(c);e.set(c,l===void 0?[1,0]:[l[0]+p,l[1]+g])}}return e}function w(n,t){return(n===u?"s":"t")+String(t)}function E(n){const t=n[0]==="s"?u:"tab",e=Number(n.slice(1));return{type:t,amount:e}}function v(n){let t,e=0,o=0;for(const[r,[c,i]]of n)(c>e||c===e&&i>o)&&(e=c,o=i,t=r);return t}function x(n,t){return(n===u?" ":" ").repeat(t)}function M(n){if(typeof n!="string")throw new TypeError("Expected a string");let t=h(n,!0);t.size===0&&(t=h(n,!1));const e=v(t);let o,r=0,c="";return e!==void 0&&({type:o,amount:r}=E(e),c=x(o,r)),{amount:r,type:o,indent:c}}export{M as k};
|