@visulima/fs 2.1.14 → 2.1.15
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 +20 -0
- package/LICENSE.md +16 -16
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/parseJson-D_udZACk.cjs +6 -0
- package/dist/shared/parseJson-pshz9KrK.mjs +6 -0
- package/dist/shared/{readJson-hlujfMhv.mjs → readJson-BLlsJf8v.mjs} +1 -1
- package/dist/shared/{readJson-BpngPb-8.cjs → readJson-BmoR7jqx.cjs} +1 -1
- package/dist/shared/{readJsonSync-DTRTDPzu.cjs → readJsonSync-C4lPifQR.cjs} +1 -1
- package/dist/shared/{readJsonSync-C1vainhA.mjs → readJsonSync-D4CNs2Oh.mjs} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.mjs +1 -1
- package/package.json +20 -6
- package/dist/shared/parseJson-DjId4v2J.mjs +0 -6
- package/dist/shared/parseJson-IY63B_0y.cjs +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## @visulima/fs [2.1.15](https://github.com/visulima/visulima/compare/@visulima/fs@2.1.14...@visulima/fs@2.1.15) (2024-09-07)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* added types support for node10 ([604583f](https://github.com/visulima/visulima/commit/604583fa3c24b950fafad45d17e7a1333040fd76))
|
|
6
|
+
|
|
7
|
+
### Styles
|
|
8
|
+
|
|
9
|
+
* cs fixes ([f5c4af7](https://github.com/visulima/visulima/commit/f5c4af7cfa9fc79b6d3fa60c1e48d88bffab5a08))
|
|
10
|
+
|
|
11
|
+
### Miscellaneous Chores
|
|
12
|
+
|
|
13
|
+
* update dev dependencies ([0738f98](https://github.com/visulima/visulima/commit/0738f9810478bb215ce4b2571dc8874c4c503089))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Dependencies
|
|
17
|
+
|
|
18
|
+
* **@visulima/path:** upgraded to 1.0.6
|
|
19
|
+
* **@visulima/error:** upgraded to 4.4.2
|
|
20
|
+
|
|
1
21
|
## @visulima/fs [2.1.14](https://github.com/visulima/visulima/compare/@visulima/fs@2.1.13...@visulima/fs@2.1.14) (2024-08-30)
|
|
2
22
|
|
|
3
23
|
### Bug Fixes
|
package/LICENSE.md
CHANGED
|
@@ -67,13 +67,13 @@ Repository: https://github.com/visulima/visulima.git
|
|
|
67
67
|
> Repository: sindresorhus/is-plain-obj
|
|
68
68
|
>
|
|
69
69
|
> > MIT License
|
|
70
|
-
> >
|
|
70
|
+
> >
|
|
71
71
|
> > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
72
|
-
> >
|
|
72
|
+
> >
|
|
73
73
|
> > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
74
|
-
> >
|
|
74
|
+
> >
|
|
75
75
|
> > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
76
|
-
> >
|
|
76
|
+
> >
|
|
77
77
|
> > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
78
78
|
|
|
79
79
|
---------------------------------------
|
|
@@ -165,13 +165,13 @@ Repository: https://github.com/visulima/visulima.git
|
|
|
165
165
|
> Repository: sindresorhus/is-plain-obj
|
|
166
166
|
>
|
|
167
167
|
> > MIT License
|
|
168
|
-
> >
|
|
168
|
+
> >
|
|
169
169
|
> > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
170
|
-
> >
|
|
170
|
+
> >
|
|
171
171
|
> > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
172
|
-
> >
|
|
172
|
+
> >
|
|
173
173
|
> > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
174
|
-
> >
|
|
174
|
+
> >
|
|
175
175
|
> > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
176
176
|
|
|
177
177
|
---------------------------------------
|
|
@@ -263,13 +263,13 @@ Repository: https://github.com/visulima/visulima.git
|
|
|
263
263
|
> Repository: sindresorhus/is-plain-obj
|
|
264
264
|
>
|
|
265
265
|
> > MIT License
|
|
266
|
-
> >
|
|
266
|
+
> >
|
|
267
267
|
> > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
268
|
-
> >
|
|
268
|
+
> >
|
|
269
269
|
> > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
270
|
-
> >
|
|
270
|
+
> >
|
|
271
271
|
> > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
272
|
-
> >
|
|
272
|
+
> >
|
|
273
273
|
> > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
274
274
|
|
|
275
275
|
---------------------------------------
|
|
@@ -361,13 +361,13 @@ Repository: https://github.com/visulima/visulima.git
|
|
|
361
361
|
> Repository: sindresorhus/is-plain-obj
|
|
362
362
|
>
|
|
363
363
|
> > MIT License
|
|
364
|
-
> >
|
|
364
|
+
> >
|
|
365
365
|
> > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
366
|
-
> >
|
|
366
|
+
> >
|
|
367
367
|
> > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
368
|
-
> >
|
|
368
|
+
> >
|
|
369
369
|
> > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
370
|
-
> >
|
|
370
|
+
> >
|
|
371
371
|
> > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
372
372
|
|
|
373
373
|
---------------------------------------
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/F_OK-B8R_JA-Q.cjs"),n=require("./shared/ensureDir-tKW3dSA0.cjs"),i=require("./shared/ensureDirSync-DzJ1sUTo.cjs"),c=require("./shared/ensureFile-C4MogFm1.cjs"),s=require("./shared/ensureFileSync-BXhhrF2q.cjs"),t=require("./shared/ensureLink-DY7IQxZ4.cjs"),o=require("./shared/ensureLinkSync-DJpt1OVV.cjs"),u=require("./shared/ensureSymlink-D6VKdTBJ.cjs"),y=require("./shared/ensureSymlinkSync-DWIrsihx.cjs"),r=require("./shared/LF-D4BqIfQm.cjs"),l=require("./shared/collect-DwzKTfA1.cjs"),S=require("./shared/collectSync-D-h8vph4.cjs"),q=require("./shared/findUp-BVECzzpO.cjs"),a=require("./shared/findUpSync-vnrRIw6w.cjs"),m=require("./shared/walk-kHxIkAkJ.cjs"),F=require("./shared/walkSync-BLhXIHWn.cjs"),d=require("./shared/isAccessible-DxFHaxVe.cjs"),w=require("./shared/isAccessibleSync-DtOcefUR.cjs"),k=require("./shared/readFile-DBC_s-48.cjs"),O=require("./shared/readFileSync-CBzoyWtz.cjs"),_=require("./shared/readJson-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/F_OK-B8R_JA-Q.cjs"),n=require("./shared/ensureDir-tKW3dSA0.cjs"),i=require("./shared/ensureDirSync-DzJ1sUTo.cjs"),c=require("./shared/ensureFile-C4MogFm1.cjs"),s=require("./shared/ensureFileSync-BXhhrF2q.cjs"),t=require("./shared/ensureLink-DY7IQxZ4.cjs"),o=require("./shared/ensureLinkSync-DJpt1OVV.cjs"),u=require("./shared/ensureSymlink-D6VKdTBJ.cjs"),y=require("./shared/ensureSymlinkSync-DWIrsihx.cjs"),r=require("./shared/LF-D4BqIfQm.cjs"),l=require("./shared/collect-DwzKTfA1.cjs"),S=require("./shared/collectSync-D-h8vph4.cjs"),q=require("./shared/findUp-BVECzzpO.cjs"),a=require("./shared/findUpSync-vnrRIw6w.cjs"),m=require("./shared/walk-kHxIkAkJ.cjs"),F=require("./shared/walkSync-BLhXIHWn.cjs"),d=require("./shared/isAccessible-DxFHaxVe.cjs"),w=require("./shared/isAccessibleSync-DtOcefUR.cjs"),k=require("./shared/readFile-DBC_s-48.cjs"),O=require("./shared/readFileSync-CBzoyWtz.cjs"),_=require("./shared/readJson-BmoR7jqx.cjs"),L=require("./shared/readJsonSync-C4lPifQR.cjs"),D=require("./shared/readYaml-jKVEYXs2.cjs"),f=require("./shared/readYamlSync-C73N6_GL.cjs"),p=require("./shared/emptyDir-Ddqlcb6Q.cjs"),J=require("./shared/emptyDirSync-DqizscgL.cjs"),K=require("./shared/remove-D67tECRM.cjs"),Y=require("./shared/removeSync-womNIl-8.cjs"),R=require("./shared/writeFile-COembSIp.cjs"),b=require("./shared/writeFileSync-C3D5fvZf.cjs"),U=require("./shared/writeJson-rHdXUJ9n.cjs"),v=require("./shared/writeJsonSync-C7xU8DX6.cjs"),P=require("./shared/writeYaml-BnD26RjE.cjs"),A=require("./shared/writeYamlSync-BS0MBjJo.cjs");exports.FIND_UP_STOP=e.FIND_UP_STOP;exports.F_OK=e.F_OK;exports.R_OK=e.R_OK;exports.W_OK=e.W_OK;exports.X_OK=e.X_OK;exports.ensureDir=n.f;exports.ensureDirSync=i.a;exports.ensureFile=c.f;exports.ensureFileSync=s.y;exports.ensureLink=t.y;exports.ensureLinkSync=o.h;exports.ensureSymlink=u.R;exports.ensureSymlinkSync=y.R;exports.CRLF=r.CRLF;exports.EOL=r.EOL;exports.LF=r.LF;exports.detect=r.detect;exports.format=r.format;exports.collect=l.a;exports.collectSync=S.c;exports.findUp=q.F;exports.findUpSync=a.F;exports.walk=m.d;exports.walkSync=F.h;exports.isAccessible=d.m;exports.isAccessibleSync=w.m;exports.readFile=k.R;exports.readFileSync=O.g;exports.readJson=_.c;exports.readJsonSync=L.J;exports.readYaml=D.d;exports.readYamlSync=f.d;exports.emptyDir=p.y;exports.emptyDirSync=J.u;exports.remove=K.y;exports.removeSync=Y.m;exports.writeFile=R.k;exports.writeFileSync=b.k;exports.writeJson=U.u;exports.writeJsonSync=v.N;exports.writeYaml=P.m;exports.writeYamlSync=A.m;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o,F as s,R as a,W as m,X as t}from"./shared/F_OK-BzMbdSs5.mjs";import{f as p}from"./shared/ensureDir-CpMWmVZ0.mjs";import{a as x}from"./shared/ensureDirSync-hyBJv3ax.mjs";import{f as i}from"./shared/ensureFile-b-ST2MTk.mjs";import{y as l}from"./shared/ensureFileSync-ClzIyiYf.mjs";import{y as d}from"./shared/ensureLink-CHQqG8z2.mjs";import{h as u}from"./shared/ensureLinkSync-Cq1cPBbo.mjs";import{R as w}from"./shared/ensureSymlink-CMtb3oPM.mjs";import{R as O}from"./shared/ensureSymlinkSync-DRDE5so4.mjs";import{C as _,E as D,L as J,d as K,f as Y}from"./shared/LF-DwWQ8GdI.mjs";import{a as b}from"./shared/collect-B2KdWG6-.mjs";import{c as v}from"./shared/collectSync-BMKZmoZR.mjs";import{F as C}from"./shared/findUp-COYH0Ul9.mjs";import{F as N}from"./shared/findUpSync-nA9H0jZj.mjs";import{d as W}from"./shared/walk-DO_o7eRl.mjs";import{h as g}from"./shared/walkSync-C5uWmu9Q.mjs";import{m as T}from"./shared/isAccessible-BbChaABn.mjs";import{m as q}from"./shared/isAccessibleSync-C3YjvkTe.mjs";import{R as B}from"./shared/readFile-BvgGZivd.mjs";import{g as H}from"./shared/readFileSync-C2bxnV-R.mjs";import{c as Q}from"./shared/readJson-
|
|
1
|
+
import{a as o,F as s,R as a,W as m,X as t}from"./shared/F_OK-BzMbdSs5.mjs";import{f as p}from"./shared/ensureDir-CpMWmVZ0.mjs";import{a as x}from"./shared/ensureDirSync-hyBJv3ax.mjs";import{f as i}from"./shared/ensureFile-b-ST2MTk.mjs";import{y as l}from"./shared/ensureFileSync-ClzIyiYf.mjs";import{y as d}from"./shared/ensureLink-CHQqG8z2.mjs";import{h as u}from"./shared/ensureLinkSync-Cq1cPBbo.mjs";import{R as w}from"./shared/ensureSymlink-CMtb3oPM.mjs";import{R as O}from"./shared/ensureSymlinkSync-DRDE5so4.mjs";import{C as _,E as D,L as J,d as K,f as Y}from"./shared/LF-DwWQ8GdI.mjs";import{a as b}from"./shared/collect-B2KdWG6-.mjs";import{c as v}from"./shared/collectSync-BMKZmoZR.mjs";import{F as C}from"./shared/findUp-COYH0Ul9.mjs";import{F as N}from"./shared/findUpSync-nA9H0jZj.mjs";import{d as W}from"./shared/walk-DO_o7eRl.mjs";import{h as g}from"./shared/walkSync-C5uWmu9Q.mjs";import{m as T}from"./shared/isAccessible-BbChaABn.mjs";import{m as q}from"./shared/isAccessibleSync-C3YjvkTe.mjs";import{R as B}from"./shared/readFile-BvgGZivd.mjs";import{g as H}from"./shared/readFileSync-C2bxnV-R.mjs";import{c as Q}from"./shared/readJson-BLlsJf8v.mjs";import{J as Z}from"./shared/readJsonSync-D4CNs2Oh.mjs";import{d as rr}from"./shared/readYaml-Cm-6prFv.mjs";import{d as or}from"./shared/readYamlSync-DgaclC7K.mjs";import{y as ar}from"./shared/emptyDir-BkedPAhT.mjs";import{u as tr}from"./shared/emptyDirSync-Cp_8wgUR.mjs";import{y as pr}from"./shared/remove-DbvVKBUa.mjs";import{m as xr}from"./shared/removeSync-Ngu7GWsH.mjs";import{k as ir}from"./shared/writeFile-BkHnZTWA.mjs";import{k as lr}from"./shared/writeFileSync-6h8CQ9EO.mjs";import{u as dr}from"./shared/writeJson-C8i3IALv.mjs";import{N as ur}from"./shared/writeJsonSync-BVBRbGPP.mjs";import{m as wr}from"./shared/writeYaml-BG-a4bX4.mjs";import{m as Or}from"./shared/writeYamlSync-BEUPvAyj.mjs";export{_ as CRLF,D as EOL,o as FIND_UP_STOP,s as F_OK,J as LF,a as R_OK,m as W_OK,t as X_OK,b as collect,v as collectSync,K as detect,ar as emptyDir,tr as emptyDirSync,p as ensureDir,x as ensureDirSync,i as ensureFile,l as ensureFileSync,d as ensureLink,u as ensureLinkSync,w as ensureSymlink,O as ensureSymlinkSync,C as findUp,N as findUpSync,Y as format,T as isAccessible,q as isAccessibleSync,B as readFile,H as readFileSync,Q as readJson,Z as readJsonSync,rr as readYaml,or as readYamlSync,pr as remove,xr as removeSync,W as walk,g as walkSync,ir as writeFile,lr as writeFileSync,dr as writeJson,ur as writeJsonSync,wr as writeYaml,Or as writeYamlSync};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";var T=Object.defineProperty;var y=(e,r)=>T(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./JSONError-BywLDEj4.cjs");var W=Object.defineProperty,O=y((e,r)=>W(e,"name",{value:r,configurable:!0}),"v"),E=Object.defineProperty,J=O((e,r)=>E(e,"name",{value:r,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,r){if(r in e)return e[r];if(r in P)return P[r]}});var I=Object.defineProperty,G=O((e,r)=>I(e,"name",{value:r,configurable:!0}),"b");const U=G((e,r,o,t)=>{const n={column:0,line:-1,...e.start},l={...n,...e.end},a=n.line,s=n.column,g=l.line,f=l.column;let p=Math.max(a-(o+1),0),d=Math.min(r.length,g+t);a===-1&&(p=0),g===-1&&(d=r.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=r[u-1]?.length;c[u]=[s,(m??0)-s+1]}else if(i===b)c[u]=[0,f];else{const m=r[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,r)=>_(e,"name",{value:r,configurable:!0}),"o");const z=S.platform==="win32"&&!S.env?.WT_SESSION?">":"❯",D=x((e,r,o)=>{const t={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}},n=r.start&&typeof r.start.column=="number";let l=q(e).split(`
|
|
3
|
+
`);typeof t?.tabWidth=="number"&&(l=l.map(i=>i.replaceAll(" "," ".repeat(t.tabWidth))));const{end:a,markerLines:s,start:g}=U(r,l,t.linesAbove,t.linesBelow),f=String(a).length,{gutter:p,marker:d,message:b}=t.color;let c=l.slice(g,a).map((i,u)=>{const m=g+1+u,v=s[m],$=(" "+m).slice(-f),L=!s[m+1],A=" "+$+(t.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
|
+
`,t.prefix+p(A.replaceAll(/\d/g," "))," ",C,d("^").repeat(F)].join(""),L&&t.message&&(j+=` ${b(t.message)}`)}return[t.prefix+d(z),p(A),i.length>0?" "+i:"",j].join("")}return t.prefix+" "+p(A)+(i.length>0?" "+i:"")}).join(`
|
|
5
|
+
`);return t.message&&!n&&(c=t.prefix+" ".repeat(f+1)+t.message+`
|
|
6
|
+
`+c),c},"codeFrame");var H=Object.defineProperty,K=y((e,r)=>H(e,"name",{value:r,configurable:!0}),"a"),Q=Object.defineProperty,k=K((e,r)=>Q(e,"name",{value:r,configurable:!0}),"l");const w=k((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"),R=k(e=>e.split(/\n|\r(?!\n)/).reduce((r,o)=>(r.push(r.at(-1)+o.length+1),r),[0]),"getLineStartIndexes"),V=k((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 l=R(e),a=w(r,l);return{column:r-l[a]+1,line:a+1}}const n=w(r,e);return{column:r-e[n]+1,line:n+1}},"indexToLineColumn");var X=Object.defineProperty,h=y((e,r)=>X(e,"name",{value:r,configurable:!0}),"s");const Y=h(e=>`\\u{${e.codePointAt(0).toString(16)}}`,"getCodePoint"),Z=h((e,r,o)=>D(e,{start:r},{tabWidth:!1,...o}),"generateCodeFrame"),ee=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:l}=o.groups;return l&&t?{column:Number(t),line:Number(l)}:(n=Number(n),n===e.length&&(n=e.length-1),V(e,n))},"getErrorLocation"),re=h(e=>e.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(r,o,t)=>`"${t}"(${Y(t)})`),"addCodePointToUnexpectedToken");function N(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(s){n=s.message}let l;e?(l=ee(e,n),n=re(n)):n+=" while parsing empty string";const a=new M.r(n);throw a.fileName=o,l&&(a.codeFrame=Z(e,l,t)),a}y(N,"F");h(N,"parseJson");exports.F=N;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
var F=Object.defineProperty;var y=(e,r)=>F(e,"name",{value:r,configurable:!0});import{r as T}from"./JSONError-BwfyCaRr.mjs";var W=Object.defineProperty,k=y((e,r)=>W(e,"name",{value:r,configurable:!0}),"v"),M=Object.defineProperty,B=k((e,r)=>M(e,"name",{value:r,configurable:!0}),"r$1");const E=B(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
2
|
+
`),"normalizeLF"),I=globalThis.process||Object.create(null),P={versions:{}},w=new Proxy(I,{get(e,r){if(r in e)return e[r];if(r in P)return P[r]}});var J=Object.defineProperty,q=k((e,r)=>J(e,"name",{value:r,configurable:!0}),"b");const G=q((e,r,o,t)=>{const n={column:0,line:-1,...e.start},l={...n,...e.end},a=n.line,s=n.column,g=l.line,f=l.column;let p=Math.max(a-(o+1),0),d=Math.min(r.length,g+t);a===-1&&(p=0),g===-1&&(d=r.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=r[u-1]?.length;c[u]=[s,(m??0)-s+1]}else if(i===b)c[u]=[0,f];else{const m=r[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 U=Object.defineProperty,x=k((e,r)=>U(e,"name",{value:r,configurable:!0}),"o");const _=w.platform==="win32"&&!w.env?.WT_SESSION?">":"❯",z=x((e,r,o)=>{const t={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}},n=r.start&&typeof r.start.column=="number";let l=E(e).split(`
|
|
3
|
+
`);typeof t?.tabWidth=="number"&&(l=l.map(i=>i.replaceAll(" "," ".repeat(t.tabWidth))));const{end:a,markerLines:s,start:g}=G(r,l,t.linesAbove,t.linesBelow),f=String(a).length,{gutter:p,marker:d,message:b}=t.color;let c=l.slice(g,a).map((i,u)=>{const m=g+1+u,v=s[m],L=(" "+m).slice(-f),N=!s[m+1],A=" "+L+(t.showGutter?" |":"");if(v){let j="";if(Array.isArray(v)){const $=i.replaceAll(/[^\t]/g," ").slice(0,Math.max(v[0]-1,0)),C=v[1]||1;j=[`
|
|
4
|
+
`,t.prefix+p(A.replaceAll(/\d/g," "))," ",$,d("^").repeat(C)].join(""),N&&t.message&&(j+=` ${b(t.message)}`)}return[t.prefix+d(_),p(A),i.length>0?" "+i:"",j].join("")}return t.prefix+" "+p(A)+(i.length>0?" "+i:"")}).join(`
|
|
5
|
+
`);return t.message&&!n&&(c=t.prefix+" ".repeat(f+1)+t.message+`
|
|
6
|
+
`+c),c},"codeFrame");var D=Object.defineProperty,H=y((e,r)=>D(e,"name",{value:r,configurable:!0}),"a"),K=Object.defineProperty,O=H((e,r)=>K(e,"name",{value:r,configurable:!0}),"l");const S=O((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"),Q=O(e=>e.split(/\n|\r(?!\n)/).reduce((r,o)=>(r.push(r.at(-1)+o.length+1),r),[0]),"getLineStartIndexes"),R=O((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 l=Q(e),a=S(r,l);return{column:r-l[a]+1,line:a+1}}const n=S(r,e);return{column:r-e[n]+1,line:n+1}},"indexToLineColumn");var V=Object.defineProperty,h=y((e,r)=>V(e,"name",{value:r,configurable:!0}),"s");const X=h(e=>`\\u{${e.codePointAt(0).toString(16)}}`,"getCodePoint"),Y=h((e,r,o)=>z(e,{start:r},{tabWidth:!1,...o}),"generateCodeFrame"),Z=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:l}=o.groups;return l&&t?{column:Number(t),line:Number(l)}:(n=Number(n),n===e.length&&(n=e.length-1),R(e,n))},"getErrorLocation"),ee=h(e=>e.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(r,o,t)=>`"${t}"(${X(t)})`),"addCodePointToUnexpectedToken");function re(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(s){n=s.message}let l;e?(l=Z(e,n),n=ee(n)):n+=" while parsing empty string";const a=new T(n);throw a.fileName=o,l&&(a.codeFrame=Y(e,l,t)),a}y(re,"F");h(re,"parseJson");export{re as F};
|
|
@@ -1 +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-
|
|
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-pshz9KrK.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};
|
|
@@ -1 +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-
|
|
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-D_udZACk.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;
|
|
@@ -1 +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-
|
|
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-D_udZACk.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;
|
|
@@ -1 +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-
|
|
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-pshz9KrK.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};
|
package/dist/utils.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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-
|
|
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-D_udZACk.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.mjs
CHANGED
|
@@ -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-
|
|
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-pshz9KrK.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.15",
|
|
4
4
|
"description": "Human friendly file system utilities for Node.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -51,9 +51,12 @@
|
|
|
51
51
|
"yaml"
|
|
52
52
|
],
|
|
53
53
|
"homepage": "https://www.visulima.com/docs/package/fs",
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/visulima/visulima/issues"
|
|
56
|
+
},
|
|
54
57
|
"repository": {
|
|
55
58
|
"type": "git",
|
|
56
|
-
"url": "https://github.com/visulima/visulima.git",
|
|
59
|
+
"url": "git+https://github.com/visulima/visulima.git",
|
|
57
60
|
"directory": "packages/fs"
|
|
58
61
|
},
|
|
59
62
|
"funding": [
|
|
@@ -109,6 +112,15 @@
|
|
|
109
112
|
"main": "dist/index.cjs",
|
|
110
113
|
"module": "dist/index.mjs",
|
|
111
114
|
"types": "dist/index.d.ts",
|
|
115
|
+
"typesVersions": {
|
|
116
|
+
"*": {
|
|
117
|
+
"*": [
|
|
118
|
+
"./dist/error.d.ts",
|
|
119
|
+
"./dist/index.d.ts",
|
|
120
|
+
"./dist/utils.d.ts"
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
},
|
|
112
124
|
"files": [
|
|
113
125
|
"dist/**",
|
|
114
126
|
"README.md",
|
|
@@ -116,18 +128,19 @@
|
|
|
116
128
|
"LICENSE.md"
|
|
117
129
|
],
|
|
118
130
|
"dependencies": {
|
|
119
|
-
"@visulima/path": "1.0.
|
|
131
|
+
"@visulima/path": "1.0.6"
|
|
120
132
|
},
|
|
121
133
|
"devDependencies": {
|
|
122
134
|
"@anolilab/eslint-config": "^15.0.3",
|
|
123
135
|
"@anolilab/prettier-config": "^5.0.14",
|
|
124
136
|
"@anolilab/semantic-release-pnpm": "^1.1.3",
|
|
125
137
|
"@anolilab/semantic-release-preset": "^9.0.0",
|
|
138
|
+
"@arethetypeswrong/cli": "^0.15.4",
|
|
126
139
|
"@babel/core": "^7.25.2",
|
|
127
140
|
"@rushstack/eslint-plugin-security": "^0.8.2",
|
|
128
141
|
"@types/node": "18.19.15",
|
|
129
|
-
"@visulima/error": "4.4.
|
|
130
|
-
"@visulima/packem": "^1.0.0-alpha.
|
|
142
|
+
"@visulima/error": "4.4.2",
|
|
143
|
+
"@visulima/packem": "^1.0.0-alpha.93",
|
|
131
144
|
"@vitest/coverage-v8": "^2.0.5",
|
|
132
145
|
"@vitest/ui": "^2.0.5",
|
|
133
146
|
"conventional-changelog-conventionalcommits": "8.0.0",
|
|
@@ -151,7 +164,7 @@
|
|
|
151
164
|
"type-fest": "^4.26.0",
|
|
152
165
|
"typescript": "5.4.5",
|
|
153
166
|
"vitest": "^2.0.5",
|
|
154
|
-
"yaml": "^2.5.
|
|
167
|
+
"yaml": "^2.5.1"
|
|
155
168
|
},
|
|
156
169
|
"peerDependencies": {
|
|
157
170
|
"yaml": "^2.4.0"
|
|
@@ -195,6 +208,7 @@
|
|
|
195
208
|
"build:prod": "cross-env NODE_ENV=production packem build",
|
|
196
209
|
"clean": "rimraf node_modules dist .eslintcache",
|
|
197
210
|
"dev": "pnpm run build --watch",
|
|
211
|
+
"lint:attw": "attw --pack",
|
|
198
212
|
"lint:eslint": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs",
|
|
199
213
|
"lint:eslint:fix": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs --fix",
|
|
200
214
|
"lint:package-json": "publint --strict",
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
var F=Object.defineProperty;var h=(e,t)=>F(e,"name",{value:t,configurable:!0});import{r as T}from"./JSONError-BwfyCaRr.mjs";var W=Object.defineProperty,k=h((e,t)=>W(e,"name",{value:t,configurable:!0}),"v"),M=Object.defineProperty,B=k((e,t)=>M(e,"name",{value:t,configurable:!0}),"r$1");const E=B(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
2
|
-
`),"normalizeLF"),I=globalThis.process||Object.create(null),P={versions:{}},$=new Proxy(I,{get(e,t){if(t in e)return e[t];if(t in P)return P[t]}});var J=Object.defineProperty,q=k((e,t)=>J(e,"name",{value:t,configurable:!0}),"b");const G=q((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 U=Object.defineProperty,x=k((e,t)=>U(e,"name",{value:t,configurable:!0}),"o");const _=$.platform==="win32"&&!$.env?.WT_SESSION?">":"❯",z=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=E(e).split(`
|
|
3
|
-
`);typeof n?.tabWidth=="number"&&(l=l.map(i=>i.replaceAll(" "," ".repeat(n.tabWidth))));const{end:a,markerLines:s,start:g}=G(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],S=(" "+m).slice(-f),L=!s[m+1],A=" "+S+(n.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
|
-
`,n.prefix+p(A.replaceAll(/\d/g," "))," ",N,d("^").repeat(C)].join(""),L&&n.message&&(j+=` ${b(n.message)}`)}return[n.prefix+d(_),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 D=Object.defineProperty,H=h((e,t)=>D(e,"name",{value:t,configurable:!0}),"l$1"),K=Object.defineProperty,O=H((e,t)=>K(e,"name",{value:t,configurable:!0}),"l");const w=O((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=O(e=>e.split(/\n|\r(?!\n)/).reduce((t,o)=>(t.push(t.at(-1)+o.length+1),t),[0]),"getLineStartIndexes"),R=O((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=Q(e),a=w(t,l);return{column:t-l[a]+1,line:a+1}}const r=w(t,e);return{column:t-e[r]+1,line:r+1}},"indexToLineColumn"),V=R;var X=Object.defineProperty,y=h((e,t)=>X(e,"name",{value:t,configurable:!0}),"s");const Y=y(e=>`\\u{${e.codePointAt(0).toString(16)}}`,"getCodePoint"),Z=y((e,t,o)=>z(e,{start:t},{tabWidth:!1,...o}),"generateCodeFrame"),ee=y((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),V(e,r))},"getErrorLocation"),te=y(e=>e.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(t,o,n)=>`"${n}"(${Y(n)})`),"addCodePointToUnexpectedToken");function ne(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=ee(e,r),r=te(r)):r+=" while parsing empty string";const a=new T(r);throw a.fileName=o,l&&(a.codeFrame=Z(e,l,n)),a}h(ne,"F");y(ne,"parseJson");export{ne as F};
|
|
@@ -1,6 +0,0 @@
|
|
|
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;
|