keep-a-changelog 2.5.2 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -1
- package/README.md +15 -14
- package/esm/keep-a-changelog/bin.d.ts +2 -0
- package/esm/{bin.js → keep-a-changelog/bin.js} +96 -18
- package/esm/{mod.d.ts → keep-a-changelog/mod.d.ts} +1 -1
- package/esm/{mod.js → keep-a-changelog/mod.js} +1 -1
- package/esm/keep-a-changelog/test/changelog.azdo.md +24 -0
- package/esm/keep-a-changelog/test/changelog.sort.md +17 -0
- package/esm/std/cli/parse_args.d.ts +193 -0
- package/esm/std/cli/parse_args.js +357 -0
- package/esm/std/ini/_ini_map.d.ts +90 -0
- package/esm/std/ini/_ini_map.js +371 -0
- package/esm/std/ini/mod.d.ts +31 -0
- package/esm/std/ini/mod.js +33 -0
- package/esm/std/ini/parse.d.ts +77 -0
- package/esm/std/ini/parse.js +72 -0
- package/esm/std/ini/stringify.d.ts +83 -0
- package/esm/std/ini/stringify.js +66 -0
- package/esm/std/path/_common/assert_path.d.ts +1 -0
- package/esm/std/path/_common/assert_path.js +7 -0
- package/esm/std/path/_common/basename.d.ts +3 -0
- package/esm/std/path/_common/basename.js +40 -0
- package/esm/std/path/_common/common.d.ts +1 -0
- package/esm/std/path/_common/common.js +23 -0
- package/esm/{deps/deno.land/std@0.189.0/path/_constants.js → std/path/_common/constants.js} +1 -1
- package/esm/std/path/_common/dirname.d.ts +1 -0
- package/esm/std/path/_common/dirname.js +8 -0
- package/esm/std/path/_common/format.d.ts +3 -0
- package/esm/std/path/_common/format.js +19 -0
- package/esm/std/path/_common/from_file_url.d.ts +2 -0
- package/esm/std/path/_common/from_file_url.js +9 -0
- package/esm/std/path/_common/glob_to_reg_exp.d.ts +34 -0
- package/esm/std/path/_common/glob_to_reg_exp.js +234 -0
- package/esm/std/path/_common/normalize.d.ts +1 -0
- package/esm/std/path/_common/normalize.js +8 -0
- package/esm/std/path/_common/normalize_string.d.ts +1 -0
- package/esm/std/path/_common/normalize_string.js +77 -0
- package/esm/std/path/_common/relative.d.ts +1 -0
- package/esm/std/path/_common/relative.js +9 -0
- package/esm/std/path/_common/strip_trailing_separators.d.ts +1 -0
- package/esm/std/path/_common/strip_trailing_separators.js +19 -0
- package/esm/std/path/_common/to_file_url.d.ts +1 -0
- package/esm/std/path/_common/to_file_url.js +15 -0
- package/esm/std/path/_os.d.ts +1 -0
- package/esm/std/path/_os.js +9 -0
- package/esm/std/path/basename.d.ts +27 -0
- package/esm/std/path/basename.js +36 -0
- package/esm/std/path/common.d.ts +27 -0
- package/esm/std/path/common.js +33 -0
- package/esm/std/path/constants.d.ts +14 -0
- package/esm/std/path/constants.js +17 -0
- package/esm/std/path/dirname.d.ts +22 -0
- package/esm/std/path/dirname.js +29 -0
- package/esm/std/path/extname.d.ts +22 -0
- package/esm/std/path/extname.js +29 -0
- package/esm/std/path/format.d.ts +21 -0
- package/esm/std/path/format.js +27 -0
- package/esm/std/path/from_file_url.d.ts +22 -0
- package/esm/std/path/from_file_url.js +28 -0
- package/esm/std/path/glob_to_regexp.d.ts +76 -0
- package/esm/std/path/glob_to_regexp.js +83 -0
- package/esm/std/path/is_absolute.d.ts +21 -0
- package/esm/std/path/is_absolute.js +28 -0
- package/esm/std/path/is_glob.d.ts +16 -0
- package/esm/std/path/is_glob.js +42 -0
- package/esm/std/path/join.d.ts +22 -0
- package/esm/std/path/join.js +29 -0
- package/esm/std/path/join_globs.d.ts +27 -0
- package/esm/std/path/join_globs.js +34 -0
- package/esm/std/path/mod.d.ts +53 -0
- package/esm/std/path/mod.js +57 -0
- package/esm/std/path/normalize.d.ts +26 -0
- package/esm/std/path/normalize.js +33 -0
- package/esm/std/path/normalize_glob.d.ts +28 -0
- package/esm/std/path/normalize_glob.js +35 -0
- package/esm/std/path/parse.d.ts +34 -0
- package/esm/std/path/parse.js +39 -0
- package/esm/std/path/posix/_util.d.ts +1 -0
- package/esm/std/path/posix/_util.js +8 -0
- package/esm/std/path/posix/basename.d.ts +39 -0
- package/esm/std/path/posix/basename.js +49 -0
- package/esm/std/path/posix/constants.d.ts +12 -0
- package/esm/std/path/posix/constants.js +14 -0
- package/esm/std/path/posix/dirname.d.ts +31 -0
- package/esm/std/path/posix/dirname.js +62 -0
- package/esm/std/path/posix/extname.d.ts +36 -0
- package/esm/std/path/posix/extname.js +89 -0
- package/esm/std/path/posix/format.d.ts +23 -0
- package/esm/std/path/posix/format.js +28 -0
- package/esm/std/path/posix/from_file_url.d.ts +16 -0
- package/esm/std/path/posix/from_file_url.js +21 -0
- package/esm/std/path/posix/glob_to_regexp.d.ts +71 -0
- package/{script/deps/deno.land/std@0.189.0/path/glob.d.ts → esm/std/path/posix/glob_to_regexp.js} +28 -29
- package/esm/std/path/posix/is_absolute.d.ts +16 -0
- package/esm/std/path/posix/is_absolute.js +23 -0
- package/esm/std/path/posix/join.d.ts +32 -0
- package/esm/std/path/posix/join.js +42 -0
- package/esm/std/path/posix/join_globs.d.ts +19 -0
- package/esm/std/path/posix/join_globs.js +40 -0
- package/esm/std/path/posix/normalize.d.ts +39 -0
- package/esm/std/path/posix/normalize.js +57 -0
- package/esm/std/path/posix/normalize_glob.d.ts +19 -0
- package/esm/std/path/posix/normalize_glob.js +32 -0
- package/esm/std/path/posix/parse.d.ts +24 -0
- package/esm/std/path/posix/parse.js +115 -0
- package/esm/std/path/posix/relative.d.ts +19 -0
- package/esm/std/path/posix/relative.js +106 -0
- package/esm/std/path/posix/resolve.d.ts +16 -0
- package/esm/std/path/posix/resolve.js +59 -0
- package/esm/std/path/posix/to_file_url.d.ts +17 -0
- package/esm/std/path/posix/to_file_url.js +27 -0
- package/esm/std/path/posix/to_namespaced_path.d.ts +15 -0
- package/esm/std/path/posix/to_namespaced_path.js +20 -0
- package/esm/std/path/relative.d.ts +23 -0
- package/esm/std/path/relative.js +30 -0
- package/esm/std/path/resolve.d.ts +21 -0
- package/esm/std/path/resolve.js +30 -0
- package/esm/std/path/to_file_url.d.ts +22 -0
- package/esm/std/path/to_file_url.js +28 -0
- package/esm/std/path/to_namespaced_path.d.ts +20 -0
- package/esm/std/path/to_namespaced_path.js +29 -0
- package/esm/{deps/deno.land/std@0.189.0/path/_interface.d.ts → std/path/types.d.ts} +13 -2
- package/esm/std/path/types.js +3 -0
- package/esm/std/path/windows/_util.d.ts +3 -0
- package/esm/std/path/windows/_util.js +15 -0
- package/esm/std/path/windows/basename.d.ts +22 -0
- package/esm/std/path/windows/basename.js +44 -0
- package/esm/std/path/windows/constants.d.ts +12 -0
- package/esm/std/path/windows/constants.js +14 -0
- package/esm/std/path/windows/dirname.d.ts +19 -0
- package/esm/std/path/windows/dirname.js +112 -0
- package/esm/std/path/windows/extname.d.ts +19 -0
- package/esm/std/path/windows/extname.js +81 -0
- package/esm/std/path/windows/format.d.ts +23 -0
- package/esm/std/path/windows/format.js +28 -0
- package/esm/std/path/windows/from_file_url.d.ts +18 -0
- package/esm/std/path/windows/from_file_url.js +30 -0
- package/esm/std/path/windows/glob_to_regexp.d.ts +70 -0
- package/esm/{deps/deno.land/std@0.189.0/path/glob.d.ts → std/path/windows/glob_to_regexp.js} +28 -29
- package/esm/std/path/windows/is_absolute.d.ts +16 -0
- package/esm/std/path/windows/is_absolute.js +38 -0
- package/esm/std/path/windows/join.d.ts +19 -0
- package/esm/std/path/windows/join.js +74 -0
- package/esm/std/path/windows/join_globs.d.ts +20 -0
- package/esm/std/path/windows/join_globs.js +41 -0
- package/esm/std/path/windows/normalize.d.ts +21 -0
- package/esm/std/path/windows/normalize.js +134 -0
- package/esm/std/path/windows/normalize_glob.d.ts +19 -0
- package/esm/std/path/windows/normalize_glob.js +32 -0
- package/esm/std/path/windows/parse.d.ts +24 -0
- package/esm/std/path/windows/parse.js +176 -0
- package/esm/std/path/windows/relative.d.ts +22 -0
- package/esm/std/path/windows/relative.js +131 -0
- package/esm/std/path/windows/resolve.d.ts +16 -0
- package/esm/std/path/windows/resolve.js +154 -0
- package/esm/std/path/windows/to_file_url.d.ts +17 -0
- package/esm/std/path/windows/to_file_url.js +34 -0
- package/esm/std/path/windows/to_namespaced_path.d.ts +16 -0
- package/esm/std/path/windows/to_namespaced_path.js +49 -0
- package/esm/std/semver/_constants.d.ts +15 -0
- package/esm/std/semver/_constants.js +38 -0
- package/esm/std/semver/_shared.d.ts +43 -0
- package/esm/std/semver/_shared.js +162 -0
- package/esm/std/semver/_test_comparator_set.d.ts +2 -0
- package/esm/std/semver/_test_comparator_set.js +58 -0
- package/esm/std/semver/can_parse.d.ts +16 -0
- package/esm/std/semver/can_parse.js +27 -0
- package/esm/std/semver/compare.d.ts +27 -0
- package/esm/std/semver/compare.js +35 -0
- package/esm/std/semver/difference.d.ts +26 -0
- package/esm/std/semver/difference.js +41 -0
- package/esm/std/semver/equals.d.ts +23 -0
- package/esm/std/semver/equals.js +27 -0
- package/esm/std/semver/format.d.ts +21 -0
- package/esm/std/semver/format.js +32 -0
- package/esm/std/semver/format_range.d.ts +17 -0
- package/esm/std/semver/format_range.js +27 -0
- package/esm/std/semver/greater_or_equal.d.ts +24 -0
- package/esm/std/semver/greater_or_equal.js +26 -0
- package/esm/std/semver/greater_than.d.ts +24 -0
- package/esm/std/semver/greater_than.js +28 -0
- package/esm/std/semver/greater_than_range.d.ts +22 -0
- package/esm/std/semver/greater_than_range.js +58 -0
- package/{script/deps/deno.land/std@0.205.0 → esm/std}/semver/increment.d.ts +27 -5
- package/esm/std/semver/increment.js +176 -0
- package/esm/std/semver/is_range.d.ts +22 -0
- package/esm/std/semver/is_range.js +38 -0
- package/{script/deps/deno.land/std@0.205.0 → esm/std}/semver/is_semver.d.ts +16 -0
- package/esm/{deps/deno.land/std@0.205.0 → std}/semver/is_semver.js +25 -13
- package/esm/std/semver/less_or_equal.d.ts +24 -0
- package/esm/std/semver/less_or_equal.js +26 -0
- package/esm/std/semver/less_than.d.ts +24 -0
- package/esm/std/semver/less_than.js +26 -0
- package/esm/std/semver/less_than_range.d.ts +22 -0
- package/esm/std/semver/less_than_range.js +58 -0
- package/esm/std/semver/max_satisfying.d.ts +21 -0
- package/esm/std/semver/max_satisfying.js +30 -0
- package/esm/std/semver/min_satisfying.d.ts +21 -0
- package/esm/std/semver/min_satisfying.js +30 -0
- package/{script/deps/deno.land/std@0.205.0 → esm/std}/semver/mod.d.ts +72 -85
- package/esm/{deps/deno.land/std@0.205.0 → std}/semver/mod.js +73 -86
- package/esm/std/semver/not_equals.d.ts +23 -0
- package/esm/std/semver/not_equals.js +25 -0
- package/esm/std/semver/parse.d.ts +24 -0
- package/esm/std/semver/parse.js +44 -0
- package/esm/std/semver/parse_range.d.ts +26 -0
- package/esm/std/semver/parse_range.js +358 -0
- package/esm/std/semver/range_intersects.d.ts +24 -0
- package/esm/std/semver/range_intersects.js +89 -0
- package/esm/std/semver/satisfies.d.ts +23 -0
- package/esm/std/semver/satisfies.js +26 -0
- package/esm/std/semver/try_parse.d.ts +20 -0
- package/esm/std/semver/try_parse.js +27 -0
- package/esm/std/semver/try_parse_range.d.ts +22 -0
- package/esm/std/semver/try_parse_range.js +33 -0
- package/esm/std/semver/types.d.ts +57 -0
- package/esm/std/semver/types.js +3 -0
- package/package.json +14 -13
- package/script/keep-a-changelog/bin.d.ts +2 -0
- package/script/{bin.js → keep-a-changelog/bin.js} +97 -19
- package/script/{mod.d.ts → keep-a-changelog/mod.d.ts} +1 -1
- package/script/{mod.js → keep-a-changelog/mod.js} +1 -1
- package/script/keep-a-changelog/test/changelog.azdo.md +24 -0
- package/script/keep-a-changelog/test/changelog.sort.md +17 -0
- package/script/std/cli/parse_args.d.ts +193 -0
- package/script/std/cli/parse_args.js +361 -0
- package/script/std/ini/_ini_map.d.ts +90 -0
- package/script/std/ini/_ini_map.js +375 -0
- package/script/std/ini/mod.d.ts +31 -0
- package/script/std/ini/mod.js +49 -0
- package/script/std/ini/parse.d.ts +77 -0
- package/script/std/ini/parse.js +76 -0
- package/script/std/ini/stringify.d.ts +83 -0
- package/script/std/ini/stringify.js +70 -0
- package/script/std/path/_common/assert_path.d.ts +1 -0
- package/script/std/path/_common/assert_path.js +11 -0
- package/script/std/path/_common/basename.d.ts +3 -0
- package/script/std/path/_common/basename.js +46 -0
- package/script/std/path/_common/common.d.ts +1 -0
- package/script/std/path/_common/common.js +27 -0
- package/script/{deps/deno.land/std@0.189.0/path/_constants.js → std/path/_common/constants.js} +1 -1
- package/script/std/path/_common/dirname.d.ts +1 -0
- package/script/std/path/_common/dirname.js +12 -0
- package/script/std/path/_common/format.d.ts +3 -0
- package/script/std/path/_common/format.js +24 -0
- package/script/std/path/_common/from_file_url.d.ts +2 -0
- package/script/std/path/_common/from_file_url.js +13 -0
- package/script/std/path/_common/glob_to_reg_exp.d.ts +34 -0
- package/script/std/path/_common/glob_to_reg_exp.js +238 -0
- package/script/std/path/_common/normalize.d.ts +1 -0
- package/script/std/path/_common/normalize.js +12 -0
- package/script/std/path/_common/normalize_string.d.ts +1 -0
- package/script/std/path/_common/normalize_string.js +81 -0
- package/script/std/path/_common/relative.d.ts +1 -0
- package/script/std/path/_common/relative.js +13 -0
- package/script/std/path/_common/strip_trailing_separators.d.ts +1 -0
- package/script/std/path/_common/strip_trailing_separators.js +23 -0
- package/script/std/path/_common/to_file_url.d.ts +1 -0
- package/script/std/path/_common/to_file_url.js +19 -0
- package/script/std/path/_os.d.ts +1 -0
- package/script/{deps/deno.land/std@0.189.0/_util/os.js → std/path/_os.js} +10 -19
- package/script/std/path/basename.d.ts +27 -0
- package/script/std/path/basename.js +40 -0
- package/script/std/path/common.d.ts +27 -0
- package/script/std/path/common.js +37 -0
- package/script/std/path/constants.d.ts +14 -0
- package/script/std/path/constants.js +20 -0
- package/script/std/path/dirname.d.ts +22 -0
- package/script/std/path/dirname.js +33 -0
- package/script/std/path/extname.d.ts +22 -0
- package/script/std/path/extname.js +33 -0
- package/script/std/path/format.d.ts +21 -0
- package/script/std/path/format.js +31 -0
- package/script/std/path/from_file_url.d.ts +22 -0
- package/script/std/path/from_file_url.js +32 -0
- package/script/std/path/glob_to_regexp.d.ts +76 -0
- package/script/std/path/glob_to_regexp.js +87 -0
- package/script/std/path/is_absolute.d.ts +21 -0
- package/script/std/path/is_absolute.js +32 -0
- package/script/std/path/is_glob.d.ts +16 -0
- package/script/std/path/is_glob.js +46 -0
- package/script/std/path/join.d.ts +22 -0
- package/script/std/path/join.js +33 -0
- package/script/std/path/join_globs.d.ts +27 -0
- package/script/std/path/join_globs.js +38 -0
- package/script/std/path/mod.d.ts +53 -0
- package/script/std/path/mod.js +73 -0
- package/script/std/path/normalize.d.ts +26 -0
- package/script/std/path/normalize.js +37 -0
- package/script/std/path/normalize_glob.d.ts +28 -0
- package/script/std/path/normalize_glob.js +39 -0
- package/script/std/path/parse.d.ts +34 -0
- package/script/std/path/parse.js +43 -0
- package/script/std/path/posix/_util.d.ts +1 -0
- package/script/std/path/posix/_util.js +12 -0
- package/script/std/path/posix/basename.d.ts +39 -0
- package/script/std/path/posix/basename.js +53 -0
- package/script/std/path/posix/constants.d.ts +12 -0
- package/script/std/path/posix/constants.js +17 -0
- package/script/std/path/posix/dirname.d.ts +31 -0
- package/script/std/path/posix/dirname.js +66 -0
- package/script/std/path/posix/extname.d.ts +36 -0
- package/script/std/path/posix/extname.js +93 -0
- package/script/std/path/posix/format.d.ts +23 -0
- package/script/std/path/posix/format.js +32 -0
- package/script/std/path/posix/from_file_url.d.ts +16 -0
- package/script/std/path/posix/from_file_url.js +25 -0
- package/script/std/path/posix/glob_to_regexp.d.ts +71 -0
- package/script/std/path/posix/glob_to_regexp.js +86 -0
- package/script/std/path/posix/is_absolute.d.ts +16 -0
- package/script/std/path/posix/is_absolute.js +27 -0
- package/script/std/path/posix/join.d.ts +32 -0
- package/script/std/path/posix/join.js +46 -0
- package/script/std/path/posix/join_globs.d.ts +19 -0
- package/script/std/path/posix/join_globs.js +44 -0
- package/script/std/path/posix/normalize.d.ts +39 -0
- package/script/std/path/posix/normalize.js +61 -0
- package/script/std/path/posix/normalize_glob.d.ts +19 -0
- package/script/std/path/posix/normalize_glob.js +36 -0
- package/script/std/path/posix/parse.d.ts +24 -0
- package/script/std/path/posix/parse.js +119 -0
- package/script/std/path/posix/relative.d.ts +19 -0
- package/script/std/path/posix/relative.js +110 -0
- package/script/std/path/posix/resolve.d.ts +16 -0
- package/script/std/path/posix/resolve.js +86 -0
- package/script/std/path/posix/to_file_url.d.ts +17 -0
- package/script/std/path/posix/to_file_url.js +31 -0
- package/script/std/path/posix/to_namespaced_path.d.ts +15 -0
- package/script/std/path/posix/to_namespaced_path.js +24 -0
- package/script/std/path/relative.d.ts +23 -0
- package/script/std/path/relative.js +34 -0
- package/script/std/path/resolve.d.ts +21 -0
- package/script/std/path/resolve.js +34 -0
- package/script/std/path/to_file_url.d.ts +22 -0
- package/script/std/path/to_file_url.js +32 -0
- package/script/std/path/to_namespaced_path.d.ts +20 -0
- package/script/std/path/to_namespaced_path.js +33 -0
- package/script/{deps/deno.land/std@0.189.0/path/_interface.d.ts → std/path/types.d.ts} +13 -2
- package/script/{deps/deno.land/std@0.189.0/path/_interface.js → std/path/types.js} +1 -1
- package/script/std/path/windows/_util.d.ts +3 -0
- package/script/std/path/windows/_util.js +21 -0
- package/script/std/path/windows/basename.d.ts +22 -0
- package/script/std/path/windows/basename.js +48 -0
- package/script/std/path/windows/constants.d.ts +12 -0
- package/script/std/path/windows/constants.js +17 -0
- package/script/std/path/windows/dirname.d.ts +19 -0
- package/script/std/path/windows/dirname.js +116 -0
- package/script/std/path/windows/extname.d.ts +19 -0
- package/script/std/path/windows/extname.js +85 -0
- package/script/std/path/windows/format.d.ts +23 -0
- package/script/std/path/windows/format.js +32 -0
- package/script/std/path/windows/from_file_url.d.ts +18 -0
- package/script/std/path/windows/from_file_url.js +34 -0
- package/script/std/path/windows/glob_to_regexp.d.ts +70 -0
- package/script/std/path/windows/glob_to_regexp.js +86 -0
- package/script/std/path/windows/is_absolute.d.ts +16 -0
- package/script/std/path/windows/is_absolute.js +42 -0
- package/script/std/path/windows/join.d.ts +19 -0
- package/script/std/path/windows/join.js +78 -0
- package/script/std/path/windows/join_globs.d.ts +20 -0
- package/script/std/path/windows/join_globs.js +45 -0
- package/script/std/path/windows/normalize.d.ts +21 -0
- package/script/std/path/windows/normalize.js +138 -0
- package/script/std/path/windows/normalize_glob.d.ts +19 -0
- package/script/std/path/windows/normalize_glob.js +36 -0
- package/script/std/path/windows/parse.d.ts +24 -0
- package/script/std/path/windows/parse.js +180 -0
- package/script/std/path/windows/relative.d.ts +22 -0
- package/script/std/path/windows/relative.js +135 -0
- package/script/std/path/windows/resolve.d.ts +16 -0
- package/script/std/path/windows/resolve.js +181 -0
- package/script/std/path/windows/to_file_url.d.ts +17 -0
- package/script/std/path/windows/to_file_url.js +38 -0
- package/script/std/path/windows/to_namespaced_path.d.ts +16 -0
- package/script/std/path/windows/to_namespaced_path.js +53 -0
- package/script/std/semver/_constants.d.ts +15 -0
- package/script/std/semver/_constants.js +41 -0
- package/script/std/semver/_shared.d.ts +43 -0
- package/script/std/semver/_shared.js +174 -0
- package/script/std/semver/_test_comparator_set.d.ts +2 -0
- package/script/std/semver/_test_comparator_set.js +62 -0
- package/script/std/semver/can_parse.d.ts +16 -0
- package/script/std/semver/can_parse.js +31 -0
- package/script/std/semver/compare.d.ts +27 -0
- package/script/std/semver/compare.js +39 -0
- package/script/std/semver/difference.d.ts +26 -0
- package/script/std/semver/difference.js +45 -0
- package/script/std/semver/equals.d.ts +23 -0
- package/script/std/semver/equals.js +31 -0
- package/script/std/semver/format.d.ts +21 -0
- package/script/std/semver/format.js +36 -0
- package/script/std/semver/format_range.d.ts +17 -0
- package/script/std/semver/format_range.js +31 -0
- package/script/std/semver/greater_or_equal.d.ts +24 -0
- package/script/std/semver/greater_or_equal.js +30 -0
- package/script/std/semver/greater_than.d.ts +24 -0
- package/script/std/semver/greater_than.js +32 -0
- package/script/std/semver/greater_than_range.d.ts +22 -0
- package/script/std/semver/greater_than_range.js +62 -0
- package/{esm/deps/deno.land/std@0.205.0 → script/std}/semver/increment.d.ts +27 -5
- package/script/std/semver/increment.js +180 -0
- package/script/std/semver/is_range.d.ts +22 -0
- package/script/std/semver/is_range.js +42 -0
- package/{esm/deps/deno.land/std@0.205.0 → script/std}/semver/is_semver.d.ts +16 -0
- package/script/{deps/deno.land/std@0.205.0 → std}/semver/is_semver.js +26 -14
- package/script/std/semver/less_or_equal.d.ts +24 -0
- package/script/std/semver/less_or_equal.js +30 -0
- package/script/std/semver/less_than.d.ts +24 -0
- package/script/std/semver/less_than.js +30 -0
- package/script/std/semver/less_than_range.d.ts +22 -0
- package/script/std/semver/less_than_range.js +62 -0
- package/script/std/semver/max_satisfying.d.ts +21 -0
- package/script/std/semver/max_satisfying.js +34 -0
- package/script/std/semver/min_satisfying.d.ts +21 -0
- package/script/std/semver/min_satisfying.js +34 -0
- package/{esm/deps/deno.land/std@0.205.0 → script/std}/semver/mod.d.ts +72 -85
- package/script/{deps/deno.land/std@0.205.0 → std}/semver/mod.js +73 -87
- package/script/std/semver/not_equals.d.ts +23 -0
- package/script/std/semver/not_equals.js +29 -0
- package/script/std/semver/parse.d.ts +24 -0
- package/script/std/semver/parse.js +48 -0
- package/script/std/semver/parse_range.d.ts +26 -0
- package/script/std/semver/parse_range.js +362 -0
- package/script/std/semver/range_intersects.d.ts +24 -0
- package/script/std/semver/range_intersects.js +93 -0
- package/script/std/semver/satisfies.d.ts +23 -0
- package/script/std/semver/satisfies.js +30 -0
- package/script/std/semver/try_parse.d.ts +20 -0
- package/script/std/semver/try_parse.js +31 -0
- package/script/std/semver/try_parse_range.d.ts +22 -0
- package/script/std/semver/try_parse_range.js +37 -0
- package/script/std/semver/types.d.ts +57 -0
- package/script/std/semver/types.js +4 -0
- package/esm/bin.d.ts +0 -2
- package/esm/deps/deno.land/std@0.189.0/_util/asserts.d.ts +0 -10
- package/esm/deps/deno.land/std@0.189.0/_util/asserts.js +0 -21
- package/esm/deps/deno.land/std@0.189.0/_util/os.d.ts +0 -4
- package/esm/deps/deno.land/std@0.189.0/_util/os.js +0 -18
- package/esm/deps/deno.land/std@0.189.0/flags/mod.d.ts +0 -166
- package/esm/deps/deno.land/std@0.189.0/flags/mod.js +0 -365
- package/esm/deps/deno.land/std@0.189.0/path/_interface.js +0 -3
- package/esm/deps/deno.land/std@0.189.0/path/_util.d.ts +0 -11
- package/esm/deps/deno.land/std@0.189.0/path/_util.js +0 -161
- package/esm/deps/deno.land/std@0.189.0/path/common.d.ts +0 -13
- package/esm/deps/deno.land/std@0.189.0/path/common.js +0 -36
- package/esm/deps/deno.land/std@0.189.0/path/glob.js +0 -361
- package/esm/deps/deno.land/std@0.189.0/path/mod.d.ts +0 -11
- package/esm/deps/deno.land/std@0.189.0/path/mod.js +0 -35
- package/esm/deps/deno.land/std@0.189.0/path/posix.d.ts +0 -86
- package/esm/deps/deno.land/std@0.189.0/path/posix.js +0 -442
- package/esm/deps/deno.land/std@0.189.0/path/separator.d.ts +0 -2
- package/esm/deps/deno.land/std@0.189.0/path/separator.js +0 -5
- package/esm/deps/deno.land/std@0.189.0/path/win32.d.ts +0 -91
- package/esm/deps/deno.land/std@0.189.0/path/win32.js +0 -909
- package/esm/deps/deno.land/std@0.205.0/semver/_shared.d.ts +0 -42
- package/esm/deps/deno.land/std@0.205.0/semver/_shared.js +0 -230
- package/esm/deps/deno.land/std@0.205.0/semver/cmp.d.ts +0 -9
- package/esm/deps/deno.land/std@0.205.0/semver/cmp.js +0 -35
- package/esm/deps/deno.land/std@0.205.0/semver/comparator_format.d.ts +0 -8
- package/esm/deps/deno.land/std@0.205.0/semver/comparator_format.js +0 -11
- package/esm/deps/deno.land/std@0.205.0/semver/comparator_intersects.d.ts +0 -8
- package/esm/deps/deno.land/std@0.205.0/semver/comparator_intersects.js +0 -45
- package/esm/deps/deno.land/std@0.205.0/semver/comparator_max.d.ts +0 -9
- package/esm/deps/deno.land/std@0.205.0/semver/comparator_max.js +0 -45
- package/esm/deps/deno.land/std@0.205.0/semver/comparator_min.d.ts +0 -8
- package/esm/deps/deno.land/std@0.205.0/semver/comparator_min.js +0 -32
- package/esm/deps/deno.land/std@0.205.0/semver/compare.d.ts +0 -10
- package/esm/deps/deno.land/std@0.205.0/semver/compare.js +0 -18
- package/esm/deps/deno.land/std@0.205.0/semver/compare_build.d.ts +0 -13
- package/esm/deps/deno.land/std@0.205.0/semver/compare_build.js +0 -23
- package/esm/deps/deno.land/std@0.205.0/semver/constants.d.ts +0 -42
- package/esm/deps/deno.land/std@0.205.0/semver/constants.js +0 -75
- package/esm/deps/deno.land/std@0.205.0/semver/difference.d.ts +0 -4
- package/esm/deps/deno.land/std@0.205.0/semver/difference.js +0 -26
- package/esm/deps/deno.land/std@0.205.0/semver/eq.d.ts +0 -4
- package/esm/deps/deno.land/std@0.205.0/semver/eq.js +0 -7
- package/esm/deps/deno.land/std@0.205.0/semver/format.d.ts +0 -12
- package/esm/deps/deno.land/std@0.205.0/semver/format.js +0 -54
- package/esm/deps/deno.land/std@0.205.0/semver/gt.d.ts +0 -3
- package/esm/deps/deno.land/std@0.205.0/semver/gt.js +0 -5
- package/esm/deps/deno.land/std@0.205.0/semver/gte.d.ts +0 -3
- package/esm/deps/deno.land/std@0.205.0/semver/gte.js +0 -5
- package/esm/deps/deno.land/std@0.205.0/semver/gtr.d.ts +0 -3
- package/esm/deps/deno.land/std@0.205.0/semver/gtr.js +0 -5
- package/esm/deps/deno.land/std@0.205.0/semver/increment.js +0 -207
- package/esm/deps/deno.land/std@0.205.0/semver/is_semver_comparator.d.ts +0 -12
- package/esm/deps/deno.land/std@0.205.0/semver/is_semver_comparator.js +0 -31
- package/esm/deps/deno.land/std@0.205.0/semver/is_semver_range.d.ts +0 -12
- package/esm/deps/deno.land/std@0.205.0/semver/is_semver_range.js +0 -22
- package/esm/deps/deno.land/std@0.205.0/semver/lt.d.ts +0 -3
- package/esm/deps/deno.land/std@0.205.0/semver/lt.js +0 -5
- package/esm/deps/deno.land/std@0.205.0/semver/lte.d.ts +0 -3
- package/esm/deps/deno.land/std@0.205.0/semver/lte.js +0 -5
- package/esm/deps/deno.land/std@0.205.0/semver/ltr.d.ts +0 -3
- package/esm/deps/deno.land/std@0.205.0/semver/ltr.js +0 -5
- package/esm/deps/deno.land/std@0.205.0/semver/max_satisfying.d.ts +0 -9
- package/esm/deps/deno.land/std@0.205.0/semver/max_satisfying.js +0 -14
- package/esm/deps/deno.land/std@0.205.0/semver/min_satisfying.d.ts +0 -9
- package/esm/deps/deno.land/std@0.205.0/semver/min_satisfying.js +0 -14
- package/esm/deps/deno.land/std@0.205.0/semver/neq.d.ts +0 -3
- package/esm/deps/deno.land/std@0.205.0/semver/neq.js +0 -5
- package/esm/deps/deno.land/std@0.205.0/semver/outside.d.ts +0 -11
- package/esm/deps/deno.land/std@0.205.0/semver/outside.js +0 -67
- package/esm/deps/deno.land/std@0.205.0/semver/parse.d.ts +0 -8
- package/esm/deps/deno.land/std@0.205.0/semver/parse.js +0 -66
- package/esm/deps/deno.land/std@0.205.0/semver/parse_comparator.d.ts +0 -7
- package/esm/deps/deno.land/std@0.205.0/semver/parse_comparator.js +0 -28
- package/esm/deps/deno.land/std@0.205.0/semver/parse_range.d.ts +0 -7
- package/esm/deps/deno.land/std@0.205.0/semver/parse_range.js +0 -292
- package/esm/deps/deno.land/std@0.205.0/semver/range_format.d.ts +0 -8
- package/esm/deps/deno.land/std@0.205.0/semver/range_format.js +0 -11
- package/esm/deps/deno.land/std@0.205.0/semver/range_intersects.d.ts +0 -8
- package/esm/deps/deno.land/std@0.205.0/semver/range_intersects.js +0 -35
- package/esm/deps/deno.land/std@0.205.0/semver/range_max.d.ts +0 -7
- package/esm/deps/deno.land/std@0.205.0/semver/range_max.js +0 -15
- package/esm/deps/deno.land/std@0.205.0/semver/range_min.d.ts +0 -7
- package/esm/deps/deno.land/std@0.205.0/semver/range_min.js +0 -14
- package/esm/deps/deno.land/std@0.205.0/semver/rcompare.d.ts +0 -8
- package/esm/deps/deno.land/std@0.205.0/semver/rcompare.js +0 -10
- package/esm/deps/deno.land/std@0.205.0/semver/rsort.d.ts +0 -3
- package/esm/deps/deno.land/std@0.205.0/semver/rsort.js +0 -5
- package/esm/deps/deno.land/std@0.205.0/semver/sort.d.ts +0 -3
- package/esm/deps/deno.land/std@0.205.0/semver/sort.js +0 -5
- package/esm/deps/deno.land/std@0.205.0/semver/test_comparator.d.ts +0 -8
- package/esm/deps/deno.land/std@0.205.0/semver/test_comparator.js +0 -10
- package/esm/deps/deno.land/std@0.205.0/semver/test_range.d.ts +0 -8
- package/esm/deps/deno.land/std@0.205.0/semver/test_range.js +0 -16
- package/esm/deps/deno.land/std@0.205.0/semver/types.d.ts +0 -44
- package/esm/deps/deno.land/std@0.205.0/semver/types.js +0 -2
- package/esm/deps/deno.land/std@0.51.0/fs/eol.d.ts +0 -12
- package/esm/deps/deno.land/std@0.51.0/fs/eol.js +0 -29
- package/esm/deps/deno.land/x/ini@v2.1.0/ini.d.ts +0 -53
- package/esm/deps/deno.land/x/ini@v2.1.0/ini.js +0 -226
- package/esm/deps/deno.land/x/ini@v2.1.0/mod.d.ts +0 -1
- package/esm/deps/deno.land/x/ini@v2.1.0/mod.js +0 -1
- package/esm/src/Change.d.ts +0 -8
- package/esm/src/Change.js +0 -48
- package/esm/src/Changelog.d.ts +0 -23
- package/esm/src/Changelog.js +0 -183
- package/esm/src/Release.d.ts +0 -28
- package/esm/src/Release.js +0 -220
- package/esm/src/deps.d.ts +0 -2
- package/esm/src/deps.js +0 -1
- package/esm/src/parser.d.ts +0 -11
- package/esm/src/parser.js +0 -178
- package/esm/src/settings.d.ts +0 -17
- package/esm/src/settings.js +0 -47
- package/script/bin.d.ts +0 -2
- package/script/deps/deno.land/std@0.189.0/_util/asserts.d.ts +0 -10
- package/script/deps/deno.land/std@0.189.0/_util/asserts.js +0 -27
- package/script/deps/deno.land/std@0.189.0/_util/os.d.ts +0 -4
- package/script/deps/deno.land/std@0.189.0/flags/mod.d.ts +0 -166
- package/script/deps/deno.land/std@0.189.0/flags/mod.js +0 -369
- package/script/deps/deno.land/std@0.189.0/path/_util.d.ts +0 -11
- package/script/deps/deno.land/std@0.189.0/path/_util.js +0 -174
- package/script/deps/deno.land/std@0.189.0/path/common.d.ts +0 -13
- package/script/deps/deno.land/std@0.189.0/path/common.js +0 -40
- package/script/deps/deno.land/std@0.189.0/path/glob.js +0 -391
- package/script/deps/deno.land/std@0.189.0/path/mod.d.ts +0 -11
- package/script/deps/deno.land/std@0.189.0/path/mod.js +0 -66
- package/script/deps/deno.land/std@0.189.0/path/posix.d.ts +0 -86
- package/script/deps/deno.land/std@0.189.0/path/posix.js +0 -481
- package/script/deps/deno.land/std@0.189.0/path/separator.d.ts +0 -2
- package/script/deps/deno.land/std@0.189.0/path/separator.js +0 -8
- package/script/deps/deno.land/std@0.189.0/path/win32.d.ts +0 -91
- package/script/deps/deno.land/std@0.189.0/path/win32.js +0 -948
- package/script/deps/deno.land/std@0.205.0/semver/_shared.d.ts +0 -42
- package/script/deps/deno.land/std@0.205.0/semver/_shared.js +0 -248
- package/script/deps/deno.land/std@0.205.0/semver/cmp.d.ts +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/cmp.js +0 -39
- package/script/deps/deno.land/std@0.205.0/semver/comparator_format.d.ts +0 -8
- package/script/deps/deno.land/std@0.205.0/semver/comparator_format.js +0 -15
- package/script/deps/deno.land/std@0.205.0/semver/comparator_intersects.d.ts +0 -8
- package/script/deps/deno.land/std@0.205.0/semver/comparator_intersects.js +0 -49
- package/script/deps/deno.land/std@0.205.0/semver/comparator_max.d.ts +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/comparator_max.js +0 -49
- package/script/deps/deno.land/std@0.205.0/semver/comparator_min.d.ts +0 -8
- package/script/deps/deno.land/std@0.205.0/semver/comparator_min.js +0 -36
- package/script/deps/deno.land/std@0.205.0/semver/compare.d.ts +0 -10
- package/script/deps/deno.land/std@0.205.0/semver/compare.js +0 -22
- package/script/deps/deno.land/std@0.205.0/semver/compare_build.d.ts +0 -13
- package/script/deps/deno.land/std@0.205.0/semver/compare_build.js +0 -27
- package/script/deps/deno.land/std@0.205.0/semver/constants.d.ts +0 -42
- package/script/deps/deno.land/std@0.205.0/semver/constants.js +0 -78
- package/script/deps/deno.land/std@0.205.0/semver/difference.d.ts +0 -4
- package/script/deps/deno.land/std@0.205.0/semver/difference.js +0 -30
- package/script/deps/deno.land/std@0.205.0/semver/eq.d.ts +0 -4
- package/script/deps/deno.land/std@0.205.0/semver/eq.js +0 -11
- package/script/deps/deno.land/std@0.205.0/semver/format.d.ts +0 -12
- package/script/deps/deno.land/std@0.205.0/semver/format.js +0 -58
- package/script/deps/deno.land/std@0.205.0/semver/gt.d.ts +0 -3
- package/script/deps/deno.land/std@0.205.0/semver/gt.js +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/gte.d.ts +0 -3
- package/script/deps/deno.land/std@0.205.0/semver/gte.js +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/gtr.d.ts +0 -3
- package/script/deps/deno.land/std@0.205.0/semver/gtr.js +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/increment.js +0 -211
- package/script/deps/deno.land/std@0.205.0/semver/is_semver_comparator.d.ts +0 -12
- package/script/deps/deno.land/std@0.205.0/semver/is_semver_comparator.js +0 -35
- package/script/deps/deno.land/std@0.205.0/semver/is_semver_range.d.ts +0 -12
- package/script/deps/deno.land/std@0.205.0/semver/is_semver_range.js +0 -26
- package/script/deps/deno.land/std@0.205.0/semver/lt.d.ts +0 -3
- package/script/deps/deno.land/std@0.205.0/semver/lt.js +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/lte.d.ts +0 -3
- package/script/deps/deno.land/std@0.205.0/semver/lte.js +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/ltr.d.ts +0 -3
- package/script/deps/deno.land/std@0.205.0/semver/ltr.js +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/max_satisfying.d.ts +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/max_satisfying.js +0 -18
- package/script/deps/deno.land/std@0.205.0/semver/min_satisfying.d.ts +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/min_satisfying.js +0 -18
- package/script/deps/deno.land/std@0.205.0/semver/neq.d.ts +0 -3
- package/script/deps/deno.land/std@0.205.0/semver/neq.js +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/outside.d.ts +0 -11
- package/script/deps/deno.land/std@0.205.0/semver/outside.js +0 -71
- package/script/deps/deno.land/std@0.205.0/semver/parse.d.ts +0 -8
- package/script/deps/deno.land/std@0.205.0/semver/parse.js +0 -70
- package/script/deps/deno.land/std@0.205.0/semver/parse_comparator.d.ts +0 -7
- package/script/deps/deno.land/std@0.205.0/semver/parse_comparator.js +0 -32
- package/script/deps/deno.land/std@0.205.0/semver/parse_range.d.ts +0 -7
- package/script/deps/deno.land/std@0.205.0/semver/parse_range.js +0 -296
- package/script/deps/deno.land/std@0.205.0/semver/range_format.d.ts +0 -8
- package/script/deps/deno.land/std@0.205.0/semver/range_format.js +0 -15
- package/script/deps/deno.land/std@0.205.0/semver/range_intersects.d.ts +0 -8
- package/script/deps/deno.land/std@0.205.0/semver/range_intersects.js +0 -39
- package/script/deps/deno.land/std@0.205.0/semver/range_max.d.ts +0 -7
- package/script/deps/deno.land/std@0.205.0/semver/range_max.js +0 -19
- package/script/deps/deno.land/std@0.205.0/semver/range_min.d.ts +0 -7
- package/script/deps/deno.land/std@0.205.0/semver/range_min.js +0 -18
- package/script/deps/deno.land/std@0.205.0/semver/rcompare.d.ts +0 -8
- package/script/deps/deno.land/std@0.205.0/semver/rcompare.js +0 -14
- package/script/deps/deno.land/std@0.205.0/semver/rsort.d.ts +0 -3
- package/script/deps/deno.land/std@0.205.0/semver/rsort.js +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/sort.d.ts +0 -3
- package/script/deps/deno.land/std@0.205.0/semver/sort.js +0 -9
- package/script/deps/deno.land/std@0.205.0/semver/test_comparator.d.ts +0 -8
- package/script/deps/deno.land/std@0.205.0/semver/test_comparator.js +0 -14
- package/script/deps/deno.land/std@0.205.0/semver/test_range.d.ts +0 -8
- package/script/deps/deno.land/std@0.205.0/semver/test_range.js +0 -20
- package/script/deps/deno.land/std@0.205.0/semver/types.d.ts +0 -44
- package/script/deps/deno.land/std@0.205.0/semver/types.js +0 -3
- package/script/deps/deno.land/std@0.51.0/fs/eol.d.ts +0 -12
- package/script/deps/deno.land/std@0.51.0/fs/eol.js +0 -34
- package/script/deps/deno.land/x/ini@v2.1.0/ini.d.ts +0 -53
- package/script/deps/deno.land/x/ini@v2.1.0/ini.js +0 -256
- package/script/deps/deno.land/x/ini@v2.1.0/mod.d.ts +0 -1
- package/script/deps/deno.land/x/ini@v2.1.0/mod.js +0 -17
- package/script/src/Change.d.ts +0 -8
- package/script/src/Change.js +0 -51
- package/script/src/Changelog.d.ts +0 -23
- package/script/src/Changelog.js +0 -186
- package/script/src/Release.d.ts +0 -28
- package/script/src/Release.js +0 -226
- package/script/src/deps.d.ts +0 -2
- package/script/src/deps.js +0 -8
- package/script/src/parser.d.ts +0 -11
- package/script/src/parser.js +0 -184
- package/script/src/settings.d.ts +0 -17
- package/script/src/settings.js +0 -51
- /package/esm/{test → keep-a-changelog/test}/changelog.custom.type.md +0 -0
- /package/esm/{test → keep-a-changelog/test}/changelog.expected.linted.md +0 -0
- /package/esm/{test → keep-a-changelog/test}/changelog.expected.md +0 -0
- /package/esm/{test → keep-a-changelog/test}/changelog.gitlab.md +0 -0
- /package/esm/{test → keep-a-changelog/test}/changelog.md +0 -0
- /package/esm/{test → keep-a-changelog/test}/empty.expected.md +0 -0
- /package/esm/{deps/deno.land/std@0.189.0/path/_constants.d.ts → std/path/_common/constants.d.ts} +0 -0
- /package/script/{test → keep-a-changelog/test}/changelog.custom.type.md +0 -0
- /package/script/{test → keep-a-changelog/test}/changelog.expected.linted.md +0 -0
- /package/script/{test → keep-a-changelog/test}/changelog.expected.md +0 -0
- /package/script/{test → keep-a-changelog/test}/changelog.gitlab.md +0 -0
- /package/script/{test → keep-a-changelog/test}/changelog.md +0 -0
- /package/script/{test → keep-a-changelog/test}/empty.expected.md +0 -0
- /package/script/{deps/deno.land/std@0.189.0/path/_constants.d.ts → std/path/_common/constants.d.ts} +0 -0
|
@@ -1,7 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
2
|
+
* The Semantic Version parser.
|
|
3
3
|
*
|
|
4
|
-
* Adapted directly from
|
|
4
|
+
* Adapted directly from {@link https://github.com/npm/node-semver | semver}.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import {
|
|
8
|
+
* parse,
|
|
9
|
+
* parseRange,
|
|
10
|
+
* greaterThan,
|
|
11
|
+
* lessThan,
|
|
12
|
+
* format
|
|
13
|
+
* } from "mod.ts";
|
|
14
|
+
* import { assertEquals } from "../assert/mod.ts";
|
|
15
|
+
*
|
|
16
|
+
* const semver = parse("1.2.3");
|
|
17
|
+
* assertEquals(semver, {
|
|
18
|
+
* major: 1,
|
|
19
|
+
* minor: 2,
|
|
20
|
+
* patch: 3,
|
|
21
|
+
* prerelease: [],
|
|
22
|
+
* build: []
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* assertEquals(format(semver), "1.2.3");
|
|
26
|
+
*
|
|
27
|
+
* const range = parseRange("1.x || >=2.5.0 || 5.0.0 - 7.2.3");
|
|
28
|
+
*
|
|
29
|
+
* const s0 = parse("1.2.3");
|
|
30
|
+
* const s1 = parse("9.8.7");
|
|
31
|
+
*
|
|
32
|
+
* assertEquals(greaterThan(s0, s1), false);
|
|
33
|
+
* assertEquals(lessThan(s0, s1), true);
|
|
34
|
+
* ```
|
|
5
35
|
*
|
|
6
36
|
* ## Versions
|
|
7
37
|
*
|
|
@@ -17,28 +47,28 @@
|
|
|
17
47
|
* formatting options.
|
|
18
48
|
*
|
|
19
49
|
* ```
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
50
|
+
* full
|
|
51
|
+
* ┌───┴───┐
|
|
52
|
+
* release │
|
|
53
|
+
* ┌───┴───┐ │
|
|
54
|
+
* primary │ │
|
|
55
|
+
* ┌─┴─┐ │ │
|
|
56
|
+
* 1.2.3-pre.1+b.1
|
|
57
|
+
* │ │ │ └─┬─┘ └┬┘
|
|
58
|
+
* │ │ │ │ └── build
|
|
59
|
+
* │ │ │ └─────── pre
|
|
60
|
+
* │ │ └─────────── patch
|
|
61
|
+
* │ └───────────── minor
|
|
62
|
+
* └─────────────── major
|
|
33
63
|
* ```
|
|
34
64
|
*
|
|
35
65
|
* ## Ranges
|
|
36
66
|
*
|
|
37
|
-
* A
|
|
38
|
-
* the range.
|
|
67
|
+
* A version {@linkcode Range} is a set of {@linkcode Comparator}s which specify
|
|
68
|
+
* versions that satisfy the range.
|
|
39
69
|
*
|
|
40
|
-
* A
|
|
41
|
-
* primitive `operators` is:
|
|
70
|
+
* A {@linkcode Comparator} is composed of an {@linkcode Operator} and a
|
|
71
|
+
* {@link SemVer}. The set of primitive `operators` is:
|
|
42
72
|
*
|
|
43
73
|
* - `<` Less than
|
|
44
74
|
* - `<=` Less than or equal to
|
|
@@ -87,27 +117,24 @@
|
|
|
87
117
|
* aware of the risk. However, it is still not appropriate to assume that they have
|
|
88
118
|
* opted into taking a similar risk on the _next_ set of prerelease versions.
|
|
89
119
|
*
|
|
90
|
-
* Note that this behavior can be suppressed (treating all prerelease versions as
|
|
91
|
-
* if they were normal versions, for the purpose of range matching) by setting the
|
|
92
|
-
* `includePrerelease` flag on the options object to any [functions](#functions)
|
|
93
|
-
* that do range matching.
|
|
94
|
-
*
|
|
95
120
|
* #### Prerelease Identifiers
|
|
96
121
|
*
|
|
97
|
-
* The method
|
|
98
|
-
* will append the value of the string as a prerelease identifier:
|
|
122
|
+
* The method {@linkcode increment} takes an additional `identifier` string
|
|
123
|
+
* argument that will append the value of the string as a prerelease identifier:
|
|
99
124
|
*
|
|
100
|
-
* ```
|
|
101
|
-
*
|
|
102
|
-
*
|
|
125
|
+
* ```ts
|
|
126
|
+
* import { increment, parse } from "mod.ts";
|
|
127
|
+
* import { assertEquals } from "../assert/mod.ts";
|
|
128
|
+
*
|
|
129
|
+
* assertEquals(increment(parse("1.2.3"), "prerelease", { prerelease: "alpha" }), parse("1.2.4-alpha.0"));
|
|
103
130
|
* ```
|
|
104
131
|
*
|
|
105
132
|
* ### Build Metadata
|
|
106
133
|
*
|
|
107
134
|
* Build metadata is `.` delimited alpha-numeric string.
|
|
108
135
|
* When parsing a version it is retained on the `build: string[]` field
|
|
109
|
-
* of the
|
|
110
|
-
* can set the build metadata on the
|
|
136
|
+
* of the SemVer instance. When incrementing there is an additional parameter that
|
|
137
|
+
* can set the build metadata on the SemVer instance.
|
|
111
138
|
*
|
|
112
139
|
* ### Advanced Range Syntax
|
|
113
140
|
*
|
|
@@ -241,70 +268,30 @@
|
|
|
241
268
|
* If you want to know if a version satisfies or does not satisfy a range, use the
|
|
242
269
|
* {@linkcode satisfies} function.
|
|
243
270
|
*
|
|
244
|
-
* This module is browser compatible.
|
|
245
|
-
*
|
|
246
|
-
* @example
|
|
247
|
-
* ```ts
|
|
248
|
-
* import {
|
|
249
|
-
* parse,
|
|
250
|
-
* parseComparator,
|
|
251
|
-
* parseRange,
|
|
252
|
-
* gt,
|
|
253
|
-
* lt,
|
|
254
|
-
* format
|
|
255
|
-
* } from "https://deno.land/std@$STD_VERSION/semver/mod.ts";
|
|
256
|
-
*
|
|
257
|
-
* const semver = parse("1.2.3");
|
|
258
|
-
* const range = parseRange("1.x || >=2.5.0 || 5.0.0 - 7.2.3");
|
|
259
|
-
*
|
|
260
|
-
* const s0 = parse("1.2.3");
|
|
261
|
-
* const s1 = parse("9.8.7");
|
|
262
|
-
* gt(s0, s1); // false
|
|
263
|
-
* lt(s0, s1); // true
|
|
264
|
-
*
|
|
265
|
-
* format(semver) // "1.2.3"
|
|
266
|
-
* ```
|
|
267
|
-
*
|
|
268
271
|
* @module
|
|
269
272
|
*/
|
|
270
|
-
export * from "./cmp.js";
|
|
271
|
-
export * from "./comparator_format.js";
|
|
272
|
-
export * from "./comparator_intersects.js";
|
|
273
|
-
export * from "./comparator_max.js";
|
|
274
|
-
export * from "./comparator_min.js";
|
|
275
|
-
export * from "./compare_build.js";
|
|
276
273
|
export * from "./compare.js";
|
|
277
|
-
export * from "./constants.js";
|
|
278
274
|
export * from "./difference.js";
|
|
279
|
-
export * from "./eq.js";
|
|
280
275
|
export * from "./format.js";
|
|
281
|
-
export * from "./
|
|
282
|
-
export * from "./gte.js";
|
|
283
|
-
export * from "./gtr.js";
|
|
284
|
-
export * from "./test_comparator.js";
|
|
285
|
-
export * from "./test_range.js";
|
|
276
|
+
export * from "./satisfies.js";
|
|
286
277
|
export * from "./increment.js";
|
|
287
|
-
export * from "./is_semver_comparator.js";
|
|
288
|
-
export * from "./is_semver_range.js";
|
|
289
278
|
export * from "./is_semver.js";
|
|
290
|
-
export * from "./lt.js";
|
|
291
|
-
export * from "./lte.js";
|
|
292
|
-
export * from "./ltr.js";
|
|
293
279
|
export * from "./max_satisfying.js";
|
|
294
280
|
export * from "./min_satisfying.js";
|
|
295
|
-
export * from "./neq.js";
|
|
296
|
-
export * from "./outside.js";
|
|
297
|
-
export * from "./parse_comparator.js";
|
|
298
281
|
export * from "./parse_range.js";
|
|
299
282
|
export * from "./parse.js";
|
|
300
|
-
export * from "./range_format.js";
|
|
301
283
|
export * from "./range_intersects.js";
|
|
302
|
-
export * from "./range_max.js";
|
|
303
|
-
export * from "./range_min.js";
|
|
304
|
-
export * from "./rcompare.js";
|
|
305
|
-
export * from "./rsort.js";
|
|
306
|
-
export * from "./sort.js";
|
|
307
284
|
export * from "./types.js";
|
|
308
|
-
export * from "./
|
|
309
|
-
export * from "./
|
|
310
|
-
export
|
|
285
|
+
export * from "./try_parse_range.js";
|
|
286
|
+
export * from "./is_range.js";
|
|
287
|
+
export * from "./can_parse.js";
|
|
288
|
+
export * from "./try_parse.js";
|
|
289
|
+
export * from "./format_range.js";
|
|
290
|
+
export * from "./equals.js";
|
|
291
|
+
export * from "./not_equals.js";
|
|
292
|
+
export * from "./greater_than.js";
|
|
293
|
+
export * from "./greater_than_range.js";
|
|
294
|
+
export * from "./greater_or_equal.js";
|
|
295
|
+
export * from "./less_than.js";
|
|
296
|
+
export * from "./less_than_range.js";
|
|
297
|
+
export * from "./less_or_equal.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Copyright Isaac Z. Schlueter and Contributors. All rights reserved. ISC license.
|
|
3
|
-
// Copyright 2018-
|
|
3
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
4
4
|
// This module is browser compatible.
|
|
5
5
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
6
|
if (k2 === undefined) k2 = k;
|
|
@@ -17,11 +17,40 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
17
17
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.SEMVER_SPEC_VERSION = void 0;
|
|
21
20
|
/**
|
|
22
|
-
* The
|
|
21
|
+
* The Semantic Version parser.
|
|
23
22
|
*
|
|
24
|
-
* Adapted directly from
|
|
23
|
+
* Adapted directly from {@link https://github.com/npm/node-semver | semver}.
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* import {
|
|
27
|
+
* parse,
|
|
28
|
+
* parseRange,
|
|
29
|
+
* greaterThan,
|
|
30
|
+
* lessThan,
|
|
31
|
+
* format
|
|
32
|
+
* } from "mod.ts";
|
|
33
|
+
* import { assertEquals } from "../assert/mod.ts";
|
|
34
|
+
*
|
|
35
|
+
* const semver = parse("1.2.3");
|
|
36
|
+
* assertEquals(semver, {
|
|
37
|
+
* major: 1,
|
|
38
|
+
* minor: 2,
|
|
39
|
+
* patch: 3,
|
|
40
|
+
* prerelease: [],
|
|
41
|
+
* build: []
|
|
42
|
+
* });
|
|
43
|
+
*
|
|
44
|
+
* assertEquals(format(semver), "1.2.3");
|
|
45
|
+
*
|
|
46
|
+
* const range = parseRange("1.x || >=2.5.0 || 5.0.0 - 7.2.3");
|
|
47
|
+
*
|
|
48
|
+
* const s0 = parse("1.2.3");
|
|
49
|
+
* const s1 = parse("9.8.7");
|
|
50
|
+
*
|
|
51
|
+
* assertEquals(greaterThan(s0, s1), false);
|
|
52
|
+
* assertEquals(lessThan(s0, s1), true);
|
|
53
|
+
* ```
|
|
25
54
|
*
|
|
26
55
|
* ## Versions
|
|
27
56
|
*
|
|
@@ -37,28 +66,28 @@ exports.SEMVER_SPEC_VERSION = void 0;
|
|
|
37
66
|
* formatting options.
|
|
38
67
|
*
|
|
39
68
|
* ```
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
69
|
+
* full
|
|
70
|
+
* ┌───┴───┐
|
|
71
|
+
* release │
|
|
72
|
+
* ┌───┴───┐ │
|
|
73
|
+
* primary │ │
|
|
74
|
+
* ┌─┴─┐ │ │
|
|
75
|
+
* 1.2.3-pre.1+b.1
|
|
76
|
+
* │ │ │ └─┬─┘ └┬┘
|
|
77
|
+
* │ │ │ │ └── build
|
|
78
|
+
* │ │ │ └─────── pre
|
|
79
|
+
* │ │ └─────────── patch
|
|
80
|
+
* │ └───────────── minor
|
|
81
|
+
* └─────────────── major
|
|
53
82
|
* ```
|
|
54
83
|
*
|
|
55
84
|
* ## Ranges
|
|
56
85
|
*
|
|
57
|
-
* A
|
|
58
|
-
* the range.
|
|
86
|
+
* A version {@linkcode Range} is a set of {@linkcode Comparator}s which specify
|
|
87
|
+
* versions that satisfy the range.
|
|
59
88
|
*
|
|
60
|
-
* A
|
|
61
|
-
* primitive `operators` is:
|
|
89
|
+
* A {@linkcode Comparator} is composed of an {@linkcode Operator} and a
|
|
90
|
+
* {@link SemVer}. The set of primitive `operators` is:
|
|
62
91
|
*
|
|
63
92
|
* - `<` Less than
|
|
64
93
|
* - `<=` Less than or equal to
|
|
@@ -107,27 +136,24 @@ exports.SEMVER_SPEC_VERSION = void 0;
|
|
|
107
136
|
* aware of the risk. However, it is still not appropriate to assume that they have
|
|
108
137
|
* opted into taking a similar risk on the _next_ set of prerelease versions.
|
|
109
138
|
*
|
|
110
|
-
* Note that this behavior can be suppressed (treating all prerelease versions as
|
|
111
|
-
* if they were normal versions, for the purpose of range matching) by setting the
|
|
112
|
-
* `includePrerelease` flag on the options object to any [functions](#functions)
|
|
113
|
-
* that do range matching.
|
|
114
|
-
*
|
|
115
139
|
* #### Prerelease Identifiers
|
|
116
140
|
*
|
|
117
|
-
* The method
|
|
118
|
-
* will append the value of the string as a prerelease identifier:
|
|
141
|
+
* The method {@linkcode increment} takes an additional `identifier` string
|
|
142
|
+
* argument that will append the value of the string as a prerelease identifier:
|
|
119
143
|
*
|
|
120
|
-
* ```
|
|
121
|
-
*
|
|
122
|
-
*
|
|
144
|
+
* ```ts
|
|
145
|
+
* import { increment, parse } from "mod.ts";
|
|
146
|
+
* import { assertEquals } from "../assert/mod.ts";
|
|
147
|
+
*
|
|
148
|
+
* assertEquals(increment(parse("1.2.3"), "prerelease", { prerelease: "alpha" }), parse("1.2.4-alpha.0"));
|
|
123
149
|
* ```
|
|
124
150
|
*
|
|
125
151
|
* ### Build Metadata
|
|
126
152
|
*
|
|
127
153
|
* Build metadata is `.` delimited alpha-numeric string.
|
|
128
154
|
* When parsing a version it is retained on the `build: string[]` field
|
|
129
|
-
* of the
|
|
130
|
-
* can set the build metadata on the
|
|
155
|
+
* of the SemVer instance. When incrementing there is an additional parameter that
|
|
156
|
+
* can set the build metadata on the SemVer instance.
|
|
131
157
|
*
|
|
132
158
|
* ### Advanced Range Syntax
|
|
133
159
|
*
|
|
@@ -261,70 +287,30 @@ exports.SEMVER_SPEC_VERSION = void 0;
|
|
|
261
287
|
* If you want to know if a version satisfies or does not satisfy a range, use the
|
|
262
288
|
* {@linkcode satisfies} function.
|
|
263
289
|
*
|
|
264
|
-
* This module is browser compatible.
|
|
265
|
-
*
|
|
266
|
-
* @example
|
|
267
|
-
* ```ts
|
|
268
|
-
* import {
|
|
269
|
-
* parse,
|
|
270
|
-
* parseComparator,
|
|
271
|
-
* parseRange,
|
|
272
|
-
* gt,
|
|
273
|
-
* lt,
|
|
274
|
-
* format
|
|
275
|
-
* } from "https://deno.land/std@$STD_VERSION/semver/mod.ts";
|
|
276
|
-
*
|
|
277
|
-
* const semver = parse("1.2.3");
|
|
278
|
-
* const range = parseRange("1.x || >=2.5.0 || 5.0.0 - 7.2.3");
|
|
279
|
-
*
|
|
280
|
-
* const s0 = parse("1.2.3");
|
|
281
|
-
* const s1 = parse("9.8.7");
|
|
282
|
-
* gt(s0, s1); // false
|
|
283
|
-
* lt(s0, s1); // true
|
|
284
|
-
*
|
|
285
|
-
* format(semver) // "1.2.3"
|
|
286
|
-
* ```
|
|
287
|
-
*
|
|
288
290
|
* @module
|
|
289
291
|
*/
|
|
290
|
-
__exportStar(require("./cmp.js"), exports);
|
|
291
|
-
__exportStar(require("./comparator_format.js"), exports);
|
|
292
|
-
__exportStar(require("./comparator_intersects.js"), exports);
|
|
293
|
-
__exportStar(require("./comparator_max.js"), exports);
|
|
294
|
-
__exportStar(require("./comparator_min.js"), exports);
|
|
295
|
-
__exportStar(require("./compare_build.js"), exports);
|
|
296
292
|
__exportStar(require("./compare.js"), exports);
|
|
297
|
-
__exportStar(require("./constants.js"), exports);
|
|
298
293
|
__exportStar(require("./difference.js"), exports);
|
|
299
|
-
__exportStar(require("./eq.js"), exports);
|
|
300
294
|
__exportStar(require("./format.js"), exports);
|
|
301
|
-
__exportStar(require("./
|
|
302
|
-
__exportStar(require("./gte.js"), exports);
|
|
303
|
-
__exportStar(require("./gtr.js"), exports);
|
|
304
|
-
__exportStar(require("./test_comparator.js"), exports);
|
|
305
|
-
__exportStar(require("./test_range.js"), exports);
|
|
295
|
+
__exportStar(require("./satisfies.js"), exports);
|
|
306
296
|
__exportStar(require("./increment.js"), exports);
|
|
307
|
-
__exportStar(require("./is_semver_comparator.js"), exports);
|
|
308
|
-
__exportStar(require("./is_semver_range.js"), exports);
|
|
309
297
|
__exportStar(require("./is_semver.js"), exports);
|
|
310
|
-
__exportStar(require("./lt.js"), exports);
|
|
311
|
-
__exportStar(require("./lte.js"), exports);
|
|
312
|
-
__exportStar(require("./ltr.js"), exports);
|
|
313
298
|
__exportStar(require("./max_satisfying.js"), exports);
|
|
314
299
|
__exportStar(require("./min_satisfying.js"), exports);
|
|
315
|
-
__exportStar(require("./neq.js"), exports);
|
|
316
|
-
__exportStar(require("./outside.js"), exports);
|
|
317
|
-
__exportStar(require("./parse_comparator.js"), exports);
|
|
318
300
|
__exportStar(require("./parse_range.js"), exports);
|
|
319
301
|
__exportStar(require("./parse.js"), exports);
|
|
320
|
-
__exportStar(require("./range_format.js"), exports);
|
|
321
302
|
__exportStar(require("./range_intersects.js"), exports);
|
|
322
|
-
__exportStar(require("./range_max.js"), exports);
|
|
323
|
-
__exportStar(require("./range_min.js"), exports);
|
|
324
|
-
__exportStar(require("./rcompare.js"), exports);
|
|
325
|
-
__exportStar(require("./rsort.js"), exports);
|
|
326
|
-
__exportStar(require("./sort.js"), exports);
|
|
327
303
|
__exportStar(require("./types.js"), exports);
|
|
328
|
-
__exportStar(require("./
|
|
329
|
-
__exportStar(require("./
|
|
330
|
-
|
|
304
|
+
__exportStar(require("./try_parse_range.js"), exports);
|
|
305
|
+
__exportStar(require("./is_range.js"), exports);
|
|
306
|
+
__exportStar(require("./can_parse.js"), exports);
|
|
307
|
+
__exportStar(require("./try_parse.js"), exports);
|
|
308
|
+
__exportStar(require("./format_range.js"), exports);
|
|
309
|
+
__exportStar(require("./equals.js"), exports);
|
|
310
|
+
__exportStar(require("./not_equals.js"), exports);
|
|
311
|
+
__exportStar(require("./greater_than.js"), exports);
|
|
312
|
+
__exportStar(require("./greater_than_range.js"), exports);
|
|
313
|
+
__exportStar(require("./greater_or_equal.js"), exports);
|
|
314
|
+
__exportStar(require("./less_than.js"), exports);
|
|
315
|
+
__exportStar(require("./less_than_range.js"), exports);
|
|
316
|
+
__exportStar(require("./less_or_equal.js"), exports);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SemVer } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Not equal comparison for two SemVers.
|
|
4
|
+
*
|
|
5
|
+
* This is equal to `compare(version1, version2) !== 0`.
|
|
6
|
+
*
|
|
7
|
+
* @example Usage
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { parse, notEquals } from "mod.ts";
|
|
10
|
+
* import { assert } from "../assert/mod.ts";
|
|
11
|
+
*
|
|
12
|
+
* const version1 = parse("1.2.3");
|
|
13
|
+
* const version2 = parse("1.2.4");
|
|
14
|
+
*
|
|
15
|
+
* assert(notEquals(version1, version2));
|
|
16
|
+
* assert(!notEquals(version1, version1));
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @param version1 The first version to compare
|
|
20
|
+
* @param version2 The second version to compare
|
|
21
|
+
* @returns `true` if `version1` is not equal to `version2`, `false` otherwise
|
|
22
|
+
*/
|
|
23
|
+
export declare function notEquals(version1: SemVer, version2: SemVer): boolean;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.notEquals = void 0;
|
|
4
|
+
const compare_js_1 = require("./compare.js");
|
|
5
|
+
/**
|
|
6
|
+
* Not equal comparison for two SemVers.
|
|
7
|
+
*
|
|
8
|
+
* This is equal to `compare(version1, version2) !== 0`.
|
|
9
|
+
*
|
|
10
|
+
* @example Usage
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { parse, notEquals } from "mod.ts";
|
|
13
|
+
* import { assert } from "../assert/mod.ts";
|
|
14
|
+
*
|
|
15
|
+
* const version1 = parse("1.2.3");
|
|
16
|
+
* const version2 = parse("1.2.4");
|
|
17
|
+
*
|
|
18
|
+
* assert(notEquals(version1, version2));
|
|
19
|
+
* assert(!notEquals(version1, version1));
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @param version1 The first version to compare
|
|
23
|
+
* @param version2 The second version to compare
|
|
24
|
+
* @returns `true` if `version1` is not equal to `version2`, `false` otherwise
|
|
25
|
+
*/
|
|
26
|
+
function notEquals(version1, version2) {
|
|
27
|
+
return (0, compare_js_1.compare)(version1, version2) !== 0;
|
|
28
|
+
}
|
|
29
|
+
exports.notEquals = notEquals;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { SemVer } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Attempt to parse a string as a semantic version, returning a SemVer object.
|
|
4
|
+
*
|
|
5
|
+
* @example Usage
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { parse } from "parse.ts";
|
|
8
|
+
* import { assertEquals } from "../assert/mod.ts";
|
|
9
|
+
*
|
|
10
|
+
* const version = parse("1.2.3");
|
|
11
|
+
* assertEquals(version, {
|
|
12
|
+
* major: 1,
|
|
13
|
+
* minor: 2,
|
|
14
|
+
* patch: 3,
|
|
15
|
+
* prerelease: [],
|
|
16
|
+
* build: [],
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @throws {TypeError} If the input string is invalid.
|
|
21
|
+
* @param value The version string to parse
|
|
22
|
+
* @returns A valid SemVer
|
|
23
|
+
*/
|
|
24
|
+
export declare function parse(value: string): SemVer;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parse = void 0;
|
|
4
|
+
const _shared_js_1 = require("./_shared.js");
|
|
5
|
+
const _shared_js_2 = require("./_shared.js");
|
|
6
|
+
/**
|
|
7
|
+
* Attempt to parse a string as a semantic version, returning a SemVer object.
|
|
8
|
+
*
|
|
9
|
+
* @example Usage
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { parse } from "parse.ts";
|
|
12
|
+
* import { assertEquals } from "../assert/mod.ts";
|
|
13
|
+
*
|
|
14
|
+
* const version = parse("1.2.3");
|
|
15
|
+
* assertEquals(version, {
|
|
16
|
+
* major: 1,
|
|
17
|
+
* minor: 2,
|
|
18
|
+
* patch: 3,
|
|
19
|
+
* prerelease: [],
|
|
20
|
+
* build: [],
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @throws {TypeError} If the input string is invalid.
|
|
25
|
+
* @param value The version string to parse
|
|
26
|
+
* @returns A valid SemVer
|
|
27
|
+
*/
|
|
28
|
+
function parse(value) {
|
|
29
|
+
if (typeof value !== "string") {
|
|
30
|
+
throw new TypeError(`Cannot parse version as version must be a string: received ${typeof value}`);
|
|
31
|
+
}
|
|
32
|
+
if (value.length > _shared_js_2.MAX_LENGTH) {
|
|
33
|
+
throw new TypeError(`Cannot parse version as version length is too long: length is ${value.length}, max length is ${_shared_js_2.MAX_LENGTH}`);
|
|
34
|
+
}
|
|
35
|
+
value = value.trim();
|
|
36
|
+
const groups = value.match(_shared_js_2.FULL_REGEXP)?.groups;
|
|
37
|
+
if (!groups)
|
|
38
|
+
throw new TypeError(`Cannot parse version: ${value}`);
|
|
39
|
+
const major = (0, _shared_js_1.parseNumber)(groups.major, `Cannot parse version ${value}: invalid major version`);
|
|
40
|
+
const minor = (0, _shared_js_1.parseNumber)(groups.minor, `Cannot parse version ${value}: invalid minor version`);
|
|
41
|
+
const patch = (0, _shared_js_1.parseNumber)(groups.patch, `Cannot parse version ${value}: invalid patch version`);
|
|
42
|
+
const prerelease = groups.prerelease
|
|
43
|
+
? (0, _shared_js_1.parsePrerelease)(groups.prerelease)
|
|
44
|
+
: [];
|
|
45
|
+
const build = groups.buildmetadata ? (0, _shared_js_1.parseBuild)(groups.buildmetadata) : [];
|
|
46
|
+
return { major, minor, patch, prerelease, build };
|
|
47
|
+
}
|
|
48
|
+
exports.parse = parse;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Range } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Parses a range string into a {@linkcode Range} object.
|
|
4
|
+
*
|
|
5
|
+
* @example Usage
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { parseRange } from "parse_range.ts";
|
|
8
|
+
* import { assertEquals } from "../assert/mod.ts";
|
|
9
|
+
*
|
|
10
|
+
* const range = parseRange(">=1.0.0 <2.0.0 || >=3.0.0");
|
|
11
|
+
* assertEquals(range, [
|
|
12
|
+
* [
|
|
13
|
+
* { operator: ">=", major: 1, minor: 0, patch: 0, prerelease: [], build: [] },
|
|
14
|
+
* { operator: "<", major: 2, minor: 0, patch: 0, prerelease: [], build: [] },
|
|
15
|
+
* ],
|
|
16
|
+
* [
|
|
17
|
+
* { operator: ">=", major: 3, minor: 0, patch: 0, prerelease: [], build: [] },
|
|
18
|
+
* ]
|
|
19
|
+
* ]);
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @throws {TypeError} If the input range is invalid.
|
|
23
|
+
* @param value The range set string
|
|
24
|
+
* @returns A valid SemVer range
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseRange(value: string): Range;
|