@visulima/fs 5.0.10 → 5.0.11
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 +2 -0
- package/dist/eol.d.ts +25 -25
- package/dist/eol.js +2 -2
- package/dist/error.d.ts +218 -218
- package/dist/glob-parent.d.ts +27 -27
- package/dist/glob-parent.js +1 -1
- package/dist/glob.d.ts +2 -2
- package/dist/glob.js +1 -1
- package/dist/index.d.ts +765 -765
- package/dist/index.js +1 -1
- package/dist/ini.d.ts +59 -59
- package/dist/ini.js +1 -1
- package/dist/is-glob.d.ts +26 -26
- package/dist/json5.d.ts +25 -25
- package/dist/json5.js +1 -1
- package/dist/jsonc.d.ts +54 -54
- package/dist/jsonc.js +1 -1
- package/dist/match.d.ts +40 -40
- package/dist/packem_shared/{collect-CIKDOMiD.js → collect-B0S0bJoE.js} +1 -1
- package/dist/packem_shared/{collectSync-D0FRLLqg.js → collectSync-0M1eoilI.js} +1 -1
- package/dist/packem_shared/copy-DiR5_5iA.js +1 -0
- package/dist/packem_shared/copySync-DffsYlhb.js +1 -0
- package/dist/packem_shared/emptyDir-BlBeczk0.js +1 -0
- package/dist/packem_shared/emptyDirSync-DfUZ9Ejz.js +1 -0
- package/dist/packem_shared/ensureDir-BEiomfxz.js +1 -0
- package/dist/packem_shared/ensureDirSync-B0w9WMwE.js +1 -0
- package/dist/packem_shared/ensureFile-waD4hDO8.js +1 -0
- package/dist/packem_shared/ensureFileSync-CG07zjV7.js +1 -0
- package/dist/packem_shared/ensureLink-Dz-PDWa5.js +1 -0
- package/dist/packem_shared/ensureLinkSync-BZH7TaSQ.js +1 -0
- package/dist/packem_shared/ensureSymlink-Byi6ajoE.js +1 -0
- package/dist/packem_shared/ensureSymlinkSync-D7OCsAd8.js +1 -0
- package/dist/packem_shared/findUp-Ylerv_a2.js +1 -0
- package/dist/packem_shared/findUpSync-BWBPRzEq.js +1 -0
- package/dist/packem_shared/glob-BUjyjdE8.js +1 -0
- package/dist/packem_shared/glob-sync.d-DaAZHTsv.d.ts +54 -0
- package/dist/packem_shared/globSync-Bk9TUV7x.js +1 -0
- package/dist/packem_shared/index-CPZbuHkp.js +1 -0
- package/dist/packem_shared/isAccessible-B7guOm3k.js +1 -0
- package/dist/packem_shared/isAccessibleSync-XH4YleJW.js +1 -0
- package/dist/packem_shared/json-error.d-COL8oxF_.d.ts +52 -0
- package/dist/packem_shared/move-KhPRvsRd.js +1 -0
- package/dist/packem_shared/{parseJson-EASgP4J9.js → parseJson-_OfIPruP.js} +1 -1
- package/dist/packem_shared/readFile-VgxUDrNH.js +1 -0
- package/dist/packem_shared/readFileSync-CloFeQw8.js +1 -0
- package/dist/packem_shared/{readIni-BsXudu2r.js → readIni-CEXHWn92.js} +1 -1
- package/dist/packem_shared/readIniSync-DsxVHypc.js +1 -0
- package/dist/packem_shared/{readJson-CcAsHxE5.js → readJson-Q3T3RlSy.js} +1 -1
- package/dist/packem_shared/{readJson5-CM1TIiHd.js → readJson5-S68aVros.js} +1 -1
- package/dist/packem_shared/{readJson5Sync-Bc26c3Fy.js → readJson5Sync-Bi9Rv46R.js} +1 -1
- package/dist/packem_shared/{readJsonSync-DuMMeB3s.js → readJsonSync-BnWiH5-R.js} +1 -1
- package/dist/packem_shared/{readJsonc-BZjMw_0f.js → readJsonc-DSoFyuDk.js} +1 -1
- package/dist/packem_shared/{readJsoncSync-C-xzeZz4.js → readJsoncSync-CLtlvFKV.js} +1 -1
- package/dist/packem_shared/readToml-CN_xnICv.js +1 -0
- package/dist/packem_shared/readTomlSync-B9TVGzen.js +1 -0
- package/dist/packem_shared/{readYaml-DvPxndW_.js → readYaml-DcpUq11D.js} +1 -1
- package/dist/packem_shared/{readYamlSync-DZ-0hSbZ.js → readYamlSync-D5RVZwco.js} +1 -1
- package/dist/packem_shared/remove-D_CUIlBL.js +1 -0
- package/dist/packem_shared/removeSync-F4nKiwrU.js +1 -0
- package/dist/packem_shared/renderError-DjesnVYT-pWsLqw-_.js +6 -0
- package/dist/packem_shared/sanitize-aEqeyx4d.js +1 -0
- package/dist/packem_shared/to-uint-8-array-7sXMoZwU.js +1 -0
- package/dist/packem_shared/{types.d-BMdL_ygj.d.ts → types.d-D3Jo_iA-.d.ts} +361 -383
- package/dist/packem_shared/walk-BReeHTKb.js +1 -0
- package/dist/packem_shared/walkSync-yHJUIJb9.js +1 -0
- package/dist/packem_shared/writeFile-srDcYaRC.js +1 -0
- package/dist/packem_shared/writeFileSync-Ddl_u4my.js +1 -0
- package/dist/packem_shared/writeIni-CKinbquM.js +4 -0
- package/dist/packem_shared/writeIniSync-BISRFyg0.js +4 -0
- package/dist/packem_shared/writeJson-DlCrFMXb.js +4 -0
- package/dist/packem_shared/writeJson5-rSp3QAKP.js +4 -0
- package/dist/packem_shared/writeJson5Sync-tSBBKnaP.js +4 -0
- package/dist/packem_shared/writeJsonSync-CKqVRz_9.js +4 -0
- package/dist/packem_shared/writeJsonc-bxz1jdeU.js +4 -0
- package/dist/packem_shared/writeJsoncSync-C-W0H9qP.js +4 -0
- package/dist/packem_shared/{writeToml-IuMO-yDu.js → writeToml-CrpfWNyK.js} +1 -1
- package/dist/packem_shared/{writeTomlSync-DhL7hHzB.js → writeTomlSync-DveRchLG.js} +1 -1
- package/dist/packem_shared/{writeYaml-ClQgvQID.js → writeYaml-DvSQ_Jbn.js} +1 -1
- package/dist/packem_shared/{writeYamlSync-DrXtHQQq.js → writeYamlSync-CEf0PUGQ.js} +1 -1
- package/dist/size.d.ts +236 -236
- package/dist/size.js +1 -1
- package/dist/toml.d.ts +52 -52
- package/dist/toml.js +1 -1
- package/dist/utils.d.ts +88 -88
- package/dist/utils.js +1 -1
- package/dist/yaml.d.ts +2 -2
- package/dist/yaml.js +1 -1
- package/package.json +1 -1
- package/dist/packem_shared/copy-Beb64BYG.js +0 -1
- package/dist/packem_shared/copySync-CagcIEBi.js +0 -1
- package/dist/packem_shared/emptyDir-C7lyd1lW.js +0 -1
- package/dist/packem_shared/emptyDirSync-B8EYpmO9.js +0 -1
- package/dist/packem_shared/ensureDir-DGarVZw8.js +0 -1
- package/dist/packem_shared/ensureDirSync-CsgPrsDH.js +0 -1
- package/dist/packem_shared/ensureFile-CMugWljp.js +0 -1
- package/dist/packem_shared/ensureFileSync-CJYTEx2r.js +0 -1
- package/dist/packem_shared/ensureLink-ChShf3lf.js +0 -1
- package/dist/packem_shared/ensureLinkSync-DPpq0I2Z.js +0 -1
- package/dist/packem_shared/ensureSymlink-y4FZjfxA.js +0 -1
- package/dist/packem_shared/ensureSymlinkSync-TcHssCH7.js +0 -1
- package/dist/packem_shared/findUp-Cii5ATt5.js +0 -1
- package/dist/packem_shared/findUpSync-C9Lkh7-v.js +0 -1
- package/dist/packem_shared/glob-DMbPwGSj.js +0 -1
- package/dist/packem_shared/glob-sync.d-hXe38TnZ.d.ts +0 -54
- package/dist/packem_shared/globSync-DiP2rtGn.js +0 -1
- package/dist/packem_shared/index-Ct4GqZSP.js +0 -1
- package/dist/packem_shared/isAccessible-PmWJhV6I.js +0 -1
- package/dist/packem_shared/isAccessibleSync-BrbOtwdr.js +0 -1
- package/dist/packem_shared/json-error.d-DVILOyHc.d.ts +0 -52
- package/dist/packem_shared/move-DopmzT-2.js +0 -1
- package/dist/packem_shared/readFile-BswaBgM0.js +0 -1
- package/dist/packem_shared/readFileSync-_fDF6Oj1.js +0 -1
- package/dist/packem_shared/readIniSync-DKwRbbs9.js +0 -1
- package/dist/packem_shared/readToml-D4jpe9q_.js +0 -1
- package/dist/packem_shared/readTomlSync-B5PIYT9z.js +0 -1
- package/dist/packem_shared/remove-CSbrd0dl.js +0 -1
- package/dist/packem_shared/removeSync-BoLAzRQE.js +0 -1
- package/dist/packem_shared/renderError-B3ePOoBG-Bi9WKMjv.js +0 -6
- package/dist/packem_shared/sanitize-DGZ3w-_w.js +0 -1
- package/dist/packem_shared/to-uint-8-array-BImOQNXm.js +0 -1
- package/dist/packem_shared/walk-OX4-6oCP.js +0 -1
- package/dist/packem_shared/walkSync-BPs6czIM.js +0 -1
- package/dist/packem_shared/writeFile-BrMtsJY7.js +0 -1
- package/dist/packem_shared/writeFileSync-W7Mf4BNy.js +0 -1
- package/dist/packem_shared/writeIni-BWX3cP1K.js +0 -4
- package/dist/packem_shared/writeIniSync-fOdgPFfL.js +0 -4
- package/dist/packem_shared/writeJson-bEVi25gX.js +0 -4
- package/dist/packem_shared/writeJson5-Ch8TpNPI.js +0 -4
- package/dist/packem_shared/writeJson5Sync-BrctV_Mk.js +0 -4
- package/dist/packem_shared/writeJsonSync-DkGnd416.js +0 -4
- package/dist/packem_shared/writeJsonc-CefrwsOc.js +0 -4
- package/dist/packem_shared/writeJsoncSync-BskDjn8o.js +0 -4
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { G as GlobOptions } from "./types.d-D3Jo_iA-.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-CPZbuHkp.js";const s=(t,o)=>r(t,o);export{s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as it}from"node:module";import{a as $}from"./index-LUKYN3u3.js";let ut;const lt=t=>(ut??=it(import.meta.url))(t),P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,D=t=>{if(typeof P<"u"&&P.versions&&P.versions.node){const[e,s]=P.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return P.getBuiltinModule(t)}return lt(t)},B=D("fs"),ct={...B,default:B},{statSync:at,stat:ht,realpathSync:pt,realpath:ft,readdirSync:gt,readdir:dt}=D("fs"),{sep:G,basename:yt,dirname:A,resolve:N,normalize:mt,relative:bt,posix:S,isAbsolute:vt}=D("path"),{fileURLToPath:wt}=D("url"),{createRequire:St}=D("module");var C=St(import.meta.url);function $t(t){let e=mt(t);return e.length>1&&e[e.length-1]===G&&(e=e.substring(0,e.length-1)),e}const kt=/[\\/]/g;function U(t,e){return t.replace(kt,e)}const Pt=/^[a-z]:[\\/]$/i;function xt(t){return t==="/"||Pt.test(t)}function j(t,e){const{resolvePaths:s,normalizePath:r,pathSeparator:n}=e,i=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(s&&(t=N(t)),(r||i)&&(t=$t(t)),t===".")return"";const o=t[t.length-1]!==n;return U(o?t+n:t,n)}function Q(t,e){return e+t}function Dt(t,e){return function(s,r){return r.startsWith(t)?r.slice(t.length)+s:U(bt(t,r),e.pathSeparator)+e.pathSeparator+s}}function Ft(t){return t}function _t(t,e,s){return e+t+s}function qt(t,e){const{relativePaths:s,includeBasePath:r}=e;return s&&t?Dt(t,e):r?Q:Ft}function Et(t){return function(e,s){s.push(e.substring(t.length)||".")}}function jt(t){return function(e,s,r){const n=e.substring(t.length)||".";r.every(i=>i(n,!0))&&s.push(n)}}const Ot=(t,e)=>{e.push(t||".")},At=(t,e,s)=>{const r=t||".";s.every(n=>n(r,!0))&&e.push(r)},Rt=()=>{};function Wt(t,e){const{includeDirs:s,filters:r,relativePaths:n}=e;return s?n?r&&r.length?jt(t):Et(t):r&&r.length?At:Ot:Rt}const Bt=(t,e,s,r)=>{r.every(n=>n(t,!1))&&s.files++},Ct=(t,e,s,r)=>{r.every(n=>n(t,!1))&&e.push(t)},Mt=(t,e,s,r)=>{s.files++},Lt=(t,e)=>{e.push(t)},It=()=>{};function Tt(t){const{excludeFiles:e,filters:s,onlyCounts:r}=t;return e?It:s&&s.length?r?Bt:Ct:r?Mt:Lt}const zt=t=>t,Gt=()=>[""].slice(0,0);function Nt(t){return t.group?Gt:zt}const Ut=(t,e,s)=>{t.push({directory:e,files:s,dir:e})},Qt=()=>{};function Yt(t){return t.group?Ut:Qt}const Zt=function(t,e,s){const{queue:r,fs:n,options:{suppressErrors:i}}=e;r.enqueue(),n.realpath(t,(o,u)=>{if(o)return r.dequeue(i?null:o,e);n.stat(u,(g,f)=>{if(g)return r.dequeue(i?null:g,e);if(f.isDirectory()&&Y(t,u,e))return r.dequeue(null,e);s(f,u),r.dequeue(null,e)})})},Ht=function(t,e,s){const{queue:r,fs:n,options:{suppressErrors:i}}=e;r.enqueue();try{const o=n.realpathSync(t),u=n.statSync(o);if(u.isDirectory()&&Y(t,o,e))return;s(u,o)}catch(o){if(!i)throw o}};function Jt(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?Ht:Zt}function Y(t,e,s){if(s.options.useRealPaths)return Kt(e,s);let r=A(t),n=1;for(;r!==s.root&&n<2;){const i=s.symlinks.get(r);i&&(i===e||i.startsWith(e)||e.startsWith(i))?n++:r=A(r)}return s.symlinks.set(t,e),n>1}function Kt(t,e){return e.visited.includes(t+e.options.pathSeparator)}const Vt=t=>t.counts,Xt=t=>t.groups,te=t=>t.paths,ee=t=>t.paths.slice(0,t.options.maxFiles),se=(t,e,s)=>(F(e,s,t.counts,t.options.suppressErrors),null),re=(t,e,s)=>(F(e,s,t.paths,t.options.suppressErrors),null),ne=(t,e,s)=>(F(e,s,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),oe=(t,e,s)=>(F(e,s,t.groups,t.options.suppressErrors),null);function F(t,e,s,r){e(t&&!r?t:null,s)}function ie(t,e){const{onlyCounts:s,group:r,maxFiles:n}=t;return s?e?Vt:se:r?e?Xt:oe:n?e?ee:ne:e?te:re}const Z={withFileTypes:!0},ue=(t,e,s,r,n)=>{if(t.queue.enqueue(),r<0)return t.queue.dequeue(null,t);const{fs:i}=t;t.visited.push(e),t.counts.directories++,i.readdir(e||".",Z,(o,u=[])=>{n(u,s,r),t.queue.dequeue(t.options.suppressErrors?null:o,t)})},le=(t,e,s,r,n)=>{const{fs:i}=t;if(r<0)return;t.visited.push(e),t.counts.directories++;let o=[];try{o=i.readdirSync(e||".",Z)}catch(u){if(!t.options.suppressErrors)throw u}n(o,s,r)};function ce(t){return t?le:ue}var ae=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},he=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},pe=class{aborted=!1;abort(){this.aborted=!0}},H=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,s){this.isSynchronous=!s,this.callbackInvoker=ie(e,this.isSynchronous),this.root=j(t,e),this.state={root:xt(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new he,options:e,queue:new ae((r,n)=>this.callbackInvoker(n,r,s)),symlinks:new Map,visited:[""].slice(0,0),controller:new pe,fs:e.fs||ct},this.joinPath=qt(this.root,e),this.pushDirectory=Wt(this.root,e),this.pushFile=Tt(e),this.getArray=Nt(e),this.groupFiles=Yt(e),this.resolveSymlink=Jt(e,this.isSynchronous),this.walkDirectory=ce(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,s)=>{const{paths:r,options:{filters:n,resolveSymlinks:i,excludeSymlinks:o,exclude:u,maxFiles:g,signal:f,useRealPaths:y,pathSeparator:h},controller:m}=this.state;if(m.aborted||f&&f.aborted||g&&r.length>g)return;const l=this.getArray(this.state.paths);for(let p=0;p<t.length;++p){const a=t[p];if(a.isFile()||a.isSymbolicLink()&&!i&&!o){const c=this.joinPath(a.name,e);this.pushFile(c,l,this.state.counts,n)}else if(a.isDirectory()){let c=_t(a.name,e,this.state.options.pathSeparator);if(u&&u(a.name,c))continue;this.pushDirectory(c,r,n),this.walkDirectory(this.state,c,c,s-1,this.walk)}else if(this.resolveSymlink&&a.isSymbolicLink()){let c=Q(a.name,e);this.resolveSymlink(c,this.state,(_,d)=>{if(_.isDirectory()){if(d=j(d,this.state.options),u&&u(a.name,y?d:c+h))return;this.walkDirectory(this.state,d,y?d:c+h,s-1,this.walk)}else{d=y?d:c;const k=yt(d),q=j(A(d),this.state.options);d=this.joinPath(k,q),this.pushFile(d,l,this.state.counts,n)}})}}this.groupFiles(this.state.groups,e,l)}};function fe(t,e){return new Promise((s,r)=>{J(t,e,(n,i)=>{if(n)return r(n);s(i)})})}function J(t,e,s){new H(t,e,s).start()}function ge(t,e){return new H(t,e).start()}var M=class{constructor(e,s){this.root=e,this.options=s}withPromise(){return fe(this.root,this.options)}withCallback(e){J(this.root,this.options,e)}sync(){return ge(this.root,this.options)}};let K=null;try{C.resolve("picomatch"),K=C("picomatch")}catch{}var de=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:G,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new M(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new M(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){const s=this.globFunction||K;if(!s)throw new Error("Please specify a glob function to use glob matching.");var r=this.globCache[t.join("\0")];return r||(r=s(t,...e),this.globCache[t.join("\0")]=r),this.options.filters.push(n=>r(n)),this}};const ye=Array.isArray,V=/\\/g,me=/^[A-Za-z]:$/,X=process.platform==="win32",be=/^(\/?\.\.)+$/;function L(t,e={}){const s=t.length,r=Array(s),n=Array(s);let i,o;for(i=0;i<s;i++){const u=tt(t[i]);r[i]=u;const g=u.length,f=Array(g);for(o=0;o<g;o++)f[o]=$(u[o],e);n[i]=f}return u=>{const g=u.split("/");if(g[0]===".."&&be.test(u))return!0;for(i=0;i<s;i++){const f=r[i],y=n[i],h=g.length,m=Math.min(h,f.length);for(o=0;o<m;){const l=f[o];if(l.includes("/"))return!0;if(!y[o](g[o]))break;if(!e.noglobstar&&l==="**")return!0;o++}if(o===h)return!0}return!1}}const ve=/^[A-Z]:\/$/i,we=X?t=>ve.test(t):t=>t==="/";function I(t,e,s){if(t===e||e.startsWith(`${t}/`)){if(s){const n=t.length+ +!we(t);return(i,o)=>i.slice(n,o?-1:void 0)||"."}const r=e.slice(t.length+1);return r?(n,i)=>{if(n===".")return r;const o=`${r}/${n}`;return i?o.slice(0,-1):o}:(n,i)=>i&&n!=="."?n.slice(0,-1):n}return s?r=>S.relative(t,r)||".":r=>S.relative(t,`${e}/${r}`)||"."}function Se(t,e){if(e.startsWith(`${t}/`)){const s=e.slice(t.length+1);return r=>`${s}/${r}`}return s=>{const r=S.relative(t,`${e}/${s}`);return s[s.length-1]==="/"&&r!==""?`${r}/`:r||"."}}function T(t){return t.replace(me,e=>`${e}/`)}const $e={parts:!0};function tt(t){var e;const s=$.scan(t,$e);return!((e=s.parts)===null||e===void 0)&&e.length?s.parts:[t]}const ke=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Pe=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,xe=t=>t.replace(ke,"\\$&"),De=t=>t.replace(Pe,"\\$&"),Fe=X?De:xe;function _e(t,e){const s=$.scan(t);return s.isGlob||s.negated}function x(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function et(t){return typeof t=="string"?[t]:t??[]}const qe=/^(\/?\.\.)+/,Ee=/\\(?=[()[\]{}!*+?@|])/g;function O(t,e,s,r){var n;const i=e.cwd;let o=t;t[t.length-1]==="/"&&(o=t.slice(0,-1));const u=o.lastIndexOf("/"),g=(u===-1?o:o.slice(u+1)).startsWith("!(");o[o.length-1]!=="*"&&!g&&e.expandDirectories&&(o+="/**");const f=Fe(i);o=vt(o.replace(Ee,""))?S.relative(f,o):S.normalize(o);const y=(n=qe.exec(o))===null||n===void 0?void 0:n[0],h=tt(o);if(y){const l=(y.length+1)/3;let p=0;const a=f.split("/");for(;p<l&&h[p+l]===a[a.length+p-l];)o=o.slice(0,(l-p-1)*3)+o.slice((l-p)*3+h[p+l].length+1)||".",p++;const c=S.join(i,y.slice(p*3));c[0]!=="."&&s.root.length>c.length&&(s.root=T(c),s.depthOffset=-l+p)}if(!r&&s.depthOffset>=0){var m;(m=s.commonPath)!==null&&m!==void 0||(s.commonPath=h);const l=[],p=Math.min(s.commonPath.length,h.length);for(let a=0;a<p;a++){const c=h[a];if(c==="**"&&!h[a+1]){l.pop();break}if(a===h.length-1||c!==s.commonPath[a]||_e(c))break;l.push(c)}s.depthOffset=l.length,s.commonPath=l,s.root=T(l.length>0?S.join(i,...l):i)}return o}function je(t,e,s){const r=[],n=[],i=[];for(const o of t.ignore)o&&(o[0]!=="!"||o[1]==="("?n.push(O(o,t,s,!0)):i.push(o.slice(1)));for(const o of e)o&&(o[0]!=="!"||o[1]==="("?r.push(O(o,t,s,!1)):(o[1]!=="!"||o[2]==="(")&&n.push(O(o.slice(1),t,s,!0)));return{match:r,ignore:n,unignore:i}}function Oe(t,e){const s=t.cwd,r={root:s,depthOffset:0},n=je(t,e,r);t.debug&&x("internal processing patterns:",n);const{absolute:i,caseSensitiveMatch:o,debug:u,dot:g,followSymbolicLinks:f,onlyDirectories:y}=t,h=r.root.replace(V,""),m={dot:g,nobrace:t.braceExpansion===!1,nocase:!o,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},l=n.unignore.length>0,p=l?$(n.unignore,m):void 0,a=l?L(n.unignore,m):void 0,c=$(n.match,{...m,ignore:n.ignore,onIgnore:p?v=>p(v.output)&&$.constants.UNIGNORE:void 0}),_=$(n.ignore,m),d=L(n.match,m),k=I(s,h,i),q=i?k:I(s,h,!0),nt=n.match.length>0&&n.match.every(v=>v==="**"||v==="**/*"),E=n.ignore.length>0||l||!nt?(v,w)=>{const b=q(w,!0);return b==="."||a&&a(b)?!1:!d(b)||_(b)}:void 0;let R;t.deep!==void 0&&(R=Math.round(t.deep-r.depthOffset));const ot=new de({filters:[u?(v,w)=>{const b=k(v,w),W=c(b);return W&&x(`matched ${b}`),W}:(v,w)=>{const b=k(v,w);return c(b)}],exclude:u&&E?(v,w)=>{const b=E(v,w);return x(`${b?"skipped":"crawling"} ${w}`),b}:E,fs:t.fs,pathSeparator:"/",relativePaths:!i,resolvePaths:i,includeBasePath:i,resolveSymlinks:f,excludeSymlinks:!f,excludeFiles:y,includeDirs:y||!t.onlyFiles,maxDepth:R,signal:t.signal}).crawl(h);return t.debug&&x("internal properties:",{...r,root:h}),[ot,s!==h&&!i&&Se(s,h)]}function st(t,e){if(e)for(let s=t.length-1;s>=0;s--)t[s]=e(t[s]);return t}const z={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Ae(t){const e=Object.assign({},t);for(const s in z)e[s]===void 0&&Object.assign(e,{[s]:z[s]});return e.cwd=(e.cwd instanceof URL?wt(e.cwd):N(e.cwd||process.cwd())).replace(V,"/"),e.ignore=et(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||dt,readdirSync:e.fs.readdirSync||gt,realpath:e.fs.realpath||ft,realpathSync:e.fs.realpathSync||pt,stat:e.fs.stat||ht,statSync:e.fs.statSync||at}),e.debug&&x("globbing with options:",e),e}function rt(t,e={}){var s;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const r=ye(t)||typeof t=="string",n=et((s=r?t:t.patterns)!==null&&s!==void 0?s:"**/*"),i=Ae(r?e:t);return n.length>0?Oe(i,n):[]}async function Ce(t,e){const[s,r]=rt(t,e);return s?st(await s.withPromise(),r):[]}function Me(t,e){const[s,r]=rt(t,e);return s?st(s.sync(),r):[]}export{Me as E,Ce as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as t}from"node:module";import{toPath as a}from"@visulima/path/utils";import{F_OK as f}from"./FIND_UP_STOP-CAwY1qU7.js";import _ from"./assertValidFileOrDirectoryPath-BTlt945W.js";let n;const i=e=>(n??=t(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=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 i(e)},{access:u}=c("node:fs/promises");async function g(e,r=f){_(e),e=a(e);try{return await u(e,r),!0}catch{return!1}}export{g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as s}from"node:module";import{toPath as a}from"@visulima/path/utils";import{F_OK as f}from"./FIND_UP_STOP-CAwY1qU7.js";import _ from"./assertValidFileOrDirectoryPath-BTlt945W.js";let n;const i=e=>(n??=s(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=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 i(e)},{accessSync:u}=c("node:fs");function g(e,r=f){_(e),e=a(e);try{return u(e,r),!0}catch{return!1}}export{g as default};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom error class for handling JSON parsing or related errors.
|
|
3
|
+
* It can optionally include a file name and a code frame for better debugging.
|
|
4
|
+
* @example
|
|
5
|
+
* ```javascript
|
|
6
|
+
* import { JSONError } from "@visulima/fs/error";
|
|
7
|
+
* import { readJsonSync } from "@visulima/fs"; // Or any function that might throw this
|
|
8
|
+
* import { join } from "node:path";
|
|
9
|
+
*
|
|
10
|
+
* try {
|
|
11
|
+
* // Imagine readJsonSync encounters a malformed JSON file and throws JSONError
|
|
12
|
+
* // Forcing the scenario for demonstration:
|
|
13
|
+
* const simulateJsonError = (filePath, content) => {
|
|
14
|
+
* const err = new JSONError(`Unexpected token '}' at position 15`);
|
|
15
|
+
* err.fileName = filePath;
|
|
16
|
+
* // A real implementation might generate a code frame using a library
|
|
17
|
+
* err.codeFrame = ` 13 | "key": "value",
|
|
18
|
+
* > 14 | "anotherKey": "anotherValue",}
|
|
19
|
+
* | ^
|
|
20
|
+
* 15 | "lastKey": "end"
|
|
21
|
+
* `;
|
|
22
|
+
* throw err;
|
|
23
|
+
* };
|
|
24
|
+
*
|
|
25
|
+
* simulateJsonError(join("path", "to", "corrupted.json"), '{ "key": "value", "anotherKey": "anotherValue",} ');
|
|
26
|
+
* // const jsonData = readJsonSync(join("path", "to", "corrupted.json"));
|
|
27
|
+
* } catch (error) {
|
|
28
|
+
* if (error instanceof JSONError) {
|
|
29
|
+
* console.error(`JSON Error: ${error.message}`);
|
|
30
|
+
* // message property will include fileName and codeFrame if they were set.
|
|
31
|
+
* // console.error(`File: ${error.fileName}`);
|
|
32
|
+
* // console.error(`Code Frame:\n${error.codeFrame}`);
|
|
33
|
+
* } else {
|
|
34
|
+
* console.error("An unexpected error occurred:", error);
|
|
35
|
+
* }
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
declare class JSONError extends Error {
|
|
40
|
+
#private;
|
|
41
|
+
fileName: string | undefined;
|
|
42
|
+
codeFrame: string | undefined;
|
|
43
|
+
override readonly name = "JSONError";
|
|
44
|
+
/**
|
|
45
|
+
* Creates a new JSONError instance.
|
|
46
|
+
* @param message The primary error message.
|
|
47
|
+
*/
|
|
48
|
+
constructor(message: string);
|
|
49
|
+
override get message(): string;
|
|
50
|
+
override set message(message: string);
|
|
51
|
+
}
|
|
52
|
+
export { JSONError as J };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as p}from"node:module";import{toPath as d}from"@visulima/path/utils";import{dirname as c,resolve as s}from"@visulima/path";import $ from"./isAccessible-B7guOm3k.js";import T from"./isAccessibleSync-XH4YleJW.js";let v;const h=t=>(v??=p(import.meta.url))(t),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=t=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[e,r]=i.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return i.getBuiltinModule(t)}return h(t)},{cwd:a}=i,{mkdir:_,rename:S,copyFile:D,unlink:E}=u("node:fs/promises"),{mkdirSync:g,renameSync:j,copyFileSync:b,unlinkSync:k}=u("node:fs");class q extends Error{constructor(e,r){super(`Source directory "${c(e)}" does not match destination directory "${c(r)}"`),this.name="SameDirectoryError"}}const l=(t,e)=>{if(!t||!e)throw new Error("Source and destination paths must not be empty");if(c(t)!==c(e))throw new q(t,e)},y=async(t,e,{cwd:r,directoryMode:o,overwrite:w,validateDirectory:m})=>{if(r&&(t=s(r,t),e=s(r,e)),m&&l(t,e),!w&&await $(e))throw new Error(`The destination file exists: ${e}`);await _(c(e),{mode:o,recursive:!0});try{await S(t,e)}catch(n){if(n.code==="EXDEV")await D(t,e),await E(t);else throw n}},f=(t,e,{cwd:r,directoryMode:o,overwrite:w,validateDirectory:m})=>{if(r&&(t=s(r,t),e=s(r,e)),m&&l(t,e),!w&&T(e))throw new Error(`The destination file exists: ${e}`);g(c(e),{mode:o,recursive:!0});try{j(t,e)}catch(n){if(n.code==="EXDEV")b(t,e),k(t);else throw n}},P=async(t,e,r={})=>{const o={overwrite:!0,validateDirectory:!1,...r,cwd:r.cwd?d(r.cwd):a()};await y(t,e,o)},V=(t,e,r)=>{const o={overwrite:!0,validateDirectory:!1,...r};o.cwd=o.cwd?d(o.cwd):a(),f(t,e,o)},X=async(t,e,r)=>{const o={overwrite:!0,...r,validateDirectory:!0};o.cwd=o.cwd?d(o.cwd):a(),await y(t,e,o)},N=(t,e,r)=>{const o={overwrite:!0,...r,validateDirectory:!0};o.cwd=o.cwd?d(o.cwd):a(),f(t,e,o)};export{P as move,V as moveSync,X as rename,N as renameSync};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s,W as l}from"./renderError-
|
|
1
|
+
import{a as s,W as l}from"./renderError-DjesnVYT-pWsLqw-_.js";import u from"./JSONError-Cvp9ycba.js";const m=t=>String.raw`\u{${t.codePointAt(0).toString(16)}}`,p=(t,o,e)=>l(t,{start:o},{tabWidth:!1,...e}),f=/in JSON at position (\d+)(?: \(line (\d+) column (\d+)\))?$/,d=(t,o)=>{const e=f.exec(o);if(!e)return;const[,n,r,a]=e;if(r&&a)return{column:Number(a),line:Number(r)};let i=Number(n);return i===t.length&&(i=t.length-1),s(t,i)},g=/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,h=t=>t.replace(g,(o,e,n)=>`"${n}"(${m(n)})`);function w(t,o,e,n){typeof o=="string"&&(typeof e=="object"&&(n=e),e=o,o=void 0);let r;try{return JSON.parse(t,o)}catch(c){r=c.message}let a;t?(a=d(t,r),r=h(r)):r+=" while parsing empty string";const i=new u(r);throw i.fileName=e,a&&(i.codeFrame=p(t,a,n)),i}export{w as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as m}from"node:module";import{toPath as j}from"@visulima/path/utils";import y from"./assertValidFileOrDirectoryPath-BTlt945W.js";import{i as q}from"./map-read-error-CR3rQUxx.js";let d;const _=e=>(d??=m(import.meta.url))(e),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[o,t]=r.versions.node.split(".").map(Number);if(o>22||o===22&&t>=3||o===20&&t>=16)return r.getBuiltinModule(e)}return _(e)},{readFile:g}=l("node:fs/promises"),{unzip:b,brotliDecompress:h}=l("node:zlib"),w={brotli:h,gzip:b,none:(e,o)=>{o(null,e)}},T=async(e,o)=>{y(e),e=j(e);const{buffer:t,compression:u,encoding:f,flag:s}=o??{};let i;try{i=await g(e,s?{flag:s}:{})}catch(n){throw q(n,e)}return await new Promise((n,p)=>{w[u??"none"](i,(c,a)=>{c?p(c):n(t?a:a.toString(f??"utf8"))})})};export{T as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as a}from"node:module";import{toPath as h}from"@visulima/path/utils";import y from"./assertValidFileOrDirectoryPath-BTlt945W.js";import{i as j}from"./map-read-error-CR3rQUxx.js";let d;const m=e=>(d??=a(import.meta.url))(e),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[o,t]=r.versions.node.split(".").map(Number);if(o>22||o===22&&t>=3||o===20&&t>=16)return r.getBuiltinModule(e)}return m(e)},{readFileSync:_}=c("node:fs"),{unzipSync:g,brotliDecompressSync:b}=c("node:zlib"),q={brotli:b,gzip:g,none:e=>e},T=(e,o)=>{y(e),e=h(e);const{buffer:t,compression:f,encoding:l,flag:n}=o??{};let s;try{s=_(e,n?{flag:n}:{})}catch(p){throw j(p,e)}const u=q[f??"none"],i=u(s);return t?i:i.toString(l??"utf8")};export{T as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parse as n}from"ini";import c from"./readFile-
|
|
1
|
+
import{parse as n}from"ini";import c from"./readFile-VgxUDrNH.js";const d=async(r,t)=>{const{bracketedArray:a=!0,...e}=t??{},o=await c(r,{encoding:"utf8",...e});return n(o,{bracketedArray:a})};export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parse as c}from"ini";import n from"./readFileSync-CloFeQw8.js";const f=(r,t)=>{const{bracketedArray:e=!0,...o}=t??{},a=n(r,{encoding:"utf8",...o});return c(a,{bracketedArray:e})};export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toPath as n}from"@visulima/path/utils";import a from"./parseJson-
|
|
1
|
+
import{toPath as n}from"@visulima/path/utils";import a from"./parseJson-_OfIPruP.js";import d from"./readFile-VgxUDrNH.js";async function u(r,o,e){typeof o=="object"&&(e=o,o=void 0);const f=await d(r,{buffer:!0,encoding:void 0});let t=new TextDecoder().decode(f);const{beforeParse:c,color:i}=e??{};return typeof c=="function"&&(t=c(t)),a(t,o,n(r),{color:i})}export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import p from"json5";import u from"./readFile-
|
|
1
|
+
import p from"json5";import u from"./readFile-VgxUDrNH.js";async function d(t,o,e){o&&typeof o=="object"&&(e=o,o=void 0);const{beforeParse:f,buffer:i,compression:a,encoding:c="utf8",flag:s}=e??{},r=await u(t,{buffer:i,compression:a,encoding:c,flag:s}),n=typeof f=="function"?f(r):r;return p.parse(n,o)}export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import n from"json5";import a from"./readFileSync-
|
|
1
|
+
import n from"json5";import a from"./readFileSync-CloFeQw8.js";function d(t,o,e){o&&typeof o=="object"&&(e=o,o=void 0);const{beforeParse:f,buffer:i,compression:p,encoding:s="utf8",flag:u}=e??{},r=a(t,{buffer:i,compression:p,encoding:s,flag:u}),c=typeof f=="function"?f(r):r;return n.parse(c,o)}export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toPath as i}from"@visulima/path/utils";import d from"./parseJson-
|
|
1
|
+
import{toPath as i}from"@visulima/path/utils";import d from"./parseJson-_OfIPruP.js";import p from"./readFileSync-CloFeQw8.js";function a(r,o,t){typeof o=="object"&&(t=o,o=void 0);const n=p(r,{buffer:!0,encoding:void 0});let e=new TextDecoder().decode(n);const{beforeParse:f,color:c}=t??{};return typeof f=="function"&&(e=f(e)),d(e,o,i(r),{color:c})}export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u,W as C}from"./renderError-
|
|
1
|
+
import{a as u,W as C}from"./renderError-DjesnVYT-pWsLqw-_.js";import{toPath as g}from"@visulima/path/utils";import{parse as h,printParseErrorCode as b}from"jsonc-parser";import y from"./JSONError-Cvp9ycba.js";import E from"./readFile-VgxUDrNH.js";const P=(r,e,a,f)=>{if(r.length===0)return;const o=r[0],n=u(e,o.offset),t=new y(`${b(o.error)} at offset ${o.offset}`);throw t.fileName=a,t.codeFrame=C(e,{start:n},{tabWidth:!1,...f}),t},J=async(r,e)=>{const{allowEmptyContent:a,allowTrailingComma:f=!0,beforeParse:o,buffer:n,color:t,compression:l,disallowComments:c,encoding:p="utf8",flag:w}=e??{},m=await E(r,{buffer:n,compression:l,encoding:p,flag:w}),s=typeof o=="function"?o(m):m,i=[],d=h(s,i,{allowEmptyContent:a,allowTrailingComma:f,disallowComments:c});return P(i,s,g(r),{color:t}),d};export{J as default,P as throwIfJsoncErrors};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toPath as g}from"@visulima/path/utils";import{parse as C}from"jsonc-parser";import d from"./readFileSync-
|
|
1
|
+
import{toPath as g}from"@visulima/path/utils";import{parse as C}from"jsonc-parser";import d from"./readFileSync-CloFeQw8.js";import{throwIfJsoncErrors as y}from"./readJsonc-DSoFyuDk.js";const T=(o,e)=>{const{allowEmptyContent:l,allowTrailingComma:a=!0,beforeParse:r,buffer:f,color:i,compression:s,disallowComments:p,encoding:c="utf8",flag:u}=e??{},t=d(o,{buffer:f,compression:s,encoding:c,flag:u}),m=typeof r=="function"?r(t):t,n=[],w=C(m,n,{allowEmptyContent:l,allowTrailingComma:a,disallowComments:p});return y(n,m,g(o),{color:i}),w};export{T as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parse as a}from"smol-toml";import n from"./readFile-VgxUDrNH.js";const c=async(r,t)=>{const o=await n(r,{encoding:"utf8",...t});return a(o)};export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parse as n}from"smol-toml";import e from"./readFileSync-CloFeQw8.js";const m=(o,r)=>{const t=e(o,{encoding:"utf8",...r});return n(t)};export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parse as n}from"yaml";import s from"./readFile-
|
|
1
|
+
import{parse as n}from"yaml";import s from"./readFile-VgxUDrNH.js";async function g(r,o,t){const{buffer:a,compression:c,encoding:i="utf8",flag:p,...f}=t??{},e=await s(r,{buffer:a,compression:c,encoding:i,flag:p});return typeof o=="function"?n(e,o,f):n(e,f)}export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parse as r}from"yaml";import m from"./readFileSync-
|
|
1
|
+
import{parse as r}from"yaml";import m from"./readFileSync-CloFeQw8.js";function g(n,o,t){const{buffer:c,compression:i,encoding:p="utf8",flag:s,...f}=t??{},e=m(n,{buffer:c,compression:i,encoding:p,flag:s});return typeof o=="function"?r(e,o,f):r(e,f)}export{g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as t}from"node:module";import a from"./assertValidFileOrDirectoryPath-BTlt945W.js";import{t as _}from"./build-rm-options-avnusYx-.js";let i;const n=e=>(i??=t(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[s,r]=o.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return o.getBuiltinModule(e)}return n(e)},{rm:u}=c("node:fs/promises"),l=async(e,s={})=>{a(e),await u(e,_(s))};export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as t}from"node:module";import _ from"./assertValidFileOrDirectoryPath-BTlt945W.js";import{t as f}from"./build-rm-options-avnusYx-.js";let n;const i=e=>(n??=t(import.meta.url))(e),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 i(e)},{rmSync:u}=c("node:fs"),a=(e,o={})=>{_(e),u(e,f(o))};export{a as default};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{createRequire as B}from"node:module";let q;const W=e=>(q??=B(import.meta.url))(e),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,N=e=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[r,t]=y.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return y.getBuiltinModule(e)}return W(e)},{createRequire:R}=N("node:module"),I=globalThis.process??Object.create(null),T={versions:{}},x=new Proxy(I,{get(e,r){if(r in e)return e[r];if(r in T)return T[r]}}),P=e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
2
|
+
`),G=(e,r,t,n)=>{const s={column:0,line:-1,...e.start},a={...s,...e.end},u=s.line,l=s.column,g=a.line,f=a.column;let m=Math.max(u-(t+1),0),h=Math.min(r.length,g+n);u===-1&&(m=0),g===-1&&(h=r.length);const d=g-u,i={};if(d)for(let o=0;o<=d;o++){const c=o+u;if(!l)i[c]=!0;else if(o===0){const p=r[c-1]?.length;i[c]=[l,(p??0)-l+1]}else if(o===d)i[c]=[0,f];else{const p=r[c-o]?.length;i[c]=[0,p]}}else l===f?i[u]=l?[l,0]:!0:i[u]=[l,(f??0)-(l??0)];return{end:h,markerLines:i,start:m}},L=x.platform==="win32"&&!x.env?.WT_SESSION?">":"❯",K=(e,r,t)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...t,color:{gutter:o=>o,marker:o=>o,message:o=>o,...t?.color}},s=typeof r.start.column=="number";let a=(e.includes("\r")?P(e):e).split(`
|
|
3
|
+
`);typeof n.tabWidth=="number"&&e.includes(" ")&&(a=a.map(o=>o.replaceAll(" "," ".repeat(n.tabWidth))));const{end:u,markerLines:l,start:g}=G(r,a,n.linesAbove,n.linesBelow),f=String(u).length,{gutter:m,marker:h,message:d}=n.color;let i=a.slice(g,u).map((o,c)=>{const p=g+1+c,A=l[p],w=String(p).padStart(f),M=!l[p+1],_=` ${w}${n.showGutter?" |":""}`;if(A){let $="";if(Array.isArray(A)){const S=o.replaceAll(/[^\t]/g," ").slice(0,Math.max(A[0]-1,0)),k=A[1]||1;$=[`
|
|
4
|
+
`,n.prefix+m(_.replaceAll(/\d/g," "))," ",S,h("^").repeat(k)].join(""),M&&n.message&&($+=` ${d(n.message)}`)}return[n.prefix+h(L),m(_),o.length>0?` ${o}`:"",$].join("")}return`${n.prefix} ${m(_)}${o.length>0?` ${o}`:""}`}).join(`
|
|
5
|
+
`);return n.message&&!s&&(i=`${n.prefix+" ".repeat(f+1)+n.message}
|
|
6
|
+
${i}`),i},j=(e,r)=>{let t=0,n=r.length-2;for(;t<n;){const s=t+(n-t>>1);if(e<r[s])n=s-1;else if(e>=r[s+1])t=s+1;else{t=s;break}}return t},O=/\n|\r(?!\n)/,U=e=>e.split(O).reduce((r,t)=>(r.push(r.at(-1)+t.length+1),r),[0]),Q=(e,r,t)=>{if(!Array.isArray(e)&&typeof e!="string"||(typeof e=="string"||Array.isArray(e))&&e.length===0)return{column:0,line:0};if(typeof r!="number"||typeof e=="string"&&r>=e.length||Array.isArray(e)&&r+1>=e.at(-1))return{column:0,line:0};if(typeof e=="string"){const s=U(e),a=j(r,s);return{column:r-s[a]+1,line:a+1}}const n=j(r,e);return{column:r-e[n]+1,line:n+1}},V=new Map([["Error",Error],["EvalError",EvalError],["RangeError",RangeError],["ReferenceError",ReferenceError],["SyntaxError",SyntaxError],["TypeError",TypeError],["URIError",URIError]]);typeof AggregateError<"u"&&V.set("AggregateError",AggregateError);let z;const C=e=>(z??=R(import.meta.url))(e),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,D=e=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[r,t]=b.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return b.getBuiltinModule(e)}return C(e)};D("node:util");let F;const H=e=>(F??=R(import.meta.url))(e),E=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=e=>{if(typeof E<"u"&&E.versions&&E.versions.node){const[r,t]=E.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return E.getBuiltinModule(e)}return H(e)};v("node:fs");v("node:path");v("node:url");export{K as W,Q as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as j}from"node:module";const g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{platform:d}=g,l="unnamed",p=128,u={'"':"ˮ","*":"⁎","/":"⁄",":":"꞉","<":"‹",">":"›","?":"ʔ","\\":"∖","|":"ǀ"},x=/[\u0000-\u001F\u0080-\u009F]/g,_=/^(?:\.+[/\\]+)+|^\.+$/g,a=/^(?:con|prn|aux|nul|com\d|lpt\d)$/i,m=/[<>:"/\\|?*]/g,w=/\//g,o=new Set([" "," ","."]),f=(n,r)=>r>0&&r<n.length-1,b=(n,r)=>{const t=n.lastIndexOf(".");if(!f(n,t))return n.slice(0,r);const e=n.slice(0,t),i=n.slice(t),s=r-i.length;return s>0?`${e.slice(0,s)}${i}`:n.slice(0,r)},h=n=>{let r=0,t=n.length;for(;r<t;){const e=n[r];if(e===void 0||!o.has(e))break;r+=1}for(;t>r;){const e=n[t-1];if(e===void 0||!o.has(e))break;t-=1}return n.slice(r,t)},$=n=>{const r=n.lastIndexOf(".");if(f(n,r)){const e=n.slice(0,r),i=n.slice(r);let s=e;for(;s.length>0;){const c=s.at(-1);if(c===void 0||!o.has(c))break;s=s.slice(0,-1)}return s.length===0?i.slice(1):`${s}${i}`}let t=n;for(;t.length>0;){const e=t.at(-1);if(e===void 0||!o.has(e))break;t=t.slice(0,-1)}return t},v=n=>{const r=n.lastIndexOf(".");if(f(n,r))return!1;if(a.test(n))return!0;let t=n;for(;t.length>0;){const e=t.at(-1);if(e===void 0||!o.has(e))break;t=t.slice(0,-1)}return!!(t.length>0&&a.test(t))},I=n=>{const r=n.lastIndexOf(".");if(f(n,r)){const i=n.slice(0,r),s=n.slice(r),c=h(i);return c.length===0?void 0:`${c}${s}`}const t=n.trim();if(t.length>0&&t[0]==="."&&t.length<=5&&t.indexOf(".",1)===-1)return;const e=h(n);if(e.length!==0)return e},O=n=>{const r=n?.filesystem??"auto";return r==="auto"?d==="win32"?"win32":"unix":r==="darwin"?"unix":r},q=(n,r)=>{if(typeof n!="string"||n.length===0)return l;const t=O(r);let e=n;if(e=e.replace(x,""),e.length===0||(e=e.replace(_,""),e.length===0))return l;if(t==="win32"||t==="fat32"){const s=e.lastIndexOf(".");if(!f(e,s)&&a.test(e))return l}if(e=t==="win32"||t==="fat32"?e.replaceAll(m,s=>u[s]??""):e.replaceAll(w,u["/"]),e=e.trim(),(t==="win32"||t==="fat32")&&(v(e)||t==="win32"&&(e=$(e),e.length===0)))return l;if(t==="fat32"){const s=I(e);if(s===void 0)return l;e=s}if(e.length===0)return l;const i=r?.maxLength??p;return e.length>i&&(e=b(e,i),e.length===0)?l:e};export{q as sanitize};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as o}from"node:module";let s;const i=e=>(s??=o(import.meta.url))(e),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[t,n]=r.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return r.getBuiltinModule(e)}return i(e)},{randomBytes:f}=c("node:crypto"),p=e=>`${e}.${process.pid.toString(36)}.${f(6).toString("hex")}.tmp`,u=new TextEncoder,d=e=>{if(e instanceof Uint8Array)return e;if(typeof e=="string")return u.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.")};export{d as i,p as o};
|