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,66 +0,0 @@
|
|
|
1
|
-
import { isValidNumber } from "./_shared.js";
|
|
2
|
-
import { isSemVer } from "./is_semver.js";
|
|
3
|
-
import { FULL, MAX_LENGTH, NUMERICIDENTIFIER, re, src } from "./_shared.js";
|
|
4
|
-
/**
|
|
5
|
-
* Attempt to parse a string as a semantic version, returning either a `SemVer`
|
|
6
|
-
* object or throws a TypeError.
|
|
7
|
-
* @param version The version string to parse
|
|
8
|
-
* @returns A valid SemVer
|
|
9
|
-
*/
|
|
10
|
-
export function parse(version) {
|
|
11
|
-
if (typeof version === "object") {
|
|
12
|
-
if (isSemVer(version)) {
|
|
13
|
-
return version;
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
throw new TypeError(`not a valid SemVer object`);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
if (typeof version !== "string") {
|
|
20
|
-
throw new TypeError(`version must be a string`);
|
|
21
|
-
}
|
|
22
|
-
if (version.length > MAX_LENGTH) {
|
|
23
|
-
throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
24
|
-
}
|
|
25
|
-
version = version.trim();
|
|
26
|
-
const r = re[FULL];
|
|
27
|
-
const m = version.match(r);
|
|
28
|
-
if (!m) {
|
|
29
|
-
throw new TypeError(`Invalid Version: ${version}`);
|
|
30
|
-
}
|
|
31
|
-
// these are actually numbers
|
|
32
|
-
const major = parseInt(m[1]);
|
|
33
|
-
const minor = parseInt(m[2]);
|
|
34
|
-
const patch = parseInt(m[3]);
|
|
35
|
-
if (major > Number.MAX_SAFE_INTEGER || major < 0) {
|
|
36
|
-
throw new TypeError("Invalid major version");
|
|
37
|
-
}
|
|
38
|
-
if (minor > Number.MAX_SAFE_INTEGER || minor < 0) {
|
|
39
|
-
throw new TypeError("Invalid minor version");
|
|
40
|
-
}
|
|
41
|
-
if (patch > Number.MAX_SAFE_INTEGER || patch < 0) {
|
|
42
|
-
throw new TypeError("Invalid patch version");
|
|
43
|
-
}
|
|
44
|
-
// number-ify any prerelease numeric ids
|
|
45
|
-
const numericIdentifier = new RegExp(`^(${src[NUMERICIDENTIFIER]})$`);
|
|
46
|
-
const prerelease = (m[4] ?? "")
|
|
47
|
-
.split(".")
|
|
48
|
-
.filter((id) => id)
|
|
49
|
-
.map((id) => {
|
|
50
|
-
const num = parseInt(id);
|
|
51
|
-
if (id.match(numericIdentifier) && isValidNumber(num)) {
|
|
52
|
-
return num;
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
return id;
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
const build = m[5]?.split(".")?.filter((m) => m) ?? [];
|
|
59
|
-
return {
|
|
60
|
-
major,
|
|
61
|
-
minor,
|
|
62
|
-
patch,
|
|
63
|
-
prerelease,
|
|
64
|
-
build,
|
|
65
|
-
};
|
|
66
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
-
import { parse } from "./parse.js";
|
|
3
|
-
import { COMPARATOR, re } from "./_shared.js";
|
|
4
|
-
import { comparatorMax } from "./comparator_max.js";
|
|
5
|
-
import { comparatorMin } from "./comparator_min.js";
|
|
6
|
-
import { ANY, NONE } from "./constants.js";
|
|
7
|
-
/**
|
|
8
|
-
* Parses a comparator string into a valid SemVerComparator.
|
|
9
|
-
* @param comparator
|
|
10
|
-
* @returns A valid SemVerComparator
|
|
11
|
-
*/
|
|
12
|
-
export function parseComparator(comparator) {
|
|
13
|
-
const r = re[COMPARATOR];
|
|
14
|
-
const m = comparator.match(r);
|
|
15
|
-
if (!m) {
|
|
16
|
-
return NONE;
|
|
17
|
-
}
|
|
18
|
-
const operator = (m[1] ?? "");
|
|
19
|
-
const semver = m[2] ? parse(m[2]) : ANY;
|
|
20
|
-
const min = comparatorMin(semver, operator);
|
|
21
|
-
const max = comparatorMax(semver, operator);
|
|
22
|
-
return {
|
|
23
|
-
operator,
|
|
24
|
-
semver,
|
|
25
|
-
min,
|
|
26
|
-
max,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SemVerRange } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Parses a range string into a SemVerRange object or throws a TypeError.
|
|
4
|
-
* @param range The range string
|
|
5
|
-
* @returns A valid semantic version range
|
|
6
|
-
*/
|
|
7
|
-
export declare function parseRange(range: string): SemVerRange;
|
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
-
import { ALL } from "./constants.js";
|
|
3
|
-
import { CARET, HYPHENRANGE, re, STAR, TILDE, XRANGE } from "./_shared.js";
|
|
4
|
-
import { parseComparator } from "./parse_comparator.js";
|
|
5
|
-
// ~, ~> --> * (any, kinda silly)
|
|
6
|
-
// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
|
|
7
|
-
// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
|
|
8
|
-
// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
|
|
9
|
-
// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
|
|
10
|
-
// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
|
|
11
|
-
function replaceTildes(comp) {
|
|
12
|
-
return comp
|
|
13
|
-
.trim()
|
|
14
|
-
.split(/\s+/)
|
|
15
|
-
.map((comp) => replaceTilde(comp))
|
|
16
|
-
.join(" ");
|
|
17
|
-
}
|
|
18
|
-
function replaceTilde(comp) {
|
|
19
|
-
const r = re[TILDE];
|
|
20
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
21
|
-
let ret;
|
|
22
|
-
if (isX(M)) {
|
|
23
|
-
ret = "";
|
|
24
|
-
}
|
|
25
|
-
else if (isX(m)) {
|
|
26
|
-
ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
|
|
27
|
-
}
|
|
28
|
-
else if (isX(p)) {
|
|
29
|
-
// ~1.2 == >=1.2.0 <1.3.0
|
|
30
|
-
ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
|
|
31
|
-
}
|
|
32
|
-
else if (pr) {
|
|
33
|
-
ret = ">=" +
|
|
34
|
-
M +
|
|
35
|
-
"." +
|
|
36
|
-
m +
|
|
37
|
-
"." +
|
|
38
|
-
p +
|
|
39
|
-
"-" +
|
|
40
|
-
pr +
|
|
41
|
-
" <" +
|
|
42
|
-
M +
|
|
43
|
-
"." +
|
|
44
|
-
(+m + 1) +
|
|
45
|
-
".0";
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
// ~1.2.3 == >=1.2.3 <1.3.0
|
|
49
|
-
ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
|
|
50
|
-
}
|
|
51
|
-
return ret;
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
// ^ --> * (any, kinda silly)
|
|
55
|
-
// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
|
|
56
|
-
// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
|
|
57
|
-
// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
|
|
58
|
-
// ^1.2.3 --> >=1.2.3 <2.0.0
|
|
59
|
-
// ^1.2.0 --> >=1.2.0 <2.0.0
|
|
60
|
-
function replaceCarets(comp) {
|
|
61
|
-
return comp
|
|
62
|
-
.trim()
|
|
63
|
-
.split(/\s+/)
|
|
64
|
-
.map((comp) => replaceCaret(comp))
|
|
65
|
-
.join(" ");
|
|
66
|
-
}
|
|
67
|
-
function replaceCaret(comp) {
|
|
68
|
-
const r = re[CARET];
|
|
69
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
70
|
-
let ret;
|
|
71
|
-
if (isX(M)) {
|
|
72
|
-
ret = "";
|
|
73
|
-
}
|
|
74
|
-
else if (isX(m)) {
|
|
75
|
-
ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
|
|
76
|
-
}
|
|
77
|
-
else if (isX(p)) {
|
|
78
|
-
if (M === "0") {
|
|
79
|
-
ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0";
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
else if (pr) {
|
|
86
|
-
if (M === "0") {
|
|
87
|
-
if (m === "0") {
|
|
88
|
-
ret = ">=" +
|
|
89
|
-
M +
|
|
90
|
-
"." +
|
|
91
|
-
m +
|
|
92
|
-
"." +
|
|
93
|
-
p +
|
|
94
|
-
"-" +
|
|
95
|
-
pr +
|
|
96
|
-
" <" +
|
|
97
|
-
M +
|
|
98
|
-
"." +
|
|
99
|
-
m +
|
|
100
|
-
"." +
|
|
101
|
-
(+p + 1);
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
ret = ">=" +
|
|
105
|
-
M +
|
|
106
|
-
"." +
|
|
107
|
-
m +
|
|
108
|
-
"." +
|
|
109
|
-
p +
|
|
110
|
-
"-" +
|
|
111
|
-
pr +
|
|
112
|
-
" <" +
|
|
113
|
-
M +
|
|
114
|
-
"." +
|
|
115
|
-
(+m + 1) +
|
|
116
|
-
".0";
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) +
|
|
121
|
-
".0.0";
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
if (M === "0") {
|
|
126
|
-
if (m === "0") {
|
|
127
|
-
ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." +
|
|
128
|
-
(+p + 1);
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0";
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
return ret;
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
function replaceXRanges(comp) {
|
|
142
|
-
return comp
|
|
143
|
-
.split(/\s+/)
|
|
144
|
-
.map((comp) => replaceXRange(comp))
|
|
145
|
-
.join(" ");
|
|
146
|
-
}
|
|
147
|
-
function replaceXRange(comp) {
|
|
148
|
-
comp = comp.trim();
|
|
149
|
-
const r = re[XRANGE];
|
|
150
|
-
return comp.replace(r, (ret, gtlt, M, m, p, _pr) => {
|
|
151
|
-
const xM = isX(M);
|
|
152
|
-
const xm = xM || isX(m);
|
|
153
|
-
const xp = xm || isX(p);
|
|
154
|
-
const anyX = xp;
|
|
155
|
-
if (gtlt === "=" && anyX) {
|
|
156
|
-
gtlt = "";
|
|
157
|
-
}
|
|
158
|
-
if (xM) {
|
|
159
|
-
if (gtlt === ">" || gtlt === "<") {
|
|
160
|
-
// nothing is allowed
|
|
161
|
-
ret = "<0.0.0";
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
// nothing is forbidden
|
|
165
|
-
ret = "*";
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
else if (gtlt && anyX) {
|
|
169
|
-
// we know patch is an x, because we have any x at all.
|
|
170
|
-
// replace X with 0
|
|
171
|
-
if (xm) {
|
|
172
|
-
m = 0;
|
|
173
|
-
}
|
|
174
|
-
p = 0;
|
|
175
|
-
if (gtlt === ">") {
|
|
176
|
-
// >1 => >=2.0.0
|
|
177
|
-
// >1.2 => >=1.3.0
|
|
178
|
-
// >1.2.3 => >= 1.2.4
|
|
179
|
-
gtlt = ">=";
|
|
180
|
-
if (xm) {
|
|
181
|
-
M = +M + 1;
|
|
182
|
-
m = 0;
|
|
183
|
-
p = 0;
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
m = +m + 1;
|
|
187
|
-
p = 0;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
else if (gtlt === "<=") {
|
|
191
|
-
// <=0.7.x is actually <0.8.0, since any 0.7.x should
|
|
192
|
-
// pass. Similarly, <=7.x is actually <8.0.0, etc.
|
|
193
|
-
gtlt = "<";
|
|
194
|
-
if (xm) {
|
|
195
|
-
M = +M + 1;
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
m = +m + 1;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
ret = gtlt + M + "." + m + "." + p;
|
|
202
|
-
}
|
|
203
|
-
else if (xm) {
|
|
204
|
-
ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
|
|
205
|
-
}
|
|
206
|
-
else if (xp) {
|
|
207
|
-
ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
|
|
208
|
-
}
|
|
209
|
-
return ret;
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
// Because * is AND-ed with everything else in the comparator,
|
|
213
|
-
// and '' means "any version", just remove the *s entirely.
|
|
214
|
-
function replaceStars(comp) {
|
|
215
|
-
return comp.trim().replace(re[STAR], "");
|
|
216
|
-
}
|
|
217
|
-
// This function is passed to string.replace(re[HYPHENRANGE])
|
|
218
|
-
// M, m, patch, prerelease, build
|
|
219
|
-
// 1.2 - 3.4.5 -> >=1.2.0 <=3.4.5
|
|
220
|
-
// 1.2.3 - 3.4 -> >=1.2.0 <3.5.0 Any 3.4.x will do
|
|
221
|
-
// 1.2 - 3.4 -> >=1.2.0 <3.5.0
|
|
222
|
-
function hyphenReplace(_$0, from, fM, fm, fp, _fpr, _fb, to, tM, tm, tp, tpr, _tb) {
|
|
223
|
-
if (isX(fM)) {
|
|
224
|
-
from = "";
|
|
225
|
-
}
|
|
226
|
-
else if (isX(fm)) {
|
|
227
|
-
from = ">=" + fM + ".0.0";
|
|
228
|
-
}
|
|
229
|
-
else if (isX(fp)) {
|
|
230
|
-
from = ">=" + fM + "." + fm + ".0";
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
from = ">=" + from;
|
|
234
|
-
}
|
|
235
|
-
if (isX(tM)) {
|
|
236
|
-
to = "";
|
|
237
|
-
}
|
|
238
|
-
else if (isX(tm)) {
|
|
239
|
-
to = "<" + (+tM + 1) + ".0.0";
|
|
240
|
-
}
|
|
241
|
-
else if (isX(tp)) {
|
|
242
|
-
to = "<" + tM + "." + (+tm + 1) + ".0";
|
|
243
|
-
}
|
|
244
|
-
else if (tpr) {
|
|
245
|
-
to = "<=" + tM + "." + tm + "." + tp + "-" + tpr;
|
|
246
|
-
}
|
|
247
|
-
else {
|
|
248
|
-
to = "<=" + to;
|
|
249
|
-
}
|
|
250
|
-
return (from + " " + to).trim();
|
|
251
|
-
}
|
|
252
|
-
function isX(id) {
|
|
253
|
-
return !id || id.toLowerCase() === "x" || id === "*";
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* Parses a range string into a SemVerRange object or throws a TypeError.
|
|
257
|
-
* @param range The range string
|
|
258
|
-
* @returns A valid semantic version range
|
|
259
|
-
*/
|
|
260
|
-
export function parseRange(range) {
|
|
261
|
-
// handle spaces around and between comparator and version
|
|
262
|
-
range = range.trim().replaceAll(/(?<=<|>|=) /g, "");
|
|
263
|
-
if (range === "") {
|
|
264
|
-
return { ranges: [[ALL]] };
|
|
265
|
-
}
|
|
266
|
-
// Split into groups of comparators, these are considered OR'd together.
|
|
267
|
-
const ranges = range
|
|
268
|
-
.trim()
|
|
269
|
-
.split(/\s*\|\|\s*/)
|
|
270
|
-
.map((range) => {
|
|
271
|
-
// convert `1.2.3 - 1.2.4` into `>=1.2.3 <=1.2.4`
|
|
272
|
-
const hr = re[HYPHENRANGE];
|
|
273
|
-
range = range.replace(hr, hyphenReplace);
|
|
274
|
-
range = replaceCarets(range);
|
|
275
|
-
range = replaceTildes(range);
|
|
276
|
-
range = replaceXRanges(range);
|
|
277
|
-
range = replaceStars(range);
|
|
278
|
-
// At this point, the range is completely trimmed and
|
|
279
|
-
// ready to be split into comparators.
|
|
280
|
-
// These are considered AND's
|
|
281
|
-
if (range === "") {
|
|
282
|
-
return [ALL];
|
|
283
|
-
}
|
|
284
|
-
else {
|
|
285
|
-
return range
|
|
286
|
-
.split(" ")
|
|
287
|
-
.filter((r) => r)
|
|
288
|
-
.map((r) => parseComparator(r));
|
|
289
|
-
}
|
|
290
|
-
});
|
|
291
|
-
return { ranges };
|
|
292
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { SemVerRange } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Formats the range into a string
|
|
4
|
-
* @example >=0.0.0 || <1.0.0
|
|
5
|
-
* @param range The range to format
|
|
6
|
-
* @returns A string representation of the range
|
|
7
|
-
*/
|
|
8
|
-
export declare function rangeFormat(range: SemVerRange): string;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { comparatorFormat } from "./comparator_format.js";
|
|
2
|
-
/**
|
|
3
|
-
* Formats the range into a string
|
|
4
|
-
* @example >=0.0.0 || <1.0.0
|
|
5
|
-
* @param range The range to format
|
|
6
|
-
* @returns A string representation of the range
|
|
7
|
-
*/
|
|
8
|
-
export function rangeFormat(range) {
|
|
9
|
-
return range.ranges.map((c) => c.map((c) => comparatorFormat(c)).join(" "))
|
|
10
|
-
.join("||");
|
|
11
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { SemVerRange } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* The ranges intersect every range of AND comparators intersects with a least one range of OR ranges.
|
|
4
|
-
* @param r0 range 0
|
|
5
|
-
* @param r1 range 1
|
|
6
|
-
* @returns returns true if any
|
|
7
|
-
*/
|
|
8
|
-
export declare function rangeIntersects(r0: SemVerRange, r1: SemVerRange): boolean;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
-
import { comparatorIntersects } from "./comparator_intersects.js";
|
|
3
|
-
function rangesSatisfiable(ranges) {
|
|
4
|
-
return ranges.every((r) => {
|
|
5
|
-
// For each OR at least one AND must be satisfiable
|
|
6
|
-
return r.ranges.some((comparators) => comparatorsSatisfiable(comparators));
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
function comparatorsSatisfiable(comparators) {
|
|
10
|
-
// Comparators are satisfiable if they all intersect with each other
|
|
11
|
-
for (let i = 0; i < comparators.length - 1; i++) {
|
|
12
|
-
const c0 = comparators[i];
|
|
13
|
-
for (const c1 of comparators.slice(i + 1)) {
|
|
14
|
-
if (!comparatorIntersects(c0, c1)) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* The ranges intersect every range of AND comparators intersects with a least one range of OR ranges.
|
|
23
|
-
* @param r0 range 0
|
|
24
|
-
* @param r1 range 1
|
|
25
|
-
* @returns returns true if any
|
|
26
|
-
*/
|
|
27
|
-
export function rangeIntersects(r0, r1) {
|
|
28
|
-
return rangesSatisfiable([r0, r1]) && r0.ranges.some((r00) => {
|
|
29
|
-
return r1.ranges.some((r11) => {
|
|
30
|
-
return r00.every((c0) => {
|
|
31
|
-
return r11.every((c1) => comparatorIntersects(c0, c1));
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SemVer, SemVerRange } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* The maximum valid SemVer for a given range or INVALID
|
|
4
|
-
* @param range The range to calculate the max for
|
|
5
|
-
* @returns A valid SemVer or INVALID
|
|
6
|
-
*/
|
|
7
|
-
export declare function rangeMax(range: SemVerRange): SemVer | undefined;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
-
import { INVALID } from "./constants.js";
|
|
3
|
-
import { sort } from "./sort.js";
|
|
4
|
-
import { testRange } from "./test_range.js";
|
|
5
|
-
/**
|
|
6
|
-
* The maximum valid SemVer for a given range or INVALID
|
|
7
|
-
* @param range The range to calculate the max for
|
|
8
|
-
* @returns A valid SemVer or INVALID
|
|
9
|
-
*/
|
|
10
|
-
export function rangeMax(range) {
|
|
11
|
-
// For and's, you take the smallest max
|
|
12
|
-
// For or's, you take the biggest max
|
|
13
|
-
//[ [1 and 2] or [2 and 3] ] = [ 1 or 2 ] = 2
|
|
14
|
-
return sort(range.ranges.map((r) => sort(r.filter((c) => testRange(c.max, range)).map((c) => c.max)).shift())).filter((v) => v).pop() ?? INVALID;
|
|
15
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SemVer, SemVerRange } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* The minimum valid SemVer for a given range or INVALID
|
|
4
|
-
* @param range The range to calculate the min for
|
|
5
|
-
* @returns A valid SemVer or INVALID
|
|
6
|
-
*/
|
|
7
|
-
export declare function rangeMin(range: SemVerRange): SemVer;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
-
import { INVALID } from "./constants.js";
|
|
3
|
-
import { sort } from "./sort.js";
|
|
4
|
-
import { testRange } from "./test_range.js";
|
|
5
|
-
/**
|
|
6
|
-
* The minimum valid SemVer for a given range or INVALID
|
|
7
|
-
* @param range The range to calculate the min for
|
|
8
|
-
* @returns A valid SemVer or INVALID
|
|
9
|
-
*/
|
|
10
|
-
export function rangeMin(range) {
|
|
11
|
-
// For or's, you take the smallest min
|
|
12
|
-
//[ [1 and 2] or [2 and 3] ] = [ 2 or 3 ] = 2
|
|
13
|
-
return sort(range.ranges.map((r) => sort(r.filter((c) => testRange(c.min, range)).map((c) => c.min)).pop()).filter((v) => v)).shift() ?? INVALID;
|
|
14
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { SemVer } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* A reverse comparison of two versions. Same as compare but
|
|
4
|
-
* `1` and `-1` are inverted.
|
|
5
|
-
*
|
|
6
|
-
* Sorts in descending order if passed to `Array.sort()`,
|
|
7
|
-
*/
|
|
8
|
-
export declare function rcompare(s0: SemVer, s1: SemVer): 1 | 0 | -1;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { compare } from "./compare.js";
|
|
2
|
-
/**
|
|
3
|
-
* A reverse comparison of two versions. Same as compare but
|
|
4
|
-
* `1` and `-1` are inverted.
|
|
5
|
-
*
|
|
6
|
-
* Sorts in descending order if passed to `Array.sort()`,
|
|
7
|
-
*/
|
|
8
|
-
export function rcompare(s0, s1) {
|
|
9
|
-
return compare(s1, s0);
|
|
10
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { SemVer, SemVerComparator } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Test to see if a semantic version falls within the range of the comparator.
|
|
4
|
-
* @param version The version to compare
|
|
5
|
-
* @param comparator The comparator
|
|
6
|
-
* @returns True if the version is within the comparators set otherwise false
|
|
7
|
-
*/
|
|
8
|
-
export declare function testComparator(version: SemVer, comparator: SemVerComparator): boolean;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { cmp } from "./cmp.js";
|
|
2
|
-
/**
|
|
3
|
-
* Test to see if a semantic version falls within the range of the comparator.
|
|
4
|
-
* @param version The version to compare
|
|
5
|
-
* @param comparator The comparator
|
|
6
|
-
* @returns True if the version is within the comparators set otherwise false
|
|
7
|
-
*/
|
|
8
|
-
export function testComparator(version, comparator) {
|
|
9
|
-
return cmp(version, comparator.operator, comparator.semver);
|
|
10
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { SemVer, SemVerRange } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Test to see if the version satisfies the range.
|
|
4
|
-
* @param version The version to test
|
|
5
|
-
* @param range The range to check
|
|
6
|
-
* @returns true if the version is in the range
|
|
7
|
-
*/
|
|
8
|
-
export declare function testRange(version: SemVer, range: SemVerRange): boolean;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { gte } from "./gte.js";
|
|
2
|
-
import { lte } from "./lte.js";
|
|
3
|
-
/**
|
|
4
|
-
* Test to see if the version satisfies the range.
|
|
5
|
-
* @param version The version to test
|
|
6
|
-
* @param range The range to check
|
|
7
|
-
* @returns true if the version is in the range
|
|
8
|
-
*/
|
|
9
|
-
export function testRange(version, range) {
|
|
10
|
-
for (const r of range.ranges) {
|
|
11
|
-
if (r.every((c) => gte(version, c.min) && lte(version, c.max))) {
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The possible release types are used as an operator for the
|
|
3
|
-
* increment function and as a result of the difference function.
|
|
4
|
-
*/
|
|
5
|
-
export type ReleaseType = "pre" | "major" | "premajor" | "minor" | "preminor" | "patch" | "prepatch" | "prerelease";
|
|
6
|
-
/**
|
|
7
|
-
* SemVer comparison operators.
|
|
8
|
-
*/
|
|
9
|
-
export type Operator = "" | "=" | "==" | "===" | "!==" | "!=" | ">" | ">=" | "<" | "<=";
|
|
10
|
-
/**
|
|
11
|
-
* The style to use when formatting a SemVer object into a string
|
|
12
|
-
*/
|
|
13
|
-
export type FormatStyle = "full" | "release" | "primary" | "build" | "pre" | "patch" | "minor" | "major";
|
|
14
|
-
/**
|
|
15
|
-
* The shape of a valid semantic version comparator
|
|
16
|
-
* @example >=0.0.0
|
|
17
|
-
*/
|
|
18
|
-
export interface SemVerComparator {
|
|
19
|
-
operator: Operator;
|
|
20
|
-
semver: SemVer;
|
|
21
|
-
min: SemVer;
|
|
22
|
-
max: SemVer;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* A SemVer object parsed into its constituent parts.
|
|
26
|
-
*/
|
|
27
|
-
export interface SemVer {
|
|
28
|
-
major: number;
|
|
29
|
-
minor: number;
|
|
30
|
-
patch: number;
|
|
31
|
-
prerelease: (string | number)[];
|
|
32
|
-
build: string[];
|
|
33
|
-
}
|
|
34
|
-
type SemVerRangeAnd = SemVerComparator[];
|
|
35
|
-
type SemVerRangeOr = SemVerRangeAnd[];
|
|
36
|
-
/**
|
|
37
|
-
* A type representing a semantic version range. The ranges consist of
|
|
38
|
-
* a nested array, which represents a set of OR comparisons while the
|
|
39
|
-
* inner array represents AND comparisons.
|
|
40
|
-
*/
|
|
41
|
-
export interface SemVerRange {
|
|
42
|
-
ranges: SemVerRangeOr;
|
|
43
|
-
}
|
|
44
|
-
export {};
|