@mtkruto/node 0.1.113 → 0.1.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/0_deps.d.ts +3 -2
- package/esm/0_deps.js +3 -2
- package/esm/1_utilities.d.ts +1 -0
- package/esm/1_utilities.js +1 -0
- package/esm/3_types.d.ts +0 -1
- package/esm/3_types.js +0 -1
- package/esm/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/client/0_utilities.d.ts +6 -0
- package/esm/client/0_utilities.js +53 -0
- package/esm/client/3_types.d.ts +60 -2
- package/esm/client/5_client.d.ts +44 -6
- package/esm/client/5_client.js +170 -42
- package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/base64.d.ts +2 -2
- package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/base64.js +2 -2
- package/{script/deps/deno.land/std@0.204.0 → esm/deps/deno.land/std@0.207.0}/fmt/colors.d.ts +1 -1
- package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/fmt/colors.js +1 -1
- package/esm/deps/deno.land/std@0.207.0/path/_common/assert_path.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/assert_path.js +7 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/basename.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/basename.js +40 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/common.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/common.js +23 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/constants.d.ts +39 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/constants.js +46 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/dirname.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/dirname.js +8 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/format.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/format.js +19 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/from_file_url.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/from_file_url.js +9 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/glob_to_reg_exp.d.ts +27 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/glob_to_reg_exp.js +235 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/normalize.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/normalize.js +8 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/normalize_string.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/normalize_string.js +77 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/relative.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/relative.js +9 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/strip_trailing_separators.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/strip_trailing_separators.js +19 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/to_file_url.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/to_file_url.js +15 -0
- package/esm/deps/deno.land/std@0.207.0/path/_interface.d.ts +26 -0
- package/esm/deps/deno.land/std@0.207.0/path/_interface.js +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/_os.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/_os.js +18 -0
- package/esm/deps/deno.land/std@0.207.0/path/basename.d.ts +8 -0
- package/esm/deps/deno.land/std@0.207.0/path/basename.js +17 -0
- package/esm/deps/deno.land/std@0.207.0/path/common.d.ts +13 -0
- package/esm/deps/deno.land/std@0.207.0/path/common.js +19 -0
- package/esm/deps/deno.land/std@0.207.0/path/dirname.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/dirname.js +12 -0
- package/esm/deps/deno.land/std@0.207.0/path/extname.d.ts +6 -0
- package/esm/deps/deno.land/std@0.207.0/path/extname.js +13 -0
- package/esm/deps/deno.land/std@0.207.0/path/format.d.ts +6 -0
- package/esm/deps/deno.land/std@0.207.0/path/format.js +12 -0
- package/esm/deps/deno.land/std@0.207.0/path/from_file_url.d.ts +17 -0
- package/esm/deps/deno.land/std@0.207.0/path/from_file_url.js +24 -0
- package/esm/deps/deno.land/std@0.207.0/path/glob_to_regexp.d.ts +61 -0
- package/esm/deps/deno.land/std@0.207.0/path/glob_to_regexp.js +65 -0
- package/esm/deps/deno.land/std@0.207.0/path/is_absolute.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/is_absolute.js +12 -0
- package/esm/deps/deno.land/std@0.207.0/path/is_glob.d.ts +2 -0
- package/esm/deps/deno.land/std@0.207.0/path/is_glob.js +28 -0
- package/esm/deps/deno.land/std@0.207.0/path/join.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/join.js +12 -0
- package/esm/deps/deno.land/std@0.207.0/path/join_globs.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/join_globs.js +11 -0
- package/esm/deps/deno.land/std@0.207.0/path/mod.d.ts +28 -0
- package/esm/deps/deno.land/std@0.207.0/path/mod.js +63 -0
- package/esm/deps/deno.land/std@0.207.0/path/normalize.d.ts +7 -0
- package/esm/deps/deno.land/std@0.207.0/path/normalize.js +14 -0
- package/esm/deps/deno.land/std@0.207.0/path/normalize_glob.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/normalize_glob.js +11 -0
- package/esm/deps/deno.land/std@0.207.0/path/parse.d.ts +6 -0
- package/esm/deps/deno.land/std@0.207.0/path/parse.js +12 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/_util.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/_util.js +8 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/basename.d.ts +8 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/basename.js +18 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/common.d.ts +13 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/common.js +19 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/dirname.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/dirname.js +36 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/extname.d.ts +6 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/extname.js +59 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/format.d.ts +6 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/format.js +11 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/from_file_url.d.ts +11 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/from_file_url.js +17 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/glob_to_regexp.d.ts +57 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/glob_to_regexp.js +69 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/is_absolute.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/is_absolute.js +12 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/is_glob.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/is_glob.js +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/join.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/join.js +26 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/join_globs.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/join_globs.js +26 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/mod.d.ts +40 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/mod.js +44 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/normalize.d.ts +7 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/normalize.js +25 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/normalize_glob.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/normalize_glob.js +16 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/parse.d.ts +6 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/parse.js +98 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/relative.d.ts +7 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/relative.js +94 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/resolve.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/resolve.js +48 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/separator.d.ts +2 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/separator.js +4 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/to_file_url.d.ts +11 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/to_file_url.js +22 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/to_namespaced_path.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/to_namespaced_path.js +10 -0
- package/esm/deps/deno.land/std@0.207.0/path/relative.d.ts +12 -0
- package/esm/deps/deno.land/std@0.207.0/path/relative.js +19 -0
- package/esm/deps/deno.land/std@0.207.0/path/resolve.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/resolve.js +14 -0
- package/esm/deps/deno.land/std@0.207.0/path/separator.d.ts +2 -0
- package/esm/deps/deno.land/std@0.207.0/path/separator.js +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/to_file_url.d.ts +17 -0
- package/esm/deps/deno.land/std@0.207.0/path/to_file_url.js +24 -0
- package/esm/deps/deno.land/std@0.207.0/path/to_namespaced_path.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/to_namespaced_path.js +14 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/_util.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/_util.js +15 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/basename.d.ts +8 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/basename.js +30 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/common.d.ts +13 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/common.js +19 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/dirname.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/dirname.js +98 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/extname.d.ts +6 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/extname.js +68 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/format.d.ts +6 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/format.js +11 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/from_file_url.d.ts +13 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/from_file_url.js +26 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/glob_to_regexp.d.ts +57 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/glob_to_regexp.js +69 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/is_absolute.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/is_absolute.js +27 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/is_glob.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/is_glob.js +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/join.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/join.js +72 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/join_globs.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/join_globs.js +26 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/mod.d.ts +40 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/mod.js +44 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/normalize.d.ts +7 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/normalize.js +130 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/normalize_glob.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/normalize_glob.js +16 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/parse.d.ts +6 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/parse.js +159 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/relative.d.ts +12 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/relative.js +121 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/resolve.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/resolve.js +143 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/separator.d.ts +2 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/separator.js +4 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/to_file_url.d.ts +13 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/to_file_url.js +31 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/to_namespaced_path.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/to_namespaced_path.js +38 -0
- package/esm/mod.d.ts +1 -1
- package/esm/mod.js +1 -1
- package/esm/types/1_chat.d.ts +2 -3
- package/esm/types/1_chat.js +4 -5
- package/esm/types/1_user.d.ts +2 -3
- package/esm/types/1_user.js +2 -3
- package/esm/utilities/0_color.d.ts +3 -0
- package/esm/utilities/0_color.js +55 -0
- package/package.json +1 -1
- package/script/0_deps.d.ts +3 -2
- package/script/0_deps.js +18 -5
- package/script/1_utilities.d.ts +1 -0
- package/script/1_utilities.js +1 -0
- package/script/3_types.d.ts +0 -1
- package/script/3_types.js +0 -1
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/client/0_utilities.d.ts +6 -0
- package/script/client/0_utilities.js +79 -1
- package/script/client/3_types.d.ts +60 -2
- package/script/client/5_client.d.ts +44 -6
- package/script/client/5_client.js +169 -41
- package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/base64.d.ts +2 -2
- package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/base64.js +2 -2
- package/{esm/deps/deno.land/std@0.204.0 → script/deps/deno.land/std@0.207.0}/fmt/colors.d.ts +1 -1
- package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/fmt/colors.js +1 -1
- package/script/deps/deno.land/std@0.207.0/path/_common/assert_path.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/assert_path.js +11 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/basename.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/basename.js +46 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/common.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/common.js +27 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/constants.d.ts +39 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/constants.js +49 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/dirname.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/dirname.js +12 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/format.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/format.js +24 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/from_file_url.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/from_file_url.js +13 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/glob_to_reg_exp.d.ts +27 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/glob_to_reg_exp.js +239 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/normalize.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/normalize.js +12 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/normalize_string.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/normalize_string.js +81 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/relative.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/relative.js +13 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/strip_trailing_separators.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/strip_trailing_separators.js +23 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/to_file_url.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/to_file_url.js +19 -0
- package/script/deps/deno.land/std@0.207.0/path/_interface.d.ts +26 -0
- package/script/deps/deno.land/std@0.207.0/path/_interface.js +4 -0
- package/script/deps/deno.land/std@0.207.0/path/_os.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/_os.js +44 -0
- package/script/deps/deno.land/std@0.207.0/path/basename.d.ts +8 -0
- package/script/deps/deno.land/std@0.207.0/path/basename.js +21 -0
- package/script/deps/deno.land/std@0.207.0/path/common.d.ts +13 -0
- package/script/deps/deno.land/std@0.207.0/path/common.js +23 -0
- package/script/deps/deno.land/std@0.207.0/path/dirname.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/dirname.js +16 -0
- package/script/deps/deno.land/std@0.207.0/path/extname.d.ts +6 -0
- package/script/deps/deno.land/std@0.207.0/path/extname.js +17 -0
- package/script/deps/deno.land/std@0.207.0/path/format.d.ts +6 -0
- package/script/deps/deno.land/std@0.207.0/path/format.js +16 -0
- package/script/deps/deno.land/std@0.207.0/path/from_file_url.d.ts +17 -0
- package/script/deps/deno.land/std@0.207.0/path/from_file_url.js +28 -0
- package/script/deps/deno.land/std@0.207.0/path/glob_to_regexp.d.ts +61 -0
- package/script/deps/deno.land/std@0.207.0/path/glob_to_regexp.js +69 -0
- package/script/deps/deno.land/std@0.207.0/path/is_absolute.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/is_absolute.js +16 -0
- package/script/deps/deno.land/std@0.207.0/path/is_glob.d.ts +2 -0
- package/script/deps/deno.land/std@0.207.0/path/is_glob.js +32 -0
- package/script/deps/deno.land/std@0.207.0/path/join.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/join.js +16 -0
- package/script/deps/deno.land/std@0.207.0/path/join_globs.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/join_globs.js +15 -0
- package/script/deps/deno.land/std@0.207.0/path/mod.d.ts +28 -0
- package/script/deps/deno.land/std@0.207.0/path/mod.js +92 -0
- package/script/deps/deno.land/std@0.207.0/path/normalize.d.ts +7 -0
- package/script/deps/deno.land/std@0.207.0/path/normalize.js +18 -0
- package/script/deps/deno.land/std@0.207.0/path/normalize_glob.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/normalize_glob.js +15 -0
- package/script/deps/deno.land/std@0.207.0/path/parse.d.ts +6 -0
- package/script/deps/deno.land/std@0.207.0/path/parse.js +16 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/_util.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/_util.js +12 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/basename.d.ts +8 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/basename.js +22 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/common.d.ts +13 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/common.js +23 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/dirname.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/dirname.js +40 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/extname.d.ts +6 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/extname.js +63 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/format.d.ts +6 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/format.js +15 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/from_file_url.d.ts +11 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/from_file_url.js +21 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/glob_to_regexp.d.ts +57 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/glob_to_regexp.js +73 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/is_absolute.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/is_absolute.js +16 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/is_glob.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/is_glob.js +7 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/join.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/join.js +30 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/join_globs.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/join_globs.js +30 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/mod.d.ts +40 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/mod.js +61 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/normalize.d.ts +7 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/normalize.js +29 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/normalize_glob.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/normalize_glob.js +20 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/parse.d.ts +6 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/parse.js +102 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/relative.d.ts +7 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/relative.js +98 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/resolve.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/resolve.js +75 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/separator.d.ts +2 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/separator.js +7 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/to_file_url.d.ts +11 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/to_file_url.js +26 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/to_namespaced_path.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/to_namespaced_path.js +14 -0
- package/script/deps/deno.land/std@0.207.0/path/relative.d.ts +12 -0
- package/script/deps/deno.land/std@0.207.0/path/relative.js +23 -0
- package/script/deps/deno.land/std@0.207.0/path/resolve.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/resolve.js +18 -0
- package/script/deps/deno.land/std@0.207.0/path/separator.d.ts +2 -0
- package/script/deps/deno.land/std@0.207.0/path/separator.js +8 -0
- package/script/deps/deno.land/std@0.207.0/path/to_file_url.d.ts +17 -0
- package/script/deps/deno.land/std@0.207.0/path/to_file_url.js +28 -0
- package/script/deps/deno.land/std@0.207.0/path/to_namespaced_path.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/to_namespaced_path.js +18 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/_util.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/_util.js +21 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/basename.d.ts +8 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/basename.js +34 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/common.d.ts +13 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/common.js +23 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/dirname.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/dirname.js +102 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/extname.d.ts +6 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/extname.js +72 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/format.d.ts +6 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/format.js +15 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/from_file_url.d.ts +13 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/from_file_url.js +30 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/glob_to_regexp.d.ts +57 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/glob_to_regexp.js +73 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/is_absolute.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/is_absolute.js +31 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/is_glob.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/is_glob.js +7 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/join.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/join.js +76 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/join_globs.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/join_globs.js +30 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/mod.d.ts +40 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/mod.js +61 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/normalize.d.ts +7 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/normalize.js +134 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/normalize_glob.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/normalize_glob.js +20 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/parse.d.ts +6 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/parse.js +163 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/relative.d.ts +12 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/relative.js +125 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/resolve.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/resolve.js +170 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/separator.d.ts +2 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/separator.js +7 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/to_file_url.d.ts +13 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/to_file_url.js +35 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/to_namespaced_path.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/to_namespaced_path.js +42 -0
- package/script/mod.d.ts +1 -1
- package/script/mod.js +3 -1
- package/script/types/1_chat.d.ts +2 -3
- package/script/types/1_chat.js +4 -5
- package/script/types/1_user.d.ts +2 -3
- package/script/types/1_user.js +1 -2
- package/script/utilities/0_color.d.ts +3 -0
- package/script/utilities/0_color.js +60 -0
- package/esm/types/0_color.d.ts +0 -3
- package/esm/types/0_color.js +0 -36
- package/script/types/0_color.d.ts +0 -3
- package/script/types/0_color.js +0 -41
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_constants.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_constants.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_diff.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_diff.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_format.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_almost_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_almost_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_array_includes.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_array_includes.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_exists.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_exists.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_false.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_false.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater_or_equal.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater_or_equal.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_instance_of.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_instance_of.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_is_error.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_is_error.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less_or_equal.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less_or_equal.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_match.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_match.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_instance_of.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_instance_of.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_match.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_match.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_strict_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_strict_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_object_match.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_object_match.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_rejects.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_rejects.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_strict_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_strict_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_string_includes.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_string_includes.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_throws.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_throws.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assertion_error.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assertion_error.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/equal.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/equal.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/fail.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/fail.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/mod.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/mod.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unimplemented.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unimplemented.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unreachable.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unreachable.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/_util.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/_util.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_constants.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_constants.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_diff.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_diff.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_format.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_format.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_almost_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_almost_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_array_includes.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_array_includes.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_exists.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_exists.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_false.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_false.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater_or_equal.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater_or_equal.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_instance_of.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_instance_of.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_is_error.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_is_error.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less_or_equal.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less_or_equal.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_match.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_match.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_instance_of.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_instance_of.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_match.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_match.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_strict_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_strict_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_object_match.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_object_match.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_rejects.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_rejects.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_strict_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_strict_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_string_includes.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_string_includes.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_throws.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_throws.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assertion_error.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assertion_error.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/equal.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/equal.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/fail.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/fail.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/mod.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/mod.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unimplemented.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unimplemented.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unreachable.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unreachable.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/_util.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/_util.js +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { encodeWhitespace } from "../_common/to_file_url.js";
|
|
4
|
+
import { isAbsolute } from "./is_absolute.js";
|
|
5
|
+
/**
|
|
6
|
+
* Converts a path string to a file URL.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { toFileUrl } from "https://deno.land/std@$STD_VERSION/path/posix.ts";
|
|
10
|
+
*
|
|
11
|
+
* toFileUrl("/home/foo"); // new URL("file:///home/foo")
|
|
12
|
+
* ```
|
|
13
|
+
* @param path to convert to file URL
|
|
14
|
+
*/
|
|
15
|
+
export function toFileUrl(path) {
|
|
16
|
+
if (!isAbsolute(path)) {
|
|
17
|
+
throw new TypeError("Must be an absolute path.");
|
|
18
|
+
}
|
|
19
|
+
const url = new URL("file:///");
|
|
20
|
+
url.pathname = encodeWhitespace(path.replace(/%/g, "%25").replace(/\\/g, "%5C"));
|
|
21
|
+
return url;
|
|
22
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
/**
|
|
4
|
+
* Resolves path to a namespace path
|
|
5
|
+
* @param path to resolve to namespace
|
|
6
|
+
*/
|
|
7
|
+
export function toNamespacedPath(path) {
|
|
8
|
+
// Non-op on posix systems
|
|
9
|
+
return path;
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return the relative path from `from` to `to` based on current working directory.
|
|
3
|
+
*
|
|
4
|
+
* An example in windws, for instance:
|
|
5
|
+
* from = 'C:\\orandea\\test\\aaa'
|
|
6
|
+
* to = 'C:\\orandea\\impl\\bbb'
|
|
7
|
+
* The output of the function should be: '..\\..\\impl\\bbb'
|
|
8
|
+
*
|
|
9
|
+
* @param from path in current working directory
|
|
10
|
+
* @param to path in current working directory
|
|
11
|
+
*/
|
|
12
|
+
export declare function relative(from: string, to: string): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { isWindows } from "./_os.js";
|
|
4
|
+
import { relative as posixRelative } from "./posix/relative.js";
|
|
5
|
+
import { relative as windowsRelative } from "./windows/relative.js";
|
|
6
|
+
/**
|
|
7
|
+
* Return the relative path from `from` to `to` based on current working directory.
|
|
8
|
+
*
|
|
9
|
+
* An example in windws, for instance:
|
|
10
|
+
* from = 'C:\\orandea\\test\\aaa'
|
|
11
|
+
* to = 'C:\\orandea\\impl\\bbb'
|
|
12
|
+
* The output of the function should be: '..\\..\\impl\\bbb'
|
|
13
|
+
*
|
|
14
|
+
* @param from path in current working directory
|
|
15
|
+
* @param to path in current working directory
|
|
16
|
+
*/
|
|
17
|
+
export function relative(from, to) {
|
|
18
|
+
return isWindows ? windowsRelative(from, to) : posixRelative(from, to);
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { isWindows } from "./_os.js";
|
|
4
|
+
import { resolve as posixResolve } from "./posix/resolve.js";
|
|
5
|
+
import { resolve as windowsResolve } from "./windows/resolve.js";
|
|
6
|
+
/**
|
|
7
|
+
* Resolves path segments into a `path`
|
|
8
|
+
* @param pathSegments to process to path
|
|
9
|
+
*/
|
|
10
|
+
export function resolve(...pathSegments) {
|
|
11
|
+
return isWindows
|
|
12
|
+
? windowsResolve(...pathSegments)
|
|
13
|
+
: posixResolve(...pathSegments);
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a path string to a file URL.
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { toFileUrl } from "https://deno.land/std@$STD_VERSION/path/to_file_url.ts";
|
|
6
|
+
*
|
|
7
|
+
* // posix
|
|
8
|
+
* toFileUrl("/home/foo"); // new URL("file:///home/foo")
|
|
9
|
+
*
|
|
10
|
+
* // win32
|
|
11
|
+
* toFileUrl("\\home\\foo"); // new URL("file:///home/foo")
|
|
12
|
+
* toFileUrl("C:\\Users\\foo"); // new URL("file:///C:/Users/foo")
|
|
13
|
+
* toFileUrl("\\\\127.0.0.1\\home\\foo"); // new URL("file://127.0.0.1/home/foo")
|
|
14
|
+
* ```
|
|
15
|
+
* @param path to convert to file URL
|
|
16
|
+
*/
|
|
17
|
+
export declare function toFileUrl(path: string): URL;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { isWindows } from "./_os.js";
|
|
4
|
+
import { toFileUrl as posixToFileUrl } from "./posix/to_file_url.js";
|
|
5
|
+
import { toFileUrl as windowsToFileUrl } from "./windows/to_file_url.js";
|
|
6
|
+
/**
|
|
7
|
+
* Converts a path string to a file URL.
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { toFileUrl } from "https://deno.land/std@$STD_VERSION/path/to_file_url.ts";
|
|
11
|
+
*
|
|
12
|
+
* // posix
|
|
13
|
+
* toFileUrl("/home/foo"); // new URL("file:///home/foo")
|
|
14
|
+
*
|
|
15
|
+
* // win32
|
|
16
|
+
* toFileUrl("\\home\\foo"); // new URL("file:///home/foo")
|
|
17
|
+
* toFileUrl("C:\\Users\\foo"); // new URL("file:///C:/Users/foo")
|
|
18
|
+
* toFileUrl("\\\\127.0.0.1\\home\\foo"); // new URL("file://127.0.0.1/home/foo")
|
|
19
|
+
* ```
|
|
20
|
+
* @param path to convert to file URL
|
|
21
|
+
*/
|
|
22
|
+
export function toFileUrl(path) {
|
|
23
|
+
return isWindows ? windowsToFileUrl(path) : posixToFileUrl(path);
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { isWindows } from "./_os.js";
|
|
4
|
+
import { toNamespacedPath as posixToNamespacedPath } from "./posix/to_namespaced_path.js";
|
|
5
|
+
import { toNamespacedPath as windowsToNamespacedPath } from "./windows/to_namespaced_path.js";
|
|
6
|
+
/**
|
|
7
|
+
* Resolves path to a namespace path
|
|
8
|
+
* @param path to resolve to namespace
|
|
9
|
+
*/
|
|
10
|
+
export function toNamespacedPath(path) {
|
|
11
|
+
return isWindows
|
|
12
|
+
? windowsToNamespacedPath(path)
|
|
13
|
+
: posixToNamespacedPath(path);
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// Copyright the Browserify authors. MIT License.
|
|
3
|
+
// Ported from https://github.com/browserify/path-browserify/
|
|
4
|
+
// This module is browser compatible.
|
|
5
|
+
import { CHAR_BACKWARD_SLASH, CHAR_FORWARD_SLASH, CHAR_LOWERCASE_A, CHAR_LOWERCASE_Z, CHAR_UPPERCASE_A, CHAR_UPPERCASE_Z, } from "../_common/constants.js";
|
|
6
|
+
export function isPosixPathSeparator(code) {
|
|
7
|
+
return code === CHAR_FORWARD_SLASH;
|
|
8
|
+
}
|
|
9
|
+
export function isPathSeparator(code) {
|
|
10
|
+
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
11
|
+
}
|
|
12
|
+
export function isWindowsDeviceRoot(code) {
|
|
13
|
+
return ((code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z) ||
|
|
14
|
+
(code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z));
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return the last portion of a `path`.
|
|
3
|
+
* Trailing directory separators are ignored, and optional suffix is removed.
|
|
4
|
+
*
|
|
5
|
+
* @param path - path to extract the name from.
|
|
6
|
+
* @param [suffix] - suffix to remove from extracted name.
|
|
7
|
+
*/
|
|
8
|
+
export declare function basename(path: string, suffix?: string): string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { assertArgs, lastPathSegment, stripSuffix, } from "../_common/basename.js";
|
|
4
|
+
import { CHAR_COLON } from "../_common/constants.js";
|
|
5
|
+
import { stripTrailingSeparators } from "../_common/strip_trailing_separators.js";
|
|
6
|
+
import { isPathSeparator, isWindowsDeviceRoot } from "./_util.js";
|
|
7
|
+
/**
|
|
8
|
+
* Return the last portion of a `path`.
|
|
9
|
+
* Trailing directory separators are ignored, and optional suffix is removed.
|
|
10
|
+
*
|
|
11
|
+
* @param path - path to extract the name from.
|
|
12
|
+
* @param [suffix] - suffix to remove from extracted name.
|
|
13
|
+
*/
|
|
14
|
+
export function basename(path, suffix = "") {
|
|
15
|
+
assertArgs(path, suffix);
|
|
16
|
+
// Check for a drive letter prefix so as not to mistake the following
|
|
17
|
+
// path separator as an extra separator at the end of the path that can be
|
|
18
|
+
// disregarded
|
|
19
|
+
let start = 0;
|
|
20
|
+
if (path.length >= 2) {
|
|
21
|
+
const drive = path.charCodeAt(0);
|
|
22
|
+
if (isWindowsDeviceRoot(drive)) {
|
|
23
|
+
if (path.charCodeAt(1) === CHAR_COLON)
|
|
24
|
+
start = 2;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const lastSegment = lastPathSegment(path, isPathSeparator, start);
|
|
28
|
+
const strippedSegment = stripTrailingSeparators(lastSegment, isPathSeparator);
|
|
29
|
+
return suffix ? stripSuffix(strippedSegment, suffix) : strippedSegment;
|
|
30
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Determines the common path from a set of paths, using an optional separator,
|
|
2
|
+
* which defaults to the OS default separator.
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { common } from "https://deno.land/std@$STD_VERSION/path/mod.ts";
|
|
6
|
+
* const p = common([
|
|
7
|
+
* "./deno/std/path/mod.ts",
|
|
8
|
+
* "./deno/std/fs/mod.ts",
|
|
9
|
+
* ]);
|
|
10
|
+
* console.log(p); // "./deno/std/"
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare function common(paths: string[], sep?: string): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { _common } from "../_common/common.js";
|
|
4
|
+
import { SEP } from "./separator.js";
|
|
5
|
+
/** Determines the common path from a set of paths, using an optional separator,
|
|
6
|
+
* which defaults to the OS default separator.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { common } from "https://deno.land/std@$STD_VERSION/path/mod.ts";
|
|
10
|
+
* const p = common([
|
|
11
|
+
* "./deno/std/path/mod.ts",
|
|
12
|
+
* "./deno/std/fs/mod.ts",
|
|
13
|
+
* ]);
|
|
14
|
+
* console.log(p); // "./deno/std/"
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export function common(paths, sep = SEP) {
|
|
18
|
+
return _common(paths, sep);
|
|
19
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { assertArg } from "../_common/dirname.js";
|
|
4
|
+
import { CHAR_COLON } from "../_common/constants.js";
|
|
5
|
+
import { stripTrailingSeparators } from "../_common/strip_trailing_separators.js";
|
|
6
|
+
import { isPathSeparator, isPosixPathSeparator, isWindowsDeviceRoot, } from "./_util.js";
|
|
7
|
+
/**
|
|
8
|
+
* Return the directory path of a `path`.
|
|
9
|
+
* @param path - path to extract the directory from.
|
|
10
|
+
*/
|
|
11
|
+
export function dirname(path) {
|
|
12
|
+
assertArg(path);
|
|
13
|
+
const len = path.length;
|
|
14
|
+
let rootEnd = -1;
|
|
15
|
+
let end = -1;
|
|
16
|
+
let matchedSlash = true;
|
|
17
|
+
let offset = 0;
|
|
18
|
+
const code = path.charCodeAt(0);
|
|
19
|
+
// Try to match a root
|
|
20
|
+
if (len > 1) {
|
|
21
|
+
if (isPathSeparator(code)) {
|
|
22
|
+
// Possible UNC root
|
|
23
|
+
rootEnd = offset = 1;
|
|
24
|
+
if (isPathSeparator(path.charCodeAt(1))) {
|
|
25
|
+
// Matched double path separator at beginning
|
|
26
|
+
let j = 2;
|
|
27
|
+
let last = j;
|
|
28
|
+
// Match 1 or more non-path separators
|
|
29
|
+
for (; j < len; ++j) {
|
|
30
|
+
if (isPathSeparator(path.charCodeAt(j)))
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
if (j < len && j !== last) {
|
|
34
|
+
// Matched!
|
|
35
|
+
last = j;
|
|
36
|
+
// Match 1 or more path separators
|
|
37
|
+
for (; j < len; ++j) {
|
|
38
|
+
if (!isPathSeparator(path.charCodeAt(j)))
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
if (j < len && j !== last) {
|
|
42
|
+
// Matched!
|
|
43
|
+
last = j;
|
|
44
|
+
// Match 1 or more non-path separators
|
|
45
|
+
for (; j < len; ++j) {
|
|
46
|
+
if (isPathSeparator(path.charCodeAt(j)))
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
if (j === len) {
|
|
50
|
+
// We matched a UNC root only
|
|
51
|
+
return path;
|
|
52
|
+
}
|
|
53
|
+
if (j !== last) {
|
|
54
|
+
// We matched a UNC root with leftovers
|
|
55
|
+
// Offset by 1 to include the separator after the UNC root to
|
|
56
|
+
// treat it as a "normal root" on top of a (UNC) root
|
|
57
|
+
rootEnd = offset = j + 1;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else if (isWindowsDeviceRoot(code)) {
|
|
64
|
+
// Possible device root
|
|
65
|
+
if (path.charCodeAt(1) === CHAR_COLON) {
|
|
66
|
+
rootEnd = offset = 2;
|
|
67
|
+
if (len > 2) {
|
|
68
|
+
if (isPathSeparator(path.charCodeAt(2)))
|
|
69
|
+
rootEnd = offset = 3;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
else if (isPathSeparator(code)) {
|
|
75
|
+
// `path` contains just a path separator, exit early to avoid
|
|
76
|
+
// unnecessary work
|
|
77
|
+
return path;
|
|
78
|
+
}
|
|
79
|
+
for (let i = len - 1; i >= offset; --i) {
|
|
80
|
+
if (isPathSeparator(path.charCodeAt(i))) {
|
|
81
|
+
if (!matchedSlash) {
|
|
82
|
+
end = i;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
// We saw the first non-path separator
|
|
88
|
+
matchedSlash = false;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (end === -1) {
|
|
92
|
+
if (rootEnd === -1)
|
|
93
|
+
return ".";
|
|
94
|
+
else
|
|
95
|
+
end = rootEnd;
|
|
96
|
+
}
|
|
97
|
+
return stripTrailingSeparators(path.slice(0, end), isPosixPathSeparator);
|
|
98
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { CHAR_COLON, CHAR_DOT } from "../_common/constants.js";
|
|
4
|
+
import { assertPath } from "../_common/assert_path.js";
|
|
5
|
+
import { isPathSeparator, isWindowsDeviceRoot } from "./_util.js";
|
|
6
|
+
/**
|
|
7
|
+
* Return the extension of the `path` with leading period.
|
|
8
|
+
* @param path with extension
|
|
9
|
+
* @returns extension (ex. for `file.ts` returns `.ts`)
|
|
10
|
+
*/
|
|
11
|
+
export function extname(path) {
|
|
12
|
+
assertPath(path);
|
|
13
|
+
let start = 0;
|
|
14
|
+
let startDot = -1;
|
|
15
|
+
let startPart = 0;
|
|
16
|
+
let end = -1;
|
|
17
|
+
let matchedSlash = true;
|
|
18
|
+
// Track the state of characters (if any) we see before our first dot and
|
|
19
|
+
// after any path separator we find
|
|
20
|
+
let preDotState = 0;
|
|
21
|
+
// Check for a drive letter prefix so as not to mistake the following
|
|
22
|
+
// path separator as an extra separator at the end of the path that can be
|
|
23
|
+
// disregarded
|
|
24
|
+
if (path.length >= 2 &&
|
|
25
|
+
path.charCodeAt(1) === CHAR_COLON &&
|
|
26
|
+
isWindowsDeviceRoot(path.charCodeAt(0))) {
|
|
27
|
+
start = startPart = 2;
|
|
28
|
+
}
|
|
29
|
+
for (let i = path.length - 1; i >= start; --i) {
|
|
30
|
+
const code = path.charCodeAt(i);
|
|
31
|
+
if (isPathSeparator(code)) {
|
|
32
|
+
// If we reached a path separator that was not part of a set of path
|
|
33
|
+
// separators at the end of the string, stop now
|
|
34
|
+
if (!matchedSlash) {
|
|
35
|
+
startPart = i + 1;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (end === -1) {
|
|
41
|
+
// We saw the first non-path separator, mark this as the end of our
|
|
42
|
+
// extension
|
|
43
|
+
matchedSlash = false;
|
|
44
|
+
end = i + 1;
|
|
45
|
+
}
|
|
46
|
+
if (code === CHAR_DOT) {
|
|
47
|
+
// If this is our first dot, mark it as the start of our extension
|
|
48
|
+
if (startDot === -1)
|
|
49
|
+
startDot = i;
|
|
50
|
+
else if (preDotState !== 1)
|
|
51
|
+
preDotState = 1;
|
|
52
|
+
}
|
|
53
|
+
else if (startDot !== -1) {
|
|
54
|
+
// We saw a non-dot and non-path separator before our dot, so we should
|
|
55
|
+
// have a good chance at having a non-empty extension
|
|
56
|
+
preDotState = -1;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (startDot === -1 ||
|
|
60
|
+
end === -1 ||
|
|
61
|
+
// We saw a non-dot character immediately before the dot
|
|
62
|
+
preDotState === 0 ||
|
|
63
|
+
// The (right-most) trimmed path component is exactly '..'
|
|
64
|
+
(preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)) {
|
|
65
|
+
return "";
|
|
66
|
+
}
|
|
67
|
+
return path.slice(startDot, end);
|
|
68
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { _format, assertArg } from "../_common/format.js";
|
|
4
|
+
/**
|
|
5
|
+
* Generate a path from `FormatInputPathObject` object.
|
|
6
|
+
* @param pathObject with path
|
|
7
|
+
*/
|
|
8
|
+
export function format(pathObject) {
|
|
9
|
+
assertArg(pathObject);
|
|
10
|
+
return _format("\\", pathObject);
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a file URL to a path string.
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { fromFileUrl } from "https://deno.land/std@$STD_VERSION/path/win32.ts";
|
|
6
|
+
*
|
|
7
|
+
* fromFileUrl("file:///home/foo"); // "\\home\\foo"
|
|
8
|
+
* fromFileUrl("file:///C:/Users/foo"); // "C:\\Users\\foo"
|
|
9
|
+
* fromFileUrl("file://localhost/home/foo"); // "\\\\localhost\\home\\foo"
|
|
10
|
+
* ```
|
|
11
|
+
* @param url of a file URL
|
|
12
|
+
*/
|
|
13
|
+
export declare function fromFileUrl(url: URL | string): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { assertArg } from "../_common/from_file_url.js";
|
|
4
|
+
/**
|
|
5
|
+
* Converts a file URL to a path string.
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { fromFileUrl } from "https://deno.land/std@$STD_VERSION/path/win32.ts";
|
|
9
|
+
*
|
|
10
|
+
* fromFileUrl("file:///home/foo"); // "\\home\\foo"
|
|
11
|
+
* fromFileUrl("file:///C:/Users/foo"); // "C:\\Users\\foo"
|
|
12
|
+
* fromFileUrl("file://localhost/home/foo"); // "\\\\localhost\\home\\foo"
|
|
13
|
+
* ```
|
|
14
|
+
* @param url of a file URL
|
|
15
|
+
*/
|
|
16
|
+
export function fromFileUrl(url) {
|
|
17
|
+
url = assertArg(url);
|
|
18
|
+
let path = decodeURIComponent(url.pathname.replace(/\//g, "\\").replace(/%(?![0-9A-Fa-f]{2})/g, "%25")).replace(/^\\*([A-Za-z]:)(\\|$)/, "$1\\");
|
|
19
|
+
if (url.hostname !== "") {
|
|
20
|
+
// Note: The `URL` implementation guarantees that the drive letter and
|
|
21
|
+
// hostname are mutually exclusive. Otherwise it would not have been valid
|
|
22
|
+
// to append the hostname and path like this.
|
|
23
|
+
path = `\\\\${url.hostname}${path}`;
|
|
24
|
+
}
|
|
25
|
+
return path;
|
|
26
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { GlobToRegExpOptions } from "../_common/glob_to_reg_exp.js";
|
|
2
|
+
/** Convert a glob string to a regular expression.
|
|
3
|
+
*
|
|
4
|
+
* Tries to match bash glob expansion as closely as possible.
|
|
5
|
+
*
|
|
6
|
+
* Basic glob syntax:
|
|
7
|
+
* - `*` - Matches everything without leaving the path segment.
|
|
8
|
+
* - `?` - Matches any single character.
|
|
9
|
+
* - `{foo,bar}` - Matches `foo` or `bar`.
|
|
10
|
+
* - `[abcd]` - Matches `a`, `b`, `c` or `d`.
|
|
11
|
+
* - `[a-d]` - Matches `a`, `b`, `c` or `d`.
|
|
12
|
+
* - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
|
|
13
|
+
* - `[[:<class>:]]` - Matches any character belonging to `<class>`.
|
|
14
|
+
* - `[[:alnum:]]` - Matches any digit or letter.
|
|
15
|
+
* - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
|
|
16
|
+
* - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
|
|
17
|
+
* for a complete list of supported character classes.
|
|
18
|
+
* - `\` - Escapes the next character for an `os` other than `"windows"`.
|
|
19
|
+
* - \` - Escapes the next character for `os` set to `"windows"`.
|
|
20
|
+
* - `/` - Path separator.
|
|
21
|
+
* - `\` - Additional path separator only for `os` set to `"windows"`.
|
|
22
|
+
*
|
|
23
|
+
* Extended syntax:
|
|
24
|
+
* - Requires `{ extended: true }`.
|
|
25
|
+
* - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
|
|
26
|
+
* - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
|
|
27
|
+
* - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
|
|
28
|
+
* - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
|
|
29
|
+
* - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
|
|
30
|
+
* - See https://www.linuxjournal.com/content/bash-extended-globbing.
|
|
31
|
+
*
|
|
32
|
+
* Globstar syntax:
|
|
33
|
+
* - Requires `{ globstar: true }`.
|
|
34
|
+
* - `**` - Matches any number of any path segments.
|
|
35
|
+
* - Must comprise its entire path segment in the provided glob.
|
|
36
|
+
* - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
|
|
37
|
+
*
|
|
38
|
+
* Note the following properties:
|
|
39
|
+
* - The generated `RegExp` is anchored at both start and end.
|
|
40
|
+
* - Repeating and trailing separators are tolerated. Trailing separators in the
|
|
41
|
+
* provided glob have no meaning and are discarded.
|
|
42
|
+
* - Absolute globs will only match absolute paths, etc.
|
|
43
|
+
* - Empty globs will match nothing.
|
|
44
|
+
* - Any special glob syntax must be contained to one path segment. For example,
|
|
45
|
+
* `?(foo|bar/baz)` is invalid. The separator will take precedence and the
|
|
46
|
+
* first segment ends with an unclosed group.
|
|
47
|
+
* - If a path segment ends with unclosed groups or a dangling escape prefix, a
|
|
48
|
+
* parse error has occurred. Every character for that segment is taken
|
|
49
|
+
* literally in this event.
|
|
50
|
+
*
|
|
51
|
+
* Limitations:
|
|
52
|
+
* - A negative group like `!(foo|bar)` will wrongly be converted to a negative
|
|
53
|
+
* look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
|
|
54
|
+
* fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
|
|
55
|
+
* `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
|
|
56
|
+
* the group occurs not nested at the end of the segment. */
|
|
57
|
+
export declare function globToRegExp(glob: string, options?: GlobToRegExpOptions): RegExp;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { _globToRegExp, } from "../_common/glob_to_reg_exp.js";
|
|
4
|
+
const constants = {
|
|
5
|
+
sep: "(?:\\\\|/)+",
|
|
6
|
+
sepMaybe: "(?:\\\\|/)*",
|
|
7
|
+
seps: ["\\", "/"],
|
|
8
|
+
globstar: "(?:[^\\\\/]*(?:\\\\|/|$)+)*",
|
|
9
|
+
wildcard: "[^\\\\/]*",
|
|
10
|
+
escapePrefix: "`",
|
|
11
|
+
};
|
|
12
|
+
/** Convert a glob string to a regular expression.
|
|
13
|
+
*
|
|
14
|
+
* Tries to match bash glob expansion as closely as possible.
|
|
15
|
+
*
|
|
16
|
+
* Basic glob syntax:
|
|
17
|
+
* - `*` - Matches everything without leaving the path segment.
|
|
18
|
+
* - `?` - Matches any single character.
|
|
19
|
+
* - `{foo,bar}` - Matches `foo` or `bar`.
|
|
20
|
+
* - `[abcd]` - Matches `a`, `b`, `c` or `d`.
|
|
21
|
+
* - `[a-d]` - Matches `a`, `b`, `c` or `d`.
|
|
22
|
+
* - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
|
|
23
|
+
* - `[[:<class>:]]` - Matches any character belonging to `<class>`.
|
|
24
|
+
* - `[[:alnum:]]` - Matches any digit or letter.
|
|
25
|
+
* - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
|
|
26
|
+
* - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
|
|
27
|
+
* for a complete list of supported character classes.
|
|
28
|
+
* - `\` - Escapes the next character for an `os` other than `"windows"`.
|
|
29
|
+
* - \` - Escapes the next character for `os` set to `"windows"`.
|
|
30
|
+
* - `/` - Path separator.
|
|
31
|
+
* - `\` - Additional path separator only for `os` set to `"windows"`.
|
|
32
|
+
*
|
|
33
|
+
* Extended syntax:
|
|
34
|
+
* - Requires `{ extended: true }`.
|
|
35
|
+
* - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
|
|
36
|
+
* - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
|
|
37
|
+
* - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
|
|
38
|
+
* - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
|
|
39
|
+
* - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
|
|
40
|
+
* - See https://www.linuxjournal.com/content/bash-extended-globbing.
|
|
41
|
+
*
|
|
42
|
+
* Globstar syntax:
|
|
43
|
+
* - Requires `{ globstar: true }`.
|
|
44
|
+
* - `**` - Matches any number of any path segments.
|
|
45
|
+
* - Must comprise its entire path segment in the provided glob.
|
|
46
|
+
* - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
|
|
47
|
+
*
|
|
48
|
+
* Note the following properties:
|
|
49
|
+
* - The generated `RegExp` is anchored at both start and end.
|
|
50
|
+
* - Repeating and trailing separators are tolerated. Trailing separators in the
|
|
51
|
+
* provided glob have no meaning and are discarded.
|
|
52
|
+
* - Absolute globs will only match absolute paths, etc.
|
|
53
|
+
* - Empty globs will match nothing.
|
|
54
|
+
* - Any special glob syntax must be contained to one path segment. For example,
|
|
55
|
+
* `?(foo|bar/baz)` is invalid. The separator will take precedence and the
|
|
56
|
+
* first segment ends with an unclosed group.
|
|
57
|
+
* - If a path segment ends with unclosed groups or a dangling escape prefix, a
|
|
58
|
+
* parse error has occurred. Every character for that segment is taken
|
|
59
|
+
* literally in this event.
|
|
60
|
+
*
|
|
61
|
+
* Limitations:
|
|
62
|
+
* - A negative group like `!(foo|bar)` will wrongly be converted to a negative
|
|
63
|
+
* look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
|
|
64
|
+
* fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
|
|
65
|
+
* `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
|
|
66
|
+
* the group occurs not nested at the end of the segment. */
|
|
67
|
+
export function globToRegExp(glob, options = {}) {
|
|
68
|
+
return _globToRegExp(constants, glob, options);
|
|
69
|
+
}
|