ventojs 0.9.2 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/deps/deno.land/std@0.210.0/assert/assert.d.ts +12 -0
- package/esm/deps/deno.land/std@0.210.0/assert/assert.js +18 -0
- package/esm/deps/deno.land/std@0.210.0/assert/assertion_error.d.ts +14 -0
- package/esm/deps/deno.land/std@0.210.0/assert/assertion_error.js +18 -0
- package/{script/deps/deno.land/std@0.208.0 → esm/deps/deno.land/std@0.210.0}/path/_common/glob_to_reg_exp.d.ts +1 -0
- package/esm/deps/deno.land/std@0.210.0/path/common.d.ts +13 -0
- package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/extname.js +1 -1
- package/{script/deps/deno.land/std@0.208.0 → esm/deps/deno.land/std@0.210.0}/path/mod.d.ts +2 -2
- package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/mod.js +3 -1
- package/{script/deps/deno.land/std@0.208.0 → esm/deps/deno.land/std@0.210.0}/path/posix/to_file_url.d.ts +1 -1
- package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/separator.d.ts +1 -1
- package/esm/deps.d.ts +2 -2
- package/esm/deps.js +2 -2
- package/esm/mod.js +2 -0
- package/esm/plugins/auto_trim.d.ts +8 -0
- package/esm/plugins/auto_trim.js +36 -0
- package/esm/plugins/escape.js +2 -1
- package/esm/plugins/for.js +27 -1
- package/esm/plugins/js.js +1 -1
- package/esm/plugins/trim.d.ts +4 -0
- package/esm/plugins/trim.js +28 -0
- package/esm/plugins/unescape.js +2 -1
- package/esm/src/environment.d.ts +8 -1
- package/esm/src/environment.js +27 -6
- package/esm/src/tokenizer.js +65 -40
- package/package.json +5 -1
- package/script/deps/deno.land/std@0.210.0/assert/assert.d.ts +12 -0
- package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/assert/assert.js +11 -1
- package/script/deps/deno.land/std@0.210.0/assert/assertion_error.d.ts +14 -0
- package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/assert/assertion_error.js +13 -2
- package/{esm/deps/deno.land/std@0.208.0 → script/deps/deno.land/std@0.210.0}/path/_common/glob_to_reg_exp.d.ts +1 -0
- package/script/deps/deno.land/std@0.210.0/path/common.d.ts +13 -0
- package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/extname.js +1 -1
- package/{esm/deps/deno.land/std@0.208.0 → script/deps/deno.land/std@0.210.0}/path/mod.d.ts +2 -2
- package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/mod.js +3 -1
- package/{esm/deps/deno.land/std@0.208.0 → script/deps/deno.land/std@0.210.0}/path/posix/to_file_url.d.ts +1 -1
- package/script/deps/deno.land/std@0.210.0/path/separator.d.ts +2 -0
- package/script/deps.d.ts +2 -2
- package/script/deps.js +2 -2
- package/script/mod.js +2 -0
- package/script/plugins/auto_trim.d.ts +8 -0
- package/script/plugins/auto_trim.js +41 -0
- package/script/plugins/escape.js +2 -1
- package/script/plugins/for.js +27 -1
- package/script/plugins/js.js +1 -1
- package/script/plugins/trim.d.ts +4 -0
- package/script/plugins/trim.js +33 -0
- package/script/plugins/unescape.js +2 -1
- package/script/src/environment.d.ts +8 -1
- package/script/src/environment.js +27 -6
- package/script/src/tokenizer.js +65 -40
- package/esm/deps/deno.land/std@0.208.0/assert/assert.d.ts +0 -2
- package/esm/deps/deno.land/std@0.208.0/assert/assert.js +0 -8
- package/esm/deps/deno.land/std@0.208.0/assert/assertion_error.d.ts +0 -4
- package/esm/deps/deno.land/std@0.208.0/assert/assertion_error.js +0 -7
- package/script/deps/deno.land/std@0.208.0/assert/assert.d.ts +0 -2
- package/script/deps/deno.land/std@0.208.0/assert/assertion_error.d.ts +0 -4
- package/script/deps/deno.land/std@0.208.0/path/posix/common.d.ts +0 -13
- package/script/deps/deno.land/std@0.208.0/path/separator.d.ts +0 -2
- package/script/deps/deno.land/std@0.208.0/path/windows/common.d.ts +0 -13
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/html/entities.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/html/entities.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/html/mod.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/html/mod.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/assert_path.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/assert_path.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/basename.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/basename.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/common.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/common.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/constants.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/constants.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/dirname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/dirname.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/format.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/from_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/from_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/glob_to_reg_exp.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/normalize.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/normalize.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/normalize_string.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/normalize_string.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/relative.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/relative.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/strip_trailing_separators.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/strip_trailing_separators.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/to_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/to_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_interface.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_interface.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_os.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_os.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/basename.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/basename.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/common.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/dirname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/dirname.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/extname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/format.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/from_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/from_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/glob_to_regexp.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/glob_to_regexp.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/is_absolute.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/is_absolute.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/is_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/is_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/join.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/join.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/join_globs.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/join_globs.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/normalize.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/normalize.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/normalize_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/normalize_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/parse.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/parse.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/_util.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/_util.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/basename.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/basename.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0/path → std@0.210.0/path/posix}/common.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/common.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/dirname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/dirname.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/extname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/extname.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/format.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/from_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/from_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/glob_to_regexp.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/glob_to_regexp.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/is_absolute.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/is_absolute.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/is_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/is_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/join.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/join.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/join_globs.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/join_globs.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/mod.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/mod.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/normalize.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/normalize.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/normalize_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/normalize_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/parse.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/parse.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/relative.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/relative.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/resolve.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/resolve.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/separator.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/separator.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/to_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/to_namespaced_path.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/to_namespaced_path.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/relative.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/relative.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/resolve.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/resolve.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/separator.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/to_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/to_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/to_namespaced_path.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/to_namespaced_path.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/_util.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/_util.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/basename.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/basename.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0/path/posix → std@0.210.0/path/windows}/common.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/common.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/dirname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/dirname.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/extname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/extname.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/format.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/from_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/from_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/glob_to_regexp.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/glob_to_regexp.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/is_absolute.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/is_absolute.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/is_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/is_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/join.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/join.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/join_globs.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/join_globs.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/mod.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/mod.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/normalize.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/normalize.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/normalize_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/normalize_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/parse.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/parse.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/relative.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/relative.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/resolve.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/resolve.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/separator.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/separator.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/to_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/to_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/to_namespaced_path.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/to_namespaced_path.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/html/entities.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/html/entities.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/html/mod.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/html/mod.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/assert_path.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/assert_path.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/basename.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/basename.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/common.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/common.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/constants.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/constants.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/dirname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/dirname.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/format.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/format.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/from_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/from_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/glob_to_reg_exp.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/normalize.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/normalize.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/normalize_string.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/normalize_string.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/relative.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/relative.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/strip_trailing_separators.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/strip_trailing_separators.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/to_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_common/to_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_interface.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_interface.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_os.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/_os.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/basename.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/basename.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/common.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/dirname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/dirname.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/extname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/format.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/format.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/from_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/from_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/glob_to_regexp.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/glob_to_regexp.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/is_absolute.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/is_absolute.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/is_glob.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/is_glob.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/join.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/join.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/join_globs.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/join_globs.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/normalize.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/normalize.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/normalize_glob.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/normalize_glob.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/parse.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/parse.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/_util.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/_util.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/basename.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/basename.js +0 -0
- /package/{esm/deps/deno.land/std@0.208.0/path/windows → script/deps/deno.land/std@0.210.0/path/posix}/common.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/common.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/dirname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/dirname.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/extname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/extname.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/format.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/format.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/from_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/from_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/glob_to_regexp.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/glob_to_regexp.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/is_absolute.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/is_absolute.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/is_glob.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/is_glob.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/join.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/join.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/join_globs.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/join_globs.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/mod.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/mod.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/normalize.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/normalize.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/normalize_glob.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/normalize_glob.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/parse.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/parse.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/relative.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/relative.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/resolve.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/resolve.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/separator.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/separator.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/to_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/to_namespaced_path.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/posix/to_namespaced_path.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/relative.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/relative.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/resolve.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/resolve.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/separator.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/to_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/to_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/to_namespaced_path.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/to_namespaced_path.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/_util.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/_util.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/basename.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/basename.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0/path → std@0.210.0/path/windows}/common.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/common.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/dirname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/dirname.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/extname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/extname.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/format.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/format.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/from_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/from_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/glob_to_regexp.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/glob_to_regexp.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/is_absolute.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/is_absolute.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/is_glob.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/is_glob.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/join.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/join.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/join_globs.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/join_globs.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/mod.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/mod.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/normalize.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/normalize.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/normalize_glob.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/normalize_glob.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/parse.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/parse.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/relative.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/relative.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/resolve.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/resolve.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/separator.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/separator.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/to_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/to_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/to_namespaced_path.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.208.0 → std@0.210.0}/path/windows/to_namespaced_path.js +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Make an assertion, error will be thrown if `expr` does not have truthy value.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { assert } from "https://deno.land/std@$STD_VERSION/assert/assert.ts";
|
|
7
|
+
*
|
|
8
|
+
* assert("hello".includes("ello")); // Doesn't throw
|
|
9
|
+
* assert("hello".includes("world")); // Throws
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export declare function assert(expr: unknown, msg?: string): asserts expr;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
import { AssertionError } from "./assertion_error.js";
|
|
3
|
+
/**
|
|
4
|
+
* Make an assertion, error will be thrown if `expr` does not have truthy value.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { assert } from "https://deno.land/std@$STD_VERSION/assert/assert.ts";
|
|
9
|
+
*
|
|
10
|
+
* assert("hello".includes("ello")); // Doesn't throw
|
|
11
|
+
* assert("hello".includes("world")); // Throws
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export function assert(expr, msg = "") {
|
|
15
|
+
if (!expr) {
|
|
16
|
+
throw new AssertionError(msg);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown when an assertion fails.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { AssertionError } from "https://deno.land/std@$STD_VERSION/assert/assertion_error.ts";
|
|
7
|
+
*
|
|
8
|
+
* throw new AssertionError("Assertion failed");
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare class AssertionError extends Error {
|
|
12
|
+
/** Constructs a new instance. */
|
|
13
|
+
constructor(message: string);
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
/**
|
|
3
|
+
* Error thrown when an assertion fails.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { AssertionError } from "https://deno.land/std@$STD_VERSION/assert/assertion_error.ts";
|
|
8
|
+
*
|
|
9
|
+
* throw new AssertionError("Assertion failed");
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export class AssertionError extends Error {
|
|
13
|
+
/** Constructs a new instance. */
|
|
14
|
+
constructor(message) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.name = "AssertionError";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Determines the common path from a set of paths, using an optional separator,
|
|
2
|
+
* which defaults to the OS default separator.
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { common } from "https://deno.land/std@$STD_VERSION/path/mod.ts";
|
|
6
|
+
* const p = common([
|
|
7
|
+
* "./deno/std/path/mod.ts",
|
|
8
|
+
* "./deno/std/fs/mod.ts",
|
|
9
|
+
* ]);
|
|
10
|
+
* console.log(p); // "./deno/std/"
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare function common(paths: string[], sep?: "/" | "\\"): string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// This module is browser compatible.
|
|
3
3
|
import { isWindows } from "./_os.js";
|
|
4
4
|
import { extname as posixExtname } from "./posix/extname.js";
|
|
5
|
-
import { extname as windowsExtname } from "./
|
|
5
|
+
import { extname as windowsExtname } from "./windows/extname.js";
|
|
6
6
|
/**
|
|
7
7
|
* Return the extension of the `path` with leading period.
|
|
8
8
|
* @param path with extension
|
|
@@ -4,8 +4,8 @@ import * as _posix from "./posix/mod.js";
|
|
|
4
4
|
export declare const win32: typeof _windows;
|
|
5
5
|
/** @deprecated (will be removed after 1.0.0) Import from {@link https://deno.land/std/posix/mod.ts} instead. */
|
|
6
6
|
export declare const posix: typeof _posix;
|
|
7
|
-
export declare const sep:
|
|
8
|
-
export declare const delimiter:
|
|
7
|
+
export declare const sep: "/" | "\\";
|
|
8
|
+
export declare const delimiter: ":" | ";";
|
|
9
9
|
export * from "./basename.js";
|
|
10
10
|
export * from "./dirname.js";
|
|
11
11
|
export * from "./extname.js";
|
|
@@ -40,7 +40,9 @@ export const win32 = _windows;
|
|
|
40
40
|
/** @deprecated (will be removed after 1.0.0) Import from {@link https://deno.land/std/posix/mod.ts} instead. */
|
|
41
41
|
export const posix = _posix;
|
|
42
42
|
export const sep = isWindows ? _windows.sep : _posix.sep;
|
|
43
|
-
export const delimiter = isWindows
|
|
43
|
+
export const delimiter = isWindows
|
|
44
|
+
? _windows.delimiter
|
|
45
|
+
: _posix.delimiter;
|
|
44
46
|
export * from "./basename.js";
|
|
45
47
|
export * from "./dirname.js";
|
|
46
48
|
export * from "./extname.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SEP:
|
|
1
|
+
export declare const SEP: "/" | "\\";
|
|
2
2
|
export declare const SEP_PATTERN: RegExp;
|
package/esm/deps.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * as path from "./deps/deno.land/std@0.
|
|
2
|
-
export * as html from "./deps/deno.land/std@0.
|
|
1
|
+
export * as path from "./deps/deno.land/std@0.210.0/path/mod.js";
|
|
2
|
+
export * as html from "./deps/deno.land/std@0.210.0/html/mod.js";
|
package/esm/deps.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * as path from "./deps/deno.land/std@0.
|
|
2
|
-
export * as html from "./deps/deno.land/std@0.
|
|
1
|
+
export * as path from "./deps/deno.land/std@0.210.0/path/mod.js";
|
|
2
|
+
export * as html from "./deps/deno.land/std@0.210.0/html/mod.js";
|
package/esm/mod.js
CHANGED
|
@@ -13,6 +13,7 @@ import exportTag from "./plugins/export.js";
|
|
|
13
13
|
import echoTag from "./plugins/echo.js";
|
|
14
14
|
import escape from "./plugins/escape.js";
|
|
15
15
|
import unescape from "./plugins/unescape.js";
|
|
16
|
+
import trim from "./plugins/trim.js";
|
|
16
17
|
export default function (options = {}) {
|
|
17
18
|
const loader = typeof options.includes === "object"
|
|
18
19
|
? options.includes
|
|
@@ -36,5 +37,6 @@ export default function (options = {}) {
|
|
|
36
37
|
env.use(echoTag());
|
|
37
38
|
env.use(escape());
|
|
38
39
|
env.use(unescape());
|
|
40
|
+
env.use(trim());
|
|
39
41
|
return env;
|
|
40
42
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Token } from "../src/tokenizer.js";
|
|
2
|
+
import type { Environment } from "../src/environment.js";
|
|
3
|
+
export declare const defaultTags: string[];
|
|
4
|
+
export type AutoTrimOptions = {
|
|
5
|
+
tags: string[];
|
|
6
|
+
};
|
|
7
|
+
export default function (options?: AutoTrimOptions): (env: Environment) => void;
|
|
8
|
+
export declare function autoTrim(tokens: Token[], options: AutoTrimOptions): void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const defaultTags = [
|
|
2
|
+
">",
|
|
3
|
+
"#",
|
|
4
|
+
"set",
|
|
5
|
+
"/set",
|
|
6
|
+
"if",
|
|
7
|
+
"/if",
|
|
8
|
+
"else",
|
|
9
|
+
"for",
|
|
10
|
+
"/for",
|
|
11
|
+
"function",
|
|
12
|
+
"async",
|
|
13
|
+
"/function",
|
|
14
|
+
"export",
|
|
15
|
+
"/export",
|
|
16
|
+
"import",
|
|
17
|
+
];
|
|
18
|
+
export default function (options = { tags: defaultTags }) {
|
|
19
|
+
return (env) => {
|
|
20
|
+
env.tokenPreprocessors.push((_, tokens) => autoTrim(tokens, options));
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function autoTrim(tokens, options) {
|
|
24
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
25
|
+
const previous = tokens[i - 1];
|
|
26
|
+
const token = tokens[i];
|
|
27
|
+
const next = tokens[i + 1];
|
|
28
|
+
const [type, code] = token;
|
|
29
|
+
if (type === "tag" && options.tags.find((tag) => code.startsWith(tag))) {
|
|
30
|
+
// Remove leading horizontal space
|
|
31
|
+
previous[1] = previous[1].replace(/[ \t]*$/, "");
|
|
32
|
+
// Remove trailing horizontal space + newline
|
|
33
|
+
next[1] = next[1].replace(/^[ \t]*(?:\r\n|\n)/, "");
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
package/esm/plugins/escape.js
CHANGED
package/esm/plugins/for.js
CHANGED
|
@@ -25,7 +25,9 @@ function forTag(env, code, output, tokens) {
|
|
|
25
25
|
compiled.push("}");
|
|
26
26
|
return compiled.join("\n");
|
|
27
27
|
}
|
|
28
|
-
function toIterator(
|
|
28
|
+
function toIterator(
|
|
29
|
+
// deno-lint-ignore no-explicit-any
|
|
30
|
+
item, withKeys = false) {
|
|
29
31
|
if (item === undefined || item === null) {
|
|
30
32
|
return [];
|
|
31
33
|
}
|
|
@@ -36,6 +38,18 @@ function toIterator(item, withKeys = false) {
|
|
|
36
38
|
return toIterator(item(), withKeys);
|
|
37
39
|
}
|
|
38
40
|
if (typeof item === "object" && item !== null) {
|
|
41
|
+
if (typeof item[Symbol.iterator] === "function") {
|
|
42
|
+
if (withKeys) {
|
|
43
|
+
return iterableToEntries(item);
|
|
44
|
+
}
|
|
45
|
+
return item;
|
|
46
|
+
}
|
|
47
|
+
if (typeof item[Symbol.asyncIterator] === "function") {
|
|
48
|
+
if (withKeys) {
|
|
49
|
+
return asyncIterableToEntries(item);
|
|
50
|
+
}
|
|
51
|
+
return item;
|
|
52
|
+
}
|
|
39
53
|
return withKeys ? Object.entries(item) : Object.values(item);
|
|
40
54
|
}
|
|
41
55
|
if (typeof item === "string") {
|
|
@@ -46,3 +60,15 @@ function toIterator(item, withKeys = false) {
|
|
|
46
60
|
}
|
|
47
61
|
return toIterator([item], withKeys);
|
|
48
62
|
}
|
|
63
|
+
function* iterableToEntries(iterator) {
|
|
64
|
+
let i = 0;
|
|
65
|
+
for (const value of iterator) {
|
|
66
|
+
yield [i++, value];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async function* asyncIterableToEntries(iterator) {
|
|
70
|
+
let i = 0;
|
|
71
|
+
for await (const value of iterator) {
|
|
72
|
+
yield [i++, value];
|
|
73
|
+
}
|
|
74
|
+
}
|
package/esm/plugins/js.js
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export default function () {
|
|
2
|
+
return (env) => {
|
|
3
|
+
env.tokenPreprocessors.push(trim);
|
|
4
|
+
};
|
|
5
|
+
}
|
|
6
|
+
export function trim(_, tokens) {
|
|
7
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
8
|
+
const previous = tokens[i - 1];
|
|
9
|
+
const token = tokens[i];
|
|
10
|
+
const next = tokens[i + 1];
|
|
11
|
+
let [type, code] = token;
|
|
12
|
+
if (type === "tag" && code.startsWith("-")) {
|
|
13
|
+
previous[1] = previous[1].trimEnd();
|
|
14
|
+
code = code.slice(1);
|
|
15
|
+
}
|
|
16
|
+
if (type === "tag" && code.endsWith("-")) {
|
|
17
|
+
next[1] = next[1].trimStart();
|
|
18
|
+
code = code.slice(0, -1);
|
|
19
|
+
}
|
|
20
|
+
// Trim tag and filter code
|
|
21
|
+
switch (type) {
|
|
22
|
+
case "tag":
|
|
23
|
+
case "filter":
|
|
24
|
+
token[1] = code.trim();
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
package/esm/plugins/unescape.js
CHANGED
package/esm/src/environment.d.ts
CHANGED
|
@@ -16,8 +16,13 @@ export interface TemplateSync {
|
|
|
16
16
|
code: string;
|
|
17
17
|
file?: string;
|
|
18
18
|
}
|
|
19
|
+
export type TokenPreprocessor = (env: Environment, tokens: Token[], path?: string) => Token[] | void;
|
|
19
20
|
export type Tag = (env: Environment, code: string, output: string, tokens: Token[]) => string | undefined;
|
|
20
|
-
export type
|
|
21
|
+
export type FilterThis = {
|
|
22
|
+
data: Record<string, unknown>;
|
|
23
|
+
env: Environment;
|
|
24
|
+
};
|
|
25
|
+
export type Filter = (this: FilterThis, ...args: any[]) => any;
|
|
21
26
|
export type Plugin = (env: Environment) => void;
|
|
22
27
|
export interface Options {
|
|
23
28
|
loader: Loader;
|
|
@@ -29,6 +34,7 @@ export declare class Environment {
|
|
|
29
34
|
cache: Map<string, Template>;
|
|
30
35
|
options: Options;
|
|
31
36
|
tags: Tag[];
|
|
37
|
+
tokenPreprocessors: TokenPreprocessor[];
|
|
32
38
|
filters: Record<string, Filter>;
|
|
33
39
|
utils: Record<string, unknown>;
|
|
34
40
|
constructor(options: Options);
|
|
@@ -38,6 +44,7 @@ export declare class Environment {
|
|
|
38
44
|
runStringSync(source: string, data?: Record<string, unknown>): TemplateResult;
|
|
39
45
|
compile(source: string, path?: string, defaults?: Record<string, unknown>, sync?: false): Template;
|
|
40
46
|
compile(source: string, path?: string, defaults?: Record<string, unknown>, sync?: true): TemplateSync;
|
|
47
|
+
tokenize(source: string, path?: string): Token[];
|
|
41
48
|
load(file: string, from?: string): Promise<Template>;
|
|
42
49
|
compileTokens(tokens: Token[], outputVar?: string, stopAt?: string[]): string[];
|
|
43
50
|
compileFilters(tokens: Token[], output: string, autoescape?: boolean): string;
|
package/esm/src/environment.js
CHANGED
|
@@ -4,6 +4,7 @@ export class Environment {
|
|
|
4
4
|
cache = new Map();
|
|
5
5
|
options;
|
|
6
6
|
tags = [];
|
|
7
|
+
tokenPreprocessors = [];
|
|
7
8
|
filters = {};
|
|
8
9
|
utils = {};
|
|
9
10
|
constructor(options) {
|
|
@@ -34,10 +35,7 @@ export class Environment {
|
|
|
34
35
|
return template(data);
|
|
35
36
|
}
|
|
36
37
|
compile(source, path, defaults, sync = false) {
|
|
37
|
-
const
|
|
38
|
-
if (error) {
|
|
39
|
-
throw this.createError(path || "unknown", source, position, error);
|
|
40
|
-
}
|
|
38
|
+
const tokens = this.tokenize(source, path);
|
|
41
39
|
const code = this.compileTokens(tokens).join("\n");
|
|
42
40
|
const { dataVarname, useWith } = this.options;
|
|
43
41
|
const constructor = new Function("__file", "__env", "__defaults", `return${sync ? "" : " async"} function (${dataVarname}) {
|
|
@@ -59,10 +57,29 @@ export class Environment {
|
|
|
59
57
|
template.source = source;
|
|
60
58
|
return template;
|
|
61
59
|
}
|
|
60
|
+
tokenize(source, path) {
|
|
61
|
+
const result = tokenize(source);
|
|
62
|
+
let { tokens } = result;
|
|
63
|
+
const { position, error } = result;
|
|
64
|
+
if (error) {
|
|
65
|
+
throw this.createError(path || "unknown", source, position, error);
|
|
66
|
+
}
|
|
67
|
+
for (const tokenPreprocessor of this.tokenPreprocessors) {
|
|
68
|
+
const result = tokenPreprocessor(this, tokens, path);
|
|
69
|
+
if (result !== undefined) {
|
|
70
|
+
tokens = result;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return tokens;
|
|
74
|
+
}
|
|
62
75
|
async load(file, from) {
|
|
63
76
|
const path = from ? this.options.loader.resolve(from, file) : file;
|
|
64
77
|
if (!this.cache.has(path)) {
|
|
65
|
-
|
|
78
|
+
// Remove query and hash params from path before loading
|
|
79
|
+
const cleanPath = path
|
|
80
|
+
.split("?")[0]
|
|
81
|
+
.split("#")[0];
|
|
82
|
+
const { source, data } = await this.options.loader.load(cleanPath);
|
|
66
83
|
const template = this.compile(source, path, data);
|
|
67
84
|
this.cache.set(path, template);
|
|
68
85
|
}
|
|
@@ -124,7 +141,8 @@ export class Environment {
|
|
|
124
141
|
}
|
|
125
142
|
else {
|
|
126
143
|
// It's a filter (e.g. filters.upper())
|
|
127
|
-
|
|
144
|
+
const { dataVarname } = this.options;
|
|
145
|
+
output = `${(isAsync || checkAsync(this.filters[name])) ? "await " : ""}__env.filters.${name}.call({data:${dataVarname},env:__env}, ${output}${args ? `, ${args}` : ""})`;
|
|
128
146
|
}
|
|
129
147
|
}
|
|
130
148
|
// Escape by default
|
|
@@ -171,3 +189,6 @@ export function errorLine(source, pos) {
|
|
|
171
189
|
}
|
|
172
190
|
return [line, column, source.split("\n")[line - 1]];
|
|
173
191
|
}
|
|
192
|
+
function checkAsync(fn) {
|
|
193
|
+
return fn.constructor?.name === "AsyncFunction";
|
|
194
|
+
}
|
package/esm/src/tokenizer.js
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
export default function tokenize(source) {
|
|
2
2
|
const tokens = [];
|
|
3
3
|
let type = "string";
|
|
4
|
-
let trimNext = false;
|
|
5
4
|
let position = 0;
|
|
6
5
|
try {
|
|
7
6
|
while (source.length > 0) {
|
|
8
7
|
if (type === "string") {
|
|
9
8
|
const index = source.indexOf("{{");
|
|
10
9
|
const code = index === -1 ? source : source.slice(0, index);
|
|
11
|
-
|
|
12
|
-
tokens.push([type, code.trimStart(), position]);
|
|
13
|
-
trimNext = false;
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
tokens.push([type, code, position]);
|
|
17
|
-
}
|
|
10
|
+
tokens.push([type, code, position]);
|
|
18
11
|
if (index === -1) {
|
|
19
12
|
break;
|
|
20
13
|
}
|
|
@@ -41,39 +34,23 @@ export default function tokenize(source) {
|
|
|
41
34
|
const lastIndex = indexes.length - 1;
|
|
42
35
|
let tag;
|
|
43
36
|
indexes.reduce((prev, curr, index) => {
|
|
44
|
-
|
|
37
|
+
const code = source.slice(prev, curr - 2);
|
|
45
38
|
// Tag
|
|
46
39
|
if (index === 1) {
|
|
47
|
-
|
|
48
|
-
if (code.startsWith("-")) {
|
|
49
|
-
code = code.slice(1);
|
|
50
|
-
const lastToken = tokens[tokens.length - 1];
|
|
51
|
-
lastToken[1] = lastToken[1].trimEnd();
|
|
52
|
-
}
|
|
53
|
-
// Right trim
|
|
54
|
-
if (code.endsWith("-") && index === lastIndex) {
|
|
55
|
-
code = code.slice(0, -1);
|
|
56
|
-
trimNext = true;
|
|
57
|
-
}
|
|
58
|
-
tag = [type, code.trim(), position];
|
|
40
|
+
tag = [type, code, position];
|
|
59
41
|
tokens.push(tag);
|
|
60
42
|
return curr;
|
|
61
43
|
}
|
|
62
|
-
// Right trim
|
|
63
|
-
if (index === lastIndex && code.endsWith("-")) {
|
|
64
|
-
code = code.slice(0, -1);
|
|
65
|
-
trimNext = true;
|
|
66
|
-
}
|
|
67
44
|
// Filters
|
|
68
|
-
tokens.push(["filter", code
|
|
45
|
+
tokens.push(["filter", code]);
|
|
69
46
|
return curr;
|
|
70
47
|
});
|
|
71
48
|
position += indexes[lastIndex];
|
|
72
49
|
source = source.slice(indexes[lastIndex]);
|
|
73
50
|
type = "string";
|
|
74
51
|
// Search the closing echo tag {{ /echo }}
|
|
75
|
-
if (tag?.[1]
|
|
76
|
-
const end = source.match(/{{
|
|
52
|
+
if (tag?.[1].match(/^\-?\s*echo\s*\-?$/)) {
|
|
53
|
+
const end = source.match(/{{\-?\s*\/echo\s*\-?}}/);
|
|
77
54
|
if (!end) {
|
|
78
55
|
throw new Error("Unclosed echo tag");
|
|
79
56
|
}
|
|
@@ -111,7 +88,8 @@ export function parseTag(source) {
|
|
|
111
88
|
statuses.unshift("bracket");
|
|
112
89
|
}
|
|
113
90
|
else if (status !== "comment" && status !== "single-quote" &&
|
|
114
|
-
status !== "double-quote" && status !== "literal"
|
|
91
|
+
status !== "double-quote" && status !== "literal" &&
|
|
92
|
+
status !== "regex" && status !== "line-comment") {
|
|
115
93
|
statuses.unshift("bracket");
|
|
116
94
|
}
|
|
117
95
|
break;
|
|
@@ -136,7 +114,9 @@ export function parseTag(source) {
|
|
|
136
114
|
}
|
|
137
115
|
else if (status !== "comment" &&
|
|
138
116
|
status !== "single-quote" &&
|
|
139
|
-
status !== "literal"
|
|
117
|
+
status !== "literal" &&
|
|
118
|
+
status !== "regex" &&
|
|
119
|
+
status !== "line-comment") {
|
|
140
120
|
statuses.unshift("double-quote");
|
|
141
121
|
}
|
|
142
122
|
break;
|
|
@@ -149,7 +129,9 @@ export function parseTag(source) {
|
|
|
149
129
|
}
|
|
150
130
|
else if (status !== "comment" &&
|
|
151
131
|
status !== "double-quote" &&
|
|
152
|
-
status !== "literal"
|
|
132
|
+
status !== "literal" &&
|
|
133
|
+
status !== "regex" &&
|
|
134
|
+
status !== "line-comment") {
|
|
153
135
|
statuses.unshift("single-quote");
|
|
154
136
|
}
|
|
155
137
|
break;
|
|
@@ -162,23 +144,56 @@ export function parseTag(source) {
|
|
|
162
144
|
}
|
|
163
145
|
else if (status !== "comment" &&
|
|
164
146
|
status !== "double-quote" &&
|
|
165
|
-
status !== "single-quote"
|
|
147
|
+
status !== "single-quote" &&
|
|
148
|
+
status !== "regex" &&
|
|
149
|
+
status !== "line-comment") {
|
|
166
150
|
statuses.unshift("literal");
|
|
167
151
|
}
|
|
168
152
|
break;
|
|
169
153
|
}
|
|
170
|
-
// Detect comments
|
|
154
|
+
// Detect comments and regex
|
|
171
155
|
case "/": {
|
|
172
156
|
const status = statuses[0];
|
|
173
|
-
if (status
|
|
174
|
-
status
|
|
175
|
-
|
|
176
|
-
|
|
157
|
+
if (status === "single-quote" || status === "double-quote" ||
|
|
158
|
+
status === "literal" || status === "line-comment") {
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
// We are in a comment: close or ignore
|
|
162
|
+
if (status === "comment") {
|
|
163
|
+
if (source.charAt(index - 2) === "*") {
|
|
164
|
+
statuses.shift();
|
|
177
165
|
}
|
|
178
|
-
|
|
179
|
-
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
// We are in a regex: close or ignore
|
|
169
|
+
if (status === "regex") {
|
|
170
|
+
if (source.charAt(index - 2) !== "\\") {
|
|
180
171
|
statuses.shift();
|
|
181
172
|
}
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
// Start a new comment
|
|
176
|
+
if (source.charAt(index) === "*") {
|
|
177
|
+
statuses.unshift("comment");
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
// Start a new line comment
|
|
181
|
+
if (source.charAt(index - 2) === "/") {
|
|
182
|
+
statuses.unshift("line-comment");
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
// Start a new regex
|
|
186
|
+
const prev = prevChar(source, index - 1);
|
|
187
|
+
if (prev === "(" || prev === "=" || prev === ":" || prev === ",") {
|
|
188
|
+
statuses.unshift("regex");
|
|
189
|
+
}
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
// Detect end of line comments
|
|
193
|
+
case "\n": {
|
|
194
|
+
const status = statuses[0];
|
|
195
|
+
if (status === "line-comment") {
|
|
196
|
+
statuses.shift();
|
|
182
197
|
}
|
|
183
198
|
break;
|
|
184
199
|
}
|
|
@@ -194,3 +209,13 @@ export function parseTag(source) {
|
|
|
194
209
|
}
|
|
195
210
|
throw new Error("Unclosed tag");
|
|
196
211
|
}
|
|
212
|
+
// Get the previous character in a string ignoring spaces, line breaks and tabs
|
|
213
|
+
function prevChar(source, index) {
|
|
214
|
+
while (index > 0) {
|
|
215
|
+
const char = source.charAt(--index);
|
|
216
|
+
if (char !== " " && char !== "\n" && char !== "\r" && char !== "\t") {
|
|
217
|
+
return char;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return "";
|
|
221
|
+
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"module": "./esm/mod.js",
|
|
3
3
|
"main": "./script/mod.js",
|
|
4
4
|
"name": "ventojs",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.11.0",
|
|
6
6
|
"description": "🌬 A minimal but powerful template engine",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": "github:oscarotero/vento",
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
".": {
|
|
13
13
|
"import": "./esm/mod.js",
|
|
14
14
|
"require": "./script/mod.js"
|
|
15
|
+
},
|
|
16
|
+
"./plugins/auto_trim.js": {
|
|
17
|
+
"import": "./esm/plugins/auto_trim.js",
|
|
18
|
+
"require": "./script/plugins/auto_trim.js"
|
|
15
19
|
}
|
|
16
20
|
},
|
|
17
21
|
"scripts": {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Make an assertion, error will be thrown if `expr` does not have truthy value.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { assert } from "https://deno.land/std@$STD_VERSION/assert/assert.ts";
|
|
7
|
+
*
|
|
8
|
+
* assert("hello".includes("ello")); // Doesn't throw
|
|
9
|
+
* assert("hello".includes("world")); // Throws
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export declare function assert(expr: unknown, msg?: string): asserts expr;
|
|
@@ -3,7 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.assert = void 0;
|
|
4
4
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
5
5
|
const assertion_error_js_1 = require("./assertion_error.js");
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Make an assertion, error will be thrown if `expr` does not have truthy value.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { assert } from "https://deno.land/std@$STD_VERSION/assert/assert.ts";
|
|
12
|
+
*
|
|
13
|
+
* assert("hello".includes("ello")); // Doesn't throw
|
|
14
|
+
* assert("hello".includes("world")); // Throws
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
7
17
|
function assert(expr, msg = "") {
|
|
8
18
|
if (!expr) {
|
|
9
19
|
throw new assertion_error_js_1.AssertionError(msg);
|