@stryke/fs 0.33.19 → 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.
- package/CHANGELOG.md +24 -0
- package/dist/{chunk-Bmb41Sf3.cjs → _virtual/rolldown_runtime.cjs} +1 -1
- package/dist/buffer.cjs +1 -1
- package/dist/buffer.d.cts +32 -2
- package/dist/buffer.d.cts.map +1 -0
- package/dist/buffer.d.mts +32 -2
- package/dist/buffer.d.mts.map +1 -0
- package/dist/buffer.mjs +2 -1
- package/dist/buffer.mjs.map +1 -0
- package/dist/chmod-x.cjs +1 -1
- package/dist/chmod-x.d.cts +44 -2
- package/dist/chmod-x.d.cts.map +1 -0
- package/dist/chmod-x.d.mts +44 -2
- package/dist/chmod-x.d.mts.map +1 -0
- package/dist/chmod-x.mjs +2 -1
- package/dist/chmod-x.mjs.map +1 -0
- package/dist/command-exists.cjs +1 -1
- package/dist/command-exists.d.cts +22 -2
- package/dist/command-exists.d.cts.map +1 -0
- package/dist/command-exists.d.mts +22 -2
- package/dist/command-exists.d.mts.map +1 -0
- package/dist/command-exists.mjs +2 -1
- package/dist/command-exists.mjs.map +1 -0
- package/dist/compress.cjs +1 -1
- package/dist/compress.d.cts +16 -2
- package/dist/compress.d.cts.map +1 -0
- package/dist/compress.d.mts +16 -2
- package/dist/compress.d.mts.map +1 -0
- package/dist/compress.mjs +2 -1
- package/dist/compress.mjs.map +1 -0
- package/dist/constants.d.cts +5 -2
- package/dist/constants.d.cts.map +1 -0
- package/dist/constants.d.mts +5 -2
- package/dist/constants.d.mts.map +1 -0
- package/dist/convert/src/array-buffer-to-string.cjs +1 -0
- package/dist/convert/src/array-buffer-to-string.mjs +2 -0
- package/dist/convert/src/array-buffer-to-string.mjs.map +1 -0
- package/dist/convert/src/to-array.cjs +1 -0
- package/dist/convert/src/to-array.mjs +2 -0
- package/dist/convert/src/to-array.mjs.map +1 -0
- package/dist/convert/src/uint8-array-to-string.cjs +1 -0
- package/dist/convert/src/uint8-array-to-string.mjs +2 -0
- package/dist/convert/src/uint8-array-to-string.mjs.map +1 -0
- package/dist/copy-file.cjs +1 -1
- package/dist/copy-file.d.cts +39 -2
- package/dist/copy-file.d.cts.map +1 -0
- package/dist/copy-file.d.mts +39 -2
- package/dist/copy-file.d.mts.map +1 -0
- package/dist/copy-file.mjs +2 -1
- package/dist/copy-file.mjs.map +1 -0
- package/dist/exists.cjs +1 -1
- package/dist/exists.d.cts +18 -2
- package/dist/exists.d.cts.map +1 -0
- package/dist/exists.d.mts +18 -2
- package/dist/exists.d.mts.map +1 -0
- package/dist/exists.mjs +2 -1
- package/dist/exists.mjs.map +1 -0
- package/dist/get-parent-path.cjs +1 -1
- package/dist/get-parent-path.d.cts +32 -2
- package/dist/get-parent-path.d.cts.map +1 -0
- package/dist/get-parent-path.d.mts +32 -2
- package/dist/get-parent-path.d.mts.map +1 -0
- package/dist/get-parent-path.mjs +2 -1
- package/dist/get-parent-path.mjs.map +1 -0
- package/dist/get-workspace-root.cjs +1 -1
- package/dist/get-workspace-root.d.cts +48 -2
- package/dist/get-workspace-root.d.cts.map +1 -0
- package/dist/get-workspace-root.d.mts +48 -2
- package/dist/get-workspace-root.d.mts.map +1 -0
- package/dist/get-workspace-root.mjs +2 -1
- package/dist/get-workspace-root.mjs.map +1 -0
- package/dist/helpers/src/get-unique.cjs +1 -0
- package/dist/helpers/src/get-unique.mjs +2 -0
- package/dist/helpers/src/get-unique.mjs.map +1 -0
- package/dist/helpers.cjs +1 -1
- package/dist/helpers.d.cts +50 -2
- package/dist/helpers.d.cts.map +1 -0
- package/dist/helpers.d.mts +50 -2
- package/dist/helpers.d.mts.map +1 -0
- package/dist/helpers.mjs +2 -1
- package/dist/helpers.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +24 -24
- package/dist/index.d.mts +24 -24
- package/dist/index.mjs +1 -1
- package/dist/install.cjs +1 -1
- package/dist/install.d.cts +28 -2
- package/dist/install.d.cts.map +1 -0
- package/dist/install.d.mts +29 -2
- package/dist/install.d.mts.map +1 -0
- package/dist/install.mjs +2 -1
- package/dist/install.mjs.map +1 -0
- package/dist/is-file.cjs +1 -1
- package/dist/is-file.d.cts +36 -2
- package/dist/is-file.d.cts.map +1 -0
- package/dist/is-file.d.mts +36 -2
- package/dist/is-file.d.mts.map +1 -0
- package/dist/is-file.mjs +2 -1
- package/dist/is-file.mjs.map +1 -0
- package/dist/json/src/storm-json.cjs +1 -0
- package/dist/json/src/storm-json.mjs +2 -0
- package/dist/json/src/storm-json.mjs.map +1 -0
- package/dist/json/src/types.d.cts +33 -0
- package/dist/json/src/types.d.cts.map +1 -0
- package/dist/json/src/types.d.mts +33 -0
- package/dist/json/src/types.d.mts.map +1 -0
- package/dist/json/src/utils/code-frames.cjs +3 -0
- package/dist/json/src/utils/code-frames.mjs +4 -0
- package/dist/json/src/utils/code-frames.mjs.map +1 -0
- package/dist/json/src/utils/parse-error.cjs +1 -0
- package/dist/json/src/utils/parse-error.mjs +2 -0
- package/dist/json/src/utils/parse-error.mjs.map +1 -0
- package/dist/json/src/utils/parse.cjs +1 -0
- package/dist/json/src/utils/parse.mjs +2 -0
- package/dist/json/src/utils/parse.mjs.map +1 -0
- package/dist/json/src/utils/stringify.cjs +1 -0
- package/dist/json/src/utils/stringify.mjs +2 -0
- package/dist/json/src/utils/stringify.mjs.map +1 -0
- package/dist/json/src/utils/strip-comments.cjs +4 -0
- package/dist/json/src/utils/strip-comments.mjs +5 -0
- package/dist/json/src/utils/strip-comments.mjs.map +1 -0
- package/dist/json.cjs +1 -1
- package/dist/json.d.cts +54 -2
- package/dist/json.d.cts.map +1 -0
- package/dist/json.d.mts +54 -2
- package/dist/json.d.mts.map +1 -0
- package/dist/json.mjs +2 -1
- package/dist/json.mjs.map +1 -0
- package/dist/list-files.cjs +1 -1
- package/dist/list-files.d.cts +51 -2
- package/dist/list-files.d.cts.map +1 -0
- package/dist/list-files.d.mts +51 -2
- package/dist/list-files.d.mts.map +1 -0
- package/dist/list-files.mjs +2 -1
- package/dist/list-files.mjs.map +1 -0
- package/dist/package-fns.cjs +1 -1
- package/dist/package-fns.d.cts +95 -2
- package/dist/package-fns.d.cts.map +1 -0
- package/dist/package-fns.d.mts +95 -2
- package/dist/package-fns.d.mts.map +1 -0
- package/dist/package-fns.mjs +2 -1
- package/dist/package-fns.mjs.map +1 -0
- package/dist/path/src/append.cjs +1 -0
- package/dist/path/src/append.mjs +2 -0
- package/dist/path/src/append.mjs.map +1 -0
- package/dist/path/src/correct-path.cjs +1 -0
- package/dist/path/src/correct-path.mjs +2 -0
- package/dist/path/src/correct-path.mjs.map +1 -0
- package/dist/path/src/cwd.cjs +1 -0
- package/dist/path/src/cwd.mjs +2 -0
- package/dist/path/src/cwd.mjs.map +1 -0
- package/dist/path/src/file-path-fns.cjs +1 -0
- package/dist/path/src/file-path-fns.mjs +2 -0
- package/dist/path/src/file-path-fns.mjs.map +1 -0
- package/dist/path/src/is-parent-path.cjs +1 -0
- package/dist/path/src/is-parent-path.mjs +2 -0
- package/dist/path/src/is-parent-path.mjs.map +1 -0
- package/dist/path/src/is-root-dir.cjs +1 -0
- package/dist/path/src/is-root-dir.mjs +2 -0
- package/dist/path/src/is-root-dir.mjs.map +1 -0
- package/dist/path/src/is-type.cjs +1 -0
- package/dist/path/src/is-type.mjs +2 -0
- package/dist/path/src/is-type.mjs.map +1 -0
- package/dist/path/src/join-paths.cjs +1 -0
- package/dist/path/src/join-paths.mjs +2 -0
- package/dist/path/src/join-paths.mjs.map +1 -0
- package/dist/path/src/regex.cjs +1 -0
- package/dist/path/src/regex.mjs +2 -0
- package/dist/path/src/regex.mjs.map +1 -0
- package/dist/path/src/replace.cjs +1 -0
- package/dist/path/src/replace.mjs +2 -0
- package/dist/path/src/replace.mjs.map +1 -0
- package/dist/path/src/resolve-parent-path.cjs +1 -0
- package/dist/path/src/resolve-parent-path.mjs +2 -0
- package/dist/path/src/resolve-parent-path.mjs.map +1 -0
- package/dist/path/src/slash.cjs +1 -0
- package/dist/path/src/slash.mjs +2 -0
- package/dist/path/src/slash.mjs.map +1 -0
- package/dist/read-file.cjs +1 -1
- package/dist/read-file.d.cts +30 -2
- package/dist/read-file.d.cts.map +1 -0
- package/dist/read-file.d.mts +30 -2
- package/dist/read-file.d.mts.map +1 -0
- package/dist/read-file.mjs +2 -1
- package/dist/read-file.mjs.map +1 -0
- package/dist/registry.cjs +1 -1
- package/dist/registry.d.cts +53 -2
- package/dist/registry.d.cts.map +1 -0
- package/dist/registry.d.mts +53 -2
- package/dist/registry.d.mts.map +1 -0
- package/dist/registry.mjs +2 -1
- package/dist/registry.mjs.map +1 -0
- package/dist/remove-file.cjs +1 -1
- package/dist/remove-file.d.cts +16 -2
- package/dist/remove-file.d.cts.map +1 -0
- package/dist/remove-file.d.mts +16 -2
- package/dist/remove-file.d.mts.map +1 -0
- package/dist/remove-file.mjs +2 -1
- package/dist/remove-file.mjs.map +1 -0
- package/dist/resolve.cjs +3 -1
- package/dist/resolve.d.cts +106 -2
- package/dist/resolve.d.cts.map +1 -0
- package/dist/resolve.d.mts +106 -2
- package/dist/resolve.d.mts.map +1 -0
- package/dist/resolve.mjs +4 -1
- package/dist/resolve.mjs.map +1 -0
- package/dist/semver-fns.cjs +1 -1
- package/dist/semver-fns.d.cts +92 -2
- package/dist/semver-fns.d.cts.map +1 -0
- package/dist/semver-fns.d.mts +92 -2
- package/dist/semver-fns.d.mts.map +1 -0
- package/dist/semver-fns.mjs +2 -1
- package/dist/semver-fns.mjs.map +1 -0
- package/dist/string-format/src/package.cjs +1 -0
- package/dist/string-format/src/package.mjs +2 -0
- package/dist/string-format/src/package.mjs.map +1 -0
- package/dist/toml.cjs +3 -1
- package/dist/toml.d.cts +81 -2
- package/dist/toml.d.cts.map +1 -0
- package/dist/toml.d.mts +81 -2
- package/dist/toml.d.mts.map +1 -0
- package/dist/toml.mjs +4 -1
- package/dist/toml.mjs.map +1 -0
- package/dist/tsconfig.cjs +1 -1
- package/dist/tsconfig.d.cts +14 -2
- package/dist/tsconfig.d.cts.map +1 -0
- package/dist/tsconfig.d.mts +14 -2
- package/dist/tsconfig.d.mts.map +1 -0
- package/dist/tsconfig.mjs +2 -1
- package/dist/tsconfig.mjs.map +1 -0
- package/dist/type-checks/src/get-object-tag.cjs +1 -0
- package/dist/type-checks/src/get-object-tag.mjs +2 -0
- package/dist/type-checks/src/get-object-tag.mjs.map +1 -0
- package/dist/type-checks/src/index.cjs +1 -0
- package/dist/type-checks/src/index.mjs +1 -0
- package/dist/type-checks/src/is-buffer.cjs +1 -0
- package/dist/type-checks/src/is-buffer.mjs +2 -0
- package/dist/type-checks/src/is-buffer.mjs.map +1 -0
- package/dist/type-checks/src/is-collection.cjs +1 -0
- package/dist/type-checks/src/is-collection.mjs +1 -0
- package/dist/type-checks/src/is-empty.cjs +1 -0
- package/dist/type-checks/src/is-empty.mjs +2 -0
- package/dist/type-checks/src/is-empty.mjs.map +1 -0
- package/dist/type-checks/src/is-error.cjs +1 -0
- package/dist/type-checks/src/is-error.mjs +2 -0
- package/dist/type-checks/src/is-error.mjs.map +1 -0
- package/dist/type-checks/src/is-null.cjs +1 -0
- package/dist/type-checks/src/is-null.mjs +2 -0
- package/dist/type-checks/src/is-null.mjs.map +1 -0
- package/dist/type-checks/src/is-number.cjs +1 -0
- package/dist/type-checks/src/is-number.mjs +2 -0
- package/dist/type-checks/src/is-number.mjs.map +1 -0
- package/dist/type-checks/src/is-object.cjs +1 -0
- package/dist/type-checks/src/is-object.mjs +2 -0
- package/dist/type-checks/src/is-object.mjs.map +1 -0
- package/dist/type-checks/src/is-plain-object.cjs +1 -0
- package/dist/type-checks/src/is-plain-object.mjs +2 -0
- package/dist/type-checks/src/is-plain-object.mjs.map +1 -0
- package/dist/type-checks/src/is-set-string.cjs +1 -0
- package/dist/type-checks/src/is-set-string.mjs +2 -0
- package/dist/type-checks/src/is-set-string.mjs.map +1 -0
- package/dist/type-checks/src/is-set.cjs +1 -0
- package/dist/type-checks/src/is-set.mjs +2 -0
- package/dist/type-checks/src/is-set.mjs.map +1 -0
- package/dist/type-checks/src/is-string.cjs +1 -0
- package/dist/type-checks/src/is-string.mjs +2 -0
- package/dist/type-checks/src/is-string.mjs.map +1 -0
- package/dist/type-checks/src/is-undefined.cjs +1 -0
- package/dist/type-checks/src/is-undefined.mjs +2 -0
- package/dist/type-checks/src/is-undefined.mjs.map +1 -0
- package/dist/type-checks/src/type-detect.cjs +1 -0
- package/dist/type-checks/src/type-detect.mjs +2 -0
- package/dist/type-checks/src/type-detect.mjs.map +1 -0
- package/dist/types/src/base.cjs +1 -0
- package/dist/types/src/base.mjs +2 -0
- package/dist/types/src/base.mjs.map +1 -0
- package/dist/{file-D1uBqkpP.d.cts → types/src/file.d.cts} +2 -2
- package/dist/types/src/file.d.cts.map +1 -0
- package/dist/{file-DauFFmfh.d.mts → types/src/file.d.mts} +2 -2
- package/dist/types/src/file.d.mts.map +1 -0
- package/dist/{package-fns-CxokaGDY.d.mts → types/src/package-json.d.cts} +2 -95
- package/dist/types/src/package-json.d.cts.map +1 -0
- package/dist/{package-fns-BNRi_Rpc.d.cts → types/src/package-json.d.mts} +2 -95
- package/dist/types/src/package-json.d.mts.map +1 -0
- package/dist/types/src/package-manager.d.cts +5 -0
- package/dist/types/src/package-manager.d.cts.map +1 -0
- package/dist/types/src/package-manager.d.mts +5 -0
- package/dist/types/src/package-manager.d.mts.map +1 -0
- package/dist/{tsconfig-B13IMV_0.d.mts → types/src/tsconfig.d.cts} +3 -12
- package/dist/types/src/tsconfig.d.cts.map +1 -0
- package/dist/{tsconfig-C8ecu1-0.d.cts → types/src/tsconfig.d.mts} +3 -12
- package/dist/types/src/tsconfig.d.mts.map +1 -0
- package/dist/write-file.cjs +1 -1
- package/dist/write-file.d.cts +35 -2
- package/dist/write-file.d.cts.map +1 -0
- package/dist/write-file.d.mts +35 -2
- package/dist/write-file.d.mts.map +1 -0
- package/dist/write-file.mjs +2 -1
- package/dist/write-file.mjs.map +1 -0
- package/dist/yaml.cjs +1 -1
- package/dist/yaml.d.cts +23 -2
- package/dist/yaml.d.cts.map +1 -0
- package/dist/yaml.d.mts +23 -2
- package/dist/yaml.d.mts.map +1 -0
- package/dist/yaml.mjs +2 -1
- package/dist/yaml.mjs.map +1 -0
- package/package.json +11 -11
- package/dist/buffer-Ch164vki.cjs +0 -1
- package/dist/buffer-DDq-CW4J.mjs +0 -2
- package/dist/buffer-DDq-CW4J.mjs.map +0 -1
- package/dist/buffer-DgfUmhrc.d.mts +0 -32
- package/dist/buffer-DgfUmhrc.d.mts.map +0 -1
- package/dist/buffer-DvCjrjQH.d.cts +0 -32
- package/dist/buffer-DvCjrjQH.d.cts.map +0 -1
- package/dist/chmod-x-BPr4tt2-.d.cts +0 -44
- package/dist/chmod-x-BPr4tt2-.d.cts.map +0 -1
- package/dist/chmod-x-FOy3sak8.cjs +0 -1
- package/dist/chmod-x-QCk1GmQJ.d.mts +0 -44
- package/dist/chmod-x-QCk1GmQJ.d.mts.map +0 -1
- package/dist/chmod-x-q-TWdus7.mjs +0 -2
- package/dist/chmod-x-q-TWdus7.mjs.map +0 -1
- package/dist/command-exists-CuieR7rx.d.cts +0 -22
- package/dist/command-exists-CuieR7rx.d.cts.map +0 -1
- package/dist/command-exists-D1bV-wSk.cjs +0 -1
- package/dist/command-exists-Dzb2kKT4.mjs +0 -2
- package/dist/command-exists-Dzb2kKT4.mjs.map +0 -1
- package/dist/command-exists-dBdtR0xj.d.mts +0 -22
- package/dist/command-exists-dBdtR0xj.d.mts.map +0 -1
- package/dist/compress-BiTxso15.mjs +0 -2
- package/dist/compress-BiTxso15.mjs.map +0 -1
- package/dist/compress-BjGbQqs_.cjs +0 -1
- package/dist/compress-CLAaOwH3.d.mts +0 -16
- package/dist/compress-CLAaOwH3.d.mts.map +0 -1
- package/dist/compress-CQve2a6h.d.cts +0 -16
- package/dist/compress-CQve2a6h.d.cts.map +0 -1
- package/dist/constants-D58o2CiO.d.cts +0 -5
- package/dist/constants-D58o2CiO.d.cts.map +0 -1
- package/dist/constants-DZz9LJgo.d.mts +0 -5
- package/dist/constants-DZz9LJgo.d.mts.map +0 -1
- package/dist/copy-file-B5FJHiIK.d.mts +0 -39
- package/dist/copy-file-B5FJHiIK.d.mts.map +0 -1
- package/dist/copy-file-Bot2YNtT.mjs +0 -2
- package/dist/copy-file-Bot2YNtT.mjs.map +0 -1
- package/dist/copy-file-DjH2Ho5e.d.cts +0 -39
- package/dist/copy-file-DjH2Ho5e.d.cts.map +0 -1
- package/dist/copy-file-Y1ilzocZ.cjs +0 -1
- package/dist/cwd-YTg9Cx6C.mjs +0 -2
- package/dist/cwd-YTg9Cx6C.mjs.map +0 -1
- package/dist/cwd-o2vq8Tk9.cjs +0 -1
- package/dist/exists-175EN367.d.mts +0 -18
- package/dist/exists-175EN367.d.mts.map +0 -1
- package/dist/exists-B31lSRFp.cjs +0 -1
- package/dist/exists-CVlDImzc.d.cts +0 -18
- package/dist/exists-CVlDImzc.d.cts.map +0 -1
- package/dist/exists-Ci-9lYmi.mjs +0 -2
- package/dist/exists-Ci-9lYmi.mjs.map +0 -1
- package/dist/file-D1uBqkpP.d.cts.map +0 -1
- package/dist/file-DauFFmfh.d.mts.map +0 -1
- package/dist/file-path-fns-7aKacdLg.cjs +0 -1
- package/dist/file-path-fns-BDzC2SIV.mjs +0 -2
- package/dist/file-path-fns-BDzC2SIV.mjs.map +0 -1
- package/dist/get-parent-path-COkh6Pvl.d.mts +0 -32
- package/dist/get-parent-path-COkh6Pvl.d.mts.map +0 -1
- package/dist/get-parent-path-Cbqs2km7.d.cts +0 -32
- package/dist/get-parent-path-Cbqs2km7.d.cts.map +0 -1
- package/dist/get-parent-path-CfRkaB4R.cjs +0 -1
- package/dist/get-parent-path-DLFSyxSW.mjs +0 -2
- package/dist/get-parent-path-DLFSyxSW.mjs.map +0 -1
- package/dist/get-workspace-root-CCNjjZGY.cjs +0 -1
- package/dist/get-workspace-root-DQBvBd8X.d.mts +0 -48
- package/dist/get-workspace-root-DQBvBd8X.d.mts.map +0 -1
- package/dist/get-workspace-root-eTfm1jII.d.cts +0 -48
- package/dist/get-workspace-root-eTfm1jII.d.cts.map +0 -1
- package/dist/get-workspace-root-k66w-wLW.mjs +0 -2
- package/dist/get-workspace-root-k66w-wLW.mjs.map +0 -1
- package/dist/helpers-BSEQb1fp.mjs +0 -2
- package/dist/helpers-BSEQb1fp.mjs.map +0 -1
- package/dist/helpers-CYWFZ-Uv.d.mts +0 -50
- package/dist/helpers-CYWFZ-Uv.d.mts.map +0 -1
- package/dist/helpers-CgMOExPa.d.cts +0 -50
- package/dist/helpers-CgMOExPa.d.cts.map +0 -1
- package/dist/helpers-_MJ6PR-g.cjs +0 -1
- package/dist/install-B3bIjHoU.mjs +0 -2
- package/dist/install-B3bIjHoU.mjs.map +0 -1
- package/dist/install-CZ_S7NHm.cjs +0 -1
- package/dist/install-CxPsLO2t.d.cts +0 -28
- package/dist/install-CxPsLO2t.d.cts.map +0 -1
- package/dist/install-dYt7hlQn.d.mts +0 -29
- package/dist/install-dYt7hlQn.d.mts.map +0 -1
- package/dist/is-error-CjEyTRps.cjs +0 -1
- package/dist/is-error-CjVXmD_8.mjs +0 -2
- package/dist/is-error-CjVXmD_8.mjs.map +0 -1
- package/dist/is-file-BkFQev3M.cjs +0 -1
- package/dist/is-file-CNooe8Wz.mjs +0 -2
- package/dist/is-file-CNooe8Wz.mjs.map +0 -1
- package/dist/is-file-DjqOQrqY.d.mts +0 -36
- package/dist/is-file-DjqOQrqY.d.mts.map +0 -1
- package/dist/is-file-DoBi2FN9.d.cts +0 -36
- package/dist/is-file-DoBi2FN9.d.cts.map +0 -1
- package/dist/is-object-FBXmvehR.cjs +0 -1
- package/dist/is-object-UsKYhyC5.mjs +0 -2
- package/dist/is-object-UsKYhyC5.mjs.map +0 -1
- package/dist/is-set-string-CLeu8BKX.cjs +0 -1
- package/dist/is-set-string-Cj0g4gsG.mjs +0 -2
- package/dist/is-set-string-Cj0g4gsG.mjs.map +0 -1
- package/dist/is-string-91Z3dOKQ.mjs +0 -2
- package/dist/is-string-91Z3dOKQ.mjs.map +0 -1
- package/dist/is-string-DKgNS0jA.cjs +0 -1
- package/dist/join-paths-BHepkhAj.mjs +0 -2
- package/dist/join-paths-BHepkhAj.mjs.map +0 -1
- package/dist/join-paths-DUdaieID.cjs +0 -1
- package/dist/json-CYenVxvr.d.cts +0 -83
- package/dist/json-CYenVxvr.d.cts.map +0 -1
- package/dist/json-DH7Q6Ftp.d.mts +0 -83
- package/dist/json-DH7Q6Ftp.d.mts.map +0 -1
- package/dist/json-DKhqPjHB.cjs +0 -6
- package/dist/json-Dp4PSH2i.mjs +0 -7
- package/dist/json-Dp4PSH2i.mjs.map +0 -1
- package/dist/list-files-Cn_UVruo.cjs +0 -1
- package/dist/list-files-D3dQOljX.d.cts +0 -51
- package/dist/list-files-D3dQOljX.d.cts.map +0 -1
- package/dist/list-files-D3iJzEQw.d.mts +0 -51
- package/dist/list-files-D3iJzEQw.d.mts.map +0 -1
- package/dist/list-files-D__uh3tQ.mjs +0 -2
- package/dist/list-files-D__uh3tQ.mjs.map +0 -1
- package/dist/package-fns-BNRi_Rpc.d.cts.map +0 -1
- package/dist/package-fns-C7-MKgBR.mjs +0 -2
- package/dist/package-fns-C7-MKgBR.mjs.map +0 -1
- package/dist/package-fns-CxokaGDY.d.mts.map +0 -1
- package/dist/package-fns-YTCdMAXr.cjs +0 -1
- package/dist/read-file-B091zB64.mjs +0 -2
- package/dist/read-file-B091zB64.mjs.map +0 -1
- package/dist/read-file-BB2WzW-N.cjs +0 -1
- package/dist/read-file-Bxn1VHKv.d.cts +0 -30
- package/dist/read-file-Bxn1VHKv.d.cts.map +0 -1
- package/dist/read-file-CRVW-wcE.d.mts +0 -30
- package/dist/read-file-CRVW-wcE.d.mts.map +0 -1
- package/dist/registry-B1taIPKm.mjs +0 -2
- package/dist/registry-B1taIPKm.mjs.map +0 -1
- package/dist/registry-BQ3JXRFA.d.mts +0 -53
- package/dist/registry-BQ3JXRFA.d.mts.map +0 -1
- package/dist/registry-BYwvM92u.cjs +0 -1
- package/dist/registry-C2A0Kau7.d.cts +0 -53
- package/dist/registry-C2A0Kau7.d.cts.map +0 -1
- package/dist/remove-file-BM64Brdf.mjs +0 -2
- package/dist/remove-file-BM64Brdf.mjs.map +0 -1
- package/dist/remove-file-BqlkL_Df.d.mts +0 -16
- package/dist/remove-file-BqlkL_Df.d.mts.map +0 -1
- package/dist/remove-file-XHFKELQN.cjs +0 -1
- package/dist/remove-file-lQOlxDwr.d.cts +0 -16
- package/dist/remove-file-lQOlxDwr.d.cts.map +0 -1
- package/dist/resolve-C_YsCFne.mjs +0 -4
- package/dist/resolve-C_YsCFne.mjs.map +0 -1
- package/dist/resolve-D66oIwjf.d.mts +0 -106
- package/dist/resolve-D66oIwjf.d.mts.map +0 -1
- package/dist/resolve-DTkLQekH.cjs +0 -3
- package/dist/resolve-DubH-8qd.d.cts +0 -106
- package/dist/resolve-DubH-8qd.d.cts.map +0 -1
- package/dist/resolve-parent-path-CR8av8WP.mjs +0 -2
- package/dist/resolve-parent-path-CR8av8WP.mjs.map +0 -1
- package/dist/resolve-parent-path-D0AaW2PB.cjs +0 -1
- package/dist/semver-fns-B0e5zB6C.d.mts +0 -92
- package/dist/semver-fns-B0e5zB6C.d.mts.map +0 -1
- package/dist/semver-fns-Btrm1dIF.cjs +0 -1
- package/dist/semver-fns-DjhZXnUw.d.cts +0 -92
- package/dist/semver-fns-DjhZXnUw.d.cts.map +0 -1
- package/dist/semver-fns-F_rYnwDq.mjs +0 -2
- package/dist/semver-fns-F_rYnwDq.mjs.map +0 -1
- package/dist/toml-CIgLQmP3.mjs +0 -4
- package/dist/toml-CIgLQmP3.mjs.map +0 -1
- package/dist/toml-D3X2QoaL.d.cts +0 -81
- package/dist/toml-D3X2QoaL.d.cts.map +0 -1
- package/dist/toml-DgVyNp_y.cjs +0 -3
- package/dist/toml-Djau1M6n.d.mts +0 -81
- package/dist/toml-Djau1M6n.d.mts.map +0 -1
- package/dist/tsconfig-B13IMV_0.d.mts.map +0 -1
- package/dist/tsconfig-B6WtgD1c.cjs +0 -1
- package/dist/tsconfig-C8ecu1-0.d.cts.map +0 -1
- package/dist/tsconfig-CqvvSVuX.mjs +0 -2
- package/dist/tsconfig-CqvvSVuX.mjs.map +0 -1
- package/dist/write-file-BmvbsmMj.d.cts +0 -35
- package/dist/write-file-BmvbsmMj.d.cts.map +0 -1
- package/dist/write-file-CFByoJkN.mjs +0 -2
- package/dist/write-file-CFByoJkN.mjs.map +0 -1
- package/dist/write-file-CWTzQpb2.d.mts +0 -35
- package/dist/write-file-CWTzQpb2.d.mts.map +0 -1
- package/dist/write-file-CqokudVp.cjs +0 -1
- package/dist/yaml-6uuLoSfT.d.cts +0 -23
- package/dist/yaml-6uuLoSfT.d.cts.map +0 -1
- package/dist/yaml-CLMo56UG.mjs +0 -2
- package/dist/yaml-CLMo56UG.mjs.map +0 -1
- package/dist/yaml-Ddslc5NK.d.mts +0 -23
- package/dist/yaml-Ddslc5NK.d.mts.map +0 -1
- package/dist/yaml-q2k-BjIM.cjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-file-CNooe8Wz.mjs","names":[],"sources":["../src/is-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 { joinPaths } from \"@stryke/path/join-paths\";\nimport { lstatSync, statSync } from \"node:fs\";\n\n/**\n * Check if the given path is a file.\n *\n * @param path - The location to check\n * @param additionalPath - An optional additional path to add to the start of the path\n * @returns An indicator specifying if the path is a file\n */\nexport function isFile(path: string, additionalPath?: string): boolean {\n return Boolean(\n statSync(additionalPath ? joinPaths(additionalPath, path) : path, {\n throwIfNoEntry: false\n })?.isFile()\n );\n}\n\n/**\n * Check if the given path is a directory.\n *\n * @param path - The location to check\n * @param additionalPath - An optional additional path to add to the start of the path\n * @returns An indicator specifying if the path is a directory\n */\nexport function isDirectory(path: string, additionalPath?: string): boolean {\n return Boolean(\n statSync(additionalPath ? joinPaths(additionalPath, path) : path, {\n throwIfNoEntry: false\n })?.isDirectory()\n );\n}\n\n/**\n * Check if the given path is a file . Does not dereference symbolic links.\n *\n * @param path - The location to check\n * @param additionalPath - An optional additional path to add to the start of the path\n * @returns An indicator specifying if the path is a file\n */\nexport const isFileSymlink = (\n path: string,\n additionalPath?: string\n): boolean => {\n return Boolean(\n lstatSync(additionalPath ? joinPaths(additionalPath, path) : path, {\n throwIfNoEntry: false\n })?.isFile()\n );\n};\n\n/**\n * Check if the given path is a directory. Does not dereference symbolic links.\n *\n * @param path - The location to check\n * @param additionalPath - An optional additional path to add to the start of the path\n * @returns An indicator specifying if the path is a directory\n */\nexport const isDirectorySymlink = (\n path: string,\n additionalPath?: string\n): boolean => {\n return Boolean(\n lstatSync(additionalPath ? joinPaths(additionalPath, path) : path, {\n throwIfNoEntry: false\n })?.isDirectory()\n );\n};\n"],"mappings":"gGA4BA,SAAgB,EAAO,EAAc,EAAkC,CACrE,MAAO,EACL,EAAS,EAAiB,EAAU,EAAgB,EAAK,CAAG,EAAM,CAChE,eAAgB,GACjB,CAAC,EAAE,QAAQ,CAWhB,SAAgB,EAAY,EAAc,EAAkC,CAC1E,MAAO,EACL,EAAS,EAAiB,EAAU,EAAgB,EAAK,CAAG,EAAM,CAChE,eAAgB,GACjB,CAAC,EAAE,aAAa,CAWrB,MAAa,GACX,EACA,IAEO,EACL,EAAU,EAAiB,EAAU,EAAgB,EAAK,CAAG,EAAM,CACjE,eAAgB,GACjB,CAAC,EAAE,QAAQ,CAWH,GACX,EACA,IAEO,EACL,EAAU,EAAiB,EAAU,EAAgB,EAAK,CAAG,EAAM,CACjE,eAAgB,GACjB,CAAC,EAAE,aAAa"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
//#region src/is-file.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Check if the given path is a file.
|
|
4
|
-
*
|
|
5
|
-
* @param path - The location to check
|
|
6
|
-
* @param additionalPath - An optional additional path to add to the start of the path
|
|
7
|
-
* @returns An indicator specifying if the path is a file
|
|
8
|
-
*/
|
|
9
|
-
declare function isFile(path: string, additionalPath?: string): boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Check if the given path is a directory.
|
|
12
|
-
*
|
|
13
|
-
* @param path - The location to check
|
|
14
|
-
* @param additionalPath - An optional additional path to add to the start of the path
|
|
15
|
-
* @returns An indicator specifying if the path is a directory
|
|
16
|
-
*/
|
|
17
|
-
declare function isDirectory(path: string, additionalPath?: string): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Check if the given path is a file . Does not dereference symbolic links.
|
|
20
|
-
*
|
|
21
|
-
* @param path - The location to check
|
|
22
|
-
* @param additionalPath - An optional additional path to add to the start of the path
|
|
23
|
-
* @returns An indicator specifying if the path is a file
|
|
24
|
-
*/
|
|
25
|
-
declare const isFileSymlink: (path: string, additionalPath?: string) => boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Check if the given path is a directory. Does not dereference symbolic links.
|
|
28
|
-
*
|
|
29
|
-
* @param path - The location to check
|
|
30
|
-
* @param additionalPath - An optional additional path to add to the start of the path
|
|
31
|
-
* @returns An indicator specifying if the path is a directory
|
|
32
|
-
*/
|
|
33
|
-
declare const isDirectorySymlink: (path: string, additionalPath?: string) => boolean;
|
|
34
|
-
//#endregion
|
|
35
|
-
export { isFileSymlink as i, isDirectorySymlink as n, isFile as r, isDirectory as t };
|
|
36
|
-
//# sourceMappingURL=is-file-DjqOQrqY.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-file-DjqOQrqY.d.mts","names":[],"sources":["../src/is-file.ts"],"sourcesContent":[],"mappings":";;AA4BA;AAeA;AAeA;AAkBA;;;iBAhDgB,MAAA;;;;;;;;iBAeA,WAAA;;;;;;;;cAeH;;;;;;;;cAkBA"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
//#region src/is-file.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Check if the given path is a file.
|
|
4
|
-
*
|
|
5
|
-
* @param path - The location to check
|
|
6
|
-
* @param additionalPath - An optional additional path to add to the start of the path
|
|
7
|
-
* @returns An indicator specifying if the path is a file
|
|
8
|
-
*/
|
|
9
|
-
declare function isFile(path: string, additionalPath?: string): boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Check if the given path is a directory.
|
|
12
|
-
*
|
|
13
|
-
* @param path - The location to check
|
|
14
|
-
* @param additionalPath - An optional additional path to add to the start of the path
|
|
15
|
-
* @returns An indicator specifying if the path is a directory
|
|
16
|
-
*/
|
|
17
|
-
declare function isDirectory(path: string, additionalPath?: string): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Check if the given path is a file . Does not dereference symbolic links.
|
|
20
|
-
*
|
|
21
|
-
* @param path - The location to check
|
|
22
|
-
* @param additionalPath - An optional additional path to add to the start of the path
|
|
23
|
-
* @returns An indicator specifying if the path is a file
|
|
24
|
-
*/
|
|
25
|
-
declare const isFileSymlink: (path: string, additionalPath?: string) => boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Check if the given path is a directory. Does not dereference symbolic links.
|
|
28
|
-
*
|
|
29
|
-
* @param path - The location to check
|
|
30
|
-
* @param additionalPath - An optional additional path to add to the start of the path
|
|
31
|
-
* @returns An indicator specifying if the path is a directory
|
|
32
|
-
*/
|
|
33
|
-
declare const isDirectorySymlink: (path: string, additionalPath?: string) => boolean;
|
|
34
|
-
//#endregion
|
|
35
|
-
export { isFileSymlink as i, isDirectorySymlink as n, isFile as r, isDirectory as t };
|
|
36
|
-
//# sourceMappingURL=is-file-DoBi2FN9.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-file-DoBi2FN9.d.cts","names":[],"sources":["../src/is-file.ts"],"sourcesContent":[],"mappings":";;AA4BA;AAeA;AAeA;AAkBA;;;iBAhDgB,MAAA;;;;;;;;iBAeA,WAAA;;;;;;;;cAeH;;;;;;;;cAkBA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./is-string-DKgNS0jA.cjs`),t=e=>typeof e==`object`&&!!e,n=n=>{if(!t(n)||e.n(n)!==`[object Object]`)return!1;if(Object.getPrototypeOf(n)===null)return!0;let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r},r=e=>{try{return typeof e==`object`||!!e&&e?.constructor===Object||n(e)}catch{return!1}};Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./is-string-91Z3dOKQ.mjs";const t=e=>typeof e==`object`&&!!e,n=n=>{if(!t(n)||e(n)!==`[object Object]`)return!1;if(Object.getPrototypeOf(n)===null)return!0;let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r},r=e=>{try{return typeof e==`object`||!!e&&e?.constructor===Object||n(e)}catch{return!1}};export{n,r as t};
|
|
2
|
-
//# sourceMappingURL=is-object-UsKYhyC5.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-object-UsKYhyC5.mjs","names":[],"sources":["../../type-checks/src/is-plain-object.ts","../../type-checks/src/is-object.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 type { PlainObject } from \"@stryke/types/base\";\nimport { getObjectTag } from \"./get-object-tag\";\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @example\n * ```typescript\n * isObjectLike({})\n * // => true\n *\n * isObjectLike([1, 2, 3])\n * // => true\n *\n * isObjectLike(Function)\n * // => false\n *\n * isObjectLike(null)\n * // => false\n * ```\n *\n * @param value - The value to check.\n * @returns Returns `true` if `value` is object-like, else `false`.\n */\nexport const isObjectLike = (obj: unknown) => {\n return typeof obj === \"object\" && obj !== null;\n};\n\n/**\n * Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @example\n * ```typescript\n * function Foo() {\n * this.a = 1\n * }\n *\n * isPlainObject(new Foo)\n * // => false\n *\n * isPlainObject([1, 2, 3])\n * // => false\n *\n * isPlainObject({ 'x': 0, 'y': 0 })\n * // => true\n *\n * isPlainObject(Object.create(null))\n * // => true\n * ```\n *\n * @param obj - The value to check.\n * @returns Returns `true` if `obj` is a plain object, else `false`.\n */\nexport const isPlainObject = (obj: unknown): obj is PlainObject => {\n if (!isObjectLike(obj) || getObjectTag(obj) !== \"[object Object]\") {\n return false;\n }\n if (Object.getPrototypeOf(obj) === null) {\n return true;\n }\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto;\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\n/* eslint-disable ts/no-unsafe-function-type */\n/* eslint-disable ts/no-unsafe-call */\n\nimport type { NativeClass } from \"@stryke/types/base\";\nimport { isPlainObject } from \"./is-plain-object\";\n\n// Prepare\nconst isClassRegex = /^class\\s|^function\\s+[A-Z]/;\nconst isConventionalClassRegex = /^function\\s+[A-Z]/;\nconst isNativeClassRegex = /^class\\s/;\n\n/** Is ES6+ class */\nexport function isNativeClass(value?: any): value is NativeClass {\n // NOTE TO DEVELOPER: If any of this changes, isClass must also be updated\n return (\n typeof value === \"function\" && isNativeClassRegex.test(value.toString())\n );\n}\n\n/**\n * Check if the provided value's type is a conventional class\n *\n * @remarks\n * Is Conventional Class\n * Looks for function with capital first letter MyClass\n * First letter is the 9th character\n * If changed, isClass must also be updated\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is a conventional class\n */\nexport function isConventionalClass(value?: any): value is Function {\n return (\n typeof value === \"function\" &&\n isConventionalClassRegex.test(value.toString())\n );\n}\n\n/**\n * Check if the provided value's type is `Object`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object`\n */\nexport function isClass(value?: any): value is Function | NativeClass; // only guarantee of truth type, not of validity\nexport function isClass(value?: any): boolean {\n return typeof value === \"function\" && isClassRegex.test(value.toString());\n}\n\n/**\n * Check if the provided value's type is `Object`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Object`\n */\nexport const isObject = (value: unknown): value is object => {\n try {\n return (\n typeof value === \"object\" ||\n (Boolean(value) && value?.constructor === Object) ||\n isPlainObject(value)\n );\n } catch {\n return false;\n }\n};\n"],"mappings":"6CA2CA,MAAa,EAAgB,GACpB,OAAO,GAAQ,YAAY,EA4BvB,EAAiB,GAAqC,CACjE,GAAI,CAAC,EAAa,EAAI,EAAI,EAAa,EAAI,GAAK,kBAC9C,MAAO,GAET,GAAI,OAAO,eAAe,EAAI,GAAK,KACjC,MAAO,GAET,IAAI,EAAQ,EACZ,KAAO,OAAO,eAAe,EAAM,GAAK,MACtC,EAAQ,OAAO,eAAe,EAAM,CAEtC,OAAO,OAAO,eAAe,EAAI,GAAK,GCV3B,EAAY,GAAoC,CAC3D,GAAI,CACF,OACE,OAAO,GAAU,UAChB,EAAQ,GAAU,GAAO,cAAgB,QAC1C,EAAc,EAAM,MAEhB,CACN,MAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./is-string-DKgNS0jA.cjs`),t=e=>{try{return e===null}catch{return!1}},n=e=>{try{return e instanceof Number||typeof e==`number`||Number(e)===e}catch{return!1}},r=e=>e===void 0,i=e=>{try{return r(e)||t(e)}catch{return!1}},a=e=>{try{return!i(e)}catch{return!1}},o=t=>{try{return a(t)&&e.t(t)&&t.length>0}catch{return!1}};Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./is-string-91Z3dOKQ.mjs";const t=e=>{try{return e===null}catch{return!1}},n=e=>{try{return e instanceof Number||typeof e==`number`||Number(e)===e}catch{return!1}},r=e=>e===void 0,i=e=>{try{return r(e)||t(e)}catch{return!1}},a=e=>{try{return!i(e)}catch{return!1}},o=t=>{try{return a(t)&&e(t)&&t.length>0}catch{return!1}};export{r as n,n as r,o as t};
|
|
2
|
-
//# sourceMappingURL=is-set-string-Cj0g4gsG.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-set-string-Cj0g4gsG.mjs","names":[],"sources":["../../type-checks/src/is-null.ts","../../type-checks/src/is-number.ts","../../type-checks/src/is-undefined.ts","../../type-checks/src/is-empty.ts","../../type-checks/src/is-set.ts","../../type-checks/src/is-set-string.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 isNull = (value: unknown): value is null => {\n try {\n return value === null;\n } catch {\n return false;\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 type { AnyNumber } from \"@stryke/types/base\";\nimport { getObjectTag } from \"./get-object-tag\";\n\n/**\n * Check if the provided value's type is `number`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `number`\n */\nexport const isNumber = (value: unknown): value is number => {\n try {\n return (\n value instanceof Number ||\n typeof value === \"number\" ||\n Number(value) === value\n );\n } catch {\n return false;\n }\n};\n\n/**\n * Check if the provided value's type is `AnyNumber`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `AnyNumber`\n */\nexport function isAnyNumber(value?: any): value is AnyNumber {\n return isNumber(value) || getObjectTag(value) === \"[object Number]\";\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\nexport const isUndefined = (value: unknown): value is undefined => {\n return value === undefined;\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 { isDate } from \"./is-date\";\nimport { isFunction } from \"./is-function\";\nimport { isNull } from \"./is-null\";\nimport { isNumber } from \"./is-number\";\nimport { isSymbol } from \"./is-symbol\";\nimport { isUndefined } from \"./is-undefined\";\n\n/**\n * Check if the provided value's type is `null` or `undefined`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `null` or `undefined`\n */\nexport const isEmpty = (value: unknown) => {\n try {\n return isUndefined(value) || isNull(value);\n } catch {\n return false;\n }\n};\n\nexport const isEmptyAnything = (value: any) => {\n if (value === true || value === false) return true;\n if (value === null || value === undefined) return true;\n if (isNumber(value)) return value === 0;\n if (isDate(value)) return Number.isNaN(value.getTime());\n if (isFunction(value)) return false;\n if (isSymbol(value)) return false;\n const { length } = value;\n if (isNumber(length)) return length === 0;\n const { size } = value;\n if (isNumber(size)) return size === 0;\n const keys = Object.keys(value).length;\n\n return keys === 0;\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 { isEmpty } from \"./is-empty\";\n\n/**\n * The inverse of the `isEmpty` function\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`\n */\nexport const isSet = (value: unknown): value is NonNullable<unknown> => {\n try {\n return !isEmpty(value);\n } catch {\n return false;\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 { isSet } from \"./is-set\";\nimport { isString } from \"./is-string\";\n\n/**\n * Determine if the type is string and is not empty (length greater than zero)\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `string` and length greater than zero\n */\nexport const isSetString = (value: unknown): value is NonNullable<string> => {\n try {\n return isSet(value) && isString(value) && value.length > 0;\n } catch {\n return false;\n }\n};\n"],"mappings":"6CAkBA,MAAa,EAAU,GAAkC,CACvD,GAAI,CACF,OAAO,IAAU,UACX,CACN,MAAO,KCKE,EAAY,GAAoC,CAC3D,GAAI,CACF,OACE,aAAiB,QACjB,OAAO,GAAU,UACjB,OAAO,EAAM,GAAK,OAEd,CACN,MAAO,KCjBE,EAAe,GACnB,IAAU,IAAA,GCYN,EAAW,GAAmB,CACzC,GAAI,CACF,OAAO,EAAY,EAAM,EAAI,EAAO,EAAM,MACpC,CACN,MAAO,KCTE,EAAS,GAAkD,CACtE,GAAI,CACF,MAAO,CAAC,EAAQ,EAAM,MAChB,CACN,MAAO,KCHE,EAAe,GAAiD,CAC3E,GAAI,CACF,OAAO,EAAM,EAAM,EAAI,EAAS,EAAM,EAAI,EAAM,OAAS,OACnD,CACN,MAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-string-91Z3dOKQ.mjs","names":[],"sources":["../../type-checks/src/get-object-tag.ts","../../type-checks/src/is-string.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 * Gets the `toStringTag` of `obj`.\n *\n * @param value - The obj to query.\n * @returns Returns the `toStringTag`.\n */\nexport const getObjectTag = (value: unknown): string => {\n if (value == null) {\n return value === undefined ? \"[object Undefined]\" : \"[object Null]\";\n }\n return Object.prototype.toString.call(value);\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\nexport const isString = (value: unknown): value is string => {\n try {\n return typeof value === \"string\";\n } catch {\n return false;\n }\n};\n"],"mappings":"AAwBA,MAAa,EAAgB,GACvB,GAAS,KACJ,IAAU,IAAA,GAAY,qBAAuB,gBAE/C,OAAO,UAAU,SAAS,KAAK,EAAM,CCVjC,EAAY,GAAoC,CAC3D,GAAI,CACF,OAAO,OAAO,GAAU,cAClB,CACN,MAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=e=>e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e),t=e=>{try{return typeof e==`string`}catch{return!1}};Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
|
|
@@ -1,2 +0,0 @@
|
|
|
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-]+$/;function s(e){return r.test(d(e))}function c(e){return s(e)}function l(e){return o.test(d(e))}function u(e){return l(e)}function d(e){return e.startsWith(`\\\\?\\`)?e:e.replace(/\\/g,`/`)}function f(t=``){return t&&t.replace(/\\/g,`/`).replace(e,e=>e.toUpperCase())}function p(e){if(!e||e.length===0)return`.`;e=f(e);let r=e.match(n),i=c(e),a=e[e.length-1]===`/`;return e=h(e,!i),e.length===0?i?`/`:a?`./`:`.`:(a&&(e+=`/`),t.test(e)&&(e+=`/`),r?i?`//${e}`:`//./${e}`:i&&!c(e)?`/${e}`:e)}function m(...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 p(t)}function h(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{u as a,a as c,s as i,i as l,d as n,t as o,c as r,e as s,m as t,n as u};
|
|
2
|
-
//# sourceMappingURL=join-paths-BHepkhAj.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"join-paths-BHepkhAj.mjs","names":["char: string | null"],"sources":["../../path/src/regex.ts","../../path/src/is-type.ts","../../path/src/slash.ts","../../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\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","/* -------------------------------------------------------------------\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","/* -------------------------------------------------------------------\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","/* -------------------------------------------------------------------\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":"AAkBA,MAAa,EAA2B,aAC3B,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/\.[0-9a-z]+$/i,o=/^(?:@[\w-]+\/)?[\w-]+$/;function s(e){return r.test(d(e))}function c(e){return s(e)}function l(e){return o.test(d(e))}function u(e){return l(e)}function d(e){return e.startsWith(`\\\\?\\`)?e:e.replace(/\\/g,`/`)}function f(t=``){return t&&t.replace(/\\/g,`/`).replace(e,e=>e.toUpperCase())}function p(e){if(!e||e.length===0)return`.`;e=f(e);let r=e.match(n),i=c(e),a=e[e.length-1]===`/`;return e=h(e,!i),e.length===0?i?`/`:a?`./`:`.`:(a&&(e+=`/`),t.test(e)&&(e+=`/`),r?i?`//${e}`:`//./${e}`:i&&!c(e)?`/${e}`:e)}function m(...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 p(t)}function h(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}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return n}});
|
package/dist/json-CYenVxvr.d.cts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { ParseOptions } from "jsonc-parser";
|
|
2
|
-
|
|
3
|
-
//#region ../json/src/types.d.ts
|
|
4
|
-
|
|
5
|
-
interface JsonParseOptions extends ParseOptions {
|
|
6
|
-
/**
|
|
7
|
-
* Expect JSON with javascript-style
|
|
8
|
-
*
|
|
9
|
-
* @defaultValue false
|
|
10
|
-
*/
|
|
11
|
-
expectComments?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Disallow javascript-style
|
|
14
|
-
*
|
|
15
|
-
* @defaultValue false
|
|
16
|
-
*/
|
|
17
|
-
disallowComments?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Allow trailing commas in the JSON content
|
|
20
|
-
*/
|
|
21
|
-
allowTrailingComma?: boolean;
|
|
22
|
-
}
|
|
23
|
-
interface JsonSerializeOptions {
|
|
24
|
-
/**
|
|
25
|
-
* the whitespaces to add as indentation to make the output more readable.
|
|
26
|
-
*
|
|
27
|
-
* @defaultValue 2
|
|
28
|
-
*/
|
|
29
|
-
spaces?: number;
|
|
30
|
-
}
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region src/json.d.ts
|
|
33
|
-
interface JsonReadOptions extends JsonParseOptions {
|
|
34
|
-
/**
|
|
35
|
-
* mutable field recording whether JSON ends with new line
|
|
36
|
-
*
|
|
37
|
-
* @defaultValue false
|
|
38
|
-
*/
|
|
39
|
-
endsWithNewline?: boolean;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Reads a JSON file and returns the object the JSON content represents.
|
|
43
|
-
*
|
|
44
|
-
* @param path - A path to a file.
|
|
45
|
-
* @param options - JSON parse options
|
|
46
|
-
* @returns Object the JSON content of the file represents
|
|
47
|
-
*/
|
|
48
|
-
declare function readJsonFileSync<T extends object = any>(path: string, options?: JsonReadOptions): T;
|
|
49
|
-
/**
|
|
50
|
-
* Reads a JSON file and returns the object the JSON content represents.
|
|
51
|
-
*
|
|
52
|
-
* @param path - A path to a file.
|
|
53
|
-
* @param options - JSON parse options
|
|
54
|
-
* @returns Object the JSON content of the file represents
|
|
55
|
-
*/
|
|
56
|
-
declare function readJsonFile<T extends object = any>(path: string, options?: JsonReadOptions): Promise<T>;
|
|
57
|
-
interface JsonWriteOptions extends JsonSerializeOptions {
|
|
58
|
-
/**
|
|
59
|
-
* whether to append new line at the end of JSON file
|
|
60
|
-
*
|
|
61
|
-
* @defaultValue false
|
|
62
|
-
*/
|
|
63
|
-
appendNewLine?: boolean;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Serializes the given data to JSON and writes it to a file.
|
|
67
|
-
*
|
|
68
|
-
* @param path - A path to a file.
|
|
69
|
-
* @param data - data which should be serialized to JSON and written to the file
|
|
70
|
-
* @param options - JSON serialize options
|
|
71
|
-
*/
|
|
72
|
-
declare function writeJsonFileSync<T extends object = object>(path: string, data: T, options?: JsonWriteOptions): void;
|
|
73
|
-
/**
|
|
74
|
-
* Serializes the given data to JSON and writes it to a file asynchronously.
|
|
75
|
-
*
|
|
76
|
-
* @param path - A path to a file.
|
|
77
|
-
* @param data - data which should be serialized to JSON and written to the file
|
|
78
|
-
* @param options - JSON serialize options
|
|
79
|
-
*/
|
|
80
|
-
declare function writeJsonFile<T extends object = object>(path: string, data: T, options?: JsonWriteOptions): Promise<void>;
|
|
81
|
-
//#endregion
|
|
82
|
-
export { writeJsonFile as a, readJsonFileSync as i, JsonWriteOptions as n, writeJsonFileSync as o, readJsonFile as r, JsonReadOptions as t };
|
|
83
|
-
//# sourceMappingURL=json-CYenVxvr.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-CYenVxvr.d.cts","names":[],"sources":["../../json/src/types.ts","../src/json.ts"],"sourcesContent":[],"mappings":";;;;UAsEiB,gBAAA,SAAyB;;;;;;;;;;;;;;;;;;UAqBzB,oBAAA;;;;;;;;;;UChEA,eAAA,SAAwB;;AD2CzC;AAqBA;;;;AChEA;AAgBA;AA4BA;;;;;AAqBA;AAgBgB,iBAjEA,gBAoEJ,CAAA,UAAA,MAAgB,GAAA,GAAA,CAAA,CAAA,IAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAlEhB,eAkEgB,CAAA,EAjEzB,CAiEyB;AAiB5B;;;;;;;iBAzDsB,6DAEV,kBACT,QAAQ;UAkBM,gBAAA,SAAyB;;;;;;;;;;;;;;;iBAgB1B,iEAER,aACI;;;;;;;;iBAiBU,6DAEd,aACI,mBACT"}
|
package/dist/json-DH7Q6Ftp.d.mts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { ParseOptions } from "jsonc-parser";
|
|
2
|
-
|
|
3
|
-
//#region ../json/src/types.d.ts
|
|
4
|
-
|
|
5
|
-
interface JsonParseOptions extends ParseOptions {
|
|
6
|
-
/**
|
|
7
|
-
* Expect JSON with javascript-style
|
|
8
|
-
*
|
|
9
|
-
* @defaultValue false
|
|
10
|
-
*/
|
|
11
|
-
expectComments?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Disallow javascript-style
|
|
14
|
-
*
|
|
15
|
-
* @defaultValue false
|
|
16
|
-
*/
|
|
17
|
-
disallowComments?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Allow trailing commas in the JSON content
|
|
20
|
-
*/
|
|
21
|
-
allowTrailingComma?: boolean;
|
|
22
|
-
}
|
|
23
|
-
interface JsonSerializeOptions {
|
|
24
|
-
/**
|
|
25
|
-
* the whitespaces to add as indentation to make the output more readable.
|
|
26
|
-
*
|
|
27
|
-
* @defaultValue 2
|
|
28
|
-
*/
|
|
29
|
-
spaces?: number;
|
|
30
|
-
}
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region src/json.d.ts
|
|
33
|
-
interface JsonReadOptions extends JsonParseOptions {
|
|
34
|
-
/**
|
|
35
|
-
* mutable field recording whether JSON ends with new line
|
|
36
|
-
*
|
|
37
|
-
* @defaultValue false
|
|
38
|
-
*/
|
|
39
|
-
endsWithNewline?: boolean;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Reads a JSON file and returns the object the JSON content represents.
|
|
43
|
-
*
|
|
44
|
-
* @param path - A path to a file.
|
|
45
|
-
* @param options - JSON parse options
|
|
46
|
-
* @returns Object the JSON content of the file represents
|
|
47
|
-
*/
|
|
48
|
-
declare function readJsonFileSync<T extends object = any>(path: string, options?: JsonReadOptions): T;
|
|
49
|
-
/**
|
|
50
|
-
* Reads a JSON file and returns the object the JSON content represents.
|
|
51
|
-
*
|
|
52
|
-
* @param path - A path to a file.
|
|
53
|
-
* @param options - JSON parse options
|
|
54
|
-
* @returns Object the JSON content of the file represents
|
|
55
|
-
*/
|
|
56
|
-
declare function readJsonFile<T extends object = any>(path: string, options?: JsonReadOptions): Promise<T>;
|
|
57
|
-
interface JsonWriteOptions extends JsonSerializeOptions {
|
|
58
|
-
/**
|
|
59
|
-
* whether to append new line at the end of JSON file
|
|
60
|
-
*
|
|
61
|
-
* @defaultValue false
|
|
62
|
-
*/
|
|
63
|
-
appendNewLine?: boolean;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Serializes the given data to JSON and writes it to a file.
|
|
67
|
-
*
|
|
68
|
-
* @param path - A path to a file.
|
|
69
|
-
* @param data - data which should be serialized to JSON and written to the file
|
|
70
|
-
* @param options - JSON serialize options
|
|
71
|
-
*/
|
|
72
|
-
declare function writeJsonFileSync<T extends object = object>(path: string, data: T, options?: JsonWriteOptions): void;
|
|
73
|
-
/**
|
|
74
|
-
* Serializes the given data to JSON and writes it to a file asynchronously.
|
|
75
|
-
*
|
|
76
|
-
* @param path - A path to a file.
|
|
77
|
-
* @param data - data which should be serialized to JSON and written to the file
|
|
78
|
-
* @param options - JSON serialize options
|
|
79
|
-
*/
|
|
80
|
-
declare function writeJsonFile<T extends object = object>(path: string, data: T, options?: JsonWriteOptions): Promise<void>;
|
|
81
|
-
//#endregion
|
|
82
|
-
export { writeJsonFile as a, readJsonFileSync as i, JsonWriteOptions as n, writeJsonFileSync as o, readJsonFile as r, JsonReadOptions as t };
|
|
83
|
-
//# sourceMappingURL=json-DH7Q6Ftp.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-DH7Q6Ftp.d.mts","names":[],"sources":["../../json/src/types.ts","../src/json.ts"],"sourcesContent":[],"mappings":";;;;UAsEiB,gBAAA,SAAyB;;;;;;;;;;;;;;;;;;UAqBzB,oBAAA;;;;;;;;;;UChEA,eAAA,SAAwB;;AD2CzC;AAqBA;;;;AChEA;AAgBA;AA4BA;;;;;AAqBA;AAgBgB,iBAjEA,gBAoEJ,CAAA,UAAA,MAAgB,GAAA,GAAA,CAAA,CAAA,IAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAlEhB,eAkEgB,CAAA,EAjEzB,CAiEyB;AAiB5B;;;;;;;iBAzDsB,6DAEV,kBACT,QAAQ;UAkBM,gBAAA,SAAyB;;;;;;;;;;;;;;;iBAgB1B,iEAER,aACI;;;;;;;;iBAiBU,6DAEd,aACI,mBACT"}
|
package/dist/json-DKhqPjHB.cjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./file-path-fns-7aKacdLg.cjs`),n=require(`./is-string-DKgNS0jA.cjs`),r=require(`./is-object-FBXmvehR.cjs`),i=require(`./is-set-string-CLeu8BKX.cjs`),a=require(`./is-error-CjEyTRps.cjs`),o=require(`./read-file-BB2WzW-N.cjs`),s=require(`./write-file-CqokudVp.cjs`);let c=require(`node:buffer`),l=require(`jsonc-parser`),u=require(`superjson`);u=e.t(u);let d=require(`lines-and-columns`);const f=Symbol(`singleComment`),p=Symbol(`multiComment`);function m(){return``}function h(e,t,n){return e.slice(t,n).replace(/\S/g,` `)}function g(e,t){let n=t-1,r=0;for(;e[n]===`\\`;)--n,r+=1;return!!(r%2)}function _(e,{whitespace:n=!0,trailingCommas:r=!1}={}){if(typeof e!=`string`)throw TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof e}\``);let i=n?h:m,a=!1,o=!1,s=0,c=``,l=``,u=-1;for(let n=0;n<e.length;n++){let d=e[n],m=e[n+1];!o&&d===`"`&&(g(e,n)||(a=!a)),!a&&(!o&&d+(m??t.s)===`//`?(c+=e.slice(s,n),s=n,o=f,n++):o===f&&d+(m??t.s)===`\r
|
|
2
|
-
`?(n++,o=!1,c+=i(e,s,n),s=n):o===f&&d===`
|
|
3
|
-
`?(o=!1,c+=i(e,s,n),s=n):!o&&d+(m??t.s)===`/*`?(c+=e.slice(s,n),s=n,o=p,n++):o===p&&d+(m??t.s)===`*/`?(n++,o=!1,c+=i(e,s,n+1),s=n+1):r&&!o&&(u===-1?d===`,`&&(l+=c+e.slice(s,n),c=``,s=n,u=n):d===`}`||d===`]`?(c+=e.slice(s,n),l+=i(c,0,1)+c.slice(1),c=``,s=n,u=-1):d!==` `&&d!==` `&&d!==`\r`&&d!==`
|
|
4
|
-
`&&(c+=e.slice(s,n),s=n,u=-1)))}return l+c+(o?i(e.slice(s)):e.slice(s))}const v=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,y=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,b=/^\s*["[{]|^\s*-?\d{1,16}(?:\.\d{1,17})?(?:E[+-]?\d+)?\s*$/i;function x(e,t){if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){console.warn(`Dropping "${e}" key to prevent prototype pollution.`);return}return t}function S(e,t={}){if(typeof e!=`string`)return e;let n=_(e);if(n[0]===`"`&&n[n.length-1]===`"`&&!n.includes(`\\`))return n.slice(1,-1);if(n=n.trim(),n.length<=9)switch(n.toLowerCase()){case`true`:return!0;case`false`:return!1;case`undefined`:return;case`null`:return null;case`nan`:return NaN;case`infinity`:return 1/0;case`-infinity`:return-1/0}if(!b.test(n)){if(t.strict)throw Error(`Invalid JSON`);return n}try{if(v.test(n)||y.test(n)){if(t.strict)throw Error(`Possible prototype pollution`);return JSON.parse(n,x)}return JSON.parse(n)}catch(n){if(t.strict)throw n;return e}}const C=/\r\n|[\n\r\u2028\u2029]/;function w(e,t,n={}){let r={column:0,line:-1,...e.start},i={...r,...e.end},{linesAbove:a=2,linesBelow:o=3}=n||{},s=r.line,c=r.column,l=i.line,u=i.column,d=Math.max(s-(a+1),0),f=Math.min(t.length,l+o);s===-1&&(d=0),l===-1&&(f=t.length);let p=l-s,m={};if(p)for(let e=0;e<=p;e++){let n=e+s;c?e===0?m[n]=[c,(t[n-1]?.length??0)-c+1]:e===p?m[n]=[0,u]:m[n]=[0,t[n-e]?.length??0]:m[n]=!0}else c===u?m[s]=c?[c,0]:!0:m[s]=[c,u-c];return{start:d,end:f,markerLines:m}}function T(e,t,n={}){let{start:r,end:i,markerLines:a}=w(t,e.split(C),n),o=String(i).length;return(n.highlight?n.highlight(e):e).split(C).slice(r,i).map((e,t)=>{let n=r+1+t,i=` ${` ${n}`.slice(-o)} | `,s=!!(a[n]??!1);if(s){let t=``;if(Array.isArray(s)){let n=e.slice(0,Math.max(s[0]-1,0)).replace(/[^\t]/g,` `),r=s[1]||1;t=[`
|
|
5
|
-
`,i.replace(/\d/g,` `),n,`^`.repeat(r)].join(``)}return[`>`,i,e,t].join(``)}return` ${i}${e}`}).join(`
|
|
6
|
-
`)}function E(e,t){let{error:n,offset:r,length:i}=t,a=new d.LinesAndColumns(e).locationForIndex(r),o=a?.line??0,s=a?.column??0;return o++,s++,`${(0,l.printParseErrorCode)(n)} in JSON at ${o}:${s}\n${T(e,{start:{line:o,column:s},end:{line:o,column:s+i}})}\n`}const D=`@/#$ :;,.!?&=+-*%^~|\\"'\`{}[]()<>`.split(``),O=(e,t=2)=>{let n=i.r(t)?` `.repeat(t):t;switch(e){case null:return`null`;case void 0:return`"undefined"`;case!0:return`true`;case!1:return`false`;case 1/0:return`infinity`;case-1/0:return`-infinity`}if(Array.isArray(e))return`[${n}${e.map(e=>O(e,n)).join(`,${n}`)}${n}]`;if(e instanceof Uint8Array)return e.toString();switch(typeof e){case`number`:return`${e}`;case`string`:return JSON.stringify(e);case`object`:return`{${n}${Object.keys(e).filter(t=>!i.n(e[t])).map(t=>`${D.some(e=>t.includes(e))?`"${t}"`:t}: ${n}${O(e[t],n)}`).join(`,${n}`)}${n}}`;default:return`null`}};var k=class e extends u.default{static#e;static get instance(){return e.#e||=new e,e.#e}static deserialize(t){return e.instance.deserialize(t)}static serialize(t){return e.instance.serialize(t)}static parse(e){return S(e)}static stringify(t,n){let r=e.instance.customTransformerRegistry.findApplicable(t),i=t;return r&&r.isApplicable(t)&&(i=r.serialize(i)),O(i)}static parseJson(t,n){try{if(n?.expectComments===!1)return e.instance.parse(t)}catch{}let r=[],i=(0,l.parse)(t,r,{allowTrailingComma:!0,...n});if(r.length>0&&r[0])throw Error(E(t,r[0]));return i}static register(t,n,r,i){e.instance.registerCustom({isApplicable:i,serialize:n,deserialize:r},t)}static registerClass(t,i){e.instance.registerClass(t,{identifier:n.t(i)?i:i?.identifier||t.name,allowProps:i&&r.t(i)&&i?.allowProps&&Array.isArray(i.allowProps)?i.allowProps:[`__typename`]})}constructor(){super({dedupe:!0})}};k.instance.registerCustom({isApplicable:e=>c.Buffer.isBuffer(e),serialize:e=>e.toString(`base64`),deserialize:e=>c.Buffer.from(e,`base64`)},`Bytes`);function A(e,t){let n=o.i(e);t&&(t.endsWithNewline=n.codePointAt(n.length-1)===10);try{return k.parseJson(n,t)}catch(t){throw a.t(t)?(t.message=t.message.replace(`JSON`,e),t):Error(`Failed to parse JSON: ${e}`)}}async function j(e,t){let n=await o.t(e);t&&(t.endsWithNewline=n.codePointAt(n.length-1)===10);try{return k.parseJson(n,t)}catch(t){throw a.t(t)?(t.message=t.message.replace(`JSON`,e),t):Error(`Failed to parse JSON: ${e}`)}}function M(e,t,n){let r=k.stringify(t,n);return s.n(e,n?.appendNewLine?`${r}\n`:r)}async function N(e,t,n){let r=k.stringify(t);return s.t(e,n?.appendNewLine?`${r}\n`:r)}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return j}});
|
package/dist/json-Dp4PSH2i.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{s as e}from"./file-path-fns-BDzC2SIV.mjs";import{t}from"./is-string-91Z3dOKQ.mjs";import{t as n}from"./is-object-UsKYhyC5.mjs";import{n as r,r as i}from"./is-set-string-Cj0g4gsG.mjs";import{t as a}from"./is-error-CjVXmD_8.mjs";import{i as o,t as s}from"./read-file-B091zB64.mjs";import{n as c,t as l}from"./write-file-CFByoJkN.mjs";import{Buffer as u}from"node:buffer";import{parse as d,printParseErrorCode as f}from"jsonc-parser";import p from"superjson";import{LinesAndColumns as m}from"lines-and-columns";const h=Symbol(`singleComment`),g=Symbol(`multiComment`);function _(){return``}function v(e,t,n){return e.slice(t,n).replace(/\S/g,` `)}function y(e,t){let n=t-1,r=0;for(;e[n]===`\\`;)--n,r+=1;return!!(r%2)}function b(t,{whitespace:n=!0,trailingCommas:r=!1}={}){if(typeof t!=`string`)throw TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof t}\``);let i=n?v:_,a=!1,o=!1,s=0,c=``,l=``,u=-1;for(let n=0;n<t.length;n++){let d=t[n],f=t[n+1];!o&&d===`"`&&(y(t,n)||(a=!a)),!a&&(!o&&d+(f??e)===`//`?(c+=t.slice(s,n),s=n,o=h,n++):o===h&&d+(f??e)===`\r
|
|
2
|
-
`?(n++,o=!1,c+=i(t,s,n),s=n):o===h&&d===`
|
|
3
|
-
`?(o=!1,c+=i(t,s,n),s=n):!o&&d+(f??e)===`/*`?(c+=t.slice(s,n),s=n,o=g,n++):o===g&&d+(f??e)===`*/`?(n++,o=!1,c+=i(t,s,n+1),s=n+1):r&&!o&&(u===-1?d===`,`&&(l+=c+t.slice(s,n),c=``,s=n,u=n):d===`}`||d===`]`?(c+=t.slice(s,n),l+=i(c,0,1)+c.slice(1),c=``,s=n,u=-1):d!==` `&&d!==` `&&d!==`\r`&&d!==`
|
|
4
|
-
`&&(c+=t.slice(s,n),s=n,u=-1)))}return l+c+(o?i(t.slice(s)):t.slice(s))}const x=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,S=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,C=/^\s*["[{]|^\s*-?\d{1,16}(?:\.\d{1,17})?(?:E[+-]?\d+)?\s*$/i;function w(e,t){if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){console.warn(`Dropping "${e}" key to prevent prototype pollution.`);return}return t}function T(e,t={}){if(typeof e!=`string`)return e;let n=b(e);if(n[0]===`"`&&n[n.length-1]===`"`&&!n.includes(`\\`))return n.slice(1,-1);if(n=n.trim(),n.length<=9)switch(n.toLowerCase()){case`true`:return!0;case`false`:return!1;case`undefined`:return;case`null`:return null;case`nan`:return NaN;case`infinity`:return 1/0;case`-infinity`:return-1/0}if(!C.test(n)){if(t.strict)throw Error(`Invalid JSON`);return n}try{if(x.test(n)||S.test(n)){if(t.strict)throw Error(`Possible prototype pollution`);return JSON.parse(n,w)}return JSON.parse(n)}catch(n){if(t.strict)throw n;return e}}const E=/\r\n|[\n\r\u2028\u2029]/;function D(e,t,n={}){let r={column:0,line:-1,...e.start},i={...r,...e.end},{linesAbove:a=2,linesBelow:o=3}=n||{},s=r.line,c=r.column,l=i.line,u=i.column,d=Math.max(s-(a+1),0),f=Math.min(t.length,l+o);s===-1&&(d=0),l===-1&&(f=t.length);let p=l-s,m={};if(p)for(let e=0;e<=p;e++){let n=e+s;c?e===0?m[n]=[c,(t[n-1]?.length??0)-c+1]:e===p?m[n]=[0,u]:m[n]=[0,t[n-e]?.length??0]:m[n]=!0}else c===u?m[s]=c?[c,0]:!0:m[s]=[c,u-c];return{start:d,end:f,markerLines:m}}function O(e,t,n={}){let{start:r,end:i,markerLines:a}=D(t,e.split(E),n),o=String(i).length;return(n.highlight?n.highlight(e):e).split(E).slice(r,i).map((e,t)=>{let n=r+1+t,i=` ${` ${n}`.slice(-o)} | `,s=!!(a[n]??!1);if(s){let t=``;if(Array.isArray(s)){let n=e.slice(0,Math.max(s[0]-1,0)).replace(/[^\t]/g,` `),r=s[1]||1;t=[`
|
|
5
|
-
`,i.replace(/\d/g,` `),n,`^`.repeat(r)].join(``)}return[`>`,i,e,t].join(``)}return` ${i}${e}`}).join(`
|
|
6
|
-
`)}function k(e,t){let{error:n,offset:r,length:i}=t,a=new m(e).locationForIndex(r),o=a?.line??0,s=a?.column??0;return o++,s++,`${f(n)} in JSON at ${o}:${s}\n${O(e,{start:{line:o,column:s},end:{line:o,column:s+i}})}\n`}const A=`@/#$ :;,.!?&=+-*%^~|\\"'\`{}[]()<>`.split(``),j=(e,t=2)=>{let n=i(t)?` `.repeat(t):t;switch(e){case null:return`null`;case void 0:return`"undefined"`;case!0:return`true`;case!1:return`false`;case 1/0:return`infinity`;case-1/0:return`-infinity`}if(Array.isArray(e))return`[${n}${e.map(e=>j(e,n)).join(`,${n}`)}${n}]`;if(e instanceof Uint8Array)return e.toString();switch(typeof e){case`number`:return`${e}`;case`string`:return JSON.stringify(e);case`object`:return`{${n}${Object.keys(e).filter(t=>!r(e[t])).map(t=>`${A.some(e=>t.includes(e))?`"${t}"`:t}: ${n}${j(e[t],n)}`).join(`,${n}`)}${n}}`;default:return`null`}};var M=class e extends p{static#e;static get instance(){return e.#e||=new e,e.#e}static deserialize(t){return e.instance.deserialize(t)}static serialize(t){return e.instance.serialize(t)}static parse(e){return T(e)}static stringify(t,n){let r=e.instance.customTransformerRegistry.findApplicable(t),i=t;return r&&r.isApplicable(t)&&(i=r.serialize(i)),j(i)}static parseJson(t,n){try{if(n?.expectComments===!1)return e.instance.parse(t)}catch{}let r=[],i=d(t,r,{allowTrailingComma:!0,...n});if(r.length>0&&r[0])throw Error(k(t,r[0]));return i}static register(t,n,r,i){e.instance.registerCustom({isApplicable:i,serialize:n,deserialize:r},t)}static registerClass(r,i){e.instance.registerClass(r,{identifier:t(i)?i:i?.identifier||r.name,allowProps:i&&n(i)&&i?.allowProps&&Array.isArray(i.allowProps)?i.allowProps:[`__typename`]})}constructor(){super({dedupe:!0})}};M.instance.registerCustom({isApplicable:e=>u.isBuffer(e),serialize:e=>e.toString(`base64`),deserialize:e=>u.from(e,`base64`)},`Bytes`);function N(e,t){let n=o(e);t&&(t.endsWithNewline=n.codePointAt(n.length-1)===10);try{return M.parseJson(n,t)}catch(t){throw a(t)?(t.message=t.message.replace(`JSON`,e),t):Error(`Failed to parse JSON: ${e}`)}}async function P(e,t){let n=await s(e);t&&(t.endsWithNewline=n.codePointAt(n.length-1)===10);try{return M.parseJson(n,t)}catch(t){throw a(t)?(t.message=t.message.replace(`JSON`,e),t):Error(`Failed to parse JSON: ${e}`)}}function F(e,t,n){let r=M.stringify(t,n);return c(e,n?.appendNewLine?`${r}\n`:r)}async function I(e,t,n){let r=M.stringify(t);return l(e,n?.appendNewLine?`${r}\n`:r)}export{F as i,N as n,I as r,P as t};
|
|
7
|
-
//# sourceMappingURL=json-Dp4PSH2i.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-Dp4PSH2i.mjs","names":["isInsideString: boolean | symbol","isInsideComment: boolean | symbol","parse","startLoc: Location","endLoc: Location","#instance","parseValue","stringifyValue","errors: ParseError[]"],"sources":["../../json/src/utils/strip-comments.ts","../../json/src/utils/parse.ts","../../json/src/utils/code-frames.ts","../../json/src/utils/parse-error.ts","../../json/src/utils/stringify.ts","../../json/src/storm-json.ts","../src/json.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 { EMPTY_STRING } from \"@stryke/types/base\";\n\nconst singleComment = Symbol(\"singleComment\");\nconst multiComment = Symbol(\"multiComment\");\n\nfunction stripWithoutWhitespace() {\n return \"\";\n}\nfunction stripWithWhitespace(value: string, start?: number, end?: number) {\n return value.slice(start, end).replace(/\\S/g, \" \");\n}\n\nfunction isEscaped(value: string, quotePosition: number) {\n let index = quotePosition - 1;\n let backslashCount = 0;\n while (value[index] === \"\\\\\") {\n index -= 1;\n backslashCount += 1;\n }\n\n return Boolean(backslashCount % 2);\n}\n\nexport function stripComments(\n value: string,\n { whitespace = true, trailingCommas = false } = {}\n) {\n if (typeof value !== \"string\") {\n throw new TypeError(\n `Expected argument \\`jsonString\\` to be a \\`string\\`, got \\`${typeof value}\\``\n );\n }\n\n const strip = whitespace ? stripWithWhitespace : stripWithoutWhitespace;\n let isInsideString: boolean | symbol = false;\n let isInsideComment: boolean | symbol = false;\n let offset = 0;\n let buffer = \"\";\n let result = \"\";\n let commaIndex = -1;\n for (let index = 0; index < value.length; index++) {\n const currentCharacter = value[index];\n const nextCharacter = value[index + 1];\n if (!isInsideComment && currentCharacter === '\"') {\n const escaped = isEscaped(value, index);\n if (!escaped) {\n isInsideString = !isInsideString;\n }\n }\n if (isInsideString) {\n continue;\n }\n if (\n !isInsideComment &&\n currentCharacter + (nextCharacter ?? EMPTY_STRING) === \"//\"\n ) {\n buffer += value.slice(offset, index);\n offset = index;\n isInsideComment = singleComment;\n index++;\n } else if (\n isInsideComment === singleComment &&\n currentCharacter + (nextCharacter ?? EMPTY_STRING) === \"\\r\\n\"\n ) {\n index++;\n isInsideComment = false;\n buffer += strip(value, offset, index);\n offset = index;\n } else if (isInsideComment === singleComment && currentCharacter === \"\\n\") {\n isInsideComment = false;\n buffer += strip(value, offset, index);\n offset = index;\n } else if (\n !isInsideComment &&\n currentCharacter + (nextCharacter ?? EMPTY_STRING) === \"/*\"\n ) {\n buffer += value.slice(offset, index);\n offset = index;\n isInsideComment = multiComment;\n index++;\n } else if (\n isInsideComment === multiComment &&\n currentCharacter + (nextCharacter ?? EMPTY_STRING) === \"*/\"\n ) {\n index++;\n isInsideComment = false;\n buffer += strip(value, offset, index + 1);\n offset = index + 1;\n } else if (trailingCommas && !isInsideComment) {\n if (commaIndex !== -1) {\n if (currentCharacter === \"}\" || currentCharacter === \"]\") {\n buffer += value.slice(offset, index);\n result += strip(buffer, 0, 1) + buffer.slice(1);\n buffer = \"\";\n offset = index;\n commaIndex = -1;\n } else if (\n currentCharacter !== \" \" &&\n currentCharacter !== \"\t\" &&\n currentCharacter !== \"\\r\" &&\n currentCharacter !== \"\\n\"\n ) {\n buffer += value.slice(offset, index);\n offset = index;\n commaIndex = -1;\n }\n } else if (currentCharacter === \",\") {\n result += buffer + value.slice(offset, index);\n buffer = \"\";\n offset = index;\n commaIndex = index;\n }\n }\n }\n\n return (\n result +\n buffer +\n (isInsideComment ? strip(value.slice(offset)) : value.slice(offset))\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 { stripComments } from \"./strip-comments\";\n\n// https://github.com/fastify/secure-json-parse\n// https://github.com/hapijs/bourne\nconst suspectProtoRx =\n /\"(?:_|\\\\u0{2}5[Ff]){2}(?:p|\\\\u0{2}70)(?:r|\\\\u0{2}72)(?:o|\\\\u0{2}6[Ff])(?:t|\\\\u0{2}74)(?:o|\\\\u0{2}6[Ff])(?:_|\\\\u0{2}5[Ff]){2}\"\\s*:/;\nconst suspectConstructorRx =\n /\"(?:c|\\\\u0063)(?:o|\\\\u006[Ff])(?:n|\\\\u006[Ee])(?:s|\\\\u0073)(?:t|\\\\u0074)(?:r|\\\\u0072)(?:u|\\\\u0075)(?:c|\\\\u0063)(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:r|\\\\u0072)\"\\s*:/;\n\nconst JsonSigRx = /^\\s*[\"[{]|^\\s*-?\\d{1,16}(?:\\.\\d{1,17})?(?:E[+-]?\\d+)?\\s*$/i;\n\nfunction jsonParseTransform(key: string, value: any): any {\n if (\n key === \"__proto__\" ||\n (key === \"constructor\" &&\n value &&\n typeof value === \"object\" &&\n \"prototype\" in value)\n ) {\n // eslint-disable-next-line no-console\n console.warn(`Dropping \"${key}\" key to prevent prototype pollution.`);\n return;\n }\n return value;\n}\n\nexport interface Options {\n strict?: boolean;\n}\n\nexport function parse<T = unknown>(value: any, options: Options = {}): T {\n if (typeof value !== \"string\") {\n return value;\n }\n\n let stripped = stripComments(value);\n\n if (\n stripped[0] === '\"' &&\n stripped[stripped.length - 1] === '\"' &&\n !stripped.includes(\"\\\\\")\n ) {\n return stripped.slice(1, -1) as T;\n }\n\n stripped = stripped.trim();\n\n if (stripped.length <= 9) {\n switch (stripped.toLowerCase()) {\n case \"true\": {\n return true as T;\n }\n case \"false\": {\n return false as T;\n }\n case \"undefined\": {\n return undefined as T;\n }\n case \"null\": {\n return null as T;\n }\n case \"nan\": {\n return Number.NaN as T;\n }\n case \"infinity\": {\n return Number.POSITIVE_INFINITY as T;\n }\n case \"-infinity\": {\n return Number.NEGATIVE_INFINITY as T;\n }\n }\n }\n\n if (!JsonSigRx.test(stripped)) {\n if (options.strict) {\n throw new Error(\"Invalid JSON\");\n }\n return stripped as T;\n }\n\n try {\n if (suspectProtoRx.test(stripped) || suspectConstructorRx.test(stripped)) {\n if (options.strict) {\n throw new Error(\"Possible prototype pollution\");\n }\n return JSON.parse(stripped, jsonParseTransform);\n }\n\n return JSON.parse(stripped);\n } catch (error) {\n if (options.strict) {\n throw error;\n }\n return value as T;\n }\n}\n\nexport function safeParse<T = unknown>(value: any, options: Options = {}): T {\n return parse<T>(value, { ...options, strict: true });\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\ninterface Location {\n column: number;\n line: number;\n}\n\ninterface NodeLocation {\n end?: Location;\n start?: Location;\n}\n\n// Adapted from https://raw.githubusercontent.com/babel/babel/4108524/packages/babel-code-frame/src/index.js\n\n/**\n * RegExp to test for newlines in terminal.\n */\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\n/**\n * Extract what lines should be marked and highlighted.\n */\nfunction getMarkerLines(\n loc: NodeLocation,\n source: string[],\n opts: { linesAbove?: number; linesBelow?: number } = {}\n): {\n start: number;\n end: number;\n markerLines: Record<number, boolean | [number, number]>;\n} {\n const startLoc: Location = {\n column: 0,\n line: -1,\n ...loc.start\n };\n const endLoc: Location = {\n ...startLoc,\n ...loc.end\n };\n const { linesAbove = 2, linesBelow = 3 } = opts || {};\n const startLine = startLoc.line;\n const startColumn = startLoc.column;\n const endLine = endLoc.line;\n const endColumn = endLoc.column;\n\n let start = Math.max(startLine - (linesAbove + 1), 0);\n let end = Math.min(source.length, endLine + linesBelow);\n\n if (startLine === -1) {\n start = 0;\n }\n\n if (endLine === -1) {\n end = source.length;\n }\n\n const lineDiff = endLine - startLine;\n const markerLines = {} as Record<number, boolean | [number, number]>;\n\n if (lineDiff) {\n for (let i = 0; i <= lineDiff; i++) {\n const lineNumber = i + startLine;\n\n if (!startColumn) {\n markerLines[lineNumber] = true;\n } else if (i === 0) {\n const sourceLength = source[lineNumber - 1]?.length ?? 0;\n\n markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];\n } else if (i === lineDiff) {\n markerLines[lineNumber] = [0, endColumn];\n } else {\n const sourceLength = source[lineNumber - i]?.length ?? 0;\n\n markerLines[lineNumber] = [0, sourceLength];\n }\n }\n } else if (startColumn === endColumn) {\n markerLines[startLine] = startColumn ? [startColumn, 0] : true;\n } else {\n markerLines[startLine] = [startColumn, endColumn - startColumn];\n }\n\n return {\n start,\n end,\n markerLines\n };\n}\n\nexport function codeFrameColumns(\n rawLines: string,\n loc: NodeLocation,\n opts: {\n linesAbove?: number;\n linesBelow?: number;\n highlight?: (rawLines: string) => string;\n } = {}\n): string {\n const lines = rawLines.split(NEWLINE);\n const { start, end, markerLines } = getMarkerLines(loc, lines, opts);\n\n const numberMaxWidth = String(end).length;\n const highlightedLines = opts.highlight ? opts.highlight(rawLines) : rawLines;\n\n const frame = highlightedLines\n .split(NEWLINE)\n .slice(start, end)\n .map((line, index) => {\n const number = start + 1 + index;\n const paddedNumber = ` ${number}`.slice(-numberMaxWidth);\n const gutter = ` ${paddedNumber} | `;\n const hasMarker = Boolean(markerLines[number] ?? false);\n if (hasMarker) {\n let markerLine = \"\";\n if (Array.isArray(hasMarker)) {\n const markerSpacing = line\n .slice(0, Math.max(hasMarker[0] - 1, 0))\n .replace(/[^\\t]/g, \" \");\n const numberOfMarkers = hasMarker[1] || 1;\n\n markerLine = [\n \"\\n \",\n gutter.replace(/\\d/g, \" \"),\n markerSpacing,\n \"^\".repeat(numberOfMarkers)\n ].join(\"\");\n }\n return [\">\", gutter, line, markerLine].join(\"\");\n }\n return ` ${gutter}${line}`;\n })\n .join(\"\\n\");\n\n return frame;\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 type { ParseError } from \"jsonc-parser\";\nimport { printParseErrorCode } from \"jsonc-parser\";\nimport { LinesAndColumns } from \"lines-and-columns\";\nimport { codeFrameColumns } from \"./code-frames\";\n\n/**\n * Nicely formats a JSON error with context\n *\n * @param input - JSON content as string\n * @param parseError - jsonc ParseError\n * @returns\n */\nexport function formatParseError(input: string, parseError: ParseError) {\n const { error, offset, length } = parseError;\n const result = new LinesAndColumns(input).locationForIndex(offset);\n let line = result?.line ?? 0;\n let column = result?.column ?? 0;\n\n line++;\n column++;\n\n return `${printParseErrorCode(error)} in JSON at ${line}:${column}\\n${codeFrameColumns(\n input,\n {\n start: {\n line,\n column\n },\n end: {\n line,\n column: column + length\n }\n }\n )}\\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 { isNumber } from \"@stryke/type-checks/is-number\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\n\nexport const invalidKeyChars = [\n \"@\",\n \"/\",\n \"#\",\n \"$\",\n \" \",\n \":\",\n \";\",\n \",\",\n \".\",\n \"!\",\n \"?\",\n \"&\",\n \"=\",\n \"+\",\n \"-\",\n \"*\",\n \"%\",\n \"^\",\n \"~\",\n \"|\",\n \"\\\\\",\n '\"',\n \"'\",\n \"`\",\n \"{\",\n \"}\",\n \"[\",\n \"]\",\n \"(\",\n \")\",\n \"<\",\n \">\"\n] as const;\n\n/**\n * Stringify a value to a JSON-like string.\n *\n * @param value - The value to stringify\n * @param spacing - The spacing to use for the stringification\n * @returns The stringified value\n */\nexport const stringify = (\n value: unknown,\n spacing: string | number = 2\n): string => {\n const space = isNumber(spacing) ? \" \".repeat(spacing) : spacing;\n\n switch (value) {\n case null: {\n return \"null\";\n }\n case undefined: {\n return '\"undefined\"';\n }\n case true: {\n return \"true\";\n }\n case false: {\n return \"false\";\n }\n case Number.POSITIVE_INFINITY: {\n return \"infinity\";\n }\n case Number.NEGATIVE_INFINITY: {\n return \"-infinity\";\n }\n }\n\n if (Array.isArray(value)) {\n return `[${space}${value.map(v => stringify(v, space)).join(`,${space}`)}${space}]`;\n }\n if (value instanceof Uint8Array) {\n return value.toString();\n }\n\n // eslint-disable-next-line ts/switch-exhaustiveness-check\n switch (typeof value) {\n case \"number\": {\n return `${value}`;\n }\n case \"string\": {\n return JSON.stringify(value);\n }\n case \"object\": {\n const keys = Object.keys(value as object).filter(\n key => !isUndefined((value as any)[key])\n );\n\n return `{${space}${keys\n .map(\n key =>\n `${invalidKeyChars.some(invalidKeyChar => key.includes(invalidKeyChar)) ? `\"${key}\"` : key}: ${space}${stringify((value as any)[key], space)}`\n )\n .join(`,${space}`)}${space}}`;\n }\n default:\n return \"null\";\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 type { ParseError } from \"jsonc-parser\";\nimport type {\n Class,\n JsonParseOptions,\n JsonParserResult,\n JsonSerializeOptions,\n JsonValue\n} from \"./types\";\n// import { Decimal } from \"decimal.js\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { parse } from \"jsonc-parser\";\nimport { Buffer } from \"node:buffer\";\nimport SuperJSON from \"superjson\";\nimport { parse as parseValue } from \"./utils/parse\";\nimport { formatParseError } from \"./utils/parse-error\";\nimport { stringify as stringifyValue } from \"./utils/stringify\";\n\n/**\n * A static JSON parser class used by Storm Software to serialize and deserialize JSON data\n *\n * @remarks\n * This class uses the [SuperJSON](https://github.com/blitz-js/superjson) library under the hood.\n */\nexport class StormJSON extends SuperJSON {\n static #instance: StormJSON;\n\n public static get instance(): StormJSON {\n if (!StormJSON.#instance) {\n StormJSON.#instance = new StormJSON();\n }\n\n return StormJSON.#instance;\n }\n\n /**\n * Deserialize the given value with superjson using the given metadata\n */\n public static override deserialize<TData = unknown>(\n payload: JsonParserResult\n ): TData {\n return StormJSON.instance.deserialize(payload);\n }\n\n /**\n * Serialize the given value with superjson\n */\n public static override serialize(object: JsonValue): JsonParserResult {\n return StormJSON.instance.serialize(object);\n }\n\n /**\n * Parse the given string value with superjson using the given metadata\n *\n * @param value - The string value to parse\n * @returns The parsed data\n */\n public static override parse<TData = unknown>(value: string): TData {\n return parseValue(value);\n }\n\n /**\n * Serializes the given data to a JSON string.\n * By default the JSON string is formatted with a 2 space indentation to be easy readable.\n *\n * @param value - Object which should be serialized to JSON\n * @param _options - JSON serialize options\n * @returns the formatted JSON representation of the object\n */\n public static override stringify<T>(\n value: T,\n _options?: JsonSerializeOptions\n ): string {\n const customTransformer =\n StormJSON.instance.customTransformerRegistry.findApplicable(value);\n\n let result = value;\n if (customTransformer && customTransformer.isApplicable(value)) {\n result = customTransformer.serialize(result) as T;\n }\n\n return stringifyValue(result);\n }\n\n /**\n * Parses the given JSON string and returns the object the JSON content represents.\n * By default javascript-style comments and trailing commas are allowed.\n *\n * @param strData - JSON content as string\n * @param options - JSON parse options\n * @returns Object the JSON content represents\n */\n public static parseJson<TData = unknown>(\n strData: string,\n options?: JsonParseOptions\n ): TData {\n try {\n if (options?.expectComments === false) {\n return StormJSON.instance.parse(strData);\n }\n } catch {\n // Do nothing\n }\n\n const errors: ParseError[] = [];\n const opts = {\n allowTrailingComma: true,\n ...options\n };\n const result = parse(strData, errors, opts) as TData;\n\n if (errors.length > 0 && errors[0]) {\n throw new Error(formatParseError(strData, errors[0]));\n }\n\n return result;\n }\n\n /**\n * Register a custom schema with superjson\n *\n * @param name - The name of the schema\n * @param serialize - The function to serialize the schema\n * @param deserialize - The function to deserialize the schema\n * @param isApplicable - The function to check if the schema is applicable\n */\n public static register<\n TData = any,\n TJsonObject extends JsonValue = JsonValue\n >(\n name: string,\n serialize: (data: TData) => TJsonObject,\n deserialize: (json: TJsonObject) => TData,\n isApplicable: (data: any) => data is TData\n ) {\n StormJSON.instance.registerCustom<TData, TJsonObject>(\n {\n isApplicable,\n serialize,\n deserialize\n },\n name\n );\n }\n\n /**\n * Register a class with superjson\n *\n * @param classConstructor - The class constructor to register\n */\n public static override registerClass(\n classConstructor: Class,\n options?: { identifier?: string; allowProps?: string[] } | string\n ) {\n StormJSON.instance.registerClass(classConstructor, {\n identifier: isString(options)\n ? options\n : options?.identifier || classConstructor.name,\n allowProps:\n options &&\n isObject(options) &&\n options?.allowProps &&\n Array.isArray(options.allowProps)\n ? options.allowProps\n : [\"__typename\"]\n });\n }\n\n private constructor() {\n super({ dedupe: true });\n }\n}\n\nStormJSON.instance.registerCustom<Buffer, string>(\n {\n isApplicable: (v): v is Buffer => Buffer.isBuffer(v),\n serialize: v => v.toString(\"base64\"),\n deserialize: v => Buffer.from(v, \"base64\")\n },\n \"Bytes\"\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 { StormJSON } from \"@stryke/json/storm-json\";\nimport type {\n JsonParseOptions,\n JsonSerializeOptions\n} from \"@stryke/json/types\";\nimport { isError } from \"@stryke/type-checks/is-error\";\nimport { readFile, readFileSync } from \"./read-file\";\nimport { writeFile, writeFileSync } from \"./write-file\";\n\nexport interface JsonReadOptions extends JsonParseOptions {\n /**\n * mutable field recording whether JSON ends with new line\n *\n * @defaultValue false\n */\n endsWithNewline?: boolean;\n}\n\n/**\n * Reads a JSON file and returns the object the JSON content represents.\n *\n * @param path - A path to a file.\n * @param options - JSON parse options\n * @returns Object the JSON content of the file represents\n */\nexport function readJsonFileSync<T extends object = any>(\n path: string,\n options?: JsonReadOptions\n): T {\n const content = readFileSync(path);\n if (options) {\n options.endsWithNewline = content.codePointAt(content.length - 1) === 10;\n }\n\n try {\n return StormJSON.parseJson<T>(content, options);\n } catch (error) {\n if (isError(error)) {\n error.message = error.message.replace(\"JSON\", path);\n throw error;\n }\n\n throw new Error(`Failed to parse JSON: ${path}`);\n }\n}\n\n/**\n * Reads a JSON file and returns the object the JSON content represents.\n *\n * @param path - A path to a file.\n * @param options - JSON parse options\n * @returns Object the JSON content of the file represents\n */\nexport async function readJsonFile<T extends object = any>(\n path: string,\n options?: JsonReadOptions\n): Promise<T> {\n const content = await readFile(path);\n if (options) {\n options.endsWithNewline = content.codePointAt(content.length - 1) === 10;\n }\n\n try {\n return StormJSON.parseJson<T>(content, options);\n } catch (error) {\n if (isError(error)) {\n error.message = error.message.replace(\"JSON\", path);\n throw error;\n }\n\n throw new Error(`Failed to parse JSON: ${path}`);\n }\n}\n\nexport interface JsonWriteOptions extends JsonSerializeOptions {\n /**\n * whether to append new line at the end of JSON file\n *\n * @defaultValue false\n */\n appendNewLine?: boolean;\n}\n\n/**\n * Serializes the given data to JSON and writes it to a file.\n *\n * @param path - A path to a file.\n * @param data - data which should be serialized to JSON and written to the file\n * @param options - JSON serialize options\n */\nexport function writeJsonFileSync<T extends object = object>(\n path: string,\n data: T,\n options?: JsonWriteOptions\n): void {\n const serializedJson = StormJSON.stringify(data, options);\n\n return writeFileSync(\n path,\n options?.appendNewLine ? `${serializedJson}\\n` : serializedJson\n );\n}\n\n/**\n * Serializes the given data to JSON and writes it to a file asynchronously.\n *\n * @param path - A path to a file.\n * @param data - data which should be serialized to JSON and written to the file\n * @param options - JSON serialize options\n */\nexport async function writeJsonFile<T extends object = object>(\n path: string,\n data: T,\n options?: JsonWriteOptions\n): Promise<void> {\n const serializedJson = StormJSON.stringify(data);\n\n return writeFile(\n path,\n options?.appendNewLine ? `${serializedJson}\\n` : serialized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B,EACpB,EACA,EACY,CACZ,IAAM,EAAU,MAAM,EAAS,EAAK,CAChC,IACF,EAAQ,gBAAkB,EAAQ,YAAY,EAAQ,OAAS,EAAE,GAAK,IAGxE,GAAI,CACF,OAAO,EAAU,UAAa,EAAS,EAAQ,OACxC,EAAO,CAMd,MALI,EAAQ,EAAM,EAChB,EAAM,QAAU,EAAM,QAAQ,QAAQ,OAAQ,EAAK,CAC7C,GAGE,MAAM,yBAAyB,IAAO,EAoBpD,SAAgB,EACd,EACA,EACA,EACM,CACN,IAAM,EAAiB,EAAU,UAAU,EAAM,EAAQ,CAEzD,OAAO,EACL,EACA,GAAS,cAAgB,GAAG,EAAe,IAAM,EAClD,CAUH,eAAsB,EACpB,EACA,EACA,EACe,CACf,IAAM,EAAiB,EAAU,UAAU,EAAK,CAEhD,OAAO,EACL,EACA,GAAS,cAAgB,GAAG,EAAe,IAAM,EAClD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./join-paths-DUdaieID.cjs`),n=require(`./is-string-DKgNS0jA.cjs`);let r=require(`defu`);r=e.t(r);let i=require(`glob`);const a=typeof Buffer<`u`,o=a?Buffer.isBuffer.bind(Buffer):function(e){return!1},s=(e=>(typeof globalThis==`object`||Object.defineProperty(e,`typeDetectGlobalObject`,{get(){return this},configurable:!0}),globalThis))(Object.prototype),c={dot:!0};async function l(e,a){return(0,i.glob)(n.t(e)?e.includes(`*`)?e:t.t(e,`**/*`):e.input?t.t(e.input,e.glob):e.glob,(0,r.default)(n.t(e)?{}:{dot:e.dot,ignore:e.ignore},a??{},c))}function u(e,a){return i.glob.sync(n.t(e)?e.includes(`*`)?e:t.t(e,`**/*`):e.input?t.t(e.input,e.glob):e.glob,(0,r.default)(n.t(e)?{}:{dot:e.dot,ignore:e.ignore},a??{},c))}async function d(e,t){let n=(await l(e,(0,r.default)({withFileTypes:!0},t??{}))).filter(e=>e.isFile());return t?.withFileTypes?n:n.map(e=>e.fullpath())}function f(e,t){let n=u(e,(0,r.default)({withFileTypes:!0},t??{})).filter(e=>e.isFile());return t?.withFileTypes?n:n.map(e=>e.fullpath())}async function p(e,t){let n=(await l(e,(0,r.default)({withFileTypes:!0},t??{}))).filter(e=>e.isDirectory());return t?.withFileTypes?n:n.map(e=>e.fullpath())}function m(e,t){let n=u(e,(0,r.default)({withFileTypes:!0},t??{})).filter(e=>e.isDirectory());return t?.withFileTypes?n:n.map(e=>e.fullpath())}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { t as AssetGlob } from "./file-D1uBqkpP.cjs";
|
|
2
|
-
import { GlobOptions, Path } from "glob";
|
|
3
|
-
|
|
4
|
-
//#region src/list-files.d.ts
|
|
5
|
-
type ListOptions = GlobOptions;
|
|
6
|
-
type InferListReturnType<TOptions extends GlobOptions> = TOptions["withFileTypes"] extends true ? Path[] : string[];
|
|
7
|
-
/**
|
|
8
|
-
* A files and directories listing helper function
|
|
9
|
-
*
|
|
10
|
-
* @param filesGlob - A glob pattern to match files
|
|
11
|
-
* @returns A list of file paths
|
|
12
|
-
*/
|
|
13
|
-
declare function list<TOptions extends ListOptions>(filesGlob: string | Omit<AssetGlob, "output">, options?: TOptions): Promise<InferListReturnType<TOptions>>;
|
|
14
|
-
/**
|
|
15
|
-
* A synchronous files and directories listing helper function
|
|
16
|
-
*
|
|
17
|
-
* @param filesGlob - A glob pattern to match files
|
|
18
|
-
* @returns A list of file paths
|
|
19
|
-
*/
|
|
20
|
-
declare function listSync<TOptions extends ListOptions>(filesGlob: string | Omit<AssetGlob, "output">, options?: TOptions): InferListReturnType<TOptions>;
|
|
21
|
-
/**
|
|
22
|
-
* A file listing helper function
|
|
23
|
-
*
|
|
24
|
-
* @param filesGlob - A glob pattern to match files
|
|
25
|
-
* @returns A list of file paths
|
|
26
|
-
*/
|
|
27
|
-
declare function listFiles<TOptions extends ListOptions>(filesGlob: string | Omit<AssetGlob, "output">, options?: TOptions): Promise<InferListReturnType<TOptions>>;
|
|
28
|
-
/**
|
|
29
|
-
* A synchronous file listing helper function
|
|
30
|
-
*
|
|
31
|
-
* @param filesGlob - A glob pattern to match files
|
|
32
|
-
* @returns A list of file paths
|
|
33
|
-
*/
|
|
34
|
-
declare function listFilesSync<TOptions extends ListOptions>(filesGlob: string | Omit<AssetGlob, "output">, options?: TOptions): InferListReturnType<TOptions>;
|
|
35
|
-
/**
|
|
36
|
-
* A directories listing helper function
|
|
37
|
-
*
|
|
38
|
-
* @param filesGlob - A glob pattern to match files
|
|
39
|
-
* @returns A list of file paths
|
|
40
|
-
*/
|
|
41
|
-
declare function listDirectories<TOptions extends ListOptions>(filesGlob: string | Omit<AssetGlob, "output">, options?: TOptions): Promise<InferListReturnType<TOptions>>;
|
|
42
|
-
/**
|
|
43
|
-
* A synchronous directories listing helper function
|
|
44
|
-
*
|
|
45
|
-
* @param filesGlob - A glob pattern to match files
|
|
46
|
-
* @returns A list of file paths
|
|
47
|
-
*/
|
|
48
|
-
declare function listDirectoriesSync<TOptions extends ListOptions>(filesGlob: string | Omit<AssetGlob, "output">, options?: TOptions): InferListReturnType<TOptions>;
|
|
49
|
-
//#endregion
|
|
50
|
-
export { listDirectoriesSync as a, listSync as c, listDirectories as i, ListOptions as n, listFiles as o, list as r, listFilesSync as s, InferListReturnType as t };
|
|
51
|
-
//# sourceMappingURL=list-files-D3dQOljX.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-files-D3dQOljX.d.cts","names":[],"sources":["../src/list-files.ts"],"sourcesContent":[],"mappings":";;;;KAyBY,WAAA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