@mtkruto/node 0.1.113 → 0.1.114
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 +56 -2
- package/esm/client/5_client.d.ts +43 -5
- package/esm/client/5_client.js +137 -4
- 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 +56 -2
- package/script/client/5_client.d.ts +43 -5
- package/script/client/5_client.js +136 -3
- 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,159 @@
|
|
|
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 a `ParsedPath` object of the `path`.
|
|
8
|
+
* @param path to process
|
|
9
|
+
*/
|
|
10
|
+
export function parse(path) {
|
|
11
|
+
assertPath(path);
|
|
12
|
+
const ret = { root: "", dir: "", base: "", ext: "", name: "" };
|
|
13
|
+
const len = path.length;
|
|
14
|
+
if (len === 0)
|
|
15
|
+
return ret;
|
|
16
|
+
let rootEnd = 0;
|
|
17
|
+
let code = path.charCodeAt(0);
|
|
18
|
+
// Try to match a root
|
|
19
|
+
if (len > 1) {
|
|
20
|
+
if (isPathSeparator(code)) {
|
|
21
|
+
// Possible UNC root
|
|
22
|
+
rootEnd = 1;
|
|
23
|
+
if (isPathSeparator(path.charCodeAt(1))) {
|
|
24
|
+
// Matched double path separator at beginning
|
|
25
|
+
let j = 2;
|
|
26
|
+
let last = j;
|
|
27
|
+
// Match 1 or more non-path separators
|
|
28
|
+
for (; j < len; ++j) {
|
|
29
|
+
if (isPathSeparator(path.charCodeAt(j)))
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
if (j < len && j !== last) {
|
|
33
|
+
// Matched!
|
|
34
|
+
last = j;
|
|
35
|
+
// Match 1 or more path separators
|
|
36
|
+
for (; j < len; ++j) {
|
|
37
|
+
if (!isPathSeparator(path.charCodeAt(j)))
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
if (j < len && j !== last) {
|
|
41
|
+
// Matched!
|
|
42
|
+
last = j;
|
|
43
|
+
// Match 1 or more non-path separators
|
|
44
|
+
for (; j < len; ++j) {
|
|
45
|
+
if (isPathSeparator(path.charCodeAt(j)))
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
if (j === len) {
|
|
49
|
+
// We matched a UNC root only
|
|
50
|
+
rootEnd = j;
|
|
51
|
+
}
|
|
52
|
+
else if (j !== last) {
|
|
53
|
+
// We matched a UNC root with leftovers
|
|
54
|
+
rootEnd = j + 1;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else if (isWindowsDeviceRoot(code)) {
|
|
61
|
+
// Possible device root
|
|
62
|
+
if (path.charCodeAt(1) === CHAR_COLON) {
|
|
63
|
+
rootEnd = 2;
|
|
64
|
+
if (len > 2) {
|
|
65
|
+
if (isPathSeparator(path.charCodeAt(2))) {
|
|
66
|
+
if (len === 3) {
|
|
67
|
+
// `path` contains just a drive root, exit early to avoid
|
|
68
|
+
// unnecessary work
|
|
69
|
+
ret.root = ret.dir = path;
|
|
70
|
+
ret.base = "\\";
|
|
71
|
+
return ret;
|
|
72
|
+
}
|
|
73
|
+
rootEnd = 3;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
// `path` contains just a relative drive root, exit early to avoid
|
|
78
|
+
// unnecessary work
|
|
79
|
+
ret.root = ret.dir = path;
|
|
80
|
+
return ret;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else if (isPathSeparator(code)) {
|
|
86
|
+
// `path` contains just a path separator, exit early to avoid
|
|
87
|
+
// unnecessary work
|
|
88
|
+
ret.root = ret.dir = path;
|
|
89
|
+
ret.base = "\\";
|
|
90
|
+
return ret;
|
|
91
|
+
}
|
|
92
|
+
if (rootEnd > 0)
|
|
93
|
+
ret.root = path.slice(0, rootEnd);
|
|
94
|
+
let startDot = -1;
|
|
95
|
+
let startPart = rootEnd;
|
|
96
|
+
let end = -1;
|
|
97
|
+
let matchedSlash = true;
|
|
98
|
+
let i = path.length - 1;
|
|
99
|
+
// Track the state of characters (if any) we see before our first dot and
|
|
100
|
+
// after any path separator we find
|
|
101
|
+
let preDotState = 0;
|
|
102
|
+
// Get non-dir info
|
|
103
|
+
for (; i >= rootEnd; --i) {
|
|
104
|
+
code = path.charCodeAt(i);
|
|
105
|
+
if (isPathSeparator(code)) {
|
|
106
|
+
// If we reached a path separator that was not part of a set of path
|
|
107
|
+
// separators at the end of the string, stop now
|
|
108
|
+
if (!matchedSlash) {
|
|
109
|
+
startPart = i + 1;
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (end === -1) {
|
|
115
|
+
// We saw the first non-path separator, mark this as the end of our
|
|
116
|
+
// extension
|
|
117
|
+
matchedSlash = false;
|
|
118
|
+
end = i + 1;
|
|
119
|
+
}
|
|
120
|
+
if (code === CHAR_DOT) {
|
|
121
|
+
// If this is our first dot, mark it as the start of our extension
|
|
122
|
+
if (startDot === -1)
|
|
123
|
+
startDot = i;
|
|
124
|
+
else if (preDotState !== 1)
|
|
125
|
+
preDotState = 1;
|
|
126
|
+
}
|
|
127
|
+
else if (startDot !== -1) {
|
|
128
|
+
// We saw a non-dot and non-path separator before our dot, so we should
|
|
129
|
+
// have a good chance at having a non-empty extension
|
|
130
|
+
preDotState = -1;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (startDot === -1 ||
|
|
134
|
+
end === -1 ||
|
|
135
|
+
// We saw a non-dot character immediately before the dot
|
|
136
|
+
preDotState === 0 ||
|
|
137
|
+
// The (right-most) trimmed path component is exactly '..'
|
|
138
|
+
(preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)) {
|
|
139
|
+
if (end !== -1) {
|
|
140
|
+
ret.base = ret.name = path.slice(startPart, end);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
ret.name = path.slice(startPart, startDot);
|
|
145
|
+
ret.base = path.slice(startPart, end);
|
|
146
|
+
ret.ext = path.slice(startDot, end);
|
|
147
|
+
}
|
|
148
|
+
// Fallback to '\' in case there is no basename
|
|
149
|
+
ret.base = ret.base || "\\";
|
|
150
|
+
// If the directory is the root, use the entire root as the `dir` including
|
|
151
|
+
// the trailing slash if any (`C:\abc` -> `C:\`). Otherwise, strip out the
|
|
152
|
+
// trailing slash (`C:\abc\def` -> `C:\abc`).
|
|
153
|
+
if (startPart > 0 && startPart !== rootEnd) {
|
|
154
|
+
ret.dir = path.slice(0, startPart - 1);
|
|
155
|
+
}
|
|
156
|
+
else
|
|
157
|
+
ret.dir = ret.root;
|
|
158
|
+
return ret;
|
|
159
|
+
}
|
|
@@ -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,121 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { CHAR_BACKWARD_SLASH } from "../_common/constants.js";
|
|
4
|
+
import { resolve } from "./resolve.js";
|
|
5
|
+
import { assertArgs } from "../_common/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
|
+
assertArgs(from, to);
|
|
19
|
+
const fromOrig = resolve(from);
|
|
20
|
+
const toOrig = resolve(to);
|
|
21
|
+
if (fromOrig === toOrig)
|
|
22
|
+
return "";
|
|
23
|
+
from = fromOrig.toLowerCase();
|
|
24
|
+
to = toOrig.toLowerCase();
|
|
25
|
+
if (from === to)
|
|
26
|
+
return "";
|
|
27
|
+
// Trim any leading backslashes
|
|
28
|
+
let fromStart = 0;
|
|
29
|
+
let fromEnd = from.length;
|
|
30
|
+
for (; fromStart < fromEnd; ++fromStart) {
|
|
31
|
+
if (from.charCodeAt(fromStart) !== CHAR_BACKWARD_SLASH)
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
// Trim trailing backslashes (applicable to UNC paths only)
|
|
35
|
+
for (; fromEnd - 1 > fromStart; --fromEnd) {
|
|
36
|
+
if (from.charCodeAt(fromEnd - 1) !== CHAR_BACKWARD_SLASH)
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
const fromLen = fromEnd - fromStart;
|
|
40
|
+
// Trim any leading backslashes
|
|
41
|
+
let toStart = 0;
|
|
42
|
+
let toEnd = to.length;
|
|
43
|
+
for (; toStart < toEnd; ++toStart) {
|
|
44
|
+
if (to.charCodeAt(toStart) !== CHAR_BACKWARD_SLASH)
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
// Trim trailing backslashes (applicable to UNC paths only)
|
|
48
|
+
for (; toEnd - 1 > toStart; --toEnd) {
|
|
49
|
+
if (to.charCodeAt(toEnd - 1) !== CHAR_BACKWARD_SLASH)
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
const toLen = toEnd - toStart;
|
|
53
|
+
// Compare paths to find the longest common path from root
|
|
54
|
+
const length = fromLen < toLen ? fromLen : toLen;
|
|
55
|
+
let lastCommonSep = -1;
|
|
56
|
+
let i = 0;
|
|
57
|
+
for (; i <= length; ++i) {
|
|
58
|
+
if (i === length) {
|
|
59
|
+
if (toLen > length) {
|
|
60
|
+
if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {
|
|
61
|
+
// We get here if `from` is the exact base path for `to`.
|
|
62
|
+
// For example: from='C:\\foo\\bar'; to='C:\\foo\\bar\\baz'
|
|
63
|
+
return toOrig.slice(toStart + i + 1);
|
|
64
|
+
}
|
|
65
|
+
else if (i === 2) {
|
|
66
|
+
// We get here if `from` is the device root.
|
|
67
|
+
// For example: from='C:\\'; to='C:\\foo'
|
|
68
|
+
return toOrig.slice(toStart + i);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (fromLen > length) {
|
|
72
|
+
if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {
|
|
73
|
+
// We get here if `to` is the exact base path for `from`.
|
|
74
|
+
// For example: from='C:\\foo\\bar'; to='C:\\foo'
|
|
75
|
+
lastCommonSep = i;
|
|
76
|
+
}
|
|
77
|
+
else if (i === 2) {
|
|
78
|
+
// We get here if `to` is the device root.
|
|
79
|
+
// For example: from='C:\\foo\\bar'; to='C:\\'
|
|
80
|
+
lastCommonSep = 3;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
const fromCode = from.charCodeAt(fromStart + i);
|
|
86
|
+
const toCode = to.charCodeAt(toStart + i);
|
|
87
|
+
if (fromCode !== toCode)
|
|
88
|
+
break;
|
|
89
|
+
else if (fromCode === CHAR_BACKWARD_SLASH)
|
|
90
|
+
lastCommonSep = i;
|
|
91
|
+
}
|
|
92
|
+
// We found a mismatch before the first common path separator was seen, so
|
|
93
|
+
// return the original `to`.
|
|
94
|
+
if (i !== length && lastCommonSep === -1) {
|
|
95
|
+
return toOrig;
|
|
96
|
+
}
|
|
97
|
+
let out = "";
|
|
98
|
+
if (lastCommonSep === -1)
|
|
99
|
+
lastCommonSep = 0;
|
|
100
|
+
// Generate the relative path based on the path difference between `to` and
|
|
101
|
+
// `from`
|
|
102
|
+
for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
|
|
103
|
+
if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) {
|
|
104
|
+
if (out.length === 0)
|
|
105
|
+
out += "..";
|
|
106
|
+
else
|
|
107
|
+
out += "\\..";
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// Lastly, append the rest of the destination (`to`) path that comes after
|
|
111
|
+
// the common path parts
|
|
112
|
+
if (out.length > 0) {
|
|
113
|
+
return out + toOrig.slice(toStart + lastCommonSep, toEnd);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
toStart += lastCommonSep;
|
|
117
|
+
if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH)
|
|
118
|
+
++toStart;
|
|
119
|
+
return toOrig.slice(toStart, toEnd);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import * as dntShim from "../../../../../_dnt.shims.js";
|
|
4
|
+
import { CHAR_COLON } from "../_common/constants.js";
|
|
5
|
+
import { normalizeString } from "../_common/normalize_string.js";
|
|
6
|
+
import { assertPath } from "../_common/assert_path.js";
|
|
7
|
+
import { isPathSeparator, isWindowsDeviceRoot } from "./_util.js";
|
|
8
|
+
/**
|
|
9
|
+
* Resolves path segments into a `path`
|
|
10
|
+
* @param pathSegments to process to path
|
|
11
|
+
*/
|
|
12
|
+
export function resolve(...pathSegments) {
|
|
13
|
+
let resolvedDevice = "";
|
|
14
|
+
let resolvedTail = "";
|
|
15
|
+
let resolvedAbsolute = false;
|
|
16
|
+
for (let i = pathSegments.length - 1; i >= -1; i--) {
|
|
17
|
+
let path;
|
|
18
|
+
// deno-lint-ignore no-explicit-any
|
|
19
|
+
const { Deno } = dntShim.dntGlobalThis;
|
|
20
|
+
if (i >= 0) {
|
|
21
|
+
path = pathSegments[i];
|
|
22
|
+
}
|
|
23
|
+
else if (!resolvedDevice) {
|
|
24
|
+
if (typeof Deno?.cwd !== "function") {
|
|
25
|
+
throw new TypeError("Resolved a drive-letter-less path without a CWD.");
|
|
26
|
+
}
|
|
27
|
+
path = Deno.cwd();
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
if (typeof Deno?.env?.get !== "function" || typeof Deno?.cwd !== "function") {
|
|
31
|
+
throw new TypeError("Resolved a relative path without a CWD.");
|
|
32
|
+
}
|
|
33
|
+
path = Deno.cwd();
|
|
34
|
+
// Verify that a cwd was found and that it actually points
|
|
35
|
+
// to our drive. If not, default to the drive's root.
|
|
36
|
+
if (path === undefined ||
|
|
37
|
+
path.slice(0, 3).toLowerCase() !== `${resolvedDevice.toLowerCase()}\\`) {
|
|
38
|
+
path = `${resolvedDevice}\\`;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
assertPath(path);
|
|
42
|
+
const len = path.length;
|
|
43
|
+
// Skip empty entries
|
|
44
|
+
if (len === 0)
|
|
45
|
+
continue;
|
|
46
|
+
let rootEnd = 0;
|
|
47
|
+
let device = "";
|
|
48
|
+
let isAbsolute = false;
|
|
49
|
+
const code = path.charCodeAt(0);
|
|
50
|
+
// Try to match a root
|
|
51
|
+
if (len > 1) {
|
|
52
|
+
if (isPathSeparator(code)) {
|
|
53
|
+
// Possible UNC root
|
|
54
|
+
// If we started with a separator, we know we at least have an
|
|
55
|
+
// absolute path of some kind (UNC or otherwise)
|
|
56
|
+
isAbsolute = true;
|
|
57
|
+
if (isPathSeparator(path.charCodeAt(1))) {
|
|
58
|
+
// Matched double path separator at beginning
|
|
59
|
+
let j = 2;
|
|
60
|
+
let last = j;
|
|
61
|
+
// Match 1 or more non-path separators
|
|
62
|
+
for (; j < len; ++j) {
|
|
63
|
+
if (isPathSeparator(path.charCodeAt(j)))
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
if (j < len && j !== last) {
|
|
67
|
+
const firstPart = path.slice(last, j);
|
|
68
|
+
// Matched!
|
|
69
|
+
last = j;
|
|
70
|
+
// Match 1 or more path separators
|
|
71
|
+
for (; j < len; ++j) {
|
|
72
|
+
if (!isPathSeparator(path.charCodeAt(j)))
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
if (j < len && j !== last) {
|
|
76
|
+
// Matched!
|
|
77
|
+
last = j;
|
|
78
|
+
// Match 1 or more non-path separators
|
|
79
|
+
for (; j < len; ++j) {
|
|
80
|
+
if (isPathSeparator(path.charCodeAt(j)))
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
if (j === len) {
|
|
84
|
+
// We matched a UNC root only
|
|
85
|
+
device = `\\\\${firstPart}\\${path.slice(last)}`;
|
|
86
|
+
rootEnd = j;
|
|
87
|
+
}
|
|
88
|
+
else if (j !== last) {
|
|
89
|
+
// We matched a UNC root with leftovers
|
|
90
|
+
device = `\\\\${firstPart}\\${path.slice(last, j)}`;
|
|
91
|
+
rootEnd = j;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
rootEnd = 1;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
else if (isWindowsDeviceRoot(code)) {
|
|
101
|
+
// Possible device root
|
|
102
|
+
if (path.charCodeAt(1) === CHAR_COLON) {
|
|
103
|
+
device = path.slice(0, 2);
|
|
104
|
+
rootEnd = 2;
|
|
105
|
+
if (len > 2) {
|
|
106
|
+
if (isPathSeparator(path.charCodeAt(2))) {
|
|
107
|
+
// Treat separator following drive name as an absolute path
|
|
108
|
+
// indicator
|
|
109
|
+
isAbsolute = true;
|
|
110
|
+
rootEnd = 3;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
else if (isPathSeparator(code)) {
|
|
117
|
+
// `path` contains just a path separator
|
|
118
|
+
rootEnd = 1;
|
|
119
|
+
isAbsolute = true;
|
|
120
|
+
}
|
|
121
|
+
if (device.length > 0 &&
|
|
122
|
+
resolvedDevice.length > 0 &&
|
|
123
|
+
device.toLowerCase() !== resolvedDevice.toLowerCase()) {
|
|
124
|
+
// This path points to another device so it is not applicable
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
if (resolvedDevice.length === 0 && device.length > 0) {
|
|
128
|
+
resolvedDevice = device;
|
|
129
|
+
}
|
|
130
|
+
if (!resolvedAbsolute) {
|
|
131
|
+
resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
|
|
132
|
+
resolvedAbsolute = isAbsolute;
|
|
133
|
+
}
|
|
134
|
+
if (resolvedAbsolute && resolvedDevice.length > 0)
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
// At this point the path should be resolved to a full absolute path,
|
|
138
|
+
// but handle relative paths to be safe (might happen when Deno.cwd()
|
|
139
|
+
// fails)
|
|
140
|
+
// Normalize the tail path
|
|
141
|
+
resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, "\\", isPathSeparator);
|
|
142
|
+
return resolvedDevice + (resolvedAbsolute ? "\\" : "") + resolvedTail || ".";
|
|
143
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a path string to a file URL.
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { toFileUrl } from "https://deno.land/std@$STD_VERSION/path/win32.ts";
|
|
6
|
+
*
|
|
7
|
+
* toFileUrl("\\home\\foo"); // new URL("file:///home/foo")
|
|
8
|
+
* toFileUrl("C:\\Users\\foo"); // new URL("file:///C:/Users/foo")
|
|
9
|
+
* toFileUrl("\\\\127.0.0.1\\home\\foo"); // new URL("file://127.0.0.1/home/foo")
|
|
10
|
+
* ```
|
|
11
|
+
* @param path to convert to file URL
|
|
12
|
+
*/
|
|
13
|
+
export declare function toFileUrl(path: string): URL;
|
|
@@ -0,0 +1,31 @@
|
|
|
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/win32.ts";
|
|
10
|
+
*
|
|
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 function toFileUrl(path) {
|
|
18
|
+
if (!isAbsolute(path)) {
|
|
19
|
+
throw new TypeError("Must be an absolute path.");
|
|
20
|
+
}
|
|
21
|
+
const [, hostname, pathname] = path.match(/^(?:[/\\]{2}([^/\\]+)(?=[/\\](?:[^/\\]|$)))?(.*)/);
|
|
22
|
+
const url = new URL("file:///");
|
|
23
|
+
url.pathname = encodeWhitespace(pathname.replace(/%/g, "%25"));
|
|
24
|
+
if (hostname !== undefined && hostname !== "localhost") {
|
|
25
|
+
url.hostname = hostname;
|
|
26
|
+
if (!url.hostname) {
|
|
27
|
+
throw new TypeError("Invalid hostname.");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return url;
|
|
31
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { CHAR_BACKWARD_SLASH, CHAR_COLON, CHAR_DOT, CHAR_QUESTION_MARK, } from "../_common/constants.js";
|
|
4
|
+
import { isWindowsDeviceRoot } from "./_util.js";
|
|
5
|
+
import { resolve } from "./resolve.js";
|
|
6
|
+
/**
|
|
7
|
+
* Resolves path to a namespace path
|
|
8
|
+
* @param path to resolve to namespace
|
|
9
|
+
*/
|
|
10
|
+
export function toNamespacedPath(path) {
|
|
11
|
+
// Note: this will *probably* throw somewhere.
|
|
12
|
+
if (typeof path !== "string")
|
|
13
|
+
return path;
|
|
14
|
+
if (path.length === 0)
|
|
15
|
+
return "";
|
|
16
|
+
const resolvedPath = resolve(path);
|
|
17
|
+
if (resolvedPath.length >= 3) {
|
|
18
|
+
if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) {
|
|
19
|
+
// Possible UNC root
|
|
20
|
+
if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) {
|
|
21
|
+
const code = resolvedPath.charCodeAt(2);
|
|
22
|
+
if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) {
|
|
23
|
+
// Matched non-long UNC root, convert the path to a long UNC path
|
|
24
|
+
return `\\\\?\\UNC\\${resolvedPath.slice(2)}`;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0))) {
|
|
29
|
+
// Possible device root
|
|
30
|
+
if (resolvedPath.charCodeAt(1) === CHAR_COLON &&
|
|
31
|
+
resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) {
|
|
32
|
+
// Matched device root, convert the path to a long UNC path
|
|
33
|
+
return `\\\\?\\${resolvedPath}`;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return path;
|
|
38
|
+
}
|
package/esm/mod.d.ts
CHANGED
package/esm/mod.js
CHANGED
package/esm/types/1_chat.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
2
|
import { ChatPhoto } from "./0_chat_photo.js";
|
|
3
|
-
import { Color } from "./0_color.js";
|
|
4
3
|
import { RestrictionReason } from "./0_restriction_reason.js";
|
|
5
4
|
export type ChatType = "private" | "group" | "supergroup" | "channel";
|
|
6
5
|
export declare namespace Chat {
|
|
@@ -9,8 +8,8 @@ export declare namespace Chat {
|
|
|
9
8
|
type: ChatType;
|
|
10
9
|
/** The identifier of the chat. */
|
|
11
10
|
id: number;
|
|
12
|
-
/**
|
|
13
|
-
color:
|
|
11
|
+
/** Identifier of a color that can be displayed instead of the chat's photo. */
|
|
12
|
+
color: number;
|
|
14
13
|
/** The chat's photo. */
|
|
15
14
|
photo?: ChatPhoto;
|
|
16
15
|
}
|
package/esm/types/1_chat.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { cleanObject, UNREACHABLE } from "../1_utilities.js";
|
|
1
|
+
import { cleanObject, getColorFromPeerId, UNREACHABLE } from "../1_utilities.js";
|
|
2
2
|
import { types } from "../2_tl.js";
|
|
3
3
|
import { ZERO_CHANNEL_ID } from "../4_constants.js";
|
|
4
4
|
import { constructChatPhoto } from "./0_chat_photo.js";
|
|
5
|
-
import { getColorFromColorId, getColorFromPeerId } from "./0_color.js";
|
|
6
5
|
import { constructRestrictionReason } from "./0_restriction_reason.js";
|
|
7
6
|
export function constructChat(chat) {
|
|
8
7
|
if (chat instanceof types.User) {
|
|
@@ -11,7 +10,7 @@ export function constructChat(chat) {
|
|
|
11
10
|
type: "private",
|
|
12
11
|
isBot: chat.bot || false,
|
|
13
12
|
id,
|
|
14
|
-
color: chat.color !== undefined ?
|
|
13
|
+
color: chat.color !== undefined ? chat.color : getColorFromPeerId(id),
|
|
15
14
|
firstName: chat.firstName || "",
|
|
16
15
|
lastName: chat.lastName,
|
|
17
16
|
isScam: chat.scam || false,
|
|
@@ -49,7 +48,7 @@ export function constructChat(chat) {
|
|
|
49
48
|
if (chat.megagroup) {
|
|
50
49
|
chat_ = {
|
|
51
50
|
id,
|
|
52
|
-
color: chat.color !== undefined ?
|
|
51
|
+
color: chat.color !== undefined ? chat.color : getColorFromPeerId(id),
|
|
53
52
|
type: "supergroup",
|
|
54
53
|
title,
|
|
55
54
|
isScam,
|
|
@@ -63,7 +62,7 @@ export function constructChat(chat) {
|
|
|
63
62
|
const id = ZERO_CHANNEL_ID + -Number(chat.id);
|
|
64
63
|
chat_ = {
|
|
65
64
|
id,
|
|
66
|
-
color: chat.color !== undefined ?
|
|
65
|
+
color: chat.color !== undefined ? chat.color : getColorFromPeerId(id),
|
|
67
66
|
type: "channel",
|
|
68
67
|
title,
|
|
69
68
|
isScam,
|
package/esm/types/1_user.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
2
|
import { ChatPhoto } from "./0_chat_photo.js";
|
|
3
|
-
import { Color } from "./0_color.js";
|
|
4
3
|
/** This object represents a Telegram user or bot. */
|
|
5
4
|
export interface User {
|
|
6
5
|
/** Unique identifier for this user or bot */
|
|
7
6
|
id: number;
|
|
8
|
-
/**
|
|
9
|
-
color:
|
|
7
|
+
/** Identifier of color that can be displayed instead of the user's photo. */
|
|
8
|
+
color: number;
|
|
10
9
|
/** True, if this user is a bot */
|
|
11
10
|
isBot: boolean;
|
|
12
11
|
/** User's or bot's first name */
|
package/esm/types/1_user.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { cleanObject } from "../1_utilities.js";
|
|
1
|
+
import { cleanObject, getColorFromPeerId } from "../1_utilities.js";
|
|
2
2
|
import { types } from "../2_tl.js";
|
|
3
3
|
import { constructChatPhoto } from "./0_chat_photo.js";
|
|
4
|
-
import { getColorFromColorId, getColorFromPeerId } from "./0_color.js";
|
|
5
4
|
export function constructUser(user_) {
|
|
6
5
|
const id = Number(user_.id);
|
|
7
6
|
const user = {
|
|
8
7
|
id,
|
|
9
|
-
color: user_.color !== undefined ?
|
|
8
|
+
color: user_.color !== undefined ? user_.color : getColorFromPeerId(id),
|
|
10
9
|
isBot: user_.bot || false,
|
|
11
10
|
firstName: user_.firstName || "",
|
|
12
11
|
lastName: user_.lastName,
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type ColorName = "red" | "orange" | "violet" | "green" | "cyan" | "blue" | "pink" | "combination 1" | "combination 2" | "combination 3" | "combination 4" | "combination 5" | "combination 6" | "combination 7" | "combination 8" | "combination 9" | "combination 10" | "combination 11" | "combination 12" | "combination 13" | "combination 14";
|
|
2
|
+
export declare function getColorFromPeerId(id: number): number;
|
|
3
|
+
export declare function getColorName(id: number): ColorName;
|