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,361 @@
|
|
|
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.parseArgs = void 0;
|
|
6
|
+
const FLAG_REGEXP = /^(?:-(?:(?<doubleDash>-)(?<negated>no-)?)?)(?<key>.+?)(?:=(?<value>.+?))?$/s;
|
|
7
|
+
const LETTER_REGEXP = /[A-Za-z]/;
|
|
8
|
+
const NUMBER_REGEXP = /-?\d+(\.\d*)?(e-?\d+)?$/;
|
|
9
|
+
const HYPHEN_REGEXP = /^(-|--)[^-]/;
|
|
10
|
+
const VALUE_REGEXP = /=(?<value>.+)/;
|
|
11
|
+
const FLAG_NAME_REGEXP = /^--[^=]+$/;
|
|
12
|
+
const SPECIAL_CHAR_REGEXP = /\W/;
|
|
13
|
+
const NON_WHITESPACE_REGEXP = /\S/;
|
|
14
|
+
function isNumber(string) {
|
|
15
|
+
return NON_WHITESPACE_REGEXP.test(string) && Number.isFinite(Number(string));
|
|
16
|
+
}
|
|
17
|
+
function setNested(object, keys, value, collect = false) {
|
|
18
|
+
keys = [...keys];
|
|
19
|
+
const key = keys.pop();
|
|
20
|
+
keys.forEach((key) => object = (object[key] ??= {}));
|
|
21
|
+
if (collect) {
|
|
22
|
+
const v = object[key];
|
|
23
|
+
if (Array.isArray(v)) {
|
|
24
|
+
v.push(value);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
value = v ? [v, value] : [value];
|
|
28
|
+
}
|
|
29
|
+
object[key] = value;
|
|
30
|
+
}
|
|
31
|
+
function hasNested(object, keys) {
|
|
32
|
+
for (const key of keys) {
|
|
33
|
+
const value = object[key];
|
|
34
|
+
if (!Object.hasOwn(object, key))
|
|
35
|
+
return false;
|
|
36
|
+
object = value;
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
function aliasIsBoolean(aliasMap, booleanSet, key) {
|
|
41
|
+
const set = aliasMap.get(key);
|
|
42
|
+
if (set === undefined)
|
|
43
|
+
return false;
|
|
44
|
+
for (const alias of set)
|
|
45
|
+
if (booleanSet.has(alias))
|
|
46
|
+
return true;
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
function isBooleanString(value) {
|
|
50
|
+
return value === "true" || value === "false";
|
|
51
|
+
}
|
|
52
|
+
function parseBooleanString(value) {
|
|
53
|
+
return value !== "false";
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Take a set of command line arguments, optionally with a set of options, and
|
|
57
|
+
* return an object representing the flags found in the passed arguments.
|
|
58
|
+
*
|
|
59
|
+
* By default, any arguments starting with `-` or `--` are considered boolean
|
|
60
|
+
* flags. If the argument name is followed by an equal sign (`=`) it is
|
|
61
|
+
* considered a key-value pair. Any arguments which could not be parsed are
|
|
62
|
+
* available in the `_` property of the returned object.
|
|
63
|
+
*
|
|
64
|
+
* By default, this module tries to determine the type of all arguments
|
|
65
|
+
* automatically and the return type of this function will have an index
|
|
66
|
+
* signature with `any` as value (`{ [x: string]: any }`).
|
|
67
|
+
*
|
|
68
|
+
* If the `string`, `boolean` or `collect` option is set, the return value of
|
|
69
|
+
* this function will be fully typed and the index signature of the return
|
|
70
|
+
* type will change to `{ [x: string]: unknown }`.
|
|
71
|
+
*
|
|
72
|
+
* Any arguments after `'--'` will not be parsed and will end up in `parsedArgs._`.
|
|
73
|
+
*
|
|
74
|
+
* Numeric-looking arguments will be returned as numbers unless `options.string`
|
|
75
|
+
* or `options.boolean` is set for that argument name.
|
|
76
|
+
*
|
|
77
|
+
* See {@linkcode ParseOptions} for more information.
|
|
78
|
+
*
|
|
79
|
+
* @param args An array of command line arguments.
|
|
80
|
+
* @param options Options for the parse function.
|
|
81
|
+
*
|
|
82
|
+
* @typeParam TArgs Type of result.
|
|
83
|
+
* @typeParam TDoubleDash Used by `TArgs` for the result.
|
|
84
|
+
* @typeParam TBooleans Used by `TArgs` for the result.
|
|
85
|
+
* @typeParam TStrings Used by `TArgs` for the result.
|
|
86
|
+
* @typeParam TCollectable Used by `TArgs` for the result.
|
|
87
|
+
* @typeParam TNegatable Used by `TArgs` for the result.
|
|
88
|
+
* @typeParam TDefaults Used by `TArgs` for the result.
|
|
89
|
+
* @typeParam TAliases Used by `TArgs` for the result.
|
|
90
|
+
* @typeParam TAliasArgNames Used by `TArgs` for the result.
|
|
91
|
+
* @typeParam TAliasNames Used by `TArgs` for the result.
|
|
92
|
+
*
|
|
93
|
+
* @return The parsed arguments.
|
|
94
|
+
*
|
|
95
|
+
* @example Usage
|
|
96
|
+
* ```ts
|
|
97
|
+
* import { parseArgs } from "parse_args.ts";
|
|
98
|
+
* import { assertEquals } from "../assert/equals.ts";
|
|
99
|
+
*
|
|
100
|
+
* // For proper use, one should use `parseArgs(Deno.args)`
|
|
101
|
+
* assertEquals(parseArgs(["--foo", "--bar=baz", "./quux.txt"]), {
|
|
102
|
+
* foo: true,
|
|
103
|
+
* bar: "baz",
|
|
104
|
+
* _: ["./quux.txt"],
|
|
105
|
+
* });
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* @example `string` and `boolean` options
|
|
109
|
+
*
|
|
110
|
+
* Use `string` and `boolean` options to specify the type of the argument.
|
|
111
|
+
*
|
|
112
|
+
* ```ts
|
|
113
|
+
* import { parseArgs } from "parse_args.ts";
|
|
114
|
+
* import { assertEquals } from "../assert/equals.ts";
|
|
115
|
+
*
|
|
116
|
+
* const args = parseArgs(["--foo", "--bar", "baz"], {
|
|
117
|
+
* boolean: ["foo"],
|
|
118
|
+
* string: ["bar"],
|
|
119
|
+
* });
|
|
120
|
+
*
|
|
121
|
+
* assertEquals(args, { foo: true, bar: "baz", _: [] });
|
|
122
|
+
* ```
|
|
123
|
+
*
|
|
124
|
+
* @example `collect` option
|
|
125
|
+
*
|
|
126
|
+
* `collect` option tells the parser to treat the option as an array. All
|
|
127
|
+
* values will be collected into one array. If a non-collectable option is used
|
|
128
|
+
* multiple times, the last value is used.
|
|
129
|
+
*
|
|
130
|
+
* ```ts
|
|
131
|
+
* import { parseArgs } from "parse_args.ts";
|
|
132
|
+
* import { assertEquals } from "../assert/equals.ts";
|
|
133
|
+
*
|
|
134
|
+
* const args = parseArgs(["--foo", "bar", "--foo", "baz"], {
|
|
135
|
+
* collect: ["foo"],
|
|
136
|
+
* });
|
|
137
|
+
*
|
|
138
|
+
* assertEquals(args, { foo: ["bar", "baz"], _: [] });
|
|
139
|
+
* ```
|
|
140
|
+
*
|
|
141
|
+
* @example `negatable` option
|
|
142
|
+
*
|
|
143
|
+
* `negatable` option tells the parser to treat the option can be negated by
|
|
144
|
+
* prefixing them with `--no-`, like `--no-config`.
|
|
145
|
+
*
|
|
146
|
+
* ```ts
|
|
147
|
+
* import { parseArgs } from "parse_args.ts";
|
|
148
|
+
* import { assertEquals } from "../assert/equals.ts";
|
|
149
|
+
*
|
|
150
|
+
* const args = parseArgs(["--no-foo"], {
|
|
151
|
+
* boolean: ["foo"],
|
|
152
|
+
* negatable: ["foo"],
|
|
153
|
+
* });
|
|
154
|
+
*
|
|
155
|
+
* assertEquals(args, { foo: false, _: [] });
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
function parseArgs(args, options) {
|
|
159
|
+
const { "--": doubleDash = false, alias = {}, boolean = false, default: defaults = {}, stopEarly = false, string = [], collect = [], negatable = [], unknown: unknownFn = (i) => i, } = options ?? {};
|
|
160
|
+
const aliasMap = new Map();
|
|
161
|
+
const booleanSet = new Set();
|
|
162
|
+
const stringSet = new Set();
|
|
163
|
+
const collectSet = new Set();
|
|
164
|
+
const negatableSet = new Set();
|
|
165
|
+
let allBools = false;
|
|
166
|
+
if (alias) {
|
|
167
|
+
for (const [key, value] of Object.entries(alias)) {
|
|
168
|
+
if (value === undefined) {
|
|
169
|
+
throw new TypeError("Alias value must be defined");
|
|
170
|
+
}
|
|
171
|
+
const aliases = Array.isArray(value) ? value : [value];
|
|
172
|
+
aliasMap.set(key, new Set(aliases));
|
|
173
|
+
aliases.forEach((alias) => aliasMap.set(alias, new Set([key, ...aliases.filter((it) => it !== alias)])));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (boolean) {
|
|
177
|
+
if (typeof boolean === "boolean") {
|
|
178
|
+
allBools = boolean;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
const booleanArgs = Array.isArray(boolean) ? boolean : [boolean];
|
|
182
|
+
for (const key of booleanArgs.filter(Boolean)) {
|
|
183
|
+
booleanSet.add(key);
|
|
184
|
+
aliasMap.get(key)?.forEach((al) => {
|
|
185
|
+
booleanSet.add(al);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (string) {
|
|
191
|
+
const stringArgs = Array.isArray(string) ? string : [string];
|
|
192
|
+
for (const key of stringArgs.filter(Boolean)) {
|
|
193
|
+
stringSet.add(key);
|
|
194
|
+
aliasMap.get(key)?.forEach((al) => stringSet.add(al));
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (collect) {
|
|
198
|
+
const collectArgs = Array.isArray(collect) ? collect : [collect];
|
|
199
|
+
for (const key of collectArgs.filter(Boolean)) {
|
|
200
|
+
collectSet.add(key);
|
|
201
|
+
aliasMap.get(key)?.forEach((al) => collectSet.add(al));
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
if (negatable) {
|
|
205
|
+
const negatableArgs = Array.isArray(negatable) ? negatable : [negatable];
|
|
206
|
+
for (const key of negatableArgs.filter(Boolean)) {
|
|
207
|
+
negatableSet.add(key);
|
|
208
|
+
aliasMap.get(key)?.forEach((alias) => negatableSet.add(alias));
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
const argv = { _: [] };
|
|
212
|
+
function setArgument(key, value, arg, collect) {
|
|
213
|
+
if (!booleanSet.has(key) &&
|
|
214
|
+
!stringSet.has(key) &&
|
|
215
|
+
!aliasMap.has(key) &&
|
|
216
|
+
!(allBools && FLAG_NAME_REGEXP.test(arg)) &&
|
|
217
|
+
unknownFn?.(arg, key, value) === false) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (typeof value === "string" && !stringSet.has(key)) {
|
|
221
|
+
value = isNumber(value) ? Number(value) : value;
|
|
222
|
+
}
|
|
223
|
+
const collectable = collect && collectSet.has(key);
|
|
224
|
+
setNested(argv, key.split("."), value, collectable);
|
|
225
|
+
aliasMap.get(key)?.forEach((key) => {
|
|
226
|
+
setNested(argv, key.split("."), value, collectable);
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
let notFlags = [];
|
|
230
|
+
// all args after "--" are not parsed
|
|
231
|
+
const index = args.indexOf("--");
|
|
232
|
+
if (index !== -1) {
|
|
233
|
+
notFlags = args.slice(index + 1);
|
|
234
|
+
args = args.slice(0, index);
|
|
235
|
+
}
|
|
236
|
+
argsLoop: for (let i = 0; i < args.length; i++) {
|
|
237
|
+
const arg = args[i];
|
|
238
|
+
const groups = arg.match(FLAG_REGEXP)?.groups;
|
|
239
|
+
if (groups) {
|
|
240
|
+
const { doubleDash, negated } = groups;
|
|
241
|
+
let key = groups.key;
|
|
242
|
+
let value = groups.value;
|
|
243
|
+
if (doubleDash) {
|
|
244
|
+
if (value) {
|
|
245
|
+
if (booleanSet.has(key))
|
|
246
|
+
value = parseBooleanString(value);
|
|
247
|
+
setArgument(key, value, arg, true);
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
if (negated) {
|
|
251
|
+
if (negatableSet.has(key)) {
|
|
252
|
+
setArgument(key, false, arg, false);
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
key = `no-${key}`;
|
|
256
|
+
}
|
|
257
|
+
const next = args[i + 1];
|
|
258
|
+
if (next) {
|
|
259
|
+
if (!booleanSet.has(key) &&
|
|
260
|
+
!allBools &&
|
|
261
|
+
!next.startsWith("-") &&
|
|
262
|
+
(!aliasMap.has(key) || !aliasIsBoolean(aliasMap, booleanSet, key))) {
|
|
263
|
+
value = next;
|
|
264
|
+
i++;
|
|
265
|
+
setArgument(key, value, arg, true);
|
|
266
|
+
continue;
|
|
267
|
+
}
|
|
268
|
+
if (isBooleanString(next)) {
|
|
269
|
+
value = parseBooleanString(next);
|
|
270
|
+
i++;
|
|
271
|
+
setArgument(key, value, arg, true);
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
value = stringSet.has(key) ? "" : true;
|
|
276
|
+
setArgument(key, value, arg, true);
|
|
277
|
+
continue;
|
|
278
|
+
}
|
|
279
|
+
const letters = arg.slice(1, -1).split("");
|
|
280
|
+
for (const [j, letter] of letters.entries()) {
|
|
281
|
+
const next = arg.slice(j + 2);
|
|
282
|
+
if (next === "-") {
|
|
283
|
+
setArgument(letter, next, arg, true);
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
if (LETTER_REGEXP.test(letter)) {
|
|
287
|
+
const groups = VALUE_REGEXP.exec(next)?.groups;
|
|
288
|
+
if (groups) {
|
|
289
|
+
setArgument(letter, groups.value, arg, true);
|
|
290
|
+
continue argsLoop;
|
|
291
|
+
}
|
|
292
|
+
if (NUMBER_REGEXP.test(next)) {
|
|
293
|
+
setArgument(letter, next, arg, true);
|
|
294
|
+
continue argsLoop;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
if (letters[j + 1]?.match(SPECIAL_CHAR_REGEXP)) {
|
|
298
|
+
setArgument(letter, arg.slice(j + 2), arg, true);
|
|
299
|
+
continue argsLoop;
|
|
300
|
+
}
|
|
301
|
+
setArgument(letter, stringSet.has(letter) ? "" : true, arg, true);
|
|
302
|
+
}
|
|
303
|
+
key = arg.slice(-1);
|
|
304
|
+
if (key === "-")
|
|
305
|
+
continue;
|
|
306
|
+
const nextArg = args[i + 1];
|
|
307
|
+
if (nextArg) {
|
|
308
|
+
if (!HYPHEN_REGEXP.test(nextArg) &&
|
|
309
|
+
!booleanSet.has(key) &&
|
|
310
|
+
(!aliasMap.has(key) || !aliasIsBoolean(aliasMap, booleanSet, key))) {
|
|
311
|
+
setArgument(key, nextArg, arg, true);
|
|
312
|
+
i++;
|
|
313
|
+
continue;
|
|
314
|
+
}
|
|
315
|
+
if (isBooleanString(nextArg)) {
|
|
316
|
+
const value = parseBooleanString(nextArg);
|
|
317
|
+
setArgument(key, value, arg, true);
|
|
318
|
+
i++;
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
setArgument(key, stringSet.has(key) ? "" : true, arg, true);
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
if (unknownFn?.(arg) !== false) {
|
|
326
|
+
argv._.push(stringSet.has("_") || !isNumber(arg) ? arg : Number(arg));
|
|
327
|
+
}
|
|
328
|
+
if (stopEarly) {
|
|
329
|
+
argv._.push(...args.slice(i + 1));
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
for (const [key, value] of Object.entries(defaults)) {
|
|
334
|
+
const keys = key.split(".");
|
|
335
|
+
if (!hasNested(argv, keys)) {
|
|
336
|
+
setNested(argv, keys, value);
|
|
337
|
+
aliasMap.get(key)?.forEach((key) => setNested(argv, key.split("."), value));
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
for (const key of booleanSet.keys()) {
|
|
341
|
+
const keys = key.split(".");
|
|
342
|
+
if (!hasNested(argv, keys)) {
|
|
343
|
+
const value = collectSet.has(key) ? [] : false;
|
|
344
|
+
setNested(argv, keys, value);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
for (const key of stringSet.keys()) {
|
|
348
|
+
const keys = key.split(".");
|
|
349
|
+
if (!hasNested(argv, keys) && collectSet.has(key)) {
|
|
350
|
+
setNested(argv, keys, []);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
if (doubleDash) {
|
|
354
|
+
argv["--"] = notFlags;
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
argv._.push(...notFlags);
|
|
358
|
+
}
|
|
359
|
+
return argv;
|
|
360
|
+
}
|
|
361
|
+
exports.parseArgs = parseArgs;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/** Options for providing formatting marks. */
|
|
2
|
+
export interface FormattingOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Character(s) used to break lines in the config file. Ignored on parse.
|
|
5
|
+
*
|
|
6
|
+
* @default {"\n"}
|
|
7
|
+
*/
|
|
8
|
+
lineBreak?: "\n" | "\r\n" | "\r";
|
|
9
|
+
/**
|
|
10
|
+
* Use a plain assignment char or pad with spaces. Ignored on parse.
|
|
11
|
+
*
|
|
12
|
+
* @default {false}
|
|
13
|
+
*/
|
|
14
|
+
pretty?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** Options for parsing INI strings. */
|
|
17
|
+
interface ParseOptions<T = any> {
|
|
18
|
+
/** Provide custom parsing of the value in a key/value pair. */
|
|
19
|
+
reviver?: ReviverFunction<T>;
|
|
20
|
+
}
|
|
21
|
+
/** Function for replacing JavaScript values with INI string values. */
|
|
22
|
+
export type ReplacerFunction = (key: string, value: any, section?: string) => string;
|
|
23
|
+
/** Function for replacing INI values with JavaScript values. */
|
|
24
|
+
export type ReviverFunction<T = any> = (key: string, value: string, section?: string) => T;
|
|
25
|
+
/**
|
|
26
|
+
* Class implementation for fine control of INI data structures.
|
|
27
|
+
*/
|
|
28
|
+
export declare class IniMap<T = any> {
|
|
29
|
+
#private;
|
|
30
|
+
/** Constructs a new `IniMap`.
|
|
31
|
+
*
|
|
32
|
+
* @param formatting Optional formatting options when printing an INI file.
|
|
33
|
+
*/
|
|
34
|
+
constructor(formatting?: FormattingOptions);
|
|
35
|
+
/**
|
|
36
|
+
* Set the value of a global key in the INI.
|
|
37
|
+
*
|
|
38
|
+
* @param key The key to set the value
|
|
39
|
+
* @param value The value to set
|
|
40
|
+
* @returns The map object itself
|
|
41
|
+
*/
|
|
42
|
+
set(key: string, value: unknown): this;
|
|
43
|
+
/**
|
|
44
|
+
* Set the value of a section key in the INI.
|
|
45
|
+
*
|
|
46
|
+
* @param section The section
|
|
47
|
+
* @param key The key to set
|
|
48
|
+
* @param value The value to set
|
|
49
|
+
* @return The map object itself
|
|
50
|
+
*/
|
|
51
|
+
set(section: string, key: string, value: unknown): this;
|
|
52
|
+
/**
|
|
53
|
+
* Convert this `IniMap` to a plain object.
|
|
54
|
+
*
|
|
55
|
+
* @returns The object equivalent to this {@code IniMap}
|
|
56
|
+
*/
|
|
57
|
+
toObject(): Record<string, T | Record<string, T>>;
|
|
58
|
+
/**
|
|
59
|
+
* Convert this `IniMap` to an INI string.
|
|
60
|
+
*
|
|
61
|
+
* @param replacer The replacer
|
|
62
|
+
* @returns Ini string
|
|
63
|
+
*/
|
|
64
|
+
toString(replacer?: ReplacerFunction): string;
|
|
65
|
+
/**
|
|
66
|
+
* Parse an INI string in this `IniMap`.
|
|
67
|
+
*
|
|
68
|
+
* @param text The text to parse
|
|
69
|
+
* @param reviver The reviver function
|
|
70
|
+
* @returns This {@code IniMap} object
|
|
71
|
+
*/
|
|
72
|
+
parse(text: string, reviver?: ReviverFunction): this;
|
|
73
|
+
/**
|
|
74
|
+
* Create an `IniMap` from an INI string.
|
|
75
|
+
*
|
|
76
|
+
* @param input The input string
|
|
77
|
+
* @param options The options to use
|
|
78
|
+
* @returns The parsed {@code IniMap}
|
|
79
|
+
*/
|
|
80
|
+
static from(input: string, options?: ParseOptions & FormattingOptions): IniMap;
|
|
81
|
+
/**
|
|
82
|
+
* Create an `IniMap` from a plain object.
|
|
83
|
+
*
|
|
84
|
+
* @param input The input string
|
|
85
|
+
* @param formatting The options to use
|
|
86
|
+
* @returns The parsed {@code IniMap}
|
|
87
|
+
*/
|
|
88
|
+
static from(input: Record<string, unknown>, formatting?: FormattingOptions): IniMap;
|
|
89
|
+
}
|
|
90
|
+
export {};
|