@marshulll/openclaw-wecom 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +3 -0
- package/README.md +3 -0
- package/README.zh.md +3 -0
- package/docs/INSTALL.md +3 -0
- package/node_modules/fast-xml-parser/CHANGELOG.md +606 -0
- package/node_modules/fast-xml-parser/LICENSE +21 -0
- package/node_modules/fast-xml-parser/README.md +237 -0
- package/node_modules/fast-xml-parser/package.json +72 -0
- package/node_modules/fast-xml-parser/src/cli/cli.js +93 -0
- package/node_modules/fast-xml-parser/src/cli/man.js +12 -0
- package/node_modules/fast-xml-parser/src/cli/read.js +92 -0
- package/node_modules/fast-xml-parser/src/fxp.d.ts +418 -0
- package/node_modules/fast-xml-parser/src/fxp.js +11 -0
- package/node_modules/fast-xml-parser/src/ignoreAttributes.js +20 -0
- package/node_modules/fast-xml-parser/src/util.js +72 -0
- package/node_modules/fast-xml-parser/src/v5/CharsSymbol.js +16 -0
- package/node_modules/fast-xml-parser/src/v5/EntitiesParser.js +107 -0
- package/node_modules/fast-xml-parser/src/v5/OptionsBuilder.js +64 -0
- package/node_modules/fast-xml-parser/src/v5/OutputBuilders/BaseOutputBuilder.js +71 -0
- package/node_modules/fast-xml-parser/src/v5/OutputBuilders/JsArrBuilder.js +103 -0
- package/node_modules/fast-xml-parser/src/v5/OutputBuilders/JsMinArrBuilder.js +102 -0
- package/node_modules/fast-xml-parser/src/v5/OutputBuilders/JsObjBuilder.js +156 -0
- package/node_modules/fast-xml-parser/src/v5/OutputBuilders/ParserOptionsBuilder.js +99 -0
- package/node_modules/fast-xml-parser/src/v5/Report.js +0 -0
- package/node_modules/fast-xml-parser/src/v5/TagPath.js +81 -0
- package/node_modules/fast-xml-parser/src/v5/TagPathMatcher.js +15 -0
- package/node_modules/fast-xml-parser/src/v5/XMLParser.js +85 -0
- package/node_modules/fast-xml-parser/src/v5/Xml2JsParser.js +237 -0
- package/node_modules/fast-xml-parser/src/v5/XmlPartReader.js +216 -0
- package/node_modules/fast-xml-parser/src/v5/XmlSpecialTagsReader.js +118 -0
- package/node_modules/fast-xml-parser/src/v5/inputSource/BufferSource.js +118 -0
- package/node_modules/fast-xml-parser/src/v5/inputSource/StringSource.js +123 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/EntitiesParser.js +107 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/booleanParser.js +23 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/booleanParserExt.js +20 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/currency.js +40 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/join.js +14 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/number.js +16 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/trim.js +8 -0
- package/node_modules/fast-xml-parser/src/v6/CharsSymbol.js +16 -0
- package/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +104 -0
- package/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +61 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +69 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +103 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +100 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +154 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +94 -0
- package/node_modules/fast-xml-parser/src/v6/Report.js +0 -0
- package/node_modules/fast-xml-parser/src/v6/TagPath.js +81 -0
- package/node_modules/fast-xml-parser/src/v6/TagPathMatcher.js +13 -0
- package/node_modules/fast-xml-parser/src/v6/XMLParser.js +83 -0
- package/node_modules/fast-xml-parser/src/v6/Xml2JsParser.js +235 -0
- package/node_modules/fast-xml-parser/src/v6/XmlPartReader.js +210 -0
- package/node_modules/fast-xml-parser/src/v6/XmlSpecialTagsReader.js +111 -0
- package/node_modules/fast-xml-parser/src/v6/inputSource/BufferSource.js +116 -0
- package/node_modules/fast-xml-parser/src/v6/inputSource/StringSource.js +121 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +105 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParser.js +22 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParserExt.js +19 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/currency.js +38 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/join.js +13 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/number.js +14 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/trim.js +6 -0
- package/node_modules/fast-xml-parser/src/validator.js +425 -0
- package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +286 -0
- package/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js +135 -0
- package/node_modules/fast-xml-parser/src/xmlbuilder/prettifyJs2Xml.js +0 -0
- package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +153 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +48 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +606 -0
- package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +58 -0
- package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +113 -0
- package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +25 -0
- package/node_modules/strnum/.vscode/launch.json +25 -0
- package/node_modules/strnum/CHANGELOG.md +22 -0
- package/node_modules/strnum/LICENSE +21 -0
- package/node_modules/strnum/README.md +97 -0
- package/node_modules/strnum/package.json +30 -0
- package/node_modules/strnum/strnum.js +111 -0
- package/node_modules/strnum/strnum.test.js +165 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +208 -0
- package/node_modules/zod/index.cjs +33 -0
- package/node_modules/zod/index.d.cts +4 -0
- package/node_modules/zod/index.d.ts +4 -0
- package/node_modules/zod/index.js +4 -0
- package/node_modules/zod/package.json +118 -0
- package/node_modules/zod/src/index.ts +4 -0
- package/node_modules/zod/src/v3/ZodError.ts +330 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +56 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +551 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +257 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +434 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +916 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5136 -0
- package/node_modules/zod/src/v4/classic/checks.ts +30 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +66 -0
- package/node_modules/zod/src/v4/classic/errors.ts +75 -0
- package/node_modules/zod/src/v4/classic/external.ts +50 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +90 -0
- package/node_modules/zod/src/v4/classic/parse.ts +33 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2054 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +210 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +63 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +352 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +31 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +296 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +313 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +619 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +527 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +91 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +268 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +829 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +34 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +171 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +108 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +92 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +196 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +86 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +247 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +563 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +123 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +147 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +127 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +37 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +298 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +342 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +356 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +532 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +204 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +57 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +881 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +66 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +758 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +2314 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +250 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +163 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +94 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1594 -0
- package/node_modules/zod/src/v4/core/checks.ts +1283 -0
- package/node_modules/zod/src/v4/core/config.ts +15 -0
- package/node_modules/zod/src/v4/core/core.ts +134 -0
- package/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/node_modules/zod/src/v4/core/errors.ts +424 -0
- package/node_modules/zod/src/v4/core/function.ts +176 -0
- package/node_modules/zod/src/v4/core/index.ts +15 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +143 -0
- package/node_modules/zod/src/v4/core/parse.ts +94 -0
- package/node_modules/zod/src/v4/core/regexes.ts +135 -0
- package/node_modules/zod/src/v4/core/registries.ts +96 -0
- package/node_modules/zod/src/v4/core/schemas.ts +3842 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +64 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +977 -0
- package/node_modules/zod/src/v4/core/util.ts +775 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +125 -0
- package/node_modules/zod/src/v4/locales/az.ts +121 -0
- package/node_modules/zod/src/v4/locales/be.ts +184 -0
- package/node_modules/zod/src/v4/locales/ca.ts +127 -0
- package/node_modules/zod/src/v4/locales/cs.ts +142 -0
- package/node_modules/zod/src/v4/locales/de.ts +124 -0
- package/node_modules/zod/src/v4/locales/en.ts +127 -0
- package/node_modules/zod/src/v4/locales/eo.ts +125 -0
- package/node_modules/zod/src/v4/locales/es.ts +125 -0
- package/node_modules/zod/src/v4/locales/fa.ts +134 -0
- package/node_modules/zod/src/v4/locales/fi.ts +131 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +126 -0
- package/node_modules/zod/src/v4/locales/fr.ts +124 -0
- package/node_modules/zod/src/v4/locales/he.ts +125 -0
- package/node_modules/zod/src/v4/locales/hu.ts +126 -0
- package/node_modules/zod/src/v4/locales/id.ts +125 -0
- package/node_modules/zod/src/v4/locales/index.ts +39 -0
- package/node_modules/zod/src/v4/locales/it.ts +125 -0
- package/node_modules/zod/src/v4/locales/ja.ts +122 -0
- package/node_modules/zod/src/v4/locales/kh.ts +126 -0
- package/node_modules/zod/src/v4/locales/ko.ts +131 -0
- package/node_modules/zod/src/v4/locales/mk.ts +127 -0
- package/node_modules/zod/src/v4/locales/ms.ts +124 -0
- package/node_modules/zod/src/v4/locales/nl.ts +126 -0
- package/node_modules/zod/src/v4/locales/no.ts +124 -0
- package/node_modules/zod/src/v4/locales/ota.ts +125 -0
- package/node_modules/zod/src/v4/locales/pl.ts +126 -0
- package/node_modules/zod/src/v4/locales/ps.ts +133 -0
- package/node_modules/zod/src/v4/locales/pt.ts +123 -0
- package/node_modules/zod/src/v4/locales/ru.ts +184 -0
- package/node_modules/zod/src/v4/locales/sl.ts +126 -0
- package/node_modules/zod/src/v4/locales/sv.ts +127 -0
- package/node_modules/zod/src/v4/locales/ta.ts +125 -0
- package/node_modules/zod/src/v4/locales/th.ts +126 -0
- package/node_modules/zod/src/v4/locales/tr.ts +121 -0
- package/node_modules/zod/src/v4/locales/ua.ts +126 -0
- package/node_modules/zod/src/v4/locales/ur.ts +126 -0
- package/node_modules/zod/src/v4/locales/vi.ts +125 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +123 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +125 -0
- package/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +22 -0
- package/node_modules/zod/src/v4/mini/external.ts +40 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +62 -0
- package/node_modules/zod/src/v4/mini/parse.ts +1 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +1579 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +51 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +871 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +185 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +275 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +299 -0
- package/node_modules/zod/src/v4-mini/index.ts +1 -0
- package/node_modules/zod/v3/ZodError.cjs +138 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +133 -0
- package/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +111 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3775 -0
- package/node_modules/zod/v3/types.d.cts +1031 -0
- package/node_modules/zod/v3/types.d.ts +1031 -0
- package/node_modules/zod/v3/types.js +3693 -0
- package/node_modules/zod/v4/classic/checks.cjs +32 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +57 -0
- package/node_modules/zod/v4/classic/compat.d.cts +46 -0
- package/node_modules/zod/v4/classic/compat.d.ts +46 -0
- package/node_modules/zod/v4/classic/compat.js +27 -0
- package/node_modules/zod/v4/classic/errors.cjs +67 -0
- package/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/node_modules/zod/v4/classic/errors.js +41 -0
- package/node_modules/zod/v4/classic/external.cjs +70 -0
- package/node_modules/zod/v4/classic/external.d.cts +13 -0
- package/node_modules/zod/v4/classic/external.d.ts +13 -0
- package/node_modules/zod/v4/classic/external.js +18 -0
- package/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/node_modules/zod/v4/classic/iso.js +30 -0
- package/node_modules/zod/v4/classic/parse.cjs +32 -0
- package/node_modules/zod/v4/classic/parse.d.cts +23 -0
- package/node_modules/zod/v4/classic/parse.d.ts +23 -0
- package/node_modules/zod/v4/classic/parse.js +6 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1109 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +630 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +630 -0
- package/node_modules/zod/v4/classic/schemas.js +1006 -0
- package/node_modules/zod/v4/core/api.cjs +1039 -0
- package/node_modules/zod/v4/core/api.d.cts +284 -0
- package/node_modules/zod/v4/core/api.d.ts +284 -0
- package/node_modules/zod/v4/core/api.js +906 -0
- package/node_modules/zod/v4/core/checks.cjs +591 -0
- package/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/zod/v4/core/checks.js +565 -0
- package/node_modules/zod/v4/core/core.cjs +67 -0
- package/node_modules/zod/v4/core/core.d.cts +49 -0
- package/node_modules/zod/v4/core/core.d.ts +49 -0
- package/node_modules/zod/v4/core/core.js +61 -0
- package/node_modules/zod/v4/core/doc.cjs +39 -0
- package/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/node_modules/zod/v4/core/doc.js +35 -0
- package/node_modules/zod/v4/core/errors.cjs +226 -0
- package/node_modules/zod/v4/core/errors.d.cts +208 -0
- package/node_modules/zod/v4/core/errors.d.ts +208 -0
- package/node_modules/zod/v4/core/errors.js +195 -0
- package/node_modules/zod/v4/core/function.cjs +102 -0
- package/node_modules/zod/v4/core/function.d.cts +52 -0
- package/node_modules/zod/v4/core/function.d.ts +52 -0
- package/node_modules/zod/v4/core/function.js +75 -0
- package/node_modules/zod/v4/core/index.cjs +44 -0
- package/node_modules/zod/v4/core/index.d.cts +15 -0
- package/node_modules/zod/v4/core/index.d.ts +15 -0
- package/node_modules/zod/v4/core/index.js +15 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +87 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +87 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/parse.cjs +87 -0
- package/node_modules/zod/v4/core/parse.d.cts +25 -0
- package/node_modules/zod/v4/core/parse.d.ts +25 -0
- package/node_modules/zod/v4/core/parse.js +57 -0
- package/node_modules/zod/v4/core/regexes.cjs +103 -0
- package/node_modules/zod/v4/core/regexes.d.cts +62 -0
- package/node_modules/zod/v4/core/regexes.d.ts +62 -0
- package/node_modules/zod/v4/core/regexes.js +95 -0
- package/node_modules/zod/v4/core/registries.cjs +56 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +1748 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1041 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1041 -0
- package/node_modules/zod/v4/core/schemas.js +1717 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +55 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +55 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +854 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +88 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +88 -0
- package/node_modules/zod/v4/core/to-json-schema.js +849 -0
- package/node_modules/zod/v4/core/util.cjs +539 -0
- package/node_modules/zod/v4/core/util.d.cts +183 -0
- package/node_modules/zod/v4/core/util.d.ts +183 -0
- package/node_modules/zod/v4/core/util.js +493 -0
- package/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/index.cjs +22 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +3 -0
- package/node_modules/zod/v4/locales/ar.cjs +142 -0
- package/node_modules/zod/v4/locales/ar.d.cts +4 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +116 -0
- package/node_modules/zod/v4/locales/az.cjs +141 -0
- package/node_modules/zod/v4/locales/az.d.cts +4 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +115 -0
- package/node_modules/zod/v4/locales/be.cjs +190 -0
- package/node_modules/zod/v4/locales/be.d.cts +4 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +164 -0
- package/node_modules/zod/v4/locales/ca.cjs +144 -0
- package/node_modules/zod/v4/locales/ca.d.cts +4 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +118 -0
- package/node_modules/zod/v4/locales/cs.cjs +161 -0
- package/node_modules/zod/v4/locales/cs.d.cts +4 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +135 -0
- package/node_modules/zod/v4/locales/de.cjs +142 -0
- package/node_modules/zod/v4/locales/de.d.cts +4 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +116 -0
- package/node_modules/zod/v4/locales/en.cjs +145 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +5 -0
- package/node_modules/zod/v4/locales/en.js +117 -0
- package/node_modules/zod/v4/locales/eo.cjs +144 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +5 -0
- package/node_modules/zod/v4/locales/eo.js +116 -0
- package/node_modules/zod/v4/locales/es.cjs +143 -0
- package/node_modules/zod/v4/locales/es.d.cts +4 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +117 -0
- package/node_modules/zod/v4/locales/fa.cjs +148 -0
- package/node_modules/zod/v4/locales/fa.d.cts +4 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +122 -0
- package/node_modules/zod/v4/locales/fi.cjs +148 -0
- package/node_modules/zod/v4/locales/fi.d.cts +4 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +122 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +143 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +117 -0
- package/node_modules/zod/v4/locales/fr.cjs +142 -0
- package/node_modules/zod/v4/locales/fr.d.cts +4 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +116 -0
- package/node_modules/zod/v4/locales/he.cjs +143 -0
- package/node_modules/zod/v4/locales/he.d.cts +4 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +117 -0
- package/node_modules/zod/v4/locales/hu.cjs +143 -0
- package/node_modules/zod/v4/locales/hu.d.cts +4 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +117 -0
- package/node_modules/zod/v4/locales/id.cjs +142 -0
- package/node_modules/zod/v4/locales/id.d.cts +4 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +116 -0
- package/node_modules/zod/v4/locales/index.cjs +84 -0
- package/node_modules/zod/v4/locales/index.d.cts +39 -0
- package/node_modules/zod/v4/locales/index.d.ts +39 -0
- package/node_modules/zod/v4/locales/index.js +39 -0
- package/node_modules/zod/v4/locales/it.cjs +143 -0
- package/node_modules/zod/v4/locales/it.d.cts +4 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +117 -0
- package/node_modules/zod/v4/locales/ja.cjs +141 -0
- package/node_modules/zod/v4/locales/ja.d.cts +4 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +115 -0
- package/node_modules/zod/v4/locales/kh.cjs +143 -0
- package/node_modules/zod/v4/locales/kh.d.cts +4 -0
- package/node_modules/zod/v4/locales/kh.d.ts +4 -0
- package/node_modules/zod/v4/locales/kh.js +117 -0
- package/node_modules/zod/v4/locales/ko.cjs +147 -0
- package/node_modules/zod/v4/locales/ko.d.cts +4 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +121 -0
- package/node_modules/zod/v4/locales/mk.cjs +144 -0
- package/node_modules/zod/v4/locales/mk.d.cts +4 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +118 -0
- package/node_modules/zod/v4/locales/ms.cjs +142 -0
- package/node_modules/zod/v4/locales/ms.d.cts +4 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +116 -0
- package/node_modules/zod/v4/locales/nl.cjs +143 -0
- package/node_modules/zod/v4/locales/nl.d.cts +4 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +117 -0
- package/node_modules/zod/v4/locales/no.cjs +142 -0
- package/node_modules/zod/v4/locales/no.d.cts +4 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +116 -0
- package/node_modules/zod/v4/locales/ota.cjs +143 -0
- package/node_modules/zod/v4/locales/ota.d.cts +4 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +117 -0
- package/node_modules/zod/v4/locales/pl.cjs +143 -0
- package/node_modules/zod/v4/locales/pl.d.cts +4 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +117 -0
- package/node_modules/zod/v4/locales/ps.cjs +148 -0
- package/node_modules/zod/v4/locales/ps.d.cts +4 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +122 -0
- package/node_modules/zod/v4/locales/pt.cjs +142 -0
- package/node_modules/zod/v4/locales/pt.d.cts +4 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +116 -0
- package/node_modules/zod/v4/locales/ru.cjs +190 -0
- package/node_modules/zod/v4/locales/ru.d.cts +4 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +164 -0
- package/node_modules/zod/v4/locales/sl.cjs +143 -0
- package/node_modules/zod/v4/locales/sl.d.cts +4 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +117 -0
- package/node_modules/zod/v4/locales/sv.cjs +144 -0
- package/node_modules/zod/v4/locales/sv.d.cts +4 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +118 -0
- package/node_modules/zod/v4/locales/ta.cjs +143 -0
- package/node_modules/zod/v4/locales/ta.d.cts +4 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +143 -0
- package/node_modules/zod/v4/locales/th.d.cts +4 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +117 -0
- package/node_modules/zod/v4/locales/tr.cjs +143 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +5 -0
- package/node_modules/zod/v4/locales/tr.js +115 -0
- package/node_modules/zod/v4/locales/ua.cjs +143 -0
- package/node_modules/zod/v4/locales/ua.d.cts +4 -0
- package/node_modules/zod/v4/locales/ua.d.ts +4 -0
- package/node_modules/zod/v4/locales/ua.js +117 -0
- package/node_modules/zod/v4/locales/ur.cjs +143 -0
- package/node_modules/zod/v4/locales/ur.d.cts +4 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +117 -0
- package/node_modules/zod/v4/locales/vi.cjs +142 -0
- package/node_modules/zod/v4/locales/vi.d.cts +4 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +116 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +142 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +116 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +143 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +117 -0
- package/node_modules/zod/v4/mini/checks.cjs +34 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +47 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +17 -0
- package/node_modules/zod/v4/mini/external.cjs +62 -0
- package/node_modules/zod/v4/mini/external.d.cts +11 -0
- package/node_modules/zod/v4/mini/external.d.ts +11 -0
- package/node_modules/zod/v4/mini/external.js +13 -0
- package/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +60 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +30 -0
- package/node_modules/zod/v4/mini/parse.cjs +8 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +839 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +356 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +356 -0
- package/node_modules/zod/v4/mini/schemas.js +732 -0
- package/node_modules/zod/v4-mini/index.cjs +17 -0
- package/node_modules/zod/v4-mini/index.d.cts +1 -0
- package/node_modules/zod/v4-mini/index.d.ts +1 -0
- package/node_modules/zod/v4-mini/index.js +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import StringSource from './inputSource/StringSource.js';
|
|
2
|
+
import BufferSource from './inputSource/BufferSource.js';
|
|
3
|
+
import {readTagExp,readClosingTagName} from './XmlPartReader.js';
|
|
4
|
+
import {readComment, readCdata,readDocType,readPiTag} from './XmlSpecialTagsReader.js';
|
|
5
|
+
import TagPath from './TagPath.js';
|
|
6
|
+
import TagPathMatcher from './TagPathMatcher.js';
|
|
7
|
+
import EntitiesParser from './EntitiesParser.js';
|
|
8
|
+
|
|
9
|
+
//To hold the data of current tag
|
|
10
|
+
//This is usually used to compare jpath expression against current tag
|
|
11
|
+
class TagDetail{
|
|
12
|
+
constructor(name){
|
|
13
|
+
this.name = name;
|
|
14
|
+
this.position = 0;
|
|
15
|
+
// this.attributes = {};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default class Xml2JsParser {
|
|
20
|
+
constructor(options) {
|
|
21
|
+
this.options = options;
|
|
22
|
+
|
|
23
|
+
this.currentTagDetail = null;
|
|
24
|
+
this.tagTextData = "";
|
|
25
|
+
this.tagsStack = [];
|
|
26
|
+
this.entityParser = new EntitiesParser(options.htmlEntities);
|
|
27
|
+
this.stopNodes = [];
|
|
28
|
+
for (let i = 0; i < this.options.stopNodes.length; i++) {
|
|
29
|
+
this.stopNodes.push(new TagPath(this.options.stopNodes[i]));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
parse(strData) {
|
|
34
|
+
this.source = new StringSource(strData);
|
|
35
|
+
this.parseXml();
|
|
36
|
+
return this.outputBuilder.getOutput();
|
|
37
|
+
}
|
|
38
|
+
parseBytesArr(data) {
|
|
39
|
+
this.source = new BufferSource(data );
|
|
40
|
+
this.parseXml();
|
|
41
|
+
return this.outputBuilder.getOutput();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
parseXml() {
|
|
45
|
+
//TODO: Separate TagValueParser as separate class. So no scope issue in node builder class
|
|
46
|
+
|
|
47
|
+
//OutputBuilder should be set in XML Parser
|
|
48
|
+
this.outputBuilder = this.options.OutputBuilder.getInstance(this.options);
|
|
49
|
+
this.root = { root: true};
|
|
50
|
+
this.currentTagDetail = this.root;
|
|
51
|
+
|
|
52
|
+
while(this.source.canRead()){
|
|
53
|
+
let ch = this.source.readCh();
|
|
54
|
+
if (ch === "") break;
|
|
55
|
+
|
|
56
|
+
if(ch === "<"){//tagStart
|
|
57
|
+
let nextChar = this.source.readChAt(0);
|
|
58
|
+
if (nextChar === "" ) throw new Error("Unexpected end of source");
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
if(nextChar === "!" || nextChar === "?"){
|
|
62
|
+
this.source.updateBufferBoundary();
|
|
63
|
+
//previously collected text should be added to current node
|
|
64
|
+
this.addTextNode();
|
|
65
|
+
|
|
66
|
+
this.readSpecialTag(nextChar);// Read DOCTYPE, comment, CDATA, PI tag
|
|
67
|
+
}else if(nextChar === "/"){
|
|
68
|
+
this.source.updateBufferBoundary();
|
|
69
|
+
this.readClosingTag();
|
|
70
|
+
// console.log(this.source.buffer.length, this.source.readable);
|
|
71
|
+
// console.log(this.tagsStack.length);
|
|
72
|
+
}else{//opening tag
|
|
73
|
+
this.readOpeningTag();
|
|
74
|
+
}
|
|
75
|
+
}else{
|
|
76
|
+
this.tagTextData += ch;
|
|
77
|
+
}
|
|
78
|
+
}//End While loop
|
|
79
|
+
if(this.tagsStack.length > 0 || ( this.tagTextData !== "undefined" && this.tagTextData.trimEnd().length > 0) ) throw new Error("Unexpected data in the end of document");
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* read closing paired tag. Set parent tag in scope.
|
|
84
|
+
* skip a node on user's choice
|
|
85
|
+
*/
|
|
86
|
+
readClosingTag(){
|
|
87
|
+
const tagName = this.processTagName(readClosingTagName(this.source));
|
|
88
|
+
// console.log(tagName, this.tagsStack.length);
|
|
89
|
+
this.validateClosingTag(tagName);
|
|
90
|
+
// All the text data collected, belongs to current tag.
|
|
91
|
+
if(!this.currentTagDetail.root) this.addTextNode();
|
|
92
|
+
this.outputBuilder.closeTag();
|
|
93
|
+
// Since the tag is closed now, parent tag comes in scope
|
|
94
|
+
this.currentTagDetail = this.tagsStack.pop();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
validateClosingTag(tagName){
|
|
98
|
+
// This can't be unpaired tag, or a stop tag.
|
|
99
|
+
if(this.isUnpaired(tagName) || this.isStopNode(tagName)) throw new Error(`Unexpected closing tag '${tagName}'`);
|
|
100
|
+
// This must match with last opening tag
|
|
101
|
+
else if(tagName !== this.currentTagDetail.name)
|
|
102
|
+
throw new Error(`Unexpected closing tag '${tagName}' expecting '${this.currentTagDetail.name}'`)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Read paired, unpaired, self-closing, stop and special tags.
|
|
107
|
+
* Create a new node
|
|
108
|
+
* Push paired tag in stack.
|
|
109
|
+
*/
|
|
110
|
+
readOpeningTag(){
|
|
111
|
+
//save previously collected text data to current node
|
|
112
|
+
this.addTextNode();
|
|
113
|
+
|
|
114
|
+
//create new tag
|
|
115
|
+
let tagExp = readTagExp(this, ">" );
|
|
116
|
+
|
|
117
|
+
// process and skip from tagsStack For unpaired tag, self closing tag, and stop node
|
|
118
|
+
const tagDetail = new TagDetail(tagExp.tagName);
|
|
119
|
+
if(this.isUnpaired(tagExp.tagName)) {
|
|
120
|
+
//TODO: this will lead 2 extra stack operation
|
|
121
|
+
this.outputBuilder.addTag(tagDetail);
|
|
122
|
+
this.outputBuilder.closeTag();
|
|
123
|
+
} else if(tagExp.selfClosing){
|
|
124
|
+
this.outputBuilder.addTag(tagDetail);
|
|
125
|
+
this.outputBuilder.closeTag();
|
|
126
|
+
} else if(this.isStopNode(this.currentTagDetail)){
|
|
127
|
+
// TODO: let's user set a stop node boundary detector for complex contents like script tag
|
|
128
|
+
//TODO: pass tag name only to avoid string operations
|
|
129
|
+
const content = source.readUptoCloseTag(`</${tagExp.tagName}`);
|
|
130
|
+
this.outputBuilder.addTag(tagDetail);
|
|
131
|
+
this.outputBuilder.addValue(content);
|
|
132
|
+
this.outputBuilder.closeTag();
|
|
133
|
+
}else{//paired tag
|
|
134
|
+
//set new nested tag in scope.
|
|
135
|
+
this.tagsStack.push(this.currentTagDetail);
|
|
136
|
+
this.outputBuilder.addTag(tagDetail);
|
|
137
|
+
this.currentTagDetail = tagDetail;
|
|
138
|
+
}
|
|
139
|
+
// console.log(tagExp.tagName,this.tagsStack.length);
|
|
140
|
+
// this.options.onClose()
|
|
141
|
+
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
readSpecialTag(startCh){
|
|
145
|
+
if(startCh == "!"){
|
|
146
|
+
let nextChar = this.source.readCh();
|
|
147
|
+
if (nextChar === null || nextChar === undefined) throw new Error("Unexpected ending of the source");
|
|
148
|
+
|
|
149
|
+
if(nextChar === "-"){//comment
|
|
150
|
+
readComment(this);
|
|
151
|
+
}else if(nextChar === "["){//CDATA
|
|
152
|
+
readCdata(this);
|
|
153
|
+
}else if(nextChar === "D"){//DOCTYPE
|
|
154
|
+
readDocType(this);
|
|
155
|
+
}
|
|
156
|
+
}else if(startCh === "?"){
|
|
157
|
+
readPiTag(this);
|
|
158
|
+
}else{
|
|
159
|
+
throw new Error(`Invalid tag '<${startCh}' at ${this.source.line}:${this.source.col}`)
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
addTextNode = function() {
|
|
163
|
+
// if(this.currentTagDetail){
|
|
164
|
+
//save text as child node
|
|
165
|
+
// if(this.currentTagDetail.tagname !== '!xml')
|
|
166
|
+
if (this.tagTextData !== undefined && this.tagTextData !== "") { //store previously collected data as textNode
|
|
167
|
+
if(this.tagTextData.trim().length > 0){
|
|
168
|
+
//TODO: shift parsing to output builder
|
|
169
|
+
|
|
170
|
+
this.outputBuilder.addValue(this.replaceEntities(this.tagTextData));
|
|
171
|
+
}
|
|
172
|
+
this.tagTextData = "";
|
|
173
|
+
}
|
|
174
|
+
// }
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
processAttrName(name){
|
|
178
|
+
if(name === "__proto__") name = "#__proto__";
|
|
179
|
+
name = resolveNameSpace(name, this.removeNSPrefix);
|
|
180
|
+
return name;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
processTagName(name){
|
|
184
|
+
if(name === "__proto__") name = "#__proto__";
|
|
185
|
+
name = resolveNameSpace(name, this.removeNSPrefix);
|
|
186
|
+
return name;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Generate tags path from tagsStack
|
|
191
|
+
*/
|
|
192
|
+
tagsPath(tagName){
|
|
193
|
+
//TODO: return TagPath Object. User can call match method with path
|
|
194
|
+
return "";
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
isUnpaired(tagName){
|
|
198
|
+
return this.options.tags.unpaired.indexOf(tagName) !== -1;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* valid expressions are
|
|
203
|
+
* tag nested
|
|
204
|
+
* * nested
|
|
205
|
+
* tag nested[attribute]
|
|
206
|
+
* tag nested[attribute=""]
|
|
207
|
+
* tag nested[attribute!=""]
|
|
208
|
+
* tag nested:0 //for future
|
|
209
|
+
* @param {string} tagName
|
|
210
|
+
* @returns
|
|
211
|
+
*/
|
|
212
|
+
isStopNode(node){
|
|
213
|
+
for (let i = 0; i < this.stopNodes.length; i++) {
|
|
214
|
+
const givenPath = this.stopNodes[i];
|
|
215
|
+
if(givenPath.match(this.tagsStack, node)) return true;
|
|
216
|
+
}
|
|
217
|
+
return false
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
replaceEntities(text){
|
|
221
|
+
//TODO: if option is set then replace entities
|
|
222
|
+
return this.entityParser.parse(text)
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function resolveNameSpace(name, removeNSPrefix) {
|
|
227
|
+
if (removeNSPrefix) {
|
|
228
|
+
const parts = name.split(':');
|
|
229
|
+
if(parts.length === 2){
|
|
230
|
+
if (parts[0] === 'xmlns') return '';
|
|
231
|
+
else return parts[1];
|
|
232
|
+
}else reportError(`Multiple namespaces ${name}`)
|
|
233
|
+
}
|
|
234
|
+
return name;
|
|
235
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* find paired tag for a stop node
|
|
5
|
+
* @param {string} xmlDoc
|
|
6
|
+
* @param {string} tagName
|
|
7
|
+
* @param {number} i : start index
|
|
8
|
+
*/
|
|
9
|
+
export function readStopNode(xmlDoc, tagName, i){
|
|
10
|
+
const startIndex = i;
|
|
11
|
+
// Starting at 1 since we already have an open tag
|
|
12
|
+
let openTagCount = 1;
|
|
13
|
+
|
|
14
|
+
for (; i < xmlDoc.length; i++) {
|
|
15
|
+
if( xmlDoc[i] === "<"){
|
|
16
|
+
if (xmlDoc[i+1] === "/") {//close tag
|
|
17
|
+
const closeIndex = findSubStrIndex(xmlDoc, ">", i, `${tagName} is not closed`);
|
|
18
|
+
let closeTagName = xmlDoc.substring(i+2,closeIndex).trim();
|
|
19
|
+
if(closeTagName === tagName){
|
|
20
|
+
openTagCount--;
|
|
21
|
+
if (openTagCount === 0) {
|
|
22
|
+
return {
|
|
23
|
+
tagContent: xmlDoc.substring(startIndex, i),
|
|
24
|
+
i : closeIndex
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
i=closeIndex;
|
|
29
|
+
} else if(xmlDoc[i+1] === '?') {
|
|
30
|
+
const closeIndex = findSubStrIndex(xmlDoc, "?>", i+1, "StopNode is not closed.")
|
|
31
|
+
i=closeIndex;
|
|
32
|
+
} else if(xmlDoc.substr(i + 1, 3) === '!--') {
|
|
33
|
+
const closeIndex = findSubStrIndex(xmlDoc, "-->", i+3, "StopNode is not closed.")
|
|
34
|
+
i=closeIndex;
|
|
35
|
+
} else if(xmlDoc.substr(i + 1, 2) === '![') {
|
|
36
|
+
const closeIndex = findSubStrIndex(xmlDoc, "]]>", i, "StopNode is not closed.") - 2;
|
|
37
|
+
i=closeIndex;
|
|
38
|
+
} else {
|
|
39
|
+
const tagData = readTagExp(xmlDoc, i, '>')
|
|
40
|
+
|
|
41
|
+
if (tagData) {
|
|
42
|
+
const openTagName = tagData && tagData.tagName;
|
|
43
|
+
if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length-1] !== "/") {
|
|
44
|
+
openTagCount++;
|
|
45
|
+
}
|
|
46
|
+
i=tagData.closeIndex;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}//end for loop
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Read closing tag name
|
|
55
|
+
* @param {Source} source
|
|
56
|
+
* @returns tag name
|
|
57
|
+
*/
|
|
58
|
+
export function readClosingTagName(source){
|
|
59
|
+
let text = ""; //temporary data
|
|
60
|
+
while(source.canRead()){
|
|
61
|
+
let ch = source.readCh();
|
|
62
|
+
// if (ch === null || ch === undefined) break;
|
|
63
|
+
// source.updateBuffer();
|
|
64
|
+
|
|
65
|
+
if (ch === ">") return text.trimEnd();
|
|
66
|
+
else text += ch;
|
|
67
|
+
}
|
|
68
|
+
throw new Error(`Unexpected end of source. Reading '${substr}'`);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Read XML tag and build attributes map
|
|
73
|
+
* This function can be used to read normal tag, pi tag.
|
|
74
|
+
* This function can't be used to read comment, CDATA, DOCTYPE.
|
|
75
|
+
* Eg <tag attr = ' some"' attr= ">" bool>
|
|
76
|
+
* @param {string} xmlDoc
|
|
77
|
+
* @param {number} startIndex starting index
|
|
78
|
+
* @returns tag expression includes tag name & attribute string
|
|
79
|
+
*/
|
|
80
|
+
export function readTagExp(parser) {
|
|
81
|
+
let inSingleQuotes = false;
|
|
82
|
+
let inDoubleQuotes = false;
|
|
83
|
+
let i;
|
|
84
|
+
let EOE = false;
|
|
85
|
+
|
|
86
|
+
for (i = 0; parser.source.canRead(i); i++) {
|
|
87
|
+
const char = parser.source.readChAt(i);
|
|
88
|
+
|
|
89
|
+
if (char === "'" && !inDoubleQuotes) {
|
|
90
|
+
inSingleQuotes = !inSingleQuotes;
|
|
91
|
+
} else if (char === '"' && !inSingleQuotes) {
|
|
92
|
+
inDoubleQuotes = !inDoubleQuotes;
|
|
93
|
+
} else if (char === '>' && !inSingleQuotes && !inDoubleQuotes) {
|
|
94
|
+
// If not inside quotes, stop reading at '>'
|
|
95
|
+
EOE = true;
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
if(inSingleQuotes || inDoubleQuotes){
|
|
101
|
+
throw new Error("Invalid attribute expression. Quote is not properly closed");
|
|
102
|
+
}else if(!EOE) throw new Error("Unexpected closing of source. Waiting for '>'");
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
const exp = parser.source.readStr(i);
|
|
106
|
+
parser.source.updateBufferBoundary(i + 1);
|
|
107
|
+
return buildTagExpObj(exp, parser)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function readPiExp(parser) {
|
|
111
|
+
let inSingleQuotes = false;
|
|
112
|
+
let inDoubleQuotes = false;
|
|
113
|
+
let i;
|
|
114
|
+
let EOE = false;
|
|
115
|
+
|
|
116
|
+
for (i = 0; parser.source.canRead(i) ; i++) {
|
|
117
|
+
const currentChar = parser.source.readChAt(i);
|
|
118
|
+
const nextChar = parser.source.readChAt(i+1);
|
|
119
|
+
|
|
120
|
+
if (currentChar === "'" && !inDoubleQuotes) {
|
|
121
|
+
inSingleQuotes = !inSingleQuotes;
|
|
122
|
+
} else if (currentChar === '"' && !inSingleQuotes) {
|
|
123
|
+
inDoubleQuotes = !inDoubleQuotes;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (!inSingleQuotes && !inDoubleQuotes) {
|
|
127
|
+
if (currentChar === '?' && nextChar === '>') {
|
|
128
|
+
EOE = true;
|
|
129
|
+
break; // Exit the loop when '?>' is found
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if(inSingleQuotes || inDoubleQuotes){
|
|
134
|
+
throw new Error("Invalid attribute expression. Quote is not properly closed in PI tag expression");
|
|
135
|
+
}else if(!EOE) throw new Error("Unexpected closing of source. Waiting for '?>'");
|
|
136
|
+
|
|
137
|
+
if(!parser.options.attributes.ignore){
|
|
138
|
+
//TODO: use regex to verify attributes if not set to ignore
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const exp = parser.source.readStr(i);
|
|
142
|
+
parser.source.updateBufferBoundary(i + 1);
|
|
143
|
+
return buildTagExpObj(exp, parser)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function buildTagExpObj(exp, parser){
|
|
147
|
+
const tagExp = {
|
|
148
|
+
tagName: "",
|
|
149
|
+
selfClosing: false
|
|
150
|
+
};
|
|
151
|
+
let attrsExp = "";
|
|
152
|
+
|
|
153
|
+
// Check for self-closing tag before setting the name
|
|
154
|
+
if(exp[exp.length -1] === "/") {
|
|
155
|
+
tagExp.selfClosing = true;
|
|
156
|
+
exp = exp.slice(0, -1); // Remove the trailing slash
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
//separate tag name
|
|
160
|
+
let i = 0;
|
|
161
|
+
for (; i < exp.length; i++) {
|
|
162
|
+
const char = exp[i];
|
|
163
|
+
if(char === " "){
|
|
164
|
+
tagExp.tagName = exp.substring(0, i);
|
|
165
|
+
attrsExp = exp.substring(i + 1);
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
//only tag
|
|
170
|
+
if(tagExp.tagName.length === 0 && i === exp.length)tagExp.tagName = exp;
|
|
171
|
+
|
|
172
|
+
tagExp.tagName = tagExp.tagName.trimEnd();
|
|
173
|
+
|
|
174
|
+
if(!parser.options.attributes.ignore && attrsExp.length > 0){
|
|
175
|
+
parseAttributesExp(attrsExp,parser)
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return tagExp;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const attrsRegx = new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?', 'gm');
|
|
182
|
+
|
|
183
|
+
function parseAttributesExp(attrStr, parser) {
|
|
184
|
+
const matches = getAllMatches(attrStr, attrsRegx);
|
|
185
|
+
const len = matches.length; //don't make it inline
|
|
186
|
+
for (let i = 0; i < len; i++) {
|
|
187
|
+
let attrName = parser.processAttrName(matches[i][1]);
|
|
188
|
+
let attrVal = parser.replaceEntities(matches[i][4] || true);
|
|
189
|
+
|
|
190
|
+
parser.outputBuilder.addAttribute(attrName, attrVal);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
const getAllMatches = function(string, regex) {
|
|
196
|
+
const matches = [];
|
|
197
|
+
let match = regex.exec(string);
|
|
198
|
+
while (match) {
|
|
199
|
+
const allmatches = [];
|
|
200
|
+
allmatches.startIndex = regex.lastIndex - match[0].length;
|
|
201
|
+
const len = match.length;
|
|
202
|
+
for (let index = 0; index < len; index++) {
|
|
203
|
+
allmatches.push(match[index]);
|
|
204
|
+
}
|
|
205
|
+
matches.push(allmatches);
|
|
206
|
+
match = regex.exec(string);
|
|
207
|
+
}
|
|
208
|
+
return matches;
|
|
209
|
+
};
|
|
210
|
+
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import {readPiExp} from './XmlPartReader.js';
|
|
2
|
+
|
|
3
|
+
export function readCdata(parser){
|
|
4
|
+
//<![ are already read till this point
|
|
5
|
+
let str = parser.source.readStr(6); //CDATA[
|
|
6
|
+
parser.source.updateBufferBoundary(6);
|
|
7
|
+
|
|
8
|
+
if(str !== "CDATA[") throw new Error(`Invalid CDATA expression at ${parser.source.line}:${parser.source.cols}`);
|
|
9
|
+
|
|
10
|
+
let text = parser.source.readUpto("]]>");
|
|
11
|
+
parser.outputBuilder.addCdata(text);
|
|
12
|
+
}
|
|
13
|
+
export function readPiTag(parser){
|
|
14
|
+
//<? are already read till this point
|
|
15
|
+
let tagExp = readPiExp(parser, "?>");
|
|
16
|
+
if(!tagExp) throw new Error("Invalid Pi Tag expression.");
|
|
17
|
+
|
|
18
|
+
if (tagExp.tagName === "?xml") {//TODO: test if tagName is just xml
|
|
19
|
+
parser.outputBuilder.addDeclaration();
|
|
20
|
+
} else {
|
|
21
|
+
parser.outputBuilder.addPi("?"+tagExp.tagName);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function readComment(parser){
|
|
26
|
+
//<!- are already read till this point
|
|
27
|
+
let ch = parser.source.readCh();
|
|
28
|
+
if(ch !== "-") throw new Error(`Invalid comment expression at ${parser.source.line}:${parser.source.cols}`);
|
|
29
|
+
|
|
30
|
+
let text = parser.source.readUpto("-->");
|
|
31
|
+
parser.outputBuilder.addComment(text);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const DOCTYPE_tags = {
|
|
35
|
+
"EL":/^EMENT\s+([^\s>]+)\s+(ANY|EMPTY|\(.+\)\s*$)/m,
|
|
36
|
+
"AT":/^TLIST\s+[^\s]+\s+[^\s]+\s+[^\s]+\s+[^\s]+\s+$/m,
|
|
37
|
+
"NO":/^TATION.+$/m
|
|
38
|
+
}
|
|
39
|
+
export function readDocType(parser){
|
|
40
|
+
//<!D are already read till this point
|
|
41
|
+
let str = parser.source.readStr(6); //OCTYPE
|
|
42
|
+
parser.source.updateBufferBoundary(6);
|
|
43
|
+
|
|
44
|
+
if(str !== "OCTYPE") throw new Error(`Invalid DOCTYPE expression at ${parser.source.line}:${parser.source.cols}`);
|
|
45
|
+
|
|
46
|
+
let hasBody = false, lastch = "";
|
|
47
|
+
|
|
48
|
+
while(parser.source.canRead()){
|
|
49
|
+
//TODO: use readChAt like used in partReader
|
|
50
|
+
let ch = parser.source.readCh();
|
|
51
|
+
if(hasBody){
|
|
52
|
+
if (ch === '<') { //Determine the tag type
|
|
53
|
+
let str = parser.source.readStr(2);
|
|
54
|
+
parser.source.updateBufferBoundary(2);
|
|
55
|
+
if(str === "EN"){ //ENTITY
|
|
56
|
+
let str = parser.source.readStr(4);
|
|
57
|
+
parser.source.updateBufferBoundary(4);
|
|
58
|
+
if(str !== "TITY") throw new Error("Invalid DOCTYPE ENTITY expression");
|
|
59
|
+
|
|
60
|
+
registerEntity(parser);
|
|
61
|
+
}else if(str === "!-") {//comment
|
|
62
|
+
readComment(parser);
|
|
63
|
+
}else{ //ELEMENT, ATTLIST, NOTATION
|
|
64
|
+
let dTagExp = parser.source.readUpto(">");
|
|
65
|
+
const regx = DOCTYPE_tags[str];
|
|
66
|
+
if(regx){
|
|
67
|
+
const match = dTagExp.match(regx);
|
|
68
|
+
if(!match) throw new Error("Invalid DOCTYPE");
|
|
69
|
+
}else throw new Error("Invalid DOCTYPE");
|
|
70
|
+
}
|
|
71
|
+
}else if( ch === '>' && lastch === "]"){//end of doctype
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
}else if( ch === '>'){//end of doctype
|
|
75
|
+
return;
|
|
76
|
+
}else if( ch === '['){
|
|
77
|
+
hasBody = true;
|
|
78
|
+
}else{
|
|
79
|
+
lastch = ch;
|
|
80
|
+
}
|
|
81
|
+
}//End While loop
|
|
82
|
+
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function registerEntity(parser){
|
|
86
|
+
//read Entity
|
|
87
|
+
let attrBoundary="";
|
|
88
|
+
let name ="", val ="";
|
|
89
|
+
while(source.canRead()){
|
|
90
|
+
let ch = source.readCh();
|
|
91
|
+
|
|
92
|
+
if(attrBoundary){
|
|
93
|
+
if (ch === attrBoundary){
|
|
94
|
+
val = text;
|
|
95
|
+
text = ""
|
|
96
|
+
}
|
|
97
|
+
}else if(ch === " " || ch === "\t"){
|
|
98
|
+
if(!name){
|
|
99
|
+
name = text.trimStart();
|
|
100
|
+
text = "";
|
|
101
|
+
}
|
|
102
|
+
}else if (ch === '"' || ch === "'") {//start of attrBoundary
|
|
103
|
+
attrBoundary = ch;
|
|
104
|
+
}else if(ch === ">"){
|
|
105
|
+
parser.entityParser.addExternalEntity(name,val);
|
|
106
|
+
return;
|
|
107
|
+
}else{
|
|
108
|
+
text+=ch;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
const Constants = {
|
|
2
|
+
space: 32,
|
|
3
|
+
tab: 9
|
|
4
|
+
}
|
|
5
|
+
export default class BufferSource{
|
|
6
|
+
constructor(bytesArr){
|
|
7
|
+
this.line = 1;
|
|
8
|
+
this.cols = 0;
|
|
9
|
+
this.buffer = bytesArr;
|
|
10
|
+
this.startIndex = 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
readCh() {
|
|
16
|
+
return String.fromCharCode(this.buffer[this.startIndex++]);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
readChAt(index) {
|
|
20
|
+
return String.fromCharCode(this.buffer[this.startIndex+index]);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
readStr(n,from){
|
|
24
|
+
if(typeof from === "undefined") from = this.startIndex;
|
|
25
|
+
return this.buffer.slice(from, from + n).toString();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
readUpto(stopStr) {
|
|
29
|
+
const inputLength = this.buffer.length;
|
|
30
|
+
const stopLength = stopStr.length;
|
|
31
|
+
const stopBuffer = Buffer.from(stopStr);
|
|
32
|
+
|
|
33
|
+
for (let i = this.startIndex; i < inputLength; i++) {
|
|
34
|
+
let match = true;
|
|
35
|
+
for (let j = 0; j < stopLength; j++) {
|
|
36
|
+
if (this.buffer[i + j] !== stopBuffer[j]) {
|
|
37
|
+
match = false;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (match) {
|
|
43
|
+
const result = this.buffer.slice(this.startIndex, i).toString();
|
|
44
|
+
this.startIndex = i + stopLength;
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
throw new Error(`Unexpected end of source. Reading '${stopStr}'`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
readUptoCloseTag(stopStr) { //stopStr: "</tagname"
|
|
53
|
+
const inputLength = this.buffer.length;
|
|
54
|
+
const stopLength = stopStr.length;
|
|
55
|
+
const stopBuffer = Buffer.from(stopStr);
|
|
56
|
+
let stopIndex = 0;
|
|
57
|
+
//0: non-matching, 1: matching stop string, 2: matching closing
|
|
58
|
+
let match = 0;
|
|
59
|
+
|
|
60
|
+
for (let i = this.startIndex; i < inputLength; i++) {
|
|
61
|
+
if(match === 1){//initial part matched
|
|
62
|
+
if(stopIndex === 0) stopIndex = i;
|
|
63
|
+
if(this.buffer[i] === Constants.space || this.buffer[i] === Constants.tab) continue;
|
|
64
|
+
else if(this.buffer[i] === '>'){ //TODO: if it should be equivalent ASCII
|
|
65
|
+
match = 2;
|
|
66
|
+
//tag boundary found
|
|
67
|
+
// this.startIndex
|
|
68
|
+
}
|
|
69
|
+
}else{
|
|
70
|
+
match = 1;
|
|
71
|
+
for (let j = 0; j < stopLength; j++) {
|
|
72
|
+
if (this.buffer[i + j] !== stopBuffer[j]) {
|
|
73
|
+
match = 0;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (match === 2) {//matched closing part
|
|
79
|
+
const result = this.buffer.slice(this.startIndex, stopIndex - 1 ).toString();
|
|
80
|
+
this.startIndex = i + 1;
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
throw new Error(`Unexpected end of source. Reading '${stopStr}'`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
readFromBuffer(n, shouldUpdate) {
|
|
89
|
+
let ch;
|
|
90
|
+
if (n === 1) {
|
|
91
|
+
ch = this.buffer[this.startIndex];
|
|
92
|
+
if (ch === 10) {
|
|
93
|
+
this.line++;
|
|
94
|
+
this.cols = 1;
|
|
95
|
+
} else {
|
|
96
|
+
this.cols++;
|
|
97
|
+
}
|
|
98
|
+
ch = String.fromCharCode(ch);
|
|
99
|
+
} else {
|
|
100
|
+
this.cols += n;
|
|
101
|
+
ch = this.buffer.slice(this.startIndex, this.startIndex + n).toString();
|
|
102
|
+
}
|
|
103
|
+
if (shouldUpdate) this.updateBuffer(n);
|
|
104
|
+
return ch;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
updateBufferBoundary(n = 1) { //n: number of characters read
|
|
108
|
+
this.startIndex += n;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
canRead(n){
|
|
112
|
+
n = n || this.startIndex;
|
|
113
|
+
return this.buffer.length - n + 1 > 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
}
|