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,68 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { CHAR_DOT } from "../_common/constants.js";
|
|
4
|
+
import { assertPath } from "../_common/assert_path.js";
|
|
5
|
+
import { isPosixPathSeparator } from "./_util.js";
|
|
6
|
+
/**
|
|
7
|
+
* Return the extension of the `path` with leading period.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { extname } from "https://deno.land/std@$STD_VERSION/path/extname.ts";
|
|
12
|
+
*
|
|
13
|
+
* console.log(extname("/home/user/Documents/")); // ""
|
|
14
|
+
* console.log(extname("/home/user/Documents/image.png")); // ".png"
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param path with extension
|
|
18
|
+
* @returns extension (ex. for `file.ts` returns `.ts`)
|
|
19
|
+
*/
|
|
20
|
+
export function extname(path) {
|
|
21
|
+
assertPath(path);
|
|
22
|
+
let startDot = -1;
|
|
23
|
+
let startPart = 0;
|
|
24
|
+
let end = -1;
|
|
25
|
+
let matchedSlash = true;
|
|
26
|
+
// Track the state of characters (if any) we see before our first dot and
|
|
27
|
+
// after any path separator we find
|
|
28
|
+
let preDotState = 0;
|
|
29
|
+
for (let i = path.length - 1; i >= 0; --i) {
|
|
30
|
+
const code = path.charCodeAt(i);
|
|
31
|
+
if (isPosixPathSeparator(code)) {
|
|
32
|
+
// If we reached a path separator that was not part of a set of path
|
|
33
|
+
// separators at the end of the string, stop now
|
|
34
|
+
if (!matchedSlash) {
|
|
35
|
+
startPart = i + 1;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (end === -1) {
|
|
41
|
+
// We saw the first non-path separator, mark this as the end of our
|
|
42
|
+
// extension
|
|
43
|
+
matchedSlash = false;
|
|
44
|
+
end = i + 1;
|
|
45
|
+
}
|
|
46
|
+
if (code === CHAR_DOT) {
|
|
47
|
+
// If this is our first dot, mark it as the start of our extension
|
|
48
|
+
if (startDot === -1)
|
|
49
|
+
startDot = i;
|
|
50
|
+
else if (preDotState !== 1)
|
|
51
|
+
preDotState = 1;
|
|
52
|
+
}
|
|
53
|
+
else if (startDot !== -1) {
|
|
54
|
+
// We saw a non-dot and non-path separator before our dot, so we should
|
|
55
|
+
// have a good chance at having a non-empty extension
|
|
56
|
+
preDotState = -1;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (startDot === -1 ||
|
|
60
|
+
end === -1 ||
|
|
61
|
+
// We saw a non-dot character immediately before the dot
|
|
62
|
+
preDotState === 0 ||
|
|
63
|
+
// The (right-most) trimmed path component is exactly '..'
|
|
64
|
+
(preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)) {
|
|
65
|
+
return "";
|
|
66
|
+
}
|
|
67
|
+
return path.slice(startDot, end);
|
|
68
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { _format, assertArg } from "../_common/format.js";
|
|
4
|
+
/**
|
|
5
|
+
* Generate a path from `FormatInputPathObject` object.
|
|
6
|
+
* @param pathObject with path
|
|
7
|
+
*/
|
|
8
|
+
export function format(pathObject) {
|
|
9
|
+
assertArg(pathObject);
|
|
10
|
+
return _format("/", pathObject);
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/**
|
|
3
|
+
* Converts a file URL to a path string.
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { fromFileUrl } from "https://deno.land/std@$STD_VERSION/path/posix/from_file_url.ts";
|
|
7
|
+
*
|
|
8
|
+
* fromFileUrl("file:///home/foo"); // "/home/foo"
|
|
9
|
+
* ```
|
|
10
|
+
* @param url of a file URL
|
|
11
|
+
*/
|
|
12
|
+
export declare function fromFileUrl(url: URL | string): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { assertArg } from "../_common/from_file_url.js";
|
|
4
|
+
/**
|
|
5
|
+
* Converts a file URL to a path string.
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { fromFileUrl } from "https://deno.land/std@$STD_VERSION/path/posix/from_file_url.ts";
|
|
9
|
+
*
|
|
10
|
+
* fromFileUrl("file:///home/foo"); // "/home/foo"
|
|
11
|
+
* ```
|
|
12
|
+
* @param url of a file URL
|
|
13
|
+
*/
|
|
14
|
+
export function fromFileUrl(url) {
|
|
15
|
+
url = assertArg(url);
|
|
16
|
+
return decodeURIComponent(url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"));
|
|
17
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type GlobToRegExpOptions } from "../_common/glob_to_reg_exp.js";
|
|
2
|
+
/** Convert a glob string to a regular expression.
|
|
3
|
+
*
|
|
4
|
+
* Tries to match bash glob expansion as closely as possible.
|
|
5
|
+
*
|
|
6
|
+
* Basic glob syntax:
|
|
7
|
+
* - `*` - Matches everything without leaving the path segment.
|
|
8
|
+
* - `?` - Matches any single character.
|
|
9
|
+
* - `{foo,bar}` - Matches `foo` or `bar`.
|
|
10
|
+
* - `[abcd]` - Matches `a`, `b`, `c` or `d`.
|
|
11
|
+
* - `[a-d]` - Matches `a`, `b`, `c` or `d`.
|
|
12
|
+
* - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
|
|
13
|
+
* - `[[:<class>:]]` - Matches any character belonging to `<class>`.
|
|
14
|
+
* - `[[:alnum:]]` - Matches any digit or letter.
|
|
15
|
+
* - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
|
|
16
|
+
* - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
|
|
17
|
+
* for a complete list of supported character classes.
|
|
18
|
+
* - `\` - Escapes the next character for an `os` other than `"windows"`.
|
|
19
|
+
* - \` - Escapes the next character for `os` set to `"windows"`.
|
|
20
|
+
* - `/` - Path separator.
|
|
21
|
+
* - `\` - Additional path separator only for `os` set to `"windows"`.
|
|
22
|
+
*
|
|
23
|
+
* Extended syntax:
|
|
24
|
+
* - Requires `{ extended: true }`.
|
|
25
|
+
* - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
|
|
26
|
+
* - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
|
|
27
|
+
* - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
|
|
28
|
+
* - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
|
|
29
|
+
* - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
|
|
30
|
+
* - See https://www.linuxjournal.com/content/bash-extended-globbing.
|
|
31
|
+
*
|
|
32
|
+
* Globstar syntax:
|
|
33
|
+
* - Requires `{ globstar: true }`.
|
|
34
|
+
* - `**` - Matches any number of any path segments.
|
|
35
|
+
* - Must comprise its entire path segment in the provided glob.
|
|
36
|
+
* - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
|
|
37
|
+
*
|
|
38
|
+
* Note the following properties:
|
|
39
|
+
* - The generated `RegExp` is anchored at both start and end.
|
|
40
|
+
* - Repeating and trailing separators are tolerated. Trailing separators in the
|
|
41
|
+
* provided glob have no meaning and are discarded.
|
|
42
|
+
* - Absolute globs will only match absolute paths, etc.
|
|
43
|
+
* - Empty globs will match nothing.
|
|
44
|
+
* - Any special glob syntax must be contained to one path segment. For example,
|
|
45
|
+
* `?(foo|bar/baz)` is invalid. The separator will take precedence and the
|
|
46
|
+
* first segment ends with an unclosed group.
|
|
47
|
+
* - If a path segment ends with unclosed groups or a dangling escape prefix, a
|
|
48
|
+
* parse error has occurred. Every character for that segment is taken
|
|
49
|
+
* literally in this event.
|
|
50
|
+
*
|
|
51
|
+
* Limitations:
|
|
52
|
+
* - A negative group like `!(foo|bar)` will wrongly be converted to a negative
|
|
53
|
+
* look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
|
|
54
|
+
* fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
|
|
55
|
+
* `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
|
|
56
|
+
* the group occurs not nested at the end of the segment. */
|
|
57
|
+
export declare function globToRegExp(glob: string, options?: GlobToRegExpOptions): RegExp;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { _globToRegExp, } from "../_common/glob_to_reg_exp.js";
|
|
4
|
+
const constants = {
|
|
5
|
+
sep: "/+",
|
|
6
|
+
sepMaybe: "/*",
|
|
7
|
+
seps: ["/"],
|
|
8
|
+
globstar: "(?:[^/]*(?:/|$)+)*",
|
|
9
|
+
wildcard: "[^/]*",
|
|
10
|
+
escapePrefix: "\\",
|
|
11
|
+
};
|
|
12
|
+
/** Convert a glob string to a regular expression.
|
|
13
|
+
*
|
|
14
|
+
* Tries to match bash glob expansion as closely as possible.
|
|
15
|
+
*
|
|
16
|
+
* Basic glob syntax:
|
|
17
|
+
* - `*` - Matches everything without leaving the path segment.
|
|
18
|
+
* - `?` - Matches any single character.
|
|
19
|
+
* - `{foo,bar}` - Matches `foo` or `bar`.
|
|
20
|
+
* - `[abcd]` - Matches `a`, `b`, `c` or `d`.
|
|
21
|
+
* - `[a-d]` - Matches `a`, `b`, `c` or `d`.
|
|
22
|
+
* - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
|
|
23
|
+
* - `[[:<class>:]]` - Matches any character belonging to `<class>`.
|
|
24
|
+
* - `[[:alnum:]]` - Matches any digit or letter.
|
|
25
|
+
* - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
|
|
26
|
+
* - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
|
|
27
|
+
* for a complete list of supported character classes.
|
|
28
|
+
* - `\` - Escapes the next character for an `os` other than `"windows"`.
|
|
29
|
+
* - \` - Escapes the next character for `os` set to `"windows"`.
|
|
30
|
+
* - `/` - Path separator.
|
|
31
|
+
* - `\` - Additional path separator only for `os` set to `"windows"`.
|
|
32
|
+
*
|
|
33
|
+
* Extended syntax:
|
|
34
|
+
* - Requires `{ extended: true }`.
|
|
35
|
+
* - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
|
|
36
|
+
* - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
|
|
37
|
+
* - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
|
|
38
|
+
* - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
|
|
39
|
+
* - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
|
|
40
|
+
* - See https://www.linuxjournal.com/content/bash-extended-globbing.
|
|
41
|
+
*
|
|
42
|
+
* Globstar syntax:
|
|
43
|
+
* - Requires `{ globstar: true }`.
|
|
44
|
+
* - `**` - Matches any number of any path segments.
|
|
45
|
+
* - Must comprise its entire path segment in the provided glob.
|
|
46
|
+
* - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
|
|
47
|
+
*
|
|
48
|
+
* Note the following properties:
|
|
49
|
+
* - The generated `RegExp` is anchored at both start and end.
|
|
50
|
+
* - Repeating and trailing separators are tolerated. Trailing separators in the
|
|
51
|
+
* provided glob have no meaning and are discarded.
|
|
52
|
+
* - Absolute globs will only match absolute paths, etc.
|
|
53
|
+
* - Empty globs will match nothing.
|
|
54
|
+
* - Any special glob syntax must be contained to one path segment. For example,
|
|
55
|
+
* `?(foo|bar/baz)` is invalid. The separator will take precedence and the
|
|
56
|
+
* first segment ends with an unclosed group.
|
|
57
|
+
* - If a path segment ends with unclosed groups or a dangling escape prefix, a
|
|
58
|
+
* parse error has occurred. Every character for that segment is taken
|
|
59
|
+
* literally in this event.
|
|
60
|
+
*
|
|
61
|
+
* Limitations:
|
|
62
|
+
* - A negative group like `!(foo|bar)` will wrongly be converted to a negative
|
|
63
|
+
* look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
|
|
64
|
+
* fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
|
|
65
|
+
* `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
|
|
66
|
+
* the group occurs not nested at the end of the segment. */
|
|
67
|
+
export function globToRegExp(glob, options = {}) {
|
|
68
|
+
return _globToRegExp(constants, glob, options);
|
|
69
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { assertPath } from "../_common/assert_path.js";
|
|
4
|
+
import { isPosixPathSeparator } from "./_util.js";
|
|
5
|
+
/**
|
|
6
|
+
* Verifies whether provided path is absolute
|
|
7
|
+
* @param path to be verified as absolute
|
|
8
|
+
*/
|
|
9
|
+
export function isAbsolute(path) {
|
|
10
|
+
assertPath(path);
|
|
11
|
+
return path.length > 0 && isPosixPathSeparator(path.charCodeAt(0));
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isGlob } from "../is_glob.js";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { assertPath } from "../_common/assert_path.js";
|
|
4
|
+
import { normalize } from "./normalize.js";
|
|
5
|
+
/**
|
|
6
|
+
* Join all given a sequence of `paths`,then normalizes the resulting path.
|
|
7
|
+
* @param paths to be joined and normalized
|
|
8
|
+
*/
|
|
9
|
+
export function join(...paths) {
|
|
10
|
+
if (paths.length === 0)
|
|
11
|
+
return ".";
|
|
12
|
+
let joined;
|
|
13
|
+
for (let i = 0; i < paths.length; ++i) {
|
|
14
|
+
const path = paths[i];
|
|
15
|
+
assertPath(path);
|
|
16
|
+
if (path.length > 0) {
|
|
17
|
+
if (!joined)
|
|
18
|
+
joined = path;
|
|
19
|
+
else
|
|
20
|
+
joined += `/${path}`;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (!joined)
|
|
24
|
+
return ".";
|
|
25
|
+
return normalize(joined);
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { join } from "./join.js";
|
|
4
|
+
import { SEPARATOR } from "./constants.js";
|
|
5
|
+
import { normalizeGlob } from "./normalize_glob.js";
|
|
6
|
+
/** Like join(), but doesn't collapse "**\/.." when `globstar` is true. */
|
|
7
|
+
export function joinGlobs(globs, { extended = true, globstar = false } = {}) {
|
|
8
|
+
if (!globstar || globs.length === 0) {
|
|
9
|
+
return join(...globs);
|
|
10
|
+
}
|
|
11
|
+
if (globs.length === 0)
|
|
12
|
+
return ".";
|
|
13
|
+
let joined;
|
|
14
|
+
for (const glob of globs) {
|
|
15
|
+
const path = glob;
|
|
16
|
+
if (path.length > 0) {
|
|
17
|
+
if (!joined)
|
|
18
|
+
joined = path;
|
|
19
|
+
else
|
|
20
|
+
joined += `${SEPARATOR}${path}`;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (!joined)
|
|
24
|
+
return ".";
|
|
25
|
+
return normalizeGlob(joined, { extended, globstar });
|
|
26
|
+
}
|
|
@@ -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,42 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// Copyright the Browserify authors. MIT License.
|
|
3
|
+
// Ported mostly from https://github.com/browserify/path-browserify/
|
|
4
|
+
// This module is browser compatible.
|
|
5
|
+
/**
|
|
6
|
+
* Utilities for working with OS-specific file paths.
|
|
7
|
+
*
|
|
8
|
+
* Codes in the examples uses POSIX path but it automatically use Windows path
|
|
9
|
+
* on Windows. Use methods under `posix` or `win32` object instead to handle non
|
|
10
|
+
* platform specific path like:
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { posix, win32 } from "https://deno.land/std@$STD_VERSION/path/mod.ts";
|
|
13
|
+
* const p1 = posix.fromFileUrl("file:///home/foo");
|
|
14
|
+
* const p2 = win32.fromFileUrl("file:///home/foo");
|
|
15
|
+
* console.log(p1); // "/home/foo"
|
|
16
|
+
* console.log(p2); // "\\home\\foo"
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* This module is browser compatible.
|
|
20
|
+
*
|
|
21
|
+
* @module
|
|
22
|
+
*/
|
|
23
|
+
export * from "./basename.js";
|
|
24
|
+
export * from "./constants.js";
|
|
25
|
+
export * from "./dirname.js";
|
|
26
|
+
export * from "./extname.js";
|
|
27
|
+
export * from "./format.js";
|
|
28
|
+
export * from "./from_file_url.js";
|
|
29
|
+
export * from "./is_absolute.js";
|
|
30
|
+
export * from "./join.js";
|
|
31
|
+
export * from "./normalize.js";
|
|
32
|
+
export * from "./parse.js";
|
|
33
|
+
export * from "./relative.js";
|
|
34
|
+
export * from "./resolve.js";
|
|
35
|
+
export * from "./to_file_url.js";
|
|
36
|
+
export * from "./to_namespaced_path.js";
|
|
37
|
+
export * from "./common.js";
|
|
38
|
+
export * from "../_interface.js";
|
|
39
|
+
export * from "./glob_to_regexp.js";
|
|
40
|
+
export * from "./is_glob.js";
|
|
41
|
+
export * from "./join_globs.js";
|
|
42
|
+
export * from "./normalize_glob.js";
|
|
@@ -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,25 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { assertArg } from "../_common/normalize.js";
|
|
4
|
+
import { normalizeString } from "../_common/normalize_string.js";
|
|
5
|
+
import { isPosixPathSeparator } from "./_util.js";
|
|
6
|
+
/**
|
|
7
|
+
* Normalize the `path`, resolving `'..'` and `'.'` segments.
|
|
8
|
+
* Note that resolving these segments does not necessarily mean that all will be eliminated.
|
|
9
|
+
* A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
|
|
10
|
+
* @param path to be normalized
|
|
11
|
+
*/
|
|
12
|
+
export function normalize(path) {
|
|
13
|
+
assertArg(path);
|
|
14
|
+
const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));
|
|
15
|
+
const trailingSeparator = isPosixPathSeparator(path.charCodeAt(path.length - 1));
|
|
16
|
+
// Normalize the path
|
|
17
|
+
path = normalizeString(path, !isAbsolute, "/", isPosixPathSeparator);
|
|
18
|
+
if (path.length === 0 && !isAbsolute)
|
|
19
|
+
path = ".";
|
|
20
|
+
if (path.length > 0 && trailingSeparator)
|
|
21
|
+
path += "/";
|
|
22
|
+
if (isAbsolute)
|
|
23
|
+
return `/${path}`;
|
|
24
|
+
return path;
|
|
25
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { normalize } from "./normalize.js";
|
|
4
|
+
import { SEPARATOR_PATTERN } from "./constants.js";
|
|
5
|
+
/** Like normalize(), but doesn't collapse "**\/.." when `globstar` is true. */
|
|
6
|
+
export function normalizeGlob(glob, { globstar = false } = {}) {
|
|
7
|
+
if (glob.match(/\0/g)) {
|
|
8
|
+
throw new Error(`Glob contains invalid characters: "${glob}"`);
|
|
9
|
+
}
|
|
10
|
+
if (!globstar) {
|
|
11
|
+
return normalize(glob);
|
|
12
|
+
}
|
|
13
|
+
const s = SEPARATOR_PATTERN.source;
|
|
14
|
+
const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g");
|
|
15
|
+
return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
|
|
16
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { CHAR_DOT } from "../_common/constants.js";
|
|
4
|
+
import { stripTrailingSeparators } from "../_common/strip_trailing_separators.js";
|
|
5
|
+
import { assertPath } from "../_common/assert_path.js";
|
|
6
|
+
import { isPosixPathSeparator } from "./_util.js";
|
|
7
|
+
/**
|
|
8
|
+
* Return a `ParsedPath` object of the `path`.
|
|
9
|
+
* @param path to process
|
|
10
|
+
*/
|
|
11
|
+
export function parse(path) {
|
|
12
|
+
assertPath(path);
|
|
13
|
+
const ret = { root: "", dir: "", base: "", ext: "", name: "" };
|
|
14
|
+
if (path.length === 0)
|
|
15
|
+
return ret;
|
|
16
|
+
const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));
|
|
17
|
+
let start;
|
|
18
|
+
if (isAbsolute) {
|
|
19
|
+
ret.root = "/";
|
|
20
|
+
start = 1;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
start = 0;
|
|
24
|
+
}
|
|
25
|
+
let startDot = -1;
|
|
26
|
+
let startPart = 0;
|
|
27
|
+
let end = -1;
|
|
28
|
+
let matchedSlash = true;
|
|
29
|
+
let i = path.length - 1;
|
|
30
|
+
// Track the state of characters (if any) we see before our first dot and
|
|
31
|
+
// after any path separator we find
|
|
32
|
+
let preDotState = 0;
|
|
33
|
+
// Get non-dir info
|
|
34
|
+
for (; i >= start; --i) {
|
|
35
|
+
const code = path.charCodeAt(i);
|
|
36
|
+
if (isPosixPathSeparator(code)) {
|
|
37
|
+
// If we reached a path separator that was not part of a set of path
|
|
38
|
+
// separators at the end of the string, stop now
|
|
39
|
+
if (!matchedSlash) {
|
|
40
|
+
startPart = i + 1;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (end === -1) {
|
|
46
|
+
// We saw the first non-path separator, mark this as the end of our
|
|
47
|
+
// extension
|
|
48
|
+
matchedSlash = false;
|
|
49
|
+
end = i + 1;
|
|
50
|
+
}
|
|
51
|
+
if (code === CHAR_DOT) {
|
|
52
|
+
// If this is our first dot, mark it as the start of our extension
|
|
53
|
+
if (startDot === -1)
|
|
54
|
+
startDot = i;
|
|
55
|
+
else if (preDotState !== 1)
|
|
56
|
+
preDotState = 1;
|
|
57
|
+
}
|
|
58
|
+
else if (startDot !== -1) {
|
|
59
|
+
// We saw a non-dot and non-path separator before our dot, so we should
|
|
60
|
+
// have a good chance at having a non-empty extension
|
|
61
|
+
preDotState = -1;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (startDot === -1 ||
|
|
65
|
+
end === -1 ||
|
|
66
|
+
// We saw a non-dot character immediately before the dot
|
|
67
|
+
preDotState === 0 ||
|
|
68
|
+
// The (right-most) trimmed path component is exactly '..'
|
|
69
|
+
(preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)) {
|
|
70
|
+
if (end !== -1) {
|
|
71
|
+
if (startPart === 0 && isAbsolute) {
|
|
72
|
+
ret.base = ret.name = path.slice(1, end);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
ret.base = ret.name = path.slice(startPart, end);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
// Fallback to '/' in case there is no basename
|
|
79
|
+
ret.base = ret.base || "/";
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
if (startPart === 0 && isAbsolute) {
|
|
83
|
+
ret.name = path.slice(1, startDot);
|
|
84
|
+
ret.base = path.slice(1, end);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
ret.name = path.slice(startPart, startDot);
|
|
88
|
+
ret.base = path.slice(startPart, end);
|
|
89
|
+
}
|
|
90
|
+
ret.ext = path.slice(startDot, end);
|
|
91
|
+
}
|
|
92
|
+
if (startPart > 0) {
|
|
93
|
+
ret.dir = stripTrailingSeparators(path.slice(0, startPart - 1), isPosixPathSeparator);
|
|
94
|
+
}
|
|
95
|
+
else if (isAbsolute)
|
|
96
|
+
ret.dir = "/";
|
|
97
|
+
return ret;
|
|
98
|
+
}
|