ventojs 0.8.1 → 0.9.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/README.md +7 -63
- package/esm/deps/deno.land/std@0.205.0/html/entities.d.ts +38 -0
- package/esm/deps/deno.land/std@0.205.0/html/entities.js +76 -0
- package/esm/deps/deno.land/std@0.205.0/html/mod.d.ts +6 -0
- package/esm/deps/deno.land/std@0.205.0/html/mod.js +8 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/assert_path.d.ts +1 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/assert_path.js +7 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/basename.d.ts +3 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/basename.js +40 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/common.d.ts +1 -0
- package/esm/deps/deno.land/{std@0.201.0/path → std@0.205.0/path/_common}/common.js +1 -14
- package/esm/deps/deno.land/std@0.205.0/path/_common/dirname.d.ts +1 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/dirname.js +8 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/format.d.ts +3 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/format.js +19 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/from_file_url.d.ts +2 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/from_file_url.js +9 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/glob_to_reg_exp.d.ts +27 -0
- package/esm/deps/deno.land/{std@0.201.0/path/glob.js → std@0.205.0/path/_common/glob_to_reg_exp.js} +13 -139
- package/esm/deps/deno.land/std@0.205.0/path/_common/is_glob.d.ts +2 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/is_glob.js +28 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/normalize.d.ts +1 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/normalize.js +8 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/normalize_string.d.ts +1 -0
- package/esm/deps/deno.land/{std@0.201.0/path/_util.js → std@0.205.0/path/_common/normalize_string.js} +1 -31
- package/esm/deps/deno.land/std@0.205.0/path/_common/relative.d.ts +1 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/relative.js +9 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/strip_trailing_separators.d.ts +1 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/strip_trailing_separators.js +19 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/to_file_url.d.ts +1 -0
- package/esm/deps/deno.land/std@0.205.0/path/_common/to_file_url.js +15 -0
- package/esm/deps/deno.land/std@0.205.0/path/_os.d.ts +3 -0
- package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/_os.js +1 -1
- package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/basename.js +2 -1
- package/esm/deps/deno.land/std@0.205.0/path/common.js +19 -0
- package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/dirname.js +2 -1
- package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/extname.js +2 -1
- package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/format.js +2 -1
- package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/from_file_url.js +2 -1
- package/esm/deps/deno.land/std@0.205.0/path/glob.d.ts +67 -0
- package/esm/deps/deno.land/std@0.205.0/path/glob.js +78 -0
- package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/is_absolute.js +2 -1
- package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/join.js +2 -1
- package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/mod.d.ts +6 -3
- package/esm/deps/deno.land/std@0.205.0/path/mod.js +60 -0
- package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/normalize.js +2 -1
- package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/parse.js +2 -1
- package/esm/deps/deno.land/std@0.205.0/path/posix/_util.d.ts +1 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/_util.js +8 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/basename.js +18 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/common.js +19 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/dirname.js +36 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/extname.js +59 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/format.d.ts +6 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/format.js +11 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/from_file_url.d.ts +12 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/from_file_url.js +17 -0
- package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.205.0/path/posix}/glob.d.ts +3 -24
- package/esm/deps/deno.land/std@0.205.0/path/posix/glob.js +106 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/is_absolute.js +12 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/join.js +26 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/mod.d.ts +37 -0
- package/esm/deps/deno.land/{std@0.201.0/path → std@0.205.0/path/posix}/mod.js +4 -8
- package/esm/deps/deno.land/std@0.205.0/path/posix/normalize.js +25 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/parse.d.ts +6 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/parse.js +98 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/relative.d.ts +7 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/relative.js +94 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/resolve.js +48 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/separator.d.ts +2 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/separator.js +4 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/to_file_url.d.ts +12 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/to_file_url.js +22 -0
- package/esm/deps/deno.land/std@0.205.0/path/posix/to_namespaced_path.js +10 -0
- package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/relative.js +2 -1
- package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/resolve.js +2 -1
- package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/to_file_url.js +2 -1
- package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/to_namespaced_path.js +2 -1
- package/esm/deps/deno.land/std@0.205.0/path/windows/_util.d.ts +3 -0
- package/esm/deps/deno.land/std@0.205.0/path/windows/_util.js +15 -0
- package/esm/deps/deno.land/std@0.205.0/path/windows/basename.d.ts +8 -0
- package/esm/deps/deno.land/std@0.205.0/path/windows/basename.js +30 -0
- package/esm/deps/deno.land/std@0.205.0/path/windows/common.d.ts +13 -0
- package/esm/deps/deno.land/std@0.205.0/path/windows/common.js +19 -0
- package/esm/deps/deno.land/std@0.205.0/path/windows/dirname.d.ts +5 -0
- package/esm/deps/deno.land/{std@0.201.0/path/_dirname.js → std@0.205.0/path/windows/dirname.js} +5 -39
- package/esm/deps/deno.land/std@0.205.0/path/windows/extname.d.ts +6 -0
- package/esm/deps/deno.land/{std@0.201.0/path/_extname.js → std@0.205.0/path/windows/extname.js} +4 -57
- package/esm/deps/deno.land/std@0.205.0/path/windows/format.d.ts +6 -0
- package/esm/deps/deno.land/std@0.205.0/path/windows/format.js +11 -0
- package/esm/deps/deno.land/{std@0.201.0/path/_from_file_url.d.ts → std@0.205.0/path/windows/from_file_url.d.ts} +1 -12
- package/esm/deps/deno.land/{std@0.201.0/path/_from_file_url.js → std@0.205.0/path/windows/from_file_url.js} +2 -22
- package/esm/deps/deno.land/{std@0.201.0/path → std@0.205.0/path/windows}/glob.d.ts +3 -24
- package/esm/deps/deno.land/std@0.205.0/path/windows/glob.js +106 -0
- package/esm/deps/deno.land/std@0.205.0/path/windows/is_absolute.d.ts +5 -0
- package/esm/deps/deno.land/{std@0.201.0/path/_is_absolute.js → std@0.205.0/path/windows/is_absolute.js} +4 -11
- package/esm/deps/deno.land/std@0.205.0/path/windows/join.d.ts +5 -0
- package/esm/deps/deno.land/{std@0.201.0/path/_join.js → std@0.205.0/path/windows/join.js} +6 -27
- package/esm/deps/deno.land/std@0.205.0/path/windows/mod.d.ts +37 -0
- package/esm/deps/deno.land/std@0.205.0/path/windows/mod.js +41 -0
- package/esm/deps/deno.land/std@0.205.0/path/windows/normalize.d.ts +7 -0
- package/esm/deps/deno.land/{std@0.201.0/path/_normalize.js → std@0.205.0/path/windows/normalize.js} +5 -28
- package/esm/deps/deno.land/std@0.205.0/path/windows/parse.d.ts +6 -0
- package/esm/deps/deno.land/{std@0.201.0/path/_parse.js → std@0.205.0/path/windows/parse.js} +4 -95
- package/esm/deps/deno.land/{std@0.201.0/path/_relative.js → std@0.205.0/path/windows/relative.js} +6 -101
- package/esm/deps/deno.land/std@0.205.0/path/windows/resolve.d.ts +5 -0
- package/esm/deps/deno.land/{std@0.201.0/path/_resolve.js → std@0.205.0/path/windows/resolve.js} +6 -46
- package/esm/deps/deno.land/std@0.205.0/path/windows/separator.d.ts +2 -0
- package/esm/deps/deno.land/std@0.205.0/path/windows/separator.js +4 -0
- package/{script/deps/deno.land/std@0.201.0/path/_to_file_url.d.ts → esm/deps/deno.land/std@0.205.0/path/windows/to_file_url.d.ts} +1 -12
- package/esm/deps/deno.land/{std@0.201.0/path/_to_file_url.js → std@0.205.0/path/windows/to_file_url.js} +4 -34
- package/esm/deps/deno.land/std@0.205.0/path/windows/to_namespaced_path.d.ts +5 -0
- package/esm/deps/deno.land/{std@0.201.0/path/_to_namespaced_path.js → std@0.205.0/path/windows/to_namespaced_path.js} +4 -12
- package/esm/deps.d.ts +2 -1
- package/esm/deps.js +2 -1
- package/esm/mod.d.ts +1 -0
- package/esm/mod.js +1 -0
- package/esm/plugins/escape.js +2 -12
- package/esm/plugins/export.js +5 -4
- package/esm/plugins/import.js +4 -11
- package/esm/plugins/include.js +3 -2
- package/esm/plugins/layout.js +4 -3
- package/esm/plugins/set.js +5 -4
- package/esm/plugins/unescape.js +2 -12
- package/esm/src/environment.d.ts +6 -0
- package/esm/src/environment.js +55 -31
- package/esm/src/tokenizer.d.ts +7 -2
- package/esm/src/tokenizer.js +77 -66
- package/package.json +1 -1
- package/script/deps/deno.land/std@0.205.0/html/entities.d.ts +38 -0
- package/script/deps/deno.land/std@0.205.0/html/entities.js +81 -0
- package/script/deps/deno.land/std@0.205.0/html/mod.d.ts +6 -0
- package/script/deps/deno.land/std@0.205.0/html/mod.js +24 -0
- package/script/deps/deno.land/std@0.205.0/path/_common/assert_path.d.ts +1 -0
- package/script/deps/deno.land/std@0.205.0/path/_common/assert_path.js +11 -0
- package/script/deps/deno.land/std@0.205.0/path/_common/basename.d.ts +3 -0
- package/script/deps/deno.land/std@0.205.0/path/_common/basename.js +46 -0
- package/script/deps/deno.land/std@0.205.0/path/_common/common.d.ts +1 -0
- package/script/deps/deno.land/{std@0.201.0/path → std@0.205.0/path/_common}/common.js +3 -16
- package/script/deps/deno.land/std@0.205.0/path/_common/dirname.d.ts +1 -0
- package/script/deps/deno.land/std@0.205.0/path/_common/dirname.js +12 -0
- package/script/deps/deno.land/std@0.205.0/path/_common/format.d.ts +3 -0
- package/{esm/deps/deno.land/std@0.201.0/path/_format.js → script/deps/deno.land/std@0.205.0/path/_common/format.js} +5 -16
- package/script/deps/deno.land/std@0.205.0/path/_common/from_file_url.d.ts +2 -0
- package/script/deps/deno.land/std@0.205.0/path/_common/from_file_url.js +13 -0
- package/script/deps/deno.land/std@0.205.0/path/_common/glob_to_reg_exp.d.ts +27 -0
- package/script/deps/deno.land/{std@0.201.0/path/glob.js → std@0.205.0/path/_common/glob_to_reg_exp.js} +15 -167
- package/script/deps/deno.land/std@0.205.0/path/_common/is_glob.d.ts +2 -0
- package/script/deps/deno.land/std@0.205.0/path/_common/is_glob.js +32 -0
- package/script/deps/deno.land/std@0.205.0/path/_common/normalize.d.ts +1 -0
- package/script/deps/deno.land/std@0.205.0/path/_common/normalize.js +12 -0
- package/script/deps/deno.land/std@0.205.0/path/_common/normalize_string.d.ts +1 -0
- package/script/deps/deno.land/{std@0.201.0/path/_util.js → std@0.205.0/path/_common/normalize_string.js} +6 -41
- package/script/deps/deno.land/std@0.205.0/path/_common/relative.d.ts +1 -0
- package/script/deps/deno.land/std@0.205.0/path/_common/relative.js +13 -0
- package/script/deps/deno.land/std@0.205.0/path/_common/strip_trailing_separators.d.ts +1 -0
- package/script/deps/deno.land/std@0.205.0/path/_common/strip_trailing_separators.js +23 -0
- package/script/deps/deno.land/std@0.205.0/path/_common/to_file_url.d.ts +1 -0
- package/script/deps/deno.land/std@0.205.0/path/_common/to_file_url.js +19 -0
- package/script/deps/deno.land/std@0.205.0/path/_os.d.ts +3 -0
- package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/_os.js +4 -4
- package/script/deps/deno.land/std@0.205.0/path/basename.d.ts +8 -0
- package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/basename.js +4 -3
- package/script/deps/deno.land/std@0.205.0/path/common.d.ts +13 -0
- package/script/deps/deno.land/std@0.205.0/path/common.js +23 -0
- package/script/deps/deno.land/std@0.205.0/path/dirname.d.ts +5 -0
- package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/dirname.js +3 -2
- package/script/deps/deno.land/std@0.205.0/path/extname.d.ts +6 -0
- package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/extname.js +3 -2
- package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/format.js +3 -2
- package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/from_file_url.js +3 -2
- package/script/deps/deno.land/std@0.205.0/path/glob.d.ts +67 -0
- package/script/deps/deno.land/std@0.205.0/path/glob.js +85 -0
- package/script/deps/deno.land/std@0.205.0/path/is_absolute.d.ts +5 -0
- package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/is_absolute.js +3 -2
- package/script/deps/deno.land/std@0.205.0/path/join.d.ts +5 -0
- package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/join.js +3 -2
- package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/mod.d.ts +6 -3
- package/script/deps/deno.land/std@0.205.0/path/mod.js +89 -0
- package/script/deps/deno.land/std@0.205.0/path/normalize.d.ts +7 -0
- package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/normalize.js +3 -2
- package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/parse.js +3 -2
- package/script/deps/deno.land/std@0.205.0/path/posix/_util.d.ts +1 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/_util.js +12 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/basename.d.ts +8 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/basename.js +22 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/common.d.ts +13 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/common.js +23 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/dirname.d.ts +5 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/dirname.js +40 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/extname.d.ts +6 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/extname.js +63 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/format.d.ts +6 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/format.js +15 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/from_file_url.d.ts +12 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/from_file_url.js +21 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/glob.d.ts +62 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/glob.js +113 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/is_absolute.d.ts +5 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/is_absolute.js +16 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/join.d.ts +5 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/join.js +30 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/mod.d.ts +37 -0
- package/script/deps/deno.land/{std@0.201.0/path → std@0.205.0/path/posix}/mod.js +5 -21
- package/script/deps/deno.land/std@0.205.0/path/posix/normalize.d.ts +7 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/normalize.js +29 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/parse.d.ts +6 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/parse.js +102 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/relative.d.ts +7 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/relative.js +98 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/resolve.d.ts +5 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/resolve.js +75 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/separator.d.ts +2 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/separator.js +7 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/to_file_url.d.ts +12 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/to_file_url.js +26 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/to_namespaced_path.d.ts +5 -0
- package/script/deps/deno.land/std@0.205.0/path/posix/to_namespaced_path.js +14 -0
- package/script/deps/deno.land/{std@0.201.0/path/_relative.d.ts → std@0.205.0/path/relative.d.ts} +1 -8
- package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/relative.js +3 -2
- package/script/deps/deno.land/std@0.205.0/path/resolve.d.ts +5 -0
- package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/resolve.js +4 -3
- package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/to_file_url.js +3 -2
- package/script/deps/deno.land/std@0.205.0/path/to_namespaced_path.d.ts +5 -0
- package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/to_namespaced_path.js +4 -3
- package/script/deps/deno.land/std@0.205.0/path/windows/_util.d.ts +3 -0
- package/script/deps/deno.land/std@0.205.0/path/windows/_util.js +21 -0
- package/script/deps/deno.land/std@0.205.0/path/windows/basename.d.ts +8 -0
- package/script/deps/deno.land/std@0.205.0/path/windows/basename.js +34 -0
- package/script/deps/deno.land/std@0.205.0/path/windows/common.d.ts +13 -0
- package/script/deps/deno.land/std@0.205.0/path/windows/common.js +23 -0
- package/script/deps/deno.land/std@0.205.0/path/windows/dirname.d.ts +5 -0
- package/script/deps/deno.land/{std@0.201.0/path/_dirname.js → std@0.205.0/path/windows/dirname.js} +9 -44
- package/script/deps/deno.land/std@0.205.0/path/windows/extname.d.ts +6 -0
- package/script/deps/deno.land/{std@0.201.0/path/_extname.js → std@0.205.0/path/windows/extname.js} +8 -62
- package/script/deps/deno.land/std@0.205.0/path/windows/format.d.ts +6 -0
- package/script/deps/deno.land/std@0.205.0/path/windows/format.js +15 -0
- package/script/deps/deno.land/{std@0.201.0/path/_from_file_url.d.ts → std@0.205.0/path/windows/from_file_url.d.ts} +1 -12
- package/script/deps/deno.land/{std@0.201.0/path/_from_file_url.js → std@0.205.0/path/windows/from_file_url.js} +5 -26
- package/script/deps/deno.land/std@0.205.0/path/windows/glob.d.ts +62 -0
- package/script/deps/deno.land/std@0.205.0/path/windows/glob.js +113 -0
- package/script/deps/deno.land/std@0.205.0/path/windows/is_absolute.d.ts +5 -0
- package/script/deps/deno.land/{std@0.201.0/path/_is_absolute.js → std@0.205.0/path/windows/is_absolute.js} +7 -15
- package/script/deps/deno.land/std@0.205.0/path/windows/join.d.ts +5 -0
- package/script/deps/deno.land/{std@0.201.0/path/_join.js → std@0.205.0/path/windows/join.js} +8 -30
- package/script/deps/deno.land/std@0.205.0/path/windows/mod.d.ts +37 -0
- package/script/deps/deno.land/std@0.205.0/path/windows/mod.js +58 -0
- package/script/deps/deno.land/std@0.205.0/path/windows/normalize.d.ts +7 -0
- package/script/deps/deno.land/{std@0.201.0/path/_normalize.js → std@0.205.0/path/windows/normalize.js} +9 -33
- package/script/deps/deno.land/std@0.205.0/path/windows/parse.d.ts +6 -0
- package/script/deps/deno.land/{std@0.201.0/path/_parse.js → std@0.205.0/path/windows/parse.js} +8 -100
- package/script/deps/deno.land/std@0.205.0/path/windows/relative.d.ts +12 -0
- package/script/deps/deno.land/std@0.205.0/path/windows/relative.js +125 -0
- package/script/deps/deno.land/std@0.205.0/path/windows/resolve.d.ts +5 -0
- package/script/deps/deno.land/{std@0.201.0/path/_resolve.js → std@0.205.0/path/windows/resolve.js} +10 -51
- package/script/deps/deno.land/std@0.205.0/path/windows/separator.d.ts +2 -0
- package/script/deps/deno.land/std@0.205.0/path/windows/separator.js +7 -0
- package/{esm/deps/deno.land/std@0.201.0/path/_to_file_url.d.ts → script/deps/deno.land/std@0.205.0/path/windows/to_file_url.d.ts} +1 -12
- package/script/deps/deno.land/std@0.205.0/path/windows/to_file_url.js +35 -0
- package/script/deps/deno.land/std@0.205.0/path/windows/to_namespaced_path.d.ts +5 -0
- package/script/deps/deno.land/{std@0.201.0/path/_to_namespaced_path.js → std@0.205.0/path/windows/to_namespaced_path.js} +11 -20
- package/script/deps.d.ts +2 -1
- package/script/deps.js +3 -2
- package/script/mod.d.ts +1 -0
- package/script/mod.js +1 -0
- package/script/plugins/escape.js +2 -12
- package/script/plugins/export.js +5 -4
- package/script/plugins/import.js +4 -11
- package/script/plugins/include.js +3 -2
- package/script/plugins/layout.js +4 -3
- package/script/plugins/set.js +5 -4
- package/script/plugins/unescape.js +2 -12
- package/script/src/environment.d.ts +6 -0
- package/script/src/environment.js +57 -32
- package/script/src/tokenizer.d.ts +7 -2
- package/script/src/tokenizer.js +77 -66
- package/esm/deps/deno.land/std@0.201.0/path/_basename.d.ts +0 -16
- package/esm/deps/deno.land/std@0.201.0/path/_basename.js +0 -78
- package/esm/deps/deno.land/std@0.201.0/path/_dirname.d.ts +0 -10
- package/esm/deps/deno.land/std@0.201.0/path/_extname.d.ts +0 -12
- package/esm/deps/deno.land/std@0.201.0/path/_format.d.ts +0 -11
- package/esm/deps/deno.land/std@0.201.0/path/_is_absolute.d.ts +0 -10
- package/esm/deps/deno.land/std@0.201.0/path/_join.d.ts +0 -10
- package/esm/deps/deno.land/std@0.201.0/path/_normalize.d.ts +0 -14
- package/esm/deps/deno.land/std@0.201.0/path/_os.d.ts +0 -4
- package/esm/deps/deno.land/std@0.201.0/path/_parse.d.ts +0 -11
- package/esm/deps/deno.land/std@0.201.0/path/_relative.d.ts +0 -19
- package/esm/deps/deno.land/std@0.201.0/path/_resolve.d.ts +0 -10
- package/esm/deps/deno.land/std@0.201.0/path/_to_namespaced_path.d.ts +0 -10
- package/esm/deps/deno.land/std@0.201.0/path/_util.d.ts +0 -6
- package/esm/deps/deno.land/std@0.201.0/path/posix.d.ts +0 -15
- package/esm/deps/deno.land/std@0.201.0/path/posix.js +0 -19
- package/esm/deps/deno.land/std@0.201.0/path/win32.d.ts +0 -15
- package/esm/deps/deno.land/std@0.201.0/path/win32.js +0 -19
- package/script/deps/deno.land/std@0.201.0/path/_basename.d.ts +0 -16
- package/script/deps/deno.land/std@0.201.0/path/_basename.js +0 -83
- package/script/deps/deno.land/std@0.201.0/path/_dirname.d.ts +0 -10
- package/script/deps/deno.land/std@0.201.0/path/_extname.d.ts +0 -12
- package/script/deps/deno.land/std@0.201.0/path/_format.d.ts +0 -11
- package/script/deps/deno.land/std@0.201.0/path/_format.js +0 -40
- package/script/deps/deno.land/std@0.201.0/path/_is_absolute.d.ts +0 -10
- package/script/deps/deno.land/std@0.201.0/path/_join.d.ts +0 -10
- package/script/deps/deno.land/std@0.201.0/path/_normalize.d.ts +0 -14
- package/script/deps/deno.land/std@0.201.0/path/_os.d.ts +0 -4
- package/script/deps/deno.land/std@0.201.0/path/_parse.d.ts +0 -11
- package/script/deps/deno.land/std@0.201.0/path/_relative.js +0 -221
- package/script/deps/deno.land/std@0.201.0/path/_resolve.d.ts +0 -10
- package/script/deps/deno.land/std@0.201.0/path/_to_file_url.js +0 -66
- package/script/deps/deno.land/std@0.201.0/path/_to_namespaced_path.d.ts +0 -10
- package/script/deps/deno.land/std@0.201.0/path/_util.d.ts +0 -6
- package/script/deps/deno.land/std@0.201.0/path/posix.d.ts +0 -15
- package/script/deps/deno.land/std@0.201.0/path/posix.js +0 -35
- package/script/deps/deno.land/std@0.201.0/path/win32.d.ts +0 -15
- package/script/deps/deno.land/std@0.201.0/path/win32.js +0 -35
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/assert/assert.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/assert/assert.js +0 -0
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/assert/assertion_error.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/assert/assertion_error.js +0 -0
- /package/esm/deps/deno.land/{std@0.201.0/path/_constants.d.ts → std@0.205.0/path/_common/constants.d.ts} +0 -0
- /package/esm/deps/deno.land/{std@0.201.0/path/_constants.js → std@0.205.0/path/_common/constants.js} +0 -0
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/_interface.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/_interface.js +0 -0
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/basename.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/common.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/dirname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/extname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/from_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/is_absolute.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/join.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/normalize.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/parse.d.ts +0 -0
- /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.205.0/path/posix}/basename.d.ts +0 -0
- /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.205.0/path/posix}/common.d.ts +0 -0
- /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.205.0/path/posix}/dirname.d.ts +0 -0
- /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.205.0/path/posix}/extname.d.ts +0 -0
- /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.205.0/path/posix}/is_absolute.d.ts +0 -0
- /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.205.0/path/posix}/join.d.ts +0 -0
- /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.205.0/path/posix}/normalize.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.201.0/path → std@0.205.0/path/posix}/resolve.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.201.0/path → std@0.205.0/path/posix}/to_namespaced_path.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/relative.d.ts +0 -0
- /package/{script/deps/deno.land/std@0.201.0 → esm/deps/deno.land/std@0.205.0}/path/resolve.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/separator.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/separator.js +0 -0
- /package/esm/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/to_file_url.d.ts +0 -0
- /package/{script/deps/deno.land/std@0.201.0 → esm/deps/deno.land/std@0.205.0}/path/to_namespaced_path.d.ts +0 -0
- /package/{script/deps/deno.land/std@0.201.0/path → esm/deps/deno.land/std@0.205.0/path/windows}/relative.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/assert/assert.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/assert/assert.js +0 -0
- /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/assert/assertion_error.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/assert/assertion_error.js +0 -0
- /package/script/deps/deno.land/{std@0.201.0/path/_constants.d.ts → std@0.205.0/path/_common/constants.d.ts} +0 -0
- /package/script/deps/deno.land/{std@0.201.0/path/_constants.js → std@0.205.0/path/_common/constants.js} +0 -0
- /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/_interface.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/_interface.js +0 -0
- /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/format.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/from_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/parse.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/separator.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/separator.js +0 -0
- /package/script/deps/deno.land/{std@0.201.0 → std@0.205.0}/path/to_file_url.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Vento
|
|
2
2
|
|
|
3
3
|
This is a minimal template engine inspired by other great engines like Nunjucks,
|
|
4
|
-
Liquid, Mustache
|
|
4
|
+
Liquid, Mustache, and EJS.
|
|
5
5
|
|
|
6
6
|
## Why another template engine?
|
|
7
7
|
|
|
@@ -32,6 +32,7 @@ neither is). The issues I found in existing template engines:
|
|
|
32
32
|
### Liquid
|
|
33
33
|
|
|
34
34
|
- I like:
|
|
35
|
+
|
|
35
36
|
- The support for async evaluation is less hacky than Nunjucks.
|
|
36
37
|
- The variables are not escaped by default, there's an `escape` filter for
|
|
37
38
|
that.
|
|
@@ -91,66 +92,9 @@ First, let's take a look at this syntax example:
|
|
|
91
92
|
|
|
92
93
|
## Getting started
|
|
93
94
|
|
|
94
|
-
|
|
95
|
-
future.~~
|
|
96
|
-
[There's already an NPM version](https://www.npmjs.com/package/ventojs) that you
|
|
97
|
-
can install with `npm install ventojs`.
|
|
98
|
-
|
|
99
|
-
Import the library and create an instance:
|
|
100
|
-
|
|
101
|
-
```ts
|
|
102
|
-
import vento from "https://deno.land/x/vento/mod.ts";
|
|
103
|
-
|
|
104
|
-
const vto = vento({
|
|
105
|
-
// Resolve the non-relative includes paths
|
|
106
|
-
includes: "./path/to/includes",
|
|
107
|
-
});
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
Or in Node:
|
|
111
|
-
|
|
112
|
-
```ts
|
|
113
|
-
import vento from "ventojs";
|
|
114
|
-
|
|
115
|
-
const vto = vento({
|
|
116
|
-
// Resolve the non-relative includes paths
|
|
117
|
-
includes: "./path/to/includes",
|
|
118
|
-
});
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
There are different ways to load, compile and run a template. For example, you
|
|
122
|
-
can use `load` to load and compile a template file and return it.
|
|
123
|
-
|
|
124
|
-
```ts
|
|
125
|
-
// Load and return a template
|
|
126
|
-
const template = await vto.load("my-template.vto");
|
|
127
|
-
|
|
128
|
-
// Now you can use it passing the data
|
|
129
|
-
const result = await template({ title: "Hello world" });
|
|
130
|
-
console.log(result.content);
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Alternatively, you can load and run the template file in a single call:
|
|
134
|
-
|
|
135
|
-
```ts
|
|
136
|
-
const result = await vto.run("my-template.vto", { title: "Hello world" });
|
|
137
|
-
console.log(result.content);
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
If the template code is not a file, you can run it directly:
|
|
141
|
-
|
|
142
|
-
```ts
|
|
143
|
-
const result = await vto.runString("<h1>{{ title }}</h1>", {
|
|
144
|
-
title: "Hello world",
|
|
145
|
-
});
|
|
146
|
-
console.log(result.content);
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
## Visual Studio Code Support
|
|
150
|
-
|
|
151
|
-
[The Vento extension for VS Code](https://marketplace.visualstudio.com/items?itemName=oscarotero.vento-syntax)
|
|
152
|
-
enables syntax highlight and provides some useful snippets.
|
|
95
|
+
See [Getting started](https://vento.js.org/getting-started/) on the docs.
|
|
153
96
|
|
|
154
|
-
##
|
|
97
|
+
## Editor support
|
|
155
98
|
|
|
156
|
-
[
|
|
99
|
+
See [Editor integrations](https://vento.js.org/editor-integrations/) on the
|
|
100
|
+
docs.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type EntityList = Record<string, string>;
|
|
2
|
+
/**
|
|
3
|
+
* Escapes text for safe interpolation into HTML text content and quoted attributes
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { escape } from "https://deno.land/std@$STD_VERSION/html/entities.ts";
|
|
8
|
+
* import { assertEquals } from "https://deno.land/std@$STD_VERSION/assert/assert_equals.ts";
|
|
9
|
+
*
|
|
10
|
+
* assertEquals(escape("<>'&AA"), "<>'&AA");
|
|
11
|
+
*
|
|
12
|
+
* // characters that don't need to be escaped will be left alone,
|
|
13
|
+
* // even if named HTML entities exist for them
|
|
14
|
+
* assertEquals(escape("þð"), "þð");
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function escape(str: string): string;
|
|
18
|
+
export type UnescapeOptions = {
|
|
19
|
+
entityList: EntityList;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Unescapes HTML entities in text
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { unescape } from "https://deno.land/std@$STD_VERSION/html/entities.ts";
|
|
27
|
+
* import { assertEquals } from "https://deno.land/std@$STD_VERSION/assert/assert_equals.ts";
|
|
28
|
+
*
|
|
29
|
+
* // default options (only handles &<>'" and numeric entities)
|
|
30
|
+
* assertEquals(unescape("<>'&AA"), "<>'&AA");
|
|
31
|
+
* assertEquals(unescape("þð"), "þð");
|
|
32
|
+
*
|
|
33
|
+
* // using the full named entity list from the HTML spec (~47K unminified)
|
|
34
|
+
* import entityList from "https://deno.land/std@$STD_VERSION/html/named_entity_list.json" assert { type: "json" };
|
|
35
|
+
* assertEquals(unescape("þð", { entityList }), "þð");
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function unescape(str: string, options?: Partial<UnescapeOptions>): string;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
const rawToEntityEntries = [
|
|
4
|
+
["&", "&"],
|
|
5
|
+
["<", "<"],
|
|
6
|
+
[">", ">"],
|
|
7
|
+
['"', """],
|
|
8
|
+
["'", "'"],
|
|
9
|
+
];
|
|
10
|
+
const defaultEntityList = Object.fromEntries([
|
|
11
|
+
...rawToEntityEntries.map(([raw, entity]) => [entity, raw]),
|
|
12
|
+
["'", "'"],
|
|
13
|
+
[" ", "\xa0"],
|
|
14
|
+
]);
|
|
15
|
+
const rawToEntity = new Map(rawToEntityEntries);
|
|
16
|
+
const rawRe = new RegExp(`[${[...rawToEntity.keys()].join("")}]`, "g");
|
|
17
|
+
/**
|
|
18
|
+
* Escapes text for safe interpolation into HTML text content and quoted attributes
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { escape } from "https://deno.land/std@$STD_VERSION/html/entities.ts";
|
|
23
|
+
* import { assertEquals } from "https://deno.land/std@$STD_VERSION/assert/assert_equals.ts";
|
|
24
|
+
*
|
|
25
|
+
* assertEquals(escape("<>'&AA"), "<>'&AA");
|
|
26
|
+
*
|
|
27
|
+
* // characters that don't need to be escaped will be left alone,
|
|
28
|
+
* // even if named HTML entities exist for them
|
|
29
|
+
* assertEquals(escape("þð"), "þð");
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export function escape(str) {
|
|
33
|
+
return str.replaceAll(rawRe, (m) => rawToEntity.get(m));
|
|
34
|
+
}
|
|
35
|
+
const defaultUnescapeOptions = {
|
|
36
|
+
entityList: defaultEntityList,
|
|
37
|
+
};
|
|
38
|
+
const MAX_CODE_POINT = 0x10ffff;
|
|
39
|
+
const RX_DEC_ENTITY = /&#([0-9]+);/g;
|
|
40
|
+
const RX_HEX_ENTITY = /&#x(\p{AHex}+);/gu;
|
|
41
|
+
const entityListRegexCache = new WeakMap();
|
|
42
|
+
/**
|
|
43
|
+
* Unescapes HTML entities in text
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* import { unescape } from "https://deno.land/std@$STD_VERSION/html/entities.ts";
|
|
48
|
+
* import { assertEquals } from "https://deno.land/std@$STD_VERSION/assert/assert_equals.ts";
|
|
49
|
+
*
|
|
50
|
+
* // default options (only handles &<>'" and numeric entities)
|
|
51
|
+
* assertEquals(unescape("<>'&AA"), "<>'&AA");
|
|
52
|
+
* assertEquals(unescape("þð"), "þð");
|
|
53
|
+
*
|
|
54
|
+
* // using the full named entity list from the HTML spec (~47K unminified)
|
|
55
|
+
* import entityList from "https://deno.land/std@$STD_VERSION/html/named_entity_list.json" assert { type: "json" };
|
|
56
|
+
* assertEquals(unescape("þð", { entityList }), "þð");
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export function unescape(str, options = {}) {
|
|
60
|
+
const { entityList } = { ...defaultUnescapeOptions, ...options };
|
|
61
|
+
let entityRe = entityListRegexCache.get(entityList);
|
|
62
|
+
if (!entityRe) {
|
|
63
|
+
entityRe = new RegExp(`(${Object.keys(entityList)
|
|
64
|
+
.sort((a, b) => b.length - a.length)
|
|
65
|
+
.join("|")})`, "g");
|
|
66
|
+
entityListRegexCache.set(entityList, entityRe);
|
|
67
|
+
}
|
|
68
|
+
return str
|
|
69
|
+
.replaceAll(entityRe, (m) => entityList[m])
|
|
70
|
+
.replaceAll(RX_DEC_ENTITY, (_, dec) => codePointStrToChar(dec, 10))
|
|
71
|
+
.replaceAll(RX_HEX_ENTITY, (_, hex) => codePointStrToChar(hex, 16));
|
|
72
|
+
}
|
|
73
|
+
function codePointStrToChar(codePointStr, radix) {
|
|
74
|
+
const codePoint = parseInt(codePointStr, radix);
|
|
75
|
+
return codePoint > MAX_CODE_POINT ? "�" : String.fromCodePoint(codePoint);
|
|
76
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function assertPath(path: string): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// Copyright the Browserify authors. MIT License.
|
|
3
|
+
export function assertPath(path) {
|
|
4
|
+
if (typeof path !== "string") {
|
|
5
|
+
throw new TypeError(`Path must be a string. Received ${JSON.stringify(path)}`);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function stripSuffix(name: string, suffix: string): string;
|
|
2
|
+
export declare function lastPathSegment(path: string, isSep: (char: number) => boolean, start?: number): string;
|
|
3
|
+
export declare function assertArgs(path: string, suffix: string): string | undefined;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { assertPath } from "./assert_path.js";
|
|
4
|
+
export function stripSuffix(name, suffix) {
|
|
5
|
+
if (suffix.length >= name.length) {
|
|
6
|
+
return name;
|
|
7
|
+
}
|
|
8
|
+
const lenDiff = name.length - suffix.length;
|
|
9
|
+
for (let i = suffix.length - 1; i >= 0; --i) {
|
|
10
|
+
if (name.charCodeAt(lenDiff + i) !== suffix.charCodeAt(i)) {
|
|
11
|
+
return name;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return name.slice(0, -suffix.length);
|
|
15
|
+
}
|
|
16
|
+
export function lastPathSegment(path, isSep, start = 0) {
|
|
17
|
+
let matchedNonSeparator = false;
|
|
18
|
+
let end = path.length;
|
|
19
|
+
for (let i = path.length - 1; i >= start; --i) {
|
|
20
|
+
if (isSep(path.charCodeAt(i))) {
|
|
21
|
+
if (matchedNonSeparator) {
|
|
22
|
+
start = i + 1;
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else if (!matchedNonSeparator) {
|
|
27
|
+
matchedNonSeparator = true;
|
|
28
|
+
end = i + 1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return path.slice(start, end);
|
|
32
|
+
}
|
|
33
|
+
export function assertArgs(path, suffix) {
|
|
34
|
+
assertPath(path);
|
|
35
|
+
if (path.length === 0)
|
|
36
|
+
return path;
|
|
37
|
+
if (typeof suffix !== "string") {
|
|
38
|
+
throw new TypeError(`Suffix must be a string. Received ${JSON.stringify(suffix)}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function _common(paths: string[], sep: string): string;
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
2
|
// This module is browser compatible.
|
|
3
|
-
|
|
4
|
-
/** Determines the common path from a set of paths, using an optional separator,
|
|
5
|
-
* which defaults to the OS default separator.
|
|
6
|
-
*
|
|
7
|
-
* ```ts
|
|
8
|
-
* import { common } from "https://deno.land/std@$STD_VERSION/path/mod.ts";
|
|
9
|
-
* const p = common([
|
|
10
|
-
* "./deno/std/path/mod.ts",
|
|
11
|
-
* "./deno/std/fs/mod.ts",
|
|
12
|
-
* ]);
|
|
13
|
-
* console.log(p); // "./deno/std/"
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
export function common(paths, sep = SEP) {
|
|
3
|
+
export function _common(paths, sep) {
|
|
17
4
|
const [first = "", ...remaining] = paths;
|
|
18
5
|
if (first === "" || remaining.length === 0) {
|
|
19
6
|
return first.substring(0, first.lastIndexOf(sep) + 1);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function assertArg(path: string): "." | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
export function _format(sep, pathObject) {
|
|
4
|
+
const dir = pathObject.dir || pathObject.root;
|
|
5
|
+
const base = pathObject.base ||
|
|
6
|
+
(pathObject.name || "") + (pathObject.ext || "");
|
|
7
|
+
if (!dir)
|
|
8
|
+
return base;
|
|
9
|
+
if (base === sep)
|
|
10
|
+
return dir;
|
|
11
|
+
if (dir === pathObject.root)
|
|
12
|
+
return dir + base;
|
|
13
|
+
return dir + sep + base;
|
|
14
|
+
}
|
|
15
|
+
export function assertArg(pathObject) {
|
|
16
|
+
if (pathObject === null || typeof pathObject !== "object") {
|
|
17
|
+
throw new TypeError(`The "pathObject" argument must be of type Object. Received type ${typeof pathObject}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
export function assertArg(url) {
|
|
4
|
+
url = url instanceof URL ? url : new URL(url);
|
|
5
|
+
if (url.protocol !== "file:") {
|
|
6
|
+
throw new TypeError("Must be a file URL.");
|
|
7
|
+
}
|
|
8
|
+
return url;
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface GlobOptions {
|
|
2
|
+
/** Extended glob syntax.
|
|
3
|
+
* See https://www.linuxjournal.com/content/bash-extended-globbing.
|
|
4
|
+
*
|
|
5
|
+
* @default {true}
|
|
6
|
+
*/
|
|
7
|
+
extended?: boolean;
|
|
8
|
+
/** Globstar syntax.
|
|
9
|
+
* See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
|
|
10
|
+
* If false, `**` is treated like `*`.
|
|
11
|
+
*
|
|
12
|
+
* @default {true}
|
|
13
|
+
*/
|
|
14
|
+
globstar?: boolean;
|
|
15
|
+
/** Whether globstar should be case-insensitive. */
|
|
16
|
+
caseInsensitive?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export type GlobToRegExpOptions = GlobOptions;
|
|
19
|
+
export interface GlobConstants {
|
|
20
|
+
sep: string;
|
|
21
|
+
sepMaybe: string;
|
|
22
|
+
seps: string[];
|
|
23
|
+
globstar: string;
|
|
24
|
+
wildcard: string;
|
|
25
|
+
escapePrefix: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function _globToRegExp(c: GlobConstants, glob: string, { extended, globstar: globstarOption, caseInsensitive, }?: GlobToRegExpOptions): RegExp;
|
package/esm/deps/deno.land/{std@0.201.0/path/glob.js → std@0.205.0/path/_common/glob_to_reg_exp.js}
RENAMED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
2
|
// This module is browser compatible.
|
|
3
|
-
import { isWindows, osType } from "./_os.js";
|
|
4
|
-
import { SEP, SEP_PATTERN } from "./separator.js";
|
|
5
|
-
import * as _win32 from "./win32.js";
|
|
6
|
-
import * as _posix from "./posix.js";
|
|
7
|
-
const path = isWindows ? _win32 : _posix;
|
|
8
|
-
const { join, normalize } = path;
|
|
9
3
|
const regExpEscapeChars = [
|
|
10
4
|
"!",
|
|
11
5
|
"$",
|
|
@@ -23,76 +17,15 @@ const regExpEscapeChars = [
|
|
|
23
17
|
"|",
|
|
24
18
|
];
|
|
25
19
|
const rangeEscapeChars = ["-", "\\", "]"];
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
*
|
|
30
|
-
* Basic glob syntax:
|
|
31
|
-
* - `*` - Matches everything without leaving the path segment.
|
|
32
|
-
* - `?` - Matches any single character.
|
|
33
|
-
* - `{foo,bar}` - Matches `foo` or `bar`.
|
|
34
|
-
* - `[abcd]` - Matches `a`, `b`, `c` or `d`.
|
|
35
|
-
* - `[a-d]` - Matches `a`, `b`, `c` or `d`.
|
|
36
|
-
* - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
|
|
37
|
-
* - `[[:<class>:]]` - Matches any character belonging to `<class>`.
|
|
38
|
-
* - `[[:alnum:]]` - Matches any digit or letter.
|
|
39
|
-
* - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
|
|
40
|
-
* - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
|
|
41
|
-
* for a complete list of supported character classes.
|
|
42
|
-
* - `\` - Escapes the next character for an `os` other than `"windows"`.
|
|
43
|
-
* - \` - Escapes the next character for `os` set to `"windows"`.
|
|
44
|
-
* - `/` - Path separator.
|
|
45
|
-
* - `\` - Additional path separator only for `os` set to `"windows"`.
|
|
46
|
-
*
|
|
47
|
-
* Extended syntax:
|
|
48
|
-
* - Requires `{ extended: true }`.
|
|
49
|
-
* - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
|
|
50
|
-
* - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
|
|
51
|
-
* - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
|
|
52
|
-
* - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
|
|
53
|
-
* - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
|
|
54
|
-
* - See https://www.linuxjournal.com/content/bash-extended-globbing.
|
|
55
|
-
*
|
|
56
|
-
* Globstar syntax:
|
|
57
|
-
* - Requires `{ globstar: true }`.
|
|
58
|
-
* - `**` - Matches any number of any path segments.
|
|
59
|
-
* - Must comprise its entire path segment in the provided glob.
|
|
60
|
-
* - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
|
|
61
|
-
*
|
|
62
|
-
* Note the following properties:
|
|
63
|
-
* - The generated `RegExp` is anchored at both start and end.
|
|
64
|
-
* - Repeating and trailing separators are tolerated. Trailing separators in the
|
|
65
|
-
* provided glob have no meaning and are discarded.
|
|
66
|
-
* - Absolute globs will only match absolute paths, etc.
|
|
67
|
-
* - Empty globs will match nothing.
|
|
68
|
-
* - Any special glob syntax must be contained to one path segment. For example,
|
|
69
|
-
* `?(foo|bar/baz)` is invalid. The separator will take precedence and the
|
|
70
|
-
* first segment ends with an unclosed group.
|
|
71
|
-
* - If a path segment ends with unclosed groups or a dangling escape prefix, a
|
|
72
|
-
* parse error has occurred. Every character for that segment is taken
|
|
73
|
-
* literally in this event.
|
|
74
|
-
*
|
|
75
|
-
* Limitations:
|
|
76
|
-
* - A negative group like `!(foo|bar)` will wrongly be converted to a negative
|
|
77
|
-
* look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
|
|
78
|
-
* fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
|
|
79
|
-
* `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
|
|
80
|
-
* the group occurs not nested at the end of the segment. */
|
|
81
|
-
export function globToRegExp(glob, { extended = true, globstar: globstarOption = true, os = osType, caseInsensitive = false, } = {}) {
|
|
20
|
+
export function _globToRegExp(c, glob, { extended = true, globstar: globstarOption = true,
|
|
21
|
+
// os = osType,
|
|
22
|
+
caseInsensitive = false, } = {}) {
|
|
82
23
|
if (glob === "") {
|
|
83
24
|
return /(?!)/;
|
|
84
25
|
}
|
|
85
|
-
const sep = os === "windows" ? "(?:\\\\|/)+" : "/+";
|
|
86
|
-
const sepMaybe = os === "windows" ? "(?:\\\\|/)*" : "/*";
|
|
87
|
-
const seps = os === "windows" ? ["\\", "/"] : ["/"];
|
|
88
|
-
const globstar = os === "windows"
|
|
89
|
-
? "(?:[^\\\\/]*(?:\\\\|/|$)+)*"
|
|
90
|
-
: "(?:[^/]*(?:/|$)+)*";
|
|
91
|
-
const wildcard = os === "windows" ? "[^\\\\/]*" : "[^/]*";
|
|
92
|
-
const escapePrefix = os === "windows" ? "`" : "\\";
|
|
93
26
|
// Remove trailing separators.
|
|
94
27
|
let newLength = glob.length;
|
|
95
|
-
for (; newLength > 1 && seps.includes(glob[newLength - 1]); newLength--)
|
|
28
|
+
for (; newLength > 1 && c.seps.includes(glob[newLength - 1]); newLength--)
|
|
96
29
|
;
|
|
97
30
|
glob = glob.slice(0, newLength);
|
|
98
31
|
let regExpString = "";
|
|
@@ -105,14 +38,14 @@ export function globToRegExp(glob, { extended = true, globstar: globstarOption =
|
|
|
105
38
|
let endsWithSep = false;
|
|
106
39
|
let i = j;
|
|
107
40
|
// Terminates with `i` at the non-inclusive end of the current segment.
|
|
108
|
-
for (; i < glob.length && !seps.includes(glob[i]); i++) {
|
|
41
|
+
for (; i < glob.length && !c.seps.includes(glob[i]); i++) {
|
|
109
42
|
if (inEscape) {
|
|
110
43
|
inEscape = false;
|
|
111
44
|
const escapeChars = inRange ? rangeEscapeChars : regExpEscapeChars;
|
|
112
45
|
segment += escapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
|
|
113
46
|
continue;
|
|
114
47
|
}
|
|
115
|
-
if (glob[i] === escapePrefix) {
|
|
48
|
+
if (glob[i] === c.escapePrefix) {
|
|
116
49
|
inEscape = true;
|
|
117
50
|
continue;
|
|
118
51
|
}
|
|
@@ -191,7 +124,7 @@ export function globToRegExp(glob, { extended = true, globstar: globstarOption =
|
|
|
191
124
|
segment += ")";
|
|
192
125
|
const type = groupStack.pop();
|
|
193
126
|
if (type === "!") {
|
|
194
|
-
segment += wildcard;
|
|
127
|
+
segment += c.wildcard;
|
|
195
128
|
}
|
|
196
129
|
else if (type !== "@") {
|
|
197
130
|
segment += type;
|
|
@@ -261,13 +194,13 @@ export function globToRegExp(glob, { extended = true, globstar: globstarOption =
|
|
|
261
194
|
}
|
|
262
195
|
const nextChar = glob[i + 1];
|
|
263
196
|
if (globstarOption && numStars === 2 &&
|
|
264
|
-
[...seps, undefined].includes(prevChar) &&
|
|
265
|
-
[...seps, undefined].includes(nextChar)) {
|
|
266
|
-
segment += globstar;
|
|
197
|
+
[...c.seps, undefined].includes(prevChar) &&
|
|
198
|
+
[...c.seps, undefined].includes(nextChar)) {
|
|
199
|
+
segment += c.globstar;
|
|
267
200
|
endsWithSep = true;
|
|
268
201
|
}
|
|
269
202
|
else {
|
|
270
|
-
segment += wildcard;
|
|
203
|
+
segment += c.wildcard;
|
|
271
204
|
}
|
|
272
205
|
}
|
|
273
206
|
continue;
|
|
@@ -285,11 +218,11 @@ export function globToRegExp(glob, { extended = true, globstar: globstarOption =
|
|
|
285
218
|
}
|
|
286
219
|
regExpString += segment;
|
|
287
220
|
if (!endsWithSep) {
|
|
288
|
-
regExpString += i < glob.length ? sep : sepMaybe;
|
|
221
|
+
regExpString += i < glob.length ? c.sep : c.sepMaybe;
|
|
289
222
|
endsWithSep = true;
|
|
290
223
|
}
|
|
291
224
|
// Terminates with `i` at the start of the next segment.
|
|
292
|
-
while (seps.includes(glob[i]))
|
|
225
|
+
while (c.seps.includes(glob[i]))
|
|
293
226
|
i++;
|
|
294
227
|
// Check that the next value of `j` is indeed higher than the current value.
|
|
295
228
|
if (!(i > j)) {
|
|
@@ -300,62 +233,3 @@ export function globToRegExp(glob, { extended = true, globstar: globstarOption =
|
|
|
300
233
|
regExpString = `^${regExpString}$`;
|
|
301
234
|
return new RegExp(regExpString, caseInsensitive ? "i" : "");
|
|
302
235
|
}
|
|
303
|
-
/** Test whether the given string is a glob */
|
|
304
|
-
export function isGlob(str) {
|
|
305
|
-
const chars = { "{": "}", "(": ")", "[": "]" };
|
|
306
|
-
const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
|
|
307
|
-
if (str === "") {
|
|
308
|
-
return false;
|
|
309
|
-
}
|
|
310
|
-
let match;
|
|
311
|
-
while ((match = regex.exec(str))) {
|
|
312
|
-
if (match[2])
|
|
313
|
-
return true;
|
|
314
|
-
let idx = match.index + match[0].length;
|
|
315
|
-
// if an open bracket/brace/paren is escaped,
|
|
316
|
-
// set the index to the next closing character
|
|
317
|
-
const open = match[1];
|
|
318
|
-
const close = open ? chars[open] : null;
|
|
319
|
-
if (open && close) {
|
|
320
|
-
const n = str.indexOf(close, idx);
|
|
321
|
-
if (n !== -1) {
|
|
322
|
-
idx = n + 1;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
str = str.slice(idx);
|
|
326
|
-
}
|
|
327
|
-
return false;
|
|
328
|
-
}
|
|
329
|
-
/** Like normalize(), but doesn't collapse "**\/.." when `globstar` is true. */
|
|
330
|
-
export function normalizeGlob(glob, { globstar = false } = {}) {
|
|
331
|
-
if (glob.match(/\0/g)) {
|
|
332
|
-
throw new Error(`Glob contains invalid characters: "${glob}"`);
|
|
333
|
-
}
|
|
334
|
-
if (!globstar) {
|
|
335
|
-
return normalize(glob);
|
|
336
|
-
}
|
|
337
|
-
const s = SEP_PATTERN.source;
|
|
338
|
-
const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g");
|
|
339
|
-
return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
|
|
340
|
-
}
|
|
341
|
-
/** Like join(), but doesn't collapse "**\/.." when `globstar` is true. */
|
|
342
|
-
export function joinGlobs(globs, { extended = true, globstar = false } = {}) {
|
|
343
|
-
if (!globstar || globs.length === 0) {
|
|
344
|
-
return join(...globs);
|
|
345
|
-
}
|
|
346
|
-
if (globs.length === 0)
|
|
347
|
-
return ".";
|
|
348
|
-
let joined;
|
|
349
|
-
for (const glob of globs) {
|
|
350
|
-
const path = glob;
|
|
351
|
-
if (path.length > 0) {
|
|
352
|
-
if (!joined)
|
|
353
|
-
joined = path;
|
|
354
|
-
else
|
|
355
|
-
joined += `${SEP}${path}`;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
if (!joined)
|
|
359
|
-
return ".";
|
|
360
|
-
return normalizeGlob(joined, { extended, globstar });
|
|
361
|
-
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
/** Test whether the given string is a glob */
|
|
4
|
+
export function isGlob(str) {
|
|
5
|
+
const chars = { "{": "}", "(": ")", "[": "]" };
|
|
6
|
+
const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
|
|
7
|
+
if (str === "") {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
let match;
|
|
11
|
+
while ((match = regex.exec(str))) {
|
|
12
|
+
if (match[2])
|
|
13
|
+
return true;
|
|
14
|
+
let idx = match.index + match[0].length;
|
|
15
|
+
// if an open bracket/brace/paren is escaped,
|
|
16
|
+
// set the index to the next closing character
|
|
17
|
+
const open = match[1];
|
|
18
|
+
const close = open ? chars[open] : null;
|
|
19
|
+
if (open && close) {
|
|
20
|
+
const n = str.indexOf(close, idx);
|
|
21
|
+
if (n !== -1) {
|
|
22
|
+
idx = n + 1;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
str = str.slice(idx);
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function assertArg(path: string): "." | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalizeString(path: string, allowAboveRoot: boolean, separator: string, isPathSeparator: (code: number) => boolean): string;
|