structured-outputs 0.1.0-beta.1 → 0.1.0-beta.11
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,956 @@
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
+
// Documentation and interface for walk were adapted from Go
|
3
|
+
// https://golang.org/pkg/path/filepath/#Walk
|
4
|
+
// Copyright 2009 The Go Authors. All rights reserved. BSD license.
|
5
|
+
import * as dntShim from "../../../../../_dnt.shims.js";
|
6
|
+
|
7
|
+
import { join } from "../../path/1.0.8/join.js";
|
8
|
+
import { toPathString } from "./_to_path_string.js";
|
9
|
+
import {
|
10
|
+
createWalkEntry,
|
11
|
+
createWalkEntrySync,
|
12
|
+
type WalkEntry,
|
13
|
+
} from "./_create_walk_entry.js";
|
14
|
+
|
15
|
+
function include(
|
16
|
+
path: string,
|
17
|
+
exts?: string[],
|
18
|
+
match?: RegExp[],
|
19
|
+
skip?: RegExp[],
|
20
|
+
): boolean {
|
21
|
+
if (exts && !exts.some((ext): boolean => path.endsWith(ext))) {
|
22
|
+
return false;
|
23
|
+
}
|
24
|
+
if (match && !match.some((pattern): boolean => !!path.match(pattern))) {
|
25
|
+
return false;
|
26
|
+
}
|
27
|
+
if (skip && skip.some((pattern): boolean => !!path.match(pattern))) {
|
28
|
+
return false;
|
29
|
+
}
|
30
|
+
return true;
|
31
|
+
}
|
32
|
+
|
33
|
+
/** Options for {@linkcode walk} and {@linkcode walkSync}. */
|
34
|
+
export interface WalkOptions {
|
35
|
+
/**
|
36
|
+
* The maximum depth of the file tree to be walked recursively.
|
37
|
+
*
|
38
|
+
* @default {Infinity}
|
39
|
+
*/
|
40
|
+
maxDepth?: number;
|
41
|
+
/**
|
42
|
+
* Indicates whether file entries should be included or not.
|
43
|
+
*
|
44
|
+
* @default {true}
|
45
|
+
*/
|
46
|
+
includeFiles?: boolean;
|
47
|
+
/**
|
48
|
+
* Indicates whether directory entries should be included or not.
|
49
|
+
*
|
50
|
+
* @default {true}
|
51
|
+
*/
|
52
|
+
includeDirs?: boolean;
|
53
|
+
/**
|
54
|
+
* Indicates whether symlink entries should be included or not.
|
55
|
+
* This option is meaningful only if `followSymlinks` is set to `false`.
|
56
|
+
*
|
57
|
+
* @default {true}
|
58
|
+
*/
|
59
|
+
includeSymlinks?: boolean;
|
60
|
+
/**
|
61
|
+
* Indicates whether symlinks should be resolved or not.
|
62
|
+
*
|
63
|
+
* @default {false}
|
64
|
+
*/
|
65
|
+
followSymlinks?: boolean;
|
66
|
+
/**
|
67
|
+
* Indicates whether the followed symlink's path should be canonicalized.
|
68
|
+
* This option works only if `followSymlinks` is not `false`.
|
69
|
+
*
|
70
|
+
* @default {true}
|
71
|
+
*/
|
72
|
+
canonicalize?: boolean;
|
73
|
+
/**
|
74
|
+
* List of file extensions used to filter entries.
|
75
|
+
* If specified, entries without the file extension specified by this option
|
76
|
+
* are excluded.
|
77
|
+
*
|
78
|
+
* File extensions with or without a leading period are accepted.
|
79
|
+
*
|
80
|
+
* @default {[]}
|
81
|
+
*/
|
82
|
+
exts?: string[];
|
83
|
+
/**
|
84
|
+
* List of regular expression patterns used to filter entries.
|
85
|
+
* If specified, entries that do not match the patterns specified by this
|
86
|
+
* option are excluded.
|
87
|
+
*/
|
88
|
+
match?: RegExp[];
|
89
|
+
/**
|
90
|
+
* List of regular expression patterns used to filter entries.
|
91
|
+
* If specified, entries matching the patterns specified by this option are
|
92
|
+
* excluded.
|
93
|
+
*/
|
94
|
+
skip?: RegExp[];
|
95
|
+
}
|
96
|
+
export type { WalkEntry };
|
97
|
+
|
98
|
+
/**
|
99
|
+
* Recursively walks through a directory and yields information about each file
|
100
|
+
* and directory encountered.
|
101
|
+
*
|
102
|
+
* The root path determines whether the file paths are relative or absolute.
|
103
|
+
* The root directory is included in the yielded entries.
|
104
|
+
*
|
105
|
+
* Requires `--allow-read` permission.
|
106
|
+
*
|
107
|
+
* @see {@link https://docs.deno.com/runtime/manual/basics/permissions#file-system-access}
|
108
|
+
* for more information on Deno's permissions system.
|
109
|
+
*
|
110
|
+
* @param root The root directory to start the walk from, as a string or URL.
|
111
|
+
* @param options The options for the walk.
|
112
|
+
* @throws {Deno.errors.NotFound} If the root directory does not exist.
|
113
|
+
*
|
114
|
+
* @returns An async iterable iterator that yields the walk entry objects.
|
115
|
+
*
|
116
|
+
* @example Basic usage
|
117
|
+
*
|
118
|
+
* File structure:
|
119
|
+
* ```
|
120
|
+
* folder
|
121
|
+
* ├── script.ts
|
122
|
+
* └── foo.ts
|
123
|
+
* ```
|
124
|
+
*
|
125
|
+
* ```ts ignore
|
126
|
+
* import { walk } from "@std/fs/walk";
|
127
|
+
*
|
128
|
+
* await Array.fromAsync(walk("."));
|
129
|
+
* // [
|
130
|
+
* // {
|
131
|
+
* // path: ".",
|
132
|
+
* // name: ".",
|
133
|
+
* // isFile: false,
|
134
|
+
* // isDirectory: true,
|
135
|
+
* // isSymlink: false
|
136
|
+
* // },
|
137
|
+
* // {
|
138
|
+
* // path: "script.ts",
|
139
|
+
* // name: "script.ts",
|
140
|
+
* // isFile: true,
|
141
|
+
* // isDirectory: false,
|
142
|
+
* // isSymlink: false
|
143
|
+
* // },
|
144
|
+
* // {
|
145
|
+
* // path: "foo.ts",
|
146
|
+
* // name: "foo.ts",
|
147
|
+
* // isFile: true,
|
148
|
+
* // isDirectory: false,
|
149
|
+
* // isSymlink: false
|
150
|
+
* // },
|
151
|
+
* // ]
|
152
|
+
* ```
|
153
|
+
*
|
154
|
+
* @example Maximum file depth
|
155
|
+
*
|
156
|
+
* Setting the `maxDepth` option to `1` will only include the root directory and
|
157
|
+
* its immediate children.
|
158
|
+
*
|
159
|
+
* File structure:
|
160
|
+
* ```
|
161
|
+
* folder
|
162
|
+
* ├── script.ts
|
163
|
+
* └── foo
|
164
|
+
* └── bar.ts
|
165
|
+
* ```
|
166
|
+
*
|
167
|
+
* ```ts ignore
|
168
|
+
* import { walk } from "@std/fs/walk";
|
169
|
+
*
|
170
|
+
* await Array.fromAsync(walk(".", { maxDepth: 1 }));
|
171
|
+
* // [
|
172
|
+
* // {
|
173
|
+
* // path: ".",
|
174
|
+
* // name: ".",
|
175
|
+
* // isFile: false,
|
176
|
+
* // isDirectory: true,
|
177
|
+
* // isSymlink: false
|
178
|
+
* // },
|
179
|
+
* // {
|
180
|
+
* // path: "script.ts",
|
181
|
+
* // name: "script.ts",
|
182
|
+
* // isFile: true,
|
183
|
+
* // isDirectory: false,
|
184
|
+
* // isSymlink: false
|
185
|
+
* // },
|
186
|
+
* // {
|
187
|
+
* // path: "foo",
|
188
|
+
* // name: "foo",
|
189
|
+
* // isFile: false,
|
190
|
+
* // isDirectory: true,
|
191
|
+
* // isSymlink: false
|
192
|
+
* // },
|
193
|
+
* // ]
|
194
|
+
* ```
|
195
|
+
*
|
196
|
+
* @example Exclude files
|
197
|
+
*
|
198
|
+
* Setting the `includeFiles` option to `false` will exclude files.
|
199
|
+
*
|
200
|
+
* File structure:
|
201
|
+
* ```
|
202
|
+
* folder
|
203
|
+
* ├── script.ts
|
204
|
+
* └── foo
|
205
|
+
* ```
|
206
|
+
*
|
207
|
+
* ```ts ignore
|
208
|
+
* import { walk } from "@std/fs/walk";
|
209
|
+
*
|
210
|
+
* await Array.fromAsync(walk(".", { includeFiles: false }));
|
211
|
+
* // [
|
212
|
+
* // {
|
213
|
+
* // path: ".",
|
214
|
+
* // name: ".",
|
215
|
+
* // isFile: false,
|
216
|
+
* // isDirectory: true,
|
217
|
+
* // isSymlink: false
|
218
|
+
* // },
|
219
|
+
* // {
|
220
|
+
* // path: "foo",
|
221
|
+
* // name: "foo",
|
222
|
+
* // isFile: false,
|
223
|
+
* // isDirectory: true,
|
224
|
+
* // isSymlink: false,
|
225
|
+
* // },
|
226
|
+
* // ]
|
227
|
+
* ```
|
228
|
+
*
|
229
|
+
* @example Exclude directories
|
230
|
+
*
|
231
|
+
* Setting the `includeDirs` option to `false` will exclude directories.
|
232
|
+
*
|
233
|
+
* File structure:
|
234
|
+
* ```
|
235
|
+
* folder
|
236
|
+
* ├── script.ts
|
237
|
+
* └── foo
|
238
|
+
* ```
|
239
|
+
*
|
240
|
+
* ```ts ignore
|
241
|
+
* import { walk } from "@std/fs/walk";
|
242
|
+
*
|
243
|
+
* await Array.fromAsync(walk(".", { includeDirs: false }));
|
244
|
+
* // [
|
245
|
+
* // {
|
246
|
+
* // path: "script.ts",
|
247
|
+
* // name: "script.ts",
|
248
|
+
* // isFile: true,
|
249
|
+
* // isDirectory: false,
|
250
|
+
* // isSymlink: false
|
251
|
+
* // },
|
252
|
+
* // ]
|
253
|
+
* ```
|
254
|
+
*
|
255
|
+
* @example Exclude symbolic links
|
256
|
+
*
|
257
|
+
* Setting the `includeSymlinks` option to `false` will exclude symbolic links.
|
258
|
+
*
|
259
|
+
* File structure:
|
260
|
+
* ```
|
261
|
+
* folder
|
262
|
+
* ├── script.ts
|
263
|
+
* ├── foo
|
264
|
+
* └── link -> script.ts (symbolic link)
|
265
|
+
* ```
|
266
|
+
*
|
267
|
+
* ```ts ignore
|
268
|
+
* import { walk } from "@std/fs/walk";
|
269
|
+
*
|
270
|
+
* await Array.fromAsync(walk(".", { includeSymlinks: false }));
|
271
|
+
* // [
|
272
|
+
* // {
|
273
|
+
* // path: ".",
|
274
|
+
* // name: ".",
|
275
|
+
* // isFile: false,
|
276
|
+
* // isDirectory: true,
|
277
|
+
* // isSymlink: false
|
278
|
+
* // },
|
279
|
+
* // {
|
280
|
+
* // path: "script.ts",
|
281
|
+
* // name: "script.ts",
|
282
|
+
* // isFile: true,
|
283
|
+
* // isDirectory: false,
|
284
|
+
* // isSymlink: false
|
285
|
+
* // },
|
286
|
+
* // ]
|
287
|
+
* ```
|
288
|
+
*
|
289
|
+
* @example Follow symbolic links
|
290
|
+
*
|
291
|
+
* Setting the `followSymlinks` option to `true` will follow symbolic links,
|
292
|
+
* affecting the `path` property of the walk entry.
|
293
|
+
*
|
294
|
+
* File structure:
|
295
|
+
* ```
|
296
|
+
* folder
|
297
|
+
* ├── script.ts
|
298
|
+
* └── link -> script.ts (symbolic link)
|
299
|
+
* ```
|
300
|
+
*
|
301
|
+
* ```ts ignore
|
302
|
+
* import { walk } from "@std/fs/walk";
|
303
|
+
*
|
304
|
+
* await Array.fromAsync(walk(".", { followSymlinks: true }));
|
305
|
+
* // [
|
306
|
+
* // {
|
307
|
+
* // path: ".",
|
308
|
+
* // name: ".",
|
309
|
+
* // isFile: false,
|
310
|
+
* // isDirectory: true,
|
311
|
+
* // isSymlink: false
|
312
|
+
* // },
|
313
|
+
* // {
|
314
|
+
* // path: "script.ts",
|
315
|
+
* // name: "script.ts",
|
316
|
+
* // isFile: true,
|
317
|
+
* // isDirectory: false,
|
318
|
+
* // isSymlink: false
|
319
|
+
* // },
|
320
|
+
* // {
|
321
|
+
* // path: "script.ts",
|
322
|
+
* // name: "link",
|
323
|
+
* // isFile: true,
|
324
|
+
* // isDirectory: false,
|
325
|
+
* // isSymlink: true
|
326
|
+
* // },
|
327
|
+
* // ]
|
328
|
+
* ```
|
329
|
+
*
|
330
|
+
* @example Canonicalize symbolic links
|
331
|
+
*
|
332
|
+
* Setting the `canonicalize` option to `false` will canonicalize the path of
|
333
|
+
* the followed symbolic link. Meaning, the `path` property of the walk entry
|
334
|
+
* will be the path of the symbolic link itself.
|
335
|
+
*
|
336
|
+
* File structure:
|
337
|
+
* ```
|
338
|
+
* folder
|
339
|
+
* ├── script.ts
|
340
|
+
* └── link -> script.ts (symbolic link)
|
341
|
+
* ```
|
342
|
+
*
|
343
|
+
* ```ts ignore
|
344
|
+
* import { walk } from "@std/fs/walk";
|
345
|
+
*
|
346
|
+
* await Array.fromAsync(walk(".", { followSymlinks: true, canonicalize: true }));
|
347
|
+
* // [
|
348
|
+
* // {
|
349
|
+
* // path: ".",
|
350
|
+
* // name: ".",
|
351
|
+
* // isFile: false,
|
352
|
+
* // isDirectory: true,
|
353
|
+
* // isSymlink: false
|
354
|
+
* // },
|
355
|
+
* // {
|
356
|
+
* // path: "script.ts",
|
357
|
+
* // name: "script.ts",
|
358
|
+
* // isFile: true,
|
359
|
+
* // isDirectory: false,
|
360
|
+
* // isSymlink: false
|
361
|
+
* // },
|
362
|
+
* // {
|
363
|
+
* // path: "link",
|
364
|
+
* // name: "link",
|
365
|
+
* // isFile: true,
|
366
|
+
* // isDirectory: false,
|
367
|
+
* // isSymlink: true
|
368
|
+
* // },
|
369
|
+
* // ]
|
370
|
+
* ```
|
371
|
+
*
|
372
|
+
* @example Filter by file extensions
|
373
|
+
*
|
374
|
+
* Setting the `exts` option to `[".ts"]` or `["ts"]` will only include entries
|
375
|
+
* with the `.ts` file extension.
|
376
|
+
*
|
377
|
+
* File structure:
|
378
|
+
* ```
|
379
|
+
* folder
|
380
|
+
* ├── script.ts
|
381
|
+
* └── foo.js
|
382
|
+
* ```
|
383
|
+
*
|
384
|
+
* ```ts ignore
|
385
|
+
* import { walk } from "@std/fs/walk";
|
386
|
+
*
|
387
|
+
* await Array.fromAsync(walk(".", { exts: [".ts"] }));
|
388
|
+
* // [
|
389
|
+
* // {
|
390
|
+
* // path: "script.ts",
|
391
|
+
* // name: "script.ts",
|
392
|
+
* // isFile: true,
|
393
|
+
* // isDirectory: false,
|
394
|
+
* // isSymlink: false
|
395
|
+
* // },
|
396
|
+
* // ]
|
397
|
+
* ```
|
398
|
+
*
|
399
|
+
* @example Filter by regular expressions
|
400
|
+
*
|
401
|
+
* Setting the `match` option to `[/.s/]` will only include entries with the
|
402
|
+
* letter `s` in their name.
|
403
|
+
*
|
404
|
+
* File structure:
|
405
|
+
* ```
|
406
|
+
* folder
|
407
|
+
* ├── script.ts
|
408
|
+
* └── README.md
|
409
|
+
* ```
|
410
|
+
*
|
411
|
+
* ```ts ignore
|
412
|
+
* import { walk } from "@std/fs/walk";
|
413
|
+
*
|
414
|
+
* await Array.fromAsync(walk(".", { match: [/s/] }));
|
415
|
+
* // [
|
416
|
+
* // {
|
417
|
+
* // path: "script.ts",
|
418
|
+
* // name: "script.ts",
|
419
|
+
* // isFile: true,
|
420
|
+
* // isDirectory: false,
|
421
|
+
* // isSymlink: false
|
422
|
+
* // },
|
423
|
+
* // ]
|
424
|
+
* ```
|
425
|
+
*
|
426
|
+
* @example Exclude by regular expressions
|
427
|
+
*
|
428
|
+
* Setting the `skip` option to `[/.s/]` will exclude entries with the letter
|
429
|
+
* `s` in their name.
|
430
|
+
*
|
431
|
+
* File structure:
|
432
|
+
* ```
|
433
|
+
* folder
|
434
|
+
* ├── script.ts
|
435
|
+
* └── README.md
|
436
|
+
* ```
|
437
|
+
*
|
438
|
+
* ```ts ignore
|
439
|
+
* import { walk } from "@std/fs/walk";
|
440
|
+
*
|
441
|
+
* await Array.fromAsync(walk(".", { skip: [/s/] }));
|
442
|
+
* // [
|
443
|
+
* // {
|
444
|
+
* // path: "README.md",
|
445
|
+
* // name: "README.md",
|
446
|
+
* // isFile: true,
|
447
|
+
* // isDirectory: false,
|
448
|
+
* // isSymlink: false
|
449
|
+
* // },
|
450
|
+
* // ]
|
451
|
+
* ```
|
452
|
+
*/
|
453
|
+
export async function* walk(
|
454
|
+
root: string | URL,
|
455
|
+
options?: WalkOptions,
|
456
|
+
): AsyncIterableIterator<WalkEntry> {
|
457
|
+
let {
|
458
|
+
maxDepth = Infinity,
|
459
|
+
includeFiles = true,
|
460
|
+
includeDirs = true,
|
461
|
+
includeSymlinks = true,
|
462
|
+
followSymlinks = false,
|
463
|
+
canonicalize = true,
|
464
|
+
exts = undefined,
|
465
|
+
match = undefined,
|
466
|
+
skip = undefined,
|
467
|
+
} = options ?? {};
|
468
|
+
|
469
|
+
if (maxDepth < 0) {
|
470
|
+
return;
|
471
|
+
}
|
472
|
+
root = toPathString(root);
|
473
|
+
if (exts) {
|
474
|
+
exts = exts.map((ext) => ext.startsWith(".") ? ext : `.${ext}`);
|
475
|
+
}
|
476
|
+
if (includeDirs && include(root, exts, match, skip)) {
|
477
|
+
yield await createWalkEntry(root);
|
478
|
+
}
|
479
|
+
if (maxDepth < 1 || !include(root, undefined, undefined, skip)) {
|
480
|
+
return;
|
481
|
+
}
|
482
|
+
for await (const entry of dntShim.Deno.readDir(root)) {
|
483
|
+
let path = join(root, entry.name);
|
484
|
+
|
485
|
+
let { isSymlink, isDirectory } = entry;
|
486
|
+
|
487
|
+
if (isSymlink) {
|
488
|
+
if (!followSymlinks) {
|
489
|
+
if (includeSymlinks && include(path, exts, match, skip)) {
|
490
|
+
yield { path, ...entry };
|
491
|
+
}
|
492
|
+
continue;
|
493
|
+
}
|
494
|
+
const realPath = await dntShim.Deno.realPath(path);
|
495
|
+
if (canonicalize) {
|
496
|
+
path = realPath;
|
497
|
+
}
|
498
|
+
// Caveat emptor: don't assume |path| is not a symlink. realpath()
|
499
|
+
// resolves symlinks but another process can replace the file system
|
500
|
+
// entity with a different type of entity before we call lstat().
|
501
|
+
({ isSymlink, isDirectory } = await dntShim.Deno.lstat(realPath));
|
502
|
+
}
|
503
|
+
|
504
|
+
if (isSymlink || isDirectory) {
|
505
|
+
const opts: WalkOptions = {
|
506
|
+
maxDepth: maxDepth - 1,
|
507
|
+
includeFiles,
|
508
|
+
includeDirs,
|
509
|
+
includeSymlinks,
|
510
|
+
followSymlinks,
|
511
|
+
};
|
512
|
+
if (exts !== undefined) {
|
513
|
+
opts.exts = exts;
|
514
|
+
}
|
515
|
+
if (match !== undefined) {
|
516
|
+
opts.match = match;
|
517
|
+
}
|
518
|
+
if (skip !== undefined) {
|
519
|
+
opts.skip = skip;
|
520
|
+
}
|
521
|
+
yield* walk(path, opts);
|
522
|
+
} else if (includeFiles && include(path, exts, match, skip)) {
|
523
|
+
yield { path, ...entry };
|
524
|
+
}
|
525
|
+
}
|
526
|
+
}
|
527
|
+
|
528
|
+
/**
|
529
|
+
* Recursively walks through a directory and yields information about each file
|
530
|
+
* and directory encountered.
|
531
|
+
*
|
532
|
+
* The root path determines whether the file paths is relative or absolute.
|
533
|
+
* The root directory is included in the yielded entries.
|
534
|
+
*
|
535
|
+
* Requires `--allow-read` permission.
|
536
|
+
*
|
537
|
+
* @see {@link https://docs.deno.com/runtime/manual/basics/permissions#file-system-access}
|
538
|
+
* for more information on Deno's permissions system.
|
539
|
+
*
|
540
|
+
* @param root The root directory to start the walk from, as a string or URL.
|
541
|
+
* @param options The options for the walk.
|
542
|
+
*
|
543
|
+
* @returns A synchronous iterable iterator that yields the walk entry objects.
|
544
|
+
*
|
545
|
+
* @example Basic usage
|
546
|
+
*
|
547
|
+
* File structure:
|
548
|
+
* ```
|
549
|
+
* folder
|
550
|
+
* ├── script.ts
|
551
|
+
* └── foo.ts
|
552
|
+
* ```
|
553
|
+
*
|
554
|
+
* ```ts ignore
|
555
|
+
* import { walkSync } from "@std/fs/walk";
|
556
|
+
*
|
557
|
+
* Array.from(walkSync("."));
|
558
|
+
* // [
|
559
|
+
* // {
|
560
|
+
* // path: ".",
|
561
|
+
* // name: ".",
|
562
|
+
* // isFile: false,
|
563
|
+
* // isDirectory: true,
|
564
|
+
* // isSymlink: false
|
565
|
+
* // },
|
566
|
+
* // {
|
567
|
+
* // path: "script.ts",
|
568
|
+
* // name: "script.ts",
|
569
|
+
* // isFile: true,
|
570
|
+
* // isDirectory: false,
|
571
|
+
* // isSymlink: false
|
572
|
+
* // },
|
573
|
+
* // {
|
574
|
+
* // path: "foo.ts",
|
575
|
+
* // name: "foo.ts",
|
576
|
+
* // isFile: true,
|
577
|
+
* // isDirectory: false,
|
578
|
+
* // isSymlink: false
|
579
|
+
* // },
|
580
|
+
* // ]
|
581
|
+
* ```
|
582
|
+
*
|
583
|
+
* @example Maximum file depth
|
584
|
+
*
|
585
|
+
* Setting the `maxDepth` option to `1` will only include the root directory and
|
586
|
+
* its immediate children.
|
587
|
+
*
|
588
|
+
* File structure:
|
589
|
+
* ```
|
590
|
+
* folder
|
591
|
+
* ├── script.ts
|
592
|
+
* └── foo
|
593
|
+
* └── bar.ts
|
594
|
+
* ```
|
595
|
+
*
|
596
|
+
* ```ts ignore
|
597
|
+
* import { walkSync } from "@std/fs/walk";
|
598
|
+
*
|
599
|
+
* Array.from(walkSync(".", { maxDepth: 1 }));
|
600
|
+
* // [
|
601
|
+
* // {
|
602
|
+
* // path: ".",
|
603
|
+
* // name: ".",
|
604
|
+
* // isFile: false,
|
605
|
+
* // isDirectory: true,
|
606
|
+
* // isSymlink: false
|
607
|
+
* // },
|
608
|
+
* // {
|
609
|
+
* // path: "script.ts",
|
610
|
+
* // name: "script.ts",
|
611
|
+
* // isFile: true,
|
612
|
+
* // isDirectory: false,
|
613
|
+
* // isSymlink: false
|
614
|
+
* // },
|
615
|
+
* // {
|
616
|
+
* // path: "foo",
|
617
|
+
* // name: "foo",
|
618
|
+
* // isFile: false,
|
619
|
+
* // isDirectory: true,
|
620
|
+
* // isSymlink: false
|
621
|
+
* // },
|
622
|
+
* // ]
|
623
|
+
* ```
|
624
|
+
*
|
625
|
+
* @example Exclude files
|
626
|
+
*
|
627
|
+
* Setting the `includeFiles` option to `false` will exclude files.
|
628
|
+
*
|
629
|
+
* File structure:
|
630
|
+
* ```
|
631
|
+
* folder
|
632
|
+
* ├── script.ts
|
633
|
+
* └── foo
|
634
|
+
* ```
|
635
|
+
*
|
636
|
+
* ```ts ignore
|
637
|
+
* import { walkSync } from "@std/fs/walk";
|
638
|
+
*
|
639
|
+
* Array.from(walkSync(".", { includeFiles: false }));
|
640
|
+
* // [
|
641
|
+
* // {
|
642
|
+
* // path: ".",
|
643
|
+
* // name: ".",
|
644
|
+
* // isFile: false,
|
645
|
+
* // isDirectory: true,
|
646
|
+
* // isSymlink: false
|
647
|
+
* // },
|
648
|
+
* // {
|
649
|
+
* // path: "foo",
|
650
|
+
* // name: "foo",
|
651
|
+
* // isFile: false,
|
652
|
+
* // isDirectory: true,
|
653
|
+
* // isSymlink: false,
|
654
|
+
* // },
|
655
|
+
* // ]
|
656
|
+
* ```
|
657
|
+
*
|
658
|
+
* @example Exclude directories
|
659
|
+
*
|
660
|
+
* Setting the `includeDirs` option to `false` will exclude directories.
|
661
|
+
*
|
662
|
+
* File structure:
|
663
|
+
* ```
|
664
|
+
* folder
|
665
|
+
* ├── script.ts
|
666
|
+
* └── foo
|
667
|
+
* ```
|
668
|
+
*
|
669
|
+
* ```ts ignore
|
670
|
+
* import { walkSync } from "@std/fs/walk";
|
671
|
+
*
|
672
|
+
* Array.from(walkSync(".", { includeDirs: false }));
|
673
|
+
* // [
|
674
|
+
* // {
|
675
|
+
* // path: "script.ts",
|
676
|
+
* // name: "script.ts",
|
677
|
+
* // isFile: true,
|
678
|
+
* // isDirectory: false,
|
679
|
+
* // isSymlink: false
|
680
|
+
* // },
|
681
|
+
* // ]
|
682
|
+
* ```
|
683
|
+
*
|
684
|
+
* @example Exclude symbolic links
|
685
|
+
*
|
686
|
+
* Setting the `includeSymlinks` option to `false` will exclude symbolic links.
|
687
|
+
*
|
688
|
+
* File structure:
|
689
|
+
* ```
|
690
|
+
* folder
|
691
|
+
* ├── script.ts
|
692
|
+
* ├── foo
|
693
|
+
* └── link -> script.ts (symbolic link)
|
694
|
+
* ```
|
695
|
+
*
|
696
|
+
* ```ts ignore
|
697
|
+
* import { walkSync } from "@std/fs/walk";
|
698
|
+
*
|
699
|
+
* Array.from(walkSync(".", { includeSymlinks: false }));
|
700
|
+
* // [
|
701
|
+
* // {
|
702
|
+
* // path: ".",
|
703
|
+
* // name: ".",
|
704
|
+
* // isFile: false,
|
705
|
+
* // isDirectory: true,
|
706
|
+
* // isSymlink: false
|
707
|
+
* // },
|
708
|
+
* // {
|
709
|
+
* // path: "script.ts",
|
710
|
+
* // name: "script.ts",
|
711
|
+
* // isFile: true,
|
712
|
+
* // isDirectory: false,
|
713
|
+
* // isSymlink: false
|
714
|
+
* // },
|
715
|
+
* // ]
|
716
|
+
* ```
|
717
|
+
*
|
718
|
+
* @example Follow symbolic links
|
719
|
+
*
|
720
|
+
* Setting the `followSymlinks` option to `true` will follow symbolic links,
|
721
|
+
* affecting the `path` property of the walk entry.
|
722
|
+
*
|
723
|
+
* File structure:
|
724
|
+
* ```
|
725
|
+
* folder
|
726
|
+
* ├── script.ts
|
727
|
+
* └── link -> script.ts (symbolic link)
|
728
|
+
* ```
|
729
|
+
*
|
730
|
+
* ```ts ignore
|
731
|
+
* import { walkSync } from "@std/fs/walk";
|
732
|
+
*
|
733
|
+
* Array.from(walkSync(".", { followSymlinks: true }));
|
734
|
+
* // [
|
735
|
+
* // {
|
736
|
+
* // path: ".",
|
737
|
+
* // name: ".",
|
738
|
+
* // isFile: false,
|
739
|
+
* // isDirectory: true,
|
740
|
+
* // isSymlink: false
|
741
|
+
* // },
|
742
|
+
* // {
|
743
|
+
* // path: "script.ts",
|
744
|
+
* // name: "script.ts",
|
745
|
+
* // isFile: true,
|
746
|
+
* // isDirectory: false,
|
747
|
+
* // isSymlink: false
|
748
|
+
* // },
|
749
|
+
* // {
|
750
|
+
* // path: "script.ts",
|
751
|
+
* // name: "link",
|
752
|
+
* // isFile: true,
|
753
|
+
* // isDirectory: false,
|
754
|
+
* // isSymlink: true
|
755
|
+
* // },
|
756
|
+
* // ]
|
757
|
+
* ```
|
758
|
+
*
|
759
|
+
* @example Canonicalize symbolic links
|
760
|
+
*
|
761
|
+
* Setting the `canonicalize` option to `false` will canonicalize the path of
|
762
|
+
* the followed symbolic link. Meaning, the `path` property of the walk entry
|
763
|
+
* will be the path of the symbolic link itself.
|
764
|
+
*
|
765
|
+
* File structure:
|
766
|
+
* ```
|
767
|
+
* folder
|
768
|
+
* ├── script.ts
|
769
|
+
* └── link -> script.ts (symbolic link)
|
770
|
+
* ```
|
771
|
+
*
|
772
|
+
* ```ts ignore
|
773
|
+
* import { walkSync } from "@std/fs/walk";
|
774
|
+
*
|
775
|
+
* Array.from(walkSync(".", { followSymlinks: true, canonicalize: true }));
|
776
|
+
* // [
|
777
|
+
* // {
|
778
|
+
* // path: ".",
|
779
|
+
* // name: ".",
|
780
|
+
* // isFile: false,
|
781
|
+
* // isDirectory: true,
|
782
|
+
* // isSymlink: false
|
783
|
+
* // },
|
784
|
+
* // {
|
785
|
+
* // path: "script.ts",
|
786
|
+
* // name: "script.ts",
|
787
|
+
* // isFile: true,
|
788
|
+
* // isDirectory: false,
|
789
|
+
* // isSymlink: false
|
790
|
+
* // },
|
791
|
+
* // {
|
792
|
+
* // path: "link",
|
793
|
+
* // name: "link",
|
794
|
+
* // isFile: true,
|
795
|
+
* // isDirectory: false,
|
796
|
+
* // isSymlink: true
|
797
|
+
* // },
|
798
|
+
* // ]
|
799
|
+
* ```
|
800
|
+
*
|
801
|
+
* @example Filter by file extensions
|
802
|
+
*
|
803
|
+
* Setting the `exts` option to `[".ts"]` or `["ts"]` will only include entries
|
804
|
+
* with the `.ts` file extension.
|
805
|
+
*
|
806
|
+
* File structure:
|
807
|
+
* ```
|
808
|
+
* folder
|
809
|
+
* ├── script.ts
|
810
|
+
* └── foo.js
|
811
|
+
* ```
|
812
|
+
*
|
813
|
+
* ```ts ignore
|
814
|
+
* import { walkSync } from "@std/fs/walk";
|
815
|
+
*
|
816
|
+
* Array.from(walkSync(".", { exts: [".ts"] }));
|
817
|
+
* // [
|
818
|
+
* // {
|
819
|
+
* // path: "script.ts",
|
820
|
+
* // name: "script.ts",
|
821
|
+
* // isFile: true,
|
822
|
+
* // isDirectory: false,
|
823
|
+
* // isSymlink: false
|
824
|
+
* // },
|
825
|
+
* // ]
|
826
|
+
* ```
|
827
|
+
*
|
828
|
+
* @example Filter by regular expressions
|
829
|
+
*
|
830
|
+
* Setting the `match` option to `[/.s/]` will only include entries with the
|
831
|
+
* letter `s` in their name.
|
832
|
+
*
|
833
|
+
* File structure:
|
834
|
+
* ```
|
835
|
+
* folder
|
836
|
+
* ├── script.ts
|
837
|
+
* └── README.md
|
838
|
+
* ```
|
839
|
+
*
|
840
|
+
* ```ts ignore
|
841
|
+
* import { walkSync } from "@std/fs/walk";
|
842
|
+
*
|
843
|
+
* Array.from(walkSync(".", { match: [/s/] }));
|
844
|
+
* // [
|
845
|
+
* // {
|
846
|
+
* // path: "script.ts",
|
847
|
+
* // name: "script.ts",
|
848
|
+
* // isFile: true,
|
849
|
+
* // isDirectory: false,
|
850
|
+
* // isSymlink: false
|
851
|
+
* // },
|
852
|
+
* // ]
|
853
|
+
* ```
|
854
|
+
*
|
855
|
+
* @example Exclude by regular expressions
|
856
|
+
*
|
857
|
+
* Setting the `skip` option to `[/.s/]` will exclude entries with the letter
|
858
|
+
* `s` in their name.
|
859
|
+
*
|
860
|
+
* File structure:
|
861
|
+
* ```
|
862
|
+
* folder
|
863
|
+
* ├── script.ts
|
864
|
+
* └── README.md
|
865
|
+
* ```
|
866
|
+
*
|
867
|
+
* ```ts ignore
|
868
|
+
* import { walkSync } from "@std/fs/walk";
|
869
|
+
*
|
870
|
+
* Array.from(walkSync(".", { skip: [/s/] }));
|
871
|
+
* // [
|
872
|
+
* // {
|
873
|
+
* // path: "README.md",
|
874
|
+
* // name: "README.md",
|
875
|
+
* // isFile: true,
|
876
|
+
* // isDirectory: false,
|
877
|
+
* // isSymlink: false
|
878
|
+
* // },
|
879
|
+
* // ]
|
880
|
+
* ```
|
881
|
+
*/
|
882
|
+
export function* walkSync(
|
883
|
+
root: string | URL,
|
884
|
+
options?: WalkOptions,
|
885
|
+
): IterableIterator<WalkEntry> {
|
886
|
+
let {
|
887
|
+
maxDepth = Infinity,
|
888
|
+
includeFiles = true,
|
889
|
+
includeDirs = true,
|
890
|
+
includeSymlinks = true,
|
891
|
+
followSymlinks = false,
|
892
|
+
canonicalize = true,
|
893
|
+
exts = undefined,
|
894
|
+
match = undefined,
|
895
|
+
skip = undefined,
|
896
|
+
} = options ?? {};
|
897
|
+
|
898
|
+
root = toPathString(root);
|
899
|
+
if (exts) {
|
900
|
+
exts = exts.map((ext) => ext.startsWith(".") ? ext : `.${ext}`);
|
901
|
+
}
|
902
|
+
if (maxDepth < 0) {
|
903
|
+
return;
|
904
|
+
}
|
905
|
+
if (includeDirs && include(root, exts, match, skip)) {
|
906
|
+
yield createWalkEntrySync(root);
|
907
|
+
}
|
908
|
+
if (maxDepth < 1 || !include(root, undefined, undefined, skip)) {
|
909
|
+
return;
|
910
|
+
}
|
911
|
+
const entries = dntShim.Deno.readDirSync(root);
|
912
|
+
for (const entry of entries) {
|
913
|
+
let path = join(root, entry.name);
|
914
|
+
|
915
|
+
let { isSymlink, isDirectory } = entry;
|
916
|
+
|
917
|
+
if (isSymlink) {
|
918
|
+
if (!followSymlinks) {
|
919
|
+
if (includeSymlinks && include(path, exts, match, skip)) {
|
920
|
+
yield { path, ...entry };
|
921
|
+
}
|
922
|
+
continue;
|
923
|
+
}
|
924
|
+
const realPath = dntShim.Deno.realPathSync(path);
|
925
|
+
if (canonicalize) {
|
926
|
+
path = realPath;
|
927
|
+
}
|
928
|
+
// Caveat emptor: don't assume |path| is not a symlink. realpath()
|
929
|
+
// resolves symlinks but another process can replace the file system
|
930
|
+
// entity with a different type of entity before we call lstat().
|
931
|
+
({ isSymlink, isDirectory } = dntShim.Deno.lstatSync(realPath));
|
932
|
+
}
|
933
|
+
|
934
|
+
if (isSymlink || isDirectory) {
|
935
|
+
const opts: WalkOptions = {
|
936
|
+
maxDepth: maxDepth - 1,
|
937
|
+
includeFiles,
|
938
|
+
includeDirs,
|
939
|
+
includeSymlinks,
|
940
|
+
followSymlinks,
|
941
|
+
};
|
942
|
+
if (exts !== undefined) {
|
943
|
+
opts.exts = exts;
|
944
|
+
}
|
945
|
+
if (match !== undefined) {
|
946
|
+
opts.match = match;
|
947
|
+
}
|
948
|
+
if (skip !== undefined) {
|
949
|
+
opts.skip = skip;
|
950
|
+
}
|
951
|
+
yield* walkSync(path, opts);
|
952
|
+
} else if (includeFiles && include(path, exts, match, skip)) {
|
953
|
+
yield { path, ...entry };
|
954
|
+
}
|
955
|
+
}
|
956
|
+
}
|