@bolt-foundry/gambit-core 0.5.3-dev
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.polyfills.d.ts +12 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -0
- package/esm/_dnt.polyfills.js +15 -0
- package/esm/_dnt.shims.d.ts +6 -0
- package/esm/_dnt.shims.d.ts.map +1 -0
- package/esm/_dnt.shims.js +61 -0
- package/esm/deps/jsr.io/@std/collections/1.1.3/_utils.d.ts +6 -0
- package/esm/deps/jsr.io/@std/collections/1.1.3/_utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.1.3/_utils.js +18 -0
- package/esm/deps/jsr.io/@std/collections/1.1.3/deep_merge.d.ts +322 -0
- package/esm/deps/jsr.io/@std/collections/1.1.3/deep_merge.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.1.3/deep_merge.js +95 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/_formats.d.ts +11 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/_formats.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/_formats.js +28 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/_shared.d.ts +5 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/_shared.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/_shared.js +8 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/any.d.ts +32 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/any.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/any.js +48 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/json.d.ts +30 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/json.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/json.js +35 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/toml.d.ts +30 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/toml.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/toml.js +36 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/types.d.ts +7 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/types.js +3 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/yaml.d.ts +33 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/yaml.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/yaml.js +39 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/_os.d.ts +2 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/_os.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/_os.js +12 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/os.d.ts +3 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/os.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/os.js +5 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts +2 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/assert_path.js +7 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts +4 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/basename.js +40 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/common.d.ts +2 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/common.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/common.js +23 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts +40 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/constants.js +46 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/dirname.d.ts +2 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/dirname.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/dirname.js +8 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/format.d.ts +4 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/format.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/format.js +19 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts +2 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.js +9 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.d.ts +35 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.js +235 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts +2 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize.js +8 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts +2 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.js +77 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/relative.d.ts +2 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/relative.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/relative.js +9 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts +2 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.js +19 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts +2 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.js +15 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/basename.d.ts +27 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/basename.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/basename.js +35 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/common.d.ts +28 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/common.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/common.js +33 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/constants.d.ts +15 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/constants.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/constants.js +17 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/dirname.d.ts +22 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/dirname.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/dirname.js +28 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/extname.d.ts +22 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/extname.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/extname.js +28 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/format.d.ts +22 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/format.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/format.js +27 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/from_file_url.d.ts +22 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/from_file_url.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/from_file_url.js +28 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.d.ts +77 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.js +83 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts +22 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.js +28 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/is_glob.d.ts +17 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/is_glob.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/is_glob.js +42 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/join.d.ts +23 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/join.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/join.js +29 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/join_globs.d.ts +28 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/join_globs.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/join_globs.js +34 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/mod.d.ts +213 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/mod.js +216 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/normalize.d.ts +26 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/normalize.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/normalize.js +32 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/normalize_glob.d.ts +29 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/normalize_glob.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/normalize_glob.js +35 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/parse.d.ts +35 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/parse.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/parse.js +39 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts +2 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/_util.js +8 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts +39 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/basename.js +52 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/constants.d.ts +13 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/constants.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/constants.js +14 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/dirname.d.ts +30 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/dirname.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/dirname.js +64 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts +37 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/extname.js +93 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/format.d.ts +24 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/format.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/format.js +28 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts +16 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.js +21 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.d.ts +72 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.js +82 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts +17 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.js +23 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts +31 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/join.js +45 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/join_globs.d.ts +20 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/join_globs.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/join_globs.js +40 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts +37 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize.js +58 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.d.ts +20 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.js +32 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/parse.d.ts +25 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/parse.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/parse.js +115 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/relative.d.ts +20 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/relative.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/relative.js +106 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/resolve.d.ts +17 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/resolve.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/resolve.js +59 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts +17 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.js +27 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.d.ts +16 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.js +20 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/relative.d.ts +24 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/relative.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/relative.js +30 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/resolve.d.ts +22 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/resolve.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/resolve.js +30 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts +22 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.js +28 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.d.ts +21 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.js +29 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/types.d.ts +38 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/types.js +3 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts +4 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/_util.js +15 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts +22 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/basename.js +47 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/constants.d.ts +13 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/constants.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/constants.js +14 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/dirname.d.ts +17 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/dirname.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/dirname.js +113 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts +17 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/extname.js +82 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/format.d.ts +24 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/format.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/format.js +28 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts +18 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.js +30 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.d.ts +71 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.js +82 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts +17 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.js +38 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts +18 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/join.js +77 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/join_globs.d.ts +21 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/join_globs.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/join_globs.js +41 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts +19 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize.js +135 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.d.ts +20 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.js +32 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/parse.d.ts +25 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/parse.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/parse.js +176 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/relative.d.ts +23 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/relative.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/relative.js +131 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/resolve.d.ts +17 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/resolve.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/resolve.js +154 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts +17 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.js +34 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.d.ts +17 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.js +49 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/_parser.d.ts +93 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/_parser.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/_parser.js +753 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/parse.d.ts +21 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/parse.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/parse.js +25 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_chars.d.ts +33 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_chars.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_chars.js +48 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_loader_state.d.ts +66 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_loader_state.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_loader_state.js +1427 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_schema.d.ts +44 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_schema.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_schema.js +117 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/binary.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/binary.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/binary.js +103 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/bool.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/bool.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/bool.js +32 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/float.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/float.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/float.js +96 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/int.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/int.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/int.js +159 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/map.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/map.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/map.js +14 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/merge.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/merge.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/merge.js +10 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/nil.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/nil.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/nil.js +22 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/omap.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/omap.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/omap.js +29 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/pairs.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/pairs.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/pairs.js +19 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/regexp.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/regexp.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/regexp.js +30 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/seq.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/seq.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/seq.js +10 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/set.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/set.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/set.js +14 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/str.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/str.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/str.js +9 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/timestamp.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/timestamp.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/timestamp.js +81 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/undefined.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/undefined.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/undefined.js +20 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type.d.ts +32 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_type.js +6 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_utils.d.ts +4 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_utils.js +13 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/parse.d.ts +76 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/parse.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.0.10/parse.js +93 -0
- package/esm/mod.d.ts +51 -0
- package/esm/mod.d.ts.map +1 -0
- package/esm/mod.js +20 -0
- package/esm/package.json +3 -0
- package/esm/src/constants.d.ts +15 -0
- package/esm/src/constants.d.ts.map +1 -0
- package/esm/src/constants.js +20 -0
- package/esm/src/definitions.d.ts +11 -0
- package/esm/src/definitions.d.ts.map +1 -0
- package/esm/src/definitions.js +14 -0
- package/esm/src/loader.d.ts +4 -0
- package/esm/src/loader.d.ts.map +1 -0
- package/esm/src/loader.js +179 -0
- package/esm/src/markdown.d.ts +5 -0
- package/esm/src/markdown.d.ts.map +1 -0
- package/esm/src/markdown.js +307 -0
- package/esm/src/openai_compat.d.ts +63 -0
- package/esm/src/openai_compat.d.ts.map +1 -0
- package/esm/src/openai_compat.js +272 -0
- package/esm/src/providers/openrouter.d.ts +8 -0
- package/esm/src/providers/openrouter.d.ts.map +1 -0
- package/esm/src/providers/openrouter.js +168 -0
- package/esm/src/render.d.ts +51 -0
- package/esm/src/render.d.ts.map +1 -0
- package/esm/src/render.js +188 -0
- package/esm/src/runtime.d.ts +35 -0
- package/esm/src/runtime.d.ts.map +1 -0
- package/esm/src/runtime.js +1368 -0
- package/esm/src/schema.d.ts +8 -0
- package/esm/src/schema.d.ts.map +1 -0
- package/esm/src/schema.js +45 -0
- package/esm/src/state.d.ts +34 -0
- package/esm/src/state.d.ts.map +1 -0
- package/esm/src/state.js +22 -0
- package/esm/src/types.d.ts +318 -0
- package/esm/src/types.d.ts.map +1 -0
- package/esm/src/types.js +1 -0
- package/package.json +32 -0
- package/script/_dnt.polyfills.d.ts +12 -0
- package/script/_dnt.polyfills.d.ts.map +1 -0
- package/script/_dnt.polyfills.js +16 -0
- package/script/_dnt.shims.d.ts +6 -0
- package/script/_dnt.shims.d.ts.map +1 -0
- package/script/_dnt.shims.js +65 -0
- package/script/deps/jsr.io/@std/collections/1.1.3/_utils.d.ts +6 -0
- package/script/deps/jsr.io/@std/collections/1.1.3/_utils.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/collections/1.1.3/_utils.js +21 -0
- package/script/deps/jsr.io/@std/collections/1.1.3/deep_merge.d.ts +322 -0
- package/script/deps/jsr.io/@std/collections/1.1.3/deep_merge.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/collections/1.1.3/deep_merge.js +98 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/_formats.d.ts +11 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/_formats.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/_formats.js +31 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/_shared.d.ts +5 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/_shared.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/_shared.js +11 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/any.d.ts +32 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/any.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/any.js +51 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/json.d.ts +30 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/json.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/json.js +38 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/toml.d.ts +30 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/toml.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/toml.js +39 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/types.d.ts +7 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/types.js +4 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/yaml.d.ts +33 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/yaml.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/front-matter/1.0.9/yaml.js +42 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/_os.d.ts +2 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/_os.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/_os.js +38 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/os.d.ts +3 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/os.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/os.js +8 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts +2 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/assert_path.js +10 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts +4 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/basename.js +45 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/common.d.ts +2 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/common.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/common.js +26 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts +40 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/constants.js +49 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/dirname.d.ts +2 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/dirname.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/dirname.js +11 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/format.d.ts +4 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/format.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/format.js +23 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts +2 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.js +12 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.d.ts +35 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.js +238 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts +2 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize.js +11 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts +2 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.js +80 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/relative.d.ts +2 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/relative.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/relative.js +12 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts +2 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.js +22 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts +2 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.js +18 -0
- package/script/deps/jsr.io/@std/path/1.1.4/basename.d.ts +27 -0
- package/script/deps/jsr.io/@std/path/1.1.4/basename.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/basename.js +38 -0
- package/script/deps/jsr.io/@std/path/1.1.4/common.d.ts +28 -0
- package/script/deps/jsr.io/@std/path/1.1.4/common.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/common.js +36 -0
- package/script/deps/jsr.io/@std/path/1.1.4/constants.d.ts +15 -0
- package/script/deps/jsr.io/@std/path/1.1.4/constants.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/constants.js +20 -0
- package/script/deps/jsr.io/@std/path/1.1.4/dirname.d.ts +22 -0
- package/script/deps/jsr.io/@std/path/1.1.4/dirname.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/dirname.js +31 -0
- package/script/deps/jsr.io/@std/path/1.1.4/extname.d.ts +22 -0
- package/script/deps/jsr.io/@std/path/1.1.4/extname.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/extname.js +31 -0
- package/script/deps/jsr.io/@std/path/1.1.4/format.d.ts +22 -0
- package/script/deps/jsr.io/@std/path/1.1.4/format.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/format.js +30 -0
- package/script/deps/jsr.io/@std/path/1.1.4/from_file_url.d.ts +22 -0
- package/script/deps/jsr.io/@std/path/1.1.4/from_file_url.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/from_file_url.js +31 -0
- package/script/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.d.ts +77 -0
- package/script/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.js +86 -0
- package/script/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts +22 -0
- package/script/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/is_absolute.js +31 -0
- package/script/deps/jsr.io/@std/path/1.1.4/is_glob.d.ts +17 -0
- package/script/deps/jsr.io/@std/path/1.1.4/is_glob.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/is_glob.js +45 -0
- package/script/deps/jsr.io/@std/path/1.1.4/join.d.ts +23 -0
- package/script/deps/jsr.io/@std/path/1.1.4/join.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/join.js +32 -0
- package/script/deps/jsr.io/@std/path/1.1.4/join_globs.d.ts +28 -0
- package/script/deps/jsr.io/@std/path/1.1.4/join_globs.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/join_globs.js +37 -0
- package/script/deps/jsr.io/@std/path/1.1.4/mod.d.ts +213 -0
- package/script/deps/jsr.io/@std/path/1.1.4/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/mod.js +232 -0
- package/script/deps/jsr.io/@std/path/1.1.4/normalize.d.ts +26 -0
- package/script/deps/jsr.io/@std/path/1.1.4/normalize.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/normalize.js +35 -0
- package/script/deps/jsr.io/@std/path/1.1.4/normalize_glob.d.ts +29 -0
- package/script/deps/jsr.io/@std/path/1.1.4/normalize_glob.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/normalize_glob.js +38 -0
- package/script/deps/jsr.io/@std/path/1.1.4/parse.d.ts +35 -0
- package/script/deps/jsr.io/@std/path/1.1.4/parse.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/parse.js +42 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts +2 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/_util.js +11 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts +39 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/basename.js +55 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/constants.d.ts +13 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/constants.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/constants.js +17 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/dirname.d.ts +30 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/dirname.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/dirname.js +67 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts +37 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/extname.js +96 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/format.d.ts +24 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/format.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/format.js +31 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts +16 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.js +24 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.d.ts +72 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.js +85 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts +17 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.js +26 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts +31 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/join.js +48 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/join_globs.d.ts +20 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/join_globs.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/join_globs.js +43 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts +37 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize.js +61 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.d.ts +20 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.js +35 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/parse.d.ts +25 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/parse.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/parse.js +118 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/relative.d.ts +20 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/relative.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/relative.js +109 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/resolve.d.ts +17 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/resolve.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/resolve.js +85 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts +17 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.js +30 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.d.ts +16 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.js +23 -0
- package/script/deps/jsr.io/@std/path/1.1.4/relative.d.ts +24 -0
- package/script/deps/jsr.io/@std/path/1.1.4/relative.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/relative.js +33 -0
- package/script/deps/jsr.io/@std/path/1.1.4/resolve.d.ts +22 -0
- package/script/deps/jsr.io/@std/path/1.1.4/resolve.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/resolve.js +33 -0
- package/script/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts +22 -0
- package/script/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/to_file_url.js +31 -0
- package/script/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.d.ts +21 -0
- package/script/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.js +32 -0
- package/script/deps/jsr.io/@std/path/1.1.4/types.d.ts +38 -0
- package/script/deps/jsr.io/@std/path/1.1.4/types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/types.js +4 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts +4 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/_util.js +20 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts +22 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/basename.js +50 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/constants.d.ts +13 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/constants.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/constants.js +17 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/dirname.d.ts +17 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/dirname.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/dirname.js +116 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts +17 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/extname.js +85 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/format.d.ts +24 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/format.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/format.js +31 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts +18 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.js +33 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.d.ts +71 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.js +85 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts +17 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.js +41 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts +18 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/join.js +80 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/join_globs.d.ts +21 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/join_globs.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/join_globs.js +44 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts +19 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize.js +138 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.d.ts +20 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.js +35 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/parse.d.ts +25 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/parse.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/parse.js +179 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/relative.d.ts +23 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/relative.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/relative.js +134 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/resolve.d.ts +17 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/resolve.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/resolve.js +180 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts +17 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.js +37 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.d.ts +17 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.js +52 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/_parser.d.ts +93 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/_parser.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/_parser.js +781 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/parse.d.ts +21 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/parse.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/parse.js +28 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_chars.d.ts +33 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_chars.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_chars.js +55 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_loader_state.d.ts +66 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_loader_state.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_loader_state.js +1431 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_schema.d.ts +44 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_schema.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_schema.js +121 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/binary.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/binary.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/binary.js +106 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/bool.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/bool.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/bool.js +35 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/float.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/float.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/float.js +99 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/int.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/int.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/int.js +162 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/map.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/map.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/map.js +17 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/merge.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/merge.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/merge.js +13 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/nil.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/nil.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/nil.js +25 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/omap.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/omap.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/omap.js +32 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/pairs.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/pairs.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/pairs.js +22 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/regexp.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/regexp.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/regexp.js +33 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/seq.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/seq.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/seq.js +13 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/set.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/set.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/set.js +17 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/str.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/str.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/str.js +12 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/timestamp.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/timestamp.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/timestamp.js +84 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/undefined.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/undefined.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type/undefined.js +23 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type.d.ts +32 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_type.js +7 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_utils.d.ts +4 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_utils.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/_utils.js +18 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/parse.d.ts +76 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/parse.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.0.10/parse.js +97 -0
- package/script/mod.d.ts +51 -0
- package/script/mod.d.ts.map +1 -0
- package/script/mod.js +30 -0
- package/script/package.json +3 -0
- package/script/src/constants.d.ts +15 -0
- package/script/src/constants.d.ts.map +1 -0
- package/script/src/constants.js +23 -0
- package/script/src/definitions.d.ts +11 -0
- package/script/src/definitions.d.ts.map +1 -0
- package/script/src/definitions.js +20 -0
- package/script/src/loader.d.ts +4 -0
- package/script/src/loader.d.ts.map +1 -0
- package/script/src/loader.js +206 -0
- package/script/src/markdown.d.ts +5 -0
- package/script/src/markdown.d.ts.map +1 -0
- package/script/src/markdown.js +335 -0
- package/script/src/openai_compat.d.ts +63 -0
- package/script/src/openai_compat.d.ts.map +1 -0
- package/script/src/openai_compat.js +276 -0
- package/script/src/providers/openrouter.d.ts +8 -0
- package/script/src/providers/openrouter.d.ts.map +1 -0
- package/script/src/providers/openrouter.js +197 -0
- package/script/src/render.d.ts +51 -0
- package/script/src/render.d.ts.map +1 -0
- package/script/src/render.js +192 -0
- package/script/src/runtime.d.ts +35 -0
- package/script/src/runtime.d.ts.map +1 -0
- package/script/src/runtime.js +1395 -0
- package/script/src/schema.d.ts +8 -0
- package/script/src/schema.d.ts.map +1 -0
- package/script/src/schema.js +51 -0
- package/script/src/state.d.ts +34 -0
- package/script/src/state.d.ts.map +1 -0
- package/script/src/state.js +49 -0
- package/script/src/types.d.ts +318 -0
- package/script/src/types.d.ts.map +1 -0
- package/script/src/types.js +2 -0
|
@@ -0,0 +1,753 @@
|
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
4
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
5
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
6
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
7
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
8
|
+
};
|
|
9
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
10
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
11
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
12
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
13
|
+
};
|
|
14
|
+
var _Scanner_whitespace, _Scanner_position, _Scanner_source;
|
|
15
|
+
import { deepMerge } from "../../collections/1.1.3/deep_merge.js";
|
|
16
|
+
/**
|
|
17
|
+
* Copy of `import { isLeap } from "@std/datetime";` because it cannot be impoted as long as it is unstable.
|
|
18
|
+
*/
|
|
19
|
+
function isLeap(yearNumber) {
|
|
20
|
+
return ((yearNumber % 4 === 0 && yearNumber % 100 !== 0) || yearNumber % 400 === 0);
|
|
21
|
+
}
|
|
22
|
+
export class Scanner {
|
|
23
|
+
constructor(source) {
|
|
24
|
+
_Scanner_whitespace.set(this, /[ \t]/);
|
|
25
|
+
_Scanner_position.set(this, 0);
|
|
26
|
+
_Scanner_source.set(this, void 0);
|
|
27
|
+
__classPrivateFieldSet(this, _Scanner_source, source, "f");
|
|
28
|
+
}
|
|
29
|
+
get position() {
|
|
30
|
+
return __classPrivateFieldGet(this, _Scanner_position, "f");
|
|
31
|
+
}
|
|
32
|
+
get source() {
|
|
33
|
+
return __classPrivateFieldGet(this, _Scanner_source, "f");
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get current character
|
|
37
|
+
* @param index - relative index from current position
|
|
38
|
+
*/
|
|
39
|
+
char(index = 0) {
|
|
40
|
+
return __classPrivateFieldGet(this, _Scanner_source, "f")[__classPrivateFieldGet(this, _Scanner_position, "f") + index] ?? "";
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get sliced string
|
|
44
|
+
* @param start - start position relative from current position
|
|
45
|
+
* @param end - end position relative from current position
|
|
46
|
+
*/
|
|
47
|
+
slice(start, end) {
|
|
48
|
+
return __classPrivateFieldGet(this, _Scanner_source, "f").slice(__classPrivateFieldGet(this, _Scanner_position, "f") + start, __classPrivateFieldGet(this, _Scanner_position, "f") + end);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Move position to next
|
|
52
|
+
*/
|
|
53
|
+
next(count = 1) {
|
|
54
|
+
__classPrivateFieldSet(this, _Scanner_position, __classPrivateFieldGet(this, _Scanner_position, "f") + count, "f");
|
|
55
|
+
}
|
|
56
|
+
skipWhitespaces() {
|
|
57
|
+
while (__classPrivateFieldGet(this, _Scanner_whitespace, "f").test(this.char()) && !this.eof()) {
|
|
58
|
+
this.next();
|
|
59
|
+
}
|
|
60
|
+
// Invalid if current char is other kinds of whitespace
|
|
61
|
+
if (!this.isCurrentCharEOL() && /\s/.test(this.char())) {
|
|
62
|
+
const escaped = "\\u" + this.char().charCodeAt(0).toString(16);
|
|
63
|
+
const position = __classPrivateFieldGet(this, _Scanner_position, "f");
|
|
64
|
+
throw new SyntaxError(`Cannot parse the TOML: It contains invalid whitespace at position '${position}': \`${escaped}\``);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
nextUntilChar(options = { skipComments: true }) {
|
|
68
|
+
while (!this.eof()) {
|
|
69
|
+
const char = this.char();
|
|
70
|
+
if (__classPrivateFieldGet(this, _Scanner_whitespace, "f").test(char) || this.isCurrentCharEOL()) {
|
|
71
|
+
this.next();
|
|
72
|
+
}
|
|
73
|
+
else if (options.skipComments && this.char() === "#") {
|
|
74
|
+
// entering comment
|
|
75
|
+
while (!this.isCurrentCharEOL() && !this.eof()) {
|
|
76
|
+
this.next();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Position reached EOF or not
|
|
86
|
+
*/
|
|
87
|
+
eof() {
|
|
88
|
+
return __classPrivateFieldGet(this, _Scanner_position, "f") >= __classPrivateFieldGet(this, _Scanner_source, "f").length;
|
|
89
|
+
}
|
|
90
|
+
isCurrentCharEOL() {
|
|
91
|
+
return this.char() === "\n" || this.startsWith("\r\n");
|
|
92
|
+
}
|
|
93
|
+
startsWith(searchString) {
|
|
94
|
+
return __classPrivateFieldGet(this, _Scanner_source, "f").startsWith(searchString, __classPrivateFieldGet(this, _Scanner_position, "f"));
|
|
95
|
+
}
|
|
96
|
+
match(regExp) {
|
|
97
|
+
if (!regExp.sticky) {
|
|
98
|
+
throw new Error(`RegExp ${regExp} does not have a sticky 'y' flag`);
|
|
99
|
+
}
|
|
100
|
+
regExp.lastIndex = __classPrivateFieldGet(this, _Scanner_position, "f");
|
|
101
|
+
return __classPrivateFieldGet(this, _Scanner_source, "f").match(regExp);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
_Scanner_whitespace = new WeakMap(), _Scanner_position = new WeakMap(), _Scanner_source = new WeakMap();
|
|
105
|
+
// -----------------------
|
|
106
|
+
// Utilities
|
|
107
|
+
// -----------------------
|
|
108
|
+
function success(body) {
|
|
109
|
+
return { ok: true, body };
|
|
110
|
+
}
|
|
111
|
+
function failure() {
|
|
112
|
+
return { ok: false };
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Creates a nested object from the keys and values.
|
|
116
|
+
*
|
|
117
|
+
* e.g. `unflat(["a", "b", "c"], 1)` returns `{ a: { b: { c: 1 } } }`
|
|
118
|
+
*/
|
|
119
|
+
export function unflat(keys, values = { __proto__: null }) {
|
|
120
|
+
return keys.reduceRight((acc, key) => ({ [key]: acc }), values);
|
|
121
|
+
}
|
|
122
|
+
function isObject(value) {
|
|
123
|
+
return typeof value === "object" && value !== null;
|
|
124
|
+
}
|
|
125
|
+
function getTargetValue(target, keys) {
|
|
126
|
+
const key = keys[0];
|
|
127
|
+
if (!key) {
|
|
128
|
+
throw new Error("Cannot parse the TOML: key length is not a positive number");
|
|
129
|
+
}
|
|
130
|
+
return target[key];
|
|
131
|
+
}
|
|
132
|
+
function deepAssignTable(target, table) {
|
|
133
|
+
const { keys, type, value } = table;
|
|
134
|
+
const currentValue = getTargetValue(target, keys);
|
|
135
|
+
if (currentValue === undefined) {
|
|
136
|
+
return Object.assign(target, unflat(keys, value));
|
|
137
|
+
}
|
|
138
|
+
if (Array.isArray(currentValue)) {
|
|
139
|
+
const last = currentValue.at(-1);
|
|
140
|
+
deepAssign(last, { type, keys: keys.slice(1), value });
|
|
141
|
+
return target;
|
|
142
|
+
}
|
|
143
|
+
if (isObject(currentValue)) {
|
|
144
|
+
deepAssign(currentValue, { type, keys: keys.slice(1), value });
|
|
145
|
+
return target;
|
|
146
|
+
}
|
|
147
|
+
throw new Error("Unexpected assign");
|
|
148
|
+
}
|
|
149
|
+
function deepAssignTableArray(target, table) {
|
|
150
|
+
const { type, keys, value } = table;
|
|
151
|
+
const currentValue = getTargetValue(target, keys);
|
|
152
|
+
if (currentValue === undefined) {
|
|
153
|
+
return Object.assign(target, unflat(keys, [value]));
|
|
154
|
+
}
|
|
155
|
+
if (Array.isArray(currentValue)) {
|
|
156
|
+
if (table.keys.length === 1) {
|
|
157
|
+
currentValue.push(value);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
const last = currentValue.at(-1);
|
|
161
|
+
deepAssign(last, {
|
|
162
|
+
type: table.type,
|
|
163
|
+
keys: table.keys.slice(1),
|
|
164
|
+
value: table.value,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
return target;
|
|
168
|
+
}
|
|
169
|
+
if (isObject(currentValue)) {
|
|
170
|
+
deepAssign(currentValue, { type, keys: keys.slice(1), value });
|
|
171
|
+
return target;
|
|
172
|
+
}
|
|
173
|
+
throw new Error("Unexpected assign");
|
|
174
|
+
}
|
|
175
|
+
export function deepAssign(target, body) {
|
|
176
|
+
switch (body.type) {
|
|
177
|
+
case "Block":
|
|
178
|
+
return deepMerge(target, body.value);
|
|
179
|
+
case "Table":
|
|
180
|
+
return deepAssignTable(target, body);
|
|
181
|
+
case "TableArray":
|
|
182
|
+
return deepAssignTableArray(target, body);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
// ---------------------------------
|
|
186
|
+
// Parser combinators and generators
|
|
187
|
+
// ---------------------------------
|
|
188
|
+
// deno-lint-ignore no-explicit-any
|
|
189
|
+
function or(parsers) {
|
|
190
|
+
return (scanner) => {
|
|
191
|
+
for (const parse of parsers) {
|
|
192
|
+
const result = parse(scanner);
|
|
193
|
+
if (result.ok)
|
|
194
|
+
return result;
|
|
195
|
+
}
|
|
196
|
+
return failure();
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
/** Join the parse results of the given parser into an array.
|
|
200
|
+
*
|
|
201
|
+
* If the parser fails at the first attempt, it will return an empty array.
|
|
202
|
+
*/
|
|
203
|
+
function join(parser, separator) {
|
|
204
|
+
const Separator = character(separator);
|
|
205
|
+
return (scanner) => {
|
|
206
|
+
const out = [];
|
|
207
|
+
const first = parser(scanner);
|
|
208
|
+
if (!first.ok)
|
|
209
|
+
return success(out);
|
|
210
|
+
out.push(first.body);
|
|
211
|
+
while (!scanner.eof()) {
|
|
212
|
+
if (!Separator(scanner).ok)
|
|
213
|
+
break;
|
|
214
|
+
const result = parser(scanner);
|
|
215
|
+
if (!result.ok) {
|
|
216
|
+
throw new SyntaxError(`Invalid token after "${separator}"`);
|
|
217
|
+
}
|
|
218
|
+
out.push(result.body);
|
|
219
|
+
}
|
|
220
|
+
return success(out);
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
/** Join the parse results of the given parser into an array.
|
|
224
|
+
*
|
|
225
|
+
* This requires the parser to succeed at least once.
|
|
226
|
+
*/
|
|
227
|
+
function join1(parser, separator) {
|
|
228
|
+
const Separator = character(separator);
|
|
229
|
+
return (scanner) => {
|
|
230
|
+
const first = parser(scanner);
|
|
231
|
+
if (!first.ok)
|
|
232
|
+
return failure();
|
|
233
|
+
const out = [first.body];
|
|
234
|
+
while (!scanner.eof()) {
|
|
235
|
+
if (!Separator(scanner).ok)
|
|
236
|
+
break;
|
|
237
|
+
const result = parser(scanner);
|
|
238
|
+
if (!result.ok) {
|
|
239
|
+
throw new SyntaxError(`Invalid token after "${separator}"`);
|
|
240
|
+
}
|
|
241
|
+
out.push(result.body);
|
|
242
|
+
}
|
|
243
|
+
return success(out);
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
function kv(keyParser, separator, valueParser) {
|
|
247
|
+
const Separator = character(separator);
|
|
248
|
+
return (scanner) => {
|
|
249
|
+
const position = scanner.position;
|
|
250
|
+
const key = keyParser(scanner);
|
|
251
|
+
if (!key.ok)
|
|
252
|
+
return failure();
|
|
253
|
+
const sep = Separator(scanner);
|
|
254
|
+
if (!sep.ok) {
|
|
255
|
+
throw new SyntaxError(`key/value pair doesn't have "${separator}"`);
|
|
256
|
+
}
|
|
257
|
+
const value = valueParser(scanner);
|
|
258
|
+
if (!value.ok) {
|
|
259
|
+
const lineEndIndex = scanner.source.indexOf("\n", scanner.position);
|
|
260
|
+
const endPosition = lineEndIndex > 0
|
|
261
|
+
? lineEndIndex
|
|
262
|
+
: scanner.source.length;
|
|
263
|
+
const line = scanner.source.slice(position, endPosition);
|
|
264
|
+
throw new SyntaxError(`Cannot parse value on line '${line}'`);
|
|
265
|
+
}
|
|
266
|
+
return success(unflat(key.body, value.body));
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
function merge(parser) {
|
|
270
|
+
return (scanner) => {
|
|
271
|
+
const result = parser(scanner);
|
|
272
|
+
if (!result.ok)
|
|
273
|
+
return failure();
|
|
274
|
+
let body = { __proto__: null };
|
|
275
|
+
for (const record of result.body) {
|
|
276
|
+
if (typeof record === "object" && record !== null) {
|
|
277
|
+
body = deepMerge(body, record);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
return success(body);
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
function repeat(parser) {
|
|
284
|
+
return (scanner) => {
|
|
285
|
+
const body = [];
|
|
286
|
+
while (!scanner.eof()) {
|
|
287
|
+
const result = parser(scanner);
|
|
288
|
+
if (!result.ok)
|
|
289
|
+
break;
|
|
290
|
+
body.push(result.body);
|
|
291
|
+
scanner.nextUntilChar();
|
|
292
|
+
}
|
|
293
|
+
if (body.length === 0)
|
|
294
|
+
return failure();
|
|
295
|
+
return success(body);
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
function surround(left, parser, right) {
|
|
299
|
+
const Left = character(left);
|
|
300
|
+
const Right = character(right);
|
|
301
|
+
return (scanner) => {
|
|
302
|
+
if (!Left(scanner).ok) {
|
|
303
|
+
return failure();
|
|
304
|
+
}
|
|
305
|
+
const result = parser(scanner);
|
|
306
|
+
if (!result.ok) {
|
|
307
|
+
throw new SyntaxError(`Invalid token after "${left}"`);
|
|
308
|
+
}
|
|
309
|
+
if (!Right(scanner).ok) {
|
|
310
|
+
throw new SyntaxError(`Not closed by "${right}" after started with "${left}"`);
|
|
311
|
+
}
|
|
312
|
+
return success(result.body);
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
function character(str) {
|
|
316
|
+
return (scanner) => {
|
|
317
|
+
scanner.skipWhitespaces();
|
|
318
|
+
if (!scanner.startsWith(str))
|
|
319
|
+
return failure();
|
|
320
|
+
scanner.next(str.length);
|
|
321
|
+
scanner.skipWhitespaces();
|
|
322
|
+
return success(undefined);
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
// -----------------------
|
|
326
|
+
// Parser components
|
|
327
|
+
// -----------------------
|
|
328
|
+
const BARE_KEY_REGEXP = /[A-Za-z0-9_-]+/y;
|
|
329
|
+
export function bareKey(scanner) {
|
|
330
|
+
scanner.skipWhitespaces();
|
|
331
|
+
const key = scanner.match(BARE_KEY_REGEXP)?.[0];
|
|
332
|
+
if (!key)
|
|
333
|
+
return failure();
|
|
334
|
+
scanner.next(key.length);
|
|
335
|
+
return success(key);
|
|
336
|
+
}
|
|
337
|
+
function escapeSequence(scanner) {
|
|
338
|
+
if (scanner.char() !== "\\")
|
|
339
|
+
return failure();
|
|
340
|
+
scanner.next();
|
|
341
|
+
// See https://toml.io/en/v1.0.0-rc.3#string
|
|
342
|
+
switch (scanner.char()) {
|
|
343
|
+
case "b":
|
|
344
|
+
scanner.next();
|
|
345
|
+
return success("\b");
|
|
346
|
+
case "t":
|
|
347
|
+
scanner.next();
|
|
348
|
+
return success("\t");
|
|
349
|
+
case "n":
|
|
350
|
+
scanner.next();
|
|
351
|
+
return success("\n");
|
|
352
|
+
case "f":
|
|
353
|
+
scanner.next();
|
|
354
|
+
return success("\f");
|
|
355
|
+
case "r":
|
|
356
|
+
scanner.next();
|
|
357
|
+
return success("\r");
|
|
358
|
+
case "u":
|
|
359
|
+
case "U": {
|
|
360
|
+
// Unicode character
|
|
361
|
+
const codePointLen = scanner.char() === "u" ? 4 : 6;
|
|
362
|
+
const codePoint = parseInt("0x" + scanner.slice(1, 1 + codePointLen), 16);
|
|
363
|
+
const str = String.fromCodePoint(codePoint);
|
|
364
|
+
scanner.next(codePointLen + 1);
|
|
365
|
+
return success(str);
|
|
366
|
+
}
|
|
367
|
+
case '"':
|
|
368
|
+
scanner.next();
|
|
369
|
+
return success('"');
|
|
370
|
+
case "\\":
|
|
371
|
+
scanner.next();
|
|
372
|
+
return success("\\");
|
|
373
|
+
default:
|
|
374
|
+
throw new SyntaxError(`Invalid escape sequence: \\${scanner.char()}`);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
export function basicString(scanner) {
|
|
378
|
+
scanner.skipWhitespaces();
|
|
379
|
+
if (scanner.char() !== '"')
|
|
380
|
+
return failure();
|
|
381
|
+
scanner.next();
|
|
382
|
+
const acc = [];
|
|
383
|
+
while (scanner.char() !== '"' && !scanner.eof()) {
|
|
384
|
+
if (scanner.char() === "\n") {
|
|
385
|
+
throw new SyntaxError("Single-line string cannot contain EOL");
|
|
386
|
+
}
|
|
387
|
+
const escapedChar = escapeSequence(scanner);
|
|
388
|
+
if (escapedChar.ok) {
|
|
389
|
+
acc.push(escapedChar.body);
|
|
390
|
+
}
|
|
391
|
+
else {
|
|
392
|
+
acc.push(scanner.char());
|
|
393
|
+
scanner.next();
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
if (scanner.eof()) {
|
|
397
|
+
throw new SyntaxError(`Single-line string is not closed:\n${acc.join("")}`);
|
|
398
|
+
}
|
|
399
|
+
scanner.next(); // skip last '""
|
|
400
|
+
return success(acc.join(""));
|
|
401
|
+
}
|
|
402
|
+
export function literalString(scanner) {
|
|
403
|
+
scanner.skipWhitespaces();
|
|
404
|
+
if (scanner.char() !== "'")
|
|
405
|
+
return failure();
|
|
406
|
+
scanner.next();
|
|
407
|
+
const acc = [];
|
|
408
|
+
while (scanner.char() !== "'" && !scanner.eof()) {
|
|
409
|
+
if (scanner.char() === "\n") {
|
|
410
|
+
throw new SyntaxError("Single-line string cannot contain EOL");
|
|
411
|
+
}
|
|
412
|
+
acc.push(scanner.char());
|
|
413
|
+
scanner.next();
|
|
414
|
+
}
|
|
415
|
+
if (scanner.eof()) {
|
|
416
|
+
throw new SyntaxError(`Single-line string is not closed:\n${acc.join("")}`);
|
|
417
|
+
}
|
|
418
|
+
scanner.next(); // skip last "'"
|
|
419
|
+
return success(acc.join(""));
|
|
420
|
+
}
|
|
421
|
+
export function multilineBasicString(scanner) {
|
|
422
|
+
scanner.skipWhitespaces();
|
|
423
|
+
if (!scanner.startsWith('"""'))
|
|
424
|
+
return failure();
|
|
425
|
+
scanner.next(3);
|
|
426
|
+
if (scanner.char() === "\n") {
|
|
427
|
+
// The first newline (LF) is trimmed
|
|
428
|
+
scanner.next();
|
|
429
|
+
}
|
|
430
|
+
else if (scanner.startsWith("\r\n")) {
|
|
431
|
+
// The first newline (CRLF) is trimmed
|
|
432
|
+
scanner.next(2);
|
|
433
|
+
}
|
|
434
|
+
const acc = [];
|
|
435
|
+
while (!scanner.startsWith('"""') && !scanner.eof()) {
|
|
436
|
+
// line ending backslash
|
|
437
|
+
if (scanner.startsWith("\\\n")) {
|
|
438
|
+
scanner.next();
|
|
439
|
+
scanner.nextUntilChar({ skipComments: false });
|
|
440
|
+
continue;
|
|
441
|
+
}
|
|
442
|
+
else if (scanner.startsWith("\\\r\n")) {
|
|
443
|
+
scanner.next();
|
|
444
|
+
scanner.nextUntilChar({ skipComments: false });
|
|
445
|
+
continue;
|
|
446
|
+
}
|
|
447
|
+
const escapedChar = escapeSequence(scanner);
|
|
448
|
+
if (escapedChar.ok) {
|
|
449
|
+
acc.push(escapedChar.body);
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
acc.push(scanner.char());
|
|
453
|
+
scanner.next();
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
if (scanner.eof()) {
|
|
457
|
+
throw new SyntaxError(`Multi-line string is not closed:\n${acc.join("")}`);
|
|
458
|
+
}
|
|
459
|
+
// if ends with 4 `"`, push the fist `"` to string
|
|
460
|
+
if (scanner.char(3) === '"') {
|
|
461
|
+
acc.push('"');
|
|
462
|
+
scanner.next();
|
|
463
|
+
}
|
|
464
|
+
scanner.next(3); // skip last '""""
|
|
465
|
+
return success(acc.join(""));
|
|
466
|
+
}
|
|
467
|
+
export function multilineLiteralString(scanner) {
|
|
468
|
+
scanner.skipWhitespaces();
|
|
469
|
+
if (!scanner.startsWith("'''"))
|
|
470
|
+
return failure();
|
|
471
|
+
scanner.next(3);
|
|
472
|
+
if (scanner.char() === "\n") {
|
|
473
|
+
// The first newline (LF) is trimmed
|
|
474
|
+
scanner.next();
|
|
475
|
+
}
|
|
476
|
+
else if (scanner.startsWith("\r\n")) {
|
|
477
|
+
// The first newline (CRLF) is trimmed
|
|
478
|
+
scanner.next(2);
|
|
479
|
+
}
|
|
480
|
+
const acc = [];
|
|
481
|
+
while (!scanner.startsWith("'''") && !scanner.eof()) {
|
|
482
|
+
acc.push(scanner.char());
|
|
483
|
+
scanner.next();
|
|
484
|
+
}
|
|
485
|
+
if (scanner.eof()) {
|
|
486
|
+
throw new SyntaxError(`Multi-line string is not closed:\n${acc.join("")}`);
|
|
487
|
+
}
|
|
488
|
+
// if ends with 4 `'`, push the fist `'` to string
|
|
489
|
+
if (scanner.char(3) === "'") {
|
|
490
|
+
acc.push("'");
|
|
491
|
+
scanner.next();
|
|
492
|
+
}
|
|
493
|
+
scanner.next(3); // skip last "'''"
|
|
494
|
+
return success(acc.join(""));
|
|
495
|
+
}
|
|
496
|
+
const BOOLEAN_REGEXP = /(?:true|false)\b/y;
|
|
497
|
+
export function boolean(scanner) {
|
|
498
|
+
scanner.skipWhitespaces();
|
|
499
|
+
const match = scanner.match(BOOLEAN_REGEXP);
|
|
500
|
+
if (!match)
|
|
501
|
+
return failure();
|
|
502
|
+
const string = match[0];
|
|
503
|
+
scanner.next(string.length);
|
|
504
|
+
const value = string === "true";
|
|
505
|
+
return success(value);
|
|
506
|
+
}
|
|
507
|
+
const INFINITY_MAP = new Map([
|
|
508
|
+
["inf", Infinity],
|
|
509
|
+
["+inf", Infinity],
|
|
510
|
+
["-inf", -Infinity],
|
|
511
|
+
]);
|
|
512
|
+
const INFINITY_REGEXP = /[+-]?inf\b/y;
|
|
513
|
+
export function infinity(scanner) {
|
|
514
|
+
scanner.skipWhitespaces();
|
|
515
|
+
const match = scanner.match(INFINITY_REGEXP);
|
|
516
|
+
if (!match)
|
|
517
|
+
return failure();
|
|
518
|
+
const string = match[0];
|
|
519
|
+
scanner.next(string.length);
|
|
520
|
+
const value = INFINITY_MAP.get(string);
|
|
521
|
+
return success(value);
|
|
522
|
+
}
|
|
523
|
+
const NAN_REGEXP = /[+-]?nan\b/y;
|
|
524
|
+
export function nan(scanner) {
|
|
525
|
+
scanner.skipWhitespaces();
|
|
526
|
+
const match = scanner.match(NAN_REGEXP);
|
|
527
|
+
if (!match)
|
|
528
|
+
return failure();
|
|
529
|
+
const string = match[0];
|
|
530
|
+
scanner.next(string.length);
|
|
531
|
+
const value = NaN;
|
|
532
|
+
return success(value);
|
|
533
|
+
}
|
|
534
|
+
export const dottedKey = join1(or([bareKey, basicString, literalString]), ".");
|
|
535
|
+
const BINARY_REGEXP = /0b[01]+(?:_[01]+)*\b/y;
|
|
536
|
+
export function binary(scanner) {
|
|
537
|
+
scanner.skipWhitespaces();
|
|
538
|
+
const match = scanner.match(BINARY_REGEXP)?.[0];
|
|
539
|
+
if (!match)
|
|
540
|
+
return failure();
|
|
541
|
+
scanner.next(match.length);
|
|
542
|
+
const value = match.slice(2).replaceAll("_", "");
|
|
543
|
+
const number = parseInt(value, 2);
|
|
544
|
+
return isNaN(number) ? failure() : success(number);
|
|
545
|
+
}
|
|
546
|
+
const OCTAL_REGEXP = /0o[0-7]+(?:_[0-7]+)*\b/y;
|
|
547
|
+
export function octal(scanner) {
|
|
548
|
+
scanner.skipWhitespaces();
|
|
549
|
+
const match = scanner.match(OCTAL_REGEXP)?.[0];
|
|
550
|
+
if (!match)
|
|
551
|
+
return failure();
|
|
552
|
+
scanner.next(match.length);
|
|
553
|
+
const value = match.slice(2).replaceAll("_", "");
|
|
554
|
+
const number = parseInt(value, 8);
|
|
555
|
+
return isNaN(number) ? failure() : success(number);
|
|
556
|
+
}
|
|
557
|
+
const HEX_REGEXP = /0x[0-9a-f]+(?:_[0-9a-f]+)*\b/yi;
|
|
558
|
+
export function hex(scanner) {
|
|
559
|
+
scanner.skipWhitespaces();
|
|
560
|
+
const match = scanner.match(HEX_REGEXP)?.[0];
|
|
561
|
+
if (!match)
|
|
562
|
+
return failure();
|
|
563
|
+
scanner.next(match.length);
|
|
564
|
+
const value = match.slice(2).replaceAll("_", "");
|
|
565
|
+
const number = parseInt(value, 16);
|
|
566
|
+
return isNaN(number) ? failure() : success(number);
|
|
567
|
+
}
|
|
568
|
+
const INTEGER_REGEXP = /[+-]?(?:0|[1-9][0-9]*(?:_[0-9]+)*)\b/y;
|
|
569
|
+
export function integer(scanner) {
|
|
570
|
+
scanner.skipWhitespaces();
|
|
571
|
+
const match = scanner.match(INTEGER_REGEXP)?.[0];
|
|
572
|
+
if (!match)
|
|
573
|
+
return failure();
|
|
574
|
+
scanner.next(match.length);
|
|
575
|
+
const value = match.replaceAll("_", "");
|
|
576
|
+
const int = parseInt(value, 10);
|
|
577
|
+
return success(int);
|
|
578
|
+
}
|
|
579
|
+
const FLOAT_REGEXP = /[+-]?(?:0|[1-9][0-9]*(?:_[0-9]+)*)(?:\.[0-9]+(?:_[0-9]+)*)?(?:e[+-]?[0-9]+(?:_[0-9]+)*)?\b/yi;
|
|
580
|
+
export function float(scanner) {
|
|
581
|
+
scanner.skipWhitespaces();
|
|
582
|
+
const match = scanner.match(FLOAT_REGEXP)?.[0];
|
|
583
|
+
if (!match)
|
|
584
|
+
return failure();
|
|
585
|
+
scanner.next(match.length);
|
|
586
|
+
const value = match.replaceAll("_", "");
|
|
587
|
+
const float = parseFloat(value);
|
|
588
|
+
if (isNaN(float))
|
|
589
|
+
return failure();
|
|
590
|
+
return success(float);
|
|
591
|
+
}
|
|
592
|
+
const DATE_TIME_REGEXP = /(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})(?:[ 0-9TZ.:+-]+)?\b/y;
|
|
593
|
+
export function dateTime(scanner) {
|
|
594
|
+
scanner.skipWhitespaces();
|
|
595
|
+
const match = scanner.match(DATE_TIME_REGEXP);
|
|
596
|
+
if (!match)
|
|
597
|
+
return failure();
|
|
598
|
+
const string = match[0];
|
|
599
|
+
scanner.next(string.length);
|
|
600
|
+
const groups = match.groups;
|
|
601
|
+
// special case if month is February
|
|
602
|
+
if (groups.month == "02") {
|
|
603
|
+
const days = parseInt(groups.day);
|
|
604
|
+
if (days > 29) {
|
|
605
|
+
throw new SyntaxError(`Invalid date string "${match}"`);
|
|
606
|
+
}
|
|
607
|
+
const year = parseInt(groups.year);
|
|
608
|
+
if (days > 28 && !isLeap(year)) {
|
|
609
|
+
throw new SyntaxError(`Invalid date string "${match}"`);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
const date = new Date(string.trim());
|
|
613
|
+
// invalid date
|
|
614
|
+
if (isNaN(date.getTime())) {
|
|
615
|
+
throw new SyntaxError(`Invalid date string "${match}"`);
|
|
616
|
+
}
|
|
617
|
+
return success(date);
|
|
618
|
+
}
|
|
619
|
+
const LOCAL_TIME_REGEXP = /(\d{2}):(\d{2}):(\d{2})(?:\.[0-9]+)?\b/y;
|
|
620
|
+
export function localTime(scanner) {
|
|
621
|
+
scanner.skipWhitespaces();
|
|
622
|
+
const match = scanner.match(LOCAL_TIME_REGEXP)?.[0];
|
|
623
|
+
if (!match)
|
|
624
|
+
return failure();
|
|
625
|
+
scanner.next(match.length);
|
|
626
|
+
return success(match);
|
|
627
|
+
}
|
|
628
|
+
export function arrayValue(scanner) {
|
|
629
|
+
scanner.skipWhitespaces();
|
|
630
|
+
if (scanner.char() !== "[")
|
|
631
|
+
return failure();
|
|
632
|
+
scanner.next();
|
|
633
|
+
const array = [];
|
|
634
|
+
while (!scanner.eof()) {
|
|
635
|
+
scanner.nextUntilChar();
|
|
636
|
+
const result = value(scanner);
|
|
637
|
+
if (!result.ok)
|
|
638
|
+
break;
|
|
639
|
+
array.push(result.body);
|
|
640
|
+
scanner.skipWhitespaces();
|
|
641
|
+
// may have a next item, but trailing comma is allowed at array
|
|
642
|
+
if (scanner.char() !== ",")
|
|
643
|
+
break;
|
|
644
|
+
scanner.next();
|
|
645
|
+
}
|
|
646
|
+
scanner.nextUntilChar();
|
|
647
|
+
if (scanner.char() !== "]")
|
|
648
|
+
throw new SyntaxError("Array is not closed");
|
|
649
|
+
scanner.next();
|
|
650
|
+
return success(array);
|
|
651
|
+
}
|
|
652
|
+
export function inlineTable(scanner) {
|
|
653
|
+
scanner.nextUntilChar();
|
|
654
|
+
if (scanner.char(1) === "}") {
|
|
655
|
+
scanner.next(2);
|
|
656
|
+
return success({ __proto__: null });
|
|
657
|
+
}
|
|
658
|
+
const pairs = surround("{", join(pair, ","), "}")(scanner);
|
|
659
|
+
if (!pairs.ok)
|
|
660
|
+
return failure();
|
|
661
|
+
let table = { __proto__: null };
|
|
662
|
+
for (const pair of pairs.body) {
|
|
663
|
+
table = deepMerge(table, pair);
|
|
664
|
+
}
|
|
665
|
+
return success(table);
|
|
666
|
+
}
|
|
667
|
+
export const value = or([
|
|
668
|
+
multilineBasicString,
|
|
669
|
+
multilineLiteralString,
|
|
670
|
+
basicString,
|
|
671
|
+
literalString,
|
|
672
|
+
boolean,
|
|
673
|
+
infinity,
|
|
674
|
+
nan,
|
|
675
|
+
dateTime,
|
|
676
|
+
localTime,
|
|
677
|
+
binary,
|
|
678
|
+
octal,
|
|
679
|
+
hex,
|
|
680
|
+
float,
|
|
681
|
+
integer,
|
|
682
|
+
arrayValue,
|
|
683
|
+
inlineTable,
|
|
684
|
+
]);
|
|
685
|
+
export const pair = kv(dottedKey, "=", value);
|
|
686
|
+
export function block(scanner) {
|
|
687
|
+
scanner.nextUntilChar();
|
|
688
|
+
const result = merge(repeat(pair))(scanner);
|
|
689
|
+
if (result.ok)
|
|
690
|
+
return success({ type: "Block", value: result.body });
|
|
691
|
+
return failure();
|
|
692
|
+
}
|
|
693
|
+
export const tableHeader = surround("[", dottedKey, "]");
|
|
694
|
+
export function table(scanner) {
|
|
695
|
+
scanner.nextUntilChar();
|
|
696
|
+
const header = tableHeader(scanner);
|
|
697
|
+
if (!header.ok)
|
|
698
|
+
return failure();
|
|
699
|
+
scanner.nextUntilChar();
|
|
700
|
+
const b = block(scanner);
|
|
701
|
+
return success({
|
|
702
|
+
type: "Table",
|
|
703
|
+
keys: header.body,
|
|
704
|
+
value: b.ok ? b.body.value : { __proto__: null },
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
export const tableArrayHeader = surround("[[", dottedKey, "]]");
|
|
708
|
+
export function tableArray(scanner) {
|
|
709
|
+
scanner.nextUntilChar();
|
|
710
|
+
const header = tableArrayHeader(scanner);
|
|
711
|
+
if (!header.ok)
|
|
712
|
+
return failure();
|
|
713
|
+
scanner.nextUntilChar();
|
|
714
|
+
const b = block(scanner);
|
|
715
|
+
return success({
|
|
716
|
+
type: "TableArray",
|
|
717
|
+
keys: header.body,
|
|
718
|
+
value: b.ok ? b.body.value : { __proto__: null },
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
export function toml(scanner) {
|
|
722
|
+
const blocks = repeat(or([block, tableArray, table]))(scanner);
|
|
723
|
+
if (!blocks.ok)
|
|
724
|
+
return success({ __proto__: null });
|
|
725
|
+
const body = blocks.body.reduce(deepAssign, { __proto__: null });
|
|
726
|
+
return success(body);
|
|
727
|
+
}
|
|
728
|
+
function createParseErrorMessage(scanner, message) {
|
|
729
|
+
const string = scanner.source.slice(0, scanner.position);
|
|
730
|
+
const lines = string.split("\n");
|
|
731
|
+
const row = lines.length;
|
|
732
|
+
const column = lines.at(-1)?.length ?? 0;
|
|
733
|
+
return `Parse error on line ${row}, column ${column}: ${message}`;
|
|
734
|
+
}
|
|
735
|
+
export function parserFactory(parser) {
|
|
736
|
+
return (tomlString) => {
|
|
737
|
+
const scanner = new Scanner(tomlString);
|
|
738
|
+
try {
|
|
739
|
+
const result = parser(scanner);
|
|
740
|
+
if (result.ok && scanner.eof())
|
|
741
|
+
return result.body;
|
|
742
|
+
const message = `Unexpected character: "${scanner.char()}"`;
|
|
743
|
+
throw new SyntaxError(createParseErrorMessage(scanner, message));
|
|
744
|
+
}
|
|
745
|
+
catch (error) {
|
|
746
|
+
if (error instanceof Error) {
|
|
747
|
+
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
|
|
748
|
+
}
|
|
749
|
+
const message = "Invalid error type caught";
|
|
750
|
+
throw new SyntaxError(createParseErrorMessage(scanner, message));
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
}
|