ventojs 1.14.0 → 2.0.0-canary.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/CHANGELOG.md +24 -0
- package/README.md +2 -0
- package/browser.js +19 -0
- package/{esm/src → core}/environment.js +30 -32
- package/{esm/src → core}/errors.js +0 -7
- package/core/js.js +191 -0
- package/core/reserved.js +63 -0
- package/core/tokenizer.js +86 -0
- package/highlightjs-vento.js +24 -0
- package/{esm/src/loader.node.js → loaders/file.js} +5 -2
- package/loaders/memory.js +24 -0
- package/loaders/url.js +28 -0
- package/{esm/bare.js → mod.js} +7 -2
- package/package.json +167 -29
- package/{esm/plugins → plugins}/auto_trim.js +0 -1
- package/plugins/echo.js +31 -0
- package/plugins/escape.js +17 -0
- package/plugins/export.js +68 -0
- package/{esm/plugins → plugins}/for.js +6 -10
- package/plugins/import.js +58 -0
- package/plugins/include.js +35 -0
- package/plugins/mod.js +30 -0
- package/{esm/plugins → plugins}/set.js +4 -3
- package/plugins/unescape.js +25 -0
- package/prism-vento.js +26 -0
- package/types/browser.d.ts +8 -0
- package/{esm/src → types/core}/environment.d.ts +4 -6
- package/{esm/src → types/core}/errors.d.ts +0 -5
- package/types/core/js.d.ts +11 -0
- package/types/core/reserved.d.ts +2 -0
- package/{esm/src → types/core}/tokenizer.d.ts +1 -8
- package/{esm/src/loader.node.d.ts → types/loaders/file.d.ts} +5 -4
- package/types/loaders/memory.d.ts +11 -0
- package/types/loaders/url.d.ts +11 -0
- package/{esm/bare.d.ts → types/mod.d.ts} +1 -3
- package/{esm → types}/plugins/auto_trim.d.ts +2 -4
- package/types/plugins/echo.d.ts +2 -0
- package/types/plugins/escape.d.ts +2 -0
- package/types/plugins/export.d.ts +2 -0
- package/types/plugins/for.d.ts +2 -0
- package/types/plugins/function.d.ts +2 -0
- package/types/plugins/if.d.ts +2 -0
- package/types/plugins/import.d.ts +2 -0
- package/types/plugins/include.d.ts +2 -0
- package/types/plugins/js.d.ts +2 -0
- package/types/plugins/layout.d.ts +2 -0
- package/types/plugins/mod.d.ts +2 -0
- package/types/plugins/set.d.ts +2 -0
- package/types/plugins/trim.d.ts +4 -0
- package/types/plugins/unescape.d.ts +2 -0
- package/esm/_dnt.polyfills.d.ts +0 -12
- package/esm/_dnt.polyfills.d.ts.map +0 -1
- package/esm/_dnt.polyfills.js +0 -15
- package/esm/_dnt.shims.d.ts +0 -2
- package/esm/_dnt.shims.d.ts.map +0 -1
- package/esm/_dnt.shims.js +0 -57
- package/esm/_dnt.test_polyfills.d.ts.map +0 -1
- package/esm/_dnt.test_shims.d.ts.map +0 -1
- package/esm/bare.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/assert/_constants.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/assert/assert_equals.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/assert/assert_is_error.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/assert/assert_throws.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/assert/assertion_error.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/assert/equal.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/collections/_utils.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/collections/deep_merge.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/fmt/colors.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/front_matter/_formats.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/front_matter/create_extractor.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/front_matter/json.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/front_matter/mod.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/front_matter/test.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/front_matter/toml.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/front_matter/yaml.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/internal/diff.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/internal/format.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/internal/mod.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/toml/_parser.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/toml/parse.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_error.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_loader/loader.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_loader/loader_state.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_mark.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_state.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_type/binary.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_type/bool.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_type/float.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_type/function.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_type/int.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_type/map.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_type/merge.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_type/mod.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_type/nil.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_type/omap.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_type/pairs.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_type/regexp.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_type/seq.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_type/set.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_type/str.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_type/timestamp.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_type/undefined.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/_utils.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/parse.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/schema/core.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/schema/default.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/schema/extended.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/schema/failsafe.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/schema/json.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/schema/mod.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/schema.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.224.0/yaml/type.d.ts.map +0 -1
- package/esm/deps/jsr.io/@davidbonnet/astring/1.8.6/src/astring.d.ts +0 -110
- package/esm/deps/jsr.io/@davidbonnet/astring/1.8.6/src/astring.d.ts.map +0 -1
- package/esm/deps/jsr.io/@davidbonnet/astring/1.8.6/src/astring.js +0 -1159
- package/esm/deps/jsr.io/@std/html/1.0.3/entities.d.ts +0 -57
- package/esm/deps/jsr.io/@std/html/1.0.3/entities.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/html/1.0.3/entities.js +0 -92
- package/esm/deps/jsr.io/@std/html/1.0.3/mod.d.ts +0 -15
- package/esm/deps/jsr.io/@std/html/1.0.3/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/html/1.0.3/mod.js +0 -16
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/assert_path.d.ts +0 -2
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/assert_path.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/assert_path.js +0 -7
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/basename.d.ts +0 -4
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/basename.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/basename.js +0 -40
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/common.d.ts +0 -2
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/common.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/common.js +0 -23
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/constants.d.ts +0 -40
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/constants.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/constants.js +0 -46
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/dirname.d.ts +0 -2
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/dirname.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/dirname.js +0 -8
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/format.d.ts +0 -4
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/format.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/format.js +0 -19
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/from_file_url.d.ts +0 -3
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/from_file_url.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/from_file_url.js +0 -9
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/glob_to_reg_exp.d.ts +0 -35
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/glob_to_reg_exp.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/glob_to_reg_exp.js +0 -234
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/normalize.d.ts +0 -2
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/normalize.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/normalize.js +0 -8
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/normalize_string.d.ts +0 -2
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/normalize_string.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/normalize_string.js +0 -77
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/relative.d.ts +0 -2
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/relative.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/relative.js +0 -9
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/strip_trailing_separators.d.ts +0 -2
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/strip_trailing_separators.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/strip_trailing_separators.js +0 -19
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/to_file_url.d.ts +0 -2
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/to_file_url.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/to_file_url.js +0 -15
- package/esm/deps/jsr.io/@std/path/1.0.8/_os.d.ts +0 -2
- package/esm/deps/jsr.io/@std/path/1.0.8/_os.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_os.js +0 -9
- package/esm/deps/jsr.io/@std/path/1.0.8/basename.d.ts +0 -28
- package/esm/deps/jsr.io/@std/path/1.0.8/basename.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/basename.js +0 -36
- package/esm/deps/jsr.io/@std/path/1.0.8/common.d.ts +0 -28
- package/esm/deps/jsr.io/@std/path/1.0.8/common.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/common.js +0 -33
- package/esm/deps/jsr.io/@std/path/1.0.8/constants.d.ts +0 -15
- package/esm/deps/jsr.io/@std/path/1.0.8/constants.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/constants.js +0 -17
- package/esm/deps/jsr.io/@std/path/1.0.8/dirname.d.ts +0 -23
- package/esm/deps/jsr.io/@std/path/1.0.8/dirname.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/dirname.js +0 -29
- package/esm/deps/jsr.io/@std/path/1.0.8/extname.d.ts +0 -23
- package/esm/deps/jsr.io/@std/path/1.0.8/extname.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/extname.js +0 -29
- package/esm/deps/jsr.io/@std/path/1.0.8/format.d.ts +0 -22
- package/esm/deps/jsr.io/@std/path/1.0.8/format.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/format.js +0 -27
- package/esm/deps/jsr.io/@std/path/1.0.8/from_file_url.d.ts +0 -23
- package/esm/deps/jsr.io/@std/path/1.0.8/from_file_url.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/from_file_url.js +0 -28
- package/esm/deps/jsr.io/@std/path/1.0.8/glob_to_regexp.d.ts +0 -77
- package/esm/deps/jsr.io/@std/path/1.0.8/glob_to_regexp.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/glob_to_regexp.js +0 -83
- package/esm/deps/jsr.io/@std/path/1.0.8/is_absolute.d.ts +0 -22
- package/esm/deps/jsr.io/@std/path/1.0.8/is_absolute.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/is_absolute.js +0 -28
- package/esm/deps/jsr.io/@std/path/1.0.8/is_glob.d.ts +0 -17
- package/esm/deps/jsr.io/@std/path/1.0.8/is_glob.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/is_glob.js +0 -42
- package/esm/deps/jsr.io/@std/path/1.0.8/join.d.ts +0 -23
- package/esm/deps/jsr.io/@std/path/1.0.8/join.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/join.js +0 -29
- package/esm/deps/jsr.io/@std/path/1.0.8/join_globs.d.ts +0 -28
- package/esm/deps/jsr.io/@std/path/1.0.8/join_globs.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/join_globs.js +0 -34
- package/esm/deps/jsr.io/@std/path/1.0.8/mod.d.ts +0 -54
- package/esm/deps/jsr.io/@std/path/1.0.8/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/mod.js +0 -57
- package/esm/deps/jsr.io/@std/path/1.0.8/normalize.d.ts +0 -27
- package/esm/deps/jsr.io/@std/path/1.0.8/normalize.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/normalize.js +0 -33
- package/esm/deps/jsr.io/@std/path/1.0.8/normalize_glob.d.ts +0 -29
- package/esm/deps/jsr.io/@std/path/1.0.8/normalize_glob.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/normalize_glob.js +0 -35
- package/esm/deps/jsr.io/@std/path/1.0.8/parse.d.ts +0 -35
- package/esm/deps/jsr.io/@std/path/1.0.8/parse.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/parse.js +0 -39
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/_util.d.ts +0 -2
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/_util.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/_util.js +0 -8
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/basename.d.ts +0 -40
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/basename.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/basename.js +0 -49
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/common.d.ts +0 -19
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/common.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/common.js +0 -24
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/constants.d.ts +0 -13
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/constants.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/constants.js +0 -14
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/dirname.d.ts +0 -32
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/dirname.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/dirname.js +0 -62
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/extname.d.ts +0 -37
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/extname.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/extname.js +0 -89
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/format.d.ts +0 -24
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/format.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/format.js +0 -28
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/from_file_url.d.ts +0 -17
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/from_file_url.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/from_file_url.js +0 -21
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/glob_to_regexp.d.ts +0 -72
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/glob_to_regexp.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/glob_to_regexp.js +0 -82
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/is_absolute.d.ts +0 -17
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/is_absolute.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/is_absolute.js +0 -23
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/is_glob.d.ts +0 -2
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/is_glob.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/is_glob.js +0 -3
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/join.d.ts +0 -33
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/join.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/join.js +0 -42
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/join_globs.d.ts +0 -20
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/join_globs.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/join_globs.js +0 -40
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/mod.d.ts +0 -40
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/mod.js +0 -43
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/normalize.d.ts +0 -40
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/normalize.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/normalize.js +0 -57
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/normalize_glob.d.ts +0 -20
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/normalize_glob.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/normalize_glob.js +0 -32
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/parse.d.ts +0 -25
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/parse.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/parse.js +0 -115
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/relative.d.ts +0 -20
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/relative.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/relative.js +0 -106
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/resolve.d.ts +0 -17
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/resolve.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/resolve.js +0 -59
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/to_file_url.d.ts +0 -18
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/to_file_url.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/to_file_url.js +0 -27
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/to_namespaced_path.d.ts +0 -16
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/to_namespaced_path.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/to_namespaced_path.js +0 -20
- package/esm/deps/jsr.io/@std/path/1.0.8/relative.d.ts +0 -24
- package/esm/deps/jsr.io/@std/path/1.0.8/relative.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/relative.js +0 -30
- package/esm/deps/jsr.io/@std/path/1.0.8/resolve.d.ts +0 -22
- package/esm/deps/jsr.io/@std/path/1.0.8/resolve.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/resolve.js +0 -30
- package/esm/deps/jsr.io/@std/path/1.0.8/to_file_url.d.ts +0 -23
- package/esm/deps/jsr.io/@std/path/1.0.8/to_file_url.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/to_file_url.js +0 -28
- package/esm/deps/jsr.io/@std/path/1.0.8/to_namespaced_path.d.ts +0 -21
- package/esm/deps/jsr.io/@std/path/1.0.8/to_namespaced_path.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/to_namespaced_path.js +0 -29
- package/esm/deps/jsr.io/@std/path/1.0.8/types.d.ts +0 -38
- package/esm/deps/jsr.io/@std/path/1.0.8/types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/types.js +0 -3
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/_util.d.ts +0 -4
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/_util.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/_util.js +0 -15
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/basename.d.ts +0 -23
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/basename.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/basename.js +0 -44
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/constants.d.ts +0 -13
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/constants.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/constants.js +0 -14
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/dirname.d.ts +0 -20
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/dirname.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/dirname.js +0 -112
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/extname.d.ts +0 -20
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/extname.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/extname.js +0 -81
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/format.d.ts +0 -24
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/format.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/format.js +0 -28
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/from_file_url.d.ts +0 -19
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/from_file_url.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/from_file_url.js +0 -30
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/glob_to_regexp.d.ts +0 -71
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/glob_to_regexp.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/glob_to_regexp.js +0 -82
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/is_absolute.d.ts +0 -17
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/is_absolute.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/is_absolute.js +0 -38
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/join.d.ts +0 -20
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/join.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/join.js +0 -74
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/join_globs.d.ts +0 -21
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/join_globs.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/join_globs.js +0 -41
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/normalize.d.ts +0 -22
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/normalize.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/normalize.js +0 -134
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/normalize_glob.d.ts +0 -20
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/normalize_glob.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/normalize_glob.js +0 -32
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/parse.d.ts +0 -25
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/parse.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/parse.js +0 -176
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/relative.d.ts +0 -23
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/relative.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/relative.js +0 -131
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/resolve.d.ts +0 -17
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/resolve.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/resolve.js +0 -154
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/to_file_url.d.ts +0 -18
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/to_file_url.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/to_file_url.js +0 -34
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/to_namespaced_path.d.ts +0 -17
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/to_namespaced_path.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/to_namespaced_path.js +0 -49
- package/esm/deps.d.ts +0 -8
- package/esm/deps.d.ts.map +0 -1
- package/esm/deps.js +0 -6
- package/esm/mod.d.ts +0 -9
- package/esm/mod.d.ts.map +0 -1
- package/esm/mod.js +0 -36
- package/esm/package.json +0 -3
- package/esm/plugins/auto_trim.d.ts.map +0 -1
- package/esm/plugins/echo.d.ts +0 -3
- package/esm/plugins/echo.d.ts.map +0 -1
- package/esm/plugins/echo.js +0 -13
- package/esm/plugins/escape.d.ts +0 -3
- package/esm/plugins/escape.d.ts.map +0 -1
- package/esm/plugins/escape.js +0 -7
- package/esm/plugins/export.d.ts +0 -3
- package/esm/plugins/export.d.ts.map +0 -1
- package/esm/plugins/export.js +0 -47
- package/esm/plugins/for.d.ts +0 -3
- package/esm/plugins/for.d.ts.map +0 -1
- package/esm/plugins/function.d.ts +0 -3
- package/esm/plugins/function.d.ts.map +0 -1
- package/esm/plugins/if.d.ts +0 -3
- package/esm/plugins/if.d.ts.map +0 -1
- package/esm/plugins/import.d.ts +0 -3
- package/esm/plugins/import.d.ts.map +0 -1
- package/esm/plugins/import.js +0 -17
- package/esm/plugins/include.d.ts +0 -3
- package/esm/plugins/include.d.ts.map +0 -1
- package/esm/plugins/include.js +0 -31
- package/esm/plugins/js.d.ts +0 -3
- package/esm/plugins/js.d.ts.map +0 -1
- package/esm/plugins/layout.d.ts +0 -3
- package/esm/plugins/layout.d.ts.map +0 -1
- package/esm/plugins/set.d.ts +0 -3
- package/esm/plugins/set.d.ts.map +0 -1
- package/esm/plugins/trim.d.ts +0 -5
- package/esm/plugins/trim.d.ts.map +0 -1
- package/esm/plugins/unescape.d.ts +0 -3
- package/esm/plugins/unescape.d.ts.map +0 -1
- package/esm/plugins/unescape.js +0 -7
- package/esm/src/environment.d.ts.map +0 -1
- package/esm/src/errors.d.ts.map +0 -1
- package/esm/src/js.d.ts +0 -5
- package/esm/src/js.d.ts.map +0 -1
- package/esm/src/js.js +0 -197
- package/esm/src/loader.node.d.ts.map +0 -1
- package/esm/src/tokenizer.d.ts.map +0 -1
- package/esm/src/tokenizer.js +0 -93
- package/esm/src/transformer.d.ts +0 -2
- package/esm/src/transformer.d.ts.map +0 -1
- package/esm/src/transformer.js +0 -218
- package/esm/test/auto_trim.test.d.ts.map +0 -1
- package/esm/test/comment.test.d.ts.map +0 -1
- package/esm/test/compile.test.d.ts.map +0 -1
- package/esm/test/echo.test.d.ts.map +0 -1
- package/esm/test/escape.test.d.ts.map +0 -1
- package/esm/test/for.test.d.ts.map +0 -1
- package/esm/test/function.test.d.ts.map +0 -1
- package/esm/test/if.test.d.ts.map +0 -1
- package/esm/test/import.test.d.ts.map +0 -1
- package/esm/test/include.test.d.ts.map +0 -1
- package/esm/test/js.test.d.ts.map +0 -1
- package/esm/test/layout.test.d.ts.map +0 -1
- package/esm/test/print.test.d.ts.map +0 -1
- package/esm/test/safe.test.d.ts.map +0 -1
- package/esm/test/set.test.d.ts.map +0 -1
- package/esm/test/tokenizer.test.d.ts.map +0 -1
- package/esm/test/unescape.test.d.ts.map +0 -1
- package/esm/test/utils.d.ts.map +0 -1
- package/esm/test/with.test.d.ts.map +0 -1
- /package/{esm/plugins → plugins}/function.js +0 -0
- /package/{esm/plugins → plugins}/if.js +0 -0
- /package/{esm/plugins → plugins}/js.js +0 -0
- /package/{esm/plugins → plugins}/layout.js +0 -0
- /package/{esm/plugins → plugins}/trim.js +0 -0
@@ -1,40 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Normalize the `path`, resolving `'..'` and `'.'` segments.
|
3
|
-
* Note that resolving these segments does not necessarily mean that all will be eliminated.
|
4
|
-
* A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
|
5
|
-
*
|
6
|
-
* @example Usage
|
7
|
-
* ```ts
|
8
|
-
* import { normalize } from "@std/path/posix/normalize";
|
9
|
-
* import { assertEquals } from "@std/assert";
|
10
|
-
*
|
11
|
-
* const path = normalize("/foo/bar//baz/asdf/quux/..");
|
12
|
-
* assertEquals(path, "/foo/bar/baz/asdf");
|
13
|
-
* ```
|
14
|
-
*
|
15
|
-
* @example Working with URLs
|
16
|
-
*
|
17
|
-
* Note: This function will remove the double slashes from a URL's scheme.
|
18
|
-
* Hence, do not pass a full URL to this function. Instead, pass the pathname of
|
19
|
-
* the URL.
|
20
|
-
*
|
21
|
-
* ```ts
|
22
|
-
* import { normalize } from "@std/path/posix/normalize";
|
23
|
-
* import { assertEquals } from "@std/assert";
|
24
|
-
*
|
25
|
-
* const url = new URL("https://deno.land");
|
26
|
-
* url.pathname = normalize("//std//assert//.//mod.ts");
|
27
|
-
* assertEquals(url.href, "https://deno.land/std/assert/mod.ts");
|
28
|
-
*
|
29
|
-
* url.pathname = normalize("std/assert/../async/retry.ts");
|
30
|
-
* assertEquals(url.href, "https://deno.land/std/async/retry.ts");
|
31
|
-
* ```
|
32
|
-
*
|
33
|
-
* Note: If you are working with file URLs,
|
34
|
-
* use the new version of `normalize` from `@std/path/posix/unstable-normalize`.
|
35
|
-
*
|
36
|
-
* @param path The path to normalize.
|
37
|
-
* @returns The normalized path.
|
38
|
-
*/
|
39
|
-
export declare function normalize(path: string): string;
|
40
|
-
//# sourceMappingURL=normalize.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/path/1.0.8/posix/normalize.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAgB9C"}
|
@@ -1,57 +0,0 @@
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
-
// This module is browser compatible.
|
3
|
-
import { assertArg } from "../_common/normalize.js";
|
4
|
-
import { normalizeString } from "../_common/normalize_string.js";
|
5
|
-
import { isPosixPathSeparator } from "./_util.js";
|
6
|
-
/**
|
7
|
-
* Normalize the `path`, resolving `'..'` and `'.'` segments.
|
8
|
-
* Note that resolving these segments does not necessarily mean that all will be eliminated.
|
9
|
-
* A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
|
10
|
-
*
|
11
|
-
* @example Usage
|
12
|
-
* ```ts
|
13
|
-
* import { normalize } from "@std/path/posix/normalize";
|
14
|
-
* import { assertEquals } from "@std/assert";
|
15
|
-
*
|
16
|
-
* const path = normalize("/foo/bar//baz/asdf/quux/..");
|
17
|
-
* assertEquals(path, "/foo/bar/baz/asdf");
|
18
|
-
* ```
|
19
|
-
*
|
20
|
-
* @example Working with URLs
|
21
|
-
*
|
22
|
-
* Note: This function will remove the double slashes from a URL's scheme.
|
23
|
-
* Hence, do not pass a full URL to this function. Instead, pass the pathname of
|
24
|
-
* the URL.
|
25
|
-
*
|
26
|
-
* ```ts
|
27
|
-
* import { normalize } from "@std/path/posix/normalize";
|
28
|
-
* import { assertEquals } from "@std/assert";
|
29
|
-
*
|
30
|
-
* const url = new URL("https://deno.land");
|
31
|
-
* url.pathname = normalize("//std//assert//.//mod.ts");
|
32
|
-
* assertEquals(url.href, "https://deno.land/std/assert/mod.ts");
|
33
|
-
*
|
34
|
-
* url.pathname = normalize("std/assert/../async/retry.ts");
|
35
|
-
* assertEquals(url.href, "https://deno.land/std/async/retry.ts");
|
36
|
-
* ```
|
37
|
-
*
|
38
|
-
* Note: If you are working with file URLs,
|
39
|
-
* use the new version of `normalize` from `@std/path/posix/unstable-normalize`.
|
40
|
-
*
|
41
|
-
* @param path The path to normalize.
|
42
|
-
* @returns The normalized path.
|
43
|
-
*/
|
44
|
-
export function normalize(path) {
|
45
|
-
assertArg(path);
|
46
|
-
const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));
|
47
|
-
const trailingSeparator = isPosixPathSeparator(path.charCodeAt(path.length - 1));
|
48
|
-
// Normalize the path
|
49
|
-
path = normalizeString(path, !isAbsolute, "/", isPosixPathSeparator);
|
50
|
-
if (path.length === 0 && !isAbsolute)
|
51
|
-
path = ".";
|
52
|
-
if (path.length > 0 && trailingSeparator)
|
53
|
-
path += "/";
|
54
|
-
if (isAbsolute)
|
55
|
-
return `/${path}`;
|
56
|
-
return path;
|
57
|
-
}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import type { GlobOptions } from "../_common/glob_to_reg_exp.js";
|
2
|
-
export type { GlobOptions };
|
3
|
-
/**
|
4
|
-
* Like normalize(), but doesn't collapse "**\/.." when `globstar` is true.
|
5
|
-
*
|
6
|
-
* @example Usage
|
7
|
-
* ```ts
|
8
|
-
* import { normalizeGlob } from "@std/path/posix/normalize-glob";
|
9
|
-
* import { assertEquals } from "@std/assert";
|
10
|
-
*
|
11
|
-
* const path = normalizeGlob("foo/bar/../*", { globstar: true });
|
12
|
-
* assertEquals(path, "foo/*");
|
13
|
-
* ```
|
14
|
-
*
|
15
|
-
* @param glob The glob to normalize.
|
16
|
-
* @param options The options to use.
|
17
|
-
* @returns The normalized path.
|
18
|
-
*/
|
19
|
-
export declare function normalizeGlob(glob: string, options?: Pick<GlobOptions, "globstar">): string;
|
20
|
-
//# sourceMappingURL=normalize_glob.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"normalize_glob.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/path/1.0.8/posix/normalize_glob.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAIjE,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,IAAI,CAAC,WAAW,EAAE,UAAU,CAAM,GAC1C,MAAM,CAcR"}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
-
// This module is browser compatible.
|
3
|
-
import { normalize } from "./normalize.js";
|
4
|
-
import { SEPARATOR_PATTERN } from "./constants.js";
|
5
|
-
/**
|
6
|
-
* Like normalize(), but doesn't collapse "**\/.." when `globstar` is true.
|
7
|
-
*
|
8
|
-
* @example Usage
|
9
|
-
* ```ts
|
10
|
-
* import { normalizeGlob } from "@std/path/posix/normalize-glob";
|
11
|
-
* import { assertEquals } from "@std/assert";
|
12
|
-
*
|
13
|
-
* const path = normalizeGlob("foo/bar/../*", { globstar: true });
|
14
|
-
* assertEquals(path, "foo/*");
|
15
|
-
* ```
|
16
|
-
*
|
17
|
-
* @param glob The glob to normalize.
|
18
|
-
* @param options The options to use.
|
19
|
-
* @returns The normalized path.
|
20
|
-
*/
|
21
|
-
export function normalizeGlob(glob, options = {}) {
|
22
|
-
const { globstar = false } = options;
|
23
|
-
if (glob.match(/\0/g)) {
|
24
|
-
throw new Error(`Glob contains invalid characters: "${glob}"`);
|
25
|
-
}
|
26
|
-
if (!globstar) {
|
27
|
-
return normalize(glob);
|
28
|
-
}
|
29
|
-
const s = SEPARATOR_PATTERN.source;
|
30
|
-
const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g");
|
31
|
-
return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
|
32
|
-
}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import type { ParsedPath } from "../types.js";
|
2
|
-
export type { ParsedPath } from "../types.js";
|
3
|
-
/**
|
4
|
-
* Return a `ParsedPath` object of the `path`.
|
5
|
-
*
|
6
|
-
* @example Usage
|
7
|
-
* ```ts
|
8
|
-
* import { parse } from "@std/path/posix/parse";
|
9
|
-
* import { assertEquals } from "@std/assert";
|
10
|
-
*
|
11
|
-
* const path = parse("/home/user/file.txt");
|
12
|
-
* assertEquals(path, {
|
13
|
-
* root: "/",
|
14
|
-
* dir: "/home/user",
|
15
|
-
* base: "file.txt",
|
16
|
-
* ext: ".txt",
|
17
|
-
* name: "file"
|
18
|
-
* });
|
19
|
-
* ```
|
20
|
-
*
|
21
|
-
* @param path The path to parse.
|
22
|
-
* @returns The parsed path object.
|
23
|
-
*/
|
24
|
-
export declare function parse(path: string): ParsedPath;
|
25
|
-
//# sourceMappingURL=parse.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/path/1.0.8/posix/parse.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAwF9C"}
|
@@ -1,115 +0,0 @@
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
-
// This module is browser compatible.
|
3
|
-
import { CHAR_DOT } from "../_common/constants.js";
|
4
|
-
import { stripTrailingSeparators } from "../_common/strip_trailing_separators.js";
|
5
|
-
import { assertPath } from "../_common/assert_path.js";
|
6
|
-
import { isPosixPathSeparator } from "./_util.js";
|
7
|
-
/**
|
8
|
-
* Return a `ParsedPath` object of the `path`.
|
9
|
-
*
|
10
|
-
* @example Usage
|
11
|
-
* ```ts
|
12
|
-
* import { parse } from "@std/path/posix/parse";
|
13
|
-
* import { assertEquals } from "@std/assert";
|
14
|
-
*
|
15
|
-
* const path = parse("/home/user/file.txt");
|
16
|
-
* assertEquals(path, {
|
17
|
-
* root: "/",
|
18
|
-
* dir: "/home/user",
|
19
|
-
* base: "file.txt",
|
20
|
-
* ext: ".txt",
|
21
|
-
* name: "file"
|
22
|
-
* });
|
23
|
-
* ```
|
24
|
-
*
|
25
|
-
* @param path The path to parse.
|
26
|
-
* @returns The parsed path object.
|
27
|
-
*/
|
28
|
-
export function parse(path) {
|
29
|
-
assertPath(path);
|
30
|
-
const ret = { root: "", dir: "", base: "", ext: "", name: "" };
|
31
|
-
if (path.length === 0)
|
32
|
-
return ret;
|
33
|
-
const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));
|
34
|
-
let start;
|
35
|
-
if (isAbsolute) {
|
36
|
-
ret.root = "/";
|
37
|
-
start = 1;
|
38
|
-
}
|
39
|
-
else {
|
40
|
-
start = 0;
|
41
|
-
}
|
42
|
-
let startDot = -1;
|
43
|
-
let startPart = 0;
|
44
|
-
let end = -1;
|
45
|
-
let matchedSlash = true;
|
46
|
-
let i = path.length - 1;
|
47
|
-
// Track the state of characters (if any) we see before our first dot and
|
48
|
-
// after any path separator we find
|
49
|
-
let preDotState = 0;
|
50
|
-
// Get non-dir info
|
51
|
-
for (; i >= start; --i) {
|
52
|
-
const code = path.charCodeAt(i);
|
53
|
-
if (isPosixPathSeparator(code)) {
|
54
|
-
// If we reached a path separator that was not part of a set of path
|
55
|
-
// separators at the end of the string, stop now
|
56
|
-
if (!matchedSlash) {
|
57
|
-
startPart = i + 1;
|
58
|
-
break;
|
59
|
-
}
|
60
|
-
continue;
|
61
|
-
}
|
62
|
-
if (end === -1) {
|
63
|
-
// We saw the first non-path separator, mark this as the end of our
|
64
|
-
// extension
|
65
|
-
matchedSlash = false;
|
66
|
-
end = i + 1;
|
67
|
-
}
|
68
|
-
if (code === CHAR_DOT) {
|
69
|
-
// If this is our first dot, mark it as the start of our extension
|
70
|
-
if (startDot === -1)
|
71
|
-
startDot = i;
|
72
|
-
else if (preDotState !== 1)
|
73
|
-
preDotState = 1;
|
74
|
-
}
|
75
|
-
else if (startDot !== -1) {
|
76
|
-
// We saw a non-dot and non-path separator before our dot, so we should
|
77
|
-
// have a good chance at having a non-empty extension
|
78
|
-
preDotState = -1;
|
79
|
-
}
|
80
|
-
}
|
81
|
-
if (startDot === -1 ||
|
82
|
-
end === -1 ||
|
83
|
-
// We saw a non-dot character immediately before the dot
|
84
|
-
preDotState === 0 ||
|
85
|
-
// The (right-most) trimmed path component is exactly '..'
|
86
|
-
(preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)) {
|
87
|
-
if (end !== -1) {
|
88
|
-
if (startPart === 0 && isAbsolute) {
|
89
|
-
ret.base = ret.name = path.slice(1, end);
|
90
|
-
}
|
91
|
-
else {
|
92
|
-
ret.base = ret.name = path.slice(startPart, end);
|
93
|
-
}
|
94
|
-
}
|
95
|
-
// Fallback to '/' in case there is no basename
|
96
|
-
ret.base = ret.base || "/";
|
97
|
-
}
|
98
|
-
else {
|
99
|
-
if (startPart === 0 && isAbsolute) {
|
100
|
-
ret.name = path.slice(1, startDot);
|
101
|
-
ret.base = path.slice(1, end);
|
102
|
-
}
|
103
|
-
else {
|
104
|
-
ret.name = path.slice(startPart, startDot);
|
105
|
-
ret.base = path.slice(startPart, end);
|
106
|
-
}
|
107
|
-
ret.ext = path.slice(startDot, end);
|
108
|
-
}
|
109
|
-
if (startPart > 0) {
|
110
|
-
ret.dir = stripTrailingSeparators(path.slice(0, startPart - 1), isPosixPathSeparator);
|
111
|
-
}
|
112
|
-
else if (isAbsolute)
|
113
|
-
ret.dir = "/";
|
114
|
-
return ret;
|
115
|
-
}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Return the relative path from `from` to `to` based on current working directory.
|
3
|
-
*
|
4
|
-
* If `from` and `to` are the same, return an empty string.
|
5
|
-
*
|
6
|
-
* @example Usage
|
7
|
-
* ```ts
|
8
|
-
* import { relative } from "@std/path/posix/relative";
|
9
|
-
* import { assertEquals } from "@std/assert";
|
10
|
-
*
|
11
|
-
* const path = relative("/data/orandea/test/aaa", "/data/orandea/impl/bbb");
|
12
|
-
* assertEquals(path, "../../impl/bbb");
|
13
|
-
* ```
|
14
|
-
*
|
15
|
-
* @param from The path to start from.
|
16
|
-
* @param to The path to reach.
|
17
|
-
* @returns The relative path.
|
18
|
-
*/
|
19
|
-
export declare function relative(from: string, to: string): string;
|
20
|
-
//# sourceMappingURL=relative.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"relative.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/path/1.0.8/posix/relative.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CA6EzD"}
|
@@ -1,106 +0,0 @@
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
-
// This module is browser compatible.
|
3
|
-
import { isPosixPathSeparator } from "./_util.js";
|
4
|
-
import { resolve } from "./resolve.js";
|
5
|
-
import { assertArgs } from "../_common/relative.js";
|
6
|
-
/**
|
7
|
-
* Return the relative path from `from` to `to` based on current working directory.
|
8
|
-
*
|
9
|
-
* If `from` and `to` are the same, return an empty string.
|
10
|
-
*
|
11
|
-
* @example Usage
|
12
|
-
* ```ts
|
13
|
-
* import { relative } from "@std/path/posix/relative";
|
14
|
-
* import { assertEquals } from "@std/assert";
|
15
|
-
*
|
16
|
-
* const path = relative("/data/orandea/test/aaa", "/data/orandea/impl/bbb");
|
17
|
-
* assertEquals(path, "../../impl/bbb");
|
18
|
-
* ```
|
19
|
-
*
|
20
|
-
* @param from The path to start from.
|
21
|
-
* @param to The path to reach.
|
22
|
-
* @returns The relative path.
|
23
|
-
*/
|
24
|
-
export function relative(from, to) {
|
25
|
-
assertArgs(from, to);
|
26
|
-
from = resolve(from);
|
27
|
-
to = resolve(to);
|
28
|
-
if (from === to)
|
29
|
-
return "";
|
30
|
-
// Trim any leading backslashes
|
31
|
-
let fromStart = 1;
|
32
|
-
const fromEnd = from.length;
|
33
|
-
for (; fromStart < fromEnd; ++fromStart) {
|
34
|
-
if (!isPosixPathSeparator(from.charCodeAt(fromStart)))
|
35
|
-
break;
|
36
|
-
}
|
37
|
-
const fromLen = fromEnd - fromStart;
|
38
|
-
// Trim any leading backslashes
|
39
|
-
let toStart = 1;
|
40
|
-
const toEnd = to.length;
|
41
|
-
for (; toStart < toEnd; ++toStart) {
|
42
|
-
if (!isPosixPathSeparator(to.charCodeAt(toStart)))
|
43
|
-
break;
|
44
|
-
}
|
45
|
-
const toLen = toEnd - toStart;
|
46
|
-
// Compare paths to find the longest common path from root
|
47
|
-
const length = fromLen < toLen ? fromLen : toLen;
|
48
|
-
let lastCommonSep = -1;
|
49
|
-
let i = 0;
|
50
|
-
for (; i <= length; ++i) {
|
51
|
-
if (i === length) {
|
52
|
-
if (toLen > length) {
|
53
|
-
if (isPosixPathSeparator(to.charCodeAt(toStart + i))) {
|
54
|
-
// We get here if `from` is the exact base path for `to`.
|
55
|
-
// For example: from='/foo/bar'; to='/foo/bar/baz'
|
56
|
-
return to.slice(toStart + i + 1);
|
57
|
-
}
|
58
|
-
else if (i === 0) {
|
59
|
-
// We get here if `from` is the root
|
60
|
-
// For example: from='/'; to='/foo'
|
61
|
-
return to.slice(toStart + i);
|
62
|
-
}
|
63
|
-
}
|
64
|
-
else if (fromLen > length) {
|
65
|
-
if (isPosixPathSeparator(from.charCodeAt(fromStart + i))) {
|
66
|
-
// We get here if `to` is the exact base path for `from`.
|
67
|
-
// For example: from='/foo/bar/baz'; to='/foo/bar'
|
68
|
-
lastCommonSep = i;
|
69
|
-
}
|
70
|
-
else if (i === 0) {
|
71
|
-
// We get here if `to` is the root.
|
72
|
-
// For example: from='/foo'; to='/'
|
73
|
-
lastCommonSep = 0;
|
74
|
-
}
|
75
|
-
}
|
76
|
-
break;
|
77
|
-
}
|
78
|
-
const fromCode = from.charCodeAt(fromStart + i);
|
79
|
-
const toCode = to.charCodeAt(toStart + i);
|
80
|
-
if (fromCode !== toCode)
|
81
|
-
break;
|
82
|
-
else if (isPosixPathSeparator(fromCode))
|
83
|
-
lastCommonSep = i;
|
84
|
-
}
|
85
|
-
let out = "";
|
86
|
-
// Generate the relative path based on the path difference between `to`
|
87
|
-
// and `from`
|
88
|
-
for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
|
89
|
-
if (i === fromEnd || isPosixPathSeparator(from.charCodeAt(i))) {
|
90
|
-
if (out.length === 0)
|
91
|
-
out += "..";
|
92
|
-
else
|
93
|
-
out += "/..";
|
94
|
-
}
|
95
|
-
}
|
96
|
-
// Lastly, append the rest of the destination (`to`) path that comes after
|
97
|
-
// the common path parts
|
98
|
-
if (out.length > 0)
|
99
|
-
return out + to.slice(toStart + lastCommonSep);
|
100
|
-
else {
|
101
|
-
toStart += lastCommonSep;
|
102
|
-
if (isPosixPathSeparator(to.charCodeAt(toStart)))
|
103
|
-
++toStart;
|
104
|
-
return to.slice(toStart);
|
105
|
-
}
|
106
|
-
}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Resolves path segments into a `path`.
|
3
|
-
*
|
4
|
-
* @example Usage
|
5
|
-
* ```ts
|
6
|
-
* import { resolve } from "@std/path/posix/resolve";
|
7
|
-
* import { assertEquals } from "@std/assert";
|
8
|
-
*
|
9
|
-
* const path = resolve("/foo", "bar", "baz/asdf", "quux", "..");
|
10
|
-
* assertEquals(path, "/foo/bar/baz/asdf");
|
11
|
-
* ```
|
12
|
-
*
|
13
|
-
* @param pathSegments The path segments to resolve.
|
14
|
-
* @returns The resolved path.
|
15
|
-
*/
|
16
|
-
export declare function resolve(...pathSegments: string[]): string;
|
17
|
-
//# sourceMappingURL=resolve.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/path/1.0.8/posix/resolve.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,OAAO,CAAC,GAAG,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,CA8CzD"}
|
@@ -1,59 +0,0 @@
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
-
// This module is browser compatible.
|
3
|
-
import * as dntShim from "../../../../../../_dnt.shims.js";
|
4
|
-
import { normalizeString } from "../_common/normalize_string.js";
|
5
|
-
import { assertPath } from "../_common/assert_path.js";
|
6
|
-
import { isPosixPathSeparator } from "./_util.js";
|
7
|
-
/**
|
8
|
-
* Resolves path segments into a `path`.
|
9
|
-
*
|
10
|
-
* @example Usage
|
11
|
-
* ```ts
|
12
|
-
* import { resolve } from "@std/path/posix/resolve";
|
13
|
-
* import { assertEquals } from "@std/assert";
|
14
|
-
*
|
15
|
-
* const path = resolve("/foo", "bar", "baz/asdf", "quux", "..");
|
16
|
-
* assertEquals(path, "/foo/bar/baz/asdf");
|
17
|
-
* ```
|
18
|
-
*
|
19
|
-
* @param pathSegments The path segments to resolve.
|
20
|
-
* @returns The resolved path.
|
21
|
-
*/
|
22
|
-
export function resolve(...pathSegments) {
|
23
|
-
let resolvedPath = "";
|
24
|
-
let resolvedAbsolute = false;
|
25
|
-
for (let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
26
|
-
let path;
|
27
|
-
if (i >= 0)
|
28
|
-
path = pathSegments[i];
|
29
|
-
else {
|
30
|
-
// deno-lint-ignore no-explicit-any
|
31
|
-
const { Deno } = dntShim.dntGlobalThis;
|
32
|
-
if (typeof Deno?.cwd !== "function") {
|
33
|
-
throw new TypeError("Resolved a relative path without a current working directory (CWD)");
|
34
|
-
}
|
35
|
-
path = Deno.cwd();
|
36
|
-
}
|
37
|
-
assertPath(path);
|
38
|
-
// Skip empty entries
|
39
|
-
if (path.length === 0) {
|
40
|
-
continue;
|
41
|
-
}
|
42
|
-
resolvedPath = `${path}/${resolvedPath}`;
|
43
|
-
resolvedAbsolute = isPosixPathSeparator(path.charCodeAt(0));
|
44
|
-
}
|
45
|
-
// At this point the path should be resolved to a full absolute path, but
|
46
|
-
// handle relative paths to be safe (might happen when Deno.cwd() fails)
|
47
|
-
// Normalize the path
|
48
|
-
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, "/", isPosixPathSeparator);
|
49
|
-
if (resolvedAbsolute) {
|
50
|
-
if (resolvedPath.length > 0)
|
51
|
-
return `/${resolvedPath}`;
|
52
|
-
else
|
53
|
-
return "/";
|
54
|
-
}
|
55
|
-
else if (resolvedPath.length > 0)
|
56
|
-
return resolvedPath;
|
57
|
-
else
|
58
|
-
return ".";
|
59
|
-
}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
/**
|
3
|
-
* Converts a path string to a file URL.
|
4
|
-
*
|
5
|
-
* @example Usage
|
6
|
-
* ```ts
|
7
|
-
* import { toFileUrl } from "@std/path/posix/to-file-url";
|
8
|
-
* import { assertEquals } from "@std/assert";
|
9
|
-
*
|
10
|
-
* assertEquals(toFileUrl("/home/foo"), new URL("file:///home/foo"));
|
11
|
-
* assertEquals(toFileUrl("/home/foo bar"), new URL("file:///home/foo%20bar"));
|
12
|
-
* ```
|
13
|
-
*
|
14
|
-
* @param path The path to convert.
|
15
|
-
* @returns The file URL.
|
16
|
-
*/
|
17
|
-
export declare function toFileUrl(path: string): URL;
|
18
|
-
//# sourceMappingURL=to_file_url.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"to_file_url.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/path/1.0.8/posix/to_file_url.ts"],"names":[],"mappings":";AAMA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAU3C"}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
-
// This module is browser compatible.
|
3
|
-
import { encodeWhitespace } from "../_common/to_file_url.js";
|
4
|
-
import { isAbsolute } from "./is_absolute.js";
|
5
|
-
/**
|
6
|
-
* Converts a path string to a file URL.
|
7
|
-
*
|
8
|
-
* @example Usage
|
9
|
-
* ```ts
|
10
|
-
* import { toFileUrl } from "@std/path/posix/to-file-url";
|
11
|
-
* import { assertEquals } from "@std/assert";
|
12
|
-
*
|
13
|
-
* assertEquals(toFileUrl("/home/foo"), new URL("file:///home/foo"));
|
14
|
-
* assertEquals(toFileUrl("/home/foo bar"), new URL("file:///home/foo%20bar"));
|
15
|
-
* ```
|
16
|
-
*
|
17
|
-
* @param path The path to convert.
|
18
|
-
* @returns The file URL.
|
19
|
-
*/
|
20
|
-
export function toFileUrl(path) {
|
21
|
-
if (!isAbsolute(path)) {
|
22
|
-
throw new TypeError(`Path must be absolute: received "${path}"`);
|
23
|
-
}
|
24
|
-
const url = new URL("file:///");
|
25
|
-
url.pathname = encodeWhitespace(path.replace(/%/g, "%25").replace(/\\/g, "%5C"));
|
26
|
-
return url;
|
27
|
-
}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Converts a path to a namespaced path. This function returns the path as is on posix.
|
3
|
-
*
|
4
|
-
* @example Usage
|
5
|
-
* ```ts
|
6
|
-
* import { toNamespacedPath } from "@std/path/posix/to-namespaced-path";
|
7
|
-
* import { assertEquals } from "@std/assert";
|
8
|
-
*
|
9
|
-
* assertEquals(toNamespacedPath("/home/foo"), "/home/foo");
|
10
|
-
* ```
|
11
|
-
*
|
12
|
-
* @param path The path.
|
13
|
-
* @returns The namespaced path.
|
14
|
-
*/
|
15
|
-
export declare function toNamespacedPath(path: string): string;
|
16
|
-
//# sourceMappingURL=to_namespaced_path.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"to_namespaced_path.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/path/1.0.8/posix/to_namespaced_path.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGrD"}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
-
// This module is browser compatible.
|
3
|
-
/**
|
4
|
-
* Converts a path to a namespaced path. This function returns the path as is on posix.
|
5
|
-
*
|
6
|
-
* @example Usage
|
7
|
-
* ```ts
|
8
|
-
* import { toNamespacedPath } from "@std/path/posix/to-namespaced-path";
|
9
|
-
* import { assertEquals } from "@std/assert";
|
10
|
-
*
|
11
|
-
* assertEquals(toNamespacedPath("/home/foo"), "/home/foo");
|
12
|
-
* ```
|
13
|
-
*
|
14
|
-
* @param path The path.
|
15
|
-
* @returns The namespaced path.
|
16
|
-
*/
|
17
|
-
export function toNamespacedPath(path) {
|
18
|
-
// Non-op on posix systems
|
19
|
-
return path;
|
20
|
-
}
|
@@ -1,24 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Return the relative path from `from` to `to` based on current working
|
3
|
-
* directory.
|
4
|
-
*
|
5
|
-
* @example Usage
|
6
|
-
* ```ts
|
7
|
-
* import { relative } from "@std/path/relative";
|
8
|
-
* import { assertEquals } from "@std/assert";
|
9
|
-
*
|
10
|
-
* if (Deno.build.os === "windows") {
|
11
|
-
* const path = relative("C:\\foobar\\test\\aaa", "C:\\foobar\\impl\\bbb");
|
12
|
-
* assertEquals(path, "..\\..\\impl\\bbb");
|
13
|
-
* } else {
|
14
|
-
* const path = relative("/data/foobar/test/aaa", "/data/foobar/impl/bbb");
|
15
|
-
* assertEquals(path, "../../impl/bbb");
|
16
|
-
* }
|
17
|
-
* ```
|
18
|
-
*
|
19
|
-
* @param from Path in current working directory.
|
20
|
-
* @param to Path in current working directory.
|
21
|
-
* @returns The relative path from `from` to `to`.
|
22
|
-
*/
|
23
|
-
export declare function relative(from: string, to: string): string;
|
24
|
-
//# sourceMappingURL=relative.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"relative.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/path/1.0.8/relative.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAEzD"}
|