@openclaw/qqbot 2026.5.20 → 2026.5.24-beta.1
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/node_modules/@eshaz/web-worker/LICENSE +201 -0
- package/node_modules/@eshaz/web-worker/README.md +134 -0
- package/node_modules/@eshaz/web-worker/browser.js +17 -0
- package/node_modules/@eshaz/web-worker/cjs/browser.js +16 -0
- package/node_modules/@eshaz/web-worker/cjs/node.js +219 -0
- package/node_modules/@eshaz/web-worker/index.d.ts +4 -0
- package/node_modules/@eshaz/web-worker/node.js +223 -0
- package/node_modules/@eshaz/web-worker/package.json +54 -0
- package/node_modules/@tencent-connect/qqbot-connector/README.md +138 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/cjs/index.d.ts +2 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/cjs/index.js +1 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/cjs/qqbot-session.d.ts +35 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/cjs/qqbot-session.js +1 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/cjs/qr-connect.d.ts +83 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/cjs/qr-connect.js +3 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/esm/index.d.ts +2 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/esm/index.js +1 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/esm/qqbot-session.d.ts +35 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/esm/qqbot-session.js +1 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/esm/qr-connect.d.ts +83 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/esm/qr-connect.js +3 -0
- package/node_modules/@tencent-connect/qqbot-connector/package.json +62 -0
- package/node_modules/@wasm-audio-decoders/common/index.js +5 -0
- package/node_modules/@wasm-audio-decoders/common/package.json +36 -0
- package/node_modules/@wasm-audio-decoders/common/src/WASMAudioDecoderCommon.js +231 -0
- package/node_modules/@wasm-audio-decoders/common/src/WASMAudioDecoderWorker.js +129 -0
- package/node_modules/@wasm-audio-decoders/common/src/puff/README +67 -0
- package/node_modules/@wasm-audio-decoders/common/src/puff/build_puff.js +31 -0
- package/node_modules/@wasm-audio-decoders/common/src/puff/puff.c +863 -0
- package/node_modules/@wasm-audio-decoders/common/src/puff/puff.h +35 -0
- package/node_modules/@wasm-audio-decoders/common/src/utilities.js +3 -0
- package/node_modules/@wasm-audio-decoders/common/types.d.ts +7 -0
- package/node_modules/mpg123-decoder/README.md +265 -0
- package/node_modules/mpg123-decoder/dist/mpg123-decoder.min.js +185 -0
- package/node_modules/mpg123-decoder/dist/mpg123-decoder.min.js.map +1 -0
- package/node_modules/mpg123-decoder/index.js +8 -0
- package/node_modules/mpg123-decoder/package.json +58 -0
- package/node_modules/mpg123-decoder/src/EmscriptenWasm.js +464 -0
- package/node_modules/mpg123-decoder/src/MPEGDecoder.js +200 -0
- package/node_modules/mpg123-decoder/src/MPEGDecoderWebWorker.js +21 -0
- package/node_modules/mpg123-decoder/types.d.ts +30 -0
- package/node_modules/qrcode-terminal/.travis.yml +3 -0
- package/node_modules/qrcode-terminal/LICENSE +222 -0
- package/node_modules/qrcode-terminal/README.md +82 -0
- package/node_modules/qrcode-terminal/bin/qrcode-terminal.js +101 -0
- package/node_modules/qrcode-terminal/example/basic.js +2 -0
- package/node_modules/qrcode-terminal/example/basic.png +0 -0
- package/node_modules/qrcode-terminal/example/callback.js +4 -0
- package/node_modules/qrcode-terminal/example/small-qrcode.js +6 -0
- package/node_modules/qrcode-terminal/lib/main.js +100 -0
- package/node_modules/qrcode-terminal/package.json +37 -0
- package/node_modules/qrcode-terminal/test/main.js +63 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/QR8bitByte.js +22 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/QRBitBuffer.js +38 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js +7 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/QRMaskPattern.js +10 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/QRMath.js +44 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/QRMode.js +6 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/QRPolynomial.js +66 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/QRRSBlock.js +298 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/QRUtil.js +272 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/index.js +462 -0
- package/node_modules/silk-wasm/LICENSE +21 -0
- package/node_modules/silk-wasm/README.md +85 -0
- package/node_modules/silk-wasm/lib/index.cjs +16 -0
- package/node_modules/silk-wasm/lib/index.d.ts +70 -0
- package/node_modules/silk-wasm/lib/index.mjs +16 -0
- package/node_modules/silk-wasm/lib/silk.wasm +0 -0
- package/node_modules/silk-wasm/lib/utils.d.ts +4 -0
- package/node_modules/silk-wasm/package.json +39 -0
- package/node_modules/simple-yenc/.github/FUNDING.yml +1 -0
- package/node_modules/simple-yenc/.prettierignore +1 -0
- package/node_modules/simple-yenc/LICENSE +7 -0
- package/node_modules/simple-yenc/README.md +163 -0
- package/node_modules/simple-yenc/dist/esm.js +1 -0
- package/node_modules/simple-yenc/dist/index.js +1 -0
- package/node_modules/simple-yenc/package.json +50 -0
- package/node_modules/simple-yenc/rollup.config.js +27 -0
- package/node_modules/simple-yenc/src/simple-yenc.js +302 -0
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +22 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +19 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/node_modules/ws/lib/receiver.js +706 -0
- package/node_modules/ws/lib/sender.js +607 -0
- package/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/ws/lib/websocket-server.js +554 -0
- package/node_modules/ws/lib/websocket.js +1393 -0
- package/node_modules/ws/package.json +70 -0
- package/node_modules/ws/wrapper.mjs +21 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +191 -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/locales/index.cjs +17 -0
- package/node_modules/zod/locales/index.d.cts +1 -0
- package/node_modules/zod/locales/index.d.ts +1 -0
- package/node_modules/zod/locales/index.js +1 -0
- package/node_modules/zod/locales/package.json +7 -0
- package/node_modules/zod/mini/index.cjs +32 -0
- package/node_modules/zod/mini/index.d.cts +3 -0
- package/node_modules/zod/mini/index.d.ts +3 -0
- package/node_modules/zod/mini/index.js +3 -0
- package/node_modules/zod/mini/package.json +7 -0
- package/node_modules/zod/package.json +135 -0
- package/node_modules/zod/src/index.ts +4 -0
- package/node_modules/zod/src/locales/index.ts +1 -0
- package/node_modules/zod/src/mini/index.ts +3 -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 +70 -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 +261 -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 +24 -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 +5138 -0
- package/node_modules/zod/src/v4/classic/checks.ts +32 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +70 -0
- package/node_modules/zod/src/v4/classic/errors.ts +82 -0
- package/node_modules/zod/src/v4/classic/external.ts +52 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +659 -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 +82 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2672 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +59 -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 +216 -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 +106 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +326 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +573 -0
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +703 -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 +374 -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 +62 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +302 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +409 -0
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +197 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +694 -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 +807 -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 +96 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +895 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +360 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +939 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +60 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +198 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +46 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -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 +117 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +330 -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 +101 -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 +325 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +717 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +333 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +450 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +74 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -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 +717 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +631 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +633 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +181 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +134 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +1224 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +771 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +3125 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +496 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +273 -0
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -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 +1823 -0
- package/node_modules/zod/src/v4/core/checks.ts +1293 -0
- package/node_modules/zod/src/v4/core/config.ts +15 -0
- package/node_modules/zod/src/v4/core/core.ts +153 -0
- package/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/node_modules/zod/src/v4/core/errors.ts +455 -0
- package/node_modules/zod/src/v4/core/index.ts +16 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +126 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +666 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +147 -0
- package/node_modules/zod/src/v4/core/parse.ts +195 -0
- package/node_modules/zod/src/v4/core/regexes.ts +190 -0
- package/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/node_modules/zod/src/v4/core/schemas.ts +4730 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -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/el.test.ts +215 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +181 -0
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -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/tests/locales/uz.test.ts +105 -0
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +622 -0
- package/node_modules/zod/src/v4/core/util.ts +983 -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 +115 -0
- package/node_modules/zod/src/v4/locales/az.ts +111 -0
- package/node_modules/zod/src/v4/locales/be.ts +176 -0
- package/node_modules/zod/src/v4/locales/bg.ts +128 -0
- package/node_modules/zod/src/v4/locales/ca.ts +116 -0
- package/node_modules/zod/src/v4/locales/cs.ts +118 -0
- package/node_modules/zod/src/v4/locales/da.ts +123 -0
- package/node_modules/zod/src/v4/locales/de.ts +116 -0
- package/node_modules/zod/src/v4/locales/el.ts +121 -0
- package/node_modules/zod/src/v4/locales/en.ts +123 -0
- package/node_modules/zod/src/v4/locales/eo.ts +118 -0
- package/node_modules/zod/src/v4/locales/es.ts +141 -0
- package/node_modules/zod/src/v4/locales/fa.ts +126 -0
- package/node_modules/zod/src/v4/locales/fi.ts +121 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +116 -0
- package/node_modules/zod/src/v4/locales/fr.ts +132 -0
- package/node_modules/zod/src/v4/locales/he.ts +246 -0
- package/node_modules/zod/src/v4/locales/hr.ts +131 -0
- package/node_modules/zod/src/v4/locales/hu.ts +117 -0
- package/node_modules/zod/src/v4/locales/hy.ts +164 -0
- package/node_modules/zod/src/v4/locales/id.ts +115 -0
- package/node_modules/zod/src/v4/locales/index.ts +52 -0
- package/node_modules/zod/src/v4/locales/is.ts +119 -0
- package/node_modules/zod/src/v4/locales/it.ts +116 -0
- package/node_modules/zod/src/v4/locales/ja.ts +114 -0
- package/node_modules/zod/src/v4/locales/ka.ts +123 -0
- package/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/node_modules/zod/src/v4/locales/km.ts +119 -0
- package/node_modules/zod/src/v4/locales/ko.ts +121 -0
- package/node_modules/zod/src/v4/locales/lt.ts +239 -0
- package/node_modules/zod/src/v4/locales/mk.ts +118 -0
- package/node_modules/zod/src/v4/locales/ms.ts +115 -0
- package/node_modules/zod/src/v4/locales/nl.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +116 -0
- package/node_modules/zod/src/v4/locales/ota.ts +117 -0
- package/node_modules/zod/src/v4/locales/pl.ts +118 -0
- package/node_modules/zod/src/v4/locales/ps.ts +126 -0
- package/node_modules/zod/src/v4/locales/pt.ts +116 -0
- package/node_modules/zod/src/v4/locales/ro.ts +129 -0
- package/node_modules/zod/src/v4/locales/ru.ts +176 -0
- package/node_modules/zod/src/v4/locales/sl.ts +118 -0
- package/node_modules/zod/src/v4/locales/sv.ts +119 -0
- package/node_modules/zod/src/v4/locales/ta.ts +118 -0
- package/node_modules/zod/src/v4/locales/th.ts +119 -0
- package/node_modules/zod/src/v4/locales/tr.ts +111 -0
- package/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/node_modules/zod/src/v4/locales/uk.ts +117 -0
- package/node_modules/zod/src/v4/locales/ur.ts +119 -0
- package/node_modules/zod/src/v4/locales/uz.ts +117 -0
- package/node_modules/zod/src/v4/locales/vi.ts +117 -0
- package/node_modules/zod/src/v4/locales/yo.ts +124 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +116 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +115 -0
- package/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/node_modules/zod/src/v4/mini/external.ts +41 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +66 -0
- package/node_modules/zod/src/v4/mini/parse.ts +14 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +1947 -0
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +24 -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 +94 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +548 -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 +5 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +993 -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 +227 -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 +325 -0
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +352 -0
- package/node_modules/zod/src/v4-mini/index.ts +3 -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 +112 -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/package.json +7 -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 +3777 -0
- package/node_modules/zod/v3/types.d.cts +1034 -0
- package/node_modules/zod/v3/types.d.ts +1034 -0
- package/node_modules/zod/v3/types.js +3695 -0
- package/node_modules/zod/v4/classic/checks.cjs +33 -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 +61 -0
- package/node_modules/zod/v4/classic/compat.d.cts +50 -0
- package/node_modules/zod/v4/classic/compat.d.ts +50 -0
- package/node_modules/zod/v4/classic/compat.js +31 -0
- package/node_modules/zod/v4/classic/errors.cjs +74 -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 +48 -0
- package/node_modules/zod/v4/classic/external.cjs +73 -0
- package/node_modules/zod/v4/classic/external.d.cts +16 -0
- package/node_modules/zod/v4/classic/external.d.ts +16 -0
- package/node_modules/zod/v4/classic/external.js +20 -0
- package/node_modules/zod/v4/classic/from-json-schema.cjs +625 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.js +599 -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/package.json +7 -0
- package/node_modules/zod/v4/classic/parse.cjs +41 -0
- package/node_modules/zod/v4/classic/parse.d.cts +31 -0
- package/node_modules/zod/v4/classic/parse.d.ts +31 -0
- package/node_modules/zod/v4/classic/parse.js +15 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1511 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +767 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +767 -0
- package/node_modules/zod/v4/classic/schemas.js +1395 -0
- package/node_modules/zod/v4/core/api.cjs +1227 -0
- package/node_modules/zod/v4/core/api.d.cts +325 -0
- package/node_modules/zod/v4/core/api.d.ts +325 -0
- package/node_modules/zod/v4/core/api.js +1087 -0
- package/node_modules/zod/v4/core/checks.cjs +601 -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 +575 -0
- package/node_modules/zod/v4/core/core.cjs +85 -0
- package/node_modules/zod/v4/core/core.d.cts +70 -0
- package/node_modules/zod/v4/core/core.d.ts +70 -0
- package/node_modules/zod/v4/core/core.js +78 -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 +216 -0
- package/node_modules/zod/v4/core/errors.d.cts +221 -0
- package/node_modules/zod/v4/core/errors.d.ts +221 -0
- package/node_modules/zod/v4/core/errors.js +185 -0
- package/node_modules/zod/v4/core/index.cjs +47 -0
- package/node_modules/zod/v4/core/index.d.cts +16 -0
- package/node_modules/zod/v4/core/index.d.ts +16 -0
- package/node_modules/zod/v4/core/index.js +16 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +99 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.js +95 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +644 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +601 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +88 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +88 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/package.json +7 -0
- package/node_modules/zod/v4/core/parse.cjs +131 -0
- package/node_modules/zod/v4/core/parse.d.cts +49 -0
- package/node_modules/zod/v4/core/parse.d.ts +49 -0
- package/node_modules/zod/v4/core/parse.js +93 -0
- package/node_modules/zod/v4/core/regexes.cjs +172 -0
- package/node_modules/zod/v4/core/regexes.d.cts +85 -0
- package/node_modules/zod/v4/core/regexes.d.ts +85 -0
- package/node_modules/zod/v4/core/regexes.js +139 -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 +2270 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1184 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1184 -0
- package/node_modules/zod/v4/core/schemas.js +2239 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +457 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.js +448 -0
- package/node_modules/zod/v4/core/util.cjs +734 -0
- package/node_modules/zod/v4/core/util.d.cts +200 -0
- package/node_modules/zod/v4/core/util.d.ts +200 -0
- package/node_modules/zod/v4/core/util.js +674 -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 +133 -0
- package/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +106 -0
- package/node_modules/zod/v4/locales/az.cjs +132 -0
- package/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +105 -0
- package/node_modules/zod/v4/locales/be.cjs +183 -0
- package/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +156 -0
- package/node_modules/zod/v4/locales/bg.cjs +147 -0
- package/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/node_modules/zod/v4/locales/bg.js +120 -0
- package/node_modules/zod/v4/locales/ca.cjs +134 -0
- package/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +107 -0
- package/node_modules/zod/v4/locales/cs.cjs +138 -0
- package/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +111 -0
- package/node_modules/zod/v4/locales/da.cjs +142 -0
- package/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/node_modules/zod/v4/locales/da.js +115 -0
- package/node_modules/zod/v4/locales/de.cjs +135 -0
- package/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +108 -0
- package/node_modules/zod/v4/locales/el.cjs +136 -0
- package/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/node_modules/zod/v4/locales/el.js +109 -0
- package/node_modules/zod/v4/locales/en.cjs +140 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +4 -0
- package/node_modules/zod/v4/locales/en.js +113 -0
- package/node_modules/zod/v4/locales/eo.cjs +136 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +4 -0
- package/node_modules/zod/v4/locales/eo.js +109 -0
- package/node_modules/zod/v4/locales/es.cjs +159 -0
- package/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +132 -0
- package/node_modules/zod/v4/locales/fa.cjs +141 -0
- package/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +114 -0
- package/node_modules/zod/v4/locales/fi.cjs +139 -0
- package/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +112 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +134 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +107 -0
- package/node_modules/zod/v4/locales/fr.cjs +152 -0
- package/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +125 -0
- package/node_modules/zod/v4/locales/he.cjs +241 -0
- package/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +214 -0
- package/node_modules/zod/v4/locales/hr.cjs +149 -0
- package/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/node_modules/zod/v4/locales/hr.js +122 -0
- package/node_modules/zod/v4/locales/hu.cjs +135 -0
- package/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +108 -0
- package/node_modules/zod/v4/locales/hy.cjs +174 -0
- package/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/node_modules/zod/v4/locales/hy.js +147 -0
- package/node_modules/zod/v4/locales/id.cjs +133 -0
- package/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +106 -0
- package/node_modules/zod/v4/locales/index.cjs +111 -0
- package/node_modules/zod/v4/locales/index.d.cts +52 -0
- package/node_modules/zod/v4/locales/index.d.ts +52 -0
- package/node_modules/zod/v4/locales/index.js +52 -0
- package/node_modules/zod/v4/locales/is.cjs +136 -0
- package/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/node_modules/zod/v4/locales/is.js +109 -0
- package/node_modules/zod/v4/locales/it.cjs +135 -0
- package/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +108 -0
- package/node_modules/zod/v4/locales/ja.cjs +134 -0
- package/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +107 -0
- package/node_modules/zod/v4/locales/ka.cjs +139 -0
- package/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/node_modules/zod/v4/locales/ka.js +112 -0
- package/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/node_modules/zod/v4/locales/kh.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +137 -0
- package/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/node_modules/zod/v4/locales/km.js +110 -0
- package/node_modules/zod/v4/locales/ko.cjs +138 -0
- package/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +111 -0
- package/node_modules/zod/v4/locales/lt.cjs +230 -0
- package/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/node_modules/zod/v4/locales/lt.js +203 -0
- package/node_modules/zod/v4/locales/mk.cjs +136 -0
- package/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +109 -0
- package/node_modules/zod/v4/locales/ms.cjs +134 -0
- package/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +107 -0
- package/node_modules/zod/v4/locales/nl.cjs +137 -0
- package/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +110 -0
- package/node_modules/zod/v4/locales/no.cjs +135 -0
- package/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +108 -0
- package/node_modules/zod/v4/locales/ota.cjs +136 -0
- package/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +109 -0
- package/node_modules/zod/v4/locales/package.json +7 -0
- package/node_modules/zod/v4/locales/pl.cjs +136 -0
- package/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +109 -0
- package/node_modules/zod/v4/locales/ps.cjs +141 -0
- package/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +114 -0
- package/node_modules/zod/v4/locales/pt.cjs +135 -0
- package/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +108 -0
- package/node_modules/zod/v4/locales/ro.cjs +146 -0
- package/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/node_modules/zod/v4/locales/ro.js +119 -0
- package/node_modules/zod/v4/locales/ru.cjs +183 -0
- package/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +156 -0
- package/node_modules/zod/v4/locales/sl.cjs +136 -0
- package/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +109 -0
- package/node_modules/zod/v4/locales/sv.cjs +137 -0
- package/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +110 -0
- package/node_modules/zod/v4/locales/ta.cjs +137 -0
- package/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +110 -0
- package/node_modules/zod/v4/locales/th.cjs +137 -0
- package/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +110 -0
- package/node_modules/zod/v4/locales/tr.cjs +132 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +4 -0
- package/node_modules/zod/v4/locales/tr.js +105 -0
- package/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/node_modules/zod/v4/locales/ua.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +135 -0
- package/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/node_modules/zod/v4/locales/uk.js +108 -0
- package/node_modules/zod/v4/locales/ur.cjs +137 -0
- package/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +110 -0
- package/node_modules/zod/v4/locales/uz.cjs +137 -0
- package/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/node_modules/zod/v4/locales/uz.js +110 -0
- package/node_modules/zod/v4/locales/vi.cjs +135 -0
- package/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +108 -0
- package/node_modules/zod/v4/locales/yo.cjs +134 -0
- package/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/node_modules/zod/v4/locales/yo.js +107 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +136 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +109 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +134 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +107 -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 +52 -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 +22 -0
- package/node_modules/zod/v4/mini/external.cjs +63 -0
- package/node_modules/zod/v4/mini/external.d.cts +13 -0
- package/node_modules/zod/v4/mini/external.d.ts +13 -0
- package/node_modules/zod/v4/mini/external.js +14 -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 +64 -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 +34 -0
- package/node_modules/zod/v4/mini/package.json +7 -0
- package/node_modules/zod/v4/mini/parse.cjs +16 -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 +1083 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +445 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +445 -0
- package/node_modules/zod/v4/mini/schemas.js +961 -0
- package/node_modules/zod/v4/package.json +7 -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/package.json +7 -0
- package/npm-shrinkwrap.json +125 -0
- package/package.json +12 -9
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export interface EncodeResult {
|
|
2
|
+
/** SILK */
|
|
3
|
+
data: Uint8Array;
|
|
4
|
+
/** in milliseconds */
|
|
5
|
+
duration: number;
|
|
6
|
+
}
|
|
7
|
+
export interface DecodeResult {
|
|
8
|
+
/** pcm_s16le */
|
|
9
|
+
data: Uint8Array;
|
|
10
|
+
/** in milliseconds */
|
|
11
|
+
duration: number;
|
|
12
|
+
}
|
|
13
|
+
/** @deprecated use `EncodeResult` instead */
|
|
14
|
+
export interface encodeResult extends EncodeResult {
|
|
15
|
+
}
|
|
16
|
+
/** @deprecated use `DecodeResult` instead */
|
|
17
|
+
export interface decodeResult extends DecodeResult {
|
|
18
|
+
}
|
|
19
|
+
export interface WavFileInfo {
|
|
20
|
+
chunkInfo: {
|
|
21
|
+
chunkId: string;
|
|
22
|
+
dataOffset: number;
|
|
23
|
+
dataLength: number;
|
|
24
|
+
}[];
|
|
25
|
+
fmt: {
|
|
26
|
+
formatCode: number;
|
|
27
|
+
numberOfChannels: number;
|
|
28
|
+
sampleRate: number;
|
|
29
|
+
bytesPerSec: number;
|
|
30
|
+
bytesPerFrame: number;
|
|
31
|
+
bitsPerSample: number;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 编码为 SILK
|
|
36
|
+
* @param input WAV 或单声道 pcm_s16le 文件
|
|
37
|
+
* @param sampleRate `input` 的采样率,可为 8000/12000/16000/24000/32000/44100/48000,当 `input` 为 WAV 时可填入 0
|
|
38
|
+
* @returns SILK
|
|
39
|
+
*/
|
|
40
|
+
export declare function encode(input: ArrayBufferView | ArrayBuffer, sampleRate: number): Promise<EncodeResult>;
|
|
41
|
+
/**
|
|
42
|
+
* 将 SILK 解码为 PCM
|
|
43
|
+
* @param input SILK 文件
|
|
44
|
+
* @param sampleRate `input` 的采样率
|
|
45
|
+
* @returns pcm_s16le
|
|
46
|
+
*/
|
|
47
|
+
export declare function decode(input: ArrayBufferView | ArrayBuffer, sampleRate: number): Promise<DecodeResult>;
|
|
48
|
+
/**
|
|
49
|
+
* 获取 SILK 音频时长
|
|
50
|
+
* @param data SILK 文件
|
|
51
|
+
* @param frameMs SILK 的 frameMs,可为 20/40/60/80/100,默认为 20
|
|
52
|
+
* @returns 单位为毫秒的时长
|
|
53
|
+
*/
|
|
54
|
+
export declare function getDuration(data: ArrayBufferView | ArrayBuffer, frameMs?: number): number;
|
|
55
|
+
/**
|
|
56
|
+
* 检测是否为 WAV 文件
|
|
57
|
+
* @param data 任意文件
|
|
58
|
+
*/
|
|
59
|
+
export declare function isWav(data: ArrayBufferView | ArrayBuffer): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* 获取 WAV 文件的信息
|
|
62
|
+
* @param data WAV 文件
|
|
63
|
+
* @returns metadata
|
|
64
|
+
*/
|
|
65
|
+
export declare function getWavFileInfo(data: ArrayBufferView | ArrayBuffer): WavFileInfo;
|
|
66
|
+
/**
|
|
67
|
+
* 检测是否为 SILK 文件
|
|
68
|
+
* @param data 任意文件
|
|
69
|
+
*/
|
|
70
|
+
export declare function isSilk(data: ArrayBufferView | ArrayBuffer): boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var Module=async function(moduleArg={}){var moduleRtn,g=moduleArg,aa,q,ba=new Promise((a,b)=>{aa=a,q=b}),ca=typeof window=="object",da=typeof WorkerGlobalScope<"u",t=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";if(t){let{createRequire:a}=await import("module");var require2=a(import.meta.url)}var u=(a,b)=>{throw b},ea=import.meta.url,v="",fa,w;if(t){var fs=require2("fs"),ha=require2("path");ea.startsWith("file:")&&(v=ha.dirname(require2("url").fileURLToPath(ea))+"/"),w=a=>(a=y(a)?new URL(a):a,fs.readFileSync(a)),fa=async a=>(a=y(a)?new URL(a):a,fs.readFileSync(a,void 0)),process.argv.slice(2),u=(a,b)=>{throw process.exitCode=a,b}}else if(ca||da){try{v=new URL(".",ea).href}catch{}da&&(w=a=>{var b=new XMLHttpRequest;return b.open("GET",a,!1),b.responseType="arraybuffer",b.send(null),new Uint8Array(b.response)}),fa=async a=>{if(y(a))return new Promise((d,c)=>{var e=new XMLHttpRequest;e.open("GET",a,!0),e.responseType="arraybuffer",e.onload=()=>{e.status==200||e.status==0&&e.response?d(e.response):c(e.status)},e.onerror=c,e.send(null)});var b=await fetch(a,{credentials:"same-origin"});if(b.ok)return b.arrayBuffer();throw Error(b.status+" : "+b.url)}}console.log.bind(console);var A=console.error.bind(console),C,D,E=!1,ia,ja,F,G,H,I,J,ka,la,ma,na,y=a=>a.startsWith("file://");function pa(){var a=D.buffer;ja=new Int8Array(a),G=new Int16Array(a),F=new Uint8Array(a),H=new Uint16Array(a),I=new Int32Array(a),J=new Uint32Array(a),ka=new Float32Array(a),na=new Float64Array(a),la=new BigInt64Array(a),ma=new BigUint64Array(a)}var K=0,L=null;function qa(a){throw g.onAbort?.(a),a="Aborted("+a+")",A(a),E=!0,a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info."),q(a),a}var ra;async function sa(a){if(!C)try{var b=await fa(a);return new Uint8Array(b)}catch{}if(a==ra&&C)a=new Uint8Array(C);else if(w)a=w(a);else throw"both async and sync fetching of the wasm failed";return a}async function ta(a,b){try{var d=await sa(a);return await WebAssembly.instantiate(d,b)}catch(c){A(`failed to asynchronously prepare wasm: ${c}`),qa(c)}}async function ua(a){var b=ra;if(!C&&typeof WebAssembly.instantiateStreaming=="function"&&!y(b)&&!t)try{var d=fetch(b,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(d,a)}catch(c){A(`wasm streaming compile failed: ${c}`),A("falling back to ArrayBuffer instantiation")}return ta(b,a)}class va{name="ExitStatus";constructor(a){this.message=`Program terminated with exit(${a})`,this.status=a}}var wa=a=>{for(;0<a.length;)a.shift()(g)},xa=[],ya=[],za=()=>{var a=g.preRun.shift();ya.push(a)},O=!0;class Aa{constructor(a){this.I=a-24}}var Ba=0,Ca=0,Da,P=a=>{for(var b="";F[a];)b+=Da[F[a++]];return b},Q={},R={},S={},T=g.BindingError=class extends Error{constructor(a){super(a),this.name="BindingError"}},Ea=a=>{throw new T(a)};function Fa(a,b,d={}){var c=b.name;if(!a)throw new T(`type "${c}" must have a positive integer typeid pointer`);if(R.hasOwnProperty(a)){if(d.K)return;throw new T(`Cannot register type '${c}' twice`)}R[a]=b,delete S[a],Q.hasOwnProperty(a)&&(b=Q[a],delete Q[a],b.forEach(e=>e()))}function U(a,b,d={}){return Fa(a,b,d)}var Ga=(a,b,d)=>{switch(b){case 1:return d?c=>ja[c]:c=>F[c];case 2:return d?c=>G[c>>1]:c=>H[c>>1];case 4:return d?c=>I[c>>2]:c=>J[c>>2];case 8:return d?c=>la[c>>3]:c=>ma[c>>3];default:throw new TypeError(`invalid integer width (${b}): ${a}`)}},Ha=[],V=[],Ia=a=>{9<a&&--V[a+1]===0&&(V[a]=void 0,Ha.push(a))},Ja=a=>{if(!a)throw new T(`Cannot use deleted val. handle = ${a}`);return V[a]},Ka=a=>{switch(a){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let b=Ha.pop()||V.length;return V[b]=a,V[b+1]=1,b}};function La(a){return this.fromWireType(J[a>>2])}var Ma={name:"emscripten::val",fromWireType:a=>{var b=Ja(a);return Ia(a),b},toWireType:(a,b)=>Ka(b),H:8,readValueFromPointer:La,G:null},Na=(a,b)=>{switch(b){case 4:return function(d){return this.fromWireType(ka[d>>2])};case 8:return function(d){return this.fromWireType(na[d>>3])};default:throw new TypeError(`invalid float width (${b}): ${a}`)}},Oa=a=>{for(;a.length;){var b=a.pop();a.pop()(b)}};function Pa(a){for(var b=1;b<a.length;++b)if(a[b]!==null&&a[b].G===void 0)return!0;return!1}var Sa=(a,b)=>{if(g[a].F===void 0){var d=g[a];g[a]=function(...c){if(!g[a].F.hasOwnProperty(c.length))throw new T(`Function '${b}' called with an invalid number of arguments (${c.length}) - expects one of (${g[a].F})!`);return g[a].F[c.length].apply(this,c)},g[a].F=[],g[a].F[d.J]=d}},Ta=(a,b,d)=>{if(g.hasOwnProperty(a)){if(d===void 0||g[a].F!==void 0&&g[a].F[d]!==void 0)throw new T(`Cannot register public name '${a}' twice`);if(Sa(a,a),g[a].F.hasOwnProperty(d))throw new T(`Cannot register multiple overloads of a function with the same number of arguments (${d})!`);g[a].F[d]=b}else g[a]=b,g[a].J=d},Ua=(a,b)=>{for(var d=[],c=0;c<a;c++)d.push(J[b+4*c>>2]);return d},Va=g.InternalError=class extends Error{constructor(a){super(a),this.name="InternalError"}},Wa=[],Xa,Ya=(a,b)=>{a=P(a);var d;if((d=Wa[b])||(Wa[b]=d=Xa.get(b)),typeof d!="function")throw new T(`unknown function pointer with signature ${a}: ${b}`);return d};class Za extends Error{}for(var ab=a=>{a=$a(a);var b=P(a);return W(a),b},bb=(a,b)=>{function d(f){e[f]||R[f]||(S[f]?S[f].forEach(d):(c.push(f),e[f]=!0))}var c=[],e={};throw b.forEach(d),new Za(`${a}: `+c.map(ab).join([", "]))},cb=(a,b)=>{function d(h){if(h=b(h),h.length!==c.length)throw new Va("Mismatched type converter count");for(var l=0;l<c.length;++l)U(c[l],h[l])}var c=[];c.forEach(h=>S[h]=a);var e=Array(a.length),f=[],m=0;a.forEach((h,l)=>{R.hasOwnProperty(h)?e[l]=R[h]:(f.push(h),Q.hasOwnProperty(h)||(Q[h]=[]),Q[h].push(()=>{e[l]=R[h],++m,m===f.length&&d(e)}))}),f.length===0&&d(e)},db=a=>{a=a.trim();let b=a.indexOf("(");return b===-1?a:a.slice(0,b)},eb=typeof TextDecoder<"u"?new TextDecoder:void 0,fb=(a=0,b=NaN)=>{var d=F,c=a+b;for(b=a;d[b]&&!(b>=c);)++b;if(16<b-a&&d.buffer&&eb)return eb.decode(d.subarray(a,b));for(c="";a<b;){var e=d[a++];if(e&128){var f=d[a++]&63;if((e&224)==192)c+=String.fromCharCode((e&31)<<6|f);else{var m=d[a++]&63;e=(e&240)==224?(e&15)<<12|f<<6|m:(e&7)<<18|f<<12|m<<6|d[a++]&63,65536>e?c+=String.fromCharCode(e):(e-=65536,c+=String.fromCharCode(55296|e>>10,56320|e&1023))}}else c+=String.fromCharCode(e)}return c},gb=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,hb=(a,b)=>{for(var d=a>>1,c=d+b/2;!(d>=c)&&H[d];)++d;if(d<<=1,32<d-a&&gb)return gb.decode(F.subarray(a,d));for(d="",c=0;!(c>=b/2);++c){var e=G[a+2*c>>1];if(e==0)break;d+=String.fromCharCode(e)}return d},ib=(a,b,d)=>{if(d??=2147483647,2>d)return 0;d-=2;var c=b;d=d<2*a.length?d/2:a.length;for(var e=0;e<d;++e)G[b>>1]=a.charCodeAt(e),b+=2;return G[b>>1]=0,b-c},jb=a=>2*a.length,kb=(a,b)=>{for(var d=0,c="";!(d>=b/4);){var e=I[a+4*d>>2];if(e==0)break;++d,65536<=e?(e-=65536,c+=String.fromCharCode(55296|e>>10,56320|e&1023)):c+=String.fromCharCode(e)}return c},lb=(a,b,d)=>{if(d??=2147483647,4>d)return 0;var c=b;d=c+d-4;for(var e=0;e<a.length;++e){var f=a.charCodeAt(e);if(55296<=f&&57343>=f){var m=a.charCodeAt(++e);f=65536+((f&1023)<<10)|m&1023}if(I[b>>2]=f,b+=4,b+4>d)break}return I[b>>2]=0,b-c},mb=a=>{for(var b=0,d=0;d<a.length;++d){var c=a.charCodeAt(d);55296<=c&&57343>=c&&++d,b+=4}return b},nb=0,ob=[],pb=a=>{var b=ob.length;return ob.push(a),b},qb=(a,b)=>{var d=R[a];if(d===void 0)throw a=`${b} has unknown type ${ab(a)}`,new T(a);return d},rb=(a,b)=>{for(var d=Array(a),c=0;c<a;++c)d[c]=qb(J[b+4*c>>2],`parameter ${c}`);return d},sb=(a,b,d)=>{var c=[];return a=a.toWireType(c,d),c.length&&(J[b>>2]=Ka(c)),a},X={},tb=a=>{ia=a,O||0<nb||(g.onExit?.(a),E=!0),u(a,new va(a))},ub=a=>{if(!E)try{if(a(),!(O||0<nb))try{ia=a=ia,tb(a)}catch(b){b instanceof va||b=="unwind"||u(1,b)}}catch(b){b instanceof va||b=="unwind"||u(1,b)}},vb=Array(256),Y=0;256>Y;++Y)vb[Y]=String.fromCharCode(Y);Da=vb,V.push(0,1,void 0,1,null,1,!0,1,!1,1),g.count_emval_handles=()=>V.length/2-5-Ha.length,g.noExitRuntime&&(O=g.noExitRuntime),g.printErr&&(A=g.printErr),g.wasmBinary&&(C=g.wasmBinary);var Ab={u:(a,b,d)=>{var c=new Aa(a);throw J[c.I+16>>2]=0,J[c.I+4>>2]=b,J[c.I+8>>2]=d,Ba=a,Ca++,Ba},v:()=>qa(""),l:(a,b,d)=>{b=P(b),U(a,{name:b,fromWireType:c=>c,toWireType:function(c,e){if(typeof e!="bigint"&&typeof e!="number")throw e===null?e="null":(c=typeof e,e=c==="object"||c==="array"||c==="function"?e.toString():""+e),new TypeError(`Cannot convert "${e}" to ${this.name}`);return typeof e=="number"&&(e=BigInt(e)),e},H:8,readValueFromPointer:Ga(b,d,b.indexOf("u")==-1),G:null})},o:(a,b,d,c)=>{b=P(b),U(a,{name:b,fromWireType:function(e){return!!e},toWireType:function(e,f){return f?d:c},H:8,readValueFromPointer:function(e){return this.fromWireType(F[e])},G:null})},m:a=>U(a,Ma),k:(a,b,d)=>{b=P(b),U(a,{name:b,fromWireType:c=>c,toWireType:(c,e)=>e,H:8,readValueFromPointer:Na(b,d),G:null})},c:(a,b,d,c,e,f,m)=>{var h=Ua(b,d);a=P(a),a=db(a),e=Ya(c,e),Ta(a,function(){bb(`Cannot call ${a} due to unbound types`,h)},b-1),cb(h,l=>{var k=[l[0],null].concat(l.slice(1));l=a;var p=a,z=e,n=k.length;if(2>n)throw new T("argTypes array size mismatch! Must at least get return value and 'this' types!");var B=k[1]!==null&&!1,M=Pa(k),Qa=k[0].name!=="void";z=[p,Ea,z,f,Oa,k[0],k[1]];for(var x=0;x<n-2;++x)z.push(k[x+2]);if(!M)for(x=B?1:2;x<k.length;++x)k[x].G!==null&&z.push(k[x].G);M=Pa(k),x=k.length-2;var r=[],N=["fn"];for(B&&N.push("thisWired"),n=0;n<x;++n)r.push(`arg${n}`),N.push(`arg${n}Wired`);r=r.join(","),N=N.join(","),r=`return function (${r}) {
|
|
2
|
+
`,M&&(r+=`var destructors = [];
|
|
3
|
+
`);var Ra=M?"destructors":"null",oa="humanName throwBindingError invoker fn runDestructors retType classParam".split(" ");for(B&&(r+=`var thisWired = classParam['toWireType'](${Ra}, this);
|
|
4
|
+
`),n=0;n<x;++n)r+=`var arg${n}Wired = argType${n}['toWireType'](${Ra}, arg${n});
|
|
5
|
+
`,oa.push(`argType${n}`);if(r+=(Qa||m?"var rv = ":"")+`invoker(${N});
|
|
6
|
+
`,M)r+=`runDestructors(destructors);
|
|
7
|
+
`;else for(n=B?1:2;n<k.length;++n)B=n===1?"thisWired":"arg"+(n-2)+"Wired",k[n].G!==null&&(r+=`${B}_dtor(${B});
|
|
8
|
+
`,oa.push(`${B}_dtor`));Qa&&(r+=`var ret = retType['fromWireType'](rv);
|
|
9
|
+
return ret;
|
|
10
|
+
`);let[yb,zb]=[oa,r+`}
|
|
11
|
+
`];if(k=new Function(...yb,zb)(...z),p=Object.defineProperty(k,"name",{value:p}),k=b-1,!g.hasOwnProperty(l))throw new Va("Replacing nonexistent public symbol");return g[l].F!==void 0&&k!==void 0?g[l].F[k]=p:(g[l]=p,g[l].J=k),[]})},b:(a,b,d,c,e)=>{if(b=P(b),e===-1&&(e=4294967295),e=h=>h,c===0){var f=32-8*d;e=h=>h<<f>>>f}var m=b.includes("unsigned")?function(h,l){return l>>>0}:function(h,l){return l};U(a,{name:b,fromWireType:e,toWireType:m,H:8,readValueFromPointer:Ga(b,d,c!==0),G:null})},a:(a,b,d)=>{function c(f){return new e(ja.buffer,J[f+4>>2],J[f>>2])}var e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][b];d=P(d),U(a,{name:d,fromWireType:c,H:8,readValueFromPointer:c},{K:!0})},n:(a,b)=>{b=P(b),U(a,{name:b,fromWireType:function(d){for(var c=J[d>>2],e=d+4,f,m=e,h=0;h<=c;++h){var l=e+h;(h==c||F[l]==0)&&(m=m?fb(m,l-m):"",f===void 0?f=m:(f+="\0",f+=m),m=l+1)}return W(d),f},toWireType:function(d,c){c instanceof ArrayBuffer&&(c=new Uint8Array(c));var e,f=typeof c=="string";if(!(f||ArrayBuffer.isView(c)&&c.BYTES_PER_ELEMENT==1))throw new T("Cannot pass non-string to std::string");var m;if(f)for(e=m=0;e<c.length;++e){var h=c.charCodeAt(e);127>=h?m++:2047>=h?m+=2:55296<=h&&57343>=h?(m+=4,++e):m+=3}else m=c.length;if(e=m,m=wb(4+e+1),h=m+4,J[m>>2]=e,f){if(f=h,h=e+1,e=F,0<h){h=f+h-1;for(var l=0;l<c.length;++l){var k=c.charCodeAt(l);if(55296<=k&&57343>=k){var p=c.charCodeAt(++l);k=65536+((k&1023)<<10)|p&1023}if(127>=k){if(f>=h)break;e[f++]=k}else{if(2047>=k){if(f+1>=h)break;e[f++]=192|k>>6}else{if(65535>=k){if(f+2>=h)break;e[f++]=224|k>>12}else{if(f+3>=h)break;e[f++]=240|k>>18,e[f++]=128|k>>12&63}e[f++]=128|k>>6&63}e[f++]=128|k&63}}e[f]=0}}else F.set(c,h);return d!==null&&d.push(W,m),m},H:8,readValueFromPointer:La,G(d){W(d)}})},e:(a,b,d)=>{if(d=P(d),b===2)var c=hb,e=ib,f=jb,m=h=>H[h>>1];else b===4&&(c=kb,e=lb,f=mb,m=h=>J[h>>2]);U(a,{name:d,fromWireType:h=>{for(var l=J[h>>2],k,p=h+4,z=0;z<=l;++z){var n=h+4+z*b;(z==l||m(n)==0)&&(p=c(p,n-p),k===void 0?k=p:(k+="\0",k+=p),p=n+b)}return W(h),k},toWireType:(h,l)=>{if(typeof l!="string")throw new T(`Cannot pass non-string to C++ string type ${d}`);var k=f(l),p=wb(4+k+b);return J[p>>2]=k/b,e(l,p+4,k+b),h!==null&&h.push(W,p),p},H:8,readValueFromPointer:La,G(h){W(h)}})},f:a=>{U(a,Ma)},p:(a,b)=>{b=P(b),U(a,{L:!0,name:b,H:0,fromWireType:()=>{},toWireType:()=>{}})},s:()=>{O=!1,nb=0},i:(a,b,d,c)=>(a=ob[a],b=Ja(b),a(null,b,d,c)),d:Ia,h:(a,b,d)=>{b=rb(a,b);var c=b.shift();a--;var e=`return function (obj, func, destructorsRef, args) {
|
|
12
|
+
`,f=0,m=[];d===0&&m.push("obj");for(var h=["retType"],l=[c],k=0;k<a;++k)m.push(`arg${k}`),h.push(`argType${k}`),l.push(b[k]),e+=` var arg${k} = argType${k}.readValueFromPointer(args${f?"+"+f:""});
|
|
13
|
+
`,f+=b[k].H;return e+=` var rv = ${d===1?"new func":"func.call"}(${m.join(", ")});
|
|
14
|
+
`,c.L||(h.push("emval_returnValue"),l.push(sb),e+=` return emval_returnValue(retType, destructorsRef, rv);
|
|
15
|
+
`),a=new Function(...h,e+`};
|
|
16
|
+
`)(...l),d=`methodCaller<(${b.map(p=>p.name).join(", ")}) => ${c.name}>`,pb(Object.defineProperty(a,"name",{value:d}))},q:a=>{9<a&&(V[a+1]+=1)},g:a=>{var b=Ja(a);Oa(b),Ia(a)},j:(a,b)=>(a=qb(a,"_emval_take_value"),a=a.readValueFromPointer(b),Ka(a)),t:(a,b)=>{if(X[a]&&(clearTimeout(X[a].id),delete X[a]),!b)return 0;var d=setTimeout(()=>{delete X[a],ub(()=>xb(a,performance.now()))},b);return X[a]={id:d,M:b},0},w:a=>{var b=F.length;if(a>>>=0,2147483648<a)return!1;for(var d=1;4>=d;d*=2){var c=b*(1+.2/d);c=Math.min(c,a+100663296);a:{c=(Math.min(2147483648,65536*Math.ceil(Math.max(a,c)/65536))-D.buffer.byteLength+65535)/65536|0;try{D.grow(c),pa();var e=1;break a}catch{}e=void 0}if(e)return!0}return!1},r:tb},Z=await async function(){function a(c){return Z=c.exports,D=Z.x,pa(),Xa=Z.D,K--,g.monitorRunDependencies?.(K),K==0&&L&&(c=L,L=null,c()),Z}K++,g.monitorRunDependencies?.(K);var b={a:Ab};if(g.instantiateWasm)return new Promise(c=>{g.instantiateWasm(b,(e,f)=>{c(a(e,f))})});ra??=g.locateFile?g.locateFile?g.locateFile("silk.wasm",v):v+"silk.wasm":new URL("silk.wasm",import.meta.url).href;try{var d=await ua(b);return a(d.instance)}catch(c){return q(c),Promise.reject(c)}}(),$a=Z.z,wb=Z.A,W=Z.B,xb=Z.C;function Bb(){function a(){if(g.calledRun=!0,!E){if(Z.y(),aa(g),g.onRuntimeInitialized?.(),g.postRun)for(typeof g.postRun=="function"&&(g.postRun=[g.postRun]);g.postRun.length;){var b=g.postRun.shift();xa.push(b)}wa(xa)}}if(0<K)L=Bb;else{if(g.preRun)for(typeof g.preRun=="function"&&(g.preRun=[g.preRun]);g.preRun.length;)za();wa(ya),0<K?L=Bb:g.setStatus?(g.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>g.setStatus(""),1),a()},1)):a()}}if(g.preInit)for(typeof g.preInit=="function"&&(g.preInit=[g.preInit]);0<g.preInit.length;)g.preInit.shift()();return Bb(),moduleRtn=ba,moduleRtn},silk_default=Module;function isWavFile(fileData){try{let chunks=unpackWavFileChunks(fileData),fmt=decodeFormatChunk(chunks.get("fmt")),data=chunks.get("data");return getWavFileType(fmt),verifyDataChunkLength(data,fmt),!0}catch{return!1}}var audioEncodingNames=["int","float"],wavFileTypeAudioEncodings=[0,0,0,1];function decodeWavFile(fileData){let chunks=unpackWavFileChunks(fileData),fmt=decodeFormatChunk(chunks.get("fmt")),data=chunks.get("data"),wavFileType=getWavFileType(fmt),audioEncoding=wavFileTypeAudioEncodings[wavFileType],wavFileTypeName=audioEncodingNames[audioEncoding]+fmt.bitsPerSample;return verifyDataChunkLength(data,fmt),{channelData:decodeDataChunk(data,fmt,wavFileType),sampleRate:fmt.sampleRate,numberOfChannels:fmt.numberOfChannels,audioEncoding,bitsPerSample:fmt.bitsPerSample,wavFileTypeName}}function unpackWavFileChunks(fileData){let dataView;fileData instanceof ArrayBuffer?dataView=new DataView(fileData):dataView=new DataView(fileData.buffer,fileData.byteOffset,fileData.byteLength);let fileLength=dataView.byteLength;if(fileLength<20)throw new Error("WAV file is too short.");if(getString(dataView,0,4)!="RIFF")throw new Error("Not a valid WAV file (no RIFF header).");let mainChunkLength=dataView.getUint32(4,!0);if(8+mainChunkLength!=fileLength)throw new Error(`Main chunk length of WAV file (${8+mainChunkLength}) does not match file size (${fileLength}).`);if(getString(dataView,8,4)!="WAVE")throw new Error("RIFF file is not a WAV file.");let chunks=new Map,fileOffset=12;for(;fileOffset<fileLength;){if(fileOffset+8>fileLength)throw new Error(`Incomplete chunk prefix in WAV file at offset ${fileOffset}.`);let chunkId=getString(dataView,fileOffset,4).trim(),chunkLength=dataView.getUint32(fileOffset+4,!0);if(fileOffset+8+chunkLength>fileLength)throw new Error(`Incomplete chunk data in WAV file at offset ${fileOffset}.`);let chunkData=new DataView(dataView.buffer,dataView.byteOffset+fileOffset+8,chunkLength);chunks.set(chunkId,chunkData);let padLength=chunkLength%2;fileOffset+=8+chunkLength+padLength}return chunks}function getString(dataView,offset,length){let a=new Uint8Array(dataView.buffer,dataView.byteOffset+offset,length);return String.fromCharCode.apply(null,a)}function getInt24(dataView,offset){let b0=dataView.getInt8(offset+2)*65536,b12=dataView.getUint16(offset,!0);return b0+b12}function decodeFormatChunk(dataView){if(!dataView)throw new Error("No format chunk found in WAV file.");if(dataView.byteLength<16)throw new Error("Format chunk of WAV file is too short.");let fmt={};return fmt.formatCode=dataView.getUint16(0,!0),fmt.numberOfChannels=dataView.getUint16(2,!0),fmt.sampleRate=dataView.getUint32(4,!0),fmt.bytesPerSec=dataView.getUint32(8,!0),fmt.bytesPerFrame=dataView.getUint16(12,!0),fmt.bitsPerSample=dataView.getUint16(14,!0),fmt}function getWavFileType(fmt){if(fmt.numberOfChannels<1||fmt.numberOfChannels>999)throw new Error("Invalid number of channels in WAV file.");let bytesPerSample=Math.ceil(fmt.bitsPerSample/8),expectedBytesPerFrame=fmt.numberOfChannels*bytesPerSample;if(fmt.formatCode==1&&fmt.bitsPerSample>=1&&fmt.bitsPerSample<=8&&fmt.bytesPerFrame==expectedBytesPerFrame)return 0;if(fmt.formatCode==1&&fmt.bitsPerSample>=9&&fmt.bitsPerSample<=16&&fmt.bytesPerFrame==expectedBytesPerFrame)return 1;if(fmt.formatCode==1&&fmt.bitsPerSample>=17&&fmt.bitsPerSample<=24&&fmt.bytesPerFrame==expectedBytesPerFrame)return 2;if(fmt.formatCode==3&&fmt.bitsPerSample==32&&fmt.bytesPerFrame==expectedBytesPerFrame)return 3;throw new Error(`Unsupported WAV file type, formatCode=${fmt.formatCode}, bitsPerSample=${fmt.bitsPerSample}, bytesPerFrame=${fmt.bytesPerFrame}, numberOfChannels=${fmt.numberOfChannels}.`)}function decodeDataChunk(data,fmt,wavFileType){switch(wavFileType){case 0:return decodeDataChunk_uint8(data,fmt);case 1:return decodeDataChunk_int16(data,fmt);case 2:return decodeDataChunk_int24(data,fmt);case 3:return decodeDataChunk_float32(data,fmt);default:throw new Error("No decoder.")}}function decodeDataChunk_int16(data,fmt){let channelData=allocateChannelDataArrays(data.byteLength,fmt),numberOfChannels=fmt.numberOfChannels,numberOfFrames=channelData[0].length,offs=0;for(let frameNo=0;frameNo<numberOfFrames;frameNo++)for(let channelNo=0;channelNo<numberOfChannels;channelNo++){let sampleValueFloat=data.getInt16(offs,!0)/32768;channelData[channelNo][frameNo]=sampleValueFloat,offs+=2}return channelData}function decodeDataChunk_uint8(data,fmt){let channelData=allocateChannelDataArrays(data.byteLength,fmt),numberOfChannels=fmt.numberOfChannels,numberOfFrames=channelData[0].length,offs=0;for(let frameNo=0;frameNo<numberOfFrames;frameNo++)for(let channelNo=0;channelNo<numberOfChannels;channelNo++){let sampleValueFloat=(data.getUint8(offs)-128)/128;channelData[channelNo][frameNo]=sampleValueFloat,offs+=1}return channelData}function decodeDataChunk_int24(data,fmt){let channelData=allocateChannelDataArrays(data.byteLength,fmt),numberOfChannels=fmt.numberOfChannels,numberOfFrames=channelData[0].length,offs=0;for(let frameNo=0;frameNo<numberOfFrames;frameNo++)for(let channelNo=0;channelNo<numberOfChannels;channelNo++){let sampleValueFloat=getInt24(data,offs)/8388608;channelData[channelNo][frameNo]=sampleValueFloat,offs+=3}return channelData}function decodeDataChunk_float32(data,fmt){let channelData=allocateChannelDataArrays(data.byteLength,fmt),numberOfChannels=fmt.numberOfChannels,numberOfFrames=channelData[0].length,offs=0;for(let frameNo=0;frameNo<numberOfFrames;frameNo++)for(let channelNo=0;channelNo<numberOfChannels;channelNo++){let sampleValueFloat=data.getFloat32(offs,!0);channelData[channelNo][frameNo]=sampleValueFloat,offs+=4}return channelData}function allocateChannelDataArrays(dataLength,fmt){let numberOfFrames=Math.floor(dataLength/fmt.bytesPerFrame),channelData=new Array(fmt.numberOfChannels);for(let channelNo=0;channelNo<fmt.numberOfChannels;channelNo++)channelData[channelNo]=new Float32Array(numberOfFrames);return channelData}function verifyDataChunkLength(data,fmt){if(!data)throw new Error("No data chunk found in WAV file.");if(data.byteLength%fmt.bytesPerFrame!=0)throw new Error("WAV file data chunk length is not a multiple of frame size.")}function getWavFileInfo(fileData){let chunks=unpackWavFileChunks(fileData),chunkInfo=getChunkInfo(chunks),fmt=decodeFormatChunk(chunks.get("fmt"));return{chunkInfo,fmt}}function getChunkInfo(chunks){let chunkInfo=[];for(let e of chunks){let ci={};ci.chunkId=e[0],ci.dataOffset=e[1].byteOffset,ci.dataLength=e[1].byteLength,chunkInfo.push(ci)}return chunkInfo.sort((e1,e2)=>e1.dataOffset-e2.dataOffset),chunkInfo}function ensureMonoPcm(channelData){let{length:numberOfChannels}=channelData;if(numberOfChannels===1)return channelData[0];let monoData=new Float32Array(channelData[0].length);for(let i=0;i<monoData.length;i++){let sum=0;for(let j=0;j<numberOfChannels;j++)sum+=channelData[j][i];monoData[i]=sum/numberOfChannels}return monoData}function ensureS16lePcm(input){let int16Array=new Int16Array(input.length);for(let offset=0;offset<input.length;offset++){let x=~~(input[offset]*32768);int16Array[offset]=x>32767?32767:x}return int16Array.buffer}function toUTF8String(input,start=0,end=input.byteLength){return new TextDecoder().decode(input.slice(start,end))}function binaryFromSource(source){return ArrayBuffer.isView(source)?source.buffer.slice(source.byteOffset,source.byteOffset+source.byteLength):source}async function encode(input,sampleRate){let instance=await silk_default(),buffer=binaryFromSource(input);if(!buffer?.byteLength)throw new Error("input data length is 0");if(isWavFile(input)){let{channelData,sampleRate:wavSampleRate}=decodeWavFile(input);sampleRate||=wavSampleRate,buffer=ensureS16lePcm(ensureMonoPcm(channelData))}let data=new Uint8Array,duration=instance.silk_encode(buffer,sampleRate,output=>{data=output.slice()});if(duration===0)throw new Error("silk encoding failure");return{data,duration}}async function decode(input,sampleRate){let instance=await silk_default(),buffer=binaryFromSource(input);if(!buffer?.byteLength)throw new Error("input data length is 0");let data=new Uint8Array,duration=instance.silk_decode(buffer,sampleRate,output=>{output.length>0&&(data=output.slice())});if(duration===0)throw new Error("silk decoding failure");return{data,duration}}function getDuration(data,frameMs=20){let buffer=binaryFromSource(data),view=new DataView(buffer),byteLength=view.byteLength,offset=view.getUint8(0)===2?10:9,blocks=0;for(;offset<byteLength;){let size=view.getUint16(offset,!0);blocks+=1,offset+=size+2}return blocks*frameMs}function isWav(data){return isWavFile(data)}function getWavFileInfo2(data){return getWavFileInfo(data)}function isSilk(data){let buffer=binaryFromSource(data);return buffer.byteLength<7?!1:toUTF8String(buffer,0,7).includes("#!SILK")}export{decode,encode,getDuration,getWavFileInfo2 as getWavFileInfo,isSilk,isWav};
|
|
Binary file
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function ensureMonoPcm(channelData: Float32Array[]): Float32Array;
|
|
2
|
+
export declare function ensureS16lePcm(input: Float32Array): ArrayBuffer;
|
|
3
|
+
export declare function toUTF8String(input: ArrayBuffer, start?: number, end?: number): string;
|
|
4
|
+
export declare function binaryFromSource(source: ArrayBufferView | ArrayBuffer): ArrayBuffer;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "silk-wasm",
|
|
3
|
+
"description": "Tencent silk encoder for Node.js and browser",
|
|
4
|
+
"version": "3.7.1",
|
|
5
|
+
"main": "lib/index.cjs",
|
|
6
|
+
"module": "lib/index.mjs",
|
|
7
|
+
"typings": "lib/index.d.ts",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/idranme/silk-wasm.git"
|
|
11
|
+
},
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"files": [
|
|
14
|
+
"lib"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"compile:cjs": "esbuild src/index.ts --outfile=lib/index.cjs --bundle --minify-whitespace --minify-syntax --platform=node --target=es2022 --inject:scripts/patch.js --define:import.meta.url=import_meta_url",
|
|
18
|
+
"compile:esm": "esbuild src/index.ts --outfile=lib/index.mjs --bundle --minify-whitespace --minify-syntax --platform=node --target=es2022 --format=esm",
|
|
19
|
+
"build": "yarn compile:cjs && yarn compile:esm && tsc"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"silk",
|
|
23
|
+
"tencent",
|
|
24
|
+
"encoder",
|
|
25
|
+
"sdk",
|
|
26
|
+
"wasm",
|
|
27
|
+
"decoder",
|
|
28
|
+
"codec"
|
|
29
|
+
],
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"esbuild": "^0.25.3",
|
|
32
|
+
"typescript": "^5.8.3",
|
|
33
|
+
"wav-file-decoder": "^1.0.3"
|
|
34
|
+
},
|
|
35
|
+
"packageManager": "yarn@4.9.1",
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=16.11.0"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
github: eshaz
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
dist
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2021-2023 Ethan Halsall
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# `simple-yenc`
|
|
2
|
+
|
|
3
|
+
`simple-yenc` is a minimalist yEnc and dynEncode encoder and decoder ECMAScript library for browser and NodeJS.
|
|
4
|
+
|
|
5
|
+
This library is designed to be simple to use and is optimized for size so that inclusion in a browser based application has very little impact.
|
|
6
|
+
|
|
7
|
+
## What is yEnc?
|
|
8
|
+
|
|
9
|
+
yEnc, or yEncode, is a very space efficient method of binary encoding. yEnc's overhead is around 1–2%,
|
|
10
|
+
compared to 33%–40% overhead for 6-bit encoding methods like Base64. yEnc has 252 of the 256 possible bytes available for use for encoding. NUL, LF, CR, and = are the only escaped characters.
|
|
11
|
+
|
|
12
|
+
### Read More
|
|
13
|
+
http://www.yenc.org/whatis.htm
|
|
14
|
+
|
|
15
|
+
## What is dynEncode?
|
|
16
|
+
|
|
17
|
+
dynEncode, or Dynamic Encode is an encoding scheme that dynamically selects the most efficient byte offset depending incoming data and the required escape characters. This encoding scheme is meant to be the most efficient encoding scheme given a set of escape characters and input data. Generally, it is a few percentage points more efficient than yEnc.
|
|
18
|
+
|
|
19
|
+
The only required escape character is `=`, which is used to denote an escaped value. Any other characters may or may not be escaped in the string depending on the destination's escape requirements.
|
|
20
|
+
|
|
21
|
+
Dynamic encoded strings have a configurable byte offset that is selected when the data is encoded. This offset shifts the encoded data around to avoid characters that must be escaped. For example, yEnc's offset is hardcoded to 42, whereas dynEncode can select an offset of 0-255 (all possible offsets).
|
|
22
|
+
|
|
23
|
+
Dynamic encoded strings are prepended with the below metadata that describes the parameters needed to decode the string into binary.
|
|
24
|
+
|
|
25
|
+
### **`dynEncode` Format**
|
|
26
|
+
Bytes | Name | Range | Description
|
|
27
|
+
------|--------------|-------------------------------|--------------------------------------------------------------------------
|
|
28
|
+
00-08 | Signature | `dynEncode` | Magic signature identifying the string as a dynEncode string.
|
|
29
|
+
09-10 | Version | `0x00-0xFE` (`0xFF` reserved) | Base-16 string describing the version of dynEncode.
|
|
30
|
+
|
|
31
|
+
#### Version 0
|
|
32
|
+
Bytes | Name | Range | Description
|
|
33
|
+
------|--------------|-------------|--------------------------------------------------------------------------
|
|
34
|
+
00-08 | Signature | `dynEncode` | Magic signature identifying the string as a dynEncode string.
|
|
35
|
+
09-10 | Version | `0x00` | Base-16 string describing the version of dynEncode.
|
|
36
|
+
11-12 | Byte Offset | `0x00-0xFF` | Base-16 string describing the byte offset used when encoding.
|
|
37
|
+
13-xx | Encoded Data | ... | Data contained in the dynEncode string.
|
|
38
|
+
|
|
39
|
+
#### Current Version (Version 1)
|
|
40
|
+
Bytes | Name | Range | Description
|
|
41
|
+
------|-------------- | --------------------------|--------------------------------------------------------------------------
|
|
42
|
+
00-08 | Signature | `dynEncode` | Magic signature identifying the string as a dynEncode string.
|
|
43
|
+
09-10 | Version | `0x01` | Base-16 string describing the version of dynEncode.
|
|
44
|
+
11-12 | Byte Offset | `0x00-0xFF` | Base-16 string describing the byte offset used when encoding.
|
|
45
|
+
13-20 | CRC 32 checksum | `0x00000000`-`0xFFFFFFFF` | Base-16 string encoding a 32bit signed integer (little endian) describing the checksum of the encoded data. <br> The checksum is validated during the decode process.
|
|
46
|
+
21-xx | Encoded Data | ... | Data contained in the dynEncode string.
|
|
47
|
+
|
|
48
|
+
*dynEncode (Dynamic Encode), the above encoding scheme, and included implementation are copyright © 2022 Ethan Halsall and are licensed under the conditions of the [MIT License](https://github.com/eshaz/simple-yenc/blob/master/LICENSE).*
|
|
49
|
+
|
|
50
|
+
## Usage
|
|
51
|
+
|
|
52
|
+
Install via [NPM](https://www.npmjs.com/package/simple-yenc)
|
|
53
|
+
|
|
54
|
+
```javascript
|
|
55
|
+
// NodeJS
|
|
56
|
+
const yenc = require("simple-yenc");
|
|
57
|
+
|
|
58
|
+
// ES6 Import
|
|
59
|
+
import * as yenc from "simple-yenc";
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### `encode()`
|
|
63
|
+
|
|
64
|
+
Encodes a Uint8Array, or array of integers 0-255, to a yEnc encoded string.
|
|
65
|
+
|
|
66
|
+
```javascript
|
|
67
|
+
// assuming `dataToEncode` is already defined
|
|
68
|
+
|
|
69
|
+
const encodedString = yenc.encode(dataToEncode);
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### `dynamicEncode()`
|
|
73
|
+
|
|
74
|
+
Encodes a Uint8Array, or array of integers 0-255, to a dynEncoded string.
|
|
75
|
+
|
|
76
|
+
This function will iterate over the incoming data 255 times to select the byte offset with the least amount of overhead. Encoding may be relatively slow for large input data.
|
|
77
|
+
|
|
78
|
+
This function only encodes the current version
|
|
79
|
+
|
|
80
|
+
#### Parameters
|
|
81
|
+
|
|
82
|
+
```javascript
|
|
83
|
+
// assuming `dataToEncode` and `stringContainerCharacter` are already defined
|
|
84
|
+
|
|
85
|
+
const encodedString = yenc.encode(dataToEncode, stringContainerCharacter);
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
* First Parameter
|
|
89
|
+
* `Array` of integers 0-255 of data to encode
|
|
90
|
+
* Second Parameter *optional* **default: `"`**
|
|
91
|
+
* `string` representing the character used to declare the string the data will be stored. Escape characters are selected automatically base on JavaScript string escape requirements depending on this value.
|
|
92
|
+
* Valid parameter values: ``` ` ``` (backtick), `"` (double quote), `'` (single quote)
|
|
93
|
+
* Third Parameter *optional* **default: `yenc.crc32`**
|
|
94
|
+
* CRC32 Function that is used to calculate the checksum.
|
|
95
|
+
* The function must implement the `CRC32Function` interface
|
|
96
|
+
|
|
97
|
+
### `decode()`
|
|
98
|
+
|
|
99
|
+
Decodes a yEnc or dynEnc encoded string into a Uint8Array.
|
|
100
|
+
|
|
101
|
+
Note: If you are embedding the yEnc string in HTML, this function will automatically handle the [HTML character reference overrides](https://html.spec.whatwg.org/multipage/parsing.html#table-charref-overrides). The HTML `charset` must be set to a character encoding that allows for single byte character representations such as `cp1252`, `ISO-8859-1`, etc. See [Issue #1](https://github.com/eshaz/simple-yenc/issues/1) for more information.
|
|
102
|
+
|
|
103
|
+
This function decodes all version of dynEnc strings.
|
|
104
|
+
|
|
105
|
+
```javascript
|
|
106
|
+
// assuming `encodedString` is already defined
|
|
107
|
+
|
|
108
|
+
const decodedUint8Array = yenc.decode(encodedString);
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
* First Parameter
|
|
112
|
+
* `string` yenc or dynEnc string
|
|
113
|
+
* Second Parameter *optional* **default: `yenc.crc32`**
|
|
114
|
+
* CRC32 Function that was used to calculate the checksum for the dynamicEncoded string.
|
|
115
|
+
* The function must implement the `CRC32Function` interface
|
|
116
|
+
|
|
117
|
+
### `stringify()`
|
|
118
|
+
|
|
119
|
+
Stringify adds escape characters for ```'\', '`', '${'``` to a yEnc encoded string so it can be stored within a Javascript string template.
|
|
120
|
+
|
|
121
|
+
You can access the encoded value as a string using [``` String.raw`` ```](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/raw).
|
|
122
|
+
|
|
123
|
+
This is useful for inlining binary in Javascript that would otherwise need to be base64 encoded.
|
|
124
|
+
|
|
125
|
+
When stored as a Javascript string, the string can be decoded by using the `decode` function.
|
|
126
|
+
|
|
127
|
+
```javascript
|
|
128
|
+
// assuming `dataToEncode` is already defined
|
|
129
|
+
|
|
130
|
+
const encodedString = yenc.encode(dataToEncode);
|
|
131
|
+
const stringified = yenc.strinfigy(encodedString);
|
|
132
|
+
|
|
133
|
+
fs.writeFileSync(
|
|
134
|
+
"myfile.js",
|
|
135
|
+
Buffer.concat(
|
|
136
|
+
["const encodedBinary = `", stringified, "`"].map(Buffer.from)
|
|
137
|
+
),
|
|
138
|
+
{ encoding: "binary" }
|
|
139
|
+
);
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### `crc32()`
|
|
143
|
+
|
|
144
|
+
Default CRC32 function that calculates the checksum for dynamicEncoded strings.
|
|
145
|
+
|
|
146
|
+
Adapted from [GCC](https://gcc.gnu.org/git/?p=gcc.git;a=blob_plain;f=libiberty/crc32.c;hb=refs/heads/master).
|
|
147
|
+
|
|
148
|
+
This CRC can be specified as:
|
|
149
|
+
* Width: `32`
|
|
150
|
+
* Poly: `0x04c11db7`
|
|
151
|
+
* Init: `0xffffffff`
|
|
152
|
+
* RefIn: `false`
|
|
153
|
+
* RefOut `false`
|
|
154
|
+
* XorOut `0`
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
// CRC32 Function Interface
|
|
158
|
+
(
|
|
159
|
+
buf: Uint8Array,
|
|
160
|
+
init: number = 0xffffffff,
|
|
161
|
+
poly: number = 0x04c11db7
|
|
162
|
+
) => CRC32Function
|
|
163
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=(t,n=4294967295,e=79764919)=>{const r=new Int32Array(256);let o,s,i,c=n;for(o=0;o<256;o++){for(i=o<<24,s=8;s>0;--s)i=2147483648&i?i<<1^e:i<<1;r[o]=i}for(o=0;o<t.length;o++)c=c<<8^r[255&(c>>24^t[o])];return c},n=t=>{const n=[];for(const e of t){let t=(e+42)%256;0===t||10===t||13===t||61===t?n.push("="+String.fromCharCode((t+64)%256)):n.push(String.fromCharCode(t))}return n.join("")},e=(n,e=t)=>{const r=t=>new Uint8Array(t.length/2).map(((n,e)=>parseInt(t.substring(2*e,2*(e+1)),16))),o=t=>r(t)[0],s=new Map;[,8364,,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,,381,,,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,,382,376].forEach(((t,n)=>s.set(t,n)));const i=new Uint8Array(n.length);let c,a,l,f=!1,g=0,h=42,p=n.length>13&&"dynEncode"===n.substring(0,9),u=0;p&&(u=11,a=o(n.substring(9,u)),a<=1&&(u+=2,h=o(n.substring(11,u))),1===a&&(u+=8,l=(t=>new DataView(r(t).buffer).getInt32(0,!0))(n.substring(13,u))));const d=256-h;for(let t=u;t<n.length;t++)if(c=n.charCodeAt(t),61!==c||f){if(92===c&&t<n.length-5&&p){const e=n.charCodeAt(t+1);117!==e&&85!==e||(c=parseInt(n.substring(t+2,t+6),16),t+=5)}if(c>255){const t=s.get(c);t&&(c=t+127)}f&&(f=!1,c-=64),i[g++]=c<h&&c>0?c+d:c-h}else f=!0;const m=i.subarray(0,g);if(p&&1===a){const t=e(m);if(t!==l){const n="Decode failed crc32 validation";throw console.error("`simple-yenc`\n",n+"\n","Expected: "+l+"; Got: "+t+"\n","Visit https://github.com/eshaz/simple-yenc for more information"),Error(n)}}return m},r=(n,e='"',r=t,o)=>{const s=(t,n)=>(t%n+n)%n,i=(t,n)=>n.push(String.fromCharCode(61,(t+64)%256)),c=t=>t.map((t=>t.toString(16).padStart(2,"0")));let a,l,f=[],g=1/0,h=Array(256).fill(0);if('"'===e?(l=[0,8,9,10,11,12,13,34,92,61],a=t=>0===t||8===t||9===t||10===t||11===t||12===t||13===t||34===t||92===t||61===t):"'"===e?(l=[0,8,9,10,11,12,13,39,92,61],a=t=>0===t||8===t||9===t||10===t||11===t||12===t||13===t||39===t||92===t||61===t):"`"===e&&(l=[13,61,96],f=[7,205,231],a=(t,n)=>13===t||36===t&&123===n||61===t||92===t&&(85===n||117===n)||96===t),void 0===o){o=0;for(let t=0;t<n.length;t++){const e=0|n[t];h[e]++;for(let r=0;r<f.length;r++){const o=f[r];s(e-n[t+1]|0,256)===o&&h[e]++}}for(let t=0;t<256;t++){let n=0;for(let e=0;e<l.length;e++)n+=h[s(l[e]-t,256)];n<g&&(g=n,o=t)}}const p=["dynEncode","01",c([o]),...c((t=>{const n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,t,!0),[...n]})(r(n)))];for(let t=0;t<n.length;t++){const e=(n[t]+o)%256;a(e,(n[t+1]+o)%256)?i(e,p):p.push(String.fromCharCode(e))}return"\\"===p[p.length-1]&&(p.pop(),i(92,p)),p.join("")},o=t=>t.replace(/[\\]/g,"\\\\").replace(/[`]/g,"\\`").replace(/\${/g,"\\${");export{t as crc32,e as decode,r as dynamicEncode,n as encode,o as stringify};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=(t,e=4294967295,r=79764919)=>{const n=new Int32Array(256);let o,s,c,i=e;for(o=0;o<256;o++){for(c=o<<24,s=8;s>0;--s)c=2147483648&c?c<<1^r:c<<1;n[o]=c}for(o=0;o<t.length;o++)i=i<<8^n[255&(i>>24^t[o])];return i};exports.crc32=t,exports.decode=(e,r=t)=>{const n=t=>new Uint8Array(t.length/2).map(((e,r)=>parseInt(t.substring(2*r,2*(r+1)),16))),o=t=>n(t)[0],s=new Map;[,8364,,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,,381,,,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,,382,376].forEach(((t,e)=>s.set(t,e)));const c=new Uint8Array(e.length);let i,a,l,f=!1,g=0,h=42,p=e.length>13&&"dynEncode"===e.substring(0,9),d=0;p&&(d=11,a=o(e.substring(9,d)),a<=1&&(d+=2,h=o(e.substring(11,d))),1===a&&(d+=8,l=(t=>new DataView(n(t).buffer).getInt32(0,!0))(e.substring(13,d))));const u=256-h;for(let t=d;t<e.length;t++)if(i=e.charCodeAt(t),61!==i||f){if(92===i&&t<e.length-5&&p){const r=e.charCodeAt(t+1);117!==r&&85!==r||(i=parseInt(e.substring(t+2,t+6),16),t+=5)}if(i>255){const t=s.get(i);t&&(i=t+127)}f&&(f=!1,i-=64),c[g++]=i<h&&i>0?i+u:i-h}else f=!0;const m=c.subarray(0,g);if(p&&1===a){const t=r(m);if(t!==l){const e="Decode failed crc32 validation";throw console.error("`simple-yenc`\n",e+"\n","Expected: "+l+"; Got: "+t+"\n","Visit https://github.com/eshaz/simple-yenc for more information"),Error(e)}}return m},exports.dynamicEncode=(e,r='"',n=t,o)=>{const s=(t,e)=>(t%e+e)%e,c=(t,e)=>e.push(String.fromCharCode(61,(t+64)%256)),i=t=>t.map((t=>t.toString(16).padStart(2,"0")));let a,l,f=[],g=1/0,h=Array(256).fill(0);if('"'===r?(l=[0,8,9,10,11,12,13,34,92,61],a=t=>0===t||8===t||9===t||10===t||11===t||12===t||13===t||34===t||92===t||61===t):"'"===r?(l=[0,8,9,10,11,12,13,39,92,61],a=t=>0===t||8===t||9===t||10===t||11===t||12===t||13===t||39===t||92===t||61===t):"`"===r&&(l=[13,61,96],f=[7,205,231],a=(t,e)=>13===t||36===t&&123===e||61===t||92===t&&(85===e||117===e)||96===t),void 0===o){o=0;for(let t=0;t<e.length;t++){const r=0|e[t];h[r]++;for(let n=0;n<f.length;n++){const o=f[n];s(r-e[t+1]|0,256)===o&&h[r]++}}for(let t=0;t<256;t++){let e=0;for(let r=0;r<l.length;r++)e+=h[s(l[r]-t,256)];e<g&&(g=e,o=t)}}const p=["dynEncode","01",i([o]),...i((t=>{const e=new Uint8Array(4);return new DataView(e.buffer).setInt32(0,t,!0),[...e]})(n(e)))];for(let t=0;t<e.length;t++){const r=(e[t]+o)%256;a(r,(e[t+1]+o)%256)?c(r,p):p.push(String.fromCharCode(r))}return"\\"===p[p.length-1]&&(p.pop(),c(92,p)),p.join("")},exports.encode=t=>{const e=[];for(const r of t){let t=(r+42)%256;0===t||10===t||13===t||61===t?e.push("="+String.fromCharCode((t+64)%256)):e.push(String.fromCharCode(t))}return e.join("")},exports.stringify=t=>t.replace(/[\\]/g,"\\\\").replace(/[`]/g,"\\`").replace(/\${/g,"\\${");
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "simple-yenc",
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"description": "Minimalist yEnc and dynEncode encoder and decoder library for browser and NodeJS",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/esm.js",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"require": "./dist/index.js",
|
|
11
|
+
"import": "./dist/esm.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"sideEffects": false,
|
|
15
|
+
"scripts": {
|
|
16
|
+
"test": "node --experimental-vm-modules node_modules/.bin/jest --maxWorkers=100%",
|
|
17
|
+
"build": "rollup -c --bundleConfigAsCjs",
|
|
18
|
+
"format": "prettier --cache --write '**/*.js' --write 'package.json'"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/eshaz/simple-yenc.git"
|
|
23
|
+
},
|
|
24
|
+
"author": "Ethan Halsall",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/eshaz/simple-yenc/issues"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/eshaz/simple-yenc#readme",
|
|
30
|
+
"funding": {
|
|
31
|
+
"type": "individual",
|
|
32
|
+
"url": "https://github.com/sponsors/eshaz"
|
|
33
|
+
},
|
|
34
|
+
"keywords": [
|
|
35
|
+
"yEnc",
|
|
36
|
+
"yEncode",
|
|
37
|
+
"dynEnc",
|
|
38
|
+
"dynEncode",
|
|
39
|
+
"Dynamic Encode",
|
|
40
|
+
"Binary Encoding"
|
|
41
|
+
],
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
44
|
+
"@types/jest": "^29.5.11",
|
|
45
|
+
"jest": "^29.7.0",
|
|
46
|
+
"prettier": "^3.2.1",
|
|
47
|
+
"rollup": "^4.9.5",
|
|
48
|
+
"simple-yenc": "file:./"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import terser from "@rollup/plugin-terser";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
input: "./src/simple-yenc.js",
|
|
5
|
+
output: [
|
|
6
|
+
{
|
|
7
|
+
file: "dist/esm.js",
|
|
8
|
+
format: "esm",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
file: "dist/index.js",
|
|
12
|
+
format: "cjs",
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
plugins: [
|
|
16
|
+
terser({
|
|
17
|
+
compress: {
|
|
18
|
+
ecma: 2021,
|
|
19
|
+
passes: 5,
|
|
20
|
+
toplevel: true,
|
|
21
|
+
unsafe: true,
|
|
22
|
+
unsafe_methods: true,
|
|
23
|
+
unsafe_arrows: true,
|
|
24
|
+
},
|
|
25
|
+
}),
|
|
26
|
+
],
|
|
27
|
+
};
|