ventojs 0.12.2 → 0.12.4
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/_dnt.shims.d.ts +1 -0
- package/esm/_dnt.shims.d.ts.map +1 -0
- package/esm/_dnt.test_polyfills.d.ts.map +1 -0
- package/esm/_dnt.test_shims.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/assert/_constants.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/assert/_diff.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/assert/_format.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/assert/assert.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/assert/assert.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/assert/assert_equals.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/assert/assert_is_error.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/assert/assert_throws.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/assert/assertion_error.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/assert/assertion_error.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/assert/equal.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/collections/_utils.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/collections/deep_merge.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/fmt/colors.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/front_matter/_formats.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/front_matter/create_extractor.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/front_matter/json.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/front_matter/mod.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/front_matter/test.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/front_matter/toml.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/front_matter/yaml.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/html/entities.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/html/entities.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/html/mod.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/html/mod.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/assert_path.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/assert_path.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/basename.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/basename.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/common.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/common.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/constants.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/constants.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/dirname.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/dirname.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/format.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/format.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/from_file_url.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/from_file_url.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/glob_to_reg_exp.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/glob_to_reg_exp.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/normalize.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/normalize.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/normalize_string.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/normalize_string.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/normalize_string.js +2 -2
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/relative.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/relative.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/strip_trailing_separators.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/strip_trailing_separators.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/to_file_url.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_common/to_file_url.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_interface.d.ts +14 -1
- package/esm/deps/deno.land/std@0.221.0/path/_interface.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_os.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/_os.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/basename.d.ts +18 -0
- package/esm/deps/deno.land/std@0.221.0/path/basename.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/basename.js +9 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/common.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/common.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/constants.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/constants.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1/path/posix → std@0.221.0/path}/dirname.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/dirname.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/extname.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/extname.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/format.d.ts +4 -1
- package/esm/deps/deno.land/std@0.221.0/path/format.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/format.js +3 -1
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/from_file_url.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/from_file_url.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/glob_to_regexp.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/glob_to_regexp.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1/path/posix → std@0.221.0/path}/is_absolute.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/is_absolute.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/is_glob.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/is_glob.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/join.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/join.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/join_globs.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/join_globs.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/mod.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/mod.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/normalize.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/normalize.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/normalize_glob.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/normalize_glob.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/parse.d.ts +19 -0
- package/esm/deps/deno.land/std@0.221.0/path/parse.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/parse.js +24 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/_util.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/_util.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/basename.d.ts +18 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/basename.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/basename.js +9 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/common.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/common.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/constants.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/constants.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/dirname.d.ts +15 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/dirname.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/dirname.js +9 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/extname.d.ts +16 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/extname.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/extname.js +9 -0
- package/esm/deps/deno.land/{std@0.219.1/path/windows → std@0.221.0/path/posix}/format.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/format.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/from_file_url.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/from_file_url.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/glob_to_regexp.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/glob_to_regexp.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1/path/windows → std@0.221.0/path/posix}/is_absolute.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/is_absolute.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/is_glob.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/is_glob.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/join.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/join.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/join.js +1 -1
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/join_globs.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/join_globs.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1/path/windows → std@0.221.0/path/posix}/mod.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/mod.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/normalize.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/normalize.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1/path/windows → std@0.221.0/path/posix}/normalize_glob.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/normalize_glob.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/parse.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/parse.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/relative.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/relative.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/resolve.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/resolve.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/to_file_url.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/to_file_url.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/to_namespaced_path.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/posix/to_namespaced_path.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/relative.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/relative.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/resolve.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/resolve.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/to_file_url.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/to_file_url.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/to_namespaced_path.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/to_namespaced_path.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/_util.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/_util.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/basename.d.ts +18 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/basename.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/basename.js +9 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/common.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/common.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/constants.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/constants.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/dirname.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/dirname.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1/path/posix → std@0.221.0/path/windows}/extname.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/extname.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1/path/posix → std@0.221.0/path/windows}/format.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/format.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/from_file_url.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/from_file_url.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/glob_to_regexp.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/glob_to_regexp.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1/path → std@0.221.0/path/windows}/is_absolute.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/is_absolute.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/is_glob.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/is_glob.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/join.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/join.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/join_globs.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/join_globs.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1/path/posix → std@0.221.0/path/windows}/mod.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/mod.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/normalize.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/normalize.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1/path/posix → std@0.221.0/path/windows}/normalize_glob.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/normalize_glob.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/parse.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/parse.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/relative.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/relative.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/resolve.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/resolve.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/to_file_url.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/to_file_url.d.ts.map +1 -0
- package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/to_namespaced_path.d.ts +1 -0
- package/esm/deps/deno.land/std@0.221.0/path/windows/to_namespaced_path.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/toml/_parser.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/toml/parse.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_error.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_loader/loader.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_loader/loader_state.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_mark.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_state.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_type/binary.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_type/bool.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_type/float.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_type/function.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_type/int.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_type/map.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_type/merge.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_type/mod.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_type/nil.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_type/omap.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_type/pairs.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_type/regexp.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_type/seq.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_type/set.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_type/str.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_type/timestamp.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_type/undefined.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/_utils.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/parse.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/schema/core.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/schema/default.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/schema/extended.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/schema/failsafe.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/schema/json.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/schema/mod.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/schema.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.221.0/yaml/type.d.ts.map +1 -0
- package/esm/deps/deno.land/x/astring@v1.8.6/src/astring.d.ts +110 -0
- package/esm/deps/deno.land/x/astring@v1.8.6/src/astring.d.ts.map +1 -0
- package/esm/deps/deno.land/x/astring@v1.8.6/src/astring.js +1159 -0
- package/esm/deps.d.ts +3 -2
- package/esm/deps.d.ts.map +1 -0
- package/esm/deps.js +2 -2
- package/esm/mod.d.ts +1 -0
- package/esm/mod.d.ts.map +1 -0
- package/esm/plugins/auto_trim.d.ts +1 -0
- package/esm/plugins/auto_trim.d.ts.map +1 -0
- package/esm/plugins/echo.d.ts +1 -0
- package/esm/plugins/echo.d.ts.map +1 -0
- package/esm/plugins/escape.d.ts +1 -0
- package/esm/plugins/escape.d.ts.map +1 -0
- package/esm/plugins/export.d.ts +1 -0
- package/esm/plugins/export.d.ts.map +1 -0
- package/esm/plugins/for.d.ts +1 -0
- package/esm/plugins/for.d.ts.map +1 -0
- package/esm/plugins/function.d.ts +1 -0
- package/esm/plugins/function.d.ts.map +1 -0
- package/esm/plugins/if.d.ts +1 -0
- package/esm/plugins/if.d.ts.map +1 -0
- package/esm/plugins/import.d.ts +1 -0
- package/esm/plugins/import.d.ts.map +1 -0
- package/esm/plugins/include.d.ts +1 -0
- package/esm/plugins/include.d.ts.map +1 -0
- package/esm/plugins/include.js +14 -6
- package/esm/plugins/js.d.ts +1 -0
- package/esm/plugins/js.d.ts.map +1 -0
- package/esm/plugins/layout.d.ts +1 -0
- package/esm/plugins/layout.d.ts.map +1 -0
- package/esm/plugins/set.d.ts +1 -0
- package/esm/plugins/set.d.ts.map +1 -0
- package/esm/plugins/trim.d.ts +1 -0
- package/esm/plugins/trim.d.ts.map +1 -0
- package/esm/plugins/unescape.d.ts +1 -0
- package/esm/plugins/unescape.d.ts.map +1 -0
- package/esm/src/environment.d.ts +55 -0
- package/esm/src/environment.d.ts.map +1 -0
- package/esm/src/environment.js +200 -0
- package/esm/src/js.d.ts +5 -0
- package/esm/src/js.d.ts.map +1 -0
- package/esm/src/js.js +150 -0
- package/esm/src/loader.d.ts +15 -0
- package/esm/src/loader.d.ts.map +1 -0
- package/esm/src/loader.js +19 -0
- package/esm/src/tokenizer.d.ts +14 -0
- package/esm/src/tokenizer.d.ts.map +1 -0
- package/esm/src/tokenizer.js +92 -0
- package/esm/src/transformer.d.ts +2 -0
- package/esm/src/transformer.d.ts.map +1 -0
- package/esm/src/transformer.js +196 -0
- package/esm/test/auto_trim.test.d.ts.map +1 -0
- package/esm/test/comment.test.d.ts.map +1 -0
- package/esm/test/compile.test.d.ts.map +1 -0
- package/esm/test/echo.test.d.ts.map +1 -0
- package/esm/test/escape.test.d.ts.map +1 -0
- package/esm/test/for.test.d.ts.map +1 -0
- package/esm/test/function.test.d.ts.map +1 -0
- package/esm/test/if.test.d.ts.map +1 -0
- package/esm/test/import.test.d.ts.map +1 -0
- package/esm/test/include.test.d.ts.map +1 -0
- package/esm/test/js.test.d.ts.map +1 -0
- package/esm/test/layout.test.d.ts.map +1 -0
- package/esm/test/print.test.d.ts.map +1 -0
- package/esm/test/safe.test.d.ts.map +1 -0
- package/esm/test/set.test.d.ts.map +1 -0
- package/esm/test/tokenizer.test.d.ts.map +1 -0
- package/esm/test/unescape.test.d.ts.map +1 -0
- package/esm/test/utils.d.ts.map +1 -0
- package/package.json +2 -2
- package/esm/deps/deno.land/std@0.219.1/path/basename.d.ts +0 -8
- package/esm/deps/deno.land/std@0.219.1/path/dirname.d.ts +0 -5
- package/esm/deps/deno.land/std@0.219.1/path/parse.d.ts +0 -6
- package/esm/deps/deno.land/std@0.219.1/path/parse.js +0 -12
- package/esm/deps/deno.land/std@0.219.1/path/posix/basename.d.ts +0 -8
- package/esm/deps/deno.land/std@0.219.1/path/windows/basename.d.ts +0 -8
- package/esm/deps/deno.land/std@0.219.1/path/windows/extname.d.ts +0 -6
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/assert/assert.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/assert/assertion_error.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/html/entities.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/html/mod.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/assert_path.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/basename.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/common.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/constants.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/dirname.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/format.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/from_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/glob_to_reg_exp.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/normalize.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/relative.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/strip_trailing_separators.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_common/to_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_interface.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/_os.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/common.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/constants.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/dirname.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/extname.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/from_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/glob_to_regexp.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/is_absolute.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/is_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/join.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/join_globs.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/mod.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/normalize.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/normalize_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/_util.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/common.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/constants.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/format.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/from_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/glob_to_regexp.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/is_absolute.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/is_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/join_globs.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/mod.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/normalize.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/normalize_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/parse.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/relative.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/resolve.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/to_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/posix/to_namespaced_path.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/relative.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/resolve.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/to_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/to_namespaced_path.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/_util.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/common.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/constants.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/dirname.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/extname.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/format.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/from_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/glob_to_regexp.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/is_absolute.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/is_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/join.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/join_globs.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/mod.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/normalize.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/normalize_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/parse.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/relative.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/resolve.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/to_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.219.1 → std@0.221.0}/path/windows/to_namespaced_path.js +0 -0
package/esm/deps.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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.221.0/path/mod.js";
|
|
2
|
+
export * as html from "./deps/deno.land/std@0.221.0/html/mod.js";
|
|
3
3
|
export * as astring from "./deps/deno.land/x/astring@v1.8.6/src/astring.js";
|
|
4
4
|
export * as meriyah from "meriyah";
|
|
5
5
|
export * as walker from "estree-walker";
|
|
6
6
|
export type * as ESTree from "estree";
|
|
7
|
+
//# sourceMappingURL=deps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,0CAA0C,CAAC;AACjE,OAAO,KAAK,IAAI,MAAM,0CAA0C,CAAC;AAEjE,OAAO,KAAK,OAAO,MAAM,kDAAkD,CAAC;AAC5E,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,YAAY,KAAK,MAAM,MAAM,QAAQ,CAAC"}
|
package/esm/deps.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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.221.0/path/mod.js";
|
|
2
|
+
export * as html from "./deps/deno.land/std@0.221.0/html/mod.js";
|
|
3
3
|
export * as astring from "./deps/deno.land/x/astring@v1.8.6/src/astring.js";
|
|
4
4
|
export * as meriyah from "meriyah";
|
|
5
5
|
export * as walker from "estree-walker";
|
package/esm/mod.d.ts
CHANGED
package/esm/mod.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAc,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAerD,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,kBAAkB;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,GAAE,OAAY,eA4B7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto_trim.d.ts","sourceRoot":"","sources":["../../src/plugins/auto_trim.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,eAAO,MAAM,WAAW,UAgBvB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAAE,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEjD,MAAM,CAAC,OAAO,WAAW,OAAO,GAAE,eAAuC,SAC1D,WAAW,UAGzB;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,eAAe,QAgBjE"}
|
package/esm/plugins/echo.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"echo.d.ts","sourceRoot":"","sources":["../../src/plugins/echo.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAGzB"}
|
package/esm/plugins/escape.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../src/plugins/escape.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAKzB"}
|
package/esm/plugins/export.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/plugins/export.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAGzB"}
|
package/esm/plugins/for.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"for.d.ts","sourceRoot":"","sources":["../../src/plugins/for.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAIzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../src/plugins/function.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAGzB"}
|
package/esm/plugins/if.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"if.d.ts","sourceRoot":"","sources":["../../src/plugins/if.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAIzB"}
|
package/esm/plugins/import.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../src/plugins/import.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAGzB"}
|
package/esm/plugins/include.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"include.d.ts","sourceRoot":"","sources":["../../src/plugins/include.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAGzB"}
|
package/esm/plugins/include.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import analyze from "../src/js.js";
|
|
1
2
|
export default function () {
|
|
2
3
|
return (env) => {
|
|
3
4
|
env.tags.push(includeTag);
|
|
@@ -7,15 +8,22 @@ function includeTag(env, code, output, tokens) {
|
|
|
7
8
|
if (!code.startsWith("include ")) {
|
|
8
9
|
return;
|
|
9
10
|
}
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const tagCode = code.substring(7).trim();
|
|
12
|
+
let index = undefined;
|
|
13
|
+
analyze(tagCode, (type, i) => {
|
|
14
|
+
if (type === "open-bracket") {
|
|
15
|
+
index = i - 1;
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const file = index === undefined
|
|
20
|
+
? tagCode.trim()
|
|
21
|
+
: tagCode.slice(0, index).trim();
|
|
22
|
+
const data = index === undefined ? "" : tagCode.slice(index).trim();
|
|
15
23
|
const { dataVarname } = env.options;
|
|
16
24
|
return `{
|
|
17
25
|
const __tmp = await __env.run(${file},
|
|
18
|
-
{...${dataVarname}${data ? `,
|
|
26
|
+
{...${dataVarname}${data ? `, ...${data}` : ""}},
|
|
19
27
|
__file
|
|
20
28
|
);
|
|
21
29
|
${output} += ${env.compileFilters(tokens, "__tmp.content")};
|
package/esm/plugins/js.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js.d.ts","sourceRoot":"","sources":["../../src/plugins/js.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAGzB"}
|
package/esm/plugins/layout.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/plugins/layout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAGzB"}
|
package/esm/plugins/set.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../src/plugins/set.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAGzB"}
|
package/esm/plugins/trim.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trim.d.ts","sourceRoot":"","sources":["../../src/plugins/trim.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAGzB;AAED,wBAAgB,IAAI,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,QA0BnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unescape.d.ts","sourceRoot":"","sources":["../../src/plugins/unescape.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,oBACC,WAAW,UAKzB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
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 TokenPreprocessor = (env: Environment, tokens: Token[], path?: string) => Token[] | void;
|
|
20
|
+
export type Tag = (env: Environment, code: string, output: string, tokens: Token[]) => string | undefined;
|
|
21
|
+
export type FilterThis = {
|
|
22
|
+
data: Record<string, unknown>;
|
|
23
|
+
env: Environment;
|
|
24
|
+
};
|
|
25
|
+
export type Filter = (this: FilterThis, ...args: any[]) => any;
|
|
26
|
+
export type Plugin = (env: Environment) => void;
|
|
27
|
+
export interface Options {
|
|
28
|
+
loader: Loader;
|
|
29
|
+
dataVarname: string;
|
|
30
|
+
autoescape: boolean;
|
|
31
|
+
useWith: boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare class Environment {
|
|
34
|
+
cache: Map<string, Template>;
|
|
35
|
+
options: Options;
|
|
36
|
+
tags: Tag[];
|
|
37
|
+
tokenPreprocessors: TokenPreprocessor[];
|
|
38
|
+
filters: Record<string, Filter>;
|
|
39
|
+
utils: Record<string, unknown>;
|
|
40
|
+
constructor(options: Options);
|
|
41
|
+
use(plugin: Plugin): void;
|
|
42
|
+
run(file: string, data: Record<string, unknown>, from?: string): Promise<TemplateResult>;
|
|
43
|
+
runString(source: string, data?: Record<string, unknown>, file?: string): Promise<TemplateResult>;
|
|
44
|
+
runStringSync(source: string, data?: Record<string, unknown>): TemplateResult;
|
|
45
|
+
compile(source: string, path?: string, defaults?: Record<string, unknown>, sync?: false): Template;
|
|
46
|
+
compile(source: string, path?: string, defaults?: Record<string, unknown>, sync?: true): TemplateSync;
|
|
47
|
+
tokenize(source: string, path?: string): Token[];
|
|
48
|
+
load(file: string, from?: string): Promise<Template>;
|
|
49
|
+
compileTokens(tokens: Token[], outputVar?: string, stopAt?: string[]): string[];
|
|
50
|
+
compileFilters(tokens: Token[], output: string, autoescape?: boolean): string;
|
|
51
|
+
createError(path: string, source: string, position: number, cause: Error): Error;
|
|
52
|
+
}
|
|
53
|
+
/** Returns the number and code of the errored line */
|
|
54
|
+
export declare function errorLine(source: string, pos: number): [number, number, string];
|
|
55
|
+
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/src/environment.ts"],"names":[],"mappings":"AACA,OAAiB,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1C,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,QAAQ;IACvB,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,iBAAiB,GAAG,CAC9B,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,KAAK,EAAE,EACf,IAAI,CAAC,EAAE,MAAM,KACV,KAAK,EAAE,GAAG,IAAI,CAAC;AAEpB,MAAM,MAAM,GAAG,GAAG,CAChB,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,EAAE,KACZ,MAAM,GAAG,SAAS,CAAC;AAExB,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,GAAG,EAAE,WAAW,CAAC;CAClB,CAAC;AAGF,MAAM,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAE/D,MAAM,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,CAAC;AAEhD,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,qBAAa,WAAW;IACtB,KAAK,wBAA+B;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,GAAG,EAAE,CAAM;IACjB,kBAAkB,EAAE,iBAAiB,EAAE,CAAM;IAC7C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;IACrC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM;gBAExB,OAAO,EAAE,OAAO;IAI5B,GAAG,CAAC,MAAM,EAAE,MAAM;IAIZ,GAAG,CACP,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,cAAc,CAAC;IAKpB,SAAS,CACb,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,cAAc,CAAC;IAkB1B,aAAa,CACX,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,cAAc;IAKjB,OAAO,CACL,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,IAAI,CAAC,EAAE,KAAK,GACX,QAAQ;IACX,OAAO,CACL,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,IAAI,CAAC,EAAE,IAAI,GACV,YAAY;IA0Cf,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE;IAoB1C,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAkB1D,aAAa,CACX,MAAM,EAAE,KAAK,EAAE,EACf,SAAS,SAAsB,EAC/B,MAAM,CAAC,EAAE,MAAM,EAAE,GAChB,MAAM,EAAE;IAiDX,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,UAAQ,GAAG,MAAM;IA+C3E,WAAW,CACT,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,KAAK,GACX,KAAK;CAYT;AAeD,sDAAsD;AACtD,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,GACV,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAqB1B"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import * as dntShim from "../_dnt.shims.js";
|
|
2
|
+
import tokenize from "./tokenizer.js";
|
|
3
|
+
import { transformTemplateCode } from "./transformer.js";
|
|
4
|
+
export class Environment {
|
|
5
|
+
cache = new Map();
|
|
6
|
+
options;
|
|
7
|
+
tags = [];
|
|
8
|
+
tokenPreprocessors = [];
|
|
9
|
+
filters = {};
|
|
10
|
+
utils = {};
|
|
11
|
+
constructor(options) {
|
|
12
|
+
this.options = options;
|
|
13
|
+
}
|
|
14
|
+
use(plugin) {
|
|
15
|
+
plugin(this);
|
|
16
|
+
}
|
|
17
|
+
async run(file, data, from) {
|
|
18
|
+
const template = await this.load(file, from);
|
|
19
|
+
return await template(data);
|
|
20
|
+
}
|
|
21
|
+
async runString(source, data, file) {
|
|
22
|
+
if (file) {
|
|
23
|
+
const cached = this.cache.get(file);
|
|
24
|
+
if (cached) {
|
|
25
|
+
return await cached(data);
|
|
26
|
+
}
|
|
27
|
+
const template = this.compile(source, file);
|
|
28
|
+
this.cache.set(file, template);
|
|
29
|
+
return await template(data);
|
|
30
|
+
}
|
|
31
|
+
const template = this.compile(source, file);
|
|
32
|
+
return await template(data);
|
|
33
|
+
}
|
|
34
|
+
runStringSync(source, data) {
|
|
35
|
+
const template = this.compile(source, "", {}, true);
|
|
36
|
+
return template(data);
|
|
37
|
+
}
|
|
38
|
+
compile(source, path, defaults, sync = false) {
|
|
39
|
+
const tokens = this.tokenize(source, path);
|
|
40
|
+
let code = this.compileTokens(tokens).join("\n");
|
|
41
|
+
const { dataVarname, useWith } = this.options;
|
|
42
|
+
if (useWith) {
|
|
43
|
+
code = transformTemplateCode(code, dataVarname);
|
|
44
|
+
}
|
|
45
|
+
const constructor = new Function("__file", "__env", "__defaults", `return${sync ? "" : " async"} function (${dataVarname}) {
|
|
46
|
+
let __pos = 0;
|
|
47
|
+
try {
|
|
48
|
+
${dataVarname} = Object.assign({}, __defaults, ${dataVarname});
|
|
49
|
+
const __exports = { content: "" };
|
|
50
|
+
${code}
|
|
51
|
+
return __exports;
|
|
52
|
+
} catch (cause) {
|
|
53
|
+
const template = __env.cache.get(__file);
|
|
54
|
+
throw __env.createError(__file, template?.source || "", __pos, cause);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`);
|
|
58
|
+
const template = constructor(path, this, defaults);
|
|
59
|
+
template.file = path;
|
|
60
|
+
template.code = code;
|
|
61
|
+
template.source = source;
|
|
62
|
+
return template;
|
|
63
|
+
}
|
|
64
|
+
tokenize(source, path) {
|
|
65
|
+
const result = tokenize(source);
|
|
66
|
+
let { tokens } = result;
|
|
67
|
+
const { position, error } = result;
|
|
68
|
+
if (error) {
|
|
69
|
+
throw this.createError(path || "unknown", source, position, error);
|
|
70
|
+
}
|
|
71
|
+
for (const tokenPreprocessor of this.tokenPreprocessors) {
|
|
72
|
+
const result = tokenPreprocessor(this, tokens, path);
|
|
73
|
+
if (result !== undefined) {
|
|
74
|
+
tokens = result;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return tokens;
|
|
78
|
+
}
|
|
79
|
+
async load(file, from) {
|
|
80
|
+
const path = from ? this.options.loader.resolve(from, file) : file;
|
|
81
|
+
if (!this.cache.has(path)) {
|
|
82
|
+
// Remove query and hash params from path before loading
|
|
83
|
+
const cleanPath = path
|
|
84
|
+
.split("?")[0]
|
|
85
|
+
.split("#")[0];
|
|
86
|
+
const { source, data } = await this.options.loader.load(cleanPath);
|
|
87
|
+
const template = this.compile(source, path, data);
|
|
88
|
+
this.cache.set(path, template);
|
|
89
|
+
}
|
|
90
|
+
return this.cache.get(path);
|
|
91
|
+
}
|
|
92
|
+
compileTokens(tokens, outputVar = "__exports.content", stopAt) {
|
|
93
|
+
const compiled = [];
|
|
94
|
+
tokens: while (tokens.length > 0) {
|
|
95
|
+
if (stopAt && tokens[0][0] === "tag" && stopAt.includes(tokens[0][1])) {
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
const [type, code, pos] = tokens.shift();
|
|
99
|
+
if (type === "comment") {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
if (type === "string") {
|
|
103
|
+
if (code !== "") {
|
|
104
|
+
compiled.push(`${outputVar} += ${JSON.stringify(code)};`);
|
|
105
|
+
}
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
if (type === "tag") {
|
|
109
|
+
compiled.push(`__pos = ${pos};`);
|
|
110
|
+
for (const tag of this.tags) {
|
|
111
|
+
const compiledTag = tag(this, code, outputVar, tokens);
|
|
112
|
+
if (typeof compiledTag === "string") {
|
|
113
|
+
compiled.push(compiledTag);
|
|
114
|
+
continue tokens;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// Unknown tag, just print it
|
|
118
|
+
const expression = this.compileFilters(tokens, code, this.options.autoescape);
|
|
119
|
+
compiled.push(`${outputVar} += (${expression}) ?? "";`);
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
throw new Error(`Unknown token type "${type}"`);
|
|
123
|
+
}
|
|
124
|
+
return compiled;
|
|
125
|
+
}
|
|
126
|
+
compileFilters(tokens, output, autoescape = false) {
|
|
127
|
+
let unescaped = false;
|
|
128
|
+
while (tokens.length > 0 && tokens[0][0] === "filter") {
|
|
129
|
+
const [, code] = tokens.shift();
|
|
130
|
+
const match = code.match(/^(await\s+)?([\w.]+)(?:\((.*)\))?$/);
|
|
131
|
+
if (!match) {
|
|
132
|
+
throw new Error(`Invalid filter: ${code}`);
|
|
133
|
+
}
|
|
134
|
+
const [_, isAsync, name, args] = match;
|
|
135
|
+
if (!this.filters[name]) {
|
|
136
|
+
if (name === "safe") {
|
|
137
|
+
unescaped = true;
|
|
138
|
+
}
|
|
139
|
+
else if (isGlobal(name)) {
|
|
140
|
+
// If a global function
|
|
141
|
+
output = `${isAsync ? "await " : ""}${name}(${output}${args ? `, ${args}` : ""})`;
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
// It's a prototype's method (e.g. `String.toUpperCase()`)
|
|
145
|
+
output = `${isAsync ? "await " : ""}(${output})?.${name}?.(${args ? args : ""})`;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
// It's a filter (e.g. filters.upper())
|
|
150
|
+
const { dataVarname } = this.options;
|
|
151
|
+
output = `${(isAsync || checkAsync(this.filters[name])) ? "await " : ""}__env.filters.${name}.call({data:${dataVarname},env:__env}, ${output}${args ? `, ${args}` : ""})`;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// Escape by default
|
|
155
|
+
if (autoescape && !unescaped) {
|
|
156
|
+
output = `__env.filters.escape(${output})`;
|
|
157
|
+
}
|
|
158
|
+
return output;
|
|
159
|
+
}
|
|
160
|
+
createError(path, source, position, cause) {
|
|
161
|
+
if (!source) {
|
|
162
|
+
return cause;
|
|
163
|
+
}
|
|
164
|
+
const [line, column, code] = errorLine(source, position);
|
|
165
|
+
return new Error(`Error in the template ${path}:${line}:${column}\n\n${code.trim()}\n\n> ${cause.message}\n`, { cause });
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function isGlobal(name) {
|
|
169
|
+
// @ts-ignore TS doesn't know about globalThis
|
|
170
|
+
if (dntShim.dntGlobalThis[name]) {
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
173
|
+
if (name.includes(".")) {
|
|
174
|
+
const [obj, prop] = name.split(".");
|
|
175
|
+
// @ts-ignore TS doesn't know about globalThis
|
|
176
|
+
return typeof dntShim.dntGlobalThis[obj]?.[prop] === "function";
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/** Returns the number and code of the errored line */
|
|
180
|
+
export function errorLine(source, pos) {
|
|
181
|
+
let line = 1;
|
|
182
|
+
let column = 1;
|
|
183
|
+
for (let index = 0; index < pos; index++) {
|
|
184
|
+
if (source[index] === "\n" ||
|
|
185
|
+
(source[index] === "\r" && source[index + 1] === "\n")) {
|
|
186
|
+
line++;
|
|
187
|
+
column = 1;
|
|
188
|
+
if (source[index] === "\r") {
|
|
189
|
+
index++;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
column++;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return [line, column, source.split("\n")[line - 1]];
|
|
197
|
+
}
|
|
198
|
+
function checkAsync(fn) {
|
|
199
|
+
return fn.constructor?.name === "AsyncFunction";
|
|
200
|
+
}
|
package/esm/src/js.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js.d.ts","sourceRoot":"","sources":["../../src/src/js.ts"],"names":[],"mappings":"AAAA,KAAK,WAAW,GACZ,YAAY,GACZ,cAAc,GACd,OAAO,GACP,UAAU,CAAC;AAWf,KAAK,OAAO,GAAG,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,KAAK,KAAK,GAAG,IAAI,CAAC;AAElE,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,QAuK/D"}
|
package/esm/src/js.js
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
export default function analyze(source, visitor) {
|
|
2
|
+
const length = source.length;
|
|
3
|
+
const statuses = [];
|
|
4
|
+
let index = 0;
|
|
5
|
+
while (index < length) {
|
|
6
|
+
const char = source.charAt(index++);
|
|
7
|
+
switch (char) {
|
|
8
|
+
// Detect start brackets
|
|
9
|
+
case "{": {
|
|
10
|
+
const status = statuses[0];
|
|
11
|
+
if (status === "literal" && source.charAt(index - 2) === "$") {
|
|
12
|
+
statuses.unshift("bracket");
|
|
13
|
+
}
|
|
14
|
+
else if (status !== "comment" && status !== "single-quote" &&
|
|
15
|
+
status !== "double-quote" && status !== "literal" &&
|
|
16
|
+
status !== "regex" && status !== "line-comment") {
|
|
17
|
+
if (statuses.length === 0 && visitor("open-bracket", index) === false) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
statuses.unshift("bracket");
|
|
21
|
+
}
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
// Detect end brackets
|
|
25
|
+
case "}": {
|
|
26
|
+
const status = statuses[0];
|
|
27
|
+
if (status === "bracket") {
|
|
28
|
+
statuses.shift();
|
|
29
|
+
if (statuses.length === 0 && visitor("close", index) === false) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
// Detect double quotes
|
|
36
|
+
case '"': {
|
|
37
|
+
const status = statuses[0];
|
|
38
|
+
if (status === "double-quote") {
|
|
39
|
+
statuses.shift();
|
|
40
|
+
}
|
|
41
|
+
else if (status !== "comment" &&
|
|
42
|
+
status !== "single-quote" &&
|
|
43
|
+
status !== "literal" &&
|
|
44
|
+
status !== "regex" &&
|
|
45
|
+
status !== "line-comment") {
|
|
46
|
+
statuses.unshift("double-quote");
|
|
47
|
+
}
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
// Detect single quotes
|
|
51
|
+
case "'": {
|
|
52
|
+
const status = statuses[0];
|
|
53
|
+
if (status === "single-quote") {
|
|
54
|
+
statuses.shift();
|
|
55
|
+
}
|
|
56
|
+
else if (status !== "comment" &&
|
|
57
|
+
status !== "double-quote" &&
|
|
58
|
+
status !== "literal" &&
|
|
59
|
+
status !== "regex" &&
|
|
60
|
+
status !== "line-comment") {
|
|
61
|
+
statuses.unshift("single-quote");
|
|
62
|
+
}
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
// Detect literals
|
|
66
|
+
case "`": {
|
|
67
|
+
const status = statuses[0];
|
|
68
|
+
if (status === "literal") {
|
|
69
|
+
statuses.shift();
|
|
70
|
+
}
|
|
71
|
+
else if (status !== "comment" &&
|
|
72
|
+
status !== "double-quote" &&
|
|
73
|
+
status !== "single-quote" &&
|
|
74
|
+
status !== "regex" &&
|
|
75
|
+
status !== "line-comment") {
|
|
76
|
+
statuses.unshift("literal");
|
|
77
|
+
}
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
// Detect comments and regex
|
|
81
|
+
case "/": {
|
|
82
|
+
const status = statuses[0];
|
|
83
|
+
if (status === "single-quote" || status === "double-quote" ||
|
|
84
|
+
status === "literal" || status === "line-comment") {
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
// We are in a comment: close or ignore
|
|
88
|
+
if (status === "comment") {
|
|
89
|
+
if (source.charAt(index - 2) === "*") {
|
|
90
|
+
statuses.shift();
|
|
91
|
+
}
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
// We are in a regex: close or ignore
|
|
95
|
+
if (status === "regex") {
|
|
96
|
+
if (source.charAt(index - 2) !== "\\") {
|
|
97
|
+
statuses.shift();
|
|
98
|
+
}
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
// Start a new comment
|
|
102
|
+
if (source.charAt(index) === "*") {
|
|
103
|
+
statuses.unshift("comment");
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
// Start a new line comment
|
|
107
|
+
if (source.charAt(index - 2) === "/") {
|
|
108
|
+
statuses.unshift("line-comment");
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
// Start a new regex
|
|
112
|
+
const prev = prevChar(source, index - 1);
|
|
113
|
+
if (prev === "(" || prev === "=" || prev === ":" || prev === ",") {
|
|
114
|
+
statuses.unshift("regex");
|
|
115
|
+
}
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
// Detect end of line comments
|
|
119
|
+
case "\n": {
|
|
120
|
+
const status = statuses[0];
|
|
121
|
+
if (status === "line-comment") {
|
|
122
|
+
statuses.shift();
|
|
123
|
+
}
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
// Detect filters
|
|
127
|
+
case "|": {
|
|
128
|
+
const status = statuses[0];
|
|
129
|
+
if (status === "bracket" && source.charAt(index) === ">" &&
|
|
130
|
+
visitor("new-filter", index + 1) === false) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (statuses.length > 0) {
|
|
138
|
+
visitor("unclosed", index);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
// Get the previous character in a string ignoring spaces, line breaks and tabs
|
|
142
|
+
function prevChar(source, index) {
|
|
143
|
+
while (index > 0) {
|
|
144
|
+
const char = source.charAt(--index);
|
|
145
|
+
if (char !== " " && char !== "\n" && char !== "\r" && char !== "\t") {
|
|
146
|
+
return char;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return "";
|
|
150
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
}
|
|
15
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/src/loader.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,MAAM;IACrB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC7D,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7C;AAED,qBAAa,UAAW,YAAW,MAAM;;gBAG3B,IAAI,EAAE,MAAM;IAIlB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAMjD,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;CAO5C"}
|