structured-outputs 0.1.0-beta.7 → 0.1.0-beta.9
Sign up to get free protection for your applications and to get access to all the features.
- 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 +12 -3
- 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 -0
- package/src/util/displayCompletion.ts +12 -0
- 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 -0
- 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}/F.d.ts +0 -0
- /package/{esm → types}/F.d.ts.map +0 -0
- /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,100 @@
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
+
import * as dntShim from "../../../../../_dnt.shims.js";
|
3
|
+
|
4
|
+
import { dirname } from "../../path/1.0.8/dirname.js";
|
5
|
+
import { ensureDir, ensureDirSync } from "./ensure_dir.js";
|
6
|
+
import { getFileInfoType } from "./_get_file_info_type.js";
|
7
|
+
import { toPathString } from "./_to_path_string.js";
|
8
|
+
|
9
|
+
/**
|
10
|
+
* Asynchronously ensures that the file exists.
|
11
|
+
*
|
12
|
+
* If the file already exists, this function does nothing. If the parent
|
13
|
+
* directories for the file do not exist, they are created.
|
14
|
+
*
|
15
|
+
* Requires `--allow-read` and `--allow-write` permissions.
|
16
|
+
*
|
17
|
+
* @see {@link https://docs.deno.com/runtime/manual/basics/permissions#file-system-access}
|
18
|
+
* for more information on Deno's permissions system.
|
19
|
+
*
|
20
|
+
* @param filePath The path of the file to ensure, as a string or URL.
|
21
|
+
*
|
22
|
+
* @returns A void promise that resolves once the file exists.
|
23
|
+
*
|
24
|
+
* @example Usage
|
25
|
+
* ```ts ignore
|
26
|
+
* import { ensureFile } from "@std/fs/ensure-file";
|
27
|
+
*
|
28
|
+
* await ensureFile("./folder/targetFile.dat");
|
29
|
+
* ```
|
30
|
+
*/
|
31
|
+
export async function ensureFile(filePath: string | URL): Promise<void> {
|
32
|
+
try {
|
33
|
+
// if file exists
|
34
|
+
const stat = await dntShim.Deno.lstat(filePath);
|
35
|
+
if (!stat.isFile) {
|
36
|
+
throw new Error(
|
37
|
+
`Failed to ensure file exists: expected 'file', got '${
|
38
|
+
getFileInfoType(stat)
|
39
|
+
}'`,
|
40
|
+
);
|
41
|
+
}
|
42
|
+
} catch (err) {
|
43
|
+
// if file not exists
|
44
|
+
if (err instanceof dntShim.Deno.errors.NotFound) {
|
45
|
+
// ensure dir exists
|
46
|
+
await ensureDir(dirname(toPathString(filePath)));
|
47
|
+
// create file
|
48
|
+
await dntShim.Deno.writeFile(filePath, new Uint8Array());
|
49
|
+
return;
|
50
|
+
}
|
51
|
+
|
52
|
+
throw err;
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
/**
|
57
|
+
* Synchronously ensures that the file exists.
|
58
|
+
*
|
59
|
+
* If the file already exists, this function does nothing. If the parent
|
60
|
+
* directories for the file do not exist, they are created.
|
61
|
+
*
|
62
|
+
* Requires `--allow-read` and `--allow-write` permissions.
|
63
|
+
*
|
64
|
+
* @see {@link https://docs.deno.com/runtime/manual/basics/permissions#file-system-access}
|
65
|
+
* for more information on Deno's permissions system.
|
66
|
+
*
|
67
|
+
* @param filePath The path of the file to ensure, as a string or URL.
|
68
|
+
*
|
69
|
+
* @returns A void value that returns once the file exists.
|
70
|
+
*
|
71
|
+
* @example Usage
|
72
|
+
* ```ts ignore
|
73
|
+
* import { ensureFileSync } from "@std/fs/ensure-file";
|
74
|
+
*
|
75
|
+
* ensureFileSync("./folder/targetFile.dat");
|
76
|
+
* ```
|
77
|
+
*/
|
78
|
+
export function ensureFileSync(filePath: string | URL): void {
|
79
|
+
try {
|
80
|
+
// if file exists
|
81
|
+
const stat = dntShim.Deno.lstatSync(filePath);
|
82
|
+
if (!stat.isFile) {
|
83
|
+
throw new Error(
|
84
|
+
`Failed to ensure file exists: expected 'file', got '${
|
85
|
+
getFileInfoType(stat)
|
86
|
+
}'`,
|
87
|
+
);
|
88
|
+
}
|
89
|
+
} catch (err) {
|
90
|
+
// if file not exists
|
91
|
+
if (err instanceof dntShim.Deno.errors.NotFound) {
|
92
|
+
// ensure dir exists
|
93
|
+
ensureDirSync(dirname(toPathString(filePath)));
|
94
|
+
// create file
|
95
|
+
dntShim.Deno.writeFileSync(filePath, new Uint8Array());
|
96
|
+
return;
|
97
|
+
}
|
98
|
+
throw err;
|
99
|
+
}
|
100
|
+
}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
+
import * as dntShim from "../../../../../_dnt.shims.js";
|
3
|
+
|
4
|
+
import { dirname } from "../../path/1.0.8/dirname.js";
|
5
|
+
import { ensureDir, ensureDirSync } from "./ensure_dir.js";
|
6
|
+
import { toPathString } from "./_to_path_string.js";
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Asynchronously ensures that the hard link exists.
|
10
|
+
*
|
11
|
+
* If the parent directories for the hard link do not exist, they are created.
|
12
|
+
*
|
13
|
+
* Requires `--allow-read` and `--allow-write` permissions.
|
14
|
+
*
|
15
|
+
* @see {@link https://docs.deno.com/runtime/manual/basics/permissions#file-system-access}
|
16
|
+
* for more information on Deno's permissions system.
|
17
|
+
*
|
18
|
+
* @param src The source file path as a string or URL. Directory hard links are
|
19
|
+
* not allowed.
|
20
|
+
* @param dest The destination link path as a string or URL.
|
21
|
+
*
|
22
|
+
* @returns A void promise that resolves once the hard link exists.
|
23
|
+
*
|
24
|
+
* @example Usage
|
25
|
+
* ```ts ignore
|
26
|
+
* import { ensureLink } from "@std/fs/ensure-link";
|
27
|
+
*
|
28
|
+
* await ensureLink("./folder/targetFile.dat", "./folder/targetFile.link.dat");
|
29
|
+
* ```
|
30
|
+
*/
|
31
|
+
export async function ensureLink(src: string | URL, dest: string | URL) {
|
32
|
+
dest = toPathString(dest);
|
33
|
+
await ensureDir(dirname(dest));
|
34
|
+
|
35
|
+
await dntShim.Deno.link(toPathString(src), dest);
|
36
|
+
}
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Synchronously ensures that the hard link exists.
|
40
|
+
*
|
41
|
+
* If the parent directories for the hard link do not exist, they are created.
|
42
|
+
*
|
43
|
+
* Requires `--allow-read` and `--allow-write` permissions.
|
44
|
+
*
|
45
|
+
* @see {@link https://docs.deno.com/runtime/manual/basics/permissions#file-system-access}
|
46
|
+
* for more information on Deno's permissions system.
|
47
|
+
*
|
48
|
+
* @param src The source file path as a string or URL. Directory hard links are
|
49
|
+
* not allowed.
|
50
|
+
* @param dest The destination link path as a string or URL.
|
51
|
+
*
|
52
|
+
* @returns A void value that returns once the hard link exists.
|
53
|
+
*
|
54
|
+
* @example Usage
|
55
|
+
* ```ts ignore
|
56
|
+
* import { ensureLinkSync } from "@std/fs/ensure-link";
|
57
|
+
*
|
58
|
+
* ensureLinkSync("./folder/targetFile.dat", "./folder/targetFile.link.dat");
|
59
|
+
* ```
|
60
|
+
*/
|
61
|
+
export function ensureLinkSync(src: string | URL, dest: string | URL) {
|
62
|
+
dest = toPathString(dest);
|
63
|
+
ensureDirSync(dirname(dest));
|
64
|
+
|
65
|
+
dntShim.Deno.linkSync(toPathString(src), dest);
|
66
|
+
}
|
@@ -0,0 +1,145 @@
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
+
import * as dntShim from "../../../../../_dnt.shims.js";
|
3
|
+
|
4
|
+
import { dirname } from "../../path/1.0.8/dirname.js";
|
5
|
+
import { resolve } from "../../path/1.0.8/resolve.js";
|
6
|
+
import { ensureDir, ensureDirSync } from "./ensure_dir.js";
|
7
|
+
import { getFileInfoType, type PathType } from "./_get_file_info_type.js";
|
8
|
+
import { toPathString } from "./_to_path_string.js";
|
9
|
+
|
10
|
+
// deno-lint-ignore no-explicit-any
|
11
|
+
const isWindows = (dntShim.dntGlobalThis as any).Deno?.build.os === "windows";
|
12
|
+
|
13
|
+
function resolveSymlinkTarget(target: string | URL, linkName: string | URL) {
|
14
|
+
if (typeof target !== "string") return target; // URL is always absolute path
|
15
|
+
if (typeof linkName === "string") {
|
16
|
+
return resolve(dirname(linkName), target);
|
17
|
+
} else {
|
18
|
+
return new URL(target, linkName);
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
function getSymlinkOption(
|
23
|
+
type: PathType | undefined,
|
24
|
+
): dntShim.Deno.SymlinkOptions | undefined {
|
25
|
+
return isWindows ? { type: type === "dir" ? "dir" : "file" } : undefined;
|
26
|
+
}
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Asynchronously ensures that the link exists, and points to a valid file.
|
30
|
+
*
|
31
|
+
* If the parent directories for the link do not exist, they are created. If the
|
32
|
+
* link already exists, and it is not modified, this function does nothing. If
|
33
|
+
* the link already exists, and it does not point to the given target, an error
|
34
|
+
* is thrown.
|
35
|
+
*
|
36
|
+
* Requires `--allow-read` and `--allow-write` permissions.
|
37
|
+
*
|
38
|
+
* @see {@link https://docs.deno.com/runtime/manual/basics/permissions#file-system-access}
|
39
|
+
* for more information on Deno's permissions system.
|
40
|
+
*
|
41
|
+
* @param target The source file path as a string or URL.
|
42
|
+
* @param linkName The destination link path as a string or URL.
|
43
|
+
*
|
44
|
+
* @returns A void promise that resolves once the link exists.
|
45
|
+
*
|
46
|
+
* @example Usage
|
47
|
+
* ```ts ignore
|
48
|
+
* import { ensureSymlink } from "@std/fs/ensure-symlink";
|
49
|
+
*
|
50
|
+
* await ensureSymlink("./folder/targetFile.dat", "./folder/targetFile.link.dat");
|
51
|
+
* ```
|
52
|
+
*/
|
53
|
+
export async function ensureSymlink(
|
54
|
+
target: string | URL,
|
55
|
+
linkName: string | URL,
|
56
|
+
) {
|
57
|
+
const targetRealPath = resolveSymlinkTarget(target, linkName);
|
58
|
+
const srcStatInfo = await dntShim.Deno.lstat(targetRealPath);
|
59
|
+
const srcFilePathType = getFileInfoType(srcStatInfo);
|
60
|
+
|
61
|
+
await ensureDir(dirname(toPathString(linkName)));
|
62
|
+
|
63
|
+
const options = getSymlinkOption(srcFilePathType);
|
64
|
+
|
65
|
+
try {
|
66
|
+
await dntShim.Deno.symlink(target, linkName, options);
|
67
|
+
} catch (error) {
|
68
|
+
if (!(error instanceof dntShim.Deno.errors.AlreadyExists)) {
|
69
|
+
throw error;
|
70
|
+
}
|
71
|
+
const linkStatInfo = await dntShim.Deno.lstat(linkName);
|
72
|
+
if (!linkStatInfo.isSymlink) {
|
73
|
+
const type = getFileInfoType(linkStatInfo);
|
74
|
+
throw new dntShim.Deno.errors.AlreadyExists(
|
75
|
+
`A '${type}' already exists at the path: ${linkName}`,
|
76
|
+
);
|
77
|
+
}
|
78
|
+
const linkPath = await dntShim.Deno.readLink(linkName);
|
79
|
+
const linkRealPath = resolve(linkPath);
|
80
|
+
if (linkRealPath !== targetRealPath) {
|
81
|
+
throw new dntShim.Deno.errors.AlreadyExists(
|
82
|
+
`A symlink targeting to an undesired path already exists: ${linkName} -> ${linkRealPath}`,
|
83
|
+
);
|
84
|
+
}
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
/**
|
89
|
+
* Synchronously ensures that the link exists, and points to a valid file.
|
90
|
+
*
|
91
|
+
* If the parent directories for the link do not exist, they are created. If the
|
92
|
+
* link already exists, and it is not modified, this function does nothing. If
|
93
|
+
* the link already exists, and it does not point to the given target, an error
|
94
|
+
* is thrown.
|
95
|
+
*
|
96
|
+
* Requires `--allow-read` and `--allow-write` permissions.
|
97
|
+
*
|
98
|
+
* @see {@link https://docs.deno.com/runtime/manual/basics/permissions#file-system-access}
|
99
|
+
* for more information on Deno's permissions system.
|
100
|
+
*
|
101
|
+
* @param target The source file path as a string or URL.
|
102
|
+
* @param linkName The destination link path as a string or URL.
|
103
|
+
* @returns A void value that returns once the link exists.
|
104
|
+
*
|
105
|
+
* @example Usage
|
106
|
+
* ```ts ignore
|
107
|
+
* import { ensureSymlinkSync } from "@std/fs/ensure-symlink";
|
108
|
+
*
|
109
|
+
* ensureSymlinkSync("./folder/targetFile.dat", "./folder/targetFile.link.dat");
|
110
|
+
* ```
|
111
|
+
*/
|
112
|
+
export function ensureSymlinkSync(
|
113
|
+
target: string | URL,
|
114
|
+
linkName: string | URL,
|
115
|
+
) {
|
116
|
+
const targetRealPath = resolveSymlinkTarget(target, linkName);
|
117
|
+
const srcStatInfo = dntShim.Deno.lstatSync(targetRealPath);
|
118
|
+
const srcFilePathType = getFileInfoType(srcStatInfo);
|
119
|
+
|
120
|
+
ensureDirSync(dirname(toPathString(linkName)));
|
121
|
+
|
122
|
+
const options = getSymlinkOption(srcFilePathType);
|
123
|
+
|
124
|
+
try {
|
125
|
+
dntShim.Deno.symlinkSync(target, linkName, options);
|
126
|
+
} catch (error) {
|
127
|
+
if (!(error instanceof dntShim.Deno.errors.AlreadyExists)) {
|
128
|
+
throw error;
|
129
|
+
}
|
130
|
+
const linkStatInfo = dntShim.Deno.lstatSync(linkName);
|
131
|
+
if (!linkStatInfo.isSymlink) {
|
132
|
+
const type = getFileInfoType(linkStatInfo);
|
133
|
+
throw new dntShim.Deno.errors.AlreadyExists(
|
134
|
+
`A '${type}' already exists at the path: ${linkName}`,
|
135
|
+
);
|
136
|
+
}
|
137
|
+
const linkPath = dntShim.Deno.readLinkSync(linkName);
|
138
|
+
const linkRealPath = resolve(linkPath);
|
139
|
+
if (linkRealPath !== targetRealPath) {
|
140
|
+
throw new dntShim.Deno.errors.AlreadyExists(
|
141
|
+
`A symlink targeting to an undesired path already exists: ${linkName} -> ${linkRealPath}`,
|
142
|
+
);
|
143
|
+
}
|
144
|
+
}
|
145
|
+
}
|
@@ -0,0 +1,74 @@
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
+
|
3
|
+
/** End-of-line character for POSIX platforms such as macOS and Linux. */
|
4
|
+
import * as dntShim from "../../../../../_dnt.shims.js";
|
5
|
+
|
6
|
+
export const LF = "\n" as const;
|
7
|
+
|
8
|
+
/** End-of-line character for Windows platforms. */
|
9
|
+
export const CRLF = "\r\n" as const;
|
10
|
+
|
11
|
+
/**
|
12
|
+
* End-of-line character evaluated for the current platform.
|
13
|
+
*
|
14
|
+
* @example Usage
|
15
|
+
* ```ts ignore
|
16
|
+
* import { EOL } from "@std/fs/eol";
|
17
|
+
*
|
18
|
+
* EOL; // "\n" on POSIX platforms and "\r\n" on Windows
|
19
|
+
* ```
|
20
|
+
*/
|
21
|
+
export const EOL: "\n" | "\r\n" =
|
22
|
+
// deno-lint-ignore no-explicit-any
|
23
|
+
(dntShim.dntGlobalThis as any).Deno?.build.os === "windows" ? CRLF : LF;
|
24
|
+
|
25
|
+
const regDetect = /(?:\r?\n)/g;
|
26
|
+
|
27
|
+
/**
|
28
|
+
* Returns the detected EOL character(s) detected in the input string. If no EOL
|
29
|
+
* character is detected, `null` is returned.
|
30
|
+
*
|
31
|
+
* @param content The input string to detect EOL characters.
|
32
|
+
*
|
33
|
+
* @returns The detected EOL character(s) or `null` if no EOL character is detected.
|
34
|
+
*
|
35
|
+
* @example Usage
|
36
|
+
* ```ts ignore
|
37
|
+
* import { detect } from "@std/fs/eol";
|
38
|
+
*
|
39
|
+
* detect("deno\r\nis not\r\nnode"); // "\r\n"
|
40
|
+
* detect("deno\nis not\r\nnode"); // "\r\n"
|
41
|
+
* detect("deno\nis not\nnode"); // "\n"
|
42
|
+
* detect("deno is not node"); // null
|
43
|
+
* ```
|
44
|
+
*/
|
45
|
+
export function detect(content: string): typeof EOL | null {
|
46
|
+
const d = content.match(regDetect);
|
47
|
+
if (!d || d.length === 0) {
|
48
|
+
return null;
|
49
|
+
}
|
50
|
+
const hasCRLF = d.some((x: string): boolean => x === CRLF);
|
51
|
+
|
52
|
+
return hasCRLF ? CRLF : LF;
|
53
|
+
}
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Normalize the input string to the targeted EOL.
|
57
|
+
*
|
58
|
+
* @param content The input string to normalize.
|
59
|
+
* @param eol The EOL character(s) to normalize the input string to.
|
60
|
+
*
|
61
|
+
* @returns The input string normalized to the targeted EOL.
|
62
|
+
*
|
63
|
+
* @example Usage
|
64
|
+
* ```ts ignore
|
65
|
+
* import { LF, format } from "@std/fs/eol";
|
66
|
+
*
|
67
|
+
* const CRLFinput = "deno\r\nis not\r\nnode";
|
68
|
+
*
|
69
|
+
* format(CRLFinput, LF); // "deno\nis not\nnode"
|
70
|
+
* ```
|
71
|
+
*/
|
72
|
+
export function format(content: string, eol: typeof EOL): string {
|
73
|
+
return content.replace(regDetect, eol);
|
74
|
+
}
|
@@ -0,0 +1,316 @@
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
+
|
3
|
+
/** Options for {@linkcode exists} and {@linkcode existsSync.} */
|
4
|
+
import * as dntShim from "../../../../../_dnt.shims.js";
|
5
|
+
|
6
|
+
export interface ExistsOptions {
|
7
|
+
/**
|
8
|
+
* When `true`, will check if the path is readable by the user as well.
|
9
|
+
*
|
10
|
+
* @default {false}
|
11
|
+
*/
|
12
|
+
isReadable?: boolean;
|
13
|
+
/**
|
14
|
+
* When `true`, will check if the path is a directory as well. Directory
|
15
|
+
* symlinks are included.
|
16
|
+
*
|
17
|
+
* @default {false}
|
18
|
+
*/
|
19
|
+
isDirectory?: boolean;
|
20
|
+
/**
|
21
|
+
* When `true`, will check if the path is a file as well. File symlinks are
|
22
|
+
* included.
|
23
|
+
*
|
24
|
+
* @default {false}
|
25
|
+
*/
|
26
|
+
isFile?: boolean;
|
27
|
+
}
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Asynchronously test whether or not the given path exists by checking with
|
31
|
+
* the file system.
|
32
|
+
*
|
33
|
+
* Note: Do not use this function if performing a check before another operation
|
34
|
+
* on that file. Doing so creates a race condition. Instead, perform the actual
|
35
|
+
* file operation directly. This function is not recommended for this use case.
|
36
|
+
* See the recommended method below.
|
37
|
+
*
|
38
|
+
* @see {@link https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use} for
|
39
|
+
* more information on the time-of-check to time-of-use bug.
|
40
|
+
*
|
41
|
+
* Requires `--allow-read` permissions, and in some cases, `--allow-sys`
|
42
|
+
* permissions if `options.isReadable` is `true`.
|
43
|
+
*
|
44
|
+
* @see {@link https://docs.deno.com/runtime/manual/basics/permissions#file-system-access}
|
45
|
+
* for more information on Deno's permissions system.
|
46
|
+
*
|
47
|
+
* @param path The path to the file or directory, as a string or URL.
|
48
|
+
* @param options Additional options for the check.
|
49
|
+
*
|
50
|
+
* @returns A promise that resolves with `true` if the path exists, `false`
|
51
|
+
* otherwise.
|
52
|
+
*
|
53
|
+
* @example Recommended method
|
54
|
+
* ```ts ignore
|
55
|
+
* // Notice no use of exists
|
56
|
+
* try {
|
57
|
+
* await Deno.remove("./foo", { recursive: true });
|
58
|
+
* } catch (error) {
|
59
|
+
* if (!(error instanceof Deno.errors.NotFound)) {
|
60
|
+
* throw error;
|
61
|
+
* }
|
62
|
+
* // Do nothing...
|
63
|
+
* }
|
64
|
+
* ```
|
65
|
+
*
|
66
|
+
* Notice that `exists()` is not used in the above example. Doing so avoids a
|
67
|
+
* possible race condition. See the above note for details.
|
68
|
+
*
|
69
|
+
* @example Basic usage
|
70
|
+
* ```ts ignore
|
71
|
+
* import { exists } from "@std/fs/exists";
|
72
|
+
*
|
73
|
+
* await exists("./exists"); // true
|
74
|
+
* await exists("./does_not_exist"); // false
|
75
|
+
* ```
|
76
|
+
*
|
77
|
+
* @example Check if a path is readable
|
78
|
+
*
|
79
|
+
* Requires `--allow-sys` permissions in some cases.
|
80
|
+
*
|
81
|
+
* ```ts ignore
|
82
|
+
* import { exists } from "@std/fs/exists";
|
83
|
+
*
|
84
|
+
* await exists("./readable", { isReadable: true }); // true
|
85
|
+
* await exists("./not_readable", { isReadable: true }); // false
|
86
|
+
* ```
|
87
|
+
*
|
88
|
+
* @example Check if a path is a directory
|
89
|
+
* ```ts ignore
|
90
|
+
* import { exists } from "@std/fs/exists";
|
91
|
+
*
|
92
|
+
* await exists("./directory", { isDirectory: true }); // true
|
93
|
+
* await exists("./file", { isDirectory: true }); // false
|
94
|
+
* ```
|
95
|
+
*
|
96
|
+
* @example Check if a path is a file
|
97
|
+
* ```ts ignore
|
98
|
+
* import { exists } from "@std/fs/exists";
|
99
|
+
*
|
100
|
+
* await exists("./file", { isFile: true }); // true
|
101
|
+
* await exists("./directory", { isFile: true }); // false
|
102
|
+
* ```
|
103
|
+
*
|
104
|
+
* @example Check if a path is a readable directory
|
105
|
+
*
|
106
|
+
* Requires `--allow-sys` permissions in some cases.
|
107
|
+
*
|
108
|
+
* ```ts ignore
|
109
|
+
* import { exists } from "@std/fs/exists";
|
110
|
+
*
|
111
|
+
* await exists("./readable_directory", { isReadable: true, isDirectory: true }); // true
|
112
|
+
* await exists("./not_readable_directory", { isReadable: true, isDirectory: true }); // false
|
113
|
+
* ```
|
114
|
+
*
|
115
|
+
* @example Check if a path is a readable file
|
116
|
+
*
|
117
|
+
* Requires `--allow-sys` permissions in some cases.
|
118
|
+
*
|
119
|
+
* ```ts ignore
|
120
|
+
* import { exists } from "@std/fs/exists";
|
121
|
+
*
|
122
|
+
* await exists("./readable_file", { isReadable: true, isFile: true }); // true
|
123
|
+
* await exists("./not_readable_file", { isReadable: true, isFile: true }); // false
|
124
|
+
* ```
|
125
|
+
*/
|
126
|
+
export async function exists(
|
127
|
+
path: string | URL,
|
128
|
+
options?: ExistsOptions,
|
129
|
+
): Promise<boolean> {
|
130
|
+
try {
|
131
|
+
const stat = await dntShim.Deno.stat(path);
|
132
|
+
if (
|
133
|
+
options &&
|
134
|
+
(options.isReadable || options.isDirectory || options.isFile)
|
135
|
+
) {
|
136
|
+
if (options.isDirectory && options.isFile) {
|
137
|
+
throw new TypeError(
|
138
|
+
"ExistsOptions.options.isDirectory and ExistsOptions.options.isFile must not be true together",
|
139
|
+
);
|
140
|
+
}
|
141
|
+
if (
|
142
|
+
(options.isDirectory && !stat.isDirectory) ||
|
143
|
+
(options.isFile && !stat.isFile)
|
144
|
+
) {
|
145
|
+
return false;
|
146
|
+
}
|
147
|
+
if (options.isReadable) {
|
148
|
+
return fileIsReadable(stat);
|
149
|
+
}
|
150
|
+
}
|
151
|
+
return true;
|
152
|
+
} catch (error) {
|
153
|
+
if (error instanceof dntShim.Deno.errors.NotFound) {
|
154
|
+
return false;
|
155
|
+
}
|
156
|
+
if (error instanceof dntShim.Deno.errors.PermissionDenied) {
|
157
|
+
if (
|
158
|
+
(await dntShim.Deno.permissions.query({ name: "read", path })).state ===
|
159
|
+
"granted"
|
160
|
+
) {
|
161
|
+
// --allow-read not missing
|
162
|
+
return !options?.isReadable; // PermissionDenied was raised by file system, so the item exists, but can't be read
|
163
|
+
}
|
164
|
+
}
|
165
|
+
throw error;
|
166
|
+
}
|
167
|
+
}
|
168
|
+
|
169
|
+
/**
|
170
|
+
* Synchronously test whether or not the given path exists by checking with
|
171
|
+
* the file system.
|
172
|
+
*
|
173
|
+
* Note: Do not use this function if performing a check before another operation
|
174
|
+
* on that file. Doing so creates a race condition. Instead, perform the actual
|
175
|
+
* file operation directly. This function is not recommended for this use case.
|
176
|
+
* See the recommended method below.
|
177
|
+
*
|
178
|
+
* @see {@link https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use} for
|
179
|
+
* more information on the time-of-check to time-of-use bug.
|
180
|
+
*
|
181
|
+
* Requires `--allow-read` permissions, and in some cases, `--allow-sys`
|
182
|
+
* permissions if `options.isReadable` is `true`.
|
183
|
+
*
|
184
|
+
* @see {@link https://docs.deno.com/runtime/manual/basics/permissions#file-system-access}
|
185
|
+
* for more information on Deno's permissions system.
|
186
|
+
*
|
187
|
+
* @param path The path to the file or directory, as a string or URL.
|
188
|
+
* @param options Additional options for the check.
|
189
|
+
*
|
190
|
+
* @returns `true` if the path exists, `false` otherwise.
|
191
|
+
*
|
192
|
+
* @example Recommended method
|
193
|
+
* ```ts ignore
|
194
|
+
* // Notice no use of exists
|
195
|
+
* try {
|
196
|
+
* Deno.removeSync("./foo", { recursive: true });
|
197
|
+
* } catch (error) {
|
198
|
+
* if (!(error instanceof Deno.errors.NotFound)) {
|
199
|
+
* throw error;
|
200
|
+
* }
|
201
|
+
* // Do nothing...
|
202
|
+
* }
|
203
|
+
* ```
|
204
|
+
*
|
205
|
+
* Notice that `existsSync()` is not used in the above example. Doing so avoids
|
206
|
+
* a possible race condition. See the above note for details.
|
207
|
+
*
|
208
|
+
* @example Basic usage
|
209
|
+
* ```ts ignore
|
210
|
+
* import { existsSync } from "@std/fs/exists";
|
211
|
+
*
|
212
|
+
* existsSync("./exists"); // true
|
213
|
+
* existsSync("./does_not_exist"); // false
|
214
|
+
* ```
|
215
|
+
*
|
216
|
+
* @example Check if a path is readable
|
217
|
+
*
|
218
|
+
* Requires `--allow-sys` permissions in some cases.
|
219
|
+
*
|
220
|
+
* ```ts ignore
|
221
|
+
* import { existsSync } from "@std/fs/exists";
|
222
|
+
*
|
223
|
+
* existsSync("./readable", { isReadable: true }); // true
|
224
|
+
* existsSync("./not_readable", { isReadable: true }); // false
|
225
|
+
* ```
|
226
|
+
*
|
227
|
+
* @example Check if a path is a directory
|
228
|
+
* ```ts ignore
|
229
|
+
* import { existsSync } from "@std/fs/exists";
|
230
|
+
*
|
231
|
+
* existsSync("./directory", { isDirectory: true }); // true
|
232
|
+
* existsSync("./file", { isDirectory: true }); // false
|
233
|
+
* ```
|
234
|
+
*
|
235
|
+
* @example Check if a path is a file
|
236
|
+
* ```ts ignore
|
237
|
+
* import { existsSync } from "@std/fs/exists";
|
238
|
+
*
|
239
|
+
* existsSync("./file", { isFile: true }); // true
|
240
|
+
* existsSync("./directory", { isFile: true }); // false
|
241
|
+
* ```
|
242
|
+
*
|
243
|
+
* @example Check if a path is a readable directory
|
244
|
+
*
|
245
|
+
* Requires `--allow-sys` permissions in some cases.
|
246
|
+
*
|
247
|
+
* ```ts ignore
|
248
|
+
* import { existsSync } from "@std/fs/exists";
|
249
|
+
*
|
250
|
+
* existsSync("./readable_directory", { isReadable: true, isDirectory: true }); // true
|
251
|
+
* existsSync("./not_readable_directory", { isReadable: true, isDirectory: true }); // false
|
252
|
+
* ```
|
253
|
+
*
|
254
|
+
* @example Check if a path is a readable file
|
255
|
+
*
|
256
|
+
* Requires `--allow-sys` permissions in some cases.
|
257
|
+
*
|
258
|
+
* ```ts ignore
|
259
|
+
* import { existsSync } from "@std/fs/exists";
|
260
|
+
*
|
261
|
+
* existsSync("./readable_file", { isReadable: true, isFile: true }); // true
|
262
|
+
* existsSync("./not_readable_file", { isReadable: true, isFile: true }); // false
|
263
|
+
* ```
|
264
|
+
*/
|
265
|
+
export function existsSync(
|
266
|
+
path: string | URL,
|
267
|
+
options?: ExistsOptions,
|
268
|
+
): boolean {
|
269
|
+
try {
|
270
|
+
const stat = dntShim.Deno.statSync(path);
|
271
|
+
if (
|
272
|
+
options &&
|
273
|
+
(options.isReadable || options.isDirectory || options.isFile)
|
274
|
+
) {
|
275
|
+
if (options.isDirectory && options.isFile) {
|
276
|
+
throw new TypeError(
|
277
|
+
"ExistsOptions.options.isDirectory and ExistsOptions.options.isFile must not be true together",
|
278
|
+
);
|
279
|
+
}
|
280
|
+
if (
|
281
|
+
(options.isDirectory && !stat.isDirectory) ||
|
282
|
+
(options.isFile && !stat.isFile)
|
283
|
+
) {
|
284
|
+
return false;
|
285
|
+
}
|
286
|
+
if (options.isReadable) {
|
287
|
+
return fileIsReadable(stat);
|
288
|
+
}
|
289
|
+
}
|
290
|
+
return true;
|
291
|
+
} catch (error) {
|
292
|
+
if (error instanceof dntShim.Deno.errors.NotFound) {
|
293
|
+
return false;
|
294
|
+
}
|
295
|
+
if (error instanceof dntShim.Deno.errors.PermissionDenied) {
|
296
|
+
if (
|
297
|
+
dntShim.Deno.permissions.querySync({ name: "read", path }).state === "granted"
|
298
|
+
) {
|
299
|
+
// --allow-read not missing
|
300
|
+
return !options?.isReadable; // PermissionDenied was raised by file system, so the item exists, but can't be read
|
301
|
+
}
|
302
|
+
}
|
303
|
+
throw error;
|
304
|
+
}
|
305
|
+
}
|
306
|
+
|
307
|
+
function fileIsReadable(stat: dntShim.Deno.FileInfo) {
|
308
|
+
if (stat.mode === null) {
|
309
|
+
return true; // Exclusive on Non-POSIX systems
|
310
|
+
} else if (dntShim.Deno.uid() === stat.uid) {
|
311
|
+
return (stat.mode & 0o400) === 0o400; // User is owner and can read?
|
312
|
+
} else if (dntShim.Deno.gid() === stat.gid) {
|
313
|
+
return (stat.mode & 0o040) === 0o040; // User group is owner and can read?
|
314
|
+
}
|
315
|
+
return (stat.mode & 0o004) === 0o004; // Others can read?
|
316
|
+
}
|