@visulima/fs 2.1.14 → 2.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/LICENSE.md +20 -20
  3. package/dist/error.cjs +1 -1
  4. package/dist/error.mjs +1 -1
  5. package/dist/index.cjs +1 -1
  6. package/dist/index.mjs +1 -1
  7. package/dist/shared/{AlreadyExistsError-yT45kpVd.mjs → AlreadyExistsError-CEu6_Tjb.mjs} +1 -1
  8. package/dist/shared/AlreadyExistsError-GC2XUgzJ.cjs +1 -0
  9. package/dist/shared/DirectoryError-B8wqer68.cjs +1 -0
  10. package/dist/shared/{DirectoryError-DYXOepnO.mjs → DirectoryError-ddlbUV8C.mjs} +1 -1
  11. package/dist/shared/F_OK-CiLqIeYK.mjs +1 -0
  12. package/dist/shared/{JSONError-BwfyCaRr.mjs → JSONError-CVkb3xZ3.mjs} +2 -2
  13. package/dist/shared/JSONError-CWuiGmNc.cjs +4 -0
  14. package/dist/shared/LF-Dbx0i6a7.mjs +3 -0
  15. package/dist/shared/NotEmptyError-BWGfec5K.cjs +1 -0
  16. package/dist/shared/{NotEmptyError-DCoszDiD.mjs → NotEmptyError-DMh1o7UL.mjs} +1 -1
  17. package/dist/shared/NotFoundError-Diij7oqe.cjs +1 -0
  18. package/dist/shared/{NotFoundError-CQCvj7gX.mjs → NotFoundError-T95YsWYl.mjs} +1 -1
  19. package/dist/shared/{PermissionError-BYPqHEY9.mjs → PermissionError-B8oi38Bx.mjs} +1 -1
  20. package/dist/shared/PermissionError-Ck1Es7al.cjs +1 -0
  21. package/dist/shared/WalkError-BsngoIKJ.mjs +1 -0
  22. package/dist/shared/WalkError-gKgp0TWD.cjs +1 -0
  23. package/dist/shared/assertValidFileContents-BLhwm7u2.mjs +1 -0
  24. package/dist/shared/assertValidFileContents-CrbDz09d.cjs +1 -0
  25. package/dist/shared/{assertValidFileOrDirectoryPath-CQmKNf2h.mjs → assertValidFileOrDirectoryPath-DgPIPmZT.mjs} +1 -1
  26. package/dist/shared/assertValidFileOrDirectoryPath-HOUs73Jk.cjs +1 -0
  27. package/dist/shared/collect-4au76gDu.cjs +1 -0
  28. package/dist/shared/collect-CRzGiRGg.mjs +1 -0
  29. package/dist/shared/collectSync-BE8DAOke.mjs +1 -0
  30. package/dist/shared/collectSync-CbKwt8rz.cjs +1 -0
  31. package/dist/shared/emptyDir-D2m8OP8u.mjs +1 -0
  32. package/dist/shared/emptyDir-DKxQHQQb.cjs +1 -0
  33. package/dist/shared/emptyDirSync-CLM_zyIb.cjs +1 -0
  34. package/dist/shared/emptyDirSync-CZNcW4wc.mjs +1 -0
  35. package/dist/shared/ensureDir-BtvxsJiS.mjs +1 -0
  36. package/dist/shared/ensureDir-DVHj-_yp.cjs +1 -0
  37. package/dist/shared/ensureDirSync-CvjJ3bGq.cjs +1 -0
  38. package/dist/shared/ensureDirSync-bGe0QB7d.mjs +1 -0
  39. package/dist/shared/ensureFile-C46R6-4l.mjs +1 -0
  40. package/dist/shared/ensureFile-CcJ5XIZm.cjs +1 -0
  41. package/dist/shared/ensureFileSync-CwYTIP4G.mjs +1 -0
  42. package/dist/shared/ensureFileSync-v-PhMLTr.cjs +1 -0
  43. package/dist/shared/ensureLink-63XWiA3I.mjs +1 -0
  44. package/dist/shared/ensureLink-C-v4AxzH.cjs +1 -0
  45. package/dist/shared/ensureLinkSync-C4S-zdVb.cjs +1 -0
  46. package/dist/shared/ensureLinkSync-D2LVObKd.mjs +1 -0
  47. package/dist/shared/ensureSymlink-C5cy9585.cjs +1 -0
  48. package/dist/shared/ensureSymlink-D36fS4KE.mjs +1 -0
  49. package/dist/shared/ensureSymlinkSync-PvWVgeXc.mjs +1 -0
  50. package/dist/shared/ensureSymlinkSync-YDRbg9hX.cjs +1 -0
  51. package/dist/shared/findUp-DTU501Mn.cjs +1 -0
  52. package/dist/shared/findUp-ik4TWAC2.mjs +1 -0
  53. package/dist/shared/findUpSync-C1w6Z_6P.cjs +1 -0
  54. package/dist/shared/findUpSync-DO0R67zX.mjs +1 -0
  55. package/dist/shared/isAccessible-C58XjRjT.cjs +1 -0
  56. package/dist/shared/isAccessible-vmOjbVOF.mjs +1 -0
  57. package/dist/shared/isAccessibleSync-9njSth1z.cjs +1 -0
  58. package/dist/shared/isAccessibleSync-BxoK0UkJ.mjs +1 -0
  59. package/dist/shared/parseJson-CgmZtT7L.mjs +6 -0
  60. package/dist/shared/parseJson-DAKf187w.cjs +6 -0
  61. package/dist/shared/readFile-D6U3MP6g.mjs +1 -0
  62. package/dist/shared/readFile-DIQKBQ0d.cjs +1 -0
  63. package/dist/shared/readFileSync-Bao-E5R8.mjs +1 -0
  64. package/dist/shared/readFileSync-CTVwduD2.cjs +1 -0
  65. package/dist/shared/readJson-CIJOiEDB.cjs +1 -0
  66. package/dist/shared/readJson-CspqAlYM.mjs +1 -0
  67. package/dist/shared/readJsonSync-CIpsOFdq.cjs +1 -0
  68. package/dist/shared/readJsonSync-D9HVAN14.mjs +1 -0
  69. package/dist/shared/readYaml-BYMJDJU0.mjs +1 -0
  70. package/dist/shared/readYaml-D4PbAXZD.cjs +1 -0
  71. package/dist/shared/readYamlSync-Bnyr8iGt.cjs +1 -0
  72. package/dist/shared/readYamlSync-CdYj75zz.mjs +1 -0
  73. package/dist/shared/remove-B-9MI2l5.cjs +1 -0
  74. package/dist/shared/remove-DzfvbZOm.mjs +1 -0
  75. package/dist/shared/removeSync-CJPR6M7V.cjs +1 -0
  76. package/dist/shared/removeSync-D165rXSn.mjs +1 -0
  77. package/dist/shared/stripJsonComments-BG8VWVP8.cjs +1 -0
  78. package/dist/shared/stripJsonComments-CnWkqJaX.mjs +1 -0
  79. package/dist/shared/walk-BJgnJy5d.cjs +1 -0
  80. package/dist/shared/walk-DH-95i_B.mjs +1 -0
  81. package/dist/shared/walkSync-D4zvt_kM.mjs +1 -0
  82. package/dist/shared/walkSync-DYawhxUA.cjs +1 -0
  83. package/dist/shared/writeFile-DwkUvAF-.mjs +1 -0
  84. package/dist/shared/writeFile-z1NYn8jk.cjs +1 -0
  85. package/dist/shared/writeFileSync-DYhY33yC.mjs +1 -0
  86. package/dist/shared/writeFileSync-rAuaAA6w.cjs +1 -0
  87. package/dist/shared/writeJson-BW5_Vr5i.cjs +4 -0
  88. package/dist/shared/writeJson-DI_vpDVy.mjs +4 -0
  89. package/dist/shared/writeJsonSync-BkoMtNUG.cjs +4 -0
  90. package/dist/shared/writeJsonSync-DLo6ZPEV.mjs +4 -0
  91. package/dist/shared/writeYaml-B4jtxffY.mjs +1 -0
  92. package/dist/shared/writeYaml-BO_bcnqK.cjs +1 -0
  93. package/dist/shared/writeYamlSync-BG69YBbH.mjs +1 -0
  94. package/dist/shared/writeYamlSync-DozAaY0A.cjs +1 -0
  95. package/dist/utils.cjs +1 -1
  96. package/dist/utils.mjs +1 -1
  97. package/package.json +20 -6
  98. package/dist/shared/AlreadyExistsError-qYsUje4Q.cjs +0 -1
  99. package/dist/shared/DirectoryError-JjvRpYZe.cjs +0 -1
  100. package/dist/shared/F_OK-BzMbdSs5.mjs +0 -1
  101. package/dist/shared/JSONError-BywLDEj4.cjs +0 -4
  102. package/dist/shared/LF-DwWQ8GdI.mjs +0 -3
  103. package/dist/shared/NotEmptyError-Bh6NOR9V.cjs +0 -1
  104. package/dist/shared/NotFoundError-BvgYH3iL.cjs +0 -1
  105. package/dist/shared/PermissionError-Dl1gfUwc.cjs +0 -1
  106. package/dist/shared/WalkError-CWKlhCA6.mjs +0 -1
  107. package/dist/shared/WalkError-DzbUzZjo.cjs +0 -1
  108. package/dist/shared/assertValidFileContents-BTXEHdLD.mjs +0 -1
  109. package/dist/shared/assertValidFileContents-vTNSeAqn.cjs +0 -1
  110. package/dist/shared/assertValidFileOrDirectoryPath-BT5xYqBy.cjs +0 -1
  111. package/dist/shared/collect-B2KdWG6-.mjs +0 -1
  112. package/dist/shared/collect-DwzKTfA1.cjs +0 -1
  113. package/dist/shared/collectSync-BMKZmoZR.mjs +0 -1
  114. package/dist/shared/collectSync-D-h8vph4.cjs +0 -1
  115. package/dist/shared/emptyDir-BkedPAhT.mjs +0 -1
  116. package/dist/shared/emptyDir-Ddqlcb6Q.cjs +0 -1
  117. package/dist/shared/emptyDirSync-Cp_8wgUR.mjs +0 -1
  118. package/dist/shared/emptyDirSync-DqizscgL.cjs +0 -1
  119. package/dist/shared/ensureDir-CpMWmVZ0.mjs +0 -1
  120. package/dist/shared/ensureDir-tKW3dSA0.cjs +0 -1
  121. package/dist/shared/ensureDirSync-DzJ1sUTo.cjs +0 -1
  122. package/dist/shared/ensureDirSync-hyBJv3ax.mjs +0 -1
  123. package/dist/shared/ensureFile-C4MogFm1.cjs +0 -1
  124. package/dist/shared/ensureFile-b-ST2MTk.mjs +0 -1
  125. package/dist/shared/ensureFileSync-BXhhrF2q.cjs +0 -1
  126. package/dist/shared/ensureFileSync-ClzIyiYf.mjs +0 -1
  127. package/dist/shared/ensureLink-CHQqG8z2.mjs +0 -1
  128. package/dist/shared/ensureLink-DY7IQxZ4.cjs +0 -1
  129. package/dist/shared/ensureLinkSync-Cq1cPBbo.mjs +0 -1
  130. package/dist/shared/ensureLinkSync-DJpt1OVV.cjs +0 -1
  131. package/dist/shared/ensureSymlink-CMtb3oPM.mjs +0 -1
  132. package/dist/shared/ensureSymlink-D6VKdTBJ.cjs +0 -1
  133. package/dist/shared/ensureSymlinkSync-DRDE5so4.mjs +0 -1
  134. package/dist/shared/ensureSymlinkSync-DWIrsihx.cjs +0 -1
  135. package/dist/shared/findUp-BVECzzpO.cjs +0 -1
  136. package/dist/shared/findUp-COYH0Ul9.mjs +0 -1
  137. package/dist/shared/findUpSync-nA9H0jZj.mjs +0 -1
  138. package/dist/shared/findUpSync-vnrRIw6w.cjs +0 -1
  139. package/dist/shared/isAccessible-BbChaABn.mjs +0 -1
  140. package/dist/shared/isAccessible-DxFHaxVe.cjs +0 -1
  141. package/dist/shared/isAccessibleSync-C3YjvkTe.mjs +0 -1
  142. package/dist/shared/isAccessibleSync-DtOcefUR.cjs +0 -1
  143. package/dist/shared/parseJson-DjId4v2J.mjs +0 -6
  144. package/dist/shared/parseJson-IY63B_0y.cjs +0 -6
  145. package/dist/shared/readFile-BvgGZivd.mjs +0 -1
  146. package/dist/shared/readFile-DBC_s-48.cjs +0 -1
  147. package/dist/shared/readFileSync-C2bxnV-R.mjs +0 -1
  148. package/dist/shared/readFileSync-CBzoyWtz.cjs +0 -1
  149. package/dist/shared/readJson-BpngPb-8.cjs +0 -1
  150. package/dist/shared/readJson-hlujfMhv.mjs +0 -1
  151. package/dist/shared/readJsonSync-C1vainhA.mjs +0 -1
  152. package/dist/shared/readJsonSync-DTRTDPzu.cjs +0 -1
  153. package/dist/shared/readYaml-Cm-6prFv.mjs +0 -1
  154. package/dist/shared/readYaml-jKVEYXs2.cjs +0 -1
  155. package/dist/shared/readYamlSync-C73N6_GL.cjs +0 -1
  156. package/dist/shared/readYamlSync-DgaclC7K.mjs +0 -1
  157. package/dist/shared/remove-D67tECRM.cjs +0 -1
  158. package/dist/shared/remove-DbvVKBUa.mjs +0 -1
  159. package/dist/shared/removeSync-Ngu7GWsH.mjs +0 -1
  160. package/dist/shared/removeSync-womNIl-8.cjs +0 -1
  161. package/dist/shared/stripJsonComments-BuOddwNE.cjs +0 -1
  162. package/dist/shared/stripJsonComments-DtqWH5Xl.mjs +0 -1
  163. package/dist/shared/walk-DO_o7eRl.mjs +0 -1
  164. package/dist/shared/walk-kHxIkAkJ.cjs +0 -1
  165. package/dist/shared/walkSync-BLhXIHWn.cjs +0 -1
  166. package/dist/shared/walkSync-C5uWmu9Q.mjs +0 -1
  167. package/dist/shared/writeFile-BkHnZTWA.mjs +0 -1
  168. package/dist/shared/writeFile-COembSIp.cjs +0 -1
  169. package/dist/shared/writeFileSync-6h8CQ9EO.mjs +0 -1
  170. package/dist/shared/writeFileSync-C3D5fvZf.cjs +0 -1
  171. package/dist/shared/writeJson-C8i3IALv.mjs +0 -4
  172. package/dist/shared/writeJson-rHdXUJ9n.cjs +0 -4
  173. package/dist/shared/writeJsonSync-BVBRbGPP.mjs +0 -4
  174. package/dist/shared/writeJsonSync-C7xU8DX6.cjs +0 -4
  175. package/dist/shared/writeYaml-BG-a4bX4.mjs +0 -1
  176. package/dist/shared/writeYaml-BnD26RjE.cjs +0 -1
  177. package/dist/shared/writeYamlSync-BEUPvAyj.mjs +0 -1
  178. package/dist/shared/writeYamlSync-BS0MBjJo.cjs +0 -1
@@ -0,0 +1 @@
1
+ var t=Object.defineProperty;var a=(r,e)=>t(r,"name",{value:e,configurable:!0});import{unlink as i,rm as c}from"node:fs/promises";import o from"./assertValidFileOrDirectoryPath-DgPIPmZT.mjs";var m=Object.defineProperty,y=a((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 default};
@@ -0,0 +1 @@
1
+ "use strict";var a=Object.defineProperty;var t=(e,r)=>a(e,"name",{value:r,configurable:!0});const c=require("node:fs"),i=require("./assertValidFileOrDirectoryPath-HOUs73Jk.cjs");var n=Object.defineProperty,s=t((e,r)=>n(e,"name",{value:r,configurable:!0}),"t");const y=s((e,r={})=>{i(e);try{c.unlinkSync(e)}catch{}try{c.rmSync(e,{force:!0,maxRetries:r?.maxRetries,recursive:!0,retryDelay:r?.retryDelay})}catch{}},"removeSync");module.exports=y;
@@ -0,0 +1 @@
1
+ var a=Object.defineProperty;var t=(r,e)=>a(r,"name",{value:e,configurable:!0});import{unlinkSync as c,rmSync as m}from"node:fs";import o from"./assertValidFileOrDirectoryPath-DgPIPmZT.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{c(r)}catch{}try{m(r,{force:!0,maxRetries:e?.maxRetries,recursive:!0,retryDelay:e?.retryDelay})}catch{}},"removeSync");export{s as default};
@@ -0,0 +1 @@
1
+ "use strict";var n=Object.defineProperty;var a=(e,t)=>n(e,"name",{value:t,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var i=Object.defineProperty,o=a((e,t)=>i(e,"name",{value:t,configurable:!0}),"n");const r=o((e,{whitespace:t=!0}={})=>e.replace(l,s=>s.startsWith('"')||s[1]==="*"&&!s.endsWith("*/")?s:t?s.replaceAll(/\S/g," "):""),"stripJsonComments"),l=/"(?:[^"\\]|\\.)*"?|\/\/[^\r\n]*|\/\*(?:[^*]|\*[^/])*(?:\*\/)?/g;exports.INTERNAL_STRIP_JSON_REGEX=l;exports.default=r;
@@ -0,0 +1 @@
1
+ var n=Object.defineProperty;var s=(e,t)=>n(e,"name",{value:t,configurable:!0});var c=Object.defineProperty,i=s((e,t)=>c(e,"name",{value:t,configurable:!0}),"n");const r=i((e,{whitespace:t=!0}={})=>e.replace(l,a=>a.startsWith('"')||a[1]==="*"&&!a.endsWith("*/")?a:t?a.replaceAll(/\S/g," "):""),"stripJsonComments"),l=/"(?:[^"\\]|\\.)*"?|\/\/[^\r\n]*|\/\*(?:[^*]|\*[^/])*(?:\*\/)?/g;export{l as INTERNAL_STRIP_JSON_REGEX,r as default};
@@ -0,0 +1 @@
1
+ "use strict";var w=Object.defineProperty;var m=(e,s)=>w(e,"name",{value:s,configurable:!0});const u=require("node:fs/promises"),c=require("@visulima/path"),D=require("@visulima/path/utils"),S=require("./WalkError-gKgp0TWD.cjs"),F=require("./assertValidFileOrDirectoryPath-HOUs73Jk.cjs"),a=require("./walk-include-CFIYniQi.cjs");var v=Object.defineProperty,b=m((e,s)=>v(e,"name",{value:s,configurable:!0}),"f");const L=b(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:k=!0,includeSymlinks:f=!0,match:p,maxDepth:y=Number.POSITIVE_INFINITY,skip:h}={}){if(F(e),y<0)return;const l=p?p.map(i=>typeof i=="string"?a.c(i):i):void 0,o=h?h.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(f&&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:k,includeSymlinks:f,match:l,maxDepth:y-1,skip:o}):i.isFile()&&k&&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 S?i:new S(i,e)}}m(d,"d");b(d,"walk");module.exports=d;
@@ -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 k from"./WalkError-BsngoIKJ.mjs";import N from"./assertValidFileOrDirectoryPath-DgPIPmZT.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),a=I(o),s=await F(o);return{isDirectory:s.isDirectory,isFile:s.isFile,isSymbolicLink:s.isSymbolicLink,name:a,path:o}},"_createWalkEntry");async function*b(e,{extensions:o,followSymlinks:a=!1,includeDirs:s=!0,includeFiles:y=!0,includeSymlinks:f=!0,match:p,maxDepth:m=Number.POSITIVE_INFINITY,skip:d}={}){if(N(e),m<0)return;const t=p?p.map(i=>typeof i=="string"?u(i):i):void 0,r=d?d.map(i=>typeof i=="string"?u(i):i):void 0;if(e=v(g(e)),s&&l(e,o,t,r)&&(yield await P(e)),!(m<1||!l(e,void 0,void 0,r)))try{for await(const i of await w(e,{withFileTypes:!0})){let n=L(e,i.name);if(i.isSymbolicLink())if(a)n=await D(n);else if(f&&l(n,o,t,r))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:a,includeDirs:s,includeFiles:y,includeSymlinks:f,match:t,maxDepth:m-1,skip:r}):i.isFile()&&y&&l(n,o,t,r)&&(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 default};
@@ -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 k from"./WalkError-BsngoIKJ.mjs";import N from"./assertValidFileOrDirectoryPath-DgPIPmZT.mjs";import{c as h,a as l}from"./walk-include-B-MbUqMt.mjs";var O=Object.defineProperty,u=c((e,o)=>O(e,"name",{value:o,configurable:!0}),"m");const P=u(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*b(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*b(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(b,"h");u(b,"walkSync");export{b as default};
@@ -0,0 +1 @@
1
+ "use strict";var D=Object.defineProperty;var y=(e,n)=>D(e,"name",{value:n,configurable:!0});const m=require("node:fs"),t=require("@visulima/path"),F=require("@visulima/path/utils"),p=require("./WalkError-gKgp0TWD.cjs"),v=require("./assertValidFileOrDirectoryPath-HOUs73Jk.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),r=m.statSync(n);return{isDirectory:r.isDirectory,isFile:r.isFile,isSymbolicLink:r.isSymbolicLink,name:t.basename(n),path:n}},"_createWalkEntry");function*d(e,{extensions:n,followSymlinks:r=!1,includeDirs:u=!0,includeFiles:k=!0,includeSymlinks:S=!0,match:f,maxDepth:a=Number.POSITIVE_INFINITY,skip:h}={}){if(v(e),a<0)return;const c=f?f.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 s=t.join(e,i.name);if(i.isSymbolicLink())if(r)s=m.realpathSync(s);else if(S&&o.a(s,n,c,l))yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:t.normalize(s)};else continue;i.isSymbolicLink()||i.isDirectory()?yield*d(s,{extensions:n,followSymlinks:r,includeDirs:u,includeFiles:k,includeSymlinks:S,match:c,maxDepth:a-1,skip:l}):i.isFile()&&k&&o.a(s,n,c,l)&&(yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:t.normalize(s)})}}catch(i){throw i instanceof p?i:new p(i,e)}}y(d,"h");b(d,"walkSync");module.exports=d;
@@ -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 l,stat as p,rename as w,chown as u,chmod as g,unlink as h}from"node:fs/promises";import{dirname as v}from"@visulima/path";import{toPath as $}from"@visulima/path/utils";import{F_OK as d}from"./F_OK-CiLqIeYK.mjs";import e from"./isAccessible-vmOjbVOF.mjs";import y from"./assertValidFileContents-BLhwm7u2.mjs";import k from"./assertValidFileOrDirectoryPath-DgPIPmZT.mjs";import{a as F}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},k(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 l(`${i}.tmp`,F(a),{encoding:t.encoding,flag:t.flag}),o&&!t.overwrite&&(m=await p(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 u(r,t.chown.uid,t.chown.gid)}catch{}await g(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 h(`${i}.tmp`)}},"writeFile");export{B as default};
@@ -0,0 +1 @@
1
+ "use strict";var u=Object.defineProperty;var w=(i,a)=>u(i,"name",{value:a,configurable:!0});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-C58XjRjT.cjs"),h=require("./assertValidFileContents-CrbDz09d.cjs"),f=require("./assertValidFileOrDirectoryPath-HOUs73Jk.cjs"),g=require("./to-uint-8-array-2-3EvGd7.cjs");var v=Object.defineProperty,p=w((i,a)=>v(i,"name",{value:a,configurable:!0}),"d");const q=p(async(i,a,t)=>{t={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...t},f(i),h(a),i=m.toPath(i);try{const r=await c(i,d.F_OK);if(!r&&t.recursive){const s=l.dirname(i);await c(s,d.F_OK)||await e.mkdir(s,{recursive:!0})}let n;await e.writeFile(`${i}.tmp`,g.a(a),{encoding:t.encoding,flag:t.flag}),r&&!t.overwrite&&(n=await e.stat(i),t.chown===void 0&&(t.chown={gid:n.gid,uid:n.uid}),await e.rename(i,`${i}.bak`));const o=`${i}.tmp`;if(t.chown)try{await e.chown(o,t.chown.uid,t.chown.gid)}catch{}await e.chmod(o,n&&!t.mode?n.mode:t.mode??438),await e.rename(o,i)}catch(r){throw new Error(`Failed to write file at: ${i} - ${r.message}`,{cause:r})}finally{await c(`${i}.tmp`)&&await e.unlink(`${i}.tmp`)}},"writeFile");module.exports=q;
@@ -0,0 +1 @@
1
+ var s=Object.defineProperty;var a=(o,t)=>s(o,"name",{value:t,configurable:!0});import{mkdirSync as l,writeFileSync as p,statSync as w,renameSync as f,chownSync as u,chmodSync as y,unlinkSync as g}from"node:fs";import{dirname as h}from"@visulima/path";import{toPath as $}from"@visulima/path/utils";import{F_OK as d}from"./F_OK-CiLqIeYK.mjs";import r from"./isAccessibleSync-BxoK0UkJ.mjs";import v from"./assertValidFileContents-BLhwm7u2.mjs";import S from"./assertValidFileOrDirectoryPath-DgPIPmZT.mjs";import{a as k}from"./to-uint-8-array-DwgaTasY.mjs";var F=Object.defineProperty,b=a((o,t)=>F(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=h(o);r(e,d)||l(e,{recursive:!0})}let c;p(`${o}.tmp`,k(t),{encoding:i.encoding,flag:i.flag}),n&&!i.overwrite&&(c=w(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{u(m,i.chown.uid,i.chown.gid)}catch{}y(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`)&&g(`${o}.tmp`)}},"writeFileSync");export{A as default};
@@ -0,0 +1 @@
1
+ "use strict";var l=Object.defineProperty;var d=(e,n)=>l(e,"name",{value:n,configurable:!0});const t=require("node:fs"),y=require("@visulima/path"),m=require("@visulima/path/utils"),u=require("./F_OK-B8R_JA-Q.cjs"),s=require("./isAccessibleSync-9njSth1z.cjs"),w=require("./assertValidFileContents-CrbDz09d.cjs"),h=require("./assertValidFileOrDirectoryPath-HOUs73Jk.cjs"),f=require("./to-uint-8-array-2-3EvGd7.cjs");var g=Object.defineProperty,S=d((e,n)=>g(e,"name",{value:n,configurable:!0}),"f");const v=S((e,n,i)=>{i={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...i},h(e),w(n),e=m.toPath(e);try{const c=s(e,u.F_OK);if(!c&&i.recursive){const a=y.dirname(e);s(a,u.F_OK)||t.mkdirSync(a,{recursive:!0})}let o;t.writeFileSync(`${e}.tmp`,f.a(n),{encoding:i.encoding,flag:i.flag}),c&&!i.overwrite&&(o=t.statSync(e),i.chown===void 0&&(i.chown={gid:o.gid,uid:o.uid}),t.renameSync(e,`${e}.bak`));const r=`${e}.tmp`;if(i.chown)try{t.chownSync(r,i.chown.uid,i.chown.gid)}catch{}t.chmodSync(r,o&&!i.mode?o.mode:i.mode??438),t.renameSync(r,e)}catch(c){throw new Error(`Failed to write file at: ${e} - ${c.message}`,{cause:c})}finally{s(`${e}.tmp`)&&t.unlinkSync(`${e}.tmp`)}},"writeFileSync");module.exports=v;
@@ -0,0 +1,4 @@
1
+ "use strict";var p=Object.defineProperty;var c=(e,t)=>p(e,"name",{value:t,configurable:!0});const q=require("node:fs/promises"),y=require("./index-Cms6lU4T.cjs"),O=require("./F_OK-B8R_JA-Q.cjs"),b=require("./isAccessible-C58XjRjT.cjs"),g=require("./writeFile-z1NYn8jk.cjs");var h=Object.defineProperty,m=c((e,t)=>h(e,"name",{value:t,configurable:!0}),"r");const v=m(async(e,t,s={})=>{const{detectIndent:o,indent:a,replacer:d,stringify:u=JSON.stringify,...f}={indent:" ",...s};let i=a,r=`
2
+ `;if(await b(e,O.R_OK))try{const n=await q.readFile(e,"utf8");if(o){const{indent:w}=y.detectIndent(n);i=w}r=n.endsWith(`
3
+ `)?`
4
+ `:""}catch(n){if(n.code!=="ENOENT")throw n}const l=u(t,d,i);await g(e,`${l}${r}`,f)},"writeJson");module.exports=v;
@@ -0,0 +1,4 @@
1
+ var w=Object.defineProperty;var o=(t,e)=>w(t,"name",{value:e,configurable:!0});import{readFile as u}from"node:fs/promises";import{d as y}from"./index-VcQXVcaq.mjs";import{R_OK as O}from"./F_OK-CiLqIeYK.mjs";import g from"./isAccessible-vmOjbVOF.mjs";import h from"./writeFile-DwkUvAF-.mjs";var v=Object.defineProperty,N=o((t,e)=>v(t,"name",{value:e,configurable:!0}),"r");const k=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 u(t,"utf8");if(c){const{indent:l}=y(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{k as default};
@@ -0,0 +1,4 @@
1
+ "use strict";var O=Object.defineProperty;var i=(e,t)=>O(e,"name",{value:t,configurable:!0});const q=require("node:fs"),S=require("./index-Cms6lU4T.cjs"),p=require("./F_OK-B8R_JA-Q.cjs"),N=require("./isAccessibleSync-9njSth1z.cjs"),b=require("./writeFileSync-rAuaAA6w.cjs");var g=Object.defineProperty,h=i((e,t)=>g(e,"name",{value:t,configurable:!0}),"r");const v=h((e,t,s={})=>{const{detectIndent:o,indent:d,replacer:f,stringify:u=JSON.stringify,...y}={indent:" ",...s};let r=d,c=`
2
+ `;if(N(e,p.R_OK))try{const n=q.readFileSync(e,"utf8");if(o){const{indent:l}=S.detectIndent(n);r=l}c=n.endsWith(`
3
+ `)?`
4
+ `:""}catch(n){if(n.code!=="ENOENT")throw n}const a=u(t,f,r);b(e,`${a}${c}`,y)},"writeJsonSync");module.exports=v;
@@ -0,0 +1,4 @@
1
+ var y=Object.defineProperty;var i=(t,e)=>y(t,"name",{value:e,configurable:!0});import{readFileSync as O}from"node:fs";import{d as u}from"./index-VcQXVcaq.mjs";import{R_OK as N}from"./F_OK-CiLqIeYK.mjs";import g from"./isAccessibleSync-BxoK0UkJ.mjs";import h from"./writeFileSync-DYhY33yC.mjs";var v=Object.defineProperty,S=i((t,e)=>v(t,"name",{value:e,configurable:!0}),"r");const j=S((t,e,c={})=>{const{detectIndent:f,indent:d,replacer:m,stringify:a=JSON.stringify,...s}={indent:" ",...c};let n=d,o=`
2
+ `;if(g(t,N))try{const r=O(t,"utf8");if(f){const{indent:l}=u(r);n=l}o=r.endsWith(`
3
+ `)?`
4
+ `:""}catch(r){if(r.code!=="ENOENT")throw r}const p=a(e,m,n);h(t,`${p}${o}`,s)},"writeJsonSync");export{j as default};
@@ -0,0 +1 @@
1
+ var i=Object.defineProperty;var e=(a,r)=>i(a,"name",{value:r,configurable:!0});import{stringify as n}from"yaml";import m from"./writeFile-DwkUvAF-.mjs";var c=Object.defineProperty,y=e((a,r)=>c(a,"name",{value:r,configurable:!0}),"n");async function p(a,r,t,o){const f=typeof t=="function"||Array.isArray(t)?n(r,t,o):n(r,t);await m(a,f)}e(p,"m");y(p,"writeYaml");export{p as default};
@@ -0,0 +1 @@
1
+ "use strict";var o=Object.defineProperty;var n=(e,r)=>o(e,"name",{value:r,configurable:!0});const a=require("yaml"),y=require("./writeFile-z1NYn8jk.cjs");var f=Object.defineProperty,u=n((e,r)=>f(e,"name",{value:r,configurable:!0}),"n");async function i(e,r,t,s){const c=typeof t=="function"||Array.isArray(t)?a.stringify(r,t,s):a.stringify(r,t);await y(e,c)}n(i,"m");u(i,"writeYaml");module.exports=i;
@@ -0,0 +1 @@
1
+ var m=Object.defineProperty;var o=(e,r)=>m(e,"name",{value:r,configurable:!0});import{stringify as t}from"yaml";import n from"./writeFileSync-DYhY33yC.mjs";var c=Object.defineProperty,y=o((e,r)=>c(e,"name",{value:r,configurable:!0}),"i");function p(e,r,i,a){const f=typeof i=="function"||Array.isArray(i)?t(r,i,a):t(r,i);n(e,f)}o(p,"m");y(p,"writeYamlSync");export{p as default};
@@ -0,0 +1 @@
1
+ "use strict";var o=Object.defineProperty;var t=(e,r)=>o(e,"name",{value:r,configurable:!0});const n=require("yaml"),y=require("./writeFileSync-rAuaAA6w.cjs");var f=Object.defineProperty,u=t((e,r)=>f(e,"name",{value:r,configurable:!0}),"i");function c(e,r,i,s){const a=typeof i=="function"||Array.isArray(i)?n.stringify(r,i,s):n.stringify(r,i);y(e,a)}t(c,"m");u(c,"writeYamlSync");module.exports=c;
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-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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/JSONError-CWuiGmNc.cjs"),r=require("./shared/assertValidFileContents-CrbDz09d.cjs"),t=require("./shared/assertValidFileOrDirectoryPath-HOUs73Jk.cjs"),s=require("./shared/parseJson-DAKf187w.cjs"),o=require("./shared/stripJsonComments-BG8VWVP8.cjs"),i=require("@visulima/path/utils");exports.JSONError=e;exports.assertValidFileContents=r;exports.assertValidFileOrDirectoryPath=t;exports.parseJson=s;exports.stripJsonComments=o.default;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-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};
1
+ import{default as e}from"./shared/JSONError-CVkb3xZ3.mjs";import{default as a}from"./shared/assertValidFileContents-BLhwm7u2.mjs";import{default as f}from"./shared/assertValidFileOrDirectoryPath-DgPIPmZT.mjs";import{default as m}from"./shared/parseJson-CgmZtT7L.mjs";import{default as d}from"./shared/stripJsonComments-CnWkqJaX.mjs";import{toPath as x}from"@visulima/path/utils";export{e as JSONError,a as assertValidFileContents,f as assertValidFileOrDirectoryPath,m as parseJson,d as stripJsonComments,x as toPath};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/fs",
3
- "version": "2.1.14",
3
+ "version": "2.1.16",
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.5"
131
+ "@visulima/path": "1.0.7"
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.1",
130
- "@visulima/packem": "^1.0.0-alpha.86",
142
+ "@visulima/error": "4.4.3",
143
+ "@visulima/packem": "^1.0.0-alpha.95",
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.0"
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 +0,0 @@
1
- "use strict";var o=Object.defineProperty;var t=(e,r)=>o(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=Object.defineProperty,a=t((e,r)=>n(e,"name",{value:r,configurable:!0}),"t");class s 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")}}exports.n=s;
@@ -1 +0,0 @@
1
- "use strict";var t=Object.defineProperty;var o=(e,r)=>t(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=Object.defineProperty,a=o((e,r)=>n(e,"name",{value:r,configurable:!0}),"o");class c extends Error{static{o(this,"n")}static{a(this,"DirectoryError")}constructor(r){super(`EISDIR: Illegal operation on a directory, ${r}`)}get code(){return"EISDIR"}set code(r){throw new Error("Cannot overwrite code EISDIR")}get name(){return"DirectoryError"}set name(r){throw new Error("Cannot overwrite name of DirectoryError")}}exports.n=c;
@@ -1 +0,0 @@
1
- const a=0,s=4,_=2,O=1,o=Symbol("findUpStop");export{a as F,s as R,_ as W,O as X,o as a};
@@ -1,4 +0,0 @@
1
- "use strict";var a=Object.defineProperty;var t=(r,e)=>a(r,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var i=Object.defineProperty,o=t((r,e)=>i(r,"name",{value:e,configurable:!0}),"i");class s extends Error{static{t(this,"r")}static{o(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}}exports.r=s;
@@ -1,3 +0,0 @@
1
- var m=Object.defineProperty;var n=(e,t)=>m(e,"name",{value:t,configurable:!0});import{platform as i}from"node:process";var g=Object.defineProperty,l=n((e,t)=>g(e,"name",{value:t,configurable:!0}),"r");const o=/\r?\n/g,c=`
2
- `,r=`\r
3
- `,d=i==="win32"?r:c,h=l(e=>{const t=e.match(o);if(!t||t.length===0)return null;const a=t.filter(s=>s===r).length,f=t.length-a;return a>f?r:c},"detect"),L=l((e,t)=>e.replaceAll(o,t),"format");export{r as C,d as E,c as L,h as d,L as f};
@@ -1 +0,0 @@
1
- "use strict";var o=Object.defineProperty;var t=(e,r)=>o(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=Object.defineProperty,E=t((e,r)=>n(e,"name",{value:r,configurable:!0}),"t");class a extends Error{static{t(this,"n")}static{E(this,"NotEmptyError")}constructor(r){super(`ENOTEMPTY: Directory not empty, ${r}`)}get code(){return"ENOTEMPTY"}set code(r){throw new Error("Cannot overwrite code ENOTEMPTY")}get name(){return"NotEmptyError"}set name(r){throw new Error("Cannot overwrite name of NotEmptyError")}}exports.n=a;
@@ -1 +0,0 @@
1
- "use strict";var t=Object.defineProperty;var o=(e,r)=>t(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=Object.defineProperty,a=o((e,r)=>n(e,"name",{value:r,configurable:!0}),"o");class u extends Error{static{o(this,"n")}static{a(this,"NotFoundError")}constructor(r){super(`ENOENT: ${r}`)}get code(){return"ENOENT"}set code(r){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(r){throw new Error("Cannot overwrite name of NotFoundError")}}exports.n=u;
@@ -1 +0,0 @@
1
- "use strict";var o=Object.defineProperty;var t=(e,r)=>o(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=Object.defineProperty,i=t((e,r)=>n(e,"name",{value:r,configurable:!0}),"o");class s extends Error{static{t(this,"n")}static{i(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")}}exports.n=s;
@@ -1 +0,0 @@
1
- var a=Object.defineProperty;var t=(e,r)=>a(e,"name",{value:r,configurable:!0});var n=Object.defineProperty,s=t((e,r)=>n(e,"name",{value:r,configurable:!0}),"t");class c extends Error{static{t(this,"i")}static{s(this,"WalkError")}root;constructor(r,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{c as i};
@@ -1 +0,0 @@
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"});var n=Object.defineProperty,s=t((e,r)=>n(e,"name",{value:r,configurable:!0}),"t");class i extends Error{static{t(this,"i")}static{s(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=i;
@@ -1 +0,0 @@
1
- var a=Object.defineProperty;var t=(e,r)=>a(e,"name",{value:r,configurable:!0});var f=Object.defineProperty,i=t((e,r)=>f(e,"name",{value:r,configurable:!0}),"e");const o=i(e=>{if(typeof e!="string"&&!(e instanceof ArrayBuffer)&&!ArrayBuffer.isView(e))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")},"assertValidFileContents");export{o as a};
@@ -1 +0,0 @@
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"});var i=Object.defineProperty,n=t((e,r)=>i(e,"name",{value:r,configurable:!0}),"e");const f=n(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");exports.a=f;
@@ -1 +0,0 @@
1
- "use strict";var n=Object.defineProperty;var t=(e,r)=>n(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var o=Object.defineProperty,a=t((e,r)=>o(e,"name",{value:r,configurable:!0}),"n");const i=a(e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")},"assertValidFileOrDirectoryPath");exports.s=i;
@@ -1 +0,0 @@
1
- var a=Object.defineProperty;var n=(e,r)=>a(e,"name",{value:r,configurable:!0});import{d as t}from"./walk-DO_o7eRl.mjs";var c=Object.defineProperty,i=n((e,r)=>c(e,"name",{value:r,configurable:!0}),"e");const j=i(async(e,r={})=>{Array.isArray(r.extensions)||(r.extensions=["js","mjs","cjs","ts"]);const s=[];for await(const o of t(e,r))s.push(o.path);return s},"collect");export{j as a};
@@ -1 +0,0 @@
1
- "use strict";var n=Object.defineProperty;var t=(r,e)=>n(r,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./walk-kHxIkAkJ.cjs");var c=Object.defineProperty,i=t((r,e)=>c(r,"name",{value:e,configurable:!0}),"e");const l=i(async(r,e={})=>{Array.isArray(e.extensions)||(e.extensions=["js","mjs","cjs","ts"]);const s=[];for await(const a of o.d(r,e))s.push(a.path);return s},"collect");exports.a=l;
@@ -1 +0,0 @@
1
- var t=Object.defineProperty;var n=(e,r)=>t(e,"name",{value:r,configurable:!0});import{h as c}from"./walkSync-C5uWmu9Q.mjs";var a=Object.defineProperty,i=n((e,r)=>a(e,"name",{value:r,configurable:!0}),"n");const j=i((e,r={})=>{Array.isArray(r.extensions)||(r.extensions=["js","mjs","cjs","ts"]);const o=[];for(const s of c(e,r))o.push(s.path);return o},"collectSync");export{j as c};
@@ -1 +0,0 @@
1
- "use strict";var t=Object.defineProperty;var o=(r,e)=>t(r,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./walkSync-BLhXIHWn.cjs");var a=Object.defineProperty,i=o((r,e)=>a(r,"name",{value:e,configurable:!0}),"n");const l=i((r,e={})=>{Array.isArray(e.extensions)||(e.extensions=["js","mjs","cjs","ts"]);const n=[];for(const s of c.h(r,e))n.push(s.path);return n},"collectSync");exports.c=l;
@@ -1 +0,0 @@
1
- var e=Object.defineProperty;var i=(r,o)=>e(r,"name",{value:o,configurable:!0});import{existsSync as a}from"node:fs";import{mkdir as m,readdir as f,rm as c}from"node:fs/promises";import{join as n}from"@visulima/path";import{toPath as p}from"@visulima/path/utils";import{s}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";var u=Object.defineProperty,v=i((r,o)=>u(r,"name",{value:o,configurable:!0}),"i");const x=v(async(r,o)=>{if(s(r),!a(r)){await m(r,{recursive:!0});return}for await(const t of await f(r))await c(n(p(r),t),{...o,force:!0,recursive:!0})},"emptyDir");export{x as y};
@@ -1 +0,0 @@
1
- "use strict";var o=Object.defineProperty;var i=(e,r)=>o(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("node:fs"),t=require("node:fs/promises"),c=require("@visulima/path"),n=require("@visulima/path/utils"),u=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs");var y=Object.defineProperty,d=i((e,r)=>y(e,"name",{value:r,configurable:!0}),"i");const f=d(async(e,r)=>{if(u.s(e),!s.existsSync(e)){await t.mkdir(e,{recursive:!0});return}for await(const a of await t.readdir(e))await t.rm(c.join(n.toPath(e),a),{...r,force:!0,recursive:!0})},"emptyDir");exports.y=f;
@@ -1 +0,0 @@
1
- var t=Object.defineProperty;var e=(r,o)=>t(r,"name",{value:o,configurable:!0});import{existsSync as m,mkdirSync as c,readdirSync as n,rmSync as f}from"node:fs";import{join as a}from"@visulima/path";import{toPath as p}from"@visulima/path/utils";import{s}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";var u=Object.defineProperty,y=e((r,o)=>u(r,"name",{value:o,configurable:!0}),"o");const l=y((r,o)=>{if(s(r),!m(r)){c(r,{recursive:!0});return}for(const i of n(r))f(a(p(r),i),{...o,force:!0,recursive:!0})},"emptyDir");export{l as u};
@@ -1 +0,0 @@
1
- "use strict";var c=Object.defineProperty;var i=(e,r)=>c(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("node:fs"),n=require("@visulima/path"),s=require("@visulima/path/utils"),u=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs");var a=Object.defineProperty,y=i((e,r)=>a(e,"name",{value:r,configurable:!0}),"o");const d=y((e,r)=>{if(u.s(e),!t.existsSync(e)){t.mkdirSync(e,{recursive:!0});return}for(const o of t.readdirSync(e))t.rmSync(n.join(s.toPath(e),o),{...r,force:!0,recursive:!0})},"emptyDir");exports.u=d;
@@ -1 +0,0 @@
1
- var c=Object.defineProperty;var i=(e,r)=>c(e,"name",{value:r,configurable:!0});import{lstat as o,mkdir as s}from"node:fs/promises";import{s as n}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";import{g as a}from"./get-file-info-type-CaWGXRjY.mjs";var f=Object.defineProperty,p=i((e,r)=>f(e,"name",{value:r,configurable:!0}),"i");const E=p(async e=>{n(e);try{const r=await o(e);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${a(r)}'`);return}catch(r){if(r.code!=="ENOENT")throw r}try{await s(e,{recursive:!0})}catch(r){if(r.code!=="EEXIST")throw r;const t=await o(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${a(t)}'`)}},"ensureDir");export{E as f};
@@ -1 +0,0 @@
1
- "use strict";var a=Object.defineProperty;var o=(r,e)=>a(r,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("node:fs/promises"),c=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs"),s=require("./get-file-info-type-BXcpoWEM.cjs");var n=Object.defineProperty,u=o((r,e)=>n(r,"name",{value:e,configurable:!0}),"i");const f=u(async r=>{c.s(r);try{const e=await t.lstat(r);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${s.getFileInfoType(e)}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await t.mkdir(r,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const i=await t.lstat(r);if(!i.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${s.getFileInfoType(i)}'`)}},"ensureDir");exports.f=f;
@@ -1 +0,0 @@
1
- "use strict";var n=Object.defineProperty;var i=(r,e)=>n(r,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("node:fs"),s=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs"),c=require("./get-file-info-type-BXcpoWEM.cjs");var a=Object.defineProperty,y=i((r,e)=>a(r,"name",{value:e,configurable:!0}),"o");const u=y(r=>{s.s(r);try{const e=t.lstatSync(r);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${c.getFileInfoType(e)}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{t.mkdirSync(r,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const o=t.lstatSync(r);if(!o.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${c.getFileInfoType(o)}'`)}},"ensureDirSync");exports.a=u;
@@ -1 +0,0 @@
1
- var s=Object.defineProperty;var o=(e,r)=>s(e,"name",{value:r,configurable:!0});import{lstatSync as i,mkdirSync as n}from"node:fs";import{s as a}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";import{g as c}from"./get-file-info-type-CaWGXRjY.mjs";var f=Object.defineProperty,p=o((e,r)=>f(e,"name",{value:r,configurable:!0}),"o");const E=p(e=>{a(e);try{const r=i(e);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${c(r)}'`);return}catch(r){if(r.code!=="ENOENT")throw r}try{n(e,{recursive:!0})}catch(r){if(r.code!=="EEXIST")throw r;const t=i(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${c(t)}'`)}},"ensureDirSync");export{E as a};
@@ -1 +0,0 @@
1
- "use strict";var o=Object.defineProperty;var t=(r,e)=>o(r,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("node:fs/promises"),a=require("@visulima/path"),n=require("@visulima/path/utils"),s=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs"),c=require("./get-file-info-type-BXcpoWEM.cjs"),u=require("./ensureDir-tKW3dSA0.cjs");var l=Object.defineProperty,f=t((r,e)=>l(r,"name",{value:e,configurable:!0}),"e");const y=f(async r=>{s.s(r);try{const e=await i.lstat(r);if(!e.isFile())throw new Error(`Ensure path exists, expected 'file', got '${c.getFileInfoType(e)}'`)}catch(e){if(e.code==="ENOENT"){await u.f(a.dirname(n.toPath(r))),await i.writeFile(r,new Uint8Array);return}throw e}},"ensureFile");exports.f=y;
@@ -1 +0,0 @@
1
- var o=Object.defineProperty;var t=(e,r)=>o(e,"name",{value:r,configurable:!0});import{lstat as i,writeFile as a}from"node:fs/promises";import{dirname as f}from"@visulima/path";import{toPath as m}from"@visulima/path/utils";import{s as n}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";import{g as s}from"./get-file-info-type-CaWGXRjY.mjs";import{f as p}from"./ensureDir-CpMWmVZ0.mjs";var c=Object.defineProperty,l=t((e,r)=>c(e,"name",{value:r,configurable:!0}),"e");const F=l(async e=>{n(e);try{const r=await i(e);if(!r.isFile())throw new Error(`Ensure path exists, expected 'file', got '${s(r)}'`)}catch(r){if(r.code==="ENOENT"){await p(f(m(e))),await a(e,new Uint8Array);return}throw r}},"ensureFile");export{F as f};
@@ -1 +0,0 @@
1
- "use strict";var n=Object.defineProperty;var t=(r,e)=>n(r,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("node:fs"),o=require("@visulima/path"),s=require("@visulima/path/utils"),c=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs"),a=require("./get-file-info-type-BXcpoWEM.cjs"),u=require("./ensureDirSync-DzJ1sUTo.cjs");var l=Object.defineProperty,y=t((r,e)=>l(r,"name",{value:e,configurable:!0}),"e");const f=y(r=>{c.s(r);try{const e=i.lstatSync(r);if(!e.isFile())throw new Error(`Ensure path exists, expected 'file', got '${a.getFileInfoType(e)}'`)}catch(e){if(e.code==="ENOENT"){u.a(o.dirname(s.toPath(r))),i.writeFileSync(r,new Uint8Array);return}throw e}},"ensureFileSync");exports.y=f;
@@ -1 +0,0 @@
1
- var t=Object.defineProperty;var o=(e,r)=>t(e,"name",{value:r,configurable:!0});import{lstatSync as i,writeFileSync as n}from"node:fs";import{dirname as m}from"@visulima/path";import{toPath as a}from"@visulima/path/utils";import{s as f}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";import{g as c}from"./get-file-info-type-CaWGXRjY.mjs";import{a as p}from"./ensureDirSync-hyBJv3ax.mjs";var s=Object.defineProperty,l=o((e,r)=>s(e,"name",{value:r,configurable:!0}),"e");const F=l(e=>{f(e);try{const r=i(e);if(!r.isFile())throw new Error(`Ensure path exists, expected 'file', got '${c(r)}'`)}catch(r){if(r.code==="ENOENT"){p(m(a(e))),n(e,new Uint8Array);return}throw r}},"ensureFileSync");export{F as y};
@@ -1 +0,0 @@
1
- var c=Object.defineProperty;var m=(e,a)=>c(e,"name",{value:a,configurable:!0});import{lstat as i,link as p}from"node:fs/promises";import{toNamespacedPath as s,dirname as l}from"@visulima/path";import{toPath as f}from"@visulima/path/utils";import{s as n}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";import{l as h}from"./is-stats-identical-CS5Y91zW.mjs";import{f as w}from"./ensureDir-CpMWmVZ0.mjs";var y=Object.defineProperty,u=m((e,a)=>y(e,"name",{value:a,configurable:!0}),"m");const j=u(async(e,a)=>{n(e),n(a),e=s(f(e)),a=s(f(a));let t;try{t=await i(a)}catch{}let o;try{o=await i(e)}catch(r){throw r.message=r.message.replace("lstat","ensureLink"),r}t&&h(o,t)||(await w(l(a)),await p(e,a))},"ensureLink");export{j as y};
@@ -1 +0,0 @@
1
- "use strict";var u=Object.defineProperty;var n=(t,e)=>u(t,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("node:fs/promises"),i=require("@visulima/path"),o=require("@visulima/path/utils"),l=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs"),h=require("./is-stats-identical-CPCumzsC.cjs"),m=require("./ensureDir-tKW3dSA0.cjs");var y=Object.defineProperty,d=n((t,e)=>y(t,"name",{value:e,configurable:!0}),"m");const p=d(async(t,e)=>{l.s(t),l.s(e),t=i.toNamespacedPath(o.toPath(t)),e=i.toNamespacedPath(o.toPath(e));let a;try{a=await s.lstat(e)}catch{}let c;try{c=await s.lstat(t)}catch(r){throw r.message=r.message.replace("lstat","ensureLink"),r}a&&h.l(c,a)||(await m.f(i.dirname(e)),await s.link(t,e))},"ensureLink");exports.y=p;
@@ -1 +0,0 @@
1
- var p=Object.defineProperty;var m=(t,e)=>p(t,"name",{value:e,configurable:!0});import{lstatSync as n,linkSync as l}from"node:fs";import{toNamespacedPath as c,dirname as f}from"@visulima/path";import{toPath as i}from"@visulima/path/utils";import{s}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";import{l as h}from"./is-stats-identical-CS5Y91zW.mjs";import{a as y}from"./ensureDirSync-hyBJv3ax.mjs";var u=Object.defineProperty,d=m((t,e)=>u(t,"name",{value:e,configurable:!0}),"o");const j=d((t,e)=>{s(t),s(e),t=c(i(t)),e=c(i(e));let o;try{o=n(e)}catch{}let a;try{a=n(t)}catch(r){throw r.message=r.message.replace("lstat","ensureLink"),r}o&&h(a,o)||(y(f(e)),l(t,e))},"ensureLinkSync");export{j as h};
@@ -1 +0,0 @@
1
- "use strict";var u=Object.defineProperty;var i=(t,e)=>u(t,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("node:fs"),n=require("@visulima/path"),o=require("@visulima/path/utils"),l=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs"),h=require("./is-stats-identical-CPCumzsC.cjs"),y=require("./ensureDirSync-DzJ1sUTo.cjs");var d=Object.defineProperty,m=i((t,e)=>d(t,"name",{value:e,configurable:!0}),"o");const S=m((t,e)=>{l.s(t),l.s(e),t=n.toNamespacedPath(o.toPath(t)),e=n.toNamespacedPath(o.toPath(e));let a;try{a=s.lstatSync(e)}catch{}let c;try{c=s.lstatSync(t)}catch(r){throw r.message=r.message.replace("lstat","ensureLink"),r}a&&h.l(c,a)||(y.a(n.dirname(e)),s.linkSync(t,e))},"ensureLinkSync");exports.h=S;
@@ -1 +0,0 @@
1
- var P=Object.defineProperty;var c=(i,a)=>P(i,"name",{value:a,configurable:!0});import{lstat as n,stat as e,symlink as S,readlink as v}from"node:fs/promises";import{toNamespacedPath as s,dirname as b,resolve as x}from"@visulima/path";import{toPath as f}from"@visulima/path/utils";import{s as l}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";import{g as p}from"./get-file-info-type-CaWGXRjY.mjs";import{l as w}from"./is-stats-identical-CS5Y91zW.mjs";import{o as E}from"./resolve-symlink-target-BofZSDIc.mjs";import{f as L}from"./ensureDir-CpMWmVZ0.mjs";import{n as y}from"./AlreadyExistsError-yT45kpVd.mjs";var T=Object.defineProperty,$=c((i,a)=>T(i,"name",{value:a,configurable:!0}),"f");const j=process.platform==="win32"||/^(?:msys|cygwin)$/.test(process.env.OSTYPE),B=$(async(i,a,d)=>{l(i),l(a);const o=E(i,a);a=s(f(a));try{if((await n(a)).isSymbolicLink()&&w(await e(o),await e(a))){const[r,t]=await Promise.all([e(o),e(a)]);if(w(r,t))return}}catch{}const h=await n(o),g=p(h);await L(b(a));const u=d??(j?"junction":g==="dir"?"dir":"file");try{await S(s(f(o)),a,u)}catch(r){if(r.code!=="EEXIST")throw r;const t=await n(a);if(!t.isSymbolicLink())throw new y("A "+p(t)+" already exists at the path: "+a);const k=await v(a),m=s(x(k));if(m!==o)throw new y("A symlink targeting to an undesired path already exists: "+a+" -> "+m)}},"ensureSymlink");export{B as R};
@@ -1 +0,0 @@
1
- "use strict";var P=Object.defineProperty;var c=(a,e)=>P(a,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("node:fs/promises"),r=require("@visulima/path"),l=require("@visulima/path/utils"),y=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs"),u=require("./get-file-info-type-BXcpoWEM.cjs"),d=require("./is-stats-identical-CPCumzsC.cjs"),S=require("./resolve-symlink-target-HnbdXA1S.cjs"),q=require("./ensureDir-tKW3dSA0.cjs"),m=require("./AlreadyExistsError-qYsUje4Q.cjs");var k=Object.defineProperty,v=c((a,e)=>k(a,"name",{value:e,configurable:!0}),"f");const T=process.platform==="win32"||/^(?:msys|cygwin)$/.test(process.env.OSTYPE),b=v(async(a,e,w)=>{y.s(a),y.s(e);const i=S.o(a,e);e=r.toNamespacedPath(l.toPath(e));try{if((await t.lstat(e)).isSymbolicLink()&&d.l(await t.stat(i),await t.stat(e))){const[s,n]=await Promise.all([t.stat(i),t.stat(e)]);if(d.l(s,n))return}}catch{}const f=await t.lstat(i),h=u.getFileInfoType(f);await q.f(r.dirname(e));const p=w??(T?"junction":h==="dir"?"dir":"file");try{await t.symlink(r.toNamespacedPath(l.toPath(i)),e,p)}catch(s){if(s.code!=="EEXIST")throw s;const n=await t.lstat(e);if(!n.isSymbolicLink())throw new m.n("A "+u.getFileInfoType(n)+" already exists at the path: "+e);const g=await t.readlink(e),o=r.toNamespacedPath(r.resolve(g));if(o!==i)throw new m.n("A symlink targeting to an undesired path already exists: "+e+" -> "+o)}},"ensureSymlink");exports.R=b;
@@ -1 +0,0 @@
1
- var k=Object.defineProperty;var c=(o,r)=>k(o,"name",{value:r,configurable:!0});import{lstatSync as s,statSync as t,symlinkSync as v,readlinkSync as P}from"node:fs";import{toNamespacedPath as m,dirname as b,resolve as x}from"@visulima/path";import{toPath as f}from"@visulima/path/utils";import{s as y}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";import{g as p}from"./get-file-info-type-CaWGXRjY.mjs";import{l}from"./is-stats-identical-CS5Y91zW.mjs";import{o as E}from"./resolve-symlink-target-BofZSDIc.mjs";import{a as L}from"./ensureDirSync-hyBJv3ax.mjs";import{n as d}from"./AlreadyExistsError-yT45kpVd.mjs";var T=Object.defineProperty,j=c((o,r)=>T(o,"name",{value:r,configurable:!0}),"f");const A=process.platform==="win32"||/^(?:msys|cygwin)$/.test(process.env.OSTYPE),B=j((o,r,h)=>{y(o),y(r);const e=E(o,r);r=m(f(r));try{if(s(r).isSymbolicLink()&&l(t(e),t(r))){const i=t(e),n=t(r);if(l(i,n))return}}catch{}const S=s(e),w=p(S);L(b(r));const g=h??(A?"junction":w==="dir"?"dir":"file");try{v(m(f(e)),r,g)}catch(i){if(i.code!=="EEXIST")throw i;const n=s(r);if(!n.isSymbolicLink())throw new d("A "+p(n)+" already exists at the path: "+r);const u=P(r),a=m(x(u));if(a!==e)throw new d("A symlink targeting to an undesired path already exists: "+r+" -> "+a)}},"ensureSymlinkSync");export{B as R};
@@ -1 +0,0 @@
1
- "use strict";var P=Object.defineProperty;var o=(n,e)=>P(n,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("node:fs"),s=require("@visulima/path"),y=require("@visulima/path/utils"),l=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs"),u=require("./get-file-info-type-BXcpoWEM.cjs"),S=require("./is-stats-identical-CPCumzsC.cjs"),q=require("./resolve-symlink-target-HnbdXA1S.cjs"),w=require("./ensureDirSync-DzJ1sUTo.cjs"),d=require("./AlreadyExistsError-qYsUje4Q.cjs");var k=Object.defineProperty,v=o((n,e)=>k(n,"name",{value:e,configurable:!0}),"f");const T=process.platform==="win32"||/^(?:msys|cygwin)$/.test(process.env.OSTYPE),b=v((n,e,f)=>{l.s(n),l.s(e);const r=q.o(n,e);e=s.toNamespacedPath(y.toPath(e));try{if(t.lstatSync(e).isSymbolicLink()&&S.l(t.statSync(r),t.statSync(e))){const i=t.statSync(r),a=t.statSync(e);if(S.l(i,a))return}}catch{}const h=t.lstatSync(r),m=u.getFileInfoType(h);w.a(s.dirname(e));const p=f??(T?"junction":m==="dir"?"dir":"file");try{t.symlinkSync(s.toNamespacedPath(y.toPath(r)),e,p)}catch(i){if(i.code!=="EEXIST")throw i;const a=t.lstatSync(e);if(!a.isSymbolicLink())throw new d.n("A "+u.getFileInfoType(a)+" already exists at the path: "+e);const g=t.readlinkSync(e),c=s.toNamespacedPath(s.resolve(g));if(c!==r)throw new d.n("A symlink targeting to an undesired path already exists: "+e+" -> "+c)}},"ensureSymlinkSync");exports.R=b;
@@ -1 +0,0 @@
1
- "use strict";var w=Object.defineProperty;var f=(r,t)=>w(r,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("node:fs/promises"),i=require("@visulima/path"),u=require("@visulima/path/utils"),v=require("./F_OK-B8R_JA-Q.cjs");var m=Object.defineProperty,y=f((r,t)=>m(r,"name",{value:t,configurable:!0}),"n");const b=y(async(r,t={})=>{if(typeof r!="string"&&!Array.isArray(r)&&typeof r!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const p=t.cwd?u.toPath(t.cwd):process.cwd();let e=i.resolve(p);const{root:n}=i.parse(e),l=u.toPath(t.stopAt??n),d=i.resolve(e,l),s=t.type??"file",g=y(async function(o){return typeof r=="function"?[await r(o)]:typeof r=="string"?[r]:Array.isArray(r)?r:[r]},"getMatchers");for(;e&&e!==d&&e!==n;){for await(const o of await g(e)){if(o===v.FIND_UP_STOP)return;if(o===void 0)continue;const a=i.isAbsolute(o)?o:i.resolve(e,o);try{const c=await h.stat(a);if(s==="file"&&c.isFile()||s==="directory"&&c.isDirectory())return a}catch{}}e=i.dirname(e)}},"findUp");exports.F=b;
@@ -1 +0,0 @@
1
- var g=Object.defineProperty;var c=(r,t)=>g(r,"name",{value:t,configurable:!0});import{stat as l}from"node:fs/promises";import{resolve as e,parse as h,isAbsolute as A,dirname as v}from"@visulima/path";import{toPath as y}from"@visulima/path/utils";import{a as b}from"./F_OK-BzMbdSs5.mjs";var P=Object.defineProperty,p=c((r,t)=>P(r,"name",{value:t,configurable:!0}),"n");const _=p(async(r,t={})=>{if(typeof r!="string"&&!Array.isArray(r)&&typeof r!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const m=t.cwd?y(t.cwd):process.cwd();let o=e(m);const{root:n}=h(o),u=y(t.stopAt??n),d=e(o,u),a=t.type??"file",w=p(async function(i){return typeof r=="function"?[await r(i)]:typeof r=="string"?[r]:Array.isArray(r)?r:[r]},"getMatchers");for(;o&&o!==d&&o!==n;){for await(const i of await w(o)){if(i===b)return;if(i===void 0)continue;const s=A(i)?i:e(o,i);try{const f=await l(s);if(a==="file"&&f.isFile()||a==="directory"&&f.isDirectory())return s}catch{}}o=v(o)}},"findUp");export{_ as F};
@@ -1 +0,0 @@
1
- var l=Object.defineProperty;var a=(r,t)=>l(r,"name",{value:t,configurable:!0});import{statSync as h}from"node:fs";import{resolve as i,parse as A,isAbsolute as v,dirname as w}from"@visulima/path";import{toPath as p}from"@visulima/path/utils";import{a as b}from"./F_OK-BzMbdSs5.mjs";var P=Object.defineProperty,y=a((r,t)=>P(r,"name",{value:t,configurable:!0}),"o");const U=y((r,t={})=>{if(typeof r!="string"&&!Array.isArray(r)&&typeof r!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const m=t.cwd?p(t.cwd):process.cwd();let o=i(m);const{root:n}=A(o),u=p(t.stopAt??n),d=i(o,u),f=t.type??"file",g=y(function(e){return typeof r=="function"?[r(e)]:typeof r=="string"?[r]:Array.isArray(r)?r:[r]},"getMatchers");for(;o&&o!==d&&o!==n;){for(const e of g(o)){if(e===b)return;if(e===void 0)continue;const s=v(e)?e:i(o,e);try{const c=h(s);if(f==="file"&&c.isFile()||f==="directory"&&c.isDirectory())return s}catch{}}o=w(o)}},"findUpSync");export{U as F};
@@ -1 +0,0 @@
1
- "use strict";var h=Object.defineProperty;var a=(r,t)=>h(r,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("node:fs"),n=require("@visulima/path"),u=require("@visulima/path/utils"),b=require("./F_OK-B8R_JA-Q.cjs");var m=Object.defineProperty,y=a((r,t)=>m(r,"name",{value:t,configurable:!0}),"o");const A=y((r,t={})=>{if(typeof r!="string"&&!Array.isArray(r)&&typeof r!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const p=t.cwd?u.toPath(t.cwd):process.cwd();let e=n.resolve(p);const{root:i}=n.parse(e),l=u.toPath(t.stopAt??i),d=n.resolve(e,l),s=t.type??"file",g=y(function(o){return typeof r=="function"?[r(o)]:typeof r=="string"?[r]:Array.isArray(r)?r:[r]},"getMatchers");for(;e&&e!==d&&e!==i;){for(const o of g(e)){if(o===b.FIND_UP_STOP)return;if(o===void 0)continue;const c=n.isAbsolute(o)?o:n.resolve(e,o);try{const f=v.statSync(c);if(s==="file"&&f.isFile()||s==="directory"&&f.isDirectory())return c}catch{}}e=n.dirname(e)}},"findUpSync");exports.F=A;
@@ -1 +0,0 @@
1
- var e=Object.defineProperty;var o=(r,t)=>e(r,"name",{value:t,configurable:!0});import{access as a}from"node:fs/promises";import{toPath as c}from"@visulima/path/utils";import{F as i}from"./F_OK-BzMbdSs5.mjs";import{s as m}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";var n=Object.defineProperty,s=o((r,t)=>n(r,"name",{value:t,configurable:!0}),"o");async function f(r,t=i){m(r),r=c(r);try{return await a(r,t),!0}catch{return!1}}o(f,"m");s(f,"isAccessible");export{f as m};
@@ -1 +0,0 @@
1
- "use strict";var s=Object.defineProperty;var r=(e,t)=>s(e,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("node:fs/promises"),a=require("@visulima/path/utils"),o=require("./F_OK-B8R_JA-Q.cjs"),n=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs");var u=Object.defineProperty,l=r((e,t)=>u(e,"name",{value:t,configurable:!0}),"o");async function i(e,t=o.F_OK){n.s(e),e=a.toPath(e);try{return await c.access(e,t),!0}catch{return!1}}r(i,"m");l(i,"isAccessible");exports.m=i;
@@ -1 +0,0 @@
1
- var e=Object.defineProperty;var o=(r,t)=>e(r,"name",{value:t,configurable:!0});import{accessSync as c}from"node:fs";import{toPath as m}from"@visulima/path/utils";import{F as a}from"./F_OK-BzMbdSs5.mjs";import{s as i}from"./assertValidFileOrDirectoryPath-CQmKNf2h.mjs";var n=Object.defineProperty,f=o((r,t)=>n(r,"name",{value:t,configurable:!0}),"o");function s(r,t=a){i(r),r=m(r);try{return c(r,t),!0}catch{return!1}}o(s,"m");f(s,"isAccessibleSync");export{s as m};
@@ -1 +0,0 @@
1
- "use strict";var i=Object.defineProperty;var r=(e,t)=>i(e,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("node:fs"),s=require("@visulima/path/utils"),o=require("./F_OK-B8R_JA-Q.cjs"),a=require("./assertValidFileOrDirectoryPath-BT5xYqBy.cjs");var u=Object.defineProperty,l=r((e,t)=>u(e,"name",{value:t,configurable:!0}),"o");function c(e,t=o.F_OK){a.s(e),e=s.toPath(e);try{return n.accessSync(e,t),!0}catch{return!1}}r(c,"m");l(c,"isAccessibleSync");exports.m=c;
@@ -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;
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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;
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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;
@@ -1 +0,0 @@
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;
@@ -1 +0,0 @@
1
- var i=Object.defineProperty;var t=(e,o)=>i(e,"name",{value:o,configurable:!0});import{toPath as d}from"@visulima/path/utils";import{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};
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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;
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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;
@@ -1 +0,0 @@
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;
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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;
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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;
@@ -1 +0,0 @@
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;
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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};