@visulima/fs 3.1.7 → 3.1.9

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 (219) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +153 -153
  3. package/dist/eol.cjs +3 -28
  4. package/dist/eol.mjs +3 -20
  5. package/dist/error.cjs +1 -21
  6. package/dist/error.mjs +1 -7
  7. package/dist/index.cjs +1 -80
  8. package/dist/index.mjs +1 -31
  9. package/dist/packem_shared/AlreadyExistsError-CEu6_Tjb.mjs +1 -0
  10. package/dist/packem_shared/AlreadyExistsError-GC2XUgzJ.cjs +1 -0
  11. package/dist/packem_shared/DirectoryError-aGtmQVph.cjs +1 -0
  12. package/dist/packem_shared/DirectoryError-ddlbUV8C.mjs +1 -0
  13. package/dist/packem_shared/F_OK-7T91O6Oz.cjs +1 -0
  14. package/dist/packem_shared/F_OK-B71i3mUa.mjs +1 -0
  15. package/dist/packem_shared/JSONError-CVkb3xZ3.mjs +4 -0
  16. package/dist/packem_shared/JSONError-CWuiGmNc.cjs +4 -0
  17. package/dist/packem_shared/NotEmptyError-BWGfec5K.cjs +1 -0
  18. package/dist/packem_shared/NotEmptyError-DMh1o7UL.mjs +1 -0
  19. package/dist/packem_shared/NotFoundError-BPiW0icm.mjs +1 -0
  20. package/dist/packem_shared/NotFoundError-Diij7oqe.cjs +1 -0
  21. package/dist/packem_shared/PermissionError-B1Emi5a9.mjs +1 -0
  22. package/dist/packem_shared/PermissionError-Ck1Es7al.cjs +1 -0
  23. package/dist/packem_shared/WalkError-BsngoIKJ.mjs +1 -0
  24. package/dist/packem_shared/WalkError-gKgp0TWD.cjs +1 -0
  25. package/dist/packem_shared/assertValidFileContents-BZFnXa7K.mjs +1 -0
  26. package/dist/packem_shared/assertValidFileContents-CrbDz09d.cjs +1 -0
  27. package/dist/packem_shared/assertValidFileOrDirectoryPath-DgPIPmZT.mjs +1 -0
  28. package/dist/packem_shared/assertValidFileOrDirectoryPath-HOUs73Jk.cjs +1 -0
  29. package/dist/packem_shared/collect-Bl2Oc1qs.cjs +1 -0
  30. package/dist/packem_shared/collect-CyYPQFMs.mjs +1 -0
  31. package/dist/packem_shared/collectSync-BHjyXWq4.cjs +1 -0
  32. package/dist/packem_shared/collectSync-CD9cXw2g.mjs +1 -0
  33. package/dist/packem_shared/emptyDir-BdjO-6Gu.mjs +1 -0
  34. package/dist/packem_shared/emptyDir-DGRw4yE9.cjs +1 -0
  35. package/dist/packem_shared/emptyDirSync-C1vsMEp-.mjs +1 -0
  36. package/dist/packem_shared/emptyDirSync-DzjDZxOx.cjs +1 -0
  37. package/dist/packem_shared/ensureDir-BuIFF_6B.mjs +1 -0
  38. package/dist/packem_shared/ensureDir-DtQzyA70.cjs +1 -0
  39. package/dist/packem_shared/ensureDirSync-BuPHxdP4.mjs +1 -0
  40. package/dist/packem_shared/ensureDirSync-C8hIoS3o.cjs +1 -0
  41. package/dist/packem_shared/ensureFile-DcAODM6a.mjs +1 -0
  42. package/dist/packem_shared/ensureFile-wR8zBfXh.cjs +1 -0
  43. package/dist/packem_shared/ensureFileSync-BI1fIdNf.cjs +1 -0
  44. package/dist/packem_shared/ensureFileSync-CzPN6ucX.mjs +1 -0
  45. package/dist/packem_shared/ensureLink-BaZLXxgx.mjs +1 -0
  46. package/dist/packem_shared/ensureLink-DCPuU0Za.cjs +1 -0
  47. package/dist/packem_shared/ensureLinkSync-9C2JL-Sl.mjs +1 -0
  48. package/dist/packem_shared/ensureLinkSync-CuRZmQlV.cjs +1 -0
  49. package/dist/packem_shared/ensureSymlink-BH6wbylb.mjs +1 -0
  50. package/dist/packem_shared/ensureSymlink-J83jhdfA.cjs +1 -0
  51. package/dist/packem_shared/ensureSymlinkSync-CZSPodAm.mjs +1 -0
  52. package/dist/packem_shared/ensureSymlinkSync-VNtMTaV8.cjs +1 -0
  53. package/dist/packem_shared/findUp-C5aWsLuD.cjs +1 -0
  54. package/dist/packem_shared/findUp-CMGMYNty.mjs +1 -0
  55. package/dist/packem_shared/findUpSync-QP_ZEsJN.mjs +1 -0
  56. package/dist/packem_shared/findUpSync-U1lTgv4y.cjs +1 -0
  57. package/dist/packem_shared/get-file-info-type-CaWGXRjY.mjs +1 -0
  58. package/dist/packem_shared/get-file-info-type-DDbpRlDl.cjs +1 -0
  59. package/dist/packem_shared/index-BSjF-5vj.mjs +1 -0
  60. package/dist/packem_shared/index-DPla58ce.cjs +1 -0
  61. package/dist/packem_shared/is-stats-identical-Bti7K05l.cjs +1 -0
  62. package/dist/packem_shared/is-stats-identical-CohsLtWy.mjs +1 -0
  63. package/dist/packem_shared/isAccessible-BQZd1_xn.cjs +1 -0
  64. package/dist/packem_shared/isAccessible-CL4eE5VL.mjs +1 -0
  65. package/dist/packem_shared/isAccessibleSync-BP5N8k_-.cjs +1 -0
  66. package/dist/packem_shared/isAccessibleSync-_HU_ppdG.mjs +1 -0
  67. package/dist/packem_shared/move--o4NZLpD.mjs +1 -0
  68. package/dist/packem_shared/move-DwG6APiG.cjs +1 -0
  69. package/dist/packem_shared/parseJson-BEnYqLIc.mjs +6 -0
  70. package/dist/packem_shared/parseJson-CQlz8sBs.cjs +6 -0
  71. package/dist/packem_shared/readFile-BvefDyr_.cjs +1 -0
  72. package/dist/packem_shared/readFile-Cix_ijtX.mjs +1 -0
  73. package/dist/packem_shared/readFileSync-B0O-8BH0.mjs +1 -0
  74. package/dist/packem_shared/readFileSync-Ct8Ql4Vs.cjs +1 -0
  75. package/dist/packem_shared/readJson-CiDugsbt.mjs +1 -0
  76. package/dist/packem_shared/readJson-DtH0Cn36.cjs +1 -0
  77. package/dist/packem_shared/readJsonSync-B47Fk6n-.mjs +1 -0
  78. package/dist/packem_shared/readJsonSync-_SoI70cG.cjs +1 -0
  79. package/dist/packem_shared/readYaml-BOYTR5D1.mjs +1 -0
  80. package/dist/packem_shared/readYaml-BzMFDsYe.cjs +1 -0
  81. package/dist/packem_shared/readYamlSync-BbK0khJu.cjs +1 -0
  82. package/dist/packem_shared/readYamlSync-md9g88k7.mjs +1 -0
  83. package/dist/packem_shared/remove-CtnFqEpd.mjs +1 -0
  84. package/dist/packem_shared/remove-DPCf2Qdb.cjs +1 -0
  85. package/dist/packem_shared/removeSync-Cyriz7r8.cjs +1 -0
  86. package/dist/packem_shared/removeSync-DI-IjqVp.mjs +1 -0
  87. package/dist/packem_shared/resolve-symlink-target-BofZSDIc.mjs +1 -0
  88. package/dist/packem_shared/resolve-symlink-target-zilkQ_AU.cjs +1 -0
  89. package/dist/packem_shared/stripJsonComments-Cp5SNAB7.mjs +1 -0
  90. package/dist/packem_shared/stripJsonComments-CvZSDnYT.cjs +1 -0
  91. package/dist/packem_shared/to-uint-8-array-2-3EvGd7.cjs +1 -0
  92. package/dist/packem_shared/to-uint-8-array-DwgaTasY.mjs +1 -0
  93. package/dist/packem_shared/walk-BZTXbT87.mjs +1 -0
  94. package/dist/packem_shared/walk-DyN_HVFW.cjs +1 -0
  95. package/dist/packem_shared/walk-include-C9pVST87.mjs +1 -0
  96. package/dist/packem_shared/walk-include-DkK-WJl4.cjs +1 -0
  97. package/dist/packem_shared/walkSync-BHlEzV_m.mjs +1 -0
  98. package/dist/packem_shared/walkSync-Bqi7L2yG.cjs +1 -0
  99. package/dist/packem_shared/writeFile-COOAkvOE.mjs +1 -0
  100. package/dist/packem_shared/writeFile-CjgQEfur.cjs +1 -0
  101. package/dist/packem_shared/writeFileSync-CQuRHo9n.cjs +1 -0
  102. package/dist/packem_shared/writeFileSync-rhu-y_zx.mjs +1 -0
  103. package/dist/packem_shared/writeJson-BYT4WInm.mjs +4 -0
  104. package/dist/packem_shared/writeJson-CJIciZ_Q.cjs +4 -0
  105. package/dist/packem_shared/writeJsonSync-BIsrhRbV.cjs +4 -0
  106. package/dist/packem_shared/writeJsonSync-CLlXOFDm.mjs +4 -0
  107. package/dist/packem_shared/writeYaml-CjzVd0K-.mjs +1 -0
  108. package/dist/packem_shared/writeYaml-VmX1VKhN.cjs +1 -0
  109. package/dist/packem_shared/writeYamlSync-D9A9Ixe1.mjs +1 -0
  110. package/dist/packem_shared/writeYamlSync-DYsM6XBi.cjs +1 -0
  111. package/dist/size.cjs +1 -118
  112. package/dist/size.mjs +1 -109
  113. package/dist/utils.cjs +1 -19
  114. package/dist/utils.mjs +1 -6
  115. package/dist/yaml.cjs +1 -15
  116. package/dist/yaml.mjs +1 -4
  117. package/package.json +1 -1
  118. package/dist/packem_shared/AlreadyExistsError-DpxtwQot.cjs +0 -34
  119. package/dist/packem_shared/AlreadyExistsError-GK7J9fVA.mjs +0 -32
  120. package/dist/packem_shared/DirectoryError-D8FHcAqu.cjs +0 -34
  121. package/dist/packem_shared/DirectoryError-DByTWE7t.mjs +0 -32
  122. package/dist/packem_shared/F_OK-CWSqQIdF.cjs +0 -17
  123. package/dist/packem_shared/F_OK-JER1LjUr.mjs +0 -8
  124. package/dist/packem_shared/JSONError-5-wHnrxX.cjs +0 -34
  125. package/dist/packem_shared/JSONError-CaKt7MhC.mjs +0 -32
  126. package/dist/packem_shared/NotEmptyError-BCS_5pPt.cjs +0 -34
  127. package/dist/packem_shared/NotEmptyError-DCXooh5l.mjs +0 -32
  128. package/dist/packem_shared/NotFoundError-B_1nPl3K.cjs +0 -34
  129. package/dist/packem_shared/NotFoundError-CUdcC61I.mjs +0 -32
  130. package/dist/packem_shared/PermissionError-CqGMI9qC.mjs +0 -32
  131. package/dist/packem_shared/PermissionError-QFMKgk2l.cjs +0 -34
  132. package/dist/packem_shared/WalkError-B4-yr8Kk.cjs +0 -31
  133. package/dist/packem_shared/WalkError-DvEBTTaj.mjs +0 -29
  134. package/dist/packem_shared/assertValidFileContents-CRVvyM6b.cjs +0 -11
  135. package/dist/packem_shared/assertValidFileContents-Ox-ScfeK.mjs +0 -9
  136. package/dist/packem_shared/assertValidFileOrDirectoryPath-BMbgA-eI.cjs +0 -11
  137. package/dist/packem_shared/assertValidFileOrDirectoryPath-BWWgA1wj.mjs +0 -9
  138. package/dist/packem_shared/collect-3Paj1Vqw.mjs +0 -16
  139. package/dist/packem_shared/collect-DnfQeSOL.cjs +0 -18
  140. package/dist/packem_shared/collectSync-D4vym4QD.cjs +0 -18
  141. package/dist/packem_shared/collectSync-DwJLL8SD.mjs +0 -16
  142. package/dist/packem_shared/emptyDir-DcCfiNcf.cjs +0 -22
  143. package/dist/packem_shared/emptyDir-Dw5xSBox.mjs +0 -20
  144. package/dist/packem_shared/emptyDirSync-BWA4n6TB.cjs +0 -21
  145. package/dist/packem_shared/emptyDirSync-DMAaCiC_.mjs +0 -19
  146. package/dist/packem_shared/ensureDir-BOfUZlxG.cjs +0 -35
  147. package/dist/packem_shared/ensureDir-BnA_fY1A.mjs +0 -33
  148. package/dist/packem_shared/ensureDirSync-DHmWi3CF.cjs +0 -35
  149. package/dist/packem_shared/ensureDirSync-Dm4az3YF.mjs +0 -33
  150. package/dist/packem_shared/ensureFile-BKrJMHfr.mjs +0 -27
  151. package/dist/packem_shared/ensureFile-CeGryLJI.cjs +0 -29
  152. package/dist/packem_shared/ensureFileSync-B7THM1sN.cjs +0 -29
  153. package/dist/packem_shared/ensureFileSync-BnhFBXaR.mjs +0 -27
  154. package/dist/packem_shared/ensureLink-ChsWDTK5.mjs +0 -34
  155. package/dist/packem_shared/ensureLink-CrxLNmHE.cjs +0 -36
  156. package/dist/packem_shared/ensureLinkSync-CG-DTUoV.mjs +0 -34
  157. package/dist/packem_shared/ensureLinkSync-D8uMqLh4.cjs +0 -36
  158. package/dist/packem_shared/ensureSymlink-BwJ_QhzJ.mjs +0 -52
  159. package/dist/packem_shared/ensureSymlink-D_ieOVYa.cjs +0 -54
  160. package/dist/packem_shared/ensureSymlinkSync-BamG29QK.mjs +0 -56
  161. package/dist/packem_shared/ensureSymlinkSync-DTMvUYZD.cjs +0 -58
  162. package/dist/packem_shared/findUp-D5W-MTpT.mjs +0 -63
  163. package/dist/packem_shared/findUp-DVIYN2wV.cjs +0 -65
  164. package/dist/packem_shared/findUpSync-BOiVyUOx.cjs +0 -65
  165. package/dist/packem_shared/findUpSync-DL3NPCYg.mjs +0 -63
  166. package/dist/packem_shared/get-file-info-type-BlryFnpp.cjs +0 -18
  167. package/dist/packem_shared/get-file-info-type-ButUVD6d.mjs +0 -16
  168. package/dist/packem_shared/index-BVZL6YMm.cjs +0 -110
  169. package/dist/packem_shared/index-r9Pk9gBe.mjs +0 -108
  170. package/dist/packem_shared/is-stats-identical-BfdEfO6i.cjs +0 -7
  171. package/dist/packem_shared/is-stats-identical-ByTYZ2Aw.mjs +0 -5
  172. package/dist/packem_shared/isAccessible-Bonsm1Ez.mjs +0 -20
  173. package/dist/packem_shared/isAccessible-ZNVGsSb7.cjs +0 -22
  174. package/dist/packem_shared/isAccessibleSync-3gnUWUwX.mjs +0 -20
  175. package/dist/packem_shared/isAccessibleSync-VWjQa-US.cjs +0 -22
  176. package/dist/packem_shared/move-DgF7Ul9L.mjs +0 -114
  177. package/dist/packem_shared/move-Dh925GL9.cjs +0 -121
  178. package/dist/packem_shared/parseJson-BA7Xrggq.mjs +0 -248
  179. package/dist/packem_shared/parseJson-LgPGI5ic.cjs +0 -250
  180. package/dist/packem_shared/readFile-b7UBVv17.mjs +0 -46
  181. package/dist/packem_shared/readFile-iFUhZHnh.cjs +0 -48
  182. package/dist/packem_shared/readFileSync-B3NTOR-W.cjs +0 -33
  183. package/dist/packem_shared/readFileSync-CkEJBqZB.mjs +0 -31
  184. package/dist/packem_shared/readJson-CEBHyuYq.cjs +0 -27
  185. package/dist/packem_shared/readJson-Ce9b06cu.mjs +0 -25
  186. package/dist/packem_shared/readJsonSync-B22hej0y.cjs +0 -27
  187. package/dist/packem_shared/readJsonSync-CkUI9_z5.mjs +0 -25
  188. package/dist/packem_shared/readYaml-C5MSs2GE.mjs +0 -13
  189. package/dist/packem_shared/readYaml-sR4bqUel.cjs +0 -15
  190. package/dist/packem_shared/readYamlSync-C3oOzxiN.cjs +0 -15
  191. package/dist/packem_shared/readYamlSync-CPjA-DLv.mjs +0 -13
  192. package/dist/packem_shared/remove-B2nxUObP.mjs +0 -18
  193. package/dist/packem_shared/remove-BpDiVPns.cjs +0 -20
  194. package/dist/packem_shared/removeSync-BosXW624.cjs +0 -20
  195. package/dist/packem_shared/removeSync-C87yepDI.mjs +0 -18
  196. package/dist/packem_shared/resolve-symlink-target-BbpEHdU2.mjs +0 -18
  197. package/dist/packem_shared/resolve-symlink-target-DImIddt6.cjs +0 -20
  198. package/dist/packem_shared/stripJsonComments-B66nRaTZ.mjs +0 -21
  199. package/dist/packem_shared/stripJsonComments-eDrcJvBT.cjs +0 -23
  200. package/dist/packem_shared/to-uint-8-array-B4CjMOD3.mjs +0 -21
  201. package/dist/packem_shared/to-uint-8-array-BaTEyX3D.cjs +0 -23
  202. package/dist/packem_shared/walk-CI3ygmrw.cjs +0 -100
  203. package/dist/packem_shared/walk-D7YA43g8.mjs +0 -98
  204. package/dist/packem_shared/walk-include-CMUSRa86.mjs +0 -20
  205. package/dist/packem_shared/walk-include-yUdRrF16.cjs +0 -23
  206. package/dist/packem_shared/walkSync-DLTsnwuJ.mjs +0 -103
  207. package/dist/packem_shared/walkSync-oXkmn9ZA.cjs +0 -105
  208. package/dist/packem_shared/writeFile-BZ4JBQxc.mjs +0 -58
  209. package/dist/packem_shared/writeFile-DgCFRCe5.cjs +0 -60
  210. package/dist/packem_shared/writeFileSync-Ctw5pNQH.mjs +0 -58
  211. package/dist/packem_shared/writeFileSync-DzXhx1pF.cjs +0 -60
  212. package/dist/packem_shared/writeJson-Bh4sU1Ly.cjs +0 -33
  213. package/dist/packem_shared/writeJson-axO_14yL.mjs +0 -31
  214. package/dist/packem_shared/writeJsonSync-CzngmuKb.mjs +0 -31
  215. package/dist/packem_shared/writeJsonSync-HFdHjunl.cjs +0 -33
  216. package/dist/packem_shared/writeYaml-3XQT2qtb.cjs +0 -29
  217. package/dist/packem_shared/writeYaml-BSFEuWp2.mjs +0 -27
  218. package/dist/packem_shared/writeYamlSync-B6VcXXIb.mjs +0 -27
  219. package/dist/packem_shared/writeYamlSync-BZR3If9v.cjs +0 -29
@@ -0,0 +1 @@
1
+ "use strict";var b=Object.defineProperty;var t=(e,r)=>b(e,"name",{value:r,configurable:!0});const g=require("node:fs"),c=require("node:zlib"),q=require("@visulima/path/utils"),y=require("./F_OK-7T91O6Oz.cjs"),s=require("./PermissionError-Ck1Es7al.cjs"),a=require("./isAccessibleSync-BP5N8k_-.cjs"),p=require("./assertValidFileOrDirectoryPath-HOUs73Jk.cjs");var S=Object.defineProperty,l=t((e,r)=>S(e,"name",{value:r,configurable:!0}),"n");const h={brotli:c.brotliDecompressSync,gzip:c.unzipSync,none:l(e=>e,"none")},m=l((e,r)=>{if(p(e),e=q.toPath(e),!a(e))throw new s(`unable to read the non-accessible file: ${e}`);if(!a(e,y.R_OK))throw new s(`invalid access to read file at: ${e}`);const{buffer:u,compression:d,encoding:i,flag:n}=r??{},f=g.readFileSync(e,n?{encoding:i,flag:n}:{encoding:i}),o=h[d??"none"](f);return u?o:o.toString()},"readFileSync");module.exports=m;
@@ -0,0 +1 @@
1
+ var i=Object.defineProperty;var t=(e,o)=>i(e,"name",{value:o,configurable:!0});import{toPath as d}from"@visulima/path/utils";import u from"./parseJson-BEnYqLIc.mjs";import m from"./readFile-Cix_ijtX.mjs";var p=Object.defineProperty,s=t((e,o)=>p(e,"name",{value:o,configurable:!0}),"i");async function l(e,o,n){typeof o=="object"&&(n=o,o=void 0);const c=await m(e,{buffer:!0,encoding:void 0});let r=new TextDecoder().decode(c);const{beforeParse:a,color:f}=n??{};return typeof a=="function"&&(r=a(r)),u(r,o,d(e),{color:f})}t(l,"c");s(l,"readJson");export{l as default};
@@ -0,0 +1 @@
1
+ "use strict";var u=Object.defineProperty;var t=(r,e)=>u(r,"name",{value:e,configurable:!0});const d=require("@visulima/path/utils"),f=require("./parseJson-CQlz8sBs.cjs"),l=require("./readFile-BvefDyr_.cjs");var b=Object.defineProperty,p=t((r,e)=>b(r,"name",{value:e,configurable:!0}),"i");async function i(r,e,n){typeof e=="object"&&(n=e,e=void 0);const a=await l(r,{buffer:!0,encoding:void 0});let o=new TextDecoder().decode(a);const{beforeParse:c,color:s}=n??{};return typeof c=="function"&&(o=c(o)),f(o,e,d.toPath(r),{color:s})}t(i,"c");p(i,"readJson");module.exports=i;
@@ -0,0 +1 @@
1
+ var i=Object.defineProperty;var t=(e,o)=>i(e,"name",{value:o,configurable:!0});import{toPath as d}from"@visulima/path/utils";import u from"./parseJson-BEnYqLIc.mjs";import m from"./readFileSync-B0O-8BH0.mjs";var p=Object.defineProperty,l=t((e,o)=>p(e,"name",{value:o,configurable:!0}),"r");function s(e,o,c){typeof o=="object"&&(c=o,o=void 0);const f=m(e,{buffer:!0,encoding:void 0});let r=new TextDecoder().decode(f);const{beforeParse:n,color:a}=c??{};return typeof n=="function"&&(r=n(r)),u(r,o,d(e),{color:a})}t(s,"c");l(s,"readJsonSync");export{s as default};
@@ -0,0 +1 @@
1
+ "use strict";var a=Object.defineProperty;var t=(r,e)=>a(r,"name",{value:e,configurable:!0});const d=require("@visulima/path/utils"),f=require("./parseJson-CQlz8sBs.cjs"),l=require("./readFileSync-Ct8Ql4Vs.cjs");var b=Object.defineProperty,p=t((r,e)=>b(r,"name",{value:e,configurable:!0}),"r");function i(r,e,c){typeof e=="object"&&(c=e,e=void 0);const u=l(r,{buffer:!0,encoding:void 0});let o=new TextDecoder().decode(u);const{beforeParse:n,color:s}=c??{};return typeof n=="function"&&(o=n(o)),f(o,e,d.toPath(r),{color:s})}t(i,"c");p(i,"readJsonSync");module.exports=i;
@@ -0,0 +1 @@
1
+ var p=Object.defineProperty;var o=(r,e)=>p(r,"name",{value:e,configurable:!0});import{parse as n}from"yaml";import s from"./readFile-Cix_ijtX.mjs";var l=Object.defineProperty,d=o((r,e)=>l(r,"name",{value:e,configurable:!0}),"e");async function g(r,e,t){const{buffer:i,compression:c,encoding:u="utf8",flag:m,...a}=t??{},f=await s(r,{buffer:i,compression:c,encoding:u,flag:m});return typeof e=="function"?n(f,e,a):n(f,a)}o(g,"d");d(g,"readYaml");export{g as default};
@@ -0,0 +1 @@
1
+ "use strict";var p=Object.defineProperty;var a=(r,e)=>p(r,"name",{value:e,configurable:!0});const i=require("yaml"),d=require("./readFile-BvefDyr_.cjs");var m=Object.defineProperty,g=a((r,e)=>m(r,"name",{value:e,configurable:!0}),"e");async function o(r,e,s){const{buffer:c,compression:f,encoding:u="utf8",flag:l,...n}=s??{},t=await d(r,{buffer:c,compression:f,encoding:u,flag:l});return typeof e=="function"?i.parse(t,e,n):i.parse(t,n)}a(o,"d");g(o,"readYaml");module.exports=o;
@@ -0,0 +1 @@
1
+ "use strict";var p=Object.defineProperty;var n=(r,e)=>p(r,"name",{value:e,configurable:!0});const a=require("yaml"),d=require("./readFileSync-Ct8Ql4Vs.cjs");var m=Object.defineProperty,g=n((r,e)=>m(r,"name",{value:e,configurable:!0}),"i");function c(r,e,i){const{buffer:f,compression:s,encoding:u="utf8",flag:l,...o}=i??{},t=d(r,{buffer:f,compression:s,encoding:u,flag:l});return typeof e=="function"?a.parse(t,e,o):a.parse(t,o)}n(c,"d");g(c,"readYamlSync");module.exports=c;
@@ -0,0 +1 @@
1
+ var p=Object.defineProperty;var o=(r,e)=>p(r,"name",{value:e,configurable:!0});import{parse as t}from"yaml";import s from"./readFileSync-B0O-8BH0.mjs";var l=Object.defineProperty,d=o((r,e)=>l(r,"name",{value:e,configurable:!0}),"i");function g(r,e,a){const{buffer:i,compression:c,encoding:u="utf8",flag:m,...f}=a??{},n=s(r,{buffer:i,compression:c,encoding:u,flag:m});return typeof e=="function"?t(n,e,f):t(n,f)}o(g,"d");d(g,"readYamlSync");export{g as default};
@@ -0,0 +1 @@
1
+ var a=Object.defineProperty;var t=(e,r)=>a(e,"name",{value:r,configurable:!0});import{unlink as i,rm as c}from"node:fs/promises";import m from"./assertValidFileOrDirectoryPath-DgPIPmZT.mjs";var o=Object.defineProperty,u=t((e,r)=>o(e,"name",{value:r,configurable:!0}),"t");const f=u(async(e,r={})=>{m(e);try{await i(e)}catch{}try{await c(e,{force:!0,maxRetries:r?.maxRetries,recursive:!0,retryDelay:r?.retryDelay})}catch{}},"remove");export{f as default};
@@ -0,0 +1 @@
1
+ "use strict";var i=Object.defineProperty;var t=(e,r)=>i(e,"name",{value:r,configurable:!0});const a=require("node:fs/promises"),c=require("./assertValidFileOrDirectoryPath-HOUs73Jk.cjs");var s=Object.defineProperty,u=t((e,r)=>s(e,"name",{value:r,configurable:!0}),"t");const o=u(async(e,r={})=>{c(e);try{await a.unlink(e)}catch{}try{await a.rm(e,{force:!0,maxRetries:r?.maxRetries,recursive:!0,retryDelay:r?.retryDelay})}catch{}},"remove");module.exports=o;
@@ -0,0 +1 @@
1
+ "use strict";var a=Object.defineProperty;var t=(e,r)=>a(e,"name",{value:r,configurable:!0});const c=require("node:fs"),i=require("./assertValidFileOrDirectoryPath-HOUs73Jk.cjs");var y=Object.defineProperty,n=t((e,r)=>y(e,"name",{value:r,configurable:!0}),"t");const s=n((e,r={})=>{i(e);try{c.unlinkSync(e)}catch{}try{c.rmSync(e,{force:!0,maxRetries:r?.maxRetries,recursive:!0,retryDelay:r?.retryDelay})}catch{}},"removeSync");module.exports=s;
@@ -0,0 +1 @@
1
+ var a=Object.defineProperty;var t=(e,r)=>a(e,"name",{value:r,configurable:!0});import{unlinkSync as c,rmSync as y}from"node:fs";import m from"./assertValidFileOrDirectoryPath-DgPIPmZT.mjs";var o=Object.defineProperty,n=t((e,r)=>o(e,"name",{value:r,configurable:!0}),"t");const l=n((e,r={})=>{m(e);try{c(e)}catch{}try{y(e,{force:!0,maxRetries:r?.maxRetries,recursive:!0,retryDelay:r?.retryDelay})}catch{}},"removeSync");export{l as default};
@@ -0,0 +1 @@
1
+ var i=Object.defineProperty;var o=(e,t)=>i(e,"name",{value:t,configurable:!0});import{resolve as r,dirname as a}from"@visulima/path";var n=Object.defineProperty,s=o((e,t)=>n(e,"name",{value:t,configurable:!0}),"i");const m=s((e,t)=>typeof e!="string"?e:e.startsWith("./")?r(e):typeof t=="string"?r(a(t),e):new URL(e,t),"resolveSymlinkTarget");export{m as o};
@@ -0,0 +1 @@
1
+ "use strict";var s=Object.defineProperty;var o=(e,t)=>s(e,"name",{value:t,configurable:!0});const r=require("@visulima/path");var i=Object.defineProperty,a=o((e,t)=>i(e,"name",{value:t,configurable:!0}),"i");const n=a((e,t)=>typeof e!="string"?e:e.startsWith("./")?r.resolve(e):typeof t=="string"?r.resolve(r.dirname(t),e):new URL(e,t),"resolveSymlinkTarget");exports.o=n;
@@ -0,0 +1 @@
1
+ var s=Object.defineProperty;var r=(e,t)=>s(e,"name",{value:t,configurable:!0});import{INTERNAL_STRIP_JSON_REGEX as o}from"./F_OK-B71i3mUa.mjs";var n=Object.defineProperty,i=r((e,t)=>n(e,"name",{value:t,configurable:!0}),"s");const c=i((e,{whitespace:t=!0}={})=>e.replace(o,a=>a.startsWith('"')||a[1]==="*"&&!a.endsWith("*/")?a:t?a.replaceAll(/\S/g," "):""),"stripJsonComments");export{c as default};
@@ -0,0 +1 @@
1
+ "use strict";var a=Object.defineProperty;var r=(e,t)=>a(e,"name",{value:t,configurable:!0});const n=require("./F_OK-7T91O6Oz.cjs");var c=Object.defineProperty,i=r((e,t)=>c(e,"name",{value:t,configurable:!0}),"s");const o=i((e,{whitespace:t=!0}={})=>e.replace(n.INTERNAL_STRIP_JSON_REGEX,s=>s.startsWith('"')||s[1]==="*"&&!s.endsWith("*/")?s:t?s.replaceAll(/\S/g," "):""),"stripJsonComments");module.exports=o;
@@ -0,0 +1 @@
1
+ "use strict";var n=Object.defineProperty;var r=(e,t)=>n(e,"name",{value:t,configurable:!0});var f=Object.defineProperty,i=r((e,t)=>f(e,"name",{value:t,configurable:!0}),"f");const a=new TextEncoder,y=i(e=>{if(e instanceof Uint8Array)return e;if(typeof e=="string")return a.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e)){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")},"toUint8Array");exports.a=y;
@@ -0,0 +1 @@
1
+ var n=Object.defineProperty;var r=(e,t)=>n(e,"name",{value:t,configurable:!0});var f=Object.defineProperty,i=r((e,t)=>f(e,"name",{value:t,configurable:!0}),"f");const a=new TextEncoder,y=i(e=>{if(e instanceof Uint8Array)return e;if(typeof e=="string")return a.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e)){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")},"toUint8Array");export{y as a};
@@ -0,0 +1 @@
1
+ var D=Object.defineProperty;var y=(e,r)=>D(e,"name",{value:r,configurable:!0});import{readdir as F,realpath as h,stat as w}from"node:fs/promises";import{resolve as L,join as v,normalize as x,basename as I}from"@visulima/path";import{toPath as g}from"@visulima/path/utils";import k from"./WalkError-BsngoIKJ.mjs";import N from"./assertValidFileOrDirectoryPath-DgPIPmZT.mjs";import{c as S,a as m}from"./walk-include-C9pVST87.mjs";var O=Object.defineProperty,s=y((e,r)=>O(e,"name",{value:r,configurable:!0}),"r");const P=s(async e=>{const r=x(e),l=I(r),t=await w(r);return{isDirectory:s(()=>t.isDirectory(),"isDirectory"),isFile:s(()=>t.isFile(),"isFile"),isSymbolicLink:s(()=>t.isSymbolicLink(),"isSymbolicLink"),name:l,path:r}},"_createWalkEntry");async function*b(e,{extensions:r,followSymlinks:l=!1,includeDirs:t=!0,includeFiles:f=!0,includeSymlinks:p=!0,match:d,maxDepth:c=Number.POSITIVE_INFINITY,skip:u}={}){if(N(e),c<0)return;const a=d?d.map(i=>typeof i=="string"?S(i):i):void 0,n=u?u.map(i=>typeof i=="string"?S(i):i):void 0;if(e=L(g(e)),t&&m(e,r,a,n)&&(yield await P(e)),!(c<1||!m(e,void 0,void 0,n)))try{for await(const i of await F(e,{withFileTypes:!0})){let o=v(e,i.name);if(i.isSymbolicLink())if(l)o=await h(o);else if(p&&m(o,r,a,n))yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:o};else continue;i.isSymbolicLink()||i.isDirectory()?yield*b(o,{extensions:r,followSymlinks:l,includeDirs:t,includeFiles:f,includeSymlinks:p,match:a,maxDepth:c-1,skip:n}):i.isFile()&&f&&m(o,r,a,n)&&(yield{isDirectory:s(()=>i.isDirectory(),"isDirectory"),isFile:s(()=>i.isFile(),"isFile"),isSymbolicLink:s(()=>i.isSymbolicLink(),"isSymbolicLink"),name:i.name,path:o})}}catch(i){throw i instanceof k?i:new k(i,e)}}y(b,"d");s(b,"walk");export{b as default};
@@ -0,0 +1 @@
1
+ "use strict";var D=Object.defineProperty;var u=(e,r)=>D(e,"name",{value:r,configurable:!0});const d=require("node:fs/promises"),y=require("@visulima/path"),F=require("@visulima/path/utils"),h=require("./WalkError-gKgp0TWD.cjs"),w=require("./assertValidFileOrDirectoryPath-HOUs73Jk.cjs"),n=require("./walk-include-DkK-WJl4.cjs");var L=Object.defineProperty,s=u((e,r)=>L(e,"name",{value:r,configurable:!0}),"r");const v=s(async e=>{const r=y.normalize(e),o=y.basename(r),a=await d.stat(r);return{isDirectory:s(()=>a.isDirectory(),"isDirectory"),isFile:s(()=>a.isFile(),"isFile"),isSymbolicLink:s(()=>a.isSymbolicLink(),"isSymbolicLink"),name:o,path:r}},"_createWalkEntry");async function*k(e,{extensions:r,followSymlinks:o=!1,includeDirs:a=!0,includeFiles:p=!0,includeSymlinks:S=!0,match:b,maxDepth:m=Number.POSITIVE_INFINITY,skip:f}={}){if(w(e),m<0)return;const c=b?b.map(i=>typeof i=="string"?n.c(i):i):void 0,t=f?f.map(i=>typeof i=="string"?n.c(i):i):void 0;if(e=y.resolve(F.toPath(e)),a&&n.a(e,r,c,t)&&(yield await v(e)),!(m<1||!n.a(e,void 0,void 0,t)))try{for await(const i of await d.readdir(e,{withFileTypes:!0})){let l=y.join(e,i.name);if(i.isSymbolicLink())if(o)l=await d.realpath(l);else if(S&&n.a(l,r,c,t))yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:l};else continue;i.isSymbolicLink()||i.isDirectory()?yield*k(l,{extensions:r,followSymlinks:o,includeDirs:a,includeFiles:p,includeSymlinks:S,match:c,maxDepth:m-1,skip:t}):i.isFile()&&p&&n.a(l,r,c,t)&&(yield{isDirectory:s(()=>i.isDirectory(),"isDirectory"),isFile:s(()=>i.isFile(),"isFile"),isSymbolicLink:s(()=>i.isSymbolicLink(),"isSymbolicLink"),name:i.name,path:l})}}catch(i){throw i instanceof h?i:new h(i,e)}}u(k,"d");s(k,"walk");module.exports=k;
@@ -0,0 +1 @@
1
+ var g=Object.defineProperty;var c=(e,r)=>g(e,"name",{value:r,configurable:!0});var n=Object.defineProperty,p=c((e,r)=>n(e,"name",{value:r,configurable:!0}),"r");const i=p(e=>{const r=e.replace(/\.\*/g,".([^/]*)").replace(/\*\*/g,"(.*)").replace(/(?<!\.)\*(?!\*)/g,"([^/]*)").replace(/\?/g,"[^/]").replace(/\.(?!\*)/g,"\\.").replace(/\{/g,"(").replace(/\}/g,")").replace(/,/g,"|").replace(/\[!(.*?)\]/g,"[^$1]");return new RegExp(`^${r}$`)},"globToRegExp");var o=Object.defineProperty,s=c((e,r)=>o(e,"name",{value:r,configurable:!0}),"n");const v=s((e,r,l,t)=>Array.isArray(r)&&r.length>0&&!r.some(a=>e.endsWith(a))||l&&!l.some(a=>a.test(e))?!1:!t?.some(a=>a.test(e)),"walkInclude");export{v as a,i as c};
@@ -0,0 +1 @@
1
+ "use strict";var g=Object.defineProperty;var c=(e,r)=>g(e,"name",{value:r,configurable:!0});var n=Object.defineProperty,p=c((e,r)=>n(e,"name",{value:r,configurable:!0}),"r");const s=p(e=>{const r=e.replace(/\.\*/g,".([^/]*)").replace(/\*\*/g,"(.*)").replace(/(?<!\.)\*(?!\*)/g,"([^/]*)").replace(/\?/g,"[^/]").replace(/\.(?!\*)/g,"\\.").replace(/\{/g,"(").replace(/\}/g,")").replace(/,/g,"|").replace(/\[!(.*?)\]/g,"[^$1]");return new RegExp(`^${r}$`)},"globToRegExp");var o=Object.defineProperty,u=c((e,r)=>o(e,"name",{value:r,configurable:!0}),"n");const i=u((e,r,t,l)=>Array.isArray(r)&&r.length>0&&!r.some(a=>e.endsWith(a))||t&&!t.some(a=>a.test(e))?!1:!l?.some(a=>a.test(e)),"walkInclude");exports.a=i;exports.c=s;
@@ -0,0 +1 @@
1
+ var D=Object.defineProperty;var c=(e,r)=>D(e,"name",{value:r,configurable:!0});import{readdirSync as F,realpathSync as v,statSync as L}from"node:fs";import{resolve as w,join as x,normalize as a,basename as I}from"@visulima/path";import{toPath as g}from"@visulima/path/utils";import S from"./WalkError-BsngoIKJ.mjs";import N from"./assertValidFileOrDirectoryPath-DgPIPmZT.mjs";import{c as k,a as l}from"./walk-include-C9pVST87.mjs";var O=Object.defineProperty,h=c((e,r)=>O(e,"name",{value:r,configurable:!0}),"m");const P=h(e=>{const r=a(e),n=L(r);return{isDirectory:n.isDirectory,isFile:n.isFile,isSymbolicLink:n.isSymbolicLink,name:I(r),path:r}},"_createWalkEntry");function*b(e,{extensions:r,followSymlinks:n=!1,includeDirs:y=!0,includeFiles:f=!0,includeSymlinks:p=!0,match:d,maxDepth:m=Number.POSITIVE_INFINITY,skip:u}={}){if(N(e),m<0)return;const s=d?d.map(i=>typeof i=="string"?k(i):i):void 0,t=u?u.map(i=>typeof i=="string"?k(i):i):void 0;if(e=w(g(e)),y&&l(e,r,s,t)&&(yield P(e)),!(m<1||!l(e,void 0,void 0,t)))try{for(const i of F(e,{withFileTypes:!0})){let o=x(e,i.name);if(i.isSymbolicLink())if(n)o=v(o);else if(p&&l(o,r,s,t))yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:a(o)};else continue;i.isSymbolicLink()||i.isDirectory()?yield*b(o,{extensions:r,followSymlinks:n,includeDirs:y,includeFiles:f,includeSymlinks:p,match:s,maxDepth:m-1,skip:t}):i.isFile()&&f&&l(o,r,s,t)&&(yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:a(o)})}}catch(i){throw i instanceof S?i:new S(i,e)}}c(b,"h");h(b,"walkSync");export{b as default};
@@ -0,0 +1 @@
1
+ "use strict";var D=Object.defineProperty;var y=(e,r)=>D(e,"name",{value:r,configurable:!0});const m=require("node:fs"),l=require("@visulima/path"),F=require("@visulima/path/utils"),p=require("./WalkError-gKgp0TWD.cjs"),v=require("./assertValidFileOrDirectoryPath-HOUs73Jk.cjs"),t=require("./walk-include-DkK-WJl4.cjs");var L=Object.defineProperty,b=y((e,r)=>L(e,"name",{value:r,configurable:!0}),"m");const w=b(e=>{const r=l.normalize(e),s=m.statSync(r);return{isDirectory:s.isDirectory,isFile:s.isFile,isSymbolicLink:s.isSymbolicLink,name:l.basename(r),path:r}},"_createWalkEntry");function*u(e,{extensions:r,followSymlinks:s=!1,includeDirs:d=!0,includeFiles:f=!0,includeSymlinks:k=!0,match:S,maxDepth:c=Number.POSITIVE_INFINITY,skip:h}={}){if(v(e),c<0)return;const a=S?S.map(i=>typeof i=="string"?t.c(i):i):void 0,o=h?h.map(i=>typeof i=="string"?t.c(i):i):void 0;if(e=l.resolve(F.toPath(e)),d&&t.a(e,r,a,o)&&(yield w(e)),!(c<1||!t.a(e,void 0,void 0,o)))try{for(const i of m.readdirSync(e,{withFileTypes:!0})){let n=l.join(e,i.name);if(i.isSymbolicLink())if(s)n=m.realpathSync(n);else if(k&&t.a(n,r,a,o))yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:l.normalize(n)};else continue;i.isSymbolicLink()||i.isDirectory()?yield*u(n,{extensions:r,followSymlinks:s,includeDirs:d,includeFiles:f,includeSymlinks:k,match:a,maxDepth:c-1,skip:o}):i.isFile()&&f&&t.a(n,r,a,o)&&(yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:l.normalize(n)})}}catch(i){throw i instanceof p?i:new p(i,e)}}y(u,"h");b(u,"walkSync");module.exports=u;
@@ -0,0 +1 @@
1
+ var f=Object.defineProperty;var c=(t,i)=>f(t,"name",{value:i,configurable:!0});import{mkdir as u,writeFile as s,stat as l,rename as w,chown as h,chmod as p,unlink as g}from"node:fs/promises";import{dirname as v}from"@visulima/path";import{toPath as $}from"@visulima/path/utils";import{F_OK as d}from"./F_OK-B71i3mUa.mjs";import m from"./isAccessible-CL4eE5VL.mjs";import y from"./assertValidFileContents-BZFnXa7K.mjs";import F from"./assertValidFileOrDirectoryPath-DgPIPmZT.mjs";import{a as b}from"./to-uint-8-array-DwgaTasY.mjs";var k=Object.defineProperty,O=c((t,i)=>k(t,"name",{value:i,configurable:!0}),"d");const B=O(async(t,i,a)=>{a={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...a},F(t),y(i),t=$(t);const o=`${t}.tmp`;try{const r=await m(t,d);if(!r&&a.recursive){const n=v(t);await m(n,d)||await u(n,{recursive:!0})}let e;if(await s(o,b(i),{encoding:a.encoding,flag:a.flag}),r&&!a.overwrite&&(e=await l(t),a.chown===void 0&&(a.chown={gid:e.gid,uid:e.uid}),await w(t,`${t}.bak`)),a.chown)try{await h(o,a.chown.uid,a.chown.gid)}catch{}await p(o,e&&!a.mode?e.mode:a.mode??438),await w(o,t)}catch(r){throw new Error(`Failed to write file at: ${t} - ${r.message}`,{cause:r})}finally{await m(o)&&await g(`${t}.tmp`)}},"writeFile");export{B as default};
@@ -0,0 +1 @@
1
+ "use strict";var d=Object.defineProperty;var u=(i,a)=>d(i,"name",{value:a,configurable:!0});const t=require("node:fs/promises"),l=require("@visulima/path"),h=require("@visulima/path/utils"),w=require("./F_OK-7T91O6Oz.cjs"),c=require("./isAccessible-BQZd1_xn.cjs"),m=require("./assertValidFileContents-CrbDz09d.cjs"),f=require("./assertValidFileOrDirectoryPath-HOUs73Jk.cjs"),g=require("./to-uint-8-array-2-3EvGd7.cjs");var v=Object.defineProperty,q=u((i,a)=>v(i,"name",{value:a,configurable:!0}),"d");const F=q(async(i,a,e)=>{e={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...e},f(i),m(a),i=h.toPath(i);const r=`${i}.tmp`;try{const n=await c(i,w.F_OK);if(!n&&e.recursive){const s=l.dirname(i);await c(s,w.F_OK)||await t.mkdir(s,{recursive:!0})}let o;if(await t.writeFile(r,g.a(a),{encoding:e.encoding,flag:e.flag}),n&&!e.overwrite&&(o=await t.stat(i),e.chown===void 0&&(e.chown={gid:o.gid,uid:o.uid}),await t.rename(i,`${i}.bak`)),e.chown)try{await t.chown(r,e.chown.uid,e.chown.gid)}catch{}await t.chmod(r,o&&!e.mode?o.mode:e.mode??438),await t.rename(r,i)}catch(n){throw new Error(`Failed to write file at: ${i} - ${n.message}`,{cause:n})}finally{await c(r)&&await t.unlink(`${i}.tmp`)}},"writeFile");module.exports=F;
@@ -0,0 +1 @@
1
+ "use strict";var l=Object.defineProperty;var u=(e,t)=>l(e,"name",{value:t,configurable:!0});const r=require("node:fs"),y=require("@visulima/path"),h=require("@visulima/path/utils"),d=require("./F_OK-7T91O6Oz.cjs"),a=require("./isAccessibleSync-BP5N8k_-.cjs"),w=require("./assertValidFileContents-CrbDz09d.cjs"),f=require("./assertValidFileOrDirectoryPath-HOUs73Jk.cjs"),m=require("./to-uint-8-array-2-3EvGd7.cjs");var g=Object.defineProperty,S=u((e,t)=>g(e,"name",{value:t,configurable:!0}),"f");const v=S((e,t,i)=>{i={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...i},f(e),w(t),e=h.toPath(e);const c=`${e}.tmp`;try{const n=a(e,d.F_OK);if(!n&&i.recursive){const s=y.dirname(e);a(s,d.F_OK)||r.mkdirSync(s,{recursive:!0})}let o;if(r.writeFileSync(c,m.a(t),{encoding:i.encoding,flag:i.flag}),n&&!i.overwrite&&(o=r.statSync(e),i.chown===void 0&&(i.chown={gid:o.gid,uid:o.uid}),r.renameSync(e,`${e}.bak`)),i.chown)try{r.chownSync(c,i.chown.uid,i.chown.gid)}catch{}r.chmodSync(c,o&&!i.mode?o.mode:i.mode??438),r.renameSync(c,e)}catch(n){throw new Error(`Failed to write file at: ${e} - ${n.message}`,{cause:n})}finally{a(c)&&r.unlinkSync(`${e}.tmp`)}},"writeFileSync");module.exports=v;
@@ -0,0 +1 @@
1
+ var u=Object.defineProperty;var a=(o,i)=>u(o,"name",{value:i,configurable:!0});import{mkdirSync as l,writeFileSync as s,statSync as w,renameSync as f,chownSync as h,chmodSync as p,unlinkSync as y}from"node:fs";import{dirname as g}from"@visulima/path";import{toPath as v}from"@visulima/path/utils";import{F_OK as d}from"./F_OK-B71i3mUa.mjs";import n from"./isAccessibleSync-_HU_ppdG.mjs";import S from"./assertValidFileContents-BZFnXa7K.mjs";import $ from"./assertValidFileOrDirectoryPath-DgPIPmZT.mjs";import{a as F}from"./to-uint-8-array-DwgaTasY.mjs";var b=Object.defineProperty,k=a((o,i)=>b(o,"name",{value:i,configurable:!0}),"f");const A=k((o,i,t)=>{t={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...t},$(o),S(i),o=v(o);const r=`${o}.tmp`;try{const c=n(o,d);if(!c&&t.recursive){const m=g(o);n(m,d)||l(m,{recursive:!0})}let e;if(s(r,F(i),{encoding:t.encoding,flag:t.flag}),c&&!t.overwrite&&(e=w(o),t.chown===void 0&&(t.chown={gid:e.gid,uid:e.uid}),f(o,`${o}.bak`)),t.chown)try{h(r,t.chown.uid,t.chown.gid)}catch{}p(r,e&&!t.mode?e.mode:t.mode??438),f(r,o)}catch(c){throw new Error(`Failed to write file at: ${o} - ${c.message}`,{cause:c})}finally{n(r)&&y(`${o}.tmp`)}},"writeFileSync");export{A as default};
@@ -0,0 +1,4 @@
1
+ var l=Object.defineProperty;var o=(t,r)=>l(t,"name",{value:r,configurable:!0});import{readFile as u}from"node:fs/promises";import{w as y}from"./index-BSjF-5vj.mjs";import{R_OK as h}from"./F_OK-B71i3mUa.mjs";import O from"./isAccessible-CL4eE5VL.mjs";import $ from"./writeFile-COOAkvOE.mjs";var g=Object.defineProperty,v=o((t,r)=>g(t,"name",{value:r,configurable:!0}),"r");const F=v(async(t,r,a={})=>{const{detectIndent:f,indent:c,replacer:m,stringify:s=JSON.stringify,...d}={indent:" ",...a};let i=c,n=`
2
+ `;if(await O(t,h))try{const e=await u(t,"utf8");if(f){const{indent:w}=y(e);i=w}n=e.endsWith(`
3
+ `)?`
4
+ `:""}catch(e){if(e.code!=="ENOENT")throw e}const p=s(r,m,i);await $(t,`${p}${n}`,d)},"writeJson");export{F as default};
@@ -0,0 +1,4 @@
1
+ "use strict";var p=Object.defineProperty;var s=(e,i)=>p(e,"name",{value:i,configurable:!0});const q=require("node:fs/promises"),y=require("./index-DPla58ce.cjs"),O=require("./F_OK-7T91O6Oz.cjs"),b=require("./isAccessible-BQZd1_xn.cjs"),g=require("./writeFile-CjgQEfur.cjs");var h=Object.defineProperty,m=s((e,i)=>h(e,"name",{value:i,configurable:!0}),"r");const v=m(async(e,i,c={})=>{const{detectIndent:a,indent:o,replacer:d,stringify:u=JSON.stringify,...f}={indent:" ",...c};let t=o,n=`
2
+ `;if(await b(e,O.R_OK))try{const r=await q.readFile(e,"utf8");if(a){const{indent:w}=y.w(r);t=w}n=r.endsWith(`
3
+ `)?`
4
+ `:""}catch(r){if(r.code!=="ENOENT")throw r}const l=u(i,d,t);await g(e,`${l}${n}`,f)},"writeJson");module.exports=v;
@@ -0,0 +1,4 @@
1
+ "use strict";var O=Object.defineProperty;var c=(e,t)=>O(e,"name",{value:t,configurable:!0});const q=require("node:fs"),S=require("./index-DPla58ce.cjs"),p=require("./F_OK-7T91O6Oz.cjs"),w=require("./isAccessibleSync-BP5N8k_-.cjs"),N=require("./writeFileSync-CQuRHo9n.cjs");var b=Object.defineProperty,g=c((e,t)=>b(e,"name",{value:t,configurable:!0}),"r");const h=g((e,t,s={})=>{const{detectIndent:o,indent:d,replacer:f,stringify:u=JSON.stringify,...y}={indent:" ",...s};let i=d,n=`
2
+ `;if(w(e,p.R_OK))try{const r=q.readFileSync(e,"utf8");if(o){const{indent:l}=S.w(r);i=l}n=r.endsWith(`
3
+ `)?`
4
+ `:""}catch(r){if(r.code!=="ENOENT")throw r}const a=u(t,f,i);N(e,`${a}${n}`,y)},"writeJsonSync");module.exports=h;
@@ -0,0 +1,4 @@
1
+ var y=Object.defineProperty;var n=(t,r)=>y(t,"name",{value:r,configurable:!0});import{readFileSync as u}from"node:fs";import{w as O}from"./index-BSjF-5vj.mjs";import{R_OK as h}from"./F_OK-B71i3mUa.mjs";import N from"./isAccessibleSync-_HU_ppdG.mjs";import g from"./writeFileSync-rhu-y_zx.mjs";var v=Object.defineProperty,w=n((t,r)=>v(t,"name",{value:r,configurable:!0}),"r");const x=w((t,r,c={})=>{const{detectIndent:f,indent:m,replacer:d,stringify:a=JSON.stringify,...s}={indent:" ",...c};let o=m,i=`
2
+ `;if(N(t,h))try{const e=u(t,"utf8");if(f){const{indent:l}=O(e);o=l}i=e.endsWith(`
3
+ `)?`
4
+ `:""}catch(e){if(e.code!=="ENOENT")throw e}const p=a(r,d,o);g(t,`${p}${i}`,s)},"writeJsonSync");export{x as default};
@@ -0,0 +1 @@
1
+ var p=Object.defineProperty;var f=(a,t)=>p(a,"name",{value:t,configurable:!0});import{stringify as l}from"yaml";import y from"./writeFile-COOAkvOE.mjs";var u=Object.defineProperty,m=f((a,t)=>u(a,"name",{value:t,configurable:!0}),"l");async function s(a,t,r,o){let e,n,i;typeof r=="object"&&r!==null&&!Array.isArray(r)&&typeof r!="function"?(e=r,n=e.replacer,i=e.space):typeof o=="object"&&o!==null?(e=o,n=r,i=e.space??(typeof o=="number"||typeof o=="string"?o:void 0)):(n=r,i=o);const c=l(t,n,i??e);await y(a,c,e)}f(s,"c");m(s,"writeYaml");export{s as default};
@@ -0,0 +1 @@
1
+ "use strict";var u=Object.defineProperty;var c=(t,a)=>u(t,"name",{value:a,configurable:!0});const y=require("yaml"),f=require("./writeFile-CjgQEfur.cjs");var p=Object.defineProperty,b=c((t,a)=>p(t,"name",{value:a,configurable:!0}),"l");async function l(t,a,e,r){let i,n,o;typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e!="function"?(i=e,n=i.replacer,o=i.space):typeof r=="object"&&r!==null?(i=r,n=e,o=i.space??(typeof r=="number"||typeof r=="string"?r:void 0)):(n=e,o=r);const s=y.stringify(a,n,o??i);await f(t,s,i)}c(l,"c");b(l,"writeYaml");module.exports=l;
@@ -0,0 +1 @@
1
+ var p=Object.defineProperty;var i=(n,t)=>p(n,"name",{value:t,configurable:!0});import{stringify as l}from"yaml";import y from"./writeFileSync-rhu-y_zx.mjs";var u=Object.defineProperty,m=i((n,t)=>u(n,"name",{value:t,configurable:!0}),"s");function s(n,t,r,o){let e,a,f;typeof r=="object"&&r!==null&&!Array.isArray(r)&&typeof r!="function"?(e=r,a=e.replacer,f=e.space):typeof o=="object"&&o!==null?(e=o,a=r,f=e.space??(typeof o=="number"||typeof o=="string"?o:void 0)):(a=r,f=o);const c=l(t,a,f??e);y(n,c,e)}i(s,"c");m(s,"writeYamlSync");export{s as default};
@@ -0,0 +1 @@
1
+ "use strict";var s=Object.defineProperty;var a=(i,o)=>s(i,"name",{value:o,configurable:!0});const u=require("yaml"),f=require("./writeFileSync-CQuRHo9n.cjs");var p=Object.defineProperty,b=a((i,o)=>p(i,"name",{value:o,configurable:!0}),"s");function y(i,o,e,r){let n,t,c;typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e!="function"?(n=e,t=n.replacer,c=n.space):typeof r=="object"&&r!==null?(n=r,t=e,c=n.space??(typeof r=="number"||typeof r=="string"?r:void 0)):(t=e,c=r);const l=u.stringify(o,t,c??n);f(i,l,n)}a(y,"c");b(y,"writeYamlSync");module.exports=y;
package/dist/size.cjs CHANGED
@@ -1,118 +1 @@
1
- 'use strict';
2
-
3
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
-
5
- const node_fs = require('node:fs');
6
- const promises = require('node:fs/promises');
7
- const node_path = require('node:path');
8
- const node_stream = require('node:stream');
9
- const node_url = require('node:url');
10
- const node_zlib = require('node:zlib');
11
- const utils = require('@visulima/path/utils');
12
-
13
- var __defProp = Object.defineProperty;
14
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
15
- const fileExists = /* @__PURE__ */ __name((input) => {
16
- if (node_path.isAbsolute(input)) {
17
- return node_fs.existsSync(input);
18
- }
19
- try {
20
- return node_fs.existsSync(node_path.resolve(input));
21
- } catch {
22
- return false;
23
- }
24
- }, "fileExists");
25
- const getStreamSizeEfficient = /* @__PURE__ */ __name(async (stream) => {
26
- let totalSize = 0;
27
- for await (const chunk of stream) {
28
- totalSize += Buffer.from(chunk).length;
29
- }
30
- return totalSize;
31
- }, "getStreamSizeEfficient");
32
- const getCompressedStreamSizeEfficient = /* @__PURE__ */ __name(async (stream, createCompressor) => {
33
- let totalSize = 0;
34
- const compressor = createCompressor();
35
- return await new Promise((resolve2, reject) => {
36
- compressor.on("data", (chunk) => {
37
- totalSize += chunk.length;
38
- });
39
- compressor.on("end", () => resolve2(totalSize));
40
- compressor.on("error", reject);
41
- stream.on("error", reject);
42
- stream.pipe(compressor);
43
- });
44
- }, "getCompressedStreamSizeEfficient");
45
- const processInputEfficiently = /* @__PURE__ */ __name(async (input, processor, streamProcessor) => {
46
- if (input instanceof node_url.URL || typeof input === "string") {
47
- const path = utils.toPath(input);
48
- if (fileExists(path)) {
49
- const fileStream = node_stream.Readable.from(await promises.readFile(path));
50
- return await streamProcessor(fileStream);
51
- }
52
- if (typeof input === "string") {
53
- return processor(Buffer.from(input));
54
- }
55
- }
56
- if (input instanceof node_stream.Readable) {
57
- return await streamProcessor(input);
58
- }
59
- return processor(input);
60
- }, "processInputEfficiently");
61
- const gzipSize = /* @__PURE__ */ __name(async (input, options) => {
62
- const streamProcessor = /* @__PURE__ */ __name(async (stream) => await getCompressedStreamSizeEfficient(stream, () => node_zlib.createGzip(options)), "streamProcessor");
63
- const bufferProcessor = /* @__PURE__ */ __name((data) => node_zlib.gzipSync(data, options).length, "bufferProcessor");
64
- return await processInputEfficiently(input, bufferProcessor, streamProcessor);
65
- }, "gzipSize");
66
- const brotliSize = /* @__PURE__ */ __name(async (input, options) => {
67
- const streamProcessor = /* @__PURE__ */ __name(async (stream) => await getCompressedStreamSizeEfficient(stream, () => node_zlib.createBrotliCompress(options)), "streamProcessor");
68
- const bufferProcessor = /* @__PURE__ */ __name((data) => node_zlib.brotliCompressSync(data, options).length, "bufferProcessor");
69
- return await processInputEfficiently(input, bufferProcessor, streamProcessor);
70
- }, "brotliSize");
71
- const rawSize = /* @__PURE__ */ __name(async (input) => {
72
- const streamProcessor = /* @__PURE__ */ __name(async (stream) => await getStreamSizeEfficient(stream), "streamProcessor");
73
- const bufferProcessor = /* @__PURE__ */ __name((data) => data.length, "bufferProcessor");
74
- return await processInputEfficiently(input, bufferProcessor, streamProcessor);
75
- }, "rawSize");
76
- const gzipSizeSync = /* @__PURE__ */ __name((input, options) => {
77
- if (input instanceof node_url.URL || typeof input === "string") {
78
- const path = utils.toPath(input);
79
- if (fileExists(path)) {
80
- return node_zlib.gzipSync(node_fs.readFileSync(path), options).length;
81
- }
82
- if (typeof input === "string") {
83
- return node_zlib.gzipSync(Buffer.from(input), options).length;
84
- }
85
- }
86
- return node_zlib.gzipSync(input, options).length;
87
- }, "gzipSizeSync");
88
- const brotliSizeSync = /* @__PURE__ */ __name((input, options) => {
89
- if (input instanceof node_url.URL || typeof input === "string") {
90
- const path = utils.toPath(input);
91
- if (fileExists(path)) {
92
- return node_zlib.brotliCompressSync(node_fs.readFileSync(path), options).length;
93
- }
94
- if (typeof input === "string") {
95
- return node_zlib.brotliCompressSync(Buffer.from(input), options).length;
96
- }
97
- }
98
- return node_zlib.brotliCompressSync(input, options).length;
99
- }, "brotliSizeSync");
100
- const rawSizeSync = /* @__PURE__ */ __name((input) => {
101
- if (input instanceof node_url.URL || typeof input === "string") {
102
- const path = utils.toPath(input);
103
- if (fileExists(path)) {
104
- return node_fs.statSync(path).size;
105
- }
106
- if (typeof input === "string") {
107
- return Buffer.from(input).length;
108
- }
109
- }
110
- return input.length;
111
- }, "rawSizeSync");
112
-
113
- exports.brotliSize = brotliSize;
114
- exports.brotliSizeSync = brotliSizeSync;
115
- exports.gzipSize = gzipSize;
116
- exports.gzipSizeSync = gzipSizeSync;
117
- exports.rawSize = rawSize;
118
- exports.rawSizeSync = rawSizeSync;
1
+ "use strict";var b=Object.defineProperty;var y=(e,t)=>b(e,"name",{value:t,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("node:fs"),h=require("node:fs/promises"),g=require("node:path"),p=require("node:stream"),a=require("node:url"),n=require("node:zlib"),c=require("@visulima/path/utils");var w=Object.defineProperty,i=y((e,t)=>w(e,"name",{value:t,configurable:!0}),"t");const f=i(e=>{if(g.isAbsolute(e))return s.existsSync(e);try{return s.existsSync(g.resolve(e))}catch{return!1}},"fileExists"),d=i(async e=>{let t=0;for await(const r of e)t+=Buffer.from(r).length;return t},"getStreamSizeEfficient"),z=i(async(e,t)=>{let r=0;const o=t();return await new Promise((l,u)=>{o.on("data",m=>{r+=m.length}),o.on("end",()=>l(r)),o.on("error",u),e.on("error",u),e.pipe(o)})},"getCompressedStreamSizeEfficient"),S=i(async(e,t,r)=>{if(e instanceof a.URL||typeof e=="string"){const o=c.toPath(e);if(f(o)){const l=p.Readable.from(await h.readFile(o));return await r(l)}if(typeof e=="string")return t(Buffer.from(e))}return e instanceof p.Readable?await r(e):t(e)},"processInputEfficiently"),P=i(async(e,t)=>await S(e,i(r=>n.gzipSync(r,t).length,"bufferProcessor"),i(async r=>await z(r,()=>n.createGzip(t)),"streamProcessor")),"gzipSize"),q=i(async(e,t)=>await S(e,i(r=>n.brotliCompressSync(r,t).length,"bufferProcessor"),i(async r=>await z(r,()=>n.createBrotliCompress(t)),"streamProcessor")),"brotliSize"),B=i(async e=>await S(e,i(t=>t.length,"bufferProcessor"),i(async t=>await d(t),"streamProcessor")),"rawSize"),_=i((e,t)=>{if(e instanceof a.URL||typeof e=="string"){const r=c.toPath(e);if(f(r))return n.gzipSync(s.readFileSync(r),t).length;if(typeof e=="string")return n.gzipSync(Buffer.from(e),t).length}return n.gzipSync(e,t).length},"gzipSizeSync"),v=i((e,t)=>{if(e instanceof a.URL||typeof e=="string"){const r=c.toPath(e);if(f(r))return n.brotliCompressSync(s.readFileSync(r),t).length;if(typeof e=="string")return n.brotliCompressSync(Buffer.from(e),t).length}return n.brotliCompressSync(e,t).length},"brotliSizeSync"),C=i(e=>{if(e instanceof a.URL||typeof e=="string"){const t=c.toPath(e);if(f(t))return s.statSync(t).size;if(typeof e=="string")return Buffer.from(e).length}return e.length},"rawSizeSync");exports.brotliSize=q;exports.brotliSizeSync=v;exports.gzipSize=P;exports.gzipSizeSync=_;exports.rawSize=B;exports.rawSizeSync=C;
package/dist/size.mjs CHANGED
@@ -1,109 +1 @@
1
- import { readFileSync, statSync, existsSync } from 'node:fs';
2
- import { readFile } from 'node:fs/promises';
3
- import { isAbsolute, resolve } from 'node:path';
4
- import { Readable } from 'node:stream';
5
- import { URL } from 'node:url';
6
- import { createBrotliCompress, brotliCompressSync, gzipSync, createGzip } from 'node:zlib';
7
- import { toPath } from '@visulima/path/utils';
8
-
9
- var __defProp = Object.defineProperty;
10
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
11
- const fileExists = /* @__PURE__ */ __name((input) => {
12
- if (isAbsolute(input)) {
13
- return existsSync(input);
14
- }
15
- try {
16
- return existsSync(resolve(input));
17
- } catch {
18
- return false;
19
- }
20
- }, "fileExists");
21
- const getStreamSizeEfficient = /* @__PURE__ */ __name(async (stream) => {
22
- let totalSize = 0;
23
- for await (const chunk of stream) {
24
- totalSize += Buffer.from(chunk).length;
25
- }
26
- return totalSize;
27
- }, "getStreamSizeEfficient");
28
- const getCompressedStreamSizeEfficient = /* @__PURE__ */ __name(async (stream, createCompressor) => {
29
- let totalSize = 0;
30
- const compressor = createCompressor();
31
- return await new Promise((resolve2, reject) => {
32
- compressor.on("data", (chunk) => {
33
- totalSize += chunk.length;
34
- });
35
- compressor.on("end", () => resolve2(totalSize));
36
- compressor.on("error", reject);
37
- stream.on("error", reject);
38
- stream.pipe(compressor);
39
- });
40
- }, "getCompressedStreamSizeEfficient");
41
- const processInputEfficiently = /* @__PURE__ */ __name(async (input, processor, streamProcessor) => {
42
- if (input instanceof URL || typeof input === "string") {
43
- const path = toPath(input);
44
- if (fileExists(path)) {
45
- const fileStream = Readable.from(await readFile(path));
46
- return await streamProcessor(fileStream);
47
- }
48
- if (typeof input === "string") {
49
- return processor(Buffer.from(input));
50
- }
51
- }
52
- if (input instanceof Readable) {
53
- return await streamProcessor(input);
54
- }
55
- return processor(input);
56
- }, "processInputEfficiently");
57
- const gzipSize = /* @__PURE__ */ __name(async (input, options) => {
58
- const streamProcessor = /* @__PURE__ */ __name(async (stream) => await getCompressedStreamSizeEfficient(stream, () => createGzip(options)), "streamProcessor");
59
- const bufferProcessor = /* @__PURE__ */ __name((data) => gzipSync(data, options).length, "bufferProcessor");
60
- return await processInputEfficiently(input, bufferProcessor, streamProcessor);
61
- }, "gzipSize");
62
- const brotliSize = /* @__PURE__ */ __name(async (input, options) => {
63
- const streamProcessor = /* @__PURE__ */ __name(async (stream) => await getCompressedStreamSizeEfficient(stream, () => createBrotliCompress(options)), "streamProcessor");
64
- const bufferProcessor = /* @__PURE__ */ __name((data) => brotliCompressSync(data, options).length, "bufferProcessor");
65
- return await processInputEfficiently(input, bufferProcessor, streamProcessor);
66
- }, "brotliSize");
67
- const rawSize = /* @__PURE__ */ __name(async (input) => {
68
- const streamProcessor = /* @__PURE__ */ __name(async (stream) => await getStreamSizeEfficient(stream), "streamProcessor");
69
- const bufferProcessor = /* @__PURE__ */ __name((data) => data.length, "bufferProcessor");
70
- return await processInputEfficiently(input, bufferProcessor, streamProcessor);
71
- }, "rawSize");
72
- const gzipSizeSync = /* @__PURE__ */ __name((input, options) => {
73
- if (input instanceof URL || typeof input === "string") {
74
- const path = toPath(input);
75
- if (fileExists(path)) {
76
- return gzipSync(readFileSync(path), options).length;
77
- }
78
- if (typeof input === "string") {
79
- return gzipSync(Buffer.from(input), options).length;
80
- }
81
- }
82
- return gzipSync(input, options).length;
83
- }, "gzipSizeSync");
84
- const brotliSizeSync = /* @__PURE__ */ __name((input, options) => {
85
- if (input instanceof URL || typeof input === "string") {
86
- const path = toPath(input);
87
- if (fileExists(path)) {
88
- return brotliCompressSync(readFileSync(path), options).length;
89
- }
90
- if (typeof input === "string") {
91
- return brotliCompressSync(Buffer.from(input), options).length;
92
- }
93
- }
94
- return brotliCompressSync(input, options).length;
95
- }, "brotliSizeSync");
96
- const rawSizeSync = /* @__PURE__ */ __name((input) => {
97
- if (input instanceof URL || typeof input === "string") {
98
- const path = toPath(input);
99
- if (fileExists(path)) {
100
- return statSync(path).size;
101
- }
102
- if (typeof input === "string") {
103
- return Buffer.from(input).length;
104
- }
105
- }
106
- return input.length;
107
- }, "rawSizeSync");
108
-
109
- export { brotliSize, brotliSizeSync, gzipSize, gzipSizeSync, rawSize, rawSizeSync };
1
+ var h=Object.defineProperty;var p=(e,t)=>h(e,"name",{value:t,configurable:!0});import{readFileSync as S,statSync as b,existsSync as u}from"node:fs";import{readFile as P}from"node:fs/promises";import{isAbsolute as d,resolve as B}from"node:path";import{Readable as g}from"node:stream";import{URL as s}from"node:url";import{gzipSync as o,createGzip as v,brotliCompressSync as f,createBrotliCompress as x}from"node:zlib";import{toPath as a}from"@visulima/path/utils";var E=Object.defineProperty,n=p((e,t)=>E(e,"name",{value:t,configurable:!0}),"t");const c=n(e=>{if(d(e))return u(e);try{return u(B(e))}catch{return!1}},"fileExists"),C=n(async e=>{let t=0;for await(const r of e)t+=Buffer.from(r).length;return t},"getStreamSizeEfficient"),z=n(async(e,t)=>{let r=0;const i=t();return await new Promise((l,y)=>{i.on("data",w=>{r+=w.length}),i.on("end",()=>l(r)),i.on("error",y),e.on("error",y),e.pipe(i)})},"getCompressedStreamSizeEfficient"),m=n(async(e,t,r)=>{if(e instanceof s||typeof e=="string"){const i=a(e);if(c(i)){const l=g.from(await P(i));return await r(l)}if(typeof e=="string")return t(Buffer.from(e))}return e instanceof g?await r(e):t(e)},"processInputEfficiently"),U=n(async(e,t)=>await m(e,n(r=>o(r,t).length,"bufferProcessor"),n(async r=>await z(r,()=>v(t)),"streamProcessor")),"gzipSize"),k=n(async(e,t)=>await m(e,n(r=>f(r,t).length,"bufferProcessor"),n(async r=>await z(r,()=>x(t)),"streamProcessor")),"brotliSize"),q=n(async e=>await m(e,n(t=>t.length,"bufferProcessor"),n(async t=>await C(t),"streamProcessor")),"rawSize"),D=n((e,t)=>{if(e instanceof s||typeof e=="string"){const r=a(e);if(c(r))return o(S(r),t).length;if(typeof e=="string")return o(Buffer.from(e),t).length}return o(e,t).length},"gzipSizeSync"),H=n((e,t)=>{if(e instanceof s||typeof e=="string"){const r=a(e);if(c(r))return f(S(r),t).length;if(typeof e=="string")return f(Buffer.from(e),t).length}return f(e,t).length},"brotliSizeSync"),J=n(e=>{if(e instanceof s||typeof e=="string"){const t=a(e);if(c(t))return b(t).size;if(typeof e=="string")return Buffer.from(e).length}return e.length},"rawSizeSync");export{k as brotliSize,H as brotliSizeSync,U as gzipSize,D as gzipSizeSync,q as rawSize,J as rawSizeSync};
package/dist/utils.cjs CHANGED
@@ -1,19 +1 @@
1
- 'use strict';
2
-
3
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
-
5
- const JSONError = require('./packem_shared/JSONError-5-wHnrxX.cjs');
6
- const assertValidFileContents = require('./packem_shared/assertValidFileContents-CRVvyM6b.cjs');
7
- const assertValidFileOrDirectoryPath = require('./packem_shared/assertValidFileOrDirectoryPath-BMbgA-eI.cjs');
8
- const parseJson = require('./packem_shared/parseJson-LgPGI5ic.cjs');
9
- const stripJsonComments = require('./packem_shared/stripJsonComments-eDrcJvBT.cjs');
10
- const utils = require('@visulima/path/utils');
11
-
12
-
13
-
14
- exports.JSONError = JSONError;
15
- exports.assertValidFileContents = assertValidFileContents;
16
- exports.assertValidFileOrDirectoryPath = assertValidFileOrDirectoryPath;
17
- exports.parseJson = parseJson;
18
- exports.stripJsonComments = stripJsonComments;
19
- exports.toPath = utils.toPath;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./packem_shared/JSONError-CWuiGmNc.cjs"),r=require("./packem_shared/assertValidFileContents-CrbDz09d.cjs"),t=require("./packem_shared/assertValidFileOrDirectoryPath-HOUs73Jk.cjs"),s=require("./packem_shared/parseJson-CQlz8sBs.cjs"),i=require("./packem_shared/stripJsonComments-CvZSDnYT.cjs"),o=require("@visulima/path/utils");exports.JSONError=e;exports.assertValidFileContents=r;exports.assertValidFileOrDirectoryPath=t;exports.parseJson=s;exports.stripJsonComments=i;exports.toPath=o.toPath;
package/dist/utils.mjs CHANGED
@@ -1,6 +1 @@
1
- export { default as JSONError } from './packem_shared/JSONError-CaKt7MhC.mjs';
2
- export { default as assertValidFileContents } from './packem_shared/assertValidFileContents-Ox-ScfeK.mjs';
3
- export { default as assertValidFileOrDirectoryPath } from './packem_shared/assertValidFileOrDirectoryPath-BWWgA1wj.mjs';
4
- export { default as parseJson } from './packem_shared/parseJson-BA7Xrggq.mjs';
5
- export { default as stripJsonComments } from './packem_shared/stripJsonComments-B66nRaTZ.mjs';
6
- export { toPath } from '@visulima/path/utils';
1
+ import{default as e}from"./packem_shared/JSONError-CVkb3xZ3.mjs";import{default as a}from"./packem_shared/assertValidFileContents-BZFnXa7K.mjs";import{default as f}from"./packem_shared/assertValidFileOrDirectoryPath-DgPIPmZT.mjs";import{default as m}from"./packem_shared/parseJson-BEnYqLIc.mjs";import{default as d}from"./packem_shared/stripJsonComments-Cp5SNAB7.mjs";import{toPath as x}from"@visulima/path/utils";export{e as JSONError,a as assertValidFileContents,f as assertValidFileOrDirectoryPath,m as parseJson,d as stripJsonComments,x as toPath};
package/dist/yaml.cjs CHANGED
@@ -1,15 +1 @@
1
- 'use strict';
2
-
3
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
-
5
- const readYaml = require('./packem_shared/readYaml-sR4bqUel.cjs');
6
- const readYamlSync = require('./packem_shared/readYamlSync-C3oOzxiN.cjs');
7
- const writeYaml = require('./packem_shared/writeYaml-3XQT2qtb.cjs');
8
- const writeYamlSync = require('./packem_shared/writeYamlSync-BZR3If9v.cjs');
9
-
10
-
11
-
12
- exports.readYaml = readYaml;
13
- exports.readYamlSync = readYamlSync;
14
- exports.writeYaml = writeYaml;
15
- exports.writeYamlSync = writeYamlSync;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./packem_shared/readYaml-BzMFDsYe.cjs"),r=require("./packem_shared/readYamlSync-BbK0khJu.cjs"),a=require("./packem_shared/writeYaml-VmX1VKhN.cjs"),l=require("./packem_shared/writeYamlSync-DYsM6XBi.cjs");exports.readYaml=e;exports.readYamlSync=r;exports.writeYaml=a;exports.writeYamlSync=l;
package/dist/yaml.mjs CHANGED
@@ -1,4 +1 @@
1
- export { default as readYaml } from './packem_shared/readYaml-C5MSs2GE.mjs';
2
- export { default as readYamlSync } from './packem_shared/readYamlSync-CPjA-DLv.mjs';
3
- export { default as writeYaml } from './packem_shared/writeYaml-BSFEuWp2.mjs';
4
- export { default as writeYamlSync } from './packem_shared/writeYamlSync-B6VcXXIb.mjs';
1
+ import{default as r}from"./packem_shared/readYaml-BOYTR5D1.mjs";import{default as f}from"./packem_shared/readYamlSync-md9g88k7.mjs";import{default as m}from"./packem_shared/writeYaml-CjzVd0K-.mjs";import{default as d}from"./packem_shared/writeYamlSync-D9A9Ixe1.mjs";export{r as readYaml,f as readYamlSync,m as writeYaml,d as writeYamlSync};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/fs",
3
- "version": "3.1.7",
3
+ "version": "3.1.9",
4
4
  "description": "Human friendly file system utilities for Node.js",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -1,34 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- class AlreadyExistsError extends Error {
6
- static {
7
- __name(this, "AlreadyExistsError");
8
- }
9
- /**
10
- * Creates a new instance.
11
- * @param {string} message The error message.
12
- */
13
- constructor(message) {
14
- super(`EEXIST: ${message}`);
15
- }
16
- // eslint-disable-next-line class-methods-use-this
17
- get code() {
18
- return "EEXIST";
19
- }
20
- // eslint-disable-next-line class-methods-use-this,@typescript-eslint/explicit-module-boundary-types
21
- set code(_name) {
22
- throw new Error("Cannot overwrite code EEXIST");
23
- }
24
- // eslint-disable-next-line class-methods-use-this
25
- get name() {
26
- return "AlreadyExistsError";
27
- }
28
- // eslint-disable-next-line class-methods-use-this,@typescript-eslint/explicit-module-boundary-types
29
- set name(_name) {
30
- throw new Error("Cannot overwrite name of AlreadyExistsError");
31
- }
32
- }
33
-
34
- module.exports = AlreadyExistsError;
@@ -1,32 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- class AlreadyExistsError extends Error {
4
- static {
5
- __name(this, "AlreadyExistsError");
6
- }
7
- /**
8
- * Creates a new instance.
9
- * @param {string} message The error message.
10
- */
11
- constructor(message) {
12
- super(`EEXIST: ${message}`);
13
- }
14
- // eslint-disable-next-line class-methods-use-this
15
- get code() {
16
- return "EEXIST";
17
- }
18
- // eslint-disable-next-line class-methods-use-this,@typescript-eslint/explicit-module-boundary-types
19
- set code(_name) {
20
- throw new Error("Cannot overwrite code EEXIST");
21
- }
22
- // eslint-disable-next-line class-methods-use-this
23
- get name() {
24
- return "AlreadyExistsError";
25
- }
26
- // eslint-disable-next-line class-methods-use-this,@typescript-eslint/explicit-module-boundary-types
27
- set name(_name) {
28
- throw new Error("Cannot overwrite name of AlreadyExistsError");
29
- }
30
- }
31
-
32
- export { AlreadyExistsError as default };
@@ -1,34 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- class DirectoryError extends Error {
6
- static {
7
- __name(this, "DirectoryError");
8
- }
9
- /**
10
- * Creates a new instance.
11
- * @param {string} message The error message.
12
- */
13
- constructor(message) {
14
- super(`EISDIR: Illegal operation on a directory, ${message}`);
15
- }
16
- // eslint-disable-next-line class-methods-use-this
17
- get code() {
18
- return "EISDIR";
19
- }
20
- // eslint-disable-next-line class-methods-use-this,@typescript-eslint/explicit-module-boundary-types
21
- set code(_name) {
22
- throw new Error("Cannot overwrite code EISDIR");
23
- }
24
- // eslint-disable-next-line class-methods-use-this
25
- get name() {
26
- return "DirectoryError";
27
- }
28
- // eslint-disable-next-line class-methods-use-this,@typescript-eslint/explicit-module-boundary-types
29
- set name(_name) {
30
- throw new Error("Cannot overwrite name of DirectoryError");
31
- }
32
- }
33
-
34
- module.exports = DirectoryError;