@visulima/fs 5.0.0-alpha.2 → 5.0.0-alpha.20

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 (223) hide show
  1. package/CHANGELOG.md +256 -0
  2. package/LICENSE.md +208 -131
  3. package/dist/eol.d.ts +31 -30
  4. package/dist/eol.js +3 -26
  5. package/dist/error.d.ts +273 -7
  6. package/dist/error.js +1 -7
  7. package/dist/glob-parent.d.ts +35 -0
  8. package/dist/glob-parent.js +1 -0
  9. package/dist/glob.d.ts +4 -0
  10. package/dist/glob.js +1 -0
  11. package/dist/index.d.ts +858 -36
  12. package/dist/index.js +1 -33
  13. package/dist/ini.d.ts +70 -0
  14. package/dist/ini.js +1 -0
  15. package/dist/is-glob.d.ts +34 -0
  16. package/dist/is-glob.js +1 -0
  17. package/dist/json5.d.ts +36 -0
  18. package/dist/json5.js +1 -0
  19. package/dist/jsonc.d.ts +65 -0
  20. package/dist/jsonc.js +1 -0
  21. package/dist/match.d.ts +46 -0
  22. package/dist/match.js +1 -0
  23. package/dist/packem_shared/AlreadyExistsError-CEu6_Tjb.js +1 -0
  24. package/dist/packem_shared/DirectoryError-ddlbUV8C.js +1 -0
  25. package/dist/packem_shared/F_OK-CAwY1qU7.js +1 -0
  26. package/dist/packem_shared/JSONError-D7h6PNWc.js +4 -0
  27. package/dist/packem_shared/NotEmptyError-DMh1o7UL.js +1 -0
  28. package/dist/packem_shared/NotFoundError-BPiW0icm.js +1 -0
  29. package/dist/packem_shared/PermissionError-B1Emi5a9.js +1 -0
  30. package/dist/packem_shared/WalkError-Olmh4908.js +1 -0
  31. package/dist/packem_shared/_commonjsHelpers-D6W6KoPK.js +1 -0
  32. package/dist/packem_shared/assertValidFileContents-BZFnXa7K.js +1 -0
  33. package/dist/packem_shared/assertValidFileOrDirectoryPath-DgPIPmZT.js +1 -0
  34. package/dist/packem_shared/build-rm-options-C1R4reBu.js +1 -0
  35. package/dist/packem_shared/collect-2KPTpCdX.js +1 -0
  36. package/dist/packem_shared/collectSync-BX55r_BH.js +1 -0
  37. package/dist/packem_shared/emptyDir-8utO028L.js +1 -0
  38. package/dist/packem_shared/emptyDirSync-Bk5fUX73.js +1 -0
  39. package/dist/packem_shared/ensureDir-CZ4oUFuo.js +1 -0
  40. package/dist/packem_shared/ensureDirSync-CoPWhbjM.js +1 -0
  41. package/dist/packem_shared/ensureFile-CF1cAAyh.js +1 -0
  42. package/dist/packem_shared/ensureFileSync-C3qR6naU.js +1 -0
  43. package/dist/packem_shared/ensureLink-LLLxlGHn.js +1 -0
  44. package/dist/packem_shared/ensureLinkSync-Dh_GtT8F.js +1 -0
  45. package/dist/packem_shared/ensureSymlink-D50kj2zl.js +1 -0
  46. package/dist/packem_shared/ensureSymlinkSync-BbVDPvI4.js +1 -0
  47. package/dist/packem_shared/findUp-BT07y_Me.js +1 -0
  48. package/dist/packem_shared/findUpSync-BvZiYsKJ.js +1 -0
  49. package/dist/packem_shared/get-file-info-type-CaWGXRjY.js +1 -0
  50. package/dist/packem_shared/glob-MHJQjR39.js +1 -0
  51. package/dist/packem_shared/glob-sync.d-D1IzfyFn.d.ts +54 -0
  52. package/dist/packem_shared/globSync-CwzlELgS.js +1 -0
  53. package/dist/packem_shared/index-CYIVJA0W.js +1 -0
  54. package/dist/packem_shared/index-DrapuBsB.js +1 -0
  55. package/dist/packem_shared/index-K-NNTkpb.js +11 -0
  56. package/dist/packem_shared/index-yGx8uzZs.js +1 -0
  57. package/dist/packem_shared/indexToLineColumn-BRSZFC6I-BKj3uzZt.js +6 -0
  58. package/dist/packem_shared/ini-preserve-CXc_xkpG.js +4 -0
  59. package/dist/packem_shared/is-stats-identical-CohsLtWy.js +1 -0
  60. package/dist/packem_shared/isAccessible-CDFxsAAo.js +1 -0
  61. package/dist/packem_shared/isAccessibleSync-5nzZWgin.js +1 -0
  62. package/dist/packem_shared/isFsCaseSensitive-CMZVY1A2.js +1 -0
  63. package/dist/packem_shared/json-error.d-DVILOyHc.d.ts +52 -0
  64. package/dist/packem_shared/jsonc-merge-CQMjx3Vw.js +2 -0
  65. package/dist/packem_shared/move-LmP6P9sn.js +1 -0
  66. package/dist/packem_shared/parseJson-Xx6vHYbv.js +1 -0
  67. package/dist/packem_shared/readFile-BAVMZg5e.js +1 -0
  68. package/dist/packem_shared/readFileSync-CGmzMUF2.js +1 -0
  69. package/dist/packem_shared/readIni-Cfl6HmTS.js +1 -0
  70. package/dist/packem_shared/readIniSync-DPg4UD0P.js +1 -0
  71. package/dist/packem_shared/readJson-kPx68Wv1.js +1 -0
  72. package/dist/packem_shared/readJson5-pXTL9nUE.js +1 -0
  73. package/dist/packem_shared/readJson5Sync-BedQc292.js +1 -0
  74. package/dist/packem_shared/readJsonSync-_HXNI3Se.js +1 -0
  75. package/dist/packem_shared/readJsonc-BzvuAXbT.js +1 -0
  76. package/dist/packem_shared/readJsoncSync-CVG1_QnX.js +1 -0
  77. package/dist/packem_shared/readToml-BO5CZK2P.js +1 -0
  78. package/dist/packem_shared/readTomlSync-1fKo0R52.js +1 -0
  79. package/dist/packem_shared/readYaml-DjK_Vqj1.js +1 -0
  80. package/dist/packem_shared/readYamlSync-C3h6KA2c.js +1 -0
  81. package/dist/packem_shared/remove-DH41Ov_c.js +1 -0
  82. package/dist/packem_shared/removeSync-50OEdnHd.js +1 -0
  83. package/dist/packem_shared/resolve-symlink-target-BofZSDIc.js +1 -0
  84. package/dist/packem_shared/sanitize-CU1xmyrg.js +1 -0
  85. package/dist/packem_shared/stripJsonComments-CzNR77MF.js +1 -0
  86. package/dist/packem_shared/to-uint-8-array-DwgaTasY.js +1 -0
  87. package/dist/packem_shared/types.d-BB9TGb5v.d.ts +1660 -0
  88. package/dist/packem_shared/walk-D01Qmmvz.js +1 -0
  89. package/dist/packem_shared/walk-include-DCiVAwMP.js +1 -0
  90. package/dist/packem_shared/walkSync-BknSdmKD.js +1 -0
  91. package/dist/packem_shared/writeFile-DNGaDOMX.js +1 -0
  92. package/dist/packem_shared/writeFileSync-CE1i-eMA.js +1 -0
  93. package/dist/packem_shared/writeIni-DG7U4ji0.js +4 -0
  94. package/dist/packem_shared/writeIniSync-Ldt6HFLb.js +4 -0
  95. package/dist/packem_shared/writeJson-BkGlq1Kv.js +4 -0
  96. package/dist/packem_shared/writeJson5-Btud4sQh.js +4 -0
  97. package/dist/packem_shared/writeJson5Sync-Iln3i1IV.js +4 -0
  98. package/dist/packem_shared/writeJsonSync-HndmyvEK.js +4 -0
  99. package/dist/packem_shared/writeJsonc-9oiamG16.js +4 -0
  100. package/dist/packem_shared/writeJsoncSync-BHBziPiK.js +4 -0
  101. package/dist/packem_shared/writeToml-Cj57wZ8B.js +1 -0
  102. package/dist/packem_shared/writeTomlSync-B34ZZp0e.js +1 -0
  103. package/dist/packem_shared/writeYaml-BhQX2yN9.js +1 -0
  104. package/dist/packem_shared/writeYamlSync-DG01FBeC.js +1 -0
  105. package/dist/size.d.ts +246 -246
  106. package/dist/size.js +1 -144
  107. package/dist/toml.d.ts +63 -0
  108. package/dist/toml.js +1 -0
  109. package/dist/utils.d.ts +103 -6
  110. package/dist/utils.js +1 -6
  111. package/dist/yaml.d.ts +13 -5
  112. package/dist/yaml.js +1 -4
  113. package/package.json +89 -36
  114. package/dist/constants.d.ts +0 -42
  115. package/dist/ensure/ensure-dir-sync.d.ts +0 -14
  116. package/dist/ensure/ensure-dir.d.ts +0 -14
  117. package/dist/ensure/ensure-file-sync.d.ts +0 -15
  118. package/dist/ensure/ensure-file.d.ts +0 -27
  119. package/dist/ensure/ensure-link-sync.d.ts +0 -16
  120. package/dist/ensure/ensure-link.d.ts +0 -16
  121. package/dist/ensure/ensure-symlink-sync.d.ts +0 -23
  122. package/dist/ensure/ensure-symlink.d.ts +0 -23
  123. package/dist/ensure/utils/get-file-info-type.d.ts +0 -7
  124. package/dist/ensure/utils/is-stats-identical.d.ts +0 -3
  125. package/dist/ensure/utils/resolve-symlink-target.d.ts +0 -2
  126. package/dist/error/already-exists-error.d.ts +0 -39
  127. package/dist/error/directory-error.d.ts +0 -47
  128. package/dist/error/json-error.d.ts +0 -52
  129. package/dist/error/not-empty-error.d.ts +0 -51
  130. package/dist/error/not-found-error.d.ts +0 -44
  131. package/dist/error/permission-error.d.ts +0 -45
  132. package/dist/error/walk-error.d.ts +0 -51
  133. package/dist/find/collect-sync.d.ts +0 -31
  134. package/dist/find/collect.d.ts +0 -35
  135. package/dist/find/find-up-sync.d.ts +0 -42
  136. package/dist/find/find-up.d.ts +0 -46
  137. package/dist/find/utils/glob-to-regexp.d.ts +0 -2
  138. package/dist/find/utils/walk-include.d.ts +0 -2
  139. package/dist/find/walk-sync.d.ts +0 -34
  140. package/dist/find/walk.d.ts +0 -37
  141. package/dist/is-accessible-sync.d.ts +0 -3
  142. package/dist/is-accessible.d.ts +0 -29
  143. package/dist/move/index.d.ts +0 -68
  144. package/dist/move/types.d.ts +0 -36
  145. package/dist/move/utils/internal-move-file-sync.d.ts +0 -3
  146. package/dist/move/utils/internal-move-file.d.ts +0 -3
  147. package/dist/move/utils/validate-same-directory.d.ts +0 -2
  148. package/dist/packem_shared/AlreadyExistsError-6Y9hjgMn.js +0 -27
  149. package/dist/packem_shared/DirectoryError-BfYPkIYP.js +0 -27
  150. package/dist/packem_shared/F_OK-MldBaGxb.js +0 -8
  151. package/dist/packem_shared/JSONError-BkHRnInH.js +0 -26
  152. package/dist/packem_shared/NotEmptyError-B21RUlVr.js +0 -27
  153. package/dist/packem_shared/NotFoundError-BIp61X6k.js +0 -27
  154. package/dist/packem_shared/PermissionError-CjoiJgip.js +0 -27
  155. package/dist/packem_shared/WalkError-DUdQd6FT.js +0 -24
  156. package/dist/packem_shared/assertValidFileContents-BmcLtsGd.js +0 -7
  157. package/dist/packem_shared/assertValidFileOrDirectoryPath-8HANmVjk.js +0 -7
  158. package/dist/packem_shared/collect-DcBwsYYd.js +0 -14
  159. package/dist/packem_shared/collectSync-Bkjf9Dbm.js +0 -14
  160. package/dist/packem_shared/emptyDir-CYB5Tict.js +0 -43
  161. package/dist/packem_shared/emptyDirSync-BD8-1Ytl.js +0 -41
  162. package/dist/packem_shared/ensureDir-C_kuQ5Ik.js +0 -53
  163. package/dist/packem_shared/ensureDirSync-CI5g-uBI.js +0 -53
  164. package/dist/packem_shared/ensureFile-BUtXGlGT.js +0 -47
  165. package/dist/packem_shared/ensureFileSync-C8hASR-1.js +0 -47
  166. package/dist/packem_shared/ensureLink-BPnAG5-P.js +0 -54
  167. package/dist/packem_shared/ensureLinkSync-B-Z7X0ub.js +0 -54
  168. package/dist/packem_shared/ensureSymlink-U5B6J0BN.js +0 -73
  169. package/dist/packem_shared/ensureSymlinkSync-DHnZj-9F.js +0 -74
  170. package/dist/packem_shared/findUp-BSnyGqer.js +0 -85
  171. package/dist/packem_shared/findUpSync-jRHbSCMV.js +0 -85
  172. package/dist/packem_shared/get-file-info-type-FD4-jsyg.js +0 -14
  173. package/dist/packem_shared/index-CHM-in-V.js +0 -100
  174. package/dist/packem_shared/is-stats-identical-D8FxpvQU.js +0 -3
  175. package/dist/packem_shared/isAccessible-DuVrTNFV.js +0 -38
  176. package/dist/packem_shared/isAccessibleSync-DI8mM0fA.js +0 -38
  177. package/dist/packem_shared/isFsCaseSensitive-D-ayleCy.js +0 -62
  178. package/dist/packem_shared/move-DbpW5_vA.js +0 -134
  179. package/dist/packem_shared/parseJson-C8xb-3LR.js +0 -231
  180. package/dist/packem_shared/readFile-Iz7kvCCk.js +0 -65
  181. package/dist/packem_shared/readFileSync-6GEIrOnl.js +0 -53
  182. package/dist/packem_shared/readJson-vddQ97Ll.js +0 -22
  183. package/dist/packem_shared/readJsonSync-DzeAdYZl.js +0 -22
  184. package/dist/packem_shared/readYaml-D5q2a0e1.js +0 -10
  185. package/dist/packem_shared/readYamlSync-DMV4U-gi.js +0 -10
  186. package/dist/packem_shared/remove-_oDY3uKo.js +0 -38
  187. package/dist/packem_shared/removeSync-DETRj7Qn.js +0 -38
  188. package/dist/packem_shared/resolve-symlink-target-Kh4GovFf.js +0 -16
  189. package/dist/packem_shared/sanitize-lOzE6k2A.js +0 -205
  190. package/dist/packem_shared/stripJsonComments-vo4k0mpF.js +0 -19
  191. package/dist/packem_shared/to-uint-8-array-Dz2nF1y1.js +0 -19
  192. package/dist/packem_shared/walk-BhTbpr3y.js +0 -115
  193. package/dist/packem_shared/walk-include-CZco7BvN.js +0 -16
  194. package/dist/packem_shared/walkSync-DDBq95s8.js +0 -114
  195. package/dist/packem_shared/writeFile-DSHERs0Z.js +0 -83
  196. package/dist/packem_shared/writeFileSync-CJp1kXQR.js +0 -83
  197. package/dist/packem_shared/writeJson-C0OfLDbe.js +0 -50
  198. package/dist/packem_shared/writeJsonSync-Cs21FE7v.js +0 -50
  199. package/dist/packem_shared/writeYaml-n4xzYN9a.js +0 -24
  200. package/dist/packem_shared/writeYamlSync-DnOEnP10.js +0 -24
  201. package/dist/read/read-file-sync.d.ts +0 -37
  202. package/dist/read/read-file.d.ts +0 -41
  203. package/dist/read/read-json-sync.d.ts +0 -5
  204. package/dist/read/read-json.d.ts +0 -5
  205. package/dist/read/read-yaml-sync.d.ts +0 -4
  206. package/dist/read/read-yaml.d.ts +0 -4
  207. package/dist/remove/empty-dir-sync.d.ts +0 -23
  208. package/dist/remove/empty-dir.d.ts +0 -28
  209. package/dist/remove/remove-sync.d.ts +0 -27
  210. package/dist/remove/remove.d.ts +0 -32
  211. package/dist/sanitize.d.ts +0 -31
  212. package/dist/types.d.ts +0 -304
  213. package/dist/utils/assert-valid-file-contents.d.ts +0 -27
  214. package/dist/utils/assert-valid-file-or-directory-path.d.ts +0 -26
  215. package/dist/utils/parse-json.d.ts +0 -5
  216. package/dist/utils/strip-json-comments.d.ts +0 -44
  217. package/dist/write/utils/to-uint-8-array.d.ts +0 -2
  218. package/dist/write/write-file-sync.d.ts +0 -30
  219. package/dist/write/write-file.d.ts +0 -30
  220. package/dist/write/write-json-sync.d.ts +0 -29
  221. package/dist/write/write-json.d.ts +0 -30
  222. package/dist/write/write-yaml-sync.d.ts +0 -4
  223. package/dist/write/write-yaml.d.ts +0 -4
@@ -0,0 +1,11 @@
1
+ var k=Object.defineProperty;var c=(x,s)=>k(x,"name",{value:s,configurable:!0});import"./_commonjsHelpers-D6W6KoPK.js";var v,g;function q(){if(g)return v;g=1;var x=Object.defineProperty,s=c((u,f)=>x(u,"name",{value:f,configurable:!0}),"l");/*!
2
+ * is-extglob <https://github.com/jonschlinkert/is-extglob>
3
+ *
4
+ * Copyright (c) 2014-2016, Jon Schlinkert.
5
+ * Licensed under the MIT License.
6
+ */return v=s(function(u){if(typeof u!="string"||u==="")return!1;for(var f;f=/(\\).|([@?!+*]\(.*\))/g.exec(u);){if(f[2])return!0;u=u.slice(f.index+f[0].length)}return!1},"isExtglob"),v}c(q,"requireIsExtglob");var d,O;function G(){if(O)return d;O=1;var x=Object.defineProperty,s=c((t,r)=>x(t,"name",{value:r,configurable:!0}),"x");/*!
7
+ * is-glob <https://github.com/jonschlinkert/is-glob>
8
+ *
9
+ * Copyright (c) 2014-2017, Jon Schlinkert.
10
+ * Released under the MIT License.
11
+ */var u=q(),f={"{":"}","(":")","[":"]"},h=s(function(t){if(t[0]==="!")return!0;for(var r=0,n=-2,a=-2,l=-2,o=-2,e=-2;r<t.length;){if(t[r]==="*"||t[r+1]==="?"&&/[\].+)]/.test(t[r])||a!==-1&&t[r]==="["&&t[r+1]!=="]"&&(a<r&&(a=t.indexOf("]",r)),a>r&&(e===-1||e>a||(e=t.indexOf("\\",r),e===-1||e>a)))||l!==-1&&t[r]==="{"&&t[r+1]!=="}"&&(l=t.indexOf("}",r),l>r&&(e=t.indexOf("\\",r),e===-1||e>l))||o!==-1&&t[r]==="("&&t[r+1]==="?"&&/[:!=]/.test(t[r+2])&&t[r+3]!==")"&&(o=t.indexOf(")",r),o>r&&(e=t.indexOf("\\",r),e===-1||e>o))||n!==-1&&t[r]==="("&&t[r+1]!=="|"&&(n<r&&(n=t.indexOf("|",r)),n!==-1&&t[n+1]!==")"&&(o=t.indexOf(")",n),o>n&&(e=t.indexOf("\\",n),e===-1||e>o))))return!0;if(t[r]==="\\"){var E=t[r+1];r+=2;var i=f[E];if(i){var b=t.indexOf(i,r);b!==-1&&(r=b+1)}if(t[r]==="!")return!0}else r++}return!1},"strictCheck"),p=s(function(t){if(t[0]==="!")return!0;for(var r=0;r<t.length;){if(/[*?{}()[\]]/.test(t[r]))return!0;if(t[r]==="\\"){var n=t[r+1];r+=2;var a=f[n];if(a){var l=t.indexOf(a,r);l!==-1&&(r=l+1)}if(t[r]==="!")return!0}else r++}return!1},"relaxedCheck");return d=s(function(t,r){if(typeof t!="string"||t==="")return!1;if(u(t))return!0;var n=h;return r&&r.strict===!1&&(n=p),n(t)},"isGlob"),d}c(G,"requireIsGlob");export{G as r};
@@ -0,0 +1 @@
1
+ var Et=Object.defineProperty;var l=(t,e)=>Et(t,"name",{value:e,configurable:!0});import{createRequire as Rt}from"node:module";import{s as F}from"./index-DrapuBsB.js";const Wt=Rt(import.meta.url),A=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=l(t=>{if(typeof A<"u"&&A.versions&&A.versions.node){const[e,s]=A.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return A.getBuiltinModule(t)}return Wt(t)},"__cjs_getBuiltinModule"),K=_("fs"),Ct={...K,default:K},{statSync:Ot,stat:Bt,realpathSync:Mt,realpath:Tt,readdirSync:It,readdir:Lt}=_("fs"),{sep:V,basename:Gt,dirname:O,resolve:X,normalize:zt,relative:Ut,posix:k,isAbsolute:Nt}=_("path"),{fileURLToPath:Qt}=_("url"),{createRequire:Yt}=_("module");var Ht=Object.defineProperty,u=l((t,e)=>Ht(t,"name",{value:e,configurable:!0}),"r"),Z=Yt(import.meta.url);function tt(t){let e=zt(t);return e.length>1&&e[e.length-1]===V&&(e=e.substring(0,e.length-1)),e}l(tt,"M$1");u(tt,"cleanPath");const Kt=/[\\/]/g;function T(t,e){return t.replace(Kt,e)}l(T,"D$1");u(T,"convertSlashes");const Zt=/^[a-z]:[\\/]$/i;function et(t){return t==="/"||Zt.test(t)}l(et,"T$1");u(et,"isRootDirectory");function q(t,e){const{resolvePaths:s,normalizePath:r,pathSeparator:n}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(s&&(t=X(t)),(r||o)&&(t=tt(t)),t===".")return"";const i=t[t.length-1]!==n;return T(i?t+n:t,n)}l(q,"w");u(q,"normalizePath");function I(t,e){return e+t}l(I,"P");u(I,"joinPathWithBasePath");function st(t,e){return function(s,r){return r.startsWith(t)?r.slice(t.length)+s:T(Ut(t,r),e.pathSeparator)+e.pathSeparator+s}}l(st,"X");u(st,"joinPathWithRelativePath");function rt(t){return t}l(rt,"H");u(rt,"joinPath");function nt(t,e,s){return e+t+s}l(nt,"U$1");u(nt,"joinDirectoryPath");function it(t,e){const{relativePaths:s,includeBasePath:r}=e;return s&&t?st(t,e):r?I:rt}l(it,"J");u(it,"build$7");function ot(t){return function(e,s){s.push(e.substring(t.length)||".")}}l(ot,"K$1");u(ot,"pushDirectoryWithRelativePath");function ut(t){return function(e,s,r){const n=e.substring(t.length)||".";r.every(o=>o(n,!0))&&s.push(n)}}l(ut,"V");u(ut,"pushDirectoryFilterWithRelativePath");const Jt=u((t,e)=>{e.push(t||".")},"pushDirectory"),Vt=u((t,e,s)=>{const r=t||".";s.every(n=>n(r,!0))&&e.push(r)},"pushDirectoryFilter"),Xt=u(()=>{},"empty$2");function lt(t,e){const{includeDirs:s,filters:r,relativePaths:n}=e;return s?n?r&&r.length?ut(t):ot(t):r&&r.length?Vt:Jt:Xt}l(lt,"st$1");u(lt,"build$6");const te=u((t,e,s,r)=>{r.every(n=>n(t,!1))&&s.files++},"pushFileFilterAndCount"),ee=u((t,e,s,r)=>{r.every(n=>n(t,!1))&&e.push(t)},"pushFileFilter"),se=u((t,e,s,r)=>{s.files++},"pushFileCount"),re=u((t,e)=>{e.push(t)},"pushFile"),ne=u(()=>{},"empty$1");function at(t){const{excludeFiles:e,filters:s,onlyCounts:r}=t;return e?ne:s&&s.length?r?te:ee:r?se:re}l(at,"ut$1");u(at,"build$5");const ie=u(t=>t,"getArray"),oe=u(()=>[""].slice(0,0),"getArrayGroup");function ct(t){return t.group?oe:ie}l(ct,"ct$1");u(ct,"build$4");const ue=u((t,e,s)=>{t.push({directory:e,files:s,dir:e})},"groupFiles"),le=u(()=>{},"empty");function ht(t){return t.group?ue:le}l(ht,"ft$1");u(ht,"build$3");const ae=u(function(t,e,s){const{queue:r,fs:n,options:{suppressErrors:o}}=e;r.enqueue(),n.realpath(t,(i,a)=>{if(i)return r.dequeue(o?null:i,e);n.stat(a,(m,y)=>{if(m)return r.dequeue(o?null:m,e);if(y.isDirectory()&&L(t,a,e))return r.dequeue(null,e);s(y,a),r.dequeue(null,e)})})},"resolveSymlinksAsync"),ce=u(function(t,e,s){const{queue:r,fs:n,options:{suppressErrors:o}}=e;r.enqueue();try{const i=n.realpathSync(t),a=n.statSync(i);if(a.isDirectory()&&L(t,i,e))return;s(a,i)}catch(i){if(!o)throw i}},"resolveSymlinks");function pt(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?ce:ae}l(pt,"gt$1");u(pt,"build$2");function L(t,e,s){if(s.options.useRealPaths)return ft(e,s);let r=O(t),n=1;for(;r!==s.root&&n<2;){const o=s.symlinks.get(r);o&&(o===e||o.startsWith(e)||e.startsWith(o))?n++:r=O(r)}return s.symlinks.set(t,e),n>1}l(L,"E$1");u(L,"isRecursive");function ft(t,e){return e.visited.includes(t+e.options.pathSeparator)}l(ft,"dt$1");u(ft,"isRecursiveUsingRealPaths");const he=u(t=>t.counts,"onlyCountsSync"),pe=u(t=>t.groups,"groupsSync"),fe=u(t=>t.paths,"defaultSync"),ge=u(t=>t.paths.slice(0,t.options.maxFiles),"limitFilesSync"),de=u((t,e,s)=>(j(e,s,t.counts,t.options.suppressErrors),null),"onlyCountsAsync"),ye=u((t,e,s)=>(j(e,s,t.paths,t.options.suppressErrors),null),"defaultAsync"),me=u((t,e,s)=>(j(e,s,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),"limitFilesAsync"),be=u((t,e,s)=>(j(e,s,t.groups,t.options.suppressErrors),null),"groupsAsync");function j(t,e,s,r){e(t&&!r?t:null,s)}l(j,"y");u(j,"report");function gt(t,e){const{onlyCounts:s,group:r,maxFiles:n}=t;return s?e?he:de:r?e?pe:be:n?e?ge:me:e?fe:ye}l(gt,"Et");u(gt,"build$1");const dt={withFileTypes:!0},ve=u((t,e,s,r,n)=>{if(t.queue.enqueue(),r<0)return t.queue.dequeue(null,t);const{fs:o}=t;t.visited.push(e),t.counts.directories++,o.readdir(e||".",dt,(i,a=[])=>{n(a,s,r),t.queue.dequeue(t.options.suppressErrors?null:i,t)})},"walkAsync"),Pe=u((t,e,s,r,n)=>{const{fs:o}=t;if(r<0)return;t.visited.push(e),t.counts.directories++;let i=[];try{i=o.readdirSync(e||".",dt)}catch(a){if(!t.options.suppressErrors)throw a}n(i,s,r)},"walkSync");function yt(t){return t?Pe:ve}l(yt,"xt$1");u(yt,"build");var we=class{static{l(this,"_t")}static{u(this,"Queue")}count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},$e=class{static{l(this,"At")}static{u(this,"Counter")}_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},Se=class{static{l(this,"Wt")}static{u(this,"Aborter")}aborted=!1;abort(){this.aborted=!0}},mt=class{static{l(this,"q")}static{u(this,"Walker")}root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,s){this.isSynchronous=!s,this.callbackInvoker=gt(e,this.isSynchronous),this.root=q(t,e),this.state={root:et(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new $e,options:e,queue:new we((r,n)=>this.callbackInvoker(n,r,s)),symlinks:new Map,visited:[""].slice(0,0),controller:new Se,fs:e.fs||Ct},this.joinPath=it(this.root,e),this.pushDirectory=lt(this.root,e),this.pushFile=at(e),this.getArray=ct(e),this.groupFiles=ht(e),this.resolveSymlink=pt(e,this.isSynchronous),this.walkDirectory=yt(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=u((t,e,s)=>{const{paths:r,options:{filters:n,resolveSymlinks:o,excludeSymlinks:i,exclude:a,maxFiles:m,signal:y,useRealPaths:v,pathSeparator:f},controller:P}=this.state;if(P.aborted||y&&y.aborted||m&&r.length>m)return;const c=this.getArray(this.state.paths);for(let d=0;d<t.length;++d){const p=t[d];if(p.isFile()||p.isSymbolicLink()&&!o&&!i){const h=this.joinPath(p.name,e);this.pushFile(h,c,this.state.counts,n)}else if(p.isDirectory()){let h=nt(p.name,e,this.state.options.pathSeparator);if(a&&a(p.name,h))continue;this.pushDirectory(h,r,n),this.walkDirectory(this.state,h,h,s-1,this.walk)}else if(this.resolveSymlink&&p.isSymbolicLink()){let h=I(p.name,e);this.resolveSymlink(h,this.state,(R,b)=>{if(R.isDirectory()){if(b=q(b,this.state.options),a&&a(p.name,v?b:h+f))return;this.walkDirectory(this.state,b,v?b:h+f,s-1,this.walk)}else{b=v?b:h;const x=Gt(b),W=q(O(b),this.state.options);b=this.joinPath(x,W),this.pushFile(b,c,this.state.counts,n)}})}}this.groupFiles(this.state.groups,e,c)},"walk")};function bt(t,e){return new Promise((s,r)=>{G(t,e,(n,o)=>{if(n)return r(n);s(o)})})}l(bt,"Ct");u(bt,"promise");function G(t,e,s){new mt(t,e,s).start()}l(G,"x");u(G,"callback");function vt(t,e){return new mt(t,e).start()}l(vt,"jt");u(vt,"sync");var J=class{static{l(this,"F")}static{u(this,"APIBuilder")}constructor(t,e){this.root=t,this.options=e}withPromise(){return bt(this.root,this.options)}withCallback(t){G(this.root,this.options,t)}sync(){return vt(this.root,this.options)}};let Pt=null;try{Z.resolve("picomatch"),Pt=Z("picomatch")}catch{}var ke=class{static{l(this,"$t")}static{u(this,"Builder")}globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:V,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new J(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new J(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){const s=this.globFunction||Pt;if(!s)throw new Error("Please specify a glob function to use glob matching.");var r=this.globCache[t.join("\0")];return r||(r=s(t,...e),this.globCache[t.join("\0")]=r),this.options.filters.push(n=>r(n)),this}},Fe=Object.defineProperty,g=l((t,e)=>Fe(t,"name",{value:e,configurable:!0}),"a");const De=Array.isArray,wt=/\\/g,$t=process.platform==="win32",xe=/^(\/?\.\.)+$/;function B(t,e={}){const s=t.length,r=Array(s),n=Array(s);let o,i;for(o=0;o<s;o++){const a=z(t[o]);r[o]=a;const m=a.length,y=Array(m);for(i=0;i<m;i++)y[i]=F(a[i],e);n[o]=y}return a=>{const m=a.split("/");if(m[0]===".."&&xe.test(a))return!0;for(o=0;o<s;o++){const y=r[o],v=n[o],f=m.length,P=Math.min(f,y.length);for(i=0;i<P;){const c=y[i];if(c.includes("/"))return!0;if(!v[i](m[i]))break;if(!e.noglobstar&&c==="**")return!0;i++}if(i===f)return!0}return!1}}l(B,"D");g(B,"getPartialMatcher");const Ae=/^[A-Z]:\/$/i,_e=$t?t=>Ae.test(t):t=>t==="/";function M(t,e,s){if(t===e||e.startsWith(`${t}/`)){if(s){const n=t.length+ +!_e(t);return(o,i)=>o.slice(n,i?-1:void 0)||"."}const r=e.slice(t.length+1);return r?(n,o)=>{if(n===".")return r;const i=`${r}/${n}`;return o?i.slice(0,-1):i}:(n,o)=>o&&n!=="."?n.slice(0,-1):n}return s?r=>k.relative(t,r)||".":r=>k.relative(t,`${e}/${r}`)||"."}l(M,"M");g(M,"buildFormat");function St(t,e){if(e.startsWith(`${t}/`)){const s=e.slice(t.length+1);return r=>`${s}/${r}`}return s=>{const r=k.relative(t,`${e}/${s}`);return s[s.length-1]==="/"&&r!==""?`${r}/`:r||"."}}l(St,"at");g(St,"buildRelative");const je={parts:!0};function z(t){var e;const s=F.scan(t,je);return!((e=s.parts)===null||e===void 0)&&e.length?s.parts:[t]}l(z,"N");g(z,"splitPattern");const qe=/\\(?![()[\]{}!+@])/g;function Ee(t){return kt(t)}l(Ee,"ut");g(Ee,"convertPosixPathToPattern");function Re(t){return Ft(t).replace(qe,"/")}l(Re,"ft");g(Re,"convertWin32PathToPattern");const We=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Ce=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,kt=g(t=>t.replace(We,"\\$&"),"escapePosixPath"),Ft=g(t=>t.replace(Ce,"\\$&"),"escapeWin32Path"),Oe=$t?Ft:kt;function Dt(t,e){if(e?.caseSensitiveMatch===!1)return!0;const s=F.scan(t);return s.isGlob||s.negated}l(Dt,"k");g(Dt,"isDynamicPattern");function D(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}l(D,"E");g(D,"log");function U(t){return typeof t=="string"?[t]:t??[]}l(U,"W");g(U,"ensureStringArray");const Be=/^(\/?\.\.)+/,Me=/\\(?=[()[\]{}!*+?@|])/g;function E(t,e,s,r){var n;const o=e.cwd;let i=t;t[t.length-1]==="/"&&(i=t.slice(0,-1));const a=i.lastIndexOf("/"),m=(a===-1?i:i.slice(a+1)).startsWith("!(");i[i.length-1]!=="*"&&!m&&e.expandDirectories&&(i+="/**");const y=Oe(o);i=Nt(i.replace(Me,""))?k.relative(y,i):k.normalize(i);const v=(n=Be.exec(i))===null||n===void 0?void 0:n[0],f=z(i);if(v){const c=(v.length+1)/3;let d=0;const p=y.split("/");for(;d<c&&f[d+c]===p[p.length+d-c];)i=i.slice(0,(c-d-1)*3)+i.slice((c-d)*3+f[d+c].length+1)||".",d++;const h=k.join(o,v.slice(d*3));h[0]!=="."&&s.root.length>h.length&&(s.root=h,s.depthOffset=-c+d)}if(!r&&s.depthOffset>=0){var P;(P=s.commonPath)!==null&&P!==void 0||(s.commonPath=f);const c=[],d=Math.min(s.commonPath.length,f.length);for(let p=0;p<d;p++){const h=f[p];if(h==="**"&&!f[p+1]){c.pop();break}if(p===f.length-1||h!==s.commonPath[p]||Dt(h))break;c.push(h)}s.depthOffset=c.length,s.commonPath=c,s.root=c.length>0?k.join(o,...c):o}return i}l(E,"$");g(E,"normalizePattern");function xt(t,e,s){const r=[],n=[],o=[];for(const i of t.ignore)i&&(i[0]!=="!"||i[1]==="("?n.push(E(i,t,s,!0)):o.push(i.slice(1)));for(const i of e)i&&(i[0]!=="!"||i[1]==="("?r.push(E(i,t,s,!1)):(i[1]!=="!"||i[2]==="(")&&n.push(E(i.slice(1),t,s,!0)));return{match:r,ignore:n,unignore:o}}l(xt,"St");g(xt,"processPatterns");function At(t,e){const s=t.cwd,r={root:s,depthOffset:0},n=xt(t,e,r);t.debug&&D("internal processing patterns:",n);const{absolute:o,caseSensitiveMatch:i,debug:a,dot:m,followSymbolicLinks:y,onlyDirectories:v}=t,f=r.root.replace(wt,""),P={dot:m,nobrace:t.braceExpansion===!1,nocase:!i,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},c=n.unignore.length>0,d=c?F(n.unignore,P):void 0,p=c?B(n.unignore,P):void 0,h=F(n.match,{...P,ignore:n.ignore,onIgnore:d?$=>d($.output)&&F.constants.UNIGNORE:void 0}),R=F(n.ignore,P),b=B(n.match,P),x=M(s,f,o),W=o?x:M(s,f,!0),jt=n.match.length>0&&n.match.every($=>$==="**"||$==="**/*"),C=n.ignore.length>0||c||!jt?($,S)=>{const w=W(S,!0);return w==="."||p&&p(w)?!1:!b(w)||R(w)}:void 0;let Y;t.deep!==void 0&&(Y=Math.round(t.deep-r.depthOffset));const qt=new ke({filters:[a?($,S)=>{const w=x($,S),H=h(w);return H&&D(`matched ${w}`),H}:($,S)=>{const w=x($,S);return h(w)}],exclude:a&&C?($,S)=>{const w=C($,S);return D(`${w?"skipped":"crawling"} ${S}`),w}:C,fs:t.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:y,excludeSymlinks:!y,excludeFiles:v,includeDirs:v||!t.onlyFiles,maxDepth:Y,signal:t.signal}).crawl(f);return t.debug&&D("internal properties:",{...r,root:f}),[qt,s!==f&&!o&&St(s,f)]}l(At,"vt");g(At,"buildCrawler");function N(t,e){if(e)for(let s=t.length-1;s>=0;s--)t[s]=e(t[s]);return t}l(N,"U");g(N,"formatPaths");const Te={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function _t(t){const e={...Te,...t};return e.cwd=(e.cwd instanceof URL?Qt(e.cwd):X(e.cwd)).replace(wt,"/"),e.ignore=U(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||Lt,readdirSync:e.fs.readdirSync||It,realpath:e.fs.realpath||Tt,realpathSync:e.fs.realpathSync||Mt,stat:e.fs.stat||Bt,statSync:e.fs.statSync||Ot}),e.debug&&D("globbing with options:",e),e}l(_t,"pt");g(_t,"getOptions");function Q(t,e={}){var s;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const r=De(t)||typeof t=="string",n=U((s=r?t:t.patterns)!==null&&s!==void 0?s:"**/*"),o=_t(r?e:t);return n.length>0?At(o,n):[]}l(Q,"G");g(Q,"getCrawler");async function Ie(t,e){const[s,r]=Q(t,e);return s?N(await s.withPromise(),r):[]}l(Ie,"bt");g(Ie,"glob");function Le(t,e){const[s,r]=Q(t,e);return s?N(s.sync(),r):[]}l(Le,"xt");g(Le,"globSync");export{Ie as b,Le as x};
@@ -0,0 +1,6 @@
1
+ var W=Object.defineProperty;var $=(e,r)=>W(e,"name",{value:r,configurable:!0});var T=Object.defineProperty,B=$((e,r)=>T(e,"name",{value:r,configurable:!0}),"A"),C=Object.defineProperty,j=B((e,r)=>C(e,"name",{value:r,configurable:!0}),"$"),F=Object.defineProperty,G=j((e,r)=>F(e,"name",{value:r,configurable:!0}),"r$1");const I=G(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
2
+ `),"normalizeLF"),E=globalThis.process??Object.create(null),O={versions:{}},k=new Proxy(E,{get(e,r){if(r in e)return e[r];if(r in O)return O[r]}});var N=Object.defineProperty,_=j((e,r)=>N(e,"name",{value:r,configurable:!0}),"b");const z=_((e,r,l,t)=>{const a={column:0,line:-1,...e.start},c={...a,...e.end},i=a.line,o=a.column,g=c.line,m=c.column;let p=Math.max(i-(l+1),0),b=Math.min(r.length,g+t);i===-1&&(p=0),g===-1&&(b=r.length);const y=g-i,s={};if(y)for(let n=0;n<=y;n++){const u=n+i;if(!o)s[u]=!0;else if(n===0){const f=r[u-1]?.length;s[u]=[o,(f??0)-o+1]}else if(n===y)s[u]=[0,m];else{const f=r[u-n]?.length;s[u]=[0,f]}}else o===m?s[i]=o?[o,0]:!0:s[i]=[o,(m??0)-(o??0)];return{end:b,markerLines:s,start:p}},"getMarkerLines");var q=Object.defineProperty,v=j((e,r)=>q(e,"name",{value:r,configurable:!0}),"t");const D=k.platform==="win32"&&!k.env?.WT_SESSION?">":"❯",Y=v((e,r,l)=>{const t={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...l,color:{gutter:v(n=>n,"gutter"),marker:v(n=>n,"marker"),message:v(n=>n,"message"),...l?.color}},a=typeof r.start.column=="number";let c=I(e).split(`
3
+ `);typeof t.tabWidth=="number"&&(c=c.map(n=>n.replaceAll(" "," ".repeat(t.tabWidth))));const{end:i,markerLines:o,start:g}=z(r,c,t.linesAbove,t.linesBelow),m=String(i).length,{gutter:p,marker:b,message:y}=t.color;let s=c.slice(g,i).map((n,u)=>{const f=g+1+u,h=o[f],S=` ${String(f)}`.slice(-m),w=!o[f+1],d=` ${S}${t.showGutter?" |":""}`;if(h){let A="";if(Array.isArray(h)){const L=n.replaceAll(/[^\t]/g," ").slice(0,Math.max(h[0]-1,0)),M=h[1]||1;A=[`
4
+ `,t.prefix+p(d.replaceAll(/\d/g," "))," ",L,b("^").repeat(M)].join(""),w&&t.message&&(A+=` ${y(t.message)}`)}return[t.prefix+b(D),p(d),n.length>0?` ${n}`:"",A].join("")}return`${t.prefix} ${p(d)}${n.length>0?` ${n}`:""}`}).join(`
5
+ `);return t.message&&!a&&(s=`${t.prefix+" ".repeat(m+1)+t.message}
6
+ ${s}`),s},"codeFrame");var H=Object.defineProperty,J=$((e,r)=>H(e,"name",{value:r,configurable:!0}),"s"),K=Object.defineProperty,Q=J((e,r)=>K(e,"name",{value:r,configurable:!0}),"o"),R=Object.defineProperty,x=Q((e,r)=>R(e,"name",{value:r,configurable:!0}),"l");const P=x((e,r)=>{let l=0,t=r.length-2;for(;l<t;){const a=l+(t-l>>1);if(e<r[a])t=a-1;else if(e>=r[a+1])l=a+1;else{l=a;break}}return l},"binarySearch"),U=/\n|\r(?!\n)/,V=x(e=>e.split(U).reduce((r,l)=>(r.push(r.at(-1)+l.length+1),r),[0]),"getLineStartIndexes"),Z=x((e,r,l)=>{const t=l?.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 c=V(e),i=P(r,c);return{column:r-c[i]+1,line:i+1}}const a=P(r,e);return{column:r-e[a]+1,line:a+1}},"indexToLineColumn");export{Y as N,Z as b};
@@ -0,0 +1,4 @@
1
+ var V=Object.defineProperty;var m=(e,t)=>V(e,"name",{value:t,configurable:!0});var D=Object.defineProperty,o=m((e,t)=>D(e,"name",{value:t,configurable:!0}),"o");const I=/^\s*(?:[;#].*)?$/,j=/^\s*\[([^\]]+)\]\s*$/,k=/\r?\n/,$=/\r?\n$/,K=/^[^=]+=/,v=o(e=>e===" "||e===" ","isWhitespace"),x=o(e=>{let t=0;for(;t<e.length&&v(e[t]);)t+=1;return{indent:e.slice(0,t),rest:e.slice(t)}},"splitLeadingWhitespace"),W=o(e=>{let t=e.length;for(;t>0&&v(e[t-1]);)t-=1;return{rest:e.slice(0,t),trailing:e.slice(t)}},"splitTrailingWhitespace"),b=o(e=>{const t=e.indexOf("=");if(t===-1)return;const n=e.slice(0,t),r=e.slice(t+1),{indent:i,rest:s}=x(n),{rest:c,trailing:a}=W(s);if(c===""||c.startsWith(";")||c.startsWith("#")||c.startsWith("["))return;const{indent:f,rest:p}=x(r),{rest:g,trailing:S}=W(p);return{after:f,before:a,indent:i,key:c,trailing:S,value:g}},"parseKeyValue"),N=o(e=>{let t=0,n=0;for(const r of e.split(k)){if(I.test(r)||j.test(r))continue;const i=b(r);i&&(i.before===" "&&i.after===" "?t+=1:i.before===""&&i.after===""&&(n+=1))}return{spaced:t,unspaced:n}},"countStyleMatches"),h=o((e,t)=>{if(!e)return;if(t===void 0)return e;let n=e;for(const r of t.split("."))if(n&&typeof n=="object"&&!Array.isArray(n))n=n[r];else return;return n&&typeof n=="object"&&!Array.isArray(n)?n:void 0},"getSection"),P=o((e,t)=>{for(const n of e.split(k)){if(!n||n.startsWith("["))continue;const r=K.exec(n);if(!r)continue;const i=n.slice(0,r[0].length-1).trim();if(i===t||i===`${t}[]`)return n.slice(r[0].length).trimStart()}return""},"extractValueToken"),M=o((e,t)=>{if(e.trim()==="")return{line:{kind:"blank",raw:e,section:t},nextSection:t};const n=e.trimStart();if(n.startsWith(";")||n.startsWith("#"))return{line:{kind:"comment",raw:e,section:t},nextSection:t};const r=j.exec(e);if(r){const s=r[1];return{line:{kind:"header",raw:e,section:s},nextSection:s}}const i=b(e);return i?{line:{key:i.key,kind:"key",raw:e,section:t},nextSection:t}:{line:{kind:"unknown",raw:e,section:t},nextSection:t}},"classifyLine"),T=o(e=>{const t=e.replace($,"").split(k),n=[];let r;for(const i of t){const{line:s,nextSection:c}=M(i,r);n.push(s),r=c}return n},"parseLines"),J=o((e,t,n)=>{const r=b(e.raw);if(!r||!e.key)return e.raw;const i=n({[e.key]:t}),s=P(i,e.key);return`${r.indent}${r.key}${r.before}=${r.after}${s}${r.trailing}`},"renderChangedKey"),A=o((e,t=[])=>{const n=[];for(const[r,i]of Object.entries(e))if(i&&typeof i=="object"&&!Array.isArray(i)){const s=[...t,r];n.push(s.join("."),...A(i,s))}return n},"collectSections"),O=o((e,t)=>{const n={};for(const[r,i]of Object.entries(e))t.has(r)||i&&typeof i=="object"&&!Array.isArray(i)||(n[r]=i);return n},"pickScalars"),L=o((e,t)=>{const n=[];for(const r of t.split(k))r!==""&&n.push(r);n.length>0&&e.push(...n)},"appendSerialized"),z=o(e=>{const{line:t,markWritten:n,nextData:r,oldData:i,renderValue:s}=e;if(!t.key)return t.raw;const c=h(r,t.section);if(!c||!(t.key in c))return;n(t.section,t.key);const a=h(i,t.section)?.[t.key],f=c[t.key];return JSON.stringify(a)===JSON.stringify(f)?t.raw:s(t,f)},"processKeyLine"),C=o((e,t,n,r,i)=>{const s=h(r,t);if(!s)return;const c=n.get(t)??new Set,a=O(s,c);Object.keys(a).length!==0&&L(e,i(a))},"flushAdditions"),E=o((e,t,n,r)=>{const i=new Set(t.filter(s=>s.kind==="header"&&s.section).map(s=>s.section));for(const s of A(n)){if(i.has(s))continue;const c=h(n,s);if(!c||Object.keys(c).length===0)continue;const a=O(c,new Set);Object.keys(a).length!==0&&L(e,r(a,s))}},"flushNewSections"),_=o(e=>{const t=e.includes(`\r
2
+ `)?`\r
3
+ `:`
4
+ `,{spaced:n,unspaced:r}=N(e);return{eol:t,whitespace:n>0&&n>=r}},"detectIniStyle"),q=o((e,t,n,r,i)=>{const{eol:s}=i,c=$.test(e),a=T(e),f=new Map,p=new Map;for(const[u,l]of a.entries())l.kind!=="blank"&&p.set(l.section,u);const g=o((u,l)=>{let d=f.get(u);d||(d=new Set,f.set(u,d)),d.add(l)},"markWritten"),S=o((u,l)=>J(u,l,r),"renderValue"),y=[];for(const[u,l]of a.entries()){if(l.kind==="key"){const d=z({line:l,markWritten:g,nextData:n,oldData:t,renderValue:S});d!==void 0&&y.push(d);continue}y.push(l.raw),p.get(l.section)===u&&C(y,l.section,f,n,r)}E(y,a,n,r);const w=y.join(s);return c&&!w.endsWith(s)?`${w}${s}`:w},"mergeIniPreservingLines");export{_ as d,q as m};
@@ -0,0 +1 @@
1
+ var a=Object.defineProperty;var t=(n,e)=>a(n,"name",{value:e,configurable:!0});var i=Object.defineProperty,r=t((n,e)=>i(n,"name",{value:e,configurable:!0}),"d");const v=r((n,e)=>!!e.ino&&!!e.dev&&e.ino===n.ino&&e.dev===n.dev,"isStatsIdentical");export{v as l};
@@ -0,0 +1 @@
1
+ var i=Object.defineProperty;var s=(e,r)=>i(e,"name",{value:r,configurable:!0});import{createRequire as n}from"node:module";import{toPath as f}from"@visulima/path/utils";import{F_OK as l}from"./F_OK-CAwY1qU7.js";import m from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";const c=n(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,a=s(e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[r,t]=o.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return o.getBuiltinModule(e)}return c(e)},"__cjs_getBuiltinModule"),{access:u}=a("node:fs/promises");var p=Object.defineProperty,_=s((e,r)=>p(e,"name",{value:r,configurable:!0}),"o");async function d(e,r=l){m(e),e=f(e);try{return await u(e,r),!0}catch{return!1}}s(d,"m");_(d,"isAccessible");export{d as default};
@@ -0,0 +1 @@
1
+ var n=Object.defineProperty;var t=(e,r)=>n(e,"name",{value:r,configurable:!0});import{createRequire as i}from"node:module";import{toPath as f}from"@visulima/path/utils";import{F_OK as l}from"./F_OK-CAwY1qU7.js";import m from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";const c=i(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=t(e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[r,s]=o.versions.node.split(".").map(Number);if(r>22||r===22&&s>=3||r===20&&s>=16)return o.getBuiltinModule(e)}return c(e)},"__cjs_getBuiltinModule"),{accessSync:a}=u("node:fs");var p=Object.defineProperty,_=t((e,r)=>p(e,"name",{value:r,configurable:!0}),"o");function d(e,r=l){m(e),e=f(e);try{return a(e,r),!0}catch{return!1}}t(d,"m");_(d,"isAccessibleSync");export{d as default};
@@ -0,0 +1 @@
1
+ var y=Object.defineProperty;var c=(t,e)=>y(t,"name",{value:e,configurable:!0});import{createRequire as d}from"node:module";const v=d(import.meta.url),n=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=c(t=>{if(typeof n<"u"&&n.versions&&n.versions.node){const[e,s]=n.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return n.getBuiltinModule(t)}return v(t)},"__cjs_getBuiltinModule"),_=u("fs"),h=u("os"),g=u("path");var m=Object.defineProperty,b=c((t,e)=>m(t,"name",{value:e,configurable:!0}),"a"),j=Object.defineProperty,o=b((t,e)=>j(t,"name",{value:e,configurable:!0}),"s");const f=o(t=>{let e="";for(let s=0;s<t.length;s+=1){const r=t[s],i=r.toUpperCase();e+=r===i?r.toLowerCase():i}return e},"invertCase"),a=new Map,p=o((t,e)=>{const s=g.join(t,`.is-fs-case-sensitive-test-${process.pid}`);try{return e.writeFileSync(s,""),!e.existsSync(f(s))}finally{try{e.unlinkSync(s)}catch{}}},"checkDirectoryCaseWithWrite"),S=o((t,e,s)=>{try{return p(t,s)}catch(r){if(e===void 0)return p(h.tmpdir(),s);throw r}},"checkDirectoryCaseWithFallback"),w=o((t,e=_,s=!0)=>{const r=t??process.cwd();if(s&&a.has(r))return a.get(r);let i;const l=f(r);return l!==r&&e.existsSync(r)?i=!e.existsSync(l):i=S(r,t,e),s&&a.set(r,i),i},"isFsCaseSensitive");export{w as isFsCaseSensitive};
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Custom error class for handling JSON parsing or related errors.
3
+ * It can optionally include a file name and a code frame for better debugging.
4
+ * @example
5
+ * ```javascript
6
+ * import { JSONError } from "@visulima/fs/error";
7
+ * import { readJsonSync } from "@visulima/fs"; // Or any function that might throw this
8
+ * import { join } from "node:path";
9
+ *
10
+ * try {
11
+ * // Imagine readJsonSync encounters a malformed JSON file and throws JSONError
12
+ * // Forcing the scenario for demonstration:
13
+ * const simulateJsonError = (filePath, content) => {
14
+ * const err = new JSONError(`Unexpected token '}' at position 15`);
15
+ * err.fileName = filePath;
16
+ * // A real implementation might generate a code frame using a library
17
+ * err.codeFrame = ` 13 | "key": "value",
18
+ * > 14 | "anotherKey": "anotherValue",}
19
+ * | ^
20
+ * 15 | "lastKey": "end"
21
+ * `;
22
+ * throw err;
23
+ * };
24
+ *
25
+ * simulateJsonError(join("path", "to", "corrupted.json"), '{ "key": "value", "anotherKey": "anotherValue",} ');
26
+ * // const jsonData = readJsonSync(join("path", "to", "corrupted.json"));
27
+ * } catch (error) {
28
+ * if (error instanceof JSONError) {
29
+ * console.error(`JSON Error: ${error.message}`);
30
+ * // message property will include fileName and codeFrame if they were set.
31
+ * // console.error(`File: ${error.fileName}`);
32
+ * // console.error(`Code Frame:\n${error.codeFrame}`);
33
+ * } else {
34
+ * console.error("An unexpected error occurred:", error);
35
+ * }
36
+ * }
37
+ * ```
38
+ */
39
+ declare class JSONError extends Error {
40
+ #private;
41
+ fileName: string | undefined;
42
+ codeFrame: string | undefined;
43
+ override readonly name = "JSONError";
44
+ /**
45
+ * Creates a new JSONError instance.
46
+ * @param message The primary error message.
47
+ */
48
+ constructor(message: string);
49
+ override get message(): string;
50
+ override set message(message: string);
51
+ }
52
+ export { JSONError as J };
@@ -0,0 +1,2 @@
1
+ var g=Object.defineProperty;var p=(e,t)=>g(e,"name",{value:t,configurable:!0});import{modify as m,applyEdits as b,parse as d}from"jsonc-parser";var O=Object.defineProperty,s=p((e,t)=>O(e,"name",{value:t,configurable:!0}),"e");const y=s(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isPlainObject"),l=s((e,t,i)=>{const r=m(e.text,t,i,{formattingOptions:e.formattingOptions});e.text=b(e.text,r)},"applyModification"),S=s((e,t,i,r,n)=>{const a=new Set([...Object.keys(t),...Object.keys(i)]);for(const o of a){const c=[...r,o];o in i?o in t?n(e,t[o],i[o],c):l(e,c,i[o]):l(e,c,void 0)}},"walkObject"),u=s((e,t,i,r)=>{if(t!==i){if(y(t)&&y(i)){S(e,t,i,r,u);return}if(Array.isArray(t)&&Array.isArray(i)&&t.length===i.length){for(const[n,a]of t.entries())u(e,a,i[n],[...r,n]);return}JSON.stringify(t)!==JSON.stringify(i)&&l(e,r,i)}},"walkValue"),j=s((e,t,i)=>{const r=d(e,[],{allowTrailingComma:!0}),n={formattingOptions:i,text:e};return u(n,r,t,[]),n.text},"mergeJsoncPreservingComments"),v=s(e=>typeof e=="number"?{insertSpaces:!0,tabSize:e}:typeof e=="string"?e===" "||e.includes(" ")?{insertSpaces:!1,tabSize:e.length||1}:{insertSpaces:!0,tabSize:e.length||2}:{insertSpaces:!0,tabSize:2},"formattingFromIndent"),J=s((e,t,i,r,n,a,o)=>{if(i&&e!==void 0){const c={...v(r),...a};let f=j(e,t,c);return n&&!f.endsWith(`
2
+ `)&&(f+=n),f}return`${JSON.stringify(t,o,r)}${n}`},"buildJsoncOutput");export{J as b};
@@ -0,0 +1 @@
1
+ var S=Object.defineProperty;var i=(r,e)=>S(r,"name",{value:e,configurable:!0});import{createRequire as b}from"node:module";import{toPath as m}from"@visulima/path/utils";import{dirname as c,resolve as s}from"@visulima/path";import $ from"./isAccessible-CDFxsAAo.js";import x from"./isAccessibleSync-5nzZWgin.js";const _=b(import.meta.url),n=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=i(r=>{if(typeof n<"u"&&n.versions&&n.versions.node){const[e,t]=n.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return n.getBuiltinModule(r)}return _(r)},"__cjs_getBuiltinModule"),{cwd:d}=n,{mkdir:g,rename:D,copyFile:E,unlink:j}=w("node:fs/promises"),{mkdirSync:M,renameSync:P,copyFileSync:k,unlinkSync:T}=w("node:fs");var F=Object.defineProperty,v=i((r,e)=>F(r,"name",{value:e,configurable:!0}),"o");class O extends Error{static{i(this,"a")}static{v(this,"SameDirectoryError")}constructor(e,t){super(`Source directory "${c(e)}" does not match destination directory "${c(t)}"`),this.name="SameDirectoryError"}}const f=v((r,e)=>{if(!r||!e)throw new Error("Source and destination paths must not be empty");if(c(r)!==c(e))throw new O(r,e)},"validateSameDirectory");var q=Object.defineProperty,B=i((r,e)=>q(r,"name",{value:e,configurable:!0}),"m$1");const p=B(async(r,e,{cwd:t,directoryMode:o,overwrite:u,validateDirectory:y})=>{if(t&&(r=s(t,r),e=s(t,e)),y&&f(r,e),!u&&await $(e))throw new Error(`The destination file exists: ${e}`);await g(c(e),{mode:o,recursive:!0});try{await D(r,e)}catch(a){if(a.code==="EXDEV")await E(r,e),await j(r);else throw a}},"internalMoveFile");var R=Object.defineProperty,V=i((r,e)=>R(r,"name",{value:e,configurable:!0}),"m");const h=V((r,e,{cwd:t,directoryMode:o,overwrite:u,validateDirectory:y})=>{if(t&&(r=s(t,r),e=s(t,e)),y&&f(r,e),!u&&x(e))throw new Error(`The destination file exists: ${e}`);M(c(e),{mode:o,recursive:!0});try{P(r,e)}catch(a){if(a.code==="EXDEV")k(r,e),T(r);else throw a}},"internalMoveFileSync");var X=Object.defineProperty,l=i((r,e)=>X(r,"name",{value:e,configurable:!0}),"i");const I=l(async(r,e,t={})=>{const o={overwrite:!0,validateDirectory:!1,...t,cwd:t.cwd?m(t.cwd):d()};await p(r,e,o)},"move"),J=l((r,e,t)=>{const o={overwrite:!0,validateDirectory:!1,...t};o.cwd=o.cwd?m(o.cwd):d(),h(r,e,o)},"moveSync"),K=l(async(r,e,t)=>{const o={overwrite:!0,...t,validateDirectory:!0};o.cwd=o.cwd?m(o.cwd):d(),await p(r,e,o)},"rename"),L=l((r,e,t)=>{const o={overwrite:!0,...t,validateDirectory:!0};o.cwd=o.cwd?m(o.cwd):d(),h(r,e,o)},"renameSync");export{I as move,J as moveSync,K as rename,L as renameSync};
@@ -0,0 +1 @@
1
+ var d=Object.defineProperty;var s=(e,t)=>d(e,"name",{value:t,configurable:!0});import{b as l,N as m}from"./indexToLineColumn-BRSZFC6I-BKj3uzZt.js";import p from"./JSONError-D7h6PNWc.js";var f=Object.defineProperty,c=s((e,t)=>f(e,"name",{value:t,configurable:!0}),"a");const g=c(e=>String.raw`\u{${e.codePointAt(0).toString(16)}}`,"getCodePoint"),b=c((e,t,o)=>m(e,{start:t},{tabWidth:!1,...o}),"generateCodeFrame"),N=/in JSON at position (\d+)(?: \(line (\d+) column (\d+)\))?$/,h=c((e,t)=>{const o=N.exec(t);if(!o)return;const[,n,r,a]=o;if(r&&a)return{column:Number(a),line:Number(r)};let i=Number(n);return i===e.length&&(i=e.length-1),l(e,i)},"getErrorLocation"),y=/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,v=c(e=>e.replace(y,(t,o,n)=>`"${n}"(${g(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(u){r=u.message}let a;e?(a=h(e,r),r=v(r)):r+=" while parsing empty string";const i=new p(r);throw i.fileName=o,a&&(i.codeFrame=b(e,a,n)),i}s(w,"E");c(w,"parseJson");export{w as default};
@@ -0,0 +1 @@
1
+ var g=Object.defineProperty;var i=(e,o)=>g(e,"name",{value:o,configurable:!0});import{createRequire as _}from"node:module";import{toPath as y}from"@visulima/path/utils";import{R_OK as P}from"./F_OK-CAwY1qU7.js";import R from"./PermissionError-B1Emi5a9.js";import f from"./isAccessible-CDFxsAAo.js";import q from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";const h=_(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,m=i(e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[o,n]=r.versions.node.split(".").map(Number);if(o>22||o===22&&n>=3||o===20&&n>=16)return r.getBuiltinModule(e)}return h(e)},"__cjs_getBuiltinModule"),{readFile:w}=m("node:fs/promises"),{unzip:j,brotliDecompress:v}=m("node:zlib");var z=Object.defineProperty,p=i((e,o)=>z(e,"name",{value:o,configurable:!0}),"n");const F={brotli:v,gzip:j,none:p((e,o)=>{o(null,e)},"none")},E=p(async(e,o)=>{if(q(e),e=y(e),!await f(e))throw new R(`unable to read the non-accessible file: ${e}`);if(!await f(e,P))throw new Error(`Unable to read the non-readable file: ${e}`);const{buffer:n,compression:u,encoding:s,flag:a}=o??{};return await w(e,a?{encoding:s,flag:a}:{encoding:s}).then(async t=>await new Promise((d,b)=>{F[u??"none"](t,(c,l)=>{c?b(c):d(n?l:l.toString())})})).catch(t=>{throw t})},"readFile");export{E as default};
@@ -0,0 +1 @@
1
+ var g=Object.defineProperty;var i=(e,o)=>g(e,"name",{value:o,configurable:!0});import{createRequire as _}from"node:module";import{toPath as j}from"@visulima/path/utils";import{R_OK as S}from"./F_OK-CAwY1qU7.js";import a from"./PermissionError-B1Emi5a9.js";import f from"./isAccessibleSync-5nzZWgin.js";import $ from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";const b=_(import.meta.url),n=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=i(e=>{if(typeof n<"u"&&n.versions&&n.versions.node){const[o,r]=n.versions.node.split(".").map(Number);if(o>22||o===22&&r>=3||o===20&&r>=16)return n.getBuiltinModule(e)}return b(e)},"__cjs_getBuiltinModule"),{readFileSync:y}=l("node:fs"),{unzipSync:h,brotliDecompressSync:v}=l("node:zlib");var w=Object.defineProperty,d=i((e,o)=>w(e,"name",{value:o,configurable:!0}),"r");const q={brotli:v,gzip:h,none:d(e=>e,"none")},O=d((e,o)=>{if($(e),e=j(e),!f(e))throw new a(`unable to read the non-accessible file: ${e}`);if(!f(e,S))throw new a(`invalid access to read file at: ${e}`);const{buffer:r,compression:m,encoding:t,flag:s}=o??{},p=y(e,s?{encoding:t,flag:s}:{encoding:t}),u=q[m??"none"],c=u(p);return r?c:c.toString()},"readFileSync");export{O as default};
@@ -0,0 +1 @@
1
+ var c=Object.defineProperty;var a=(r,e)=>c(r,"name",{value:e,configurable:!0});import{parse as i}from"ini";import d from"./readFile-BAVMZg5e.js";var u=Object.defineProperty,f=a((r,e)=>u(r,"name",{value:e,configurable:!0}),"n");const b=f(async(r,e)=>{const{bracketedArray:t=!0,...n}=e??{},o=await d(r,{encoding:"utf8",...n});return i(o,{bracketedArray:t})},"readIni");export{b as default};
@@ -0,0 +1 @@
1
+ var c=Object.defineProperty;var t=(r,e)=>c(r,"name",{value:e,configurable:!0});import{parse as i}from"ini";import u from"./readFileSync-CGmzMUF2.js";var d=Object.defineProperty,f=t((r,e)=>d(r,"name",{value:e,configurable:!0}),"r");const s=f((r,e)=>{const{bracketedArray:a=!0,...o}=e??{},n=u(r,{encoding:"utf8",...o});return i(n,{bracketedArray:a})},"readIniSync");export{s as default};
@@ -0,0 +1 @@
1
+ var i=Object.defineProperty;var t=(e,o)=>i(e,"name",{value:o,configurable:!0});import{toPath as d}from"@visulima/path/utils";import u from"./parseJson-Xx6vHYbv.js";import m from"./readFile-BAVMZg5e.js";var p=Object.defineProperty,s=t((e,o)=>p(e,"name",{value:o,configurable:!0}),"i");async function l(e,o,n){typeof o=="object"&&(n=o,o=void 0);const c=await m(e,{buffer:!0,encoding:void 0});let r=new TextDecoder().decode(c);const{beforeParse:a,color:f}=n??{};return typeof a=="function"&&(r=a(r)),u(r,o,d(e),{color:f})}t(l,"c");s(l,"readJson");export{l as default};
@@ -0,0 +1 @@
1
+ var s=Object.defineProperty;var r=(o,e)=>s(o,"name",{value:e,configurable:!0});import m from"json5";import b from"./readFile-BAVMZg5e.js";var d=Object.defineProperty,g=r((o,e)=>d(o,"name",{value:e,configurable:!0}),"i");async function l(o,e,f){e&&typeof e=="object"&&(f=e,e=void 0);const{beforeParse:t,buffer:i,compression:n,encoding:c="utf8",flag:u}=f??{},a=await b(o,{buffer:i,compression:n,encoding:c,flag:u}),p=typeof t=="function"?t(a):a;return m.parse(p,e)}r(l,"u");g(l,"readJson5");export{l as default};
@@ -0,0 +1 @@
1
+ var u=Object.defineProperty;var r=(o,e)=>u(o,"name",{value:e,configurable:!0});import m from"json5";import d from"./readFileSync-CGmzMUF2.js";var b=Object.defineProperty,g=r((o,e)=>b(o,"name",{value:e,configurable:!0}),"p");function l(o,e,f){e&&typeof e=="object"&&(f=e,e=void 0);const{beforeParse:t,buffer:c,compression:n,encoding:i="utf8",flag:p}=f??{},a=d(o,{buffer:c,compression:n,encoding:i,flag:p}),s=typeof t=="function"?t(a):a;return m.parse(s,e)}r(l,"m");g(l,"readJson5Sync");export{l as default};
@@ -0,0 +1 @@
1
+ var i=Object.defineProperty;var t=(o,e)=>i(o,"name",{value:e,configurable:!0});import{toPath as d}from"@visulima/path/utils";import u from"./parseJson-Xx6vHYbv.js";import m from"./readFileSync-CGmzMUF2.js";var p=Object.defineProperty,l=t((o,e)=>p(o,"name",{value:e,configurable:!0}),"r");function s(o,e,n){typeof e=="object"&&(n=e,e=void 0);const f=m(o,{buffer:!0,encoding:void 0});let r=new TextDecoder().decode(f);const{beforeParse:c,color:a}=n??{};return typeof c=="function"&&(r=c(r)),u(r,e,d(o),{color:a})}t(s,"J");l(s,"readJsonSync");export{s as default};
@@ -0,0 +1 @@
1
+ var C=Object.defineProperty;var l=(o,r)=>C(o,"name",{value:r,configurable:!0});import{b,N as h}from"./indexToLineColumn-BRSZFC6I-BKj3uzZt.js";import{toPath as E}from"@visulima/path/utils";import{parse as y,printParseErrorCode as P}from"jsonc-parser";import v from"./JSONError-D7h6PNWc.js";import J from"./readFile-BAVMZg5e.js";var T=Object.defineProperty,c=l((o,r)=>T(o,"name",{value:r,configurable:!0}),"a");const $=c((o,r,a,n)=>{if(o.length===0)return;const t=o[0],f=b(r,t.offset),e=new v(`${P(t.error)} at offset ${t.offset}`);throw e.fileName=a,e.codeFrame=h(r,{start:f},{tabWidth:!1,...n}),e},"throwIfJsoncErrors"),R=c(async(o,r)=>{const{allowEmptyContent:a,allowTrailingComma:n=!0,beforeParse:t,buffer:f,color:e,compression:p,disallowComments:u,encoding:w="utf8",flag:d}=r??{},s=await J(o,{buffer:f,compression:p,encoding:w,flag:d}),m=typeof t=="function"?t(s):s,i=[],g=y(m,i,{allowEmptyContent:a,allowTrailingComma:n,disallowComments:u});return $(i,m,E(o),{color:e}),g},"readJsonc");export{R as default,$ as throwIfJsoncErrors};
@@ -0,0 +1 @@
1
+ var g=Object.defineProperty;var l=(o,r)=>g(o,"name",{value:r,configurable:!0});import{toPath as y}from"@visulima/path/utils";import{parse as C}from"jsonc-parser";import b from"./readFileSync-CGmzMUF2.js";import{throwIfJsoncErrors as P}from"./readJsonc-BzvuAXbT.js";var v=Object.defineProperty,E=l((o,r)=>v(o,"name",{value:r,configurable:!0}),"p");const F=E((o,r)=>{const{allowEmptyContent:m,allowTrailingComma:f=!0,beforeParse:e,buffer:i,color:s,compression:c,disallowComments:p,encoding:u="utf8",flag:d}=r??{},t=b(o,{buffer:i,compression:c,encoding:u,flag:d}),n=typeof e=="function"?e(t):t,a=[],w=C(n,a,{allowEmptyContent:m,allowTrailingComma:f,disallowComments:p});return P(a,n,y(o),{color:s}),w},"readJsoncSync");export{F as default};
@@ -0,0 +1 @@
1
+ var o=Object.defineProperty;var t=(r,e)=>o(r,"name",{value:e,configurable:!0});import{parse as n}from"smol-toml";import c from"./readFile-BAVMZg5e.js";var f=Object.defineProperty,i=t((r,e)=>f(r,"name",{value:e,configurable:!0}),"r");const s=i(async(r,e)=>{const a=await c(r,{encoding:"utf8",...e});return n(a)},"readToml");export{s as default};
@@ -0,0 +1 @@
1
+ var n=Object.defineProperty;var t=(r,e)=>n(r,"name",{value:e,configurable:!0});import{parse as a}from"smol-toml";import c from"./readFileSync-CGmzMUF2.js";var f=Object.defineProperty,i=t((r,e)=>f(r,"name",{value:e,configurable:!0}),"n");const d=i((r,e)=>{const o=c(r,{encoding:"utf8",...e});return a(o)},"readTomlSync");export{d as default};
@@ -0,0 +1 @@
1
+ var p=Object.defineProperty;var o=(r,e)=>p(r,"name",{value:e,configurable:!0});import{parse as n}from"yaml";import s from"./readFile-BAVMZg5e.js";var l=Object.defineProperty,d=o((r,e)=>l(r,"name",{value:e,configurable:!0}),"r");async function g(r,e,t){const{buffer:c,compression:i,encoding:u="utf8",flag:m,...a}=t??{},f=await s(r,{buffer:c,compression:i,encoding:u,flag:m});return typeof e=="function"?n(f,e,a):n(f,a)}o(g,"l");d(g,"readYaml");export{g as default};
@@ -0,0 +1 @@
1
+ var p=Object.defineProperty;var o=(r,e)=>p(r,"name",{value:e,configurable:!0});import{parse as t}from"yaml";import l from"./readFileSync-CGmzMUF2.js";var s=Object.defineProperty,d=o((r,e)=>s(r,"name",{value:e,configurable:!0}),"t");function g(r,e,a){const{buffer:c,compression:i,encoding:u="utf8",flag:m,...f}=a??{},n=l(r,{buffer:c,compression:i,encoding:u,flag:m});return typeof e=="function"?t(n,e,f):t(n,f)}o(g,"l");d(g,"readYamlSync");export{g as default};
@@ -0,0 +1 @@
1
+ var t=Object.defineProperty;var s=(e,r)=>t(e,"name",{value:r,configurable:!0});import{createRequire as n}from"node:module";import l from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import{i as m}from"./build-rm-options-C1R4reBu.js";const a=n(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=s(e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[r,i]=o.versions.node.split(".").map(Number);if(r>22||r===22&&i>=3||r===20&&i>=16)return o.getBuiltinModule(e)}return a(e)},"__cjs_getBuiltinModule"),{unlink:u,rm:f}=c("node:fs/promises");var p=Object.defineProperty,d=s((e,r)=>p(e,"name",{value:r,configurable:!0}),"i");const b=d(async(e,r={})=>{l(e);try{await u(e)}catch{}try{await f(e,m(r))}catch{}},"remove");export{b as default};
@@ -0,0 +1 @@
1
+ var n=Object.defineProperty;var s=(e,o)=>n(e,"name",{value:o,configurable:!0});import{createRequire as i}from"node:module";import l from"./assertValidFileOrDirectoryPath-DgPIPmZT.js";import{i as m}from"./build-rm-options-C1R4reBu.js";const c=i(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,a=s(e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[o,t]=r.versions.node.split(".").map(Number);if(o>22||o===22&&t>=3||o===20&&t>=16)return r.getBuiltinModule(e)}return c(e)},"__cjs_getBuiltinModule"),{unlinkSync:u,rmSync:f}=a("node:fs");var p=Object.defineProperty,d=s((e,o)=>p(e,"name",{value:o,configurable:!0}),"o");const b=d((e,o={})=>{l(e);try{u(e)}catch{}try{f(e,m(o))}catch{}},"removeSync");export{b as default};
@@ -0,0 +1 @@
1
+ var i=Object.defineProperty;var o=(e,t)=>i(e,"name",{value:t,configurable:!0});import{resolve as r,dirname as a}from"@visulima/path";var n=Object.defineProperty,s=o((e,t)=>n(e,"name",{value:t,configurable:!0}),"i");const m=s((e,t)=>typeof e!="string"?e:e.startsWith("./")?r(e):typeof t=="string"?r(a(t),e):new URL(e,t),"resolveSymlinkTarget");export{m as o};
@@ -0,0 +1 @@
1
+ var p=Object.defineProperty;var g=(n,r)=>p(n,"name",{value:r,configurable:!0});import{createRequire as m}from"node:module";const S=m(import.meta.url),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{platform:v}=x;var w=Object.defineProperty,l=g((n,r)=>w(n,"name",{value:r,configurable:!0}),"l");const o="unnamed",b=128,h={'"':"ˮ","*":"⁎","/":"⁄",":":"꞉","<":"‹",">":"›","?":"ʔ","\\":"∖","|":"ǀ"},_=/[\u0000-\u001F\u0080-\u009F]/g,O=/^(?:\.+[/\\]+)+|^\.+$/g,u=/^(?:con|prn|aux|nul|com\d|lpt\d)$/i,$=/[<>:"/\\|?*]/g,y=/\//g,a=new Set([" "," ","."]),f=l((n,r)=>r>0&&r<n.length-1,"hasExtension"),I=l((n,r)=>{const t=n.lastIndexOf(".");if(!f(n,t))return n.slice(0,r);const e=n.slice(0,t),i=n.slice(t),s=r-i.length;return s>0?`${e.slice(0,s)}${i}`:n.slice(0,r)},"truncateWithExtension"),d=l(n=>{let r=0,t=n.length;for(;r<t;){const e=n[r];if(e===void 0||!a.has(e))break;r+=1}for(;t>r;){const e=n[t-1];if(e===void 0||!a.has(e))break;t-=1}return n.slice(r,t)},"trimSpacesAndPeriods"),k=l(n=>{const r=n.lastIndexOf(".");if(f(n,r)){const e=n.slice(0,r),i=n.slice(r);let s=e;for(;s.length>0;){const c=s.at(-1);if(c===void 0||!a.has(c))break;s=s.slice(0,-1)}return s.length===0?i.slice(1):`${s}${i}`}let t=n;for(;t.length>0;){const e=t.at(-1);if(e===void 0||!a.has(e))break;t=t.slice(0,-1)}return t},"cleanWindowsName"),j=l(n=>{const r=n.lastIndexOf(".");if(f(n,r))return!1;if(u.test(n))return!0;let t=n;for(;t.length>0;){const e=t.at(-1);if(e===void 0||!a.has(e))break;t=t.slice(0,-1)}return!!(t.length>0&&u.test(t))},"isWindowsReservedName"),A=l(n=>{const r=n.lastIndexOf(".");if(f(n,r)){const i=n.slice(0,r),s=n.slice(r),c=d(i);return c.length===0?void 0:`${c}${s}`}const t=n.trim();if(t.length>0&&t[0]==="."&&t.length<=5&&t.indexOf(".",1)===-1)return;const e=d(n);if(e.length!==0)return e},"cleanFat32Name"),F=l(n=>{const r=n?.filesystem??"auto";return r==="auto"?v==="win32"?"win32":"unix":r==="darwin"?"unix":r},"getFileSystemType"),T=l((n,r)=>{if(typeof n!="string"||n.length===0)return o;const t=F(r);let e=n;if(e=e.replace(_,""),e.length===0||(e=e.replace(O,""),e.length===0))return o;if(t==="win32"||t==="fat32"){const s=e.lastIndexOf(".");if(!f(e,s)&&u.test(e))return o}if(e=t==="win32"||t==="fat32"?e.replaceAll($,s=>h[s]??""):e.replaceAll(y,h["/"]),e=e.trim(),(t==="win32"||t==="fat32")&&(j(e)||t==="win32"&&(e=k(e),e.length===0)))return o;if(t==="fat32"){const s=A(e);if(s===void 0)return o;e=s}if(e.length===0)return o;const i=r?.maxLength??b;return e.length>i&&(e=I(e,i),e.length===0)?o:e},"sanitize");export{T as sanitize};
@@ -0,0 +1 @@
1
+ var s=Object.defineProperty;var r=(e,t)=>s(e,"name",{value:t,configurable:!0});import{INTERNAL_STRIP_JSON_REGEX as o}from"./F_OK-CAwY1qU7.js";var n=Object.defineProperty,i=r((e,t)=>n(e,"name",{value:t,configurable:!0}),"n");const c=i((e,{whitespace:t=!0}={})=>e.replace(o,a=>a.startsWith('"')||a[1]==="*"&&!a.endsWith("*/")?a:t?a.replaceAll(/\S/g," "):""),"stripJsonComments");export{c as default};
@@ -0,0 +1 @@
1
+ var n=Object.defineProperty;var r=(e,t)=>n(e,"name",{value:t,configurable:!0});var f=Object.defineProperty,i=r((e,t)=>f(e,"name",{value:t,configurable:!0}),"f");const a=new TextEncoder,y=i(e=>{if(e instanceof Uint8Array)return e;if(typeof e=="string")return a.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e)){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")},"toUint8Array");export{y as a};