@stryke/fs 0.33.8 → 0.33.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1280 -0
- package/README.md +18 -9
- package/dist/buffer-Ch164vki.cjs +1 -0
- package/dist/buffer-DDq-CW4J.mjs +2 -0
- package/dist/buffer-DDq-CW4J.mjs.map +1 -0
- package/dist/{buffer.d.ts → buffer-DgfUmhrc.d.mts} +8 -4
- package/dist/buffer-DgfUmhrc.d.mts.map +1 -0
- package/dist/buffer-DvCjrjQH.d.cts +32 -0
- package/dist/buffer-DvCjrjQH.d.cts.map +1 -0
- package/dist/buffer.cjs +1 -34
- package/dist/buffer.d.cts +2 -0
- package/dist/buffer.d.mts +2 -0
- package/dist/buffer.mjs +1 -1
- package/dist/{chmod-x.d.ts → chmod-x-BPr4tt2-.d.cts} +10 -6
- package/dist/chmod-x-BPr4tt2-.d.cts.map +1 -0
- package/dist/chmod-x-FOy3sak8.cjs +1 -0
- package/dist/chmod-x-QCk1GmQJ.d.mts +44 -0
- package/dist/chmod-x-QCk1GmQJ.d.mts.map +1 -0
- package/dist/chmod-x-q-TWdus7.mjs +2 -0
- package/dist/chmod-x-q-TWdus7.mjs.map +1 -0
- package/dist/chmod-x.cjs +1 -57
- package/dist/chmod-x.d.cts +2 -0
- package/dist/chmod-x.d.mts +2 -0
- package/dist/chmod-x.mjs +1 -1
- package/dist/chunk-Bmb41Sf3.cjs +1 -0
- package/dist/{command-exists.d.ts → command-exists-CuieR7rx.d.cts} +6 -2
- package/dist/command-exists-CuieR7rx.d.cts.map +1 -0
- package/dist/command-exists-D1bV-wSk.cjs +1 -0
- package/dist/command-exists-Dzb2kKT4.mjs +2 -0
- package/dist/command-exists-Dzb2kKT4.mjs.map +1 -0
- package/dist/command-exists-dBdtR0xj.d.mts +22 -0
- package/dist/command-exists-dBdtR0xj.d.mts.map +1 -0
- package/dist/command-exists.cjs +1 -71
- package/dist/command-exists.d.cts +2 -0
- package/dist/command-exists.d.mts +2 -0
- package/dist/command-exists.mjs +1 -1
- package/dist/compress-BiTxso15.mjs +2 -0
- package/dist/compress-BiTxso15.mjs.map +1 -0
- package/dist/compress-BjGbQqs_.cjs +1 -0
- package/dist/compress-CLAaOwH3.d.mts +16 -0
- package/dist/compress-CLAaOwH3.d.mts.map +1 -0
- package/dist/compress-CQve2a6h.d.cts +16 -0
- package/dist/compress-CQve2a6h.d.cts.map +1 -0
- package/dist/compress.cjs +1 -26
- package/dist/compress.d.cts +2 -0
- package/dist/compress.d.mts +2 -0
- package/dist/compress.mjs +1 -1
- package/dist/constants-D58o2CiO.d.cts +5 -0
- package/dist/constants-D58o2CiO.d.cts.map +1 -0
- package/dist/constants-DZz9LJgo.d.mts +5 -0
- package/dist/constants-DZz9LJgo.d.mts.map +1 -0
- package/dist/constants.cjs +0 -1
- package/dist/constants.d.cts +2 -0
- package/dist/constants.d.mts +2 -0
- package/dist/constants.mjs +1 -0
- package/dist/{copy-file.d.ts → copy-file-B5FJHiIK.d.mts} +11 -5
- package/dist/copy-file-B5FJHiIK.d.mts.map +1 -0
- package/dist/copy-file-Bot2YNtT.mjs +2 -0
- package/dist/copy-file-Bot2YNtT.mjs.map +1 -0
- package/dist/copy-file-DjH2Ho5e.d.cts +39 -0
- package/dist/copy-file-DjH2Ho5e.d.cts.map +1 -0
- package/dist/copy-file-Y1ilzocZ.cjs +1 -0
- package/dist/copy-file.cjs +1 -48
- package/dist/copy-file.d.cts +2 -0
- package/dist/copy-file.d.mts +2 -0
- package/dist/copy-file.mjs +1 -1
- package/dist/cwd-YTg9Cx6C.mjs +2 -0
- package/dist/cwd-YTg9Cx6C.mjs.map +1 -0
- package/dist/cwd-o2vq8Tk9.cjs +1 -0
- package/dist/{exists.d.ts → exists-175EN367.d.mts} +6 -2
- package/dist/exists-175EN367.d.mts.map +1 -0
- package/dist/exists-B31lSRFp.cjs +1 -0
- package/dist/exists-CVlDImzc.d.cts +18 -0
- package/dist/exists-CVlDImzc.d.cts.map +1 -0
- package/dist/exists-Ci-9lYmi.mjs +2 -0
- package/dist/exists-Ci-9lYmi.mjs.map +1 -0
- package/dist/exists.cjs +1 -15
- package/dist/exists.d.cts +2 -0
- package/dist/exists.d.mts +2 -0
- package/dist/exists.mjs +1 -1
- package/dist/file-D1uBqkpP.d.cts +32 -0
- package/dist/file-D1uBqkpP.d.cts.map +1 -0
- package/dist/file-DauFFmfh.d.mts +32 -0
- package/dist/file-DauFFmfh.d.mts.map +1 -0
- package/dist/file-path-fns-7aKacdLg.cjs +1 -0
- package/dist/file-path-fns-BDzC2SIV.mjs +2 -0
- package/dist/file-path-fns-BDzC2SIV.mjs.map +1 -0
- package/dist/get-parent-path-COkh6Pvl.d.mts +32 -0
- package/dist/get-parent-path-COkh6Pvl.d.mts.map +1 -0
- package/dist/get-parent-path-Cbqs2km7.d.cts +32 -0
- package/dist/get-parent-path-Cbqs2km7.d.cts.map +1 -0
- package/dist/get-parent-path-CfRkaB4R.cjs +1 -0
- package/dist/get-parent-path-DLFSyxSW.mjs +2 -0
- package/dist/get-parent-path-DLFSyxSW.mjs.map +1 -0
- package/dist/get-parent-path.cjs +1 -28
- package/dist/get-parent-path.d.cts +2 -0
- package/dist/get-parent-path.d.mts +2 -0
- package/dist/get-parent-path.mjs +1 -1
- package/dist/get-workspace-root-CCNjjZGY.cjs +1 -0
- package/dist/{get-workspace-root.d.ts → get-workspace-root-DQBvBd8X.d.mts} +12 -8
- package/dist/get-workspace-root-DQBvBd8X.d.mts.map +1 -0
- package/dist/get-workspace-root-eTfm1jII.d.cts +48 -0
- package/dist/get-workspace-root-eTfm1jII.d.cts.map +1 -0
- package/dist/get-workspace-root-k66w-wLW.mjs +2 -0
- package/dist/get-workspace-root-k66w-wLW.mjs.map +1 -0
- package/dist/get-workspace-root.cjs +1 -49
- package/dist/get-workspace-root.d.cts +2 -0
- package/dist/get-workspace-root.d.mts +2 -0
- package/dist/get-workspace-root.mjs +1 -1
- package/dist/helpers-BSEQb1fp.mjs +2 -0
- package/dist/helpers-BSEQb1fp.mjs.map +1 -0
- package/dist/{helpers.d.ts → helpers-CYWFZ-Uv.d.mts} +10 -6
- package/dist/helpers-CYWFZ-Uv.d.mts.map +1 -0
- package/dist/helpers-CgMOExPa.d.cts +50 -0
- package/dist/helpers-CgMOExPa.d.cts.map +1 -0
- package/dist/helpers-_MJ6PR-g.cjs +1 -0
- package/dist/helpers.cjs +1 -49
- package/dist/helpers.d.cts +2 -0
- package/dist/helpers.d.mts +2 -0
- package/dist/helpers.mjs +1 -1
- package/dist/index.cjs +1 -269
- package/dist/index.d.cts +25 -0
- package/dist/index.d.mts +25 -0
- package/dist/index.mjs +1 -1
- package/dist/install-B3bIjHoU.mjs +2 -0
- package/dist/install-B3bIjHoU.mjs.map +1 -0
- package/dist/install-CZ_S7NHm.cjs +1 -0
- package/dist/install-CxPsLO2t.d.cts +28 -0
- package/dist/install-CxPsLO2t.d.cts.map +1 -0
- package/dist/install-dYt7hlQn.d.mts +29 -0
- package/dist/install-dYt7hlQn.d.mts.map +1 -0
- package/dist/install.cjs +1 -25
- package/dist/install.d.cts +2 -0
- package/dist/install.d.mts +2 -0
- package/dist/install.mjs +1 -1
- package/dist/is-error-CjEyTRps.cjs +1 -0
- package/dist/is-error-CjVXmD_8.mjs +2 -0
- package/dist/is-error-CjVXmD_8.mjs.map +1 -0
- package/dist/is-file-BkFQev3M.cjs +1 -0
- package/dist/is-file-CNooe8Wz.mjs +2 -0
- package/dist/is-file-CNooe8Wz.mjs.map +1 -0
- package/dist/{is-file.d.ts → is-file-DjqOQrqY.d.mts} +8 -4
- package/dist/is-file-DjqOQrqY.d.mts.map +1 -0
- package/dist/is-file-DoBi2FN9.d.cts +36 -0
- package/dist/is-file-DoBi2FN9.d.cts.map +1 -0
- package/dist/is-file.cjs +1 -29
- package/dist/is-file.d.cts +2 -0
- package/dist/is-file.d.mts +2 -0
- package/dist/is-file.mjs +1 -1
- package/dist/is-object-FBXmvehR.cjs +1 -0
- package/dist/is-object-UsKYhyC5.mjs +2 -0
- package/dist/is-object-UsKYhyC5.mjs.map +1 -0
- package/dist/is-set-string-CLeu8BKX.cjs +1 -0
- package/dist/is-set-string-Cj0g4gsG.mjs +2 -0
- package/dist/is-set-string-Cj0g4gsG.mjs.map +1 -0
- package/dist/is-string-91Z3dOKQ.mjs +2 -0
- package/dist/is-string-91Z3dOKQ.mjs.map +1 -0
- package/dist/is-string-DKgNS0jA.cjs +1 -0
- package/dist/join-paths-BHepkhAj.mjs +2 -0
- package/dist/join-paths-BHepkhAj.mjs.map +1 -0
- package/dist/join-paths-DUdaieID.cjs +1 -0
- package/dist/json-CYenVxvr.d.cts +83 -0
- package/dist/json-CYenVxvr.d.cts.map +1 -0
- package/dist/json-DH7Q6Ftp.d.mts +83 -0
- package/dist/json-DH7Q6Ftp.d.mts.map +1 -0
- package/dist/json-DKhqPjHB.cjs +6 -0
- package/dist/json-Dp4PSH2i.mjs +7 -0
- package/dist/json-Dp4PSH2i.mjs.map +1 -0
- package/dist/json.cjs +1 -41
- package/dist/json.d.cts +2 -0
- package/dist/json.d.mts +2 -0
- package/dist/json.mjs +1 -3
- package/dist/list-files-Cn_UVruo.cjs +1 -0
- package/dist/list-files-D3dQOljX.d.cts +51 -0
- package/dist/list-files-D3dQOljX.d.cts.map +1 -0
- package/dist/list-files-D3iJzEQw.d.mts +51 -0
- package/dist/list-files-D3iJzEQw.d.mts.map +1 -0
- package/dist/list-files-D__uh3tQ.mjs +2 -0
- package/dist/list-files-D__uh3tQ.mjs.map +1 -0
- package/dist/list-files.cjs +1 -55
- package/dist/list-files.d.cts +2 -0
- package/dist/list-files.d.mts +2 -0
- package/dist/list-files.mjs +1 -1
- package/dist/package-fns-BNRi_Rpc.d.cts +354 -0
- package/dist/package-fns-BNRi_Rpc.d.cts.map +1 -0
- package/dist/package-fns-C7-MKgBR.mjs +2 -0
- package/dist/package-fns-C7-MKgBR.mjs.map +1 -0
- package/dist/package-fns-CxokaGDY.d.mts +354 -0
- package/dist/package-fns-CxokaGDY.d.mts.map +1 -0
- package/dist/package-fns-YTCdMAXr.cjs +1 -0
- package/dist/package-fns.cjs +1 -99
- package/dist/package-fns.d.cts +2 -0
- package/dist/package-fns.d.mts +2 -0
- package/dist/package-fns.mjs +1 -1
- package/dist/read-file-B091zB64.mjs +2 -0
- package/dist/read-file-B091zB64.mjs.map +1 -0
- package/dist/read-file-BB2WzW-N.cjs +1 -0
- package/dist/{read-file.d.ts → read-file-Bxn1VHKv.d.cts} +8 -4
- package/dist/read-file-Bxn1VHKv.d.cts.map +1 -0
- package/dist/read-file-CRVW-wcE.d.mts +30 -0
- package/dist/read-file-CRVW-wcE.d.mts.map +1 -0
- package/dist/read-file.cjs +1 -31
- package/dist/read-file.d.cts +2 -0
- package/dist/read-file.d.mts +2 -0
- package/dist/read-file.mjs +1 -1
- package/dist/registry-B1taIPKm.mjs +2 -0
- package/dist/registry-B1taIPKm.mjs.map +1 -0
- package/dist/{registry.d.ts → registry-BQ3JXRFA.d.mts} +17 -13
- package/dist/registry-BQ3JXRFA.d.mts.map +1 -0
- package/dist/registry-BYwvM92u.cjs +1 -0
- package/dist/registry-C2A0Kau7.d.cts +53 -0
- package/dist/registry-C2A0Kau7.d.cts.map +1 -0
- package/dist/registry.cjs +1 -95
- package/dist/registry.d.cts +2 -0
- package/dist/registry.d.mts +2 -0
- package/dist/registry.mjs +1 -1
- package/dist/remove-file-BM64Brdf.mjs +2 -0
- package/dist/remove-file-BM64Brdf.mjs.map +1 -0
- package/dist/remove-file-BqlkL_Df.d.mts +16 -0
- package/dist/remove-file-BqlkL_Df.d.mts.map +1 -0
- package/dist/remove-file-XHFKELQN.cjs +1 -0
- package/dist/remove-file-lQOlxDwr.d.cts +16 -0
- package/dist/remove-file-lQOlxDwr.d.cts.map +1 -0
- package/dist/remove-file.cjs +1 -16
- package/dist/remove-file.d.cts +2 -0
- package/dist/remove-file.d.mts +2 -0
- package/dist/remove-file.mjs +1 -1
- package/dist/resolve-C_YsCFne.mjs +4 -0
- package/dist/resolve-C_YsCFne.mjs.map +1 -0
- package/dist/{resolve.d.ts → resolve-D66oIwjf.d.mts} +33 -29
- package/dist/resolve-D66oIwjf.d.mts.map +1 -0
- package/dist/resolve-DTkLQekH.cjs +3 -0
- package/dist/resolve-DubH-8qd.d.cts +106 -0
- package/dist/resolve-DubH-8qd.d.cts.map +1 -0
- package/dist/resolve-parent-path-CR8av8WP.mjs +2 -0
- package/dist/resolve-parent-path-CR8av8WP.mjs.map +1 -0
- package/dist/resolve-parent-path-D0AaW2PB.cjs +1 -0
- package/dist/resolve.cjs +1 -115
- package/dist/resolve.d.cts +2 -0
- package/dist/resolve.d.mts +2 -0
- package/dist/resolve.mjs +1 -5
- package/dist/{semver-fns.d.ts → semver-fns-B0e5zB6C.d.mts} +17 -11
- package/dist/semver-fns-B0e5zB6C.d.mts.map +1 -0
- package/dist/semver-fns-Btrm1dIF.cjs +1 -0
- package/dist/semver-fns-DjhZXnUw.d.cts +92 -0
- package/dist/semver-fns-DjhZXnUw.d.cts.map +1 -0
- package/dist/semver-fns-F_rYnwDq.mjs +2 -0
- package/dist/semver-fns-F_rYnwDq.mjs.map +1 -0
- package/dist/semver-fns.cjs +1 -40
- package/dist/semver-fns.d.cts +2 -0
- package/dist/semver-fns.d.mts +2 -0
- package/dist/semver-fns.mjs +1 -1
- package/dist/toml-CIgLQmP3.mjs +4 -0
- package/dist/toml-CIgLQmP3.mjs.map +1 -0
- package/dist/toml-D3X2QoaL.d.cts +81 -0
- package/dist/toml-D3X2QoaL.d.cts.map +1 -0
- package/dist/toml-DgVyNp_y.cjs +3 -0
- package/dist/toml-Djau1M6n.d.mts +81 -0
- package/dist/toml-Djau1M6n.d.mts.map +1 -0
- package/dist/toml.cjs +1 -40
- package/dist/toml.d.cts +2 -0
- package/dist/toml.d.mts +2 -0
- package/dist/toml.mjs +1 -3
- package/dist/tsconfig-B13IMV_0.d.mts +812 -0
- package/dist/tsconfig-B13IMV_0.d.mts.map +1 -0
- package/dist/tsconfig-B6WtgD1c.cjs +1 -0
- package/dist/tsconfig-C8ecu1-0.d.cts +812 -0
- package/dist/tsconfig-C8ecu1-0.d.cts.map +1 -0
- package/dist/tsconfig-CqvvSVuX.mjs +2 -0
- package/dist/tsconfig-CqvvSVuX.mjs.map +1 -0
- package/dist/tsconfig.cjs +1 -28
- package/dist/tsconfig.d.cts +2 -0
- package/dist/tsconfig.d.mts +2 -0
- package/dist/tsconfig.mjs +1 -1
- package/dist/write-file-BmvbsmMj.d.cts +35 -0
- package/dist/write-file-BmvbsmMj.d.cts.map +1 -0
- package/dist/write-file-CFByoJkN.mjs +2 -0
- package/dist/write-file-CFByoJkN.mjs.map +1 -0
- package/dist/write-file-CWTzQpb2.d.mts +35 -0
- package/dist/write-file-CWTzQpb2.d.mts.map +1 -0
- package/dist/write-file-CqokudVp.cjs +1 -0
- package/dist/write-file.cjs +1 -26
- package/dist/write-file.d.cts +2 -0
- package/dist/write-file.d.mts +2 -0
- package/dist/write-file.mjs +1 -1
- package/dist/yaml-6uuLoSfT.d.cts +23 -0
- package/dist/yaml-6uuLoSfT.d.cts.map +1 -0
- package/dist/yaml-CLMo56UG.mjs +2 -0
- package/dist/yaml-CLMo56UG.mjs.map +1 -0
- package/dist/yaml-Ddslc5NK.d.mts +23 -0
- package/dist/yaml-Ddslc5NK.d.mts.map +1 -0
- package/dist/yaml-q2k-BjIM.cjs +1 -0
- package/dist/yaml.cjs +1 -15
- package/dist/yaml.d.cts +2 -0
- package/dist/yaml.d.mts +2 -0
- package/dist/yaml.mjs +1 -1
- package/package.json +98 -379
- package/dist/compress.d.ts +0 -11
- package/dist/constants.d.ts +0 -1
- package/dist/get-parent-path.d.ts +0 -28
- package/dist/index.d.ts +0 -32
- package/dist/install.d.ts +0 -24
- package/dist/json.d.ts +0 -49
- package/dist/list-files.d.ts +0 -46
- package/dist/package-fns.d.ts +0 -89
- package/dist/remove-file.d.ts +0 -12
- package/dist/toml.d.ts +0 -77
- package/dist/tsconfig.d.ts +0 -8
- package/dist/write-file.d.ts +0 -30
- package/dist/yaml.d.ts +0 -18
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compress-BiTxso15.mjs","names":[],"sources":["../../convert/src/array-buffer-to-string.ts","../../convert/src/uint8-array-to-string.ts","../src/compress.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Convert an ArrayBuffer or Uint8Array to a string\n *\n * @param buffer - The ArrayBuffer or Uint8Array to convert\n * @returns The converted string\n */\nexport function arrayBufferToString(\n buffer: ArrayBuffer | ArrayBufferLike | Uint8Array\n): string {\n const bytes =\n buffer instanceof Uint8Array\n ? buffer\n : new Uint8Array(buffer as ArrayBufferLike);\n const len = bytes.byteLength;\n if (len < 65535) {\n return String.fromCharCode.apply(null, bytes as unknown as number[]);\n }\n let binary = \"\";\n for (let i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]!);\n }\n return binary;\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { arrayBufferToString } from \"./array-buffer-to-string\";\n\n/**\n * Convert a Uint8Array to a base64 string\n *\n * @param buffer - The Uint8Array to convert\n * @returns The converted base64 string\n */\nexport function uint8ArrayToString(buffer: Uint8Array): string {\n return btoa(arrayBufferToString(buffer));\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { uint8ArrayToString } from \"@stryke/convert/uint8-array-to-string\";\nimport { findFolderName, resolveParentPath } from \"@stryke/path\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { GlobOptions } from \"glob\";\nimport { createTarGzip } from \"nanotar\";\nimport { isDirectory } from \"./is-file\";\nimport { listFiles } from \"./list-files\";\nimport { readFileIfExisting } from \"./read-file\";\nimport { writeFile } from \"./write-file\";\n\nexport interface CompressDirectoryOptions extends GlobOptions {\n destination?: string;\n}\n\n/**\n * Compress a directory or file into a tar.gz archive.\n *\n * @param directory - The source directory or file/glob to compress.\n * @param options - Options for the compression.\n */\nexport async function compressDirectory(\n directory: string,\n options?: CompressDirectoryOptions\n): Promise<void> {\n const files = await listFiles(\n isDirectory(directory) ? joinPaths(directory, \"**/*\") : directory,\n options\n );\n const data = await createTarGzip(\n await Promise.all(\n files.map(async file => ({\n name: file,\n data: await readFileIfExisting(file)\n }))\n ),\n {\n attrs: { group: \"storm-software\" }\n }\n );\n\n return writeFile(\n options?.destination\n ? isDirectory(options.destination)\n ? joinPaths(options.destination, `${new Date().getTime()}.tar.gz`)\n : options.destination\n : isDirectory(directory)\n ? `${joinPaths(resolveParentPath(directory), findFolderName(directory))}.tar.gz`\n : directory,\n uint8ArrayToString(data)\n );\n}\n"],"mappings":"6WAwBA,SAAgB,EACd,EACQ,CACR,IAAM,EACJ,aAAkB,WACd,EACA,IAAI,WAAW,EAA0B,CACzC,EAAM,EAAM,WAClB,GAAI,EAAM,MACR,OAAO,OAAO,aAAa,MAAM,KAAM,EAA6B,CAEtE,IAAI,EAAS,GACb,IAAK,IAAI,EAAI,EAAG,EAAI,EAAK,IACvB,GAAU,OAAO,aAAa,EAAM,GAAI,CAE1C,OAAO,ECbT,SAAgB,EAAmB,EAA4B,CAC7D,OAAO,KAAK,EAAoB,EAAO,CAAC,CCW1C,eAAsB,EACpB,EACA,EACe,CACf,IAAM,EAAQ,MAAM,EAClB,EAAY,EAAU,CAAG,EAAU,EAAW,OAAO,CAAG,EACxD,EACD,CACK,EAAO,MAAM,EACjB,MAAM,QAAQ,IACZ,EAAM,IAAI,KAAM,KAAS,CACvB,KAAM,EACN,KAAM,MAAM,EAAmB,EAAK,CACrC,EAAE,CACJ,CACD,CACE,MAAO,CAAE,MAAO,iBAAkB,CACnC,CACF,CAED,OAAO,EACL,GAAS,YACL,EAAY,EAAQ,YAAY,CAC9B,EAAU,EAAQ,YAAa,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,SAAS,CAChE,EAAQ,YACV,EAAY,EAAU,CACpB,GAAG,EAAU,EAAkB,EAAU,CAAE,EAAe,EAAU,CAAC,CAAC,SACtE,EACN,EAAmB,EAAK,CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./join-paths-DUdaieID.cjs`),n=require(`./file-path-fns-7aKacdLg.cjs`),r=require(`./resolve-parent-path-D0AaW2PB.cjs`),i=require(`./is-file-BkFQev3M.cjs`),a=require(`./list-files-Cn_UVruo.cjs`),o=require(`./read-file-BB2WzW-N.cjs`),s=require(`./write-file-CqokudVp.cjs`);let c=require(`nanotar`);function l(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n=t.byteLength;if(n<65535)return String.fromCharCode.apply(null,t);let r=``;for(let e=0;e<n;e++)r+=String.fromCharCode(t[e]);return r}function u(e){return btoa(l(e))}async function d(e,l){let d=await a.i(i.t(e)?t.t(e,`**/*`):e,l),f=await(0,c.createTarGzip)(await Promise.all(d.map(async e=>({name:e,data:await o.n(e)}))),{attrs:{group:`storm-software`}});return s.t(l?.destination?i.t(l.destination)?t.t(l.destination,`${new Date().getTime()}.tar.gz`):l.destination:i.t(e)?`${t.t(r.t(e),n.i(e))}.tar.gz`:e,u(f))}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return d}});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GlobOptions } from "glob";
|
|
2
|
+
|
|
3
|
+
//#region src/compress.d.ts
|
|
4
|
+
interface CompressDirectoryOptions extends GlobOptions {
|
|
5
|
+
destination?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Compress a directory or file into a tar.gz archive.
|
|
9
|
+
*
|
|
10
|
+
* @param directory - The source directory or file/glob to compress.
|
|
11
|
+
* @param options - Options for the compression.
|
|
12
|
+
*/
|
|
13
|
+
declare function compressDirectory(directory: string, options?: CompressDirectoryOptions): Promise<void>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { compressDirectory as n, CompressDirectoryOptions as t };
|
|
16
|
+
//# sourceMappingURL=compress-CLAaOwH3.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compress-CLAaOwH3.d.mts","names":[],"sources":["../src/compress.ts"],"sourcesContent":[],"mappings":";;;UA4BiB,wBAAA,SAAiC;;AAAlD;AAUA;;;;;;iBAAsB,iBAAA,8BAEV,2BACT"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GlobOptions } from "glob";
|
|
2
|
+
|
|
3
|
+
//#region src/compress.d.ts
|
|
4
|
+
interface CompressDirectoryOptions extends GlobOptions {
|
|
5
|
+
destination?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Compress a directory or file into a tar.gz archive.
|
|
9
|
+
*
|
|
10
|
+
* @param directory - The source directory or file/glob to compress.
|
|
11
|
+
* @param options - Options for the compression.
|
|
12
|
+
*/
|
|
13
|
+
declare function compressDirectory(directory: string, options?: CompressDirectoryOptions): Promise<void>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { compressDirectory as n, CompressDirectoryOptions as t };
|
|
16
|
+
//# sourceMappingURL=compress-CQve2a6h.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compress-CQve2a6h.d.cts","names":[],"sources":["../src/compress.ts"],"sourcesContent":[],"mappings":";;;UA4BiB,wBAAA,SAAiC;;AAAlD;AAUA;;;;;;iBAAsB,iBAAA,8BAEV,2BACT"}
|
package/dist/compress.cjs
CHANGED
|
@@ -1,26 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.compressDirectory = compressDirectory;
|
|
7
|
-
var _uint8ArrayToString = require("@stryke/convert/uint8-array-to-string");
|
|
8
|
-
var _path = require("@stryke/path");
|
|
9
|
-
var _joinPaths = require("@stryke/path/join-paths");
|
|
10
|
-
var _nanotar = require("nanotar");
|
|
11
|
-
var _isFile = require("./is-file.cjs");
|
|
12
|
-
var _listFiles = require("./list-files.cjs");
|
|
13
|
-
var _readFile = require("./read-file.cjs");
|
|
14
|
-
var _writeFile = require("./write-file.cjs");
|
|
15
|
-
async function compressDirectory(t, i) {
|
|
16
|
-
const e = await (0, _listFiles.listFiles)((0, _isFile.isDirectory)(t) ? (0, _joinPaths.joinPaths)(t, "**/*") : t, i),
|
|
17
|
-
s = await (0, _nanotar.createTarGzip)(await Promise.all(e.map(async a => ({
|
|
18
|
-
name: a,
|
|
19
|
-
data: await (0, _readFile.readFileIfExisting)(a)
|
|
20
|
-
}))), {
|
|
21
|
-
attrs: {
|
|
22
|
-
group: "storm-software"
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
return (0, _writeFile.writeFile)(i?.destination ? (0, _isFile.isDirectory)(i.destination) ? (0, _joinPaths.joinPaths)(i.destination, `${new Date().getTime()}.tar.gz`) : i.destination : (0, _isFile.isDirectory)(t) ? `${(0, _joinPaths.joinPaths)((0, _path.resolveParentPath)(t), (0, _path.findFolderName)(t))}.tar.gz` : t, (0, _uint8ArrayToString.uint8ArrayToString)(s));
|
|
26
|
-
}
|
|
1
|
+
require(`./helpers-_MJ6PR-g.cjs`);const e=require(`./compress-BjGbQqs_.cjs`);require(`./list-files-Cn_UVruo.cjs`),require(`./write-file-CqokudVp.cjs`),exports.compressDirectory=e.t;
|
package/dist/compress.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"./helpers-BSEQb1fp.mjs";import{t as e}from"./compress-BiTxso15.mjs";import"./list-files-D__uh3tQ.mjs";import"./write-file-CFByoJkN.mjs";export{e as compressDirectory};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-D58o2CiO.d.cts","names":[],"sources":["../src/constants.ts"],"sourcesContent":[],"mappings":";KAkBY,QAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-DZz9LJgo.d.mts","names":[],"sources":["../src/constants.ts"],"sourcesContent":[],"mappings":";KAkBY,QAAA"}
|
package/dist/constants.cjs
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/dist/constants.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { t as AssetGlob } from "./file-DauFFmfh.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/copy-file.d.ts
|
|
4
|
+
|
|
2
5
|
/**
|
|
3
6
|
* Copy a file from one location to another
|
|
4
7
|
*
|
|
@@ -6,7 +9,7 @@ import type { AssetGlob } from "@stryke/types/file";
|
|
|
6
9
|
* @param destination - The destination location
|
|
7
10
|
* @returns An indicator specifying if the copy was successful
|
|
8
11
|
*/
|
|
9
|
-
|
|
12
|
+
declare function copyFile(source: string | URL, destination: string | URL): Promise<void>;
|
|
10
13
|
/**
|
|
11
14
|
* Synchronously copy a file from one location to another
|
|
12
15
|
*
|
|
@@ -14,7 +17,7 @@ export declare function copyFile(source: string | URL, destination: string | URL
|
|
|
14
17
|
* @param destination - The destination location
|
|
15
18
|
* @returns An indicator specifying if the copy was successful
|
|
16
19
|
*/
|
|
17
|
-
|
|
20
|
+
declare function copyFileSync(source: string | URL, destination: string | URL): void;
|
|
18
21
|
/**
|
|
19
22
|
* Copy files from one location to another
|
|
20
23
|
*
|
|
@@ -22,7 +25,7 @@ export declare function copyFileSync(source: string | URL, destination: string |
|
|
|
22
25
|
* @param destination - The destination location
|
|
23
26
|
* @returns An indicator specifying if the copy was successful
|
|
24
27
|
*/
|
|
25
|
-
|
|
28
|
+
declare function copyFiles(source: string | URL | Omit<AssetGlob, "output">, destination: string | URL): Promise<void | void[]>;
|
|
26
29
|
/**
|
|
27
30
|
* Synchronously copy files from one location to another
|
|
28
31
|
*
|
|
@@ -30,4 +33,7 @@ export declare function copyFiles(source: string | URL | Omit<AssetGlob, "output
|
|
|
30
33
|
* @param destination - The destination location
|
|
31
34
|
* @returns An indicator specifying if the copy was successful
|
|
32
35
|
*/
|
|
33
|
-
|
|
36
|
+
declare function copyFilesSync(source: string | URL | Omit<AssetGlob, "output">, destination: string | URL): void | void[];
|
|
37
|
+
//#endregion
|
|
38
|
+
export { copyFilesSync as i, copyFileSync as n, copyFiles as r, copyFile as t };
|
|
39
|
+
//# sourceMappingURL=copy-file-B5FJHiIK.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-file-B5FJHiIK.d.mts","names":[],"sources":["../src/copy-file.ts"],"sourcesContent":[],"mappings":";;;;;;AAwCA;;;;;AA4BgB,iBA5BM,QAAA,CA4BwB,MAA2B,EAAG,MAAA,GA3BzD,GA2ByD,EAAA,WAAA,EAAA,MAAA,GA1BpD,GA0BoD,CAAA,EA1BjD,OA0BiD,CAAA,IAAA,CAAA;AAyB5E;;;;;;;AAmCgB,iBA5DA,YAAA,CA4Da,MAAA,EAAA,MAAA,GA5DiB,GA4DjB,EAAA,WAAA,EAAA,MAAA,GA5D4C,GA4D5C,CAAA,EAAA,IAAA;;;;;;;;iBAnCP,SAAA,kBACH,MAAM,KAAK,4CACN,MAAG;;;;;;;;iBAiCX,aAAA,kBACG,MAAM,KAAK,4CACN"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as e}from"./cwd-YTg9Cx6C.mjs";import{n as t,t as n}from"./join-paths-BHepkhAj.mjs";import{a as r,f as i,l as a,r as o}from"./file-path-fns-BDzC2SIV.mjs";import{t as s}from"./is-string-91Z3dOKQ.mjs";import{t as c}from"./resolve-parent-path-CR8av8WP.mjs";import{n as l}from"./exists-Ci-9lYmi.mjs";import{n as u,t as d}from"./helpers-BSEQb1fp.mjs";import{r as f,t as p}from"./is-file-CNooe8Wz.mjs";import{a as m,i as h}from"./list-files-D__uh3tQ.mjs";import{copyFileSync as g}from"node:fs";import{copyFile as _}from"node:fs/promises";import{fileURLToPath as v}from"mlly";function y(n,r=e()){return i(n,r)?t(n).replace(t(r),``).replace(/^\//,``):n}async function b(e,t){let n=e instanceof URL?v(e):e,i=t instanceof URL?v(t):t;if(r(i)?l(o(i))||await d(o(i)):l(c(i))||await d(c(i)),s(n)&&l(n))return _(n,i)}function x(e,t){let n=e instanceof URL?v(e):e,i=t instanceof URL?v(t):t;if(r(i)?l(o(i))||u(o(i)):l(c(i))||u(c(i)),s(n)&&l(n))return g(n,i)}async function S(e,t){let r=e instanceof URL?v(e):e,i=t instanceof URL?v(t):t;return s(r)&&f(r)?b(r,i):Promise.all((await h(r)).map(async e=>{let t=n(i,y(e,s(r)?a(r):r.input));p(e)?await S(e,t):await b(e,t)}))}function C(e,t){let r=e instanceof URL?v(e):e,i=t instanceof URL?v(t):t;return s(r)&&f(r)?x(r,i):m(r).map(e=>{let t=n(i,y(e,s(r)?a(r):r.input));p(e)?C(e,t):x(e,t)})}export{C as i,x as n,S as r,b as t};
|
|
2
|
+
//# sourceMappingURL=copy-file-Bot2YNtT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-file-Bot2YNtT.mjs","names":["copyFile","existsSync","cpf","copyFileSync","cpfSync"],"sources":["../../path/src/replace.ts","../src/copy-file.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { cwd } from \"./cwd\";\nimport {\n findFileDotExtensionSafe,\n findFileExtensionSafe\n} from \"./file-path-fns\";\nimport { isParentPath } from \"./is-parent-path\";\nimport { slash } from \"./slash\";\n\n/**\n * Replace the base path from the beginning of the given path.\n *\n * @example\n * ```ts\n * replacePath(\"/home/user/project/src/index.ts\", \"/home/user/project\");\n * // returns \"src/index.ts\"\n * ```\n *\n * @param childPath - The child path to replace the {@link parentPath} substring from\n * @param parentPath - The parent path to remove from the {@link childPath} parameter\n * @returns The {@link childPath} with the {@link parentPath} path removed\n */\nexport function replacePath(\n childPath: string,\n parentPath: string = cwd()\n): string {\n return isParentPath(childPath, parentPath)\n ? slash(childPath).replace(slash(parentPath), \"\").replace(/^\\//, \"\")\n : childPath;\n}\n\n/**\n * Replace the extension of a given path with the provided value.\n *\n * @example\n * ```ts\n * replaceExtension(\"/home/user/project/src/index.ts\", \".js\");\n * // returns \"/home/user/project/src/index.js\"\n * replaceExtension(\"/home/user/project/src/index.ts\");\n * // returns \"/home/user/project/src/index\"\n * ```\n *\n * @param path - The path that will have its current extension replaced\n * @param replacement - The value (or an empty string) to replace the current extension with\n * @returns The path with the replaced extension\n */\nexport function replaceExtension(path: string, replacement = \"\"): string {\n return path.replace(\n !replacement || replacement.includes(\".\")\n ? findFileDotExtensionSafe(path)\n : findFileExtensionSafe(path),\n replacement\n );\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { stripStars } from \"@stryke/path/correct-path\";\nimport { findFilePath, hasFileExtension } from \"@stryke/path/file-path-fns\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { resolveParentPath } from \"@stryke/path/resolve-parent-path\";\nimport { isString } from \"@stryke/type-checks\";\nimport type { AssetGlob } from \"@stryke/types/file\";\nimport { fileURLToPath } from \"mlly\";\nimport { copyFileSync as cpfSync } from \"node:fs\";\nimport { copyFile as cpf } from \"node:fs/promises\";\nimport { existsSync } from \"./exists\";\nimport { createDirectory, createDirectorySync } from \"./helpers\";\nimport { isDirectory, isFile } from \"./is-file\";\nimport { listFiles, listFilesSync } from \"./list-files\";\n\n/**\n * Copy a file from one location to another\n *\n * @param source - The file to copy, this can be a file, directory, URL, or glob pattern\n * @param destination - The destination location\n * @returns An indicator specifying if the copy was successful\n */\nexport async function copyFile(\n source: string | URL,\n destination: string | URL\n) {\n const src = source instanceof URL ? fileURLToPath(source) : source;\n const dest =\n destination instanceof URL ? fileURLToPath(destination) : destination;\n\n if (!hasFileExtension(dest)) {\n if (!existsSync(resolveParentPath(dest))) {\n await createDirectory(resolveParentPath(dest));\n }\n } else if (!existsSync(findFilePath(dest))) {\n await createDirectory(findFilePath(dest));\n }\n\n if (isString(src) && existsSync(src)) {\n return cpf(src, dest);\n }\n}\n\n/**\n * Synchronously copy a file from one location to another\n *\n * @param source - The file to copy, this can be a file, directory, URL, or glob pattern\n * @param destination - The destination location\n * @returns An indicator specifying if the copy was successful\n */\nexport function copyFileSync(source: string | URL, destination: string | URL) {\n const src = source instanceof URL ? fileURLToPath(source) : source;\n const dest =\n destination instanceof URL ? fileURLToPath(destination) : destination;\n\n if (!hasFileExtension(dest)) {\n if (!existsSync(resolveParentPath(dest))) {\n createDirectorySync(resolveParentPath(dest));\n }\n } else if (!existsSync(findFilePath(dest))) {\n createDirectorySync(findFilePath(dest));\n }\n\n if (isString(src) && existsSync(src)) {\n return cpfSync(src, dest);\n }\n}\n\n/**\n * Copy files from one location to another\n *\n * @param source - The source location, this can be a file, directory, URL, or glob pattern\n * @param destination - The destination location\n * @returns An indicator specifying if the copy was successful\n */\nexport async function copyFiles(\n source: string | URL | Omit<AssetGlob, \"output\">,\n destination: string | URL\n) {\n const src = source instanceof URL ? fileURLToPath(source) : source;\n const dest =\n destination instanceof URL ? fileURLToPath(destination) : destination;\n\n if (isString(src) && isFile(src)) {\n return copyFile(src, dest);\n }\n\n return Promise.all(\n (await listFiles(src)).map(async entryPath => {\n const destFile = joinPaths(\n dest,\n replacePath(entryPath, isString(src) ? stripStars(src) : src.input)\n );\n\n if (isDirectory(entryPath)) {\n await copyFiles(entryPath, destFile);\n } else {\n await copyFile(entryPath, destFile);\n }\n })\n );\n}\n\n/**\n * Synchronously copy files from one location to another\n *\n * @param source - The source location, this can be a file, directory, URL, or glob pattern\n * @param destination - The destination location\n * @returns An indicator specifying if the copy was successful\n */\nexport function copyFilesSync(\n source: string | URL | Omit<AssetGlob, \"output\">,\n destination: string | URL\n) {\n const src = source instanceof URL ? fileURLToPath(source) : source;\n const dest =\n destination instanceof URL ? fileURLToPath(destination) : destination;\n\n if (isString(src) && isFile(src)) {\n return copyFileSync(src, dest);\n }\n\n return listFilesSync(src).map(entryPath => {\n const destFile = joinPaths(\n dest,\n replacePath(entryPath, isString(src) ? stripStars(src) : src.input)\n );\n\n if (isDirectory(entryPath)) {\n copyFilesSync(entryPath, destFile);\n } else {\n copyFileSync(entryPath, destFile);\n }\n });\n}\n"],"mappings":"ikBAuCA,SAAgB,EACd,EACA,EAAqB,GAAK,CAClB,CACR,OAAO,EAAa,EAAW,EAAW,CACtC,EAAM,EAAU,CAAC,QAAQ,EAAM,EAAW,CAAE,GAAG,CAAC,QAAQ,MAAO,GAAG,CAClE,ECLN,eAAsBA,EACpB,EACA,EACA,CACA,IAAM,EAAM,aAAkB,IAAM,EAAc,EAAO,CAAG,EACtD,EACJ,aAAuB,IAAM,EAAc,EAAY,CAAG,EAU5D,GARK,EAAiB,EAAK,CAIfC,EAAW,EAAa,EAAK,CAAC,EACxC,MAAM,EAAgB,EAAa,EAAK,CAAC,CAJpCA,EAAW,EAAkB,EAAK,CAAC,EACtC,MAAM,EAAgB,EAAkB,EAAK,CAAC,CAM9C,EAAS,EAAI,EAAIA,EAAW,EAAI,CAClC,OAAOC,EAAI,EAAK,EAAK,CAWzB,SAAgBC,EAAa,EAAsB,EAA2B,CAC5E,IAAM,EAAM,aAAkB,IAAM,EAAc,EAAO,CAAG,EACtD,EACJ,aAAuB,IAAM,EAAc,EAAY,CAAG,EAU5D,GARK,EAAiB,EAAK,CAIfF,EAAW,EAAa,EAAK,CAAC,EACxC,EAAoB,EAAa,EAAK,CAAC,CAJlCA,EAAW,EAAkB,EAAK,CAAC,EACtC,EAAoB,EAAkB,EAAK,CAAC,CAM5C,EAAS,EAAI,EAAIA,EAAW,EAAI,CAClC,OAAOG,EAAQ,EAAK,EAAK,CAW7B,eAAsB,EACpB,EACA,EACA,CACA,IAAM,EAAM,aAAkB,IAAM,EAAc,EAAO,CAAG,EACtD,EACJ,aAAuB,IAAM,EAAc,EAAY,CAAG,EAM5D,OAJI,EAAS,EAAI,EAAI,EAAO,EAAI,CACvBJ,EAAS,EAAK,EAAK,CAGrB,QAAQ,KACZ,MAAM,EAAU,EAAI,EAAE,IAAI,KAAM,IAAa,CAC5C,IAAM,EAAW,EACf,EACA,EAAY,EAAW,EAAS,EAAI,CAAG,EAAW,EAAI,CAAG,EAAI,MAAM,CACpE,CAEG,EAAY,EAAU,CACxB,MAAM,EAAU,EAAW,EAAS,CAEpC,MAAMA,EAAS,EAAW,EAAS,EAErC,CACH,CAUH,SAAgB,EACd,EACA,EACA,CACA,IAAM,EAAM,aAAkB,IAAM,EAAc,EAAO,CAAG,EACtD,EACJ,aAAuB,IAAM,EAAc,EAAY,CAAG,EAM5D,OAJI,EAAS,EAAI,EAAI,EAAO,EAAI,CACvBG,EAAa,EAAK,EAAK,CAGzB,EAAc,EAAI,CAAC,IAAI,GAAa,CACzC,IAAM,EAAW,EACf,EACA,EAAY,EAAW,EAAS,EAAI,CAAG,EAAW,EAAI,CAAG,EAAI,MAAM,CACpE,CAEG,EAAY,EAAU,CACxB,EAAc,EAAW,EAAS,CAElC,EAAa,EAAW,EAAS,EAEnC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { t as AssetGlob } from "./file-D1uBqkpP.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/copy-file.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Copy a file from one location to another
|
|
7
|
+
*
|
|
8
|
+
* @param source - The file to copy, this can be a file, directory, URL, or glob pattern
|
|
9
|
+
* @param destination - The destination location
|
|
10
|
+
* @returns An indicator specifying if the copy was successful
|
|
11
|
+
*/
|
|
12
|
+
declare function copyFile(source: string | URL, destination: string | URL): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Synchronously copy a file from one location to another
|
|
15
|
+
*
|
|
16
|
+
* @param source - The file to copy, this can be a file, directory, URL, or glob pattern
|
|
17
|
+
* @param destination - The destination location
|
|
18
|
+
* @returns An indicator specifying if the copy was successful
|
|
19
|
+
*/
|
|
20
|
+
declare function copyFileSync(source: string | URL, destination: string | URL): void;
|
|
21
|
+
/**
|
|
22
|
+
* Copy files from one location to another
|
|
23
|
+
*
|
|
24
|
+
* @param source - The source location, this can be a file, directory, URL, or glob pattern
|
|
25
|
+
* @param destination - The destination location
|
|
26
|
+
* @returns An indicator specifying if the copy was successful
|
|
27
|
+
*/
|
|
28
|
+
declare function copyFiles(source: string | URL | Omit<AssetGlob, "output">, destination: string | URL): Promise<void | void[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Synchronously copy files from one location to another
|
|
31
|
+
*
|
|
32
|
+
* @param source - The source location, this can be a file, directory, URL, or glob pattern
|
|
33
|
+
* @param destination - The destination location
|
|
34
|
+
* @returns An indicator specifying if the copy was successful
|
|
35
|
+
*/
|
|
36
|
+
declare function copyFilesSync(source: string | URL | Omit<AssetGlob, "output">, destination: string | URL): void | void[];
|
|
37
|
+
//#endregion
|
|
38
|
+
export { copyFilesSync as i, copyFileSync as n, copyFiles as r, copyFile as t };
|
|
39
|
+
//# sourceMappingURL=copy-file-DjH2Ho5e.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-file-DjH2Ho5e.d.cts","names":[],"sources":["../src/copy-file.ts"],"sourcesContent":[],"mappings":";;;;;;AAwCA;;;;;AA4BgB,iBA5BM,QAAA,CA4BwB,MAA2B,EAAG,MAAA,GA3BzD,GA2ByD,EAAA,WAAA,EAAA,MAAA,GA1BpD,GA0BoD,CAAA,EA1BjD,OA0BiD,CAAA,IAAA,CAAA;AAyB5E;;;;;;;AAmCgB,iBA5DA,YAAA,CA4Da,MAAA,EAAA,MAAA,GA5DiB,GA4DjB,EAAA,WAAA,EAAA,MAAA,GA5D4C,GA4D5C,CAAA,EAAA,IAAA;;;;;;;;iBAnCP,SAAA,kBACH,MAAM,KAAK,4CACN,MAAG;;;;;;;;iBAiCX,aAAA,kBACG,MAAM,KAAK,4CACN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./cwd-o2vq8Tk9.cjs`),n=require(`./join-paths-DUdaieID.cjs`),r=require(`./file-path-fns-7aKacdLg.cjs`),i=require(`./is-string-DKgNS0jA.cjs`),a=require(`./resolve-parent-path-D0AaW2PB.cjs`),o=require(`./exists-B31lSRFp.cjs`),s=require(`./helpers-_MJ6PR-g.cjs`),c=require(`./is-file-BkFQev3M.cjs`),l=require(`./list-files-Cn_UVruo.cjs`);let u=require(`node:fs`),d=require(`node:fs/promises`),f=require(`mlly`);function p(e,i=t.t()){return r.f(e,i)?n.n(e).replace(n.n(i),``).replace(/^\//,``):e}async function m(e,t){let n=e instanceof URL?(0,f.fileURLToPath)(e):e,c=t instanceof URL?(0,f.fileURLToPath)(t):t;if(r.a(c)?o.n(r.r(c))||await s.t(r.r(c)):o.n(a.t(c))||await s.t(a.t(c)),i.t(n)&&o.n(n))return(0,d.copyFile)(n,c)}function h(e,t){let n=e instanceof URL?(0,f.fileURLToPath)(e):e,c=t instanceof URL?(0,f.fileURLToPath)(t):t;if(r.a(c)?o.n(r.r(c))||s.n(r.r(c)):o.n(a.t(c))||s.n(a.t(c)),i.t(n)&&o.n(n))return(0,u.copyFileSync)(n,c)}async function g(e,t){let a=e instanceof URL?(0,f.fileURLToPath)(e):e,o=t instanceof URL?(0,f.fileURLToPath)(t):t;return i.t(a)&&c.r(a)?m(a,o):Promise.all((await l.i(a)).map(async e=>{let t=n.t(o,p(e,i.t(a)?r.l(a):a.input));c.t(e)?await g(e,t):await m(e,t)}))}function _(e,t){let a=e instanceof URL?(0,f.fileURLToPath)(e):e,o=t instanceof URL?(0,f.fileURLToPath)(t):t;return i.t(a)&&c.r(a)?h(a,o):l.a(a).map(e=>{let t=n.t(o,p(e,i.t(a)?r.l(a):a.input));c.t(e)?_(e,t):h(e,t)})}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return m}});
|
package/dist/copy-file.cjs
CHANGED
|
@@ -1,48 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.copyFile = copyFile;
|
|
7
|
-
exports.copyFileSync = copyFileSync;
|
|
8
|
-
exports.copyFiles = copyFiles;
|
|
9
|
-
exports.copyFilesSync = copyFilesSync;
|
|
10
|
-
var _correctPath = require("@stryke/path/correct-path");
|
|
11
|
-
var _filePathFns = require("@stryke/path/file-path-fns");
|
|
12
|
-
var _join = require("@stryke/path/join");
|
|
13
|
-
var _replace = require("@stryke/path/replace");
|
|
14
|
-
var _resolveParentPath = require("@stryke/path/resolve-parent-path");
|
|
15
|
-
var _typeChecks = require("@stryke/type-checks");
|
|
16
|
-
var _mlly = require("mlly");
|
|
17
|
-
var _nodeFs = require("node:fs");
|
|
18
|
-
var _promises = require("node:fs/promises");
|
|
19
|
-
var _exists = require("./exists.cjs");
|
|
20
|
-
var _helpers = require("./helpers.cjs");
|
|
21
|
-
var _isFile = require("./is-file.cjs");
|
|
22
|
-
var _listFiles = require("./list-files.cjs");
|
|
23
|
-
async function copyFile(r, o) {
|
|
24
|
-
const i = r instanceof URL ? (0, _mlly.fileURLToPath)(r) : r,
|
|
25
|
-
t = o instanceof URL ? (0, _mlly.fileURLToPath)(o) : o;
|
|
26
|
-
if ((0, _filePathFns.hasFileExtension)(t) ? (0, _exists.existsSync)((0, _filePathFns.findFilePath)(t)) || (await (0, _helpers.createDirectory)((0, _filePathFns.findFilePath)(t))) : (0, _exists.existsSync)((0, _resolveParentPath.resolveParentPath)(t)) || (await (0, _helpers.createDirectory)((0, _resolveParentPath.resolveParentPath)(t))), (0, _typeChecks.isString)(i) && (0, _exists.existsSync)(i)) return (0, _promises.copyFile)(i, t);
|
|
27
|
-
}
|
|
28
|
-
function copyFileSync(r, o) {
|
|
29
|
-
const i = r instanceof URL ? (0, _mlly.fileURLToPath)(r) : r,
|
|
30
|
-
t = o instanceof URL ? (0, _mlly.fileURLToPath)(o) : o;
|
|
31
|
-
if ((0, _filePathFns.hasFileExtension)(t) ? (0, _exists.existsSync)((0, _filePathFns.findFilePath)(t)) || (0, _helpers.createDirectorySync)((0, _filePathFns.findFilePath)(t)) : (0, _exists.existsSync)((0, _resolveParentPath.resolveParentPath)(t)) || (0, _helpers.createDirectorySync)((0, _resolveParentPath.resolveParentPath)(t)), (0, _typeChecks.isString)(i) && (0, _exists.existsSync)(i)) return (0, _nodeFs.copyFileSync)(i, t);
|
|
32
|
-
}
|
|
33
|
-
async function copyFiles(r, o) {
|
|
34
|
-
const i = r instanceof URL ? (0, _mlly.fileURLToPath)(r) : r,
|
|
35
|
-
t = o instanceof URL ? (0, _mlly.fileURLToPath)(o) : o;
|
|
36
|
-
return (0, _typeChecks.isString)(i) && (0, _isFile.isFile)(i) ? copyFile(i, t) : Promise.all((await (0, _listFiles.listFiles)(i)).map(async s => {
|
|
37
|
-
const c = (0, _join.joinPaths)(t, (0, _replace.replacePath)(s, (0, _typeChecks.isString)(i) ? (0, _correctPath.stripStars)(i) : i.input));
|
|
38
|
-
(0, _isFile.isDirectory)(s) ? await copyFiles(s, c) : await copyFile(s, c);
|
|
39
|
-
}));
|
|
40
|
-
}
|
|
41
|
-
function copyFilesSync(r, o) {
|
|
42
|
-
const i = r instanceof URL ? (0, _mlly.fileURLToPath)(r) : r,
|
|
43
|
-
t = o instanceof URL ? (0, _mlly.fileURLToPath)(o) : o;
|
|
44
|
-
return (0, _typeChecks.isString)(i) && (0, _isFile.isFile)(i) ? copyFileSync(i, t) : (0, _listFiles.listFilesSync)(i).map(s => {
|
|
45
|
-
const c = (0, _join.joinPaths)(t, (0, _replace.replacePath)(s, (0, _typeChecks.isString)(i) ? (0, _correctPath.stripStars)(i) : i.input));
|
|
46
|
-
(0, _isFile.isDirectory)(s) ? copyFilesSync(s, c) : copyFileSync(s, c);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
1
|
+
const e=require(`./copy-file-Y1ilzocZ.cjs`);require(`./helpers-_MJ6PR-g.cjs`),require(`./list-files-Cn_UVruo.cjs`),exports.copyFile=e.t,exports.copyFileSync=e.n,exports.copyFiles=e.r,exports.copyFilesSync=e.i;
|
package/dist/copy-file.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"./copy-file-Bot2YNtT.mjs";import"./helpers-BSEQb1fp.mjs";import"./list-files-D__uh3tQ.mjs";export{r as copyFile,t as copyFileSync,n as copyFiles,e as copyFilesSync};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cwd-YTg9Cx6C.mjs","names":[],"sources":["../../path/src/cwd.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Get the current working directory.\n *\n * @remarks\n * This function attempts to retrieve the current working directory using `process.cwd()`.\n *\n * @returns The current working directory or '/' if it cannot be determined\n */\nexport function cwd() {\n if (typeof process !== \"undefined\" && typeof process.cwd === \"function\") {\n return process.cwd().replace(/\\\\/g, \"/\");\n }\n return \"/\";\n}\n"],"mappings":"AA0BA,SAAgB,GAAM,CAIpB,OAHI,OAAO,QAAY,KAAe,OAAO,QAAQ,KAAQ,WACpD,QAAQ,KAAK,CAAC,QAAQ,MAAO,IAAI,CAEnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
+
//#region src/exists.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Check if a file exists
|
|
3
4
|
*
|
|
4
5
|
* @param filePath - The file path to check
|
|
5
6
|
* @returns An indicator specifying if the file exists
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
+
declare function existsSync(filePath: string): boolean;
|
|
8
9
|
/**
|
|
9
10
|
* Check if a file exists
|
|
10
11
|
*
|
|
11
12
|
* @param filePath - The file path to check
|
|
12
13
|
* @returns An indicator specifying if the file exists
|
|
13
14
|
*/
|
|
14
|
-
|
|
15
|
+
declare function exists(filePath: string): Promise<boolean>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { existsSync as n, exists as t };
|
|
18
|
+
//# sourceMappingURL=exists-175EN367.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exists-175EN367.d.mts","names":[],"sources":["../src/exists.ts"],"sourcesContent":[],"mappings":";;AA2BA;AAUA;;;;iBAVgB,UAAA;;;;;;;iBAUM,MAAA,oBAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./chunk-Bmb41Sf3.cjs`);let t=require(`node:fs`),n=require(`node:fs/promises`);function r(e){return(0,t.existsSync)(e)}async function i(e){return(0,n.access)(e,n.constants.F_OK).then(()=>!0).catch(()=>!1)}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/exists.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Check if a file exists
|
|
4
|
+
*
|
|
5
|
+
* @param filePath - The file path to check
|
|
6
|
+
* @returns An indicator specifying if the file exists
|
|
7
|
+
*/
|
|
8
|
+
declare function existsSync(filePath: string): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Check if a file exists
|
|
11
|
+
*
|
|
12
|
+
* @param filePath - The file path to check
|
|
13
|
+
* @returns An indicator specifying if the file exists
|
|
14
|
+
*/
|
|
15
|
+
declare function exists(filePath: string): Promise<boolean>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { existsSync as n, exists as t };
|
|
18
|
+
//# sourceMappingURL=exists-CVlDImzc.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exists-CVlDImzc.d.cts","names":[],"sources":["../src/exists.ts"],"sourcesContent":[],"mappings":";;AA2BA;AAUA;;;;iBAVgB,UAAA;;;;;;;iBAUM,MAAA,oBAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exists-Ci-9lYmi.mjs","names":["existsSync","existsSyncFs","constants"],"sources":["../src/exists.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { existsSync as existsSyncFs } from \"node:fs\";\nimport { access, constants } from \"node:fs/promises\";\n\n/**\n * Check if a file exists\n *\n * @param filePath - The file path to check\n * @returns An indicator specifying if the file exists\n */\nexport function existsSync(filePath: string): boolean {\n return existsSyncFs(filePath);\n}\n\n/**\n * Check if a file exists\n *\n * @param filePath - The file path to check\n * @returns An indicator specifying if the file exists\n */\nexport async function exists(filePath: string): Promise<boolean> {\n return access(filePath, constants.F_OK)\n .then(() => true)\n .catch(() => false);\n}\n"],"mappings":"8FA2BA,SAAgBA,EAAW,EAA2B,CACpD,OAAOC,EAAa,EAAS,CAS/B,eAAsB,EAAO,EAAoC,CAC/D,OAAO,EAAO,EAAUC,EAAU,KAAK,CACpC,SAAW,GAAK,CAChB,UAAY,GAAM"}
|
package/dist/exists.cjs
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.exists = exists;
|
|
7
|
-
exports.existsSync = existsSync;
|
|
8
|
-
var _nodeFs = require("node:fs");
|
|
9
|
-
var _promises = require("node:fs/promises");
|
|
10
|
-
function existsSync(s) {
|
|
11
|
-
return (0, _nodeFs.existsSync)(s);
|
|
12
|
-
}
|
|
13
|
-
async function exists(s) {
|
|
14
|
-
return (0, _promises.access)(s, _promises.constants.F_OK).then(() => !0).catch(() => !1);
|
|
15
|
-
}
|
|
1
|
+
const e=require(`./exists-B31lSRFp.cjs`);exports.exists=e.t,exports.existsSync=e.n;
|
package/dist/exists.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{n as e,t}from"./exists-Ci-9lYmi.mjs";export{t as exists,e as existsSync};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region ../types/src/file.d.ts
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A valid `picomatch` glob pattern, or array of patterns.
|
|
5
|
+
*/
|
|
6
|
+
type FilterPattern = ReadonlyArray<string | RegExp> | string | RegExp | null;
|
|
7
|
+
interface FileInputOutput {
|
|
8
|
+
input: string;
|
|
9
|
+
output: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* An interface got representing an asset files with glob patterns.
|
|
13
|
+
*/
|
|
14
|
+
type AssetGlob = Required<Omit<FileInputOutput, "input">> & Partial<Pick<FileInputOutput, "input">> & {
|
|
15
|
+
/**
|
|
16
|
+
* A glob pattern to match files.
|
|
17
|
+
*/
|
|
18
|
+
glob: string;
|
|
19
|
+
/**
|
|
20
|
+
* An array of glob patterns to ignore files.
|
|
21
|
+
*/
|
|
22
|
+
ignore?: string[];
|
|
23
|
+
/**
|
|
24
|
+
* Include `.dot` files in normal matches and `globstar` matches. Note that an explicit dot in a portion of the pattern will always match dot files.
|
|
25
|
+
*
|
|
26
|
+
* @defaultValue true
|
|
27
|
+
*/
|
|
28
|
+
dot?: boolean;
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { FilterPattern as n, AssetGlob as t };
|
|
32
|
+
//# sourceMappingURL=file-D1uBqkpP.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-D1uBqkpP.d.cts","names":[],"sources":["../../types/src/file.ts"],"sourcesContent":[],"mappings":";;;;;KA8CY,aAAA,GACR,uBAAuB,mBAEvB;UAGa,eAAA;;;;;;;KAQL,SAAA,GAAY,SAAS,KAAK,6BACpC,QAAQ,KAAK"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region ../types/src/file.d.ts
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A valid `picomatch` glob pattern, or array of patterns.
|
|
5
|
+
*/
|
|
6
|
+
type FilterPattern = ReadonlyArray<string | RegExp> | string | RegExp | null;
|
|
7
|
+
interface FileInputOutput {
|
|
8
|
+
input: string;
|
|
9
|
+
output: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* An interface got representing an asset files with glob patterns.
|
|
13
|
+
*/
|
|
14
|
+
type AssetGlob = Required<Omit<FileInputOutput, "input">> & Partial<Pick<FileInputOutput, "input">> & {
|
|
15
|
+
/**
|
|
16
|
+
* A glob pattern to match files.
|
|
17
|
+
*/
|
|
18
|
+
glob: string;
|
|
19
|
+
/**
|
|
20
|
+
* An array of glob patterns to ignore files.
|
|
21
|
+
*/
|
|
22
|
+
ignore?: string[];
|
|
23
|
+
/**
|
|
24
|
+
* Include `.dot` files in normal matches and `globstar` matches. Note that an explicit dot in a portion of the pattern will always match dot files.
|
|
25
|
+
*
|
|
26
|
+
* @defaultValue true
|
|
27
|
+
*/
|
|
28
|
+
dot?: boolean;
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { FilterPattern as n, AssetGlob as t };
|
|
32
|
+
//# sourceMappingURL=file-DauFFmfh.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-DauFFmfh.d.mts","names":[],"sources":["../../types/src/file.ts"],"sourcesContent":[],"mappings":";;;;;KA8CY,aAAA,GACR,uBAAuB,mBAEvB;UAGa,eAAA;;;;;;;KAQL,SAAA,GAAY,SAAS,KAAK,6BACpC,QAAQ,KAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./cwd-o2vq8Tk9.cjs`),t=require(`./join-paths-DUdaieID.cjs`),n=require(`./is-set-string-CLeu8BKX.cjs`);function r(e,n){let r=t.n(e.replace(/\\/g,`/`).replace(/\/$/,``)),i=t.n(n.replace(/\\/g,`/`).replace(/\/$/,``));return r!==i&&r.startsWith(`${i}/`)}function i(n,i=e.t()){return t.n(r(n,i)?n:t.t(i,n))}function a(e,t){return`${e}.${t.replace(/^\./,``)}`}function o(e=``){return e&&t.n(e).replace(t.s,e=>e.toUpperCase())}function s(e){if(!e||e.length===0)return`.`;e=o(e);let n=e.match(t.u),r=t.i(e),i=e.endsWith(`/`);return e=l(e,!r),e.length===0?r?`/`:i?`./`:`.`:(i&&(e+=`/`),t.o.test(e)&&(e+=`/`),n?r?`//${e}`:`//./${e}`:!e.startsWith(`/`)&&r&&!t.o.test(e)?`/${e}`:e)}function c(e){if(!e||e.length===0)return`.`;e=s(e);let t=!1;return e.split(`/`).reduce((e,n)=>n?.trim()?t||n.includes(`*`)?(t=!0,e):e+(e?`/${n}`:n):e,``)}function l(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(!(i===s-1||a===1))if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}else if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}function u(n,r=e.t()){return t.i(n)?n:t.n(l(i(n,r),!0))}const d=``;function f(e,t={}){let{requireExtension:n=!1,withExtension:r=!0}=t,i=o(e)?.split(e?.includes(`\\`)?`\\`:`/`)?.pop()??``;return n===!0&&!i.includes(`.`)?``:r===!1&&i.includes(`.`)?i.replace(`.${h(i)??``}`,``)||``:i}function p(e,t={}){let n=o(e),r=n.replace(f(n,{requireExtension:!1,...t}),``);return r===`/`?r:r.replace(/\/$/,``)}function m(e,t){let n=p(e,t).split(`/`),r=``;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t){r=t;break}}return r??``}function h(e){if(e.endsWith(`.`)||e.endsWith(`/`))return;let r=t.c.exec(o(e));return r&&r.length>0&&n.t(r[0])?r[0].replace(`.`,``):void 0}function g(e){return!!h(e)}function _(...n){n=n.map(e=>o(e));let r=``,i=!1;for(let a=n.length-1;a>=-1&&!i;a--){let o=a>=0?n[a]:e.t();!o||o.length===0||(r=`${o}/${r}`,i=t.r(o))}return r=l(r,!i),i&&!t.r(r)?`/${r}`:r.length>0?r:`.`}function v(e,n){let r=_(e).replace(t.l,`$1`).split(`/`),i=_(n).replace(t.l,`$1`).split(`/`);if(i[0][1]===`:`&&r[0][1]===`:`&&r[0]!==i[0])return i.join(`/`);let a=[...r];for(let e of a){if(i[0]!==e)break;r.shift(),i.shift()}return[...r.map(()=>`..`),...i].join(`/`)}function y(e,t,n=!1){return v(n===!0?e:e.replace(/\/$/,``),n===!0?t:t.replace(/\/$/,``))}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return``}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return u}});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as e}from"./cwd-YTg9Cx6C.mjs";import{c as t,i as n,l as r,n as i,o as a,r as o,s,t as c,u as l}from"./join-paths-BHepkhAj.mjs";import{t as u}from"./is-set-string-Cj0g4gsG.mjs";function d(e,t){let n=i(e.replace(/\\/g,`/`).replace(/\/$/,``)),r=i(t.replace(/\\/g,`/`).replace(/\/$/,``));return n!==r&&n.startsWith(`${r}/`)}function f(t,n=e()){return i(d(t,n)?t:c(n,t))}function p(e,t){return`${e}.${t.replace(/^\./,``)}`}function m(e=``){return e&&i(e).replace(s,e=>e.toUpperCase())}function h(e){if(!e||e.length===0)return`.`;e=m(e);let t=e.match(l),r=n(e),i=e.endsWith(`/`);return e=_(e,!r),e.length===0?r?`/`:i?`./`:`.`:(i&&(e+=`/`),a.test(e)&&(e+=`/`),t?r?`//${e}`:`//./${e}`:!e.startsWith(`/`)&&r&&!a.test(e)?`/${e}`:e)}function g(e){if(!e||e.length===0)return`.`;e=h(e);let t=!1;return e.split(`/`).reduce((e,n)=>n?.trim()?t||n.includes(`*`)?(t=!0,e):e+(e?`/${n}`:n):e,``)}function _(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(!(i===s-1||a===1))if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}else if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}function v(t,r=e()){return n(t)?t:i(_(f(t,r),!0))}const y=``;function b(e,t={}){let{requireExtension:n=!1,withExtension:r=!0}=t,i=m(e)?.split(e?.includes(`\\`)?`\\`:`/`)?.pop()??``;return n===!0&&!i.includes(`.`)?``:r===!1&&i.includes(`.`)?i.replace(`.${C(i)??``}`,``)||``:i}function x(e,t={}){let n=m(e),r=n.replace(b(n,{requireExtension:!1,...t}),``);return r===`/`?r:r.replace(/\/$/,``)}function S(e,t){let n=x(e,t).split(`/`),r=``;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t){r=t;break}}return r??``}function C(e){if(e.endsWith(`.`)||e.endsWith(`/`))return;let n=t.exec(m(e));return n&&n.length>0&&u(n[0])?n[0].replace(`.`,``):void 0}function w(e){return!!C(e)}function T(...t){t=t.map(e=>m(e));let n=``,r=!1;for(let i=t.length-1;i>=-1&&!r;i--){let a=i>=0?t[i]:e();!a||a.length===0||(n=`${a}/${n}`,r=o(a))}return n=_(n,!r),r&&!o(n)?`/${n}`:n.length>0?n:`.`}function E(e,t){let n=T(e).replace(r,`$1`).split(`/`),i=T(t).replace(r,`$1`).split(`/`);if(i[0][1]===`:`&&n[0][1]===`:`&&n[0]!==i[0])return i.join(`/`);let a=[...n];for(let e of a){if(i[0]!==e)break;n.shift(),i.shift()}return[...n.map(()=>`..`),...i].join(`/`)}function D(e,t,n=!1){return E(n===!0?e:e.replace(/\/$/,``),n===!0?t:t.replace(/\/$/,``))}export{w as a,h as c,p as d,d as f,S as i,g as l,b as n,D as o,x as r,y as s,C as t,v as u};
|
|
2
|
+
//# sourceMappingURL=file-path-fns-BDzC2SIV.mjs.map
|