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,166 +0,0 @@
|
|
|
1
|
-
/** Combines recursively all intersection types and returns a new single type. */
|
|
2
|
-
type Id<TRecord> = TRecord extends Record<string, unknown> ? TRecord extends infer InferredRecord ? {
|
|
3
|
-
[Key in keyof InferredRecord]: Id<InferredRecord[Key]>;
|
|
4
|
-
} : never : TRecord;
|
|
5
|
-
/** Converts a union type `A | B | C` into an intersection type `A & B & C`. */
|
|
6
|
-
type UnionToIntersection<TValue> = (TValue extends unknown ? (args: TValue) => unknown : never) extends (args: infer R) => unknown ? R extends Record<string, unknown> ? R : never : never;
|
|
7
|
-
type BooleanType = boolean | string | undefined;
|
|
8
|
-
type StringType = string | undefined;
|
|
9
|
-
type ArgType = StringType | BooleanType;
|
|
10
|
-
type Collectable = string | undefined;
|
|
11
|
-
type Negatable = string | undefined;
|
|
12
|
-
type UseTypes<TBooleans extends BooleanType, TStrings extends StringType, TCollectable extends Collectable> = undefined extends ((false extends TBooleans ? undefined : TBooleans) & TCollectable & TStrings) ? false : true;
|
|
13
|
-
/**
|
|
14
|
-
* Creates a record with all available flags with the corresponding type and
|
|
15
|
-
* default type.
|
|
16
|
-
*/
|
|
17
|
-
type Values<TBooleans extends BooleanType, TStrings extends StringType, TCollectable extends Collectable, TNegatable extends Negatable, TDefault extends Record<string, unknown> | undefined, TAliases extends Aliases | undefined> = UseTypes<TBooleans, TStrings, TCollectable> extends true ? Record<string, unknown> & AddAliases<SpreadDefaults<CollectValues<TStrings, string, TCollectable, TNegatable> & RecursiveRequired<CollectValues<TBooleans, boolean, TCollectable>> & CollectUnknownValues<TBooleans, TStrings, TCollectable, TNegatable>, DedotRecord<TDefault>>, TAliases> : Record<string, any>;
|
|
18
|
-
type Aliases<TArgNames = string, TAliasNames extends string = string> = Partial<Record<Extract<TArgNames, string>, TAliasNames | ReadonlyArray<TAliasNames>>>;
|
|
19
|
-
type AddAliases<TArgs, TAliases extends Aliases | undefined> = {
|
|
20
|
-
[TArgName in keyof TArgs as AliasNames<TArgName, TAliases>]: TArgs[TArgName];
|
|
21
|
-
};
|
|
22
|
-
type AliasNames<TArgName, TAliases extends Aliases | undefined> = TArgName extends keyof TAliases ? string extends TAliases[TArgName] ? TArgName : TAliases[TArgName] extends string ? TArgName | TAliases[TArgName] : TAliases[TArgName] extends Array<string> ? TArgName | TAliases[TArgName][number] : TArgName : TArgName;
|
|
23
|
-
/**
|
|
24
|
-
* Spreads all default values of Record `TDefaults` into Record `TArgs`
|
|
25
|
-
* and makes default values required.
|
|
26
|
-
*
|
|
27
|
-
* **Example:**
|
|
28
|
-
* `SpreadValues<{ foo?: boolean, bar?: number }, { foo: number }>`
|
|
29
|
-
*
|
|
30
|
-
* **Result:** `{ foo: boolean | number, bar?: number }`
|
|
31
|
-
*/
|
|
32
|
-
type SpreadDefaults<TArgs, TDefaults> = TDefaults extends undefined ? TArgs : TArgs extends Record<string, unknown> ? Omit<TArgs, keyof TDefaults> & {
|
|
33
|
-
[Default in keyof TDefaults]: Default extends keyof TArgs ? (TArgs[Default] & TDefaults[Default] | TDefaults[Default]) extends Record<string, unknown> ? NonNullable<SpreadDefaults<TArgs[Default], TDefaults[Default]>> : TDefaults[Default] | NonNullable<TArgs[Default]> : unknown;
|
|
34
|
-
} : never;
|
|
35
|
-
/**
|
|
36
|
-
* Defines the Record for the `default` option to add
|
|
37
|
-
* auto-suggestion support for IDE's.
|
|
38
|
-
*/
|
|
39
|
-
type Defaults<TBooleans extends BooleanType, TStrings extends StringType> = Id<UnionToIntersection<Record<string, unknown> & MapTypes<TStrings, unknown> & MapTypes<TBooleans, unknown> & MapDefaults<TBooleans> & MapDefaults<TStrings>>>;
|
|
40
|
-
type MapDefaults<TArgNames extends ArgType> = Partial<Record<TArgNames extends string ? TArgNames : string, unknown>>;
|
|
41
|
-
type RecursiveRequired<TRecord> = TRecord extends Record<string, unknown> ? {
|
|
42
|
-
[Key in keyof TRecord]-?: RecursiveRequired<TRecord[Key]>;
|
|
43
|
-
} : TRecord;
|
|
44
|
-
/** Same as `MapTypes` but also supports collectable options. */
|
|
45
|
-
type CollectValues<TArgNames extends ArgType, TType, TCollectable extends Collectable, TNegatable extends Negatable = undefined> = UnionToIntersection<Extract<TArgNames, TCollectable> extends string ? (Exclude<TArgNames, TCollectable> extends never ? Record<never, never> : MapTypes<Exclude<TArgNames, TCollectable>, TType, TNegatable>) & (Extract<TArgNames, TCollectable> extends never ? Record<never, never> : RecursiveRequired<MapTypes<Extract<TArgNames, TCollectable>, Array<TType>, TNegatable>>) : MapTypes<TArgNames, TType, TNegatable>>;
|
|
46
|
-
/** Same as `Record` but also supports dotted and negatable options. */
|
|
47
|
-
type MapTypes<TArgNames extends ArgType, TType, TNegatable extends Negatable = undefined> = undefined extends TArgNames ? Record<never, never> : TArgNames extends `${infer Name}.${infer Rest}` ? {
|
|
48
|
-
[Key in Name]?: MapTypes<Rest, TType, TNegatable extends `${Name}.${infer Negate}` ? Negate : undefined>;
|
|
49
|
-
} : TArgNames extends string ? Partial<Record<TArgNames, TNegatable extends TArgNames ? TType | false : TType>> : Record<never, never>;
|
|
50
|
-
type CollectUnknownValues<TBooleans extends BooleanType, TStrings extends StringType, TCollectable extends Collectable, TNegatable extends Negatable> = UnionToIntersection<TCollectable extends TBooleans & TStrings ? Record<never, never> : DedotRecord<Record<Exclude<Extract<Exclude<TCollectable, TNegatable>, string>, Extract<TStrings | TBooleans, string>>, Array<unknown>> & Record<Exclude<Extract<Extract<TCollectable, TNegatable>, string>, Extract<TStrings | TBooleans, string>>, Array<unknown> | false>>>;
|
|
51
|
-
/** Converts `{ "foo.bar.baz": unknown }` into `{ foo: { bar: { baz: unknown } } }`. */
|
|
52
|
-
type DedotRecord<TRecord> = Record<string, unknown> extends TRecord ? TRecord : TRecord extends Record<string, unknown> ? UnionToIntersection<ValueOf<{
|
|
53
|
-
[Key in keyof TRecord]: Key extends string ? Dedot<Key, TRecord[Key]> : never;
|
|
54
|
-
}>> : TRecord;
|
|
55
|
-
type Dedot<TKey extends string, TValue> = TKey extends `${infer Name}.${infer Rest}` ? {
|
|
56
|
-
[Key in Name]: Dedot<Rest, TValue>;
|
|
57
|
-
} : {
|
|
58
|
-
[Key in TKey]: TValue;
|
|
59
|
-
};
|
|
60
|
-
type ValueOf<TValue> = TValue[keyof TValue];
|
|
61
|
-
/** The value returned from `parse`. */
|
|
62
|
-
export type Args<TArgs extends Record<string, unknown> = Record<string, any>, TDoubleDash extends boolean | undefined = undefined> = Id<TArgs & {
|
|
63
|
-
/** Contains all the arguments that didn't have an option associated with
|
|
64
|
-
* them. */
|
|
65
|
-
_: Array<string | number>;
|
|
66
|
-
} & (boolean extends TDoubleDash ? DoubleDash : true extends TDoubleDash ? Required<DoubleDash> : Record<never, never>)>;
|
|
67
|
-
type DoubleDash = {
|
|
68
|
-
/** Contains all the arguments that appear after the double dash: "--". */
|
|
69
|
-
"--"?: Array<string>;
|
|
70
|
-
};
|
|
71
|
-
/** The options for the `parse` call. */
|
|
72
|
-
export interface ParseOptions<TBooleans extends BooleanType = BooleanType, TStrings extends StringType = StringType, TCollectable extends Collectable = Collectable, TNegatable extends Negatable = Negatable, TDefault extends Record<string, unknown> | undefined = Record<string, unknown> | undefined, TAliases extends Aliases | undefined = Aliases | undefined, TDoubleDash extends boolean | undefined = boolean | undefined> {
|
|
73
|
-
/**
|
|
74
|
-
* When `true`, populate the result `_` with everything before the `--` and
|
|
75
|
-
* the result `['--']` with everything after the `--`.
|
|
76
|
-
*
|
|
77
|
-
* @default {false}
|
|
78
|
-
*
|
|
79
|
-
* @example
|
|
80
|
-
* ```ts
|
|
81
|
-
* // $ deno run example.ts -- a arg1
|
|
82
|
-
* import { parse } from "https://deno.land/std@$STD_VERSION/flags/mod.ts";
|
|
83
|
-
* console.dir(parse(Deno.args, { "--": false }));
|
|
84
|
-
* // output: { _: [ "a", "arg1" ] }
|
|
85
|
-
* console.dir(parse(Deno.args, { "--": true }));
|
|
86
|
-
* // output: { _: [], --: [ "a", "arg1" ] }
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
|
-
"--"?: TDoubleDash;
|
|
90
|
-
/**
|
|
91
|
-
* An object mapping string names to strings or arrays of string argument
|
|
92
|
-
* names to use as aliases.
|
|
93
|
-
*/
|
|
94
|
-
alias?: TAliases;
|
|
95
|
-
/**
|
|
96
|
-
* A boolean, string or array of strings to always treat as booleans. If
|
|
97
|
-
* `true` will treat all double hyphenated arguments without equal signs as
|
|
98
|
-
* `boolean` (e.g. affects `--foo`, not `-f` or `--foo=bar`).
|
|
99
|
-
* All `boolean` arguments will be set to `false` by default.
|
|
100
|
-
*/
|
|
101
|
-
boolean?: TBooleans | ReadonlyArray<Extract<TBooleans, string>>;
|
|
102
|
-
/** An object mapping string argument names to default values. */
|
|
103
|
-
default?: TDefault & Defaults<TBooleans, TStrings>;
|
|
104
|
-
/**
|
|
105
|
-
* When `true`, populate the result `_` with everything after the first
|
|
106
|
-
* non-option.
|
|
107
|
-
*/
|
|
108
|
-
stopEarly?: boolean;
|
|
109
|
-
/** A string or array of strings argument names to always treat as strings. */
|
|
110
|
-
string?: TStrings | ReadonlyArray<Extract<TStrings, string>>;
|
|
111
|
-
/**
|
|
112
|
-
* A string or array of strings argument names to always treat as arrays.
|
|
113
|
-
* Collectable options can be used multiple times. All values will be
|
|
114
|
-
* collected into one array. If a non-collectable option is used multiple
|
|
115
|
-
* times, the last value is used.
|
|
116
|
-
* All Collectable arguments will be set to `[]` by default.
|
|
117
|
-
*/
|
|
118
|
-
collect?: TCollectable | ReadonlyArray<Extract<TCollectable, string>>;
|
|
119
|
-
/**
|
|
120
|
-
* A string or array of strings argument names which can be negated
|
|
121
|
-
* by prefixing them with `--no-`, like `--no-config`.
|
|
122
|
-
*/
|
|
123
|
-
negatable?: TNegatable | ReadonlyArray<Extract<TNegatable, string>>;
|
|
124
|
-
/**
|
|
125
|
-
* A function which is invoked with a command line parameter not defined in
|
|
126
|
-
* the `options` configuration object. If the function returns `false`, the
|
|
127
|
-
* unknown option is not added to `parsedArgs`.
|
|
128
|
-
*/
|
|
129
|
-
unknown?: (arg: string, key?: string, value?: unknown) => unknown;
|
|
130
|
-
}
|
|
131
|
-
/** Take a set of command line arguments, optionally with a set of options, and
|
|
132
|
-
* return an object representing the flags found in the passed arguments.
|
|
133
|
-
*
|
|
134
|
-
* By default, any arguments starting with `-` or `--` are considered boolean
|
|
135
|
-
* flags. If the argument name is followed by an equal sign (`=`) it is
|
|
136
|
-
* considered a key-value pair. Any arguments which could not be parsed are
|
|
137
|
-
* available in the `_` property of the returned object.
|
|
138
|
-
*
|
|
139
|
-
* By default, the flags module tries to determine the type of all arguments
|
|
140
|
-
* automatically and the return type of the `parse` method will have an index
|
|
141
|
-
* signature with `any` as value (`{ [x: string]: any }`).
|
|
142
|
-
*
|
|
143
|
-
* If the `string`, `boolean` or `collect` option is set, the return value of
|
|
144
|
-
* the `parse` method will be fully typed and the index signature of the return
|
|
145
|
-
* type will change to `{ [x: string]: unknown }`.
|
|
146
|
-
*
|
|
147
|
-
* Any arguments after `'--'` will not be parsed and will end up in `parsedArgs._`.
|
|
148
|
-
*
|
|
149
|
-
* Numeric-looking arguments will be returned as numbers unless `options.string`
|
|
150
|
-
* or `options.boolean` is set for that argument name.
|
|
151
|
-
*
|
|
152
|
-
* @example
|
|
153
|
-
* ```ts
|
|
154
|
-
* import { parse } from "https://deno.land/std@$STD_VERSION/flags/mod.ts";
|
|
155
|
-
* const parsedArgs = parse(Deno.args);
|
|
156
|
-
* ```
|
|
157
|
-
*
|
|
158
|
-
* @example
|
|
159
|
-
* ```ts
|
|
160
|
-
* import { parse } from "https://deno.land/std@$STD_VERSION/flags/mod.ts";
|
|
161
|
-
* const parsedArgs = parse(["--foo", "--bar=baz", "./quux.txt"]);
|
|
162
|
-
* // parsedArgs: { foo: true, bar: "baz", _: ["./quux.txt"] }
|
|
163
|
-
* ```
|
|
164
|
-
*/
|
|
165
|
-
export declare function parse<TArgs extends Values<TBooleans, TStrings, TCollectable, TNegatable, TDefaults, TAliases>, TDoubleDash extends boolean | undefined = undefined, TBooleans extends BooleanType = undefined, TStrings extends StringType = undefined, TCollectable extends Collectable = undefined, TNegatable extends Negatable = undefined, TDefaults extends Record<string, unknown> | undefined = undefined, TAliases extends Aliases<TAliasArgNames, TAliasNames> | undefined = undefined, TAliasArgNames extends string = string, TAliasNames extends string = string>(args: string[], { "--": doubleDash, alias, boolean, default: defaults, stopEarly, string, collect, negatable, unknown, }?: ParseOptions<TBooleans, TStrings, TCollectable, TNegatable, TDefaults, TAliases, TDoubleDash>): Args<TArgs, TDoubleDash>;
|
|
166
|
-
export {};
|
|
@@ -1,369 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
3
|
-
// This module is browser compatible.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.parse = void 0;
|
|
6
|
-
/**
|
|
7
|
-
* Command line arguments parser based on
|
|
8
|
-
* [minimist](https://github.com/minimistjs/minimist).
|
|
9
|
-
*
|
|
10
|
-
* This module is browser compatible.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* import { parse } from "https://deno.land/std@$STD_VERSION/flags/mod.ts";
|
|
15
|
-
*
|
|
16
|
-
* console.dir(parse(Deno.args));
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* ```sh
|
|
20
|
-
* $ deno run https://deno.land/std/examples/flags.ts -a beep -b boop
|
|
21
|
-
* { _: [], a: 'beep', b: 'boop' }
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
* ```sh
|
|
25
|
-
* $ deno run https://deno.land/std/examples/flags.ts -x 3 -y 4 -n5 -abc --beep=boop foo bar baz
|
|
26
|
-
* { _: [ 'foo', 'bar', 'baz' ],
|
|
27
|
-
* x: 3,
|
|
28
|
-
* y: 4,
|
|
29
|
-
* n: 5,
|
|
30
|
-
* a: true,
|
|
31
|
-
* b: true,
|
|
32
|
-
* c: true,
|
|
33
|
-
* beep: 'boop' }
|
|
34
|
-
* ```
|
|
35
|
-
*
|
|
36
|
-
* @module
|
|
37
|
-
*/
|
|
38
|
-
const asserts_js_1 = require("../_util/asserts.js");
|
|
39
|
-
const { hasOwn } = Object;
|
|
40
|
-
function get(obj, key) {
|
|
41
|
-
if (hasOwn(obj, key)) {
|
|
42
|
-
return obj[key];
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
function getForce(obj, key) {
|
|
46
|
-
const v = get(obj, key);
|
|
47
|
-
(0, asserts_js_1.assert)(v != null);
|
|
48
|
-
return v;
|
|
49
|
-
}
|
|
50
|
-
function isNumber(x) {
|
|
51
|
-
if (typeof x === "number")
|
|
52
|
-
return true;
|
|
53
|
-
if (/^0x[0-9a-f]+$/i.test(String(x)))
|
|
54
|
-
return true;
|
|
55
|
-
return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(String(x));
|
|
56
|
-
}
|
|
57
|
-
function hasKey(obj, keys) {
|
|
58
|
-
let o = obj;
|
|
59
|
-
keys.slice(0, -1).forEach((key) => {
|
|
60
|
-
o = (get(o, key) ?? {});
|
|
61
|
-
});
|
|
62
|
-
const key = keys[keys.length - 1];
|
|
63
|
-
return hasOwn(o, key);
|
|
64
|
-
}
|
|
65
|
-
/** Take a set of command line arguments, optionally with a set of options, and
|
|
66
|
-
* return an object representing the flags found in the passed arguments.
|
|
67
|
-
*
|
|
68
|
-
* By default, any arguments starting with `-` or `--` are considered boolean
|
|
69
|
-
* flags. If the argument name is followed by an equal sign (`=`) it is
|
|
70
|
-
* considered a key-value pair. Any arguments which could not be parsed are
|
|
71
|
-
* available in the `_` property of the returned object.
|
|
72
|
-
*
|
|
73
|
-
* By default, the flags module tries to determine the type of all arguments
|
|
74
|
-
* automatically and the return type of the `parse` method will have an index
|
|
75
|
-
* signature with `any` as value (`{ [x: string]: any }`).
|
|
76
|
-
*
|
|
77
|
-
* If the `string`, `boolean` or `collect` option is set, the return value of
|
|
78
|
-
* the `parse` method will be fully typed and the index signature of the return
|
|
79
|
-
* type will change to `{ [x: string]: unknown }`.
|
|
80
|
-
*
|
|
81
|
-
* Any arguments after `'--'` will not be parsed and will end up in `parsedArgs._`.
|
|
82
|
-
*
|
|
83
|
-
* Numeric-looking arguments will be returned as numbers unless `options.string`
|
|
84
|
-
* or `options.boolean` is set for that argument name.
|
|
85
|
-
*
|
|
86
|
-
* @example
|
|
87
|
-
* ```ts
|
|
88
|
-
* import { parse } from "https://deno.land/std@$STD_VERSION/flags/mod.ts";
|
|
89
|
-
* const parsedArgs = parse(Deno.args);
|
|
90
|
-
* ```
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
* ```ts
|
|
94
|
-
* import { parse } from "https://deno.land/std@$STD_VERSION/flags/mod.ts";
|
|
95
|
-
* const parsedArgs = parse(["--foo", "--bar=baz", "./quux.txt"]);
|
|
96
|
-
* // parsedArgs: { foo: true, bar: "baz", _: ["./quux.txt"] }
|
|
97
|
-
* ```
|
|
98
|
-
*/
|
|
99
|
-
function parse(args, { "--": doubleDash = false, alias = {}, boolean = false, default: defaults = {}, stopEarly = false, string = [], collect = [], negatable = [], unknown = (i) => i, } = {}) {
|
|
100
|
-
const aliases = {};
|
|
101
|
-
const flags = {
|
|
102
|
-
bools: {},
|
|
103
|
-
strings: {},
|
|
104
|
-
unknownFn: unknown,
|
|
105
|
-
allBools: false,
|
|
106
|
-
collect: {},
|
|
107
|
-
negatable: {},
|
|
108
|
-
};
|
|
109
|
-
if (alias !== undefined) {
|
|
110
|
-
for (const key in alias) {
|
|
111
|
-
const val = getForce(alias, key);
|
|
112
|
-
if (typeof val === "string") {
|
|
113
|
-
aliases[key] = [val];
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
aliases[key] = val;
|
|
117
|
-
}
|
|
118
|
-
for (const alias of getForce(aliases, key)) {
|
|
119
|
-
aliases[alias] = [key].concat(aliases[key].filter((y) => alias !== y));
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if (boolean !== undefined) {
|
|
124
|
-
if (typeof boolean === "boolean") {
|
|
125
|
-
flags.allBools = !!boolean;
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
const booleanArgs = typeof boolean === "string"
|
|
129
|
-
? [boolean]
|
|
130
|
-
: boolean;
|
|
131
|
-
for (const key of booleanArgs.filter(Boolean)) {
|
|
132
|
-
flags.bools[key] = true;
|
|
133
|
-
const alias = get(aliases, key);
|
|
134
|
-
if (alias) {
|
|
135
|
-
for (const al of alias) {
|
|
136
|
-
flags.bools[al] = true;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
if (string !== undefined) {
|
|
143
|
-
const stringArgs = typeof string === "string"
|
|
144
|
-
? [string]
|
|
145
|
-
: string;
|
|
146
|
-
for (const key of stringArgs.filter(Boolean)) {
|
|
147
|
-
flags.strings[key] = true;
|
|
148
|
-
const alias = get(aliases, key);
|
|
149
|
-
if (alias) {
|
|
150
|
-
for (const al of alias) {
|
|
151
|
-
flags.strings[al] = true;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
if (collect !== undefined) {
|
|
157
|
-
const collectArgs = typeof collect === "string"
|
|
158
|
-
? [collect]
|
|
159
|
-
: collect;
|
|
160
|
-
for (const key of collectArgs.filter(Boolean)) {
|
|
161
|
-
flags.collect[key] = true;
|
|
162
|
-
const alias = get(aliases, key);
|
|
163
|
-
if (alias) {
|
|
164
|
-
for (const al of alias) {
|
|
165
|
-
flags.collect[al] = true;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
if (negatable !== undefined) {
|
|
171
|
-
const negatableArgs = typeof negatable === "string"
|
|
172
|
-
? [negatable]
|
|
173
|
-
: negatable;
|
|
174
|
-
for (const key of negatableArgs.filter(Boolean)) {
|
|
175
|
-
flags.negatable[key] = true;
|
|
176
|
-
const alias = get(aliases, key);
|
|
177
|
-
if (alias) {
|
|
178
|
-
for (const al of alias) {
|
|
179
|
-
flags.negatable[al] = true;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
const argv = { _: [] };
|
|
185
|
-
function argDefined(key, arg) {
|
|
186
|
-
return ((flags.allBools && /^--[^=]+$/.test(arg)) ||
|
|
187
|
-
get(flags.bools, key) ||
|
|
188
|
-
!!get(flags.strings, key) ||
|
|
189
|
-
!!get(aliases, key));
|
|
190
|
-
}
|
|
191
|
-
function setKey(obj, name, value, collect = true) {
|
|
192
|
-
let o = obj;
|
|
193
|
-
const keys = name.split(".");
|
|
194
|
-
keys.slice(0, -1).forEach(function (key) {
|
|
195
|
-
if (get(o, key) === undefined) {
|
|
196
|
-
o[key] = {};
|
|
197
|
-
}
|
|
198
|
-
o = get(o, key);
|
|
199
|
-
});
|
|
200
|
-
const key = keys[keys.length - 1];
|
|
201
|
-
const collectable = collect && !!get(flags.collect, name);
|
|
202
|
-
if (!collectable) {
|
|
203
|
-
o[key] = value;
|
|
204
|
-
}
|
|
205
|
-
else if (get(o, key) === undefined) {
|
|
206
|
-
o[key] = [value];
|
|
207
|
-
}
|
|
208
|
-
else if (Array.isArray(get(o, key))) {
|
|
209
|
-
o[key].push(value);
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
o[key] = [get(o, key), value];
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
function setArg(key, val, arg = undefined, collect) {
|
|
216
|
-
if (arg && flags.unknownFn && !argDefined(key, arg)) {
|
|
217
|
-
if (flags.unknownFn(arg, key, val) === false)
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
const value = !get(flags.strings, key) && isNumber(val) ? Number(val) : val;
|
|
221
|
-
setKey(argv, key, value, collect);
|
|
222
|
-
const alias = get(aliases, key);
|
|
223
|
-
if (alias) {
|
|
224
|
-
for (const x of alias) {
|
|
225
|
-
setKey(argv, x, value, collect);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
function aliasIsBoolean(key) {
|
|
230
|
-
return getForce(aliases, key).some((x) => typeof get(flags.bools, x) === "boolean");
|
|
231
|
-
}
|
|
232
|
-
let notFlags = [];
|
|
233
|
-
// all args after "--" are not parsed
|
|
234
|
-
if (args.includes("--")) {
|
|
235
|
-
notFlags = args.slice(args.indexOf("--") + 1);
|
|
236
|
-
args = args.slice(0, args.indexOf("--"));
|
|
237
|
-
}
|
|
238
|
-
for (let i = 0; i < args.length; i++) {
|
|
239
|
-
const arg = args[i];
|
|
240
|
-
if (/^--.+=/.test(arg)) {
|
|
241
|
-
const m = arg.match(/^--([^=]+)=(.*)$/s);
|
|
242
|
-
(0, asserts_js_1.assert)(m != null);
|
|
243
|
-
const [, key, value] = m;
|
|
244
|
-
if (flags.bools[key]) {
|
|
245
|
-
const booleanValue = value !== "false";
|
|
246
|
-
setArg(key, booleanValue, arg);
|
|
247
|
-
}
|
|
248
|
-
else {
|
|
249
|
-
setArg(key, value, arg);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
else if (/^--no-.+/.test(arg) && get(flags.negatable, arg.replace(/^--no-/, ""))) {
|
|
253
|
-
const m = arg.match(/^--no-(.+)/);
|
|
254
|
-
(0, asserts_js_1.assert)(m != null);
|
|
255
|
-
setArg(m[1], false, arg, false);
|
|
256
|
-
}
|
|
257
|
-
else if (/^--.+/.test(arg)) {
|
|
258
|
-
const m = arg.match(/^--(.+)/);
|
|
259
|
-
(0, asserts_js_1.assert)(m != null);
|
|
260
|
-
const [, key] = m;
|
|
261
|
-
const next = args[i + 1];
|
|
262
|
-
if (next !== undefined &&
|
|
263
|
-
!/^-/.test(next) &&
|
|
264
|
-
!get(flags.bools, key) &&
|
|
265
|
-
!flags.allBools &&
|
|
266
|
-
(get(aliases, key) ? !aliasIsBoolean(key) : true)) {
|
|
267
|
-
setArg(key, next, arg);
|
|
268
|
-
i++;
|
|
269
|
-
}
|
|
270
|
-
else if (/^(true|false)$/.test(next)) {
|
|
271
|
-
setArg(key, next === "true", arg);
|
|
272
|
-
i++;
|
|
273
|
-
}
|
|
274
|
-
else {
|
|
275
|
-
setArg(key, get(flags.strings, key) ? "" : true, arg);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
else if (/^-[^-]+/.test(arg)) {
|
|
279
|
-
const letters = arg.slice(1, -1).split("");
|
|
280
|
-
let broken = false;
|
|
281
|
-
for (let j = 0; j < letters.length; j++) {
|
|
282
|
-
const next = arg.slice(j + 2);
|
|
283
|
-
if (next === "-") {
|
|
284
|
-
setArg(letters[j], next, arg);
|
|
285
|
-
continue;
|
|
286
|
-
}
|
|
287
|
-
if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {
|
|
288
|
-
setArg(letters[j], next.split(/=(.+)/)[1], arg);
|
|
289
|
-
broken = true;
|
|
290
|
-
break;
|
|
291
|
-
}
|
|
292
|
-
if (/[A-Za-z]/.test(letters[j]) &&
|
|
293
|
-
/-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
|
|
294
|
-
setArg(letters[j], next, arg);
|
|
295
|
-
broken = true;
|
|
296
|
-
break;
|
|
297
|
-
}
|
|
298
|
-
if (letters[j + 1] && letters[j + 1].match(/\W/)) {
|
|
299
|
-
setArg(letters[j], arg.slice(j + 2), arg);
|
|
300
|
-
broken = true;
|
|
301
|
-
break;
|
|
302
|
-
}
|
|
303
|
-
else {
|
|
304
|
-
setArg(letters[j], get(flags.strings, letters[j]) ? "" : true, arg);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
const [key] = arg.slice(-1);
|
|
308
|
-
if (!broken && key !== "-") {
|
|
309
|
-
if (args[i + 1] &&
|
|
310
|
-
!/^(-|--)[^-]/.test(args[i + 1]) &&
|
|
311
|
-
!get(flags.bools, key) &&
|
|
312
|
-
(get(aliases, key) ? !aliasIsBoolean(key) : true)) {
|
|
313
|
-
setArg(key, args[i + 1], arg);
|
|
314
|
-
i++;
|
|
315
|
-
}
|
|
316
|
-
else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
|
|
317
|
-
setArg(key, args[i + 1] === "true", arg);
|
|
318
|
-
i++;
|
|
319
|
-
}
|
|
320
|
-
else {
|
|
321
|
-
setArg(key, get(flags.strings, key) ? "" : true, arg);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
else {
|
|
326
|
-
if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
|
|
327
|
-
argv._.push(flags.strings["_"] ?? !isNumber(arg) ? arg : Number(arg));
|
|
328
|
-
}
|
|
329
|
-
if (stopEarly) {
|
|
330
|
-
argv._.push(...args.slice(i + 1));
|
|
331
|
-
break;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
for (const [key, value] of Object.entries(defaults)) {
|
|
336
|
-
if (!hasKey(argv, key.split("."))) {
|
|
337
|
-
setKey(argv, key, value, false);
|
|
338
|
-
if (aliases[key]) {
|
|
339
|
-
for (const x of aliases[key]) {
|
|
340
|
-
setKey(argv, x, value, false);
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
for (const key of Object.keys(flags.bools)) {
|
|
346
|
-
if (!hasKey(argv, key.split("."))) {
|
|
347
|
-
const value = get(flags.collect, key) ? [] : false;
|
|
348
|
-
setKey(argv, key, value, false);
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
for (const key of Object.keys(flags.strings)) {
|
|
352
|
-
if (!hasKey(argv, key.split(".")) && get(flags.collect, key)) {
|
|
353
|
-
setKey(argv, key, [], false);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
if (doubleDash) {
|
|
357
|
-
argv["--"] = [];
|
|
358
|
-
for (const key of notFlags) {
|
|
359
|
-
argv["--"].push(key);
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
else {
|
|
363
|
-
for (const key of notFlags) {
|
|
364
|
-
argv._.push(key);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
return argv;
|
|
368
|
-
}
|
|
369
|
-
exports.parse = parse;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { FormatInputPathObject } from "./_interface.js";
|
|
2
|
-
export declare function assertPath(path: string): void;
|
|
3
|
-
export declare function isPosixPathSeparator(code: number): boolean;
|
|
4
|
-
export declare function isPathSeparator(code: number): boolean;
|
|
5
|
-
export declare function isWindowsDeviceRoot(code: number): boolean;
|
|
6
|
-
export declare function normalizeString(path: string, allowAboveRoot: boolean, separator: string, isPathSeparator: (code: number) => boolean): string;
|
|
7
|
-
export declare function _format(sep: string, pathObject: FormatInputPathObject): string;
|
|
8
|
-
export declare function encodeWhitespace(string: string): string;
|
|
9
|
-
export declare function lastPathSegment(path: string, isSep: (char: number) => boolean, start?: number): string;
|
|
10
|
-
export declare function stripTrailingSeparators(segment: string, isSep: (char: number) => boolean): string;
|
|
11
|
-
export declare function stripSuffix(name: string, suffix: string): string;
|