@visulima/fs 2.1.13 → 2.1.14
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 +16 -0
- package/LICENSE.md +52 -560
- package/dist/error.cjs +1 -1
- package/dist/error.d.cts +1 -1
- package/dist/error.d.mts +1 -1
- package/dist/error.d.ts +1 -1
- package/dist/error.mjs +1 -1
- package/dist/index.cjs +1 -9
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +1 -9
- package/dist/shared/AlreadyExistsError-qYsUje4Q.cjs +1 -0
- package/dist/shared/AlreadyExistsError-yT45kpVd.mjs +1 -0
- package/dist/shared/DirectoryError-DYXOepnO.mjs +1 -0
- package/dist/shared/DirectoryError-JjvRpYZe.cjs +1 -0
- package/dist/shared/F_OK-B8R_JA-Q.cjs +1 -0
- package/dist/shared/F_OK-BzMbdSs5.mjs +1 -0
- package/dist/shared/{fs.BXbumRuI.mjs → JSONError-BwfyCaRr.mjs} +1 -1
- package/dist/shared/JSONError-BywLDEj4.cjs +4 -0
- package/dist/shared/LF-D4BqIfQm.cjs +3 -0
- package/dist/shared/LF-DwWQ8GdI.mjs +3 -0
- package/dist/shared/NotEmptyError-Bh6NOR9V.cjs +1 -0
- package/dist/shared/NotEmptyError-DCoszDiD.mjs +1 -0
- package/dist/shared/NotFoundError-BvgYH3iL.cjs +1 -0
- package/dist/shared/NotFoundError-CQCvj7gX.mjs +1 -0
- package/dist/shared/PermissionError-BYPqHEY9.mjs +1 -0
- package/dist/shared/PermissionError-Dl1gfUwc.cjs +1 -0
- package/dist/shared/WalkError-CWKlhCA6.mjs +1 -0
- package/dist/shared/WalkError-DzbUzZjo.cjs +1 -0
- package/dist/shared/assertValidFileContents-BTXEHdLD.mjs +1 -0
- package/dist/shared/assertValidFileContents-vTNSeAqn.cjs +1 -0
- package/dist/shared/assertValidFileOrDirectoryPath-BT5xYqBy.cjs +1 -0
- package/dist/shared/assertValidFileOrDirectoryPath-CQmKNf2h.mjs +1 -0
- package/dist/shared/collect-B2KdWG6-.mjs +1 -0
- package/dist/shared/collect-DwzKTfA1.cjs +1 -0
- package/dist/shared/collectSync-BMKZmoZR.mjs +1 -0
- package/dist/shared/collectSync-D-h8vph4.cjs +1 -0
- package/dist/shared/emptyDir-BkedPAhT.mjs +1 -0
- package/dist/shared/emptyDir-Ddqlcb6Q.cjs +1 -0
- package/dist/shared/emptyDirSync-Cp_8wgUR.mjs +1 -0
- package/dist/shared/emptyDirSync-DqizscgL.cjs +1 -0
- package/dist/shared/ensureDir-CpMWmVZ0.mjs +1 -0
- package/dist/shared/ensureDir-tKW3dSA0.cjs +1 -0
- package/dist/shared/ensureDirSync-DzJ1sUTo.cjs +1 -0
- package/dist/shared/ensureDirSync-hyBJv3ax.mjs +1 -0
- package/dist/shared/ensureFile-C4MogFm1.cjs +1 -0
- package/dist/shared/ensureFile-b-ST2MTk.mjs +1 -0
- package/dist/shared/ensureFileSync-BXhhrF2q.cjs +1 -0
- package/dist/shared/ensureFileSync-ClzIyiYf.mjs +1 -0
- package/dist/shared/ensureLink-CHQqG8z2.mjs +1 -0
- package/dist/shared/ensureLink-DY7IQxZ4.cjs +1 -0
- package/dist/shared/ensureLinkSync-Cq1cPBbo.mjs +1 -0
- package/dist/shared/ensureLinkSync-DJpt1OVV.cjs +1 -0
- package/dist/shared/ensureSymlink-CMtb3oPM.mjs +1 -0
- package/dist/shared/ensureSymlink-D6VKdTBJ.cjs +1 -0
- package/dist/shared/ensureSymlinkSync-DRDE5so4.mjs +1 -0
- package/dist/shared/ensureSymlinkSync-DWIrsihx.cjs +1 -0
- package/dist/shared/findUp-BVECzzpO.cjs +1 -0
- package/dist/shared/findUp-COYH0Ul9.mjs +1 -0
- package/dist/shared/findUpSync-nA9H0jZj.mjs +1 -0
- package/dist/shared/findUpSync-vnrRIw6w.cjs +1 -0
- package/dist/shared/get-file-info-type-BXcpoWEM.cjs +1 -0
- package/dist/shared/get-file-info-type-CaWGXRjY.mjs +1 -0
- package/dist/shared/index-Cms6lU4T.cjs +1 -0
- package/dist/shared/index-VcQXVcaq.mjs +1 -0
- package/dist/shared/is-stats-identical-CPCumzsC.cjs +1 -0
- package/dist/shared/is-stats-identical-CS5Y91zW.mjs +1 -0
- package/dist/shared/isAccessible-BbChaABn.mjs +1 -0
- package/dist/shared/isAccessible-DxFHaxVe.cjs +1 -0
- package/dist/shared/isAccessibleSync-C3YjvkTe.mjs +1 -0
- package/dist/shared/isAccessibleSync-DtOcefUR.cjs +1 -0
- package/dist/shared/parseJson-DjId4v2J.mjs +6 -0
- package/dist/shared/parseJson-IY63B_0y.cjs +6 -0
- package/dist/shared/readFile-BvgGZivd.mjs +1 -0
- package/dist/shared/readFile-DBC_s-48.cjs +1 -0
- package/dist/shared/readFileSync-C2bxnV-R.mjs +1 -0
- package/dist/shared/readFileSync-CBzoyWtz.cjs +1 -0
- package/dist/shared/readJson-BpngPb-8.cjs +1 -0
- package/dist/shared/readJson-hlujfMhv.mjs +1 -0
- package/dist/shared/readJsonSync-C1vainhA.mjs +1 -0
- package/dist/shared/readJsonSync-DTRTDPzu.cjs +1 -0
- package/dist/shared/readYaml-Cm-6prFv.mjs +1 -0
- package/dist/shared/readYaml-jKVEYXs2.cjs +1 -0
- package/dist/shared/readYamlSync-C73N6_GL.cjs +1 -0
- package/dist/shared/readYamlSync-DgaclC7K.mjs +1 -0
- package/dist/shared/remove-D67tECRM.cjs +1 -0
- package/dist/shared/remove-DbvVKBUa.mjs +1 -0
- package/dist/shared/removeSync-Ngu7GWsH.mjs +1 -0
- package/dist/shared/removeSync-womNIl-8.cjs +1 -0
- package/dist/shared/resolve-symlink-target-BofZSDIc.mjs +1 -0
- package/dist/shared/resolve-symlink-target-HnbdXA1S.cjs +1 -0
- package/dist/shared/stripJsonComments-BuOddwNE.cjs +1 -0
- package/dist/shared/stripJsonComments-DtqWH5Xl.mjs +1 -0
- package/dist/shared/to-uint-8-array-2-3EvGd7.cjs +1 -0
- package/dist/shared/to-uint-8-array-DwgaTasY.mjs +1 -0
- package/dist/shared/walk-DO_o7eRl.mjs +1 -0
- package/dist/shared/walk-include-B-MbUqMt.mjs +1 -0
- package/dist/shared/walk-include-CFIYniQi.cjs +1 -0
- package/dist/shared/walk-kHxIkAkJ.cjs +1 -0
- package/dist/shared/walkSync-BLhXIHWn.cjs +1 -0
- package/dist/shared/walkSync-C5uWmu9Q.mjs +1 -0
- package/dist/shared/writeFile-BkHnZTWA.mjs +1 -0
- package/dist/shared/writeFile-COembSIp.cjs +1 -0
- package/dist/shared/writeFileSync-6h8CQ9EO.mjs +1 -0
- package/dist/shared/writeFileSync-C3D5fvZf.cjs +1 -0
- package/dist/shared/writeJson-C8i3IALv.mjs +4 -0
- package/dist/shared/writeJson-rHdXUJ9n.cjs +4 -0
- package/dist/shared/writeJsonSync-BVBRbGPP.mjs +4 -0
- package/dist/shared/writeJsonSync-C7xU8DX6.cjs +4 -0
- package/dist/shared/writeYaml-BG-a4bX4.mjs +1 -0
- package/dist/shared/writeYaml-BnD26RjE.cjs +1 -0
- package/dist/shared/writeYamlSync-BEUPvAyj.mjs +1 -0
- package/dist/shared/writeYamlSync-BS0MBjJo.cjs +1 -0
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.cts +2 -2
- package/dist/utils.d.mts +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.mjs +1 -1
- package/package.json +5 -5
- package/dist/shared/fs.BLXmkvbT.cjs +0 -4
- package/dist/shared/fs.BMHe7vX1.mjs +0 -1
- package/dist/shared/fs.CRRGdXGG.mjs +0 -6
- package/dist/shared/fs.CjglVHda.cjs +0 -1
- package/dist/shared/fs.DpFCX-WT.cjs +0 -6
- /package/dist/shared/{fs.ZPgZIXcg.d.cts → json-error-ZPgZIXcg.d.cts} +0 -0
- /package/dist/shared/{fs.ZPgZIXcg.d.mts → json-error-ZPgZIXcg.d.mjs} +0 -0
- /package/dist/shared/{fs.ZPgZIXcg.d.ts → json-error-ZPgZIXcg.d.mts} +0 -0
- /package/dist/shared/{fs.CpT5ICZl.d.cts → observable-like.d-CpT5ICZl.d.cts} +0 -0
- /package/dist/shared/{fs.CpT5ICZl.d.mts → observable-like.d-CpT5ICZl.d.mjs} +0 -0
- /package/dist/shared/{fs.CpT5ICZl.d.ts → observable-like.d-CpT5ICZl.d.mts} +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";var T=Object.defineProperty;var y=(e,t)=>T(e,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./JSONError-BywLDEj4.cjs");var W=Object.defineProperty,O=y((e,t)=>W(e,"name",{value:t,configurable:!0}),"v"),E=Object.defineProperty,J=O((e,t)=>E(e,"name",{value:t,configurable:!0}),"r$1");const q=J(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
2
|
+
`),"normalizeLF"),B=globalThis.process||Object.create(null),P={versions:{}},S=new Proxy(B,{get(e,t){if(t in e)return e[t];if(t in P)return P[t]}});var I=Object.defineProperty,G=O((e,t)=>I(e,"name",{value:t,configurable:!0}),"b");const U=G((e,t,o,n)=>{const r={column:0,line:-1,...e.start},l={...r,...e.end},a=r.line,s=r.column,g=l.line,f=l.column;let p=Math.max(a-(o+1),0),d=Math.min(t.length,g+n);a===-1&&(p=0),g===-1&&(d=t.length);const b=g-a,c={};if(b)for(let i=0;i<=b;i++){const u=i+a;if(!s)c[u]=!0;else if(i===0){const m=t[u-1]?.length;c[u]=[s,(m??0)-s+1]}else if(i===b)c[u]=[0,f];else{const m=t[u-i]?.length;c[u]=[0,m]}}else s===f?c[a]=s?[s,0]:!0:c[a]=[s,(f??0)-(s??0)];return{end:d,markerLines:c,start:p}},"getMarkerLines");var _=Object.defineProperty,x=O((e,t)=>_(e,"name",{value:t,configurable:!0}),"o");const z=S.platform==="win32"&&!S.env?.WT_SESSION?">":"❯",D=x((e,t,o)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...o,color:{gutter:x(i=>i,"gutter"),marker:x(i=>i,"marker"),message:x(i=>i,"message"),...o?.color}},r=t.start&&typeof t.start.column=="number";let l=q(e).split(`
|
|
3
|
+
`);typeof n?.tabWidth=="number"&&(l=l.map(i=>i.replaceAll(" "," ".repeat(n.tabWidth))));const{end:a,markerLines:s,start:g}=U(t,l,n.linesAbove,n.linesBelow),f=String(a).length,{gutter:p,marker:d,message:b}=n.color;let c=l.slice(g,a).map((i,u)=>{const m=g+1+u,v=s[m],N=(" "+m).slice(-f),L=!s[m+1],A=" "+N+(n.showGutter?" |":"");if(v){let j="";if(Array.isArray(v)){const C=i.replaceAll(/[^\t]/g," ").slice(0,Math.max(v[0]-1,0)),F=v[1]||1;j=[`
|
|
4
|
+
`,n.prefix+p(A.replaceAll(/\d/g," "))," ",C,d("^").repeat(F)].join(""),L&&n.message&&(j+=` ${b(n.message)}`)}return[n.prefix+d(z),p(A),i.length>0?" "+i:"",j].join("")}return n.prefix+" "+p(A)+(i.length>0?" "+i:"")}).join(`
|
|
5
|
+
`);return n.message&&!r&&(c=n.prefix+" ".repeat(f+1)+n.message+`
|
|
6
|
+
`+c),c},"codeFrame");var H=Object.defineProperty,K=y((e,t)=>H(e,"name",{value:t,configurable:!0}),"l$1"),Q=Object.defineProperty,k=K((e,t)=>Q(e,"name",{value:t,configurable:!0}),"l");const $=k((e,t)=>{let o=0,n=t.length-2;for(;o<n;){const r=o+(n-o>>1);if(e<t[r])n=r-1;else if(e>=t[r+1])o=r+1;else{o=r;break}}return o},"binarySearch"),R=k(e=>e.split(/\n|\r(?!\n)/).reduce((t,o)=>(t.push(t.at(-1)+o.length+1),t),[0]),"getLineStartIndexes"),V=k((e,t,o)=>{const n=o?.skipChecks??!1;if(!n&&(!Array.isArray(e)&&typeof e!="string"||(typeof e=="string"||Array.isArray(e))&&e.length===0))return{column:0,line:0};if(!n&&(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=R(e),a=$(t,l);return{column:t-l[a]+1,line:a+1}}const r=$(t,e);return{column:t-e[r]+1,line:r+1}},"indexToLineColumn"),X=V;var Y=Object.defineProperty,h=y((e,t)=>Y(e,"name",{value:t,configurable:!0}),"s");const Z=h(e=>`\\u{${e.codePointAt(0).toString(16)}}`,"getCodePoint"),ee=h((e,t,o)=>D(e,{start:t},{tabWidth:!1,...o}),"generateCodeFrame"),te=h((e,t)=>{const o=/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/.exec(t);if(!o)return;let{column:n,index:r,line:l}=o.groups;return l&&n?{column:Number(n),line:Number(l)}:(r=Number(r),r===e.length&&(r=e.length-1),X(e,r))},"getErrorLocation"),ne=h(e=>e.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(t,o,n)=>`"${n}"(${Z(n)})`),"addCodePointToUnexpectedToken");function w(e,t,o,n){typeof t=="string"&&(typeof o=="object"&&(n=o),o=t,t=void 0);let r;try{return JSON.parse(e,t)}catch(s){r=s.message}let l;e?(l=te(e,r),r=ne(r)):r+=" while parsing empty string";const a=new M.r(r);throw a.fileName=o,l&&(a.codeFrame=ee(e,l,n)),a}y(w,"F");h(w,"parseJson");exports.F=w;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var w=Object.defineProperty;var m=(o,r)=>w(o,"name",{value:r,configurable:!0});import{readFile as b}from"node:fs/promises";import{brotliDecompress as g,unzip as h}from"node:zlib";import{toPath as u}from"@visulima/path/utils";import{R as P}from"./F_OK-BzMbdSs5.mjs";import{n as v}from"./PermissionError-BYPqHEY9.mjs";import{m as f}from"./isAccessible-BbChaABn.mjs";import{s as y}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";var R=Object.defineProperty,l=m((o,r)=>R(o,"name",{value:r,configurable:!0}),"n");const $={brotli:g,gzip:h,none:l((o,r)=>{r(null,o)},"none")},S=l(async(o,r)=>{if(y(o),o=u(o),!await f(o))throw new v(`unable to read the non-accessible file: ${o}`);if(!await f(o,P))throw new Error(`Unable to read the non-readable file: ${o}`);const{buffer:c,compression:p,encoding:e,flag:t}=r??{};return await b(o,t?{encoding:e,flag:t}:{encoding:e}).then(async n=>await new Promise((s,d)=>{$[p??"none"](n,(i,a)=>{i?d(i):s(c?a:a.toString())})})).catch(n=>{throw n})},"readFile");export{S as R};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var w=Object.defineProperty;var s=(e,r)=>w(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("node:fs/promises"),c=require("node:zlib"),m=require("@visulima/path/utils"),p=require("./F_OK-B8R_JA-Q.cjs"),q=require("./PermissionError-Dl1gfUwc.cjs"),l=require("./isAccessible-DxFHaxVe.cjs"),P=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs");var y=Object.defineProperty,u=s((e,r)=>y(e,"name",{value:r,configurable:!0}),"n");const O={brotli:c.brotliDecompress,gzip:c.unzip,none:u((e,r)=>{r(null,e)},"none")},v=u(async(e,r)=>{if(P.s(e),e=m.toPath(e),!await l.m(e))throw new q.n(`unable to read the non-accessible file: ${e}`);if(!await l.m(e,p.R_OK))throw new Error(`Unable to read the non-readable file: ${e}`);const{buffer:d,compression:b,encoding:i,flag:o}=r??{};return await h.readFile(e,o?{encoding:i,flag:o}:{encoding:i}).then(async n=>await new Promise((f,g)=>{O[b??"none"](n,(t,a)=>{t?g(t):f(d?a:a.toString())})})).catch(n=>{throw n})},"readFile");exports.R=v;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.defineProperty;var t=(o,r)=>s(o,"name",{value:r,configurable:!0});import{readFileSync as d}from"node:fs";import{brotliDecompressSync as g,unzipSync as b}from"node:zlib";import{toPath as u}from"@visulima/path/utils";import{R as y}from"./F_OK-BzMbdSs5.mjs";import{n as a}from"./PermissionError-BYPqHEY9.mjs";import{m}from"./isAccessibleSync-C3YjvkTe.mjs";import{s as S}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";var h=Object.defineProperty,f=t((o,r)=>h(o,"name",{value:r,configurable:!0}),"n");const v={brotli:g,gzip:b,none:f(o=>o,"none")},x=f((o,r)=>{if(S(o),o=u(o),!m(o))throw new a(`unable to read the non-accessible file: ${o}`);if(!m(o,y))throw new a(`invalid access to read file at: ${o}`);const{buffer:c,compression:l,encoding:n,flag:i}=r??{},p=d(o,i?{encoding:n,flag:i}:{encoding:n}),e=v[l??"none"](p);return c?e:e.toString()},"readFileSync");export{x as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var b=Object.defineProperty;var t=(e,n)=>b(e,"name",{value:n,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("node:fs"),c=require("node:zlib"),y=require("@visulima/path/utils"),m=require("./F_OK-B8R_JA-Q.cjs"),s=require("./PermissionError-Dl1gfUwc.cjs"),a=require("./isAccessibleSync-DtOcefUR.cjs"),S=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs");var q=Object.defineProperty,l=t((e,n)=>q(e,"name",{value:n,configurable:!0}),"n");const p={brotli:c.brotliDecompressSync,gzip:c.unzipSync,none:l(e=>e,"none")},h=l((e,n)=>{if(S.s(e),e=y.toPath(e),!a.m(e))throw new s.n(`unable to read the non-accessible file: ${e}`);if(!a.m(e,m.R_OK))throw new s.n(`invalid access to read file at: ${e}`);const{buffer:u,compression:d,encoding:r,flag:i}=n??{},f=g.readFileSync(e,i?{encoding:r,flag:i}:{encoding:r}),o=p[d??"none"](f);return u?o:o.toString()},"readFileSync");exports.g=h;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var u=Object.defineProperty;var t=(o,e)=>u(o,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@visulima/path/utils"),f=require("./parseJson-IY63B_0y.cjs"),l=require("./readFile-DBC_s-48.cjs");var b=Object.defineProperty,v=t((o,e)=>b(o,"name",{value:e,configurable:!0}),"i");async function i(o,e,n){typeof e=="object"&&(n=e,e=void 0);const a=await l.R(o,{buffer:!0,encoding:void 0});let r=new TextDecoder().decode(a);const{beforeParse:c,color:s}=n??{};return typeof c=="function"&&(r=c(r)),f.F(r,e,d.toPath(o),{color:s})}t(i,"c");v(i,"readJson");exports.c=i;
|
|
@@ -0,0 +1 @@
|
|
|
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{F as m}from"./parseJson-DjId4v2J.mjs";import{R as p}from"./readFile-BvgGZivd.mjs";var s=Object.defineProperty,u=t((e,o)=>s(e,"name",{value:o,configurable:!0}),"i");async function b(e,o,n){typeof o=="object"&&(n=o,o=void 0);const a=await p(e,{buffer:!0,encoding:void 0});let r=new TextDecoder().decode(a);const{beforeParse:c,color:f}=n??{};return typeof c=="function"&&(r=c(r)),m(r,o,d(e),{color:f})}t(b,"c");u(b,"readJson");export{b as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=Object.defineProperty;var t=(e,o)=>a(e,"name",{value:o,configurable:!0});import{toPath as d}from"@visulima/path/utils";import{F as m}from"./parseJson-DjId4v2J.mjs";import{g as p}from"./readFileSync-C2bxnV-R.mjs";var u=Object.defineProperty,b=t((e,o)=>u(e,"name",{value:o,configurable:!0}),"r");function l(e,o,n){typeof o=="object"&&(n=o,o=void 0);const f=p(e,{buffer:!0,encoding:void 0});let r=new TextDecoder().decode(f);const{beforeParse:c,color:i}=n??{};return typeof c=="function"&&(r=c(r)),m(r,o,d(e),{color:i})}t(l,"J");b(l,"readJsonSync");export{l as J};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var u=Object.defineProperty;var t=(o,e)=>u(o,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@visulima/path/utils"),f=require("./parseJson-IY63B_0y.cjs"),l=require("./readFileSync-CBzoyWtz.cjs");var b=Object.defineProperty,y=t((o,e)=>b(o,"name",{value:e,configurable:!0}),"r");function i(o,e,n){typeof e=="object"&&(n=e,e=void 0);const a=l.g(o,{buffer:!0,encoding:void 0});let r=new TextDecoder().decode(a);const{beforeParse:c,color:s}=n??{};return typeof c=="function"&&(r=c(r)),f.F(r,e,d.toPath(o),{color:s})}t(i,"J");y(i,"readJsonSync");exports.J=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.defineProperty;var o=(r,e)=>s(r,"name",{value:e,configurable:!0});import{parse as a}from"yaml";import{R as u}from"./readFile-BvgGZivd.mjs";var l=Object.defineProperty,d=o((r,e)=>l(r,"name",{value:e,configurable:!0}),"e");async function g(r,e,t){const{buffer:i,compression:c,encoding:m="utf8",flag:p,...n}=t??{},f=await u(r,{buffer:i,compression:c,encoding:m,flag:p});return typeof e=="function"?a(f,e,n):a(f,n)}o(g,"d");d(g,"readYaml");export{g as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var d=Object.defineProperty;var n=(r,e)=>d(r,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("yaml"),p=require("./readFile-DBC_s-48.cjs");var g=Object.defineProperty,m=n((r,e)=>g(r,"name",{value:e,configurable:!0}),"e");async function i(r,e,c){const{buffer:f,compression:s,encoding:u="utf8",flag:l,...a}=c??{},o=await p.R(r,{buffer:f,compression:s,encoding:u,flag:l});return typeof e=="function"?t.parse(o,e,a):t.parse(o,a)}n(i,"d");m(i,"readYaml");exports.d=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var d=Object.defineProperty;var n=(r,e)=>d(r,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("yaml"),g=require("./readFileSync-CBzoyWtz.cjs");var p=Object.defineProperty,m=n((r,e)=>p(r,"name",{value:e,configurable:!0}),"i");function c(r,e,i){const{buffer:f,compression:u,encoding:s="utf8",flag:l,...o}=i??{},t=g.g(r,{buffer:f,compression:u,encoding:s,flag:l});return typeof e=="function"?a.parse(t,e,o):a.parse(t,o)}n(c,"d");m(c,"readYamlSync");exports.d=c;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var u=Object.defineProperty;var o=(r,e)=>u(r,"name",{value:e,configurable:!0});import{parse as t}from"yaml";import{g as s}from"./readFileSync-C2bxnV-R.mjs";var g=Object.defineProperty,l=o((r,e)=>g(r,"name",{value:e,configurable:!0}),"i");function d(r,e,i){const{buffer:a,compression:c,encoding:m="utf8",flag:p,...n}=i??{},f=s(r,{buffer:a,compression:c,encoding:m,flag:p});return typeof e=="function"?t(f,e,n):t(f,n)}o(d,"d");l(d,"readYamlSync");export{d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var t=(e,r)=>i(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("node:fs/promises"),c=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs");var s=Object.defineProperty,o=t((e,r)=>s(e,"name",{value:r,configurable:!0}),"t");const y=o(async(e,r={})=>{c.s(e);try{await a.unlink(e)}catch{}try{await a.rm(e,{force:!0,maxRetries:r?.maxRetries,recursive:!0,retryDelay:r?.retryDelay})}catch{}},"remove");exports.y=y;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=Object.defineProperty;var t=(r,e)=>a(r,"name",{value:e,configurable:!0});import{unlink as i,rm as c}from"node:fs/promises";import{s as o}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";var m=Object.defineProperty,y=t((r,e)=>m(r,"name",{value:e,configurable:!0}),"t");const l=y(async(r,e={})=>{o(r);try{await i(r)}catch{}try{await c(r,{force:!0,maxRetries:e?.maxRetries,recursive:!0,retryDelay:e?.retryDelay})}catch{}},"remove");export{l as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=Object.defineProperty;var t=(r,e)=>c(r,"name",{value:e,configurable:!0});import{unlinkSync as a,rmSync as m}from"node:fs";import{s as o}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";var y=Object.defineProperty,i=t((r,e)=>y(r,"name",{value:e,configurable:!0}),"t");const s=i((r,e={})=>{o(r);try{a(r)}catch{}try{m(r,{force:!0,maxRetries:e?.maxRetries,recursive:!0,retryDelay:e?.retryDelay})}catch{}},"removeSync");export{s as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var t=(e,r)=>a(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("node:fs"),i=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs");var n=Object.defineProperty,o=t((e,r)=>n(e,"name",{value:r,configurable:!0}),"t");const y=o((e,r={})=>{i.s(e);try{c.unlinkSync(e)}catch{}try{c.rmSync(e,{force:!0,maxRetries:r?.maxRetries,recursive:!0,retryDelay:r?.retryDelay})}catch{}},"removeSync");exports.m=y;
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var r=(e,t)=>s(e,"name",{value:t,configurable:!0});const o=require("@visulima/path");var i=Object.defineProperty,a=r((e,t)=>i(e,"name",{value:t,configurable:!0}),"i");const n=a((e,t)=>typeof e!="string"?e:e.startsWith("./")?o.resolve(e):typeof t=="string"?o.resolve(o.dirname(t),e):new URL(e,t),"resolveSymlinkTarget");exports.o=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var s=(e,t)=>a(e,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var i=Object.defineProperty,o=s((e,t)=>i(e,"name",{value:t,configurable:!0}),"n");const r=o((e,{whitespace:t=!0}={})=>e.replace(c,n=>n.startsWith('"')||n[1]==="*"&&!n.endsWith("*/")?n:t?n.replaceAll(/\S/g," "):""),"stripJsonComments"),c=/"(?:[^"\\]|\\.)*"?|\/\/[^\r\n]*|\/\*(?:[^*]|\*[^/])*(?:\*\/)?/g;exports.i=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=Object.defineProperty;var s=(e,t)=>a(e,"name",{value:t,configurable:!0});var c=Object.defineProperty,i=s((e,t)=>c(e,"name",{value:t,configurable:!0}),"n");const l=i((e,{whitespace:t=!0}={})=>e.replace(o,n=>n.startsWith('"')||n[1]==="*"&&!n.endsWith("*/")?n:t?n.replaceAll(/\S/g," "):""),"stripJsonComments"),o=/"(?:[^"\\]|\\.)*"?|\/\/[^\r\n]*|\/\*(?:[^*]|\*[^/])*(?:\*\/)?/g;export{l as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";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");exports.a=y;
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var h=Object.defineProperty;var c=(e,o)=>h(e,"name",{value:o,configurable:!0});import{readdir as w,realpath as D,stat as F}from"node:fs/promises";import{resolve as v,join as L,normalize as x,basename as I}from"@visulima/path";import{toPath as g}from"@visulima/path/utils";import{i as k}from"./WalkError-CWKlhCA6.mjs";import{s as N}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";import{c as u,a as l}from"./walk-include-B-MbUqMt.mjs";var O=Object.defineProperty,S=c((e,o)=>O(e,"name",{value:o,configurable:!0}),"f");const P=S(async e=>{const o=x(e),t=I(o),r=await F(o);return{isDirectory:r.isDirectory,isFile:r.isFile,isSymbolicLink:r.isSymbolicLink,name:t,path:o}},"_createWalkEntry");async function*b(e,{extensions:o,followSymlinks:t=!1,includeDirs:r=!0,includeFiles:y=!0,includeSymlinks:f=!0,match:p,maxDepth:m=Number.POSITIVE_INFINITY,skip:d}={}){if(N(e),m<0)return;const a=p?p.map(i=>typeof i=="string"?u(i):i):void 0,s=d?d.map(i=>typeof i=="string"?u(i):i):void 0;if(e=v(g(e)),r&&l(e,o,a,s)&&(yield await P(e)),!(m<1||!l(e,void 0,void 0,s)))try{for await(const i of await w(e,{withFileTypes:!0})){let n=L(e,i.name);if(i.isSymbolicLink())if(t)n=await D(n);else if(f&&l(n,o,a,s))yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:n};else continue;i.isSymbolicLink()||i.isDirectory()?yield*b(n,{extensions:o,followSymlinks:t,includeDirs:r,includeFiles:y,includeSymlinks:f,match:a,maxDepth:m-1,skip:s}):i.isFile()&&y&&l(n,o,a,s)&&(yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:n})}}catch(i){throw i instanceof k?i:new k(i,e)}}c(b,"d");S(b,"walk");export{b as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=Object.defineProperty;var c=(e,r)=>n(e,"name",{value:r,configurable:!0});var p=Object.defineProperty,t=c((e,r)=>p(e,"name",{value:r,configurable:!0}),"r");const u=t(e=>{const r=e.replace(/\.\*/g,".([^/]*)").replace(/\*\*/g,"(.*)").replace(/(?<!\.)\*(?!\*)/g,"([^/]*)").replace(/\?/g,"[^/]").replace(/\.(?!\*)/g,"\\.").replace(/\{/g,"(").replace(/\}/g,")").replace(/,/g,"|").replace(/\[!(.*?)\]/g,"[^$1]");return new RegExp(`^${r}$`)},"globToRegExp");var o=Object.defineProperty,s=c((e,r)=>o(e,"name",{value:r,configurable:!0}),"n");const v=s((e,r,g,l)=>Array.isArray(r)&&r.length>0&&!r.some(a=>e.endsWith(a))||g&&!g.some(a=>a.test(e))?!1:!l?.some(a=>a.test(e)),"walkInclude");export{v as a,u as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=Object.defineProperty;var c=(e,r)=>t(e,"name",{value:r,configurable:!0});var n=Object.defineProperty,p=c((e,r)=>n(e,"name",{value:r,configurable:!0}),"r");const s=p(e=>{const r=e.replace(/\.\*/g,".([^/]*)").replace(/\*\*/g,"(.*)").replace(/(?<!\.)\*(?!\*)/g,"([^/]*)").replace(/\?/g,"[^/]").replace(/\.(?!\*)/g,"\\.").replace(/\{/g,"(").replace(/\}/g,")").replace(/,/g,"|").replace(/\[!(.*?)\]/g,"[^$1]");return new RegExp(`^${r}$`)},"globToRegExp");var o=Object.defineProperty,i=c((e,r)=>o(e,"name",{value:r,configurable:!0}),"n");const u=i((e,r,g,l)=>Array.isArray(r)&&r.length>0&&!r.some(a=>e.endsWith(a))||g&&!g.some(a=>a.test(e))?!1:!l?.some(a=>a.test(e)),"walkInclude");exports.a=u;exports.c=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var w=Object.defineProperty;var m=(e,s)=>w(e,"name",{value:s,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("node:fs/promises"),c=require("@visulima/path"),D=require("@visulima/path/utils"),b=require("./WalkError-DzbUzZjo.cjs"),F=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs"),a=require("./walk-include-CFIYniQi.cjs");var v=Object.defineProperty,h=m((e,s)=>v(e,"name",{value:s,configurable:!0}),"f");const L=h(async e=>{const s=c.normalize(e),t=c.basename(s),n=await u.stat(s);return{isDirectory:n.isDirectory,isFile:n.isFile,isSymbolicLink:n.isSymbolicLink,name:t,path:s}},"_createWalkEntry");async function*d(e,{extensions:s,followSymlinks:t=!1,includeDirs:n=!0,includeFiles:f=!0,includeSymlinks:k=!0,match:p,maxDepth:y=Number.POSITIVE_INFINITY,skip:S}={}){if(F.s(e),y<0)return;const l=p?p.map(i=>typeof i=="string"?a.c(i):i):void 0,o=S?S.map(i=>typeof i=="string"?a.c(i):i):void 0;if(e=c.resolve(D.toPath(e)),n&&a.a(e,s,l,o)&&(yield await L(e)),!(y<1||!a.a(e,void 0,void 0,o)))try{for await(const i of await u.readdir(e,{withFileTypes:!0})){let r=c.join(e,i.name);if(i.isSymbolicLink())if(t)r=await u.realpath(r);else if(k&&a.a(r,s,l,o))yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:r};else continue;i.isSymbolicLink()||i.isDirectory()?yield*d(r,{extensions:s,followSymlinks:t,includeDirs:n,includeFiles:f,includeSymlinks:k,match:l,maxDepth:y-1,skip:o}):i.isFile()&&f&&a.a(r,s,l,o)&&(yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:r})}}catch(i){throw i instanceof b.i?i:new b.i(i,e)}}m(d,"d");h(d,"walk");exports.d=d;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var D=Object.defineProperty;var y=(e,n)=>D(e,"name",{value:n,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("node:fs"),t=require("@visulima/path"),F=require("@visulima/path/utils"),p=require("./WalkError-DzbUzZjo.cjs"),v=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs"),o=require("./walk-include-CFIYniQi.cjs");var L=Object.defineProperty,b=y((e,n)=>L(e,"name",{value:n,configurable:!0}),"m");const w=b(e=>{const n=t.normalize(e),s=m.statSync(n);return{isDirectory:s.isDirectory,isFile:s.isFile,isSymbolicLink:s.isSymbolicLink,name:t.basename(n),path:n}},"_createWalkEntry");function*d(e,{extensions:n,followSymlinks:s=!1,includeDirs:u=!0,includeFiles:S=!0,includeSymlinks:f=!0,match:k,maxDepth:a=Number.POSITIVE_INFINITY,skip:h}={}){if(v.s(e),a<0)return;const c=k?k.map(i=>typeof i=="string"?o.c(i):i):void 0,l=h?h.map(i=>typeof i=="string"?o.c(i):i):void 0;if(e=t.resolve(F.toPath(e)),u&&o.a(e,n,c,l)&&(yield w(e)),!(a<1||!o.a(e,void 0,void 0,l)))try{for(const i of m.readdirSync(e,{withFileTypes:!0})){let r=t.join(e,i.name);if(i.isSymbolicLink())if(s)r=m.realpathSync(r);else if(f&&o.a(r,n,c,l))yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:t.normalize(r)};else continue;i.isSymbolicLink()||i.isDirectory()?yield*d(r,{extensions:n,followSymlinks:s,includeDirs:u,includeFiles:S,includeSymlinks:f,match:c,maxDepth:a-1,skip:l}):i.isFile()&&S&&o.a(r,n,c,l)&&(yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:t.normalize(r)})}}catch(i){throw i instanceof p.i?i:new p.i(i,e)}}y(d,"h");b(d,"walkSync");exports.h=d;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var D=Object.defineProperty;var c=(e,o)=>D(e,"name",{value:o,configurable:!0});import{readdirSync as F,realpathSync as v,statSync as L}from"node:fs";import{resolve as w,join as x,normalize as a,basename as I}from"@visulima/path";import{toPath as g}from"@visulima/path/utils";import{i as k}from"./WalkError-CWKlhCA6.mjs";import{s as N}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";import{c as h,a as l}from"./walk-include-B-MbUqMt.mjs";var O=Object.defineProperty,b=c((e,o)=>O(e,"name",{value:o,configurable:!0}),"m");const P=b(e=>{const o=a(e),r=L(o);return{isDirectory:r.isDirectory,isFile:r.isFile,isSymbolicLink:r.isSymbolicLink,name:I(o),path:o}},"_createWalkEntry");function*u(e,{extensions:o,followSymlinks:r=!1,includeDirs:y=!0,includeFiles:f=!0,includeSymlinks:p=!0,match:d,maxDepth:m=Number.POSITIVE_INFINITY,skip:S}={}){if(N(e),m<0)return;const t=d?d.map(i=>typeof i=="string"?h(i):i):void 0,s=S?S.map(i=>typeof i=="string"?h(i):i):void 0;if(e=w(g(e)),y&&l(e,o,t,s)&&(yield P(e)),!(m<1||!l(e,void 0,void 0,s)))try{for(const i of F(e,{withFileTypes:!0})){let n=x(e,i.name);if(i.isSymbolicLink())if(r)n=v(n);else if(p&&l(n,o,t,s))yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:a(n)};else continue;i.isSymbolicLink()||i.isDirectory()?yield*u(n,{extensions:o,followSymlinks:r,includeDirs:y,includeFiles:f,includeSymlinks:p,match:t,maxDepth:m-1,skip:s}):i.isFile()&&f&&l(n,o,t,s)&&(yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:a(n)})}}catch(i){throw i instanceof k?i:new k(i,e)}}c(u,"h");b(u,"walkSync");export{u as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var c=(i,a)=>f(i,"name",{value:a,configurable:!0});import{mkdir as s,writeFile as p,stat as l,rename as w,chown as g,chmod as h,unlink as u}from"node:fs/promises";import{dirname as v}from"@visulima/path";import{toPath as $}from"@visulima/path/utils";import{F as d}from"./F_OK-BzMbdSs5.mjs";import{m as e}from"./isAccessible-BbChaABn.mjs";import{a as y}from"./assertValidFileContents-BTXEHdLD.mjs";import{s as F}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";import{a as k}from"./to-uint-8-array-DwgaTasY.mjs";var b=Object.defineProperty,O=c((i,a)=>b(i,"name",{value:a,configurable:!0}),"d");const B=O(async(i,a,t)=>{t={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...t},F(i),y(a),i=$(i);try{const o=await e(i,d);if(!o&&t.recursive){const n=v(i);await e(n,d)||await s(n,{recursive:!0})}let m;await p(`${i}.tmp`,k(a),{encoding:t.encoding,flag:t.flag}),o&&!t.overwrite&&(m=await l(i),t.chown===void 0&&(t.chown={gid:m.gid,uid:m.uid}),await w(i,`${i}.bak`));const r=`${i}.tmp`;if(t.chown)try{await g(r,t.chown.uid,t.chown.gid)}catch{}await h(r,m&&!t.mode?m.mode:t.mode??438),await w(r,i)}catch(o){throw new Error(`Failed to write file at: ${i} - ${o.message}`,{cause:o})}finally{await e(`${i}.tmp`)&&await u(`${i}.tmp`)}},"writeFile");export{B as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var u=Object.defineProperty;var w=(i,a)=>u(i,"name",{value:a,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("node:fs/promises"),l=require("@visulima/path"),m=require("@visulima/path/utils"),d=require("./F_OK-B8R_JA-Q.cjs"),c=require("./isAccessible-DxFHaxVe.cjs"),g=require("./assertValidFileContents-vTNSeAqn.cjs"),h=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs"),f=require("./to-uint-8-array-2-3EvGd7.cjs");var v=Object.defineProperty,y=w((i,a)=>v(i,"name",{value:a,configurable:!0}),"d");const p=y(async(i,a,t)=>{t={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...t},h.s(i),g.a(a),i=m.toPath(i);try{const r=await c.m(i,d.F_OK);if(!r&&t.recursive){const s=l.dirname(i);await c.m(s,d.F_OK)||await e.mkdir(s,{recursive:!0})}let o;await e.writeFile(`${i}.tmp`,f.a(a),{encoding:t.encoding,flag:t.flag}),r&&!t.overwrite&&(o=await e.stat(i),t.chown===void 0&&(t.chown={gid:o.gid,uid:o.uid}),await e.rename(i,`${i}.bak`));const n=`${i}.tmp`;if(t.chown)try{await e.chown(n,t.chown.uid,t.chown.gid)}catch{}await e.chmod(n,o&&!t.mode?o.mode:t.mode??438),await e.rename(n,i)}catch(r){throw new Error(`Failed to write file at: ${i} - ${r.message}`,{cause:r})}finally{await c.m(`${i}.tmp`)&&await e.unlink(`${i}.tmp`)}},"writeFile");exports.k=p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.defineProperty;var a=(o,t)=>s(o,"name",{value:t,configurable:!0});import{mkdirSync as p,writeFileSync as w,statSync as l,renameSync as f,chownSync as y,chmodSync as g,unlinkSync as h}from"node:fs";import{dirname as u}from"@visulima/path";import{toPath as $}from"@visulima/path/utils";import{F as d}from"./F_OK-BzMbdSs5.mjs";import{m as r}from"./isAccessibleSync-C3YjvkTe.mjs";import{a as v}from"./assertValidFileContents-BTXEHdLD.mjs";import{s as S}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";import{a as F}from"./to-uint-8-array-DwgaTasY.mjs";var k=Object.defineProperty,b=a((o,t)=>k(o,"name",{value:t,configurable:!0}),"f");const A=b((o,t,i)=>{i={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...i},S(o),v(t),o=$(o);try{const n=r(o,d);if(!n&&i.recursive){const e=u(o);r(e,d)||p(e,{recursive:!0})}let c;w(`${o}.tmp`,F(t),{encoding:i.encoding,flag:i.flag}),n&&!i.overwrite&&(c=l(o),i.chown===void 0&&(i.chown={gid:c.gid,uid:c.uid}),f(o,`${o}.bak`));const m=`${o}.tmp`;if(i.chown)try{y(m,i.chown.uid,i.chown.gid)}catch{}g(m,c&&!i.mode?c.mode:i.mode??438),f(m,o)}catch(n){throw new Error(`Failed to write file at: ${o} - ${n.message}`,{cause:n})}finally{r(`${o}.tmp`)&&h(`${o}.tmp`)}},"writeFileSync");export{A as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var l=Object.defineProperty;var d=(e,n)=>l(e,"name",{value:n,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("node:fs"),m=require("@visulima/path"),y=require("@visulima/path/utils"),u=require("./F_OK-B8R_JA-Q.cjs"),s=require("./isAccessibleSync-DtOcefUR.cjs"),w=require("./assertValidFileContents-vTNSeAqn.cjs"),f=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs"),g=require("./to-uint-8-array-2-3EvGd7.cjs");var h=Object.defineProperty,S=d((e,n)=>h(e,"name",{value:n,configurable:!0}),"f");const v=S((e,n,t)=>{t={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...t},f.s(e),w.a(n),e=y.toPath(e);try{const c=s.m(e,u.F_OK);if(!c&&t.recursive){const a=m.dirname(e);s.m(a,u.F_OK)||i.mkdirSync(a,{recursive:!0})}let o;i.writeFileSync(`${e}.tmp`,g.a(n),{encoding:t.encoding,flag:t.flag}),c&&!t.overwrite&&(o=i.statSync(e),t.chown===void 0&&(t.chown={gid:o.gid,uid:o.uid}),i.renameSync(e,`${e}.bak`));const r=`${e}.tmp`;if(t.chown)try{i.chownSync(r,t.chown.uid,t.chown.gid)}catch{}i.chmodSync(r,o&&!t.mode?o.mode:t.mode??438),i.renameSync(r,e)}catch(c){throw new Error(`Failed to write file at: ${e} - ${c.message}`,{cause:c})}finally{s.m(`${e}.tmp`)&&i.unlinkSync(`${e}.tmp`)}},"writeFileSync");exports.k=v;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var w=Object.defineProperty;var o=(t,e)=>w(t,"name",{value:e,configurable:!0});import{readFile as y}from"node:fs/promises";import{d as u}from"./index-VcQXVcaq.mjs";import{R as O}from"./F_OK-BzMbdSs5.mjs";import{m as g}from"./isAccessible-BbChaABn.mjs";import{k as h}from"./writeFile-BkHnZTWA.mjs";var v=Object.defineProperty,N=o((t,e)=>v(t,"name",{value:e,configurable:!0}),"r");const j=N(async(t,e,a={})=>{const{detectIndent:c,indent:f,replacer:d,stringify:m=JSON.stringify,...s}={indent:" ",...a};let r=f,i=`
|
|
2
|
+
`;if(await g(t,O))try{const n=await y(t,"utf8");if(c){const{indent:l}=u(n);r=l}i=n.endsWith(`
|
|
3
|
+
`)?`
|
|
4
|
+
`:""}catch(n){if(n.code!=="ENOENT")throw n}const p=m(e,d,r);await h(t,`${p}${i}`,s)},"writeJson");export{j as u};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";var y=Object.defineProperty;var c=(e,t)=>y(e,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("node:fs/promises"),b=require("./index-Cms6lU4T.cjs"),g=require("./F_OK-B8R_JA-Q.cjs"),m=require("./isAccessible-DxFHaxVe.cjs"),p=require("./writeFile-COembSIp.cjs");var q=Object.defineProperty,v=c((e,t)=>q(e,"name",{value:t,configurable:!0}),"r");const h=v(async(e,t,s={})=>{const{detectIndent:o,indent:a,replacer:d,stringify:u=JSON.stringify,...l}={indent:" ",...s};let i=a,r=`
|
|
2
|
+
`;if(await m.m(e,g.R_OK))try{const n=await O.readFile(e,"utf8");if(o){const{indent:w}=b.detectIndent(n);i=w}r=n.endsWith(`
|
|
3
|
+
`)?`
|
|
4
|
+
`:""}catch(n){if(n.code!=="ENOENT")throw n}const f=u(t,d,i);await p.k(e,`${f}${r}`,l)},"writeJson");exports.u=h;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var l=Object.defineProperty;var i=(t,e)=>l(t,"name",{value:e,configurable:!0});import{readFileSync as O}from"node:fs";import{d as N}from"./index-VcQXVcaq.mjs";import{R as g}from"./F_OK-BzMbdSs5.mjs";import{m as h}from"./isAccessibleSync-C3YjvkTe.mjs";import{k as u}from"./writeFileSync-6h8CQ9EO.mjs";var v=Object.defineProperty,S=i((t,e)=>v(t,"name",{value:e,configurable:!0}),"r");const R=S((t,e,c={})=>{const{detectIndent:f,indent:d,replacer:m,stringify:s=JSON.stringify,...a}={indent:" ",...c};let n=d,o=`
|
|
2
|
+
`;if(h(t,g))try{const r=O(t,"utf8");if(f){const{indent:y}=N(r);n=y}o=r.endsWith(`
|
|
3
|
+
`)?`
|
|
4
|
+
`:""}catch(r){if(r.code!=="ENOENT")throw r}const p=s(e,m,n);u(t,`${p}${o}`,a)},"writeJsonSync");export{R as N};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";var O=Object.defineProperty;var c=(e,t)=>O(e,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("node:fs"),b=require("./index-Cms6lU4T.cjs"),g=require("./F_OK-B8R_JA-Q.cjs"),q=require("./isAccessibleSync-DtOcefUR.cjs"),N=require("./writeFileSync-C3D5fvZf.cjs");var m=Object.defineProperty,p=c((e,t)=>m(e,"name",{value:t,configurable:!0}),"r");const v=p((e,t,o={})=>{const{detectIndent:s,indent:d,replacer:f,stringify:l=JSON.stringify,...u}={indent:" ",...o};let r=d,i=`
|
|
2
|
+
`;if(q.m(e,g.R_OK))try{const n=S.readFileSync(e,"utf8");if(s){const{indent:a}=b.detectIndent(n);r=a}i=n.endsWith(`
|
|
3
|
+
`)?`
|
|
4
|
+
`:""}catch(n){if(n.code!=="ENOENT")throw n}const y=l(t,f,r);N.k(e,`${y}${i}`,u)},"writeJsonSync");exports.N=v;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=Object.defineProperty;var o=(a,r)=>i(a,"name",{value:r,configurable:!0});import{stringify as t}from"yaml";import{k as m}from"./writeFile-BkHnZTWA.mjs";var c=Object.defineProperty,y=o((a,r)=>c(a,"name",{value:r,configurable:!0}),"n");async function p(a,r,n,e){const f=typeof n=="function"||Array.isArray(n)?t(r,n,e):t(r,n);await m(a,f)}o(p,"m");y(p,"writeYaml");export{p as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var y=Object.defineProperty;var n=(r,e)=>y(r,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("yaml"),s=require("./writeFile-COembSIp.cjs");var u=Object.defineProperty,f=n((r,e)=>u(r,"name",{value:e,configurable:!0}),"n");async function i(r,e,t,o){const c=typeof t=="function"||Array.isArray(t)?a.stringify(e,t,o):a.stringify(e,t);await s.k(r,c)}n(i,"m");f(i,"writeYaml");exports.m=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var m=Object.defineProperty;var e=(i,r)=>m(i,"name",{value:r,configurable:!0});import{stringify as t}from"yaml";import{k as n}from"./writeFileSync-6h8CQ9EO.mjs";var c=Object.defineProperty,y=e((i,r)=>c(i,"name",{value:r,configurable:!0}),"i");function p(i,r,o,a){const f=typeof o=="function"||Array.isArray(o)?t(r,o,a):t(r,o);n(i,f)}e(p,"m");y(p,"writeYamlSync");export{p as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var y=Object.defineProperty;var t=(r,e)=>y(r,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("yaml"),s=require("./writeFileSync-C3D5fvZf.cjs");var u=Object.defineProperty,f=t((r,e)=>u(r,"name",{value:e,configurable:!0}),"i");function o(r,e,i,a){const c=typeof i=="function"||Array.isArray(i)?n.stringify(e,i,a):n.stringify(e,i);s.k(r,c)}t(o,"m");f(o,"writeYamlSync");exports.m=o;
|
package/dist/utils.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./shared/JSONError-BywLDEj4.cjs"),e=require("./shared/assertValidFileContents-vTNSeAqn.cjs"),t=require("./shared/assertValidFileOrDirectoryPath-BT5xYqBy.cjs"),s=require("./shared/parseJson-IY63B_0y.cjs"),o=require("./shared/stripJsonComments-BuOddwNE.cjs"),i=require("@visulima/path/utils");exports.JSONError=r.r;exports.assertValidFileContents=e.a;exports.assertValidFileOrDirectoryPath=t.s;exports.parseJson=s.F;exports.stripJsonComments=o.i;exports.toPath=i.toPath;
|
package/dist/utils.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { J as JSONError } from './shared/
|
|
2
|
-
import { J as JsonValue, o as CodeFrameOptions, c as JsonReviver } from './shared/
|
|
1
|
+
export { J as JSONError } from './shared/json-error-ZPgZIXcg.cjs';
|
|
2
|
+
import { J as JsonValue, o as CodeFrameOptions, c as JsonReviver } from './shared/observable-like.d-CpT5ICZl.cjs';
|
|
3
3
|
export { toPath } from '@visulima/path/utils';
|
|
4
4
|
import 'node:fs';
|
|
5
5
|
import 'yaml';
|
package/dist/utils.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { J as JSONError } from './shared/
|
|
2
|
-
import { J as JsonValue, o as CodeFrameOptions, c as JsonReviver } from './shared/
|
|
1
|
+
export { J as JSONError } from './shared/json-error-ZPgZIXcg.mjs';
|
|
2
|
+
import { J as JsonValue, o as CodeFrameOptions, c as JsonReviver } from './shared/observable-like.d-CpT5ICZl.mjs';
|
|
3
3
|
export { toPath } from '@visulima/path/utils';
|
|
4
4
|
import 'node:fs';
|
|
5
5
|
import 'yaml';
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { J as JSONError } from './shared/
|
|
2
|
-
import { J as JsonValue, o as CodeFrameOptions, c as JsonReviver } from './shared/
|
|
1
|
+
export { J as JSONError } from './shared/json-error-ZPgZIXcg.d.mjs';
|
|
2
|
+
import { J as JsonValue, o as CodeFrameOptions, c as JsonReviver } from './shared/observable-like.d-CpT5ICZl.d.mjs';
|
|
3
3
|
export { toPath } from '@visulima/path/utils';
|
|
4
4
|
import 'node:fs';
|
|
5
5
|
import 'yaml';
|
package/dist/utils.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{r as s}from"./shared/JSONError-BwfyCaRr.mjs";import{a as e}from"./shared/assertValidFileContents-BTXEHdLD.mjs";import{s as m}from"./shared/assertValidFileOrDirectoryPath-CQmKNf2h.mjs";import{F as i}from"./shared/parseJson-DjId4v2J.mjs";import{i as x}from"./shared/stripJsonComments-DtqWH5Xl.mjs";import{toPath as l}from"@visulima/path/utils";export{s as JSONError,e as assertValidFileContents,m as assertValidFileOrDirectoryPath,i as parseJson,x as stripJsonComments,l as toPath};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/fs",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.14",
|
|
4
4
|
"description": "Human friendly file system utilities for Node.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"LICENSE.md"
|
|
117
117
|
],
|
|
118
118
|
"dependencies": {
|
|
119
|
-
"@visulima/path": "1.0.
|
|
119
|
+
"@visulima/path": "1.0.5"
|
|
120
120
|
},
|
|
121
121
|
"devDependencies": {
|
|
122
122
|
"@anolilab/eslint-config": "^15.0.3",
|
|
@@ -126,8 +126,8 @@
|
|
|
126
126
|
"@babel/core": "^7.25.2",
|
|
127
127
|
"@rushstack/eslint-plugin-security": "^0.8.2",
|
|
128
128
|
"@types/node": "18.19.15",
|
|
129
|
-
"@visulima/error": "4.4.
|
|
130
|
-
"@visulima/packem": "^1.0.0-alpha.
|
|
129
|
+
"@visulima/error": "4.4.1",
|
|
130
|
+
"@visulima/packem": "^1.0.0-alpha.86",
|
|
131
131
|
"@vitest/coverage-v8": "^2.0.5",
|
|
132
132
|
"@vitest/ui": "^2.0.5",
|
|
133
133
|
"conventional-changelog-conventionalcommits": "8.0.0",
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
"safe-regex2": "^4.0.0",
|
|
149
149
|
"semantic-release": "24.0.0",
|
|
150
150
|
"tempy": "^3.1.0",
|
|
151
|
-
"type-fest": "^4.
|
|
151
|
+
"type-fest": "^4.26.0",
|
|
152
152
|
"typescript": "5.4.5",
|
|
153
153
|
"vitest": "^2.0.5",
|
|
154
154
|
"yaml": "^2.5.0"
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var t=(r,e)=>a(r,"name",{value:e,configurable:!0});var i=Object.defineProperty,c=t((r,e)=>i(r,"name",{value:e,configurable:!0}),"i");class s extends Error{static{t(this,"r")}static{c(this,"JSONError")}fileName;codeFrame;name="JSONError";#e;constructor(e){super(),this.#e=e,Error.captureStackTrace(this,s)}get message(){return`${this.#e}${this.fileName?` in ${this.fileName}`:""}${this.codeFrame?`
|
|
2
|
-
|
|
3
|
-
${this.codeFrame}
|
|
4
|
-
`:""}`}set message(e){this.#e=e}}const o=s;exports.c=o;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var n=Object.defineProperty;var t=(e,r)=>n(e,"name",{value:r,configurable:!0});var s=Object.defineProperty,a=t((e,r)=>s(e,"name",{value:r,configurable:!0}),"t$2");let E=class extends Error{static{t(this,"n")}static{a(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")}};const v=E;var i=Object.defineProperty,c=t((e,r)=>i(e,"name",{value:r,configurable:!0}),"o");let l=class extends Error{static{t(this,"n")}static{c(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")}};const h=l;var u=Object.defineProperty,m=t((e,r)=>u(e,"name",{value:r,configurable:!0}),"t");class p extends Error{static{t(this,"i")}static{m(this,"WalkError")}root;constructor(r,o){super(`${r instanceof Error?r.message:r} for path "${o}"`),this.cause=r,this.root=o}get name(){return"WalkError"}set name(r){throw new Error("Cannot overwrite name of WalkError")}}export{p as i,v as l,h as s};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
var C=Object.defineProperty;var m=(e,t)=>C(e,"name",{value:t,configurable:!0});import{c as T}from"./fs.BXbumRuI.mjs";var B=Object.defineProperty,W=m((e,t)=>B(e,"name",{value:t,configurable:!0}),"n");const ue=W(e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")},"assertValidFileOrDirectoryPath");var E=Object.defineProperty,$=m((e,t)=>E(e,"name",{value:t,configurable:!0}),"v$1"),M=Object.defineProperty,U=$((e,t)=>M(e,"name",{value:t,configurable:!0}),"r$1");const I=U(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
2
|
-
`),"normalizeLF"),J=globalThis.process||Object.create(null),j={versions:{}},O=new Proxy(J,{get(e,t){if(t in e)return e[t];if(t in j)return j[t]}});var V=Object.defineProperty,q=$((e,t)=>V(e,"name",{value:t,configurable:!0}),"b");const G=q((e,t,o,n)=>{const r={column:0,line:-1,...e.start},i={...r,...e.end},l=r.line,s=r.column,g=i.line,p=i.column;let b=Math.max(l-(o+1),0),y=Math.min(t.length,g+n);l===-1&&(b=0),g===-1&&(y=t.length);const d=g-l,c={};if(d)for(let a=0;a<=d;a++){const u=a+l;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===d)c[u]=[0,p];else{const f=t[u-a]?.length;c[u]=[0,f]}}else s===p?c[l]=s?[s,0]:!0:c[l]=[s,(p??0)-(s??0)];return{end:y,markerLines:c,start:b}},"getMarkerLines");var R=Object.defineProperty,A=$((e,t)=>R(e,"name",{value:t,configurable:!0}),"o");const _=O.platform==="win32"&&!O.env?.WT_SESSION?">":"❯",z=A((e,t,o)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...o,color:{gutter:A(a=>a,"gutter"),marker:A(a=>a,"marker"),message:A(a=>a,"message"),...o?.color}},r=t.start&&typeof t.start.column=="number";let i=I(e).split(`
|
|
3
|
-
`);typeof n?.tabWidth=="number"&&(i=i.map(a=>a.replaceAll(" "," ".repeat(n.tabWidth))));const{end:l,markerLines:s,start:g}=G(t,i,n.linesAbove,n.linesBelow),p=String(l).length,{gutter:b,marker:y,message:d}=n.color;let c=i.slice(g,l).map((a,u)=>{const f=g+1+u,v=s[f],L=(" "+f).slice(-p),S=!s[f+1],w=" "+L+(n.showGutter?" |":"");if(v){let x="";if(Array.isArray(v)){const F=a.replaceAll(/[^\t]/g," ").slice(0,Math.max(v[0]-1,0)),N=v[1]||1;x=[`
|
|
4
|
-
`,n.prefix+b(w.replaceAll(/\d/g," "))," ",F,y("^").repeat(N)].join(""),S&&n.message&&(x+=` ${d(n.message)}`)}return[n.prefix+y(_),b(w),a.length>0?" "+a:"",x].join("")}return n.prefix+" "+b(w)+(a.length>0?" "+a:"")}).join(`
|
|
5
|
-
`);return n.message&&!r&&(c=n.prefix+" ".repeat(p+1)+n.message+`
|
|
6
|
-
`+c),c},"codeFrame");var D=Object.defineProperty,H=m((e,t)=>D(e,"name",{value:t,configurable:!0}),"l$1"),K=Object.defineProperty,P=H((e,t)=>K(e,"name",{value:t,configurable:!0}),"l");const k=P((e,t)=>{let o=0,n=t.length-2;for(;o<n;){const r=o+(n-o>>1);if(e<t[r])n=r-1;else if(e>=t[r+1])o=r+1;else{o=r;break}}return o},"binarySearch"),Q=P(e=>e.split(/\n|\r(?!\n)/).reduce((t,o)=>(t.push(t.at(-1)+o.length+1),t),[0]),"getLineStartIndexes"),X=P((e,t,o)=>{const n=o?.skipChecks??!1;if(!n&&(!Array.isArray(e)&&typeof e!="string"||(typeof e=="string"||Array.isArray(e))&&e.length===0))return{column:0,line:0};if(!n&&(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 i=Q(e),l=k(t,i);return{column:t-i[l]+1,line:l+1}}const r=k(t,e);return{column:t-e[r]+1,line:r+1}},"indexToLineColumn"),Y=X;var Z=Object.defineProperty,h=m((e,t)=>Z(e,"name",{value:t,configurable:!0}),"s");const ee=h(e=>`\\u{${e.codePointAt(0).toString(16)}}`,"getCodePoint"),te=h((e,t,o)=>z(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:n,index:r,line:i}=o.groups;return i&&n?{column:Number(n),line:Number(i)}:(r=Number(r),r===e.length&&(r=e.length-1),Y(e,r))},"getErrorLocation"),re=h(e=>e.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(t,o,n)=>`"${n}"(${ee(n)})`),"addCodePointToUnexpectedToken");function oe(e,t,o,n){typeof t=="string"&&(typeof o=="object"&&(n=o),o=t,t=void 0);let r;try{return JSON.parse(e,t)}catch(s){r=s.message}let i;e?(i=ne(e,r),r=re(r)):r+=" while parsing empty string";const l=new T(r);throw l.fileName=o,i&&(l.codeFrame=te(e,i,n)),l}m(oe,"F");h(oe,"parseJson");var ae=Object.defineProperty,ie=m((e,t)=>ae(e,"name",{value:t,configurable:!0}),"e");const le=ie(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"),fe=le;export{oe as F,ue as s,fe as v};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var n=Object.defineProperty;var t=(e,r)=>n(e,"name",{value:r,configurable:!0});var s=Object.defineProperty,a=t((e,r)=>s(e,"name",{value:r,configurable:!0}),"t$2");let i=class extends Error{static{t(this,"n")}static{a(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")}};const E=i;var c=Object.defineProperty,l=t((e,r)=>c(e,"name",{value:r,configurable:!0}),"o");let u=class extends Error{static{t(this,"n")}static{l(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")}};const m=u;var d=Object.defineProperty,w=t((e,r)=>d(e,"name",{value:r,configurable:!0}),"t");class v extends Error{static{t(this,"i")}static{w(this,"WalkError")}root;constructor(r,o){super(`${r instanceof Error?r.message:r} for path "${o}"`),this.cause=r,this.root=o}get name(){return"WalkError"}set name(r){throw new Error("Cannot overwrite name of WalkError")}}exports.i=v;exports.l=E;exports.s=m;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";var T=Object.defineProperty;var m=(e,r)=>T(e,"name",{value:r,configurable:!0});const B=require("./fs.BLXmkvbT.cjs");var E=Object.defineProperty,W=m((e,r)=>E(e,"name",{value:r,configurable:!0}),"n");const M=W(e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")},"assertValidFileOrDirectoryPath");var U=Object.defineProperty,x=m((e,r)=>U(e,"name",{value:r,configurable:!0}),"v$1"),q=Object.defineProperty,I=x((e,r)=>q(e,"name",{value:r,configurable:!0}),"r$1");const J=I(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
2
|
-
`),"normalizeLF"),V=globalThis.process||Object.create(null),$={versions:{}},O=new Proxy(V,{get(e,r){if(r in e)return e[r];if(r in $)return $[r]}});var G=Object.defineProperty,R=x((e,r)=>G(e,"name",{value:r,configurable:!0}),"b");const _=R((e,r,o,t)=>{const n={column:0,line:-1,...e.start},a={...n,...e.end},s=n.line,l=n.column,g=a.line,p=a.column;let b=Math.max(s-(o+1),0),y=Math.min(r.length,g+t);s===-1&&(b=0),g===-1&&(y=r.length);const d=g-s,c={};if(d)for(let i=0;i<=d;i++){const u=i+s;if(!l)c[u]=!0;else if(i===0){const f=r[u-1]?.length;c[u]=[l,(f??0)-l+1]}else if(i===d)c[u]=[0,p];else{const f=r[u-i]?.length;c[u]=[0,f]}}else l===p?c[s]=l?[l,0]:!0:c[s]=[l,(p??0)-(l??0)];return{end:y,markerLines:c,start:b}},"getMarkerLines");var z=Object.defineProperty,A=x((e,r)=>z(e,"name",{value:r,configurable:!0}),"o");const D=O.platform==="win32"&&!O.env?.WT_SESSION?">":"❯",H=A((e,r,o)=>{const t={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...o,color:{gutter:A(i=>i,"gutter"),marker:A(i=>i,"marker"),message:A(i=>i,"message"),...o?.color}},n=r.start&&typeof r.start.column=="number";let a=J(e).split(`
|
|
3
|
-
`);typeof t?.tabWidth=="number"&&(a=a.map(i=>i.replaceAll(" "," ".repeat(t.tabWidth))));const{end:s,markerLines:l,start:g}=_(r,a,t.linesAbove,t.linesBelow),p=String(s).length,{gutter:b,marker:y,message:d}=t.color;let c=a.slice(g,s).map((i,u)=>{const f=g+1+u,v=l[f],F=(" "+f).slice(-p),S=!l[f+1],w=" "+F+(t.showGutter?" |":"");if(v){let j="";if(Array.isArray(v)){const N=i.replaceAll(/[^\t]/g," ").slice(0,Math.max(v[0]-1,0)),C=v[1]||1;j=[`
|
|
4
|
-
`,t.prefix+b(w.replaceAll(/\d/g," "))," ",N,y("^").repeat(C)].join(""),S&&t.message&&(j+=` ${d(t.message)}`)}return[t.prefix+y(D),b(w),i.length>0?" "+i:"",j].join("")}return t.prefix+" "+b(w)+(i.length>0?" "+i:"")}).join(`
|
|
5
|
-
`);return t.message&&!n&&(c=t.prefix+" ".repeat(p+1)+t.message+`
|
|
6
|
-
`+c),c},"codeFrame");var K=Object.defineProperty,Q=m((e,r)=>K(e,"name",{value:r,configurable:!0}),"l$1"),X=Object.defineProperty,P=Q((e,r)=>X(e,"name",{value:r,configurable:!0}),"l");const k=P((e,r)=>{let o=0,t=r.length-2;for(;o<t;){const n=o+(t-o>>1);if(e<r[n])t=n-1;else if(e>=r[n+1])o=n+1;else{o=n;break}}return o},"binarySearch"),Y=P(e=>e.split(/\n|\r(?!\n)/).reduce((r,o)=>(r.push(r.at(-1)+o.length+1),r),[0]),"getLineStartIndexes"),Z=P((e,r,o)=>{const t=o?.skipChecks??!1;if(!t&&(!Array.isArray(e)&&typeof e!="string"||(typeof e=="string"||Array.isArray(e))&&e.length===0))return{column:0,line:0};if(!t&&(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 a=Y(e),s=k(r,a);return{column:r-a[s]+1,line:s+1}}const n=k(r,e);return{column:r-e[n]+1,line:n+1}},"indexToLineColumn"),ee=Z;var re=Object.defineProperty,h=m((e,r)=>re(e,"name",{value:r,configurable:!0}),"s");const te=h(e=>`\\u{${e.codePointAt(0).toString(16)}}`,"getCodePoint"),ne=h((e,r,o)=>H(e,{start:r},{tabWidth:!1,...o}),"generateCodeFrame"),oe=h((e,r)=>{const o=/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/.exec(r);if(!o)return;let{column:t,index:n,line:a}=o.groups;return a&&t?{column:Number(t),line:Number(a)}:(n=Number(n),n===e.length&&(n=e.length-1),ee(e,n))},"getErrorLocation"),ie=h(e=>e.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(r,o,t)=>`"${t}"(${te(t)})`),"addCodePointToUnexpectedToken");function L(e,r,o,t){typeof r=="string"&&(typeof o=="object"&&(t=o),o=r,r=void 0);let n;try{return JSON.parse(e,r)}catch(l){n=l.message}let a;e?(a=oe(e,n),n=ie(n)):n+=" while parsing empty string";const s=new B.c(n);throw s.fileName=o,a&&(s.codeFrame=ne(e,a,t)),s}m(L,"F");h(L,"parseJson");var ae=Object.defineProperty,se=m((e,r)=>ae(e,"name",{value:r,configurable:!0}),"e");const le=se(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"),ce=le;exports.F=L;exports.s=M;exports.v=ce;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|