@visulima/fs 2.3.5 → 2.3.7

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 (217) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +318 -362
  3. package/dist/error.cjs +21 -1
  4. package/dist/error.mjs +7 -1
  5. package/dist/index.cjs +88 -1
  6. package/dist/index.mjs +35 -1
  7. package/dist/packem_shared/AlreadyExistsError-DpxtwQot.cjs +34 -0
  8. package/dist/packem_shared/AlreadyExistsError-GK7J9fVA.mjs +32 -0
  9. package/dist/packem_shared/DirectoryError-D8FHcAqu.cjs +34 -0
  10. package/dist/packem_shared/DirectoryError-DByTWE7t.mjs +32 -0
  11. package/dist/packem_shared/F_OK-CWSqQIdF.cjs +17 -0
  12. package/dist/packem_shared/F_OK-JER1LjUr.mjs +8 -0
  13. package/dist/packem_shared/JSONError-BCIIHvzq.mjs +28 -0
  14. package/dist/packem_shared/JSONError-gkXvBSar.cjs +30 -0
  15. package/dist/packem_shared/LF-CU3KsvZC.mjs +20 -0
  16. package/dist/packem_shared/LF-bB2qO80j.cjs +28 -0
  17. package/dist/packem_shared/NotEmptyError-BCS_5pPt.cjs +34 -0
  18. package/dist/packem_shared/NotEmptyError-DCXooh5l.mjs +32 -0
  19. package/dist/packem_shared/NotFoundError-B_1nPl3K.cjs +34 -0
  20. package/dist/packem_shared/NotFoundError-CUdcC61I.mjs +32 -0
  21. package/dist/packem_shared/PermissionError-CqGMI9qC.mjs +32 -0
  22. package/dist/packem_shared/PermissionError-QFMKgk2l.cjs +34 -0
  23. package/dist/packem_shared/WalkError-B7_AVs7d.cjs +27 -0
  24. package/dist/packem_shared/WalkError-H9EuRv7O.mjs +25 -0
  25. package/dist/packem_shared/assertValidFileContents-CRVvyM6b.cjs +11 -0
  26. package/dist/packem_shared/assertValidFileContents-Ox-ScfeK.mjs +9 -0
  27. package/dist/packem_shared/assertValidFileOrDirectoryPath-BMbgA-eI.cjs +11 -0
  28. package/dist/packem_shared/assertValidFileOrDirectoryPath-BWWgA1wj.mjs +9 -0
  29. package/dist/packem_shared/collect-BtDVJEOm.mjs +16 -0
  30. package/dist/packem_shared/collect-DxUriHCH.cjs +18 -0
  31. package/dist/packem_shared/collectSync-BaA0s001.cjs +18 -0
  32. package/dist/packem_shared/collectSync-CGjdb50I.mjs +16 -0
  33. package/dist/packem_shared/emptyDir-DcCfiNcf.cjs +22 -0
  34. package/dist/packem_shared/emptyDir-Dw5xSBox.mjs +20 -0
  35. package/dist/packem_shared/emptyDirSync-BoknkGUe.cjs +21 -0
  36. package/dist/packem_shared/emptyDirSync-DTGPXQ3v.mjs +19 -0
  37. package/dist/packem_shared/ensureDir-XiBlkOLR.mjs +33 -0
  38. package/dist/packem_shared/ensureDir-iUK2ga5M.cjs +35 -0
  39. package/dist/packem_shared/ensureDirSync-2IFUHFK2.mjs +33 -0
  40. package/dist/packem_shared/ensureDirSync-CXdMkg0Y.cjs +35 -0
  41. package/dist/packem_shared/ensureFile-Br8tFUJ7.cjs +29 -0
  42. package/dist/packem_shared/ensureFile-C2bWlBEa.mjs +27 -0
  43. package/dist/packem_shared/ensureFileSync-CZzSkNGC.cjs +29 -0
  44. package/dist/packem_shared/ensureFileSync-DkFfhOEs.mjs +27 -0
  45. package/dist/packem_shared/ensureLink-CFiabAD3.mjs +34 -0
  46. package/dist/packem_shared/ensureLink-Dqw5GBDq.cjs +36 -0
  47. package/dist/packem_shared/ensureLinkSync-BVw3h6sK.cjs +36 -0
  48. package/dist/packem_shared/ensureLinkSync-Dk-YeRg6.mjs +34 -0
  49. package/dist/packem_shared/ensureSymlink-CFSfreco.cjs +54 -0
  50. package/dist/packem_shared/ensureSymlink-CSqngPoI.mjs +52 -0
  51. package/dist/packem_shared/ensureSymlinkSync-BCd9bzsx.cjs +58 -0
  52. package/dist/packem_shared/ensureSymlinkSync-QRaNZX2E.mjs +56 -0
  53. package/dist/packem_shared/findUp-C8_QpAtD.mjs +63 -0
  54. package/dist/packem_shared/findUp-DA511Swp.cjs +65 -0
  55. package/dist/packem_shared/findUpSync-DVOd3V-q.mjs +63 -0
  56. package/dist/packem_shared/findUpSync-u1rGibzw.cjs +65 -0
  57. package/dist/packem_shared/get-file-info-type-BpRzQHvd.cjs +18 -0
  58. package/dist/packem_shared/get-file-info-type-CeiZ6n6g.mjs +16 -0
  59. package/dist/packem_shared/index-ajT9ecry.mjs +108 -0
  60. package/dist/packem_shared/index-ngvEMjBI.cjs +110 -0
  61. package/dist/packem_shared/is-stats-identical-BfdEfO6i.cjs +7 -0
  62. package/dist/packem_shared/is-stats-identical-ByTYZ2Aw.mjs +5 -0
  63. package/dist/packem_shared/isAccessible-Bonsm1Ez.mjs +20 -0
  64. package/dist/packem_shared/isAccessible-ZNVGsSb7.cjs +22 -0
  65. package/dist/packem_shared/isAccessibleSync-3gnUWUwX.mjs +20 -0
  66. package/dist/packem_shared/isAccessibleSync-VWjQa-US.cjs +22 -0
  67. package/dist/packem_shared/move-DgF7Ul9L.mjs +114 -0
  68. package/dist/packem_shared/move-Dh925GL9.cjs +121 -0
  69. package/dist/packem_shared/parseJson-DcUo4Rpt.cjs +251 -0
  70. package/dist/packem_shared/parseJson-n9THWOFI.mjs +249 -0
  71. package/dist/packem_shared/readFile-DUM-xNoB.mjs +46 -0
  72. package/dist/packem_shared/readFile-iFUhZHnh.cjs +48 -0
  73. package/dist/packem_shared/readFileSync-B3NTOR-W.cjs +33 -0
  74. package/dist/packem_shared/readFileSync-Cck96_o0.mjs +31 -0
  75. package/dist/packem_shared/readJson-DIHRleEE.mjs +25 -0
  76. package/dist/packem_shared/readJson-JrCHMN3m.cjs +27 -0
  77. package/dist/packem_shared/readJsonSync-BPfxTuQL.mjs +25 -0
  78. package/dist/packem_shared/readJsonSync-o_MAOlUv.cjs +27 -0
  79. package/dist/packem_shared/readYaml-sR4bqUel.cjs +15 -0
  80. package/dist/packem_shared/readYaml-vVKK8ZzY.mjs +13 -0
  81. package/dist/packem_shared/readYamlSync-C3oOzxiN.cjs +15 -0
  82. package/dist/packem_shared/readYamlSync-MOLH4gXB.mjs +13 -0
  83. package/dist/packem_shared/remove-B2nxUObP.mjs +18 -0
  84. package/dist/packem_shared/remove-BpDiVPns.cjs +20 -0
  85. package/dist/packem_shared/removeSync-BosXW624.cjs +20 -0
  86. package/dist/packem_shared/removeSync-C87yepDI.mjs +18 -0
  87. package/dist/packem_shared/resolve-symlink-target-BbpEHdU2.mjs +18 -0
  88. package/dist/packem_shared/resolve-symlink-target-DImIddt6.cjs +20 -0
  89. package/dist/packem_shared/stripJsonComments-B66nRaTZ.mjs +21 -0
  90. package/dist/packem_shared/stripJsonComments-eDrcJvBT.cjs +23 -0
  91. package/dist/packem_shared/to-uint-8-array-B4CjMOD3.mjs +21 -0
  92. package/dist/packem_shared/to-uint-8-array-BaTEyX3D.cjs +23 -0
  93. package/dist/packem_shared/walk-BW7b4GXI.cjs +106 -0
  94. package/dist/packem_shared/walk-CNcSYQVq.mjs +104 -0
  95. package/dist/packem_shared/walk-include-CMUSRa86.mjs +20 -0
  96. package/dist/packem_shared/walk-include-yUdRrF16.cjs +23 -0
  97. package/dist/packem_shared/walkSync-BzxdFWLU.mjs +103 -0
  98. package/dist/packem_shared/walkSync-DgPj93NL.cjs +105 -0
  99. package/dist/packem_shared/writeFile-B7dhfseN.mjs +58 -0
  100. package/dist/packem_shared/writeFile-DKu5-M8x.cjs +60 -0
  101. package/dist/packem_shared/writeFileSync-Db6pmY0q.cjs +60 -0
  102. package/dist/packem_shared/writeFileSync-mMGYqOc8.mjs +58 -0
  103. package/dist/packem_shared/writeJson-BSQE2uFN.mjs +31 -0
  104. package/dist/packem_shared/writeJson-DtnnjTix.cjs +33 -0
  105. package/dist/packem_shared/writeJsonSync-C_i6LsGT.mjs +31 -0
  106. package/dist/packem_shared/writeJsonSync-Dz5-B2PD.cjs +33 -0
  107. package/dist/packem_shared/writeYaml-B-KoZN0E.cjs +14 -0
  108. package/dist/packem_shared/writeYaml-DSTzKc0_.mjs +12 -0
  109. package/dist/packem_shared/writeYamlSync-D6borSP1.cjs +14 -0
  110. package/dist/packem_shared/writeYamlSync-agxYIea0.mjs +12 -0
  111. package/dist/utils.cjs +19 -1
  112. package/dist/utils.mjs +6 -1
  113. package/package.json +15 -16
  114. package/dist/packem_shared/AlreadyExistsError-CEu6_Tjb.mjs +0 -1
  115. package/dist/packem_shared/AlreadyExistsError-GC2XUgzJ.cjs +0 -1
  116. package/dist/packem_shared/DirectoryError-B8wqer68.cjs +0 -1
  117. package/dist/packem_shared/DirectoryError-ddlbUV8C.mjs +0 -1
  118. package/dist/packem_shared/F_OK-6WAweffB.cjs +0 -1
  119. package/dist/packem_shared/F_OK-B71i3mUa.mjs +0 -1
  120. package/dist/packem_shared/JSONError-CVkb3xZ3.mjs +0 -4
  121. package/dist/packem_shared/JSONError-CWuiGmNc.cjs +0 -4
  122. package/dist/packem_shared/LF-D4BqIfQm.cjs +0 -3
  123. package/dist/packem_shared/LF-Dbx0i6a7.mjs +0 -3
  124. package/dist/packem_shared/NotEmptyError-BWGfec5K.cjs +0 -1
  125. package/dist/packem_shared/NotEmptyError-DMh1o7UL.mjs +0 -1
  126. package/dist/packem_shared/NotFoundError-Diij7oqe.cjs +0 -1
  127. package/dist/packem_shared/NotFoundError-T95YsWYl.mjs +0 -1
  128. package/dist/packem_shared/PermissionError-B8oi38Bx.mjs +0 -1
  129. package/dist/packem_shared/PermissionError-Ck1Es7al.cjs +0 -1
  130. package/dist/packem_shared/WalkError-BsngoIKJ.mjs +0 -1
  131. package/dist/packem_shared/WalkError-gKgp0TWD.cjs +0 -1
  132. package/dist/packem_shared/assertValidFileContents-BLhwm7u2.mjs +0 -1
  133. package/dist/packem_shared/assertValidFileContents-CrbDz09d.cjs +0 -1
  134. package/dist/packem_shared/assertValidFileOrDirectoryPath-DgPIPmZT.mjs +0 -1
  135. package/dist/packem_shared/assertValidFileOrDirectoryPath-HOUs73Jk.cjs +0 -1
  136. package/dist/packem_shared/collect-4au76gDu.cjs +0 -1
  137. package/dist/packem_shared/collect-CRzGiRGg.mjs +0 -1
  138. package/dist/packem_shared/collectSync-BE8DAOke.mjs +0 -1
  139. package/dist/packem_shared/collectSync-CbKwt8rz.cjs +0 -1
  140. package/dist/packem_shared/emptyDir-D2m8OP8u.mjs +0 -1
  141. package/dist/packem_shared/emptyDir-DKxQHQQb.cjs +0 -1
  142. package/dist/packem_shared/emptyDirSync-CLM_zyIb.cjs +0 -1
  143. package/dist/packem_shared/emptyDirSync-CZNcW4wc.mjs +0 -1
  144. package/dist/packem_shared/ensureDir-BtvxsJiS.mjs +0 -1
  145. package/dist/packem_shared/ensureDir-DVHj-_yp.cjs +0 -1
  146. package/dist/packem_shared/ensureDirSync-CvjJ3bGq.cjs +0 -1
  147. package/dist/packem_shared/ensureDirSync-bGe0QB7d.mjs +0 -1
  148. package/dist/packem_shared/ensureFile-C46R6-4l.mjs +0 -1
  149. package/dist/packem_shared/ensureFile-CcJ5XIZm.cjs +0 -1
  150. package/dist/packem_shared/ensureFileSync-CwYTIP4G.mjs +0 -1
  151. package/dist/packem_shared/ensureFileSync-v-PhMLTr.cjs +0 -1
  152. package/dist/packem_shared/ensureLink-63XWiA3I.mjs +0 -1
  153. package/dist/packem_shared/ensureLink-C-v4AxzH.cjs +0 -1
  154. package/dist/packem_shared/ensureLinkSync-C4S-zdVb.cjs +0 -1
  155. package/dist/packem_shared/ensureLinkSync-D2LVObKd.mjs +0 -1
  156. package/dist/packem_shared/ensureSymlink-C5cy9585.cjs +0 -1
  157. package/dist/packem_shared/ensureSymlink-D36fS4KE.mjs +0 -1
  158. package/dist/packem_shared/ensureSymlinkSync-PvWVgeXc.mjs +0 -1
  159. package/dist/packem_shared/ensureSymlinkSync-YDRbg9hX.cjs +0 -1
  160. package/dist/packem_shared/findUp-CMGMYNty.mjs +0 -1
  161. package/dist/packem_shared/findUp-VKPTLmQQ.cjs +0 -1
  162. package/dist/packem_shared/findUpSync-BFwDGxkV.cjs +0 -1
  163. package/dist/packem_shared/findUpSync-QP_ZEsJN.mjs +0 -1
  164. package/dist/packem_shared/get-file-info-type-BXcpoWEM.cjs +0 -1
  165. package/dist/packem_shared/get-file-info-type-CaWGXRjY.mjs +0 -1
  166. package/dist/packem_shared/index-Cms6lU4T.cjs +0 -1
  167. package/dist/packem_shared/index-VcQXVcaq.mjs +0 -1
  168. package/dist/packem_shared/is-stats-identical-CPCumzsC.cjs +0 -1
  169. package/dist/packem_shared/is-stats-identical-CS5Y91zW.mjs +0 -1
  170. package/dist/packem_shared/isAccessible-Be3NKjOk.cjs +0 -1
  171. package/dist/packem_shared/isAccessible-cO53WedI.mjs +0 -1
  172. package/dist/packem_shared/isAccessibleSync-D5Vc2GTD.mjs +0 -1
  173. package/dist/packem_shared/isAccessibleSync-WOSgkAy2.cjs +0 -1
  174. package/dist/packem_shared/move-MZ9F6paN.mjs +0 -1
  175. package/dist/packem_shared/move-j3mzcWrG.cjs +0 -1
  176. package/dist/packem_shared/parseJson-BIYrZWHm.mjs +0 -6
  177. package/dist/packem_shared/parseJson-CXe73j5t.cjs +0 -6
  178. package/dist/packem_shared/readFile-CFus1Rym.mjs +0 -1
  179. package/dist/packem_shared/readFile-fzYtUKuW.cjs +0 -1
  180. package/dist/packem_shared/readFileSync-Dz4jLcWc.cjs +0 -1
  181. package/dist/packem_shared/readFileSync-Ulz6QzOz.mjs +0 -1
  182. package/dist/packem_shared/readJson-C6RN16Rf.mjs +0 -1
  183. package/dist/packem_shared/readJson-D7_CYUJX.cjs +0 -1
  184. package/dist/packem_shared/readJsonSync-QziPGqW_.cjs +0 -1
  185. package/dist/packem_shared/readJsonSync-ztZXpE8z.mjs +0 -1
  186. package/dist/packem_shared/readYaml-C-ui8qXw.cjs +0 -1
  187. package/dist/packem_shared/readYaml-aFHfT-4e.mjs +0 -1
  188. package/dist/packem_shared/readYamlSync-CeJ6RnoJ.mjs +0 -1
  189. package/dist/packem_shared/readYamlSync-DUYMSemC.cjs +0 -1
  190. package/dist/packem_shared/remove-B-9MI2l5.cjs +0 -1
  191. package/dist/packem_shared/remove-DzfvbZOm.mjs +0 -1
  192. package/dist/packem_shared/removeSync-CJPR6M7V.cjs +0 -1
  193. package/dist/packem_shared/removeSync-D165rXSn.mjs +0 -1
  194. package/dist/packem_shared/resolve-symlink-target-BofZSDIc.mjs +0 -1
  195. package/dist/packem_shared/resolve-symlink-target-HnbdXA1S.cjs +0 -1
  196. package/dist/packem_shared/stripJsonComments-CKgR4nW4.mjs +0 -1
  197. package/dist/packem_shared/stripJsonComments-Cw7UCxI3.cjs +0 -1
  198. package/dist/packem_shared/to-uint-8-array-2-3EvGd7.cjs +0 -1
  199. package/dist/packem_shared/to-uint-8-array-DwgaTasY.mjs +0 -1
  200. package/dist/packem_shared/walk-BJgnJy5d.cjs +0 -1
  201. package/dist/packem_shared/walk-DH-95i_B.mjs +0 -1
  202. package/dist/packem_shared/walk-include-B-MbUqMt.mjs +0 -1
  203. package/dist/packem_shared/walk-include-CFIYniQi.cjs +0 -1
  204. package/dist/packem_shared/walkSync-D4zvt_kM.mjs +0 -1
  205. package/dist/packem_shared/walkSync-DYawhxUA.cjs +0 -1
  206. package/dist/packem_shared/writeFile-DaHzc_FW.mjs +0 -1
  207. package/dist/packem_shared/writeFile-WCuWZNRy.cjs +0 -1
  208. package/dist/packem_shared/writeFileSync-D9HGh6J-.mjs +0 -1
  209. package/dist/packem_shared/writeFileSync-Ds49_ORi.cjs +0 -1
  210. package/dist/packem_shared/writeJson-BdjtBy1t.cjs +0 -4
  211. package/dist/packem_shared/writeJson-Bu7Dw4Uu.mjs +0 -4
  212. package/dist/packem_shared/writeJsonSync-7CjNn7oo.mjs +0 -4
  213. package/dist/packem_shared/writeJsonSync-CdC3ahaO.cjs +0 -4
  214. package/dist/packem_shared/writeYaml-COWffUNm.cjs +0 -1
  215. package/dist/packem_shared/writeYaml-bi1dx696.mjs +0 -1
  216. package/dist/packem_shared/writeYamlSync-BpIN1tTP.cjs +0 -1
  217. package/dist/packem_shared/writeYamlSync-D2VPlEws.mjs +0 -1
@@ -0,0 +1,103 @@
1
+ import { readdirSync, realpathSync, statSync } from 'node:fs';
2
+ import { resolve, join, normalize, basename } from '@visulima/path';
3
+ import { toPath } from '@visulima/path/utils';
4
+ import WalkError from './WalkError-H9EuRv7O.mjs';
5
+ import assertValidFileOrDirectoryPath from './assertValidFileOrDirectoryPath-BWWgA1wj.mjs';
6
+ import { g as globToRegExp, w as walkInclude } from './walk-include-CMUSRa86.mjs';
7
+
8
+ var __defProp = Object.defineProperty;
9
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
10
+ const _createWalkEntry = /* @__PURE__ */ __name((path) => {
11
+ const normalizePath = normalize(path);
12
+ const info = statSync(normalizePath);
13
+ return {
14
+ // eslint-disable-next-line @typescript-eslint/unbound-method
15
+ isDirectory: info.isDirectory,
16
+ // eslint-disable-next-line @typescript-eslint/unbound-method
17
+ isFile: info.isFile,
18
+ // eslint-disable-next-line @typescript-eslint/unbound-method
19
+ isSymbolicLink: info.isSymbolicLink,
20
+ name: basename(normalizePath),
21
+ path: normalizePath
22
+ };
23
+ }, "_createWalkEntry");
24
+ function* walkSync(directory, {
25
+ extensions,
26
+ followSymlinks = false,
27
+ includeDirs: includeDirectories = true,
28
+ includeFiles = true,
29
+ includeSymlinks = true,
30
+ match,
31
+ maxDepth = Number.POSITIVE_INFINITY,
32
+ skip
33
+ } = {}) {
34
+ assertValidFileOrDirectoryPath(directory);
35
+ if (maxDepth < 0) {
36
+ return;
37
+ }
38
+ const mappedMatch = match ? match.map((pattern) => typeof pattern === "string" ? globToRegExp(pattern) : pattern) : undefined;
39
+ const mappedSkip = skip ? skip.map((pattern) => typeof pattern === "string" ? globToRegExp(pattern) : pattern) : undefined;
40
+ directory = resolve(toPath(directory));
41
+ if (includeDirectories && walkInclude(directory, extensions, mappedMatch, mappedSkip)) {
42
+ yield _createWalkEntry(directory);
43
+ }
44
+ if (maxDepth < 1 || !walkInclude(directory, undefined, undefined, mappedSkip)) {
45
+ return;
46
+ }
47
+ try {
48
+ for (const entry of readdirSync(directory, {
49
+ withFileTypes: true
50
+ })) {
51
+ let path = join(directory, entry.name);
52
+ if (entry.isSymbolicLink()) {
53
+ if (followSymlinks) {
54
+ path = realpathSync(path);
55
+ } else if (includeSymlinks && walkInclude(path, extensions, mappedMatch, mappedSkip)) {
56
+ yield {
57
+ // eslint-disable-next-line @typescript-eslint/unbound-method
58
+ isDirectory: entry.isDirectory,
59
+ // eslint-disable-next-line @typescript-eslint/unbound-method
60
+ isFile: entry.isFile,
61
+ // eslint-disable-next-line @typescript-eslint/unbound-method
62
+ isSymbolicLink: entry.isSymbolicLink,
63
+ name: entry.name,
64
+ path: normalize(path)
65
+ };
66
+ } else {
67
+ continue;
68
+ }
69
+ }
70
+ if (entry.isSymbolicLink() || entry.isDirectory()) {
71
+ yield* walkSync(path, {
72
+ extensions,
73
+ followSymlinks,
74
+ includeDirs: includeDirectories,
75
+ includeFiles,
76
+ includeSymlinks,
77
+ match: mappedMatch,
78
+ maxDepth: maxDepth - 1,
79
+ skip: mappedSkip
80
+ });
81
+ } else if (entry.isFile() && includeFiles && walkInclude(path, extensions, mappedMatch, mappedSkip)) {
82
+ yield {
83
+ // eslint-disable-next-line @typescript-eslint/unbound-method
84
+ isDirectory: entry.isDirectory,
85
+ // eslint-disable-next-line @typescript-eslint/unbound-method
86
+ isFile: entry.isFile,
87
+ // eslint-disable-next-line @typescript-eslint/unbound-method
88
+ isSymbolicLink: entry.isSymbolicLink,
89
+ name: entry.name,
90
+ path: normalize(path)
91
+ };
92
+ }
93
+ }
94
+ } catch (error) {
95
+ if (error instanceof WalkError) {
96
+ throw error;
97
+ }
98
+ throw new WalkError(error, directory);
99
+ }
100
+ }
101
+ __name(walkSync, "walkSync");
102
+
103
+ export { walkSync as default };
@@ -0,0 +1,105 @@
1
+ 'use strict';
2
+
3
+ const node_fs = require('node:fs');
4
+ const path = require('@visulima/path');
5
+ const utils = require('@visulima/path/utils');
6
+ const WalkError = require('./WalkError-B7_AVs7d.cjs');
7
+ const assertValidFileOrDirectoryPath = require('./assertValidFileOrDirectoryPath-BMbgA-eI.cjs');
8
+ const walkInclude = require('./walk-include-yUdRrF16.cjs');
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
12
+ const _createWalkEntry = /* @__PURE__ */ __name((path$1) => {
13
+ const normalizePath = path.normalize(path$1);
14
+ const info = node_fs.statSync(normalizePath);
15
+ return {
16
+ // eslint-disable-next-line @typescript-eslint/unbound-method
17
+ isDirectory: info.isDirectory,
18
+ // eslint-disable-next-line @typescript-eslint/unbound-method
19
+ isFile: info.isFile,
20
+ // eslint-disable-next-line @typescript-eslint/unbound-method
21
+ isSymbolicLink: info.isSymbolicLink,
22
+ name: path.basename(normalizePath),
23
+ path: normalizePath
24
+ };
25
+ }, "_createWalkEntry");
26
+ function* walkSync(directory, {
27
+ extensions,
28
+ followSymlinks = false,
29
+ includeDirs: includeDirectories = true,
30
+ includeFiles = true,
31
+ includeSymlinks = true,
32
+ match,
33
+ maxDepth = Number.POSITIVE_INFINITY,
34
+ skip
35
+ } = {}) {
36
+ assertValidFileOrDirectoryPath(directory);
37
+ if (maxDepth < 0) {
38
+ return;
39
+ }
40
+ const mappedMatch = match ? match.map((pattern) => typeof pattern === "string" ? walkInclude.globToRegExp(pattern) : pattern) : undefined;
41
+ const mappedSkip = skip ? skip.map((pattern) => typeof pattern === "string" ? walkInclude.globToRegExp(pattern) : pattern) : undefined;
42
+ directory = path.resolve(utils.toPath(directory));
43
+ if (includeDirectories && walkInclude.walkInclude(directory, extensions, mappedMatch, mappedSkip)) {
44
+ yield _createWalkEntry(directory);
45
+ }
46
+ if (maxDepth < 1 || !walkInclude.walkInclude(directory, undefined, undefined, mappedSkip)) {
47
+ return;
48
+ }
49
+ try {
50
+ for (const entry of node_fs.readdirSync(directory, {
51
+ withFileTypes: true
52
+ })) {
53
+ let path$1 = path.join(directory, entry.name);
54
+ if (entry.isSymbolicLink()) {
55
+ if (followSymlinks) {
56
+ path$1 = node_fs.realpathSync(path$1);
57
+ } else if (includeSymlinks && walkInclude.walkInclude(path$1, extensions, mappedMatch, mappedSkip)) {
58
+ yield {
59
+ // eslint-disable-next-line @typescript-eslint/unbound-method
60
+ isDirectory: entry.isDirectory,
61
+ // eslint-disable-next-line @typescript-eslint/unbound-method
62
+ isFile: entry.isFile,
63
+ // eslint-disable-next-line @typescript-eslint/unbound-method
64
+ isSymbolicLink: entry.isSymbolicLink,
65
+ name: entry.name,
66
+ path: path.normalize(path$1)
67
+ };
68
+ } else {
69
+ continue;
70
+ }
71
+ }
72
+ if (entry.isSymbolicLink() || entry.isDirectory()) {
73
+ yield* walkSync(path$1, {
74
+ extensions,
75
+ followSymlinks,
76
+ includeDirs: includeDirectories,
77
+ includeFiles,
78
+ includeSymlinks,
79
+ match: mappedMatch,
80
+ maxDepth: maxDepth - 1,
81
+ skip: mappedSkip
82
+ });
83
+ } else if (entry.isFile() && includeFiles && walkInclude.walkInclude(path$1, extensions, mappedMatch, mappedSkip)) {
84
+ yield {
85
+ // eslint-disable-next-line @typescript-eslint/unbound-method
86
+ isDirectory: entry.isDirectory,
87
+ // eslint-disable-next-line @typescript-eslint/unbound-method
88
+ isFile: entry.isFile,
89
+ // eslint-disable-next-line @typescript-eslint/unbound-method
90
+ isSymbolicLink: entry.isSymbolicLink,
91
+ name: entry.name,
92
+ path: path.normalize(path$1)
93
+ };
94
+ }
95
+ }
96
+ } catch (error) {
97
+ if (error instanceof WalkError) {
98
+ throw error;
99
+ }
100
+ throw new WalkError(error, directory);
101
+ }
102
+ }
103
+ __name(walkSync, "walkSync");
104
+
105
+ module.exports = walkSync;
@@ -0,0 +1,58 @@
1
+ import { mkdir, writeFile as writeFile$1, stat, rename, chown, chmod, unlink } from 'node:fs/promises';
2
+ import { dirname } from '@visulima/path';
3
+ import { toPath } from '@visulima/path/utils';
4
+ import { F_OK } from './F_OK-JER1LjUr.mjs';
5
+ import isAccessible from './isAccessible-Bonsm1Ez.mjs';
6
+ import assertValidFileContents from './assertValidFileContents-Ox-ScfeK.mjs';
7
+ import assertValidFileOrDirectoryPath from './assertValidFileOrDirectoryPath-BWWgA1wj.mjs';
8
+ import { t as toUint8Array } from './to-uint-8-array-B4CjMOD3.mjs';
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
12
+ const writeFile = /* @__PURE__ */ __name(async (path, content, options) => {
13
+ options = {
14
+ encoding: "utf8",
15
+ flag: "w",
16
+ overwrite: true,
17
+ recursive: true,
18
+ ...options
19
+ };
20
+ assertValidFileOrDirectoryPath(path);
21
+ assertValidFileContents(content);
22
+ path = toPath(path);
23
+ try {
24
+ const pathExists = await isAccessible(path, F_OK);
25
+ if (!pathExists && options.recursive) {
26
+ const directory = dirname(path);
27
+ if (!await isAccessible(directory, F_OK)) {
28
+ await mkdir(directory, { recursive: true });
29
+ }
30
+ }
31
+ let stat$1;
32
+ await writeFile$1(`${path}.tmp`, toUint8Array(content), { encoding: options.encoding, flag: options.flag });
33
+ if (pathExists && !options.overwrite) {
34
+ stat$1 = await stat(path);
35
+ if (options.chown === undefined) {
36
+ options.chown = { gid: stat$1.gid, uid: stat$1.uid };
37
+ }
38
+ await rename(path, `${path}.bak`);
39
+ }
40
+ const temporaryPath = `${path}.tmp`;
41
+ if (options.chown) {
42
+ try {
43
+ await chown(temporaryPath, options.chown.uid, options.chown.gid);
44
+ } catch {
45
+ }
46
+ }
47
+ await chmod(temporaryPath, stat$1 && !options.mode ? stat$1.mode : options.mode ?? 438);
48
+ await rename(temporaryPath, path);
49
+ } catch (error) {
50
+ throw new Error(`Failed to write file at: ${path} - ${error.message}`, { cause: error });
51
+ } finally {
52
+ if (await isAccessible(`${path}.tmp`)) {
53
+ await unlink(`${path}.tmp`);
54
+ }
55
+ }
56
+ }, "writeFile");
57
+
58
+ export { writeFile as default };
@@ -0,0 +1,60 @@
1
+ 'use strict';
2
+
3
+ const promises = require('node:fs/promises');
4
+ const path = require('@visulima/path');
5
+ const utils = require('@visulima/path/utils');
6
+ const F_OK = require('./F_OK-CWSqQIdF.cjs');
7
+ const isAccessible = require('./isAccessible-ZNVGsSb7.cjs');
8
+ const assertValidFileContents = require('./assertValidFileContents-CRVvyM6b.cjs');
9
+ const assertValidFileOrDirectoryPath = require('./assertValidFileOrDirectoryPath-BMbgA-eI.cjs');
10
+ const toUint8Array = require('./to-uint-8-array-BaTEyX3D.cjs');
11
+
12
+ var __defProp = Object.defineProperty;
13
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
14
+ const writeFile = /* @__PURE__ */ __name(async (path$1, content, options) => {
15
+ options = {
16
+ encoding: "utf8",
17
+ flag: "w",
18
+ overwrite: true,
19
+ recursive: true,
20
+ ...options
21
+ };
22
+ assertValidFileOrDirectoryPath(path$1);
23
+ assertValidFileContents(content);
24
+ path$1 = utils.toPath(path$1);
25
+ try {
26
+ const pathExists = await isAccessible(path$1, F_OK.F_OK);
27
+ if (!pathExists && options.recursive) {
28
+ const directory = path.dirname(path$1);
29
+ if (!await isAccessible(directory, F_OK.F_OK)) {
30
+ await promises.mkdir(directory, { recursive: true });
31
+ }
32
+ }
33
+ let stat;
34
+ await promises.writeFile(`${path$1}.tmp`, toUint8Array.toUint8Array(content), { encoding: options.encoding, flag: options.flag });
35
+ if (pathExists && !options.overwrite) {
36
+ stat = await promises.stat(path$1);
37
+ if (options.chown === undefined) {
38
+ options.chown = { gid: stat.gid, uid: stat.uid };
39
+ }
40
+ await promises.rename(path$1, `${path$1}.bak`);
41
+ }
42
+ const temporaryPath = `${path$1}.tmp`;
43
+ if (options.chown) {
44
+ try {
45
+ await promises.chown(temporaryPath, options.chown.uid, options.chown.gid);
46
+ } catch {
47
+ }
48
+ }
49
+ await promises.chmod(temporaryPath, stat && !options.mode ? stat.mode : options.mode ?? 438);
50
+ await promises.rename(temporaryPath, path$1);
51
+ } catch (error) {
52
+ throw new Error(`Failed to write file at: ${path$1} - ${error.message}`, { cause: error });
53
+ } finally {
54
+ if (await isAccessible(`${path$1}.tmp`)) {
55
+ await promises.unlink(`${path$1}.tmp`);
56
+ }
57
+ }
58
+ }, "writeFile");
59
+
60
+ module.exports = writeFile;
@@ -0,0 +1,60 @@
1
+ 'use strict';
2
+
3
+ const node_fs = require('node:fs');
4
+ const path = require('@visulima/path');
5
+ const utils = require('@visulima/path/utils');
6
+ const F_OK = require('./F_OK-CWSqQIdF.cjs');
7
+ const isAccessibleSync = require('./isAccessibleSync-VWjQa-US.cjs');
8
+ const assertValidFileContents = require('./assertValidFileContents-CRVvyM6b.cjs');
9
+ const assertValidFileOrDirectoryPath = require('./assertValidFileOrDirectoryPath-BMbgA-eI.cjs');
10
+ const toUint8Array = require('./to-uint-8-array-BaTEyX3D.cjs');
11
+
12
+ var __defProp = Object.defineProperty;
13
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
14
+ const writeFileSync = /* @__PURE__ */ __name((path$1, content, options) => {
15
+ options = {
16
+ encoding: "utf8",
17
+ flag: "w",
18
+ overwrite: true,
19
+ recursive: true,
20
+ ...options
21
+ };
22
+ assertValidFileOrDirectoryPath(path$1);
23
+ assertValidFileContents(content);
24
+ path$1 = utils.toPath(path$1);
25
+ try {
26
+ const pathExists = isAccessibleSync(path$1, F_OK.F_OK);
27
+ if (!pathExists && options.recursive) {
28
+ const directory = path.dirname(path$1);
29
+ if (!isAccessibleSync(directory, F_OK.F_OK)) {
30
+ node_fs.mkdirSync(directory, { recursive: true });
31
+ }
32
+ }
33
+ let stat;
34
+ node_fs.writeFileSync(`${path$1}.tmp`, toUint8Array.toUint8Array(content), { encoding: options.encoding, flag: options.flag });
35
+ if (pathExists && !options.overwrite) {
36
+ stat = node_fs.statSync(path$1);
37
+ if (options.chown === undefined) {
38
+ options.chown = { gid: stat.gid, uid: stat.uid };
39
+ }
40
+ node_fs.renameSync(path$1, `${path$1}.bak`);
41
+ }
42
+ const temporaryPath = `${path$1}.tmp`;
43
+ if (options.chown) {
44
+ try {
45
+ node_fs.chownSync(temporaryPath, options.chown.uid, options.chown.gid);
46
+ } catch {
47
+ }
48
+ }
49
+ node_fs.chmodSync(temporaryPath, stat && !options.mode ? stat.mode : options.mode ?? 438);
50
+ node_fs.renameSync(temporaryPath, path$1);
51
+ } catch (error) {
52
+ throw new Error(`Failed to write file at: ${path$1} - ${error.message}`, { cause: error });
53
+ } finally {
54
+ if (isAccessibleSync(`${path$1}.tmp`)) {
55
+ node_fs.unlinkSync(`${path$1}.tmp`);
56
+ }
57
+ }
58
+ }, "writeFileSync");
59
+
60
+ module.exports = writeFileSync;
@@ -0,0 +1,58 @@
1
+ import { mkdirSync, writeFileSync as writeFileSync$1, statSync, renameSync, chownSync, chmodSync, unlinkSync } from 'node:fs';
2
+ import { dirname } from '@visulima/path';
3
+ import { toPath } from '@visulima/path/utils';
4
+ import { F_OK } from './F_OK-JER1LjUr.mjs';
5
+ import isAccessibleSync from './isAccessibleSync-3gnUWUwX.mjs';
6
+ import assertValidFileContents from './assertValidFileContents-Ox-ScfeK.mjs';
7
+ import assertValidFileOrDirectoryPath from './assertValidFileOrDirectoryPath-BWWgA1wj.mjs';
8
+ import { t as toUint8Array } from './to-uint-8-array-B4CjMOD3.mjs';
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
12
+ const writeFileSync = /* @__PURE__ */ __name((path, content, options) => {
13
+ options = {
14
+ encoding: "utf8",
15
+ flag: "w",
16
+ overwrite: true,
17
+ recursive: true,
18
+ ...options
19
+ };
20
+ assertValidFileOrDirectoryPath(path);
21
+ assertValidFileContents(content);
22
+ path = toPath(path);
23
+ try {
24
+ const pathExists = isAccessibleSync(path, F_OK);
25
+ if (!pathExists && options.recursive) {
26
+ const directory = dirname(path);
27
+ if (!isAccessibleSync(directory, F_OK)) {
28
+ mkdirSync(directory, { recursive: true });
29
+ }
30
+ }
31
+ let stat;
32
+ writeFileSync$1(`${path}.tmp`, toUint8Array(content), { encoding: options.encoding, flag: options.flag });
33
+ if (pathExists && !options.overwrite) {
34
+ stat = statSync(path);
35
+ if (options.chown === undefined) {
36
+ options.chown = { gid: stat.gid, uid: stat.uid };
37
+ }
38
+ renameSync(path, `${path}.bak`);
39
+ }
40
+ const temporaryPath = `${path}.tmp`;
41
+ if (options.chown) {
42
+ try {
43
+ chownSync(temporaryPath, options.chown.uid, options.chown.gid);
44
+ } catch {
45
+ }
46
+ }
47
+ chmodSync(temporaryPath, stat && !options.mode ? stat.mode : options.mode ?? 438);
48
+ renameSync(temporaryPath, path);
49
+ } catch (error) {
50
+ throw new Error(`Failed to write file at: ${path} - ${error.message}`, { cause: error });
51
+ } finally {
52
+ if (isAccessibleSync(`${path}.tmp`)) {
53
+ unlinkSync(`${path}.tmp`);
54
+ }
55
+ }
56
+ }, "writeFileSync");
57
+
58
+ export { writeFileSync as default };
@@ -0,0 +1,31 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { d as detectIndent } from './index-ajT9ecry.mjs';
3
+ import { R_OK } from './F_OK-JER1LjUr.mjs';
4
+ import isAccessible from './isAccessible-Bonsm1Ez.mjs';
5
+ import writeFile from './writeFile-B7dhfseN.mjs';
6
+
7
+ var __defProp = Object.defineProperty;
8
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
+ const writeJson = /* @__PURE__ */ __name(async (path, data, options = {}) => {
10
+ const { detectIndent: detectIndent$1, indent: indentOption, replacer, stringify = JSON.stringify, ...writeOptions } = { indent: " ", ...options };
11
+ let indent = indentOption;
12
+ let trailingNewline = "\n";
13
+ if (await isAccessible(path, R_OK)) {
14
+ try {
15
+ const file = await readFile(path, "utf8");
16
+ if (detectIndent$1) {
17
+ const { indent: dIndent } = detectIndent(file);
18
+ indent = dIndent;
19
+ }
20
+ trailingNewline = file.endsWith("\n") ? "\n" : "";
21
+ } catch (error) {
22
+ if (error.code !== "ENOENT") {
23
+ throw error;
24
+ }
25
+ }
26
+ }
27
+ const json = stringify(data, replacer, indent);
28
+ await writeFile(path, `${json}${trailingNewline}`, writeOptions);
29
+ }, "writeJson");
30
+
31
+ export { writeJson as default };
@@ -0,0 +1,33 @@
1
+ 'use strict';
2
+
3
+ const promises = require('node:fs/promises');
4
+ const index = require('./index-ngvEMjBI.cjs');
5
+ const F_OK = require('./F_OK-CWSqQIdF.cjs');
6
+ const isAccessible = require('./isAccessible-ZNVGsSb7.cjs');
7
+ const writeFile = require('./writeFile-DKu5-M8x.cjs');
8
+
9
+ var __defProp = Object.defineProperty;
10
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
11
+ const writeJson = /* @__PURE__ */ __name(async (path, data, options = {}) => {
12
+ const { detectIndent, indent: indentOption, replacer, stringify = JSON.stringify, ...writeOptions } = { indent: " ", ...options };
13
+ let indent = indentOption;
14
+ let trailingNewline = "\n";
15
+ if (await isAccessible(path, F_OK.R_OK)) {
16
+ try {
17
+ const file = await promises.readFile(path, "utf8");
18
+ if (detectIndent) {
19
+ const { indent: dIndent } = index.detectIndent(file);
20
+ indent = dIndent;
21
+ }
22
+ trailingNewline = file.endsWith("\n") ? "\n" : "";
23
+ } catch (error) {
24
+ if (error.code !== "ENOENT") {
25
+ throw error;
26
+ }
27
+ }
28
+ }
29
+ const json = stringify(data, replacer, indent);
30
+ await writeFile(path, `${json}${trailingNewline}`, writeOptions);
31
+ }, "writeJson");
32
+
33
+ module.exports = writeJson;
@@ -0,0 +1,31 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { d as detectIndent } from './index-ajT9ecry.mjs';
3
+ import { R_OK } from './F_OK-JER1LjUr.mjs';
4
+ import isAccessibleSync from './isAccessibleSync-3gnUWUwX.mjs';
5
+ import writeFileSync from './writeFileSync-mMGYqOc8.mjs';
6
+
7
+ var __defProp = Object.defineProperty;
8
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
+ const writeJsonSync = /* @__PURE__ */ __name((path, data, options = {}) => {
10
+ const { detectIndent: detectIndent$1, indent: indentOption, replacer, stringify = JSON.stringify, ...writeOptions } = { indent: " ", ...options };
11
+ let indent = indentOption;
12
+ let trailingNewline = "\n";
13
+ if (isAccessibleSync(path, R_OK)) {
14
+ try {
15
+ const file = readFileSync(path, "utf8");
16
+ if (detectIndent$1) {
17
+ const { indent: dIndent } = detectIndent(file);
18
+ indent = dIndent;
19
+ }
20
+ trailingNewline = file.endsWith("\n") ? "\n" : "";
21
+ } catch (error) {
22
+ if (error.code !== "ENOENT") {
23
+ throw error;
24
+ }
25
+ }
26
+ }
27
+ const json = stringify(data, replacer, indent);
28
+ writeFileSync(path, `${json}${trailingNewline}`, writeOptions);
29
+ }, "writeJsonSync");
30
+
31
+ export { writeJsonSync as default };
@@ -0,0 +1,33 @@
1
+ 'use strict';
2
+
3
+ const node_fs = require('node:fs');
4
+ const index = require('./index-ngvEMjBI.cjs');
5
+ const F_OK = require('./F_OK-CWSqQIdF.cjs');
6
+ const isAccessibleSync = require('./isAccessibleSync-VWjQa-US.cjs');
7
+ const writeFileSync = require('./writeFileSync-Db6pmY0q.cjs');
8
+
9
+ var __defProp = Object.defineProperty;
10
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
11
+ const writeJsonSync = /* @__PURE__ */ __name((path, data, options = {}) => {
12
+ const { detectIndent, indent: indentOption, replacer, stringify = JSON.stringify, ...writeOptions } = { indent: " ", ...options };
13
+ let indent = indentOption;
14
+ let trailingNewline = "\n";
15
+ if (isAccessibleSync(path, F_OK.R_OK)) {
16
+ try {
17
+ const file = node_fs.readFileSync(path, "utf8");
18
+ if (detectIndent) {
19
+ const { indent: dIndent } = index.detectIndent(file);
20
+ indent = dIndent;
21
+ }
22
+ trailingNewline = file.endsWith("\n") ? "\n" : "";
23
+ } catch (error) {
24
+ if (error.code !== "ENOENT") {
25
+ throw error;
26
+ }
27
+ }
28
+ }
29
+ const json = stringify(data, replacer, indent);
30
+ writeFileSync(path, `${json}${trailingNewline}`, writeOptions);
31
+ }, "writeJsonSync");
32
+
33
+ module.exports = writeJsonSync;
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ const yaml = require('yaml');
4
+ const writeFile = require('./writeFile-DKu5-M8x.cjs');
5
+
6
+ var __defProp = Object.defineProperty;
7
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
+ async function writeYaml(path, data, replacer, options) {
9
+ const content = typeof replacer === "function" || Array.isArray(replacer) ? yaml.stringify(data, replacer, options) : yaml.stringify(data, replacer);
10
+ await writeFile(path, content);
11
+ }
12
+ __name(writeYaml, "writeYaml");
13
+
14
+ module.exports = writeYaml;
@@ -0,0 +1,12 @@
1
+ import { stringify } from 'yaml';
2
+ import writeFile from './writeFile-B7dhfseN.mjs';
3
+
4
+ var __defProp = Object.defineProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
+ async function writeYaml(path, data, replacer, options) {
7
+ const content = typeof replacer === "function" || Array.isArray(replacer) ? stringify(data, replacer, options) : stringify(data, replacer);
8
+ await writeFile(path, content);
9
+ }
10
+ __name(writeYaml, "writeYaml");
11
+
12
+ export { writeYaml as default };
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ const yaml = require('yaml');
4
+ const writeFileSync = require('./writeFileSync-Db6pmY0q.cjs');
5
+
6
+ var __defProp = Object.defineProperty;
7
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
+ function writeYamlSync(path, data, replacer, options) {
9
+ const content = typeof replacer === "function" || Array.isArray(replacer) ? yaml.stringify(data, replacer, options) : yaml.stringify(data, replacer);
10
+ writeFileSync(path, content);
11
+ }
12
+ __name(writeYamlSync, "writeYamlSync");
13
+
14
+ module.exports = writeYamlSync;
@@ -0,0 +1,12 @@
1
+ import { stringify } from 'yaml';
2
+ import writeFileSync from './writeFileSync-mMGYqOc8.mjs';
3
+
4
+ var __defProp = Object.defineProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
+ function writeYamlSync(path, data, replacer, options) {
7
+ const content = typeof replacer === "function" || Array.isArray(replacer) ? stringify(data, replacer, options) : stringify(data, replacer);
8
+ writeFileSync(path, content);
9
+ }
10
+ __name(writeYamlSync, "writeYamlSync");
11
+
12
+ export { writeYamlSync as default };
package/dist/utils.cjs CHANGED
@@ -1 +1,19 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./packem_shared/JSONError-CWuiGmNc.cjs"),e=require("./packem_shared/assertValidFileContents-CrbDz09d.cjs"),t=require("./packem_shared/assertValidFileOrDirectoryPath-HOUs73Jk.cjs"),s=require("./packem_shared/parseJson-CXe73j5t.cjs"),o=require("./packem_shared/stripJsonComments-Cw7UCxI3.cjs"),i=require("@visulima/path/utils");exports.JSONError=r;exports.assertValidFileContents=e;exports.assertValidFileOrDirectoryPath=t;exports.parseJson=s;exports.stripJsonComments=o;exports.toPath=i.toPath;
1
+ 'use strict';
2
+
3
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
+
5
+ const JSONError = require('./packem_shared/JSONError-gkXvBSar.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-DcUo4Rpt.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;
package/dist/utils.mjs CHANGED
@@ -1 +1,6 @@
1
- import{default as e}from"./packem_shared/JSONError-CVkb3xZ3.mjs";import{default as a}from"./packem_shared/assertValidFileContents-BLhwm7u2.mjs";import{default as f}from"./packem_shared/assertValidFileOrDirectoryPath-DgPIPmZT.mjs";import{default as m}from"./packem_shared/parseJson-BIYrZWHm.mjs";import{default as d}from"./packem_shared/stripJsonComments-CKgR4nW4.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};
1
+ export { default as JSONError } from './packem_shared/JSONError-BCIIHvzq.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-n9THWOFI.mjs';
5
+ export { default as stripJsonComments } from './packem_shared/stripJsonComments-B66nRaTZ.mjs';
6
+ export { toPath } from '@visulima/path/utils';