structured-outputs 0.1.0-beta.1 → 0.1.0-beta.10
Sign up to get free protection for your applications and to get access to all the features.
- package/esm/F.js +1 -1
- package/esm/F.js.map +1 -1
- package/esm/_dnt.polyfills.js +124 -0
- package/esm/_dnt.polyfills.js.map +1 -0
- package/esm/_dnt.shims.js +62 -0
- package/esm/_dnt.shims.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/almost_equals.js +47 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/almost_equals.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/array_includes.js +47 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/array_includes.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/assert.js +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/assert.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/assertion_error.js +31 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/assertion_error.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/equal.js +137 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/equal.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/equals.js +46 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/equals.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/exists.js +28 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/exists.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/fail.js +21 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/fail.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/false.js +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/false.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/greater.js +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/greater.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/greater_or_equal.js +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/greater_or_equal.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/instance_of.js +53 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/instance_of.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/is_error.js +54 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/is_error.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/less.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/less.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/less_or_equal.js +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/less_or_equal.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/match.js +27 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/match.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/mod.js +46 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/mod.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/not_equals.js +33 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/not_equals.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/not_instance_of.js +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/not_instance_of.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/not_match.js +27 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/not_match.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/not_strict_equals.js +33 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/not_strict_equals.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/object_match.js +160 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/object_match.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/rejects.js +54 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/rejects.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/strict_equals.js +58 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/strict_equals.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/string_includes.js +27 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/string_includes.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/throws.js +45 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/throws.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/unimplemented.js +21 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/unimplemented.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/unreachable.js +21 -0
- package/esm/deps/jsr.io/@std/assert/1.0.7/unreachable.js.map +1 -0
- package/esm/deps/jsr.io/@std/cli/1.0.6/_data.js +18 -0
- package/esm/deps/jsr.io/@std/cli/1.0.6/_data.js.map +1 -0
- package/esm/deps/jsr.io/@std/cli/1.0.6/_run_length.js +35 -0
- package/esm/deps/jsr.io/@std/cli/1.0.6/_run_length.js.map +1 -0
- package/esm/deps/jsr.io/@std/cli/1.0.6/mod.js +19 -0
- package/esm/deps/jsr.io/@std/cli/1.0.6/mod.js.map +1 -0
- package/esm/deps/jsr.io/@std/cli/1.0.6/parse_args.js +306 -0
- package/esm/deps/jsr.io/@std/cli/1.0.6/parse_args.js.map +1 -0
- package/esm/deps/jsr.io/@std/cli/1.0.6/prompt_secret.js +87 -0
- package/esm/deps/jsr.io/@std/cli/1.0.6/prompt_secret.js.map +1 -0
- package/esm/deps/jsr.io/@std/cli/1.0.6/unicode_width.js +75 -0
- package/esm/deps/jsr.io/@std/cli/1.0.6/unicode_width.js.map +1 -0
- package/esm/deps/jsr.io/@std/dotenv/0.225.2/load.js +11 -0
- package/esm/deps/jsr.io/@std/dotenv/0.225.2/load.js.map +1 -0
- package/esm/deps/jsr.io/@std/dotenv/0.225.2/mod.js +213 -0
- package/esm/deps/jsr.io/@std/dotenv/0.225.2/mod.js.map +1 -0
- package/esm/deps/jsr.io/@std/dotenv/0.225.2/parse.js +75 -0
- package/esm/deps/jsr.io/@std/dotenv/0.225.2/parse.js.map +1 -0
- package/esm/deps/jsr.io/@std/dotenv/0.225.2/stringify.js +45 -0
- package/esm/deps/jsr.io/@std/dotenv/0.225.2/stringify.js.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/_create_walk_entry.js +35 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/_create_walk_entry.js.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/_get_file_info_type.js +19 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/_get_file_info_type.js.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/_is_same_path.js +18 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/_is_same_path.js.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/_is_subdir.js +26 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/_is_subdir.js.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/_to_path_string.js +14 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/_to_path_string.js.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/copy.js +315 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/copy.js.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/empty_dir.js +88 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/empty_dir.js.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/ensure_dir.js +103 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/ensure_dir.js.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/ensure_file.js +91 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/ensure_file.js.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/ensure_link.js +62 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/ensure_link.js.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/ensure_symlink.js +122 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/ensure_symlink.js.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/eol.js +67 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/eol.js.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/exists.js +272 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/exists.js.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/expand_glob.js +417 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/expand_glob.js.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/mod.js +30 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/mod.js.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/move.js +142 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/move.js.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/walk.js +847 -0
- package/esm/deps/jsr.io/@std/fs/1.0.5/walk.js.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.js +111 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.js.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.js +277 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.js.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.js +180 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.js.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.js +38 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.js.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.js +208 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.js.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.js +3 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/assert_path.js +8 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/assert_path.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/basename.js +41 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/basename.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/common.js +24 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/common.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/constants.js +47 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/constants.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/dirname.js +9 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/dirname.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/format.js +20 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/format.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/from_file_url.js +10 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/from_file_url.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/glob_to_reg_exp.js +235 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/glob_to_reg_exp.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/normalize.js +9 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/normalize.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/normalize_string.js +78 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/normalize_string.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/relative.js +10 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/relative.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/strip_trailing_separators.js +20 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/strip_trailing_separators.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/to_file_url.js +16 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/to_file_url.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_os.js +10 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/_os.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/basename.js +37 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/basename.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/common.js +34 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/common.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/constants.js +18 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/constants.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/dirname.js +30 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/dirname.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/extname.js +30 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/extname.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/format.js +28 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/format.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/from_file_url.js +29 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/from_file_url.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/glob_to_regexp.js +84 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/glob_to_regexp.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/is_absolute.js +29 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/is_absolute.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/is_glob.js +43 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/is_glob.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/join.js +30 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/join.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/join_globs.js +35 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/join_globs.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/mod.js +58 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/mod.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/normalize.js +34 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/normalize.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/normalize_glob.js +36 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/normalize_glob.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/parse.js +40 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/parse.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/_util.js +9 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/_util.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/basename.js +50 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/basename.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/constants.js +15 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/constants.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/dirname.js +63 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/dirname.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/extname.js +90 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/extname.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/format.js +29 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/format.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/from_file_url.js +22 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/from_file_url.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/glob_to_regexp.js +83 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/glob_to_regexp.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/is_absolute.js +24 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/is_absolute.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/join.js +43 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/join.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/join_globs.js +41 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/join_globs.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/normalize.js +58 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/normalize.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/normalize_glob.js +33 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/normalize_glob.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/parse.js +116 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/parse.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/relative.js +107 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/relative.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/resolve.js +60 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/resolve.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/to_file_url.js +28 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/to_file_url.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/to_namespaced_path.js +21 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/to_namespaced_path.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/relative.js +31 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/relative.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/resolve.js +31 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/resolve.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/to_file_url.js +29 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/to_file_url.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/to_namespaced_path.js +30 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/to_namespaced_path.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/types.js +4 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/types.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/_util.js +16 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/_util.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/basename.js +45 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/basename.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/constants.js +15 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/constants.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/dirname.js +113 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/dirname.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/extname.js +82 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/extname.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/format.js +29 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/format.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/from_file_url.js +31 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/from_file_url.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/glob_to_regexp.js +83 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/glob_to_regexp.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/is_absolute.js +39 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/is_absolute.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/join.js +75 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/join.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/join_globs.js +42 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/join_globs.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/normalize.js +135 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/normalize.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/normalize_glob.js +33 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/normalize_glob.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/parse.js +177 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/parse.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/relative.js +132 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/relative.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/resolve.js +155 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/resolve.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/to_file_url.js +35 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/to_file_url.js.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/to_namespaced_path.js +50 -0
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/to_namespaced_path.js.map +1 -0
- package/esm/main.js +80 -0
- package/esm/main.js.map +1 -0
- package/esm/mod.js +1 -0
- package/esm/mod.js.map +1 -1
- package/esm/util/displayCompletion.js +9 -0
- package/esm/util/displayCompletion.js.map +1 -0
- package/package.json +13 -3
- package/src/F.ts +9 -2
- package/src/_dnt.polyfills.ts +172 -0
- package/src/_dnt.shims.ts +64 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/almost_equals.ts +55 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/array_includes.ts +57 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/assert.ts +23 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/assertion_error.ts +31 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/equal.ts +152 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/equals.ts +52 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/exists.ts +31 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/fail.ts +21 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/false.ts +26 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/greater.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/greater_or_equal.ts +36 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/instance_of.ts +64 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/is_error.ts +65 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/less.ts +29 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/less_or_equal.ts +36 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/mod.ts +47 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/not_equals.ts +36 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/not_instance_of.ts +33 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/not_match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/not_strict_equals.ts +42 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/object_match.ts +202 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/rejects.ts +123 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/strict_equals.ts +67 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/string_includes.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/throws.ts +111 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/unimplemented.ts +21 -0
- package/src/deps/jsr.io/@std/assert/1.0.7/unreachable.ts +21 -0
- package/src/deps/jsr.io/@std/cli/1.0.6/_data.js +17 -0
- package/src/deps/jsr.io/@std/cli/1.0.6/_run_length.ts +41 -0
- package/src/deps/jsr.io/@std/cli/1.0.6/mod.ts +20 -0
- package/src/deps/jsr.io/@std/cli/1.0.6/parse_args.ts +776 -0
- package/src/deps/jsr.io/@std/cli/1.0.6/prompt_secret.ts +102 -0
- package/src/deps/jsr.io/@std/cli/1.0.6/unicode_width.ts +79 -0
- package/src/deps/jsr.io/@std/dotenv/0.225.2/load.ts +14 -0
- package/src/deps/jsr.io/@std/dotenv/0.225.2/mod.ts +251 -0
- package/src/deps/jsr.io/@std/dotenv/0.225.2/parse.ts +113 -0
- package/src/deps/jsr.io/@std/dotenv/0.225.2/stringify.ts +47 -0
- package/src/deps/jsr.io/@std/fs/1.0.5/_create_walk_entry.ts +47 -0
- package/src/deps/jsr.io/@std/fs/1.0.5/_get_file_info_type.ts +25 -0
- package/src/deps/jsr.io/@std/fs/1.0.5/_is_same_path.ts +23 -0
- package/src/deps/jsr.io/@std/fs/1.0.5/_is_subdir.ts +34 -0
- package/src/deps/jsr.io/@std/fs/1.0.5/_to_path_string.ts +17 -0
- package/src/deps/jsr.io/@std/fs/1.0.5/copy.ts +413 -0
- package/src/deps/jsr.io/@std/fs/1.0.5/empty_dir.ts +91 -0
- package/src/deps/jsr.io/@std/fs/1.0.5/ensure_dir.ts +110 -0
- package/src/deps/jsr.io/@std/fs/1.0.5/ensure_file.ts +100 -0
- package/src/deps/jsr.io/@std/fs/1.0.5/ensure_link.ts +66 -0
- package/src/deps/jsr.io/@std/fs/1.0.5/ensure_symlink.ts +145 -0
- package/src/deps/jsr.io/@std/fs/1.0.5/eol.ts +74 -0
- package/src/deps/jsr.io/@std/fs/1.0.5/exists.ts +316 -0
- package/src/deps/jsr.io/@std/fs/1.0.5/expand_glob.ts +538 -0
- package/src/deps/jsr.io/@std/fs/1.0.5/mod.ts +31 -0
- package/src/deps/jsr.io/@std/fs/1.0.5/move.ts +171 -0
- package/src/deps/jsr.io/@std/fs/1.0.5/walk.ts +956 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/build_message.ts +134 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/diff.ts +317 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/diff_str.ts +204 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/format.ts +39 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/styles.ts +233 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/types.ts +18 -0
- package/src/deps/jsr.io/@std/path/1.0.8/_common/assert_path.ts +10 -0
- package/src/deps/jsr.io/@std/path/1.0.8/_common/basename.ts +53 -0
- package/src/deps/jsr.io/@std/path/1.0.8/_common/common.ts +26 -0
- package/src/deps/jsr.io/@std/path/1.0.8/_common/constants.ts +49 -0
- package/src/deps/jsr.io/@std/path/1.0.8/_common/dirname.ts +9 -0
- package/src/deps/jsr.io/@std/path/1.0.8/_common/format.ts +25 -0
- package/src/deps/jsr.io/@std/path/1.0.8/_common/from_file_url.ts +12 -0
- package/src/deps/jsr.io/@std/path/1.0.8/_common/glob_to_reg_exp.ts +290 -0
- package/src/deps/jsr.io/@std/path/1.0.8/_common/normalize.ts +9 -0
- package/src/deps/jsr.io/@std/path/1.0.8/_common/normalize_string.ts +74 -0
- package/src/deps/jsr.io/@std/path/1.0.8/_common/relative.ts +10 -0
- package/src/deps/jsr.io/@std/path/1.0.8/_common/strip_trailing_separators.ts +25 -0
- package/src/deps/jsr.io/@std/path/1.0.8/_common/to_file_url.ts +17 -0
- package/src/deps/jsr.io/@std/path/1.0.8/_os.ts +12 -0
- package/src/deps/jsr.io/@std/path/1.0.8/basename.ts +38 -0
- package/src/deps/jsr.io/@std/path/1.0.8/common.ts +35 -0
- package/src/deps/jsr.io/@std/path/1.0.8/constants.ts +18 -0
- package/src/deps/jsr.io/@std/path/1.0.8/dirname.ts +31 -0
- package/src/deps/jsr.io/@std/path/1.0.8/extname.ts +30 -0
- package/src/deps/jsr.io/@std/path/1.0.8/format.ts +30 -0
- package/src/deps/jsr.io/@std/path/1.0.8/from_file_url.ts +30 -0
- package/src/deps/jsr.io/@std/path/1.0.8/glob_to_regexp.ts +94 -0
- package/src/deps/jsr.io/@std/path/1.0.8/is_absolute.ts +30 -0
- package/src/deps/jsr.io/@std/path/1.0.8/is_glob.ts +49 -0
- package/src/deps/jsr.io/@std/path/1.0.8/join.ts +31 -0
- package/src/deps/jsr.io/@std/path/1.0.8/join_globs.ts +42 -0
- package/src/deps/jsr.io/@std/path/1.0.8/mod.ts +58 -0
- package/src/deps/jsr.io/@std/path/1.0.8/normalize.ts +34 -0
- package/src/deps/jsr.io/@std/path/1.0.8/normalize_glob.ts +45 -0
- package/src/deps/jsr.io/@std/path/1.0.8/parse.ts +44 -0
- package/src/deps/jsr.io/@std/path/1.0.8/posix/_util.ts +10 -0
- package/src/deps/jsr.io/@std/path/1.0.8/posix/basename.ts +59 -0
- package/src/deps/jsr.io/@std/path/1.0.8/posix/constants.ts +15 -0
- package/src/deps/jsr.io/@std/path/1.0.8/posix/dirname.ts +70 -0
- package/src/deps/jsr.io/@std/path/1.0.8/posix/extname.ts +92 -0
- package/src/deps/jsr.io/@std/path/1.0.8/posix/format.ts +31 -0
- package/src/deps/jsr.io/@std/path/1.0.8/posix/from_file_url.ts +25 -0
- package/src/deps/jsr.io/@std/path/1.0.8/posix/glob_to_regexp.ts +94 -0
- package/src/deps/jsr.io/@std/path/1.0.8/posix/is_absolute.ts +25 -0
- package/src/deps/jsr.io/@std/path/1.0.8/posix/join.ts +43 -0
- package/src/deps/jsr.io/@std/path/1.0.8/posix/join_globs.ts +45 -0
- package/src/deps/jsr.io/@std/path/1.0.8/posix/normalize.ts +62 -0
- package/src/deps/jsr.io/@std/path/1.0.8/posix/normalize_glob.ts +43 -0
- package/src/deps/jsr.io/@std/path/1.0.8/posix/parse.ts +121 -0
- package/src/deps/jsr.io/@std/path/1.0.8/posix/relative.ts +103 -0
- package/src/deps/jsr.io/@std/path/1.0.8/posix/resolve.ts +71 -0
- package/src/deps/jsr.io/@std/path/1.0.8/posix/to_file_url.ts +32 -0
- package/src/deps/jsr.io/@std/path/1.0.8/posix/to_namespaced_path.ts +21 -0
- package/src/deps/jsr.io/@std/path/1.0.8/relative.ts +32 -0
- package/src/deps/jsr.io/@std/path/1.0.8/resolve.ts +32 -0
- package/src/deps/jsr.io/@std/path/1.0.8/to_file_url.ts +30 -0
- package/src/deps/jsr.io/@std/path/1.0.8/to_namespaced_path.ts +31 -0
- package/src/deps/jsr.io/@std/path/1.0.8/types.ts +40 -0
- package/src/deps/jsr.io/@std/path/1.0.8/windows/_util.ts +28 -0
- package/src/deps/jsr.io/@std/path/1.0.8/windows/basename.ts +51 -0
- package/src/deps/jsr.io/@std/path/1.0.8/windows/constants.ts +15 -0
- package/src/deps/jsr.io/@std/path/1.0.8/windows/dirname.ts +117 -0
- package/src/deps/jsr.io/@std/path/1.0.8/windows/extname.ts +89 -0
- package/src/deps/jsr.io/@std/path/1.0.8/windows/format.ts +31 -0
- package/src/deps/jsr.io/@std/path/1.0.8/windows/from_file_url.ts +34 -0
- package/src/deps/jsr.io/@std/path/1.0.8/windows/glob_to_regexp.ts +92 -0
- package/src/deps/jsr.io/@std/path/1.0.8/windows/is_absolute.ts +40 -0
- package/src/deps/jsr.io/@std/path/1.0.8/windows/join.ts +75 -0
- package/src/deps/jsr.io/@std/path/1.0.8/windows/join_globs.ts +46 -0
- package/src/deps/jsr.io/@std/path/1.0.8/windows/normalize.ts +135 -0
- package/src/deps/jsr.io/@std/path/1.0.8/windows/normalize_glob.ts +43 -0
- package/src/deps/jsr.io/@std/path/1.0.8/windows/parse.ts +184 -0
- package/src/deps/jsr.io/@std/path/1.0.8/windows/relative.ts +128 -0
- package/src/deps/jsr.io/@std/path/1.0.8/windows/resolve.ts +178 -0
- package/src/deps/jsr.io/@std/path/1.0.8/windows/to_file_url.ts +38 -0
- package/src/deps/jsr.io/@std/path/1.0.8/windows/to_namespaced_path.ts +60 -0
- package/src/main.ts +106 -0
- package/src/mod.ts +2 -7
- package/src/util/displayCompletion.ts +12 -0
- package/{esm → types}/F.d.ts +2 -1
- package/{esm → types}/F.d.ts.map +1 -1
- package/types/_dnt.polyfills.d.ts +19 -0
- package/types/_dnt.polyfills.d.ts.map +1 -0
- package/types/_dnt.shims.d.ts +6 -0
- package/types/_dnt.shims.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/almost_equals.d.ts +29 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/almost_equals.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/array_includes.d.ts +24 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/array_includes.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/assert.d.ts +16 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/assert.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/assertion_error.d.ts +26 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/assertion_error.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/equal.d.ts +17 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/equal.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/equals.d.ts +22 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/equals.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/exists.d.ts +18 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/exists.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/fail.d.ts +15 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/fail.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/false.d.ts +18 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/false.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/greater.d.ts +20 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/greater.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/greater_or_equal.d.ts +20 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/greater_or_equal.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/instance_of.d.ts +23 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/instance_of.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/is_error.d.ts +25 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/is_error.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/less.d.ts +19 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/less.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/less_or_equal.d.ts +20 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/less_or_equal.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/match.d.ts +18 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/match.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/mod.d.ts +44 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/mod.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/not_equals.d.ts +21 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/not_equals.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/not_instance_of.d.ts +20 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/not_instance_of.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/not_match.d.ts +18 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/not_match.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/not_strict_equals.d.ts +23 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/not_strict_equals.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/object_match.d.ts +28 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/object_match.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/rejects.d.ts +42 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/rejects.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/strict_equals.d.ts +24 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/strict_equals.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/string_includes.d.ts +18 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/string_includes.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/throws.d.ts +45 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/throws.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/unimplemented.d.ts +15 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/unimplemented.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/unreachable.d.ts +15 -0
- package/types/deps/jsr.io/@std/assert/1.0.7/unreachable.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/cli/1.0.6/_data.d.ts +9 -0
- package/types/deps/jsr.io/@std/cli/1.0.6/_data.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/cli/1.0.6/_run_length.d.ts +9 -0
- package/types/deps/jsr.io/@std/cli/1.0.6/_run_length.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/cli/1.0.6/mod.d.ts +18 -0
- package/types/deps/jsr.io/@std/cli/1.0.6/mod.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/cli/1.0.6/parse_args.d.ts +229 -0
- package/types/deps/jsr.io/@std/cli/1.0.6/parse_args.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/cli/1.0.6/prompt_secret.d.ts +28 -0
- package/types/deps/jsr.io/@std/cli/1.0.6/prompt_secret.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/cli/1.0.6/unicode_width.d.ts +40 -0
- package/types/deps/jsr.io/@std/cli/1.0.6/unicode_width.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/dotenv/0.225.2/load.d.ts +2 -0
- package/types/deps/jsr.io/@std/dotenv/0.225.2/load.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/dotenv/0.225.2/mod.d.ts +164 -0
- package/types/deps/jsr.io/@std/dotenv/0.225.2/mod.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/dotenv/0.225.2/parse.d.ts +19 -0
- package/types/deps/jsr.io/@std/dotenv/0.225.2/parse.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/dotenv/0.225.2/stringify.d.ts +17 -0
- package/types/deps/jsr.io/@std/dotenv/0.225.2/stringify.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/_create_walk_entry.d.ts +14 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/_create_walk_entry.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/_get_file_info_type.d.ts +13 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/_get_file_info_type.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/_is_same_path.d.ts +10 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/_is_same_path.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/_is_subdir.d.ts +12 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/_is_subdir.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/_to_path_string.d.ts +9 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/_to_path_string.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/copy.d.ts +117 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/copy.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/empty_dir.d.ts +48 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/empty_dir.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/ensure_dir.d.ts +49 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/ensure_dir.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/ensure_file.d.ts +47 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/ensure_file.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/ensure_link.d.ts +49 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/ensure_link.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/ensure_symlink.d.ts +52 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/ensure_symlink.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/eol.d.ts +52 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/eol.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/exists.d.ts +218 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/exists.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/expand_glob.d.ts +267 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/expand_glob.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/mod.d.ts +29 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/mod.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/move.d.ts +86 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/move.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/walk.d.ts +777 -0
- package/types/deps/jsr.io/@std/fs/1.0.5/walk.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +82 -0
- package/types/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +140 -0
- package/types/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +99 -0
- package/types/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/internal/1.0.5/format.d.ts +2 -0
- package/types/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +159 -0
- package/types/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/internal/1.0.5/types.d.ts +16 -0
- package/types/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/assert_path.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/assert_path.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/basename.d.ts +4 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/basename.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/common.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/common.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/constants.d.ts +40 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/constants.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/dirname.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/dirname.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/format.d.ts +4 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/format.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/from_file_url.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/from_file_url.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/glob_to_reg_exp.d.ts +35 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/glob_to_reg_exp.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/normalize.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/normalize.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/normalize_string.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/normalize_string.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/relative.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/relative.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/strip_trailing_separators.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/strip_trailing_separators.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/to_file_url.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_common/to_file_url.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_os.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.0.8/_os.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/basename.d.ts +28 -0
- package/types/deps/jsr.io/@std/path/1.0.8/basename.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/common.d.ts +28 -0
- package/types/deps/jsr.io/@std/path/1.0.8/common.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/constants.d.ts +15 -0
- package/types/deps/jsr.io/@std/path/1.0.8/constants.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/dirname.d.ts +23 -0
- package/types/deps/jsr.io/@std/path/1.0.8/dirname.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/extname.d.ts +23 -0
- package/types/deps/jsr.io/@std/path/1.0.8/extname.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/format.d.ts +22 -0
- package/types/deps/jsr.io/@std/path/1.0.8/format.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/from_file_url.d.ts +22 -0
- package/types/deps/jsr.io/@std/path/1.0.8/from_file_url.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/glob_to_regexp.d.ts +77 -0
- package/types/deps/jsr.io/@std/path/1.0.8/glob_to_regexp.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/is_absolute.d.ts +22 -0
- package/types/deps/jsr.io/@std/path/1.0.8/is_absolute.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/is_glob.d.ts +17 -0
- package/types/deps/jsr.io/@std/path/1.0.8/is_glob.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/join.d.ts +23 -0
- package/types/deps/jsr.io/@std/path/1.0.8/join.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/join_globs.d.ts +28 -0
- package/types/deps/jsr.io/@std/path/1.0.8/join_globs.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/mod.d.ts +54 -0
- package/types/deps/jsr.io/@std/path/1.0.8/mod.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/normalize.d.ts +27 -0
- package/types/deps/jsr.io/@std/path/1.0.8/normalize.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/normalize_glob.d.ts +29 -0
- package/types/deps/jsr.io/@std/path/1.0.8/normalize_glob.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/parse.d.ts +35 -0
- package/types/deps/jsr.io/@std/path/1.0.8/parse.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/_util.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/_util.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/basename.d.ts +40 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/basename.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/constants.d.ts +13 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/constants.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/dirname.d.ts +32 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/dirname.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/extname.d.ts +37 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/extname.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/format.d.ts +24 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/format.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/from_file_url.d.ts +16 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/from_file_url.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/glob_to_regexp.d.ts +72 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/glob_to_regexp.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/is_absolute.d.ts +17 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/is_absolute.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/join.d.ts +33 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/join.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/join_globs.d.ts +20 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/join_globs.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/normalize.d.ts +40 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/normalize.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/normalize_glob.d.ts +20 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/normalize_glob.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/parse.d.ts +25 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/parse.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/relative.d.ts +20 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/relative.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/resolve.d.ts +17 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/resolve.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/to_file_url.d.ts +17 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/to_file_url.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/to_namespaced_path.d.ts +16 -0
- package/types/deps/jsr.io/@std/path/1.0.8/posix/to_namespaced_path.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/relative.d.ts +24 -0
- package/types/deps/jsr.io/@std/path/1.0.8/relative.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/resolve.d.ts +22 -0
- package/types/deps/jsr.io/@std/path/1.0.8/resolve.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/to_file_url.d.ts +22 -0
- package/types/deps/jsr.io/@std/path/1.0.8/to_file_url.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/to_namespaced_path.d.ts +21 -0
- package/types/deps/jsr.io/@std/path/1.0.8/to_namespaced_path.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/types.d.ts +38 -0
- package/types/deps/jsr.io/@std/path/1.0.8/types.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/_util.d.ts +4 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/_util.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/basename.d.ts +23 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/basename.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/constants.d.ts +13 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/constants.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/dirname.d.ts +20 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/dirname.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/extname.d.ts +20 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/extname.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/format.d.ts +24 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/format.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/from_file_url.d.ts +18 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/from_file_url.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/glob_to_regexp.d.ts +71 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/glob_to_regexp.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/is_absolute.d.ts +17 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/is_absolute.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/join.d.ts +20 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/join.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/join_globs.d.ts +21 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/join_globs.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/normalize.d.ts +22 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/normalize.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/normalize_glob.d.ts +20 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/normalize_glob.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/parse.d.ts +25 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/parse.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/relative.d.ts +23 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/relative.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/resolve.d.ts +17 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/resolve.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/to_file_url.d.ts +17 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/to_file_url.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/to_namespaced_path.d.ts +17 -0
- package/types/deps/jsr.io/@std/path/1.0.8/windows/to_namespaced_path.d.ts.map +1 -0
- package/types/main.d.ts +4 -0
- package/types/main.d.ts.map +1 -0
- package/{esm → types}/mod.d.ts +1 -5
- package/types/mod.d.ts.map +1 -0
- package/types/util/displayCompletion.d.ts +3 -0
- package/types/util/displayCompletion.d.ts.map +1 -0
- package/esm/mod.d.ts.map +0 -1
- /package/{esm → types}/ResponseFormat.d.ts +0 -0
- /package/{esm → types}/ResponseFormat.d.ts.map +0 -0
- /package/{esm → types}/_base.d.ts +0 -0
- /package/{esm → types}/_base.d.ts.map +0 -0
- /package/{esm → types}/array.d.ts +0 -0
- /package/{esm → types}/array.d.ts.map +0 -0
- /package/{esm → types}/common.d.ts +0 -0
- /package/{esm → types}/common.d.ts.map +0 -0
- /package/{esm → types}/literal.d.ts +0 -0
- /package/{esm → types}/literal.d.ts.map +0 -0
- /package/{esm → types}/number.d.ts +0 -0
- /package/{esm → types}/number.d.ts.map +0 -0
- /package/{esm → types}/object.d.ts +0 -0
- /package/{esm → types}/object.d.ts.map +0 -0
- /package/{esm → types}/schema.d.ts +0 -0
- /package/{esm → types}/schema.d.ts.map +0 -0
- /package/{esm → types}/string.d.ts +0 -0
- /package/{esm → types}/string.d.ts.map +0 -0
- /package/{esm → types}/union.d.ts +0 -0
- /package/{esm → types}/union.d.ts.map +0 -0
@@ -0,0 +1,776 @@
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
+
// This module is browser compatible.
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Command line arguments parser based on
|
6
|
+
* {@link https://github.com/minimistjs/minimist | minimist}.
|
7
|
+
*
|
8
|
+
* @example
|
9
|
+
* ```ts
|
10
|
+
* import { parseArgs } from "@std/cli/parse-args";
|
11
|
+
*
|
12
|
+
* console.dir(parseArgs(Deno.args));
|
13
|
+
* ```
|
14
|
+
*
|
15
|
+
* @module
|
16
|
+
*/
|
17
|
+
|
18
|
+
/** Combines recursively all intersection types and returns a new single type.
|
19
|
+
* @internal
|
20
|
+
*/
|
21
|
+
type Id<TRecord> = TRecord extends Record<string, unknown>
|
22
|
+
? TRecord extends infer InferredRecord
|
23
|
+
? { [Key in keyof InferredRecord]: Id<InferredRecord[Key]> }
|
24
|
+
: never
|
25
|
+
: TRecord;
|
26
|
+
|
27
|
+
/** Converts a union type `A | B | C` into an intersection type `A & B & C`.
|
28
|
+
* @internal
|
29
|
+
*/
|
30
|
+
type UnionToIntersection<TValue> =
|
31
|
+
(TValue extends unknown ? (args: TValue) => unknown : never) extends
|
32
|
+
(args: infer R) => unknown ? R extends Record<string, unknown> ? R : never
|
33
|
+
: never;
|
34
|
+
|
35
|
+
/** @internal */
|
36
|
+
type BooleanType = boolean | string | undefined;
|
37
|
+
/** @internal */
|
38
|
+
type StringType = string | undefined;
|
39
|
+
/** @internal */
|
40
|
+
type ArgType = StringType | BooleanType;
|
41
|
+
|
42
|
+
/** @internal */
|
43
|
+
type Collectable = string | undefined;
|
44
|
+
/** @internal */
|
45
|
+
type Negatable = string | undefined;
|
46
|
+
|
47
|
+
type UseTypes<
|
48
|
+
TBooleans extends BooleanType,
|
49
|
+
TStrings extends StringType,
|
50
|
+
TCollectable extends Collectable,
|
51
|
+
> = undefined extends (
|
52
|
+
& (false extends TBooleans ? undefined : TBooleans)
|
53
|
+
& TCollectable
|
54
|
+
& TStrings
|
55
|
+
) ? false
|
56
|
+
: true;
|
57
|
+
|
58
|
+
/**
|
59
|
+
* Creates a record with all available flags with the corresponding type and
|
60
|
+
* default type.
|
61
|
+
* @internal
|
62
|
+
*/
|
63
|
+
type Values<
|
64
|
+
TBooleans extends BooleanType,
|
65
|
+
TStrings extends StringType,
|
66
|
+
TCollectable extends Collectable,
|
67
|
+
TNegatable extends Negatable,
|
68
|
+
TDefault extends Record<string, unknown> | undefined,
|
69
|
+
TAliases extends Aliases | undefined,
|
70
|
+
> = UseTypes<TBooleans, TStrings, TCollectable> extends true ?
|
71
|
+
& Record<string, unknown>
|
72
|
+
& AddAliases<
|
73
|
+
SpreadDefaults<
|
74
|
+
& CollectValues<TStrings, string, TCollectable, TNegatable>
|
75
|
+
& RecursiveRequired<CollectValues<TBooleans, boolean, TCollectable>>
|
76
|
+
& CollectUnknownValues<
|
77
|
+
TBooleans,
|
78
|
+
TStrings,
|
79
|
+
TCollectable,
|
80
|
+
TNegatable
|
81
|
+
>,
|
82
|
+
DedotRecord<TDefault>
|
83
|
+
>,
|
84
|
+
TAliases
|
85
|
+
>
|
86
|
+
// deno-lint-ignore no-explicit-any
|
87
|
+
: Record<string, any>;
|
88
|
+
|
89
|
+
/** @internal */
|
90
|
+
type Aliases<TArgNames = string, TAliasNames extends string = string> = Partial<
|
91
|
+
Record<Extract<TArgNames, string>, TAliasNames | ReadonlyArray<TAliasNames>>
|
92
|
+
>;
|
93
|
+
|
94
|
+
type AddAliases<
|
95
|
+
TArgs,
|
96
|
+
TAliases extends Aliases | undefined,
|
97
|
+
> = {
|
98
|
+
[TArgName in keyof TArgs as AliasNames<TArgName, TAliases>]: TArgs[TArgName];
|
99
|
+
};
|
100
|
+
|
101
|
+
type AliasNames<
|
102
|
+
TArgName,
|
103
|
+
TAliases extends Aliases | undefined,
|
104
|
+
> = TArgName extends keyof TAliases
|
105
|
+
? string extends TAliases[TArgName] ? TArgName
|
106
|
+
: TAliases[TArgName] extends string ? TArgName | TAliases[TArgName]
|
107
|
+
: TAliases[TArgName] extends Array<string>
|
108
|
+
? TArgName | TAliases[TArgName][number]
|
109
|
+
: TArgName
|
110
|
+
: TArgName;
|
111
|
+
|
112
|
+
/**
|
113
|
+
* Spreads all default values of Record `TDefaults` into Record `TArgs`
|
114
|
+
* and makes default values required.
|
115
|
+
*
|
116
|
+
* **Example:**
|
117
|
+
* `SpreadValues<{ foo?: boolean, bar?: number }, { foo: number }>`
|
118
|
+
*
|
119
|
+
* **Result:** `{ foo: boolean | number, bar?: number }`
|
120
|
+
*/
|
121
|
+
type SpreadDefaults<TArgs, TDefaults> = TDefaults extends undefined ? TArgs
|
122
|
+
: TArgs extends Record<string, unknown> ?
|
123
|
+
& Omit<TArgs, keyof TDefaults>
|
124
|
+
& {
|
125
|
+
[Default in keyof TDefaults]: Default extends keyof TArgs
|
126
|
+
? (TArgs[Default] & TDefaults[Default] | TDefaults[Default]) extends
|
127
|
+
Record<string, unknown>
|
128
|
+
? NonNullable<SpreadDefaults<TArgs[Default], TDefaults[Default]>>
|
129
|
+
: TDefaults[Default] | NonNullable<TArgs[Default]>
|
130
|
+
: unknown;
|
131
|
+
}
|
132
|
+
: never;
|
133
|
+
|
134
|
+
/**
|
135
|
+
* Defines the Record for the `default` option to add
|
136
|
+
* auto-suggestion support for IDE's.
|
137
|
+
* @internal
|
138
|
+
*/
|
139
|
+
type Defaults<TBooleans extends BooleanType, TStrings extends StringType> = Id<
|
140
|
+
UnionToIntersection<
|
141
|
+
& Record<string, unknown>
|
142
|
+
// Dedotted auto suggestions: { foo: { bar: unknown } }
|
143
|
+
& MapTypes<TStrings, unknown>
|
144
|
+
& MapTypes<TBooleans, unknown>
|
145
|
+
// Flat auto suggestions: { "foo.bar": unknown }
|
146
|
+
& MapDefaults<TBooleans>
|
147
|
+
& MapDefaults<TStrings>
|
148
|
+
>
|
149
|
+
>;
|
150
|
+
|
151
|
+
type MapDefaults<TArgNames extends ArgType> = Partial<
|
152
|
+
Record<TArgNames extends string ? TArgNames : string, unknown>
|
153
|
+
>;
|
154
|
+
|
155
|
+
type RecursiveRequired<TRecord> = TRecord extends Record<string, unknown> ? {
|
156
|
+
[Key in keyof TRecord]-?: RecursiveRequired<TRecord[Key]>;
|
157
|
+
}
|
158
|
+
: TRecord;
|
159
|
+
|
160
|
+
/** Same as `MapTypes` but also supports collectable options. */
|
161
|
+
type CollectValues<
|
162
|
+
TArgNames extends ArgType,
|
163
|
+
TType,
|
164
|
+
TCollectable extends Collectable,
|
165
|
+
TNegatable extends Negatable = undefined,
|
166
|
+
> = UnionToIntersection<
|
167
|
+
Extract<TArgNames, TCollectable> extends string ?
|
168
|
+
& (Exclude<TArgNames, TCollectable> extends never ? Record<never, never>
|
169
|
+
: MapTypes<Exclude<TArgNames, TCollectable>, TType, TNegatable>)
|
170
|
+
& (Extract<TArgNames, TCollectable> extends never ? Record<never, never>
|
171
|
+
: RecursiveRequired<
|
172
|
+
MapTypes<Extract<TArgNames, TCollectable>, Array<TType>, TNegatable>
|
173
|
+
>)
|
174
|
+
: MapTypes<TArgNames, TType, TNegatable>
|
175
|
+
>;
|
176
|
+
|
177
|
+
/** Same as `Record` but also supports dotted and negatable options. */
|
178
|
+
type MapTypes<
|
179
|
+
TArgNames extends ArgType,
|
180
|
+
TType,
|
181
|
+
TNegatable extends Negatable = undefined,
|
182
|
+
> = undefined extends TArgNames ? Record<never, never>
|
183
|
+
: TArgNames extends `${infer Name}.${infer Rest}` ? {
|
184
|
+
[Key in Name]?: MapTypes<
|
185
|
+
Rest,
|
186
|
+
TType,
|
187
|
+
TNegatable extends `${Name}.${infer Negate}` ? Negate : undefined
|
188
|
+
>;
|
189
|
+
}
|
190
|
+
: TArgNames extends string ? Partial<
|
191
|
+
Record<TArgNames, TNegatable extends TArgNames ? TType | false : TType>
|
192
|
+
>
|
193
|
+
: Record<never, never>;
|
194
|
+
|
195
|
+
type CollectUnknownValues<
|
196
|
+
TBooleans extends BooleanType,
|
197
|
+
TStrings extends StringType,
|
198
|
+
TCollectable extends Collectable,
|
199
|
+
TNegatable extends Negatable,
|
200
|
+
> = UnionToIntersection<
|
201
|
+
TCollectable extends TBooleans & TStrings ? Record<never, never>
|
202
|
+
: DedotRecord<
|
203
|
+
// Unknown collectable & non-negatable args.
|
204
|
+
& Record<
|
205
|
+
Exclude<
|
206
|
+
Extract<Exclude<TCollectable, TNegatable>, string>,
|
207
|
+
Extract<TStrings | TBooleans, string>
|
208
|
+
>,
|
209
|
+
Array<unknown>
|
210
|
+
>
|
211
|
+
// Unknown collectable & negatable args.
|
212
|
+
& Record<
|
213
|
+
Exclude<
|
214
|
+
Extract<Extract<TCollectable, TNegatable>, string>,
|
215
|
+
Extract<TStrings | TBooleans, string>
|
216
|
+
>,
|
217
|
+
Array<unknown> | false
|
218
|
+
>
|
219
|
+
>
|
220
|
+
>;
|
221
|
+
|
222
|
+
/** Converts `{ "foo.bar.baz": unknown }` into `{ foo: { bar: { baz: unknown } } }`. */
|
223
|
+
type DedotRecord<TRecord> = Record<string, unknown> extends TRecord ? TRecord
|
224
|
+
: TRecord extends Record<string, unknown> ? UnionToIntersection<
|
225
|
+
ValueOf<
|
226
|
+
{
|
227
|
+
[Key in keyof TRecord]: Key extends string ? Dedot<Key, TRecord[Key]>
|
228
|
+
: never;
|
229
|
+
}
|
230
|
+
>
|
231
|
+
>
|
232
|
+
: TRecord;
|
233
|
+
|
234
|
+
type Dedot<TKey extends string, TValue> = TKey extends
|
235
|
+
`${infer Name}.${infer Rest}` ? { [Key in Name]: Dedot<Rest, TValue> }
|
236
|
+
: { [Key in TKey]: TValue };
|
237
|
+
|
238
|
+
type ValueOf<TValue> = TValue[keyof TValue];
|
239
|
+
|
240
|
+
/** The value returned from {@linkcode parseArgs}. */
|
241
|
+
export type Args<
|
242
|
+
// deno-lint-ignore no-explicit-any
|
243
|
+
TArgs extends Record<string, unknown> = Record<string, any>,
|
244
|
+
TDoubleDash extends boolean | undefined = undefined,
|
245
|
+
> = Id<
|
246
|
+
& TArgs
|
247
|
+
& {
|
248
|
+
/** Contains all the arguments that didn't have an option associated with
|
249
|
+
* them. */
|
250
|
+
_: Array<string | number>;
|
251
|
+
}
|
252
|
+
& (boolean extends TDoubleDash ? DoubleDash
|
253
|
+
: true extends TDoubleDash ? Required<DoubleDash>
|
254
|
+
: Record<never, never>)
|
255
|
+
>;
|
256
|
+
|
257
|
+
/** @internal */
|
258
|
+
type DoubleDash = {
|
259
|
+
/** Contains all the arguments that appear after the double dash: "--". */
|
260
|
+
"--"?: Array<string>;
|
261
|
+
};
|
262
|
+
|
263
|
+
/** Options for {@linkcode parseArgs}. */
|
264
|
+
export interface ParseOptions<
|
265
|
+
TBooleans extends BooleanType = BooleanType,
|
266
|
+
TStrings extends StringType = StringType,
|
267
|
+
TCollectable extends Collectable = Collectable,
|
268
|
+
TNegatable extends Negatable = Negatable,
|
269
|
+
TDefault extends Record<string, unknown> | undefined =
|
270
|
+
| Record<string, unknown>
|
271
|
+
| undefined,
|
272
|
+
TAliases extends Aliases | undefined = Aliases | undefined,
|
273
|
+
TDoubleDash extends boolean | undefined = boolean | undefined,
|
274
|
+
> {
|
275
|
+
/**
|
276
|
+
* When `true`, populate the result `_` with everything before the `--` and
|
277
|
+
* the result `['--']` with everything after the `--`.
|
278
|
+
*
|
279
|
+
* @default {false}
|
280
|
+
*
|
281
|
+
* @example
|
282
|
+
* ```ts
|
283
|
+
* // $ deno run example.ts -- a arg1
|
284
|
+
* import { parseArgs } from "@std/cli/parse-args";
|
285
|
+
* console.dir(parseArgs(Deno.args, { "--": false }));
|
286
|
+
* // output: { _: [ "a", "arg1" ] }
|
287
|
+
* console.dir(parseArgs(Deno.args, { "--": true }));
|
288
|
+
* // output: { _: [], --: [ "a", "arg1" ] }
|
289
|
+
* ```
|
290
|
+
*/
|
291
|
+
"--"?: TDoubleDash;
|
292
|
+
|
293
|
+
/**
|
294
|
+
* An object mapping string names to strings or arrays of string argument
|
295
|
+
* names to use as aliases.
|
296
|
+
*
|
297
|
+
* @default {{}}
|
298
|
+
*/
|
299
|
+
alias?: TAliases;
|
300
|
+
|
301
|
+
/**
|
302
|
+
* A boolean, string or array of strings to always treat as booleans. If
|
303
|
+
* `true` will treat all double hyphenated arguments without equal signs as
|
304
|
+
* `boolean` (e.g. affects `--foo`, not `-f` or `--foo=bar`).
|
305
|
+
* All `boolean` arguments will be set to `false` by default.
|
306
|
+
*
|
307
|
+
* @default {false}
|
308
|
+
*/
|
309
|
+
boolean?: TBooleans | ReadonlyArray<Extract<TBooleans, string>>;
|
310
|
+
|
311
|
+
/**
|
312
|
+
* An object mapping string argument names to default values.
|
313
|
+
*
|
314
|
+
* @default {{}}
|
315
|
+
*/
|
316
|
+
default?: TDefault & Defaults<TBooleans, TStrings>;
|
317
|
+
|
318
|
+
/**
|
319
|
+
* When `true`, populate the result `_` with everything after the first
|
320
|
+
* non-option.
|
321
|
+
*
|
322
|
+
* @default {false}
|
323
|
+
*/
|
324
|
+
stopEarly?: boolean;
|
325
|
+
|
326
|
+
/**
|
327
|
+
* A string or array of strings argument names to always treat as strings.
|
328
|
+
*
|
329
|
+
* @default {[]}
|
330
|
+
*/
|
331
|
+
string?: TStrings | ReadonlyArray<Extract<TStrings, string>>;
|
332
|
+
|
333
|
+
/**
|
334
|
+
* A string or array of strings argument names to always treat as arrays.
|
335
|
+
* Collectable options can be used multiple times. All values will be
|
336
|
+
* collected into one array. If a non-collectable option is used multiple
|
337
|
+
* times, the last value is used.
|
338
|
+
*
|
339
|
+
* @default {[]}
|
340
|
+
*/
|
341
|
+
collect?: TCollectable | ReadonlyArray<Extract<TCollectable, string>>;
|
342
|
+
|
343
|
+
/**
|
344
|
+
* A string or array of strings argument names which can be negated
|
345
|
+
* by prefixing them with `--no-`, like `--no-config`.
|
346
|
+
*
|
347
|
+
* @default {[]}
|
348
|
+
*/
|
349
|
+
negatable?: TNegatable | ReadonlyArray<Extract<TNegatable, string>>;
|
350
|
+
|
351
|
+
/**
|
352
|
+
* A function which is invoked with a command line parameter not defined in
|
353
|
+
* the `options` configuration object. If the function returns `false`, the
|
354
|
+
* unknown option is not added to `parsedArgs`.
|
355
|
+
*
|
356
|
+
* @default {unknown}
|
357
|
+
*/
|
358
|
+
unknown?: (arg: string, key?: string, value?: unknown) => unknown;
|
359
|
+
}
|
360
|
+
|
361
|
+
interface NestedMapping {
|
362
|
+
[key: string]: NestedMapping | unknown;
|
363
|
+
}
|
364
|
+
|
365
|
+
const FLAG_REGEXP =
|
366
|
+
/^(?:-(?:(?<doubleDash>-)(?<negated>no-)?)?)(?<key>.+?)(?:=(?<value>.+?))?$/s;
|
367
|
+
const LETTER_REGEXP = /[A-Za-z]/;
|
368
|
+
const NUMBER_REGEXP = /-?\d+(\.\d*)?(e-?\d+)?$/;
|
369
|
+
const HYPHEN_REGEXP = /^(-|--)[^-]/;
|
370
|
+
const VALUE_REGEXP = /=(?<value>.+)/;
|
371
|
+
const FLAG_NAME_REGEXP = /^--[^=]+$/;
|
372
|
+
const SPECIAL_CHAR_REGEXP = /\W/;
|
373
|
+
|
374
|
+
const NON_WHITESPACE_REGEXP = /\S/;
|
375
|
+
|
376
|
+
function isNumber(string: string): boolean {
|
377
|
+
return NON_WHITESPACE_REGEXP.test(string) && Number.isFinite(Number(string));
|
378
|
+
}
|
379
|
+
|
380
|
+
function setNested(
|
381
|
+
object: NestedMapping,
|
382
|
+
keys: string[],
|
383
|
+
value: unknown,
|
384
|
+
collect = false,
|
385
|
+
) {
|
386
|
+
keys = [...keys];
|
387
|
+
const key = keys.pop()!;
|
388
|
+
|
389
|
+
keys.forEach((key) => object = (object[key] ??= {}) as NestedMapping);
|
390
|
+
|
391
|
+
if (collect) {
|
392
|
+
const v = object[key];
|
393
|
+
if (Array.isArray(v)) {
|
394
|
+
v.push(value);
|
395
|
+
return;
|
396
|
+
}
|
397
|
+
|
398
|
+
value = v ? [v, value] : [value];
|
399
|
+
}
|
400
|
+
|
401
|
+
object[key] = value;
|
402
|
+
}
|
403
|
+
|
404
|
+
function hasNested(object: NestedMapping, keys: string[]): boolean {
|
405
|
+
for (const key of keys) {
|
406
|
+
const value = object[key];
|
407
|
+
if (!Object.hasOwn(object, key)) return false;
|
408
|
+
object = value as NestedMapping;
|
409
|
+
}
|
410
|
+
return true;
|
411
|
+
}
|
412
|
+
|
413
|
+
function aliasIsBoolean(
|
414
|
+
aliasMap: Map<string, Set<string>>,
|
415
|
+
booleanSet: Set<string>,
|
416
|
+
key: string,
|
417
|
+
): boolean {
|
418
|
+
const set = aliasMap.get(key);
|
419
|
+
if (set === undefined) return false;
|
420
|
+
for (const alias of set) if (booleanSet.has(alias)) return true;
|
421
|
+
return false;
|
422
|
+
}
|
423
|
+
|
424
|
+
function isBooleanString(value: string) {
|
425
|
+
return value === "true" || value === "false";
|
426
|
+
}
|
427
|
+
|
428
|
+
function parseBooleanString(value: unknown) {
|
429
|
+
return value !== "false";
|
430
|
+
}
|
431
|
+
|
432
|
+
/**
|
433
|
+
* Take a set of command line arguments, optionally with a set of options, and
|
434
|
+
* return an object representing the flags found in the passed arguments.
|
435
|
+
*
|
436
|
+
* By default, any arguments starting with `-` or `--` are considered boolean
|
437
|
+
* flags. If the argument name is followed by an equal sign (`=`) it is
|
438
|
+
* considered a key-value pair. Any arguments which could not be parsed are
|
439
|
+
* available in the `_` property of the returned object.
|
440
|
+
*
|
441
|
+
* By default, this module tries to determine the type of all arguments
|
442
|
+
* automatically and the return type of this function will have an index
|
443
|
+
* signature with `any` as value (`{ [x: string]: any }`).
|
444
|
+
*
|
445
|
+
* If the `string`, `boolean` or `collect` option is set, the return value of
|
446
|
+
* this function will be fully typed and the index signature of the return
|
447
|
+
* type will change to `{ [x: string]: unknown }`.
|
448
|
+
*
|
449
|
+
* Any arguments after `'--'` will not be parsed and will end up in `parsedArgs._`.
|
450
|
+
*
|
451
|
+
* Numeric-looking arguments will be returned as numbers unless `options.string`
|
452
|
+
* or `options.boolean` is set for that argument name.
|
453
|
+
*
|
454
|
+
* @param args An array of command line arguments.
|
455
|
+
* @param options Options for the parse function.
|
456
|
+
*
|
457
|
+
* @typeParam TArgs Type of result.
|
458
|
+
* @typeParam TDoubleDash Used by `TArgs` for the result.
|
459
|
+
* @typeParam TBooleans Used by `TArgs` for the result.
|
460
|
+
* @typeParam TStrings Used by `TArgs` for the result.
|
461
|
+
* @typeParam TCollectable Used by `TArgs` for the result.
|
462
|
+
* @typeParam TNegatable Used by `TArgs` for the result.
|
463
|
+
* @typeParam TDefaults Used by `TArgs` for the result.
|
464
|
+
* @typeParam TAliases Used by `TArgs` for the result.
|
465
|
+
* @typeParam TAliasArgNames Used by `TArgs` for the result.
|
466
|
+
* @typeParam TAliasNames Used by `TArgs` for the result.
|
467
|
+
*
|
468
|
+
* @return The parsed arguments.
|
469
|
+
*
|
470
|
+
* @example Usage
|
471
|
+
* ```ts
|
472
|
+
* import { parseArgs } from "@std/cli/parse-args";
|
473
|
+
* import { assertEquals } from "@std/assert";
|
474
|
+
*
|
475
|
+
* // For proper use, one should use `parseArgs(Deno.args)`
|
476
|
+
* assertEquals(parseArgs(["--foo", "--bar=baz", "./quux.txt"]), {
|
477
|
+
* foo: true,
|
478
|
+
* bar: "baz",
|
479
|
+
* _: ["./quux.txt"],
|
480
|
+
* });
|
481
|
+
* ```
|
482
|
+
*/
|
483
|
+
export function parseArgs<
|
484
|
+
TArgs extends Values<
|
485
|
+
TBooleans,
|
486
|
+
TStrings,
|
487
|
+
TCollectable,
|
488
|
+
TNegatable,
|
489
|
+
TDefaults,
|
490
|
+
TAliases
|
491
|
+
>,
|
492
|
+
TDoubleDash extends boolean | undefined = undefined,
|
493
|
+
TBooleans extends BooleanType = undefined,
|
494
|
+
TStrings extends StringType = undefined,
|
495
|
+
TCollectable extends Collectable = undefined,
|
496
|
+
TNegatable extends Negatable = undefined,
|
497
|
+
TDefaults extends Record<string, unknown> | undefined = undefined,
|
498
|
+
TAliases extends Aliases<TAliasArgNames, TAliasNames> | undefined = undefined,
|
499
|
+
TAliasArgNames extends string = string,
|
500
|
+
TAliasNames extends string = string,
|
501
|
+
>(
|
502
|
+
args: string[],
|
503
|
+
options?: ParseOptions<
|
504
|
+
TBooleans,
|
505
|
+
TStrings,
|
506
|
+
TCollectable,
|
507
|
+
TNegatable,
|
508
|
+
TDefaults,
|
509
|
+
TAliases,
|
510
|
+
TDoubleDash
|
511
|
+
>,
|
512
|
+
): Args<TArgs, TDoubleDash> {
|
513
|
+
const {
|
514
|
+
"--": doubleDash = false,
|
515
|
+
alias = {} as NonNullable<TAliases>,
|
516
|
+
boolean = false,
|
517
|
+
default: defaults = {} as TDefaults & Defaults<TBooleans, TStrings>,
|
518
|
+
stopEarly = false,
|
519
|
+
string = [],
|
520
|
+
collect = [],
|
521
|
+
negatable = [],
|
522
|
+
unknown: unknownFn = (i: string): unknown => i,
|
523
|
+
} = options ?? {};
|
524
|
+
const aliasMap: Map<string, Set<string>> = new Map();
|
525
|
+
const booleanSet = new Set<string>();
|
526
|
+
const stringSet = new Set<string>();
|
527
|
+
const collectSet = new Set<string>();
|
528
|
+
const negatableSet = new Set<string>();
|
529
|
+
|
530
|
+
let allBools = false;
|
531
|
+
|
532
|
+
if (alias) {
|
533
|
+
for (const [key, value] of Object.entries(alias)) {
|
534
|
+
if (value === undefined) {
|
535
|
+
throw new TypeError("Alias value must be defined");
|
536
|
+
}
|
537
|
+
const aliases = Array.isArray(value) ? value : [value];
|
538
|
+
aliasMap.set(key, new Set(aliases));
|
539
|
+
aliases.forEach((alias) =>
|
540
|
+
aliasMap.set(
|
541
|
+
alias,
|
542
|
+
new Set([key, ...aliases.filter((it) => it !== alias)]),
|
543
|
+
)
|
544
|
+
);
|
545
|
+
}
|
546
|
+
}
|
547
|
+
|
548
|
+
if (boolean) {
|
549
|
+
if (typeof boolean === "boolean") {
|
550
|
+
allBools = boolean;
|
551
|
+
} else {
|
552
|
+
const booleanArgs = Array.isArray(boolean) ? boolean : [boolean];
|
553
|
+
for (const key of booleanArgs.filter(Boolean)) {
|
554
|
+
booleanSet.add(key);
|
555
|
+
aliasMap.get(key)?.forEach((al) => {
|
556
|
+
booleanSet.add(al);
|
557
|
+
});
|
558
|
+
}
|
559
|
+
}
|
560
|
+
}
|
561
|
+
|
562
|
+
if (string) {
|
563
|
+
const stringArgs = Array.isArray(string) ? string : [string];
|
564
|
+
for (const key of stringArgs.filter(Boolean)) {
|
565
|
+
stringSet.add(key);
|
566
|
+
aliasMap.get(key)?.forEach((al) => stringSet.add(al));
|
567
|
+
}
|
568
|
+
}
|
569
|
+
|
570
|
+
if (collect) {
|
571
|
+
const collectArgs = Array.isArray(collect) ? collect : [collect];
|
572
|
+
for (const key of collectArgs.filter(Boolean)) {
|
573
|
+
collectSet.add(key);
|
574
|
+
aliasMap.get(key)?.forEach((al) => collectSet.add(al));
|
575
|
+
}
|
576
|
+
}
|
577
|
+
|
578
|
+
if (negatable) {
|
579
|
+
const negatableArgs = Array.isArray(negatable) ? negatable : [negatable];
|
580
|
+
for (const key of negatableArgs.filter(Boolean)) {
|
581
|
+
negatableSet.add(key);
|
582
|
+
aliasMap.get(key)?.forEach((alias) => negatableSet.add(alias));
|
583
|
+
}
|
584
|
+
}
|
585
|
+
|
586
|
+
const argv: Args = { _: [] };
|
587
|
+
|
588
|
+
function setArgument(
|
589
|
+
key: string,
|
590
|
+
value: string | number | boolean,
|
591
|
+
arg: string,
|
592
|
+
collect: boolean,
|
593
|
+
) {
|
594
|
+
if (
|
595
|
+
!booleanSet.has(key) &&
|
596
|
+
!stringSet.has(key) &&
|
597
|
+
!aliasMap.has(key) &&
|
598
|
+
!(allBools && FLAG_NAME_REGEXP.test(arg)) &&
|
599
|
+
unknownFn?.(arg, key, value) === false
|
600
|
+
) {
|
601
|
+
return;
|
602
|
+
}
|
603
|
+
|
604
|
+
if (typeof value === "string" && !stringSet.has(key)) {
|
605
|
+
value = isNumber(value) ? Number(value) : value;
|
606
|
+
}
|
607
|
+
|
608
|
+
const collectable = collect && collectSet.has(key);
|
609
|
+
setNested(argv, key.split("."), value, collectable);
|
610
|
+
aliasMap.get(key)?.forEach((key) => {
|
611
|
+
setNested(argv, key.split("."), value, collectable);
|
612
|
+
});
|
613
|
+
}
|
614
|
+
|
615
|
+
let notFlags: string[] = [];
|
616
|
+
|
617
|
+
// all args after "--" are not parsed
|
618
|
+
const index = args.indexOf("--");
|
619
|
+
if (index !== -1) {
|
620
|
+
notFlags = args.slice(index + 1);
|
621
|
+
args = args.slice(0, index);
|
622
|
+
}
|
623
|
+
|
624
|
+
argsLoop:
|
625
|
+
for (let i = 0; i < args.length; i++) {
|
626
|
+
const arg = args[i]!;
|
627
|
+
|
628
|
+
const groups = arg.match(FLAG_REGEXP)?.groups;
|
629
|
+
|
630
|
+
if (groups) {
|
631
|
+
const { doubleDash, negated } = groups;
|
632
|
+
let key = groups.key!;
|
633
|
+
let value: string | number | boolean | undefined = groups.value;
|
634
|
+
|
635
|
+
if (doubleDash) {
|
636
|
+
if (value) {
|
637
|
+
if (booleanSet.has(key)) value = parseBooleanString(value);
|
638
|
+
setArgument(key, value, arg, true);
|
639
|
+
continue;
|
640
|
+
}
|
641
|
+
|
642
|
+
if (negated) {
|
643
|
+
if (negatableSet.has(key)) {
|
644
|
+
setArgument(key, false, arg, false);
|
645
|
+
continue;
|
646
|
+
}
|
647
|
+
key = `no-${key}`;
|
648
|
+
}
|
649
|
+
|
650
|
+
const next = args[i + 1];
|
651
|
+
|
652
|
+
if (next) {
|
653
|
+
if (
|
654
|
+
!booleanSet.has(key) &&
|
655
|
+
!allBools &&
|
656
|
+
!next.startsWith("-") &&
|
657
|
+
(!aliasMap.has(key) || !aliasIsBoolean(aliasMap, booleanSet, key))
|
658
|
+
) {
|
659
|
+
value = next;
|
660
|
+
i++;
|
661
|
+
setArgument(key, value, arg, true);
|
662
|
+
continue;
|
663
|
+
}
|
664
|
+
|
665
|
+
if (isBooleanString(next)) {
|
666
|
+
value = parseBooleanString(next);
|
667
|
+
i++;
|
668
|
+
setArgument(key, value, arg, true);
|
669
|
+
continue;
|
670
|
+
}
|
671
|
+
}
|
672
|
+
|
673
|
+
value = stringSet.has(key) ? "" : true;
|
674
|
+
setArgument(key, value, arg, true);
|
675
|
+
continue;
|
676
|
+
}
|
677
|
+
const letters = arg.slice(1, -1).split("");
|
678
|
+
|
679
|
+
for (const [j, letter] of letters.entries()) {
|
680
|
+
const next = arg.slice(j + 2);
|
681
|
+
|
682
|
+
if (next === "-") {
|
683
|
+
setArgument(letter, next, arg, true);
|
684
|
+
continue;
|
685
|
+
}
|
686
|
+
|
687
|
+
if (LETTER_REGEXP.test(letter)) {
|
688
|
+
const groups = VALUE_REGEXP.exec(next)?.groups;
|
689
|
+
if (groups) {
|
690
|
+
setArgument(letter, groups.value!, arg, true);
|
691
|
+
continue argsLoop;
|
692
|
+
}
|
693
|
+
if (NUMBER_REGEXP.test(next)) {
|
694
|
+
setArgument(letter, next, arg, true);
|
695
|
+
continue argsLoop;
|
696
|
+
}
|
697
|
+
}
|
698
|
+
|
699
|
+
if (letters[j + 1]?.match(SPECIAL_CHAR_REGEXP)) {
|
700
|
+
setArgument(letter, arg.slice(j + 2), arg, true);
|
701
|
+
continue argsLoop;
|
702
|
+
}
|
703
|
+
setArgument(letter, stringSet.has(letter) ? "" : true, arg, true);
|
704
|
+
}
|
705
|
+
|
706
|
+
key = arg.slice(-1);
|
707
|
+
if (key === "-") continue;
|
708
|
+
|
709
|
+
const nextArg = args[i + 1];
|
710
|
+
|
711
|
+
if (nextArg) {
|
712
|
+
if (
|
713
|
+
!HYPHEN_REGEXP.test(nextArg) &&
|
714
|
+
!booleanSet.has(key) &&
|
715
|
+
(!aliasMap.has(key) || !aliasIsBoolean(aliasMap, booleanSet, key))
|
716
|
+
) {
|
717
|
+
setArgument(key, nextArg, arg, true);
|
718
|
+
i++;
|
719
|
+
continue;
|
720
|
+
}
|
721
|
+
if (isBooleanString(nextArg)) {
|
722
|
+
const value = parseBooleanString(nextArg);
|
723
|
+
setArgument(key, value, arg, true);
|
724
|
+
i++;
|
725
|
+
continue;
|
726
|
+
}
|
727
|
+
}
|
728
|
+
setArgument(key, stringSet.has(key) ? "" : true, arg, true);
|
729
|
+
continue;
|
730
|
+
}
|
731
|
+
|
732
|
+
if (unknownFn?.(arg) !== false) {
|
733
|
+
argv._.push(
|
734
|
+
stringSet.has("_") || !isNumber(arg) ? arg : Number(arg),
|
735
|
+
);
|
736
|
+
}
|
737
|
+
|
738
|
+
if (stopEarly) {
|
739
|
+
argv._.push(...args.slice(i + 1));
|
740
|
+
break;
|
741
|
+
}
|
742
|
+
}
|
743
|
+
|
744
|
+
for (const [key, value] of Object.entries(defaults)) {
|
745
|
+
const keys = key.split(".");
|
746
|
+
if (!hasNested(argv, keys)) {
|
747
|
+
setNested(argv, keys, value);
|
748
|
+
aliasMap.get(key)?.forEach((key) =>
|
749
|
+
setNested(argv, key.split("."), value)
|
750
|
+
);
|
751
|
+
}
|
752
|
+
}
|
753
|
+
|
754
|
+
for (const key of booleanSet.keys()) {
|
755
|
+
const keys = key.split(".");
|
756
|
+
if (!hasNested(argv, keys)) {
|
757
|
+
const value = collectSet.has(key) ? [] : false;
|
758
|
+
setNested(argv, keys, value);
|
759
|
+
}
|
760
|
+
}
|
761
|
+
|
762
|
+
for (const key of stringSet.keys()) {
|
763
|
+
const keys = key.split(".");
|
764
|
+
if (!hasNested(argv, keys) && collectSet.has(key)) {
|
765
|
+
setNested(argv, keys, []);
|
766
|
+
}
|
767
|
+
}
|
768
|
+
|
769
|
+
if (doubleDash) {
|
770
|
+
argv["--"] = notFlags;
|
771
|
+
} else {
|
772
|
+
argv._.push(...notFlags);
|
773
|
+
}
|
774
|
+
|
775
|
+
return argv as Args<TArgs, TDoubleDash>;
|
776
|
+
}
|