@visulima/fs 5.0.9 → 5.0.11

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 (132) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/eol.d.ts +25 -25
  3. package/dist/eol.js +2 -2
  4. package/dist/error.d.ts +218 -218
  5. package/dist/glob-parent.d.ts +27 -27
  6. package/dist/glob-parent.js +1 -1
  7. package/dist/glob.d.ts +2 -2
  8. package/dist/glob.js +1 -1
  9. package/dist/index.d.ts +765 -765
  10. package/dist/index.js +1 -1
  11. package/dist/ini.d.ts +59 -59
  12. package/dist/ini.js +1 -1
  13. package/dist/is-glob.d.ts +26 -26
  14. package/dist/json5.d.ts +25 -25
  15. package/dist/json5.js +1 -1
  16. package/dist/jsonc.d.ts +54 -54
  17. package/dist/jsonc.js +1 -1
  18. package/dist/match.d.ts +40 -40
  19. package/dist/packem_shared/{collect-CIKDOMiD.js → collect-B0S0bJoE.js} +1 -1
  20. package/dist/packem_shared/{collectSync-D0FRLLqg.js → collectSync-0M1eoilI.js} +1 -1
  21. package/dist/packem_shared/copy-DiR5_5iA.js +1 -0
  22. package/dist/packem_shared/copySync-DffsYlhb.js +1 -0
  23. package/dist/packem_shared/emptyDir-BlBeczk0.js +1 -0
  24. package/dist/packem_shared/emptyDirSync-DfUZ9Ejz.js +1 -0
  25. package/dist/packem_shared/ensureDir-BEiomfxz.js +1 -0
  26. package/dist/packem_shared/ensureDirSync-B0w9WMwE.js +1 -0
  27. package/dist/packem_shared/ensureFile-waD4hDO8.js +1 -0
  28. package/dist/packem_shared/ensureFileSync-CG07zjV7.js +1 -0
  29. package/dist/packem_shared/ensureLink-Dz-PDWa5.js +1 -0
  30. package/dist/packem_shared/ensureLinkSync-BZH7TaSQ.js +1 -0
  31. package/dist/packem_shared/ensureSymlink-Byi6ajoE.js +1 -0
  32. package/dist/packem_shared/ensureSymlinkSync-D7OCsAd8.js +1 -0
  33. package/dist/packem_shared/findUp-Ylerv_a2.js +1 -0
  34. package/dist/packem_shared/findUpSync-BWBPRzEq.js +1 -0
  35. package/dist/packem_shared/glob-BUjyjdE8.js +1 -0
  36. package/dist/packem_shared/glob-sync.d-DaAZHTsv.d.ts +54 -0
  37. package/dist/packem_shared/globSync-Bk9TUV7x.js +1 -0
  38. package/dist/packem_shared/index-CPZbuHkp.js +1 -0
  39. package/dist/packem_shared/isAccessible-B7guOm3k.js +1 -0
  40. package/dist/packem_shared/isAccessibleSync-XH4YleJW.js +1 -0
  41. package/dist/packem_shared/json-error.d-COL8oxF_.d.ts +52 -0
  42. package/dist/packem_shared/move-KhPRvsRd.js +1 -0
  43. package/dist/packem_shared/{parseJson-EASgP4J9.js → parseJson-_OfIPruP.js} +1 -1
  44. package/dist/packem_shared/readFile-VgxUDrNH.js +1 -0
  45. package/dist/packem_shared/readFileSync-CloFeQw8.js +1 -0
  46. package/dist/packem_shared/{readIni-BsXudu2r.js → readIni-CEXHWn92.js} +1 -1
  47. package/dist/packem_shared/readIniSync-DsxVHypc.js +1 -0
  48. package/dist/packem_shared/{readJson-CcAsHxE5.js → readJson-Q3T3RlSy.js} +1 -1
  49. package/dist/packem_shared/{readJson5-CM1TIiHd.js → readJson5-S68aVros.js} +1 -1
  50. package/dist/packem_shared/{readJson5Sync-Bc26c3Fy.js → readJson5Sync-Bi9Rv46R.js} +1 -1
  51. package/dist/packem_shared/{readJsonSync-DuMMeB3s.js → readJsonSync-BnWiH5-R.js} +1 -1
  52. package/dist/packem_shared/{readJsonc-BZjMw_0f.js → readJsonc-DSoFyuDk.js} +1 -1
  53. package/dist/packem_shared/{readJsoncSync-C-xzeZz4.js → readJsoncSync-CLtlvFKV.js} +1 -1
  54. package/dist/packem_shared/readToml-CN_xnICv.js +1 -0
  55. package/dist/packem_shared/readTomlSync-B9TVGzen.js +1 -0
  56. package/dist/packem_shared/{readYaml-DvPxndW_.js → readYaml-DcpUq11D.js} +1 -1
  57. package/dist/packem_shared/{readYamlSync-DZ-0hSbZ.js → readYamlSync-D5RVZwco.js} +1 -1
  58. package/dist/packem_shared/remove-D_CUIlBL.js +1 -0
  59. package/dist/packem_shared/removeSync-F4nKiwrU.js +1 -0
  60. package/dist/packem_shared/renderError-DjesnVYT-pWsLqw-_.js +6 -0
  61. package/dist/packem_shared/sanitize-aEqeyx4d.js +1 -0
  62. package/dist/packem_shared/to-uint-8-array-7sXMoZwU.js +1 -0
  63. package/dist/packem_shared/{types.d-BMdL_ygj.d.ts → types.d-D3Jo_iA-.d.ts} +361 -383
  64. package/dist/packem_shared/walk-BReeHTKb.js +1 -0
  65. package/dist/packem_shared/walkSync-yHJUIJb9.js +1 -0
  66. package/dist/packem_shared/writeFile-srDcYaRC.js +1 -0
  67. package/dist/packem_shared/writeFileSync-Ddl_u4my.js +1 -0
  68. package/dist/packem_shared/writeIni-CKinbquM.js +4 -0
  69. package/dist/packem_shared/writeIniSync-BISRFyg0.js +4 -0
  70. package/dist/packem_shared/writeJson-DlCrFMXb.js +4 -0
  71. package/dist/packem_shared/writeJson5-rSp3QAKP.js +4 -0
  72. package/dist/packem_shared/writeJson5Sync-tSBBKnaP.js +4 -0
  73. package/dist/packem_shared/writeJsonSync-CKqVRz_9.js +4 -0
  74. package/dist/packem_shared/writeJsonc-bxz1jdeU.js +4 -0
  75. package/dist/packem_shared/writeJsoncSync-C-W0H9qP.js +4 -0
  76. package/dist/packem_shared/{writeToml-IuMO-yDu.js → writeToml-CrpfWNyK.js} +1 -1
  77. package/dist/packem_shared/{writeTomlSync-DhL7hHzB.js → writeTomlSync-DveRchLG.js} +1 -1
  78. package/dist/packem_shared/{writeYaml-ClQgvQID.js → writeYaml-DvSQ_Jbn.js} +1 -1
  79. package/dist/packem_shared/{writeYamlSync-DrXtHQQq.js → writeYamlSync-CEf0PUGQ.js} +1 -1
  80. package/dist/size.d.ts +236 -236
  81. package/dist/size.js +1 -1
  82. package/dist/toml.d.ts +52 -52
  83. package/dist/toml.js +1 -1
  84. package/dist/utils.d.ts +88 -88
  85. package/dist/utils.js +1 -1
  86. package/dist/yaml.d.ts +2 -2
  87. package/dist/yaml.js +1 -1
  88. package/package.json +1 -1
  89. package/dist/packem_shared/copy-Beb64BYG.js +0 -1
  90. package/dist/packem_shared/copySync-CagcIEBi.js +0 -1
  91. package/dist/packem_shared/emptyDir-C7lyd1lW.js +0 -1
  92. package/dist/packem_shared/emptyDirSync-B8EYpmO9.js +0 -1
  93. package/dist/packem_shared/ensureDir-DGarVZw8.js +0 -1
  94. package/dist/packem_shared/ensureDirSync-CsgPrsDH.js +0 -1
  95. package/dist/packem_shared/ensureFile-CMugWljp.js +0 -1
  96. package/dist/packem_shared/ensureFileSync-CJYTEx2r.js +0 -1
  97. package/dist/packem_shared/ensureLink-ChShf3lf.js +0 -1
  98. package/dist/packem_shared/ensureLinkSync-DPpq0I2Z.js +0 -1
  99. package/dist/packem_shared/ensureSymlink-y4FZjfxA.js +0 -1
  100. package/dist/packem_shared/ensureSymlinkSync-TcHssCH7.js +0 -1
  101. package/dist/packem_shared/findUp-Cii5ATt5.js +0 -1
  102. package/dist/packem_shared/findUpSync-C9Lkh7-v.js +0 -1
  103. package/dist/packem_shared/glob-DMbPwGSj.js +0 -1
  104. package/dist/packem_shared/glob-sync.d-hXe38TnZ.d.ts +0 -54
  105. package/dist/packem_shared/globSync-DiP2rtGn.js +0 -1
  106. package/dist/packem_shared/index-Ct4GqZSP.js +0 -1
  107. package/dist/packem_shared/isAccessible-PmWJhV6I.js +0 -1
  108. package/dist/packem_shared/isAccessibleSync-BrbOtwdr.js +0 -1
  109. package/dist/packem_shared/json-error.d-DVILOyHc.d.ts +0 -52
  110. package/dist/packem_shared/move-DopmzT-2.js +0 -1
  111. package/dist/packem_shared/readFile-BswaBgM0.js +0 -1
  112. package/dist/packem_shared/readFileSync-_fDF6Oj1.js +0 -1
  113. package/dist/packem_shared/readIniSync-DKwRbbs9.js +0 -1
  114. package/dist/packem_shared/readToml-D4jpe9q_.js +0 -1
  115. package/dist/packem_shared/readTomlSync-B5PIYT9z.js +0 -1
  116. package/dist/packem_shared/remove-CSbrd0dl.js +0 -1
  117. package/dist/packem_shared/removeSync-BoLAzRQE.js +0 -1
  118. package/dist/packem_shared/renderError-B3ePOoBG-Bi9WKMjv.js +0 -6
  119. package/dist/packem_shared/sanitize-DGZ3w-_w.js +0 -1
  120. package/dist/packem_shared/to-uint-8-array-BImOQNXm.js +0 -1
  121. package/dist/packem_shared/walk-OX4-6oCP.js +0 -1
  122. package/dist/packem_shared/walkSync-BPs6czIM.js +0 -1
  123. package/dist/packem_shared/writeFile-BrMtsJY7.js +0 -1
  124. package/dist/packem_shared/writeFileSync-W7Mf4BNy.js +0 -1
  125. package/dist/packem_shared/writeIni-BWX3cP1K.js +0 -4
  126. package/dist/packem_shared/writeIniSync-fOdgPFfL.js +0 -4
  127. package/dist/packem_shared/writeJson-bEVi25gX.js +0 -4
  128. package/dist/packem_shared/writeJson5-Ch8TpNPI.js +0 -4
  129. package/dist/packem_shared/writeJson5Sync-BrctV_Mk.js +0 -4
  130. package/dist/packem_shared/writeJsonSync-DkGnd416.js +0 -4
  131. package/dist/packem_shared/writeJsonc-CefrwsOc.js +0 -4
  132. package/dist/packem_shared/writeJsoncSync-BskDjn8o.js +0 -4
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{createRequire as h}from"node:module";import{FIND_UP_STOP as L,F_OK as P,R_OK as R,W_OK as $,X_OK as J}from"./packem_shared/FIND_UP_STOP-CAwY1qU7.js";import{default as T}from"./packem_shared/copy-Beb64BYG.js";import{default as W}from"./packem_shared/copySync-CagcIEBi.js";import{default as M}from"./packem_shared/ensureDir-DGarVZw8.js";import{default as E}from"./packem_shared/ensureDirSync-CsgPrsDH.js";import{default as z}from"./packem_shared/ensureFile-CMugWljp.js";import{default as I}from"./packem_shared/ensureFileSync-CJYTEx2r.js";import{default as H}from"./packem_shared/ensureLink-ChShf3lf.js";import{default as V}from"./packem_shared/ensureLinkSync-DPpq0I2Z.js";import{default as Z}from"./packem_shared/ensureSymlink-y4FZjfxA.js";import{default as re}from"./packem_shared/ensureSymlinkSync-TcHssCH7.js";import{CRLF as oe,EOL as se,LF as ae,detect as ne,format as ie}from"./eol.js";import{default as le}from"./packem_shared/collect-CIKDOMiD.js";import{default as ue}from"./packem_shared/collectSync-D0FRLLqg.js";import{default as me}from"./packem_shared/findUp-Cii5ATt5.js";import{default as xe}from"./packem_shared/findUpSync-C9Lkh7-v.js";import{default as Se}from"./packem_shared/glob-DMbPwGSj.js";import{default as _e}from"./packem_shared/globSync-DiP2rtGn.js";import{default as Fe}from"./packem_shared/walk-OX4-6oCP.js";import{default as ge}from"./packem_shared/walkSync-BPs6czIM.js";import{default as ke}from"./glob-parent.js";import{default as De}from"./packem_shared/isAccessible-PmWJhV6I.js";import{default as qe}from"./packem_shared/isAccessibleSync-BrbOtwdr.js";import{default as Le}from"./is-glob.js";import{match as Re,matcher as $e}from"./match.js";import{move as Ke,moveSync as Te,rename as Ue,renameSync as We}from"./packem_shared/move-DopmzT-2.js";import{default as Me}from"./packem_shared/readFile-BswaBgM0.js";import{default as Ee}from"./packem_shared/readFileSync-_fDF6Oj1.js";import{default as ze}from"./packem_shared/readJson-CcAsHxE5.js";import{default as Ie}from"./packem_shared/readJsonSync-DuMMeB3s.js";import{default as He}from"./packem_shared/emptyDir-C7lyd1lW.js";import{default as Ve}from"./packem_shared/emptyDirSync-B8EYpmO9.js";import{default as Ze}from"./packem_shared/remove-CSbrd0dl.js";import{default as rr}from"./packem_shared/removeSync-BoLAzRQE.js";import{sanitize as or}from"./packem_shared/sanitize-DGZ3w-_w.js";import{default as ar}from"./packem_shared/writeFile-BrMtsJY7.js";import{default as ir}from"./packem_shared/writeFileSync-W7Mf4BNy.js";import{default as lr}from"./packem_shared/writeJson-bEVi25gX.js";import{default as ur}from"./packem_shared/writeJsonSync-DkGnd416.js";const F=h(import.meta.url),n=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=i=>{if(typeof n<"u"&&n.versions&&n.versions.node){const[s,f]=n.versions.node.split(".").map(Number);if(s>22||s===22&&f>=3||s===20&&f>=16)return n.getBuiltinModule(i)}return F(i)},b=u("fs"),g=u("os"),w=u("path");var c={},x;function k(){if(x)return c;x=1;var i=Object.defineProperty,s=(o,e)=>i(o,"name",{value:e,configurable:!0}),f=b,y=g,S=w;const p=s(o=>{let e="";for(let r=0;r<o.length;r+=1){const t=o[r],a=t.toUpperCase();e+=t===a?t.toLowerCase():a}return e},"invertCase"),l=new Map,m=s((o,e)=>{const r=S.join(o,`.is-fs-case-sensitive-test-${process.pid}`);try{return e.writeFileSync(r,""),!e.existsSync(p(r))}finally{try{e.unlinkSync(r)}catch{}}},"checkDirectoryCaseWithWrite"),v=s((o,e,r)=>{try{return m(o,r)}catch(t){if(e===void 0)return m(y.tmpdir(),r);throw t}},"checkDirectoryCaseWithFallback"),_=s((o,e=f,r=!0)=>{const t=o??process.cwd();if(r&&l.has(t))return l.get(t);let a;const d=p(t);return d!==t&&e.existsSync(t)?a=!e.existsSync(d):a=v(t,o,e),r&&l.set(t,a),a},"isFsCaseSensitive");return c.isFsCaseSensitive=_,c}var C=k();const j=C.isFsCaseSensitive;export{oe as CRLF,se as EOL,L as FIND_UP_STOP,P as F_OK,ae as LF,R as R_OK,$ as W_OK,J as X_OK,le as collect,ue as collectSync,T as copy,W as copySync,ne as detect,He as emptyDir,Ve as emptyDirSync,M as ensureDir,E as ensureDirSync,z as ensureFile,I as ensureFileSync,H as ensureLink,V as ensureLinkSync,Z as ensureSymlink,re as ensureSymlinkSync,me as findUp,xe as findUpSync,ie as format,Se as glob,ke as globParent,_e as globSync,De as isAccessible,qe as isAccessibleSync,j as isFsCaseSensitive,Le as isGlob,Re as match,$e as matcher,Ke as move,Te as moveSync,Me as readFile,Ee as readFileSync,ze as readJson,Ie as readJsonSync,Ze as remove,rr as removeSync,Ue as rename,We as renameSync,or as sanitize,Fe as walk,ge as walkSync,ar as writeFile,ir as writeFileSync,lr as writeJson,ur as writeJsonSync};
1
+ import{createRequire as h}from"node:module";import{FIND_UP_STOP as R,F_OK as P,R_OK as $,W_OK as J,X_OK as K}from"./packem_shared/FIND_UP_STOP-CAwY1qU7.js";import{default as U}from"./packem_shared/copy-DiR5_5iA.js";import{default as B}from"./packem_shared/copySync-DffsYlhb.js";import{default as A}from"./packem_shared/ensureDir-BEiomfxz.js";import{default as N}from"./packem_shared/ensureDirSync-B0w9WMwE.js";import{default as G}from"./packem_shared/ensureFile-waD4hDO8.js";import{default as X}from"./packem_shared/ensureFileSync-CG07zjV7.js";import{default as Q}from"./packem_shared/ensureLink-Dz-PDWa5.js";import{default as Y}from"./packem_shared/ensureLinkSync-BZH7TaSQ.js";import{default as ee}from"./packem_shared/ensureSymlink-Byi6ajoE.js";import{default as te}from"./packem_shared/ensureSymlinkSync-D7OCsAd8.js";import{CRLF as se,EOL as ae,LF as ne,detect as ie,format as fe}from"./eol.js";import{default as le}from"./packem_shared/collect-B0S0bJoE.js";import{default as pe}from"./packem_shared/collectSync-0M1eoilI.js";import{default as de}from"./packem_shared/findUp-Ylerv_a2.js";import{default as ye}from"./packem_shared/findUpSync-BWBPRzEq.js";import{default as _e}from"./packem_shared/glob-BUjyjdE8.js";import{default as he}from"./packem_shared/globSync-Bk9TUV7x.js";import{default as be}from"./packem_shared/walk-BReeHTKb.js";import{default as we}from"./packem_shared/walkSync-yHJUIJb9.js";import{default as Ce}from"./glob-parent.js";import{default as je}from"./packem_shared/isAccessible-B7guOm3k.js";import{default as Oe}from"./packem_shared/isAccessibleSync-XH4YleJW.js";import{default as Re}from"./is-glob.js";import{match as $e,matcher as Je}from"./match.js";import{move as Te,moveSync as Ue,rename as We,renameSync as Be}from"./packem_shared/move-KhPRvsRd.js";import{default as Ae}from"./packem_shared/readFile-VgxUDrNH.js";import{default as Ne}from"./packem_shared/readFileSync-CloFeQw8.js";import{default as Ge}from"./packem_shared/readJson-Q3T3RlSy.js";import{default as Xe}from"./packem_shared/readJsonSync-BnWiH5-R.js";import{default as Qe}from"./packem_shared/emptyDir-BlBeczk0.js";import{default as Ye}from"./packem_shared/emptyDirSync-DfUZ9Ejz.js";import{default as er}from"./packem_shared/remove-D_CUIlBL.js";import{default as tr}from"./packem_shared/removeSync-F4nKiwrU.js";import{sanitize as sr}from"./packem_shared/sanitize-aEqeyx4d.js";import{default as nr}from"./packem_shared/writeFile-srDcYaRC.js";import{default as fr}from"./packem_shared/writeFileSync-Ddl_u4my.js";import{default as lr}from"./packem_shared/writeJson-DlCrFMXb.js";import{default as pr}from"./packem_shared/writeJsonSync-CKqVRz_9.js";let F;const b=n=>(F??=h(import.meta.url))(n),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=n=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[s,f]=i.versions.node.split(".").map(Number);if(s>22||s===22&&f>=3||s===20&&f>=16)return i.getBuiltinModule(n)}return b(n)},g=u("fs"),w=u("os"),k=u("path");var l={},x;function C(){if(x)return l;x=1;var n=Object.defineProperty,s=(o,e)=>n(o,"name",{value:e,configurable:!0}),f=g,y=w,S=k;const p=s(o=>{let e="";for(let r=0;r<o.length;r+=1){const t=o[r],a=t.toUpperCase();e+=t===a?t.toLowerCase():a}return e},"invertCase"),c=new Map,m=s((o,e)=>{const r=S.join(o,`.is-fs-case-sensitive-test-${process.pid}`);try{return e.writeFileSync(r,""),!e.existsSync(p(r))}finally{try{e.unlinkSync(r)}catch{}}},"checkDirectoryCaseWithWrite"),_=s((o,e,r)=>{try{return m(o,r)}catch(t){if(e===void 0)return m(y.tmpdir(),r);throw t}},"checkDirectoryCaseWithFallback"),v=s((o,e=f,r=!0)=>{const t=o??process.cwd();if(r&&c.has(t))return c.get(t);let a;const d=p(t);return d!==t&&e.existsSync(t)?a=!e.existsSync(d):a=_(t,o,e),r&&c.set(t,a),a},"isFsCaseSensitive");return l.isFsCaseSensitive=v,l}var D=C();const q=D.isFsCaseSensitive;export{se as CRLF,ae as EOL,R as FIND_UP_STOP,P as F_OK,ne as LF,$ as R_OK,J as W_OK,K as X_OK,le as collect,pe as collectSync,U as copy,B as copySync,ie as detect,Qe as emptyDir,Ye as emptyDirSync,A as ensureDir,N as ensureDirSync,G as ensureFile,X as ensureFileSync,Q as ensureLink,Y as ensureLinkSync,ee as ensureSymlink,te as ensureSymlinkSync,de as findUp,ye as findUpSync,fe as format,_e as glob,Ce as globParent,he as globSync,je as isAccessible,Oe as isAccessibleSync,q as isFsCaseSensitive,Re as isGlob,$e as match,Je as matcher,Te as move,Ue as moveSync,Ae as readFile,Ne as readFileSync,Ge as readJson,Xe as readJsonSync,er as remove,tr as removeSync,We as rename,Be as renameSync,sr as sanitize,be as walk,we as walkSync,nr as writeFile,fr as writeFileSync,lr as writeJson,pr as writeJsonSync};
package/dist/ini.d.ts CHANGED
@@ -1,70 +1,70 @@
1
- import { C as CompressionType, R as ReadIniOptions, W as WriteIniOptions } from "./packem_shared/types.d-BMdL_ygj.js";
2
- export type { I as IniEncodeOptions, a as IniLineEnding } from "./packem_shared/types.d-BMdL_ygj.js";
1
+ import { C as CompressionType, R as ReadIniOptions, W as WriteIniOptions } from "./packem_shared/types.d-D3Jo_iA-.js";
2
+ export type { I as IniEncodeOptions, a as IniLineEnding } from "./packem_shared/types.d-D3Jo_iA-.js";
3
3
  import 'node:fs';
4
4
  import 'fdir';
5
5
  /**
6
- * Asynchronously reads an INI file and parses it into an object.
7
- * @template R The expected type of the parsed object. Defaults to `Record&lt;string, unknown>`.
8
- * @param path The path to the INI file. Can be a file URL or a string path.
9
- * @param options Optional configuration. See {@link ReadIniOptions}.
10
- * @returns A promise that resolves with the parsed object.
11
- * @example
12
- * ```javascript
13
- * import { readIni } from "@visulima/fs/ini";
14
- *
15
- * const config = await readIni("./config.ini");
16
- * ```
17
- */
6
+ * Asynchronously reads an INI file and parses it into an object.
7
+ * @template R The expected type of the parsed object. Defaults to `Record&lt;string, unknown>`.
8
+ * @param path The path to the INI file. Can be a file URL or a string path.
9
+ * @param options Optional configuration. See {@link ReadIniOptions}.
10
+ * @returns A promise that resolves with the parsed object.
11
+ * @example
12
+ * ```javascript
13
+ * import { readIni } from "@visulima/fs/ini";
14
+ *
15
+ * const config = await readIni("./config.ini");
16
+ * ```
17
+ */
18
18
  declare const readIni: <R = Record<string, unknown>>(path: URL | string, options?: ReadIniOptions<CompressionType>) => Promise<R>;
19
19
  /**
20
- * Synchronously reads an INI file and parses it into an object.
21
- * @template R The expected type of the parsed object. Defaults to `Record&lt;string, unknown>`.
22
- * @param path The path to the INI file. Can be a file URL or a string path.
23
- * @param options Optional configuration. See {@link ReadIniOptions}.
24
- * @returns The parsed object.
25
- * @example
26
- * ```javascript
27
- * import { readIniSync } from "@visulima/fs/ini";
28
- *
29
- * const config = readIniSync("./config.ini");
30
- * ```
31
- */
20
+ * Synchronously reads an INI file and parses it into an object.
21
+ * @template R The expected type of the parsed object. Defaults to `Record&lt;string, unknown>`.
22
+ * @param path The path to the INI file. Can be a file URL or a string path.
23
+ * @param options Optional configuration. See {@link ReadIniOptions}.
24
+ * @returns The parsed object.
25
+ * @example
26
+ * ```javascript
27
+ * import { readIniSync } from "@visulima/fs/ini";
28
+ *
29
+ * const config = readIniSync("./config.ini");
30
+ * ```
31
+ */
32
32
  declare const readIniSync: (path: URL | string, options?: ReadIniOptions<CompressionType>) => Record<string, unknown>;
33
33
  /**
34
- * Asynchronously writes an object to an INI file.
35
- *
36
- * When an existing file is present and `preserveStyle` is `true` (the default), the original file's
37
- * whitespace-around-`=` style and line endings are auto-detected and retained, and any line whose
38
- * parsed value is unchanged is kept verbatim — preserving trailing whitespace and inline `;`/`#`
39
- * comments. Explicit `whitespace` / `eol` options always win over detection.
40
- * @param path The path to the INI file. Can be a file URL or a string path.
41
- * @param data The data to serialize.
42
- * @param options Optional configuration. See {@link WriteIniOptions}.
43
- * @returns A promise that resolves when the file has been written.
44
- * @example
45
- * ```javascript
46
- * import { writeIni } from "@visulima/fs/ini";
47
- *
48
- * await writeIni("./config.ini", { server: { port: 8080 } });
49
- * ```
50
- */
34
+ * Asynchronously writes an object to an INI file.
35
+ *
36
+ * When an existing file is present and `preserveStyle` is `true` (the default), the original file's
37
+ * whitespace-around-`=` style and line endings are auto-detected and retained, and any line whose
38
+ * parsed value is unchanged is kept verbatim — preserving trailing whitespace and inline `;`/`#`
39
+ * comments. Explicit `whitespace` / `eol` options always win over detection.
40
+ * @param path The path to the INI file. Can be a file URL or a string path.
41
+ * @param data The data to serialize.
42
+ * @param options Optional configuration. See {@link WriteIniOptions}.
43
+ * @returns A promise that resolves when the file has been written.
44
+ * @example
45
+ * ```javascript
46
+ * import { writeIni } from "@visulima/fs/ini";
47
+ *
48
+ * await writeIni("./config.ini", { server: { port: 8080 } });
49
+ * ```
50
+ */
51
51
  declare const writeIni: (path: URL | string, data: Record<string, unknown>, options?: WriteIniOptions) => Promise<void>;
52
52
  /**
53
- * Synchronously writes an object to an INI file.
54
- *
55
- * When an existing file is present and `preserveStyle` is `true` (the default), the original file's
56
- * whitespace-around-`=` style and line endings are auto-detected and retained, and any line whose
57
- * parsed value is unchanged is kept verbatim — preserving trailing whitespace and inline `;`/`#`
58
- * comments. Explicit `whitespace` / `eol` options always win over detection.
59
- * @param path The path to the INI file. Can be a file URL or a string path.
60
- * @param data The data to serialize.
61
- * @param options Optional configuration. See {@link WriteIniOptions}.
62
- * @example
63
- * ```javascript
64
- * import { writeIniSync } from "@visulima/fs/ini";
65
- *
66
- * writeIniSync("./config.ini", { server: { port: 8080 } });
67
- * ```
68
- */
53
+ * Synchronously writes an object to an INI file.
54
+ *
55
+ * When an existing file is present and `preserveStyle` is `true` (the default), the original file's
56
+ * whitespace-around-`=` style and line endings are auto-detected and retained, and any line whose
57
+ * parsed value is unchanged is kept verbatim — preserving trailing whitespace and inline `;`/`#`
58
+ * comments. Explicit `whitespace` / `eol` options always win over detection.
59
+ * @param path The path to the INI file. Can be a file URL or a string path.
60
+ * @param data The data to serialize.
61
+ * @param options Optional configuration. See {@link WriteIniOptions}.
62
+ * @example
63
+ * ```javascript
64
+ * import { writeIniSync } from "@visulima/fs/ini";
65
+ *
66
+ * writeIniSync("./config.ini", { server: { port: 8080 } });
67
+ * ```
68
+ */
69
69
  declare const writeIniSync: (path: URL | string, data: Record<string, unknown>, options?: WriteIniOptions) => void;
70
70
  export { type ReadIniOptions, type WriteIniOptions, readIni, readIniSync, writeIni, writeIniSync };
package/dist/ini.js CHANGED
@@ -1 +1 @@
1
- import{default as a}from"./packem_shared/readIni-BsXudu2r.js";import{default as f}from"./packem_shared/readIniSync-DKwRbbs9.js";import{default as d}from"./packem_shared/writeIni-BWX3cP1K.js";import{default as n}from"./packem_shared/writeIniSync-fOdgPFfL.js";export{a as readIni,f as readIniSync,d as writeIni,n as writeIniSync};
1
+ import{default as a}from"./packem_shared/readIni-CEXHWn92.js";import{default as f}from"./packem_shared/readIniSync-DsxVHypc.js";import{default as d}from"./packem_shared/writeIni-CKinbquM.js";import{default as n}from"./packem_shared/writeIniSync-BISRFyg0.js";export{a as readIni,f as readIniSync,d as writeIni,n as writeIniSync};
package/dist/is-glob.d.ts CHANGED
@@ -1,34 +1,34 @@
1
1
  /**
2
- * Options accepted by {@link isGlob}.
3
- */
2
+ * Options accepted by {@link isGlob}.
3
+ */
4
4
  interface IsGlobOptions {
5
5
  /**
6
- * When `false`, matches more permissively — any string containing unescaped glob
7
- * meta characters (`*`, `?`, `{}`, `()`, `[]`) is treated as a glob, even when the
8
- * sequence is not a valid glob expression.
9
- * @default true
10
- */
6
+ * When `false`, matches more permissively — any string containing unescaped glob
7
+ * meta characters (`*`, `?`, `{}`, `()`, `[]`) is treated as a glob, even when the
8
+ * sequence is not a valid glob expression.
9
+ * @default true
10
+ */
11
11
  strict?: boolean;
12
12
  }
13
13
  /**
14
- * Returns `true` if the given value looks like a glob pattern (including extglobs like `@(foo|bar)`).
15
- *
16
- * Escaped meta characters (e.g. `\\*`) are not considered globs. Non-string values always return `false`.
17
- *
18
- * Powered by [`is-glob`](https://github.com/micromatch/is-glob) which is bundled into the built output so it does
19
- * not appear as a runtime dependency of `@visulima/fs`.
20
- * @param value The value to inspect.
21
- * @param options Optional configuration. See {@link IsGlobOptions}.
22
- * @returns `true` if `value` looks like a glob pattern, otherwise `false`.
23
- * @example
24
- * ```javascript
25
- * import { isGlob } from "@visulima/fs";
26
- *
27
- * isGlob("src/**\/*.ts"); // true
28
- * isGlob("src/index.ts"); // false
29
- * isGlob("src/\\*.ts"); // false — escaped
30
- * isGlob("!foo.js"); // true — negation
31
- * ```
32
- */
14
+ * Returns `true` if the given value looks like a glob pattern (including extglobs like `@(foo|bar)`).
15
+ *
16
+ * Escaped meta characters (e.g. `\\*`) are not considered globs. Non-string values always return `false`.
17
+ *
18
+ * Powered by [`is-glob`](https://github.com/micromatch/is-glob) which is bundled into the built output so it does
19
+ * not appear as a runtime dependency of `@visulima/fs`.
20
+ * @param value The value to inspect.
21
+ * @param options Optional configuration. See {@link IsGlobOptions}.
22
+ * @returns `true` if `value` looks like a glob pattern, otherwise `false`.
23
+ * @example
24
+ * ```javascript
25
+ * import { isGlob } from "@visulima/fs";
26
+ *
27
+ * isGlob("src/**\/*.ts"); // true
28
+ * isGlob("src/index.ts"); // false
29
+ * isGlob("src/\\*.ts"); // false — escaped
30
+ * isGlob("!foo.js"); // true — negation
31
+ * ```
32
+ */
33
33
  declare const isGlob: (value: unknown, options?: IsGlobOptions) => boolean;
34
34
  export { type IsGlobOptions, isGlob as default };
package/dist/json5.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as CompressionType, b as ReadJson5Options, J as Json5Reviver, c as WriteJson5Options } from "./packem_shared/types.d-BMdL_ygj.js";
2
- export type { d as Json5Replacer } from "./packem_shared/types.d-BMdL_ygj.js";
1
+ import { C as CompressionType, b as ReadJson5Options, J as Json5Reviver, c as WriteJson5Options } from "./packem_shared/types.d-D3Jo_iA-.js";
2
+ export type { d as Json5Replacer } from "./packem_shared/types.d-D3Jo_iA-.js";
3
3
  import 'node:fs';
4
4
  import 'fdir';
5
5
  declare function readJson5<R = unknown>(path: URL | string, options?: ReadJson5Options<CompressionType>): Promise<R>;
@@ -7,30 +7,30 @@ declare function readJson5<R = unknown>(path: URL | string, reviver: Json5Revive
7
7
  declare function readJson5Sync(path: URL | string, options?: ReadJson5Options<CompressionType>): unknown;
8
8
  declare function readJson5Sync(path: URL | string, reviver: Json5Reviver, options?: ReadJson5Options<CompressionType>): unknown;
9
9
  /**
10
- * Asynchronously writes a value to a JSON5 file.
11
- * @param path The path to the JSON5 file. Can be a file URL or a string path.
12
- * @param data The data to serialize.
13
- * @param options Optional configuration. See {@link WriteJson5Options}.
14
- * @returns A promise that resolves when the file has been written.
15
- * @example
16
- * ```javascript
17
- * import { writeJson5 } from "@visulima/fs/json5";
18
- *
19
- * await writeJson5("./config.json5", { name: "app" }, { indent: 2, quote: "'" });
20
- * ```
21
- */
10
+ * Asynchronously writes a value to a JSON5 file.
11
+ * @param path The path to the JSON5 file. Can be a file URL or a string path.
12
+ * @param data The data to serialize.
13
+ * @param options Optional configuration. See {@link WriteJson5Options}.
14
+ * @returns A promise that resolves when the file has been written.
15
+ * @example
16
+ * ```javascript
17
+ * import { writeJson5 } from "@visulima/fs/json5";
18
+ *
19
+ * await writeJson5("./config.json5", { name: "app" }, { indent: 2, quote: "'" });
20
+ * ```
21
+ */
22
22
  declare const writeJson5: (path: URL | string, data: unknown, options?: WriteJson5Options) => Promise<void>;
23
23
  /**
24
- * Synchronously writes a value to a JSON5 file.
25
- * @param path The path to the JSON5 file. Can be a file URL or a string path.
26
- * @param data The data to serialize.
27
- * @param options Optional configuration. See {@link WriteJson5Options}.
28
- * @example
29
- * ```javascript
30
- * import { writeJson5Sync } from "@visulima/fs/json5";
31
- *
32
- * writeJson5Sync("./config.json5", { name: "app" }, { indent: 2 });
33
- * ```
34
- */
24
+ * Synchronously writes a value to a JSON5 file.
25
+ * @param path The path to the JSON5 file. Can be a file URL or a string path.
26
+ * @param data The data to serialize.
27
+ * @param options Optional configuration. See {@link WriteJson5Options}.
28
+ * @example
29
+ * ```javascript
30
+ * import { writeJson5Sync } from "@visulima/fs/json5";
31
+ *
32
+ * writeJson5Sync("./config.json5", { name: "app" }, { indent: 2 });
33
+ * ```
34
+ */
35
35
  declare const writeJson5Sync: (path: URL | string, data: unknown, options?: WriteJson5Options) => void;
36
36
  export { type Json5Reviver, type ReadJson5Options, type WriteJson5Options, readJson5, readJson5Sync, writeJson5, writeJson5Sync };
package/dist/json5.js CHANGED
@@ -1 +1 @@
1
- import{default as r}from"./packem_shared/readJson5-CM1TIiHd.js";import{default as t}from"./packem_shared/readJson5Sync-Bc26c3Fy.js";import{default as s}from"./packem_shared/writeJson5-Ch8TpNPI.js";import{default as n}from"./packem_shared/writeJson5Sync-BrctV_Mk.js";export{r as readJson5,t as readJson5Sync,s as writeJson5,n as writeJson5Sync};
1
+ import{default as r}from"./packem_shared/readJson5-S68aVros.js";import{default as t}from"./packem_shared/readJson5Sync-Bi9Rv46R.js";import{default as s}from"./packem_shared/writeJson5-rSp3QAKP.js";import{default as n}from"./packem_shared/writeJson5Sync-tSBBKnaP.js";export{r as readJson5,t as readJson5Sync,s as writeJson5,n as writeJson5Sync};
package/dist/jsonc.d.ts CHANGED
@@ -1,65 +1,65 @@
1
- import { C as CompressionType, e as ReadJsoncOptions, f as WriteJsoncOptions } from "./packem_shared/types.d-BMdL_ygj.js";
2
- export type { g as JsoncFormattingOptions, h as JsoncParseOptions } from "./packem_shared/types.d-BMdL_ygj.js";
1
+ import { C as CompressionType, e as ReadJsoncOptions, f as WriteJsoncOptions } from "./packem_shared/types.d-D3Jo_iA-.js";
2
+ export type { g as JsoncFormattingOptions, h as JsoncParseOptions } from "./packem_shared/types.d-D3Jo_iA-.js";
3
3
  import 'node:fs';
4
4
  import 'fdir';
5
5
  /**
6
- * Asynchronously reads a JSONC (JSON with comments) file and parses it into a JavaScript value.
7
- * Supports `//` and `/* *\/` comments and, optionally, trailing commas via `jsonc-parser`.
8
- * @param path The path to the JSONC file. Can be a file URL or a string path.
9
- * @param options Optional configuration. See {@link ReadJsoncOptions}.
10
- * @returns A promise that resolves with the parsed value.
11
- * @example
12
- * ```javascript
13
- * import { readJsonc } from "@visulima/fs/jsonc";
14
- *
15
- * const config = await readJsonc("./tsconfig.json", { allowTrailingComma: true });
16
- * ```
17
- */
6
+ * Asynchronously reads a JSONC (JSON with comments) file and parses it into a JavaScript value.
7
+ * Supports `//` and `/* *\/` comments and, optionally, trailing commas via `jsonc-parser`.
8
+ * @param path The path to the JSONC file. Can be a file URL or a string path.
9
+ * @param options Optional configuration. See {@link ReadJsoncOptions}.
10
+ * @returns A promise that resolves with the parsed value.
11
+ * @example
12
+ * ```javascript
13
+ * import { readJsonc } from "@visulima/fs/jsonc";
14
+ *
15
+ * const config = await readJsonc("./tsconfig.json", { allowTrailingComma: true });
16
+ * ```
17
+ */
18
18
  declare const readJsonc: (path: URL | string, options?: ReadJsoncOptions<CompressionType>) => Promise<unknown>;
19
19
  /**
20
- * Synchronously reads a JSONC (JSON with comments) file and parses it into a JavaScript value.
21
- * Supports `//` and `/* *\/` comments and, optionally, trailing commas via `jsonc-parser`.
22
- * @param path The path to the JSONC file. Can be a file URL or a string path.
23
- * @param options Optional configuration. See {@link ReadJsoncOptions}.
24
- * @returns The parsed value.
25
- * @example
26
- * ```javascript
27
- * import { readJsoncSync } from "@visulima/fs/jsonc";
28
- *
29
- * const config = readJsoncSync("./tsconfig.json", { allowTrailingComma: true });
30
- * ```
31
- */
20
+ * Synchronously reads a JSONC (JSON with comments) file and parses it into a JavaScript value.
21
+ * Supports `//` and `/* *\/` comments and, optionally, trailing commas via `jsonc-parser`.
22
+ * @param path The path to the JSONC file. Can be a file URL or a string path.
23
+ * @param options Optional configuration. See {@link ReadJsoncOptions}.
24
+ * @returns The parsed value.
25
+ * @example
26
+ * ```javascript
27
+ * import { readJsoncSync } from "@visulima/fs/jsonc";
28
+ *
29
+ * const config = readJsoncSync("./tsconfig.json", { allowTrailingComma: true });
30
+ * ```
31
+ */
32
32
  declare const readJsoncSync: (path: URL | string, options?: ReadJsoncOptions<CompressionType>) => unknown;
33
33
  /**
34
- * Asynchronously writes a value to a JSONC file. When `preserveComments` is `true` (the default)
35
- * and the target file already exists, existing comments and formatting are preserved by computing
36
- * a minimal diff against the new value via `jsonc-parser`'s `modify` API.
37
- * @param path The path to the JSONC file. Can be a file URL or a string path.
38
- * @param data The data to serialize.
39
- * @param options Optional configuration. See {@link WriteJsoncOptions}.
40
- * @returns A promise that resolves when the file has been written.
41
- * @example
42
- * ```javascript
43
- * import { writeJsonc } from "@visulima/fs/jsonc";
44
- *
45
- * // Preserves comments inside an existing tsconfig.json
46
- * await writeJsonc("./tsconfig.json", { ...tsconfig, compilerOptions: { target: "es2024" } });
47
- * ```
48
- */
34
+ * Asynchronously writes a value to a JSONC file. When `preserveComments` is `true` (the default)
35
+ * and the target file already exists, existing comments and formatting are preserved by computing
36
+ * a minimal diff against the new value via `jsonc-parser`'s `modify` API.
37
+ * @param path The path to the JSONC file. Can be a file URL or a string path.
38
+ * @param data The data to serialize.
39
+ * @param options Optional configuration. See {@link WriteJsoncOptions}.
40
+ * @returns A promise that resolves when the file has been written.
41
+ * @example
42
+ * ```javascript
43
+ * import { writeJsonc } from "@visulima/fs/jsonc";
44
+ *
45
+ * // Preserves comments inside an existing tsconfig.json
46
+ * await writeJsonc("./tsconfig.json", { ...tsconfig, compilerOptions: { target: "es2024" } });
47
+ * ```
48
+ */
49
49
  declare const writeJsonc: (path: URL | string, data: unknown, options?: WriteJsoncOptions) => Promise<void>;
50
50
  /**
51
- * Synchronously writes a value to a JSONC file. When `preserveComments` is `true` (the default)
52
- * and the target file already exists, existing comments and formatting are preserved by computing
53
- * a minimal diff against the new value via `jsonc-parser`'s `modify` API.
54
- * @param path The path to the JSONC file. Can be a file URL or a string path.
55
- * @param data The data to serialize.
56
- * @param options Optional configuration. See {@link WriteJsoncOptions}.
57
- * @example
58
- * ```javascript
59
- * import { writeJsoncSync } from "@visulima/fs/jsonc";
60
- *
61
- * writeJsoncSync("./tsconfig.json", updated);
62
- * ```
63
- */
51
+ * Synchronously writes a value to a JSONC file. When `preserveComments` is `true` (the default)
52
+ * and the target file already exists, existing comments and formatting are preserved by computing
53
+ * a minimal diff against the new value via `jsonc-parser`'s `modify` API.
54
+ * @param path The path to the JSONC file. Can be a file URL or a string path.
55
+ * @param data The data to serialize.
56
+ * @param options Optional configuration. See {@link WriteJsoncOptions}.
57
+ * @example
58
+ * ```javascript
59
+ * import { writeJsoncSync } from "@visulima/fs/jsonc";
60
+ *
61
+ * writeJsoncSync("./tsconfig.json", updated);
62
+ * ```
63
+ */
64
64
  declare const writeJsoncSync: (path: URL | string, data: unknown, options?: WriteJsoncOptions) => void;
65
65
  export { type ReadJsoncOptions, type WriteJsoncOptions, readJsonc, readJsoncSync, writeJsonc, writeJsoncSync };
package/dist/jsonc.js CHANGED
@@ -1 +1 @@
1
- import{default as r}from"./packem_shared/readJsonc-BZjMw_0f.js";import{default as t}from"./packem_shared/readJsoncSync-C-xzeZz4.js";import{default as s}from"./packem_shared/writeJsonc-CefrwsOc.js";import{default as d}from"./packem_shared/writeJsoncSync-BskDjn8o.js";export{r as readJsonc,t as readJsoncSync,s as writeJsonc,d as writeJsoncSync};
1
+ import{default as r}from"./packem_shared/readJsonc-DSoFyuDk.js";import{default as t}from"./packem_shared/readJsoncSync-CLtlvFKV.js";import{default as s}from"./packem_shared/writeJsonc-bxz1jdeU.js";import{default as d}from"./packem_shared/writeJsoncSync-C-W0H9qP.js";export{r as readJsonc,t as readJsoncSync,s as writeJsonc,d as writeJsoncSync};
package/dist/match.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Options accepted by {@link match} and {@link matcher}.
3
- *
4
- * Mirrors `picomatch.PicomatchOptions`; passed straight through to
5
- * [`picomatch`](https://github.com/micromatch/picomatch#options); see its
6
- * documentation for the full list.
7
- */
2
+ * Options accepted by {@link match} and {@link matcher}.
3
+ *
4
+ * Mirrors `picomatch.PicomatchOptions`; passed straight through to
5
+ * [`picomatch`](https://github.com/micromatch/picomatch#options); see its
6
+ * documentation for the full list.
7
+ */
8
8
  interface MatchOptions {
9
9
  basename?: boolean;
10
10
  bash?: boolean;
@@ -40,41 +40,41 @@ interface MatchOptions {
40
40
  windows?: boolean;
41
41
  }
42
42
  /**
43
- * Tests whether a path matches one or more glob patterns.
44
- *
45
- * Powered by [`picomatch`](https://github.com/micromatch/picomatch) which is bundled into the built output so it does
46
- * not appear as a runtime dependency of `@visulima/fs`.
47
- *
48
- * If you match many values against the same pattern, prefer {@link matcher} to compile the pattern once.
49
- * @param value The path (or paths) to test.
50
- * @param pattern A single glob or array of globs.
51
- * @param options Optional picomatch options. See {@link MatchOptions}.
52
- * @returns `true` if `value` matches any of `pattern`.
53
- * @example
54
- * ```javascript
55
- * import { match } from "@visulima/fs";
56
- *
57
- * match("src/index.ts", "src/**\/*.ts"); // true
58
- * match("src/index.ts", ["**\/*.js", "**\/*.ts"]); // true
59
- * match("src/index.ts", "**\/*.js"); // false
60
- * ```
61
- */
43
+ * Tests whether a path matches one or more glob patterns.
44
+ *
45
+ * Powered by [`picomatch`](https://github.com/micromatch/picomatch) which is bundled into the built output so it does
46
+ * not appear as a runtime dependency of `@visulima/fs`.
47
+ *
48
+ * If you match many values against the same pattern, prefer {@link matcher} to compile the pattern once.
49
+ * @param value The path (or paths) to test.
50
+ * @param pattern A single glob or array of globs.
51
+ * @param options Optional picomatch options. See {@link MatchOptions}.
52
+ * @returns `true` if `value` matches any of `pattern`.
53
+ * @example
54
+ * ```javascript
55
+ * import { match } from "@visulima/fs";
56
+ *
57
+ * match("src/index.ts", "src/**\/*.ts"); // true
58
+ * match("src/index.ts", ["**\/*.js", "**\/*.ts"]); // true
59
+ * match("src/index.ts", "**\/*.js"); // false
60
+ * ```
61
+ */
62
62
  declare const match: (value: string | string[], pattern: string | string[], options?: MatchOptions) => boolean;
63
63
  /**
64
- * Compiles a glob pattern into a reusable matcher function.
65
- *
66
- * Powered by [`picomatch`](https://github.com/micromatch/picomatch) which is bundled into the built output so it does
67
- * not appear as a runtime dependency of `@visulima/fs`.
68
- * @param pattern A single glob or array of globs.
69
- * @param options Optional picomatch options. See {@link MatchOptions}.
70
- * @returns A function that returns `true` when its argument matches the compiled pattern.
71
- * @example
72
- * ```javascript
73
- * import { matcher } from "@visulima/fs";
74
- *
75
- * const isTs = matcher("**\/*.ts");
76
- * ["a.ts", "b.js", "c.ts"].filter(isTs); // ["a.ts", "c.ts"]
77
- * ```
78
- */
64
+ * Compiles a glob pattern into a reusable matcher function.
65
+ *
66
+ * Powered by [`picomatch`](https://github.com/micromatch/picomatch) which is bundled into the built output so it does
67
+ * not appear as a runtime dependency of `@visulima/fs`.
68
+ * @param pattern A single glob or array of globs.
69
+ * @param options Optional picomatch options. See {@link MatchOptions}.
70
+ * @returns A function that returns `true` when its argument matches the compiled pattern.
71
+ * @example
72
+ * ```javascript
73
+ * import { matcher } from "@visulima/fs";
74
+ *
75
+ * const isTs = matcher("**\/*.ts");
76
+ * ["a.ts", "b.js", "c.ts"].filter(isTs); // ["a.ts", "c.ts"]
77
+ * ```
78
+ */
79
79
  declare const matcher: (pattern: string | string[], options?: MatchOptions) => (value: string) => boolean;
80
80
  export { MatchOptions, match, matcher };
@@ -1 +1 @@
1
- import n from"./walk-OX4-6oCP.js";const e=async(r,s={})=>{Array.isArray(s.extensions)||(s.extensions=["js","mjs","cjs","ts"]);const o=[];for await(const t of n(r,s))o.push(t.path);return o};export{e as default};
1
+ import n from"./walk-BReeHTKb.js";const e=async(r,s={})=>{Array.isArray(s.extensions)||(s.extensions=["js","mjs","cjs","ts"]);const o=[];for await(const t of n(r,s))o.push(t.path);return o};export{e as default};
@@ -1 +1 @@
1
- import t from"./walkSync-BPs6czIM.js";const a=(r,s={})=>{Array.isArray(s.extensions)||(s.extensions=["js","mjs","cjs","ts"]);const o=[];for(const n of t(r,s))o.push(n.path);return o};export{a as default};
1
+ import t from"./walkSync-yHJUIJb9.js";const a=(r,s={})=>{Array.isArray(s.extensions)||(s.extensions=["js","mjs","cjs","ts"]);const o=[];for(const n of t(r,s))o.push(n.path);return o};export{a as default};
@@ -0,0 +1 @@
1
+ import{createRequire as v}from"node:module";import{toPath as n}from"@visulima/path/utils";import j from"./AlreadyExistsError-DEb3UWja.js";import c from"./assertValidFileOrDirectoryPath-BTlt945W.js";let y;const h=e=>(y??=v(import.meta.url))(e),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=e=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[r,t]=s.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return s.getBuiltinModule(e)}return h(e)},{cp:g}=b("node:fs/promises"),w=async(e,r,t={})=>{c(e),c(r);const{dereference:a=!1,errorOnExist:f=!0,filter:m,overwrite:l=!0,preserveTimestamps:p=!1,recursive:u=!0,verbatimSymlinks:d=!1}=t,_=n(e),o=n(r);try{await g(_,o,{dereference:a,errorOnExist:f,filter:m,force:l,preserveTimestamps:p,recursive:u,verbatimSymlinks:d})}catch(i){throw i?.code==="ERR_FS_CP_EEXIST"?new j(`destination already exists, copy '${o}'`):i}};export{w as default};
@@ -0,0 +1 @@
1
+ import{createRequire as v}from"node:module";import{toPath as n}from"@visulima/path/utils";import j from"./AlreadyExistsError-DEb3UWja.js";import c from"./assertValidFileOrDirectoryPath-BTlt945W.js";let y;const h=e=>(y??=v(import.meta.url))(e),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=e=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[r,t]=s.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return s.getBuiltinModule(e)}return h(e)},{cpSync:g}=b("node:fs"),q=(e,r,t={})=>{c(e),c(r);const{dereference:a=!1,errorOnExist:f=!0,filter:l,overwrite:m=!0,preserveTimestamps:p=!1,recursive:u=!0,verbatimSymlinks:d=!1}=t,_=n(e),o=n(r);try{g(_,o,{dereference:a,errorOnExist:f,filter:l,force:m,preserveTimestamps:p,recursive:u,verbatimSymlinks:d})}catch(i){throw i?.code==="ERR_FS_CP_EEXIST"?new j(`destination already exists, copy '${o}'`):i}};export{q as default};
@@ -0,0 +1 @@
1
+ import{createRequire as c}from"node:module";import{join as _}from"@visulima/path";import{toPath as l}from"@visulima/path/utils";import j from"./assertValidFileOrDirectoryPath-BTlt945W.js";import{t as g}from"./build-rm-options-avnusYx-.js";let a;const u=e=>(a??=c(import.meta.url))(e),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,i=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[o,s]=r.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return r.getBuiltinModule(e)}return u(e)},{existsSync:f}=i("node:fs"),{mkdir:m,readdir:d,rm:p}=i("node:fs/promises"),w=async(e,o)=>{if(j(e),!f(e)){await m(e,{recursive:!0});return}const s=await d(e),t=g(o);for(const n of s)await p(_(l(e),n),t)};export{w as default};
@@ -0,0 +1 @@
1
+ import{createRequire as t}from"node:module";import{join as p}from"@visulima/path";import{toPath as _}from"@visulima/path/utils";import l from"./assertValidFileOrDirectoryPath-BTlt945W.js";import{t as j}from"./build-rm-options-avnusYx-.js";let n;const c=e=>(n??=t(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=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)},{existsSync:f,mkdirSync:m,readdirSync:a,rmSync:d}=u("node:fs"),v=(e,r)=>{if(l(e),!f(e)){m(e,{recursive:!0});return}const s=j(r);for(const i of a(e))d(p(_(e),i),s)};export{v as default};
@@ -0,0 +1 @@
1
+ import{createRequire as n}from"node:module";import p from"./assertValidFileOrDirectoryPath-BTlt945W.js";import{g as i}from"./get-file-info-type-DzWpohDB.js";let c;const a=r=>(c??=n(import.meta.url))(r),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=r=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[e,t]=o.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return o.getBuiltinModule(r)}return a(r)},{lstat:s,mkdir:d}=u("node:fs/promises"),m=async r=>{p(r);try{const e=await s(r);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(i(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await d(r,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const t=await s(r);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(i(t))}'`,{cause:e})}};export{m as default};
@@ -0,0 +1 @@
1
+ import{createRequire as n}from"node:module";import f from"./assertValidFileOrDirectoryPath-BTlt945W.js";import{g as i}from"./get-file-info-type-DzWpohDB.js";let c;const u=r=>(c??=n(import.meta.url))(r),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,a=r=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[e,t]=o.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return o.getBuiltinModule(r)}return u(r)},{lstatSync:s,mkdirSync:d}=a("node:fs"),g=r=>{f(r);try{const e=s(r);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(i(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{d(r,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const t=s(r);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(i(t))}'`,{cause:e})}};export{g as default};
@@ -0,0 +1 @@
1
+ import{createRequire as i}from"node:module";import{dirname as f}from"@visulima/path";import{toPath as m}from"@visulima/path/utils";import l from"./assertValidFileOrDirectoryPath-BTlt945W.js";import u from"./ensureDir-BEiomfxz.js";import{g as d}from"./get-file-info-type-DzWpohDB.js";let s;const n=e=>(s??=i(import.meta.url))(e),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,a=e=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[r,o]=t.versions.node.split(".").map(Number);if(r>22||r===22&&o>=3||r===20&&o>=16)return t.getBuiltinModule(e)}return n(e)},{lstat:c,writeFile:p}=a("node:fs/promises"),T=async e=>{l(e);try{const r=await c(e);if(!r.isFile())throw new Error(`Ensure path exists, expected 'file', got '${String(d(r))}'`)}catch(r){if(r.code==="ENOENT"){await u(f(m(e))),await p(e,new Uint8Array);return}throw r}};export{T as default};
@@ -0,0 +1 @@
1
+ import{createRequire as i}from"node:module";import{dirname as a}from"@visulima/path";import{toPath as l}from"@visulima/path/utils";import m from"./assertValidFileOrDirectoryPath-BTlt945W.js";import u from"./ensureDirSync-B0w9WMwE.js";import{g as d}from"./get-file-info-type-DzWpohDB.js";let s;const n=e=>(s??=i(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=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 n(e)},{lstatSync:f,writeFileSync:p}=c("node:fs"),T=e=>{m(e);try{const r=f(e);if(!r.isFile())throw new Error(`Ensure path exists, expected 'file', got '${String(d(r))}'`)}catch(r){if(r.code==="ENOENT"){u(a(l(e))),p(e,new Uint8Array);return}throw r}};export{T as default};
@@ -0,0 +1 @@
1
+ import{createRequire as p}from"node:module";import{toNamespacedPath as n,dirname as h}from"@visulima/path";import{toPath as c}from"@visulima/path/utils";import m from"./assertValidFileOrDirectoryPath-BTlt945W.js";import g from"./ensureDir-BEiomfxz.js";import{d as j}from"./is-stats-identical-l1GRN4Qu.js";let u;const f=e=>(u??=p(import.meta.url))(e),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=e=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[t,o]=s.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return s.getBuiltinModule(e)}return f(e)},{lstat:a,link:_}=d("node:fs/promises"),R=async(e,t)=>{m(e),m(t),e=n(c(e)),t=n(c(t));let o;try{o=await a(t)}catch{}let i;try{i=await a(e)}catch(l){const r=l;throw r.message=r.message.replace("lstat","ensureLink"),r}o&&j(i,o)||(await g(h(t)),await _(e,t))};export{R as default};
@@ -0,0 +1 @@
1
+ import{createRequire as p}from"node:module";import{toNamespacedPath as c,dirname as h}from"@visulima/path";import{toPath as a}from"@visulima/path/utils";import m from"./assertValidFileOrDirectoryPath-BTlt945W.js";import g from"./ensureDirSync-B0w9WMwE.js";import{d as y}from"./is-stats-identical-l1GRN4Qu.js";let u;const f=e=>(u??=p(import.meta.url))(e),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=e=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[o,t]=s.versions.node.split(".").map(Number);if(o>22||o===22&&t>=3||o===20&&t>=16)return s.getBuiltinModule(e)}return f(e)},{lstatSync:i,linkSync:_}=d("node:fs"),T=(e,o)=>{m(e),m(o),e=c(a(e)),o=c(a(o));let t;try{t=i(o)}catch{}let n;try{n=i(e)}catch(l){const r=l;throw r.message=r.message.replace("lstat","ensureLink"),r}t&&y(n,t)||(g(h(o)),_(e,o))};export{T as default};
@@ -0,0 +1 @@
1
+ import{createRequire as g}from"node:module";import{toNamespacedPath as m,dirname as P,resolve as S}from"@visulima/path";import{toPath as p}from"@visulima/path/utils";import d from"./assertValidFileOrDirectoryPath-BTlt945W.js";import q from"./ensureDir-BEiomfxz.js";import{g as u}from"./get-file-info-type-DzWpohDB.js";import{d as x}from"./is-stats-identical-l1GRN4Qu.js";import{t as E}from"./resolve-symlink-target-CWrn0v4P.js";import h from"./AlreadyExistsError-DEb3UWja.js";let j;const b=i=>(j??=g(import.meta.url))(i),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=i=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[e,o]=t.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return t.getBuiltinModule(i)}return b(i)},{lstat:c,stat:f,symlink:k,readlink:v}=T("node:fs/promises"),R=process.platform==="win32"||/^(?:msys|cygwin)$/.test(process.env.OSTYPE),Y=async(i,e,o)=>{d(i),d(e);const r=E(i,e);e=m(p(e));try{if((await c(e)).isSymbolicLink()){const[s,n]=await Promise.all([f(r),f(e)]);if(x(s,n))return}}catch{}const w=await c(r),y=u(w);await q(P(e));let a=o??"file";o||(R?a="junction":a=y==="dir"?"dir":"file");try{await k(m(p(r)),e,a)}catch(s){if(s.code!=="EEXIST")throw s;const n=await c(e);if(!n.isSymbolicLink())throw new h(`A ${String(u(n))} already exists at the path: ${e}`);const _=await v(e),l=m(S(_));if(l!==r)throw new h(`A symlink targeting to an undesired path already exists: ${e} -> ${l}`)}};export{Y as default};
@@ -0,0 +1 @@
1
+ import{createRequire as j}from"node:module";import{toNamespacedPath as l,dirname as q,resolve as x}from"@visulima/path";import{toPath as p}from"@visulima/path/utils";import d from"./assertValidFileOrDirectoryPath-BTlt945W.js";import P from"./ensureDirSync-B0w9WMwE.js";import{g as u}from"./get-file-info-type-DzWpohDB.js";import{d as y}from"./is-stats-identical-l1GRN4Qu.js";import{t as E}from"./resolve-symlink-target-CWrn0v4P.js";import _ from"./AlreadyExistsError-DEb3UWja.js";let w;const b=o=>(w??=j(import.meta.url))(o),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=o=>{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(o)}return b(o)},{lstatSync:m,statSync:c,symlinkSync:k,readlinkSync:v}=T("node:fs"),R=process.platform==="win32"||/^(?:msys|cygwin)$/.test(process.env.OSTYPE),Y=(o,e,r)=>{d(o),d(e);const t=E(o,e);e=l(p(e));try{if(m(e).isSymbolicLink()&&y(c(t),c(e))){const s=c(t),n=c(e);if(y(s,n))return}}catch{}const h=m(t),g=u(h);P(q(e));let a=r??"file";r||(R?a="junction":a=g==="dir"?"dir":"file");try{k(l(p(t)),e,a)}catch(s){if(s.code!=="EEXIST")throw s;const n=m(e);if(!n.isSymbolicLink())throw new _(`A ${String(u(n))} already exists at the path: ${e}`);const S=v(e),f=l(x(S));if(f!==t)throw new _(`A symlink targeting to an undesired path already exists: ${e} -> ${f}`)}};export{Y as default};
@@ -0,0 +1 @@
1
+ import{createRequire as g}from"node:module";import{resolve as c,parse as T,isAbsolute as v,dirname as q}from"@visulima/path";import{toPath as f}from"@visulima/path/utils";import{FIND_UP_STOP as B}from"./FIND_UP_STOP-CAwY1qU7.js";let w;const h=t=>(w??=g(import.meta.url))(t),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=t=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[o,i]=s.versions.node.split(".").map(Number);if(o>22||o===22&&i>=3||o===20&&i>=16)return s.getBuiltinModule(t)}return h(t)},{stat:b,lstat:j}=A("node:fs/promises"),D=async(t,o={})=>{if(typeof t!="string"&&!Array.isArray(t)&&typeof t!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const i=o.cwd?f(o.cwd):process.cwd();let r=c(i);const{root:a}=T(r),y=f(o.stopAt??a),m=c(r,y),u=o.type??"file",d=async function(n){return typeof t=="function"?[await t(n)]:typeof t=="string"?[t]:Array.isArray(t)?t:[t]};o.allowSymlinks??=!0;const _=o.allowSymlinks?b:j;for(;r&&r!==m&&r!==a;){const n=await d(r);for(let e of n){if(e===B)return;if(e===void 0)continue;Buffer.isBuffer(e)?e=e.toString():e instanceof URL&&(e=f(e));const l=v(e)?e:c(r,e);try{const p=await _(l);if(u==="file"&&p.isFile()||u==="directory"&&p.isDirectory())return l}catch{}}r=q(r)}};export{D as default};
@@ -0,0 +1 @@
1
+ import{createRequire as _}from"node:module";import{resolve as i,parse as A,isAbsolute as S,dirname as T}from"@visulima/path";import{toPath as c}from"@visulima/path/utils";import{FIND_UP_STOP as v}from"./FIND_UP_STOP-CAwY1qU7.js";let g;const h=e=>(g??=_(import.meta.url))(e),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=e=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[o,n]=s.versions.node.split(".").map(Number);if(o>22||o===22&&n>=3||o===20&&n>=16)return s.getBuiltinModule(e)}return h(e)},{statSync:b,lstatSync:j}=w("node:fs"),F=(e,o={})=>{if(typeof e!="string"&&!Array.isArray(e)&&typeof e!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const n=o.cwd?c(o.cwd):process.cwd();let r=i(n);const{root:f}=A(r),p=c(o.stopAt??f),y=i(r,p),u=o.type??"file",d=function(t){return typeof e=="function"?[e(t)]:typeof e=="string"?[e]:Array.isArray(e)?e:[e]};o.allowSymlinks??=!0;const m=o.allowSymlinks?b:j;for(;r&&r!==y&&r!==f;){for(let t of d(r)){if(t===v)return;if(t===void 0)continue;Buffer.isBuffer(t)?t=t.toString():t instanceof URL&&(t=c(t));const a=S(t)?t:i(r,t);try{const l=m(a);if(u==="file"&&l.isFile()||u==="directory"&&l.isDirectory())return a}catch{}}r=T(r)}};export{F as default};
@@ -0,0 +1 @@
1
+ import{b as o}from"./index-CPZbuHkp.js";const i=async(a,t)=>await o(a,t);export{i as default};