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
|
@@ -0,0 +1,362 @@
|
|
|
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.parseRange = void 0;
|
|
6
|
+
const _shared_js_1 = require("./_shared.js");
|
|
7
|
+
const _constants_js_1 = require("./_constants.js");
|
|
8
|
+
function parseComparator(comparator) {
|
|
9
|
+
const match = comparator.match(_shared_js_1.COMPARATOR_REGEXP);
|
|
10
|
+
const groups = match?.groups;
|
|
11
|
+
if (!groups)
|
|
12
|
+
return null;
|
|
13
|
+
const { operator, prerelease, buildmetadata } = groups;
|
|
14
|
+
const semver = groups.major
|
|
15
|
+
? {
|
|
16
|
+
major: (0, _shared_js_1.parseNumber)(groups.major, `Cannot parse comparator ${comparator}: invalid major version`),
|
|
17
|
+
minor: (0, _shared_js_1.parseNumber)(groups.minor, `Cannot parse comparator ${comparator}: invalid minor version`),
|
|
18
|
+
patch: (0, _shared_js_1.parseNumber)(groups.patch, `Cannot parse comparator ${comparator}: invalid patch version`),
|
|
19
|
+
prerelease: prerelease ? (0, _shared_js_1.parsePrerelease)(prerelease) : [],
|
|
20
|
+
build: buildmetadata ? (0, _shared_js_1.parseBuild)(buildmetadata) : [],
|
|
21
|
+
}
|
|
22
|
+
: _constants_js_1.ANY;
|
|
23
|
+
return { operator: operator || undefined, ...semver };
|
|
24
|
+
}
|
|
25
|
+
function isWildcard(id) {
|
|
26
|
+
return !id || id.toLowerCase() === "x" || id === "*";
|
|
27
|
+
}
|
|
28
|
+
function handleLeftHyphenRangeGroups(leftGroup) {
|
|
29
|
+
if (isWildcard(leftGroup.major))
|
|
30
|
+
return;
|
|
31
|
+
if (isWildcard(leftGroup.minor)) {
|
|
32
|
+
return {
|
|
33
|
+
operator: ">=",
|
|
34
|
+
major: +leftGroup.major,
|
|
35
|
+
minor: 0,
|
|
36
|
+
patch: 0,
|
|
37
|
+
prerelease: [],
|
|
38
|
+
build: [],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
if (isWildcard(leftGroup.patch)) {
|
|
42
|
+
return {
|
|
43
|
+
operator: ">=",
|
|
44
|
+
major: +leftGroup.major,
|
|
45
|
+
minor: +leftGroup.minor,
|
|
46
|
+
patch: 0,
|
|
47
|
+
prerelease: [],
|
|
48
|
+
build: [],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
operator: ">=",
|
|
53
|
+
major: +leftGroup.major,
|
|
54
|
+
minor: +leftGroup.minor,
|
|
55
|
+
patch: +leftGroup.patch,
|
|
56
|
+
prerelease: leftGroup.prerelease
|
|
57
|
+
? (0, _shared_js_1.parsePrerelease)(leftGroup.prerelease)
|
|
58
|
+
: [],
|
|
59
|
+
build: [],
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function handleRightHyphenRangeGroups(rightGroups) {
|
|
63
|
+
if (isWildcard(rightGroups.major)) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (isWildcard(rightGroups.minor)) {
|
|
67
|
+
return {
|
|
68
|
+
operator: "<",
|
|
69
|
+
major: +rightGroups.major + 1,
|
|
70
|
+
minor: 0,
|
|
71
|
+
patch: 0,
|
|
72
|
+
prerelease: [],
|
|
73
|
+
build: [],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
if (isWildcard(rightGroups.patch)) {
|
|
77
|
+
return {
|
|
78
|
+
operator: "<",
|
|
79
|
+
major: +rightGroups.major,
|
|
80
|
+
minor: +rightGroups.minor + 1,
|
|
81
|
+
patch: 0,
|
|
82
|
+
prerelease: [],
|
|
83
|
+
build: [],
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
if (rightGroups.prerelease) {
|
|
87
|
+
return {
|
|
88
|
+
operator: "<=",
|
|
89
|
+
major: +rightGroups.major,
|
|
90
|
+
minor: +rightGroups.minor,
|
|
91
|
+
patch: +rightGroups.patch,
|
|
92
|
+
prerelease: (0, _shared_js_1.parsePrerelease)(rightGroups.prerelease),
|
|
93
|
+
build: [],
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
operator: "<=",
|
|
98
|
+
major: +rightGroups.major,
|
|
99
|
+
minor: +rightGroups.minor,
|
|
100
|
+
patch: +rightGroups.patch,
|
|
101
|
+
prerelease: [],
|
|
102
|
+
build: [],
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function parseHyphenRange(range) {
|
|
106
|
+
const leftMatch = range.match(new RegExp(`^${_shared_js_1.XRANGE}`));
|
|
107
|
+
const leftGroup = leftMatch?.groups;
|
|
108
|
+
if (!leftGroup)
|
|
109
|
+
return null;
|
|
110
|
+
const leftLength = leftMatch[0].length;
|
|
111
|
+
const hyphenMatch = range.slice(leftLength).match(/^\s+-\s+/);
|
|
112
|
+
if (!hyphenMatch)
|
|
113
|
+
return null;
|
|
114
|
+
const hyphenLength = hyphenMatch[0].length;
|
|
115
|
+
const rightMatch = range.slice(leftLength + hyphenLength).match(new RegExp(`^${_shared_js_1.XRANGE}\\s*$`));
|
|
116
|
+
const rightGroups = rightMatch?.groups;
|
|
117
|
+
if (!rightGroups)
|
|
118
|
+
return null;
|
|
119
|
+
const from = handleLeftHyphenRangeGroups(leftGroup);
|
|
120
|
+
const to = handleRightHyphenRangeGroups(rightGroups);
|
|
121
|
+
return [from, to].filter(Boolean);
|
|
122
|
+
}
|
|
123
|
+
function handleCaretOperator(groups) {
|
|
124
|
+
const majorIsWildcard = isWildcard(groups.major);
|
|
125
|
+
const minorIsWildcard = isWildcard(groups.minor);
|
|
126
|
+
const patchIsWildcard = isWildcard(groups.patch);
|
|
127
|
+
const major = +groups.major;
|
|
128
|
+
const minor = +groups.minor;
|
|
129
|
+
const patch = +groups.patch;
|
|
130
|
+
if (majorIsWildcard)
|
|
131
|
+
return [_constants_js_1.ALL];
|
|
132
|
+
if (minorIsWildcard) {
|
|
133
|
+
return [
|
|
134
|
+
{ operator: ">=", major, minor: 0, patch: 0 },
|
|
135
|
+
{ operator: "<", major: major + 1, minor: 0, patch: 0 },
|
|
136
|
+
];
|
|
137
|
+
}
|
|
138
|
+
if (patchIsWildcard) {
|
|
139
|
+
if (major === 0) {
|
|
140
|
+
return [
|
|
141
|
+
{ operator: ">=", major, minor, patch: 0 },
|
|
142
|
+
{ operator: "<", major, minor: minor + 1, patch: 0 },
|
|
143
|
+
];
|
|
144
|
+
}
|
|
145
|
+
return [
|
|
146
|
+
{ operator: ">=", major, minor, patch: 0 },
|
|
147
|
+
{ operator: "<", major: major + 1, minor: 0, patch: 0 },
|
|
148
|
+
];
|
|
149
|
+
}
|
|
150
|
+
const prerelease = (0, _shared_js_1.parsePrerelease)(groups.prerelease ?? "");
|
|
151
|
+
if (major === 0) {
|
|
152
|
+
if (minor === 0) {
|
|
153
|
+
return [
|
|
154
|
+
{ operator: ">=", major, minor, patch, prerelease },
|
|
155
|
+
{ operator: "<", major, minor, patch: patch + 1 },
|
|
156
|
+
];
|
|
157
|
+
}
|
|
158
|
+
return [
|
|
159
|
+
{ operator: ">=", major, minor, patch, prerelease },
|
|
160
|
+
{ operator: "<", major, minor: minor + 1, patch: 0 },
|
|
161
|
+
];
|
|
162
|
+
}
|
|
163
|
+
return [
|
|
164
|
+
{ operator: ">=", major, minor, patch, prerelease },
|
|
165
|
+
{ operator: "<", major: major + 1, minor: 0, patch: 0 },
|
|
166
|
+
];
|
|
167
|
+
}
|
|
168
|
+
function handleTildeOperator(groups) {
|
|
169
|
+
const majorIsWildcard = isWildcard(groups.major);
|
|
170
|
+
const minorIsWildcard = isWildcard(groups.minor);
|
|
171
|
+
const patchIsWildcard = isWildcard(groups.patch);
|
|
172
|
+
const major = +groups.major;
|
|
173
|
+
const minor = +groups.minor;
|
|
174
|
+
const patch = +groups.patch;
|
|
175
|
+
if (majorIsWildcard)
|
|
176
|
+
return [_constants_js_1.ALL];
|
|
177
|
+
if (minorIsWildcard) {
|
|
178
|
+
return [
|
|
179
|
+
{ operator: ">=", major, minor: 0, patch: 0 },
|
|
180
|
+
{ operator: "<", major: major + 1, minor: 0, patch: 0 },
|
|
181
|
+
];
|
|
182
|
+
}
|
|
183
|
+
if (patchIsWildcard) {
|
|
184
|
+
return [
|
|
185
|
+
{ operator: ">=", major, minor, patch: 0 },
|
|
186
|
+
{ operator: "<", major, minor: minor + 1, patch: 0 },
|
|
187
|
+
];
|
|
188
|
+
}
|
|
189
|
+
const prerelease = (0, _shared_js_1.parsePrerelease)(groups.prerelease ?? "");
|
|
190
|
+
return [
|
|
191
|
+
{ operator: ">=", major, minor, patch, prerelease },
|
|
192
|
+
{ operator: "<", major, minor: minor + 1, patch: 0 },
|
|
193
|
+
];
|
|
194
|
+
}
|
|
195
|
+
function handleLessThanOperator(groups) {
|
|
196
|
+
const majorIsWildcard = isWildcard(groups.major);
|
|
197
|
+
const minorIsWildcard = isWildcard(groups.minor);
|
|
198
|
+
const patchIsWildcard = isWildcard(groups.patch);
|
|
199
|
+
const major = +groups.major;
|
|
200
|
+
const minor = +groups.minor;
|
|
201
|
+
const patch = +groups.patch;
|
|
202
|
+
if (majorIsWildcard)
|
|
203
|
+
return [{ operator: "<", major: 0, minor: 0, patch: 0 }];
|
|
204
|
+
if (minorIsWildcard) {
|
|
205
|
+
if (patchIsWildcard)
|
|
206
|
+
return [{ operator: "<", major, minor: 0, patch: 0 }];
|
|
207
|
+
return [{ operator: "<", major, minor: 0, patch: 0 }];
|
|
208
|
+
}
|
|
209
|
+
if (patchIsWildcard)
|
|
210
|
+
return [{ operator: "<", major, minor, patch: 0 }];
|
|
211
|
+
const prerelease = (0, _shared_js_1.parsePrerelease)(groups.prerelease ?? "");
|
|
212
|
+
const build = (0, _shared_js_1.parseBuild)(groups.build ?? "");
|
|
213
|
+
return [{ operator: "<", major, minor, patch, prerelease, build }];
|
|
214
|
+
}
|
|
215
|
+
function handleLessThanOrEqualOperator(groups) {
|
|
216
|
+
const minorIsWildcard = isWildcard(groups.minor);
|
|
217
|
+
const patchIsWildcard = isWildcard(groups.patch);
|
|
218
|
+
const major = +groups.major;
|
|
219
|
+
const minor = +groups.minor;
|
|
220
|
+
const patch = +groups.patch;
|
|
221
|
+
if (minorIsWildcard) {
|
|
222
|
+
if (patchIsWildcard) {
|
|
223
|
+
return [{ operator: "<", major: major + 1, minor: 0, patch: 0 }];
|
|
224
|
+
}
|
|
225
|
+
return [{ operator: "<", major, minor: minor + 1, patch: 0 }];
|
|
226
|
+
}
|
|
227
|
+
if (patchIsWildcard) {
|
|
228
|
+
return [{ operator: "<", major, minor: minor + 1, patch: 0 }];
|
|
229
|
+
}
|
|
230
|
+
const prerelease = (0, _shared_js_1.parsePrerelease)(groups.prerelease ?? "");
|
|
231
|
+
const build = (0, _shared_js_1.parseBuild)(groups.build ?? "");
|
|
232
|
+
return [{ operator: "<=", major, minor, patch, prerelease, build }];
|
|
233
|
+
}
|
|
234
|
+
function handleGreaterThanOperator(groups) {
|
|
235
|
+
const majorIsWildcard = isWildcard(groups.major);
|
|
236
|
+
const minorIsWildcard = isWildcard(groups.minor);
|
|
237
|
+
const patchIsWildcard = isWildcard(groups.patch);
|
|
238
|
+
const major = +groups.major;
|
|
239
|
+
const minor = +groups.minor;
|
|
240
|
+
const patch = +groups.patch;
|
|
241
|
+
if (majorIsWildcard)
|
|
242
|
+
return [{ operator: "<", major: 0, minor: 0, patch: 0 }];
|
|
243
|
+
if (minorIsWildcard) {
|
|
244
|
+
return [{ operator: ">=", major: major + 1, minor: 0, patch: 0 }];
|
|
245
|
+
}
|
|
246
|
+
if (patchIsWildcard) {
|
|
247
|
+
return [{ operator: ">=", major, minor: minor + 1, patch: 0 }];
|
|
248
|
+
}
|
|
249
|
+
const prerelease = (0, _shared_js_1.parsePrerelease)(groups.prerelease ?? "");
|
|
250
|
+
const build = (0, _shared_js_1.parseBuild)(groups.build ?? "");
|
|
251
|
+
return [{ operator: ">", major, minor, patch, prerelease, build }];
|
|
252
|
+
}
|
|
253
|
+
function handleGreaterOrEqualOperator(groups) {
|
|
254
|
+
const majorIsWildcard = isWildcard(groups.major);
|
|
255
|
+
const minorIsWildcard = isWildcard(groups.minor);
|
|
256
|
+
const patchIsWildcard = isWildcard(groups.patch);
|
|
257
|
+
const major = +groups.major;
|
|
258
|
+
const minor = +groups.minor;
|
|
259
|
+
const patch = +groups.patch;
|
|
260
|
+
if (majorIsWildcard)
|
|
261
|
+
return [_constants_js_1.ALL];
|
|
262
|
+
if (minorIsWildcard) {
|
|
263
|
+
if (patchIsWildcard)
|
|
264
|
+
return [{ operator: ">=", major, minor: 0, patch: 0 }];
|
|
265
|
+
return [{ operator: ">=", major, minor: 0, patch: 0 }];
|
|
266
|
+
}
|
|
267
|
+
if (patchIsWildcard)
|
|
268
|
+
return [{ operator: ">=", major, minor, patch: 0 }];
|
|
269
|
+
const prerelease = (0, _shared_js_1.parsePrerelease)(groups.prerelease ?? "");
|
|
270
|
+
const build = (0, _shared_js_1.parseBuild)(groups.build ?? "");
|
|
271
|
+
return [{ operator: ">=", major, minor, patch, prerelease, build }];
|
|
272
|
+
}
|
|
273
|
+
function handleEqualOperator(groups) {
|
|
274
|
+
const majorIsWildcard = isWildcard(groups.major);
|
|
275
|
+
const minorIsWildcard = isWildcard(groups.minor);
|
|
276
|
+
const patchIsWildcard = isWildcard(groups.patch);
|
|
277
|
+
const major = +groups.major;
|
|
278
|
+
const minor = +groups.minor;
|
|
279
|
+
const patch = +groups.patch;
|
|
280
|
+
if (majorIsWildcard)
|
|
281
|
+
return [_constants_js_1.ALL];
|
|
282
|
+
if (minorIsWildcard) {
|
|
283
|
+
return [
|
|
284
|
+
{ operator: ">=", major, minor: 0, patch: 0 },
|
|
285
|
+
{ operator: "<", major: major + 1, minor: 0, patch: 0 },
|
|
286
|
+
];
|
|
287
|
+
}
|
|
288
|
+
if (patchIsWildcard) {
|
|
289
|
+
return [
|
|
290
|
+
{ operator: ">=", major, minor, patch: 0 },
|
|
291
|
+
{ operator: "<", major, minor: minor + 1, patch: 0 },
|
|
292
|
+
];
|
|
293
|
+
}
|
|
294
|
+
const prerelease = (0, _shared_js_1.parsePrerelease)(groups.prerelease ?? "");
|
|
295
|
+
const build = (0, _shared_js_1.parseBuild)(groups.build ?? "");
|
|
296
|
+
return [{ operator: undefined, major, minor, patch, prerelease, build }];
|
|
297
|
+
}
|
|
298
|
+
function parseOperatorRange(string) {
|
|
299
|
+
const groups = string.match(_shared_js_1.OPERATOR_XRANGE_REGEXP)
|
|
300
|
+
?.groups;
|
|
301
|
+
if (!groups)
|
|
302
|
+
return parseComparator(string);
|
|
303
|
+
switch (groups.operator) {
|
|
304
|
+
case "^":
|
|
305
|
+
return handleCaretOperator(groups);
|
|
306
|
+
case "~":
|
|
307
|
+
case "~>":
|
|
308
|
+
return handleTildeOperator(groups);
|
|
309
|
+
case "<":
|
|
310
|
+
return handleLessThanOperator(groups);
|
|
311
|
+
case "<=":
|
|
312
|
+
return handleLessThanOrEqualOperator(groups);
|
|
313
|
+
case ">":
|
|
314
|
+
return handleGreaterThanOperator(groups);
|
|
315
|
+
case ">=":
|
|
316
|
+
return handleGreaterOrEqualOperator(groups);
|
|
317
|
+
case "=":
|
|
318
|
+
case "":
|
|
319
|
+
return handleEqualOperator(groups);
|
|
320
|
+
default:
|
|
321
|
+
throw new Error(`Cannot parse version range: '${groups.operator}' is not a valid operator`);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
function parseOperatorRanges(string) {
|
|
325
|
+
return string.split(/\s+/).flatMap(parseOperatorRange);
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Parses a range string into a {@linkcode Range} object.
|
|
329
|
+
*
|
|
330
|
+
* @example Usage
|
|
331
|
+
* ```ts
|
|
332
|
+
* import { parseRange } from "parse_range.ts";
|
|
333
|
+
* import { assertEquals } from "../assert/mod.ts";
|
|
334
|
+
*
|
|
335
|
+
* const range = parseRange(">=1.0.0 <2.0.0 || >=3.0.0");
|
|
336
|
+
* assertEquals(range, [
|
|
337
|
+
* [
|
|
338
|
+
* { operator: ">=", major: 1, minor: 0, patch: 0, prerelease: [], build: [] },
|
|
339
|
+
* { operator: "<", major: 2, minor: 0, patch: 0, prerelease: [], build: [] },
|
|
340
|
+
* ],
|
|
341
|
+
* [
|
|
342
|
+
* { operator: ">=", major: 3, minor: 0, patch: 0, prerelease: [], build: [] },
|
|
343
|
+
* ]
|
|
344
|
+
* ]);
|
|
345
|
+
* ```
|
|
346
|
+
*
|
|
347
|
+
* @throws {TypeError} If the input range is invalid.
|
|
348
|
+
* @param value The range set string
|
|
349
|
+
* @returns A valid SemVer range
|
|
350
|
+
*/
|
|
351
|
+
function parseRange(value) {
|
|
352
|
+
const result = value
|
|
353
|
+
// remove spaces between operators and versions
|
|
354
|
+
.replaceAll(/(?<=<|>|=|~|\^)(\s+)/g, "")
|
|
355
|
+
.split(/\s*\|\|\s*/)
|
|
356
|
+
.map((string) => parseHyphenRange(string) || parseOperatorRanges(string));
|
|
357
|
+
if (result.some((r) => r.includes(null))) {
|
|
358
|
+
throw new TypeError(`Cannot parse version range: range "${value}" is invalid`);
|
|
359
|
+
}
|
|
360
|
+
return result;
|
|
361
|
+
}
|
|
362
|
+
exports.parseRange = parseRange;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Range } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The ranges intersect every range of AND comparators intersects with a least
|
|
4
|
+
* one range of OR ranges.
|
|
5
|
+
*
|
|
6
|
+
* @example Usage
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { parseRange, rangeIntersects } from "mod.ts";
|
|
9
|
+
* import { assert } from "../assert/mod.ts";
|
|
10
|
+
*
|
|
11
|
+
* const range1 = parseRange(">=1.0.0 <2.0.0");
|
|
12
|
+
* const range2 = parseRange(">=1.0.0 <1.2.3");
|
|
13
|
+
* const range3 = parseRange(">=1.2.3 <2.0.0");
|
|
14
|
+
*
|
|
15
|
+
* assert(rangeIntersects(range1, range2));
|
|
16
|
+
* assert(rangeIntersects(range1, range3));
|
|
17
|
+
* assert(!rangeIntersects(range2, range3));
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @param range1 range 0
|
|
21
|
+
* @param range2 range 1
|
|
22
|
+
* @returns returns true if the given ranges intersect, false otherwise
|
|
23
|
+
*/
|
|
24
|
+
export declare function rangeIntersects(range1: Range, range2: Range): boolean;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rangeIntersects = void 0;
|
|
4
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
5
|
+
// This module is browser compatible.
|
|
6
|
+
const _shared_js_1 = require("./_shared.js");
|
|
7
|
+
const compare_js_1 = require("./compare.js");
|
|
8
|
+
const satisfies_js_1 = require("./satisfies.js");
|
|
9
|
+
function comparatorIntersects(comparator1, comparator2) {
|
|
10
|
+
const op0 = comparator1.operator;
|
|
11
|
+
const op1 = comparator2.operator;
|
|
12
|
+
if (op0 === undefined) {
|
|
13
|
+
// if comparator1 is empty comparator, then returns true
|
|
14
|
+
if ((0, _shared_js_1.isWildcardComparator)(comparator1))
|
|
15
|
+
return true;
|
|
16
|
+
return (0, satisfies_js_1.satisfies)(comparator1, [[comparator2]]);
|
|
17
|
+
}
|
|
18
|
+
if (op1 === undefined) {
|
|
19
|
+
if ((0, _shared_js_1.isWildcardComparator)(comparator2))
|
|
20
|
+
return true;
|
|
21
|
+
return (0, satisfies_js_1.satisfies)(comparator2, [[comparator1]]);
|
|
22
|
+
}
|
|
23
|
+
const cmp = (0, compare_js_1.compare)(comparator1, comparator2);
|
|
24
|
+
const sameDirectionIncreasing = (op0 === ">=" || op0 === ">") &&
|
|
25
|
+
(op1 === ">=" || op1 === ">");
|
|
26
|
+
const sameDirectionDecreasing = (op0 === "<=" || op0 === "<") &&
|
|
27
|
+
(op1 === "<=" || op1 === "<");
|
|
28
|
+
const sameSemVer = cmp === 0;
|
|
29
|
+
const differentDirectionsInclusive = (op0 === ">=" || op0 === "<=") &&
|
|
30
|
+
(op1 === ">=" || op1 === "<=");
|
|
31
|
+
const oppositeDirectionsLessThan = cmp === -1 &&
|
|
32
|
+
(op0 === ">=" || op0 === ">") &&
|
|
33
|
+
(op1 === "<=" || op1 === "<");
|
|
34
|
+
const oppositeDirectionsGreaterThan = cmp === 1 &&
|
|
35
|
+
(op0 === "<=" || op0 === "<") &&
|
|
36
|
+
(op1 === ">=" || op1 === ">");
|
|
37
|
+
return sameDirectionIncreasing ||
|
|
38
|
+
sameDirectionDecreasing ||
|
|
39
|
+
(sameSemVer && differentDirectionsInclusive) ||
|
|
40
|
+
oppositeDirectionsLessThan ||
|
|
41
|
+
oppositeDirectionsGreaterThan;
|
|
42
|
+
}
|
|
43
|
+
function rangesSatisfiable(ranges) {
|
|
44
|
+
return ranges.every((r) => {
|
|
45
|
+
// For each OR at least one AND must be satisfiable
|
|
46
|
+
return r.some((comparators) => comparatorsSatisfiable(comparators));
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function comparatorsSatisfiable(comparators) {
|
|
50
|
+
// Comparators are satisfiable if they all intersect with each other
|
|
51
|
+
for (let i = 0; i < comparators.length - 1; i++) {
|
|
52
|
+
const comparator1 = comparators[i];
|
|
53
|
+
for (const comparator2 of comparators.slice(i + 1)) {
|
|
54
|
+
if (!comparatorIntersects(comparator1, comparator2)) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The ranges intersect every range of AND comparators intersects with a least
|
|
63
|
+
* one range of OR ranges.
|
|
64
|
+
*
|
|
65
|
+
* @example Usage
|
|
66
|
+
* ```ts
|
|
67
|
+
* import { parseRange, rangeIntersects } from "mod.ts";
|
|
68
|
+
* import { assert } from "../assert/mod.ts";
|
|
69
|
+
*
|
|
70
|
+
* const range1 = parseRange(">=1.0.0 <2.0.0");
|
|
71
|
+
* const range2 = parseRange(">=1.0.0 <1.2.3");
|
|
72
|
+
* const range3 = parseRange(">=1.2.3 <2.0.0");
|
|
73
|
+
*
|
|
74
|
+
* assert(rangeIntersects(range1, range2));
|
|
75
|
+
* assert(rangeIntersects(range1, range3));
|
|
76
|
+
* assert(!rangeIntersects(range2, range3));
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* @param range1 range 0
|
|
80
|
+
* @param range2 range 1
|
|
81
|
+
* @returns returns true if the given ranges intersect, false otherwise
|
|
82
|
+
*/
|
|
83
|
+
function rangeIntersects(range1, range2) {
|
|
84
|
+
return rangesSatisfiable([range1, range2]) &&
|
|
85
|
+
range1.some((range10) => {
|
|
86
|
+
return range2.some((r11) => {
|
|
87
|
+
return range10.every((comparator1) => {
|
|
88
|
+
return r11.every((comparator2) => comparatorIntersects(comparator1, comparator2));
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
exports.rangeIntersects = rangeIntersects;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Range, SemVer } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Test to see if the SemVer satisfies the range.
|
|
4
|
+
*
|
|
5
|
+
* @example Usage
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { parse, parseRange, satisfies } from "mod.ts";
|
|
8
|
+
* import { assert } from "../assert/mod.ts";
|
|
9
|
+
*
|
|
10
|
+
* const version = parse("1.2.3");
|
|
11
|
+
* const range0 = parseRange(">=1.0.0 <2.0.0");
|
|
12
|
+
* const range1 = parseRange(">=1.0.0 <1.3.0");
|
|
13
|
+
* const range2 = parseRange(">=1.0.0 <1.2.3");
|
|
14
|
+
*
|
|
15
|
+
* assert(satisfies(version, range0));
|
|
16
|
+
* assert(satisfies(version, range1));
|
|
17
|
+
* assert(!satisfies(version, range2));
|
|
18
|
+
* ```
|
|
19
|
+
* @param version The version to test
|
|
20
|
+
* @param range The range to check
|
|
21
|
+
* @returns true if the version is in the range
|
|
22
|
+
*/
|
|
23
|
+
export declare function satisfies(version: SemVer, range: Range): boolean;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.satisfies = void 0;
|
|
5
|
+
const _test_comparator_set_js_1 = require("./_test_comparator_set.js");
|
|
6
|
+
/**
|
|
7
|
+
* Test to see if the SemVer satisfies the range.
|
|
8
|
+
*
|
|
9
|
+
* @example Usage
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { parse, parseRange, satisfies } from "mod.ts";
|
|
12
|
+
* import { assert } from "../assert/mod.ts";
|
|
13
|
+
*
|
|
14
|
+
* const version = parse("1.2.3");
|
|
15
|
+
* const range0 = parseRange(">=1.0.0 <2.0.0");
|
|
16
|
+
* const range1 = parseRange(">=1.0.0 <1.3.0");
|
|
17
|
+
* const range2 = parseRange(">=1.0.0 <1.2.3");
|
|
18
|
+
*
|
|
19
|
+
* assert(satisfies(version, range0));
|
|
20
|
+
* assert(satisfies(version, range1));
|
|
21
|
+
* assert(!satisfies(version, range2));
|
|
22
|
+
* ```
|
|
23
|
+
* @param version The version to test
|
|
24
|
+
* @param range The range to check
|
|
25
|
+
* @returns true if the version is in the range
|
|
26
|
+
*/
|
|
27
|
+
function satisfies(version, range) {
|
|
28
|
+
return range.some((set) => (0, _test_comparator_set_js_1.testComparatorSet)(version, set));
|
|
29
|
+
}
|
|
30
|
+
exports.satisfies = satisfies;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SemVer } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the parsed SemVer, or `undefined` if it's not valid.
|
|
4
|
+
*
|
|
5
|
+
* @example Usage
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { tryParse } from "try_parse.ts";
|
|
8
|
+
* import { assertEquals } from "../assert/mod.ts";
|
|
9
|
+
*
|
|
10
|
+
* assertEquals(tryParse("1.2.3"), { major: 1, minor: 2, patch: 3, prerelease: [], build: [] });
|
|
11
|
+
* assertEquals(tryParse("1.2.3-alpha"), { major: 1, minor: 2, patch: 3, prerelease: ["alpha"], build: [] });
|
|
12
|
+
* assertEquals(tryParse("1.2.3+build"), { major: 1, minor: 2, patch: 3, prerelease: [], build: ["build"] });
|
|
13
|
+
* assertEquals(tryParse("1.2.3-alpha.1+build.1"), { major: 1, minor: 2, patch: 3, prerelease: ["alpha", 1], build: ["build", "1"] });
|
|
14
|
+
* assertEquals(tryParse(" invalid "), undefined);
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param value The version string to parse
|
|
18
|
+
* @returns A valid SemVer or `undefined`
|
|
19
|
+
*/
|
|
20
|
+
export declare function tryParse(value: string): SemVer | undefined;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tryParse = void 0;
|
|
4
|
+
const parse_js_1 = require("./parse.js");
|
|
5
|
+
/**
|
|
6
|
+
* Returns the parsed SemVer, or `undefined` if it's not valid.
|
|
7
|
+
*
|
|
8
|
+
* @example Usage
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { tryParse } from "try_parse.ts";
|
|
11
|
+
* import { assertEquals } from "../assert/mod.ts";
|
|
12
|
+
*
|
|
13
|
+
* assertEquals(tryParse("1.2.3"), { major: 1, minor: 2, patch: 3, prerelease: [], build: [] });
|
|
14
|
+
* assertEquals(tryParse("1.2.3-alpha"), { major: 1, minor: 2, patch: 3, prerelease: ["alpha"], build: [] });
|
|
15
|
+
* assertEquals(tryParse("1.2.3+build"), { major: 1, minor: 2, patch: 3, prerelease: [], build: ["build"] });
|
|
16
|
+
* assertEquals(tryParse("1.2.3-alpha.1+build.1"), { major: 1, minor: 2, patch: 3, prerelease: ["alpha", 1], build: ["build", "1"] });
|
|
17
|
+
* assertEquals(tryParse(" invalid "), undefined);
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @param value The version string to parse
|
|
21
|
+
* @returns A valid SemVer or `undefined`
|
|
22
|
+
*/
|
|
23
|
+
function tryParse(value) {
|
|
24
|
+
try {
|
|
25
|
+
return (0, parse_js_1.parse)(value);
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.tryParse = tryParse;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Range } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Parses the given range string and returns a Range object. If the range string
|
|
4
|
+
* is invalid, `undefined` is returned.
|
|
5
|
+
*
|
|
6
|
+
* @example Usage
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { tryParseRange } from "mod.ts";
|
|
9
|
+
* import { assertEquals } from "../assert/mod.ts";
|
|
10
|
+
*
|
|
11
|
+
* assertEquals(tryParseRange(">=1.2.3 <1.2.4"), [
|
|
12
|
+
* [
|
|
13
|
+
* { operator: ">=", major: 1, minor: 2, patch: 3, prerelease: [], build: [] },
|
|
14
|
+
* { operator: "<", major: 1, minor: 2, patch: 4, prerelease: [], build: [] },
|
|
15
|
+
* ],
|
|
16
|
+
* ]);
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @param value The range string
|
|
20
|
+
* @returns A Range object if valid otherwise `undefined`
|
|
21
|
+
*/
|
|
22
|
+
export declare function tryParseRange(value: string): Range | undefined;
|
|
@@ -0,0 +1,37 @@
|
|
|
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.tryParseRange = void 0;
|
|
6
|
+
const parse_range_js_1 = require("./parse_range.js");
|
|
7
|
+
/**
|
|
8
|
+
* Parses the given range string and returns a Range object. If the range string
|
|
9
|
+
* is invalid, `undefined` is returned.
|
|
10
|
+
*
|
|
11
|
+
* @example Usage
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { tryParseRange } from "mod.ts";
|
|
14
|
+
* import { assertEquals } from "../assert/mod.ts";
|
|
15
|
+
*
|
|
16
|
+
* assertEquals(tryParseRange(">=1.2.3 <1.2.4"), [
|
|
17
|
+
* [
|
|
18
|
+
* { operator: ">=", major: 1, minor: 2, patch: 3, prerelease: [], build: [] },
|
|
19
|
+
* { operator: "<", major: 1, minor: 2, patch: 4, prerelease: [], build: [] },
|
|
20
|
+
* ],
|
|
21
|
+
* ]);
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @param value The range string
|
|
25
|
+
* @returns A Range object if valid otherwise `undefined`
|
|
26
|
+
*/
|
|
27
|
+
function tryParseRange(value) {
|
|
28
|
+
try {
|
|
29
|
+
// Return '*' instead of '' so that truthiness works.
|
|
30
|
+
// This will throw if it's invalid anyway
|
|
31
|
+
return (0, parse_range_js_1.parseRange)(value);
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.tryParseRange = tryParseRange;
|