@visulima/fs 4.0.2 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/CHANGELOG.md +35 -1
  2. package/LICENSE.md +2 -2
  3. package/dist/eol.js +26 -3
  4. package/dist/error.js +7 -1
  5. package/dist/index.js +32 -1
  6. package/dist/packem_shared/AlreadyExistsError-D5BGeeNR.js +27 -0
  7. package/dist/packem_shared/DirectoryError-CaUV2Pbk.js +27 -0
  8. package/dist/packem_shared/F_OK-MldBaGxb.js +8 -0
  9. package/dist/packem_shared/JSONError-BkHRnInH.js +26 -0
  10. package/dist/packem_shared/NotEmptyError-mOHWXE0m.js +27 -0
  11. package/dist/packem_shared/NotFoundError-D4llRgRs.js +27 -0
  12. package/dist/packem_shared/PermissionError-1qs0skfo.js +27 -0
  13. package/dist/packem_shared/WalkError-DUdQd6FT.js +24 -0
  14. package/dist/packem_shared/assertValidFileContents-BmcLtsGd.js +7 -0
  15. package/dist/packem_shared/assertValidFileOrDirectoryPath-8HANmVjk.js +7 -0
  16. package/dist/packem_shared/collect-DcBwsYYd.js +14 -0
  17. package/dist/packem_shared/collectSync-Bkjf9Dbm.js +14 -0
  18. package/dist/packem_shared/emptyDir-CYB5Tict.js +43 -0
  19. package/dist/packem_shared/emptyDirSync-BD8-1Ytl.js +41 -0
  20. package/dist/packem_shared/ensureDir-C_kuQ5Ik.js +53 -0
  21. package/dist/packem_shared/ensureDirSync-CI5g-uBI.js +53 -0
  22. package/dist/packem_shared/ensureFile-BUtXGlGT.js +47 -0
  23. package/dist/packem_shared/ensureFileSync-C8hASR-1.js +47 -0
  24. package/dist/packem_shared/ensureLink-BPnAG5-P.js +54 -0
  25. package/dist/packem_shared/ensureLinkSync-B-Z7X0ub.js +54 -0
  26. package/dist/packem_shared/ensureSymlink-BGz6W-Wa.js +73 -0
  27. package/dist/packem_shared/ensureSymlinkSync-C5Gk8QYi.js +74 -0
  28. package/dist/packem_shared/findUp-BSnyGqer.js +85 -0
  29. package/dist/packem_shared/findUpSync-jRHbSCMV.js +85 -0
  30. package/dist/packem_shared/get-file-info-type-FD4-jsyg.js +14 -0
  31. package/dist/packem_shared/index-CHM-in-V.js +100 -0
  32. package/dist/packem_shared/is-stats-identical-D8FxpvQU.js +3 -0
  33. package/dist/packem_shared/isAccessible-DuVrTNFV.js +38 -0
  34. package/dist/packem_shared/isAccessibleSync-DI8mM0fA.js +38 -0
  35. package/dist/packem_shared/isFsCaseSensitive-D-ayleCy.js +62 -0
  36. package/dist/packem_shared/move-DbpW5_vA.js +134 -0
  37. package/dist/packem_shared/parseJson-CqUuRguZ.js +231 -0
  38. package/dist/packem_shared/readFile-iHOVXeH-.js +68 -0
  39. package/dist/packem_shared/readFileSync-BkEj9BQY.js +53 -0
  40. package/dist/packem_shared/readJson-pdfQBWDR.js +22 -0
  41. package/dist/packem_shared/readJsonSync-BZqGcA5d.js +22 -0
  42. package/dist/packem_shared/readYaml-BQXTlR2p.js +10 -0
  43. package/dist/packem_shared/readYamlSync-BBBQ5ujx.js +10 -0
  44. package/dist/packem_shared/remove-_oDY3uKo.js +38 -0
  45. package/dist/packem_shared/removeSync-DETRj7Qn.js +38 -0
  46. package/dist/packem_shared/resolve-symlink-target-Kh4GovFf.js +16 -0
  47. package/dist/packem_shared/stripJsonComments-vo4k0mpF.js +19 -0
  48. package/dist/packem_shared/to-uint-8-array-Dz2nF1y1.js +19 -0
  49. package/dist/packem_shared/walk-BhTbpr3y.js +115 -0
  50. package/dist/packem_shared/walk-include-CZco7BvN.js +16 -0
  51. package/dist/packem_shared/walkSync-DDBq95s8.js +114 -0
  52. package/dist/packem_shared/writeFile-DSHERs0Z.js +83 -0
  53. package/dist/packem_shared/writeFileSync-CJp1kXQR.js +83 -0
  54. package/dist/packem_shared/writeJson-C0OfLDbe.js +50 -0
  55. package/dist/packem_shared/writeJsonSync-Cs21FE7v.js +50 -0
  56. package/dist/packem_shared/writeYaml-n4xzYN9a.js +24 -0
  57. package/dist/packem_shared/writeYamlSync-DnOEnP10.js +24 -0
  58. package/dist/size.js +144 -1
  59. package/dist/utils.js +6 -1
  60. package/dist/yaml.js +4 -1
  61. package/package.json +3 -3
  62. package/dist/packem_shared/AlreadyExistsError-CEu6_Tjb.js +0 -1
  63. package/dist/packem_shared/DirectoryError-ddlbUV8C.js +0 -1
  64. package/dist/packem_shared/F_OK-CAwY1qU7.js +0 -1
  65. package/dist/packem_shared/JSONError-D7h6PNWc.js +0 -4
  66. package/dist/packem_shared/NotEmptyError-DMh1o7UL.js +0 -1
  67. package/dist/packem_shared/NotFoundError-BPiW0icm.js +0 -1
  68. package/dist/packem_shared/PermissionError-B1Emi5a9.js +0 -1
  69. package/dist/packem_shared/WalkError-BsngoIKJ.js +0 -1
  70. package/dist/packem_shared/assertValidFileContents-BZFnXa7K.js +0 -1
  71. package/dist/packem_shared/assertValidFileOrDirectoryPath-DgPIPmZT.js +0 -1
  72. package/dist/packem_shared/collect-DO31RsLs.js +0 -1
  73. package/dist/packem_shared/collectSync-Cy7ULmjZ.js +0 -1
  74. package/dist/packem_shared/emptyDir-zBLHyPsJ.js +0 -1
  75. package/dist/packem_shared/emptyDirSync-DZ8nTo6g.js +0 -1
  76. package/dist/packem_shared/ensureDir-CwcwvbZ0.js +0 -1
  77. package/dist/packem_shared/ensureDirSync-DsFhH5oQ.js +0 -1
  78. package/dist/packem_shared/ensureFile-DwcEQVDX.js +0 -1
  79. package/dist/packem_shared/ensureFileSync-KnrH51Ox.js +0 -1
  80. package/dist/packem_shared/ensureLink-5rjQGEBb.js +0 -1
  81. package/dist/packem_shared/ensureLinkSync-CYXpscf2.js +0 -1
  82. package/dist/packem_shared/ensureSymlink-BMLtwpf2.js +0 -1
  83. package/dist/packem_shared/ensureSymlinkSync-CyAnZg8r.js +0 -1
  84. package/dist/packem_shared/findUp-Di7Az07S.js +0 -1
  85. package/dist/packem_shared/findUpSync-iV97v14Q.js +0 -1
  86. package/dist/packem_shared/get-file-info-type-CaWGXRjY.js +0 -1
  87. package/dist/packem_shared/index-CYIVJA0W.js +0 -1
  88. package/dist/packem_shared/is-stats-identical-CohsLtWy.js +0 -1
  89. package/dist/packem_shared/isAccessible-CDFxsAAo.js +0 -1
  90. package/dist/packem_shared/isAccessibleSync-5nzZWgin.js +0 -1
  91. package/dist/packem_shared/isFsCaseSensitive-Drl8fHLV.js +0 -1
  92. package/dist/packem_shared/move-Bz4gSIjp.js +0 -1
  93. package/dist/packem_shared/parseJson-Cj4v3qzl.js +0 -6
  94. package/dist/packem_shared/readFile-CbxFM_zp.js +0 -1
  95. package/dist/packem_shared/readFileSync-B9iv2Sb8.js +0 -1
  96. package/dist/packem_shared/readJson-BgC3msx-.js +0 -1
  97. package/dist/packem_shared/readJsonSync-DHO1vjAG.js +0 -1
  98. package/dist/packem_shared/readYaml-C8QlsEFe.js +0 -1
  99. package/dist/packem_shared/readYamlSync-BIuoBHUt.js +0 -1
  100. package/dist/packem_shared/remove-BUqZUj1W.js +0 -1
  101. package/dist/packem_shared/removeSync-BbT4vmDi.js +0 -1
  102. package/dist/packem_shared/resolve-symlink-target-BofZSDIc.js +0 -1
  103. package/dist/packem_shared/stripJsonComments-DbMjL4qv.js +0 -1
  104. package/dist/packem_shared/to-uint-8-array-DwgaTasY.js +0 -1
  105. package/dist/packem_shared/walk-ZrZngpc4.js +0 -1
  106. package/dist/packem_shared/walk-include-DCiVAwMP.js +0 -1
  107. package/dist/packem_shared/walkSync-BQa4NKSG.js +0 -1
  108. package/dist/packem_shared/writeFile-D5OYEMHu.js +0 -1
  109. package/dist/packem_shared/writeFileSync-CO4ySqUn.js +0 -1
  110. package/dist/packem_shared/writeJson-DfmgiY_s.js +0 -4
  111. package/dist/packem_shared/writeJsonSync-Ck1pmmj_.js +0 -4
  112. package/dist/packem_shared/writeYaml-a_cglLPV.js +0 -1
  113. package/dist/packem_shared/writeYamlSync-vSQIN6OR.js +0 -1
package/dist/size.js CHANGED
@@ -1 +1,144 @@
1
- var w=Object.defineProperty;var g=(e,t)=>w(e,"name",{value:t,configurable:!0});import{createRequire as _}from"node:module";import{toPath as l}from"@visulima/path/utils";const P=_(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,i=g(e=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[t,n]=s.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return s.getBuiltinModule(e)}return P(e)},"__cjs_getBuiltinModule"),{readFileSync:z,statSync:B,existsSync:S}=i("node:fs"),{readFile:v}=i("node:fs/promises"),{isAbsolute:j,resolve:x}=i("node:path"),{Readable:d}=i("node:stream"),{URL:c}=i("node:url"),{gzipSync:a,createGzip:E,brotliCompressSync:f,createBrotliCompress:R}=i("node:zlib");var q=Object.defineProperty,r=g((e,t)=>q(e,"name",{value:t,configurable:!0}),"t");const u=r(e=>{if(j(e))return S(e);try{return S(x(e))}catch{return!1}},"fileExists"),C=r(async e=>{let t=0;for await(const n of e)t+=Buffer.from(n).length;return t},"getStreamSizeEfficient"),h=r(async(e,t)=>{let n=0;const o=t();return await new Promise((p,m)=>{o.on("data",b=>{n+=b.length}),o.on("end",()=>p(n)),o.on("error",m),e.on("error",m),e.pipe(o)})},"getCompressedStreamSizeEfficient"),y=r(async(e,t,n)=>{if(e instanceof c||typeof e=="string"){const o=l(e);if(u(o)){const p=d.from(await v(o));return await n(p)}if(typeof e=="string")return t(Buffer.from(e))}return e instanceof d?await n(e):t(e)},"processInputEfficiently"),A=r(async(e,t)=>await y(e,r(n=>a(n,t).length,"bufferProcessor"),r(async n=>await h(n,()=>E(t)),"streamProcessor")),"gzipSize"),G=r(async(e,t)=>await y(e,r(n=>f(n,t).length,"bufferProcessor"),r(async n=>await h(n,()=>R(t)),"streamProcessor")),"brotliSize"),I=r(async e=>await y(e,r(t=>t.length,"bufferProcessor"),r(async t=>await C(t),"streamProcessor")),"rawSize"),L=r((e,t)=>{if(e instanceof c||typeof e=="string"){const n=l(e);if(u(n))return a(z(n),t).length;if(typeof e=="string")return a(Buffer.from(e),t).length}return a(e,t).length},"gzipSizeSync"),N=r((e,t)=>{if(e instanceof c||typeof e=="string"){const n=l(e);if(u(n))return f(z(n),t).length;if(typeof e=="string")return f(Buffer.from(e),t).length}return f(e,t).length},"brotliSizeSync"),O=r(e=>{if(e instanceof c||typeof e=="string"){const t=l(e);if(u(t))return B(t).size;if(typeof e=="string")return Buffer.from(e).length}return e.length},"rawSizeSync");export{G as brotliSize,N as brotliSizeSync,A as gzipSize,L as gzipSizeSync,I as rawSize,O as rawSizeSync};
1
+ import { createRequire as __cjs_createRequire } from "node:module";
2
+
3
+ const __cjs_require = __cjs_createRequire(import.meta.url);
4
+
5
+ const __cjs_getProcess = typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" ? globalThis.process : process;
6
+
7
+ const __cjs_getBuiltinModule = (module) => {
8
+ // Check if we're in Node.js and version supports getBuiltinModule
9
+ if (typeof __cjs_getProcess !== "undefined" && __cjs_getProcess.versions && __cjs_getProcess.versions.node) {
10
+ const [major, minor] = __cjs_getProcess.versions.node.split(".").map(Number);
11
+ // Node.js 20.16.0+ and 22.3.0+
12
+ if (major > 22 || (major === 22 && minor >= 3) || (major === 20 && minor >= 16)) {
13
+ return __cjs_getProcess.getBuiltinModule(module);
14
+ }
15
+ }
16
+ // Fallback to createRequire
17
+ return __cjs_require(module);
18
+ };
19
+
20
+ const {
21
+ readFileSync,
22
+ statSync,
23
+ existsSync
24
+ } = __cjs_getBuiltinModule("node:fs");
25
+ const {
26
+ readFile
27
+ } = __cjs_getBuiltinModule("node:fs/promises");
28
+ const {
29
+ isAbsolute,
30
+ resolve
31
+ } = __cjs_getBuiltinModule("node:path");
32
+ const {
33
+ Readable
34
+ } = __cjs_getBuiltinModule("node:stream");
35
+ const {
36
+ URL
37
+ } = __cjs_getBuiltinModule("node:url");
38
+ const {
39
+ gzipSync,
40
+ brotliCompressSync,
41
+ createBrotliCompress,
42
+ createGzip
43
+ } = __cjs_getBuiltinModule("node:zlib");
44
+ import { toPath } from '@visulima/path/utils';
45
+
46
+ const fileExists = (input) => {
47
+ if (isAbsolute(input)) {
48
+ return existsSync(input);
49
+ }
50
+ try {
51
+ return existsSync(resolve(input));
52
+ } catch {
53
+ return false;
54
+ }
55
+ };
56
+ const getStreamSizeEfficient = async (stream) => {
57
+ let totalSize = 0;
58
+ for await (const chunk of stream) {
59
+ totalSize += Buffer.from(chunk).length;
60
+ }
61
+ return totalSize;
62
+ };
63
+ const getCompressedStreamSizeEfficient = async (stream, createCompressor) => {
64
+ let totalSize = 0;
65
+ const compressor = createCompressor();
66
+ return await new Promise((resolve2, reject) => {
67
+ compressor.on("data", (chunk) => {
68
+ totalSize += chunk.length;
69
+ });
70
+ compressor.on("end", () => resolve2(totalSize));
71
+ compressor.on("error", reject);
72
+ stream.on("error", reject);
73
+ stream.pipe(compressor);
74
+ });
75
+ };
76
+ const processInputEfficiently = async (input, processor, streamProcessor) => {
77
+ if (input instanceof URL || typeof input === "string") {
78
+ const path = toPath(input);
79
+ if (fileExists(path)) {
80
+ const fileStream = Readable.from(await readFile(path));
81
+ return await streamProcessor(fileStream);
82
+ }
83
+ if (typeof input === "string") {
84
+ return processor(Buffer.from(input));
85
+ }
86
+ }
87
+ if (input instanceof Readable) {
88
+ return await streamProcessor(input);
89
+ }
90
+ return processor(input);
91
+ };
92
+ const gzipSize = async (input, options) => {
93
+ const streamProcessor = async (stream) => await getCompressedStreamSizeEfficient(stream, () => createGzip(options));
94
+ const bufferProcessor = (data) => gzipSync(data, options).length;
95
+ return await processInputEfficiently(input, bufferProcessor, streamProcessor);
96
+ };
97
+ const brotliSize = async (input, options) => {
98
+ const streamProcessor = async (stream) => await getCompressedStreamSizeEfficient(stream, () => createBrotliCompress(options));
99
+ const bufferProcessor = (data) => brotliCompressSync(data, options).length;
100
+ return await processInputEfficiently(input, bufferProcessor, streamProcessor);
101
+ };
102
+ const rawSize = async (input) => {
103
+ const streamProcessor = async (stream) => await getStreamSizeEfficient(stream);
104
+ const bufferProcessor = (data) => data.length;
105
+ return await processInputEfficiently(input, bufferProcessor, streamProcessor);
106
+ };
107
+ const gzipSizeSync = (input, options) => {
108
+ if (input instanceof URL || typeof input === "string") {
109
+ const path = toPath(input);
110
+ if (fileExists(path)) {
111
+ return gzipSync(readFileSync(path), options).length;
112
+ }
113
+ if (typeof input === "string") {
114
+ return gzipSync(Buffer.from(input), options).length;
115
+ }
116
+ }
117
+ return gzipSync(input, options).length;
118
+ };
119
+ const brotliSizeSync = (input, options) => {
120
+ if (input instanceof URL || typeof input === "string") {
121
+ const path = toPath(input);
122
+ if (fileExists(path)) {
123
+ return brotliCompressSync(readFileSync(path), options).length;
124
+ }
125
+ if (typeof input === "string") {
126
+ return brotliCompressSync(Buffer.from(input), options).length;
127
+ }
128
+ }
129
+ return brotliCompressSync(input, options).length;
130
+ };
131
+ const rawSizeSync = (input) => {
132
+ if (input instanceof URL || typeof input === "string") {
133
+ const path = toPath(input);
134
+ if (fileExists(path)) {
135
+ return statSync(path).size;
136
+ }
137
+ if (typeof input === "string") {
138
+ return Buffer.from(input).length;
139
+ }
140
+ }
141
+ return input.length;
142
+ };
143
+
144
+ export { brotliSize, brotliSizeSync, gzipSize, gzipSizeSync, rawSize, rawSizeSync };
package/dist/utils.js CHANGED
@@ -1 +1,6 @@
1
- import{default as e}from"./packem_shared/JSONError-D7h6PNWc.js";import{default as a}from"./packem_shared/assertValidFileContents-BZFnXa7K.js";import{default as f}from"./packem_shared/assertValidFileOrDirectoryPath-DgPIPmZT.js";import{default as m}from"./packem_shared/parseJson-Cj4v3qzl.js";import{default as d}from"./packem_shared/stripJsonComments-DbMjL4qv.js";import{toPath as x}from"@visulima/path/utils";export{e as JSONError,a as assertValidFileContents,f as assertValidFileOrDirectoryPath,m as parseJson,d as stripJsonComments,x as toPath};
1
+ export { default as JSONError } from './packem_shared/JSONError-BkHRnInH.js';
2
+ export { default as assertValidFileContents } from './packem_shared/assertValidFileContents-BmcLtsGd.js';
3
+ export { default as assertValidFileOrDirectoryPath } from './packem_shared/assertValidFileOrDirectoryPath-8HANmVjk.js';
4
+ export { default as parseJson } from './packem_shared/parseJson-CqUuRguZ.js';
5
+ export { default as stripJsonComments } from './packem_shared/stripJsonComments-vo4k0mpF.js';
6
+ export { toPath } from '@visulima/path/utils';
package/dist/yaml.js CHANGED
@@ -1 +1,4 @@
1
- import{default as r}from"./packem_shared/readYaml-C8QlsEFe.js";import{default as f}from"./packem_shared/readYamlSync-BIuoBHUt.js";import{default as m}from"./packem_shared/writeYaml-a_cglLPV.js";import{default as d}from"./packem_shared/writeYamlSync-vSQIN6OR.js";export{r as readYaml,f as readYamlSync,m as writeYaml,d as writeYamlSync};
1
+ export { default as readYaml } from './packem_shared/readYaml-BQXTlR2p.js';
2
+ export { default as readYamlSync } from './packem_shared/readYamlSync-BBBQ5ujx.js';
3
+ export { default as writeYaml } from './packem_shared/writeYaml-n4xzYN9a.js';
4
+ export { default as writeYamlSync } from './packem_shared/writeYamlSync-DnOEnP10.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/fs",
3
- "version": "4.0.2",
3
+ "version": "4.0.4",
4
4
  "description": "Human friendly file system utilities for Node.js",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -113,8 +113,8 @@
113
113
  "LICENSE.md"
114
114
  ],
115
115
  "dependencies": {
116
- "@visulima/path": "2.0.1",
117
- "type-fest": "^5.1.0"
116
+ "@visulima/path": "2.0.3",
117
+ "type-fest": "^5.2.0"
118
118
  },
119
119
  "peerDependencies": {
120
120
  "yaml": "^2.7.1"
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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};
@@ -1,4 +0,0 @@
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};
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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: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};
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
1
- var n=Object.defineProperty;var a=(r,e)=>n(r,"name",{value:e,configurable:!0});import o from"./walk-ZrZngpc4.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};
@@ -1 +0,0 @@
1
- var t=Object.defineProperty;var s=(r,e)=>t(r,"name",{value:e,configurable:!0});import a from"./walkSync-BQa4NKSG.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};
@@ -1 +0,0 @@
1
- var n=Object.defineProperty;var s=(e,r)=>n(e,"name",{value:r,configurable:!0});import{createRequire as a}from"node:module";import{join as d}from"@visulima/path";import{toPath as l}from"@visulima/path/utils";import _ from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";const c=a(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,i=s(e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[r,t]=o.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return o.getBuiltinModule(e)}return c(e)},"__cjs_getBuiltinModule"),{existsSync:u}=i("node:fs"),{mkdir:f,readdir:m,rm:p}=i("node:fs/promises");var v=Object.defineProperty,y=s((e,r)=>v(e,"name",{value:r,configurable:!0}),"o");const q=y(async(e,r)=>{if(_(e),!u(e)){await f(e,{recursive:!0});return}for await(const t of await m(e))await p(d(l(e),t),{...r,force:!0,recursive:!0})},"emptyDir");export{q as default};
@@ -1 +0,0 @@
1
- var i=Object.defineProperty;var s=(e,r)=>i(e,"name",{value:r,configurable:!0});import{createRequire as n}from"node:module";import{join as d}from"@visulima/path";import{toPath as l}from"@visulima/path/utils";import _ from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";const c=n(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=s(e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[r,t]=o.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return o.getBuiltinModule(e)}return c(e)},"__cjs_getBuiltinModule"),{existsSync:f,mkdirSync:a,readdirSync:m,rmSync:p}=u("node:fs");var y=Object.defineProperty,v=s((e,r)=>y(e,"name",{value:r,configurable:!0}),"e");const q=v((e,r)=>{if(_(e),!f(e)){a(e,{recursive:!0});return}for(const t of m(e))p(d(l(e),t),{...r,force:!0,recursive:!0})},"emptyDirSync");export{q as default};
@@ -1 +0,0 @@
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}),"i");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 '${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 '${n(t)}'`)}},"ensureDir");export{w as default};
@@ -1 +0,0 @@
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),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=s(r=>{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(r)}return u(r)},"__cjs_getBuiltinModule"),{lstatSync:i,mkdirSync:d}=f("node:fs");var l=Object.defineProperty,m=s((r,e)=>l(r,"name",{value:e,configurable:!0}),"o");const E=m(r=>{p(r);try{const e=i(r);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${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 o=i(r);if(!o.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${n(o)}'`)}},"ensureDirSync");export{E as default};
@@ -1 +0,0 @@
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-CwcwvbZ0.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,h=t((r,e)=>g(r,"name",{value:e,configurable:!0}),"e");const F=h(async r=>{u(r);try{const e=await f(r);if(!e.isFile())throw new Error(`Ensure path exists, expected 'file', got '${_(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};
@@ -1 +0,0 @@
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-DsFhH5oQ.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 y=Object.defineProperty,g=t((r,e)=>y(r,"name",{value:e,configurable:!0}),"e");const F=g(r=>{m(r);try{const e=f(r);if(!e.isFile())throw new Error(`Ensure path exists, expected 'file', got '${_(e)}'`)}catch(e){if(e.code==="ENOENT"){d(p(u(r))),l(r,new Uint8Array);return}throw e}},"ensureFileSync");export{F as default};
@@ -1 +0,0 @@
1
- var f=Object.defineProperty;var i=(t,e)=>f(t,"name",{value:e,configurable:!0});import{createRequire as p}from"node:module";import{toNamespacedPath as c,dirname as g}from"@visulima/path";import{toPath as m}from"@visulima/path/utils";import l from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import h from"./ensureDir-CwcwvbZ0.js";import{l as y}from"./is-stats-identical-CohsLtWy.js";const u=p(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=i(t=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[e,o]=r.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return r.getBuiltinModule(t)}return u(t)},"__cjs_getBuiltinModule"),{lstat:n,link:_}=d("node:fs/promises");var b=Object.defineProperty,j=i((t,e)=>b(t,"name",{value:e,configurable:!0}),"m");const L=j(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(s){throw s.message=s.message.replace("lstat","ensureLink"),s}o&&y(a,o)||(await h(g(e)),await _(t,e))},"ensureLink");export{L as default};
@@ -1 +0,0 @@
1
- var p=Object.defineProperty;var n=(o,e)=>p(o,"name",{value:e,configurable:!0});import{createRequire as u}from"node:module";import{toNamespacedPath as c,dirname as g}from"@visulima/path";import{toPath as m}from"@visulima/path/utils";import l from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import h from"./ensureDirSync-DsFhH5oQ.js";import{l as y}from"./is-stats-identical-CohsLtWy.js";const f=u(import.meta.url),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=n(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 f(o)},"__cjs_getBuiltinModule"),{lstatSync:a,linkSync:_}=d("node:fs");var b=Object.defineProperty,j=n((o,e)=>b(o,"name",{value:e,configurable:!0}),"o");const L=j((o,e)=>{l(o),l(e),o=c(m(o)),e=c(m(e));let r;try{r=a(e)}catch{}let i;try{i=a(o)}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}r&&y(i,r)||(h(g(e)),_(o,e))},"ensureLinkSync");export{L as default};
@@ -1 +0,0 @@
1
- var v=Object.defineProperty;var c=(o,e)=>v(o,"name",{value:e,configurable:!0});import{createRequire as j}from"node:module";import{toNamespacedPath as f,dirname as T,resolve as x}from"@visulima/path";import{toPath as p}from"@visulima/path/utils";import d from"./AlreadyExistsError-CEu6_Tjb.js";import u from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import q from"./ensureDir-CwcwvbZ0.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";const P=j(import.meta.url),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$=c(o=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[e,t]=i.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return i.getBuiltinModule(o)}return P(o)},"__cjs_getBuiltinModule"),{lstat:m,stat:n,symlink:k,readlink:S}=$("node:fs/promises");var L=Object.defineProperty,A=c((o,e)=>L(o,"name",{value:e,configurable:!0}),"f");const B=process.platform==="win32"||/^(?:msys|cygwin)$/.test(process.env.OSTYPE),D=A(async(o,e,t)=>{u(o),u(e);const r=E(o,e);e=f(p(e));try{if((await m(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 g=await m(r),h=y(g);await q(T(e));const _=t??(B?"junction":h==="dir"?"dir":"file");try{await k(f(p(r)),e,_)}catch(s){if(s.code!=="EEXIST")throw s;const a=await m(e);if(!a.isSymbolicLink())throw new d(`A ${y(a)} already exists at the path: ${e}`);const b=await S(e),l=f(x(b));if(l!==r)throw new d(`A symlink targeting to an undesired path already exists: ${e} -> ${l}`)}},"ensureSymlink");export{D as default};
@@ -1 +0,0 @@
1
- var v=Object.defineProperty;var a=(o,e)=>v(o,"name",{value:e,configurable:!0});import{createRequire as w}from"node:module";import{toNamespacedPath as f,dirname as $,resolve as x}from"@visulima/path";import{toPath as p}from"@visulima/path/utils";import d from"./AlreadyExistsError-CEu6_Tjb.js";import u from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import q from"./ensureDirSync-DsFhH5oQ.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";const j=w(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=a(o=>{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(o)}return j(o)},"__cjs_getBuiltinModule"),{lstatSync:m,statSync:c,symlinkSync:P,readlinkSync:T}=k("node:fs");var L=Object.defineProperty,A=a((o,e)=>L(o,"name",{value:e,configurable:!0}),"f");const B=process.platform==="win32"||/^(?:msys|cygwin)$/.test(process.env.OSTYPE),D=A((o,e,i)=>{u(o),u(e);const r=E(o,e);e=f(p(e));try{if(m(e).isSymbolicLink()&&g(c(r),c(e))){const n=c(r),t=c(e);if(g(n,t))return}}catch{}const h=m(r),_=y(h);q($(e));const S=i??(B?"junction":_==="dir"?"dir":"file");try{P(f(p(r)),e,S)}catch(n){if(n.code!=="EEXIST")throw n;const t=m(e);if(!t.isSymbolicLink())throw new d(`A ${y(t)} already exists at the path: ${e}`);const b=T(e),l=f(x(b));if(l!==r)throw new d(`A symlink targeting to an undesired path already exists: ${e} -> ${l}`)}},"ensureSymlinkSync");export{D as default};
@@ -1 +0,0 @@
1
- var h=Object.defineProperty;var i=(e,t)=>h(e,"name",{value:t,configurable:!0});import{createRequire as v}from"node:module";import{resolve as a,parse as P,isAbsolute as S,dirname as k}from"@visulima/path";import{toPath as p}from"@visulima/path/utils";import{FIND_UP_STOP as B}from"./F_OK-CAwY1qU7.js";const b=v(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,m=i(e=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[t,n]=s.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return s.getBuiltinModule(e)}return b(e)},"__cjs_getBuiltinModule"),{stat:T,lstat:j}=m("node:fs/promises"),{fileURLToPath:A}=m("node:url");var R=Object.defineProperty,y=i((e,t)=>R(e,"name",{value:t,configurable:!0}),"s");const L=y(async(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 n=t.cwd?p(t.cwd):process.cwd();let r=a(n);const{root:c}=P(r),d=p(t.stopAt??c),g=a(r,d),f=t.type??"file",_=y(async function(o){return typeof e=="function"?[await e(o)]:typeof e=="string"?[e]:Array.isArray(e)?e:[e]},"getMatchers");t.allowSymlinks===void 0&&(t.allowSymlinks=!0);const w=t.allowSymlinks?T:j;for(;r&&r!==g&&r!==c;){for await(let o of await _(r)){if(o===B)return;if(o===void 0)continue;Buffer.isBuffer(o)?o=o.toString():o instanceof URL&&(o=A(o));const l=S(o)?o:a(r,o);try{const u=await w(l);if(f==="file"&&u.isFile()||f==="directory"&&u.isDirectory())return l}catch{}}r=k(r)}},"findUp");export{L as default};
@@ -1 +0,0 @@
1
- var v=Object.defineProperty;var i=(e,t)=>v(e,"name",{value:t,configurable:!0});import{createRequire as b}from"node:module";import{resolve as c,parse as A,isAbsolute as P,dirname as k}from"@visulima/path";import{toPath as p}from"@visulima/path/utils";import{FIND_UP_STOP as B}from"./F_OK-CAwY1qU7.js";const w=b(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 R=Object.defineProperty,y=i((e,t)=>R(e,"name",{value:t,configurable:!0}),"o");const L=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===void 0&&(t.allowSymlinks=!0);const h=t.allowSymlinks?S:T;for(;r&&r!==g&&r!==f;){for(let o of _(r)){if(o===B)return;if(o===void 0)continue;Buffer.isBuffer(o)?o=o.toString():o instanceof URL&&(o=j(o));const l=P(o)?o:c(r,o);try{const u=h(l);if(a==="file"&&u.isFile()||a==="directory"&&u.isDirectory())return l}catch{}}r=k(r)}},"findUpSync");export{L as default};
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
1
- var a=Object.defineProperty;var t=(n,e)=>a(n,"name",{value:e,configurable:!0});var i=Object.defineProperty,r=t((n,e)=>i(n,"name",{value:e,configurable:!0}),"d");const v=r((n,e)=>!!e.ino&&!!e.dev&&e.ino===n.ino&&e.dev===n.dev,"isStatsIdentical");export{v as l};
@@ -1 +0,0 @@
1
- var i=Object.defineProperty;var s=(e,r)=>i(e,"name",{value:r,configurable:!0});import{createRequire as n}from"node:module";import{toPath as f}from"@visulima/path/utils";import{F_OK as l}from"./F_OK-CAwY1qU7.js";import m from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";const c=n(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,a=s(e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[r,t]=o.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return o.getBuiltinModule(e)}return c(e)},"__cjs_getBuiltinModule"),{access:u}=a("node:fs/promises");var p=Object.defineProperty,_=s((e,r)=>p(e,"name",{value:r,configurable:!0}),"o");async function d(e,r=l){m(e),e=f(e);try{return await u(e,r),!0}catch{return!1}}s(d,"m");_(d,"isAccessible");export{d as default};
@@ -1 +0,0 @@
1
- var n=Object.defineProperty;var t=(e,r)=>n(e,"name",{value:r,configurable:!0});import{createRequire as i}from"node:module";import{toPath as f}from"@visulima/path/utils";import{F_OK as l}from"./F_OK-CAwY1qU7.js";import m from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";const c=i(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=t(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 c(e)},"__cjs_getBuiltinModule"),{accessSync:a}=u("node:fs");var p=Object.defineProperty,_=t((e,r)=>p(e,"name",{value:r,configurable:!0}),"o");function d(e,r=l){m(e),e=f(e);try{return a(e,r),!0}catch{return!1}}t(d,"m");_(d,"isAccessibleSync");export{d as default};
@@ -1 +0,0 @@
1
- var y=Object.defineProperty;var c=(s,e)=>y(s,"name",{value:e,configurable:!0});import{createRequire as d}from"node:module";const h=d(import.meta.url),n=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=c(s=>{if(typeof n<"u"&&n.versions&&n.versions.node){const[e,t]=n.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return n.getBuiltinModule(s)}return h(s)},"__cjs_getBuiltinModule"),v=u("fs"),_=u("os"),m=u("path");var g=Object.defineProperty,b=c((s,e)=>g(s,"name",{value:e,configurable:!0}),"a"),j=Object.defineProperty,o=b((s,e)=>j(s,"name",{value:e,configurable:!0}),"s");const f=o(s=>{let e="";for(let t=0;t<s.length;t+=1){const r=s[t],i=r.toUpperCase();e+=r===i?r.toLowerCase():i}return e},"invertCase"),a=new Map,p=o((s,e)=>{const t=m.join(s,`.is-fs-case-sensitive-test-${process.pid}`);try{return e.writeFileSync(t,""),!e.existsSync(f(t))}finally{try{e.unlinkSync(t)}catch{}}},"checkDirectoryCaseWithWrite"),S=o((s,e,t)=>{try{return p(s,t)}catch(r){if(e===void 0)return p(_.tmpdir(),t);throw r}},"checkDirectoryCaseWithFallback"),k=o((s,e=v,t=!0)=>{const r=s??process.cwd();if(t&&a.has(r))return a.get(r);let i;const l=f(r);return l!==r&&e.existsSync(r)?i=!e.existsSync(l):i=S(r,s,e),t&&a.set(r,i),i},"isFsCaseSensitive");export{k as isFsCaseSensitive};
@@ -1 +0,0 @@
1
- var S=Object.defineProperty;var i=(r,e)=>S(r,"name",{value:e,configurable:!0});import{createRequire as b}from"node:module";import{toPath as m}from"@visulima/path/utils";import{dirname as c,resolve as s}from"@visulima/path";import j from"./isAccessible-CDFxsAAo.js";import k from"./isAccessibleSync-5nzZWgin.js";const _=b(import.meta.url),n=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,y=i(r=>{if(typeof n<"u"&&n.versions&&n.versions.node){const[e,t]=n.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return n.getBuiltinModule(r)}return _(r)},"__cjs_getBuiltinModule"),{cwd:d}=n,{mkdir:g,rename:D,copyFile:$,unlink:E}=y("node:fs/promises"),{mkdirSync:M,renameSync:P,copyFileSync:x,unlinkSync:T}=y("node:fs");var F=Object.defineProperty,v=i((r,e)=>F(r,"name",{value:e,configurable:!0}),"o$2");class O extends Error{static{i(this,"a")}static{v(this,"SameDirectoryError")}constructor(e,t){super(`Source directory "${c(e)}" does not match destination directory "${c(t)}"`),this.name="SameDirectoryError"}}const f=v((r,e)=>{if(!r||!e)throw new Error("Source and destination paths must not be empty");if(c(r)!==c(e))throw new O(r,e)},"validateSameDirectory");var q=Object.defineProperty,B=i((r,e)=>q(r,"name",{value:e,configurable:!0}),"o$1");const p=B(async(r,e,{cwd:t,directoryMode:o,overwrite:u,validateDirectory:w})=>{if(t&&(r=s(t,r),e=s(t,e)),w&&f(r,e),!u&&await j(e))throw new Error(`The destination file exists: ${e}`);await g(c(e),{mode:o,recursive:!0});try{await D(r,e)}catch(a){if(a.code==="EXDEV")await $(r,e),await E(r);else throw a}},"internalMoveFile");var R=Object.defineProperty,V=i((r,e)=>R(r,"name",{value:e,configurable:!0}),"o");const h=V((r,e,{cwd:t,directoryMode:o,overwrite:u,validateDirectory:w})=>{if(t&&(r=s(t,r),e=s(t,e)),w&&f(r,e),!u&&k(e))throw new Error(`The destination file exists: ${e}`);M(c(e),{mode:o,recursive:!0});try{P(r,e)}catch(a){if(a.code==="EXDEV")x(r,e),T(r);else throw a}},"internalMoveFileSync");var X=Object.defineProperty,l=i((r,e)=>X(r,"name",{value:e,configurable:!0}),"i");const I=l(async(r,e,t={})=>{const o={overwrite:!0,validateDirectory:!1,...t,cwd:t.cwd?m(t.cwd):d()};await p(r,e,o)},"move"),J=l((r,e,t)=>{const o={overwrite:!0,validateDirectory:!1,...t};o.cwd=o.cwd?m(o.cwd):d(),h(r,e,o)},"moveSync"),K=l(async(r,e,t)=>{const o={overwrite:!0,...t,validateDirectory:!0};o.cwd=o.cwd?m(o.cwd):d(),await p(r,e,o)},"rename"),L=l((r,e,t)=>{const o={overwrite:!0,...t,validateDirectory:!0};o.cwd=o.cwd?m(o.cwd):d(),h(r,e,o)},"renameSync");export{I as move,J as moveSync,K as rename,L as renameSync};
@@ -1,6 +0,0 @@
1
- var T=Object.defineProperty;var y=(e,t)=>T(e,"name",{value:t,configurable:!0});import W from"./JSONError-D7h6PNWc.js";var F=Object.defineProperty,M=y((e,t)=>F(e,"name",{value:t,configurable:!0}),"A"),J=Object.defineProperty,j=M((e,t)=>J(e,"name",{value:t,configurable:!0}),"v"),B=Object.defineProperty,E=j((e,t)=>B(e,"name",{value:t,configurable:!0}),"r$1");const G=E(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
2
- `),"normalizeLF"),I=globalThis.process||Object.create(null),P={versions:{}},k=new Proxy(I,{get(e,t){if(t in e)return e[t];if(t in P)return P[t]}});var q=Object.defineProperty,U=j((e,t)=>q(e,"name",{value:t,configurable:!0}),"b");const _=U((e,t,o,r)=>{const n={column:0,line:-1,...e.start},l={...n,...e.end},i=n.line,s=n.column,m=l.line,g=l.column;let p=Math.max(i-(o+1),0),d=Math.min(t.length,m+r);i===-1&&(p=0),m===-1&&(d=t.length);const b=m-i,c={};if(b)for(let a=0;a<=b;a++){const u=a+i;if(!s)c[u]=!0;else if(a===0){const f=t[u-1]?.length;c[u]=[s,(f??0)-s+1]}else if(a===b)c[u]=[0,g];else{const f=t[u-a]?.length;c[u]=[0,f]}}else s===g?c[i]=s?[s,0]:!0:c[i]=[s,(g??0)-(s??0)];return{end:d,markerLines:c,start:p}},"getMarkerLines");var z=Object.defineProperty,$=j((e,t)=>z(e,"name",{value:t,configurable:!0}),"o");const D=k.platform==="win32"&&!k.env?.WT_SESSION?">":"❯",H=$((e,t,o)=>{const r={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...o,color:{gutter:$(a=>a,"gutter"),marker:$(a=>a,"marker"),message:$(a=>a,"message"),...o?.color}},n=t.start&&typeof t.start.column=="number";let l=G(e).split(`
3
- `);typeof r?.tabWidth=="number"&&(l=l.map(a=>a.replaceAll(" "," ".repeat(r.tabWidth))));const{end:i,markerLines:s,start:m}=_(t,l,r.linesAbove,r.linesBelow),g=String(i).length,{gutter:p,marker:d,message:b}=r.color;let c=l.slice(m,i).map((a,u)=>{const f=m+1+u,v=s[f],S=` ${f}`.slice(-g),L=!s[f+1],x=` ${S}${r.showGutter?" |":""}`;if(v){let A="";if(Array.isArray(v)){const N=a.replaceAll(/[^\t]/g," ").slice(0,Math.max(v[0]-1,0)),C=v[1]||1;A=[`
4
- `,r.prefix+p(x.replaceAll(/\d/g," "))," ",N,d("^").repeat(C)].join(""),L&&r.message&&(A+=` ${b(r.message)}`)}return[r.prefix+d(D),p(x),a.length>0?` ${a}`:"",A].join("")}return`${r.prefix} ${p(x)}${a.length>0?` ${a}`:""}`}).join(`
5
- `);return r.message&&!n&&(c=`${r.prefix+" ".repeat(g+1)+r.message}
6
- ${c}`),c},"codeFrame");var K=Object.defineProperty,Q=y((e,t)=>K(e,"name",{value:t,configurable:!0}),"s$1"),R=Object.defineProperty,V=Q((e,t)=>R(e,"name",{value:t,configurable:!0}),"o"),X=Object.defineProperty,O=V((e,t)=>X(e,"name",{value:t,configurable:!0}),"l");const w=O((e,t)=>{let o=0,r=t.length-2;for(;o<r;){const n=o+(r-o>>1);if(e<t[n])r=n-1;else if(e>=t[n+1])o=n+1;else{o=n;break}}return o},"binarySearch"),Y=O(e=>e.split(/\n|\r(?!\n)/).reduce((t,o)=>(t.push(t.at(-1)+o.length+1),t),[0]),"getLineStartIndexes"),Z=O((e,t,o)=>{const r=o?.skipChecks??!1;if(!r&&(!Array.isArray(e)&&typeof e!="string"||(typeof e=="string"||Array.isArray(e))&&e.length===0))return{column:0,line:0};if(!r&&(typeof t!="number"||typeof e=="string"&&t>=e.length||Array.isArray(e)&&t+1>=e.at(-1)))return{column:0,line:0};if(typeof e=="string"){const l=Y(e),i=w(t,l);return{column:t-l[i]+1,line:i+1}}const n=w(t,e);return{column:t-e[n]+1,line:n+1}},"indexToLineColumn");var ee=Object.defineProperty,h=y((e,t)=>ee(e,"name",{value:t,configurable:!0}),"s");const te=h(e=>`\\u{${e.codePointAt(0).toString(16)}}`,"getCodePoint"),re=h((e,t,o)=>H(e,{start:t},{tabWidth:!1,...o}),"generateCodeFrame"),ne=h((e,t)=>{const o=/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/.exec(t);if(!o)return;let{column:r,index:n,line:l}=o.groups;return l&&r?{column:Number(r),line:Number(l)}:(n=Number(n),n===e.length&&(n=e.length-1),Z(e,n))},"getErrorLocation"),oe=h(e=>e.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(t,o,r)=>`"${r}"(${te(r)})`),"addCodePointToUnexpectedToken");function ae(e,t,o,r){typeof t=="string"&&(typeof o=="object"&&(r=o),o=t,t=void 0);let n;try{return JSON.parse(e,t)}catch(s){n=s.message}let l;e?(l=ne(e,n),n=oe(n)):n+=" while parsing empty string";const i=new W(n);throw i.fileName=o,l&&(i.codeFrame=re(e,l,r)),i}y(ae,"J");h(ae,"parseJson");export{ae as default};
@@ -1 +0,0 @@
1
- var g=Object.defineProperty;var i=(e,o)=>g(e,"name",{value:o,configurable:!0});import{createRequire as _}from"node:module";import{toPath as y}from"@visulima/path/utils";import{R_OK as P}from"./F_OK-CAwY1qU7.js";import R from"./PermissionError-B1Emi5a9.js";import f from"./isAccessible-CDFxsAAo.js";import q from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";const h=_(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,m=i(e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[o,n]=r.versions.node.split(".").map(Number);if(o>22||o===22&&n>=3||o===20&&n>=16)return r.getBuiltinModule(e)}return h(e)},"__cjs_getBuiltinModule"),{readFile:w}=m("node:fs/promises"),{unzip:j,brotliDecompress:v}=m("node:zlib");var z=Object.defineProperty,p=i((e,o)=>z(e,"name",{value:o,configurable:!0}),"n");const T={brotli:v,gzip:j,none:p((e,o)=>{o(null,e)},"none")},E=p(async(e,o)=>{if(q(e),e=y(e),!await f(e))throw new R(`unable to read the non-accessible file: ${e}`);if(!await f(e,P))throw new Error(`Unable to read the non-readable file: ${e}`);const{buffer:n,compression:d,encoding:s,flag:a}=o??{};return await w(e,a?{encoding:s,flag:a}:{encoding:s}).then(async t=>await new Promise((u,b)=>{T[d??"none"](t,(c,l)=>{c?b(c):u(n?l:l.toString())})})).catch(t=>{throw t})},"readFile");export{E as default};
@@ -1 +0,0 @@
1
- var u=Object.defineProperty;var i=(e,o)=>u(e,"name",{value:o,configurable:!0});import{createRequire as g}from"node:module";import{toPath as v}from"@visulima/path/utils";import{R_OK as j}from"./F_OK-CAwY1qU7.js";import a from"./PermissionError-B1Emi5a9.js";import f from"./isAccessibleSync-5nzZWgin.js";import S from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";const b=g(import.meta.url),n=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=i(e=>{if(typeof n<"u"&&n.versions&&n.versions.node){const[o,r]=n.versions.node.split(".").map(Number);if(o>22||o===22&&r>=3||o===20&&r>=16)return n.getBuiltinModule(e)}return b(e)},"__cjs_getBuiltinModule"),{readFileSync:_}=l("node:fs"),{unzipSync:y,brotliDecompressSync:h}=l("node:zlib");var w=Object.defineProperty,d=i((e,o)=>w(e,"name",{value:o,configurable:!0}),"n");const $={brotli:h,gzip:y,none:d(e=>e,"none")},M=d((e,o)=>{if(S(e),e=v(e),!f(e))throw new a(`unable to read the non-accessible file: ${e}`);if(!f(e,j))throw new a(`invalid access to read file at: ${e}`);const{buffer:r,compression:m,encoding:t,flag:s}=o??{},p=_(e,s?{encoding:t,flag:s}:{encoding:t}),c=$[m??"none"](p);return r?c:c.toString()},"readFileSync");export{M as default};
@@ -1 +0,0 @@
1
- var i=Object.defineProperty;var t=(e,o)=>i(e,"name",{value:o,configurable:!0});import{toPath as d}from"@visulima/path/utils";import u from"./parseJson-Cj4v3qzl.js";import m from"./readFile-CbxFM_zp.js";var p=Object.defineProperty,s=t((e,o)=>p(e,"name",{value:o,configurable:!0}),"i");async function l(e,o,n){typeof o=="object"&&(n=o,o=void 0);const c=await m(e,{buffer:!0,encoding:void 0});let r=new TextDecoder().decode(c);const{beforeParse:a,color:f}=n??{};return typeof a=="function"&&(r=a(r)),u(r,o,d(e),{color:f})}t(l,"c");s(l,"readJson");export{l as default};
@@ -1 +0,0 @@
1
- var i=Object.defineProperty;var t=(e,o)=>i(e,"name",{value:o,configurable:!0});import{toPath as d}from"@visulima/path/utils";import u from"./parseJson-Cj4v3qzl.js";import m from"./readFileSync-B9iv2Sb8.js";var p=Object.defineProperty,l=t((e,o)=>p(e,"name",{value:o,configurable:!0}),"r");function s(e,o,c){typeof o=="object"&&(c=o,o=void 0);const f=m(e,{buffer:!0,encoding:void 0});let r=new TextDecoder().decode(f);const{beforeParse:n,color:a}=c??{};return typeof n=="function"&&(r=n(r)),u(r,o,d(e),{color:a})}t(s,"c");l(s,"readJsonSync");export{s as default};
@@ -1 +0,0 @@
1
- var l=Object.defineProperty;var r=(o,e)=>l(o,"name",{value:e,configurable:!0});import{createRequire as p}from"node:module";import m from"./readFile-CbxFM_zp.js";const d=p(import.meta.url),v=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process;const{parse:t}=d("yaml");var _=Object.defineProperty,g=r((o,e)=>_(o,"name",{value:e,configurable:!0}),"e");async function b(o,e,i){const{buffer:a,compression:c,encoding:f="utf8",flag:u,...s}=i??{},n=await m(o,{buffer:a,compression:c,encoding:f,flag:u});return typeof e=="function"?t(n,e,s):t(n,s)}r(b,"d");g(b,"readYaml");export{b as default};
@@ -1 +0,0 @@
1
- var l=Object.defineProperty;var r=(o,e)=>l(o,"name",{value:e,configurable:!0});import{createRequire as p}from"node:module";import m from"./readFileSync-B9iv2Sb8.js";const d=p(import.meta.url),v=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process;const{parse:t}=d("yaml");var g=Object.defineProperty,_=r((o,e)=>g(o,"name",{value:e,configurable:!0}),"i");function b(o,e,i){const{buffer:c,compression:f,encoding:u="utf8",flag:a,...n}=i??{},s=m(o,{buffer:c,compression:f,encoding:u,flag:a});return typeof e=="function"?t(s,e,n):t(s,n)}r(b,"d");_(b,"readYamlSync");export{b as default};
@@ -1 +0,0 @@
1
- var i=Object.defineProperty;var s=(e,r)=>i(e,"name",{value:r,configurable:!0});import{createRequire as n}from"node:module";import m from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";const a=n(import.meta.url),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=s(e=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[r,o]=t.versions.node.split(".").map(Number);if(r>22||r===22&&o>=3||r===20&&o>=16)return t.getBuiltinModule(e)}return a(e)},"__cjs_getBuiltinModule"),{unlink:u,rm:l}=c("node:fs/promises");var f=Object.defineProperty,p=s((e,r)=>f(e,"name",{value:r,configurable:!0}),"t");const v=p(async(e,r={})=>{m(e);try{await u(e)}catch{}try{await l(e,{force:!0,maxRetries:r?.maxRetries,recursive:!0,retryDelay:r?.retryDelay})}catch{}},"remove");export{v as default};
@@ -1 +0,0 @@
1
- var n=Object.defineProperty;var o=(e,r)=>n(e,"name",{value:r,configurable:!0});import{createRequire as i}from"node:module";import f from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";const c=i(import.meta.url),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,a=o(e=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[r,s]=t.versions.node.split(".").map(Number);if(r>22||r===22&&s>=3||r===20&&s>=16)return t.getBuiltinModule(e)}return c(e)},"__cjs_getBuiltinModule"),{unlinkSync:u,rmSync:l}=a("node:fs");var m=Object.defineProperty,y=o((e,r)=>m(e,"name",{value:r,configurable:!0}),"t");const v=y((e,r={})=>{f(e);try{u(e)}catch{}try{l(e,{force:!0,maxRetries:r?.maxRetries,recursive:!0,retryDelay:r?.retryDelay})}catch{}},"removeSync");export{v as default};
@@ -1 +0,0 @@
1
- var i=Object.defineProperty;var o=(e,t)=>i(e,"name",{value:t,configurable:!0});import{resolve as r,dirname as a}from"@visulima/path";var n=Object.defineProperty,s=o((e,t)=>n(e,"name",{value:t,configurable:!0}),"i");const m=s((e,t)=>typeof e!="string"?e:e.startsWith("./")?r(e):typeof t=="string"?r(a(t),e):new URL(e,t),"resolveSymlinkTarget");export{m as o};
@@ -1 +0,0 @@
1
- var s=Object.defineProperty;var r=(e,t)=>s(e,"name",{value:t,configurable:!0});import{INTERNAL_STRIP_JSON_REGEX as o}from"./F_OK-CAwY1qU7.js";var n=Object.defineProperty,i=r((e,t)=>n(e,"name",{value:t,configurable:!0}),"s");const c=i((e,{whitespace:t=!0}={})=>e.replace(o,a=>a.startsWith('"')||a[1]==="*"&&!a.endsWith("*/")?a:t?a.replaceAll(/\S/g," "):""),"stripJsonComments");export{c as default};
@@ -1 +0,0 @@
1
- var n=Object.defineProperty;var r=(e,t)=>n(e,"name",{value:t,configurable:!0});var f=Object.defineProperty,i=r((e,t)=>f(e,"name",{value:t,configurable:!0}),"f");const a=new TextEncoder,y=i(e=>{if(e instanceof Uint8Array)return e;if(typeof e=="string")return a.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e)){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")},"toUint8Array");export{y as a};
@@ -1 +0,0 @@
1
- var _=Object.defineProperty;var m=(e,s)=>_(e,"name",{value:s,configurable:!0});import{createRequire as D}from"node:module";import{resolve as j,join as T,normalize as x,basename as I}from"@visulima/path";import{toPath as N}from"@visulima/path/utils";import k from"./WalkError-BsngoIKJ.js";import P from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import{a as h,b as y}from"./walk-include-DCiVAwMP.js";const F=D(import.meta.url),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=m(e=>{if(typeof a<"u"&&a.versions&&a.versions.node){const[s,r]=a.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return a.getBuiltinModule(e)}return F(e)},"__cjs_getBuiltinModule"),{readdir:w,realpath:g,stat:L}=v("node:fs/promises");var q=Object.defineProperty,o=m((e,s)=>q(e,"name",{value:s,configurable:!0}),"r");const O=o(async e=>{const s=x(e),r=I(s),t=await L(s);return{isDirectory:o(()=>t.isDirectory(),"isDirectory"),isFile:o(()=>t.isFile(),"isFile"),isSymbolicLink:o(()=>t.isSymbolicLink(),"isSymbolicLink"),name:r,path:s}},"_createWalkEntry");async function*S(e,{extensions:s,followSymlinks:r=!1,includeDirs:t=!0,includeFiles:f=!0,includeSymlinks:p=!0,match:d,maxDepth:u=Number.POSITIVE_INFINITY,skip:b}={}){if(P(e),u<0)return;const c=d?d.map(i=>typeof i=="string"?h(i):i):void 0,l=b?b.map(i=>typeof i=="string"?h(i):i):void 0;if(e=j(N(e)),t&&y(e,s,c,l)&&(yield await O(e)),!(u<1||!y(e,void 0,void 0,l)))try{for await(const i of await w(e,{withFileTypes:!0})){let n=T(e,i.name);if(i.isSymbolicLink())if(r)n=await g(n);else if(p&&y(n,s,c,l))yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:n};else continue;i.isSymbolicLink()||i.isDirectory()?yield*S(n,{extensions:s,followSymlinks:r,includeDirs:t,includeFiles:f,includeSymlinks:p,match:c,maxDepth:u-1,skip:l}):i.isFile()&&f&&y(n,s,c,l)&&(yield{isDirectory:o(()=>i.isDirectory(),"isDirectory"),isFile:o(()=>i.isFile(),"isFile"),isSymbolicLink:o(()=>i.isSymbolicLink(),"isSymbolicLink"),name:i.name,path:n})}}catch(i){throw i instanceof k?i:new k(i,e)}}m(S,"d");o(S,"walk");export{S as default};
@@ -1 +0,0 @@
1
- var l=Object.defineProperty;var t=(e,a)=>l(e,"name",{value:a,configurable:!0});var n=Object.defineProperty,p=t((e,a)=>n(e,"name",{value:a,configurable:!0}),"g");const i=p(e=>{const a=e.replace(/\.\*/g,".([^/]*)").replace(/\*\*/g,"(.*)").replace(/(?<!\.)\*(?!\*)/g,"([^/]*)").replace(/\?/g,"[^/]").replace(/\.(?!\*)/g,String.raw`\.`).replace(/\{/g,"(").replace(/\}/g,")").replace(/,/g,"|").replace(/\[!(.*?)\]/g,"[^$1]");return new RegExp(`^${a}$`)},"globToRegExp");var s=Object.defineProperty,o=t((e,a)=>s(e,"name",{value:a,configurable:!0}),"n");const b=o((e,a,c,g)=>Array.isArray(a)&&a.length>0&&!a.some(r=>e.endsWith(r))||c&&!c.some(r=>r.test(e))?!1:!g?.some(r=>r.test(e)),"walkInclude");export{i as a,b};
@@ -1 +0,0 @@
1
- var v=Object.defineProperty;var c=(e,s)=>v(e,"name",{value:s,configurable:!0});import{createRequire as D}from"node:module";import{resolve as T,join as x,normalize as y,basename as I}from"@visulima/path";import{toPath as N}from"@visulima/path/utils";import S from"./WalkError-BsngoIKJ.js";import P from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import{a as h,b as a}from"./walk-include-DCiVAwMP.js";const F=D(import.meta.url),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,g=c(e=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[s,o]=t.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return t.getBuiltinModule(e)}return F(e)},"__cjs_getBuiltinModule"),{readdirSync:L,realpathSync:j,statSync:w}=g("node:fs");var q=Object.defineProperty,k=c((e,s)=>q(e,"name",{value:s,configurable:!0}),"m");const O=k(e=>{const s=y(e),o=w(s);return{isDirectory:o.isDirectory,isFile:o.isFile,isSymbolicLink:o.isSymbolicLink,name:I(s),path:s}},"_createWalkEntry");function*_(e,{extensions:s,followSymlinks:o=!1,includeDirs:f=!0,includeFiles:u=!0,includeSymlinks:d=!0,match:p,maxDepth:m=Number.POSITIVE_INFINITY,skip:b}={}){if(P(e),m<0)return;const l=p?p.map(i=>typeof i=="string"?h(i):i):void 0,n=b?b.map(i=>typeof i=="string"?h(i):i):void 0;if(e=T(N(e)),f&&a(e,s,l,n)&&(yield O(e)),!(m<1||!a(e,void 0,void 0,n)))try{for(const i of L(e,{withFileTypes:!0})){let r=x(e,i.name);if(i.isSymbolicLink())if(o)r=j(r);else if(d&&a(r,s,l,n))yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:y(r)};else continue;i.isSymbolicLink()||i.isDirectory()?yield*_(r,{extensions:s,followSymlinks:o,includeDirs:f,includeFiles:u,includeSymlinks:d,match:l,maxDepth:m-1,skip:n}):i.isFile()&&u&&a(r,s,l,n)&&(yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:y(r)})}}catch(i){throw i instanceof S?i:new S(i,e)}}c(_,"h");k(_,"walkSync");export{_ as default};
@@ -1 +0,0 @@
1
- var u=Object.defineProperty;var s=(t,e)=>u(t,"name",{value:e,configurable:!0});import{createRequire as l}from"node:module";import{dirname as j}from"@visulima/path";import{toPath as $}from"@visulima/path/utils";import{F_OK as f}from"./F_OK-CAwY1qU7.js";import c from"./isAccessible-CDFxsAAo.js";import F from"./assertValidFileContents-BZFnXa7K.js";import k from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import{a as q}from"./to-uint-8-array-DwgaTasY.js";const w=l(import.meta.url),n=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,p=s(t=>{if(typeof n<"u"&&n.versions&&n.versions.node){const[e,i]=n.versions.node.split(".").map(Number);if(e>22||e===22&&i>=3||e===20&&i>=16)return n.getBuiltinModule(t)}return w(t)},"__cjs_getBuiltinModule"),{mkdir:g,writeFile:h,stat:_,rename:d,chown:v,chmod:y,unlink:b}=p("node:fs/promises");var P=Object.defineProperty,T=s((t,e)=>P(t,"name",{value:e,configurable:!0}),"d");const A=T(async(t,e,i)=>{i={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...i},k(t),F(e),t=$(t);const o=`${t}.tmp`;try{const r=await c(t,f);if(!r&&i.recursive){const m=j(t);await c(m,f)||await g(m,{recursive:!0})}let a;if(await h(o,q(e),{encoding:i.encoding,flag:i.flag}),r&&!i.overwrite&&(a=await _(t),i.chown===void 0&&(i.chown={gid:a.gid,uid:a.uid}),await d(t,`${t}.bak`)),i.chown)try{await v(o,i.chown.uid,i.chown.gid)}catch{}await y(o,a&&!i.mode?a.mode:i.mode??438),await d(o,t)}catch(r){throw new Error(`Failed to write file at: ${t} - ${r.message}`,{cause:r})}finally{await c(o)&&await b(`${t}.tmp`)}},"writeFile");export{A as default};
@@ -1 +0,0 @@
1
- var u=Object.defineProperty;var s=(e,t)=>u(e,"name",{value:t,configurable:!0});import{createRequire as l}from"node:module";import{dirname as b}from"@visulima/path";import{toPath as $}from"@visulima/path/utils";import{F_OK as f}from"./F_OK-CAwY1qU7.js";import a from"./isAccessibleSync-5nzZWgin.js";import j from"./assertValidFileContents-BZFnXa7K.js";import F from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import{a as k}from"./to-uint-8-array-DwgaTasY.js";const p=l(import.meta.url),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,g=s(e=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[t,o]=c.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return c.getBuiltinModule(e)}return p(e)},"__cjs_getBuiltinModule"),{mkdirSync:h,writeFileSync:y,statSync:w,renameSync:d,chownSync:_,chmodSync:v,unlinkSync:S}=g("node:fs");var q=Object.defineProperty,P=s((e,t)=>q(e,"name",{value:t,configurable:!0}),"f");const z=P((e,t,o)=>{o={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...o},F(e),j(t),e=$(e);const i=`${e}.tmp`;try{const r=a(e,f);if(!r&&o.recursive){const m=b(e);a(m,f)||h(m,{recursive:!0})}let n;if(y(i,k(t),{encoding:o.encoding,flag:o.flag}),r&&!o.overwrite&&(n=w(e),o.chown===void 0&&(o.chown={gid:n.gid,uid:n.uid}),d(e,`${e}.bak`)),o.chown)try{_(i,o.chown.uid,o.chown.gid)}catch{}v(i,n&&!o.mode?n.mode:o.mode??438),d(i,e)}catch(r){throw new Error(`Failed to write file at: ${e} - ${r.message}`,{cause:r})}finally{a(i)&&S(`${e}.tmp`)}},"writeFileSync");export{z as default};
@@ -1,4 +0,0 @@
1
- var _=Object.defineProperty;var n=(e,t)=>_(e,"name",{value:t,configurable:!0});import{createRequire as g}from"node:module";import{C as j}from"./index-CYIVJA0W.js";import{R_OK as v}from"./F_OK-CAwY1qU7.js";import w from"./isAccessible-CDFxsAAo.js";import N from"./writeFile-D5OYEMHu.js";const y=g(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=n(e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,i]=o.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return o.getBuiltinModule(e)}return y(e)},"__cjs_getBuiltinModule"),{readFile:b}=h("node:fs/promises");var O=Object.defineProperty,T=n((e,t)=>O(e,"name",{value:t,configurable:!0}),"r");const M=T(async(e,t,i={})=>{const{detectIndent:a,indent:f,replacer:d,stringify:m=JSON.stringify,...p}={indent:" ",...i};let s=f,c=`
2
- `;if(await w(e,v))try{const r=await b(e,"utf8");if(a){const{indent:l}=j(r);s=l}c=r.endsWith(`
3
- `)?`
4
- `:""}catch(r){if(r.code!=="ENOENT")throw r}const u=m(t,d,s);await N(e,`${u}${c}`,p)},"writeJson");export{M as default};
@@ -1,4 +0,0 @@
1
- var _=Object.defineProperty;var i=(e,t)=>_(e,"name",{value:t,configurable:!0});import{createRequire as y}from"node:module";import{C as j}from"./index-CYIVJA0W.js";import{R_OK as v}from"./F_OK-CAwY1qU7.js";import N from"./isAccessibleSync-5nzZWgin.js";import O from"./writeFileSync-CO4ySqUn.js";const g=y(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=i(e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,n]=o.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return o.getBuiltinModule(e)}return g(e)},"__cjs_getBuiltinModule"),{readFileSync:b}=h("node:fs");var T=Object.defineProperty,q=i((e,t)=>T(e,"name",{value:t,configurable:!0}),"r");const J=q((e,t,n={})=>{const{detectIndent:f,indent:d,replacer:a,stringify:l=JSON.stringify,...m}={indent:" ",...n};let s=d,c=`
2
- `;if(N(e,v))try{const r=b(e,"utf8");if(f){const{indent:u}=j(r);s=u}c=r.endsWith(`
3
- `)?`
4
- `:""}catch(r){if(r.code!=="ENOENT")throw r}const p=l(t,a,s);O(e,`${p}${c}`,m)},"writeJsonSync");export{J as default};
@@ -1 +0,0 @@
1
- var l=Object.defineProperty;var a=(n,s)=>l(n,"name",{value:s,configurable:!0});import{createRequire as u}from"node:module";import m from"./writeFile-D5OYEMHu.js";const f=u(import.meta.url),j=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process;const{stringify:p}=f("yaml");var y=Object.defineProperty,d=a((n,s)=>y(n,"name",{value:s,configurable:!0}),"l");async function _(n,s,e,o){let r,t,i;typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e!="function"?(r=e,t=r.replacer,i=r.space):typeof o=="object"&&o!==null?(r=o,t=e,i=r.space??(typeof o=="number"||typeof o=="string"?o:void 0)):(t=e,i=o);const c=p(s,t,i??r);await m(n,c,r)}a(_,"c");d(_,"writeYaml");export{_ as default};
@@ -1 +0,0 @@
1
- var l=Object.defineProperty;var c=(n,s)=>l(n,"name",{value:s,configurable:!0});import{createRequire as u}from"node:module";import m from"./writeFileSync-CO4ySqUn.js";const f=u(import.meta.url),j=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process;const{stringify:p}=f("yaml");var y=Object.defineProperty,d=c((n,s)=>y(n,"name",{value:s,configurable:!0}),"s");function _(n,s,e,o){let r,t,i;typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e!="function"?(r=e,t=r.replacer,i=r.space):typeof o=="object"&&o!==null?(r=o,t=e,i=r.space??(typeof o=="number"||typeof o=="string"?o:void 0)):(t=e,i=o);const a=p(s,t,i??r);m(n,a,r)}c(_,"c");d(_,"writeYamlSync");export{_ as default};