@stryke/fs 0.33.8 → 0.33.16

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 (310) hide show
  1. package/CHANGELOG.md +1280 -0
  2. package/README.md +18 -9
  3. package/dist/buffer-Ch164vki.cjs +1 -0
  4. package/dist/buffer-DDq-CW4J.mjs +2 -0
  5. package/dist/buffer-DDq-CW4J.mjs.map +1 -0
  6. package/dist/{buffer.d.ts → buffer-DgfUmhrc.d.mts} +8 -4
  7. package/dist/buffer-DgfUmhrc.d.mts.map +1 -0
  8. package/dist/buffer-DvCjrjQH.d.cts +32 -0
  9. package/dist/buffer-DvCjrjQH.d.cts.map +1 -0
  10. package/dist/buffer.cjs +1 -34
  11. package/dist/buffer.d.cts +2 -0
  12. package/dist/buffer.d.mts +2 -0
  13. package/dist/buffer.mjs +1 -1
  14. package/dist/{chmod-x.d.ts → chmod-x-BPr4tt2-.d.cts} +10 -6
  15. package/dist/chmod-x-BPr4tt2-.d.cts.map +1 -0
  16. package/dist/chmod-x-FOy3sak8.cjs +1 -0
  17. package/dist/chmod-x-QCk1GmQJ.d.mts +44 -0
  18. package/dist/chmod-x-QCk1GmQJ.d.mts.map +1 -0
  19. package/dist/chmod-x-q-TWdus7.mjs +2 -0
  20. package/dist/chmod-x-q-TWdus7.mjs.map +1 -0
  21. package/dist/chmod-x.cjs +1 -57
  22. package/dist/chmod-x.d.cts +2 -0
  23. package/dist/chmod-x.d.mts +2 -0
  24. package/dist/chmod-x.mjs +1 -1
  25. package/dist/chunk-Bmb41Sf3.cjs +1 -0
  26. package/dist/{command-exists.d.ts → command-exists-CuieR7rx.d.cts} +6 -2
  27. package/dist/command-exists-CuieR7rx.d.cts.map +1 -0
  28. package/dist/command-exists-D1bV-wSk.cjs +1 -0
  29. package/dist/command-exists-Dzb2kKT4.mjs +2 -0
  30. package/dist/command-exists-Dzb2kKT4.mjs.map +1 -0
  31. package/dist/command-exists-dBdtR0xj.d.mts +22 -0
  32. package/dist/command-exists-dBdtR0xj.d.mts.map +1 -0
  33. package/dist/command-exists.cjs +1 -71
  34. package/dist/command-exists.d.cts +2 -0
  35. package/dist/command-exists.d.mts +2 -0
  36. package/dist/command-exists.mjs +1 -1
  37. package/dist/compress-BiTxso15.mjs +2 -0
  38. package/dist/compress-BiTxso15.mjs.map +1 -0
  39. package/dist/compress-BjGbQqs_.cjs +1 -0
  40. package/dist/compress-CLAaOwH3.d.mts +16 -0
  41. package/dist/compress-CLAaOwH3.d.mts.map +1 -0
  42. package/dist/compress-CQve2a6h.d.cts +16 -0
  43. package/dist/compress-CQve2a6h.d.cts.map +1 -0
  44. package/dist/compress.cjs +1 -26
  45. package/dist/compress.d.cts +2 -0
  46. package/dist/compress.d.mts +2 -0
  47. package/dist/compress.mjs +1 -1
  48. package/dist/constants-D58o2CiO.d.cts +5 -0
  49. package/dist/constants-D58o2CiO.d.cts.map +1 -0
  50. package/dist/constants-DZz9LJgo.d.mts +5 -0
  51. package/dist/constants-DZz9LJgo.d.mts.map +1 -0
  52. package/dist/constants.cjs +0 -1
  53. package/dist/constants.d.cts +2 -0
  54. package/dist/constants.d.mts +2 -0
  55. package/dist/constants.mjs +1 -0
  56. package/dist/{copy-file.d.ts → copy-file-B5FJHiIK.d.mts} +11 -5
  57. package/dist/copy-file-B5FJHiIK.d.mts.map +1 -0
  58. package/dist/copy-file-Bot2YNtT.mjs +2 -0
  59. package/dist/copy-file-Bot2YNtT.mjs.map +1 -0
  60. package/dist/copy-file-DjH2Ho5e.d.cts +39 -0
  61. package/dist/copy-file-DjH2Ho5e.d.cts.map +1 -0
  62. package/dist/copy-file-Y1ilzocZ.cjs +1 -0
  63. package/dist/copy-file.cjs +1 -48
  64. package/dist/copy-file.d.cts +2 -0
  65. package/dist/copy-file.d.mts +2 -0
  66. package/dist/copy-file.mjs +1 -1
  67. package/dist/cwd-YTg9Cx6C.mjs +2 -0
  68. package/dist/cwd-YTg9Cx6C.mjs.map +1 -0
  69. package/dist/cwd-o2vq8Tk9.cjs +1 -0
  70. package/dist/{exists.d.ts → exists-175EN367.d.mts} +6 -2
  71. package/dist/exists-175EN367.d.mts.map +1 -0
  72. package/dist/exists-B31lSRFp.cjs +1 -0
  73. package/dist/exists-CVlDImzc.d.cts +18 -0
  74. package/dist/exists-CVlDImzc.d.cts.map +1 -0
  75. package/dist/exists-Ci-9lYmi.mjs +2 -0
  76. package/dist/exists-Ci-9lYmi.mjs.map +1 -0
  77. package/dist/exists.cjs +1 -15
  78. package/dist/exists.d.cts +2 -0
  79. package/dist/exists.d.mts +2 -0
  80. package/dist/exists.mjs +1 -1
  81. package/dist/file-D1uBqkpP.d.cts +32 -0
  82. package/dist/file-D1uBqkpP.d.cts.map +1 -0
  83. package/dist/file-DauFFmfh.d.mts +32 -0
  84. package/dist/file-DauFFmfh.d.mts.map +1 -0
  85. package/dist/file-path-fns-7aKacdLg.cjs +1 -0
  86. package/dist/file-path-fns-BDzC2SIV.mjs +2 -0
  87. package/dist/file-path-fns-BDzC2SIV.mjs.map +1 -0
  88. package/dist/get-parent-path-COkh6Pvl.d.mts +32 -0
  89. package/dist/get-parent-path-COkh6Pvl.d.mts.map +1 -0
  90. package/dist/get-parent-path-Cbqs2km7.d.cts +32 -0
  91. package/dist/get-parent-path-Cbqs2km7.d.cts.map +1 -0
  92. package/dist/get-parent-path-CfRkaB4R.cjs +1 -0
  93. package/dist/get-parent-path-DLFSyxSW.mjs +2 -0
  94. package/dist/get-parent-path-DLFSyxSW.mjs.map +1 -0
  95. package/dist/get-parent-path.cjs +1 -28
  96. package/dist/get-parent-path.d.cts +2 -0
  97. package/dist/get-parent-path.d.mts +2 -0
  98. package/dist/get-parent-path.mjs +1 -1
  99. package/dist/get-workspace-root-CCNjjZGY.cjs +1 -0
  100. package/dist/{get-workspace-root.d.ts → get-workspace-root-DQBvBd8X.d.mts} +12 -8
  101. package/dist/get-workspace-root-DQBvBd8X.d.mts.map +1 -0
  102. package/dist/get-workspace-root-eTfm1jII.d.cts +48 -0
  103. package/dist/get-workspace-root-eTfm1jII.d.cts.map +1 -0
  104. package/dist/get-workspace-root-k66w-wLW.mjs +2 -0
  105. package/dist/get-workspace-root-k66w-wLW.mjs.map +1 -0
  106. package/dist/get-workspace-root.cjs +1 -49
  107. package/dist/get-workspace-root.d.cts +2 -0
  108. package/dist/get-workspace-root.d.mts +2 -0
  109. package/dist/get-workspace-root.mjs +1 -1
  110. package/dist/helpers-BSEQb1fp.mjs +2 -0
  111. package/dist/helpers-BSEQb1fp.mjs.map +1 -0
  112. package/dist/{helpers.d.ts → helpers-CYWFZ-Uv.d.mts} +10 -6
  113. package/dist/helpers-CYWFZ-Uv.d.mts.map +1 -0
  114. package/dist/helpers-CgMOExPa.d.cts +50 -0
  115. package/dist/helpers-CgMOExPa.d.cts.map +1 -0
  116. package/dist/helpers-_MJ6PR-g.cjs +1 -0
  117. package/dist/helpers.cjs +1 -49
  118. package/dist/helpers.d.cts +2 -0
  119. package/dist/helpers.d.mts +2 -0
  120. package/dist/helpers.mjs +1 -1
  121. package/dist/index.cjs +1 -269
  122. package/dist/index.d.cts +25 -0
  123. package/dist/index.d.mts +25 -0
  124. package/dist/index.mjs +1 -1
  125. package/dist/install-B3bIjHoU.mjs +2 -0
  126. package/dist/install-B3bIjHoU.mjs.map +1 -0
  127. package/dist/install-CZ_S7NHm.cjs +1 -0
  128. package/dist/install-CxPsLO2t.d.cts +28 -0
  129. package/dist/install-CxPsLO2t.d.cts.map +1 -0
  130. package/dist/install-dYt7hlQn.d.mts +29 -0
  131. package/dist/install-dYt7hlQn.d.mts.map +1 -0
  132. package/dist/install.cjs +1 -25
  133. package/dist/install.d.cts +2 -0
  134. package/dist/install.d.mts +2 -0
  135. package/dist/install.mjs +1 -1
  136. package/dist/is-error-CjEyTRps.cjs +1 -0
  137. package/dist/is-error-CjVXmD_8.mjs +2 -0
  138. package/dist/is-error-CjVXmD_8.mjs.map +1 -0
  139. package/dist/is-file-BkFQev3M.cjs +1 -0
  140. package/dist/is-file-CNooe8Wz.mjs +2 -0
  141. package/dist/is-file-CNooe8Wz.mjs.map +1 -0
  142. package/dist/{is-file.d.ts → is-file-DjqOQrqY.d.mts} +8 -4
  143. package/dist/is-file-DjqOQrqY.d.mts.map +1 -0
  144. package/dist/is-file-DoBi2FN9.d.cts +36 -0
  145. package/dist/is-file-DoBi2FN9.d.cts.map +1 -0
  146. package/dist/is-file.cjs +1 -29
  147. package/dist/is-file.d.cts +2 -0
  148. package/dist/is-file.d.mts +2 -0
  149. package/dist/is-file.mjs +1 -1
  150. package/dist/is-object-FBXmvehR.cjs +1 -0
  151. package/dist/is-object-UsKYhyC5.mjs +2 -0
  152. package/dist/is-object-UsKYhyC5.mjs.map +1 -0
  153. package/dist/is-set-string-CLeu8BKX.cjs +1 -0
  154. package/dist/is-set-string-Cj0g4gsG.mjs +2 -0
  155. package/dist/is-set-string-Cj0g4gsG.mjs.map +1 -0
  156. package/dist/is-string-91Z3dOKQ.mjs +2 -0
  157. package/dist/is-string-91Z3dOKQ.mjs.map +1 -0
  158. package/dist/is-string-DKgNS0jA.cjs +1 -0
  159. package/dist/join-paths-BHepkhAj.mjs +2 -0
  160. package/dist/join-paths-BHepkhAj.mjs.map +1 -0
  161. package/dist/join-paths-DUdaieID.cjs +1 -0
  162. package/dist/json-CYenVxvr.d.cts +83 -0
  163. package/dist/json-CYenVxvr.d.cts.map +1 -0
  164. package/dist/json-DH7Q6Ftp.d.mts +83 -0
  165. package/dist/json-DH7Q6Ftp.d.mts.map +1 -0
  166. package/dist/json-DKhqPjHB.cjs +6 -0
  167. package/dist/json-Dp4PSH2i.mjs +7 -0
  168. package/dist/json-Dp4PSH2i.mjs.map +1 -0
  169. package/dist/json.cjs +1 -41
  170. package/dist/json.d.cts +2 -0
  171. package/dist/json.d.mts +2 -0
  172. package/dist/json.mjs +1 -3
  173. package/dist/list-files-Cn_UVruo.cjs +1 -0
  174. package/dist/list-files-D3dQOljX.d.cts +51 -0
  175. package/dist/list-files-D3dQOljX.d.cts.map +1 -0
  176. package/dist/list-files-D3iJzEQw.d.mts +51 -0
  177. package/dist/list-files-D3iJzEQw.d.mts.map +1 -0
  178. package/dist/list-files-D__uh3tQ.mjs +2 -0
  179. package/dist/list-files-D__uh3tQ.mjs.map +1 -0
  180. package/dist/list-files.cjs +1 -55
  181. package/dist/list-files.d.cts +2 -0
  182. package/dist/list-files.d.mts +2 -0
  183. package/dist/list-files.mjs +1 -1
  184. package/dist/package-fns-BNRi_Rpc.d.cts +354 -0
  185. package/dist/package-fns-BNRi_Rpc.d.cts.map +1 -0
  186. package/dist/package-fns-C7-MKgBR.mjs +2 -0
  187. package/dist/package-fns-C7-MKgBR.mjs.map +1 -0
  188. package/dist/package-fns-CxokaGDY.d.mts +354 -0
  189. package/dist/package-fns-CxokaGDY.d.mts.map +1 -0
  190. package/dist/package-fns-YTCdMAXr.cjs +1 -0
  191. package/dist/package-fns.cjs +1 -99
  192. package/dist/package-fns.d.cts +2 -0
  193. package/dist/package-fns.d.mts +2 -0
  194. package/dist/package-fns.mjs +1 -1
  195. package/dist/read-file-B091zB64.mjs +2 -0
  196. package/dist/read-file-B091zB64.mjs.map +1 -0
  197. package/dist/read-file-BB2WzW-N.cjs +1 -0
  198. package/dist/{read-file.d.ts → read-file-Bxn1VHKv.d.cts} +8 -4
  199. package/dist/read-file-Bxn1VHKv.d.cts.map +1 -0
  200. package/dist/read-file-CRVW-wcE.d.mts +30 -0
  201. package/dist/read-file-CRVW-wcE.d.mts.map +1 -0
  202. package/dist/read-file.cjs +1 -31
  203. package/dist/read-file.d.cts +2 -0
  204. package/dist/read-file.d.mts +2 -0
  205. package/dist/read-file.mjs +1 -1
  206. package/dist/registry-B1taIPKm.mjs +2 -0
  207. package/dist/registry-B1taIPKm.mjs.map +1 -0
  208. package/dist/{registry.d.ts → registry-BQ3JXRFA.d.mts} +17 -13
  209. package/dist/registry-BQ3JXRFA.d.mts.map +1 -0
  210. package/dist/registry-BYwvM92u.cjs +1 -0
  211. package/dist/registry-C2A0Kau7.d.cts +53 -0
  212. package/dist/registry-C2A0Kau7.d.cts.map +1 -0
  213. package/dist/registry.cjs +1 -95
  214. package/dist/registry.d.cts +2 -0
  215. package/dist/registry.d.mts +2 -0
  216. package/dist/registry.mjs +1 -1
  217. package/dist/remove-file-BM64Brdf.mjs +2 -0
  218. package/dist/remove-file-BM64Brdf.mjs.map +1 -0
  219. package/dist/remove-file-BqlkL_Df.d.mts +16 -0
  220. package/dist/remove-file-BqlkL_Df.d.mts.map +1 -0
  221. package/dist/remove-file-XHFKELQN.cjs +1 -0
  222. package/dist/remove-file-lQOlxDwr.d.cts +16 -0
  223. package/dist/remove-file-lQOlxDwr.d.cts.map +1 -0
  224. package/dist/remove-file.cjs +1 -16
  225. package/dist/remove-file.d.cts +2 -0
  226. package/dist/remove-file.d.mts +2 -0
  227. package/dist/remove-file.mjs +1 -1
  228. package/dist/resolve-C_YsCFne.mjs +4 -0
  229. package/dist/resolve-C_YsCFne.mjs.map +1 -0
  230. package/dist/{resolve.d.ts → resolve-D66oIwjf.d.mts} +33 -29
  231. package/dist/resolve-D66oIwjf.d.mts.map +1 -0
  232. package/dist/resolve-DTkLQekH.cjs +3 -0
  233. package/dist/resolve-DubH-8qd.d.cts +106 -0
  234. package/dist/resolve-DubH-8qd.d.cts.map +1 -0
  235. package/dist/resolve-parent-path-CR8av8WP.mjs +2 -0
  236. package/dist/resolve-parent-path-CR8av8WP.mjs.map +1 -0
  237. package/dist/resolve-parent-path-D0AaW2PB.cjs +1 -0
  238. package/dist/resolve.cjs +1 -115
  239. package/dist/resolve.d.cts +2 -0
  240. package/dist/resolve.d.mts +2 -0
  241. package/dist/resolve.mjs +1 -5
  242. package/dist/{semver-fns.d.ts → semver-fns-B0e5zB6C.d.mts} +17 -11
  243. package/dist/semver-fns-B0e5zB6C.d.mts.map +1 -0
  244. package/dist/semver-fns-Btrm1dIF.cjs +1 -0
  245. package/dist/semver-fns-DjhZXnUw.d.cts +92 -0
  246. package/dist/semver-fns-DjhZXnUw.d.cts.map +1 -0
  247. package/dist/semver-fns-F_rYnwDq.mjs +2 -0
  248. package/dist/semver-fns-F_rYnwDq.mjs.map +1 -0
  249. package/dist/semver-fns.cjs +1 -40
  250. package/dist/semver-fns.d.cts +2 -0
  251. package/dist/semver-fns.d.mts +2 -0
  252. package/dist/semver-fns.mjs +1 -1
  253. package/dist/toml-CIgLQmP3.mjs +4 -0
  254. package/dist/toml-CIgLQmP3.mjs.map +1 -0
  255. package/dist/toml-D3X2QoaL.d.cts +81 -0
  256. package/dist/toml-D3X2QoaL.d.cts.map +1 -0
  257. package/dist/toml-DgVyNp_y.cjs +3 -0
  258. package/dist/toml-Djau1M6n.d.mts +81 -0
  259. package/dist/toml-Djau1M6n.d.mts.map +1 -0
  260. package/dist/toml.cjs +1 -40
  261. package/dist/toml.d.cts +2 -0
  262. package/dist/toml.d.mts +2 -0
  263. package/dist/toml.mjs +1 -3
  264. package/dist/tsconfig-B13IMV_0.d.mts +812 -0
  265. package/dist/tsconfig-B13IMV_0.d.mts.map +1 -0
  266. package/dist/tsconfig-B6WtgD1c.cjs +1 -0
  267. package/dist/tsconfig-C8ecu1-0.d.cts +812 -0
  268. package/dist/tsconfig-C8ecu1-0.d.cts.map +1 -0
  269. package/dist/tsconfig-CqvvSVuX.mjs +2 -0
  270. package/dist/tsconfig-CqvvSVuX.mjs.map +1 -0
  271. package/dist/tsconfig.cjs +1 -28
  272. package/dist/tsconfig.d.cts +2 -0
  273. package/dist/tsconfig.d.mts +2 -0
  274. package/dist/tsconfig.mjs +1 -1
  275. package/dist/write-file-BmvbsmMj.d.cts +35 -0
  276. package/dist/write-file-BmvbsmMj.d.cts.map +1 -0
  277. package/dist/write-file-CFByoJkN.mjs +2 -0
  278. package/dist/write-file-CFByoJkN.mjs.map +1 -0
  279. package/dist/write-file-CWTzQpb2.d.mts +35 -0
  280. package/dist/write-file-CWTzQpb2.d.mts.map +1 -0
  281. package/dist/write-file-CqokudVp.cjs +1 -0
  282. package/dist/write-file.cjs +1 -26
  283. package/dist/write-file.d.cts +2 -0
  284. package/dist/write-file.d.mts +2 -0
  285. package/dist/write-file.mjs +1 -1
  286. package/dist/yaml-6uuLoSfT.d.cts +23 -0
  287. package/dist/yaml-6uuLoSfT.d.cts.map +1 -0
  288. package/dist/yaml-CLMo56UG.mjs +2 -0
  289. package/dist/yaml-CLMo56UG.mjs.map +1 -0
  290. package/dist/yaml-Ddslc5NK.d.mts +23 -0
  291. package/dist/yaml-Ddslc5NK.d.mts.map +1 -0
  292. package/dist/yaml-q2k-BjIM.cjs +1 -0
  293. package/dist/yaml.cjs +1 -15
  294. package/dist/yaml.d.cts +2 -0
  295. package/dist/yaml.d.mts +2 -0
  296. package/dist/yaml.mjs +1 -1
  297. package/package.json +98 -379
  298. package/dist/compress.d.ts +0 -11
  299. package/dist/constants.d.ts +0 -1
  300. package/dist/get-parent-path.d.ts +0 -28
  301. package/dist/index.d.ts +0 -32
  302. package/dist/install.d.ts +0 -24
  303. package/dist/json.d.ts +0 -49
  304. package/dist/list-files.d.ts +0 -46
  305. package/dist/package-fns.d.ts +0 -89
  306. package/dist/remove-file.d.ts +0 -12
  307. package/dist/toml.d.ts +0 -77
  308. package/dist/tsconfig.d.ts +0 -8
  309. package/dist/write-file.d.ts +0 -30
  310. package/dist/yaml.d.ts +0 -18
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compress-BiTxso15.mjs","names":[],"sources":["../../convert/src/array-buffer-to-string.ts","../../convert/src/uint8-array-to-string.ts","../src/compress.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Convert an ArrayBuffer or Uint8Array to a string\n *\n * @param buffer - The ArrayBuffer or Uint8Array to convert\n * @returns The converted string\n */\nexport function arrayBufferToString(\n buffer: ArrayBuffer | ArrayBufferLike | Uint8Array\n): string {\n const bytes =\n buffer instanceof Uint8Array\n ? buffer\n : new Uint8Array(buffer as ArrayBufferLike);\n const len = bytes.byteLength;\n if (len < 65535) {\n return String.fromCharCode.apply(null, bytes as unknown as number[]);\n }\n let binary = \"\";\n for (let i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]!);\n }\n return binary;\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { arrayBufferToString } from \"./array-buffer-to-string\";\n\n/**\n * Convert a Uint8Array to a base64 string\n *\n * @param buffer - The Uint8Array to convert\n * @returns The converted base64 string\n */\nexport function uint8ArrayToString(buffer: Uint8Array): string {\n return btoa(arrayBufferToString(buffer));\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { uint8ArrayToString } from \"@stryke/convert/uint8-array-to-string\";\nimport { findFolderName, resolveParentPath } from \"@stryke/path\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { GlobOptions } from \"glob\";\nimport { createTarGzip } from \"nanotar\";\nimport { isDirectory } from \"./is-file\";\nimport { listFiles } from \"./list-files\";\nimport { readFileIfExisting } from \"./read-file\";\nimport { writeFile } from \"./write-file\";\n\nexport interface CompressDirectoryOptions extends GlobOptions {\n destination?: string;\n}\n\n/**\n * Compress a directory or file into a tar.gz archive.\n *\n * @param directory - The source directory or file/glob to compress.\n * @param options - Options for the compression.\n */\nexport async function compressDirectory(\n directory: string,\n options?: CompressDirectoryOptions\n): Promise<void> {\n const files = await listFiles(\n isDirectory(directory) ? joinPaths(directory, \"**/*\") : directory,\n options\n );\n const data = await createTarGzip(\n await Promise.all(\n files.map(async file => ({\n name: file,\n data: await readFileIfExisting(file)\n }))\n ),\n {\n attrs: { group: \"storm-software\" }\n }\n );\n\n return writeFile(\n options?.destination\n ? isDirectory(options.destination)\n ? joinPaths(options.destination, `${new Date().getTime()}.tar.gz`)\n : options.destination\n : isDirectory(directory)\n ? `${joinPaths(resolveParentPath(directory), findFolderName(directory))}.tar.gz`\n : directory,\n uint8ArrayToString(data)\n );\n}\n"],"mappings":"6WAwBA,SAAgB,EACd,EACQ,CACR,IAAM,EACJ,aAAkB,WACd,EACA,IAAI,WAAW,EAA0B,CACzC,EAAM,EAAM,WAClB,GAAI,EAAM,MACR,OAAO,OAAO,aAAa,MAAM,KAAM,EAA6B,CAEtE,IAAI,EAAS,GACb,IAAK,IAAI,EAAI,EAAG,EAAI,EAAK,IACvB,GAAU,OAAO,aAAa,EAAM,GAAI,CAE1C,OAAO,ECbT,SAAgB,EAAmB,EAA4B,CAC7D,OAAO,KAAK,EAAoB,EAAO,CAAC,CCW1C,eAAsB,EACpB,EACA,EACe,CACf,IAAM,EAAQ,MAAM,EAClB,EAAY,EAAU,CAAG,EAAU,EAAW,OAAO,CAAG,EACxD,EACD,CACK,EAAO,MAAM,EACjB,MAAM,QAAQ,IACZ,EAAM,IAAI,KAAM,KAAS,CACvB,KAAM,EACN,KAAM,MAAM,EAAmB,EAAK,CACrC,EAAE,CACJ,CACD,CACE,MAAO,CAAE,MAAO,iBAAkB,CACnC,CACF,CAED,OAAO,EACL,GAAS,YACL,EAAY,EAAQ,YAAY,CAC9B,EAAU,EAAQ,YAAa,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,SAAS,CAChE,EAAQ,YACV,EAAY,EAAU,CACpB,GAAG,EAAU,EAAkB,EAAU,CAAE,EAAe,EAAU,CAAC,CAAC,SACtE,EACN,EAAmB,EAAK,CACzB"}
@@ -0,0 +1 @@
1
+ const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./join-paths-DUdaieID.cjs`),n=require(`./file-path-fns-7aKacdLg.cjs`),r=require(`./resolve-parent-path-D0AaW2PB.cjs`),i=require(`./is-file-BkFQev3M.cjs`),a=require(`./list-files-Cn_UVruo.cjs`),o=require(`./read-file-BB2WzW-N.cjs`),s=require(`./write-file-CqokudVp.cjs`);let c=require(`nanotar`);function l(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n=t.byteLength;if(n<65535)return String.fromCharCode.apply(null,t);let r=``;for(let e=0;e<n;e++)r+=String.fromCharCode(t[e]);return r}function u(e){return btoa(l(e))}async function d(e,l){let d=await a.i(i.t(e)?t.t(e,`**/*`):e,l),f=await(0,c.createTarGzip)(await Promise.all(d.map(async e=>({name:e,data:await o.n(e)}))),{attrs:{group:`storm-software`}});return s.t(l?.destination?i.t(l.destination)?t.t(l.destination,`${new Date().getTime()}.tar.gz`):l.destination:i.t(e)?`${t.t(r.t(e),n.i(e))}.tar.gz`:e,u(f))}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return d}});
@@ -0,0 +1,16 @@
1
+ import { GlobOptions } from "glob";
2
+
3
+ //#region src/compress.d.ts
4
+ interface CompressDirectoryOptions extends GlobOptions {
5
+ destination?: string;
6
+ }
7
+ /**
8
+ * Compress a directory or file into a tar.gz archive.
9
+ *
10
+ * @param directory - The source directory or file/glob to compress.
11
+ * @param options - Options for the compression.
12
+ */
13
+ declare function compressDirectory(directory: string, options?: CompressDirectoryOptions): Promise<void>;
14
+ //#endregion
15
+ export { compressDirectory as n, CompressDirectoryOptions as t };
16
+ //# sourceMappingURL=compress-CLAaOwH3.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compress-CLAaOwH3.d.mts","names":[],"sources":["../src/compress.ts"],"sourcesContent":[],"mappings":";;;UA4BiB,wBAAA,SAAiC;;AAAlD;AAUA;;;;;;iBAAsB,iBAAA,8BAEV,2BACT"}
@@ -0,0 +1,16 @@
1
+ import { GlobOptions } from "glob";
2
+
3
+ //#region src/compress.d.ts
4
+ interface CompressDirectoryOptions extends GlobOptions {
5
+ destination?: string;
6
+ }
7
+ /**
8
+ * Compress a directory or file into a tar.gz archive.
9
+ *
10
+ * @param directory - The source directory or file/glob to compress.
11
+ * @param options - Options for the compression.
12
+ */
13
+ declare function compressDirectory(directory: string, options?: CompressDirectoryOptions): Promise<void>;
14
+ //#endregion
15
+ export { compressDirectory as n, CompressDirectoryOptions as t };
16
+ //# sourceMappingURL=compress-CQve2a6h.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compress-CQve2a6h.d.cts","names":[],"sources":["../src/compress.ts"],"sourcesContent":[],"mappings":";;;UA4BiB,wBAAA,SAAiC;;AAAlD;AAUA;;;;;;iBAAsB,iBAAA,8BAEV,2BACT"}
package/dist/compress.cjs CHANGED
@@ -1,26 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.compressDirectory = compressDirectory;
7
- var _uint8ArrayToString = require("@stryke/convert/uint8-array-to-string");
8
- var _path = require("@stryke/path");
9
- var _joinPaths = require("@stryke/path/join-paths");
10
- var _nanotar = require("nanotar");
11
- var _isFile = require("./is-file.cjs");
12
- var _listFiles = require("./list-files.cjs");
13
- var _readFile = require("./read-file.cjs");
14
- var _writeFile = require("./write-file.cjs");
15
- async function compressDirectory(t, i) {
16
- const e = await (0, _listFiles.listFiles)((0, _isFile.isDirectory)(t) ? (0, _joinPaths.joinPaths)(t, "**/*") : t, i),
17
- s = await (0, _nanotar.createTarGzip)(await Promise.all(e.map(async a => ({
18
- name: a,
19
- data: await (0, _readFile.readFileIfExisting)(a)
20
- }))), {
21
- attrs: {
22
- group: "storm-software"
23
- }
24
- });
25
- return (0, _writeFile.writeFile)(i?.destination ? (0, _isFile.isDirectory)(i.destination) ? (0, _joinPaths.joinPaths)(i.destination, `${new Date().getTime()}.tar.gz`) : i.destination : (0, _isFile.isDirectory)(t) ? `${(0, _joinPaths.joinPaths)((0, _path.resolveParentPath)(t), (0, _path.findFolderName)(t))}.tar.gz` : t, (0, _uint8ArrayToString.uint8ArrayToString)(s));
26
- }
1
+ require(`./helpers-_MJ6PR-g.cjs`);const e=require(`./compress-BjGbQqs_.cjs`);require(`./list-files-Cn_UVruo.cjs`),require(`./write-file-CqokudVp.cjs`),exports.compressDirectory=e.t;
@@ -0,0 +1,2 @@
1
+ import { n as compressDirectory, t as CompressDirectoryOptions } from "./compress-CQve2a6h.cjs";
2
+ export { CompressDirectoryOptions, compressDirectory };
@@ -0,0 +1,2 @@
1
+ import { n as compressDirectory, t as CompressDirectoryOptions } from "./compress-CLAaOwH3.mjs";
2
+ export { CompressDirectoryOptions, compressDirectory };
package/dist/compress.mjs CHANGED
@@ -1 +1 @@
1
- import{uint8ArrayToString as n}from"@stryke/convert/uint8-array-to-string";import{findFolderName as m,resolveParentPath as p}from"@stryke/path";import{joinPaths as r}from"@stryke/path/join-paths";import{createTarGzip as f}from"nanotar";import{isDirectory as o}from"./is-file";import{listFiles as l}from"./list-files";import{readFileIfExisting as g}from"./read-file";import{writeFile as w}from"./write-file";export async function compressDirectory(t,i){const e=await l(o(t)?r(t,"**/*"):t,i),s=await f(await Promise.all(e.map(async a=>({name:a,data:await g(a)}))),{attrs:{group:"storm-software"}});return w(i?.destination?o(i.destination)?r(i.destination,`${new Date().getTime()}.tar.gz`):i.destination:o(t)?`${r(p(t),m(t))}.tar.gz`:t,n(s))}
1
+ import"./helpers-BSEQb1fp.mjs";import{t as e}from"./compress-BiTxso15.mjs";import"./list-files-D__uh3tQ.mjs";import"./write-file-CFByoJkN.mjs";export{e as compressDirectory};
@@ -0,0 +1,5 @@
1
+ //#region src/constants.d.ts
2
+ type Encoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex";
3
+ //#endregion
4
+ export { Encoding as t };
5
+ //# sourceMappingURL=constants-D58o2CiO.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants-D58o2CiO.d.cts","names":[],"sources":["../src/constants.ts"],"sourcesContent":[],"mappings":";KAkBY,QAAA"}
@@ -0,0 +1,5 @@
1
+ //#region src/constants.d.ts
2
+ type Encoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex";
3
+ //#endregion
4
+ export { Encoding as t };
5
+ //# sourceMappingURL=constants-DZz9LJgo.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants-DZz9LJgo.d.mts","names":[],"sources":["../src/constants.ts"],"sourcesContent":[],"mappings":";KAkBY,QAAA"}
@@ -1 +0,0 @@
1
- "use strict";
@@ -0,0 +1,2 @@
1
+ import { t as Encoding } from "./constants-D58o2CiO.cjs";
2
+ export { Encoding };
@@ -0,0 +1,2 @@
1
+ import { t as Encoding } from "./constants-DZz9LJgo.mjs";
2
+ export { Encoding };
@@ -0,0 +1 @@
1
+ export{};
@@ -1,4 +1,7 @@
1
- import type { AssetGlob } from "@stryke/types/file";
1
+ import { t as AssetGlob } from "./file-DauFFmfh.mjs";
2
+
3
+ //#region src/copy-file.d.ts
4
+
2
5
  /**
3
6
  * Copy a file from one location to another
4
7
  *
@@ -6,7 +9,7 @@ import type { AssetGlob } from "@stryke/types/file";
6
9
  * @param destination - The destination location
7
10
  * @returns An indicator specifying if the copy was successful
8
11
  */
9
- export declare function copyFile(source: string | URL, destination: string | URL): Promise<void>;
12
+ declare function copyFile(source: string | URL, destination: string | URL): Promise<void>;
10
13
  /**
11
14
  * Synchronously copy a file from one location to another
12
15
  *
@@ -14,7 +17,7 @@ export declare function copyFile(source: string | URL, destination: string | URL
14
17
  * @param destination - The destination location
15
18
  * @returns An indicator specifying if the copy was successful
16
19
  */
17
- export declare function copyFileSync(source: string | URL, destination: string | URL): void;
20
+ declare function copyFileSync(source: string | URL, destination: string | URL): void;
18
21
  /**
19
22
  * Copy files from one location to another
20
23
  *
@@ -22,7 +25,7 @@ export declare function copyFileSync(source: string | URL, destination: string |
22
25
  * @param destination - The destination location
23
26
  * @returns An indicator specifying if the copy was successful
24
27
  */
25
- export declare function copyFiles(source: string | URL | Omit<AssetGlob, "output">, destination: string | URL): Promise<void | void[]>;
28
+ declare function copyFiles(source: string | URL | Omit<AssetGlob, "output">, destination: string | URL): Promise<void | void[]>;
26
29
  /**
27
30
  * Synchronously copy files from one location to another
28
31
  *
@@ -30,4 +33,7 @@ export declare function copyFiles(source: string | URL | Omit<AssetGlob, "output
30
33
  * @param destination - The destination location
31
34
  * @returns An indicator specifying if the copy was successful
32
35
  */
33
- export declare function copyFilesSync(source: string | URL | Omit<AssetGlob, "output">, destination: string | URL): void | void[];
36
+ declare function copyFilesSync(source: string | URL | Omit<AssetGlob, "output">, destination: string | URL): void | void[];
37
+ //#endregion
38
+ export { copyFilesSync as i, copyFileSync as n, copyFiles as r, copyFile as t };
39
+ //# sourceMappingURL=copy-file-B5FJHiIK.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-file-B5FJHiIK.d.mts","names":[],"sources":["../src/copy-file.ts"],"sourcesContent":[],"mappings":";;;;;;AAwCA;;;;;AA4BgB,iBA5BM,QAAA,CA4BwB,MAA2B,EAAG,MAAA,GA3BzD,GA2ByD,EAAA,WAAA,EAAA,MAAA,GA1BpD,GA0BoD,CAAA,EA1BjD,OA0BiD,CAAA,IAAA,CAAA;AAyB5E;;;;;;;AAmCgB,iBA5DA,YAAA,CA4Da,MAAA,EAAA,MAAA,GA5DiB,GA4DjB,EAAA,WAAA,EAAA,MAAA,GA5D4C,GA4D5C,CAAA,EAAA,IAAA;;;;;;;;iBAnCP,SAAA,kBACH,MAAM,KAAK,4CACN,MAAG;;;;;;;;iBAiCX,aAAA,kBACG,MAAM,KAAK,4CACN"}
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./cwd-YTg9Cx6C.mjs";import{n as t,t as n}from"./join-paths-BHepkhAj.mjs";import{a as r,f as i,l as a,r as o}from"./file-path-fns-BDzC2SIV.mjs";import{t as s}from"./is-string-91Z3dOKQ.mjs";import{t as c}from"./resolve-parent-path-CR8av8WP.mjs";import{n as l}from"./exists-Ci-9lYmi.mjs";import{n as u,t as d}from"./helpers-BSEQb1fp.mjs";import{r as f,t as p}from"./is-file-CNooe8Wz.mjs";import{a as m,i as h}from"./list-files-D__uh3tQ.mjs";import{copyFileSync as g}from"node:fs";import{copyFile as _}from"node:fs/promises";import{fileURLToPath as v}from"mlly";function y(n,r=e()){return i(n,r)?t(n).replace(t(r),``).replace(/^\//,``):n}async function b(e,t){let n=e instanceof URL?v(e):e,i=t instanceof URL?v(t):t;if(r(i)?l(o(i))||await d(o(i)):l(c(i))||await d(c(i)),s(n)&&l(n))return _(n,i)}function x(e,t){let n=e instanceof URL?v(e):e,i=t instanceof URL?v(t):t;if(r(i)?l(o(i))||u(o(i)):l(c(i))||u(c(i)),s(n)&&l(n))return g(n,i)}async function S(e,t){let r=e instanceof URL?v(e):e,i=t instanceof URL?v(t):t;return s(r)&&f(r)?b(r,i):Promise.all((await h(r)).map(async e=>{let t=n(i,y(e,s(r)?a(r):r.input));p(e)?await S(e,t):await b(e,t)}))}function C(e,t){let r=e instanceof URL?v(e):e,i=t instanceof URL?v(t):t;return s(r)&&f(r)?x(r,i):m(r).map(e=>{let t=n(i,y(e,s(r)?a(r):r.input));p(e)?C(e,t):x(e,t)})}export{C as i,x as n,S as r,b as t};
2
+ //# sourceMappingURL=copy-file-Bot2YNtT.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-file-Bot2YNtT.mjs","names":["copyFile","existsSync","cpf","copyFileSync","cpfSync"],"sources":["../../path/src/replace.ts","../src/copy-file.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { cwd } from \"./cwd\";\nimport {\n findFileDotExtensionSafe,\n findFileExtensionSafe\n} from \"./file-path-fns\";\nimport { isParentPath } from \"./is-parent-path\";\nimport { slash } from \"./slash\";\n\n/**\n * Replace the base path from the beginning of the given path.\n *\n * @example\n * ```ts\n * replacePath(\"/home/user/project/src/index.ts\", \"/home/user/project\");\n * // returns \"src/index.ts\"\n * ```\n *\n * @param childPath - The child path to replace the {@link parentPath} substring from\n * @param parentPath - The parent path to remove from the {@link childPath} parameter\n * @returns The {@link childPath} with the {@link parentPath} path removed\n */\nexport function replacePath(\n childPath: string,\n parentPath: string = cwd()\n): string {\n return isParentPath(childPath, parentPath)\n ? slash(childPath).replace(slash(parentPath), \"\").replace(/^\\//, \"\")\n : childPath;\n}\n\n/**\n * Replace the extension of a given path with the provided value.\n *\n * @example\n * ```ts\n * replaceExtension(\"/home/user/project/src/index.ts\", \".js\");\n * // returns \"/home/user/project/src/index.js\"\n * replaceExtension(\"/home/user/project/src/index.ts\");\n * // returns \"/home/user/project/src/index\"\n * ```\n *\n * @param path - The path that will have its current extension replaced\n * @param replacement - The value (or an empty string) to replace the current extension with\n * @returns The path with the replaced extension\n */\nexport function replaceExtension(path: string, replacement = \"\"): string {\n return path.replace(\n !replacement || replacement.includes(\".\")\n ? findFileDotExtensionSafe(path)\n : findFileExtensionSafe(path),\n replacement\n );\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { stripStars } from \"@stryke/path/correct-path\";\nimport { findFilePath, hasFileExtension } from \"@stryke/path/file-path-fns\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { resolveParentPath } from \"@stryke/path/resolve-parent-path\";\nimport { isString } from \"@stryke/type-checks\";\nimport type { AssetGlob } from \"@stryke/types/file\";\nimport { fileURLToPath } from \"mlly\";\nimport { copyFileSync as cpfSync } from \"node:fs\";\nimport { copyFile as cpf } from \"node:fs/promises\";\nimport { existsSync } from \"./exists\";\nimport { createDirectory, createDirectorySync } from \"./helpers\";\nimport { isDirectory, isFile } from \"./is-file\";\nimport { listFiles, listFilesSync } from \"./list-files\";\n\n/**\n * Copy a file from one location to another\n *\n * @param source - The file to copy, this can be a file, directory, URL, or glob pattern\n * @param destination - The destination location\n * @returns An indicator specifying if the copy was successful\n */\nexport async function copyFile(\n source: string | URL,\n destination: string | URL\n) {\n const src = source instanceof URL ? fileURLToPath(source) : source;\n const dest =\n destination instanceof URL ? fileURLToPath(destination) : destination;\n\n if (!hasFileExtension(dest)) {\n if (!existsSync(resolveParentPath(dest))) {\n await createDirectory(resolveParentPath(dest));\n }\n } else if (!existsSync(findFilePath(dest))) {\n await createDirectory(findFilePath(dest));\n }\n\n if (isString(src) && existsSync(src)) {\n return cpf(src, dest);\n }\n}\n\n/**\n * Synchronously copy a file from one location to another\n *\n * @param source - The file to copy, this can be a file, directory, URL, or glob pattern\n * @param destination - The destination location\n * @returns An indicator specifying if the copy was successful\n */\nexport function copyFileSync(source: string | URL, destination: string | URL) {\n const src = source instanceof URL ? fileURLToPath(source) : source;\n const dest =\n destination instanceof URL ? fileURLToPath(destination) : destination;\n\n if (!hasFileExtension(dest)) {\n if (!existsSync(resolveParentPath(dest))) {\n createDirectorySync(resolveParentPath(dest));\n }\n } else if (!existsSync(findFilePath(dest))) {\n createDirectorySync(findFilePath(dest));\n }\n\n if (isString(src) && existsSync(src)) {\n return cpfSync(src, dest);\n }\n}\n\n/**\n * Copy files from one location to another\n *\n * @param source - The source location, this can be a file, directory, URL, or glob pattern\n * @param destination - The destination location\n * @returns An indicator specifying if the copy was successful\n */\nexport async function copyFiles(\n source: string | URL | Omit<AssetGlob, \"output\">,\n destination: string | URL\n) {\n const src = source instanceof URL ? fileURLToPath(source) : source;\n const dest =\n destination instanceof URL ? fileURLToPath(destination) : destination;\n\n if (isString(src) && isFile(src)) {\n return copyFile(src, dest);\n }\n\n return Promise.all(\n (await listFiles(src)).map(async entryPath => {\n const destFile = joinPaths(\n dest,\n replacePath(entryPath, isString(src) ? stripStars(src) : src.input)\n );\n\n if (isDirectory(entryPath)) {\n await copyFiles(entryPath, destFile);\n } else {\n await copyFile(entryPath, destFile);\n }\n })\n );\n}\n\n/**\n * Synchronously copy files from one location to another\n *\n * @param source - The source location, this can be a file, directory, URL, or glob pattern\n * @param destination - The destination location\n * @returns An indicator specifying if the copy was successful\n */\nexport function copyFilesSync(\n source: string | URL | Omit<AssetGlob, \"output\">,\n destination: string | URL\n) {\n const src = source instanceof URL ? fileURLToPath(source) : source;\n const dest =\n destination instanceof URL ? fileURLToPath(destination) : destination;\n\n if (isString(src) && isFile(src)) {\n return copyFileSync(src, dest);\n }\n\n return listFilesSync(src).map(entryPath => {\n const destFile = joinPaths(\n dest,\n replacePath(entryPath, isString(src) ? stripStars(src) : src.input)\n );\n\n if (isDirectory(entryPath)) {\n copyFilesSync(entryPath, destFile);\n } else {\n copyFileSync(entryPath, destFile);\n }\n });\n}\n"],"mappings":"ikBAuCA,SAAgB,EACd,EACA,EAAqB,GAAK,CAClB,CACR,OAAO,EAAa,EAAW,EAAW,CACtC,EAAM,EAAU,CAAC,QAAQ,EAAM,EAAW,CAAE,GAAG,CAAC,QAAQ,MAAO,GAAG,CAClE,ECLN,eAAsBA,EACpB,EACA,EACA,CACA,IAAM,EAAM,aAAkB,IAAM,EAAc,EAAO,CAAG,EACtD,EACJ,aAAuB,IAAM,EAAc,EAAY,CAAG,EAU5D,GARK,EAAiB,EAAK,CAIfC,EAAW,EAAa,EAAK,CAAC,EACxC,MAAM,EAAgB,EAAa,EAAK,CAAC,CAJpCA,EAAW,EAAkB,EAAK,CAAC,EACtC,MAAM,EAAgB,EAAkB,EAAK,CAAC,CAM9C,EAAS,EAAI,EAAIA,EAAW,EAAI,CAClC,OAAOC,EAAI,EAAK,EAAK,CAWzB,SAAgBC,EAAa,EAAsB,EAA2B,CAC5E,IAAM,EAAM,aAAkB,IAAM,EAAc,EAAO,CAAG,EACtD,EACJ,aAAuB,IAAM,EAAc,EAAY,CAAG,EAU5D,GARK,EAAiB,EAAK,CAIfF,EAAW,EAAa,EAAK,CAAC,EACxC,EAAoB,EAAa,EAAK,CAAC,CAJlCA,EAAW,EAAkB,EAAK,CAAC,EACtC,EAAoB,EAAkB,EAAK,CAAC,CAM5C,EAAS,EAAI,EAAIA,EAAW,EAAI,CAClC,OAAOG,EAAQ,EAAK,EAAK,CAW7B,eAAsB,EACpB,EACA,EACA,CACA,IAAM,EAAM,aAAkB,IAAM,EAAc,EAAO,CAAG,EACtD,EACJ,aAAuB,IAAM,EAAc,EAAY,CAAG,EAM5D,OAJI,EAAS,EAAI,EAAI,EAAO,EAAI,CACvBJ,EAAS,EAAK,EAAK,CAGrB,QAAQ,KACZ,MAAM,EAAU,EAAI,EAAE,IAAI,KAAM,IAAa,CAC5C,IAAM,EAAW,EACf,EACA,EAAY,EAAW,EAAS,EAAI,CAAG,EAAW,EAAI,CAAG,EAAI,MAAM,CACpE,CAEG,EAAY,EAAU,CACxB,MAAM,EAAU,EAAW,EAAS,CAEpC,MAAMA,EAAS,EAAW,EAAS,EAErC,CACH,CAUH,SAAgB,EACd,EACA,EACA,CACA,IAAM,EAAM,aAAkB,IAAM,EAAc,EAAO,CAAG,EACtD,EACJ,aAAuB,IAAM,EAAc,EAAY,CAAG,EAM5D,OAJI,EAAS,EAAI,EAAI,EAAO,EAAI,CACvBG,EAAa,EAAK,EAAK,CAGzB,EAAc,EAAI,CAAC,IAAI,GAAa,CACzC,IAAM,EAAW,EACf,EACA,EAAY,EAAW,EAAS,EAAI,CAAG,EAAW,EAAI,CAAG,EAAI,MAAM,CACpE,CAEG,EAAY,EAAU,CACxB,EAAc,EAAW,EAAS,CAElC,EAAa,EAAW,EAAS,EAEnC"}
@@ -0,0 +1,39 @@
1
+ import { t as AssetGlob } from "./file-D1uBqkpP.cjs";
2
+
3
+ //#region src/copy-file.d.ts
4
+
5
+ /**
6
+ * Copy a file from one location to another
7
+ *
8
+ * @param source - The file to copy, this can be a file, directory, URL, or glob pattern
9
+ * @param destination - The destination location
10
+ * @returns An indicator specifying if the copy was successful
11
+ */
12
+ declare function copyFile(source: string | URL, destination: string | URL): Promise<void>;
13
+ /**
14
+ * Synchronously copy a file from one location to another
15
+ *
16
+ * @param source - The file to copy, this can be a file, directory, URL, or glob pattern
17
+ * @param destination - The destination location
18
+ * @returns An indicator specifying if the copy was successful
19
+ */
20
+ declare function copyFileSync(source: string | URL, destination: string | URL): void;
21
+ /**
22
+ * Copy files from one location to another
23
+ *
24
+ * @param source - The source location, this can be a file, directory, URL, or glob pattern
25
+ * @param destination - The destination location
26
+ * @returns An indicator specifying if the copy was successful
27
+ */
28
+ declare function copyFiles(source: string | URL | Omit<AssetGlob, "output">, destination: string | URL): Promise<void | void[]>;
29
+ /**
30
+ * Synchronously copy files from one location to another
31
+ *
32
+ * @param source - The source location, this can be a file, directory, URL, or glob pattern
33
+ * @param destination - The destination location
34
+ * @returns An indicator specifying if the copy was successful
35
+ */
36
+ declare function copyFilesSync(source: string | URL | Omit<AssetGlob, "output">, destination: string | URL): void | void[];
37
+ //#endregion
38
+ export { copyFilesSync as i, copyFileSync as n, copyFiles as r, copyFile as t };
39
+ //# sourceMappingURL=copy-file-DjH2Ho5e.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-file-DjH2Ho5e.d.cts","names":[],"sources":["../src/copy-file.ts"],"sourcesContent":[],"mappings":";;;;;;AAwCA;;;;;AA4BgB,iBA5BM,QAAA,CA4BwB,MAA2B,EAAG,MAAA,GA3BzD,GA2ByD,EAAA,WAAA,EAAA,MAAA,GA1BpD,GA0BoD,CAAA,EA1BjD,OA0BiD,CAAA,IAAA,CAAA;AAyB5E;;;;;;;AAmCgB,iBA5DA,YAAA,CA4Da,MAAA,EAAA,MAAA,GA5DiB,GA4DjB,EAAA,WAAA,EAAA,MAAA,GA5D4C,GA4D5C,CAAA,EAAA,IAAA;;;;;;;;iBAnCP,SAAA,kBACH,MAAM,KAAK,4CACN,MAAG;;;;;;;;iBAiCX,aAAA,kBACG,MAAM,KAAK,4CACN"}
@@ -0,0 +1 @@
1
+ const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./cwd-o2vq8Tk9.cjs`),n=require(`./join-paths-DUdaieID.cjs`),r=require(`./file-path-fns-7aKacdLg.cjs`),i=require(`./is-string-DKgNS0jA.cjs`),a=require(`./resolve-parent-path-D0AaW2PB.cjs`),o=require(`./exists-B31lSRFp.cjs`),s=require(`./helpers-_MJ6PR-g.cjs`),c=require(`./is-file-BkFQev3M.cjs`),l=require(`./list-files-Cn_UVruo.cjs`);let u=require(`node:fs`),d=require(`node:fs/promises`),f=require(`mlly`);function p(e,i=t.t()){return r.f(e,i)?n.n(e).replace(n.n(i),``).replace(/^\//,``):e}async function m(e,t){let n=e instanceof URL?(0,f.fileURLToPath)(e):e,c=t instanceof URL?(0,f.fileURLToPath)(t):t;if(r.a(c)?o.n(r.r(c))||await s.t(r.r(c)):o.n(a.t(c))||await s.t(a.t(c)),i.t(n)&&o.n(n))return(0,d.copyFile)(n,c)}function h(e,t){let n=e instanceof URL?(0,f.fileURLToPath)(e):e,c=t instanceof URL?(0,f.fileURLToPath)(t):t;if(r.a(c)?o.n(r.r(c))||s.n(r.r(c)):o.n(a.t(c))||s.n(a.t(c)),i.t(n)&&o.n(n))return(0,u.copyFileSync)(n,c)}async function g(e,t){let a=e instanceof URL?(0,f.fileURLToPath)(e):e,o=t instanceof URL?(0,f.fileURLToPath)(t):t;return i.t(a)&&c.r(a)?m(a,o):Promise.all((await l.i(a)).map(async e=>{let t=n.t(o,p(e,i.t(a)?r.l(a):a.input));c.t(e)?await g(e,t):await m(e,t)}))}function _(e,t){let a=e instanceof URL?(0,f.fileURLToPath)(e):e,o=t instanceof URL?(0,f.fileURLToPath)(t):t;return i.t(a)&&c.r(a)?h(a,o):l.a(a).map(e=>{let t=n.t(o,p(e,i.t(a)?r.l(a):a.input));c.t(e)?_(e,t):h(e,t)})}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return m}});
@@ -1,48 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.copyFile = copyFile;
7
- exports.copyFileSync = copyFileSync;
8
- exports.copyFiles = copyFiles;
9
- exports.copyFilesSync = copyFilesSync;
10
- var _correctPath = require("@stryke/path/correct-path");
11
- var _filePathFns = require("@stryke/path/file-path-fns");
12
- var _join = require("@stryke/path/join");
13
- var _replace = require("@stryke/path/replace");
14
- var _resolveParentPath = require("@stryke/path/resolve-parent-path");
15
- var _typeChecks = require("@stryke/type-checks");
16
- var _mlly = require("mlly");
17
- var _nodeFs = require("node:fs");
18
- var _promises = require("node:fs/promises");
19
- var _exists = require("./exists.cjs");
20
- var _helpers = require("./helpers.cjs");
21
- var _isFile = require("./is-file.cjs");
22
- var _listFiles = require("./list-files.cjs");
23
- async function copyFile(r, o) {
24
- const i = r instanceof URL ? (0, _mlly.fileURLToPath)(r) : r,
25
- t = o instanceof URL ? (0, _mlly.fileURLToPath)(o) : o;
26
- if ((0, _filePathFns.hasFileExtension)(t) ? (0, _exists.existsSync)((0, _filePathFns.findFilePath)(t)) || (await (0, _helpers.createDirectory)((0, _filePathFns.findFilePath)(t))) : (0, _exists.existsSync)((0, _resolveParentPath.resolveParentPath)(t)) || (await (0, _helpers.createDirectory)((0, _resolveParentPath.resolveParentPath)(t))), (0, _typeChecks.isString)(i) && (0, _exists.existsSync)(i)) return (0, _promises.copyFile)(i, t);
27
- }
28
- function copyFileSync(r, o) {
29
- const i = r instanceof URL ? (0, _mlly.fileURLToPath)(r) : r,
30
- t = o instanceof URL ? (0, _mlly.fileURLToPath)(o) : o;
31
- if ((0, _filePathFns.hasFileExtension)(t) ? (0, _exists.existsSync)((0, _filePathFns.findFilePath)(t)) || (0, _helpers.createDirectorySync)((0, _filePathFns.findFilePath)(t)) : (0, _exists.existsSync)((0, _resolveParentPath.resolveParentPath)(t)) || (0, _helpers.createDirectorySync)((0, _resolveParentPath.resolveParentPath)(t)), (0, _typeChecks.isString)(i) && (0, _exists.existsSync)(i)) return (0, _nodeFs.copyFileSync)(i, t);
32
- }
33
- async function copyFiles(r, o) {
34
- const i = r instanceof URL ? (0, _mlly.fileURLToPath)(r) : r,
35
- t = o instanceof URL ? (0, _mlly.fileURLToPath)(o) : o;
36
- return (0, _typeChecks.isString)(i) && (0, _isFile.isFile)(i) ? copyFile(i, t) : Promise.all((await (0, _listFiles.listFiles)(i)).map(async s => {
37
- const c = (0, _join.joinPaths)(t, (0, _replace.replacePath)(s, (0, _typeChecks.isString)(i) ? (0, _correctPath.stripStars)(i) : i.input));
38
- (0, _isFile.isDirectory)(s) ? await copyFiles(s, c) : await copyFile(s, c);
39
- }));
40
- }
41
- function copyFilesSync(r, o) {
42
- const i = r instanceof URL ? (0, _mlly.fileURLToPath)(r) : r,
43
- t = o instanceof URL ? (0, _mlly.fileURLToPath)(o) : o;
44
- return (0, _typeChecks.isString)(i) && (0, _isFile.isFile)(i) ? copyFileSync(i, t) : (0, _listFiles.listFilesSync)(i).map(s => {
45
- const c = (0, _join.joinPaths)(t, (0, _replace.replacePath)(s, (0, _typeChecks.isString)(i) ? (0, _correctPath.stripStars)(i) : i.input));
46
- (0, _isFile.isDirectory)(s) ? copyFilesSync(s, c) : copyFileSync(s, c);
47
- });
48
- }
1
+ const e=require(`./copy-file-Y1ilzocZ.cjs`);require(`./helpers-_MJ6PR-g.cjs`),require(`./list-files-Cn_UVruo.cjs`),exports.copyFile=e.t,exports.copyFileSync=e.n,exports.copyFiles=e.r,exports.copyFilesSync=e.i;
@@ -0,0 +1,2 @@
1
+ import { i as copyFilesSync, n as copyFileSync, r as copyFiles, t as copyFile } from "./copy-file-DjH2Ho5e.cjs";
2
+ export { copyFile, copyFileSync, copyFiles, copyFilesSync };
@@ -0,0 +1,2 @@
1
+ import { i as copyFilesSync, n as copyFileSync, r as copyFiles, t as copyFile } from "./copy-file-B5FJHiIK.mjs";
2
+ export { copyFile, copyFileSync, copyFiles, copyFilesSync };
@@ -1 +1 @@
1
- import{stripStars as l}from"@stryke/path/correct-path";import{findFilePath as p,hasFileExtension as a}from"@stryke/path/file-path-fns";import{joinPaths as L}from"@stryke/path/join";import{replacePath as R}from"@stryke/path/replace";import{resolveParentPath as m}from"@stryke/path/resolve-parent-path";import{isString as n}from"@stryke/type-checks";import{fileURLToPath as e}from"mlly";import{copyFileSync as S}from"node:fs";import{copyFile as u}from"node:fs/promises";import{existsSync as f}from"./exists";import{createDirectory as U,createDirectorySync as y}from"./helpers";import{isDirectory as F,isFile as g}from"./is-file";import{listFiles as x,listFilesSync as w}from"./list-files";export async function copyFile(r,o){const i=r instanceof URL?e(r):r,t=o instanceof URL?e(o):o;if(a(t)?f(p(t))||await U(p(t)):f(m(t))||await U(m(t)),n(i)&&f(i))return u(i,t)}export function copyFileSync(r,o){const i=r instanceof URL?e(r):r,t=o instanceof URL?e(o):o;if(a(t)?f(p(t))||y(p(t)):f(m(t))||y(m(t)),n(i)&&f(i))return S(i,t)}export async function copyFiles(r,o){const i=r instanceof URL?e(r):r,t=o instanceof URL?e(o):o;return n(i)&&g(i)?copyFile(i,t):Promise.all((await x(i)).map(async s=>{const c=L(t,R(s,n(i)?l(i):i.input));F(s)?await copyFiles(s,c):await copyFile(s,c)}))}export function copyFilesSync(r,o){const i=r instanceof URL?e(r):r,t=o instanceof URL?e(o):o;return n(i)&&g(i)?copyFileSync(i,t):w(i).map(s=>{const c=L(t,R(s,n(i)?l(i):i.input));F(s)?copyFilesSync(s,c):copyFileSync(s,c)})}
1
+ import{i as e,n as t,r as n,t as r}from"./copy-file-Bot2YNtT.mjs";import"./helpers-BSEQb1fp.mjs";import"./list-files-D__uh3tQ.mjs";export{r as copyFile,t as copyFileSync,n as copyFiles,e as copyFilesSync};
@@ -0,0 +1,2 @@
1
+ function e(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}export{e as t};
2
+ //# sourceMappingURL=cwd-YTg9Cx6C.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cwd-YTg9Cx6C.mjs","names":[],"sources":["../../path/src/cwd.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Get the current working directory.\n *\n * @remarks\n * This function attempts to retrieve the current working directory using `process.cwd()`.\n *\n * @returns The current working directory or '/' if it cannot be determined\n */\nexport function cwd() {\n if (typeof process !== \"undefined\" && typeof process.cwd === \"function\") {\n return process.cwd().replace(/\\\\/g, \"/\");\n }\n return \"/\";\n}\n"],"mappings":"AA0BA,SAAgB,GAAM,CAIpB,OAHI,OAAO,QAAY,KAAe,OAAO,QAAQ,KAAQ,WACpD,QAAQ,KAAK,CAAC,QAAQ,MAAO,IAAI,CAEnC"}
@@ -0,0 +1 @@
1
+ function e(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
@@ -1,14 +1,18 @@
1
+ //#region src/exists.d.ts
1
2
  /**
2
3
  * Check if a file exists
3
4
  *
4
5
  * @param filePath - The file path to check
5
6
  * @returns An indicator specifying if the file exists
6
7
  */
7
- export declare function existsSync(filePath: string): boolean;
8
+ declare function existsSync(filePath: string): boolean;
8
9
  /**
9
10
  * Check if a file exists
10
11
  *
11
12
  * @param filePath - The file path to check
12
13
  * @returns An indicator specifying if the file exists
13
14
  */
14
- export declare function exists(filePath: string): Promise<boolean>;
15
+ declare function exists(filePath: string): Promise<boolean>;
16
+ //#endregion
17
+ export { existsSync as n, exists as t };
18
+ //# sourceMappingURL=exists-175EN367.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exists-175EN367.d.mts","names":[],"sources":["../src/exists.ts"],"sourcesContent":[],"mappings":";;AA2BA;AAUA;;;;iBAVgB,UAAA;;;;;;;iBAUM,MAAA,oBAA0B"}
@@ -0,0 +1 @@
1
+ const e=require(`./chunk-Bmb41Sf3.cjs`);let t=require(`node:fs`),n=require(`node:fs/promises`);function r(e){return(0,t.existsSync)(e)}async function i(e){return(0,n.access)(e,n.constants.F_OK).then(()=>!0).catch(()=>!1)}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
@@ -0,0 +1,18 @@
1
+ //#region src/exists.d.ts
2
+ /**
3
+ * Check if a file exists
4
+ *
5
+ * @param filePath - The file path to check
6
+ * @returns An indicator specifying if the file exists
7
+ */
8
+ declare function existsSync(filePath: string): boolean;
9
+ /**
10
+ * Check if a file exists
11
+ *
12
+ * @param filePath - The file path to check
13
+ * @returns An indicator specifying if the file exists
14
+ */
15
+ declare function exists(filePath: string): Promise<boolean>;
16
+ //#endregion
17
+ export { existsSync as n, exists as t };
18
+ //# sourceMappingURL=exists-CVlDImzc.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exists-CVlDImzc.d.cts","names":[],"sources":["../src/exists.ts"],"sourcesContent":[],"mappings":";;AA2BA;AAUA;;;;iBAVgB,UAAA;;;;;;;iBAUM,MAAA,oBAA0B"}
@@ -0,0 +1,2 @@
1
+ import{existsSync as e}from"node:fs";import{access as t,constants as n}from"node:fs/promises";function r(t){return e(t)}async function i(e){return t(e,n.F_OK).then(()=>!0).catch(()=>!1)}export{r as n,i as t};
2
+ //# sourceMappingURL=exists-Ci-9lYmi.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exists-Ci-9lYmi.mjs","names":["existsSync","existsSyncFs","constants"],"sources":["../src/exists.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { existsSync as existsSyncFs } from \"node:fs\";\nimport { access, constants } from \"node:fs/promises\";\n\n/**\n * Check if a file exists\n *\n * @param filePath - The file path to check\n * @returns An indicator specifying if the file exists\n */\nexport function existsSync(filePath: string): boolean {\n return existsSyncFs(filePath);\n}\n\n/**\n * Check if a file exists\n *\n * @param filePath - The file path to check\n * @returns An indicator specifying if the file exists\n */\nexport async function exists(filePath: string): Promise<boolean> {\n return access(filePath, constants.F_OK)\n .then(() => true)\n .catch(() => false);\n}\n"],"mappings":"8FA2BA,SAAgBA,EAAW,EAA2B,CACpD,OAAOC,EAAa,EAAS,CAS/B,eAAsB,EAAO,EAAoC,CAC/D,OAAO,EAAO,EAAUC,EAAU,KAAK,CACpC,SAAW,GAAK,CAChB,UAAY,GAAM"}
package/dist/exists.cjs CHANGED
@@ -1,15 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.exists = exists;
7
- exports.existsSync = existsSync;
8
- var _nodeFs = require("node:fs");
9
- var _promises = require("node:fs/promises");
10
- function existsSync(s) {
11
- return (0, _nodeFs.existsSync)(s);
12
- }
13
- async function exists(s) {
14
- return (0, _promises.access)(s, _promises.constants.F_OK).then(() => !0).catch(() => !1);
15
- }
1
+ const e=require(`./exists-B31lSRFp.cjs`);exports.exists=e.t,exports.existsSync=e.n;
@@ -0,0 +1,2 @@
1
+ import { n as existsSync, t as exists } from "./exists-CVlDImzc.cjs";
2
+ export { exists, existsSync };
@@ -0,0 +1,2 @@
1
+ import { n as existsSync, t as exists } from "./exists-175EN367.mjs";
2
+ export { exists, existsSync };
package/dist/exists.mjs CHANGED
@@ -1 +1 @@
1
- import{existsSync as t}from"node:fs";import{access as n,constants as e}from"node:fs/promises";export function existsSync(s){return t(s)}export async function exists(s){return n(s,e.F_OK).then(()=>!0).catch(()=>!1)}
1
+ import{n as e,t}from"./exists-Ci-9lYmi.mjs";export{t as exists,e as existsSync};
@@ -0,0 +1,32 @@
1
+ //#region ../types/src/file.d.ts
2
+
3
+ /**
4
+ * A valid `picomatch` glob pattern, or array of patterns.
5
+ */
6
+ type FilterPattern = ReadonlyArray<string | RegExp> | string | RegExp | null;
7
+ interface FileInputOutput {
8
+ input: string;
9
+ output: string;
10
+ }
11
+ /**
12
+ * An interface got representing an asset files with glob patterns.
13
+ */
14
+ type AssetGlob = Required<Omit<FileInputOutput, "input">> & Partial<Pick<FileInputOutput, "input">> & {
15
+ /**
16
+ * A glob pattern to match files.
17
+ */
18
+ glob: string;
19
+ /**
20
+ * An array of glob patterns to ignore files.
21
+ */
22
+ ignore?: string[];
23
+ /**
24
+ * Include `.dot` files in normal matches and `globstar` matches. Note that an explicit dot in a portion of the pattern will always match dot files.
25
+ *
26
+ * @defaultValue true
27
+ */
28
+ dot?: boolean;
29
+ };
30
+ //#endregion
31
+ export { FilterPattern as n, AssetGlob as t };
32
+ //# sourceMappingURL=file-D1uBqkpP.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-D1uBqkpP.d.cts","names":[],"sources":["../../types/src/file.ts"],"sourcesContent":[],"mappings":";;;;;KA8CY,aAAA,GACR,uBAAuB,mBAEvB;UAGa,eAAA;;;;;;;KAQL,SAAA,GAAY,SAAS,KAAK,6BACpC,QAAQ,KAAK"}
@@ -0,0 +1,32 @@
1
+ //#region ../types/src/file.d.ts
2
+
3
+ /**
4
+ * A valid `picomatch` glob pattern, or array of patterns.
5
+ */
6
+ type FilterPattern = ReadonlyArray<string | RegExp> | string | RegExp | null;
7
+ interface FileInputOutput {
8
+ input: string;
9
+ output: string;
10
+ }
11
+ /**
12
+ * An interface got representing an asset files with glob patterns.
13
+ */
14
+ type AssetGlob = Required<Omit<FileInputOutput, "input">> & Partial<Pick<FileInputOutput, "input">> & {
15
+ /**
16
+ * A glob pattern to match files.
17
+ */
18
+ glob: string;
19
+ /**
20
+ * An array of glob patterns to ignore files.
21
+ */
22
+ ignore?: string[];
23
+ /**
24
+ * Include `.dot` files in normal matches and `globstar` matches. Note that an explicit dot in a portion of the pattern will always match dot files.
25
+ *
26
+ * @defaultValue true
27
+ */
28
+ dot?: boolean;
29
+ };
30
+ //#endregion
31
+ export { FilterPattern as n, AssetGlob as t };
32
+ //# sourceMappingURL=file-DauFFmfh.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-DauFFmfh.d.mts","names":[],"sources":["../../types/src/file.ts"],"sourcesContent":[],"mappings":";;;;;KA8CY,aAAA,GACR,uBAAuB,mBAEvB;UAGa,eAAA;;;;;;;KAQL,SAAA,GAAY,SAAS,KAAK,6BACpC,QAAQ,KAAK"}
@@ -0,0 +1 @@
1
+ const e=require(`./cwd-o2vq8Tk9.cjs`),t=require(`./join-paths-DUdaieID.cjs`),n=require(`./is-set-string-CLeu8BKX.cjs`);function r(e,n){let r=t.n(e.replace(/\\/g,`/`).replace(/\/$/,``)),i=t.n(n.replace(/\\/g,`/`).replace(/\/$/,``));return r!==i&&r.startsWith(`${i}/`)}function i(n,i=e.t()){return t.n(r(n,i)?n:t.t(i,n))}function a(e,t){return`${e}.${t.replace(/^\./,``)}`}function o(e=``){return e&&t.n(e).replace(t.s,e=>e.toUpperCase())}function s(e){if(!e||e.length===0)return`.`;e=o(e);let n=e.match(t.u),r=t.i(e),i=e.endsWith(`/`);return e=l(e,!r),e.length===0?r?`/`:i?`./`:`.`:(i&&(e+=`/`),t.o.test(e)&&(e+=`/`),n?r?`//${e}`:`//./${e}`:!e.startsWith(`/`)&&r&&!t.o.test(e)?`/${e}`:e)}function c(e){if(!e||e.length===0)return`.`;e=s(e);let t=!1;return e.split(`/`).reduce((e,n)=>n?.trim()?t||n.includes(`*`)?(t=!0,e):e+(e?`/${n}`:n):e,``)}function l(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(!(i===s-1||a===1))if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}else if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}function u(n,r=e.t()){return t.i(n)?n:t.n(l(i(n,r),!0))}const d=``;function f(e,t={}){let{requireExtension:n=!1,withExtension:r=!0}=t,i=o(e)?.split(e?.includes(`\\`)?`\\`:`/`)?.pop()??``;return n===!0&&!i.includes(`.`)?``:r===!1&&i.includes(`.`)?i.replace(`.${h(i)??``}`,``)||``:i}function p(e,t={}){let n=o(e),r=n.replace(f(n,{requireExtension:!1,...t}),``);return r===`/`?r:r.replace(/\/$/,``)}function m(e,t){let n=p(e,t).split(`/`),r=``;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t){r=t;break}}return r??``}function h(e){if(e.endsWith(`.`)||e.endsWith(`/`))return;let r=t.c.exec(o(e));return r&&r.length>0&&n.t(r[0])?r[0].replace(`.`,``):void 0}function g(e){return!!h(e)}function _(...n){n=n.map(e=>o(e));let r=``,i=!1;for(let a=n.length-1;a>=-1&&!i;a--){let o=a>=0?n[a]:e.t();!o||o.length===0||(r=`${o}/${r}`,i=t.r(o))}return r=l(r,!i),i&&!t.r(r)?`/${r}`:r.length>0?r:`.`}function v(e,n){let r=_(e).replace(t.l,`$1`).split(`/`),i=_(n).replace(t.l,`$1`).split(`/`);if(i[0][1]===`:`&&r[0][1]===`:`&&r[0]!==i[0])return i.join(`/`);let a=[...r];for(let e of a){if(i[0]!==e)break;r.shift(),i.shift()}return[...r.map(()=>`..`),...i].join(`/`)}function y(e,t,n=!1){return v(n===!0?e:e.replace(/\/$/,``),n===!0?t:t.replace(/\/$/,``))}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return``}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return u}});
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./cwd-YTg9Cx6C.mjs";import{c as t,i as n,l as r,n as i,o as a,r as o,s,t as c,u as l}from"./join-paths-BHepkhAj.mjs";import{t as u}from"./is-set-string-Cj0g4gsG.mjs";function d(e,t){let n=i(e.replace(/\\/g,`/`).replace(/\/$/,``)),r=i(t.replace(/\\/g,`/`).replace(/\/$/,``));return n!==r&&n.startsWith(`${r}/`)}function f(t,n=e()){return i(d(t,n)?t:c(n,t))}function p(e,t){return`${e}.${t.replace(/^\./,``)}`}function m(e=``){return e&&i(e).replace(s,e=>e.toUpperCase())}function h(e){if(!e||e.length===0)return`.`;e=m(e);let t=e.match(l),r=n(e),i=e.endsWith(`/`);return e=_(e,!r),e.length===0?r?`/`:i?`./`:`.`:(i&&(e+=`/`),a.test(e)&&(e+=`/`),t?r?`//${e}`:`//./${e}`:!e.startsWith(`/`)&&r&&!a.test(e)?`/${e}`:e)}function g(e){if(!e||e.length===0)return`.`;e=h(e);let t=!1;return e.split(`/`).reduce((e,n)=>n?.trim()?t||n.includes(`*`)?(t=!0,e):e+(e?`/${n}`:n):e,``)}function _(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(!(i===s-1||a===1))if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}else if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}function v(t,r=e()){return n(t)?t:i(_(f(t,r),!0))}const y=``;function b(e,t={}){let{requireExtension:n=!1,withExtension:r=!0}=t,i=m(e)?.split(e?.includes(`\\`)?`\\`:`/`)?.pop()??``;return n===!0&&!i.includes(`.`)?``:r===!1&&i.includes(`.`)?i.replace(`.${C(i)??``}`,``)||``:i}function x(e,t={}){let n=m(e),r=n.replace(b(n,{requireExtension:!1,...t}),``);return r===`/`?r:r.replace(/\/$/,``)}function S(e,t){let n=x(e,t).split(`/`),r=``;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t){r=t;break}}return r??``}function C(e){if(e.endsWith(`.`)||e.endsWith(`/`))return;let n=t.exec(m(e));return n&&n.length>0&&u(n[0])?n[0].replace(`.`,``):void 0}function w(e){return!!C(e)}function T(...t){t=t.map(e=>m(e));let n=``,r=!1;for(let i=t.length-1;i>=-1&&!r;i--){let a=i>=0?t[i]:e();!a||a.length===0||(n=`${a}/${n}`,r=o(a))}return n=_(n,!r),r&&!o(n)?`/${n}`:n.length>0?n:`.`}function E(e,t){let n=T(e).replace(r,`$1`).split(`/`),i=T(t).replace(r,`$1`).split(`/`);if(i[0][1]===`:`&&n[0][1]===`:`&&n[0]!==i[0])return i.join(`/`);let a=[...n];for(let e of a){if(i[0]!==e)break;n.shift(),i.shift()}return[...n.map(()=>`..`),...i].join(`/`)}function D(e,t,n=!1){return E(n===!0?e:e.replace(/\/$/,``),n===!0?t:t.replace(/\/$/,``))}export{w as a,h as c,p as d,d as f,S as i,g as l,b as n,D as o,x as r,y as s,C as t,v as u};
2
+ //# sourceMappingURL=file-path-fns-BDzC2SIV.mjs.map