keep-a-changelog 2.5.2 → 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 +28 -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} +96 -18
- 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} +97 -19
- 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
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.join = void 0;
|
|
6
|
+
const assert_path_js_1 = require("../_common/assert_path.js");
|
|
7
|
+
const normalize_js_1 = require("./normalize.js");
|
|
8
|
+
/**
|
|
9
|
+
* Join all given a sequence of `paths`,then normalizes the resulting path.
|
|
10
|
+
*
|
|
11
|
+
* @example Usage
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { join } from "join.ts";
|
|
14
|
+
* import { assertEquals } from "../../assert/mod.ts";
|
|
15
|
+
*
|
|
16
|
+
* const path = join("/foo", "bar", "baz/asdf", "quux", "..");
|
|
17
|
+
* assertEquals(path, "/foo/bar/baz/asdf");
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example Working with URLs
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { join } from "join.ts";
|
|
23
|
+
* import { assertEquals } from "../../assert/mod.ts";
|
|
24
|
+
*
|
|
25
|
+
* const url = new URL("https://deno.land");
|
|
26
|
+
* url.pathname = join("std", "path", "mod.ts");
|
|
27
|
+
* assertEquals(url.href, "https://deno.land/std/path/mod.ts");
|
|
28
|
+
*
|
|
29
|
+
* url.pathname = join("//std", "path/", "/mod.ts");
|
|
30
|
+
* assertEquals(url.href, "https://deno.land/std/path/mod.ts");
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* Note: If you are working with file URLs,
|
|
34
|
+
* use the new version of `join` from `@std/path/posix/unstable-join`.
|
|
35
|
+
*
|
|
36
|
+
* @param paths The paths to join.
|
|
37
|
+
* @returns The joined path.
|
|
38
|
+
*/
|
|
39
|
+
function join(...paths) {
|
|
40
|
+
if (paths.length === 0)
|
|
41
|
+
return ".";
|
|
42
|
+
paths.forEach((path) => (0, assert_path_js_1.assertPath)(path));
|
|
43
|
+
const joined = paths.filter((path) => path.length > 0).join("/");
|
|
44
|
+
return joined === "" ? "." : (0, normalize_js_1.normalize)(joined);
|
|
45
|
+
}
|
|
46
|
+
exports.join = join;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { GlobOptions } from "../_common/glob_to_reg_exp.js";
|
|
2
|
+
export type { GlobOptions };
|
|
3
|
+
/**
|
|
4
|
+
* Like join(), but doesn't collapse "**\/.." when `globstar` is true.
|
|
5
|
+
*
|
|
6
|
+
* @example Usage
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { joinGlobs } from "join_globs.ts";
|
|
9
|
+
* import { assertEquals } from "../../assert/mod.ts";
|
|
10
|
+
*
|
|
11
|
+
* const path = joinGlobs(["foo", "bar", "**"], { globstar: true });
|
|
12
|
+
* assertEquals(path, "foo/bar/**");
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @param globs The globs to join.
|
|
16
|
+
* @param options The options to use.
|
|
17
|
+
* @returns The joined path.
|
|
18
|
+
*/
|
|
19
|
+
export declare function joinGlobs(globs: string[], options?: Pick<GlobOptions, "globstar">): string;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.joinGlobs = void 0;
|
|
6
|
+
const join_js_1 = require("./join.js");
|
|
7
|
+
const constants_js_1 = require("./constants.js");
|
|
8
|
+
const normalize_glob_js_1 = require("./normalize_glob.js");
|
|
9
|
+
/**
|
|
10
|
+
* Like join(), but doesn't collapse "**\/.." when `globstar` is true.
|
|
11
|
+
*
|
|
12
|
+
* @example Usage
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { joinGlobs } from "join_globs.ts";
|
|
15
|
+
* import { assertEquals } from "../../assert/mod.ts";
|
|
16
|
+
*
|
|
17
|
+
* const path = joinGlobs(["foo", "bar", "**"], { globstar: true });
|
|
18
|
+
* assertEquals(path, "foo/bar/**");
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @param globs The globs to join.
|
|
22
|
+
* @param options The options to use.
|
|
23
|
+
* @returns The joined path.
|
|
24
|
+
*/
|
|
25
|
+
function joinGlobs(globs, options = {}) {
|
|
26
|
+
const { globstar = false } = options;
|
|
27
|
+
if (!globstar || globs.length === 0) {
|
|
28
|
+
return (0, join_js_1.join)(...globs);
|
|
29
|
+
}
|
|
30
|
+
let joined;
|
|
31
|
+
for (const glob of globs) {
|
|
32
|
+
const path = glob;
|
|
33
|
+
if (path.length > 0) {
|
|
34
|
+
if (!joined)
|
|
35
|
+
joined = path;
|
|
36
|
+
else
|
|
37
|
+
joined += `${constants_js_1.SEPARATOR}${path}`;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (!joined)
|
|
41
|
+
return ".";
|
|
42
|
+
return (0, normalize_glob_js_1.normalizeGlob)(joined, { globstar });
|
|
43
|
+
}
|
|
44
|
+
exports.joinGlobs = joinGlobs;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalize the `path`, resolving `'..'` and `'.'` segments.
|
|
3
|
+
* Note that resolving these segments does not necessarily mean that all will be eliminated.
|
|
4
|
+
* A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
|
|
5
|
+
*
|
|
6
|
+
* @example Usage
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { normalize } from "normalize.ts";
|
|
9
|
+
* import { assertEquals } from "../../assert/mod.ts";
|
|
10
|
+
*
|
|
11
|
+
* const path = normalize("/foo/bar//baz/asdf/quux/..");
|
|
12
|
+
* assertEquals(path, "/foo/bar/baz/asdf");
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @example Working with URLs
|
|
16
|
+
*
|
|
17
|
+
* Note: This function will remove the double slashes from a URL's scheme.
|
|
18
|
+
* Hence, do not pass a full URL to this function. Instead, pass the pathname of
|
|
19
|
+
* the URL.
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { normalize } from "normalize.ts";
|
|
23
|
+
* import { assertEquals } from "../../assert/mod.ts";
|
|
24
|
+
*
|
|
25
|
+
* const url = new URL("https://deno.land");
|
|
26
|
+
* url.pathname = normalize("//std//assert//.//mod.ts");
|
|
27
|
+
* assertEquals(url.href, "https://deno.land/std/assert/mod.ts");
|
|
28
|
+
*
|
|
29
|
+
* url.pathname = normalize("std/assert/../async/retry.ts");
|
|
30
|
+
* assertEquals(url.href, "https://deno.land/std/async/retry.ts");
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* Note: If you are working with file URLs,
|
|
34
|
+
* use the new version of `normalize` from `@std/path/posix/unstable-normalize`.
|
|
35
|
+
*
|
|
36
|
+
* @param path The path to normalize.
|
|
37
|
+
* @returns The normalized path.
|
|
38
|
+
*/
|
|
39
|
+
export declare function normalize(path: string): string;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.normalize = void 0;
|
|
6
|
+
const normalize_js_1 = require("../_common/normalize.js");
|
|
7
|
+
const normalize_string_js_1 = require("../_common/normalize_string.js");
|
|
8
|
+
const _util_js_1 = require("./_util.js");
|
|
9
|
+
/**
|
|
10
|
+
* Normalize the `path`, resolving `'..'` and `'.'` segments.
|
|
11
|
+
* Note that resolving these segments does not necessarily mean that all will be eliminated.
|
|
12
|
+
* A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
|
|
13
|
+
*
|
|
14
|
+
* @example Usage
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { normalize } from "normalize.ts";
|
|
17
|
+
* import { assertEquals } from "../../assert/mod.ts";
|
|
18
|
+
*
|
|
19
|
+
* const path = normalize("/foo/bar//baz/asdf/quux/..");
|
|
20
|
+
* assertEquals(path, "/foo/bar/baz/asdf");
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example Working with URLs
|
|
24
|
+
*
|
|
25
|
+
* Note: This function will remove the double slashes from a URL's scheme.
|
|
26
|
+
* Hence, do not pass a full URL to this function. Instead, pass the pathname of
|
|
27
|
+
* the URL.
|
|
28
|
+
*
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { normalize } from "normalize.ts";
|
|
31
|
+
* import { assertEquals } from "../../assert/mod.ts";
|
|
32
|
+
*
|
|
33
|
+
* const url = new URL("https://deno.land");
|
|
34
|
+
* url.pathname = normalize("//std//assert//.//mod.ts");
|
|
35
|
+
* assertEquals(url.href, "https://deno.land/std/assert/mod.ts");
|
|
36
|
+
*
|
|
37
|
+
* url.pathname = normalize("std/assert/../async/retry.ts");
|
|
38
|
+
* assertEquals(url.href, "https://deno.land/std/async/retry.ts");
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* Note: If you are working with file URLs,
|
|
42
|
+
* use the new version of `normalize` from `@std/path/posix/unstable-normalize`.
|
|
43
|
+
*
|
|
44
|
+
* @param path The path to normalize.
|
|
45
|
+
* @returns The normalized path.
|
|
46
|
+
*/
|
|
47
|
+
function normalize(path) {
|
|
48
|
+
(0, normalize_js_1.assertArg)(path);
|
|
49
|
+
const isAbsolute = (0, _util_js_1.isPosixPathSeparator)(path.charCodeAt(0));
|
|
50
|
+
const trailingSeparator = (0, _util_js_1.isPosixPathSeparator)(path.charCodeAt(path.length - 1));
|
|
51
|
+
// Normalize the path
|
|
52
|
+
path = (0, normalize_string_js_1.normalizeString)(path, !isAbsolute, "/", _util_js_1.isPosixPathSeparator);
|
|
53
|
+
if (path.length === 0 && !isAbsolute)
|
|
54
|
+
path = ".";
|
|
55
|
+
if (path.length > 0 && trailingSeparator)
|
|
56
|
+
path += "/";
|
|
57
|
+
if (isAbsolute)
|
|
58
|
+
return `/${path}`;
|
|
59
|
+
return path;
|
|
60
|
+
}
|
|
61
|
+
exports.normalize = normalize;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { GlobOptions } from "../_common/glob_to_reg_exp.js";
|
|
2
|
+
export type { GlobOptions };
|
|
3
|
+
/**
|
|
4
|
+
* Like normalize(), but doesn't collapse "**\/.." when `globstar` is true.
|
|
5
|
+
*
|
|
6
|
+
* @example Usage
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { normalizeGlob } from "normalize_glob.ts";
|
|
9
|
+
* import { assertEquals } from "../../assert/mod.ts";
|
|
10
|
+
*
|
|
11
|
+
* const path = normalizeGlob("foo/bar/../*", { globstar: true });
|
|
12
|
+
* assertEquals(path, "foo/*");
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @param glob The glob to normalize.
|
|
16
|
+
* @param options The options to use.
|
|
17
|
+
* @returns The normalized path.
|
|
18
|
+
*/
|
|
19
|
+
export declare function normalizeGlob(glob: string, options?: Pick<GlobOptions, "globstar">): string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.normalizeGlob = void 0;
|
|
6
|
+
const normalize_js_1 = require("./normalize.js");
|
|
7
|
+
const constants_js_1 = require("./constants.js");
|
|
8
|
+
/**
|
|
9
|
+
* Like normalize(), but doesn't collapse "**\/.." when `globstar` is true.
|
|
10
|
+
*
|
|
11
|
+
* @example Usage
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { normalizeGlob } from "normalize_glob.ts";
|
|
14
|
+
* import { assertEquals } from "../../assert/mod.ts";
|
|
15
|
+
*
|
|
16
|
+
* const path = normalizeGlob("foo/bar/../*", { globstar: true });
|
|
17
|
+
* assertEquals(path, "foo/*");
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @param glob The glob to normalize.
|
|
21
|
+
* @param options The options to use.
|
|
22
|
+
* @returns The normalized path.
|
|
23
|
+
*/
|
|
24
|
+
function normalizeGlob(glob, options = {}) {
|
|
25
|
+
const { globstar = false } = options;
|
|
26
|
+
if (glob.match(/\0/g)) {
|
|
27
|
+
throw new Error(`Glob contains invalid characters: "${glob}"`);
|
|
28
|
+
}
|
|
29
|
+
if (!globstar) {
|
|
30
|
+
return (0, normalize_js_1.normalize)(glob);
|
|
31
|
+
}
|
|
32
|
+
const s = constants_js_1.SEPARATOR_PATTERN.source;
|
|
33
|
+
const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g");
|
|
34
|
+
return (0, normalize_js_1.normalize)(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
|
|
35
|
+
}
|
|
36
|
+
exports.normalizeGlob = normalizeGlob;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ParsedPath } from "../types.js";
|
|
2
|
+
export type { ParsedPath } from "../types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Return a `ParsedPath` object of the `path`.
|
|
5
|
+
*
|
|
6
|
+
* @example Usage
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { parse } from "parse.ts";
|
|
9
|
+
* import { assertEquals } from "../../assert/mod.ts";
|
|
10
|
+
*
|
|
11
|
+
* const path = parse("/home/user/file.txt");
|
|
12
|
+
* assertEquals(path, {
|
|
13
|
+
* root: "/",
|
|
14
|
+
* dir: "/home/user",
|
|
15
|
+
* base: "file.txt",
|
|
16
|
+
* ext: ".txt",
|
|
17
|
+
* name: "file"
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @param path The path to parse.
|
|
22
|
+
* @returns The parsed path object.
|
|
23
|
+
*/
|
|
24
|
+
export declare function parse(path: string): ParsedPath;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.parse = void 0;
|
|
6
|
+
const constants_js_1 = require("../_common/constants.js");
|
|
7
|
+
const strip_trailing_separators_js_1 = require("../_common/strip_trailing_separators.js");
|
|
8
|
+
const assert_path_js_1 = require("../_common/assert_path.js");
|
|
9
|
+
const _util_js_1 = require("./_util.js");
|
|
10
|
+
/**
|
|
11
|
+
* Return a `ParsedPath` object of the `path`.
|
|
12
|
+
*
|
|
13
|
+
* @example Usage
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { parse } from "parse.ts";
|
|
16
|
+
* import { assertEquals } from "../../assert/mod.ts";
|
|
17
|
+
*
|
|
18
|
+
* const path = parse("/home/user/file.txt");
|
|
19
|
+
* assertEquals(path, {
|
|
20
|
+
* root: "/",
|
|
21
|
+
* dir: "/home/user",
|
|
22
|
+
* base: "file.txt",
|
|
23
|
+
* ext: ".txt",
|
|
24
|
+
* name: "file"
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @param path The path to parse.
|
|
29
|
+
* @returns The parsed path object.
|
|
30
|
+
*/
|
|
31
|
+
function parse(path) {
|
|
32
|
+
(0, assert_path_js_1.assertPath)(path);
|
|
33
|
+
const ret = { root: "", dir: "", base: "", ext: "", name: "" };
|
|
34
|
+
if (path.length === 0)
|
|
35
|
+
return ret;
|
|
36
|
+
const isAbsolute = (0, _util_js_1.isPosixPathSeparator)(path.charCodeAt(0));
|
|
37
|
+
let start;
|
|
38
|
+
if (isAbsolute) {
|
|
39
|
+
ret.root = "/";
|
|
40
|
+
start = 1;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
start = 0;
|
|
44
|
+
}
|
|
45
|
+
let startDot = -1;
|
|
46
|
+
let startPart = 0;
|
|
47
|
+
let end = -1;
|
|
48
|
+
let matchedSlash = true;
|
|
49
|
+
let i = path.length - 1;
|
|
50
|
+
// Track the state of characters (if any) we see before our first dot and
|
|
51
|
+
// after any path separator we find
|
|
52
|
+
let preDotState = 0;
|
|
53
|
+
// Get non-dir info
|
|
54
|
+
for (; i >= start; --i) {
|
|
55
|
+
const code = path.charCodeAt(i);
|
|
56
|
+
if ((0, _util_js_1.isPosixPathSeparator)(code)) {
|
|
57
|
+
// If we reached a path separator that was not part of a set of path
|
|
58
|
+
// separators at the end of the string, stop now
|
|
59
|
+
if (!matchedSlash) {
|
|
60
|
+
startPart = i + 1;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if (end === -1) {
|
|
66
|
+
// We saw the first non-path separator, mark this as the end of our
|
|
67
|
+
// extension
|
|
68
|
+
matchedSlash = false;
|
|
69
|
+
end = i + 1;
|
|
70
|
+
}
|
|
71
|
+
if (code === constants_js_1.CHAR_DOT) {
|
|
72
|
+
// If this is our first dot, mark it as the start of our extension
|
|
73
|
+
if (startDot === -1)
|
|
74
|
+
startDot = i;
|
|
75
|
+
else if (preDotState !== 1)
|
|
76
|
+
preDotState = 1;
|
|
77
|
+
}
|
|
78
|
+
else if (startDot !== -1) {
|
|
79
|
+
// We saw a non-dot and non-path separator before our dot, so we should
|
|
80
|
+
// have a good chance at having a non-empty extension
|
|
81
|
+
preDotState = -1;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (startDot === -1 ||
|
|
85
|
+
end === -1 ||
|
|
86
|
+
// We saw a non-dot character immediately before the dot
|
|
87
|
+
preDotState === 0 ||
|
|
88
|
+
// The (right-most) trimmed path component is exactly '..'
|
|
89
|
+
(preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)) {
|
|
90
|
+
if (end !== -1) {
|
|
91
|
+
if (startPart === 0 && isAbsolute) {
|
|
92
|
+
ret.base = ret.name = path.slice(1, end);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
ret.base = ret.name = path.slice(startPart, end);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// Fallback to '/' in case there is no basename
|
|
99
|
+
ret.base = ret.base || "/";
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
if (startPart === 0 && isAbsolute) {
|
|
103
|
+
ret.name = path.slice(1, startDot);
|
|
104
|
+
ret.base = path.slice(1, end);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
ret.name = path.slice(startPart, startDot);
|
|
108
|
+
ret.base = path.slice(startPart, end);
|
|
109
|
+
}
|
|
110
|
+
ret.ext = path.slice(startDot, end);
|
|
111
|
+
}
|
|
112
|
+
if (startPart > 0) {
|
|
113
|
+
ret.dir = (0, strip_trailing_separators_js_1.stripTrailingSeparators)(path.slice(0, startPart - 1), _util_js_1.isPosixPathSeparator);
|
|
114
|
+
}
|
|
115
|
+
else if (isAbsolute)
|
|
116
|
+
ret.dir = "/";
|
|
117
|
+
return ret;
|
|
118
|
+
}
|
|
119
|
+
exports.parse = parse;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return the relative path from `from` to `to` based on current working directory.
|
|
3
|
+
*
|
|
4
|
+
* If `from` and `to` are the same, return an empty string.
|
|
5
|
+
*
|
|
6
|
+
* @example Usage
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { relative } from "relative.ts";
|
|
9
|
+
* import { assertEquals } from "../../assert/mod.ts";
|
|
10
|
+
*
|
|
11
|
+
* const path = relative("/data/orandea/test/aaa", "/data/orandea/impl/bbb");
|
|
12
|
+
* assertEquals(path, "../../impl/bbb");
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @param from The path to start from.
|
|
16
|
+
* @param to The path to reach.
|
|
17
|
+
* @returns The relative path.
|
|
18
|
+
*/
|
|
19
|
+
export declare function relative(from: string, to: string): string;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.relative = void 0;
|
|
6
|
+
const _util_js_1 = require("./_util.js");
|
|
7
|
+
const resolve_js_1 = require("./resolve.js");
|
|
8
|
+
const relative_js_1 = require("../_common/relative.js");
|
|
9
|
+
/**
|
|
10
|
+
* Return the relative path from `from` to `to` based on current working directory.
|
|
11
|
+
*
|
|
12
|
+
* If `from` and `to` are the same, return an empty string.
|
|
13
|
+
*
|
|
14
|
+
* @example Usage
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { relative } from "relative.ts";
|
|
17
|
+
* import { assertEquals } from "../../assert/mod.ts";
|
|
18
|
+
*
|
|
19
|
+
* const path = relative("/data/orandea/test/aaa", "/data/orandea/impl/bbb");
|
|
20
|
+
* assertEquals(path, "../../impl/bbb");
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @param from The path to start from.
|
|
24
|
+
* @param to The path to reach.
|
|
25
|
+
* @returns The relative path.
|
|
26
|
+
*/
|
|
27
|
+
function relative(from, to) {
|
|
28
|
+
(0, relative_js_1.assertArgs)(from, to);
|
|
29
|
+
from = (0, resolve_js_1.resolve)(from);
|
|
30
|
+
to = (0, resolve_js_1.resolve)(to);
|
|
31
|
+
if (from === to)
|
|
32
|
+
return "";
|
|
33
|
+
// Trim any leading backslashes
|
|
34
|
+
let fromStart = 1;
|
|
35
|
+
const fromEnd = from.length;
|
|
36
|
+
for (; fromStart < fromEnd; ++fromStart) {
|
|
37
|
+
if (!(0, _util_js_1.isPosixPathSeparator)(from.charCodeAt(fromStart)))
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
const fromLen = fromEnd - fromStart;
|
|
41
|
+
// Trim any leading backslashes
|
|
42
|
+
let toStart = 1;
|
|
43
|
+
const toEnd = to.length;
|
|
44
|
+
for (; toStart < toEnd; ++toStart) {
|
|
45
|
+
if (!(0, _util_js_1.isPosixPathSeparator)(to.charCodeAt(toStart)))
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
const toLen = toEnd - toStart;
|
|
49
|
+
// Compare paths to find the longest common path from root
|
|
50
|
+
const length = fromLen < toLen ? fromLen : toLen;
|
|
51
|
+
let lastCommonSep = -1;
|
|
52
|
+
let i = 0;
|
|
53
|
+
for (; i <= length; ++i) {
|
|
54
|
+
if (i === length) {
|
|
55
|
+
if (toLen > length) {
|
|
56
|
+
if ((0, _util_js_1.isPosixPathSeparator)(to.charCodeAt(toStart + i))) {
|
|
57
|
+
// We get here if `from` is the exact base path for `to`.
|
|
58
|
+
// For example: from='/foo/bar'; to='/foo/bar/baz'
|
|
59
|
+
return to.slice(toStart + i + 1);
|
|
60
|
+
}
|
|
61
|
+
else if (i === 0) {
|
|
62
|
+
// We get here if `from` is the root
|
|
63
|
+
// For example: from='/'; to='/foo'
|
|
64
|
+
return to.slice(toStart + i);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else if (fromLen > length) {
|
|
68
|
+
if ((0, _util_js_1.isPosixPathSeparator)(from.charCodeAt(fromStart + i))) {
|
|
69
|
+
// We get here if `to` is the exact base path for `from`.
|
|
70
|
+
// For example: from='/foo/bar/baz'; to='/foo/bar'
|
|
71
|
+
lastCommonSep = i;
|
|
72
|
+
}
|
|
73
|
+
else if (i === 0) {
|
|
74
|
+
// We get here if `to` is the root.
|
|
75
|
+
// For example: from='/foo'; to='/'
|
|
76
|
+
lastCommonSep = 0;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
const fromCode = from.charCodeAt(fromStart + i);
|
|
82
|
+
const toCode = to.charCodeAt(toStart + i);
|
|
83
|
+
if (fromCode !== toCode)
|
|
84
|
+
break;
|
|
85
|
+
else if ((0, _util_js_1.isPosixPathSeparator)(fromCode))
|
|
86
|
+
lastCommonSep = i;
|
|
87
|
+
}
|
|
88
|
+
let out = "";
|
|
89
|
+
// Generate the relative path based on the path difference between `to`
|
|
90
|
+
// and `from`
|
|
91
|
+
for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
|
|
92
|
+
if (i === fromEnd || (0, _util_js_1.isPosixPathSeparator)(from.charCodeAt(i))) {
|
|
93
|
+
if (out.length === 0)
|
|
94
|
+
out += "..";
|
|
95
|
+
else
|
|
96
|
+
out += "/..";
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Lastly, append the rest of the destination (`to`) path that comes after
|
|
100
|
+
// the common path parts
|
|
101
|
+
if (out.length > 0)
|
|
102
|
+
return out + to.slice(toStart + lastCommonSep);
|
|
103
|
+
else {
|
|
104
|
+
toStart += lastCommonSep;
|
|
105
|
+
if ((0, _util_js_1.isPosixPathSeparator)(to.charCodeAt(toStart)))
|
|
106
|
+
++toStart;
|
|
107
|
+
return to.slice(toStart);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.relative = relative;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves path segments into a `path`.
|
|
3
|
+
*
|
|
4
|
+
* @example Usage
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { resolve } from "resolve.ts";
|
|
7
|
+
* import { assertEquals } from "../../assert/mod.ts";
|
|
8
|
+
*
|
|
9
|
+
* const path = resolve("/foo", "bar", "baz/asdf", "quux", "..");
|
|
10
|
+
* assertEquals(path, "/foo/bar/baz/asdf");
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @param pathSegments The path segments to resolve.
|
|
14
|
+
* @returns The resolved path.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolve(...pathSegments: string[]): string;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.resolve = void 0;
|
|
27
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
28
|
+
// This module is browser compatible.
|
|
29
|
+
const dntShim = __importStar(require("../../../_dnt.shims.js"));
|
|
30
|
+
const normalize_string_js_1 = require("../_common/normalize_string.js");
|
|
31
|
+
const assert_path_js_1 = require("../_common/assert_path.js");
|
|
32
|
+
const _util_js_1 = require("./_util.js");
|
|
33
|
+
/**
|
|
34
|
+
* Resolves path segments into a `path`.
|
|
35
|
+
*
|
|
36
|
+
* @example Usage
|
|
37
|
+
* ```ts
|
|
38
|
+
* import { resolve } from "resolve.ts";
|
|
39
|
+
* import { assertEquals } from "../../assert/mod.ts";
|
|
40
|
+
*
|
|
41
|
+
* const path = resolve("/foo", "bar", "baz/asdf", "quux", "..");
|
|
42
|
+
* assertEquals(path, "/foo/bar/baz/asdf");
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @param pathSegments The path segments to resolve.
|
|
46
|
+
* @returns The resolved path.
|
|
47
|
+
*/
|
|
48
|
+
function resolve(...pathSegments) {
|
|
49
|
+
let resolvedPath = "";
|
|
50
|
+
let resolvedAbsolute = false;
|
|
51
|
+
for (let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
|
52
|
+
let path;
|
|
53
|
+
if (i >= 0)
|
|
54
|
+
path = pathSegments[i];
|
|
55
|
+
else {
|
|
56
|
+
// deno-lint-ignore no-explicit-any
|
|
57
|
+
const { Deno } = dntShim.dntGlobalThis;
|
|
58
|
+
if (typeof Deno?.cwd !== "function") {
|
|
59
|
+
throw new TypeError("Resolved a relative path without a current working directory (CWD)");
|
|
60
|
+
}
|
|
61
|
+
path = Deno.cwd();
|
|
62
|
+
}
|
|
63
|
+
(0, assert_path_js_1.assertPath)(path);
|
|
64
|
+
// Skip empty entries
|
|
65
|
+
if (path.length === 0) {
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
resolvedPath = `${path}/${resolvedPath}`;
|
|
69
|
+
resolvedAbsolute = (0, _util_js_1.isPosixPathSeparator)(path.charCodeAt(0));
|
|
70
|
+
}
|
|
71
|
+
// At this point the path should be resolved to a full absolute path, but
|
|
72
|
+
// handle relative paths to be safe (might happen when Deno.cwd() fails)
|
|
73
|
+
// Normalize the path
|
|
74
|
+
resolvedPath = (0, normalize_string_js_1.normalizeString)(resolvedPath, !resolvedAbsolute, "/", _util_js_1.isPosixPathSeparator);
|
|
75
|
+
if (resolvedAbsolute) {
|
|
76
|
+
if (resolvedPath.length > 0)
|
|
77
|
+
return `/${resolvedPath}`;
|
|
78
|
+
else
|
|
79
|
+
return "/";
|
|
80
|
+
}
|
|
81
|
+
else if (resolvedPath.length > 0)
|
|
82
|
+
return resolvedPath;
|
|
83
|
+
else
|
|
84
|
+
return ".";
|
|
85
|
+
}
|
|
86
|
+
exports.resolve = resolve;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/**
|
|
3
|
+
* Converts a path string to a file URL.
|
|
4
|
+
*
|
|
5
|
+
* @example Usage
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { toFileUrl } from "to_file_url.ts";
|
|
8
|
+
* import { assertEquals } from "../../assert/mod.ts";
|
|
9
|
+
*
|
|
10
|
+
* assertEquals(toFileUrl("/home/foo"), new URL("file:///home/foo"));
|
|
11
|
+
* assertEquals(toFileUrl("/home/foo bar"), new URL("file:///home/foo%20bar"));
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @param path The path to convert.
|
|
15
|
+
* @returns The file URL.
|
|
16
|
+
*/
|
|
17
|
+
export declare function toFileUrl(path: string): URL;
|