keep-a-changelog 2.5.3 → 2.6.0
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 +22 -1
- package/README.md +15 -14
- package/esm/keep-a-changelog/bin.d.ts +2 -0
- package/esm/{bin.js → keep-a-changelog/bin.js} +85 -13
- package/esm/{mod.d.ts → keep-a-changelog/mod.d.ts} +1 -1
- package/esm/{mod.js → keep-a-changelog/mod.js} +1 -1
- package/esm/keep-a-changelog/test/changelog.azdo.md +24 -0
- package/esm/keep-a-changelog/test/changelog.sort.md +17 -0
- package/esm/std/cli/parse_args.d.ts +193 -0
- package/esm/std/cli/parse_args.js +357 -0
- package/esm/std/ini/_ini_map.d.ts +90 -0
- package/esm/std/ini/_ini_map.js +371 -0
- package/esm/std/ini/mod.d.ts +31 -0
- package/esm/std/ini/mod.js +33 -0
- package/esm/std/ini/parse.d.ts +77 -0
- package/esm/std/ini/parse.js +72 -0
- package/esm/std/ini/stringify.d.ts +83 -0
- package/esm/std/ini/stringify.js +66 -0
- package/esm/std/path/_common/assert_path.d.ts +1 -0
- package/esm/std/path/_common/assert_path.js +7 -0
- package/esm/std/path/_common/basename.d.ts +3 -0
- package/esm/std/path/_common/basename.js +40 -0
- package/esm/std/path/_common/common.d.ts +1 -0
- package/esm/std/path/_common/common.js +23 -0
- package/esm/{deps/deno.land/std@0.189.0/path/_constants.js → std/path/_common/constants.js} +1 -1
- package/esm/std/path/_common/dirname.d.ts +1 -0
- package/esm/std/path/_common/dirname.js +8 -0
- package/esm/std/path/_common/format.d.ts +3 -0
- package/esm/std/path/_common/format.js +19 -0
- package/esm/std/path/_common/from_file_url.d.ts +2 -0
- package/esm/std/path/_common/from_file_url.js +9 -0
- package/esm/std/path/_common/glob_to_reg_exp.d.ts +34 -0
- package/esm/std/path/_common/glob_to_reg_exp.js +234 -0
- package/esm/std/path/_common/normalize.d.ts +1 -0
- package/esm/std/path/_common/normalize.js +8 -0
- package/esm/std/path/_common/normalize_string.d.ts +1 -0
- package/esm/std/path/_common/normalize_string.js +77 -0
- package/esm/std/path/_common/relative.d.ts +1 -0
- package/esm/std/path/_common/relative.js +9 -0
- package/esm/std/path/_common/strip_trailing_separators.d.ts +1 -0
- package/esm/std/path/_common/strip_trailing_separators.js +19 -0
- package/esm/std/path/_common/to_file_url.d.ts +1 -0
- package/esm/std/path/_common/to_file_url.js +15 -0
- package/esm/std/path/_os.d.ts +1 -0
- package/esm/std/path/_os.js +9 -0
- package/esm/std/path/basename.d.ts +27 -0
- package/esm/std/path/basename.js +36 -0
- package/esm/std/path/common.d.ts +27 -0
- package/esm/std/path/common.js +33 -0
- package/esm/std/path/constants.d.ts +14 -0
- package/esm/std/path/constants.js +17 -0
- package/esm/std/path/dirname.d.ts +22 -0
- package/esm/std/path/dirname.js +29 -0
- package/esm/std/path/extname.d.ts +22 -0
- package/esm/std/path/extname.js +29 -0
- package/esm/std/path/format.d.ts +21 -0
- package/esm/std/path/format.js +27 -0
- package/esm/std/path/from_file_url.d.ts +22 -0
- package/esm/std/path/from_file_url.js +28 -0
- package/esm/std/path/glob_to_regexp.d.ts +76 -0
- package/esm/std/path/glob_to_regexp.js +83 -0
- package/esm/std/path/is_absolute.d.ts +21 -0
- package/esm/std/path/is_absolute.js +28 -0
- package/esm/std/path/is_glob.d.ts +16 -0
- package/esm/std/path/is_glob.js +42 -0
- package/esm/std/path/join.d.ts +22 -0
- package/esm/std/path/join.js +29 -0
- package/esm/std/path/join_globs.d.ts +27 -0
- package/esm/std/path/join_globs.js +34 -0
- package/esm/std/path/mod.d.ts +53 -0
- package/esm/std/path/mod.js +57 -0
- package/esm/std/path/normalize.d.ts +26 -0
- package/esm/std/path/normalize.js +33 -0
- package/esm/std/path/normalize_glob.d.ts +28 -0
- package/esm/std/path/normalize_glob.js +35 -0
- package/esm/std/path/parse.d.ts +34 -0
- package/esm/std/path/parse.js +39 -0
- package/esm/std/path/posix/_util.d.ts +1 -0
- package/esm/std/path/posix/_util.js +8 -0
- package/esm/std/path/posix/basename.d.ts +39 -0
- package/esm/std/path/posix/basename.js +49 -0
- package/esm/std/path/posix/constants.d.ts +12 -0
- package/esm/std/path/posix/constants.js +14 -0
- package/esm/std/path/posix/dirname.d.ts +31 -0
- package/esm/std/path/posix/dirname.js +62 -0
- package/esm/std/path/posix/extname.d.ts +36 -0
- package/esm/std/path/posix/extname.js +89 -0
- package/esm/std/path/posix/format.d.ts +23 -0
- package/esm/std/path/posix/format.js +28 -0
- package/esm/std/path/posix/from_file_url.d.ts +16 -0
- package/esm/std/path/posix/from_file_url.js +21 -0
- package/esm/std/path/posix/glob_to_regexp.d.ts +71 -0
- package/{script/deps/deno.land/std@0.189.0/path/glob.d.ts → esm/std/path/posix/glob_to_regexp.js} +28 -29
- package/esm/std/path/posix/is_absolute.d.ts +16 -0
- package/esm/std/path/posix/is_absolute.js +23 -0
- package/esm/std/path/posix/join.d.ts +32 -0
- package/esm/std/path/posix/join.js +42 -0
- package/esm/std/path/posix/join_globs.d.ts +19 -0
- package/esm/std/path/posix/join_globs.js +40 -0
- package/esm/std/path/posix/normalize.d.ts +39 -0
- package/esm/std/path/posix/normalize.js +57 -0
- package/esm/std/path/posix/normalize_glob.d.ts +19 -0
- package/esm/std/path/posix/normalize_glob.js +32 -0
- package/esm/std/path/posix/parse.d.ts +24 -0
- package/esm/std/path/posix/parse.js +115 -0
- package/esm/std/path/posix/relative.d.ts +19 -0
- package/esm/std/path/posix/relative.js +106 -0
- package/esm/std/path/posix/resolve.d.ts +16 -0
- package/esm/std/path/posix/resolve.js +59 -0
- package/esm/std/path/posix/to_file_url.d.ts +17 -0
- package/esm/std/path/posix/to_file_url.js +27 -0
- package/esm/std/path/posix/to_namespaced_path.d.ts +15 -0
- package/esm/std/path/posix/to_namespaced_path.js +20 -0
- package/esm/std/path/relative.d.ts +23 -0
- package/esm/std/path/relative.js +30 -0
- package/esm/std/path/resolve.d.ts +21 -0
- package/esm/std/path/resolve.js +30 -0
- package/esm/std/path/to_file_url.d.ts +22 -0
- package/esm/std/path/to_file_url.js +28 -0
- package/esm/std/path/to_namespaced_path.d.ts +20 -0
- package/esm/std/path/to_namespaced_path.js +29 -0
- package/esm/{deps/deno.land/std@0.189.0/path/_interface.d.ts → std/path/types.d.ts} +13 -2
- package/esm/std/path/types.js +3 -0
- package/esm/std/path/windows/_util.d.ts +3 -0
- package/esm/std/path/windows/_util.js +15 -0
- package/esm/std/path/windows/basename.d.ts +22 -0
- package/esm/std/path/windows/basename.js +44 -0
- package/esm/std/path/windows/constants.d.ts +12 -0
- package/esm/std/path/windows/constants.js +14 -0
- package/esm/std/path/windows/dirname.d.ts +19 -0
- package/esm/std/path/windows/dirname.js +112 -0
- package/esm/std/path/windows/extname.d.ts +19 -0
- package/esm/std/path/windows/extname.js +81 -0
- package/esm/std/path/windows/format.d.ts +23 -0
- package/esm/std/path/windows/format.js +28 -0
- package/esm/std/path/windows/from_file_url.d.ts +18 -0
- package/esm/std/path/windows/from_file_url.js +30 -0
- package/esm/std/path/windows/glob_to_regexp.d.ts +70 -0
- package/esm/{deps/deno.land/std@0.189.0/path/glob.d.ts → std/path/windows/glob_to_regexp.js} +28 -29
- package/esm/std/path/windows/is_absolute.d.ts +16 -0
- package/esm/std/path/windows/is_absolute.js +38 -0
- package/esm/std/path/windows/join.d.ts +19 -0
- package/esm/std/path/windows/join.js +74 -0
- package/esm/std/path/windows/join_globs.d.ts +20 -0
- package/esm/std/path/windows/join_globs.js +41 -0
- package/esm/std/path/windows/normalize.d.ts +21 -0
- package/esm/std/path/windows/normalize.js +134 -0
- package/esm/std/path/windows/normalize_glob.d.ts +19 -0
- package/esm/std/path/windows/normalize_glob.js +32 -0
- package/esm/std/path/windows/parse.d.ts +24 -0
- package/esm/std/path/windows/parse.js +176 -0
- package/esm/std/path/windows/relative.d.ts +22 -0
- package/esm/std/path/windows/relative.js +131 -0
- package/esm/std/path/windows/resolve.d.ts +16 -0
- package/esm/std/path/windows/resolve.js +154 -0
- package/esm/std/path/windows/to_file_url.d.ts +17 -0
- package/esm/std/path/windows/to_file_url.js +34 -0
- package/esm/std/path/windows/to_namespaced_path.d.ts +16 -0
- package/esm/std/path/windows/to_namespaced_path.js +49 -0
- package/esm/std/semver/_constants.d.ts +15 -0
- package/esm/std/semver/_constants.js +38 -0
- package/esm/std/semver/_shared.d.ts +43 -0
- package/esm/std/semver/_shared.js +162 -0
- package/esm/std/semver/_test_comparator_set.d.ts +2 -0
- package/esm/std/semver/_test_comparator_set.js +58 -0
- package/esm/std/semver/can_parse.d.ts +16 -0
- package/esm/std/semver/can_parse.js +27 -0
- package/esm/std/semver/compare.d.ts +27 -0
- package/esm/std/semver/compare.js +35 -0
- package/esm/std/semver/difference.d.ts +26 -0
- package/esm/std/semver/difference.js +41 -0
- package/esm/std/semver/equals.d.ts +23 -0
- package/esm/std/semver/equals.js +27 -0
- package/esm/std/semver/format.d.ts +21 -0
- package/esm/std/semver/format.js +32 -0
- package/esm/std/semver/format_range.d.ts +17 -0
- package/esm/std/semver/format_range.js +27 -0
- package/esm/std/semver/greater_or_equal.d.ts +24 -0
- package/esm/std/semver/greater_or_equal.js +26 -0
- package/esm/std/semver/greater_than.d.ts +24 -0
- package/esm/std/semver/greater_than.js +28 -0
- package/esm/std/semver/greater_than_range.d.ts +22 -0
- package/esm/std/semver/greater_than_range.js +58 -0
- package/{script/deps/deno.land/std@0.205.0 → esm/std}/semver/increment.d.ts +27 -5
- package/esm/std/semver/increment.js +176 -0
- package/esm/std/semver/is_range.d.ts +22 -0
- package/esm/std/semver/is_range.js +38 -0
- package/{script/deps/deno.land/std@0.205.0 → esm/std}/semver/is_semver.d.ts +16 -0
- package/esm/{deps/deno.land/std@0.205.0 → std}/semver/is_semver.js +25 -13
- package/esm/std/semver/less_or_equal.d.ts +24 -0
- package/esm/std/semver/less_or_equal.js +26 -0
- package/esm/std/semver/less_than.d.ts +24 -0
- package/esm/std/semver/less_than.js +26 -0
- package/esm/std/semver/less_than_range.d.ts +22 -0
- package/esm/std/semver/less_than_range.js +58 -0
- package/esm/std/semver/max_satisfying.d.ts +21 -0
- package/esm/std/semver/max_satisfying.js +30 -0
- package/esm/std/semver/min_satisfying.d.ts +21 -0
- package/esm/std/semver/min_satisfying.js +30 -0
- package/{script/deps/deno.land/std@0.205.0 → esm/std}/semver/mod.d.ts +72 -85
- package/esm/{deps/deno.land/std@0.205.0 → std}/semver/mod.js +73 -86
- package/esm/std/semver/not_equals.d.ts +23 -0
- package/esm/std/semver/not_equals.js +25 -0
- package/esm/std/semver/parse.d.ts +24 -0
- package/esm/std/semver/parse.js +44 -0
- package/esm/std/semver/parse_range.d.ts +26 -0
- package/esm/std/semver/parse_range.js +358 -0
- package/esm/std/semver/range_intersects.d.ts +24 -0
- package/esm/std/semver/range_intersects.js +89 -0
- package/esm/std/semver/satisfies.d.ts +23 -0
- package/esm/std/semver/satisfies.js +26 -0
- package/esm/std/semver/try_parse.d.ts +20 -0
- package/esm/std/semver/try_parse.js +27 -0
- package/esm/std/semver/try_parse_range.d.ts +22 -0
- package/esm/std/semver/try_parse_range.js +33 -0
- package/esm/std/semver/types.d.ts +57 -0
- package/esm/std/semver/types.js +3 -0
- package/package.json +14 -13
- package/script/keep-a-changelog/bin.d.ts +2 -0
- package/script/{bin.js → keep-a-changelog/bin.js} +86 -14
- package/script/{mod.d.ts → keep-a-changelog/mod.d.ts} +1 -1
- package/script/{mod.js → keep-a-changelog/mod.js} +1 -1
- package/script/keep-a-changelog/test/changelog.azdo.md +24 -0
- package/script/keep-a-changelog/test/changelog.sort.md +17 -0
- package/script/std/cli/parse_args.d.ts +193 -0
- package/script/std/cli/parse_args.js +361 -0
- package/script/std/ini/_ini_map.d.ts +90 -0
- package/script/std/ini/_ini_map.js +375 -0
- package/script/std/ini/mod.d.ts +31 -0
- package/script/std/ini/mod.js +49 -0
- package/script/std/ini/parse.d.ts +77 -0
- package/script/std/ini/parse.js +76 -0
- package/script/std/ini/stringify.d.ts +83 -0
- package/script/std/ini/stringify.js +70 -0
- package/script/std/path/_common/assert_path.d.ts +1 -0
- package/script/std/path/_common/assert_path.js +11 -0
- package/script/std/path/_common/basename.d.ts +3 -0
- package/script/std/path/_common/basename.js +46 -0
- package/script/std/path/_common/common.d.ts +1 -0
- package/script/std/path/_common/common.js +27 -0
- package/script/{deps/deno.land/std@0.189.0/path/_constants.js → std/path/_common/constants.js} +1 -1
- package/script/std/path/_common/dirname.d.ts +1 -0
- package/script/std/path/_common/dirname.js +12 -0
- package/script/std/path/_common/format.d.ts +3 -0
- package/script/std/path/_common/format.js +24 -0
- package/script/std/path/_common/from_file_url.d.ts +2 -0
- package/script/std/path/_common/from_file_url.js +13 -0
- package/script/std/path/_common/glob_to_reg_exp.d.ts +34 -0
- package/script/std/path/_common/glob_to_reg_exp.js +238 -0
- package/script/std/path/_common/normalize.d.ts +1 -0
- package/script/std/path/_common/normalize.js +12 -0
- package/script/std/path/_common/normalize_string.d.ts +1 -0
- package/script/std/path/_common/normalize_string.js +81 -0
- package/script/std/path/_common/relative.d.ts +1 -0
- package/script/std/path/_common/relative.js +13 -0
- package/script/std/path/_common/strip_trailing_separators.d.ts +1 -0
- package/script/std/path/_common/strip_trailing_separators.js +23 -0
- package/script/std/path/_common/to_file_url.d.ts +1 -0
- package/script/std/path/_common/to_file_url.js +19 -0
- package/script/std/path/_os.d.ts +1 -0
- package/script/{deps/deno.land/std@0.189.0/_util/os.js → std/path/_os.js} +10 -19
- package/script/std/path/basename.d.ts +27 -0
- package/script/std/path/basename.js +40 -0
- package/script/std/path/common.d.ts +27 -0
- package/script/std/path/common.js +37 -0
- package/script/std/path/constants.d.ts +14 -0
- package/script/std/path/constants.js +20 -0
- package/script/std/path/dirname.d.ts +22 -0
- package/script/std/path/dirname.js +33 -0
- package/script/std/path/extname.d.ts +22 -0
- package/script/std/path/extname.js +33 -0
- package/script/std/path/format.d.ts +21 -0
- package/script/std/path/format.js +31 -0
- package/script/std/path/from_file_url.d.ts +22 -0
- package/script/std/path/from_file_url.js +32 -0
- package/script/std/path/glob_to_regexp.d.ts +76 -0
- package/script/std/path/glob_to_regexp.js +87 -0
- package/script/std/path/is_absolute.d.ts +21 -0
- package/script/std/path/is_absolute.js +32 -0
- package/script/std/path/is_glob.d.ts +16 -0
- package/script/std/path/is_glob.js +46 -0
- package/script/std/path/join.d.ts +22 -0
- package/script/std/path/join.js +33 -0
- package/script/std/path/join_globs.d.ts +27 -0
- package/script/std/path/join_globs.js +38 -0
- package/script/std/path/mod.d.ts +53 -0
- package/script/std/path/mod.js +73 -0
- package/script/std/path/normalize.d.ts +26 -0
- package/script/std/path/normalize.js +37 -0
- package/script/std/path/normalize_glob.d.ts +28 -0
- package/script/std/path/normalize_glob.js +39 -0
- package/script/std/path/parse.d.ts +34 -0
- package/script/std/path/parse.js +43 -0
- package/script/std/path/posix/_util.d.ts +1 -0
- package/script/std/path/posix/_util.js +12 -0
- package/script/std/path/posix/basename.d.ts +39 -0
- package/script/std/path/posix/basename.js +53 -0
- package/script/std/path/posix/constants.d.ts +12 -0
- package/script/std/path/posix/constants.js +17 -0
- package/script/std/path/posix/dirname.d.ts +31 -0
- package/script/std/path/posix/dirname.js +66 -0
- package/script/std/path/posix/extname.d.ts +36 -0
- package/script/std/path/posix/extname.js +93 -0
- package/script/std/path/posix/format.d.ts +23 -0
- package/script/std/path/posix/format.js +32 -0
- package/script/std/path/posix/from_file_url.d.ts +16 -0
- package/script/std/path/posix/from_file_url.js +25 -0
- package/script/std/path/posix/glob_to_regexp.d.ts +71 -0
- package/script/std/path/posix/glob_to_regexp.js +86 -0
- package/script/std/path/posix/is_absolute.d.ts +16 -0
- package/script/std/path/posix/is_absolute.js +27 -0
- package/script/std/path/posix/join.d.ts +32 -0
- package/script/std/path/posix/join.js +46 -0
- package/script/std/path/posix/join_globs.d.ts +19 -0
- package/script/std/path/posix/join_globs.js +44 -0
- package/script/std/path/posix/normalize.d.ts +39 -0
- package/script/std/path/posix/normalize.js +61 -0
- package/script/std/path/posix/normalize_glob.d.ts +19 -0
- package/script/std/path/posix/normalize_glob.js +36 -0
- package/script/std/path/posix/parse.d.ts +24 -0
- package/script/std/path/posix/parse.js +119 -0
- package/script/std/path/posix/relative.d.ts +19 -0
- package/script/std/path/posix/relative.js +110 -0
- package/script/std/path/posix/resolve.d.ts +16 -0
- package/script/std/path/posix/resolve.js +86 -0
- package/script/std/path/posix/to_file_url.d.ts +17 -0
- package/script/std/path/posix/to_file_url.js +31 -0
- package/script/std/path/posix/to_namespaced_path.d.ts +15 -0
- package/script/std/path/posix/to_namespaced_path.js +24 -0
- package/script/std/path/relative.d.ts +23 -0
- package/script/std/path/relative.js +34 -0
- package/script/std/path/resolve.d.ts +21 -0
- package/script/std/path/resolve.js +34 -0
- package/script/std/path/to_file_url.d.ts +22 -0
- package/script/std/path/to_file_url.js +32 -0
- package/script/std/path/to_namespaced_path.d.ts +20 -0
- package/script/std/path/to_namespaced_path.js +33 -0
- package/script/{deps/deno.land/std@0.189.0/path/_interface.d.ts → std/path/types.d.ts} +13 -2
- package/script/{deps/deno.land/std@0.189.0/path/_interface.js → std/path/types.js} +1 -1
- package/script/std/path/windows/_util.d.ts +3 -0
- package/script/std/path/windows/_util.js +21 -0
- package/script/std/path/windows/basename.d.ts +22 -0
- package/script/std/path/windows/basename.js +48 -0
- package/script/std/path/windows/constants.d.ts +12 -0
- package/script/std/path/windows/constants.js +17 -0
- package/script/std/path/windows/dirname.d.ts +19 -0
- package/script/std/path/windows/dirname.js +116 -0
- package/script/std/path/windows/extname.d.ts +19 -0
- package/script/std/path/windows/extname.js +85 -0
- package/script/std/path/windows/format.d.ts +23 -0
- package/script/std/path/windows/format.js +32 -0
- package/script/std/path/windows/from_file_url.d.ts +18 -0
- package/script/std/path/windows/from_file_url.js +34 -0
- package/script/std/path/windows/glob_to_regexp.d.ts +70 -0
- package/script/std/path/windows/glob_to_regexp.js +86 -0
- package/script/std/path/windows/is_absolute.d.ts +16 -0
- package/script/std/path/windows/is_absolute.js +42 -0
- package/script/std/path/windows/join.d.ts +19 -0
- package/script/std/path/windows/join.js +78 -0
- package/script/std/path/windows/join_globs.d.ts +20 -0
- package/script/std/path/windows/join_globs.js +45 -0
- package/script/std/path/windows/normalize.d.ts +21 -0
- package/script/std/path/windows/normalize.js +138 -0
- package/script/std/path/windows/normalize_glob.d.ts +19 -0
- package/script/std/path/windows/normalize_glob.js +36 -0
- package/script/std/path/windows/parse.d.ts +24 -0
- package/script/std/path/windows/parse.js +180 -0
- package/script/std/path/windows/relative.d.ts +22 -0
- package/script/std/path/windows/relative.js +135 -0
- package/script/std/path/windows/resolve.d.ts +16 -0
- package/script/std/path/windows/resolve.js +181 -0
- package/script/std/path/windows/to_file_url.d.ts +17 -0
- package/script/std/path/windows/to_file_url.js +38 -0
- package/script/std/path/windows/to_namespaced_path.d.ts +16 -0
- package/script/std/path/windows/to_namespaced_path.js +53 -0
- package/script/std/semver/_constants.d.ts +15 -0
- package/script/std/semver/_constants.js +41 -0
- package/script/std/semver/_shared.d.ts +43 -0
- package/script/std/semver/_shared.js +174 -0
- package/script/std/semver/_test_comparator_set.d.ts +2 -0
- package/script/std/semver/_test_comparator_set.js +62 -0
- package/script/std/semver/can_parse.d.ts +16 -0
- package/script/std/semver/can_parse.js +31 -0
- package/script/std/semver/compare.d.ts +27 -0
- package/script/std/semver/compare.js +39 -0
- package/script/std/semver/difference.d.ts +26 -0
- package/script/std/semver/difference.js +45 -0
- package/script/std/semver/equals.d.ts +23 -0
- package/script/std/semver/equals.js +31 -0
- package/script/std/semver/format.d.ts +21 -0
- package/script/std/semver/format.js +36 -0
- package/script/std/semver/format_range.d.ts +17 -0
- package/script/std/semver/format_range.js +31 -0
- package/script/std/semver/greater_or_equal.d.ts +24 -0
- package/script/std/semver/greater_or_equal.js +30 -0
- package/script/std/semver/greater_than.d.ts +24 -0
- package/script/std/semver/greater_than.js +32 -0
- package/script/std/semver/greater_than_range.d.ts +22 -0
- package/script/std/semver/greater_than_range.js +62 -0
- package/{esm/deps/deno.land/std@0.205.0 → script/std}/semver/increment.d.ts +27 -5
- package/script/std/semver/increment.js +180 -0
- package/script/std/semver/is_range.d.ts +22 -0
- package/script/std/semver/is_range.js +42 -0
- package/{esm/deps/deno.land/std@0.205.0 → script/std}/semver/is_semver.d.ts +16 -0
- package/script/{deps/deno.land/std@0.205.0 → std}/semver/is_semver.js +26 -14
- package/script/std/semver/less_or_equal.d.ts +24 -0
- package/script/std/semver/less_or_equal.js +30 -0
- package/script/std/semver/less_than.d.ts +24 -0
- package/script/std/semver/less_than.js +30 -0
- package/script/std/semver/less_than_range.d.ts +22 -0
- package/script/std/semver/less_than_range.js +62 -0
- package/script/std/semver/max_satisfying.d.ts +21 -0
- package/script/std/semver/max_satisfying.js +34 -0
- package/script/std/semver/min_satisfying.d.ts +21 -0
- package/script/std/semver/min_satisfying.js +34 -0
- package/{esm/deps/deno.land/std@0.205.0 → script/std}/semver/mod.d.ts +72 -85
- package/script/{deps/deno.land/std@0.205.0 → std}/semver/mod.js +73 -87
- package/script/std/semver/not_equals.d.ts +23 -0
- package/script/std/semver/not_equals.js +29 -0
- package/script/std/semver/parse.d.ts +24 -0
- package/script/std/semver/parse.js +48 -0
- package/script/std/semver/parse_range.d.ts +26 -0
- package/script/std/semver/parse_range.js +362 -0
- package/script/std/semver/range_intersects.d.ts +24 -0
- package/script/std/semver/range_intersects.js +93 -0
- package/script/std/semver/satisfies.d.ts +23 -0
- package/script/std/semver/satisfies.js +30 -0
- package/script/std/semver/try_parse.d.ts +20 -0
- package/script/std/semver/try_parse.js +31 -0
- package/script/std/semver/try_parse_range.d.ts +22 -0
- package/script/std/semver/try_parse_range.js +37 -0
- package/script/std/semver/types.d.ts +57 -0
- package/script/std/semver/types.js +4 -0
- package/esm/bin.d.ts +0 -2
- package/esm/deps/deno.land/std@0.189.0/_util/asserts.d.ts +0 -10
- package/esm/deps/deno.land/std@0.189.0/_util/asserts.js +0 -21
- package/esm/deps/deno.land/std@0.189.0/_util/os.d.ts +0 -4
- package/esm/deps/deno.land/std@0.189.0/_util/os.js +0 -18
- package/esm/deps/deno.land/std@0.189.0/flags/mod.d.ts +0 -166
- package/esm/deps/deno.land/std@0.189.0/flags/mod.js +0 -365
- package/esm/deps/deno.land/std@0.189.0/path/_interface.js +0 -3
- package/esm/deps/deno.land/std@0.189.0/path/_util.d.ts +0 -11
- package/esm/deps/deno.land/std@0.189.0/path/_util.js +0 -161
- package/esm/deps/deno.land/std@0.189.0/path/common.d.ts +0 -13
- package/esm/deps/deno.land/std@0.189.0/path/common.js +0 -36
- package/esm/deps/deno.land/std@0.189.0/path/glob.js +0 -361
- package/esm/deps/deno.land/std@0.189.0/path/mod.d.ts +0 -11
- package/esm/deps/deno.land/std@0.189.0/path/mod.js +0 -35
- package/esm/deps/deno.land/std@0.189.0/path/posix.d.ts +0 -86
- package/esm/deps/deno.land/std@0.189.0/path/posix.js +0 -442
- package/esm/deps/deno.land/std@0.189.0/path/separator.d.ts +0 -2
- package/esm/deps/deno.land/std@0.189.0/path/separator.js +0 -5
- package/esm/deps/deno.land/std@0.189.0/path/win32.d.ts +0 -91
- package/esm/deps/deno.land/std@0.189.0/path/win32.js +0 -909
- package/esm/deps/deno.land/std@0.205.0/semver/_shared.d.ts +0 -42
- package/esm/deps/deno.land/std@0.205.0/semver/_shared.js +0 -230
- package/esm/deps/deno.land/std@0.205.0/semver/cmp.d.ts +0 -9
- package/esm/deps/deno.land/std@0.205.0/semver/cmp.js +0 -35
- package/esm/deps/deno.land/std@0.205.0/semver/comparator_format.d.ts +0 -8
- package/esm/deps/deno.land/std@0.205.0/semver/comparator_format.js +0 -11
- package/esm/deps/deno.land/std@0.205.0/semver/comparator_intersects.d.ts +0 -8
- package/esm/deps/deno.land/std@0.205.0/semver/comparator_intersects.js +0 -45
- package/esm/deps/deno.land/std@0.205.0/semver/comparator_max.d.ts +0 -9
- package/esm/deps/deno.land/std@0.205.0/semver/comparator_max.js +0 -45
- package/esm/deps/deno.land/std@0.205.0/semver/comparator_min.d.ts +0 -8
- package/esm/deps/deno.land/std@0.205.0/semver/comparator_min.js +0 -32
- package/esm/deps/deno.land/std@0.205.0/semver/compare.d.ts +0 -10
- package/esm/deps/deno.land/std@0.205.0/semver/compare.js +0 -18
- package/esm/deps/deno.land/std@0.205.0/semver/compare_build.d.ts +0 -13
- package/esm/deps/deno.land/std@0.205.0/semver/compare_build.js +0 -23
- package/esm/deps/deno.land/std@0.205.0/semver/constants.d.ts +0 -42
- package/esm/deps/deno.land/std@0.205.0/semver/constants.js +0 -75
- package/esm/deps/deno.land/std@0.205.0/semver/difference.d.ts +0 -4
- package/esm/deps/deno.land/std@0.205.0/semver/difference.js +0 -26
- package/esm/deps/deno.land/std@0.205.0/semver/eq.d.ts +0 -4
- package/esm/deps/deno.land/std@0.205.0/semver/eq.js +0 -7
- package/esm/deps/deno.land/std@0.205.0/semver/format.d.ts +0 -12
- package/esm/deps/deno.land/std@0.205.0/semver/format.js +0 -54
- package/esm/deps/deno.land/std@0.205.0/semver/gt.d.ts +0 -3
- package/esm/deps/deno.land/std@0.205.0/semver/gt.js +0 -5
- package/esm/deps/deno.land/std@0.205.0/semver/gte.d.ts +0 -3
- package/esm/deps/deno.land/std@0.205.0/semver/gte.js +0 -5
- package/esm/deps/deno.land/std@0.205.0/semver/gtr.d.ts +0 -3
- package/esm/deps/deno.land/std@0.205.0/semver/gtr.js +0 -5
- package/esm/deps/deno.land/std@0.205.0/semver/increment.js +0 -207
- package/esm/deps/deno.land/std@0.205.0/semver/is_semver_comparator.d.ts +0 -12
- package/esm/deps/deno.land/std@0.205.0/semver/is_semver_comparator.js +0 -31
- package/esm/deps/deno.land/std@0.205.0/semver/is_semver_range.d.ts +0 -12
- package/esm/deps/deno.land/std@0.205.0/semver/is_semver_range.js +0 -22
- package/esm/deps/deno.land/std@0.205.0/semver/lt.d.ts +0 -3
- package/esm/deps/deno.land/std@0.205.0/semver/lt.js +0 -5
- package/esm/deps/deno.land/std@0.205.0/semver/lte.d.ts +0 -3
- package/esm/deps/deno.land/std@0.205.0/semver/lte.js +0 -5
- package/esm/deps/deno.land/std@0.205.0/semver/ltr.d.ts +0 -3
- package/esm/deps/deno.land/std@0.205.0/semver/ltr.js +0 -5
- package/esm/deps/deno.land/std@0.205.0/semver/max_satisfying.d.ts +0 -9
- package/esm/deps/deno.land/std@0.205.0/semver/max_satisfying.js +0 -14
- package/esm/deps/deno.land/std@0.205.0/semver/min_satisfying.d.ts +0 -9
- package/esm/deps/deno.land/std@0.205.0/semver/min_satisfying.js +0 -14
- package/esm/deps/deno.land/std@0.205.0/semver/neq.d.ts +0 -3
- package/esm/deps/deno.land/std@0.205.0/semver/neq.js +0 -5
- package/esm/deps/deno.land/std@0.205.0/semver/outside.d.ts +0 -11
- package/esm/deps/deno.land/std@0.205.0/semver/outside.js +0 -67
- package/esm/deps/deno.land/std@0.205.0/semver/parse.d.ts +0 -8
- package/esm/deps/deno.land/std@0.205.0/semver/parse.js +0 -66
- package/esm/deps/deno.land/std@0.205.0/semver/parse_comparator.d.ts +0 -7
- package/esm/deps/deno.land/std@0.205.0/semver/parse_comparator.js +0 -28
- package/esm/deps/deno.land/std@0.205.0/semver/parse_range.d.ts +0 -7
- package/esm/deps/deno.land/std@0.205.0/semver/parse_range.js +0 -292
- package/esm/deps/deno.land/std@0.205.0/semver/range_format.d.ts +0 -8
- package/esm/deps/deno.land/std@0.205.0/semver/range_format.js +0 -11
- package/esm/deps/deno.land/std@0.205.0/semver/range_intersects.d.ts +0 -8
- package/esm/deps/deno.land/std@0.205.0/semver/range_intersects.js +0 -35
- package/esm/deps/deno.land/std@0.205.0/semver/range_max.d.ts +0 -7
- package/esm/deps/deno.land/std@0.205.0/semver/range_max.js +0 -15
- package/esm/deps/deno.land/std@0.205.0/semver/range_min.d.ts +0 -7
- package/esm/deps/deno.land/std@0.205.0/semver/range_min.js +0 -14
- package/esm/deps/deno.land/std@0.205.0/semver/rcompare.d.ts +0 -8
- package/esm/deps/deno.land/std@0.205.0/semver/rcompare.js +0 -10
- package/esm/deps/deno.land/std@0.205.0/semver/rsort.d.ts +0 -3
- package/esm/deps/deno.land/std@0.205.0/semver/rsort.js +0 -5
- package/esm/deps/deno.land/std@0.205.0/semver/sort.d.ts +0 -3
- package/esm/deps/deno.land/std@0.205.0/semver/sort.js +0 -5
- package/esm/deps/deno.land/std@0.205.0/semver/test_comparator.d.ts +0 -8
- package/esm/deps/deno.land/std@0.205.0/semver/test_comparator.js +0 -10
- package/esm/deps/deno.land/std@0.205.0/semver/test_range.d.ts +0 -8
- package/esm/deps/deno.land/std@0.205.0/semver/test_range.js +0 -16
- package/esm/deps/deno.land/std@0.205.0/semver/types.d.ts +0 -44
- package/esm/deps/deno.land/std@0.205.0/semver/types.js +0 -2
- package/esm/deps/deno.land/std@0.51.0/fs/eol.d.ts +0 -12
- package/esm/deps/deno.land/std@0.51.0/fs/eol.js +0 -29
- package/esm/deps/deno.land/x/ini@v2.1.0/ini.d.ts +0 -53
- package/esm/deps/deno.land/x/ini@v2.1.0/ini.js +0 -226
- package/esm/deps/deno.land/x/ini@v2.1.0/mod.d.ts +0 -1
- package/esm/deps/deno.land/x/ini@v2.1.0/mod.js +0 -1
- package/esm/src/Change.d.ts +0 -8
- package/esm/src/Change.js +0 -48
- package/esm/src/Changelog.d.ts +0 -23
- package/esm/src/Changelog.js +0 -183
- package/esm/src/Release.d.ts +0 -28
- package/esm/src/Release.js +0 -220
- package/esm/src/deps.d.ts +0 -2
- package/esm/src/deps.js +0 -1
- package/esm/src/parser.d.ts +0 -11
- package/esm/src/parser.js +0 -178
- package/esm/src/settings.d.ts +0 -17
- package/esm/src/settings.js +0 -47
- package/script/bin.d.ts +0 -2
- package/script/deps/deno.land/std@0.189.0/_util/asserts.d.ts +0 -10
- package/script/deps/deno.land/std@0.189.0/_util/asserts.js +0 -27
- package/script/deps/deno.land/std@0.189.0/_util/os.d.ts +0 -4
- package/script/deps/deno.land/std@0.189.0/flags/mod.d.ts +0 -166
- package/script/deps/deno.land/std@0.189.0/flags/mod.js +0 -369
- package/script/deps/deno.land/std@0.189.0/path/_util.d.ts +0 -11
- package/script/deps/deno.land/std@0.189.0/path/_util.js +0 -174
- package/script/deps/deno.land/std@0.189.0/path/common.d.ts +0 -13
- package/script/deps/deno.land/std@0.189.0/path/common.js +0 -40
- package/script/deps/deno.land/std@0.189.0/path/glob.js +0 -391
- package/script/deps/deno.land/std@0.189.0/path/mod.d.ts +0 -11
- package/script/deps/deno.land/std@0.189.0/path/mod.js +0 -66
- package/script/deps/deno.land/std@0.189.0/path/posix.d.ts +0 -86
- package/script/deps/deno.land/std@0.189.0/path/posix.js +0 -481
- package/script/deps/deno.land/std@0.189.0/path/separator.d.ts +0 -2
- package/script/deps/deno.land/std@0.189.0/path/separator.js +0 -8
- package/script/deps/deno.land/std@0.189.0/path/win32.d.ts +0 -91
- package/script/deps/deno.land/std@0.189.0/path/win32.js +0 -948
- package/script/deps/deno.land/std@0.205.0/semver/_shared.d.ts +0 -42
- package/script/deps/deno.land/std@0.205.0/semver/_shared.js +0 -248
- package/script/deps/deno.land/std@0.205.0/semver/cmp.d.ts +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/cmp.js +0 -39
- package/script/deps/deno.land/std@0.205.0/semver/comparator_format.d.ts +0 -8
- package/script/deps/deno.land/std@0.205.0/semver/comparator_format.js +0 -15
- package/script/deps/deno.land/std@0.205.0/semver/comparator_intersects.d.ts +0 -8
- package/script/deps/deno.land/std@0.205.0/semver/comparator_intersects.js +0 -49
- package/script/deps/deno.land/std@0.205.0/semver/comparator_max.d.ts +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/comparator_max.js +0 -49
- package/script/deps/deno.land/std@0.205.0/semver/comparator_min.d.ts +0 -8
- package/script/deps/deno.land/std@0.205.0/semver/comparator_min.js +0 -36
- package/script/deps/deno.land/std@0.205.0/semver/compare.d.ts +0 -10
- package/script/deps/deno.land/std@0.205.0/semver/compare.js +0 -22
- package/script/deps/deno.land/std@0.205.0/semver/compare_build.d.ts +0 -13
- package/script/deps/deno.land/std@0.205.0/semver/compare_build.js +0 -27
- package/script/deps/deno.land/std@0.205.0/semver/constants.d.ts +0 -42
- package/script/deps/deno.land/std@0.205.0/semver/constants.js +0 -78
- package/script/deps/deno.land/std@0.205.0/semver/difference.d.ts +0 -4
- package/script/deps/deno.land/std@0.205.0/semver/difference.js +0 -30
- package/script/deps/deno.land/std@0.205.0/semver/eq.d.ts +0 -4
- package/script/deps/deno.land/std@0.205.0/semver/eq.js +0 -11
- package/script/deps/deno.land/std@0.205.0/semver/format.d.ts +0 -12
- package/script/deps/deno.land/std@0.205.0/semver/format.js +0 -58
- package/script/deps/deno.land/std@0.205.0/semver/gt.d.ts +0 -3
- package/script/deps/deno.land/std@0.205.0/semver/gt.js +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/gte.d.ts +0 -3
- package/script/deps/deno.land/std@0.205.0/semver/gte.js +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/gtr.d.ts +0 -3
- package/script/deps/deno.land/std@0.205.0/semver/gtr.js +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/increment.js +0 -211
- package/script/deps/deno.land/std@0.205.0/semver/is_semver_comparator.d.ts +0 -12
- package/script/deps/deno.land/std@0.205.0/semver/is_semver_comparator.js +0 -35
- package/script/deps/deno.land/std@0.205.0/semver/is_semver_range.d.ts +0 -12
- package/script/deps/deno.land/std@0.205.0/semver/is_semver_range.js +0 -26
- package/script/deps/deno.land/std@0.205.0/semver/lt.d.ts +0 -3
- package/script/deps/deno.land/std@0.205.0/semver/lt.js +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/lte.d.ts +0 -3
- package/script/deps/deno.land/std@0.205.0/semver/lte.js +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/ltr.d.ts +0 -3
- package/script/deps/deno.land/std@0.205.0/semver/ltr.js +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/max_satisfying.d.ts +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/max_satisfying.js +0 -18
- package/script/deps/deno.land/std@0.205.0/semver/min_satisfying.d.ts +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/min_satisfying.js +0 -18
- package/script/deps/deno.land/std@0.205.0/semver/neq.d.ts +0 -3
- package/script/deps/deno.land/std@0.205.0/semver/neq.js +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/outside.d.ts +0 -11
- package/script/deps/deno.land/std@0.205.0/semver/outside.js +0 -71
- package/script/deps/deno.land/std@0.205.0/semver/parse.d.ts +0 -8
- package/script/deps/deno.land/std@0.205.0/semver/parse.js +0 -70
- package/script/deps/deno.land/std@0.205.0/semver/parse_comparator.d.ts +0 -7
- package/script/deps/deno.land/std@0.205.0/semver/parse_comparator.js +0 -32
- package/script/deps/deno.land/std@0.205.0/semver/parse_range.d.ts +0 -7
- package/script/deps/deno.land/std@0.205.0/semver/parse_range.js +0 -296
- package/script/deps/deno.land/std@0.205.0/semver/range_format.d.ts +0 -8
- package/script/deps/deno.land/std@0.205.0/semver/range_format.js +0 -15
- package/script/deps/deno.land/std@0.205.0/semver/range_intersects.d.ts +0 -8
- package/script/deps/deno.land/std@0.205.0/semver/range_intersects.js +0 -39
- package/script/deps/deno.land/std@0.205.0/semver/range_max.d.ts +0 -7
- package/script/deps/deno.land/std@0.205.0/semver/range_max.js +0 -19
- package/script/deps/deno.land/std@0.205.0/semver/range_min.d.ts +0 -7
- package/script/deps/deno.land/std@0.205.0/semver/range_min.js +0 -18
- package/script/deps/deno.land/std@0.205.0/semver/rcompare.d.ts +0 -8
- package/script/deps/deno.land/std@0.205.0/semver/rcompare.js +0 -14
- package/script/deps/deno.land/std@0.205.0/semver/rsort.d.ts +0 -3
- package/script/deps/deno.land/std@0.205.0/semver/rsort.js +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/sort.d.ts +0 -3
- package/script/deps/deno.land/std@0.205.0/semver/sort.js +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/test_comparator.d.ts +0 -8
- package/script/deps/deno.land/std@0.205.0/semver/test_comparator.js +0 -14
- package/script/deps/deno.land/std@0.205.0/semver/test_range.d.ts +0 -8
- package/script/deps/deno.land/std@0.205.0/semver/test_range.js +0 -20
- package/script/deps/deno.land/std@0.205.0/semver/types.d.ts +0 -44
- package/script/deps/deno.land/std@0.205.0/semver/types.js +0 -3
- package/script/deps/deno.land/std@0.51.0/fs/eol.d.ts +0 -12
- package/script/deps/deno.land/std@0.51.0/fs/eol.js +0 -34
- package/script/deps/deno.land/x/ini@v2.1.0/ini.d.ts +0 -53
- package/script/deps/deno.land/x/ini@v2.1.0/ini.js +0 -256
- package/script/deps/deno.land/x/ini@v2.1.0/mod.d.ts +0 -1
- package/script/deps/deno.land/x/ini@v2.1.0/mod.js +0 -17
- package/script/src/Change.d.ts +0 -8
- package/script/src/Change.js +0 -51
- package/script/src/Changelog.d.ts +0 -23
- package/script/src/Changelog.js +0 -186
- package/script/src/Release.d.ts +0 -28
- package/script/src/Release.js +0 -226
- package/script/src/deps.d.ts +0 -2
- package/script/src/deps.js +0 -8
- package/script/src/parser.d.ts +0 -11
- package/script/src/parser.js +0 -184
- package/script/src/settings.d.ts +0 -17
- package/script/src/settings.js +0 -51
- /package/esm/{test → keep-a-changelog/test}/changelog.custom.type.md +0 -0
- /package/esm/{test → keep-a-changelog/test}/changelog.expected.linted.md +0 -0
- /package/esm/{test → keep-a-changelog/test}/changelog.expected.md +0 -0
- /package/esm/{test → keep-a-changelog/test}/changelog.gitlab.md +0 -0
- /package/esm/{test → keep-a-changelog/test}/changelog.md +0 -0
- /package/esm/{test → keep-a-changelog/test}/empty.expected.md +0 -0
- /package/esm/{deps/deno.land/std@0.189.0/path/_constants.d.ts → std/path/_common/constants.d.ts} +0 -0
- /package/script/{test → keep-a-changelog/test}/changelog.custom.type.md +0 -0
- /package/script/{test → keep-a-changelog/test}/changelog.expected.linted.md +0 -0
- /package/script/{test → keep-a-changelog/test}/changelog.expected.md +0 -0
- /package/script/{test → keep-a-changelog/test}/changelog.gitlab.md +0 -0
- /package/script/{test → keep-a-changelog/test}/changelog.md +0 -0
- /package/script/{test → keep-a-changelog/test}/empty.expected.md +0 -0
- /package/script/{deps/deno.land/std@0.189.0/path/_constants.d.ts → std/path/_common/constants.d.ts} +0 -0
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import type { FormatInputPathObject, ParsedPath } from "./_interface.js";
|
|
3
|
-
export declare const sep = "/";
|
|
4
|
-
export declare const delimiter = ":";
|
|
5
|
-
/**
|
|
6
|
-
* Resolves `pathSegments` into an absolute path.
|
|
7
|
-
* @param pathSegments an array of path segments
|
|
8
|
-
*/
|
|
9
|
-
export declare function resolve(...pathSegments: string[]): string;
|
|
10
|
-
/**
|
|
11
|
-
* Normalize the `path`, resolving `'..'` and `'.'` segments.
|
|
12
|
-
* Note that resolving these segments does not necessarily mean that all will be eliminated.
|
|
13
|
-
* A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
|
|
14
|
-
* @param path to be normalized
|
|
15
|
-
*/
|
|
16
|
-
export declare function normalize(path: string): string;
|
|
17
|
-
/**
|
|
18
|
-
* Verifies whether provided path is absolute
|
|
19
|
-
* @param path to be verified as absolute
|
|
20
|
-
*/
|
|
21
|
-
export declare function isAbsolute(path: string): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Join all given a sequence of `paths`,then normalizes the resulting path.
|
|
24
|
-
* @param paths to be joined and normalized
|
|
25
|
-
*/
|
|
26
|
-
export declare function join(...paths: string[]): string;
|
|
27
|
-
/**
|
|
28
|
-
* Return the relative path from `from` to `to` based on current working directory.
|
|
29
|
-
* @param from path in current working directory
|
|
30
|
-
* @param to path in current working directory
|
|
31
|
-
*/
|
|
32
|
-
export declare function relative(from: string, to: string): string;
|
|
33
|
-
/**
|
|
34
|
-
* Resolves path to a namespace path
|
|
35
|
-
* @param path to resolve to namespace
|
|
36
|
-
*/
|
|
37
|
-
export declare function toNamespacedPath(path: string): string;
|
|
38
|
-
/**
|
|
39
|
-
* Return the directory path of a `path`.
|
|
40
|
-
* @param path - path to extract the directory from.
|
|
41
|
-
*/
|
|
42
|
-
export declare function dirname(path: string): string;
|
|
43
|
-
/**
|
|
44
|
-
* Return the last portion of a `path`.
|
|
45
|
-
* Trailing directory separators are ignored, and optional suffix is removed.
|
|
46
|
-
*
|
|
47
|
-
* @param path - path to extract the name from.
|
|
48
|
-
* @param [suffix] - suffix to remove from extracted name.
|
|
49
|
-
*/
|
|
50
|
-
export declare function basename(path: string, suffix?: string): string;
|
|
51
|
-
/**
|
|
52
|
-
* Return the extension of the `path` with leading period.
|
|
53
|
-
* @param path with extension
|
|
54
|
-
* @returns extension (ex. for `file.ts` returns `.ts`)
|
|
55
|
-
*/
|
|
56
|
-
export declare function extname(path: string): string;
|
|
57
|
-
/**
|
|
58
|
-
* Generate a path from `FormatInputPathObject` object.
|
|
59
|
-
* @param pathObject with path
|
|
60
|
-
*/
|
|
61
|
-
export declare function format(pathObject: FormatInputPathObject): string;
|
|
62
|
-
/**
|
|
63
|
-
* Return a `ParsedPath` object of the `path`.
|
|
64
|
-
* @param path to process
|
|
65
|
-
*/
|
|
66
|
-
export declare function parse(path: string): ParsedPath;
|
|
67
|
-
/**
|
|
68
|
-
* Converts a file URL to a path string.
|
|
69
|
-
*
|
|
70
|
-
* ```ts
|
|
71
|
-
* import { fromFileUrl } from "https://deno.land/std@$STD_VERSION/path/posix.ts";
|
|
72
|
-
* fromFileUrl("file:///home/foo"); // "/home/foo"
|
|
73
|
-
* ```
|
|
74
|
-
* @param url of a file URL
|
|
75
|
-
*/
|
|
76
|
-
export declare function fromFileUrl(url: string | URL): string;
|
|
77
|
-
/**
|
|
78
|
-
* Converts a path string to a file URL.
|
|
79
|
-
*
|
|
80
|
-
* ```ts
|
|
81
|
-
* import { toFileUrl } from "https://deno.land/std@$STD_VERSION/path/posix.ts";
|
|
82
|
-
* toFileUrl("/home/foo"); // new URL("file:///home/foo")
|
|
83
|
-
* ```
|
|
84
|
-
* @param path to convert to file URL
|
|
85
|
-
*/
|
|
86
|
-
export declare function toFileUrl(path: string): URL;
|
|
@@ -1,442 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
-
// Copyright the Browserify authors. MIT License.
|
|
3
|
-
// Ported from https://github.com/browserify/path-browserify/
|
|
4
|
-
// This module is browser compatible.
|
|
5
|
-
import * as dntShim from "../../../../_dnt.shims.js";
|
|
6
|
-
import { CHAR_DOT } from "./_constants.js";
|
|
7
|
-
import { _format, assertPath, encodeWhitespace, isPosixPathSeparator, lastPathSegment, normalizeString, stripSuffix, stripTrailingSeparators, } from "./_util.js";
|
|
8
|
-
export const sep = "/";
|
|
9
|
-
export const delimiter = ":";
|
|
10
|
-
// path.resolve([from ...], to)
|
|
11
|
-
/**
|
|
12
|
-
* Resolves `pathSegments` into an absolute path.
|
|
13
|
-
* @param pathSegments an array of path segments
|
|
14
|
-
*/
|
|
15
|
-
export function resolve(...pathSegments) {
|
|
16
|
-
let resolvedPath = "";
|
|
17
|
-
let resolvedAbsolute = false;
|
|
18
|
-
for (let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
|
19
|
-
let path;
|
|
20
|
-
if (i >= 0)
|
|
21
|
-
path = pathSegments[i];
|
|
22
|
-
else {
|
|
23
|
-
// deno-lint-ignore no-explicit-any
|
|
24
|
-
const { Deno } = dntShim.dntGlobalThis;
|
|
25
|
-
if (typeof Deno?.cwd !== "function") {
|
|
26
|
-
throw new TypeError("Resolved a relative path without a CWD.");
|
|
27
|
-
}
|
|
28
|
-
path = Deno.cwd();
|
|
29
|
-
}
|
|
30
|
-
assertPath(path);
|
|
31
|
-
// Skip empty entries
|
|
32
|
-
if (path.length === 0) {
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
resolvedPath = `${path}/${resolvedPath}`;
|
|
36
|
-
resolvedAbsolute = isPosixPathSeparator(path.charCodeAt(0));
|
|
37
|
-
}
|
|
38
|
-
// At this point the path should be resolved to a full absolute path, but
|
|
39
|
-
// handle relative paths to be safe (might happen when process.cwd() fails)
|
|
40
|
-
// Normalize the path
|
|
41
|
-
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, "/", isPosixPathSeparator);
|
|
42
|
-
if (resolvedAbsolute) {
|
|
43
|
-
if (resolvedPath.length > 0)
|
|
44
|
-
return `/${resolvedPath}`;
|
|
45
|
-
else
|
|
46
|
-
return "/";
|
|
47
|
-
}
|
|
48
|
-
else if (resolvedPath.length > 0)
|
|
49
|
-
return resolvedPath;
|
|
50
|
-
else
|
|
51
|
-
return ".";
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Normalize the `path`, resolving `'..'` and `'.'` segments.
|
|
55
|
-
* Note that resolving these segments does not necessarily mean that all will be eliminated.
|
|
56
|
-
* A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
|
|
57
|
-
* @param path to be normalized
|
|
58
|
-
*/
|
|
59
|
-
export function normalize(path) {
|
|
60
|
-
assertPath(path);
|
|
61
|
-
if (path.length === 0)
|
|
62
|
-
return ".";
|
|
63
|
-
const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));
|
|
64
|
-
const trailingSeparator = isPosixPathSeparator(path.charCodeAt(path.length - 1));
|
|
65
|
-
// Normalize the path
|
|
66
|
-
path = normalizeString(path, !isAbsolute, "/", isPosixPathSeparator);
|
|
67
|
-
if (path.length === 0 && !isAbsolute)
|
|
68
|
-
path = ".";
|
|
69
|
-
if (path.length > 0 && trailingSeparator)
|
|
70
|
-
path += "/";
|
|
71
|
-
if (isAbsolute)
|
|
72
|
-
return `/${path}`;
|
|
73
|
-
return path;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Verifies whether provided path is absolute
|
|
77
|
-
* @param path to be verified as absolute
|
|
78
|
-
*/
|
|
79
|
-
export function isAbsolute(path) {
|
|
80
|
-
assertPath(path);
|
|
81
|
-
return path.length > 0 && isPosixPathSeparator(path.charCodeAt(0));
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Join all given a sequence of `paths`,then normalizes the resulting path.
|
|
85
|
-
* @param paths to be joined and normalized
|
|
86
|
-
*/
|
|
87
|
-
export function join(...paths) {
|
|
88
|
-
if (paths.length === 0)
|
|
89
|
-
return ".";
|
|
90
|
-
let joined;
|
|
91
|
-
for (let i = 0, len = paths.length; i < len; ++i) {
|
|
92
|
-
const path = paths[i];
|
|
93
|
-
assertPath(path);
|
|
94
|
-
if (path.length > 0) {
|
|
95
|
-
if (!joined)
|
|
96
|
-
joined = path;
|
|
97
|
-
else
|
|
98
|
-
joined += `/${path}`;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
if (!joined)
|
|
102
|
-
return ".";
|
|
103
|
-
return normalize(joined);
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Return the relative path from `from` to `to` based on current working directory.
|
|
107
|
-
* @param from path in current working directory
|
|
108
|
-
* @param to path in current working directory
|
|
109
|
-
*/
|
|
110
|
-
export function relative(from, to) {
|
|
111
|
-
assertPath(from);
|
|
112
|
-
assertPath(to);
|
|
113
|
-
if (from === to)
|
|
114
|
-
return "";
|
|
115
|
-
from = resolve(from);
|
|
116
|
-
to = resolve(to);
|
|
117
|
-
if (from === to)
|
|
118
|
-
return "";
|
|
119
|
-
// Trim any leading backslashes
|
|
120
|
-
let fromStart = 1;
|
|
121
|
-
const fromEnd = from.length;
|
|
122
|
-
for (; fromStart < fromEnd; ++fromStart) {
|
|
123
|
-
if (!isPosixPathSeparator(from.charCodeAt(fromStart)))
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
const fromLen = fromEnd - fromStart;
|
|
127
|
-
// Trim any leading backslashes
|
|
128
|
-
let toStart = 1;
|
|
129
|
-
const toEnd = to.length;
|
|
130
|
-
for (; toStart < toEnd; ++toStart) {
|
|
131
|
-
if (!isPosixPathSeparator(to.charCodeAt(toStart)))
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
const toLen = toEnd - toStart;
|
|
135
|
-
// Compare paths to find the longest common path from root
|
|
136
|
-
const length = fromLen < toLen ? fromLen : toLen;
|
|
137
|
-
let lastCommonSep = -1;
|
|
138
|
-
let i = 0;
|
|
139
|
-
for (; i <= length; ++i) {
|
|
140
|
-
if (i === length) {
|
|
141
|
-
if (toLen > length) {
|
|
142
|
-
if (isPosixPathSeparator(to.charCodeAt(toStart + i))) {
|
|
143
|
-
// We get here if `from` is the exact base path for `to`.
|
|
144
|
-
// For example: from='/foo/bar'; to='/foo/bar/baz'
|
|
145
|
-
return to.slice(toStart + i + 1);
|
|
146
|
-
}
|
|
147
|
-
else if (i === 0) {
|
|
148
|
-
// We get here if `from` is the root
|
|
149
|
-
// For example: from='/'; to='/foo'
|
|
150
|
-
return to.slice(toStart + i);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
else if (fromLen > length) {
|
|
154
|
-
if (isPosixPathSeparator(from.charCodeAt(fromStart + i))) {
|
|
155
|
-
// We get here if `to` is the exact base path for `from`.
|
|
156
|
-
// For example: from='/foo/bar/baz'; to='/foo/bar'
|
|
157
|
-
lastCommonSep = i;
|
|
158
|
-
}
|
|
159
|
-
else if (i === 0) {
|
|
160
|
-
// We get here if `to` is the root.
|
|
161
|
-
// For example: from='/foo'; to='/'
|
|
162
|
-
lastCommonSep = 0;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
break;
|
|
166
|
-
}
|
|
167
|
-
const fromCode = from.charCodeAt(fromStart + i);
|
|
168
|
-
const toCode = to.charCodeAt(toStart + i);
|
|
169
|
-
if (fromCode !== toCode)
|
|
170
|
-
break;
|
|
171
|
-
else if (isPosixPathSeparator(fromCode))
|
|
172
|
-
lastCommonSep = i;
|
|
173
|
-
}
|
|
174
|
-
let out = "";
|
|
175
|
-
// Generate the relative path based on the path difference between `to`
|
|
176
|
-
// and `from`
|
|
177
|
-
for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
|
|
178
|
-
if (i === fromEnd || isPosixPathSeparator(from.charCodeAt(i))) {
|
|
179
|
-
if (out.length === 0)
|
|
180
|
-
out += "..";
|
|
181
|
-
else
|
|
182
|
-
out += "/..";
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
// Lastly, append the rest of the destination (`to`) path that comes after
|
|
186
|
-
// the common path parts
|
|
187
|
-
if (out.length > 0)
|
|
188
|
-
return out + to.slice(toStart + lastCommonSep);
|
|
189
|
-
else {
|
|
190
|
-
toStart += lastCommonSep;
|
|
191
|
-
if (isPosixPathSeparator(to.charCodeAt(toStart)))
|
|
192
|
-
++toStart;
|
|
193
|
-
return to.slice(toStart);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Resolves path to a namespace path
|
|
198
|
-
* @param path to resolve to namespace
|
|
199
|
-
*/
|
|
200
|
-
export function toNamespacedPath(path) {
|
|
201
|
-
// Non-op on posix systems
|
|
202
|
-
return path;
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Return the directory path of a `path`.
|
|
206
|
-
* @param path - path to extract the directory from.
|
|
207
|
-
*/
|
|
208
|
-
export function dirname(path) {
|
|
209
|
-
if (path.length === 0)
|
|
210
|
-
return ".";
|
|
211
|
-
let end = -1;
|
|
212
|
-
let matchedNonSeparator = false;
|
|
213
|
-
for (let i = path.length - 1; i >= 1; --i) {
|
|
214
|
-
if (isPosixPathSeparator(path.charCodeAt(i))) {
|
|
215
|
-
if (matchedNonSeparator) {
|
|
216
|
-
end = i;
|
|
217
|
-
break;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
else {
|
|
221
|
-
matchedNonSeparator = true;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
// No matches. Fallback based on provided path:
|
|
225
|
-
//
|
|
226
|
-
// - leading slashes paths
|
|
227
|
-
// "/foo" => "/"
|
|
228
|
-
// "///foo" => "/"
|
|
229
|
-
// - no slash path
|
|
230
|
-
// "foo" => "."
|
|
231
|
-
if (end === -1) {
|
|
232
|
-
return isPosixPathSeparator(path.charCodeAt(0)) ? "/" : ".";
|
|
233
|
-
}
|
|
234
|
-
return stripTrailingSeparators(path.slice(0, end), isPosixPathSeparator);
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Return the last portion of a `path`.
|
|
238
|
-
* Trailing directory separators are ignored, and optional suffix is removed.
|
|
239
|
-
*
|
|
240
|
-
* @param path - path to extract the name from.
|
|
241
|
-
* @param [suffix] - suffix to remove from extracted name.
|
|
242
|
-
*/
|
|
243
|
-
export function basename(path, suffix = "") {
|
|
244
|
-
assertPath(path);
|
|
245
|
-
if (path.length === 0)
|
|
246
|
-
return path;
|
|
247
|
-
if (typeof suffix !== "string") {
|
|
248
|
-
throw new TypeError(`Suffix must be a string. Received ${JSON.stringify(suffix)}`);
|
|
249
|
-
}
|
|
250
|
-
const lastSegment = lastPathSegment(path, isPosixPathSeparator);
|
|
251
|
-
const strippedSegment = stripTrailingSeparators(lastSegment, isPosixPathSeparator);
|
|
252
|
-
return suffix ? stripSuffix(strippedSegment, suffix) : strippedSegment;
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Return the extension of the `path` with leading period.
|
|
256
|
-
* @param path with extension
|
|
257
|
-
* @returns extension (ex. for `file.ts` returns `.ts`)
|
|
258
|
-
*/
|
|
259
|
-
export function extname(path) {
|
|
260
|
-
assertPath(path);
|
|
261
|
-
let startDot = -1;
|
|
262
|
-
let startPart = 0;
|
|
263
|
-
let end = -1;
|
|
264
|
-
let matchedSlash = true;
|
|
265
|
-
// Track the state of characters (if any) we see before our first dot and
|
|
266
|
-
// after any path separator we find
|
|
267
|
-
let preDotState = 0;
|
|
268
|
-
for (let i = path.length - 1; i >= 0; --i) {
|
|
269
|
-
const code = path.charCodeAt(i);
|
|
270
|
-
if (isPosixPathSeparator(code)) {
|
|
271
|
-
// If we reached a path separator that was not part of a set of path
|
|
272
|
-
// separators at the end of the string, stop now
|
|
273
|
-
if (!matchedSlash) {
|
|
274
|
-
startPart = i + 1;
|
|
275
|
-
break;
|
|
276
|
-
}
|
|
277
|
-
continue;
|
|
278
|
-
}
|
|
279
|
-
if (end === -1) {
|
|
280
|
-
// We saw the first non-path separator, mark this as the end of our
|
|
281
|
-
// extension
|
|
282
|
-
matchedSlash = false;
|
|
283
|
-
end = i + 1;
|
|
284
|
-
}
|
|
285
|
-
if (code === CHAR_DOT) {
|
|
286
|
-
// If this is our first dot, mark it as the start of our extension
|
|
287
|
-
if (startDot === -1)
|
|
288
|
-
startDot = i;
|
|
289
|
-
else if (preDotState !== 1)
|
|
290
|
-
preDotState = 1;
|
|
291
|
-
}
|
|
292
|
-
else if (startDot !== -1) {
|
|
293
|
-
// We saw a non-dot and non-path separator before our dot, so we should
|
|
294
|
-
// have a good chance at having a non-empty extension
|
|
295
|
-
preDotState = -1;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
if (startDot === -1 ||
|
|
299
|
-
end === -1 ||
|
|
300
|
-
// We saw a non-dot character immediately before the dot
|
|
301
|
-
preDotState === 0 ||
|
|
302
|
-
// The (right-most) trimmed path component is exactly '..'
|
|
303
|
-
(preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)) {
|
|
304
|
-
return "";
|
|
305
|
-
}
|
|
306
|
-
return path.slice(startDot, end);
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* Generate a path from `FormatInputPathObject` object.
|
|
310
|
-
* @param pathObject with path
|
|
311
|
-
*/
|
|
312
|
-
export function format(pathObject) {
|
|
313
|
-
if (pathObject === null || typeof pathObject !== "object") {
|
|
314
|
-
throw new TypeError(`The "pathObject" argument must be of type Object. Received type ${typeof pathObject}`);
|
|
315
|
-
}
|
|
316
|
-
return _format("/", pathObject);
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* Return a `ParsedPath` object of the `path`.
|
|
320
|
-
* @param path to process
|
|
321
|
-
*/
|
|
322
|
-
export function parse(path) {
|
|
323
|
-
assertPath(path);
|
|
324
|
-
const ret = { root: "", dir: "", base: "", ext: "", name: "" };
|
|
325
|
-
if (path.length === 0)
|
|
326
|
-
return ret;
|
|
327
|
-
const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));
|
|
328
|
-
let start;
|
|
329
|
-
if (isAbsolute) {
|
|
330
|
-
ret.root = "/";
|
|
331
|
-
start = 1;
|
|
332
|
-
}
|
|
333
|
-
else {
|
|
334
|
-
start = 0;
|
|
335
|
-
}
|
|
336
|
-
let startDot = -1;
|
|
337
|
-
let startPart = 0;
|
|
338
|
-
let end = -1;
|
|
339
|
-
let matchedSlash = true;
|
|
340
|
-
let i = path.length - 1;
|
|
341
|
-
// Track the state of characters (if any) we see before our first dot and
|
|
342
|
-
// after any path separator we find
|
|
343
|
-
let preDotState = 0;
|
|
344
|
-
// Get non-dir info
|
|
345
|
-
for (; i >= start; --i) {
|
|
346
|
-
const code = path.charCodeAt(i);
|
|
347
|
-
if (isPosixPathSeparator(code)) {
|
|
348
|
-
// If we reached a path separator that was not part of a set of path
|
|
349
|
-
// separators at the end of the string, stop now
|
|
350
|
-
if (!matchedSlash) {
|
|
351
|
-
startPart = i + 1;
|
|
352
|
-
break;
|
|
353
|
-
}
|
|
354
|
-
continue;
|
|
355
|
-
}
|
|
356
|
-
if (end === -1) {
|
|
357
|
-
// We saw the first non-path separator, mark this as the end of our
|
|
358
|
-
// extension
|
|
359
|
-
matchedSlash = false;
|
|
360
|
-
end = i + 1;
|
|
361
|
-
}
|
|
362
|
-
if (code === CHAR_DOT) {
|
|
363
|
-
// If this is our first dot, mark it as the start of our extension
|
|
364
|
-
if (startDot === -1)
|
|
365
|
-
startDot = i;
|
|
366
|
-
else if (preDotState !== 1)
|
|
367
|
-
preDotState = 1;
|
|
368
|
-
}
|
|
369
|
-
else if (startDot !== -1) {
|
|
370
|
-
// We saw a non-dot and non-path separator before our dot, so we should
|
|
371
|
-
// have a good chance at having a non-empty extension
|
|
372
|
-
preDotState = -1;
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
if (startDot === -1 ||
|
|
376
|
-
end === -1 ||
|
|
377
|
-
// We saw a non-dot character immediately before the dot
|
|
378
|
-
preDotState === 0 ||
|
|
379
|
-
// The (right-most) trimmed path component is exactly '..'
|
|
380
|
-
(preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)) {
|
|
381
|
-
if (end !== -1) {
|
|
382
|
-
if (startPart === 0 && isAbsolute) {
|
|
383
|
-
ret.base = ret.name = path.slice(1, end);
|
|
384
|
-
}
|
|
385
|
-
else {
|
|
386
|
-
ret.base = ret.name = path.slice(startPart, end);
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
// Fallback to '/' in case there is no basename
|
|
390
|
-
ret.base = ret.base || "/";
|
|
391
|
-
}
|
|
392
|
-
else {
|
|
393
|
-
if (startPart === 0 && isAbsolute) {
|
|
394
|
-
ret.name = path.slice(1, startDot);
|
|
395
|
-
ret.base = path.slice(1, end);
|
|
396
|
-
}
|
|
397
|
-
else {
|
|
398
|
-
ret.name = path.slice(startPart, startDot);
|
|
399
|
-
ret.base = path.slice(startPart, end);
|
|
400
|
-
}
|
|
401
|
-
ret.ext = path.slice(startDot, end);
|
|
402
|
-
}
|
|
403
|
-
if (startPart > 0) {
|
|
404
|
-
ret.dir = stripTrailingSeparators(path.slice(0, startPart - 1), isPosixPathSeparator);
|
|
405
|
-
}
|
|
406
|
-
else if (isAbsolute)
|
|
407
|
-
ret.dir = "/";
|
|
408
|
-
return ret;
|
|
409
|
-
}
|
|
410
|
-
/**
|
|
411
|
-
* Converts a file URL to a path string.
|
|
412
|
-
*
|
|
413
|
-
* ```ts
|
|
414
|
-
* import { fromFileUrl } from "https://deno.land/std@$STD_VERSION/path/posix.ts";
|
|
415
|
-
* fromFileUrl("file:///home/foo"); // "/home/foo"
|
|
416
|
-
* ```
|
|
417
|
-
* @param url of a file URL
|
|
418
|
-
*/
|
|
419
|
-
export function fromFileUrl(url) {
|
|
420
|
-
url = url instanceof URL ? url : new URL(url);
|
|
421
|
-
if (url.protocol != "file:") {
|
|
422
|
-
throw new TypeError("Must be a file URL.");
|
|
423
|
-
}
|
|
424
|
-
return decodeURIComponent(url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"));
|
|
425
|
-
}
|
|
426
|
-
/**
|
|
427
|
-
* Converts a path string to a file URL.
|
|
428
|
-
*
|
|
429
|
-
* ```ts
|
|
430
|
-
* import { toFileUrl } from "https://deno.land/std@$STD_VERSION/path/posix.ts";
|
|
431
|
-
* toFileUrl("/home/foo"); // new URL("file:///home/foo")
|
|
432
|
-
* ```
|
|
433
|
-
* @param path to convert to file URL
|
|
434
|
-
*/
|
|
435
|
-
export function toFileUrl(path) {
|
|
436
|
-
if (!isAbsolute(path)) {
|
|
437
|
-
throw new TypeError("Must be an absolute path.");
|
|
438
|
-
}
|
|
439
|
-
const url = new URL("file:///");
|
|
440
|
-
url.pathname = encodeWhitespace(path.replace(/%/g, "%25").replace(/\\/g, "%5C"));
|
|
441
|
-
return url;
|
|
442
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import type { FormatInputPathObject, ParsedPath } from "./_interface.js";
|
|
3
|
-
export declare const sep = "\\";
|
|
4
|
-
export declare const delimiter = ";";
|
|
5
|
-
/**
|
|
6
|
-
* Resolves path segments into a `path`
|
|
7
|
-
* @param pathSegments to process to path
|
|
8
|
-
*/
|
|
9
|
-
export declare function resolve(...pathSegments: string[]): string;
|
|
10
|
-
/**
|
|
11
|
-
* Normalizes a `path`
|
|
12
|
-
* @param path to normalize
|
|
13
|
-
*/
|
|
14
|
-
export declare function normalize(path: string): string;
|
|
15
|
-
/**
|
|
16
|
-
* Verifies whether path is absolute
|
|
17
|
-
* @param path to verify
|
|
18
|
-
*/
|
|
19
|
-
export declare function isAbsolute(path: string): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Join all given a sequence of `paths`,then normalizes the resulting path.
|
|
22
|
-
* @param paths to be joined and normalized
|
|
23
|
-
*/
|
|
24
|
-
export declare function join(...paths: string[]): string;
|
|
25
|
-
/**
|
|
26
|
-
* It will solve the relative path from `from` to `to`, for instance:
|
|
27
|
-
* from = 'C:\\orandea\\test\\aaa'
|
|
28
|
-
* to = 'C:\\orandea\\impl\\bbb'
|
|
29
|
-
* The output of the function should be: '..\\..\\impl\\bbb'
|
|
30
|
-
* @param from relative path
|
|
31
|
-
* @param to relative path
|
|
32
|
-
*/
|
|
33
|
-
export declare function relative(from: string, to: string): string;
|
|
34
|
-
/**
|
|
35
|
-
* Resolves path to a namespace path
|
|
36
|
-
* @param path to resolve to namespace
|
|
37
|
-
*/
|
|
38
|
-
export declare function toNamespacedPath(path: string): string;
|
|
39
|
-
/**
|
|
40
|
-
* Return the directory path of a `path`.
|
|
41
|
-
* @param path - path to extract the directory from.
|
|
42
|
-
*/
|
|
43
|
-
export declare function dirname(path: string): string;
|
|
44
|
-
/**
|
|
45
|
-
* Return the last portion of a `path`.
|
|
46
|
-
* Trailing directory separators are ignored, and optional suffix is removed.
|
|
47
|
-
*
|
|
48
|
-
* @param path - path to extract name from.
|
|
49
|
-
* @param [suffix] - suffix to remove from extracted name.
|
|
50
|
-
*/
|
|
51
|
-
export declare function basename(path: string, suffix?: string): string;
|
|
52
|
-
/**
|
|
53
|
-
* Return the extension of the `path` with leading period.
|
|
54
|
-
* @param path with extension
|
|
55
|
-
* @returns extension (ex. for `file.ts` returns `.ts`)
|
|
56
|
-
*/
|
|
57
|
-
export declare function extname(path: string): string;
|
|
58
|
-
/**
|
|
59
|
-
* Generate a path from `FormatInputPathObject` object.
|
|
60
|
-
* @param pathObject with path
|
|
61
|
-
*/
|
|
62
|
-
export declare function format(pathObject: FormatInputPathObject): string;
|
|
63
|
-
/**
|
|
64
|
-
* Return a `ParsedPath` object of the `path`.
|
|
65
|
-
* @param path to process
|
|
66
|
-
*/
|
|
67
|
-
export declare function parse(path: string): ParsedPath;
|
|
68
|
-
/**
|
|
69
|
-
* Converts a file URL to a path string.
|
|
70
|
-
*
|
|
71
|
-
* ```ts
|
|
72
|
-
* import { fromFileUrl } from "https://deno.land/std@$STD_VERSION/path/win32.ts";
|
|
73
|
-
* fromFileUrl("file:///home/foo"); // "\\home\\foo"
|
|
74
|
-
* fromFileUrl("file:///C:/Users/foo"); // "C:\\Users\\foo"
|
|
75
|
-
* fromFileUrl("file://localhost/home/foo"); // "\\\\localhost\\home\\foo"
|
|
76
|
-
* ```
|
|
77
|
-
* @param url of a file URL
|
|
78
|
-
*/
|
|
79
|
-
export declare function fromFileUrl(url: string | URL): string;
|
|
80
|
-
/**
|
|
81
|
-
* Converts a path string to a file URL.
|
|
82
|
-
*
|
|
83
|
-
* ```ts
|
|
84
|
-
* import { toFileUrl } from "https://deno.land/std@$STD_VERSION/path/win32.ts";
|
|
85
|
-
* toFileUrl("\\home\\foo"); // new URL("file:///home/foo")
|
|
86
|
-
* toFileUrl("C:\\Users\\foo"); // new URL("file:///C:/Users/foo")
|
|
87
|
-
* toFileUrl("\\\\127.0.0.1\\home\\foo"); // new URL("file://127.0.0.1/home/foo")
|
|
88
|
-
* ```
|
|
89
|
-
* @param path to convert to file URL
|
|
90
|
-
*/
|
|
91
|
-
export declare function toFileUrl(path: string): URL;
|