@stryke/fs 0.33.20 → 0.33.21

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 (494) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/{chunk-Bmb41Sf3.cjs → _virtual/rolldown_runtime.cjs} +1 -1
  3. package/dist/buffer.cjs +1 -1
  4. package/dist/buffer.d.cts +32 -2
  5. package/dist/buffer.d.cts.map +1 -0
  6. package/dist/buffer.d.mts +32 -2
  7. package/dist/buffer.d.mts.map +1 -0
  8. package/dist/buffer.mjs +2 -1
  9. package/dist/buffer.mjs.map +1 -0
  10. package/dist/chmod-x.cjs +1 -1
  11. package/dist/chmod-x.d.cts +44 -2
  12. package/dist/chmod-x.d.cts.map +1 -0
  13. package/dist/chmod-x.d.mts +44 -2
  14. package/dist/chmod-x.d.mts.map +1 -0
  15. package/dist/chmod-x.mjs +2 -1
  16. package/dist/chmod-x.mjs.map +1 -0
  17. package/dist/command-exists.cjs +1 -1
  18. package/dist/command-exists.d.cts +22 -2
  19. package/dist/command-exists.d.cts.map +1 -0
  20. package/dist/command-exists.d.mts +22 -2
  21. package/dist/command-exists.d.mts.map +1 -0
  22. package/dist/command-exists.mjs +2 -1
  23. package/dist/command-exists.mjs.map +1 -0
  24. package/dist/compress.cjs +1 -1
  25. package/dist/compress.d.cts +16 -2
  26. package/dist/compress.d.cts.map +1 -0
  27. package/dist/compress.d.mts +16 -2
  28. package/dist/compress.d.mts.map +1 -0
  29. package/dist/compress.mjs +2 -1
  30. package/dist/compress.mjs.map +1 -0
  31. package/dist/constants.d.cts +5 -2
  32. package/dist/constants.d.cts.map +1 -0
  33. package/dist/constants.d.mts +5 -2
  34. package/dist/constants.d.mts.map +1 -0
  35. package/dist/convert/src/array-buffer-to-string.cjs +1 -0
  36. package/dist/convert/src/array-buffer-to-string.mjs +2 -0
  37. package/dist/convert/src/array-buffer-to-string.mjs.map +1 -0
  38. package/dist/convert/src/to-array.cjs +1 -0
  39. package/dist/convert/src/to-array.mjs +2 -0
  40. package/dist/convert/src/to-array.mjs.map +1 -0
  41. package/dist/convert/src/uint8-array-to-string.cjs +1 -0
  42. package/dist/convert/src/uint8-array-to-string.mjs +2 -0
  43. package/dist/convert/src/uint8-array-to-string.mjs.map +1 -0
  44. package/dist/copy-file.cjs +1 -1
  45. package/dist/copy-file.d.cts +39 -2
  46. package/dist/copy-file.d.cts.map +1 -0
  47. package/dist/copy-file.d.mts +39 -2
  48. package/dist/copy-file.d.mts.map +1 -0
  49. package/dist/copy-file.mjs +2 -1
  50. package/dist/copy-file.mjs.map +1 -0
  51. package/dist/exists.cjs +1 -1
  52. package/dist/exists.d.cts +18 -2
  53. package/dist/exists.d.cts.map +1 -0
  54. package/dist/exists.d.mts +18 -2
  55. package/dist/exists.d.mts.map +1 -0
  56. package/dist/exists.mjs +2 -1
  57. package/dist/exists.mjs.map +1 -0
  58. package/dist/get-parent-path.cjs +1 -1
  59. package/dist/get-parent-path.d.cts +32 -2
  60. package/dist/get-parent-path.d.cts.map +1 -0
  61. package/dist/get-parent-path.d.mts +32 -2
  62. package/dist/get-parent-path.d.mts.map +1 -0
  63. package/dist/get-parent-path.mjs +2 -1
  64. package/dist/get-parent-path.mjs.map +1 -0
  65. package/dist/get-workspace-root.cjs +1 -1
  66. package/dist/get-workspace-root.d.cts +48 -2
  67. package/dist/get-workspace-root.d.cts.map +1 -0
  68. package/dist/get-workspace-root.d.mts +48 -2
  69. package/dist/get-workspace-root.d.mts.map +1 -0
  70. package/dist/get-workspace-root.mjs +2 -1
  71. package/dist/get-workspace-root.mjs.map +1 -0
  72. package/dist/helpers/src/get-unique.cjs +1 -0
  73. package/dist/helpers/src/get-unique.mjs +2 -0
  74. package/dist/helpers/src/get-unique.mjs.map +1 -0
  75. package/dist/helpers.cjs +1 -1
  76. package/dist/helpers.d.cts +50 -2
  77. package/dist/helpers.d.cts.map +1 -0
  78. package/dist/helpers.d.mts +50 -2
  79. package/dist/helpers.d.mts.map +1 -0
  80. package/dist/helpers.mjs +2 -1
  81. package/dist/helpers.mjs.map +1 -0
  82. package/dist/index.cjs +1 -1
  83. package/dist/index.d.cts +24 -24
  84. package/dist/index.d.mts +24 -24
  85. package/dist/index.mjs +1 -1
  86. package/dist/install.cjs +1 -1
  87. package/dist/install.d.cts +28 -2
  88. package/dist/install.d.cts.map +1 -0
  89. package/dist/install.d.mts +29 -2
  90. package/dist/install.d.mts.map +1 -0
  91. package/dist/install.mjs +2 -1
  92. package/dist/install.mjs.map +1 -0
  93. package/dist/is-file.cjs +1 -1
  94. package/dist/is-file.d.cts +36 -2
  95. package/dist/is-file.d.cts.map +1 -0
  96. package/dist/is-file.d.mts +36 -2
  97. package/dist/is-file.d.mts.map +1 -0
  98. package/dist/is-file.mjs +2 -1
  99. package/dist/is-file.mjs.map +1 -0
  100. package/dist/json/src/storm-json.cjs +1 -0
  101. package/dist/json/src/storm-json.mjs +2 -0
  102. package/dist/json/src/storm-json.mjs.map +1 -0
  103. package/dist/json/src/types.d.cts +33 -0
  104. package/dist/json/src/types.d.cts.map +1 -0
  105. package/dist/json/src/types.d.mts +33 -0
  106. package/dist/json/src/types.d.mts.map +1 -0
  107. package/dist/json/src/utils/code-frames.cjs +3 -0
  108. package/dist/json/src/utils/code-frames.mjs +4 -0
  109. package/dist/json/src/utils/code-frames.mjs.map +1 -0
  110. package/dist/json/src/utils/parse-error.cjs +1 -0
  111. package/dist/json/src/utils/parse-error.mjs +2 -0
  112. package/dist/json/src/utils/parse-error.mjs.map +1 -0
  113. package/dist/json/src/utils/parse.cjs +1 -0
  114. package/dist/json/src/utils/parse.mjs +2 -0
  115. package/dist/json/src/utils/parse.mjs.map +1 -0
  116. package/dist/json/src/utils/stringify.cjs +1 -0
  117. package/dist/json/src/utils/stringify.mjs +2 -0
  118. package/dist/json/src/utils/stringify.mjs.map +1 -0
  119. package/dist/json/src/utils/strip-comments.cjs +4 -0
  120. package/dist/json/src/utils/strip-comments.mjs +5 -0
  121. package/dist/json/src/utils/strip-comments.mjs.map +1 -0
  122. package/dist/json.cjs +1 -1
  123. package/dist/json.d.cts +54 -2
  124. package/dist/json.d.cts.map +1 -0
  125. package/dist/json.d.mts +54 -2
  126. package/dist/json.d.mts.map +1 -0
  127. package/dist/json.mjs +2 -1
  128. package/dist/json.mjs.map +1 -0
  129. package/dist/list-files.cjs +1 -1
  130. package/dist/list-files.d.cts +51 -2
  131. package/dist/list-files.d.cts.map +1 -0
  132. package/dist/list-files.d.mts +51 -2
  133. package/dist/list-files.d.mts.map +1 -0
  134. package/dist/list-files.mjs +2 -1
  135. package/dist/list-files.mjs.map +1 -0
  136. package/dist/package-fns.cjs +1 -1
  137. package/dist/package-fns.d.cts +95 -2
  138. package/dist/package-fns.d.cts.map +1 -0
  139. package/dist/package-fns.d.mts +95 -2
  140. package/dist/package-fns.d.mts.map +1 -0
  141. package/dist/package-fns.mjs +2 -1
  142. package/dist/package-fns.mjs.map +1 -0
  143. package/dist/path/src/append.cjs +1 -0
  144. package/dist/path/src/append.mjs +2 -0
  145. package/dist/path/src/append.mjs.map +1 -0
  146. package/dist/path/src/correct-path.cjs +1 -0
  147. package/dist/path/src/correct-path.mjs +2 -0
  148. package/dist/path/src/correct-path.mjs.map +1 -0
  149. package/dist/path/src/cwd.cjs +1 -0
  150. package/dist/path/src/cwd.mjs +2 -0
  151. package/dist/path/src/cwd.mjs.map +1 -0
  152. package/dist/path/src/file-path-fns.cjs +1 -0
  153. package/dist/path/src/file-path-fns.mjs +2 -0
  154. package/dist/path/src/file-path-fns.mjs.map +1 -0
  155. package/dist/path/src/is-parent-path.cjs +1 -0
  156. package/dist/path/src/is-parent-path.mjs +2 -0
  157. package/dist/path/src/is-parent-path.mjs.map +1 -0
  158. package/dist/path/src/is-root-dir.cjs +1 -0
  159. package/dist/path/src/is-root-dir.mjs +2 -0
  160. package/dist/path/src/is-root-dir.mjs.map +1 -0
  161. package/dist/path/src/is-type.cjs +1 -0
  162. package/dist/path/src/is-type.mjs +2 -0
  163. package/dist/path/src/is-type.mjs.map +1 -0
  164. package/dist/path/src/join-paths.cjs +1 -0
  165. package/dist/path/src/join-paths.mjs +2 -0
  166. package/dist/path/src/join-paths.mjs.map +1 -0
  167. package/dist/path/src/regex.cjs +1 -0
  168. package/dist/path/src/regex.mjs +2 -0
  169. package/dist/path/src/regex.mjs.map +1 -0
  170. package/dist/path/src/replace.cjs +1 -0
  171. package/dist/path/src/replace.mjs +2 -0
  172. package/dist/path/src/replace.mjs.map +1 -0
  173. package/dist/path/src/resolve-parent-path.cjs +1 -0
  174. package/dist/path/src/resolve-parent-path.mjs +2 -0
  175. package/dist/path/src/resolve-parent-path.mjs.map +1 -0
  176. package/dist/path/src/slash.cjs +1 -0
  177. package/dist/path/src/slash.mjs +2 -0
  178. package/dist/path/src/slash.mjs.map +1 -0
  179. package/dist/read-file.cjs +1 -1
  180. package/dist/read-file.d.cts +30 -2
  181. package/dist/read-file.d.cts.map +1 -0
  182. package/dist/read-file.d.mts +30 -2
  183. package/dist/read-file.d.mts.map +1 -0
  184. package/dist/read-file.mjs +2 -1
  185. package/dist/read-file.mjs.map +1 -0
  186. package/dist/registry.cjs +1 -1
  187. package/dist/registry.d.cts +53 -2
  188. package/dist/registry.d.cts.map +1 -0
  189. package/dist/registry.d.mts +53 -2
  190. package/dist/registry.d.mts.map +1 -0
  191. package/dist/registry.mjs +2 -1
  192. package/dist/registry.mjs.map +1 -0
  193. package/dist/remove-file.cjs +1 -1
  194. package/dist/remove-file.d.cts +16 -2
  195. package/dist/remove-file.d.cts.map +1 -0
  196. package/dist/remove-file.d.mts +16 -2
  197. package/dist/remove-file.d.mts.map +1 -0
  198. package/dist/remove-file.mjs +2 -1
  199. package/dist/remove-file.mjs.map +1 -0
  200. package/dist/resolve.cjs +3 -1
  201. package/dist/resolve.d.cts +106 -2
  202. package/dist/resolve.d.cts.map +1 -0
  203. package/dist/resolve.d.mts +106 -2
  204. package/dist/resolve.d.mts.map +1 -0
  205. package/dist/resolve.mjs +4 -1
  206. package/dist/resolve.mjs.map +1 -0
  207. package/dist/semver-fns.cjs +1 -1
  208. package/dist/semver-fns.d.cts +92 -2
  209. package/dist/semver-fns.d.cts.map +1 -0
  210. package/dist/semver-fns.d.mts +92 -2
  211. package/dist/semver-fns.d.mts.map +1 -0
  212. package/dist/semver-fns.mjs +2 -1
  213. package/dist/semver-fns.mjs.map +1 -0
  214. package/dist/string-format/src/package.cjs +1 -0
  215. package/dist/string-format/src/package.mjs +2 -0
  216. package/dist/string-format/src/package.mjs.map +1 -0
  217. package/dist/toml.cjs +3 -1
  218. package/dist/toml.d.cts +81 -2
  219. package/dist/toml.d.cts.map +1 -0
  220. package/dist/toml.d.mts +81 -2
  221. package/dist/toml.d.mts.map +1 -0
  222. package/dist/toml.mjs +4 -1
  223. package/dist/toml.mjs.map +1 -0
  224. package/dist/tsconfig.cjs +1 -1
  225. package/dist/tsconfig.d.cts +14 -2
  226. package/dist/tsconfig.d.cts.map +1 -0
  227. package/dist/tsconfig.d.mts +14 -2
  228. package/dist/tsconfig.d.mts.map +1 -0
  229. package/dist/tsconfig.mjs +2 -1
  230. package/dist/tsconfig.mjs.map +1 -0
  231. package/dist/type-checks/src/get-object-tag.cjs +1 -0
  232. package/dist/type-checks/src/get-object-tag.mjs +2 -0
  233. package/dist/type-checks/src/get-object-tag.mjs.map +1 -0
  234. package/dist/type-checks/src/index.cjs +1 -0
  235. package/dist/type-checks/src/index.mjs +1 -0
  236. package/dist/type-checks/src/is-buffer.cjs +1 -0
  237. package/dist/type-checks/src/is-buffer.mjs +2 -0
  238. package/dist/type-checks/src/is-buffer.mjs.map +1 -0
  239. package/dist/type-checks/src/is-collection.cjs +1 -0
  240. package/dist/type-checks/src/is-collection.mjs +1 -0
  241. package/dist/type-checks/src/is-empty.cjs +1 -0
  242. package/dist/type-checks/src/is-empty.mjs +2 -0
  243. package/dist/type-checks/src/is-empty.mjs.map +1 -0
  244. package/dist/type-checks/src/is-error.cjs +1 -0
  245. package/dist/type-checks/src/is-error.mjs +2 -0
  246. package/dist/type-checks/src/is-error.mjs.map +1 -0
  247. package/dist/type-checks/src/is-null.cjs +1 -0
  248. package/dist/type-checks/src/is-null.mjs +2 -0
  249. package/dist/type-checks/src/is-null.mjs.map +1 -0
  250. package/dist/type-checks/src/is-number.cjs +1 -0
  251. package/dist/type-checks/src/is-number.mjs +2 -0
  252. package/dist/type-checks/src/is-number.mjs.map +1 -0
  253. package/dist/type-checks/src/is-object.cjs +1 -0
  254. package/dist/type-checks/src/is-object.mjs +2 -0
  255. package/dist/type-checks/src/is-object.mjs.map +1 -0
  256. package/dist/type-checks/src/is-plain-object.cjs +1 -0
  257. package/dist/type-checks/src/is-plain-object.mjs +2 -0
  258. package/dist/type-checks/src/is-plain-object.mjs.map +1 -0
  259. package/dist/type-checks/src/is-set-string.cjs +1 -0
  260. package/dist/type-checks/src/is-set-string.mjs +2 -0
  261. package/dist/type-checks/src/is-set-string.mjs.map +1 -0
  262. package/dist/type-checks/src/is-set.cjs +1 -0
  263. package/dist/type-checks/src/is-set.mjs +2 -0
  264. package/dist/type-checks/src/is-set.mjs.map +1 -0
  265. package/dist/type-checks/src/is-string.cjs +1 -0
  266. package/dist/type-checks/src/is-string.mjs +2 -0
  267. package/dist/type-checks/src/is-string.mjs.map +1 -0
  268. package/dist/type-checks/src/is-undefined.cjs +1 -0
  269. package/dist/type-checks/src/is-undefined.mjs +2 -0
  270. package/dist/type-checks/src/is-undefined.mjs.map +1 -0
  271. package/dist/type-checks/src/type-detect.cjs +1 -0
  272. package/dist/type-checks/src/type-detect.mjs +2 -0
  273. package/dist/type-checks/src/type-detect.mjs.map +1 -0
  274. package/dist/types/src/base.cjs +1 -0
  275. package/dist/types/src/base.mjs +2 -0
  276. package/dist/types/src/base.mjs.map +1 -0
  277. package/dist/{file-D1uBqkpP.d.cts → types/src/file.d.cts} +2 -2
  278. package/dist/types/src/file.d.cts.map +1 -0
  279. package/dist/{file-DauFFmfh.d.mts → types/src/file.d.mts} +2 -2
  280. package/dist/types/src/file.d.mts.map +1 -0
  281. package/dist/{package-fns-CxokaGDY.d.mts → types/src/package-json.d.cts} +2 -95
  282. package/dist/types/src/package-json.d.cts.map +1 -0
  283. package/dist/{package-fns-BNRi_Rpc.d.cts → types/src/package-json.d.mts} +2 -95
  284. package/dist/types/src/package-json.d.mts.map +1 -0
  285. package/dist/types/src/package-manager.d.cts +5 -0
  286. package/dist/types/src/package-manager.d.cts.map +1 -0
  287. package/dist/types/src/package-manager.d.mts +5 -0
  288. package/dist/types/src/package-manager.d.mts.map +1 -0
  289. package/dist/{tsconfig-B13IMV_0.d.mts → types/src/tsconfig.d.cts} +3 -12
  290. package/dist/types/src/tsconfig.d.cts.map +1 -0
  291. package/dist/{tsconfig-C8ecu1-0.d.cts → types/src/tsconfig.d.mts} +3 -12
  292. package/dist/types/src/tsconfig.d.mts.map +1 -0
  293. package/dist/write-file.cjs +1 -1
  294. package/dist/write-file.d.cts +35 -2
  295. package/dist/write-file.d.cts.map +1 -0
  296. package/dist/write-file.d.mts +35 -2
  297. package/dist/write-file.d.mts.map +1 -0
  298. package/dist/write-file.mjs +2 -1
  299. package/dist/write-file.mjs.map +1 -0
  300. package/dist/yaml.cjs +1 -1
  301. package/dist/yaml.d.cts +23 -2
  302. package/dist/yaml.d.cts.map +1 -0
  303. package/dist/yaml.d.mts +23 -2
  304. package/dist/yaml.d.mts.map +1 -0
  305. package/dist/yaml.mjs +2 -1
  306. package/dist/yaml.mjs.map +1 -0
  307. package/package.json +11 -11
  308. package/dist/buffer-Ch164vki.cjs +0 -1
  309. package/dist/buffer-DDq-CW4J.mjs +0 -2
  310. package/dist/buffer-DDq-CW4J.mjs.map +0 -1
  311. package/dist/buffer-DgfUmhrc.d.mts +0 -32
  312. package/dist/buffer-DgfUmhrc.d.mts.map +0 -1
  313. package/dist/buffer-DvCjrjQH.d.cts +0 -32
  314. package/dist/buffer-DvCjrjQH.d.cts.map +0 -1
  315. package/dist/chmod-x-BPr4tt2-.d.cts +0 -44
  316. package/dist/chmod-x-BPr4tt2-.d.cts.map +0 -1
  317. package/dist/chmod-x-FOy3sak8.cjs +0 -1
  318. package/dist/chmod-x-QCk1GmQJ.d.mts +0 -44
  319. package/dist/chmod-x-QCk1GmQJ.d.mts.map +0 -1
  320. package/dist/chmod-x-q-TWdus7.mjs +0 -2
  321. package/dist/chmod-x-q-TWdus7.mjs.map +0 -1
  322. package/dist/command-exists-CuieR7rx.d.cts +0 -22
  323. package/dist/command-exists-CuieR7rx.d.cts.map +0 -1
  324. package/dist/command-exists-D1bV-wSk.cjs +0 -1
  325. package/dist/command-exists-Dzb2kKT4.mjs +0 -2
  326. package/dist/command-exists-Dzb2kKT4.mjs.map +0 -1
  327. package/dist/command-exists-dBdtR0xj.d.mts +0 -22
  328. package/dist/command-exists-dBdtR0xj.d.mts.map +0 -1
  329. package/dist/compress-BiTxso15.mjs +0 -2
  330. package/dist/compress-BiTxso15.mjs.map +0 -1
  331. package/dist/compress-BjGbQqs_.cjs +0 -1
  332. package/dist/compress-CLAaOwH3.d.mts +0 -16
  333. package/dist/compress-CLAaOwH3.d.mts.map +0 -1
  334. package/dist/compress-CQve2a6h.d.cts +0 -16
  335. package/dist/compress-CQve2a6h.d.cts.map +0 -1
  336. package/dist/constants-D58o2CiO.d.cts +0 -5
  337. package/dist/constants-D58o2CiO.d.cts.map +0 -1
  338. package/dist/constants-DZz9LJgo.d.mts +0 -5
  339. package/dist/constants-DZz9LJgo.d.mts.map +0 -1
  340. package/dist/copy-file-B5FJHiIK.d.mts +0 -39
  341. package/dist/copy-file-B5FJHiIK.d.mts.map +0 -1
  342. package/dist/copy-file-Bot2YNtT.mjs +0 -2
  343. package/dist/copy-file-Bot2YNtT.mjs.map +0 -1
  344. package/dist/copy-file-DjH2Ho5e.d.cts +0 -39
  345. package/dist/copy-file-DjH2Ho5e.d.cts.map +0 -1
  346. package/dist/copy-file-Y1ilzocZ.cjs +0 -1
  347. package/dist/cwd-YTg9Cx6C.mjs +0 -2
  348. package/dist/cwd-YTg9Cx6C.mjs.map +0 -1
  349. package/dist/cwd-o2vq8Tk9.cjs +0 -1
  350. package/dist/exists-175EN367.d.mts +0 -18
  351. package/dist/exists-175EN367.d.mts.map +0 -1
  352. package/dist/exists-B31lSRFp.cjs +0 -1
  353. package/dist/exists-CVlDImzc.d.cts +0 -18
  354. package/dist/exists-CVlDImzc.d.cts.map +0 -1
  355. package/dist/exists-Ci-9lYmi.mjs +0 -2
  356. package/dist/exists-Ci-9lYmi.mjs.map +0 -1
  357. package/dist/file-D1uBqkpP.d.cts.map +0 -1
  358. package/dist/file-DauFFmfh.d.mts.map +0 -1
  359. package/dist/file-path-fns-7aKacdLg.cjs +0 -1
  360. package/dist/file-path-fns-BDzC2SIV.mjs +0 -2
  361. package/dist/file-path-fns-BDzC2SIV.mjs.map +0 -1
  362. package/dist/get-parent-path-COkh6Pvl.d.mts +0 -32
  363. package/dist/get-parent-path-COkh6Pvl.d.mts.map +0 -1
  364. package/dist/get-parent-path-Cbqs2km7.d.cts +0 -32
  365. package/dist/get-parent-path-Cbqs2km7.d.cts.map +0 -1
  366. package/dist/get-parent-path-CfRkaB4R.cjs +0 -1
  367. package/dist/get-parent-path-DLFSyxSW.mjs +0 -2
  368. package/dist/get-parent-path-DLFSyxSW.mjs.map +0 -1
  369. package/dist/get-workspace-root-CCNjjZGY.cjs +0 -1
  370. package/dist/get-workspace-root-DQBvBd8X.d.mts +0 -48
  371. package/dist/get-workspace-root-DQBvBd8X.d.mts.map +0 -1
  372. package/dist/get-workspace-root-eTfm1jII.d.cts +0 -48
  373. package/dist/get-workspace-root-eTfm1jII.d.cts.map +0 -1
  374. package/dist/get-workspace-root-k66w-wLW.mjs +0 -2
  375. package/dist/get-workspace-root-k66w-wLW.mjs.map +0 -1
  376. package/dist/helpers-BSEQb1fp.mjs +0 -2
  377. package/dist/helpers-BSEQb1fp.mjs.map +0 -1
  378. package/dist/helpers-CYWFZ-Uv.d.mts +0 -50
  379. package/dist/helpers-CYWFZ-Uv.d.mts.map +0 -1
  380. package/dist/helpers-CgMOExPa.d.cts +0 -50
  381. package/dist/helpers-CgMOExPa.d.cts.map +0 -1
  382. package/dist/helpers-_MJ6PR-g.cjs +0 -1
  383. package/dist/install-B3bIjHoU.mjs +0 -2
  384. package/dist/install-B3bIjHoU.mjs.map +0 -1
  385. package/dist/install-CZ_S7NHm.cjs +0 -1
  386. package/dist/install-CxPsLO2t.d.cts +0 -28
  387. package/dist/install-CxPsLO2t.d.cts.map +0 -1
  388. package/dist/install-dYt7hlQn.d.mts +0 -29
  389. package/dist/install-dYt7hlQn.d.mts.map +0 -1
  390. package/dist/is-error-CjEyTRps.cjs +0 -1
  391. package/dist/is-error-CjVXmD_8.mjs +0 -2
  392. package/dist/is-error-CjVXmD_8.mjs.map +0 -1
  393. package/dist/is-file-BkFQev3M.cjs +0 -1
  394. package/dist/is-file-CNooe8Wz.mjs +0 -2
  395. package/dist/is-file-CNooe8Wz.mjs.map +0 -1
  396. package/dist/is-file-DjqOQrqY.d.mts +0 -36
  397. package/dist/is-file-DjqOQrqY.d.mts.map +0 -1
  398. package/dist/is-file-DoBi2FN9.d.cts +0 -36
  399. package/dist/is-file-DoBi2FN9.d.cts.map +0 -1
  400. package/dist/is-object-FBXmvehR.cjs +0 -1
  401. package/dist/is-object-UsKYhyC5.mjs +0 -2
  402. package/dist/is-object-UsKYhyC5.mjs.map +0 -1
  403. package/dist/is-set-string-CLeu8BKX.cjs +0 -1
  404. package/dist/is-set-string-Cj0g4gsG.mjs +0 -2
  405. package/dist/is-set-string-Cj0g4gsG.mjs.map +0 -1
  406. package/dist/is-string-91Z3dOKQ.mjs +0 -2
  407. package/dist/is-string-91Z3dOKQ.mjs.map +0 -1
  408. package/dist/is-string-DKgNS0jA.cjs +0 -1
  409. package/dist/join-paths-BHepkhAj.mjs +0 -2
  410. package/dist/join-paths-BHepkhAj.mjs.map +0 -1
  411. package/dist/join-paths-DUdaieID.cjs +0 -1
  412. package/dist/json-CYenVxvr.d.cts +0 -83
  413. package/dist/json-CYenVxvr.d.cts.map +0 -1
  414. package/dist/json-DH7Q6Ftp.d.mts +0 -83
  415. package/dist/json-DH7Q6Ftp.d.mts.map +0 -1
  416. package/dist/json-DKhqPjHB.cjs +0 -6
  417. package/dist/json-Dp4PSH2i.mjs +0 -7
  418. package/dist/json-Dp4PSH2i.mjs.map +0 -1
  419. package/dist/list-files-Cn_UVruo.cjs +0 -1
  420. package/dist/list-files-D3dQOljX.d.cts +0 -51
  421. package/dist/list-files-D3dQOljX.d.cts.map +0 -1
  422. package/dist/list-files-D3iJzEQw.d.mts +0 -51
  423. package/dist/list-files-D3iJzEQw.d.mts.map +0 -1
  424. package/dist/list-files-D__uh3tQ.mjs +0 -2
  425. package/dist/list-files-D__uh3tQ.mjs.map +0 -1
  426. package/dist/package-fns-BNRi_Rpc.d.cts.map +0 -1
  427. package/dist/package-fns-C7-MKgBR.mjs +0 -2
  428. package/dist/package-fns-C7-MKgBR.mjs.map +0 -1
  429. package/dist/package-fns-CxokaGDY.d.mts.map +0 -1
  430. package/dist/package-fns-YTCdMAXr.cjs +0 -1
  431. package/dist/read-file-B091zB64.mjs +0 -2
  432. package/dist/read-file-B091zB64.mjs.map +0 -1
  433. package/dist/read-file-BB2WzW-N.cjs +0 -1
  434. package/dist/read-file-Bxn1VHKv.d.cts +0 -30
  435. package/dist/read-file-Bxn1VHKv.d.cts.map +0 -1
  436. package/dist/read-file-CRVW-wcE.d.mts +0 -30
  437. package/dist/read-file-CRVW-wcE.d.mts.map +0 -1
  438. package/dist/registry-B1taIPKm.mjs +0 -2
  439. package/dist/registry-B1taIPKm.mjs.map +0 -1
  440. package/dist/registry-BQ3JXRFA.d.mts +0 -53
  441. package/dist/registry-BQ3JXRFA.d.mts.map +0 -1
  442. package/dist/registry-BYwvM92u.cjs +0 -1
  443. package/dist/registry-C2A0Kau7.d.cts +0 -53
  444. package/dist/registry-C2A0Kau7.d.cts.map +0 -1
  445. package/dist/remove-file-BM64Brdf.mjs +0 -2
  446. package/dist/remove-file-BM64Brdf.mjs.map +0 -1
  447. package/dist/remove-file-BqlkL_Df.d.mts +0 -16
  448. package/dist/remove-file-BqlkL_Df.d.mts.map +0 -1
  449. package/dist/remove-file-XHFKELQN.cjs +0 -1
  450. package/dist/remove-file-lQOlxDwr.d.cts +0 -16
  451. package/dist/remove-file-lQOlxDwr.d.cts.map +0 -1
  452. package/dist/resolve-C_YsCFne.mjs +0 -4
  453. package/dist/resolve-C_YsCFne.mjs.map +0 -1
  454. package/dist/resolve-D66oIwjf.d.mts +0 -106
  455. package/dist/resolve-D66oIwjf.d.mts.map +0 -1
  456. package/dist/resolve-DTkLQekH.cjs +0 -3
  457. package/dist/resolve-DubH-8qd.d.cts +0 -106
  458. package/dist/resolve-DubH-8qd.d.cts.map +0 -1
  459. package/dist/resolve-parent-path-CR8av8WP.mjs +0 -2
  460. package/dist/resolve-parent-path-CR8av8WP.mjs.map +0 -1
  461. package/dist/resolve-parent-path-D0AaW2PB.cjs +0 -1
  462. package/dist/semver-fns-B0e5zB6C.d.mts +0 -92
  463. package/dist/semver-fns-B0e5zB6C.d.mts.map +0 -1
  464. package/dist/semver-fns-Btrm1dIF.cjs +0 -1
  465. package/dist/semver-fns-DjhZXnUw.d.cts +0 -92
  466. package/dist/semver-fns-DjhZXnUw.d.cts.map +0 -1
  467. package/dist/semver-fns-F_rYnwDq.mjs +0 -2
  468. package/dist/semver-fns-F_rYnwDq.mjs.map +0 -1
  469. package/dist/toml-CIgLQmP3.mjs +0 -4
  470. package/dist/toml-CIgLQmP3.mjs.map +0 -1
  471. package/dist/toml-D3X2QoaL.d.cts +0 -81
  472. package/dist/toml-D3X2QoaL.d.cts.map +0 -1
  473. package/dist/toml-DgVyNp_y.cjs +0 -3
  474. package/dist/toml-Djau1M6n.d.mts +0 -81
  475. package/dist/toml-Djau1M6n.d.mts.map +0 -1
  476. package/dist/tsconfig-B13IMV_0.d.mts.map +0 -1
  477. package/dist/tsconfig-B6WtgD1c.cjs +0 -1
  478. package/dist/tsconfig-C8ecu1-0.d.cts.map +0 -1
  479. package/dist/tsconfig-CqvvSVuX.mjs +0 -2
  480. package/dist/tsconfig-CqvvSVuX.mjs.map +0 -1
  481. package/dist/write-file-BmvbsmMj.d.cts +0 -35
  482. package/dist/write-file-BmvbsmMj.d.cts.map +0 -1
  483. package/dist/write-file-CFByoJkN.mjs +0 -2
  484. package/dist/write-file-CFByoJkN.mjs.map +0 -1
  485. package/dist/write-file-CWTzQpb2.d.mts +0 -35
  486. package/dist/write-file-CWTzQpb2.d.mts.map +0 -1
  487. package/dist/write-file-CqokudVp.cjs +0 -1
  488. package/dist/yaml-6uuLoSfT.d.cts +0 -23
  489. package/dist/yaml-6uuLoSfT.d.cts.map +0 -1
  490. package/dist/yaml-CLMo56UG.mjs +0 -2
  491. package/dist/yaml-CLMo56UG.mjs.map +0 -1
  492. package/dist/yaml-Ddslc5NK.d.mts +0 -23
  493. package/dist/yaml-Ddslc5NK.d.mts.map +0 -1
  494. package/dist/yaml-q2k-BjIM.cjs +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cwd.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
+ const e=require(`./cwd.cjs`),t=require(`./regex.cjs`),n=require(`./is-type.cjs`),r=require(`./correct-path.cjs`),i=require(`../../type-checks/src/is-set-string.cjs`),a=require(`../../types/src/base.cjs`);function o(e,t={}){let{requireExtension:n=!1,withExtension:i=!0}=t,o=r.normalizeWindowsPath(e)?.split(e?.includes(`\\`)?`\\`:`/`)?.pop()??``;return n===!0&&!o.includes(`.`)?a.EMPTY_STRING:i===!1&&o.includes(`.`)?o.replace(`.${l(o)??``}`,``)||a.EMPTY_STRING:o}function s(e,t={}){let n=r.normalizeWindowsPath(e),i=n.replace(o(n,{requireExtension:!1,...t}),``);return i===`/`?i:i.replace(/\/$/,``)}function c(e,t){let n=s(e,t).split(`/`),r=``;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t){r=t;break}}return r??a.EMPTY_STRING}function l(e){if(e.endsWith(`.`)||e.endsWith(`/`))return;let n=t.FILE_EXTENSION_REGEX.exec(r.normalizeWindowsPath(e));return n&&n.length>0&&i.isSetString(n[0])?n[0].replace(`.`,``):void 0}function u(e){return!!l(e)}function d(...t){t=t.map(e=>r.normalizeWindowsPath(e));let i=``,a=!1;for(let r=t.length-1;r>=-1&&!a;r--){let o=r>=0?t[r]:e.cwd();!o||o.length===0||(i=`${o}/${i}`,a=n.isAbsolute(o))}return i=r.normalizeString(i,!a),a&&!n.isAbsolute(i)?`/${i}`:i.length>0?i:`.`}function f(e,n){let r=d(e).replace(t.ROOT_FOLDER_REGEX,`$1`).split(`/`),i=d(n).replace(t.ROOT_FOLDER_REGEX,`$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 p(e,t,n=!1){return f(n===!0?e:e.replace(/\/$/,``),n===!0?t:t.replace(/\/$/,``))}exports.findFileExtension=l,exports.findFileName=o,exports.findFilePath=s,exports.findFolderName=c,exports.hasFileExtension=u,exports.relativePath=p;
@@ -0,0 +1,2 @@
1
+ import{cwd as e}from"./cwd.mjs";import{FILE_EXTENSION_REGEX as t,ROOT_FOLDER_REGEX as n}from"./regex.mjs";import{isAbsolute as r}from"./is-type.mjs";import{normalizeString as i,normalizeWindowsPath as a}from"./correct-path.mjs";import{isSetString as o}from"../../type-checks/src/is-set-string.mjs";import{EMPTY_STRING as s}from"../../types/src/base.mjs";function c(e,t={}){let{requireExtension:n=!1,withExtension:r=!0}=t,i=a(e)?.split(e?.includes(`\\`)?`\\`:`/`)?.pop()??``;return n===!0&&!i.includes(`.`)?s:r===!1&&i.includes(`.`)?i.replace(`.${d(i)??``}`,``)||s:i}function l(e,t={}){let n=a(e),r=n.replace(c(n,{requireExtension:!1,...t}),``);return r===`/`?r:r.replace(/\/$/,``)}function u(e,t){let n=l(e,t).split(`/`),r=``;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t){r=t;break}}return r??s}function d(e){if(e.endsWith(`.`)||e.endsWith(`/`))return;let n=t.exec(a(e));return n&&n.length>0&&o(n[0])?n[0].replace(`.`,``):void 0}function f(e){return!!d(e)}function p(...t){t=t.map(e=>a(e));let n=``,o=!1;for(let i=t.length-1;i>=-1&&!o;i--){let a=i>=0?t[i]:e();!a||a.length===0||(n=`${a}/${n}`,o=r(a))}return n=i(n,!o),o&&!r(n)?`/${n}`:n.length>0?n:`.`}function m(e,t){let r=p(e).replace(n,`$1`).split(`/`),i=p(t).replace(n,`$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 h(e,t,n=!1){return m(n===!0?e:e.replace(/\/$/,``),n===!0?t:t.replace(/\/$/,``))}export{d as findFileExtension,c as findFileName,l as findFilePath,u as findFolderName,f as hasFileExtension,h as relativePath};
2
+ //# sourceMappingURL=file-path-fns.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-path-fns.mjs","names":["currentDir"],"sources":["../../../../path/src/file-path-fns.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 { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { EMPTY_STRING } from \"@stryke/types/base\";\nimport { normalizeString, normalizeWindowsPath } from \"./correct-path\";\nimport { cwd as currentDir } from \"./cwd\";\nimport { isAbsolute, isAbsolutePath } from \"./is-type\";\nimport { joinPaths } from \"./join-paths\";\nimport { FILE_EXTENSION_REGEX, ROOT_FOLDER_REGEX } from \"./regex\";\n\nexport interface FindFileNameOptions {\n /**\n * Require the file extension to be present in the file name.\n *\n * @defaultValue false\n */\n requireExtension?: boolean;\n\n /**\n * Return the file extension as part of the full file name result.\n *\n * @defaultValue true\n */\n withExtension?: boolean;\n}\n\n/**\n * Find the file name from a file path.\n *\n * @example\n * ```ts\n * const fileName = findFileName(\"C:\\\\Users\\\\user\\\\Documents\\\\file.txt\");\n * // fileName = \"file.txt\"\n * ```\n *\n * @param filePath - The file path to process\n * @param options - Options to control the file name extraction\n * @returns The file name\n */\nexport function findFileName(\n filePath: string,\n options: FindFileNameOptions = {}\n): string {\n const { requireExtension = false, withExtension = true } = options;\n const result =\n normalizeWindowsPath(filePath)\n ?.split(filePath?.includes(\"\\\\\") ? \"\\\\\" : \"/\")\n ?.pop() ?? \"\";\n\n if (requireExtension === true && !result.includes(\".\")) {\n return EMPTY_STRING;\n }\n\n if (withExtension === false && result.includes(\".\")) {\n return (\n result.replace(`.${findFileExtension(result) ?? \"\"}`, \"\") || EMPTY_STRING\n );\n }\n\n return result;\n}\n\n/**\n * Find the full file path's directories from a file path.\n *\n * @remarks\n * The functionality of this method is similar to the {@link path.dirname} function in Node's path module.\n *\n * @example\n * ```ts\n * const folderPath = findFilePath(\"C:\\\\Users\\\\user\\\\Documents\\\\file.txt\");\n * // folderPath = \"C:\\\\Users\\\\user\\\\Documents\"\n * ```\n *\n * @param filePath - The file path to process\n * @param options - Options to control the file name extraction\n * @returns The full file path's directories\n */\nexport function findFilePath(\n filePath: string,\n options: FindFileNameOptions = {}\n): string {\n const normalizedPath = normalizeWindowsPath(filePath);\n\n const result = normalizedPath.replace(\n findFileName(normalizedPath, { requireExtension: false, ...options }),\n \"\"\n );\n\n return result === \"/\" ? result : result.replace(/\\/$/, \"\");\n}\n\nexport const dirname = findFilePath;\n\n/**\n * Find the top most folder containing the file from a file path.\n *\n * @remarks\n * The functionality of this method is similar to the {@link path.basename} function in Node's path module.\n * If you're looking for the full path of the folder (for example: `C:\\\\Users\\\\user\\\\Documents` instead of just `Documents`) containing the file, use {@link findFilePath} instead.\n *\n * @example\n * const folderPath = findFolderName(\"C:\\\\Users\\\\user\\\\Documents\\\\file.txt\");\n * // folderPath = \"Documents\"\n *\n * @param filePath - The file path to process\n * @param options - Options to control the file name extraction\n * @returns The folder containing the file\n */\nexport function findFolderName(\n filePath: string,\n options?: FindFileNameOptions\n): string {\n const segments = findFilePath(filePath, options).split(\"/\");\n\n let lastSegment = \"\";\n for (let i = segments.length - 1; i >= 0; i--) {\n const val = segments[i];\n if (val) {\n lastSegment = val;\n break;\n }\n }\n\n // if (\n // folderPath.lastIndexOf(\"\\\\\") === folderPath.length - 1 ||\n // folderPath.lastIndexOf(\"/\") === folderPath.length - 1\n // ) {\n // folderPath = folderPath.slice(0, Math.max(0, folderPath.length - 1));\n // }\n\n return lastSegment ?? EMPTY_STRING;\n}\n\nexport const basename = findFolderName;\n\n/**\n * Find the file extension from a file path.\n *\n * @remarks\n * The functionality of this method is similar to the {@link path.extname} function in Node's path module.\n * The file extension is the part of the file name that comes after the last dot (`.`) in the file name. If the file name does not contain a dot, or if it ends with a dot, this function will return `undefined`.\n *\n * The returned extension **will not** include the dot, for example `txt` or `js` instead of `.txt` or `.js`.\n *\n * @example\n * ```ts\n * findFileExtension(\"C:\\\\Users\\\\user\\\\Documents\\\\file.config.ts\");\n * // Returns \"ts\"\n * ```\n *\n * @param filePath - The file path to process\n * @returns The file extension or undefined if no extension is found\n */\nexport function findFileExtension(filePath: string): string | undefined {\n if (filePath.endsWith(\".\") || filePath.endsWith(\"/\")) {\n return undefined;\n }\n\n const match = FILE_EXTENSION_REGEX.exec(normalizeWindowsPath(filePath));\n\n return match && match.length > 0 && isSetString(match[0])\n ? match[0].replace(\".\", \"\")\n : undefined;\n}\n\nexport const extname = findFileExtension;\n\n/**\n * Find the file extension including the `\".\"` character prefix from a file path.\n *\n * @remarks\n * The file extension is the part of the file name that comes after (and including) the last dot (`.`) in the file name. If the file name does not contain a dot, or if it ends with a dot, this function will return `undefined`.\n *\n * The returned extension **will** include the dot, for example `.txt` or `.js` instead of `txt` or `js`.\n *\n * @param filePath - The file path to process\n * @returns The file extension (including the `\".\"` prefix) or undefined if no extension is found\n */\nexport function findFileDotExtension(filePath: string): string | undefined {\n const ext = findFileExtension(filePath);\n\n return ext ? `.${ext}` : undefined;\n}\n\n/**\n * Find the file extension from a file path or an empty string.\n *\n * @remarks\n * The file extension is the part of the file name that comes after the last dot (`.`) in the file name. If the file name does not contain a dot, or if it ends with a dot, this function will return `undefined`.\n *\n * The returned extension **will not** include the dot, for example `txt` or `js` instead of `.txt` or `.js`.\n *\n * @param filePath - The file path to process\n * @returns The file extension or an empty string if no extension is found\n */\nexport function findFileExtensionSafe(filePath: string): string {\n return findFileExtension(filePath) ?? EMPTY_STRING;\n}\n\n/**\n * Find the file extension including the `\".\"` character prefix from a file path or an empty string.\n *\n * @remarks\n * The file extension is the part of the file name that comes after (and including) the last dot (`.`) in the file name. If the file name does not contain a dot, or if it ends with a dot, this function will return `undefined`.\n *\n * The returned extension **will** include the dot, for example `.txt` or `.js` instead of `txt` or `js`.\n *\n * @param filePath - The file path to process\n * @returns The file extension (including the `\".\"` prefix) or an empty string if no extension is found\n */\nexport function findFileDotExtensionSafe(filePath: string): string {\n const ext = findFileExtension(filePath);\n\n return ext ? `.${ext}` : \"\";\n}\n\n/**\n * Check if a file path has a file name.\n *\n * @param filePath - The file path to process\n * @returns An indicator specifying if the file path has a file name\n */\nexport function hasFileName(filePath: string): boolean {\n return Boolean(findFileName(filePath));\n}\n\n/**\n * Check if a file path has a file path.\n *\n * @param filePath - The file path to process\n * @returns An indicator specifying if the file path has a file path\n */\nexport function hasFilePath(filePath: string): boolean {\n return Boolean(findFilePath(filePath));\n}\n\n/**\n * Check if a file path has a folder name.\n *\n * @param filePath - The file path to process\n * @returns An indicator specifying if the file path has a folder name\n */\nexport function hasFolderName(filePath: string): boolean {\n return Boolean(findFolderName(filePath));\n}\n\n/**\n * Check if a file path has a file extension.\n *\n * @param filePath - The file path to process\n * @returns An indicator specifying if the file path has a file extension\n */\nexport function hasFileExtension(filePath: string): boolean {\n return Boolean(findFileExtension(filePath));\n}\n\n/**\n * Resolve the file path to an absolute path.\n *\n * @param path - The path to resolve\n * @param cwd - The current working directory\n * @returns The resolved path\n */\nexport function resolvePath(path: string, cwd = currentDir()) {\n // Normalize windows arguments\n const paths = normalizeWindowsPath(path).split(\"/\");\n\n let resolvedPath = \"\";\n let resolvedAbsolute = false;\n\n for (\n let index = paths.length - 1;\n index >= -1 && !resolvedAbsolute;\n index--\n ) {\n const path = index >= 0 ? paths[index] : cwd;\n\n // Skip empty entries\n if (!path || path.length === 0) {\n continue;\n }\n\n resolvedPath = joinPaths(path, resolvedPath);\n resolvedAbsolute = isAbsolutePath(path);\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);\n\n if (resolvedAbsolute && !isAbsolutePath(resolvedPath)) {\n return `/${resolvedPath}`;\n }\n\n return resolvedPath.length > 0 ? resolvedPath : \".\";\n}\n\nexport function resolve(...paths: string[]) {\n // Normalize windows arguments\n paths = paths.map(argument => normalizeWindowsPath(argument));\n\n let resolvedPath = \"\";\n let resolvedAbsolute = false;\n\n for (\n let index = paths.length - 1;\n index >= -1 && !resolvedAbsolute;\n index--\n ) {\n const path = index >= 0 ? paths[index] : currentDir();\n\n // Skip empty entries\n if (!path || path.length === 0) {\n continue;\n }\n\n resolvedPath = `${path}/${resolvedPath}`;\n resolvedAbsolute = isAbsolute(path);\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);\n\n if (resolvedAbsolute && !isAbsolute(resolvedPath)) {\n return `/${resolvedPath}`;\n }\n\n return resolvedPath.length > 0 ? resolvedPath : \".\";\n}\n\n/**\n * Resolve the file path to an absolute path.\n *\n * @param paths - The paths to resolve\n * @returns The resolved path\n */\nexport function resolvePaths(...paths: string[]) {\n return resolvePath(\n joinPaths(...paths.map(path => normalizeWindowsPath(path)))\n );\n}\n\n/**\n * Get the relative path from one file to another.\n *\n * @remarks\n * This function is similar to the `path.relative` function in Node's path module.\n *\n * @param from - The base path to start from\n * @param to - The target path to resolve relative to the base path\n * @returns The relative path from the base path to the target path\n */\nexport function relative(from: string, to: string) {\n // we cast these because `split` will always be at least one string\n const _from = resolve(from).replace(ROOT_FOLDER_REGEX, \"$1\").split(\"/\") as [\n string,\n ...string[]\n ];\n const _to = resolve(to).replace(ROOT_FOLDER_REGEX, \"$1\").split(\"/\") as [\n string,\n ...string[]\n ];\n\n // Different windows drive letters\n if (_to[0][1] === \":\" && _from[0][1] === \":\" && _from[0] !== _to[0]) {\n return _to.join(\"/\");\n }\n\n const _fromCopy = [..._from];\n for (const segment of _fromCopy) {\n if (_to[0] !== segment) {\n break;\n }\n _from.shift();\n _to.shift();\n }\n return [..._from.map(() => \"..\"), ..._to].join(\"/\");\n}\n\n/**\n * Get the relative path from one file to another.\n *\n * @remarks\n * This function wraps the `path.relative` function in Node's path module.\n *\n * @param from - The base path to start from\n * @param to - The target path to resolve relative to the base path\n * @param withEndSlash - Whether to include a trailing slash at the end of the path\n * @returns The relative path from the base path to the target path\n */\nexport function relativePath(from: string, to: string, withEndSlash = false) {\n return relative(\n withEndSlash !== true ? from.replace(/\\/$/, \"\") : from,\n withEndSlash !== true ? to.replace(/\\/$/, \"\") : to\n );\n}\n\n/**\n * Find the file path relative to the workspace root path.\n *\n * @param filePath - The file path to process\n * @returns The resolved file path\n */\nexport function relativeToCurrentDir(filePath: string) {\n return relativePath(filePath, currentDir());\n}\n\n/**\n * Check if the path is a relative path.\n *\n * @param path - The path to check\n * @returns An indicator specifying if the path is a relative path\n */\nexport function parsePath(path: string) {\n // The root of the path such as '/' or 'c:\\'\n const root =\n /^[/\\\\]|^[a-z]:[/\\\\]/i.exec(path)?.[0]?.replace(/\\\\/g, \"/\") || \"\";\n\n const normalizedPath = normalizeWindowsPath(path);\n\n const segments = normalizedPath.replace(/\\/$/, \"\").split(\"/\").slice(0, -1);\n if (segments.length === 1 && /^[A-Z]:$/i.test(segments[0] as string)) {\n segments[0] += \"/\";\n }\n\n const base = findFolderName(normalizedPath);\n const dir = segments.join(\"/\") || (isAbsolutePath(path) ? \"/\" : \".\");\n const ext = findFileExtensionSafe(path);\n\n return {\n root,\n dir,\n base,\n ext,\n name: base.slice(0, base.length - ext.length)\n };\n}\n\n/**\n * Rename the file name with a new name.\n *\n * @param filePath - The current file path being processed\n * @param newFileName - The updated file name being processed\n * @returns The modified or unmodified file path.\n */\nexport function renameFile(filePath: string, newFileName: string): string {\n const file = parsePath(filePath);\n\n return joinPaths(\n file.dir,\n newFileName.includes(\".\") ? newFileName : newFileName + file.ext\n );\n}\n"],"mappings":"kWAuDA,SAAgB,EACd,EACA,EAA+B,EAAE,CACzB,CACR,GAAM,CAAE,mBAAmB,GAAO,gBAAgB,IAAS,EACrD,EACJ,EAAqB,EAAS,EAC1B,MAAM,GAAU,SAAS,KAAK,CAAG,KAAO,IAAI,EAC5C,KAAK,EAAI,GAYf,OAVI,IAAqB,IAAQ,CAAC,EAAO,SAAS,IAAI,CAC7C,EAGL,IAAkB,IAAS,EAAO,SAAS,IAAI,CAE/C,EAAO,QAAQ,IAAI,EAAkB,EAAO,EAAI,KAAM,GAAG,EAAI,EAI1D,EAmBT,SAAgB,EACd,EACA,EAA+B,EAAE,CACzB,CACR,IAAM,EAAiB,EAAqB,EAAS,CAE/C,EAAS,EAAe,QAC5B,EAAa,EAAgB,CAAE,iBAAkB,GAAO,GAAG,EAAS,CAAC,CACrE,GACD,CAED,OAAO,IAAW,IAAM,EAAS,EAAO,QAAQ,MAAO,GAAG,CAoB5D,SAAgB,EACd,EACA,EACQ,CACR,IAAM,EAAW,EAAa,EAAU,EAAQ,CAAC,MAAM,IAAI,CAEvD,EAAc,GAClB,IAAK,IAAI,EAAI,EAAS,OAAS,EAAG,GAAK,EAAG,IAAK,CAC7C,IAAM,EAAM,EAAS,GACrB,GAAI,EAAK,CACP,EAAc,EACd,OAWJ,OAAO,GAAe,EAuBxB,SAAgB,EAAkB,EAAsC,CACtE,GAAI,EAAS,SAAS,IAAI,EAAI,EAAS,SAAS,IAAI,CAClD,OAGF,IAAM,EAAQ,EAAqB,KAAK,EAAqB,EAAS,CAAC,CAEvE,OAAO,GAAS,EAAM,OAAS,GAAK,EAAY,EAAM,GAAG,CACrD,EAAM,GAAG,QAAQ,IAAK,GAAG,CACzB,IAAA,GA0FN,SAAgB,EAAiB,EAA2B,CAC1D,MAAO,EAAQ,EAAkB,EAAS,CA8C5C,SAAgB,EAAQ,GAAG,EAAiB,CAE1C,EAAQ,EAAM,IAAI,GAAY,EAAqB,EAAS,CAAC,CAE7D,IAAI,EAAe,GACf,EAAmB,GAEvB,IACE,IAAI,EAAQ,EAAM,OAAS,EAC3B,GAAS,IAAM,CAAC,EAChB,IACA,CACA,IAAM,EAAO,GAAS,EAAI,EAAM,GAASA,GAAY,CAGjD,CAAC,GAAQ,EAAK,SAAW,IAI7B,EAAe,GAAG,EAAK,GAAG,IAC1B,EAAmB,EAAW,EAAK,EAarC,MANA,GAAe,EAAgB,EAAc,CAAC,EAAiB,CAE3D,GAAoB,CAAC,EAAW,EAAa,CACxC,IAAI,IAGN,EAAa,OAAS,EAAI,EAAe,IAyBlD,SAAgB,EAAS,EAAc,EAAY,CAEjD,IAAM,EAAQ,EAAQ,EAAK,CAAC,QAAQ,EAAmB,KAAK,CAAC,MAAM,IAAI,CAIjE,EAAM,EAAQ,EAAG,CAAC,QAAQ,EAAmB,KAAK,CAAC,MAAM,IAAI,CAMnE,GAAI,EAAI,GAAG,KAAO,KAAO,EAAM,GAAG,KAAO,KAAO,EAAM,KAAO,EAAI,GAC/D,OAAO,EAAI,KAAK,IAAI,CAGtB,IAAM,EAAY,CAAC,GAAG,EAAM,CAC5B,IAAK,IAAM,KAAW,EAAW,CAC/B,GAAI,EAAI,KAAO,EACb,MAEF,EAAM,OAAO,CACb,EAAI,OAAO,CAEb,MAAO,CAAC,GAAG,EAAM,QAAU,KAAK,CAAE,GAAG,EAAI,CAAC,KAAK,IAAI,CAcrD,SAAgB,EAAa,EAAc,EAAY,EAAe,GAAO,CAC3E,OAAO,EACL,IAAiB,GAAiC,EAA1B,EAAK,QAAQ,MAAO,GAAG,CAC/C,IAAiB,GAA+B,EAAxB,EAAG,QAAQ,MAAO,GAAG,CAC9C"}
@@ -0,0 +1 @@
1
+ const e=require(`./slash.cjs`);function t(t,n){let r=e.slash(t.replace(/\\/g,`/`).replace(/\/$/,``)),i=e.slash(n.replace(/\\/g,`/`).replace(/\/$/,``));return r!==i&&r.startsWith(`${i}/`)}exports.isParentPath=t;
@@ -0,0 +1,2 @@
1
+ import{slash as e}from"./slash.mjs";function t(t,n){let r=e(t.replace(/\\/g,`/`).replace(/\/$/,``)),i=e(n.replace(/\\/g,`/`).replace(/\/$/,``));return r!==i&&r.startsWith(`${i}/`)}export{t as isParentPath};
2
+ //# sourceMappingURL=is-parent-path.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-parent-path.mjs","names":[],"sources":["../../../../path/src/is-parent-path.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 { slash } from \"./slash\";\n\n/**\n * Check if a given path is a parent of another path.\n *\n * @example\n * ```ts\n * isParentPath(\"/home/user/project/src/index.ts\", \"/home/user/project/src\");\n * // returns true\n * isParentPath(\"/home/user/project/src/index.ts\", \"/home/user/project\");\n * // returns true\n * isParentPath(\"/home/user/project/src/index.ts\", \"/home/user/project/src/other\");\n * // returns false\n * isParentPath(\"/home/user/project/src/index.ts\", \"/home/user/other\");\n * // returns false\n * isParentPath(\"/home/user/project/src/index.ts\", \"/home/user/project/src/index.ts\");\n * // returns false\n * ```\n *\n * @param childPath - The path to check if it is a child of the parent path.\n * @param parentPath - The path to check if it is a parent of the child path.\n * @returns `true` if `childPath` is a child of `parentPath`, otherwise `false`.\n */\nexport function isParentPath(childPath: string, parentPath: string): boolean {\n const normalizedChild = slash(\n childPath.replace(/\\\\/g, \"/\").replace(/\\/$/, \"\")\n );\n const normalizedParent = slash(\n parentPath.replace(/\\\\/g, \"/\").replace(/\\/$/, \"\")\n );\n\n return (\n normalizedChild !== normalizedParent &&\n normalizedChild.startsWith(`${normalizedParent}/`)\n );\n}\n"],"mappings":"oCAyCA,SAAgB,EAAa,EAAmB,EAA6B,CAC3E,IAAM,EAAkB,EACtB,EAAU,QAAQ,MAAO,IAAI,CAAC,QAAQ,MAAO,GAAG,CACjD,CACK,EAAmB,EACvB,EAAW,QAAQ,MAAO,IAAI,CAAC,QAAQ,MAAO,GAAG,CAClD,CAED,OACE,IAAoB,GACpB,EAAgB,WAAW,GAAG,EAAiB,GAAG"}
@@ -0,0 +1 @@
1
+ function e(e){return e===`/`||e===`c:\\`||e===`C:\\`}exports.isSystemRoot=e;
@@ -0,0 +1,2 @@
1
+ function e(e){return e===`/`||e===`c:\\`||e===`C:\\`}export{e as isSystemRoot};
2
+ //# sourceMappingURL=is-root-dir.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-root-dir.mjs","names":[],"sources":["../../../../path/src/is-root-dir.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 * Check if the directory is the current system's root directory.\n *\n * @param dir - The directory to check.\n * @returns Returns true if the directory is the root directory.\n */\nexport function isSystemRoot(dir: string): boolean {\n return Boolean(dir === \"/\" || dir === \"c:\\\\\" || dir === \"C:\\\\\");\n}\n"],"mappings":"AAwBA,SAAgB,EAAa,EAAsB,CACjD,OAAe,IAAQ,KAAO,IAAQ,QAAU,IAAQ"}
@@ -0,0 +1 @@
1
+ const e=require(`./regex.cjs`),t=require(`./slash.cjs`);function n(n){return e.ABSOLUTE_PATH_REGEX.test(t.slash(n))}function r(e){return n(e)}function i(n){return e.NPM_SCOPED_PACKAGE_REGEX.test(t.slash(n))}function a(e){return i(e)}exports.isAbsolute=r,exports.isAbsolutePath=n,exports.isNpmScopedPackage=a;
@@ -0,0 +1,2 @@
1
+ import{ABSOLUTE_PATH_REGEX as e,NPM_SCOPED_PACKAGE_REGEX as t}from"./regex.mjs";import{slash as n}from"./slash.mjs";function r(t){return e.test(n(t))}function i(e){return r(e)}function a(e){return t.test(n(e))}function o(e){return a(e)}export{i as isAbsolute,r as isAbsolutePath,o as isNpmScopedPackage};
2
+ //# sourceMappingURL=is-type.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-type.mjs","names":[],"sources":["../../../../path/src/is-type.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 { ABSOLUTE_PATH_REGEX, NPM_SCOPED_PACKAGE_REGEX } from \"./regex\";\nimport { slash } from \"./slash\";\n\n/**\n * Check if the path is an absolute path.\n *\n * @param path - The path to check\n * @returns An indicator specifying if the path is an absolute path\n */\nexport function isAbsolutePath(path: string): boolean {\n return ABSOLUTE_PATH_REGEX.test(slash(path));\n}\n\n/**\n * Check if the path is an absolute path.\n *\n * @remarks\n * This is an alias for {@link isAbsolutePath}.\n *\n * @param path - The path to check\n * @returns An indicator specifying if the path is an absolute path\n */\nexport function isAbsolute(path: string): boolean {\n return isAbsolutePath(path);\n}\n\n/**\n * Check if the path is a relative path.\n *\n * @param path - The path to check\n * @returns An indicator specifying if the path is a relative path\n */\nexport function isRelativePath(path: string): boolean {\n return !isAbsolutePath(path);\n}\n\n/**\n * Check if the path is a relative path.\n *\n * @remarks\n * This is an alias for {@link isRelativePath}.\n *\n * @param path - The path to check\n * @returns An indicator specifying if the path is a relative path\n */\nexport function isRelative(path: string): boolean {\n return isRelativePath(path);\n}\n\n/**\n * Check if the path is a npm package path.\n *\n * @remarks\n * This only checks if the path matches the npm namespace scoped package naming convention such as `@scope/package-name`. This is an alias for {@link isNpmScopedPackage}.\n *\n * @example\n * ```ts\n * isNpmScopedPackage(\"@stryke/path\"); // returns true\n * isNpmScopedPackage(\"lodash\"); // returns false\n * isNpmNamespacePackage(\"./src/index.ts\"); // returns false\n * ```\n *\n * @param path - The path to check\n * @returns An indicator specifying if the path is a npm package path\n */\nexport function isNpmScopedPackagePath(path: string): boolean {\n return NPM_SCOPED_PACKAGE_REGEX.test(slash(path));\n}\n\n/**\n * Check if the path is a npm package path.\n *\n * @remarks\n * This only checks if the path matches the npm namespace scoped package naming convention such as `@scope/package-name`. This is an alias for {@link isNpmScopedPackagePath}.\n *\n * @example\n * ```ts\n * isNpmScopedPackagePath(\"@stryke/path\"); // returns true\n * isNpmScopedPackagePath(\"lodash\"); // returns false\n * isNpmScopedPackagePath(\"./src/index.ts\"); // returns false\n * ```\n *\n * @param path - The path to check\n * @returns An indicator specifying if the path is a npm package path\n */\nexport function isNpmScopedPackage(path: string): boolean {\n return isNpmScopedPackagePath(path);\n}\n"],"mappings":"oHA2BA,SAAgB,EAAe,EAAuB,CACpD,OAAO,EAAoB,KAAK,EAAM,EAAK,CAAC,CAY9C,SAAgB,EAAW,EAAuB,CAChD,OAAO,EAAe,EAAK,CA0C7B,SAAgB,EAAuB,EAAuB,CAC5D,OAAO,EAAyB,KAAK,EAAM,EAAK,CAAC,CAmBnD,SAAgB,EAAmB,EAAuB,CACxD,OAAO,EAAuB,EAAK"}
@@ -0,0 +1 @@
1
+ const e=require(`./regex.cjs`),t=require(`./is-type.cjs`);function n(t=``){return t&&t.replace(/\\/g,`/`).replace(e.DRIVE_LETTER_START_REGEX,e=>e.toUpperCase())}function r(r){if(!r||r.length===0)return`.`;r=n(r);let i=r.match(e.UNC_REGEX),o=t.isAbsolute(r),s=r[r.length-1]===`/`;return r=a(r,!o),r.length===0?o?`/`:s?`./`:`.`:(s&&(r+=`/`),e.DRIVE_LETTER_REGEX.test(r)&&(r+=`/`),i?o?`//${r}`:`//./${r}`:o&&!t.isAbsolute(r)?`/${r}`:r)}function i(...e){let t=``;for(let n of e)if(n)if(t.length>0){let e=t[t.length-1]===`/`,r=n[0]===`/`;e&&r?t+=n.slice(1):t+=e||r?n:`/${n}`}else t+=n;return r(t)}function a(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}exports.joinPaths=i;
@@ -0,0 +1,2 @@
1
+ import{DRIVE_LETTER_REGEX as e,DRIVE_LETTER_START_REGEX as t,UNC_REGEX as n}from"./regex.mjs";import{isAbsolute as r}from"./is-type.mjs";function i(e=``){return e&&e.replace(/\\/g,`/`).replace(t,e=>e.toUpperCase())}function a(t){if(!t||t.length===0)return`.`;t=i(t);let a=t.match(n),o=r(t),c=t[t.length-1]===`/`;return t=s(t,!o),t.length===0?o?`/`:c?`./`:`.`:(c&&(t+=`/`),e.test(t)&&(t+=`/`),a?o?`//${t}`:`//./${t}`:o&&!r(t)?`/${t}`:t)}function o(...e){let t=``;for(let n of e)if(n)if(t.length>0){let e=t[t.length-1]===`/`,r=n[0]===`/`;e&&r?t+=n.slice(1):t+=e||r?n:`/${n}`}else t+=n;return a(t)}function s(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}export{o as joinPaths};
2
+ //# sourceMappingURL=join-paths.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"join-paths.mjs","names":["char: string | null"],"sources":["../../../../path/src/join-paths.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 { isAbsolute } from \"./is-type\";\nimport {\n DRIVE_LETTER_REGEX,\n DRIVE_LETTER_START_REGEX,\n UNC_REGEX\n} from \"./regex\";\n\n// Util to normalize windows paths to posix\nfunction normalizeWindowsPath(input = \"\") {\n if (!input) {\n return input;\n }\n return input\n .replace(/\\\\/g, \"/\")\n .replace(DRIVE_LETTER_START_REGEX, r => r.toUpperCase());\n}\n\nfunction correctPaths(path?: string) {\n if (!path || path.length === 0) {\n return \".\";\n }\n\n // Normalize windows argument\n path = normalizeWindowsPath(path);\n\n const isUNCPath = path.match(UNC_REGEX);\n const isPathAbsolute = isAbsolute(path);\n const trailingSeparator = path[path.length - 1] === \"/\";\n\n // Normalize the path\n path = normalizeString(path, !isPathAbsolute);\n\n if (path.length === 0) {\n if (isPathAbsolute) {\n return \"/\";\n }\n return trailingSeparator ? \"./\" : \".\";\n }\n if (trailingSeparator) {\n path += \"/\";\n }\n if (DRIVE_LETTER_REGEX.test(path)) {\n path += \"/\";\n }\n\n if (isUNCPath) {\n if (!isPathAbsolute) {\n return `//./${path}`;\n }\n return `//${path}`;\n }\n\n return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;\n}\n\n/**\n * Joins all given path segments together using the platform-specific separator as a delimiter.\n * The resulting path is normalized to remove any redundant or unnecessary segments.\n *\n * @param segments - The path segments to join.\n * @returns The joined and normalized path string.\n */\nexport function joinPaths(...segments: string[]): string {\n let path = \"\";\n\n for (const seg of segments) {\n if (!seg) {\n continue;\n }\n if (path.length > 0) {\n const pathTrailing = path[path.length - 1] === \"/\";\n const segLeading = seg[0] === \"/\";\n const both = pathTrailing && segLeading;\n if (both) {\n path += seg.slice(1);\n } else {\n path += pathTrailing || segLeading ? seg : `/${seg}`;\n }\n } else {\n path += seg;\n }\n }\n\n return correctPaths(path);\n}\n\nexport const join = joinPaths;\n\n/**\n * Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.\n *\n * @param path - The path to normalize.\n * @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.\n * @returns the normalized path string.\n */\nfunction normalizeString(path: string, allowAboveRoot: boolean) {\n let res = \"\";\n let lastSegmentLength = 0;\n let lastSlash = -1;\n let dots = 0;\n let char: string | null = null;\n for (let index = 0; index <= path.length; ++index) {\n if (index < path.length) {\n // casted because we know it exists thanks to the length check\n char = path[index] as string;\n } else if (char === \"/\") {\n break;\n } else {\n char = \"/\";\n }\n if (char === \"/\") {\n if (lastSlash === index - 1 || dots === 1) {\n // NOOP\n } else if (dots === 2) {\n if (\n res.length < 2 ||\n lastSegmentLength !== 2 ||\n res[res.length - 1] !== \".\" ||\n res[res.length - 2] !== \".\"\n ) {\n if (res.length > 2) {\n const lastSlashIndex = res.lastIndexOf(\"/\");\n if (lastSlashIndex === -1) {\n res = \"\";\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf(\"/\");\n }\n lastSlash = index;\n dots = 0;\n continue;\n } else if (res.length > 0) {\n res = \"\";\n lastSegmentLength = 0;\n lastSlash = index;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n res += res.length > 0 ? \"/..\" : \"..\";\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0) {\n res += `/${path.slice(lastSlash + 1, index)}`;\n } else {\n res = path.slice(lastSlash + 1, index);\n }\n lastSegmentLength = index - lastSlash - 1;\n }\n lastSlash = index;\n dots = 0;\n } else if (char === \".\" && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}\n"],"mappings":"yIA0BA,SAAS,EAAqB,EAAQ,GAAI,CAIxC,OAHK,GAGE,EACJ,QAAQ,MAAO,IAAI,CACnB,QAAQ,EAA0B,GAAK,EAAE,aAAa,CAAC,CAG5D,SAAS,EAAa,EAAe,CACnC,GAAI,CAAC,GAAQ,EAAK,SAAW,EAC3B,MAAO,IAIT,EAAO,EAAqB,EAAK,CAEjC,IAAM,EAAY,EAAK,MAAM,EAAU,CACjC,EAAiB,EAAW,EAAK,CACjC,EAAoB,EAAK,EAAK,OAAS,KAAO,IAyBpD,MAtBA,GAAO,EAAgB,EAAM,CAAC,EAAe,CAEzC,EAAK,SAAW,EACd,EACK,IAEF,EAAoB,KAAO,KAEhC,IACF,GAAQ,KAEN,EAAmB,KAAK,EAAK,GAC/B,GAAQ,KAGN,EACG,EAGE,KAAK,IAFH,OAAO,IAKX,GAAkB,CAAC,EAAW,EAAK,CAAG,IAAI,IAAS,GAU5D,SAAgB,EAAU,GAAG,EAA4B,CACvD,IAAI,EAAO,GAEX,IAAK,IAAM,KAAO,EACX,KAGL,GAAI,EAAK,OAAS,EAAG,CACnB,IAAM,EAAe,EAAK,EAAK,OAAS,KAAO,IACzC,EAAa,EAAI,KAAO,IACjB,GAAgB,EAE3B,GAAQ,EAAI,MAAM,EAAE,CAEpB,GAAQ,GAAgB,EAAa,EAAM,IAAI,SAGjD,GAAQ,EAIZ,OAAO,EAAa,EAAK,CAY3B,SAAS,EAAgB,EAAc,EAAyB,CAC9D,IAAI,EAAM,GACN,EAAoB,EACpB,EAAY,GACZ,EAAO,EACPA,EAAsB,KAC1B,IAAK,IAAI,EAAQ,EAAG,GAAS,EAAK,OAAQ,EAAE,EAAO,CACjD,GAAI,EAAQ,EAAK,OAEf,EAAO,EAAK,WACH,IAAS,IAClB,WAEA,EAAO,IAET,GAAI,IAAS,IAAK,CAChB,GAAI,MAAc,EAAQ,GAAK,IAAS,GAAG,GAEhC,IAAS,EAAG,CACrB,GACE,EAAI,OAAS,GACb,IAAsB,GACtB,EAAI,EAAI,OAAS,KAAO,KACxB,EAAI,EAAI,OAAS,KAAO,QAEpB,EAAI,OAAS,EAAG,CAClB,IAAM,EAAiB,EAAI,YAAY,IAAI,CACvC,IAAmB,IACrB,EAAM,GACN,EAAoB,IAEpB,EAAM,EAAI,MAAM,EAAG,EAAe,CAClC,EAAoB,EAAI,OAAS,EAAI,EAAI,YAAY,IAAI,EAE3D,EAAY,EACZ,EAAO,EACP,iBACS,EAAI,OAAS,EAAG,CACzB,EAAM,GACN,EAAoB,EACpB,EAAY,EACZ,EAAO,EACP,UAGA,IACF,GAAO,EAAI,OAAS,EAAI,MAAQ,KAChC,EAAoB,QAGlB,EAAI,OAAS,EACf,GAAO,IAAI,EAAK,MAAM,EAAY,EAAG,EAAM,GAE3C,EAAM,EAAK,MAAM,EAAY,EAAG,EAAM,CAExC,EAAoB,EAAQ,EAAY,EAE1C,EAAY,EACZ,EAAO,OACE,IAAS,KAAO,IAAS,GAClC,EAAE,EAEF,EAAO,GAGX,OAAO"}
@@ -0,0 +1 @@
1
+ const e=/^[A-Z]:\//i,t=/^[A-Z]:$/i,n=/^[/\\]{2}/,r=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i,i=/^\/([A-Z]:)?$/i,a=/\.[0-9a-z]+$/i,o=/^(?:@[\w-]+\/)?[\w-]+$/;exports.ABSOLUTE_PATH_REGEX=r,exports.DRIVE_LETTER_REGEX=t,exports.DRIVE_LETTER_START_REGEX=e,exports.FILE_EXTENSION_REGEX=a,exports.NPM_SCOPED_PACKAGE_REGEX=o,exports.ROOT_FOLDER_REGEX=i,exports.UNC_REGEX=n;
@@ -0,0 +1,2 @@
1
+ const e=/^[A-Z]:\//i,t=/^[A-Z]:$/i,n=/^[/\\]{2}/,r=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i,i=/^\/([A-Z]:)?$/i,a=/\.[0-9a-z]+$/i,o=/^(?:@[\w-]+\/)?[\w-]+$/;export{r as ABSOLUTE_PATH_REGEX,t as DRIVE_LETTER_REGEX,e as DRIVE_LETTER_START_REGEX,a as FILE_EXTENSION_REGEX,o as NPM_SCOPED_PACKAGE_REGEX,i as ROOT_FOLDER_REGEX,n as UNC_REGEX};
2
+ //# sourceMappingURL=regex.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regex.mjs","names":[],"sources":["../../../../path/src/regex.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\nexport const DRIVE_LETTER_START_REGEX = /^[A-Z]:\\//i;\nexport const DRIVE_LETTER_REGEX = /^[A-Z]:$/i;\n\nexport const UNC_REGEX = /^[/\\\\]{2}/;\n\nexport const ABSOLUTE_PATH_REGEX =\n /^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^~[/\\\\]|^[A-Z]:[/\\\\]/i;\n\nexport const ROOT_FOLDER_REGEX = /^\\/([A-Z]:)?$/i;\n\nexport const FILE_EXTENSION_REGEX = /\\.[0-9a-z]+$/i;\n\nexport const PACKAGE_PATH_REGEX = /^@\\w+\\/.*$/;\nexport const NPM_SCOPED_PACKAGE_REGEX = /^(?:@[\\w-]+\\/)?[\\w-]+$/;\n"],"mappings":"AAkBA,MAAa,EAA2B,aAC3B,EAAqB,YAErB,EAAY,YAEZ,EACX,wDAEW,EAAoB,iBAEpB,EAAuB,gBAGvB,EAA2B"}
@@ -0,0 +1 @@
1
+ const e=require(`./cwd.cjs`),t=require(`./slash.cjs`),n=require(`./is-parent-path.cjs`);function r(r,i=e.cwd()){return n.isParentPath(r,i)?t.slash(r).replace(t.slash(i),``).replace(/^\//,``):r}exports.replacePath=r;
@@ -0,0 +1,2 @@
1
+ import{cwd as e}from"./cwd.mjs";import{slash as t}from"./slash.mjs";import{isParentPath as n}from"./is-parent-path.mjs";function r(r,i=e()){return n(r,i)?t(r).replace(t(i),``).replace(/^\//,``):r}export{r as replacePath};
2
+ //# sourceMappingURL=replace.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replace.mjs","names":[],"sources":["../../../../path/src/replace.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"],"mappings":"wHAuCA,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"}
@@ -0,0 +1 @@
1
+ const e=require(`./join-paths.cjs`),t=(t,n=1)=>{let r=t.replaceAll(/\/+$/g,``);for(let t=0;t<n;t++)r=e.joinPaths(r,`..`);return r};exports.resolveParentPath=t;
@@ -0,0 +1,2 @@
1
+ import{joinPaths as e}from"./join-paths.mjs";const t=(t,n=1)=>{let r=t.replaceAll(/\/+$/g,``);for(let t=0;t<n;t++)r=e(r,`..`);return r};export{t as resolveParentPath};
2
+ //# sourceMappingURL=resolve-parent-path.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-parent-path.mjs","names":[],"sources":["../../../../path/src/resolve-parent-path.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 { joinPaths } from \"./join-paths\";\n\n/**\n * Resolve the parent path of the provided path.\n *\n * @param path - The path to resolve.\n * @param count - The number of parent directories to traverse.\n * @returns The parent path of the provided path.\n */\nexport const resolveParentPath = (path: string, count: number = 1): string => {\n let parentPath = path.replaceAll(/\\/+$/g, \"\");\n for (let i = 0; i < count; i++) {\n parentPath = joinPaths(parentPath, \"..\");\n }\n return parentPath;\n};\n"],"mappings":"6CA2BA,MAAa,GAAqB,EAAc,EAAgB,IAAc,CAC5E,IAAI,EAAa,EAAK,WAAW,QAAS,GAAG,CAC7C,IAAK,IAAI,EAAI,EAAG,EAAI,EAAO,IACzB,EAAa,EAAU,EAAY,KAAK,CAE1C,OAAO"}
@@ -0,0 +1 @@
1
+ function e(e){return e.startsWith(`\\\\?\\`)?e:e.replace(/\\/g,`/`)}exports.slash=e;
@@ -0,0 +1,2 @@
1
+ function e(e){return e.startsWith(`\\\\?\\`)?e:e.replace(/\\/g,`/`)}export{e as slash};
2
+ //# sourceMappingURL=slash.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slash.mjs","names":[],"sources":["../../../../path/src/slash.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 { isAbsolutePath } from \"./is-type\";\n\n/**\n * Replace backslash to slash\n *\n * @param path - The string to replace\n * @returns The string with replaced backslashes\n */\nexport function slash(path: string) {\n if (path.startsWith(\"\\\\\\\\?\\\\\")) {\n return path;\n }\n\n return path.replace(/\\\\/g, \"/\");\n}\n\n/**\n * Replace backslash to slash and remove unneeded leading and trailing slashes\n *\n * @param path - The string to replace\n * @returns The string with replaced backslashes\n */\nexport function formatSlash(path: string) {\n const formatted = slash(path);\n\n return isAbsolutePath(formatted)\n ? formatted.replace(/\\/+$/g, \"\")\n : formatted.replace(/^\\.\\//g, \"\").replace(/\\/+$/g, \"\");\n}\n"],"mappings":"AA0BA,SAAgB,EAAM,EAAc,CAKlC,OAJI,EAAK,WAAW,UAAU,CACrB,EAGF,EAAK,QAAQ,MAAO,IAAI"}
@@ -1 +1 @@
1
- const e=require(`./read-file-BB2WzW-N.cjs`);exports.readFile=e.t,exports.readFileIfExisting=e.n,exports.readFileIfExistingSync=e.r,exports.readFileSync=e.i;
1
+ const e=require(`./_virtual/rolldown_runtime.cjs`);let t=require(`node:fs`),n=require(`node:fs/promises`);const r=e=>{if(!e)throw Error(`No file path provided to read data`);return(0,t.readFileSync)(e,{encoding:`utf8`})},i=async e=>{if(!e)throw Error(`No file path provided to read data`);return(0,n.readFile)(e,{encoding:`utf8`})};function a(e){return(0,t.existsSync)(e)?r(e):``}async function o(e){return(0,t.existsSync)(e)?i(e):``}exports.readFile=i,exports.readFileIfExisting=o,exports.readFileIfExistingSync=a,exports.readFileSync=r;
@@ -1,2 +1,30 @@
1
- import { i as readFileSync, n as readFileIfExisting, r as readFileIfExistingSync, t as readFile } from "./read-file-Bxn1VHKv.cjs";
2
- export { readFile, readFileIfExisting, readFileIfExistingSync, readFileSync };
1
+ //#region src/read-file.d.ts
2
+ /**
3
+ * Read the given content to the given file path
4
+ *
5
+ * @param filePath - The file path to write to
6
+ */
7
+ declare const readFileSync: (filePath: string) => string;
8
+ /**
9
+ * Read the given content to the given file path
10
+ *
11
+ * @param filePath - The file path to read to
12
+ */
13
+ declare const readFile: (filePath: string) => Promise<string>;
14
+ /**
15
+ * Reads a file if it exists, otherwise returns an empty string.
16
+ *
17
+ * @param path - The path to the file to read.
18
+ * @returns The content of the file if it exists, otherwise an empty string.
19
+ */
20
+ declare function readFileIfExistingSync(path: string): string;
21
+ /**
22
+ * Reads a file if it exists, otherwise returns an empty string.
23
+ *
24
+ * @param path - The path to the file to read.
25
+ * @returns The content of the file if it exists, otherwise an empty string.
26
+ */
27
+ declare function readFileIfExisting(path: string): Promise<string>;
28
+ //#endregion
29
+ export { readFile, readFileIfExisting, readFileIfExistingSync, readFileSync };
30
+ //# sourceMappingURL=read-file.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-file.d.cts","names":[],"sources":["../src/read-file.ts"],"sourcesContent":[],"mappings":";;AA0BA;AAaA;AAcA;AAUA;cArCa;;;;;;cAaA,gCAAqC;;;;;;;iBAclC,sBAAA;;;;;;;iBAUM,kBAAA,gBAA+B"}
@@ -1,2 +1,30 @@
1
- import { i as readFileSync, n as readFileIfExisting, r as readFileIfExistingSync, t as readFile } from "./read-file-CRVW-wcE.mjs";
2
- export { readFile, readFileIfExisting, readFileIfExistingSync, readFileSync };
1
+ //#region src/read-file.d.ts
2
+ /**
3
+ * Read the given content to the given file path
4
+ *
5
+ * @param filePath - The file path to write to
6
+ */
7
+ declare const readFileSync: (filePath: string) => string;
8
+ /**
9
+ * Read the given content to the given file path
10
+ *
11
+ * @param filePath - The file path to read to
12
+ */
13
+ declare const readFile: (filePath: string) => Promise<string>;
14
+ /**
15
+ * Reads a file if it exists, otherwise returns an empty string.
16
+ *
17
+ * @param path - The path to the file to read.
18
+ * @returns The content of the file if it exists, otherwise an empty string.
19
+ */
20
+ declare function readFileIfExistingSync(path: string): string;
21
+ /**
22
+ * Reads a file if it exists, otherwise returns an empty string.
23
+ *
24
+ * @param path - The path to the file to read.
25
+ * @returns The content of the file if it exists, otherwise an empty string.
26
+ */
27
+ declare function readFileIfExisting(path: string): Promise<string>;
28
+ //#endregion
29
+ export { readFile, readFileIfExisting, readFileIfExistingSync, readFileSync };
30
+ //# sourceMappingURL=read-file.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-file.d.mts","names":[],"sources":["../src/read-file.ts"],"sourcesContent":[],"mappings":";;AA0BA;AAaA;AAcA;AAUA;cArCa;;;;;;cAaA,gCAAqC;;;;;;;iBAclC,sBAAA;;;;;;;iBAUM,kBAAA,gBAA+B"}
@@ -1 +1,2 @@
1
- import{i as e,n as t,r as n,t as r}from"./read-file-B091zB64.mjs";export{r as readFile,t as readFileIfExisting,n as readFileIfExistingSync,e as readFileSync};
1
+ import{existsSync as e,readFileSync as t}from"node:fs";import{readFile as n}from"node:fs/promises";const r=e=>{if(!e)throw Error(`No file path provided to read data`);return t(e,{encoding:`utf8`})},i=async e=>{if(!e)throw Error(`No file path provided to read data`);return n(e,{encoding:`utf8`})};function a(t){return e(t)?r(t):``}async function o(t){return e(t)?i(t):``}export{i as readFile,o as readFileIfExisting,a as readFileIfExistingSync,r as readFileSync};
2
+ //# sourceMappingURL=read-file.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-file.mjs","names":["readFileSyncFs","readFileFs"],"sources":["../src/read-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 { existsSync, readFileSync as readFileSyncFs } from \"node:fs\";\nimport { readFile as readFileFs } from \"node:fs/promises\";\n\n/**\n * Read the given content to the given file path\n *\n * @param filePath - The file path to write to\n */\nexport const readFileSync = (filePath: string): string => {\n if (!filePath) {\n throw new Error(\"No file path provided to read data\");\n }\n\n return readFileSyncFs(filePath, { encoding: \"utf8\" });\n};\n\n/**\n * Read the given content to the given file path\n *\n * @param filePath - The file path to read to\n */\nexport const readFile = async (filePath: string): Promise<string> => {\n if (!filePath) {\n throw new Error(\"No file path provided to read data\");\n }\n\n return readFileFs(filePath, { encoding: \"utf8\" });\n};\n\n/**\n * Reads a file if it exists, otherwise returns an empty string.\n *\n * @param path - The path to the file to read.\n * @returns The content of the file if it exists, otherwise an empty string.\n */\nexport function readFileIfExistingSync(path: string) {\n return existsSync(path) ? readFileSync(path) : \"\";\n}\n\n/**\n * Reads a file if it exists, otherwise returns an empty string.\n *\n * @param path - The path to the file to read.\n * @returns The content of the file if it exists, otherwise an empty string.\n */\nexport async function readFileIfExisting(path: string) {\n return existsSync(path) ? readFile(path) : \"\";\n}\n"],"mappings":"mGA0BA,MAAa,EAAgB,GAA6B,CACxD,GAAI,CAAC,EACH,MAAU,MAAM,qCAAqC,CAGvD,OAAOA,EAAe,EAAU,CAAE,SAAU,OAAQ,CAAC,EAQ1C,EAAW,KAAO,IAAsC,CACnE,GAAI,CAAC,EACH,MAAU,MAAM,qCAAqC,CAGvD,OAAOC,EAAW,EAAU,CAAE,SAAU,OAAQ,CAAC,EASnD,SAAgB,EAAuB,EAAc,CACnD,OAAO,EAAW,EAAK,CAAG,EAAa,EAAK,CAAG,GASjD,eAAsB,EAAmB,EAAc,CACrD,OAAO,EAAW,EAAK,CAAG,EAAS,EAAK,CAAG"}
package/dist/registry.cjs CHANGED
@@ -1 +1 @@
1
- require(`./get-workspace-root-CCNjjZGY.cjs`);const e=require(`./registry-BYwvM92u.cjs`);exports.formatNodeOptions=e.t,exports.getFormattedNodeOptionsWithoutInspect=e.n,exports.getParsedNodeOptionsWithoutInspect=e.r,exports.getRegistry=e.i,exports.tokenizeArgs=e.a;
1
+ const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./get-workspace-root.cjs`);let n=require(`node:child_process`),r=require(`@antfu/install-pkg`),i=require(`node:util`);const a=e=>{let{values:t,tokens:n}=(0,i.parseArgs)({args:e,strict:!1,tokens:!0}),r=null;for(let e=0;e<n.length;e++){let i=n[e];if(i.kind===`option-terminator`)break;if(i.kind===`option`){r=i.value===void 0?i:null;continue}if(i.kind!==`positional`){r=null;continue}r&&(r.name in t&&typeof t[r.name]==`string`?t[r.name]+=` ${i.value}`:t[r.name]=i.value)}return t},o=e=>{let t=[],n=!1,r=!0;for(let i=0;i<e.length;i++){let a=e[i];if(a===`\\`&&n){if(e.length===i+1)throw Error(`Invalid escape character at the end.`);a=e[++i]}else if(a===` `&&!n){r=!0;continue}else if(a===`"`){n=!n;continue}r?(t.push(a),r=!1):t[t.length-1]+=a}if(n)throw Error(`Unterminated string`);return t},s=()=>process.env.NODE_OPTIONS?o(process.env.NODE_OPTIONS):[];function c(e){return Object.entries(e).map(([e,t])=>t===!0?`--${e}`:t?`--${e}=${t.includes(` `)&&!t.startsWith(`"`)?JSON.stringify(t):t}`:null).filter(e=>e!==null).join(` `)}function l(){let e=s();if(e.length===0)return{};let t=a(e);return delete t.inspect,delete t[`inspect-brk`],delete t.inspect_brk,t}function u(){let e=l();return Object.keys(e).length===0?``:c(e)}async function d(e){let i=await(0,r.detectPackageManager)(t.getWorkspaceRoot(e)),a=i===`npm`?`--no-workspaces`:``,o=`https://registry.npmjs.org/`;try{let e=(0,n.execSync)(`${i} config get registry ${a}`,{env:{...process.env,NODE_OPTIONS:u()}}).toString().trim();e.startsWith(`http`)&&(o=e.endsWith(`/`)?e:`${e}/`)}catch(e){throw Error(`Failed to get registry from "${i}".`,{cause:e})}return o}exports.formatNodeOptions=c,exports.getFormattedNodeOptionsWithoutInspect=u,exports.getParsedNodeOptionsWithoutInspect=l,exports.getRegistry=d,exports.tokenizeArgs=o;
@@ -1,2 +1,53 @@
1
- import { a as getRegistry, i as getParsedNodeOptionsWithoutInspect, n as formatNodeOptions, o as tokenizeArgs, r as getFormattedNodeOptionsWithoutInspect, t as NodeOptionsToken } from "./registry-C2A0Kau7.cjs";
2
- export { NodeOptionsToken, formatNodeOptions, getFormattedNodeOptionsWithoutInspect, getParsedNodeOptionsWithoutInspect, getRegistry, tokenizeArgs };
1
+ //#region src/registry.d.ts
2
+ interface NodeOptionsToken {
3
+ kind: "option";
4
+ index: number;
5
+ name: string;
6
+ rawName: string;
7
+ value: undefined;
8
+ inlineValue: undefined;
9
+ }
10
+ /**
11
+ * Tokenizes the arguments string into an array of strings, supporting quoted
12
+ * values and escaped characters.
13
+ * Converted from: https://github.com/nodejs/node/blob/c29d53c5cfc63c5a876084e788d70c9e87bed880/src/node_options.cc#L1401
14
+ *
15
+ * @param input - The arguments string to be tokenized.
16
+ * @returns An array of strings with the tokenized arguments.
17
+ */
18
+ declare const tokenizeArgs: (input: string) => string[];
19
+ /**
20
+ * Stringify the arguments to be used in a command line. It will ignore any
21
+ * argument that has a value of `undefined`.
22
+ *
23
+ * @param args - The arguments to be stringified.
24
+ * @returns A string with the arguments.
25
+ */
26
+ declare function formatNodeOptions(args: Record<string, string | boolean | undefined>): string;
27
+ /**
28
+ * Get the node options from the `NODE_OPTIONS` environment variable and parse
29
+ * them into an object without the inspect options.
30
+ *
31
+ * @returns An object with the parsed node options.
32
+ */
33
+ declare function getParsedNodeOptionsWithoutInspect(): {
34
+ [longOption: string]: string | boolean | undefined;
35
+ };
36
+ /**
37
+ * Get the node options from the `NODE_OPTIONS` environment variable and format
38
+ * them into a string without the inspect options.
39
+ *
40
+ * @returns A string with the formatted node options.
41
+ */
42
+ declare function getFormattedNodeOptionsWithoutInspect(): string;
43
+ /**
44
+ * Returns the package registry using the user's package manager. The URL will have a trailing slash.
45
+ *
46
+ * @param baseDir - The base directory to detect the package manager from.
47
+ * @returns The package registry URL with a trailing slash.
48
+ * @throws Will throw an error if the package manager cannot be detected or if the registry cannot be retrieved.
49
+ */
50
+ declare function getRegistry(baseDir?: string): Promise<string>;
51
+ //#endregion
52
+ export { NodeOptionsToken, formatNodeOptions, getFormattedNodeOptionsWithoutInspect, getParsedNodeOptionsWithoutInspect, getRegistry, tokenizeArgs };
53
+ //# sourceMappingURL=registry.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.cts","names":[],"sources":["../src/registry.ts"],"sourcesContent":[],"mappings":";UAuBiB,gBAAA;EAAA,IAAA,EAAA,QAAA;EA8DJ,KAAA,EAAA,MAAA;EAmEG,IAAA,EAAA,MAAA;EA+BA,OAAA,EAAA,MAAA;EAoBA,KAAA,EAAA,SAAA;EAcM,WAAA,EAAA,SAAW;;;;;;;;;;cApIpB;;;;;;;;iBAmEG,iBAAA,OACR;;;;;;;iBA8BQ,kCAAA,CAAA;;;;;;;;;iBAoBA,qCAAA,CAAA;;;;;;;;iBAcM,WAAA,oBAA4B"}
@@ -1,2 +1,53 @@
1
- import { a as getRegistry, i as getParsedNodeOptionsWithoutInspect, n as formatNodeOptions, o as tokenizeArgs, r as getFormattedNodeOptionsWithoutInspect, t as NodeOptionsToken } from "./registry-BQ3JXRFA.mjs";
2
- export { NodeOptionsToken, formatNodeOptions, getFormattedNodeOptionsWithoutInspect, getParsedNodeOptionsWithoutInspect, getRegistry, tokenizeArgs };
1
+ //#region src/registry.d.ts
2
+ interface NodeOptionsToken {
3
+ kind: "option";
4
+ index: number;
5
+ name: string;
6
+ rawName: string;
7
+ value: undefined;
8
+ inlineValue: undefined;
9
+ }
10
+ /**
11
+ * Tokenizes the arguments string into an array of strings, supporting quoted
12
+ * values and escaped characters.
13
+ * Converted from: https://github.com/nodejs/node/blob/c29d53c5cfc63c5a876084e788d70c9e87bed880/src/node_options.cc#L1401
14
+ *
15
+ * @param input - The arguments string to be tokenized.
16
+ * @returns An array of strings with the tokenized arguments.
17
+ */
18
+ declare const tokenizeArgs: (input: string) => string[];
19
+ /**
20
+ * Stringify the arguments to be used in a command line. It will ignore any
21
+ * argument that has a value of `undefined`.
22
+ *
23
+ * @param args - The arguments to be stringified.
24
+ * @returns A string with the arguments.
25
+ */
26
+ declare function formatNodeOptions(args: Record<string, string | boolean | undefined>): string;
27
+ /**
28
+ * Get the node options from the `NODE_OPTIONS` environment variable and parse
29
+ * them into an object without the inspect options.
30
+ *
31
+ * @returns An object with the parsed node options.
32
+ */
33
+ declare function getParsedNodeOptionsWithoutInspect(): {
34
+ [longOption: string]: string | boolean | undefined;
35
+ };
36
+ /**
37
+ * Get the node options from the `NODE_OPTIONS` environment variable and format
38
+ * them into a string without the inspect options.
39
+ *
40
+ * @returns A string with the formatted node options.
41
+ */
42
+ declare function getFormattedNodeOptionsWithoutInspect(): string;
43
+ /**
44
+ * Returns the package registry using the user's package manager. The URL will have a trailing slash.
45
+ *
46
+ * @param baseDir - The base directory to detect the package manager from.
47
+ * @returns The package registry URL with a trailing slash.
48
+ * @throws Will throw an error if the package manager cannot be detected or if the registry cannot be retrieved.
49
+ */
50
+ declare function getRegistry(baseDir?: string): Promise<string>;
51
+ //#endregion
52
+ export { NodeOptionsToken, formatNodeOptions, getFormattedNodeOptionsWithoutInspect, getParsedNodeOptionsWithoutInspect, getRegistry, tokenizeArgs };
53
+ //# sourceMappingURL=registry.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.mts","names":[],"sources":["../src/registry.ts"],"sourcesContent":[],"mappings":";UAuBiB,gBAAA;EAAA,IAAA,EAAA,QAAA;EA8DJ,KAAA,EAAA,MAAA;EAmEG,IAAA,EAAA,MAAA;EA+BA,OAAA,EAAA,MAAA;EAoBA,KAAA,EAAA,SAAA;EAcM,WAAA,EAAA,SAAW;;;;;;;;;;cApIpB;;;;;;;;iBAmEG,iBAAA,OACR;;;;;;;iBA8BQ,kCAAA,CAAA;;;;;;;;;iBAoBA,qCAAA,CAAA;;;;;;;;iBAcM,WAAA,oBAA4B"}
package/dist/registry.mjs CHANGED
@@ -1 +1,2 @@
1
- import"./get-workspace-root-k66w-wLW.mjs";import{a as e,i as t,n,r,t as i}from"./registry-B1taIPKm.mjs";export{i as formatNodeOptions,n as getFormattedNodeOptionsWithoutInspect,r as getParsedNodeOptionsWithoutInspect,t as getRegistry,e as tokenizeArgs};
1
+ import{getWorkspaceRoot as e}from"./get-workspace-root.mjs";import{execSync as t}from"node:child_process";import{detectPackageManager as n}from"@antfu/install-pkg";import{parseArgs as r}from"node:util";const i=e=>{let{values:t,tokens:n}=r({args:e,strict:!1,tokens:!0}),i=null;for(let e=0;e<n.length;e++){let r=n[e];if(r.kind===`option-terminator`)break;if(r.kind===`option`){i=r.value===void 0?r:null;continue}if(r.kind!==`positional`){i=null;continue}i&&(i.name in t&&typeof t[i.name]==`string`?t[i.name]+=` ${r.value}`:t[i.name]=r.value)}return t},a=e=>{let t=[],n=!1,r=!0;for(let i=0;i<e.length;i++){let a=e[i];if(a===`\\`&&n){if(e.length===i+1)throw Error(`Invalid escape character at the end.`);a=e[++i]}else if(a===` `&&!n){r=!0;continue}else if(a===`"`){n=!n;continue}r?(t.push(a),r=!1):t[t.length-1]+=a}if(n)throw Error(`Unterminated string`);return t},o=()=>process.env.NODE_OPTIONS?a(process.env.NODE_OPTIONS):[];function s(e){return Object.entries(e).map(([e,t])=>t===!0?`--${e}`:t?`--${e}=${t.includes(` `)&&!t.startsWith(`"`)?JSON.stringify(t):t}`:null).filter(e=>e!==null).join(` `)}function c(){let e=o();if(e.length===0)return{};let t=i(e);return delete t.inspect,delete t[`inspect-brk`],delete t.inspect_brk,t}function l(){let e=c();return Object.keys(e).length===0?``:s(e)}async function u(r){let i=await n(e(r)),a=i===`npm`?`--no-workspaces`:``,o=`https://registry.npmjs.org/`;try{let e=t(`${i} config get registry ${a}`,{env:{...process.env,NODE_OPTIONS:l()}}).toString().trim();e.startsWith(`http`)&&(o=e.endsWith(`/`)?e:`${e}/`)}catch(e){throw Error(`Failed to get registry from "${i}".`,{cause:e})}return o}export{s as formatNodeOptions,l as getFormattedNodeOptionsWithoutInspect,c as getParsedNodeOptionsWithoutInspect,u as getRegistry,a as tokenizeArgs};
2
+ //# sourceMappingURL=registry.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.mjs","names":["orphan: NodeOptionsToken | null | undefined","args: string[]"],"sources":["../src/registry.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 { detectPackageManager } from \"@antfu/install-pkg\";\nimport { execSync } from \"node:child_process\";\nimport { parseArgs } from \"node:util\";\nimport { getWorkspaceRoot } from \"./get-workspace-root\";\n\nexport interface NodeOptionsToken {\n kind: \"option\";\n index: number;\n name: string;\n rawName: string;\n value: undefined;\n inlineValue: undefined;\n}\n\nconst parseNodeArgs = (args: string[]) => {\n const { values, tokens } = parseArgs({ args, strict: false, tokens: true });\n\n // For the `NODE_OPTIONS`, we support arguments with values without the `=`\n // sign. We need to parse them manually.\n let orphan: NodeOptionsToken | null | undefined = null;\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i]!;\n\n if (token.kind === \"option-terminator\") {\n break;\n }\n\n // When we encounter an option, if it's value is undefined, we should check\n // to see if the following tokens are positional parameters. If they are,\n // then the option is orphaned, and we can assign it.\n if (token.kind === \"option\") {\n orphan = typeof token.value === \"undefined\" ? token : null;\n continue;\n }\n\n // If the token isn't a positional one, then we can't assign it to the found\n // orphaned option.\n if (token.kind !== \"positional\") {\n orphan = null;\n continue;\n }\n\n // If we don't have an orphan, then we can skip this token.\n if (!orphan) {\n continue;\n }\n\n // If the token is a positional one, and it has a value, so add it to the\n // values object. If it already exists, append it with a space.\n if (orphan.name in values && typeof values[orphan.name] === \"string\") {\n values[orphan.name] += ` ${token.value}`;\n } else {\n values[orphan.name] = token.value;\n }\n }\n\n return values;\n};\n\n/**\n * Tokenizes the arguments string into an array of strings, supporting quoted\n * values and escaped characters.\n * Converted from: https://github.com/nodejs/node/blob/c29d53c5cfc63c5a876084e788d70c9e87bed880/src/node_options.cc#L1401\n *\n * @param input - The arguments string to be tokenized.\n * @returns An array of strings with the tokenized arguments.\n */\nexport const tokenizeArgs = (input: string): string[] => {\n const args: string[] = [];\n let isInString = false;\n let willStartNewArg = true;\n\n for (let i = 0; i < input.length; i++) {\n let char = input[i]!;\n\n // Skip any escaped characters in strings.\n if (char === \"\\\\\" && isInString) {\n // Ensure we don't have an escape character at the end.\n if (input.length === i + 1) {\n throw new Error(\"Invalid escape character at the end.\");\n }\n\n // Skip the next character.\n char = input[++i]!;\n }\n // If we find a space outside of a string, we should start a new argument.\n else if (char === \" \" && !isInString) {\n willStartNewArg = true;\n continue;\n }\n\n // If we find a quote, we should toggle the string flag.\n else if (char === '\"') {\n isInString = !isInString;\n continue;\n }\n\n // If we're starting a new argument, we should add it to the array.\n if (willStartNewArg) {\n args.push(char);\n willStartNewArg = false;\n }\n // Otherwise, add it to the last argument.\n else {\n args[args.length - 1] += char;\n }\n }\n\n if (isInString) {\n throw new Error(\"Unterminated string\");\n }\n\n return args;\n};\n\n/**\n * Get the node options from the environment variable `NODE_OPTIONS` and returns\n * them as an array of strings.\n *\n * @returns An array of strings with the node options.\n */\nconst getNodeOptionsArgs = () => {\n if (!process.env.NODE_OPTIONS) return [];\n\n return tokenizeArgs(process.env.NODE_OPTIONS);\n};\n\n/**\n * Stringify the arguments to be used in a command line. It will ignore any\n * argument that has a value of `undefined`.\n *\n * @param args - The arguments to be stringified.\n * @returns A string with the arguments.\n */\nexport function formatNodeOptions(\n args: Record<string, string | boolean | undefined>\n): string {\n return Object.entries(args)\n .map(([key, value]) => {\n if (value === true) {\n return `--${key}`;\n }\n\n if (value) {\n return `--${key}=${\n // Values with spaces need to be quoted. We use JSON.stringify to\n // also escape any nested quotes.\n value.includes(\" \") && !value.startsWith('\"')\n ? JSON.stringify(value)\n : value\n }`;\n }\n\n return null;\n })\n .filter(arg => arg !== null)\n .join(\" \");\n}\n\n/**\n * Get the node options from the `NODE_OPTIONS` environment variable and parse\n * them into an object without the inspect options.\n *\n * @returns An object with the parsed node options.\n */\nexport function getParsedNodeOptionsWithoutInspect() {\n const args = getNodeOptionsArgs();\n if (args.length === 0) return {};\n\n const parsed = parseNodeArgs(args);\n\n // Remove inspect options.\n delete parsed.inspect;\n delete parsed[\"inspect-brk\"];\n delete parsed.inspect_brk;\n\n return parsed;\n}\n\n/**\n * Get the node options from the `NODE_OPTIONS` environment variable and format\n * them into a string without the inspect options.\n *\n * @returns A string with the formatted node options.\n */\nexport function getFormattedNodeOptionsWithoutInspect() {\n const args = getParsedNodeOptionsWithoutInspect();\n if (Object.keys(args).length === 0) return \"\";\n\n return formatNodeOptions(args);\n}\n\n/**\n * Returns the package registry using the user's package manager. The URL will have a trailing slash.\n *\n * @param baseDir - The base directory to detect the package manager from.\n * @returns The package registry URL with a trailing slash.\n * @throws Will throw an error if the package manager cannot be detected or if the registry cannot be retrieved.\n */\nexport async function getRegistry(baseDir?: string) {\n const workspaceRoot = getWorkspaceRoot(baseDir);\n const pkgManager = await detectPackageManager(workspaceRoot);\n\n // Since `npm config` command fails in npm workspace to prevent workspace config conflicts,\n // add `--no-workspaces` flag to run under the context of the root project only.\n // Safe for non-workspace projects as it's equivalent to default `--workspaces=false`.\n // x-ref: https://github.com/vercel/next.js/issues/47121#issuecomment-1499044345\n // x-ref: https://github.com/npm/statusboard/issues/371#issue-920669998\n const resolvedFlags = pkgManager === \"npm\" ? \"--no-workspaces\" : \"\";\n let registry = `https://registry.npmjs.org/`;\n\n try {\n const output = execSync(\n `${pkgManager} config get registry ${resolvedFlags}`,\n {\n env: {\n ...process.env,\n NODE_OPTIONS: getFormattedNodeOptionsWithoutInspect()\n }\n }\n )\n .toString()\n .trim();\n\n if (output.startsWith(\"http\")) {\n registry = output.endsWith(\"/\") ? output : `${output}/`;\n }\n } catch (err) {\n throw new Error(`Failed to get registry from \"${pkgManager}\".`, {\n cause: err\n });\n }\n\n return registry;\n}\n"],"mappings":"0MAgCA,MAAM,EAAiB,GAAmB,CACxC,GAAM,CAAE,SAAQ,UAAW,EAAU,CAAE,OAAM,OAAQ,GAAO,OAAQ,GAAM,CAAC,CAIvEA,EAA8C,KAClD,IAAK,IAAI,EAAI,EAAG,EAAI,EAAO,OAAQ,IAAK,CACtC,IAAM,EAAQ,EAAO,GAErB,GAAI,EAAM,OAAS,oBACjB,MAMF,GAAI,EAAM,OAAS,SAAU,CAC3B,EAAgB,EAAM,QAAU,OAAc,EAAQ,KACtD,SAKF,GAAI,EAAM,OAAS,aAAc,CAC/B,EAAS,KACT,SAIG,IAMD,EAAO,QAAQ,GAAU,OAAO,EAAO,EAAO,OAAU,SAC1D,EAAO,EAAO,OAAS,IAAI,EAAM,QAEjC,EAAO,EAAO,MAAQ,EAAM,OAIhC,OAAO,GAWI,EAAgB,GAA4B,CACvD,IAAMC,EAAiB,EAAE,CACrB,EAAa,GACb,EAAkB,GAEtB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,OAAQ,IAAK,CACrC,IAAI,EAAO,EAAM,GAGjB,GAAI,IAAS,MAAQ,EAAY,CAE/B,GAAI,EAAM,SAAW,EAAI,EACvB,MAAU,MAAM,uCAAuC,CAIzD,EAAO,EAAM,EAAE,WAGR,IAAS,KAAO,CAAC,EAAY,CACpC,EAAkB,GAClB,iBAIO,IAAS,IAAK,CACrB,EAAa,CAAC,EACd,SAIE,GACF,EAAK,KAAK,EAAK,CACf,EAAkB,IAIlB,EAAK,EAAK,OAAS,IAAM,EAI7B,GAAI,EACF,MAAU,MAAM,sBAAsB,CAGxC,OAAO,GASH,MACC,QAAQ,IAAI,aAEV,EAAa,QAAQ,IAAI,aAAa,CAFP,EAAE,CAY1C,SAAgB,EACd,EACQ,CACR,OAAO,OAAO,QAAQ,EAAK,CACxB,KAAK,CAAC,EAAK,KACN,IAAU,GACL,KAAK,IAGV,EACK,KAAK,EAAI,GAGd,EAAM,SAAS,IAAI,EAAI,CAAC,EAAM,WAAW,IAAI,CACzC,KAAK,UAAU,EAAM,CACrB,IAID,KACP,CACD,OAAO,GAAO,IAAQ,KAAK,CAC3B,KAAK,IAAI,CASd,SAAgB,GAAqC,CACnD,IAAM,EAAO,GAAoB,CACjC,GAAI,EAAK,SAAW,EAAG,MAAO,EAAE,CAEhC,IAAM,EAAS,EAAc,EAAK,CAOlC,OAJA,OAAO,EAAO,QACd,OAAO,EAAO,eACd,OAAO,EAAO,YAEP,EAST,SAAgB,GAAwC,CACtD,IAAM,EAAO,GAAoC,CAGjD,OAFI,OAAO,KAAK,EAAK,CAAC,SAAW,EAAU,GAEpC,EAAkB,EAAK,CAUhC,eAAsB,EAAY,EAAkB,CAElD,IAAM,EAAa,MAAM,EADH,EAAiB,EAAQ,CACa,CAOtD,EAAgB,IAAe,MAAQ,kBAAoB,GAC7D,EAAW,8BAEf,GAAI,CACF,IAAM,EAAS,EACb,GAAG,EAAW,uBAAuB,IACrC,CACE,IAAK,CACH,GAAG,QAAQ,IACX,aAAc,GAAuC,CACtD,CACF,CACF,CACE,UAAU,CACV,MAAM,CAEL,EAAO,WAAW,OAAO,GAC3B,EAAW,EAAO,SAAS,IAAI,CAAG,EAAS,GAAG,EAAO,UAEhD,EAAK,CACZ,MAAU,MAAM,gCAAgC,EAAW,IAAK,CAC9D,MAAO,EACR,CAAC,CAGJ,OAAO"}
@@ -1 +1 @@
1
- const e=require(`./remove-file-XHFKELQN.cjs`);exports.removeFile=e.t,exports.removeFileSync=e.n;
1
+ const e=require(`./_virtual/rolldown_runtime.cjs`);let t=require(`node:fs`),n=require(`node:fs/promises`);const r=e=>{!e||!(0,t.existsSync)(e)||(0,t.rmSync)(e)},i=async e=>{if(!(!e||!(0,t.existsSync)(e)))return(0,n.rm)(e)};exports.removeFile=i,exports.removeFileSync=r;
@@ -1,2 +1,16 @@
1
- import { n as removeFileSync, t as removeFile } from "./remove-file-lQOlxDwr.cjs";
2
- export { removeFile, removeFileSync };
1
+ //#region src/remove-file.d.ts
2
+ /**
3
+ * Remove the given content to the given file path
4
+ *
5
+ * @param filePath - The file path to remove to
6
+ */
7
+ declare const removeFileSync: (filePath: string) => void;
8
+ /**
9
+ * Remove the given content to the given file path
10
+ *
11
+ * @param filePath - The file path to read to
12
+ */
13
+ declare const removeFile: (filePath: string) => Promise<void>;
14
+ //#endregion
15
+ export { removeFile, removeFileSync };
16
+ //# sourceMappingURL=remove-file.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-file.d.cts","names":[],"sources":["../src/remove-file.ts"],"sourcesContent":[],"mappings":";;AA0BA;AAaA;;;cAba;;;;;;cAaA,kCAAuC"}
@@ -1,2 +1,16 @@
1
- import { n as removeFileSync, t as removeFile } from "./remove-file-BqlkL_Df.mjs";
2
- export { removeFile, removeFileSync };
1
+ //#region src/remove-file.d.ts
2
+ /**
3
+ * Remove the given content to the given file path
4
+ *
5
+ * @param filePath - The file path to remove to
6
+ */
7
+ declare const removeFileSync: (filePath: string) => void;
8
+ /**
9
+ * Remove the given content to the given file path
10
+ *
11
+ * @param filePath - The file path to read to
12
+ */
13
+ declare const removeFile: (filePath: string) => Promise<void>;
14
+ //#endregion
15
+ export { removeFile, removeFileSync };
16
+ //# sourceMappingURL=remove-file.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-file.d.mts","names":[],"sources":["../src/remove-file.ts"],"sourcesContent":[],"mappings":";;AA0BA;AAaA;;;cAba;;;;;;cAaA,kCAAuC"}
@@ -1 +1,2 @@
1
- import{n as e,t}from"./remove-file-BM64Brdf.mjs";export{t as removeFile,e as removeFileSync};
1
+ import{existsSync as e,rmSync as t}from"node:fs";import{rm as n}from"node:fs/promises";const r=n=>{!n||!e(n)||t(n)},i=async t=>{if(!(!t||!e(t)))return n(t)};export{i as removeFile,r as removeFileSync};
2
+ //# sourceMappingURL=remove-file.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-file.mjs","names":[],"sources":["../src/remove-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 { existsSync, rmSync } from \"node:fs\";\nimport { rm } from \"node:fs/promises\";\n\n/**\n * Remove the given content to the given file path\n *\n * @param filePath - The file path to remove to\n */\nexport const removeFileSync = (filePath: string): void => {\n if (!filePath || !existsSync(filePath)) {\n return;\n }\n\n rmSync(filePath);\n};\n\n/**\n * Remove the given content to the given file path\n *\n * @param filePath - The file path to read to\n */\nexport const removeFile = async (filePath: string): Promise<void> => {\n if (!filePath || !existsSync(filePath)) {\n return;\n }\n\n return rm(filePath);\n};\n"],"mappings":"uFA0BA,MAAa,EAAkB,GAA2B,CACpD,CAAC,GAAY,CAAC,EAAW,EAAS,EAItC,EAAO,EAAS,EAQL,EAAa,KAAO,IAAoC,CAC/D,MAAC,GAAY,CAAC,EAAW,EAAS,EAItC,OAAO,EAAG,EAAS"}
package/dist/resolve.cjs CHANGED
@@ -1 +1,3 @@
1
- require(`./get-workspace-root-CCNjjZGY.cjs`);const e=require(`./resolve-DTkLQekH.cjs`);exports.DEFAULT_EXTENSIONS=e.t,exports.getNodeModulesPaths=e.n,exports.getResolutionCombinations=e.r,exports.getResolutionPaths=e.i,exports.importModule=e.a,exports.resolve=e.o,exports.resolvePackage=e.s,exports.resolvePackageSync=e.c,exports.resolveSafe=e.l,exports.resolveSafeSync=e.u,exports.resolveSync=e.d;
1
+ const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./path/src/cwd.cjs`),n=require(`./path/src/is-type.cjs`),r=require(`./path/src/join-paths.cjs`),i=require(`./path/src/append.cjs`),a=require(`./path/src/correct-path.cjs`),o=require(`./path/src/file-path-fns.cjs`),s=require(`./exists.cjs`),c=require(`./get-workspace-root.cjs`),l=require(`./helpers/src/get-unique.cjs`);let u=require(`mlly`);const d=[`js`,`jsx`,`mjs`,`cjs`,`ts`,`tsx`,`mts`,`cts`,`json`,`jsonc`,`json5`,`node`];function f(e=[]){let r=e;r.includes(t.cwd())||r.push(t.cwd());let i=c.getWorkspaceRoot();return r.includes(i)||r.push(i),r=l.getUnique(r.filter(Boolean).map(e=>a.correctPath(e)).reduce((e,r,o,s)=>(e.push(r),n.isAbsolutePath(r)||(e.push(a.toAbsolutePath(r,t.cwd())),e.push(a.toAbsolutePath(r,i)),s.forEach(t=>{e.push(a.toAbsolutePath(r,t))})),e),[])),r}function p(e=[]){return l.getUnique(e.reduce((e,t)=>(o.findFolderName(t)===`node_modules`&&e.push(a.correctPath(t)),s.existsSync(r.joinPaths(t,`node_modules`))&&e.push(a.correctPath(r.joinPaths(t,`node_modules`))),e),[]))}function m(e,t={}){let s=f(t.paths);n.isNpmScopedPackage(e)?s=p(s):s.push(...p(s));let c=t.extensions??d,u=s.map(t=>r.joinPaths(t,e));return o.findFileName(e,{withExtension:!1})!==`index`&&(u=u.reduce((e,t)=>(e.push(t),e.push(r.joinPaths(t,`index`)),e),[])),o.findFileExtension(e)||(u=u.reduce((e,t)=>(e.push(t),c.forEach(n=>{e.push(i.appendExtension(t,n))}),e),[])),l.getUnique(u.filter(Boolean)).map(e=>a.correctPath(e))}async function h(e,t={}){let r=f(t.paths);n.isNpmScopedPackage(e)?r=p(r):r.push(...p(r));let i,o;try{i=await(0,u.resolvePath)(e,{url:r,extensions:t.extensions??d,conditions:t.conditions})}catch(e){o=e}if(!i)throw Error(`Unable to resolve module "${e}". The following import paths were tried: \n${r.join(`
2
+ `)}`,{cause:o});return a.correctPath(i)}function g(e,t={}){let r=f(t.paths);n.isNpmScopedPackage(e)?r=p(r):r.push(...p(r));let i,o;try{i=(0,u.resolvePathSync)(e,{url:r,extensions:t.extensions??d,conditions:t.conditions})}catch(e){o=e}if(!i)throw Error(`Unable to resolve module "${e}". The following import paths were tried: \n${r.join(`
3
+ `)}`,{cause:o});return a.correctPath(i)}async function _(e,t={}){try{return await h(e,t)}catch{return}}function v(e,t={}){try{return g(e,t)}catch{return}}async function y(e){let t=await import(e);return t&&(0,u.interopDefault)(t)}async function b(e,t={}){let n=await _(r.joinPaths(e,`package.json`),t);return n||(n=await _(r.joinPaths(e,`index.js`),t),n||=await _(e,t)),n?o.findFilePath(n):void 0}function x(e,t={}){let n=v(r.joinPaths(e,`package.json`),t);return n||(n=v(r.joinPaths(e,`index.js`),t),n||=v(e,t)),n?o.findFilePath(n):void 0}exports.DEFAULT_EXTENSIONS=d,exports.getNodeModulesPaths=p,exports.getResolutionCombinations=m,exports.getResolutionPaths=f,exports.importModule=y,exports.resolve=h,exports.resolvePackage=b,exports.resolvePackageSync=x,exports.resolveSafe=_,exports.resolveSafeSync=v,exports.resolveSync=g;