fontconv 0.0.1
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/LICENSE +21 -0
- package/README.md +71 -0
- package/esm/_dnt.shims.d.ts +5 -0
- package/esm/_dnt.shims.js +61 -0
- package/esm/deps/deno.land/std@0.221.0/assert/assert.d.ts +12 -0
- package/esm/deps/deno.land/std@0.221.0/assert/assert.js +18 -0
- package/esm/deps/deno.land/std@0.221.0/assert/assertion_error.d.ts +14 -0
- package/esm/deps/deno.land/std@0.221.0/assert/assertion_error.js +18 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/assert_path.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/assert_path.js +7 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/basename.d.ts +3 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/basename.js +40 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/common.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/common.js +23 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/constants.d.ts +39 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/constants.js +46 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/dirname.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/dirname.js +8 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/format.d.ts +3 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/format.js +19 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/from_file_url.d.ts +2 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/from_file_url.js +9 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/glob_to_reg_exp.d.ts +28 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/glob_to_reg_exp.js +237 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/normalize.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/normalize.js +8 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/normalize_string.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/normalize_string.js +77 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/relative.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/relative.js +9 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/strip_trailing_separators.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/strip_trailing_separators.js +19 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/to_file_url.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/to_file_url.js +15 -0
- package/esm/deps/deno.land/std@0.221.0/path/_interface.d.ts +38 -0
- package/esm/deps/deno.land/std@0.221.0/path/_interface.js +3 -0
- package/esm/deps/deno.land/std@0.221.0/path/_os.d.ts +3 -0
- package/esm/deps/deno.land/std@0.221.0/path/_os.js +18 -0
- package/esm/deps/deno.land/std@0.221.0/path/basename.d.ts +17 -0
- package/esm/deps/deno.land/std@0.221.0/path/basename.js +26 -0
- package/esm/deps/deno.land/std@0.221.0/path/common.d.ts +13 -0
- package/esm/deps/deno.land/std@0.221.0/path/common.js +19 -0
- package/esm/deps/deno.land/std@0.221.0/path/constants.d.ts +3 -0
- package/esm/deps/deno.land/std@0.221.0/path/constants.js +6 -0
- package/esm/deps/deno.land/std@0.221.0/path/dirname.d.ts +5 -0
- package/esm/deps/deno.land/std@0.221.0/path/dirname.js +12 -0
- package/esm/deps/deno.land/std@0.221.0/path/extname.d.ts +6 -0
- package/esm/deps/deno.land/std@0.221.0/path/extname.js +13 -0
- package/esm/deps/deno.land/std@0.221.0/path/format.d.ts +8 -0
- package/esm/deps/deno.land/std@0.221.0/path/format.js +14 -0
- package/esm/deps/deno.land/std@0.221.0/path/from_file_url.d.ts +18 -0
- package/esm/deps/deno.land/std@0.221.0/path/from_file_url.js +24 -0
- package/esm/deps/deno.land/std@0.221.0/path/glob_to_regexp.d.ts +62 -0
- package/esm/deps/deno.land/std@0.221.0/path/glob_to_regexp.js +65 -0
- package/esm/deps/deno.land/std@0.221.0/path/is_absolute.d.ts +5 -0
- package/esm/deps/deno.land/std@0.221.0/path/is_absolute.js +12 -0
- package/esm/deps/deno.land/std@0.221.0/path/is_glob.d.ts +2 -0
- package/esm/deps/deno.land/std@0.221.0/path/is_glob.js +28 -0
- package/esm/deps/deno.land/std@0.221.0/path/join.d.ts +5 -0
- package/esm/deps/deno.land/std@0.221.0/path/join.js +12 -0
- package/esm/deps/deno.land/std@0.221.0/path/join_globs.d.ts +4 -0
- package/esm/deps/deno.land/std@0.221.0/path/join_globs.js +11 -0
- package/esm/deps/deno.land/std@0.221.0/path/mod.d.ts +56 -0
- package/esm/deps/deno.land/std@0.221.0/path/mod.js +60 -0
- package/esm/deps/deno.land/std@0.221.0/path/normalize.d.ts +7 -0
- package/esm/deps/deno.land/std@0.221.0/path/normalize.js +14 -0
- package/esm/deps/deno.land/std@0.221.0/path/normalize_glob.d.ts +4 -0
- package/esm/deps/deno.land/std@0.221.0/path/normalize_glob.js +11 -0
- package/esm/deps/deno.land/std@0.221.0/path/parse.d.ts +18 -0
- package/esm/deps/deno.land/std@0.221.0/path/parse.js +24 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/_util.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/_util.js +8 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/basename.d.ts +17 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/basename.js +27 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/common.d.ts +13 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/common.js +19 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/constants.d.ts +3 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/constants.js +5 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/dirname.d.ts +14 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/dirname.js +45 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/extname.d.ts +15 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/extname.js +68 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/format.d.ts +6 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/format.js +11 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/from_file_url.d.ts +12 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/from_file_url.js +17 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/glob_to_regexp.d.ts +57 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/glob_to_regexp.js +69 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/is_absolute.d.ts +5 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/is_absolute.js +12 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/is_glob.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/is_glob.js +3 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/join.d.ts +5 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/join.js +26 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/join_globs.d.ts +4 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/join_globs.js +26 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/mod.d.ts +38 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/mod.js +42 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/normalize.d.ts +7 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/normalize.js +25 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/normalize_glob.d.ts +4 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/normalize_glob.js +16 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/parse.d.ts +6 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/parse.js +98 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/relative.d.ts +7 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/relative.js +94 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/resolve.d.ts +5 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/resolve.js +48 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/to_file_url.d.ts +12 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/to_file_url.js +22 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/to_namespaced_path.d.ts +5 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/to_namespaced_path.js +10 -0
- package/esm/deps/deno.land/std@0.221.0/path/relative.d.ts +12 -0
- package/esm/deps/deno.land/std@0.221.0/path/relative.js +19 -0
- package/esm/deps/deno.land/std@0.221.0/path/resolve.d.ts +5 -0
- package/esm/deps/deno.land/std@0.221.0/path/resolve.js +14 -0
- package/esm/deps/deno.land/std@0.221.0/path/to_file_url.d.ts +18 -0
- package/esm/deps/deno.land/std@0.221.0/path/to_file_url.js +24 -0
- package/esm/deps/deno.land/std@0.221.0/path/to_namespaced_path.d.ts +5 -0
- package/esm/deps/deno.land/std@0.221.0/path/to_namespaced_path.js +14 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/_util.d.ts +3 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/_util.js +15 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/basename.d.ts +17 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/basename.js +39 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/common.d.ts +13 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/common.js +19 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/constants.d.ts +3 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/constants.js +5 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/dirname.d.ts +5 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/dirname.js +98 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/extname.d.ts +6 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/extname.js +68 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/format.d.ts +6 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/format.js +11 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/from_file_url.d.ts +14 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/from_file_url.js +26 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/glob_to_regexp.d.ts +57 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/glob_to_regexp.js +69 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/is_absolute.d.ts +5 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/is_absolute.js +27 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/is_glob.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/is_glob.js +3 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/join.d.ts +5 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/join.js +72 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/join_globs.d.ts +4 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/join_globs.js +26 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/mod.d.ts +38 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/mod.js +42 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/normalize.d.ts +7 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/normalize.js +130 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/normalize_glob.d.ts +4 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/normalize_glob.js +16 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/parse.d.ts +6 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/parse.js +159 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/relative.d.ts +12 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/relative.js +121 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/resolve.d.ts +5 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/resolve.js +143 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/to_file_url.d.ts +14 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/to_file_url.js +31 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/to_namespaced_path.d.ts +5 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/to_namespaced_path.js +38 -0
- package/esm/fontconv/cli.d.ts +2 -0
- package/esm/fontconv/cli.js +36 -0
- package/esm/fontconv/mod.d.ts +10 -0
- package/esm/fontconv/mod.js +147 -0
- package/esm/fontconv/test.d.ts +1 -0
- package/esm/package.json +3 -0
- package/esm/test/bootstrap-icons.woff2 +0 -0
- package/esm/test/format-check.eot +0 -0
- package/esm/test/format-check.otf +0 -0
- package/esm/test/format-check.svg +25 -0
- package/esm/test/format-check.ttf +0 -0
- package/esm/test/format-check.woff +0 -0
- package/esm/test/format-check.woff2 +0 -0
- package/esm/test/material-icons.woff2 +0 -0
- package/esm/ttf2svg/mod.d.ts +9 -0
- package/esm/ttf2svg/mod.js +167 -0
- package/package.json +42 -0
- package/script/_dnt.shims.d.ts +5 -0
- package/script/_dnt.shims.js +65 -0
- package/script/deps/deno.land/std@0.221.0/assert/assert.d.ts +12 -0
- package/script/deps/deno.land/std@0.221.0/assert/assert.js +22 -0
- package/script/deps/deno.land/std@0.221.0/assert/assertion_error.d.ts +14 -0
- package/script/deps/deno.land/std@0.221.0/assert/assertion_error.js +22 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/assert_path.d.ts +1 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/assert_path.js +11 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/basename.d.ts +3 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/basename.js +46 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/common.d.ts +1 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/common.js +27 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/constants.d.ts +39 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/constants.js +49 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/dirname.d.ts +1 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/dirname.js +12 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/format.d.ts +3 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/format.js +24 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/from_file_url.d.ts +2 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/from_file_url.js +13 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/glob_to_reg_exp.d.ts +28 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/glob_to_reg_exp.js +241 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/normalize.d.ts +1 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/normalize.js +12 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/normalize_string.d.ts +1 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/normalize_string.js +81 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/relative.d.ts +1 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/relative.js +13 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/strip_trailing_separators.d.ts +1 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/strip_trailing_separators.js +23 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/to_file_url.d.ts +1 -0
- package/script/deps/deno.land/std@0.221.0/path/_common/to_file_url.js +19 -0
- package/script/deps/deno.land/std@0.221.0/path/_interface.d.ts +38 -0
- package/script/deps/deno.land/std@0.221.0/path/_interface.js +4 -0
- package/script/deps/deno.land/std@0.221.0/path/_os.d.ts +3 -0
- package/script/deps/deno.land/std@0.221.0/path/_os.js +44 -0
- package/script/deps/deno.land/std@0.221.0/path/basename.d.ts +17 -0
- package/script/deps/deno.land/std@0.221.0/path/basename.js +30 -0
- package/script/deps/deno.land/std@0.221.0/path/common.d.ts +13 -0
- package/script/deps/deno.land/std@0.221.0/path/common.js +23 -0
- package/script/deps/deno.land/std@0.221.0/path/constants.d.ts +3 -0
- package/script/deps/deno.land/std@0.221.0/path/constants.js +9 -0
- package/script/deps/deno.land/std@0.221.0/path/dirname.d.ts +5 -0
- package/script/deps/deno.land/std@0.221.0/path/dirname.js +16 -0
- package/script/deps/deno.land/std@0.221.0/path/extname.d.ts +6 -0
- package/script/deps/deno.land/std@0.221.0/path/extname.js +17 -0
- package/script/deps/deno.land/std@0.221.0/path/format.d.ts +8 -0
- package/script/deps/deno.land/std@0.221.0/path/format.js +18 -0
- package/script/deps/deno.land/std@0.221.0/path/from_file_url.d.ts +18 -0
- package/script/deps/deno.land/std@0.221.0/path/from_file_url.js +28 -0
- package/script/deps/deno.land/std@0.221.0/path/glob_to_regexp.d.ts +62 -0
- package/script/deps/deno.land/std@0.221.0/path/glob_to_regexp.js +69 -0
- package/script/deps/deno.land/std@0.221.0/path/is_absolute.d.ts +5 -0
- package/script/deps/deno.land/std@0.221.0/path/is_absolute.js +16 -0
- package/script/deps/deno.land/std@0.221.0/path/is_glob.d.ts +2 -0
- package/script/deps/deno.land/std@0.221.0/path/is_glob.js +32 -0
- package/script/deps/deno.land/std@0.221.0/path/join.d.ts +5 -0
- package/script/deps/deno.land/std@0.221.0/path/join.js +16 -0
- package/script/deps/deno.land/std@0.221.0/path/join_globs.d.ts +4 -0
- package/script/deps/deno.land/std@0.221.0/path/join_globs.js +15 -0
- package/script/deps/deno.land/std@0.221.0/path/mod.d.ts +56 -0
- package/script/deps/deno.land/std@0.221.0/path/mod.js +89 -0
- package/script/deps/deno.land/std@0.221.0/path/normalize.d.ts +7 -0
- package/script/deps/deno.land/std@0.221.0/path/normalize.js +18 -0
- package/script/deps/deno.land/std@0.221.0/path/normalize_glob.d.ts +4 -0
- package/script/deps/deno.land/std@0.221.0/path/normalize_glob.js +15 -0
- package/script/deps/deno.land/std@0.221.0/path/parse.d.ts +18 -0
- package/script/deps/deno.land/std@0.221.0/path/parse.js +28 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/_util.d.ts +1 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/_util.js +12 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/basename.d.ts +17 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/basename.js +31 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/common.d.ts +13 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/common.js +23 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/constants.d.ts +3 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/constants.js +8 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/dirname.d.ts +14 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/dirname.js +49 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/extname.d.ts +15 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/extname.js +72 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/format.d.ts +6 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/format.js +15 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/from_file_url.d.ts +12 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/from_file_url.js +21 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/glob_to_regexp.d.ts +57 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/glob_to_regexp.js +73 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/is_absolute.d.ts +5 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/is_absolute.js +16 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/is_glob.d.ts +1 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/is_glob.js +7 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/join.d.ts +5 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/join.js +30 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/join_globs.d.ts +4 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/join_globs.js +30 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/mod.d.ts +38 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/mod.js +58 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/normalize.d.ts +7 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/normalize.js +29 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/normalize_glob.d.ts +4 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/normalize_glob.js +20 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/parse.d.ts +6 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/parse.js +102 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/relative.d.ts +7 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/relative.js +98 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/resolve.d.ts +5 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/resolve.js +75 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/to_file_url.d.ts +12 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/to_file_url.js +26 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/to_namespaced_path.d.ts +5 -0
- package/script/deps/deno.land/std@0.221.0/path/posix/to_namespaced_path.js +14 -0
- package/script/deps/deno.land/std@0.221.0/path/relative.d.ts +12 -0
- package/script/deps/deno.land/std@0.221.0/path/relative.js +23 -0
- package/script/deps/deno.land/std@0.221.0/path/resolve.d.ts +5 -0
- package/script/deps/deno.land/std@0.221.0/path/resolve.js +18 -0
- package/script/deps/deno.land/std@0.221.0/path/to_file_url.d.ts +18 -0
- package/script/deps/deno.land/std@0.221.0/path/to_file_url.js +28 -0
- package/script/deps/deno.land/std@0.221.0/path/to_namespaced_path.d.ts +5 -0
- package/script/deps/deno.land/std@0.221.0/path/to_namespaced_path.js +18 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/_util.d.ts +3 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/_util.js +21 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/basename.d.ts +17 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/basename.js +43 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/common.d.ts +13 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/common.js +23 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/constants.d.ts +3 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/constants.js +8 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/dirname.d.ts +5 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/dirname.js +102 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/extname.d.ts +6 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/extname.js +72 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/format.d.ts +6 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/format.js +15 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/from_file_url.d.ts +14 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/from_file_url.js +30 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/glob_to_regexp.d.ts +57 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/glob_to_regexp.js +73 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/is_absolute.d.ts +5 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/is_absolute.js +31 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/is_glob.d.ts +1 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/is_glob.js +7 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/join.d.ts +5 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/join.js +76 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/join_globs.d.ts +4 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/join_globs.js +30 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/mod.d.ts +38 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/mod.js +58 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/normalize.d.ts +7 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/normalize.js +134 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/normalize_glob.d.ts +4 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/normalize_glob.js +20 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/parse.d.ts +6 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/parse.js +163 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/relative.d.ts +12 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/relative.js +125 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/resolve.d.ts +5 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/resolve.js +170 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/to_file_url.d.ts +14 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/to_file_url.js +35 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/to_namespaced_path.d.ts +5 -0
- package/script/deps/deno.land/std@0.221.0/path/windows/to_namespaced_path.js +42 -0
- package/script/fontconv/cli.d.ts +2 -0
- package/script/fontconv/cli.js +61 -0
- package/script/fontconv/mod.d.ts +10 -0
- package/script/fontconv/mod.js +186 -0
- package/script/fontconv/test.d.ts +1 -0
- package/script/package.json +3 -0
- package/script/test/bootstrap-icons.woff2 +0 -0
- package/script/test/format-check.eot +0 -0
- package/script/test/format-check.otf +0 -0
- package/script/test/format-check.svg +25 -0
- package/script/test/format-check.ttf +0 -0
- package/script/test/format-check.woff +0 -0
- package/script/test/format-check.woff2 +0 -0
- package/script/test/material-icons.woff2 +0 -0
- package/script/ttf2svg/mod.d.ts +9 -0
- package/script/ttf2svg/mod.js +204 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.globToRegExp = void 0;
|
|
6
|
+
const glob_to_reg_exp_js_1 = require("../_common/glob_to_reg_exp.js");
|
|
7
|
+
const constants = {
|
|
8
|
+
sep: "(?:\\\\|/)+",
|
|
9
|
+
sepMaybe: "(?:\\\\|/)*",
|
|
10
|
+
seps: ["\\", "/"],
|
|
11
|
+
globstar: "(?:[^\\\\/]*(?:\\\\|/|$)+)*",
|
|
12
|
+
wildcard: "[^\\\\/]*",
|
|
13
|
+
escapePrefix: "`",
|
|
14
|
+
};
|
|
15
|
+
/** Convert a glob string to a regular expression.
|
|
16
|
+
*
|
|
17
|
+
* Tries to match bash glob expansion as closely as possible.
|
|
18
|
+
*
|
|
19
|
+
* Basic glob syntax:
|
|
20
|
+
* - `*` - Matches everything without leaving the path segment.
|
|
21
|
+
* - `?` - Matches any single character.
|
|
22
|
+
* - `{foo,bar}` - Matches `foo` or `bar`.
|
|
23
|
+
* - `[abcd]` - Matches `a`, `b`, `c` or `d`.
|
|
24
|
+
* - `[a-d]` - Matches `a`, `b`, `c` or `d`.
|
|
25
|
+
* - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
|
|
26
|
+
* - `[[:<class>:]]` - Matches any character belonging to `<class>`.
|
|
27
|
+
* - `[[:alnum:]]` - Matches any digit or letter.
|
|
28
|
+
* - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
|
|
29
|
+
* - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
|
|
30
|
+
* for a complete list of supported character classes.
|
|
31
|
+
* - `\` - Escapes the next character for an `os` other than `"windows"`.
|
|
32
|
+
* - \` - Escapes the next character for `os` set to `"windows"`.
|
|
33
|
+
* - `/` - Path separator.
|
|
34
|
+
* - `\` - Additional path separator only for `os` set to `"windows"`.
|
|
35
|
+
*
|
|
36
|
+
* Extended syntax:
|
|
37
|
+
* - Requires `{ extended: true }`.
|
|
38
|
+
* - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
|
|
39
|
+
* - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
|
|
40
|
+
* - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
|
|
41
|
+
* - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
|
|
42
|
+
* - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
|
|
43
|
+
* - See https://www.linuxjournal.com/content/bash-extended-globbing.
|
|
44
|
+
*
|
|
45
|
+
* Globstar syntax:
|
|
46
|
+
* - Requires `{ globstar: true }`.
|
|
47
|
+
* - `**` - Matches any number of any path segments.
|
|
48
|
+
* - Must comprise its entire path segment in the provided glob.
|
|
49
|
+
* - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
|
|
50
|
+
*
|
|
51
|
+
* Note the following properties:
|
|
52
|
+
* - The generated `RegExp` is anchored at both start and end.
|
|
53
|
+
* - Repeating and trailing separators are tolerated. Trailing separators in the
|
|
54
|
+
* provided glob have no meaning and are discarded.
|
|
55
|
+
* - Absolute globs will only match absolute paths, etc.
|
|
56
|
+
* - Empty globs will match nothing.
|
|
57
|
+
* - Any special glob syntax must be contained to one path segment. For example,
|
|
58
|
+
* `?(foo|bar/baz)` is invalid. The separator will take precedence and the
|
|
59
|
+
* first segment ends with an unclosed group.
|
|
60
|
+
* - If a path segment ends with unclosed groups or a dangling escape prefix, a
|
|
61
|
+
* parse error has occurred. Every character for that segment is taken
|
|
62
|
+
* literally in this event.
|
|
63
|
+
*
|
|
64
|
+
* Limitations:
|
|
65
|
+
* - A negative group like `!(foo|bar)` will wrongly be converted to a negative
|
|
66
|
+
* look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
|
|
67
|
+
* fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
|
|
68
|
+
* `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
|
|
69
|
+
* the group occurs not nested at the end of the segment. */
|
|
70
|
+
function globToRegExp(glob, options = {}) {
|
|
71
|
+
return (0, glob_to_reg_exp_js_1._globToRegExp)(constants, glob, options);
|
|
72
|
+
}
|
|
73
|
+
exports.globToRegExp = globToRegExp;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.isAbsolute = void 0;
|
|
6
|
+
const constants_js_1 = require("../_common/constants.js");
|
|
7
|
+
const assert_path_js_1 = require("../_common/assert_path.js");
|
|
8
|
+
const _util_js_1 = require("./_util.js");
|
|
9
|
+
/**
|
|
10
|
+
* Verifies whether provided path is absolute
|
|
11
|
+
* @param path to be verified as absolute
|
|
12
|
+
*/
|
|
13
|
+
function isAbsolute(path) {
|
|
14
|
+
(0, assert_path_js_1.assertPath)(path);
|
|
15
|
+
const len = path.length;
|
|
16
|
+
if (len === 0)
|
|
17
|
+
return false;
|
|
18
|
+
const code = path.charCodeAt(0);
|
|
19
|
+
if ((0, _util_js_1.isPathSeparator)(code)) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
else if ((0, _util_js_1.isWindowsDeviceRoot)(code)) {
|
|
23
|
+
// Possible device root
|
|
24
|
+
if (len > 2 && path.charCodeAt(1) === constants_js_1.CHAR_COLON) {
|
|
25
|
+
if ((0, _util_js_1.isPathSeparator)(path.charCodeAt(2)))
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
exports.isAbsolute = isAbsolute;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isGlob } from "../is_glob.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.isGlob = void 0;
|
|
6
|
+
var is_glob_js_1 = require("../is_glob.js");
|
|
7
|
+
Object.defineProperty(exports, "isGlob", { enumerable: true, get: function () { return is_glob_js_1.isGlob; } });
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.join = void 0;
|
|
6
|
+
const assert_js_1 = require("../../assert/assert.js");
|
|
7
|
+
const assert_path_js_1 = require("../_common/assert_path.js");
|
|
8
|
+
const _util_js_1 = require("./_util.js");
|
|
9
|
+
const normalize_js_1 = require("./normalize.js");
|
|
10
|
+
/**
|
|
11
|
+
* Join all given a sequence of `paths`,then normalizes the resulting path.
|
|
12
|
+
* @param paths to be joined and normalized
|
|
13
|
+
*/
|
|
14
|
+
function join(...paths) {
|
|
15
|
+
if (paths.length === 0)
|
|
16
|
+
return ".";
|
|
17
|
+
let joined;
|
|
18
|
+
let firstPart = null;
|
|
19
|
+
for (let i = 0; i < paths.length; ++i) {
|
|
20
|
+
const path = paths[i];
|
|
21
|
+
(0, assert_path_js_1.assertPath)(path);
|
|
22
|
+
if (path.length > 0) {
|
|
23
|
+
if (joined === undefined)
|
|
24
|
+
joined = firstPart = path;
|
|
25
|
+
else
|
|
26
|
+
joined += `\\${path}`;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (joined === undefined)
|
|
30
|
+
return ".";
|
|
31
|
+
// Make sure that the joined path doesn't start with two slashes, because
|
|
32
|
+
// normalize() will mistake it for an UNC path then.
|
|
33
|
+
//
|
|
34
|
+
// This step is skipped when it is very clear that the user actually
|
|
35
|
+
// intended to point at an UNC path. This is assumed when the first
|
|
36
|
+
// non-empty string arguments starts with exactly two slashes followed by
|
|
37
|
+
// at least one more non-slash character.
|
|
38
|
+
//
|
|
39
|
+
// Note that for normalize() to treat a path as an UNC path it needs to
|
|
40
|
+
// have at least 2 components, so we don't filter for that here.
|
|
41
|
+
// This means that the user can use join to construct UNC paths from
|
|
42
|
+
// a server name and a share name; for example:
|
|
43
|
+
// path.join('//server', 'share') -> '\\\\server\\share\\')
|
|
44
|
+
let needsReplace = true;
|
|
45
|
+
let slashCount = 0;
|
|
46
|
+
(0, assert_js_1.assert)(firstPart !== null);
|
|
47
|
+
if ((0, _util_js_1.isPathSeparator)(firstPart.charCodeAt(0))) {
|
|
48
|
+
++slashCount;
|
|
49
|
+
const firstLen = firstPart.length;
|
|
50
|
+
if (firstLen > 1) {
|
|
51
|
+
if ((0, _util_js_1.isPathSeparator)(firstPart.charCodeAt(1))) {
|
|
52
|
+
++slashCount;
|
|
53
|
+
if (firstLen > 2) {
|
|
54
|
+
if ((0, _util_js_1.isPathSeparator)(firstPart.charCodeAt(2)))
|
|
55
|
+
++slashCount;
|
|
56
|
+
else {
|
|
57
|
+
// We matched a UNC path in the first part
|
|
58
|
+
needsReplace = false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (needsReplace) {
|
|
65
|
+
// Find any more consecutive slashes we need to replace
|
|
66
|
+
for (; slashCount < joined.length; ++slashCount) {
|
|
67
|
+
if (!(0, _util_js_1.isPathSeparator)(joined.charCodeAt(slashCount)))
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
// Replace the slashes if needed
|
|
71
|
+
if (slashCount >= 2)
|
|
72
|
+
joined = `\\${joined.slice(slashCount)}`;
|
|
73
|
+
}
|
|
74
|
+
return (0, normalize_js_1.normalize)(joined);
|
|
75
|
+
}
|
|
76
|
+
exports.join = join;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.joinGlobs = void 0;
|
|
6
|
+
const join_js_1 = require("./join.js");
|
|
7
|
+
const constants_js_1 = require("./constants.js");
|
|
8
|
+
const normalize_glob_js_1 = require("./normalize_glob.js");
|
|
9
|
+
/** Like join(), but doesn't collapse "**\/.." when `globstar` is true. */
|
|
10
|
+
function joinGlobs(globs, { extended = true, globstar = false } = {}) {
|
|
11
|
+
if (!globstar || globs.length === 0) {
|
|
12
|
+
return (0, join_js_1.join)(...globs);
|
|
13
|
+
}
|
|
14
|
+
if (globs.length === 0)
|
|
15
|
+
return ".";
|
|
16
|
+
let joined;
|
|
17
|
+
for (const glob of globs) {
|
|
18
|
+
const path = glob;
|
|
19
|
+
if (path.length > 0) {
|
|
20
|
+
if (!joined)
|
|
21
|
+
joined = path;
|
|
22
|
+
else
|
|
23
|
+
joined += `${constants_js_1.SEPARATOR}${path}`;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (!joined)
|
|
27
|
+
return ".";
|
|
28
|
+
return (0, normalize_glob_js_1.normalizeGlob)(joined, { extended, globstar });
|
|
29
|
+
}
|
|
30
|
+
exports.joinGlobs = joinGlobs;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for working with OS-specific file paths.
|
|
3
|
+
*
|
|
4
|
+
* Codes in the examples uses POSIX path but it automatically use Windows path
|
|
5
|
+
* on Windows. Use methods under `posix` or `win32` object instead to handle non
|
|
6
|
+
* platform specific path like:
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { posix, win32 } from "https://deno.land/std@$STD_VERSION/path/mod.ts";
|
|
9
|
+
* const p1 = posix.fromFileUrl("file:///home/foo");
|
|
10
|
+
* const p2 = win32.fromFileUrl("file:///home/foo");
|
|
11
|
+
* console.log(p1); // "/home/foo"
|
|
12
|
+
* console.log(p2); // "\\home\\foo"
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* This module is browser compatible.
|
|
16
|
+
*
|
|
17
|
+
* @module
|
|
18
|
+
*/
|
|
19
|
+
export * from "./basename.js";
|
|
20
|
+
export * from "./constants.js";
|
|
21
|
+
export * from "./dirname.js";
|
|
22
|
+
export * from "./extname.js";
|
|
23
|
+
export * from "./format.js";
|
|
24
|
+
export * from "./from_file_url.js";
|
|
25
|
+
export * from "./is_absolute.js";
|
|
26
|
+
export * from "./join.js";
|
|
27
|
+
export * from "./normalize.js";
|
|
28
|
+
export * from "./parse.js";
|
|
29
|
+
export * from "./relative.js";
|
|
30
|
+
export * from "./resolve.js";
|
|
31
|
+
export * from "./to_file_url.js";
|
|
32
|
+
export * from "./to_namespaced_path.js";
|
|
33
|
+
export * from "./common.js";
|
|
34
|
+
export * from "../_interface.js";
|
|
35
|
+
export * from "./glob_to_regexp.js";
|
|
36
|
+
export * from "./is_glob.js";
|
|
37
|
+
export * from "./join_globs.js";
|
|
38
|
+
export * from "./normalize_glob.js";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
|
+
// Copyright the Browserify authors. MIT License.
|
|
4
|
+
// Ported mostly from https://github.com/browserify/path-browserify/
|
|
5
|
+
// This module is browser compatible.
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
/**
|
|
22
|
+
* Utilities for working with OS-specific file paths.
|
|
23
|
+
*
|
|
24
|
+
* Codes in the examples uses POSIX path but it automatically use Windows path
|
|
25
|
+
* on Windows. Use methods under `posix` or `win32` object instead to handle non
|
|
26
|
+
* platform specific path like:
|
|
27
|
+
* ```ts
|
|
28
|
+
* import { posix, win32 } from "https://deno.land/std@$STD_VERSION/path/mod.ts";
|
|
29
|
+
* const p1 = posix.fromFileUrl("file:///home/foo");
|
|
30
|
+
* const p2 = win32.fromFileUrl("file:///home/foo");
|
|
31
|
+
* console.log(p1); // "/home/foo"
|
|
32
|
+
* console.log(p2); // "\\home\\foo"
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* This module is browser compatible.
|
|
36
|
+
*
|
|
37
|
+
* @module
|
|
38
|
+
*/
|
|
39
|
+
__exportStar(require("./basename.js"), exports);
|
|
40
|
+
__exportStar(require("./constants.js"), exports);
|
|
41
|
+
__exportStar(require("./dirname.js"), exports);
|
|
42
|
+
__exportStar(require("./extname.js"), exports);
|
|
43
|
+
__exportStar(require("./format.js"), exports);
|
|
44
|
+
__exportStar(require("./from_file_url.js"), exports);
|
|
45
|
+
__exportStar(require("./is_absolute.js"), exports);
|
|
46
|
+
__exportStar(require("./join.js"), exports);
|
|
47
|
+
__exportStar(require("./normalize.js"), exports);
|
|
48
|
+
__exportStar(require("./parse.js"), exports);
|
|
49
|
+
__exportStar(require("./relative.js"), exports);
|
|
50
|
+
__exportStar(require("./resolve.js"), exports);
|
|
51
|
+
__exportStar(require("./to_file_url.js"), exports);
|
|
52
|
+
__exportStar(require("./to_namespaced_path.js"), exports);
|
|
53
|
+
__exportStar(require("./common.js"), exports);
|
|
54
|
+
__exportStar(require("../_interface.js"), exports);
|
|
55
|
+
__exportStar(require("./glob_to_regexp.js"), exports);
|
|
56
|
+
__exportStar(require("./is_glob.js"), exports);
|
|
57
|
+
__exportStar(require("./join_globs.js"), exports);
|
|
58
|
+
__exportStar(require("./normalize_glob.js"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalize the `path`, resolving `'..'` and `'.'` segments.
|
|
3
|
+
* Note that resolving these segments does not necessarily mean that all will be eliminated.
|
|
4
|
+
* A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
|
|
5
|
+
* @param path to be normalized
|
|
6
|
+
*/
|
|
7
|
+
export declare function normalize(path: string): string;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.normalize = void 0;
|
|
6
|
+
const normalize_js_1 = require("../_common/normalize.js");
|
|
7
|
+
const constants_js_1 = require("../_common/constants.js");
|
|
8
|
+
const normalize_string_js_1 = require("../_common/normalize_string.js");
|
|
9
|
+
const _util_js_1 = require("./_util.js");
|
|
10
|
+
/**
|
|
11
|
+
* Normalize the `path`, resolving `'..'` and `'.'` segments.
|
|
12
|
+
* Note that resolving these segments does not necessarily mean that all will be eliminated.
|
|
13
|
+
* A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
|
|
14
|
+
* @param path to be normalized
|
|
15
|
+
*/
|
|
16
|
+
function normalize(path) {
|
|
17
|
+
(0, normalize_js_1.assertArg)(path);
|
|
18
|
+
const len = path.length;
|
|
19
|
+
let rootEnd = 0;
|
|
20
|
+
let device;
|
|
21
|
+
let isAbsolute = false;
|
|
22
|
+
const code = path.charCodeAt(0);
|
|
23
|
+
// Try to match a root
|
|
24
|
+
if (len > 1) {
|
|
25
|
+
if ((0, _util_js_1.isPathSeparator)(code)) {
|
|
26
|
+
// Possible UNC root
|
|
27
|
+
// If we started with a separator, we know we at least have an absolute
|
|
28
|
+
// path of some kind (UNC or otherwise)
|
|
29
|
+
isAbsolute = true;
|
|
30
|
+
if ((0, _util_js_1.isPathSeparator)(path.charCodeAt(1))) {
|
|
31
|
+
// Matched double path separator at beginning
|
|
32
|
+
let j = 2;
|
|
33
|
+
let last = j;
|
|
34
|
+
// Match 1 or more non-path separators
|
|
35
|
+
for (; j < len; ++j) {
|
|
36
|
+
if ((0, _util_js_1.isPathSeparator)(path.charCodeAt(j)))
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
if (j < len && j !== last) {
|
|
40
|
+
const firstPart = path.slice(last, j);
|
|
41
|
+
// Matched!
|
|
42
|
+
last = j;
|
|
43
|
+
// Match 1 or more path separators
|
|
44
|
+
for (; j < len; ++j) {
|
|
45
|
+
if (!(0, _util_js_1.isPathSeparator)(path.charCodeAt(j)))
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
if (j < len && j !== last) {
|
|
49
|
+
// Matched!
|
|
50
|
+
last = j;
|
|
51
|
+
// Match 1 or more non-path separators
|
|
52
|
+
for (; j < len; ++j) {
|
|
53
|
+
if ((0, _util_js_1.isPathSeparator)(path.charCodeAt(j)))
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
if (j === len) {
|
|
57
|
+
// We matched a UNC root only
|
|
58
|
+
// Return the normalized version of the UNC root since there
|
|
59
|
+
// is nothing left to process
|
|
60
|
+
return `\\\\${firstPart}\\${path.slice(last)}\\`;
|
|
61
|
+
}
|
|
62
|
+
else if (j !== last) {
|
|
63
|
+
// We matched a UNC root with leftovers
|
|
64
|
+
device = `\\\\${firstPart}\\${path.slice(last, j)}`;
|
|
65
|
+
rootEnd = j;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
rootEnd = 1;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
else if ((0, _util_js_1.isWindowsDeviceRoot)(code)) {
|
|
75
|
+
// Possible device root
|
|
76
|
+
if (path.charCodeAt(1) === constants_js_1.CHAR_COLON) {
|
|
77
|
+
device = path.slice(0, 2);
|
|
78
|
+
rootEnd = 2;
|
|
79
|
+
if (len > 2) {
|
|
80
|
+
if ((0, _util_js_1.isPathSeparator)(path.charCodeAt(2))) {
|
|
81
|
+
// Treat separator following drive name as an absolute path
|
|
82
|
+
// indicator
|
|
83
|
+
isAbsolute = true;
|
|
84
|
+
rootEnd = 3;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
else if ((0, _util_js_1.isPathSeparator)(code)) {
|
|
91
|
+
// `path` contains just a path separator, exit early to avoid unnecessary
|
|
92
|
+
// work
|
|
93
|
+
return "\\";
|
|
94
|
+
}
|
|
95
|
+
let tail;
|
|
96
|
+
if (rootEnd < len) {
|
|
97
|
+
tail = (0, normalize_string_js_1.normalizeString)(path.slice(rootEnd), !isAbsolute, "\\", _util_js_1.isPathSeparator);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
tail = "";
|
|
101
|
+
}
|
|
102
|
+
if (tail.length === 0 && !isAbsolute)
|
|
103
|
+
tail = ".";
|
|
104
|
+
if (tail.length > 0 && (0, _util_js_1.isPathSeparator)(path.charCodeAt(len - 1))) {
|
|
105
|
+
tail += "\\";
|
|
106
|
+
}
|
|
107
|
+
if (device === undefined) {
|
|
108
|
+
if (isAbsolute) {
|
|
109
|
+
if (tail.length > 0)
|
|
110
|
+
return `\\${tail}`;
|
|
111
|
+
else
|
|
112
|
+
return "\\";
|
|
113
|
+
}
|
|
114
|
+
else if (tail.length > 0) {
|
|
115
|
+
return tail;
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
return "";
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
else if (isAbsolute) {
|
|
122
|
+
if (tail.length > 0)
|
|
123
|
+
return `${device}\\${tail}`;
|
|
124
|
+
else
|
|
125
|
+
return `${device}\\`;
|
|
126
|
+
}
|
|
127
|
+
else if (tail.length > 0) {
|
|
128
|
+
return device + tail;
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
return device;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.normalize = normalize;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.normalizeGlob = void 0;
|
|
6
|
+
const normalize_js_1 = require("./normalize.js");
|
|
7
|
+
const constants_js_1 = require("./constants.js");
|
|
8
|
+
/** Like normalize(), but doesn't collapse "**\/.." when `globstar` is true. */
|
|
9
|
+
function normalizeGlob(glob, { globstar = false } = {}) {
|
|
10
|
+
if (glob.match(/\0/g)) {
|
|
11
|
+
throw new Error(`Glob contains invalid characters: "${glob}"`);
|
|
12
|
+
}
|
|
13
|
+
if (!globstar) {
|
|
14
|
+
return (0, normalize_js_1.normalize)(glob);
|
|
15
|
+
}
|
|
16
|
+
const s = constants_js_1.SEPARATOR_PATTERN.source;
|
|
17
|
+
const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g");
|
|
18
|
+
return (0, normalize_js_1.normalize)(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
|
|
19
|
+
}
|
|
20
|
+
exports.normalizeGlob = normalizeGlob;
|