ventojs 0.10.2 → 0.12.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/README.md +35 -93
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/assert/assert.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/assert/assertion_error.js +1 -1
- package/esm/deps/deno.land/std@0.219.1/html/entities.d.ts +39 -0
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/html/entities.js +14 -15
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/html/mod.d.ts +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/html/mod.js +2 -2
- package/esm/deps/deno.land/std@0.219.1/path/_common/assert_path.d.ts +1 -0
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/assert_path.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/basename.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/common.js +9 -9
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/constants.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/dirname.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/format.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/from_file_url.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/glob_to_reg_exp.js +4 -2
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/normalize.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/normalize_string.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/relative.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/strip_trailing_separators.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/to_file_url.js +1 -1
- package/esm/deps/deno.land/std@0.219.1/path/_interface.js +3 -0
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_os.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/basename.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/common.js +3 -3
- package/esm/deps/deno.land/std@0.219.1/path/constants.d.ts +3 -0
- package/esm/deps/deno.land/std@0.219.1/path/constants.js +6 -0
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/dirname.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/extname.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/format.d.ts +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/format.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/from_file_url.js +1 -1
- package/{script/deps/deno.land/std@0.210.0 → esm/deps/deno.land/std@0.219.1}/path/glob_to_regexp.d.ts +2 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/glob_to_regexp.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/is_absolute.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/is_glob.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/join.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/join_globs.d.ts +1 -0
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/join_globs.js +1 -1
- package/esm/deps/deno.land/std@0.219.1/path/mod.d.ts +56 -0
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/mod.js +3 -8
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/normalize.js +1 -1
- package/{script/deps/deno.land/std@0.210.0 → esm/deps/deno.land/std@0.219.1}/path/normalize_glob.d.ts +1 -0
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/normalize_glob.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/parse.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/_util.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/basename.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0/path/windows → std@0.219.1/path/posix}/common.js +3 -3
- package/esm/deps/deno.land/std@0.219.1/path/posix/constants.d.ts +3 -0
- package/esm/deps/deno.land/std@0.219.1/path/posix/constants.js +5 -0
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/dirname.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/extname.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/format.js +1 -1
- package/{script/deps/deno.land/std@0.210.0 → esm/deps/deno.land/std@0.219.1}/path/posix/from_file_url.d.ts +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/from_file_url.js +2 -2
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/glob_to_regexp.d.ts +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/glob_to_regexp.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/is_absolute.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0/path/windows → std@0.219.1/path/posix}/is_glob.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/join.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0/path/windows → std@0.219.1/path/posix}/join_globs.d.ts +2 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/join_globs.js +3 -3
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/mod.d.ts +1 -3
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/mod.js +2 -4
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/normalize.js +1 -1
- package/{script/deps/deno.land/std@0.210.0 → esm/deps/deno.land/std@0.219.1}/path/posix/normalize_glob.d.ts +2 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/normalize_glob.js +3 -3
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/parse.d.ts +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/parse.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/relative.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/resolve.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/to_file_url.d.ts +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/to_file_url.js +2 -2
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/to_namespaced_path.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/relative.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/resolve.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/to_file_url.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/to_namespaced_path.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/_util.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/basename.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0/path/posix → std@0.219.1/path/windows}/common.js +3 -3
- package/esm/deps/deno.land/std@0.219.1/path/windows/constants.d.ts +3 -0
- package/esm/deps/deno.land/std@0.219.1/path/windows/constants.js +5 -0
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/dirname.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/extname.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/format.js +1 -1
- package/{script/deps/deno.land/std@0.210.0 → esm/deps/deno.land/std@0.219.1}/path/windows/from_file_url.d.ts +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/from_file_url.js +2 -2
- package/{script/deps/deno.land/std@0.210.0/path/posix → esm/deps/deno.land/std@0.219.1/path/windows}/glob_to_regexp.d.ts +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/glob_to_regexp.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/is_absolute.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0/path/posix → std@0.219.1/path/windows}/is_glob.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/join.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0/path/posix → std@0.219.1/path/windows}/join_globs.d.ts +2 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/join_globs.js +3 -3
- package/{script/deps/deno.land/std@0.210.0/path/posix → esm/deps/deno.land/std@0.219.1/path/windows}/mod.d.ts +1 -3
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/mod.js +2 -4
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/normalize.js +1 -1
- package/{script/deps/deno.land/std@0.210.0 → esm/deps/deno.land/std@0.219.1}/path/windows/normalize_glob.d.ts +2 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/normalize_glob.js +3 -3
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/parse.d.ts +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/parse.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/relative.js +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/resolve.js +1 -1
- package/{script/deps/deno.land/std@0.210.0 → esm/deps/deno.land/std@0.219.1}/path/windows/to_file_url.d.ts +1 -1
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/to_file_url.js +2 -2
- package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/to_namespaced_path.js +1 -1
- package/esm/deps/deno.land/x/astring@v1.8.6/src/astring.d.ts +109 -0
- package/esm/deps/deno.land/x/astring@v1.8.6/src/astring.js +1159 -0
- package/esm/deps.d.ts +6 -2
- package/esm/deps.js +5 -2
- package/esm/mod.d.ts +1 -0
- 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/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 +3 -0
- package/esm/src/environment.js +28 -7
- package/esm/src/tokenizer.js +6 -29
- package/esm/src/transformer.d.ts +1 -0
- package/esm/src/transformer.js +180 -0
- package/package.json +21 -8
- package/esm/deps/deno.land/std@0.210.0/html/entities.d.ts +0 -38
- package/esm/deps/deno.land/std@0.210.0/path/_common/assert_path.d.ts +0 -1
- package/esm/deps/deno.land/std@0.210.0/path/_interface.js +0 -3
- package/esm/deps/deno.land/std@0.210.0/path/common.d.ts +0 -13
- package/esm/deps/deno.land/std@0.210.0/path/glob_to_regexp.d.ts +0 -61
- package/esm/deps/deno.land/std@0.210.0/path/mod.d.ts +0 -28
- package/esm/deps/deno.land/std@0.210.0/path/normalize_glob.d.ts +0 -3
- package/esm/deps/deno.land/std@0.210.0/path/posix/from_file_url.d.ts +0 -12
- package/esm/deps/deno.land/std@0.210.0/path/posix/normalize_glob.d.ts +0 -3
- package/esm/deps/deno.land/std@0.210.0/path/posix/separator.d.ts +0 -2
- package/esm/deps/deno.land/std@0.210.0/path/posix/separator.js +0 -4
- package/esm/deps/deno.land/std@0.210.0/path/separator.d.ts +0 -2
- package/esm/deps/deno.land/std@0.210.0/path/separator.js +0 -5
- package/esm/deps/deno.land/std@0.210.0/path/windows/from_file_url.d.ts +0 -14
- package/esm/deps/deno.land/std@0.210.0/path/windows/glob_to_regexp.d.ts +0 -57
- package/esm/deps/deno.land/std@0.210.0/path/windows/mod.d.ts +0 -40
- package/esm/deps/deno.land/std@0.210.0/path/windows/normalize_glob.d.ts +0 -3
- package/esm/deps/deno.land/std@0.210.0/path/windows/separator.d.ts +0 -2
- package/esm/deps/deno.land/std@0.210.0/path/windows/separator.js +0 -4
- package/esm/deps/deno.land/std@0.210.0/path/windows/to_file_url.d.ts +0 -14
- package/script/_dnt.shims.d.ts +0 -5
- package/script/_dnt.shims.js +0 -65
- package/script/deps/deno.land/std@0.210.0/assert/assert.d.ts +0 -12
- package/script/deps/deno.land/std@0.210.0/assert/assert.js +0 -22
- package/script/deps/deno.land/std@0.210.0/assert/assertion_error.d.ts +0 -14
- package/script/deps/deno.land/std@0.210.0/assert/assertion_error.js +0 -22
- package/script/deps/deno.land/std@0.210.0/html/entities.d.ts +0 -38
- package/script/deps/deno.land/std@0.210.0/html/entities.js +0 -81
- package/script/deps/deno.land/std@0.210.0/html/mod.d.ts +0 -6
- package/script/deps/deno.land/std@0.210.0/html/mod.js +0 -24
- package/script/deps/deno.land/std@0.210.0/path/_common/assert_path.d.ts +0 -1
- package/script/deps/deno.land/std@0.210.0/path/_common/assert_path.js +0 -11
- package/script/deps/deno.land/std@0.210.0/path/_common/basename.d.ts +0 -3
- package/script/deps/deno.land/std@0.210.0/path/_common/basename.js +0 -46
- package/script/deps/deno.land/std@0.210.0/path/_common/common.d.ts +0 -1
- package/script/deps/deno.land/std@0.210.0/path/_common/common.js +0 -27
- package/script/deps/deno.land/std@0.210.0/path/_common/constants.d.ts +0 -39
- package/script/deps/deno.land/std@0.210.0/path/_common/constants.js +0 -49
- package/script/deps/deno.land/std@0.210.0/path/_common/dirname.d.ts +0 -1
- package/script/deps/deno.land/std@0.210.0/path/_common/dirname.js +0 -12
- package/script/deps/deno.land/std@0.210.0/path/_common/format.d.ts +0 -3
- package/script/deps/deno.land/std@0.210.0/path/_common/format.js +0 -24
- package/script/deps/deno.land/std@0.210.0/path/_common/from_file_url.d.ts +0 -2
- package/script/deps/deno.land/std@0.210.0/path/_common/from_file_url.js +0 -13
- package/script/deps/deno.land/std@0.210.0/path/_common/glob_to_reg_exp.d.ts +0 -28
- package/script/deps/deno.land/std@0.210.0/path/_common/glob_to_reg_exp.js +0 -239
- package/script/deps/deno.land/std@0.210.0/path/_common/normalize.d.ts +0 -1
- package/script/deps/deno.land/std@0.210.0/path/_common/normalize.js +0 -12
- package/script/deps/deno.land/std@0.210.0/path/_common/normalize_string.d.ts +0 -1
- package/script/deps/deno.land/std@0.210.0/path/_common/normalize_string.js +0 -81
- package/script/deps/deno.land/std@0.210.0/path/_common/relative.d.ts +0 -1
- package/script/deps/deno.land/std@0.210.0/path/_common/relative.js +0 -13
- package/script/deps/deno.land/std@0.210.0/path/_common/strip_trailing_separators.d.ts +0 -1
- package/script/deps/deno.land/std@0.210.0/path/_common/strip_trailing_separators.js +0 -23
- package/script/deps/deno.land/std@0.210.0/path/_common/to_file_url.d.ts +0 -1
- package/script/deps/deno.land/std@0.210.0/path/_common/to_file_url.js +0 -19
- package/script/deps/deno.land/std@0.210.0/path/_interface.d.ts +0 -26
- package/script/deps/deno.land/std@0.210.0/path/_interface.js +0 -4
- package/script/deps/deno.land/std@0.210.0/path/_os.d.ts +0 -3
- package/script/deps/deno.land/std@0.210.0/path/_os.js +0 -44
- package/script/deps/deno.land/std@0.210.0/path/basename.d.ts +0 -8
- package/script/deps/deno.land/std@0.210.0/path/basename.js +0 -21
- package/script/deps/deno.land/std@0.210.0/path/common.d.ts +0 -13
- package/script/deps/deno.land/std@0.210.0/path/common.js +0 -23
- package/script/deps/deno.land/std@0.210.0/path/dirname.d.ts +0 -5
- package/script/deps/deno.land/std@0.210.0/path/dirname.js +0 -16
- package/script/deps/deno.land/std@0.210.0/path/extname.d.ts +0 -6
- package/script/deps/deno.land/std@0.210.0/path/extname.js +0 -17
- package/script/deps/deno.land/std@0.210.0/path/format.d.ts +0 -6
- package/script/deps/deno.land/std@0.210.0/path/format.js +0 -16
- package/script/deps/deno.land/std@0.210.0/path/from_file_url.d.ts +0 -18
- package/script/deps/deno.land/std@0.210.0/path/from_file_url.js +0 -28
- package/script/deps/deno.land/std@0.210.0/path/glob_to_regexp.js +0 -69
- package/script/deps/deno.land/std@0.210.0/path/is_absolute.d.ts +0 -5
- package/script/deps/deno.land/std@0.210.0/path/is_absolute.js +0 -16
- package/script/deps/deno.land/std@0.210.0/path/is_glob.d.ts +0 -2
- package/script/deps/deno.land/std@0.210.0/path/is_glob.js +0 -32
- package/script/deps/deno.land/std@0.210.0/path/join.d.ts +0 -5
- package/script/deps/deno.land/std@0.210.0/path/join.js +0 -16
- package/script/deps/deno.land/std@0.210.0/path/join_globs.d.ts +0 -3
- package/script/deps/deno.land/std@0.210.0/path/join_globs.js +0 -15
- package/script/deps/deno.land/std@0.210.0/path/mod.d.ts +0 -28
- package/script/deps/deno.land/std@0.210.0/path/mod.js +0 -94
- package/script/deps/deno.land/std@0.210.0/path/normalize.d.ts +0 -7
- package/script/deps/deno.land/std@0.210.0/path/normalize.js +0 -18
- package/script/deps/deno.land/std@0.210.0/path/normalize_glob.js +0 -15
- package/script/deps/deno.land/std@0.210.0/path/parse.d.ts +0 -6
- package/script/deps/deno.land/std@0.210.0/path/parse.js +0 -16
- package/script/deps/deno.land/std@0.210.0/path/posix/_util.d.ts +0 -1
- package/script/deps/deno.land/std@0.210.0/path/posix/_util.js +0 -12
- package/script/deps/deno.land/std@0.210.0/path/posix/basename.d.ts +0 -8
- package/script/deps/deno.land/std@0.210.0/path/posix/basename.js +0 -22
- package/script/deps/deno.land/std@0.210.0/path/posix/common.js +0 -23
- package/script/deps/deno.land/std@0.210.0/path/posix/dirname.d.ts +0 -5
- package/script/deps/deno.land/std@0.210.0/path/posix/dirname.js +0 -40
- package/script/deps/deno.land/std@0.210.0/path/posix/extname.d.ts +0 -6
- package/script/deps/deno.land/std@0.210.0/path/posix/extname.js +0 -63
- package/script/deps/deno.land/std@0.210.0/path/posix/format.d.ts +0 -6
- package/script/deps/deno.land/std@0.210.0/path/posix/format.js +0 -15
- package/script/deps/deno.land/std@0.210.0/path/posix/from_file_url.js +0 -21
- package/script/deps/deno.land/std@0.210.0/path/posix/glob_to_regexp.js +0 -73
- package/script/deps/deno.land/std@0.210.0/path/posix/is_absolute.d.ts +0 -5
- package/script/deps/deno.land/std@0.210.0/path/posix/is_absolute.js +0 -16
- package/script/deps/deno.land/std@0.210.0/path/posix/is_glob.d.ts +0 -1
- package/script/deps/deno.land/std@0.210.0/path/posix/is_glob.js +0 -7
- package/script/deps/deno.land/std@0.210.0/path/posix/join.d.ts +0 -5
- package/script/deps/deno.land/std@0.210.0/path/posix/join.js +0 -30
- package/script/deps/deno.land/std@0.210.0/path/posix/join_globs.d.ts +0 -3
- package/script/deps/deno.land/std@0.210.0/path/posix/join_globs.js +0 -30
- package/script/deps/deno.land/std@0.210.0/path/posix/mod.js +0 -61
- package/script/deps/deno.land/std@0.210.0/path/posix/normalize.d.ts +0 -7
- package/script/deps/deno.land/std@0.210.0/path/posix/normalize.js +0 -29
- package/script/deps/deno.land/std@0.210.0/path/posix/normalize_glob.js +0 -20
- package/script/deps/deno.land/std@0.210.0/path/posix/parse.d.ts +0 -6
- package/script/deps/deno.land/std@0.210.0/path/posix/parse.js +0 -102
- package/script/deps/deno.land/std@0.210.0/path/posix/relative.d.ts +0 -7
- package/script/deps/deno.land/std@0.210.0/path/posix/relative.js +0 -98
- package/script/deps/deno.land/std@0.210.0/path/posix/resolve.d.ts +0 -5
- package/script/deps/deno.land/std@0.210.0/path/posix/resolve.js +0 -75
- package/script/deps/deno.land/std@0.210.0/path/posix/separator.d.ts +0 -2
- package/script/deps/deno.land/std@0.210.0/path/posix/separator.js +0 -7
- package/script/deps/deno.land/std@0.210.0/path/posix/to_file_url.d.ts +0 -12
- package/script/deps/deno.land/std@0.210.0/path/posix/to_file_url.js +0 -26
- package/script/deps/deno.land/std@0.210.0/path/posix/to_namespaced_path.d.ts +0 -5
- package/script/deps/deno.land/std@0.210.0/path/posix/to_namespaced_path.js +0 -14
- package/script/deps/deno.land/std@0.210.0/path/relative.d.ts +0 -12
- package/script/deps/deno.land/std@0.210.0/path/relative.js +0 -23
- package/script/deps/deno.land/std@0.210.0/path/resolve.d.ts +0 -5
- package/script/deps/deno.land/std@0.210.0/path/resolve.js +0 -18
- package/script/deps/deno.land/std@0.210.0/path/separator.d.ts +0 -2
- package/script/deps/deno.land/std@0.210.0/path/separator.js +0 -8
- package/script/deps/deno.land/std@0.210.0/path/to_file_url.d.ts +0 -18
- package/script/deps/deno.land/std@0.210.0/path/to_file_url.js +0 -28
- package/script/deps/deno.land/std@0.210.0/path/to_namespaced_path.d.ts +0 -5
- package/script/deps/deno.land/std@0.210.0/path/to_namespaced_path.js +0 -18
- package/script/deps/deno.land/std@0.210.0/path/windows/_util.d.ts +0 -3
- package/script/deps/deno.land/std@0.210.0/path/windows/_util.js +0 -21
- package/script/deps/deno.land/std@0.210.0/path/windows/basename.d.ts +0 -8
- package/script/deps/deno.land/std@0.210.0/path/windows/basename.js +0 -34
- package/script/deps/deno.land/std@0.210.0/path/windows/common.d.ts +0 -13
- package/script/deps/deno.land/std@0.210.0/path/windows/common.js +0 -23
- package/script/deps/deno.land/std@0.210.0/path/windows/dirname.d.ts +0 -5
- package/script/deps/deno.land/std@0.210.0/path/windows/dirname.js +0 -102
- package/script/deps/deno.land/std@0.210.0/path/windows/extname.d.ts +0 -6
- package/script/deps/deno.land/std@0.210.0/path/windows/extname.js +0 -72
- package/script/deps/deno.land/std@0.210.0/path/windows/format.d.ts +0 -6
- package/script/deps/deno.land/std@0.210.0/path/windows/format.js +0 -15
- package/script/deps/deno.land/std@0.210.0/path/windows/from_file_url.js +0 -30
- package/script/deps/deno.land/std@0.210.0/path/windows/glob_to_regexp.d.ts +0 -57
- package/script/deps/deno.land/std@0.210.0/path/windows/glob_to_regexp.js +0 -73
- package/script/deps/deno.land/std@0.210.0/path/windows/is_absolute.d.ts +0 -5
- package/script/deps/deno.land/std@0.210.0/path/windows/is_absolute.js +0 -31
- package/script/deps/deno.land/std@0.210.0/path/windows/is_glob.d.ts +0 -1
- package/script/deps/deno.land/std@0.210.0/path/windows/is_glob.js +0 -7
- package/script/deps/deno.land/std@0.210.0/path/windows/join.d.ts +0 -5
- package/script/deps/deno.land/std@0.210.0/path/windows/join.js +0 -76
- package/script/deps/deno.land/std@0.210.0/path/windows/join_globs.d.ts +0 -3
- package/script/deps/deno.land/std@0.210.0/path/windows/join_globs.js +0 -30
- package/script/deps/deno.land/std@0.210.0/path/windows/mod.d.ts +0 -40
- package/script/deps/deno.land/std@0.210.0/path/windows/mod.js +0 -61
- package/script/deps/deno.land/std@0.210.0/path/windows/normalize.d.ts +0 -7
- package/script/deps/deno.land/std@0.210.0/path/windows/normalize.js +0 -134
- package/script/deps/deno.land/std@0.210.0/path/windows/normalize_glob.js +0 -20
- package/script/deps/deno.land/std@0.210.0/path/windows/parse.d.ts +0 -6
- package/script/deps/deno.land/std@0.210.0/path/windows/parse.js +0 -163
- package/script/deps/deno.land/std@0.210.0/path/windows/relative.d.ts +0 -12
- package/script/deps/deno.land/std@0.210.0/path/windows/relative.js +0 -125
- package/script/deps/deno.land/std@0.210.0/path/windows/resolve.d.ts +0 -5
- package/script/deps/deno.land/std@0.210.0/path/windows/resolve.js +0 -170
- package/script/deps/deno.land/std@0.210.0/path/windows/separator.d.ts +0 -2
- package/script/deps/deno.land/std@0.210.0/path/windows/separator.js +0 -7
- package/script/deps/deno.land/std@0.210.0/path/windows/to_file_url.js +0 -35
- package/script/deps/deno.land/std@0.210.0/path/windows/to_namespaced_path.d.ts +0 -5
- package/script/deps/deno.land/std@0.210.0/path/windows/to_namespaced_path.js +0 -42
- package/script/deps.d.ts +0 -2
- package/script/deps.js +0 -28
- package/script/mod.d.ts +0 -9
- package/script/mod.js +0 -69
- package/script/package.json +0 -3
- package/script/plugins/echo.d.ts +0 -2
- package/script/plugins/echo.js +0 -16
- package/script/plugins/escape.d.ts +0 -2
- package/script/plugins/escape.js +0 -9
- package/script/plugins/export.d.ts +0 -2
- package/script/plugins/export.js +0 -50
- package/script/plugins/for.d.ts +0 -2
- package/script/plugins/for.js +0 -77
- package/script/plugins/function.d.ts +0 -2
- package/script/plugins/function.js +0 -40
- package/script/plugins/if.d.ts +0 -2
- package/script/plugins/if.js +0 -35
- package/script/plugins/import.d.ts +0 -2
- package/script/plugins/import.js +0 -20
- package/script/plugins/include.d.ts +0 -2
- package/script/plugins/include.js +0 -26
- package/script/plugins/js.d.ts +0 -2
- package/script/plugins/js.js +0 -14
- package/script/plugins/layout.d.ts +0 -2
- package/script/plugins/layout.js +0 -37
- package/script/plugins/set.d.ts +0 -2
- package/script/plugins/set.js +0 -48
- package/script/plugins/unescape.d.ts +0 -2
- package/script/plugins/unescape.js +0 -9
- package/script/src/environment.d.ts +0 -51
- package/script/src/environment.js +0 -208
- package/script/src/loader.d.ts +0 -14
- package/script/src/loader.js +0 -46
- package/script/src/tokenizer.d.ts +0 -13
- package/script/src/tokenizer.js +0 -249
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/assert/assert.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/assert/assertion_error.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/basename.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/common.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/constants.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/dirname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/from_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/glob_to_reg_exp.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/normalize.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/normalize_string.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/relative.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/strip_trailing_separators.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/to_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_interface.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_os.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/basename.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0/path/posix → std@0.219.1/path}/common.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/dirname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/extname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/from_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/is_absolute.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/is_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/join.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/normalize.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/parse.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/_util.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/basename.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0/path/windows → std@0.219.1/path/posix}/common.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/dirname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/extname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/is_absolute.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/is_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/join.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/normalize.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/relative.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/resolve.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/posix/to_namespaced_path.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/relative.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/resolve.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/to_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/to_namespaced_path.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/_util.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/basename.d.ts +0 -0
- /package/{script/deps/deno.land/std@0.210.0/path/posix → esm/deps/deno.land/std@0.219.1/path/windows}/common.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/dirname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/extname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/is_absolute.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/is_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/join.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/normalize.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/relative.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/resolve.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/windows/to_namespaced_path.d.ts +0 -0
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Token } from "./tokenizer.js";
|
|
2
|
-
import type { Loader } from "./loader.js";
|
|
3
|
-
export interface TemplateResult {
|
|
4
|
-
content: string;
|
|
5
|
-
[key: string]: unknown;
|
|
6
|
-
}
|
|
7
|
-
export interface Template {
|
|
8
|
-
(data?: Record<string, unknown>): Promise<TemplateResult>;
|
|
9
|
-
source: string;
|
|
10
|
-
code: string;
|
|
11
|
-
file?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface TemplateSync {
|
|
14
|
-
(data?: Record<string, unknown>): TemplateResult;
|
|
15
|
-
source: string;
|
|
16
|
-
code: string;
|
|
17
|
-
file?: string;
|
|
18
|
-
}
|
|
19
|
-
export type Tag = (env: Environment, code: string, output: string, tokens: Token[]) => string | undefined;
|
|
20
|
-
export type FilterThis = {
|
|
21
|
-
data: Record<string, unknown>;
|
|
22
|
-
env: Environment;
|
|
23
|
-
};
|
|
24
|
-
export type Filter = (this: FilterThis, ...args: any[]) => any;
|
|
25
|
-
export type Plugin = (env: Environment) => void;
|
|
26
|
-
export interface Options {
|
|
27
|
-
loader: Loader;
|
|
28
|
-
dataVarname: string;
|
|
29
|
-
autoescape: boolean;
|
|
30
|
-
useWith: boolean;
|
|
31
|
-
}
|
|
32
|
-
export declare class Environment {
|
|
33
|
-
cache: Map<string, Template>;
|
|
34
|
-
options: Options;
|
|
35
|
-
tags: Tag[];
|
|
36
|
-
filters: Record<string, Filter>;
|
|
37
|
-
utils: Record<string, unknown>;
|
|
38
|
-
constructor(options: Options);
|
|
39
|
-
use(plugin: Plugin): void;
|
|
40
|
-
run(file: string, data: Record<string, unknown>, from?: string): Promise<TemplateResult>;
|
|
41
|
-
runString(source: string, data?: Record<string, unknown>, file?: string): Promise<TemplateResult>;
|
|
42
|
-
runStringSync(source: string, data?: Record<string, unknown>): TemplateResult;
|
|
43
|
-
compile(source: string, path?: string, defaults?: Record<string, unknown>, sync?: false): Template;
|
|
44
|
-
compile(source: string, path?: string, defaults?: Record<string, unknown>, sync?: true): TemplateSync;
|
|
45
|
-
load(file: string, from?: string): Promise<Template>;
|
|
46
|
-
compileTokens(tokens: Token[], outputVar?: string, stopAt?: string[]): string[];
|
|
47
|
-
compileFilters(tokens: Token[], output: string, autoescape?: boolean): string;
|
|
48
|
-
createError(path: string, source: string, position: number, cause: Error): Error;
|
|
49
|
-
}
|
|
50
|
-
/** Returns the number and code of the errored line */
|
|
51
|
-
export declare function errorLine(source: string, pos: number): [number, number, string];
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.errorLine = exports.Environment = void 0;
|
|
30
|
-
const dntShim = __importStar(require("../_dnt.shims.js"));
|
|
31
|
-
const tokenizer_js_1 = __importDefault(require("./tokenizer.js"));
|
|
32
|
-
class Environment {
|
|
33
|
-
cache = new Map();
|
|
34
|
-
options;
|
|
35
|
-
tags = [];
|
|
36
|
-
filters = {};
|
|
37
|
-
utils = {};
|
|
38
|
-
constructor(options) {
|
|
39
|
-
this.options = options;
|
|
40
|
-
}
|
|
41
|
-
use(plugin) {
|
|
42
|
-
plugin(this);
|
|
43
|
-
}
|
|
44
|
-
async run(file, data, from) {
|
|
45
|
-
const template = await this.load(file, from);
|
|
46
|
-
return await template(data);
|
|
47
|
-
}
|
|
48
|
-
async runString(source, data, file) {
|
|
49
|
-
if (file) {
|
|
50
|
-
const cached = this.cache.get(file);
|
|
51
|
-
if (cached) {
|
|
52
|
-
return await cached(data);
|
|
53
|
-
}
|
|
54
|
-
const template = this.compile(source, file);
|
|
55
|
-
this.cache.set(file, template);
|
|
56
|
-
return await template(data);
|
|
57
|
-
}
|
|
58
|
-
const template = this.compile(source, file);
|
|
59
|
-
return await template(data);
|
|
60
|
-
}
|
|
61
|
-
runStringSync(source, data) {
|
|
62
|
-
const template = this.compile(source, "", {}, true);
|
|
63
|
-
return template(data);
|
|
64
|
-
}
|
|
65
|
-
compile(source, path, defaults, sync = false) {
|
|
66
|
-
const { tokens, position, error } = (0, tokenizer_js_1.default)(source);
|
|
67
|
-
if (error) {
|
|
68
|
-
throw this.createError(path || "unknown", source, position, error);
|
|
69
|
-
}
|
|
70
|
-
const code = this.compileTokens(tokens).join("\n");
|
|
71
|
-
const { dataVarname, useWith } = this.options;
|
|
72
|
-
const constructor = new Function("__file", "__env", "__defaults", `return${sync ? "" : " async"} function (${dataVarname}) {
|
|
73
|
-
let __pos = 0;
|
|
74
|
-
try {
|
|
75
|
-
${dataVarname} = Object.assign({}, __defaults, ${dataVarname});
|
|
76
|
-
const __exports = { content: "" };
|
|
77
|
-
${useWith ? `with (${dataVarname}) {${code}}` : code}
|
|
78
|
-
return __exports;
|
|
79
|
-
} catch (cause) {
|
|
80
|
-
const template = __env.cache.get(__file);
|
|
81
|
-
throw __env.createError(__file, template?.source || "", __pos, cause);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
`);
|
|
85
|
-
const template = constructor(path, this, defaults);
|
|
86
|
-
template.file = path;
|
|
87
|
-
template.code = code;
|
|
88
|
-
template.source = source;
|
|
89
|
-
return template;
|
|
90
|
-
}
|
|
91
|
-
async load(file, from) {
|
|
92
|
-
const path = from ? this.options.loader.resolve(from, file) : file;
|
|
93
|
-
if (!this.cache.has(path)) {
|
|
94
|
-
const { source, data } = await this.options.loader.load(path);
|
|
95
|
-
const template = this.compile(source, path, data);
|
|
96
|
-
this.cache.set(path, template);
|
|
97
|
-
}
|
|
98
|
-
return this.cache.get(path);
|
|
99
|
-
}
|
|
100
|
-
compileTokens(tokens, outputVar = "__exports.content", stopAt) {
|
|
101
|
-
const compiled = [];
|
|
102
|
-
tokens: while (tokens.length > 0) {
|
|
103
|
-
if (stopAt && tokens[0][0] === "tag" && stopAt.includes(tokens[0][1])) {
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
const [type, code, pos] = tokens.shift();
|
|
107
|
-
if (type === "comment") {
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
if (type === "string") {
|
|
111
|
-
compiled.push(`${outputVar} += ${JSON.stringify(code)};`);
|
|
112
|
-
continue;
|
|
113
|
-
}
|
|
114
|
-
if (type === "tag") {
|
|
115
|
-
compiled.push(`__pos = ${pos};`);
|
|
116
|
-
for (const tag of this.tags) {
|
|
117
|
-
const compiledTag = tag(this, code, outputVar, tokens);
|
|
118
|
-
if (typeof compiledTag === "string") {
|
|
119
|
-
compiled.push(compiledTag);
|
|
120
|
-
continue tokens;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
// Unknown tag, just print it
|
|
124
|
-
const expression = this.compileFilters(tokens, code, this.options.autoescape);
|
|
125
|
-
compiled.push(`${outputVar} += (${expression}) ?? "";`);
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
throw new Error(`Unknown token type "${type}"`);
|
|
129
|
-
}
|
|
130
|
-
return compiled;
|
|
131
|
-
}
|
|
132
|
-
compileFilters(tokens, output, autoescape = false) {
|
|
133
|
-
let unescaped = false;
|
|
134
|
-
while (tokens.length > 0 && tokens[0][0] === "filter") {
|
|
135
|
-
const [, code] = tokens.shift();
|
|
136
|
-
const match = code.match(/^(await\s+)?([\w.]+)(?:\((.*)\))?$/);
|
|
137
|
-
if (!match) {
|
|
138
|
-
throw new Error(`Invalid filter: ${code}`);
|
|
139
|
-
}
|
|
140
|
-
const [_, isAsync, name, args] = match;
|
|
141
|
-
if (!this.filters[name]) {
|
|
142
|
-
if (name === "safe") {
|
|
143
|
-
unescaped = true;
|
|
144
|
-
}
|
|
145
|
-
else if (isGlobal(name)) {
|
|
146
|
-
// If a global function
|
|
147
|
-
output = `${isAsync ? "await " : ""}${name}(${output}${args ? `, ${args}` : ""})`;
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
// It's a prototype's method (e.g. `String.toUpperCase()`)
|
|
151
|
-
output = `${isAsync ? "await " : ""}(${output})?.${name}?.(${args ? args : ""})`;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
// It's a filter (e.g. filters.upper())
|
|
156
|
-
const { dataVarname } = this.options;
|
|
157
|
-
output = `${(isAsync || checkAsync(this.filters[name])) ? "await " : ""}__env.filters.${name}.call({data:${dataVarname},env:__env}, ${output}${args ? `, ${args}` : ""})`;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
// Escape by default
|
|
161
|
-
if (autoescape && !unescaped) {
|
|
162
|
-
output = `__env.filters.escape(${output})`;
|
|
163
|
-
}
|
|
164
|
-
return output;
|
|
165
|
-
}
|
|
166
|
-
createError(path, source, position, cause) {
|
|
167
|
-
if (!source) {
|
|
168
|
-
return cause;
|
|
169
|
-
}
|
|
170
|
-
const [line, column, code] = errorLine(source, position);
|
|
171
|
-
return new Error(`Error in the template ${path}:${line}:${column}\n\n${code.trim()}\n\n> ${cause.message}\n`, { cause });
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
exports.Environment = Environment;
|
|
175
|
-
function isGlobal(name) {
|
|
176
|
-
// @ts-ignore TS doesn't know about globalThis
|
|
177
|
-
if (dntShim.dntGlobalThis[name]) {
|
|
178
|
-
return true;
|
|
179
|
-
}
|
|
180
|
-
if (name.includes(".")) {
|
|
181
|
-
const [obj, prop] = name.split(".");
|
|
182
|
-
// @ts-ignore TS doesn't know about globalThis
|
|
183
|
-
return typeof dntShim.dntGlobalThis[obj]?.[prop] === "function";
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
/** Returns the number and code of the errored line */
|
|
187
|
-
function errorLine(source, pos) {
|
|
188
|
-
let line = 1;
|
|
189
|
-
let column = 1;
|
|
190
|
-
for (let index = 0; index < pos; index++) {
|
|
191
|
-
if (source[index] === "\n" ||
|
|
192
|
-
(source[index] === "\r" && source[index + 1] === "\n")) {
|
|
193
|
-
line++;
|
|
194
|
-
column = 1;
|
|
195
|
-
if (source[index] === "\r") {
|
|
196
|
-
index++;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
200
|
-
column++;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
return [line, column, source.split("\n")[line - 1]];
|
|
204
|
-
}
|
|
205
|
-
exports.errorLine = errorLine;
|
|
206
|
-
function checkAsync(fn) {
|
|
207
|
-
return fn.constructor?.name === "AsyncFunction";
|
|
208
|
-
}
|
package/script/src/loader.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface TemplateSource {
|
|
2
|
-
source: string;
|
|
3
|
-
data?: Record<string, unknown>;
|
|
4
|
-
}
|
|
5
|
-
export interface Loader {
|
|
6
|
-
load(file: string): TemplateSource | Promise<TemplateSource>;
|
|
7
|
-
resolve(from: string, file: string): string;
|
|
8
|
-
}
|
|
9
|
-
export declare class FileLoader implements Loader {
|
|
10
|
-
#private;
|
|
11
|
-
constructor(root: string);
|
|
12
|
-
load(file: string): Promise<TemplateSource>;
|
|
13
|
-
resolve(from: string, file: string): string;
|
|
14
|
-
}
|
package/script/src/loader.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.FileLoader = void 0;
|
|
27
|
-
const dntShim = __importStar(require("../_dnt.shims.js"));
|
|
28
|
-
const deps_js_1 = require("../deps.js");
|
|
29
|
-
class FileLoader {
|
|
30
|
-
#root;
|
|
31
|
-
constructor(root) {
|
|
32
|
-
this.#root = root;
|
|
33
|
-
}
|
|
34
|
-
async load(file) {
|
|
35
|
-
return {
|
|
36
|
-
source: await dntShim.Deno.readTextFile(file),
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
resolve(from, file) {
|
|
40
|
-
if (file.startsWith(".")) {
|
|
41
|
-
return deps_js_1.path.join(deps_js_1.path.dirname(from), file);
|
|
42
|
-
}
|
|
43
|
-
return deps_js_1.path.join(this.#root, file);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.FileLoader = FileLoader;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type TokenType = "string" | "tag" | "filter" | "comment";
|
|
2
|
-
export type Token = [TokenType, string, number?];
|
|
3
|
-
export interface TokenizeResult {
|
|
4
|
-
tokens: Token[];
|
|
5
|
-
position: number;
|
|
6
|
-
error: Error | undefined;
|
|
7
|
-
}
|
|
8
|
-
export default function tokenize(source: string): TokenizeResult;
|
|
9
|
-
/**
|
|
10
|
-
* Parse a tag and return the indexes of the start and end brackets, and the filters between.
|
|
11
|
-
* For example: {{ tag |> filter1 |> filter2 }} => [2, 9, 20, 31]
|
|
12
|
-
*/
|
|
13
|
-
export declare function parseTag(source: string): number[];
|
package/script/src/tokenizer.js
DELETED
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseTag = void 0;
|
|
4
|
-
function tokenize(source) {
|
|
5
|
-
const tokens = [];
|
|
6
|
-
let type = "string";
|
|
7
|
-
let trimNext = false;
|
|
8
|
-
let position = 0;
|
|
9
|
-
try {
|
|
10
|
-
while (source.length > 0) {
|
|
11
|
-
if (type === "string") {
|
|
12
|
-
const index = source.indexOf("{{");
|
|
13
|
-
const code = index === -1 ? source : source.slice(0, index);
|
|
14
|
-
if (trimNext) {
|
|
15
|
-
tokens.push([type, code.trimStart(), position]);
|
|
16
|
-
trimNext = false;
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
tokens.push([type, code, position]);
|
|
20
|
-
}
|
|
21
|
-
if (index === -1) {
|
|
22
|
-
break;
|
|
23
|
-
}
|
|
24
|
-
position += index;
|
|
25
|
-
source = source.slice(index);
|
|
26
|
-
type = source.startsWith("{{#") ? "comment" : "tag";
|
|
27
|
-
continue;
|
|
28
|
-
}
|
|
29
|
-
if (type === "comment") {
|
|
30
|
-
source = source.slice(3);
|
|
31
|
-
const index = source.indexOf("#}}");
|
|
32
|
-
const comment = index === -1 ? source : source.slice(0, index);
|
|
33
|
-
tokens.push([type, comment, position]);
|
|
34
|
-
if (index === -1) {
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
position += index + 3;
|
|
38
|
-
source = source.slice(index + 3);
|
|
39
|
-
type = "string";
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
if (type === "tag") {
|
|
43
|
-
const indexes = parseTag(source);
|
|
44
|
-
const lastIndex = indexes.length - 1;
|
|
45
|
-
let tag;
|
|
46
|
-
indexes.reduce((prev, curr, index) => {
|
|
47
|
-
let code = source.slice(prev, curr - 2);
|
|
48
|
-
// Tag
|
|
49
|
-
if (index === 1) {
|
|
50
|
-
// Left trim
|
|
51
|
-
if (code.startsWith("-")) {
|
|
52
|
-
code = code.slice(1);
|
|
53
|
-
const lastToken = tokens[tokens.length - 1];
|
|
54
|
-
lastToken[1] = lastToken[1].trimEnd();
|
|
55
|
-
}
|
|
56
|
-
// Right trim
|
|
57
|
-
if (code.endsWith("-") && index === lastIndex) {
|
|
58
|
-
code = code.slice(0, -1);
|
|
59
|
-
trimNext = true;
|
|
60
|
-
}
|
|
61
|
-
tag = [type, code.trim(), position];
|
|
62
|
-
tokens.push(tag);
|
|
63
|
-
return curr;
|
|
64
|
-
}
|
|
65
|
-
// Right trim
|
|
66
|
-
if (index === lastIndex && code.endsWith("-")) {
|
|
67
|
-
code = code.slice(0, -1);
|
|
68
|
-
trimNext = true;
|
|
69
|
-
}
|
|
70
|
-
// Filters
|
|
71
|
-
tokens.push(["filter", code.trim()]);
|
|
72
|
-
return curr;
|
|
73
|
-
});
|
|
74
|
-
position += indexes[lastIndex];
|
|
75
|
-
source = source.slice(indexes[lastIndex]);
|
|
76
|
-
type = "string";
|
|
77
|
-
// Search the closing echo tag {{ /echo }}
|
|
78
|
-
if (tag?.[1] === "echo") {
|
|
79
|
-
const end = source.match(/{{\s*\/echo\s*}}/);
|
|
80
|
-
if (!end) {
|
|
81
|
-
throw new Error("Unclosed echo tag");
|
|
82
|
-
}
|
|
83
|
-
const rawCode = source.slice(0, end.index);
|
|
84
|
-
tag[1] = `echo ${JSON.stringify(rawCode)}`;
|
|
85
|
-
const length = Number(end.index) + end[0].length;
|
|
86
|
-
source = source.slice(length);
|
|
87
|
-
position += length;
|
|
88
|
-
}
|
|
89
|
-
continue;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
catch (error) {
|
|
94
|
-
return { tokens, position, error };
|
|
95
|
-
}
|
|
96
|
-
return { tokens, position, error: undefined };
|
|
97
|
-
}
|
|
98
|
-
exports.default = tokenize;
|
|
99
|
-
/**
|
|
100
|
-
* Parse a tag and return the indexes of the start and end brackets, and the filters between.
|
|
101
|
-
* For example: {{ tag |> filter1 |> filter2 }} => [2, 9, 20, 31]
|
|
102
|
-
*/
|
|
103
|
-
function parseTag(source) {
|
|
104
|
-
const length = source.length;
|
|
105
|
-
const statuses = [];
|
|
106
|
-
const indexes = [2];
|
|
107
|
-
let index = 0;
|
|
108
|
-
while (index < length) {
|
|
109
|
-
const char = source.charAt(index++);
|
|
110
|
-
switch (char) {
|
|
111
|
-
// Detect start brackets
|
|
112
|
-
case "{": {
|
|
113
|
-
const status = statuses[0];
|
|
114
|
-
if (status === "literal" && source.charAt(index - 2) === "$") {
|
|
115
|
-
statuses.unshift("bracket");
|
|
116
|
-
}
|
|
117
|
-
else if (status !== "comment" && status !== "single-quote" &&
|
|
118
|
-
status !== "double-quote" && status !== "literal" &&
|
|
119
|
-
status !== "regex" && status !== "line-comment") {
|
|
120
|
-
statuses.unshift("bracket");
|
|
121
|
-
}
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
// Detect end brackets
|
|
125
|
-
case "}": {
|
|
126
|
-
const status = statuses[0];
|
|
127
|
-
if (status === "bracket") {
|
|
128
|
-
statuses.shift();
|
|
129
|
-
if (statuses.length === 0) {
|
|
130
|
-
indexes.push(index);
|
|
131
|
-
return indexes;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
break;
|
|
135
|
-
}
|
|
136
|
-
// Detect double quotes
|
|
137
|
-
case '"': {
|
|
138
|
-
const status = statuses[0];
|
|
139
|
-
if (status === "double-quote") {
|
|
140
|
-
statuses.shift();
|
|
141
|
-
}
|
|
142
|
-
else if (status !== "comment" &&
|
|
143
|
-
status !== "single-quote" &&
|
|
144
|
-
status !== "literal" &&
|
|
145
|
-
status !== "regex" &&
|
|
146
|
-
status !== "line-comment") {
|
|
147
|
-
statuses.unshift("double-quote");
|
|
148
|
-
}
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
// Detect single quotes
|
|
152
|
-
case "'": {
|
|
153
|
-
const status = statuses[0];
|
|
154
|
-
if (status === "single-quote") {
|
|
155
|
-
statuses.shift();
|
|
156
|
-
}
|
|
157
|
-
else if (status !== "comment" &&
|
|
158
|
-
status !== "double-quote" &&
|
|
159
|
-
status !== "literal" &&
|
|
160
|
-
status !== "regex" &&
|
|
161
|
-
status !== "line-comment") {
|
|
162
|
-
statuses.unshift("single-quote");
|
|
163
|
-
}
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
|
-
// Detect literals
|
|
167
|
-
case "`": {
|
|
168
|
-
const status = statuses[0];
|
|
169
|
-
if (status === "literal") {
|
|
170
|
-
statuses.shift();
|
|
171
|
-
}
|
|
172
|
-
else if (status !== "comment" &&
|
|
173
|
-
status !== "double-quote" &&
|
|
174
|
-
status !== "single-quote" &&
|
|
175
|
-
status !== "regex" &&
|
|
176
|
-
status !== "line-comment") {
|
|
177
|
-
statuses.unshift("literal");
|
|
178
|
-
}
|
|
179
|
-
break;
|
|
180
|
-
}
|
|
181
|
-
// Detect comments and regex
|
|
182
|
-
case "/": {
|
|
183
|
-
const status = statuses[0];
|
|
184
|
-
if (status === "single-quote" || status === "double-quote" ||
|
|
185
|
-
status === "literal" || status === "line-comment") {
|
|
186
|
-
break;
|
|
187
|
-
}
|
|
188
|
-
// We are in a comment: close or ignore
|
|
189
|
-
if (status === "comment") {
|
|
190
|
-
if (source.charAt(index - 2) === "*") {
|
|
191
|
-
statuses.shift();
|
|
192
|
-
}
|
|
193
|
-
break;
|
|
194
|
-
}
|
|
195
|
-
// We are in a regex: close or ignore
|
|
196
|
-
if (status === "regex") {
|
|
197
|
-
if (source.charAt(index - 2) !== "\\") {
|
|
198
|
-
statuses.shift();
|
|
199
|
-
}
|
|
200
|
-
break;
|
|
201
|
-
}
|
|
202
|
-
// Start a new comment
|
|
203
|
-
if (source.charAt(index) === "*") {
|
|
204
|
-
statuses.unshift("comment");
|
|
205
|
-
break;
|
|
206
|
-
}
|
|
207
|
-
// Start a new line comment
|
|
208
|
-
if (source.charAt(index - 2) === "/") {
|
|
209
|
-
statuses.unshift("line-comment");
|
|
210
|
-
break;
|
|
211
|
-
}
|
|
212
|
-
// Start a new regex
|
|
213
|
-
const prev = prevChar(source, index - 1);
|
|
214
|
-
if (prev === "(" || prev === "=" || prev === ":" || prev === ",") {
|
|
215
|
-
statuses.unshift("regex");
|
|
216
|
-
}
|
|
217
|
-
break;
|
|
218
|
-
}
|
|
219
|
-
// Detect end of line comments
|
|
220
|
-
case "\n": {
|
|
221
|
-
const status = statuses[0];
|
|
222
|
-
if (status === "line-comment") {
|
|
223
|
-
statuses.shift();
|
|
224
|
-
}
|
|
225
|
-
break;
|
|
226
|
-
}
|
|
227
|
-
// Detect filters
|
|
228
|
-
case "|": {
|
|
229
|
-
const status = statuses[0];
|
|
230
|
-
if (status === "bracket" && source.charAt(index) === ">") {
|
|
231
|
-
indexes.push(index + 1);
|
|
232
|
-
}
|
|
233
|
-
break;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
throw new Error("Unclosed tag");
|
|
238
|
-
}
|
|
239
|
-
exports.parseTag = parseTag;
|
|
240
|
-
// Get the previous character in a string ignoring spaces, line breaks and tabs
|
|
241
|
-
function prevChar(source, index) {
|
|
242
|
-
while (index > 0) {
|
|
243
|
-
const char = source.charAt(--index);
|
|
244
|
-
if (char !== " " && char !== "\n" && char !== "\r" && char !== "\t") {
|
|
245
|
-
return char;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
return "";
|
|
249
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/esm/deps/deno.land/{std@0.210.0 → std@0.219.1}/path/_common/strip_trailing_separators.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|