@visulima/fs 5.0.0-alpha.8 → 5.0.0

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 (226) hide show
  1. package/CHANGELOG.md +491 -0
  2. package/LICENSE.md +236 -5
  3. package/README.md +65 -0
  4. package/dist/eol.d.ts +31 -30
  5. package/dist/eol.js +3 -26
  6. package/dist/error.d.ts +273 -7
  7. package/dist/error.js +1 -7
  8. package/dist/glob-parent.d.ts +35 -0
  9. package/dist/glob-parent.js +1 -0
  10. package/dist/glob.d.ts +4 -0
  11. package/dist/glob.js +1 -0
  12. package/dist/index.d.ts +930 -36
  13. package/dist/index.js +1 -33
  14. package/dist/ini.d.ts +70 -0
  15. package/dist/ini.js +1 -0
  16. package/dist/is-glob.d.ts +34 -0
  17. package/dist/is-glob.js +1 -0
  18. package/dist/json5.d.ts +36 -0
  19. package/dist/json5.js +1 -0
  20. package/dist/jsonc.d.ts +65 -0
  21. package/dist/jsonc.js +1 -0
  22. package/dist/match.d.ts +80 -0
  23. package/dist/match.js +1 -0
  24. package/dist/packem_shared/AlreadyExistsError-DEb3UWja.js +1 -0
  25. package/dist/packem_shared/DirectoryError-BtwSTLmT.js +1 -0
  26. package/dist/packem_shared/FIND_UP_STOP-CAwY1qU7.js +1 -0
  27. package/dist/packem_shared/JSONError-Cvp9ycba.js +4 -0
  28. package/dist/packem_shared/NotEmptyError-DZ1Ix089.js +1 -0
  29. package/dist/packem_shared/NotFoundError-CnRY6lVp.js +1 -0
  30. package/dist/packem_shared/PermissionError-DJ_2VWEj.js +1 -0
  31. package/dist/packem_shared/WalkError-B8qTd-v-.js +1 -0
  32. package/dist/packem_shared/_commonjsHelpers-CWAkuNXM.js +1 -0
  33. package/dist/packem_shared/assertValidFileContents-CbIN7sy7.js +1 -0
  34. package/dist/packem_shared/assertValidFileOrDirectoryPath-BTlt945W.js +1 -0
  35. package/dist/packem_shared/build-rm-options-avnusYx-.js +1 -0
  36. package/dist/packem_shared/collect-CIKDOMiD.js +1 -0
  37. package/dist/packem_shared/collectSync-D0FRLLqg.js +1 -0
  38. package/dist/packem_shared/copy-Beb64BYG.js +1 -0
  39. package/dist/packem_shared/copySync-CagcIEBi.js +1 -0
  40. package/dist/packem_shared/emptyDir-C7lyd1lW.js +1 -0
  41. package/dist/packem_shared/emptyDirSync-B8EYpmO9.js +1 -0
  42. package/dist/packem_shared/ensureDir-DGarVZw8.js +1 -0
  43. package/dist/packem_shared/ensureDirSync-CsgPrsDH.js +1 -0
  44. package/dist/packem_shared/ensureFile-CMugWljp.js +1 -0
  45. package/dist/packem_shared/ensureFileSync-CJYTEx2r.js +1 -0
  46. package/dist/packem_shared/ensureLink-ChShf3lf.js +1 -0
  47. package/dist/packem_shared/ensureLinkSync-DPpq0I2Z.js +1 -0
  48. package/dist/packem_shared/ensureSymlink-y4FZjfxA.js +1 -0
  49. package/dist/packem_shared/ensureSymlinkSync-TcHssCH7.js +1 -0
  50. package/dist/packem_shared/findUp-Cii5ATt5.js +1 -0
  51. package/dist/packem_shared/findUpSync-C9Lkh7-v.js +1 -0
  52. package/dist/packem_shared/get-file-info-type-DzWpohDB.js +1 -0
  53. package/dist/packem_shared/glob-fqg4KepW.js +1 -0
  54. package/dist/packem_shared/glob-sync.d-hXe38TnZ.d.ts +54 -0
  55. package/dist/packem_shared/globSync-B8_ne93E.js +1 -0
  56. package/dist/packem_shared/index-B2MhYg3r.js +1 -0
  57. package/dist/packem_shared/index-BHy3Kcr7.js +11 -0
  58. package/dist/packem_shared/index-BLg3XWiD.js +1 -0
  59. package/dist/packem_shared/index-D8MDd0tv.js +1 -0
  60. package/dist/packem_shared/ini-preserve-D1DopDLd.js +4 -0
  61. package/dist/packem_shared/is-stats-identical-l1GRN4Qu.js +1 -0
  62. package/dist/packem_shared/isAccessible-PmWJhV6I.js +1 -0
  63. package/dist/packem_shared/isAccessibleSync-BrbOtwdr.js +1 -0
  64. package/dist/packem_shared/json-error.d-DVILOyHc.d.ts +52 -0
  65. package/dist/packem_shared/jsonc-merge-Bkw73TLW.js +2 -0
  66. package/dist/packem_shared/map-read-error-CR3rQUxx.js +1 -0
  67. package/dist/packem_shared/move-DopmzT-2.js +1 -0
  68. package/dist/packem_shared/parseJson-EASgP4J9.js +1 -0
  69. package/dist/packem_shared/readFile-BswaBgM0.js +1 -0
  70. package/dist/packem_shared/readFileSync-_fDF6Oj1.js +1 -0
  71. package/dist/packem_shared/readIni-BsXudu2r.js +1 -0
  72. package/dist/packem_shared/readIniSync-DKwRbbs9.js +1 -0
  73. package/dist/packem_shared/readJson-CcAsHxE5.js +1 -0
  74. package/dist/packem_shared/readJson5-CM1TIiHd.js +1 -0
  75. package/dist/packem_shared/readJson5Sync-Bc26c3Fy.js +1 -0
  76. package/dist/packem_shared/readJsonSync-DuMMeB3s.js +1 -0
  77. package/dist/packem_shared/readJsonc-BZjMw_0f.js +1 -0
  78. package/dist/packem_shared/readJsoncSync-C-xzeZz4.js +1 -0
  79. package/dist/packem_shared/readToml-D4jpe9q_.js +1 -0
  80. package/dist/packem_shared/readTomlSync-B5PIYT9z.js +1 -0
  81. package/dist/packem_shared/readYaml-DvPxndW_.js +1 -0
  82. package/dist/packem_shared/readYamlSync-DZ-0hSbZ.js +1 -0
  83. package/dist/packem_shared/remove-CSbrd0dl.js +1 -0
  84. package/dist/packem_shared/removeSync-BoLAzRQE.js +1 -0
  85. package/dist/packem_shared/renderError-B3ePOoBG-Bi9WKMjv.js +6 -0
  86. package/dist/packem_shared/resolve-symlink-target-CWrn0v4P.js +1 -0
  87. package/dist/packem_shared/sanitize-DGZ3w-_w.js +1 -0
  88. package/dist/packem_shared/stripJsonComments-Bfcn2PKv.js +1 -0
  89. package/dist/packem_shared/to-uint-8-array-BImOQNXm.js +1 -0
  90. package/dist/packem_shared/types.d-BMdL_ygj.d.ts +1773 -0
  91. package/dist/packem_shared/walk-OX4-6oCP.js +1 -0
  92. package/dist/packem_shared/walk-include-BXhGSn6t.js +1 -0
  93. package/dist/packem_shared/walkSync-BPs6czIM.js +1 -0
  94. package/dist/packem_shared/writeFile-BrMtsJY7.js +1 -0
  95. package/dist/packem_shared/writeFileSync-W7Mf4BNy.js +1 -0
  96. package/dist/packem_shared/writeIni-BWX3cP1K.js +4 -0
  97. package/dist/packem_shared/writeIniSync-fOdgPFfL.js +4 -0
  98. package/dist/packem_shared/writeJson-bEVi25gX.js +4 -0
  99. package/dist/packem_shared/writeJson5-Ch8TpNPI.js +4 -0
  100. package/dist/packem_shared/writeJson5Sync-BrctV_Mk.js +4 -0
  101. package/dist/packem_shared/writeJsonSync-DkGnd416.js +4 -0
  102. package/dist/packem_shared/writeJsonc-CefrwsOc.js +4 -0
  103. package/dist/packem_shared/writeJsoncSync-BskDjn8o.js +4 -0
  104. package/dist/packem_shared/writeToml-IuMO-yDu.js +1 -0
  105. package/dist/packem_shared/writeTomlSync-DhL7hHzB.js +1 -0
  106. package/dist/packem_shared/writeYaml-ClQgvQID.js +1 -0
  107. package/dist/packem_shared/writeYamlSync-DrXtHQQq.js +1 -0
  108. package/dist/size.d.ts +246 -246
  109. package/dist/size.js +1 -146
  110. package/dist/toml.d.ts +63 -0
  111. package/dist/toml.js +1 -0
  112. package/dist/utils.d.ts +103 -6
  113. package/dist/utils.js +1 -6
  114. package/dist/yaml.d.ts +13 -5
  115. package/dist/yaml.js +1 -4
  116. package/package.json +68 -17
  117. package/dist/constants.d.ts +0 -42
  118. package/dist/ensure/ensure-dir-sync.d.ts +0 -14
  119. package/dist/ensure/ensure-dir.d.ts +0 -14
  120. package/dist/ensure/ensure-file-sync.d.ts +0 -15
  121. package/dist/ensure/ensure-file.d.ts +0 -27
  122. package/dist/ensure/ensure-link-sync.d.ts +0 -16
  123. package/dist/ensure/ensure-link.d.ts +0 -16
  124. package/dist/ensure/ensure-symlink-sync.d.ts +0 -23
  125. package/dist/ensure/ensure-symlink.d.ts +0 -23
  126. package/dist/ensure/utils/get-file-info-type.d.ts +0 -7
  127. package/dist/ensure/utils/is-stats-identical.d.ts +0 -3
  128. package/dist/ensure/utils/resolve-symlink-target.d.ts +0 -2
  129. package/dist/error/already-exists-error.d.ts +0 -39
  130. package/dist/error/directory-error.d.ts +0 -47
  131. package/dist/error/json-error.d.ts +0 -52
  132. package/dist/error/not-empty-error.d.ts +0 -51
  133. package/dist/error/not-found-error.d.ts +0 -44
  134. package/dist/error/permission-error.d.ts +0 -45
  135. package/dist/error/walk-error.d.ts +0 -51
  136. package/dist/find/collect-sync.d.ts +0 -31
  137. package/dist/find/collect.d.ts +0 -35
  138. package/dist/find/find-up-sync.d.ts +0 -42
  139. package/dist/find/find-up.d.ts +0 -46
  140. package/dist/find/utils/glob-to-regexp.d.ts +0 -2
  141. package/dist/find/utils/walk-include.d.ts +0 -2
  142. package/dist/find/walk-sync.d.ts +0 -34
  143. package/dist/find/walk.d.ts +0 -37
  144. package/dist/is-accessible-sync.d.ts +0 -3
  145. package/dist/is-accessible.d.ts +0 -29
  146. package/dist/move/index.d.ts +0 -68
  147. package/dist/move/types.d.ts +0 -36
  148. package/dist/move/utils/internal-move-file-sync.d.ts +0 -3
  149. package/dist/move/utils/internal-move-file.d.ts +0 -3
  150. package/dist/move/utils/validate-same-directory.d.ts +0 -2
  151. package/dist/packem_shared/AlreadyExistsError-6Y9hjgMn.js +0 -27
  152. package/dist/packem_shared/DirectoryError-BfYPkIYP.js +0 -27
  153. package/dist/packem_shared/F_OK-MldBaGxb.js +0 -8
  154. package/dist/packem_shared/JSONError-BkHRnInH.js +0 -26
  155. package/dist/packem_shared/NotEmptyError-B21RUlVr.js +0 -27
  156. package/dist/packem_shared/NotFoundError-BIp61X6k.js +0 -27
  157. package/dist/packem_shared/PermissionError-CjoiJgip.js +0 -27
  158. package/dist/packem_shared/WalkError-DER5A43G.js +0 -24
  159. package/dist/packem_shared/assertValidFileContents-BmcLtsGd.js +0 -7
  160. package/dist/packem_shared/assertValidFileOrDirectoryPath-8HANmVjk.js +0 -7
  161. package/dist/packem_shared/collect-CqQ3eVab.js +0 -14
  162. package/dist/packem_shared/collectSync-noE08NNv.js +0 -14
  163. package/dist/packem_shared/emptyDir-Df4Tfjtk.js +0 -44
  164. package/dist/packem_shared/emptyDirSync-BD8-1Ytl.js +0 -41
  165. package/dist/packem_shared/ensureDir-DNlPftys.js +0 -53
  166. package/dist/packem_shared/ensureDirSync-DcPZFMy5.js +0 -53
  167. package/dist/packem_shared/ensureFile-BRQpUOUM.js +0 -47
  168. package/dist/packem_shared/ensureFileSync-SBY7A9-C.js +0 -47
  169. package/dist/packem_shared/ensureLink-DJQeauEn.js +0 -55
  170. package/dist/packem_shared/ensureLinkSync-D9RVAglV.js +0 -55
  171. package/dist/packem_shared/ensureSymlink-CoRYDRwr.js +0 -80
  172. package/dist/packem_shared/ensureSymlinkSync-CFimFlgh.js +0 -81
  173. package/dist/packem_shared/findUp-YcNLKdfV.js +0 -84
  174. package/dist/packem_shared/findUpSync-BfA5fheN.js +0 -83
  175. package/dist/packem_shared/get-file-info-type-FD4-jsyg.js +0 -14
  176. package/dist/packem_shared/index-CHM-in-V.js +0 -100
  177. package/dist/packem_shared/is-stats-identical-D8FxpvQU.js +0 -3
  178. package/dist/packem_shared/isAccessible-DuVrTNFV.js +0 -38
  179. package/dist/packem_shared/isAccessibleSync-DI8mM0fA.js +0 -38
  180. package/dist/packem_shared/isFsCaseSensitive-D-ayleCy.js +0 -62
  181. package/dist/packem_shared/move-DbpW5_vA.js +0 -134
  182. package/dist/packem_shared/parseJson-BedVi91S.js +0 -232
  183. package/dist/packem_shared/readFile-Iz7kvCCk.js +0 -65
  184. package/dist/packem_shared/readFileSync-gm9yfIhh.js +0 -54
  185. package/dist/packem_shared/readJson-D0G0ndHL.js +0 -22
  186. package/dist/packem_shared/readJsonSync-B7oicPaL.js +0 -22
  187. package/dist/packem_shared/readYaml-D5q2a0e1.js +0 -10
  188. package/dist/packem_shared/readYamlSync-BKX-PAfq.js +0 -10
  189. package/dist/packem_shared/remove-CNkjFFkQ.js +0 -38
  190. package/dist/packem_shared/removeSync-AnawYpPv.js +0 -38
  191. package/dist/packem_shared/resolve-symlink-target-Kh4GovFf.js +0 -16
  192. package/dist/packem_shared/sanitize-BZoLN9Fg.js +0 -205
  193. package/dist/packem_shared/stripJsonComments-vo4k0mpF.js +0 -19
  194. package/dist/packem_shared/to-uint-8-array-Dz2nF1y1.js +0 -19
  195. package/dist/packem_shared/walk-CSZgCuDx.js +0 -124
  196. package/dist/packem_shared/walk-include-CZco7BvN.js +0 -16
  197. package/dist/packem_shared/walkSync-C4Cy28xb.js +0 -123
  198. package/dist/packem_shared/writeFile-B8HX0JIQ.js +0 -81
  199. package/dist/packem_shared/writeFileSync-DB8vv8xR.js +0 -81
  200. package/dist/packem_shared/writeJson-Bo7C2UHw.js +0 -50
  201. package/dist/packem_shared/writeJsonSync-BKZ_9Acr.js +0 -50
  202. package/dist/packem_shared/writeYaml-BWCOome-.js +0 -24
  203. package/dist/packem_shared/writeYamlSync-DBVnXmuY.js +0 -24
  204. package/dist/read/read-file-sync.d.ts +0 -37
  205. package/dist/read/read-file.d.ts +0 -41
  206. package/dist/read/read-json-sync.d.ts +0 -5
  207. package/dist/read/read-json.d.ts +0 -5
  208. package/dist/read/read-yaml-sync.d.ts +0 -4
  209. package/dist/read/read-yaml.d.ts +0 -4
  210. package/dist/remove/empty-dir-sync.d.ts +0 -23
  211. package/dist/remove/empty-dir.d.ts +0 -28
  212. package/dist/remove/remove-sync.d.ts +0 -27
  213. package/dist/remove/remove.d.ts +0 -32
  214. package/dist/sanitize.d.ts +0 -31
  215. package/dist/types.d.ts +0 -304
  216. package/dist/utils/assert-valid-file-contents.d.ts +0 -27
  217. package/dist/utils/assert-valid-file-or-directory-path.d.ts +0 -26
  218. package/dist/utils/parse-json.d.ts +0 -5
  219. package/dist/utils/strip-json-comments.d.ts +0 -44
  220. package/dist/write/utils/to-uint-8-array.d.ts +0 -2
  221. package/dist/write/write-file-sync.d.ts +0 -30
  222. package/dist/write/write-file.d.ts +0 -30
  223. package/dist/write/write-json-sync.d.ts +0 -29
  224. package/dist/write/write-json.d.ts +0 -30
  225. package/dist/write/write-yaml-sync.d.ts +0 -4
  226. package/dist/write/write-yaml.d.ts +0 -4
@@ -0,0 +1 @@
1
+ import{g as mt}from"./_commonjsHelpers-CWAkuNXM.js";var Et={},bt,$t;function ht(){if($t)return bt;$t=1;const C="[^\\\\/]",x=Symbol("unignore"),v="\\.",U="\\+",K="\\?",s="\\/",a="(?=.)",c="[^/]",f=`(?:${s}|$)`,m=`(?:^|${s})`,y=`${v}{1,2}${f}`,X=`(?!${v})`,B=`(?!${m}${y})`,T=`(?!${v}{0,1}${f})`,G=`(?!${y})`,ot=`[^.${s}]`,j=`${c}*?`,q="/",p={DOT_LITERAL:v,PLUS_LITERAL:U,QMARK_LITERAL:K,SLASH_LITERAL:s,ONE_CHAR:a,QMARK:c,END_ANCHOR:f,DOTS_SLASH:y,NO_DOT:X,NO_DOTS:B,NO_DOT_SLASH:T,NO_DOTS_SLASH:G,QMARK_NO_DOT:ot,STAR:j,START_ANCHOR:m,SEP:q},i={...p,SLASH_LITERAL:"[\\\\/]",QMARK:C,STAR:`${C}*?`,DOTS_SLASH:`${v}{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!${v})`,NO_DOTS:`(?!(?:^|[\\\\/])${v}{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!${v}{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!${v}{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},u={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return bt={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:u,UNIGNORE:x,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(l){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${l.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(l){return l===!0?i:p}},bt}var dt;function gt(){return dt||(dt=1,(function(C){const{REGEX_BACKSLASH:x,REGEX_REMOVE_BACKSLASH:v,REGEX_SPECIAL_CHARS:U,REGEX_SPECIAL_CHARS_GLOBAL:K}=ht();C.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),C.hasRegexChars=s=>U.test(s),C.isRegexChar=s=>s.length===1&&C.hasRegexChars(s),C.escapeRegex=s=>s.replace(K,"\\$1"),C.toPosixSlashes=s=>s.replace(x,"/"),C.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const s=navigator.platform.toLowerCase();return s==="win32"||s==="windows"}return process.platform?process.platform==="win32":!1},C.removeBackslashes=s=>s.replace(v,a=>a==="\\"?"":a),C.escapeLast=(s,a,c)=>{const f=s.lastIndexOf(a,c);return f===-1?s:s[f-1]==="\\"?C.escapeLast(s,a,f-1):`${s.slice(0,f)}\\${s.slice(f)}`},C.removePrefix=(s,a={})=>{let c=s;return c.startsWith("./")&&(c=c.slice(2),a.prefix="./"),c},C.wrapOutput=(s,a={},c={})=>{const f=c.contains?"":"^",m=c.contains?"":"$";let y=`${f}(?:${s})${m}`;return a.negated===!0&&(y=`(?:^(?!${y}).*$)`),y},C.basename=(s,{windows:a}={})=>{const c=s.split(a?/[\\/]/:"/"),f=c[c.length-1];return f===""?c[c.length-2]:f}})(Et)),Et}var yt,vt;function kt(){if(vt)return yt;vt=1;const C=gt(),{CHAR_ASTERISK:x,CHAR_AT:v,CHAR_BACKWARD_SLASH:U,CHAR_COMMA:K,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:a,CHAR_FORWARD_SLASH:c,CHAR_LEFT_CURLY_BRACE:f,CHAR_LEFT_PARENTHESES:m,CHAR_LEFT_SQUARE_BRACKET:y,CHAR_PLUS:X,CHAR_QUESTION_MARK:B,CHAR_RIGHT_CURLY_BRACE:T,CHAR_RIGHT_PARENTHESES:G,CHAR_RIGHT_SQUARE_BRACKET:ot}=ht(),j=i=>i===c||i===U,q=i=>{i.isPrefix!==!0&&(i.depth=i.isGlobstar?1/0:1)};return yt=(i,u)=>{const l=u||{},E=i.length-1,R=l.parts===!0||l.scanToEnd===!0,h=[],_=[],at=[];let F=i,P=-1,D=0,Q=0,V=!1,Y=!1,I=!1,st=!1,pt=!1,$=!1,z=!1,lt=!1,ft=!1,H=!1,Z=0,rt,A,t={value:"",depth:0,isGlob:!1};const M=()=>P>=E,et=()=>F.charCodeAt(P+1),W=()=>(rt=A,F.charCodeAt(++P));for(;P<E;){A=W();let N;if(A===U){z=t.backslashes=!0,A=W(),A===f&&($=!0);continue}if($===!0||A===f){for(Z++;M()!==!0&&(A=W());){if(A===U){z=t.backslashes=!0,W();continue}if(A===f){Z++;continue}if($!==!0&&A===s&&(A=W())===s){if(V=t.isBrace=!0,I=t.isGlob=!0,H=!0,R===!0)continue;break}if($!==!0&&A===K){if(V=t.isBrace=!0,I=t.isGlob=!0,H=!0,R===!0)continue;break}if(A===T&&(Z--,Z===0)){$=!1,V=t.isBrace=!0,H=!0;break}}if(R===!0)continue;break}if(A===c){if(h.push(P),_.push(t),t={value:"",depth:0,isGlob:!1},H===!0)continue;if(rt===s&&P===D+1){D+=2;continue}Q=P+1;continue}if(l.noext!==!0&&(A===X||A===v||A===x||A===B||A===a)&&et()===m){if(I=t.isGlob=!0,st=t.isExtglob=!0,H=!0,A===a&&P===D&&(ft=!0),R===!0){for(;M()!==!0&&(A=W());){if(A===U){z=t.backslashes=!0,A=W();continue}if(A===G){I=t.isGlob=!0,H=!0;break}}continue}break}if(A===x){if(rt===x&&(pt=t.isGlobstar=!0),I=t.isGlob=!0,H=!0,R===!0)continue;break}if(A===B){if(I=t.isGlob=!0,H=!0,R===!0)continue;break}if(A===y){for(;M()!==!0&&(N=W());){if(N===U){z=t.backslashes=!0,W();continue}if(N===ot){Y=t.isBracket=!0,I=t.isGlob=!0,H=!0;break}}if(R===!0)continue;break}if(l.nonegate!==!0&&A===a&&P===D){lt=t.negated=!0,D++;continue}if(l.noparen!==!0&&A===m){if(I=t.isGlob=!0,R===!0){for(;M()!==!0&&(A=W());){if(A===m){z=t.backslashes=!0,A=W();continue}if(A===G){H=!0;break}}continue}break}if(I===!0){if(H=!0,R===!0)continue;break}}l.noext===!0&&(st=!1,I=!1);let e=F,n="",tt="";D>0&&(n=F.slice(0,D),F=F.slice(D),Q-=D),e&&I===!0&&Q>0?(e=F.slice(0,Q),tt=F.slice(Q)):I===!0?(e="",tt=F):e=F,e&&e!==""&&e!=="/"&&e!==F&&j(e.charCodeAt(e.length-1))&&(e=e.slice(0,-1)),l.unescape===!0&&(tt&&(tt=C.removeBackslashes(tt)),e&&z===!0&&(e=C.removeBackslashes(e)));const d={prefix:n,input:i,start:D,base:e,glob:tt,isBrace:V,isBracket:Y,isGlob:I,isExtglob:st,isGlobstar:pt,negated:lt,negatedExtglob:ft};if(l.tokens===!0&&(d.maxDepth=0,j(A)||_.push(t),d.tokens=_),l.parts===!0||l.tokens===!0){let N;for(let k=0;k<h.length;k++){const J=N?N+1:D,ct=h[k],Rt=i.slice(J,ct);l.tokens&&(k===0&&D!==0?(_[k].isPrefix=!0,_[k].value=n):_[k].value=Rt,q(_[k]),d.maxDepth+=_[k].depth),(k!==0||Rt!=="")&&at.push(Rt),N=ct}if(N&&N+1<i.length){const k=i.slice(N+1);at.push(k),l.tokens&&(_[_.length-1].value=k,q(_[_.length-1]),d.maxDepth+=_[_.length-1].depth)}d.slashes=h,d.parts=at}return d},yt}var Ct,Ht;function Nt(){if(Ht)return Ct;Ht=1;const C=ht(),x=gt(),{MAX_LENGTH:v,POSIX_REGEX_SOURCE:U,REGEX_NON_SPECIAL_CHARS:K,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:a}=C,c=(p,i)=>typeof i.expandRange=="function"?i.expandRange(...p,i):(p.sort(),`[${p.join("-")}]`),f=(p,i)=>`Missing ${p}: "${i}" - use "\\\\${i}" to match literal characters`,m=p=>{const i=[];let u=0,l=0,E=0,R="",h=!1;for(const _ of p){if(h===!0){R+=_,h=!1;continue}if(_==="\\"){R+=_,h=!0;continue}if(_==='"'){E=E===1?0:1,R+=_;continue}if(E===0){if(_==="[")u++;else if(_==="]"&&u>0)u--;else if(u===0){if(_==="(")l++;else if(_===")"&&l>0)l--;else if(_==="|"&&l===0){i.push(R),R="";continue}}}R+=_}return i.push(R),i},y=p=>{let i=!1;for(const u of p){if(i===!0){i=!1;continue}if(u==="\\"){i=!0;continue}if(/[?*+@!()[\]{}]/.test(u))return!1}return!0},X=p=>{let i=p.trim(),u=!0;for(;u===!0;)u=!1,/^@\([^\\()[\]{}|]+\)$/.test(i)&&(i=i.slice(2,-1),u=!0);if(y(i))return i.replace(/\\(.)/g,"$1")},B=p=>{const i=p.map(X).filter(Boolean);for(let u=0;u<i.length;u++)for(let l=u+1;l<i.length;l++){const E=i[u],R=i[l],h=E[0];if(!(!h||E!==h.repeat(E.length)||R!==h.repeat(R.length))&&(E===R||E.startsWith(R)||R.startsWith(E)))return!0}return!1},T=(p,i=!0)=>{if(p[0]!=="+"&&p[0]!=="*"||p[1]!=="(")return;let u=0,l=0,E=0,R=!1;for(let h=1;h<p.length;h++){const _=p[h];if(R===!0){R=!1;continue}if(_==="\\"){R=!0;continue}if(_==='"'){E=E===1?0:1;continue}if(E!==1){if(_==="["){u++;continue}if(_==="]"&&u>0){u--;continue}if(!(u>0)){if(_==="("){l++;continue}if(_===")"&&(l--,l===0))return i===!0&&h!==p.length-1?void 0:{type:p[0],body:p.slice(2,h),end:h}}}}},G=p=>{let i=0;const u=[];for(;i<p.length;){const l=T(p.slice(i),!1);if(!l||l.type!=="*")return;const E=m(l.body).map(h=>h.trim());if(E.length!==1)return;const R=X(E[0]);if(!R||R.length!==1)return;u.push(R),i+=l.end+1}return u.length<1?void 0:`${u.length===1?x.escapeRegex(u[0]):`[${u.map(l=>x.escapeRegex(l)).join("")}]`}*`},ot=p=>{let i=0,u=p.trim(),l=T(u);for(;l;)i++,u=l.body.trim(),l=T(u);return i},j=(p,i)=>{if(i.maxExtglobRecursion===!1)return{risky:!1};const u=typeof i.maxExtglobRecursion=="number"?i.maxExtglobRecursion:C.DEFAULT_MAX_EXTGLOB_RECURSION,l=m(p).map(E=>E.trim());if(l.length>1&&(l.some(E=>E==="")||l.some(E=>/^[*?]+$/.test(E))||B(l)))return{risky:!0};for(const E of l){const R=G(E);if(R)return{risky:!0,safeOutput:R};if(ot(E)>u)return{risky:!0}}return{risky:!1}},q=(p,i)=>{if(typeof p!="string")throw new TypeError("Expected a string");p=a[p]||p;const u={...i},l=typeof u.maxLength=="number"?Math.min(v,u.maxLength):v;let E=p.length;if(E>l)throw new SyntaxError(`Input length: ${E}, exceeds maximum allowed length: ${l}`);const R={type:"bos",value:"",output:u.prepend||""},h=[R],_=u.capture?"":"?:",at=C.globChars(u.windows),F=C.extglobChars(at),{DOT_LITERAL:P,PLUS_LITERAL:D,SLASH_LITERAL:Q,ONE_CHAR:V,DOTS_SLASH:Y,NO_DOT:I,NO_DOT_SLASH:st,NO_DOTS_SLASH:pt,QMARK:$,QMARK_NO_DOT:z,STAR:lt,START_ANCHOR:ft}=at,H=o=>`(${_}(?:(?!${ft}${o.dot?Y:P}).)*?)`,Z=u.dot?"":I,rt=u.dot?$:z;let A=u.bash===!0?H(u):lt;u.capture&&(A=`(${A})`),typeof u.noext=="boolean"&&(u.noextglob=u.noext);const t={input:p,index:-1,start:0,dot:u.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};p=x.removePrefix(p,t),E=p.length;const M=[],et=[],W=[];let e=R,n;const tt=()=>t.index===E-1,d=t.peek=(o=1)=>p[t.index+o],N=t.advance=()=>p[++t.index]||"",k=()=>p.slice(t.index+1),J=(o="",O=0)=>{t.consumed+=o,t.index+=O},ct=o=>{t.output+=o.output!=null?o.output:o.value,J(o.value)},Rt=()=>{let o=1;for(;d()==="!"&&(d(2)!=="("||d(3)==="?");)N(),t.start++,o++;return o%2===0?!1:(t.negated=!0,t.start++,!0)},At=o=>{t[o]++,W.push(o)},it=o=>{t[o]--,W.pop()},g=o=>{if(e.type==="globstar"){const O=t.braces>0&&(o.type==="comma"||o.type==="brace"),r=o.extglob===!0||M.length&&(o.type==="pipe"||o.type==="paren");o.type!=="slash"&&o.type!=="paren"&&!O&&!r&&(t.output=t.output.slice(0,-e.output.length),e.type="star",e.value="*",e.output=A,t.output+=e.output)}if(M.length&&o.type!=="paren"&&(M[M.length-1].inner+=o.value),(o.value||o.output)&&ct(o),e&&e.type==="text"&&o.type==="text"){e.output=(e.output||e.value)+o.value,e.value+=o.value;return}o.prev=e,h.push(o),e=o},_t=(o,O)=>{const r={...F[O],conditions:1,inner:""};r.prev=e,r.parens=t.parens,r.output=t.output,r.startIndex=t.index,r.tokensIndex=h.length;const b=(u.capture?"(":"")+r.open;At("parens"),g({type:o,value:O,output:t.output?"":V}),g({type:"paren",extglob:!0,value:N(),output:b}),M.push(r)},Lt=o=>{const O=p.slice(o.startIndex,t.index+1),r=p.slice(o.startIndex+2,t.index),b=j(r,u);if((o.type==="plus"||o.type==="star")&&b.risky){const S=b.safeOutput?(o.output?"":V)+(u.capture?`(${b.safeOutput})`:b.safeOutput):void 0,ut=h[o.tokensIndex];ut.type="text",ut.value=O,ut.output=S||x.escapeRegex(O);for(let nt=o.tokensIndex+1;nt<h.length;nt++)h[nt].value="",h[nt].output="",delete h[nt].suffix;t.output=o.output+ut.output,t.backtrack=!0,g({type:"paren",extglob:!0,value:n,output:""}),it("parens");return}let L=o.close+(u.capture?")":""),w;if(o.type==="negate"){let S=A;if(o.inner&&o.inner.length>1&&o.inner.includes("/")&&(S=H(u)),(S!==A||tt()||/^\)+$/.test(k()))&&(L=o.close=`)$))${S}`),o.inner.includes("*")&&(w=k())&&/^\.[^\\/.]+$/.test(w)){const ut=q(w,{...i,fastpaths:!1}).output;L=o.close=`)${ut})${S})`}o.prev.type==="bos"&&(t.negatedExtglob=!0)}g({type:"paren",extglob:!0,value:n,output:L}),it("parens")};if(u.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(p)){let o=!1,O=p.replace(s,(r,b,L,w,S,ut)=>w==="\\"?(o=!0,r):w==="?"?b?b+w+(S?$.repeat(S.length):""):ut===0?rt+(S?$.repeat(S.length):""):$.repeat(L.length):w==="."?P.repeat(L.length):w==="*"?b?b+w+(S?A:""):A:b?r:`\\${r}`);return o===!0&&(u.unescape===!0?O=O.replace(/\\/g,""):O=O.replace(/\\+/g,r=>r.length%2===0?"\\\\":r?"\\":"")),O===p&&u.contains===!0?(t.output=p,t):(t.output=x.wrapOutput(O,t,i),t)}for(;!tt();){if(n=N(),n==="\0")continue;if(n==="\\"){const r=d();if(r==="/"&&u.bash!==!0||r==="."||r===";")continue;if(!r){n+="\\",g({type:"text",value:n});continue}const b=/^\\+/.exec(k());let L=0;if(b&&b[0].length>2&&(L=b[0].length,t.index+=L,L%2!==0&&(n+="\\")),u.unescape===!0?n=N():n+=N(),t.brackets===0){g({type:"text",value:n});continue}}if(t.brackets>0&&(n!=="]"||e.value==="["||e.value==="[^")){if(u.posix!==!1&&n===":"){const r=e.value.slice(1);if(r.includes("[")&&(e.posix=!0,r.includes(":"))){const b=e.value.lastIndexOf("["),L=e.value.slice(0,b),w=e.value.slice(b+2),S=U[w];if(S){e.value=L+S,t.backtrack=!0,N(),!R.output&&h.indexOf(e)===1&&(R.output=V);continue}}}(n==="["&&d()!==":"||n==="-"&&d()==="]")&&(n=`\\${n}`),n==="]"&&(e.value==="["||e.value==="[^")&&(n=`\\${n}`),u.posix===!0&&n==="!"&&e.value==="["&&(n="^"),e.value+=n,ct({value:n});continue}if(t.quotes===1&&n!=='"'){n=x.escapeRegex(n),e.value+=n,ct({value:n});continue}if(n==='"'){t.quotes=t.quotes===1?0:1,u.keepQuotes===!0&&g({type:"text",value:n});continue}if(n==="("){At("parens"),g({type:"paren",value:n});continue}if(n===")"){if(t.parens===0&&u.strictBrackets===!0)throw new SyntaxError(f("opening","("));const r=M[M.length-1];if(r&&t.parens===r.parens+1){Lt(M.pop());continue}g({type:"paren",value:n,output:t.parens?")":"\\)"}),it("parens");continue}if(n==="["){if(u.nobracket===!0||!k().includes("]")){if(u.nobracket!==!0&&u.strictBrackets===!0)throw new SyntaxError(f("closing","]"));n=`\\${n}`}else At("brackets");g({type:"bracket",value:n});continue}if(n==="]"){if(u.nobracket===!0||e&&e.type==="bracket"&&e.value.length===1){g({type:"text",value:n,output:`\\${n}`});continue}if(t.brackets===0){if(u.strictBrackets===!0)throw new SyntaxError(f("opening","["));g({type:"text",value:n,output:`\\${n}`});continue}it("brackets");const r=e.value.slice(1);if(e.posix!==!0&&r[0]==="^"&&!r.includes("/")&&(n=`/${n}`),e.value+=n,ct({value:n}),u.literalBrackets===!1||x.hasRegexChars(r))continue;const b=x.escapeRegex(e.value);if(t.output=t.output.slice(0,-e.value.length),u.literalBrackets===!0){t.output+=b,e.value=b;continue}e.value=`(${_}${b}|${e.value})`,t.output+=e.value;continue}if(n==="{"&&u.nobrace!==!0){At("braces");const r={type:"brace",value:n,output:"(",outputIndex:t.output.length,tokensIndex:t.tokens.length};et.push(r),g(r);continue}if(n==="}"){const r=et[et.length-1];if(u.nobrace===!0||!r){g({type:"text",value:n,output:n});continue}let b=")";if(r.dots===!0){const L=h.slice(),w=[];for(let S=L.length-1;S>=0&&(h.pop(),L[S].type!=="brace");S--)L[S].type!=="dots"&&w.unshift(L[S].value);b=c(w,u),t.backtrack=!0}if(r.comma!==!0&&r.dots!==!0){const L=t.output.slice(0,r.outputIndex),w=t.tokens.slice(r.tokensIndex);r.value=r.output="\\{",n=b="\\}",t.output=L;for(const S of w)t.output+=S.output||S.value}g({type:"brace",value:n,output:b}),it("braces"),et.pop();continue}if(n==="|"){M.length>0&&M[M.length-1].conditions++,g({type:"text",value:n});continue}if(n===","){let r=n;const b=et[et.length-1];b&&W[W.length-1]==="braces"&&(b.comma=!0,r="|"),g({type:"comma",value:n,output:r});continue}if(n==="/"){if(e.type==="dot"&&t.index===t.start+1){t.start=t.index+1,t.consumed="",t.output="",h.pop(),e=R;continue}g({type:"slash",value:n,output:Q});continue}if(n==="."){if(t.braces>0&&e.type==="dot"){e.value==="."&&(e.output=P);const r=et[et.length-1];e.type="dots",e.output+=n,e.value+=n,r.dots=!0;continue}if(t.braces+t.parens===0&&e.type!=="bos"&&e.type!=="slash"){g({type:"text",value:n,output:P});continue}g({type:"dot",value:n,output:P});continue}if(n==="?"){if(!(e&&e.value==="(")&&u.noextglob!==!0&&d()==="("&&d(2)!=="?"){_t("qmark",n);continue}if(e&&e.type==="paren"){const r=d();let b=n;(e.value==="("&&!/[!=<:]/.test(r)||r==="<"&&!/<([!=]|\w+>)/.test(k()))&&(b=`\\${n}`),g({type:"text",value:n,output:b});continue}if(u.dot!==!0&&(e.type==="slash"||e.type==="bos")){g({type:"qmark",value:n,output:z});continue}g({type:"qmark",value:n,output:$});continue}if(n==="!"){if(u.noextglob!==!0&&d()==="("&&(d(2)!=="?"||!/[!=<:]/.test(d(3)))){_t("negate",n);continue}if(u.nonegate!==!0&&t.index===0){Rt();continue}}if(n==="+"){if(u.noextglob!==!0&&d()==="("&&d(2)!=="?"){_t("plus",n);continue}if(e&&e.value==="("||u.regex===!1){g({type:"plus",value:n,output:D});continue}if(e&&(e.type==="bracket"||e.type==="paren"||e.type==="brace")||t.parens>0){g({type:"plus",value:n});continue}g({type:"plus",value:D});continue}if(n==="@"){if(u.noextglob!==!0&&d()==="("&&d(2)!=="?"){g({type:"at",extglob:!0,value:n,output:""});continue}g({type:"text",value:n});continue}if(n!=="*"){(n==="$"||n==="^")&&(n=`\\${n}`);const r=K.exec(k());r&&(n+=r[0],t.index+=r[0].length),g({type:"text",value:n});continue}if(e&&(e.type==="globstar"||e.star===!0)){e.type="star",e.star=!0,e.value+=n,e.output=A,t.backtrack=!0,t.globstar=!0,J(n);continue}let o=k();if(u.noextglob!==!0&&/^\([^?]/.test(o)){_t("star",n);continue}if(e.type==="star"){if(u.noglobstar===!0){J(n);continue}const r=e.prev,b=r.prev,L=r.type==="slash"||r.type==="bos",w=b&&(b.type==="star"||b.type==="globstar");if(u.bash===!0&&(!L||o[0]&&o[0]!=="/")){g({type:"star",value:n,output:""});continue}const S=t.braces>0&&(r.type==="comma"||r.type==="brace"),ut=M.length&&(r.type==="pipe"||r.type==="paren");if(!L&&r.type!=="paren"&&!S&&!ut){g({type:"star",value:n,output:""});continue}for(;o.slice(0,3)==="/**";){const nt=p[t.index+4];if(nt&&nt!=="/")break;o=o.slice(3),J("/**",3)}if(r.type==="bos"&&tt()){e.type="globstar",e.value+=n,e.output=H(u),t.output=e.output,t.globstar=!0,J(n);continue}if(r.type==="slash"&&r.prev.type!=="bos"&&!w&&tt()){t.output=t.output.slice(0,-(r.output+e.output).length),r.output=`(?:${r.output}`,e.type="globstar",e.output=H(u)+(u.strictSlashes?")":"|$)"),e.value+=n,t.globstar=!0,t.output+=r.output+e.output,J(n);continue}if(r.type==="slash"&&r.prev.type!=="bos"&&o[0]==="/"){const nt=o[1]!==void 0?"|$":"";t.output=t.output.slice(0,-(r.output+e.output).length),r.output=`(?:${r.output}`,e.type="globstar",e.output=`${H(u)}${Q}|${Q}${nt})`,e.value+=n,t.output+=r.output+e.output,t.globstar=!0,J(n+N()),g({type:"slash",value:"/",output:""});continue}if(r.type==="bos"&&o[0]==="/"){e.type="globstar",e.value+=n,e.output=`(?:^|${Q}|${H(u)}${Q})`,t.output=e.output,t.globstar=!0,J(n+N()),g({type:"slash",value:"/",output:""});continue}if(S&&o[0]==="/"){e.type="globstar",e.value+=n,e.output=`(?:^|${Q}|${H(u)}${Q})`,t.output+=e.output,t.globstar=!0,J(n+N()),g({type:"slash",value:"/",output:""});continue}t.output=t.output.slice(0,-e.output.length),e.type="globstar",e.output=H(u),e.value+=n,t.output+=e.output,t.globstar=!0,J(n);continue}const O={type:"star",value:n,output:A};if(u.bash===!0){O.output=".*?",(e.type==="bos"||e.type==="slash")&&(O.output=Z+O.output),g(O);continue}if(e&&(e.type==="bracket"||e.type==="paren")&&u.regex===!0){O.output=n,g(O);continue}(t.index===t.start||e.type==="slash"||e.type==="dot")&&(e.type==="dot"?(t.output+=st,e.output+=st):u.dot===!0?(t.output+=pt,e.output+=pt):(t.output+=Z,e.output+=Z),d()!=="*"&&(t.output+=V,e.output+=V)),g(O)}for(;t.brackets>0;){if(u.strictBrackets===!0)throw new SyntaxError(f("closing","]"));t.output=x.escapeLast(t.output,"["),it("brackets")}for(;t.parens>0;){if(u.strictBrackets===!0)throw new SyntaxError(f("closing",")"));t.output=x.escapeLast(t.output,"("),it("parens")}for(;t.braces>0;){if(u.strictBrackets===!0)throw new SyntaxError(f("closing","}"));t.output=x.escapeLast(t.output,"{"),it("braces")}if(u.strictSlashes!==!0&&(e.type==="star"||e.type==="bracket")&&g({type:"maybe_slash",value:"",output:`${Q}?`}),t.backtrack===!0){t.output="";for(const o of t.tokens)t.output+=o.output!=null?o.output:o.value,o.suffix&&(t.output+=o.suffix)}return t};return q.fastpaths=(p,i)=>{const u={...i},l=typeof u.maxLength=="number"?Math.min(v,u.maxLength):v,E=p.length;if(E>l)throw new SyntaxError(`Input length: ${E}, exceeds maximum allowed length: ${l}`);p=a[p]||p;const{DOT_LITERAL:R,SLASH_LITERAL:h,ONE_CHAR:_,DOTS_SLASH:at,NO_DOT:F,NO_DOTS:P,NO_DOTS_SLASH:D,STAR:Q,START_ANCHOR:V}=C.globChars(u.windows),Y=u.dot?P:F,I=u.dot?D:F,st=u.capture?"":"?:",pt={negated:!1,prefix:""};let $=u.bash===!0?".*?":Q;u.capture&&($=`(${$})`);const z=Z=>Z.noglobstar===!0?$:`(${st}(?:(?!${V}${Z.dot?at:R}).)*?)`,lt=Z=>{switch(Z){case"*":return`${Y}${_}${$}`;case".*":return`${R}${_}${$}`;case"*.*":return`${Y}${$}${R}${_}${$}`;case"*/*":return`${Y}${$}${h}${_}${I}${$}`;case"**":return Y+z(u);case"**/*":return`(?:${Y}${z(u)}${h})?${I}${_}${$}`;case"**/*.*":return`(?:${Y}${z(u)}${h})?${I}${$}${R}${_}${$}`;case"**/.*":return`(?:${Y}${z(u)}${h})?${R}${_}${$}`;default:{const rt=/^(.*?)\.(\w+)$/.exec(Z);if(!rt)return;const A=lt(rt[1]);return A?A+R+rt[2]:void 0}}},ft=x.removePrefix(p,pt);let H=lt(ft);return H&&u.strictSlashes!==!0&&(H+=`${h}?`),H},Ct=q,Ct}var St,Ot;function It(){if(Ot)return St;Ot=1;const C=kt(),x=Nt(),v=gt(),U=ht(),K=a=>a&&typeof a=="object"&&!Array.isArray(a),s=(a,c,f=!1)=>{if(Array.isArray(a)){const j=a.map(q=>s(q,c,f));return q=>{for(const p of j){const i=p(q);if(i)return i}return!1}}const m=K(a)&&a.tokens&&a.input;if(a===""||typeof a!="string"&&!m)throw new TypeError("Expected pattern to be a non-empty string");const y=c||{},X=y.windows,B=m?s.compileRe(a,c):s.makeRe(a,c,!1,!0),T=B.state;delete B.state;let G=()=>!1;if(y.ignore){const j={...c,ignore:null,onMatch:null,onResult:null};G=s(y.ignore,j,f)}const ot=(j,q=!1)=>{const{isMatch:p,match:i,output:u}=s.test(j,B,c,{glob:a,posix:X}),l={glob:a,state:T,regex:B,posix:X,input:j,output:u,match:i,isMatch:p};if(typeof y.onResult=="function"&&y.onResult(l),p===!1)return l.isMatch=!1,q?l:!1;t:if(G(j)){if(typeof y.onIgnore=="function"&&y.onIgnore(l)===U.UNIGNORE){l.isMatch=!0;break t}return l.isMatch=!1,q?l:!1}return typeof y.onMatch=="function"&&y.onMatch(l),q?l:!0};return f&&(ot.state=T),ot};return s.test=(a,c,f,{glob:m,posix:y}={})=>{if(typeof a!="string")throw new TypeError("Expected input to be a string");if(a==="")return{isMatch:!1,output:""};const X=f||{},B=X.format||(y?v.toPosixSlashes:null);let T=a===m,G=T&&B?B(a):a;return T===!1&&(G=B?B(a):a,T=G===m),(T===!1||X.capture===!0)&&(X.matchBase===!0||X.basename===!0?T=s.matchBase(a,c,f,y):T=c.exec(G)),{isMatch:!!T,match:T,output:G}},s.matchBase=(a,c,f)=>(c instanceof RegExp?c:s.makeRe(c,f)).test(v.basename(a)),s.isMatch=(a,c,f)=>s(c,f)(a),s.parse=(a,c)=>Array.isArray(a)?a.map(f=>s.parse(f,c)):x(a,{...c,fastpaths:!1}),s.scan=(a,c)=>C(a,c),s.compileRe=(a,c,f=!1,m=!1)=>{if(f===!0)return a.output;const y=c||{},X=y.contains?"":"^",B=y.contains?"":"$";let T=`${X}(?:${a.output})${B}`;a&&a.negated===!0&&(T=`^(?!${T}).*$`);const G=s.toRegex(T,c);return m===!0&&(G.state=a),G},s.makeRe=(a,c={},f=!1,m=!1)=>{if(!a||typeof a!="string")throw new TypeError("Expected a non-empty string");let y={negated:!1,fastpaths:!0};return c.fastpaths!==!1&&(a[0]==="."||a[0]==="*")&&(y.output=x.fastpaths(a,c)),y.output||(y=x(a,c)),s.compileRe(y,c,f,m)},s.toRegex=(a,c)=>{try{const f=c||{};return new RegExp(a,f.flags||(f.nocase?"i":""))}catch(f){if(c&&c.debug===!0)throw f;return/$^/}},s.constants=U,St=s,St}var xt,Tt;function wt(){if(Tt)return xt;Tt=1;const C=It(),x=gt();function v(U,K,s=!1){return K&&(K.windows===null||K.windows===void 0)&&(K={...K,windows:x.isWindows()}),C(U,K,s)}return Object.assign(v,C),xt=v,xt}var Bt=wt();const Pt=mt(Bt);export{Pt as a};
@@ -0,0 +1,4 @@
1
+ const v=/^\s*(?:[;#].*)?$/,$=/^\s*\[([^\]]+)\]\s*$/,h=/\r?\n/,j=/\r?\n$/,D=/^[^=]+=/,m=e=>e===" "||e===" ",S=e=>{let t=0;for(;t<e.length&&m(e[t]);)t+=1;return{indent:e.slice(0,t),rest:e.slice(t)}},x=e=>{let t=e.length;for(;t>0&&m(e[t-1]);)t-=1;return{rest:e.slice(0,t),trailing:e.slice(t)}},b=e=>{const t=e.indexOf("=");if(t===-1)return;const n=e.slice(0,t),r=e.slice(t+1),{indent:i,rest:s}=S(n),{rest:o,trailing:c}=x(s);if(o===""||o.startsWith(";")||o.startsWith("#")||o.startsWith("["))return;const{indent:f,rest:y}=S(r),{rest:p,trailing:g}=x(y);return{after:f,before:c,indent:i,key:o,trailing:g,value:p}},I=e=>{let t=0,n=0;for(const r of e.split(h)){if(v.test(r)||$.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}},k=(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},N=(e,t)=>{for(const n of e.split(h)){if(!n||n.startsWith("["))continue;const r=D.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""},J=(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=$.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}},L=e=>{const t=e.replace(j,"").split(h),n=[];let r;for(const i of t){const{line:s,nextSection:o}=J(i,r);n.push(s),r=o}return n},M=(e,t,n)=>{const r=b(e.raw);if(!r||!e.key)return e.raw;const i=n({[e.key]:t}),s=N(i,e.key);return`${r.indent}${r.key}${r.before}=${r.after}${s}${r.trailing}`},W=(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("."),...W(i,s))}return n},A=(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},O=(e,t)=>{const n=[];for(const r of t.split(h))r!==""&&n.push(r);n.length>0&&e.push(...n)},P=e=>{const{line:t,markWritten:n,nextData:r,oldData:i,renderValue:s}=e;if(!t.key)return t.raw;const o=k(r,t.section);if(!o||!(t.key in o))return;n(t.section,t.key);const c=k(i,t.section)?.[t.key],f=o[t.key];return JSON.stringify(c)===JSON.stringify(f)?t.raw:s(t,f)},V=(e,t,n,r,i)=>{const s=k(r,t);if(!s)return;const o=n.get(t)??new Set,c=A(s,o);Object.keys(c).length!==0&&O(e,i(c))},E=(e,t,n,r)=>{const i=new Set(t.filter(s=>s.kind==="header"&&s.section).map(s=>s.section));for(const s of W(n)){if(i.has(s))continue;const o=k(n,s);if(!o||Object.keys(o).length===0)continue;const c=A(o,new Set);Object.keys(c).length!==0&&O(e,r(c,s))}},K=e=>{const t=e.includes(`\r
2
+ `)?`\r
3
+ `:`
4
+ `,{spaced:n,unspaced:r}=I(e);return{eol:t,whitespace:n>0&&n>=r}},R=(e,t,n,r,i)=>{const{eol:s}=i,o=j.test(e),c=L(e),f=new Map,y=new Map;for(const[l,a]of c.entries())a.kind!=="blank"&&y.set(a.section,l);const p=(l,a)=>{let u=f.get(l);u||(u=new Set,f.set(l,u)),u.add(a)},g=(l,a)=>M(l,a,r),d=[];for(const[l,a]of c.entries()){if(a.kind==="key"){const u=P({line:a,markWritten:p,nextData:n,oldData:t,renderValue:g});u!==void 0&&d.push(u);continue}d.push(a.raw),y.get(a.section)===l&&V(d,a.section,f,n,r)}E(d,c,n,r);const w=d.join(s);return o&&!w.endsWith(s)?`${w}${s}`:w};export{K as d,R as m};
@@ -0,0 +1 @@
1
+ const e=(n,d)=>!!d.ino&&!!d.dev&&d.ino===n.ino&&d.dev===n.dev;export{e as d};
@@ -0,0 +1 @@
1
+ import{createRequire as t}from"node:module";import{toPath as a}from"@visulima/path/utils";import{F_OK as u}from"./FIND_UP_STOP-CAwY1qU7.js";import f from"./assertValidFileOrDirectoryPath-BTlt945W.js";const n=t(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,i=e=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[o,r]=s.versions.node.split(".").map(Number);if(o>22||o===22&&r>=3||o===20&&r>=16)return s.getBuiltinModule(e)}return n(e)},{access:c}=i("node:fs/promises");async function d(e,o=u){f(e),e=a(e);try{return await c(e,o),!0}catch{return!1}}export{d as default};
@@ -0,0 +1 @@
1
+ import{createRequire as s}from"node:module";import{toPath as u}from"@visulima/path/utils";import{F_OK as f}from"./FIND_UP_STOP-CAwY1qU7.js";import a from"./assertValidFileOrDirectoryPath-BTlt945W.js";const n=s(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,i=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 n(e)},{accessSync:c}=i("node:fs");function d(e,o=f){a(e),e=u(e);try{return c(e,o),!0}catch{return!1}}export{d as default};
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Custom error class for handling JSON parsing or related errors.
3
+ * It can optionally include a file name and a code frame for better debugging.
4
+ * @example
5
+ * ```javascript
6
+ * import { JSONError } from "@visulima/fs/error";
7
+ * import { readJsonSync } from "@visulima/fs"; // Or any function that might throw this
8
+ * import { join } from "node:path";
9
+ *
10
+ * try {
11
+ * // Imagine readJsonSync encounters a malformed JSON file and throws JSONError
12
+ * // Forcing the scenario for demonstration:
13
+ * const simulateJsonError = (filePath, content) => {
14
+ * const err = new JSONError(`Unexpected token '}' at position 15`);
15
+ * err.fileName = filePath;
16
+ * // A real implementation might generate a code frame using a library
17
+ * err.codeFrame = ` 13 | "key": "value",
18
+ * > 14 | "anotherKey": "anotherValue",}
19
+ * | ^
20
+ * 15 | "lastKey": "end"
21
+ * `;
22
+ * throw err;
23
+ * };
24
+ *
25
+ * simulateJsonError(join("path", "to", "corrupted.json"), '{ "key": "value", "anotherKey": "anotherValue",} ');
26
+ * // const jsonData = readJsonSync(join("path", "to", "corrupted.json"));
27
+ * } catch (error) {
28
+ * if (error instanceof JSONError) {
29
+ * console.error(`JSON Error: ${error.message}`);
30
+ * // message property will include fileName and codeFrame if they were set.
31
+ * // console.error(`File: ${error.fileName}`);
32
+ * // console.error(`Code Frame:\n${error.codeFrame}`);
33
+ * } else {
34
+ * console.error("An unexpected error occurred:", error);
35
+ * }
36
+ * }
37
+ * ```
38
+ */
39
+ declare class JSONError extends Error {
40
+ #private;
41
+ fileName: string | undefined;
42
+ codeFrame: string | undefined;
43
+ override readonly name = "JSONError";
44
+ /**
45
+ * Creates a new JSONError instance.
46
+ * @param message The primary error message.
47
+ */
48
+ constructor(message: string);
49
+ override get message(): string;
50
+ override set message(message: string);
51
+ }
52
+ export { JSONError as J };
@@ -0,0 +1,2 @@
1
+ import{parse as u,modify as g,applyEdits as l}from"jsonc-parser";const y=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),c=(t,i,e)=>{const r=g(t.text,i,e,{formattingOptions:t.formattingOptions});t.text=l(t.text,r)},m=(t,i,e,r,s)=>{const o=new Set([...Object.keys(i),...Object.keys(e)]);for(const n of o){const a=[...r,n];n in e?n in i?s(t,i[n],e[n],a):c(t,a,e[n]):c(t,a,void 0)}},p=(t,i,e,r)=>{if(i!==e){if(y(i)&&y(e)){m(t,i,e,r,p);return}if(Array.isArray(i)&&Array.isArray(e)&&i.length===e.length){for(const[s,o]of i.entries())p(t,o,e[s],[...r,s]);return}JSON.stringify(i)!==JSON.stringify(e)&&c(t,r,e)}},S=(t,i,e)=>{const r=u(t,[],{allowTrailingComma:!0}),s={formattingOptions:e,text:t};return p(s,r,i,[]),s.text},b=t=>typeof t=="number"?{insertSpaces:!0,tabSize:t}:typeof t=="string"?t===" "||t.includes(" ")?{insertSpaces:!1,tabSize:t.length||1}:{insertSpaces:!0,tabSize:t.length||2}:{insertSpaces:!0,tabSize:2},d=(t,i,e,r,s,o,n)=>{if(e&&t!==void 0){const a={...b(r),...o};let f=S(t,i,a);return s&&!f.endsWith(`
2
+ `)&&(f+=s),f}return`${JSON.stringify(i,n,r)}${s}`};export{d as b};
@@ -0,0 +1 @@
1
+ import n from"./NotFoundError-CnRY6lVp.js";import t from"./PermissionError-DJ_2VWEj.js";const c=(o,r)=>{const e=o?.code;return e==="ENOENT"?new n(`no such file or directory, open '${r}'`):e==="EACCES"||e==="EPERM"?new t(`unable to read the non-readable file: ${r}`):o};export{c as i};
@@ -0,0 +1 @@
1
+ import{createRequire as p}from"node:module";import{toPath as d}from"@visulima/path/utils";import{dirname as c,resolve as s}from"@visulima/path";import E from"./isAccessible-PmWJhV6I.js";import k from"./isAccessibleSync-BrbOtwdr.js";const v=p(import.meta.url),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=t=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[e,r]=i.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return i.getBuiltinModule(t)}return v(t)},{cwd:a}=i,{mkdir:h,rename:_,copyFile:S,unlink:D}=u("node:fs/promises"),{mkdirSync:$,renameSync:g,copyFileSync:b,unlinkSync:j}=u("node:fs");class T extends Error{constructor(e,r){super(`Source directory "${c(e)}" does not match destination directory "${c(r)}"`),this.name="SameDirectoryError"}}const l=(t,e)=>{if(!t||!e)throw new Error("Source and destination paths must not be empty");if(c(t)!==c(e))throw new T(t,e)},y=async(t,e,{cwd:r,directoryMode:o,overwrite:w,validateDirectory:m})=>{if(r&&(t=s(r,t),e=s(r,e)),m&&l(t,e),!w&&await E(e))throw new Error(`The destination file exists: ${e}`);await h(c(e),{mode:o,recursive:!0});try{await _(t,e)}catch(n){if(n.code==="EXDEV")await S(t,e),await D(t);else throw n}},f=(t,e,{cwd:r,directoryMode:o,overwrite:w,validateDirectory:m})=>{if(r&&(t=s(r,t),e=s(r,e)),m&&l(t,e),!w&&k(e))throw new Error(`The destination file exists: ${e}`);$(c(e),{mode:o,recursive:!0});try{g(t,e)}catch(n){if(n.code==="EXDEV")b(t,e),j(t);else throw n}},P=async(t,e,r={})=>{const o={overwrite:!0,validateDirectory:!1,...r,cwd:r.cwd?d(r.cwd):a()};await y(t,e,o)},R=(t,e,r)=>{const o={overwrite:!0,validateDirectory:!1,...r};o.cwd=o.cwd?d(o.cwd):a(),f(t,e,o)},V=async(t,e,r)=>{const o={overwrite:!0,...r,validateDirectory:!0};o.cwd=o.cwd?d(o.cwd):a(),await y(t,e,o)},X=(t,e,r)=>{const o={overwrite:!0,...r,validateDirectory:!0};o.cwd=o.cwd?d(o.cwd):a(),f(t,e,o)};export{P as move,R as moveSync,V as rename,X as renameSync};
@@ -0,0 +1 @@
1
+ import{a as s,W as l}from"./renderError-B3ePOoBG-Bi9WKMjv.js";import u from"./JSONError-Cvp9ycba.js";const m=t=>String.raw`\u{${t.codePointAt(0).toString(16)}}`,p=(t,o,e)=>l(t,{start:o},{tabWidth:!1,...e}),f=/in JSON at position (\d+)(?: \(line (\d+) column (\d+)\))?$/,d=(t,o)=>{const e=f.exec(o);if(!e)return;const[,n,r,a]=e;if(r&&a)return{column:Number(a),line:Number(r)};let i=Number(n);return i===t.length&&(i=t.length-1),s(t,i)},g=/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,h=t=>t.replace(g,(o,e,n)=>`"${n}"(${m(n)})`);function w(t,o,e,n){typeof o=="string"&&(typeof e=="object"&&(n=e),e=o,o=void 0);let r;try{return JSON.parse(t,o)}catch(c){r=c.message}let a;t?(a=d(t,r),r=h(r)):r+=" while parsing empty string";const i=new u(r);throw i.fileName=e,a&&(i.codeFrame=p(t,a,n)),i}export{w as default};
@@ -0,0 +1 @@
1
+ import{createRequire as m}from"node:module";import{toPath as h}from"@visulima/path/utils";import j from"./assertValidFileOrDirectoryPath-BTlt945W.js";import{i as y}from"./map-read-error-CR3rQUxx.js";const d=m(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=o=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[e,t]=r.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return r.getBuiltinModule(o)}return d(o)},{readFile:g}=l("node:fs/promises"),{unzip:_,brotliDecompress:b}=l("node:zlib"),w={brotli:b,gzip:_,none:(o,e)=>{e(null,o)}},T=async(o,e)=>{j(o),o=h(o);const{buffer:t,compression:f,encoding:p,flag:s}=e??{};let i;try{i=await g(o,s?{flag:s}:{})}catch(n){throw y(n,o)}return await new Promise((n,u)=>{w[f??"none"](i,(c,a)=>{c?u(c):n(t?a:a.toString(p??"utf8"))})})};export{T as default};
@@ -0,0 +1 @@
1
+ import{createRequire as a}from"node:module";import{toPath as b}from"@visulima/path/utils";import y from"./assertValidFileOrDirectoryPath-BTlt945W.js";import{i as h}from"./map-read-error-CR3rQUxx.js";const d=a(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=o=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[e,t]=r.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return r.getBuiltinModule(o)}return d(o)},{readFileSync:m}=c("node:fs"),{unzipSync:g,brotliDecompressSync:_}=c("node:zlib"),j={brotli:_,gzip:g,none:o=>o},T=(o,e)=>{y(o),o=b(o);const{buffer:t,compression:f,encoding:l,flag:n}=e??{};let s;try{s=m(o,n?{flag:n}:{})}catch(u){throw h(u,o)}const p=j[f??"none"],i=p(s);return t?i:i.toString(l??"utf8")};export{T as default};
@@ -0,0 +1 @@
1
+ import{parse as n}from"ini";import c from"./readFile-BswaBgM0.js";const d=async(r,t)=>{const{bracketedArray:a=!0,...e}=t??{},o=await c(r,{encoding:"utf8",...e});return n(o,{bracketedArray:a})};export{d as default};
@@ -0,0 +1 @@
1
+ import{parse as c}from"ini";import n from"./readFileSync-_fDF6Oj1.js";const f=(r,t)=>{const{bracketedArray:e=!0,...o}=t??{},a=n(r,{encoding:"utf8",...o});return c(a,{bracketedArray:e})};export{f as default};
@@ -0,0 +1 @@
1
+ import{toPath as n}from"@visulima/path/utils";import a from"./parseJson-EASgP4J9.js";import d from"./readFile-BswaBgM0.js";async function u(r,o,e){typeof o=="object"&&(e=o,o=void 0);const f=await d(r,{buffer:!0,encoding:void 0});let t=new TextDecoder().decode(f);const{beforeParse:c,color:i}=e??{};return typeof c=="function"&&(t=c(t)),a(t,o,n(r),{color:i})}export{u as default};
@@ -0,0 +1 @@
1
+ import p from"json5";import u from"./readFile-BswaBgM0.js";async function d(t,o,e){o&&typeof o=="object"&&(e=o,o=void 0);const{beforeParse:f,buffer:i,compression:a,encoding:c="utf8",flag:s}=e??{},r=await u(t,{buffer:i,compression:a,encoding:c,flag:s}),n=typeof f=="function"?f(r):r;return p.parse(n,o)}export{d as default};
@@ -0,0 +1 @@
1
+ import n from"json5";import a from"./readFileSync-_fDF6Oj1.js";function d(t,o,e){o&&typeof o=="object"&&(e=o,o=void 0);const{beforeParse:f,buffer:i,compression:p,encoding:s="utf8",flag:u}=e??{},r=a(t,{buffer:i,compression:p,encoding:s,flag:u}),c=typeof f=="function"?f(r):r;return n.parse(c,o)}export{d as default};
@@ -0,0 +1 @@
1
+ import{toPath as i}from"@visulima/path/utils";import d from"./parseJson-EASgP4J9.js";import p from"./readFileSync-_fDF6Oj1.js";function a(r,o,t){typeof o=="object"&&(t=o,o=void 0);const n=p(r,{buffer:!0,encoding:void 0});let e=new TextDecoder().decode(n);const{beforeParse:f,color:c}=t??{};return typeof f=="function"&&(e=f(e)),d(e,o,i(r),{color:c})}export{a as default};
@@ -0,0 +1 @@
1
+ import{a as u,W as C}from"./renderError-B3ePOoBG-Bi9WKMjv.js";import{toPath as g}from"@visulima/path/utils";import{parse as h,printParseErrorCode as b}from"jsonc-parser";import y from"./JSONError-Cvp9ycba.js";import E from"./readFile-BswaBgM0.js";const P=(r,e,a,f)=>{if(r.length===0)return;const o=r[0],n=u(e,o.offset),t=new y(`${b(o.error)} at offset ${o.offset}`);throw t.fileName=a,t.codeFrame=C(e,{start:n},{tabWidth:!1,...f}),t},J=async(r,e)=>{const{allowEmptyContent:a,allowTrailingComma:f=!0,beforeParse:o,buffer:n,color:t,compression:l,disallowComments:c,encoding:p="utf8",flag:w}=e??{},m=await E(r,{buffer:n,compression:l,encoding:p,flag:w}),s=typeof o=="function"?o(m):m,i=[],d=h(s,i,{allowEmptyContent:a,allowTrailingComma:f,disallowComments:c});return P(i,s,g(r),{color:t}),d};export{J as default,P as throwIfJsoncErrors};
@@ -0,0 +1 @@
1
+ import{toPath as g}from"@visulima/path/utils";import{parse as C}from"jsonc-parser";import d from"./readFileSync-_fDF6Oj1.js";import{throwIfJsoncErrors as y}from"./readJsonc-BZjMw_0f.js";const T=(o,e)=>{const{allowEmptyContent:l,allowTrailingComma:a=!0,beforeParse:r,buffer:f,color:i,compression:s,disallowComments:p,encoding:c="utf8",flag:u}=e??{},t=d(o,{buffer:f,compression:s,encoding:c,flag:u}),m=typeof r=="function"?r(t):t,n=[],w=C(m,n,{allowEmptyContent:l,allowTrailingComma:a,disallowComments:p});return y(n,m,g(o),{color:i}),w};export{T as default};
@@ -0,0 +1 @@
1
+ import{parse as a}from"smol-toml";import n from"./readFile-BswaBgM0.js";const c=async(r,t)=>{const o=await n(r,{encoding:"utf8",...t});return a(o)};export{c as default};
@@ -0,0 +1 @@
1
+ import{parse as n}from"smol-toml";import e from"./readFileSync-_fDF6Oj1.js";const m=(o,r)=>{const t=e(o,{encoding:"utf8",...r});return n(t)};export{m as default};
@@ -0,0 +1 @@
1
+ import{parse as n}from"yaml";import s from"./readFile-BswaBgM0.js";async function g(r,o,t){const{buffer:a,compression:c,encoding:i="utf8",flag:p,...f}=t??{},e=await s(r,{buffer:a,compression:c,encoding:i,flag:p});return typeof o=="function"?n(e,o,f):n(e,f)}export{g as default};
@@ -0,0 +1 @@
1
+ import{parse as r}from"yaml";import m from"./readFileSync-_fDF6Oj1.js";function g(n,o,t){const{buffer:c,compression:i,encoding:p="utf8",flag:s,...f}=t??{},e=m(n,{buffer:c,compression:i,encoding:p,flag:s});return typeof o=="function"?r(e,o,f):r(e,f)}export{g as default};
@@ -0,0 +1 @@
1
+ import{createRequire as t}from"node:module";import a from"./assertValidFileOrDirectoryPath-BTlt945W.js";import{t as m}from"./build-rm-options-avnusYx-.js";const i=t(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,n=e=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[o,r]=s.versions.node.split(".").map(Number);if(o>22||o===22&&r>=3||o===20&&r>=16)return s.getBuiltinModule(e)}return i(e)},{rm:c}=n("node:fs/promises"),l=async(e,o={})=>{a(e),await c(e,m(o))};export{l as default};
@@ -0,0 +1 @@
1
+ import{createRequire as t}from"node:module";import u from"./assertValidFileOrDirectoryPath-BTlt945W.js";import{t as f}from"./build-rm-options-avnusYx-.js";const n=t(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,i=e=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[o,r]=s.versions.node.split(".").map(Number);if(o>22||o===22&&r>=3||o===20&&r>=16)return s.getBuiltinModule(e)}return n(e)},{rmSync:c}=i("node:fs"),_=(e,o={})=>{u(e),c(e,f(o))};export{_ as default};
@@ -0,0 +1,6 @@
1
+ import{createRequire as B}from"node:module";const W=B(import.meta.url),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,q=e=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[r,t]=y.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return y.getBuiltinModule(e)}return W(e)},{createRequire:w}=q("node:module"),N=globalThis.process??Object.create(null),_={versions:{}},x=new Proxy(N,{get(e,r){if(r in e)return e[r];if(r in _)return _[r]}}),I=e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
2
+ `),G=(e,r,t,n)=>{const s={column:0,line:-1,...e.start},a={...s,...e.end},u=s.line,i=s.column,g=a.line,f=a.column;let m=Math.max(u-(t+1),0),h=Math.min(r.length,g+n);u===-1&&(m=0),g===-1&&(h=r.length);const d=g-u,l={};if(d)for(let o=0;o<=d;o++){const c=o+u;if(!i)l[c]=!0;else if(o===0){const p=r[c-1]?.length;l[c]=[i,(p??0)-i+1]}else if(o===d)l[c]=[0,f];else{const p=r[c-o]?.length;l[c]=[0,p]}}else i===f?l[u]=i?[i,0]:!0:l[u]=[i,(f??0)-(i??0)];return{end:h,markerLines:l,start:m}},L=x.platform==="win32"&&!x.env?.WT_SESSION?">":"❯",F=(e,r,t)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...t,color:{gutter:o=>o,marker:o=>o,message:o=>o,...t?.color}},s=typeof r.start.column=="number";let a=(e.includes("\r")?I(e):e).split(`
3
+ `);typeof n.tabWidth=="number"&&e.includes(" ")&&(a=a.map(o=>o.replaceAll(" "," ".repeat(n.tabWidth))));const{end:u,markerLines:i,start:g}=G(r,a,n.linesAbove,n.linesBelow),f=String(u).length,{gutter:m,marker:h,message:d}=n.color;let l=a.slice(g,u).map((o,c)=>{const p=g+1+c,A=i[p],M=String(p).padStart(f),R=!i[p+1],v=` ${M}${n.showGutter?" |":""}`;if(A){let $="";if(Array.isArray(A)){const S=o.replaceAll(/[^\t]/g," ").slice(0,Math.max(A[0]-1,0)),k=A[1]||1;$=[`
4
+ `,n.prefix+m(v.replaceAll(/\d/g," "))," ",S,h("^").repeat(k)].join(""),R&&n.message&&($+=` ${d(n.message)}`)}return[n.prefix+h(L),m(v),o.length>0?` ${o}`:"",$].join("")}return`${n.prefix} ${m(v)}${o.length>0?` ${o}`:""}`}).join(`
5
+ `);return n.message&&!s&&(l=`${n.prefix+" ".repeat(f+1)+n.message}
6
+ ${l}`),l},j=(e,r)=>{let t=0,n=r.length-2;for(;t<n;){const s=t+(n-t>>1);if(e<r[s])n=s-1;else if(e>=r[s+1])t=s+1;else{t=s;break}}return t},O=/\n|\r(?!\n)/,P=e=>e.split(O).reduce((r,t)=>(r.push(r.at(-1)+t.length+1),r),[0]),H=(e,r,t)=>{if(!Array.isArray(e)&&typeof e!="string"||(typeof e=="string"||Array.isArray(e))&&e.length===0)return{column:0,line:0};if(typeof r!="number"||typeof e=="string"&&r>=e.length||Array.isArray(e)&&r+1>=e.at(-1))return{column:0,line:0};if(typeof e=="string"){const s=P(e),a=j(r,s);return{column:r-s[a]+1,line:a+1}}const n=j(r,e);return{column:r-e[n]+1,line:n+1}},U=new Map([["Error",Error],["EvalError",EvalError],["RangeError",RangeError],["ReferenceError",ReferenceError],["SyntaxError",SyntaxError],["TypeError",TypeError],["URIError",URIError]]);typeof AggregateError<"u"&&U.set("AggregateError",AggregateError);const V=w(import.meta.url),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,z=e=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[r,t]=b.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return b.getBuiltinModule(e)}return V(e)};z("node:util");const C=w(import.meta.url),E=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=e=>{if(typeof E<"u"&&E.versions&&E.versions.node){const[r,t]=E.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return E.getBuiltinModule(e)}return C(e)};T("node:fs");T("node:path");T("node:url");export{F as W,H as a};
@@ -0,0 +1 @@
1
+ import{resolve as o,dirname as s}from"@visulima/path";const p=(t,e)=>typeof t!="string"?t:t.startsWith("./")?o(t):typeof e=="string"?o(s(e),t):new URL(t,e);export{p as t};
@@ -0,0 +1 @@
1
+ import{createRequire as h}from"node:module";const j=h(import.meta.url),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{platform:p}=d,l="unnamed",x=128,u={'"':"ˮ","*":"⁎","/":"⁄",":":"꞉","<":"‹",">":"›","?":"ʔ","\\":"∖","|":"ǀ"},m=/[\u0000-\u001F\u0080-\u009F]/g,w=/^(?:\.+[/\\]+)+|^\.+$/g,a=/^(?:con|prn|aux|nul|com\d|lpt\d)$/i,_=/[<>:"/\\|?*]/g,b=/\//g,c=new Set([" "," ","."]),f=(n,r)=>r>0&&r<n.length-1,$=(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)},g=n=>{let r=0,t=n.length;for(;r<t;){const e=n[r];if(e===void 0||!c.has(e))break;r+=1}for(;t>r;){const e=n[t-1];if(e===void 0||!c.has(e))break;t-=1}return n.slice(r,t)},v=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 o=s.at(-1);if(o===void 0||!c.has(o))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||!c.has(e))break;t=t.slice(0,-1)}return t},I=n=>{const r=n.lastIndexOf(".");if(f(n,r))return!1;if(a.test(n))return!0;let t=n;for(;t.length>0;){const e=t.at(-1);if(e===void 0||!c.has(e))break;t=t.slice(0,-1)}return!!(t.length>0&&a.test(t))},O=n=>{const r=n.lastIndexOf(".");if(f(n,r)){const i=n.slice(0,r),s=n.slice(r),o=g(i);return o.length===0?void 0:`${o}${s}`}const t=n.trim();if(t.length>0&&t[0]==="."&&t.length<=5&&t.indexOf(".",1)===-1)return;const e=g(n);if(e.length!==0)return e},k=n=>{const r=n?.filesystem??"auto";return r==="auto"?p==="win32"?"win32":"unix":r==="darwin"?"unix":r},q=(n,r)=>{if(typeof n!="string"||n.length===0)return l;const t=k(r);let e=n;if(e=e.replace(m,""),e.length===0||(e=e.replace(w,""),e.length===0))return l;if(t==="win32"||t==="fat32"){const s=e.lastIndexOf(".");if(!f(e,s)&&a.test(e))return l}if(e=t==="win32"||t==="fat32"?e.replaceAll(_,s=>u[s]??""):e.replaceAll(b,u["/"]),e=e.trim(),(t==="win32"||t==="fat32")&&(I(e)||t==="win32"&&(e=v(e),e.length===0)))return l;if(t==="fat32"){const s=O(e);if(s===void 0)return l;e=s}if(e.length===0)return l;const i=r?.maxLength??x;return e.length>i&&(e=$(e,i),e.length===0)?l:e};export{q as sanitize};
@@ -0,0 +1 @@
1
+ import{INTERNAL_STRIP_JSON_REGEX as a}from"./FIND_UP_STOP-CAwY1qU7.js";const p=(t,{whitespace:s=!0}={})=>t.replace(a,e=>e.startsWith('"')||e[1]==="*"&&!e.endsWith("*/")?e:s?e.replaceAll(/\S/g," "):"");export{p as default};
@@ -0,0 +1 @@
1
+ import{createRequire as o}from"node:module";const s=o(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,i=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[t,n]=r.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return r.getBuiltinModule(e)}return s(e)},{randomBytes:f}=i("node:crypto"),a=e=>`${e}.${process.pid.toString(36)}.${f(6).toString("hex")}.tmp`,c=new TextEncoder,p=e=>{if(e instanceof Uint8Array)return e;if(typeof e=="string")return c.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e)){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")};export{p as i,a as o};