From eeaa7d42617848dd3bca29442e3827223bbc3bed Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Tue, 11 Feb 2025 10:57:24 +0900 Subject: [PATCH 01/32] give .cjs ext for CommonJS files --- package.json | 10 +++++----- tools/esmify.ts | 25 ------------------------- tools/fix-ext.mts | 28 ++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 30 deletions(-) delete mode 100644 tools/esmify.ts create mode 100644 tools/fix-ext.mts diff --git a/package.json b/package.json index 5d03ab5..77c79f3 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "MessagePack for ECMA-262/JavaScript/TypeScript", "author": "The MessagePack community", "license": "ISC", - "main": "./dist.cjs/index.js", + "main": "./dist.cjs/index.cjs", "module": "./dist.esm/index.mjs", "cdn": "./dist.umd/msgpack.min.js", "unpkg": "./dist.umd/msgpack.min.js", @@ -12,7 +12,7 @@ "sideEffects": false, "scripts": { "build": "npm publish --dry-run", - "prepare": "npm run clean && webpack --bail && tsc --build tsconfig.dist.cjs.json tsconfig.dist.esm.json && ts-node tools/esmify.ts dist.esm/*.js dist.esm/*/*.js", + "prepare": "npm run clean && webpack --bail && tsc --build tsconfig.dist.cjs.json tsconfig.dist.esm.json && tsimp tools/fix-ext.mts --mjs dist.esm/*.js dist.esm/*/*.js && tsimp tools/fix-ext.mts --cjs dist.cjs/*.js dist.cjs/*/*.js", "prepublishOnly": "npm run test:dist", "clean": "rimraf build dist dist.*", "test": "mocha 'test/**/*.test.ts'", @@ -89,10 +89,10 @@ "webpack-cli": "latest" }, "files": [ - "mod.ts", "src/**/*.*", - "dist/**/*.*", + "dist.cjs/**/*.*", + "dist.esm/**/*.*", "dist.umd/**/*.*", - "dist.esm/**/*.*" + "mod.ts" ] } diff --git a/tools/esmify.ts b/tools/esmify.ts deleted file mode 100644 index 8447c10..0000000 --- a/tools/esmify.ts +++ /dev/null @@ -1,25 +0,0 @@ -#!ts-node -/* eslint-disable no-console */ - -import fs from "fs"; - -const files = process.argv.slice(2); - -for (const file of files) { - const fileMjs = file.replace(/\.js$/, ".mjs"); - console.info(`Processing ${file} => ${fileMjs}`); - // .js => .mjs - const content = fs.readFileSync(file).toString("utf-8"); - const newContent = content.replace(/\bfrom "(\.\.?\/[^"]+)";/g, 'from "$1.mjs";') - .replace(/\bimport "(\.\.?\/[^"]+)";/g, 'import "$1.mjs";') - .replace(/\/\/# sourceMappingURL=(.+)\.js\.map$/, - "//# sourceMappingURL=$1.mjs.map"); - fs.writeFileSync(fileMjs, newContent); - fs.unlinkSync(file); - - // .js.map => .mjs.map - const mapping = JSON.parse(fs.readFileSync(`${file}.map`).toString("utf-8")); - mapping.file = mapping.file.replace(/\.js$/, ".mjs"); - fs.writeFileSync(`${fileMjs}.map`, JSON.stringify(mapping)); - fs.unlinkSync(`${file}.map`); -} diff --git a/tools/fix-ext.mts b/tools/fix-ext.mts new file mode 100644 index 0000000..bd45cd7 --- /dev/null +++ b/tools/fix-ext.mts @@ -0,0 +1,28 @@ +import fs from "node:fs"; + +const mode = process.argv[2]; // --cjs or --mjs +const files = process.argv.slice(3); + +const ext = mode === "--cjs" ? "cjs" : "mjs"; + +console.info(`Fixing ${mode} files with extension ${ext}`); + +for (const file of files) { + const fileMjs = file.replace(/\.js$/, `.${ext}`); + console.info(`Processing ${file} => ${fileMjs}`); + // .js => .mjs + const content = fs.readFileSync(file).toString("utf-8"); + const newContent = content + .replace(/\bfrom "(\.\.?\/[^"]+).js";/g, `from "$1.${ext}";`) + .replace(/\bimport "(\.\.?\/[^"]+)";/g, 'import "$1.mjs";') + .replace(/\brequire\("(\.\.?\/[^"]+).js"\)/g, `require("$1.${ext}");`) + .replace(/\/\/# sourceMappingURL=(.+)\.js\.map$/, `//# sourceMappingURL=$1.${ext}.map`); + fs.writeFileSync(fileMjs, newContent); + fs.unlinkSync(file); + + // .js.map => .mjs.map + const mapping = JSON.parse(fs.readFileSync(`${file}.map`).toString("utf-8")); + mapping.file = mapping.file.replace(/\.js$/, ext); + fs.writeFileSync(`${fileMjs}.map`, JSON.stringify(mapping)); + fs.unlinkSync(`${file}.map`); +} From 935948d4c2a124aa876aae3b09066e8c7b73aa81 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Tue, 11 Feb 2025 11:02:12 +0900 Subject: [PATCH 02/32] lint in CI --- .github/workflows/ci.yml | 2 ++ eslint.config.mjs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d3aaf4..2c40858 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,8 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm install -g nyc - run: npm ci + - run: npx tsc + - run: npm run lint - run: npm run test:cover - uses: codecov/codecov-action@v5 with: diff --git a/eslint.config.mjs b/eslint.config.mjs index 7303492..3d5529e 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -17,7 +17,7 @@ const compat = new FlatCompat({ }); export default [{ - ignores: ["**/*.js"], + ignores: ["**/*.js", "test/deno*", "test/bun*"], }, ...fixupConfigRules(compat.extends( "eslint:recommended", "plugin:@typescript-eslint/recommended", From 95acb655e0f5c602466fcd14adb3242ea71c8e52 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Tue, 11 Feb 2025 11:05:11 +0900 Subject: [PATCH 03/32] introduce timeline action --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c40858..939a092 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,8 +25,6 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm install -g nyc - run: npm ci - - run: npx tsc - - run: npm run lint - run: npm run test:cover - uses: codecov/codecov-action@v5 with: @@ -49,6 +47,18 @@ jobs: - run: npm ci - run: npm run test:browser -- --browsers ${{ matrix.browser }} + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + cache: npm + node-version: '22' + - run: npm ci + - run: npx tsc + - run: npm run lint deno: runs-on: ubuntu-latest @@ -70,3 +80,16 @@ jobs: - run: bun install - run: npm run test:bun + timeline: + runs-on: ubuntu-latest + permissions: + actions: read + needs: + - nodejs + - browser + - lint + - deno + - bun + steps: + - uses: Kesin11/actions-timeline@v2 + From b30b250e9a154d311ded32096d272a8419fe3731 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Tue, 11 Feb 2025 11:12:48 +0900 Subject: [PATCH 04/32] fix --- tools/fix-ext.mts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/fix-ext.mts b/tools/fix-ext.mts index bd45cd7..80250bc 100644 --- a/tools/fix-ext.mts +++ b/tools/fix-ext.mts @@ -13,9 +13,9 @@ for (const file of files) { // .js => .mjs const content = fs.readFileSync(file).toString("utf-8"); const newContent = content - .replace(/\bfrom "(\.\.?\/[^"]+).js";/g, `from "$1.${ext}";`) - .replace(/\bimport "(\.\.?\/[^"]+)";/g, 'import "$1.mjs";') - .replace(/\brequire\("(\.\.?\/[^"]+).js"\)/g, `require("$1.${ext}");`) + .replace(/\bfrom "(\.\.?\/[^"]+)(?:\.js)?";/g, `from "$1.${ext}";`) + .replace(/\bimport "(\.\.?\/[^"]+)(?:\.js)?";/g, `import "$1.${ext}";`) + .replace(/\brequire\("(\.\.?\/[^"]+)(?:\.js)?"\)/g, `require("$1.${ext}");`) .replace(/\/\/# sourceMappingURL=(.+)\.js\.map$/, `//# sourceMappingURL=$1.${ext}.map`); fs.writeFileSync(fileMjs, newContent); fs.unlinkSync(file); From c81694e454bb6172e5315741d9ce3e8a0caaeb69 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Tue, 11 Feb 2025 11:17:26 +0900 Subject: [PATCH 05/32] add test for dist.cjs with deno --- package.json | 2 +- test/deno_cjs_test.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 test/deno_cjs_test.ts diff --git a/package.json b/package.json index 77c79f3..2ec64d3 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "test": "mocha 'test/**/*.test.ts'", "test:dist": "npm run lint && npm run test && npm run test:deno", "test:cover": "npm run cover:clean && npx nyc --no-clean npm run 'test' && npm run cover:report", - "test:deno": "deno test test/deno_test.ts", + "test:deno": "deno test --allow-read test/deno_*.ts", "test:bun": "bun test test/bun.spec.ts", "test:fuzz": "npm exec --yes -- jsfuzz@git+https://gitlab.com/gitlab-org/security-products/analyzers/fuzzers/jsfuzz.git#39e6cf16613a0e30c7a7953f62e64292dbd5d3f3 --fuzzTime 60 --no-versifier test/decode.jsfuzz.js corpus", "cover:clean": "rimraf .nyc_output coverage/", diff --git a/test/deno_cjs_test.ts b/test/deno_cjs_test.ts new file mode 100755 index 0000000..7293f0a --- /dev/null +++ b/test/deno_cjs_test.ts @@ -0,0 +1,12 @@ +#!/usr/bin/env deno test --allow-read + +/* eslint-disable */ +import { deepStrictEqual } from "node:assert"; +import { test } from "node:test"; +import * as msgpack from "../dist.cjs/index.cjs"; + +test("Hello, world!", () => { + const encoded = msgpack.encode("Hello, world!"); + const decoded = msgpack.decode(encoded); + deepStrictEqual(decoded, "Hello, world!"); +}); From ae695a041816ebcbcf5187fe6794467e9a43cfb5 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Tue, 11 Feb 2025 11:21:38 +0900 Subject: [PATCH 06/32] changelog for 3.0.1 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ecd37f..48acde2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # This is the revision history of @msgpack/msgpack +## 3.0.1 2025-02-11 + +https://github.com/msgpack/msgpack-javascript/compare/v3.0.1...v3.0.1 + +* Implement a tiny polyfill to Symbol.dispose ([#261](https://github.com/msgpack/msgpack-javascript/pull/261) to fix #260) + + ## 3.0.0 2025-02-07 https://github.com/msgpack/msgpack-javascript/compare/v2.8.0...v3.0.0 From 3b45f2f118783ea5d84a9e5345cb17d0776ca50d Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Tue, 11 Feb 2025 11:21:53 +0900 Subject: [PATCH 07/32] 3.0.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 65407f8..ecaf06b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@msgpack/msgpack", - "version": "3.0.0", + "version": "3.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@msgpack/msgpack", - "version": "3.0.0", + "version": "3.0.1", "license": "ISC", "devDependencies": { "@eslint/compat": "latest", diff --git a/package.json b/package.json index 2ec64d3..d6cbb3d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@msgpack/msgpack", - "version": "3.0.0", + "version": "3.0.1", "description": "MessagePack for ECMA-262/JavaScript/TypeScript", "author": "The MessagePack community", "license": "ISC", From 419736f1806fc8cd91d17cb5fc535290c3ba55bd Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Tue, 11 Feb 2025 11:24:13 +0900 Subject: [PATCH 08/32] fix changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48acde2..6c3ddea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 3.0.1 2025-02-11 -https://github.com/msgpack/msgpack-javascript/compare/v3.0.1...v3.0.1 +https://github.com/msgpack/msgpack-javascript/compare/v3.0.0...v3.0.1 * Implement a tiny polyfill to Symbol.dispose ([#261](https://github.com/msgpack/msgpack-javascript/pull/261) to fix #260) From accf28769bce33507673723b10886783845ee430 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Wed, 12 Feb 2025 08:59:41 +0900 Subject: [PATCH 09/32] pure ESM-ify --- src/CachedKeyDecoder.ts | 2 +- src/Decoder.ts | 18 +++++++-------- src/Encoder.ts | 14 ++++++------ src/ExtensionCodec.ts | 4 ++-- src/decode.ts | 6 ++--- src/decodeAsync.ts | 10 ++++---- src/encode.ts | 6 ++--- src/index.ts | 24 ++++++++++---------- src/timestamp.ts | 4 ++-- test/CachedKeyDecoder.test.ts | 6 ++--- test/ExtensionCodec.test.ts | 2 +- test/bigint64.test.ts | 2 +- test/bun.spec.ts | 2 +- test/codec-bigint.test.ts | 2 +- test/codec-float.test.ts | 2 +- test/codec-int.test.ts | 2 +- test/codec-timestamp.test.ts | 2 +- test/decode-blob.test.ts | 2 +- test/decode-max-length.test.ts | 4 ++-- test/decode-raw-strings.test.ts | 4 ++-- test/decodeArrayStream.test.ts | 2 +- test/decodeAsync.test.ts | 2 +- test/decodeMulti.test.ts | 2 +- test/decodeMultiStream.test.ts | 2 +- test/edge-cases.test.ts | 2 +- test/encode.test.ts | 2 +- test/msgpack-ext.test.ts | 2 +- test/msgpack-test-suite.test.ts | 2 +- test/prototype-pollution.test.ts | 2 +- test/reuse-instances-with-extensions.test.ts | 2 +- test/reuse-instances.test.ts | 2 +- test/whatwg-streams.test.ts | 2 +- tools/fix-ext.mts | 6 ++--- tsconfig.dist.cjs.json | 1 + tsconfig.dist.esm.json | 1 + tsconfig.dist.webpack.json | 1 + tsconfig.json | 2 +- tsconfig.test-karma.json | 4 +++- 38 files changed, 81 insertions(+), 76 deletions(-) diff --git a/src/CachedKeyDecoder.ts b/src/CachedKeyDecoder.ts index f410854..73524f0 100644 --- a/src/CachedKeyDecoder.ts +++ b/src/CachedKeyDecoder.ts @@ -1,4 +1,4 @@ -import { utf8DecodeJs } from "./utils/utf8"; +import { utf8DecodeJs } from "./utils/utf8.ts"; const DEFAULT_MAX_KEY_LENGTH = 16; const DEFAULT_MAX_LENGTH_PER_KEY = 16; diff --git a/src/Decoder.ts b/src/Decoder.ts index 3a40f9e..0bf74de 100644 --- a/src/Decoder.ts +++ b/src/Decoder.ts @@ -1,12 +1,12 @@ -import "./utils/symbol.dispose"; -import { prettyByte } from "./utils/prettyByte"; -import { ExtensionCodec, ExtensionCodecType } from "./ExtensionCodec"; -import { getInt64, getUint64, UINT32_MAX } from "./utils/int"; -import { utf8Decode } from "./utils/utf8"; -import { ensureUint8Array } from "./utils/typedArrays"; -import { CachedKeyDecoder, KeyDecoder } from "./CachedKeyDecoder"; -import { DecodeError } from "./DecodeError"; -import type { ContextOf } from "./context"; +import "./utils/symbol.dispose.ts"; +import { prettyByte } from "./utils/prettyByte.ts"; +import { ExtensionCodec, ExtensionCodecType } from "./ExtensionCodec.ts"; +import { getInt64, getUint64, UINT32_MAX } from "./utils/int.ts"; +import { utf8Decode } from "./utils/utf8.ts"; +import { ensureUint8Array } from "./utils/typedArrays.ts"; +import { CachedKeyDecoder, KeyDecoder } from "./CachedKeyDecoder.ts"; +import { DecodeError } from "./DecodeError.ts"; +import type { ContextOf } from "./context.ts"; export type DecoderOptions = Readonly< Partial<{ diff --git a/src/Encoder.ts b/src/Encoder.ts index 393c275..27d8ded 100644 --- a/src/Encoder.ts +++ b/src/Encoder.ts @@ -1,10 +1,10 @@ -import "./utils/symbol.dispose"; -import { utf8Count, utf8Encode } from "./utils/utf8"; -import { ExtensionCodec, ExtensionCodecType } from "./ExtensionCodec"; -import { setInt64, setUint64 } from "./utils/int"; -import { ensureUint8Array } from "./utils/typedArrays"; -import type { ExtData } from "./ExtData"; -import type { ContextOf } from "./context"; +import "./utils/symbol.dispose.ts"; +import { utf8Count, utf8Encode } from "./utils/utf8.ts"; +import { ExtensionCodec, ExtensionCodecType } from "./ExtensionCodec.ts"; +import { setInt64, setUint64 } from "./utils/int.ts"; +import { ensureUint8Array } from "./utils/typedArrays.ts"; +import type { ExtData } from "./ExtData.ts"; +import type { ContextOf } from "./context.ts"; export const DEFAULT_MAX_DEPTH = 100; export const DEFAULT_INITIAL_BUFFER_SIZE = 2048; diff --git a/src/ExtensionCodec.ts b/src/ExtensionCodec.ts index 5bd2200..5691579 100644 --- a/src/ExtensionCodec.ts +++ b/src/ExtensionCodec.ts @@ -1,7 +1,7 @@ // ExtensionCodec to handle MessagePack extensions -import { ExtData } from "./ExtData"; -import { timestampExtension } from "./timestamp"; +import { ExtData } from "./ExtData.ts"; +import { timestampExtension } from "./timestamp.ts"; export type ExtensionDecoderType = ( data: Uint8Array, diff --git a/src/decode.ts b/src/decode.ts index e4857ae..685fc10 100644 --- a/src/decode.ts +++ b/src/decode.ts @@ -1,6 +1,6 @@ -import { Decoder } from "./Decoder"; -import type { DecoderOptions } from "./Decoder"; -import type { SplitUndefined } from "./context"; +import { Decoder } from "./Decoder.ts"; +import type { DecoderOptions } from "./Decoder.ts"; +import type { SplitUndefined } from "./context.ts"; /** * It decodes a single MessagePack object in a buffer. diff --git a/src/decodeAsync.ts b/src/decodeAsync.ts index d4f91dc..9534f07 100644 --- a/src/decodeAsync.ts +++ b/src/decodeAsync.ts @@ -1,8 +1,8 @@ -import { Decoder } from "./Decoder"; -import { ensureAsyncIterable } from "./utils/stream"; -import type { DecoderOptions } from "./Decoder"; -import type { ReadableStreamLike } from "./utils/stream"; -import type { SplitUndefined } from "./context"; +import { Decoder } from "./Decoder.ts"; +import { ensureAsyncIterable } from "./utils/stream.ts"; +import type { DecoderOptions } from "./Decoder.ts"; +import type { ReadableStreamLike } from "./utils/stream.ts"; +import type { SplitUndefined } from "./context.ts"; /** * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. diff --git a/src/encode.ts b/src/encode.ts index 392b7fe..9a9d07a 100644 --- a/src/encode.ts +++ b/src/encode.ts @@ -1,6 +1,6 @@ -import { Encoder } from "./Encoder"; -import type { EncoderOptions } from "./Encoder"; -import type { SplitUndefined } from "./context"; +import { Encoder } from "./Encoder.ts"; +import type { EncoderOptions } from "./Encoder.ts"; +import type { SplitUndefined } from "./context.ts"; /** * It encodes `value` in the MessagePack format and diff --git a/src/index.ts b/src/index.ts index 840f25d..f4550e2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,33 +1,33 @@ // Main Functions: -import { encode } from "./encode"; +import { encode } from "./encode.ts"; export { encode }; -import { decode, decodeMulti } from "./decode"; +import { decode, decodeMulti } from "./decode.ts"; export { decode, decodeMulti }; -import { decodeAsync, decodeArrayStream, decodeMultiStream } from "./decodeAsync"; +import { decodeAsync, decodeArrayStream, decodeMultiStream } from "./decodeAsync.ts"; export { decodeAsync, decodeArrayStream, decodeMultiStream }; -import { Decoder } from "./Decoder"; +import { Decoder } from "./Decoder.ts"; export { Decoder }; -import type { DecoderOptions } from "./Decoder"; +import type { DecoderOptions } from "./Decoder.ts"; export type { DecoderOptions }; -import { DecodeError } from "./DecodeError"; +import { DecodeError } from "./DecodeError.ts"; export { DecodeError }; -import { Encoder } from "./Encoder"; +import { Encoder } from "./Encoder.ts"; export { Encoder }; -import type { EncoderOptions } from "./Encoder"; +import type { EncoderOptions } from "./Encoder.ts"; export type { EncoderOptions }; // Utilities for Extension Types: -import { ExtensionCodec } from "./ExtensionCodec"; +import { ExtensionCodec } from "./ExtensionCodec.ts"; export { ExtensionCodec }; -import type { ExtensionCodecType, ExtensionDecoderType, ExtensionEncoderType } from "./ExtensionCodec"; +import type { ExtensionCodecType, ExtensionDecoderType, ExtensionEncoderType } from "./ExtensionCodec.ts"; export type { ExtensionCodecType, ExtensionDecoderType, ExtensionEncoderType }; -import { ExtData } from "./ExtData"; +import { ExtData } from "./ExtData.ts"; export { ExtData }; import { @@ -37,7 +37,7 @@ import { decodeTimestampToTimeSpec, encodeTimestampExtension, decodeTimestampExtension, -} from "./timestamp"; +} from "./timestamp.ts"; export { EXT_TIMESTAMP, encodeDateToTimeSpec, diff --git a/src/timestamp.ts b/src/timestamp.ts index e3fe015..3c1e9db 100644 --- a/src/timestamp.ts +++ b/src/timestamp.ts @@ -1,6 +1,6 @@ // https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type -import { DecodeError } from "./DecodeError"; -import { getInt64, setInt64 } from "./utils/int"; +import { DecodeError } from "./DecodeError.ts"; +import { getInt64, setInt64 } from "./utils/int.ts"; export const EXT_TIMESTAMP = -1; diff --git a/test/CachedKeyDecoder.test.ts b/test/CachedKeyDecoder.test.ts index 4e9dd06..8cb16f0 100644 --- a/test/CachedKeyDecoder.test.ts +++ b/test/CachedKeyDecoder.test.ts @@ -1,7 +1,7 @@ import assert from "assert"; -import { CachedKeyDecoder } from "../src/CachedKeyDecoder"; -import { utf8EncodeJs, utf8Count } from "../src/utils/utf8"; -import type { KeyDecoder } from "../src/CachedKeyDecoder"; +import { CachedKeyDecoder } from "../src/CachedKeyDecoder.ts"; +import { utf8EncodeJs, utf8Count } from "../src/utils/utf8.ts"; +import type { KeyDecoder } from "../src/CachedKeyDecoder.ts"; function tryDecode(keyDecoder: KeyDecoder, str: string): string { const byteLength = utf8Count(str); diff --git a/test/ExtensionCodec.test.ts b/test/ExtensionCodec.test.ts index 5d9f5e3..543171b 100644 --- a/test/ExtensionCodec.test.ts +++ b/test/ExtensionCodec.test.ts @@ -1,6 +1,6 @@ import assert from "assert"; import util from "util"; -import { encode, decode, ExtensionCodec, decodeAsync } from "../src/index"; +import { encode, decode, ExtensionCodec, decodeAsync } from "../src/index.ts"; describe("ExtensionCodec", () => { context("timestamp", () => { diff --git a/test/bigint64.test.ts b/test/bigint64.test.ts index e4ab68a..e2bf08f 100644 --- a/test/bigint64.test.ts +++ b/test/bigint64.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { encode, decode } from "../src/index"; +import { encode, decode } from "../src/index.ts"; describe("useBigInt64: true", () => { before(function () { diff --git a/test/bun.spec.ts b/test/bun.spec.ts index 92e202d..fca79ea 100644 --- a/test/bun.spec.ts +++ b/test/bun.spec.ts @@ -1,5 +1,5 @@ import { expect, test } from "bun:test"; -import { encode, decode } from "../src/index"; +import { encode, decode } from "../src/index.ts"; test("Hello, world!", () => { const encoded = encode("Hello, world!"); diff --git a/test/codec-bigint.test.ts b/test/codec-bigint.test.ts index 524bbf7..b0ef7aa 100644 --- a/test/codec-bigint.test.ts +++ b/test/codec-bigint.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { encode, decode, ExtensionCodec, DecodeError } from "../src/index"; +import { encode, decode, ExtensionCodec, DecodeError } from "../src/index.ts"; // There's a built-in `useBigInt64: true` option, but a custom codec might be // better if you'd like to encode bigint to reduce the size of binaries. diff --git a/test/codec-float.test.ts b/test/codec-float.test.ts index 3b690dc..accc590 100644 --- a/test/codec-float.test.ts +++ b/test/codec-float.test.ts @@ -1,6 +1,6 @@ import assert from "assert"; import * as ieee754 from "ieee754"; -import { decode } from "../src/index"; +import { decode } from "../src/index.ts"; const FLOAT32_TYPE = 0xca; const FLOAT64_TYPE = 0xcb; diff --git a/test/codec-int.test.ts b/test/codec-int.test.ts index 486f93b..7e5a822 100644 --- a/test/codec-int.test.ts +++ b/test/codec-int.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { setInt64, getInt64, getUint64, setUint64 } from "../src/utils/int"; +import { setInt64, getInt64, getUint64, setUint64 } from "../src/utils/int.ts"; const INT64SPECS = { ZERO: 0, diff --git a/test/codec-timestamp.test.ts b/test/codec-timestamp.test.ts index 1ee1432..a309872 100644 --- a/test/codec-timestamp.test.ts +++ b/test/codec-timestamp.test.ts @@ -7,7 +7,7 @@ import { decodeTimestampExtension, decodeTimestampToTimeSpec, encodeTimestampExtension, -} from "../src/index"; +} from "../src/index.ts"; const TIME = 1556636810389; diff --git a/test/decode-blob.test.ts b/test/decode-blob.test.ts index 5fdb6c9..0c8c5b4 100644 --- a/test/decode-blob.test.ts +++ b/test/decode-blob.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { encode, decode, decodeAsync } from "../src/index"; +import { encode, decode, decodeAsync } from "../src/index.ts"; (typeof Blob !== "undefined" ? describe : describe.skip)("Blob", () => { it("decodes it with `decode()`", async function () { diff --git a/test/decode-max-length.test.ts b/test/decode-max-length.test.ts index 8a2eb56..8dd87f9 100644 --- a/test/decode-max-length.test.ts +++ b/test/decode-max-length.test.ts @@ -1,6 +1,6 @@ import assert from "assert"; -import { encode, decode, decodeAsync } from "../src/index"; -import type { DecoderOptions } from "../src/index"; +import { encode, decode, decodeAsync } from "../src/index.ts"; +import type { DecoderOptions } from "../src/index.ts"; describe("decode with max${Type}Length specified", () => { async function* createStream(input: T) { diff --git a/test/decode-raw-strings.test.ts b/test/decode-raw-strings.test.ts index 9608f5d..c50ff15 100644 --- a/test/decode-raw-strings.test.ts +++ b/test/decode-raw-strings.test.ts @@ -1,6 +1,6 @@ import assert from "assert"; -import { encode, decode } from "../src/index"; -import type { DecoderOptions } from "../src/index"; +import { encode, decode } from "../src/index.ts"; +import type { DecoderOptions } from "../src/index.ts"; describe("decode with rawStrings specified", () => { const options = { rawStrings: true } satisfies DecoderOptions; diff --git a/test/decodeArrayStream.test.ts b/test/decodeArrayStream.test.ts index f91b12e..a8f7ed5 100644 --- a/test/decodeArrayStream.test.ts +++ b/test/decodeArrayStream.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { encode, decodeArrayStream } from "../src/index"; +import { encode, decodeArrayStream } from "../src/index.ts"; describe("decodeArrayStream", () => { const generateSampleObject = () => { diff --git a/test/decodeAsync.test.ts b/test/decodeAsync.test.ts index 99b46f6..9687370 100644 --- a/test/decodeAsync.test.ts +++ b/test/decodeAsync.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { encode, decodeAsync } from "../src/index"; +import { encode, decodeAsync } from "../src/index.ts"; describe("decodeAsync", () => { function wrapWithNoisyBuffer(byte: number) { diff --git a/test/decodeMulti.test.ts b/test/decodeMulti.test.ts index f5b96e1..eb661b8 100644 --- a/test/decodeMulti.test.ts +++ b/test/decodeMulti.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { encode, decodeMulti } from "../src/index"; +import { encode, decodeMulti } from "../src/index.ts"; describe("decodeMulti", () => { it("decodes multiple objects in a single binary", () => { diff --git a/test/decodeMultiStream.test.ts b/test/decodeMultiStream.test.ts index b88dd12..4da31e5 100644 --- a/test/decodeMultiStream.test.ts +++ b/test/decodeMultiStream.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { encode, decodeMultiStream } from "../src/index"; +import { encode, decodeMultiStream } from "../src/index.ts"; describe("decodeStream", () => { it("decodes stream", async () => { diff --git a/test/edge-cases.test.ts b/test/edge-cases.test.ts index 43cc9e5..797f6be 100644 --- a/test/edge-cases.test.ts +++ b/test/edge-cases.test.ts @@ -1,7 +1,7 @@ // kind of hand-written fuzzing data // any errors should not break Encoder/Decoder instance states import assert from "assert"; -import { encode, decodeAsync, decode, Encoder, Decoder, decodeMulti, decodeMultiStream } from "../src/index"; +import { encode, decodeAsync, decode, Encoder, Decoder, decodeMulti, decodeMultiStream } from "../src/index.ts"; function testEncoder(encoder: Encoder): void { const object = { diff --git a/test/encode.test.ts b/test/encode.test.ts index 2167276..f1b6ffe 100644 --- a/test/encode.test.ts +++ b/test/encode.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { encode, decode } from "../src/index"; +import { encode, decode } from "../src/index.ts"; describe("encode", () => { context("sortKeys", () => { diff --git a/test/msgpack-ext.test.ts b/test/msgpack-ext.test.ts index a884f5c..15244cb 100644 --- a/test/msgpack-ext.test.ts +++ b/test/msgpack-ext.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { encode, decode, ExtData } from "../src/index"; +import { encode, decode, ExtData } from "../src/index.ts"; function seq(n: number) { const a: Array = []; diff --git a/test/msgpack-test-suite.test.ts b/test/msgpack-test-suite.test.ts index 94c841e..d42b0db 100644 --- a/test/msgpack-test-suite.test.ts +++ b/test/msgpack-test-suite.test.ts @@ -2,7 +2,7 @@ import assert from "assert"; import util from "util"; import { Exam } from "msgpack-test-js"; import { MsgTimestamp } from "msg-timestamp"; -import { encode, decode, ExtensionCodec, EXT_TIMESTAMP, encodeTimeSpecToTimestamp } from "../src/index"; +import { encode, decode, ExtensionCodec, EXT_TIMESTAMP, encodeTimeSpecToTimestamp } from "../src/index.ts"; const extensionCodec = new ExtensionCodec(); extensionCodec.register({ diff --git a/test/prototype-pollution.test.ts b/test/prototype-pollution.test.ts index 78238c0..46e293e 100644 --- a/test/prototype-pollution.test.ts +++ b/test/prototype-pollution.test.ts @@ -1,5 +1,5 @@ import { throws } from "assert"; -import { encode, decode, DecodeError } from "../src/index"; +import { encode, decode, DecodeError } from "../src/index.ts"; describe("prototype pollution", () => { context("__proto__ exists as a map key", () => { diff --git a/test/reuse-instances-with-extensions.test.ts b/test/reuse-instances-with-extensions.test.ts index 39cb456..f539625 100644 --- a/test/reuse-instances-with-extensions.test.ts +++ b/test/reuse-instances-with-extensions.test.ts @@ -1,7 +1,7 @@ // https://github.com/msgpack/msgpack-javascript/issues/195 import { deepStrictEqual } from "assert"; -import { Encoder, Decoder, ExtensionCodec } from "../src/index"; +import { Encoder, Decoder, ExtensionCodec } from "../src/index.ts"; const MSGPACK_EXT_TYPE_BIGINT = 0; diff --git a/test/reuse-instances.test.ts b/test/reuse-instances.test.ts index 8f1cee1..2c971cd 100644 --- a/test/reuse-instances.test.ts +++ b/test/reuse-instances.test.ts @@ -1,5 +1,5 @@ import { deepStrictEqual } from "assert"; -import { Encoder, Decoder, decode } from "../src/index"; +import { Encoder, Decoder, decode } from "../src/index.ts"; const createStream = async function* (...args: any) { for (const item of args) { diff --git a/test/whatwg-streams.test.ts b/test/whatwg-streams.test.ts index ac2ae6a..2b32493 100644 --- a/test/whatwg-streams.test.ts +++ b/test/whatwg-streams.test.ts @@ -1,5 +1,5 @@ import { deepStrictEqual } from "assert"; -import { decodeAsync, encode, decodeArrayStream } from "../src/index"; +import { decodeAsync, encode, decodeArrayStream } from "../src/index.ts"; const isReadableStreamConstructorAvailable: boolean = (() => { try { diff --git a/tools/fix-ext.mts b/tools/fix-ext.mts index 80250bc..bd6f737 100644 --- a/tools/fix-ext.mts +++ b/tools/fix-ext.mts @@ -13,9 +13,9 @@ for (const file of files) { // .js => .mjs const content = fs.readFileSync(file).toString("utf-8"); const newContent = content - .replace(/\bfrom "(\.\.?\/[^"]+)(?:\.js)?";/g, `from "$1.${ext}";`) - .replace(/\bimport "(\.\.?\/[^"]+)(?:\.js)?";/g, `import "$1.${ext}";`) - .replace(/\brequire\("(\.\.?\/[^"]+)(?:\.js)?"\)/g, `require("$1.${ext}");`) + .replace(/\bfrom "(\.\.?\/[^"]+)\.js";/g, `from "$1.${ext}";`) + .replace(/\bimport "(\.\.?\/[^"]+)\.js";/g, `import "$1.${ext}";`) + .replace(/\brequire\("(\.\.?\/[^"]+)\.js"\)/g, `require("$1.${ext}");`) .replace(/\/\/# sourceMappingURL=(.+)\.js\.map$/, `//# sourceMappingURL=$1.${ext}.map`); fs.writeFileSync(fileMjs, newContent); fs.unlinkSync(file); diff --git a/tsconfig.dist.cjs.json b/tsconfig.dist.cjs.json index bb97412..8225a84 100644 --- a/tsconfig.dist.cjs.json +++ b/tsconfig.dist.cjs.json @@ -6,6 +6,7 @@ "declaration": false, "noEmitOnError": true, "noEmit": false, + "rewriteRelativeImportExtensions": true, "incremental": false }, "include": ["src/**/*.ts"] diff --git a/tsconfig.dist.esm.json b/tsconfig.dist.esm.json index 42aeff6..f8d47a0 100644 --- a/tsconfig.dist.esm.json +++ b/tsconfig.dist.esm.json @@ -6,6 +6,7 @@ "declaration": true, "noEmitOnError": true, "noEmit": false, + "rewriteRelativeImportExtensions": true, "incremental": false }, "include": ["src/**/*.ts"] diff --git a/tsconfig.dist.webpack.json b/tsconfig.dist.webpack.json index 687889a..c7fb1ea 100644 --- a/tsconfig.dist.webpack.json +++ b/tsconfig.dist.webpack.json @@ -4,6 +4,7 @@ "module": "ESNext", "noEmitOnError": true, "noEmit": false, + "allowImportingTsExtensions": false, "outDir": "./build/webpack" }, "include": ["src/**/*.ts"] diff --git a/tsconfig.json b/tsconfig.json index 60e468c..1c7ef93 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -41,7 +41,7 @@ "noPropertyAccessFromIndexSignature": true, "noImplicitOverride": true, "verbatimModuleSyntax": false, - // "allowImportingTsExtensions": true, + "allowImportingTsExtensions": true, "noEmit": true, /* Module Resolution Options */ diff --git a/tsconfig.test-karma.json b/tsconfig.test-karma.json index 560ff84..4a3bdec 100644 --- a/tsconfig.test-karma.json +++ b/tsconfig.test-karma.json @@ -2,8 +2,10 @@ "extends": "./tsconfig.json", "compilerOptions": { "module": "ESNext", - "outDir": "./build/karma", + "noEmitOnError": true, "noEmit": false, + "allowImportingTsExtensions": false, + "outDir": "./build/karma", "incremental": false } } From 1fe0b5b1e6c83acb354e5195f60a9cefed890dae Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Wed, 12 Feb 2025 20:31:04 +0900 Subject: [PATCH 10/32] assertNonNull for async iterator result is no longer needed --- src/utils/stream.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/utils/stream.ts b/src/utils/stream.ts index b7549e1..75bc1d2 100644 --- a/src/utils/stream.ts +++ b/src/utils/stream.ts @@ -10,12 +10,6 @@ export function isAsyncIterable(object: ReadableStreamLike): object is Asy return (object as any)[Symbol.asyncIterator] != null; } -function assertNonNull(value: T | null | undefined): asserts value is T { - if (value == null) { - throw new Error("Assertion Failure: value must not be null nor undefined"); - } -} - export async function* asyncIterableFromStream(stream: ReadableStream): AsyncIterable { const reader = stream.getReader(); @@ -25,7 +19,6 @@ export async function* asyncIterableFromStream(stream: ReadableStream): As if (done) { return; } - assertNonNull(value); yield value; } } finally { From 588354f10c576f98c28a9505d31b571a65a8a347 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Wed, 12 Feb 2025 20:32:08 +0900 Subject: [PATCH 11/32] remove unecessary export type --- src/context.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context.ts b/src/context.ts index 1f75665..1edaaa5 100644 --- a/src/context.ts +++ b/src/context.ts @@ -1,4 +1,4 @@ -export type SplitTypes = U extends T ? (Exclude extends never ? T : Exclude) : T; +type SplitTypes = U extends T ? (Exclude extends never ? T : Exclude) : T; export type SplitUndefined = SplitTypes; From 59057eec03f0fdce834b2c01abe61381b6e7256b Mon Sep 17 00:00:00 2001 From: Pejman Nikram Date: Wed, 19 Feb 2025 22:17:21 +0200 Subject: [PATCH 12/32] adding support for nonstandard map key in the decoder fix #255 --- README.md | 25 ++++++++++++++----------- src/Decoder.ts | 21 +++++++++++++++------ test/decodeAsync.test.ts | 15 +++++++++++++++ 3 files changed, 44 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 6ba5681..f7c36cc 100644 --- a/README.md +++ b/README.md @@ -145,17 +145,20 @@ NodeJS `Buffer` is also acceptable because it is a subclass of `Uint8Array`. #### `DecoderOptions` -| Name | Type | Default | -| -------------- | -------------- | ----------------------------- | -| extensionCodec | ExtensionCodec | `ExtensionCodec.defaultCodec` | -| context | user-defined | - | -| useBigInt64 | boolean | false | -| rawStrings | boolean | false | -| maxStrLength | number | `4_294_967_295` (UINT32_MAX) | -| maxBinLength | number | `4_294_967_295` (UINT32_MAX) | -| maxArrayLength | number | `4_294_967_295` (UINT32_MAX) | -| maxMapLength | number | `4_294_967_295` (UINT32_MAX) | -| maxExtLength | number | `4_294_967_295` (UINT32_MAX) | +| Name | Type | Default | +| --------------- | ------------------- | ---------------------------------------------- | +| extensionCodec | ExtensionCodec | `ExtensionCodec.defaultCodec` | +| context | user-defined | - | +| useBigInt64 | boolean | false | +| rawStrings | boolean | false | +| maxStrLength | number | `4_294_967_295` (UINT32_MAX) | +| maxBinLength | number | `4_294_967_295` (UINT32_MAX) | +| maxArrayLength | number | `4_294_967_295` (UINT32_MAX) | +| maxMapLength | number | `4_294_967_295` (UINT32_MAX) | +| maxExtLength | number | `4_294_967_295` (UINT32_MAX) | +| mapKeyConverter | MapKeyConverterType | throw exception if key is not string or number | + +`MapKeyConverterType` is defined as `(key: unknown) => string | number`. To skip UTF-8 decoding of strings, `rawStrings` can be set to `true`. In this case, strings are decoded into `Uint8Array`. diff --git a/src/Decoder.ts b/src/Decoder.ts index 0bf74de..e9257a9 100644 --- a/src/Decoder.ts +++ b/src/Decoder.ts @@ -68,6 +68,13 @@ export type DecoderOptions = Readonly< * `null` is a special value to disable the use of the key decoder at all. */ keyDecoder: KeyDecoder | null; + + /** + * A function to convert decoded map key to a valid JS key type. + * + * Defaults to a function that throws an error if the key is not a string or a number. + */ + mapKeyConverter: (key: unknown) => MapKeyType; }> > & ContextOf; @@ -78,8 +85,11 @@ const STATE_MAP_VALUE = "map_value"; type MapKeyType = string | number; -const isValidMapKeyType = (key: unknown): key is MapKeyType => { - return typeof key === "string" || typeof key === "number"; +const mapKeyConverter = (key: unknown): MapKeyType => { + if (typeof key === "string" || typeof key === "number") { + return key; + } + throw new DecodeError("The type of key must be string or number but " + typeof key); }; type StackMapState = { @@ -213,6 +223,7 @@ export class Decoder { private readonly maxMapLength: number; private readonly maxExtLength: number; private readonly keyDecoder: KeyDecoder | null; + private readonly mapKeyConverter: (key: unknown) => MapKeyType; private totalPos = 0; private pos = 0; @@ -236,6 +247,7 @@ export class Decoder { this.maxMapLength = options?.maxMapLength ?? UINT32_MAX; this.maxExtLength = options?.maxExtLength ?? UINT32_MAX; this.keyDecoder = options?.keyDecoder !== undefined ? options.keyDecoder : sharedCachedKeyDecoder; + this.mapKeyConverter = options?.mapKeyConverter ?? mapKeyConverter; } private clone(): Decoder { @@ -631,14 +643,11 @@ export class Decoder { continue DECODE; } } else if (state.type === STATE_MAP_KEY) { - if (!isValidMapKeyType(object)) { - throw new DecodeError("The type of key must be string or number but " + typeof object); - } if (object === "__proto__") { throw new DecodeError("The key __proto__ is not allowed"); } - state.key = object; + state.key = this.mapKeyConverter(object); state.type = STATE_MAP_VALUE; continue DECODE; } else { diff --git a/test/decodeAsync.test.ts b/test/decodeAsync.test.ts index 9687370..6af6c19 100644 --- a/test/decodeAsync.test.ts +++ b/test/decodeAsync.test.ts @@ -36,6 +36,21 @@ describe("decodeAsync", () => { assert.deepStrictEqual(object, { "foo": "bar" }); }); + it("decodes fixmap {'[1, 2]': 'baz'} with custom map key converter", async () => { + const createStream = async function* () { + yield [0x81]; // fixmap size=1 + yield encode([1, 2]); + yield encode("baz"); + }; + + const object = await decodeAsync(createStream(), { + mapKeyConverter: (key) => JSON.stringify(key), + }); + + const key = JSON.stringify([1, 2]); + assert.deepStrictEqual(object, { [key]: "baz" }); + }); + it("decodes multi-byte integer byte-by-byte", async () => { const createStream = async function* () { yield [0xcd]; // uint 16 From c0c823891411da28c6f87e14f5d6d9c0fc38b0e8 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Fri, 21 Feb 2025 21:58:11 +0900 Subject: [PATCH 13/32] changes --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c3ddea..c38d2ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # This is the revision history of @msgpack/msgpack + +## 3.1.0 2025-02-21 + +https://github.com/msgpack/msgpack-javascript/compare/v3.0.1...v3.1.0 + +* Added support for nonstandard map keys in the decoder ([#266](https://github.com/msgpack/msgpack-javascript/pull/266) by @PejmanNik) + ## 3.0.1 2025-02-11 https://github.com/msgpack/msgpack-javascript/compare/v3.0.0...v3.0.1 From 4a337c55e74b6424335eb76eafe84646ca85052e Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Fri, 21 Feb 2025 21:58:21 +0900 Subject: [PATCH 14/32] 3.1.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index ecaf06b..7268a8e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@msgpack/msgpack", - "version": "3.0.1", + "version": "3.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@msgpack/msgpack", - "version": "3.0.1", + "version": "3.1.0", "license": "ISC", "devDependencies": { "@eslint/compat": "latest", diff --git a/package.json b/package.json index d6cbb3d..b1b2e2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@msgpack/msgpack", - "version": "3.0.1", + "version": "3.1.0", "description": "MessagePack for ECMA-262/JavaScript/TypeScript", "author": "The MessagePack community", "license": "ISC", From 69295b3a8b5c555a015836c37f7c58aadaab1322 Mon Sep 17 00:00:00 2001 From: rijenkii Date: Mon, 3 Mar 2025 15:14:55 +0700 Subject: [PATCH 15/32] Remove all mentions of Explicit Resource Management features --- src/Decoder.ts | 160 +++++++++++++++++++----------------- src/Encoder.ts | 38 ++++----- src/utils/symbol.dispose.ts | 11 --- 3 files changed, 101 insertions(+), 108 deletions(-) delete mode 100644 src/utils/symbol.dispose.ts diff --git a/src/Decoder.ts b/src/Decoder.ts index e9257a9..9239dd1 100644 --- a/src/Decoder.ts +++ b/src/Decoder.ts @@ -1,4 +1,3 @@ -import "./utils/symbol.dispose.ts"; import { prettyByte } from "./utils/prettyByte.ts"; import { ExtensionCodec, ExtensionCodecType } from "./ExtensionCodec.ts"; import { getInt64, getUint64, UINT32_MAX } from "./utils/int.ts"; @@ -305,15 +304,6 @@ export class Decoder { return new RangeError(`Extra ${view.byteLength - pos} of ${view.byteLength} byte(s) found at buffer[${posToShow}]`); } - private enteringGuard(): Disposable { - this.entered = true; - return { - [Symbol.dispose]: () => { - this.entered = false; - }, - }; - } - /** * @throws {@link DecodeError} * @throws {@link RangeError} @@ -323,17 +313,21 @@ export class Decoder { const instance = this.clone(); return instance.decode(buffer); } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - using _guard = this.enteringGuard(); - this.reinitializeState(); - this.setBuffer(buffer); + try { + this.entered = true; - const object = this.doDecodeSync(); - if (this.hasRemaining(1)) { - throw this.createExtraByteError(this.pos); + this.reinitializeState(); + this.setBuffer(buffer); + + const object = this.doDecodeSync(); + if (this.hasRemaining(1)) { + throw this.createExtraByteError(this.pos); + } + return object; + } finally { + this.entered = false; } - return object; } public *decodeMulti(buffer: ArrayLike | ArrayBufferView | ArrayBufferLike): Generator { @@ -342,14 +336,18 @@ export class Decoder { yield* instance.decodeMulti(buffer); return; } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - using _guard = this.enteringGuard(); - this.reinitializeState(); - this.setBuffer(buffer); + try { + this.entered = true; - while (this.hasRemaining(1)) { - yield this.doDecodeSync(); + this.reinitializeState(); + this.setBuffer(buffer); + + while (this.hasRemaining(1)) { + yield this.doDecodeSync(); + } + } finally { + this.entered = false; } } @@ -358,42 +356,46 @@ export class Decoder { const instance = this.clone(); return instance.decodeAsync(stream); } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - using _guard = this.enteringGuard(); - let decoded = false; - let object: unknown; - for await (const buffer of stream) { - if (decoded) { - this.entered = false; - throw this.createExtraByteError(this.totalPos); - } + try { + this.entered = true; - this.appendBuffer(buffer); + let decoded = false; + let object: unknown; + for await (const buffer of stream) { + if (decoded) { + this.entered = false; + throw this.createExtraByteError(this.totalPos); + } - try { - object = this.doDecodeSync(); - decoded = true; - } catch (e) { - if (!(e instanceof RangeError)) { - throw e; // rethrow + this.appendBuffer(buffer); + + try { + object = this.doDecodeSync(); + decoded = true; + } catch (e) { + if (!(e instanceof RangeError)) { + throw e; // rethrow + } + // fallthrough } - // fallthrough + this.totalPos += this.pos; } - this.totalPos += this.pos; - } - if (decoded) { - if (this.hasRemaining(1)) { - throw this.createExtraByteError(this.totalPos); + if (decoded) { + if (this.hasRemaining(1)) { + throw this.createExtraByteError(this.totalPos); + } + return object; } - return object; - } - const { headByte, pos, totalPos } = this; - throw new RangeError( - `Insufficient data in parsing ${prettyByte(headByte)} at ${totalPos} (${pos} in the current buffer)`, - ); + const { headByte, pos, totalPos } = this; + throw new RangeError( + `Insufficient data in parsing ${prettyByte(headByte)} at ${totalPos} (${pos} in the current buffer)`, + ); + } finally { + this.entered = false; + } } public decodeArrayStream( @@ -412,39 +414,43 @@ export class Decoder { yield* instance.decodeMultiAsync(stream, isArray); return; } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - using _guard = this.enteringGuard(); - let isArrayHeaderRequired = isArray; - let arrayItemsLeft = -1; + try { + this.entered = true; - for await (const buffer of stream) { - if (isArray && arrayItemsLeft === 0) { - throw this.createExtraByteError(this.totalPos); - } + let isArrayHeaderRequired = isArray; + let arrayItemsLeft = -1; - this.appendBuffer(buffer); + for await (const buffer of stream) { + if (isArray && arrayItemsLeft === 0) { + throw this.createExtraByteError(this.totalPos); + } - if (isArrayHeaderRequired) { - arrayItemsLeft = this.readArraySize(); - isArrayHeaderRequired = false; - this.complete(); - } + this.appendBuffer(buffer); - try { - while (true) { - yield this.doDecodeSync(); - if (--arrayItemsLeft === 0) { - break; - } + if (isArrayHeaderRequired) { + arrayItemsLeft = this.readArraySize(); + isArrayHeaderRequired = false; + this.complete(); } - } catch (e) { - if (!(e instanceof RangeError)) { - throw e; // rethrow + + try { + while (true) { + yield this.doDecodeSync(); + if (--arrayItemsLeft === 0) { + break; + } + } + } catch (e) { + if (!(e instanceof RangeError)) { + throw e; // rethrow + } + // fallthrough } - // fallthrough + this.totalPos += this.pos; } - this.totalPos += this.pos; + } finally { + this.entered = false; } } diff --git a/src/Encoder.ts b/src/Encoder.ts index 27d8ded..ffb4f6b 100644 --- a/src/Encoder.ts +++ b/src/Encoder.ts @@ -1,4 +1,3 @@ -import "./utils/symbol.dispose.ts"; import { utf8Count, utf8Encode } from "./utils/utf8.ts"; import { ExtensionCodec, ExtensionCodecType } from "./ExtensionCodec.ts"; import { setInt64, setUint64 } from "./utils/int.ts"; @@ -127,15 +126,6 @@ export class Encoder { this.pos = 0; } - private enteringGuard(): Disposable { - this.entered = true; - return { - [Symbol.dispose]: () => { - this.entered = false; - }, - }; - } - /** * This is almost equivalent to {@link Encoder#encode}, but it returns an reference of the encoder's internal buffer and thus much faster than {@link Encoder#encode}. * @@ -146,12 +136,16 @@ export class Encoder { const instance = this.clone(); return instance.encodeSharedRef(object); } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - using _guard = this.enteringGuard(); - this.reinitializeState(); - this.doEncode(object, 1); - return this.bytes.subarray(0, this.pos); + try { + this.entered = true; + + this.reinitializeState(); + this.doEncode(object, 1); + return this.bytes.subarray(0, this.pos); + } finally { + this.entered = false; + } } /** @@ -162,12 +156,16 @@ export class Encoder { const instance = this.clone(); return instance.encode(object); } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - using _guard = this.enteringGuard(); - this.reinitializeState(); - this.doEncode(object, 1); - return this.bytes.slice(0, this.pos); + try { + this.entered = true; + + this.reinitializeState(); + this.doEncode(object, 1); + return this.bytes.slice(0, this.pos); + } finally { + this.entered = false; + } } private doEncode(object: unknown, depth: number): void { diff --git a/src/utils/symbol.dispose.ts b/src/utils/symbol.dispose.ts deleted file mode 100644 index d5d1eba..0000000 --- a/src/utils/symbol.dispose.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Polyfill to Symbol.dispose - -// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -if (!Symbol.dispose) { - Object.defineProperty(Symbol, "dispose", { - value: Symbol("dispose"), - writable: false, - enumerable: false, - configurable: false, - }); -} From feb740e39f01502a84f9464e36eedc155c600316 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Wed, 12 Mar 2025 20:09:05 +0900 Subject: [PATCH 16/32] 3.1.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7268a8e..ee6c7d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@msgpack/msgpack", - "version": "3.1.0", + "version": "3.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@msgpack/msgpack", - "version": "3.1.0", + "version": "3.1.1", "license": "ISC", "devDependencies": { "@eslint/compat": "latest", diff --git a/package.json b/package.json index b1b2e2a..e67d3fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@msgpack/msgpack", - "version": "3.1.0", + "version": "3.1.1", "description": "MessagePack for ECMA-262/JavaScript/TypeScript", "author": "The MessagePack community", "license": "ISC", From 1b2b6a23daf626b0cff1efcf44b45cf5864a2aa8 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Wed, 12 Mar 2025 20:10:48 +0900 Subject: [PATCH 17/32] changes --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c38d2ec..95211e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # This is the revision history of @msgpack/msgpack +## 3.1.1 2025-03-12 + +https://github.com/msgpack/msgpack-javascript/compare/v3.1.0...v3.1.1 + +* Stop using `Symbol.dispose`, which is not yet supported in some environments ([#268](https://github.com/msgpack/msgpack-javascript/pull/268) by @rijenkii) + ## 3.1.0 2025-02-21 From d8464eb7e455b8dbdeb1019b32e35f48a7712633 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Sun, 25 May 2025 09:03:43 +0900 Subject: [PATCH 18/32] add node24 to ci.yml --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 939a092..e26aaa9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ jobs: - '18' - '20' - '22' + - '24' steps: - uses: actions/checkout@v4 - name: Setup Node.js ${{ matrix.node-version }} From 66315201a3300b46cb7f473ce69f2077eac5d40b Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Sun, 25 May 2025 09:06:33 +0900 Subject: [PATCH 19/32] update fuzz.yml --- .github/workflows/fuzz.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index 0bcacca..79f9e5c 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -14,12 +14,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: cache: npm - node-version: "18" + node-version: "20" # npm@9 may fail with https://github.com/npm/cli/issues/6723 # npm@10 may fail with "GitFetcher requires an Arborist constructor to pack a tarball" From a0c6a988316b961a4b1bef980ee8247a20b83aa1 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Sun, 25 May 2025 09:07:48 +0900 Subject: [PATCH 20/32] use import type to import TS types --- src/Encoder.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Encoder.ts b/src/Encoder.ts index ffb4f6b..43fcd8f 100644 --- a/src/Encoder.ts +++ b/src/Encoder.ts @@ -1,9 +1,10 @@ import { utf8Count, utf8Encode } from "./utils/utf8.ts"; -import { ExtensionCodec, ExtensionCodecType } from "./ExtensionCodec.ts"; +import { ExtensionCodec } from "./ExtensionCodec.ts"; import { setInt64, setUint64 } from "./utils/int.ts"; import { ensureUint8Array } from "./utils/typedArrays.ts"; import type { ExtData } from "./ExtData.ts"; import type { ContextOf } from "./context.ts"; +import type { ExtensionCodecType } from "./ExtensionCodec.ts"; export const DEFAULT_MAX_DEPTH = 100; export const DEFAULT_INITIAL_BUFFER_SIZE = 2048; From 35b294a289eb007e5fa80b09cf45391bce5f7e8c Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Sun, 25 May 2025 09:11:19 +0900 Subject: [PATCH 21/32] do not send coverage report to codecova (operation timed out) --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e26aaa9..eb4dd7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,10 +27,6 @@ jobs: - run: npm install -g nyc - run: npm ci - run: npm run test:cover - - uses: codecov/codecov-action@v5 - with: - files: coverage/coverage-final.json - token: ${{ secrets.CODECOV_TOKEN }} browser: runs-on: ubuntu-latest From 6aed81b871c412acad356f7678ece677fcae5069 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Sun, 25 May 2025 09:12:12 +0900 Subject: [PATCH 22/32] hide codecov badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f7c36cc..830d75c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MessagePack for ECMA-262/JavaScript/TypeScript -[![npm version](https://img.shields.io/npm/v/@msgpack/msgpack.svg)](https://www.npmjs.com/package/@msgpack/msgpack) ![CI](https://github.com/msgpack/msgpack-javascript/workflows/CI/badge.svg) [![codecov](https://codecov.io/gh/msgpack/msgpack-javascript/branch/master/graphs/badge.svg)](https://codecov.io/gh/msgpack/msgpack-javascript) [![minzip](https://badgen.net/bundlephobia/minzip/@msgpack/msgpack)](https://bundlephobia.com/result?p=@msgpack/msgpack) [![tree-shaking](https://badgen.net/bundlephobia/tree-shaking/@msgpack/msgpack)](https://bundlephobia.com/result?p=@msgpack/msgpack) +[![npm version](https://img.shields.io/npm/v/@msgpack/msgpack.svg)](https://www.npmjs.com/package/@msgpack/msgpack) ![CI](https://github.com/msgpack/msgpack-javascript/workflows/CI/badge.svg) [![minzip](https://badgen.net/bundlephobia/minzip/@msgpack/msgpack)](https://bundlephobia.com/result?p=@msgpack/msgpack) [![tree-shaking](https://badgen.net/bundlephobia/tree-shaking/@msgpack/msgpack)](https://bundlephobia.com/result?p=@msgpack/msgpack) This library is an implementation of **MessagePack** for TypeScript and JavaScript, providing a compact and efficient binary serialization format. Learn more about MessagePack at: From 3b40330dd107507881c689049d0836d5b786417e Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Sun, 25 May 2025 09:15:11 +0900 Subject: [PATCH 23/32] fix --- .github/workflows/codeql.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 406131c..578c615 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Initialize CodeQL uses: github/codeql-action/init@v3 diff --git a/package.json b/package.json index e67d3fd..a9cdd12 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "test:bun": "bun test test/bun.spec.ts", "test:fuzz": "npm exec --yes -- jsfuzz@git+https://gitlab.com/gitlab-org/security-products/analyzers/fuzzers/jsfuzz.git#39e6cf16613a0e30c7a7953f62e64292dbd5d3f3 --fuzzTime 60 --no-versifier test/decode.jsfuzz.js corpus", "cover:clean": "rimraf .nyc_output coverage/", - "cover:report": "npx nyc report --reporter=text-summary --reporter=html --reporter=json", + "cover:report": "npx nyc report --reporter=text-summary", "test:browser": "karma start --single-run", "test:browser:firefox": "karma start --single-run --browsers FirefoxHeadless", "test:browser:chrome": "karma start --single-run --browsers ChromeHeadless", From 9c52717572d85199cd0e9e28fd9f33921bdbfa8f Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Sun, 25 May 2025 09:15:43 +0900 Subject: [PATCH 24/32] fix imports --- src/Decoder.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Decoder.ts b/src/Decoder.ts index 9239dd1..83b68a1 100644 --- a/src/Decoder.ts +++ b/src/Decoder.ts @@ -1,11 +1,12 @@ import { prettyByte } from "./utils/prettyByte.ts"; -import { ExtensionCodec, ExtensionCodecType } from "./ExtensionCodec.ts"; +import { ExtensionCodec } from "./ExtensionCodec.ts"; import { getInt64, getUint64, UINT32_MAX } from "./utils/int.ts"; import { utf8Decode } from "./utils/utf8.ts"; import { ensureUint8Array } from "./utils/typedArrays.ts"; import { CachedKeyDecoder, KeyDecoder } from "./CachedKeyDecoder.ts"; import { DecodeError } from "./DecodeError.ts"; import type { ContextOf } from "./context.ts"; +import type { ExtensionCodecType } from "./ExtensionCodec.ts"; export type DecoderOptions = Readonly< Partial<{ @@ -70,7 +71,7 @@ export type DecoderOptions = Readonly< /** * A function to convert decoded map key to a valid JS key type. - * + * * Defaults to a function that throws an error if the key is not a string or a number. */ mapKeyConverter: (key: unknown) => MapKeyType; From fb92347d140e7c790053289cdcdbccfc32bc12bd Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Sun, 25 May 2025 09:19:30 +0900 Subject: [PATCH 25/32] fix --- eslint.config.mjs | 203 +++++++++++++++++++++++----------------- src/CachedKeyDecoder.ts | 4 +- src/Decoder.ts | 3 +- 3 files changed, 120 insertions(+), 90 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 3d5529e..0af8fa6 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -11,112 +11,141 @@ import { FlatCompat } from "@eslint/eslintrc"; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const compat = new FlatCompat({ - baseDirectory: __dirname, - recommendedConfig: js.configs.recommended, - allConfig: js.configs.all + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, }); -export default [{ +export default [ + { ignores: ["**/*.js", "test/deno*", "test/bun*"], -}, ...fixupConfigRules(compat.extends( - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:import/recommended", - "plugin:import/typescript", - "prettier", -)), { + }, + ...fixupConfigRules( + compat.extends( + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:import/recommended", + "plugin:import/typescript", + "prettier", + ), + ), + { plugins: { - "@typescript-eslint": fixupPluginRules(typescriptEslintEslintPlugin), - tsdoc, + "@typescript-eslint": fixupPluginRules(typescriptEslintEslintPlugin), + tsdoc, }, languageOptions: { - parser: tsParser, - ecmaVersion: 5, - sourceType: "script", + parser: tsParser, + ecmaVersion: 5, + sourceType: "script", - parserOptions: { - project: "./tsconfig.json", - }, + parserOptions: { + project: "./tsconfig.json", + }, }, settings: {}, rules: { - "no-constant-condition": ["warn", { - checkLoops: false, - }], + "no-constant-condition": [ + "warn", + { + checkLoops: false, + }, + ], - "no-useless-escape": "warn", - "no-console": "warn", - "no-var": "warn", - "no-return-await": "warn", - "prefer-const": "warn", - "guard-for-in": "warn", - curly: "warn", - "no-param-reassign": "warn", - "prefer-spread": "warn", - "import/no-unresolved": "off", - "import/no-cycle": "error", - "import/no-default-export": "warn", - "tsdoc/syntax": "warn", - "@typescript-eslint/await-thenable": "warn", + "no-useless-escape": "warn", + "no-console": "warn", + "no-var": "warn", + "no-return-await": "warn", + "prefer-const": "warn", + "guard-for-in": "warn", + curly: "warn", + "no-param-reassign": "warn", + "prefer-spread": "warn", + "import/no-unresolved": "off", + "import/no-cycle": "error", + "import/no-default-export": "warn", + "tsdoc/syntax": "warn", + "@typescript-eslint/await-thenable": "warn", - "@typescript-eslint/array-type": ["warn", { - default: "generic", - }], + "@typescript-eslint/array-type": [ + "warn", + { + default: "generic", + }, + ], - "@typescript-eslint/naming-convention": ["warn", { - selector: "default", - format: ["camelCase", "UPPER_CASE", "PascalCase"], - leadingUnderscore: "allow", - }, { - selector: "typeLike", - format: ["PascalCase"], - leadingUnderscore: "allow", - }], + "@typescript-eslint/naming-convention": [ + "warn", + { + selector: "default", + format: ["camelCase", "UPPER_CASE", "PascalCase"], + leadingUnderscore: "allow", + }, + { + selector: "typeLike", + format: ["PascalCase"], + leadingUnderscore: "allow", + }, + ], - "@typescript-eslint/restrict-plus-operands": "warn", - //"@typescript-eslint/no-throw-literal": "warn", - "@typescript-eslint/unbound-method": "warn", - "@typescript-eslint/explicit-module-boundary-types": "warn", - //"@typescript-eslint/no-extra-semi": "warn", - "@typescript-eslint/no-extra-non-null-assertion": "warn", + "@typescript-eslint/restrict-plus-operands": "warn", + //"@typescript-eslint/no-throw-literal": "warn", + "@typescript-eslint/unbound-method": "warn", + "@typescript-eslint/explicit-module-boundary-types": "warn", + //"@typescript-eslint/no-extra-semi": "warn", + "@typescript-eslint/no-extra-non-null-assertion": "warn", - "@typescript-eslint/no-unused-vars": ["warn", { - argsIgnorePattern: "^_", - }], + "@typescript-eslint/no-unused-vars": [ + "warn", + { + argsIgnorePattern: "^_", + }, + ], - "@typescript-eslint/no-use-before-define": "warn", - "@typescript-eslint/no-for-in-array": "warn", - "@typescript-eslint/no-unsafe-argument": "warn", - "@typescript-eslint/no-unsafe-call": "warn", + "@typescript-eslint/no-use-before-define": "warn", + "@typescript-eslint/no-for-in-array": "warn", + "@typescript-eslint/no-unsafe-argument": "warn", + "@typescript-eslint/no-unsafe-call": "warn", - "@typescript-eslint/no-unnecessary-condition": ["warn", { - allowConstantLoopConditions: true, - }], + "@typescript-eslint/no-unnecessary-condition": [ + "warn", + { + allowConstantLoopConditions: true, + }, + ], - "@typescript-eslint/no-unnecessary-type-constraint": "warn", - "@typescript-eslint/no-implied-eval": "warn", - "@typescript-eslint/no-non-null-asserted-optional-chain": "warn", - "@typescript-eslint/no-invalid-void-type": "warn", - "@typescript-eslint/no-loss-of-precision": "warn", - "@typescript-eslint/no-confusing-void-expression": "warn", - "@typescript-eslint/no-redundant-type-constituents": "warn", - "@typescript-eslint/prefer-for-of": "warn", - "@typescript-eslint/prefer-includes": "warn", - "@typescript-eslint/prefer-string-starts-ends-with": "warn", - "@typescript-eslint/prefer-readonly": "warn", - "@typescript-eslint/prefer-regexp-exec": "warn", - "@typescript-eslint/prefer-nullish-coalescing": "warn", - "@typescript-eslint/prefer-optional-chain": "warn", - "@typescript-eslint/prefer-ts-expect-error": "warn", - "@typescript-eslint/indent": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-empty-interface": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-var-requires": "off", - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/no-unnecessary-type-constraint": "warn", + "@typescript-eslint/no-implied-eval": "warn", + "@typescript-eslint/no-non-null-asserted-optional-chain": "warn", + "@typescript-eslint/no-invalid-void-type": "warn", + "@typescript-eslint/no-loss-of-precision": "warn", + "@typescript-eslint/no-confusing-void-expression": "warn", + "@typescript-eslint/no-redundant-type-constituents": "warn", + "@typescript-eslint/prefer-for-of": "warn", + "@typescript-eslint/prefer-includes": "warn", + "@typescript-eslint/prefer-string-starts-ends-with": "warn", + "@typescript-eslint/prefer-readonly": "warn", + "@typescript-eslint/prefer-regexp-exec": "warn", + "@typescript-eslint/prefer-nullish-coalescing": "warn", + "@typescript-eslint/prefer-optional-chain": "warn", + "@typescript-eslint/prefer-ts-expect-error": "warn", + "@typescript-eslint/consistent-type-imports": [ + "error", + { + prefer: "type-imports", + disallowTypeAnnotations: false, + }, + ], + "@typescript-eslint/indent": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-empty-interface": "off", + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/ban-ts-comment": "off", }, -}]; + }, +]; diff --git a/src/CachedKeyDecoder.ts b/src/CachedKeyDecoder.ts index 73524f0..0de4a7d 100644 --- a/src/CachedKeyDecoder.ts +++ b/src/CachedKeyDecoder.ts @@ -16,8 +16,8 @@ export class CachedKeyDecoder implements KeyDecoder { hit = 0; miss = 0; private readonly caches: Array>; - private readonly maxKeyLength: number; - private readonly maxLengthPerKey: number; + readonly maxKeyLength: number; + readonly maxLengthPerKey: number; constructor(maxKeyLength = DEFAULT_MAX_KEY_LENGTH, maxLengthPerKey = DEFAULT_MAX_LENGTH_PER_KEY) { this.maxKeyLength = maxKeyLength; diff --git a/src/Decoder.ts b/src/Decoder.ts index 83b68a1..bba8804 100644 --- a/src/Decoder.ts +++ b/src/Decoder.ts @@ -3,10 +3,11 @@ import { ExtensionCodec } from "./ExtensionCodec.ts"; import { getInt64, getUint64, UINT32_MAX } from "./utils/int.ts"; import { utf8Decode } from "./utils/utf8.ts"; import { ensureUint8Array } from "./utils/typedArrays.ts"; -import { CachedKeyDecoder, KeyDecoder } from "./CachedKeyDecoder.ts"; +import { CachedKeyDecoder } from "./CachedKeyDecoder.ts"; import { DecodeError } from "./DecodeError.ts"; import type { ContextOf } from "./context.ts"; import type { ExtensionCodecType } from "./ExtensionCodec.ts"; +import type { KeyDecoder } from "./CachedKeyDecoder.ts"; export type DecoderOptions = Readonly< Partial<{ From 502575308b2d9d5457919a5f8f236fc81cf965e0 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Sun, 25 May 2025 09:23:56 +0900 Subject: [PATCH 26/32] revert hiding coverage reports --- README.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 830d75c..f7c36cc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MessagePack for ECMA-262/JavaScript/TypeScript -[![npm version](https://img.shields.io/npm/v/@msgpack/msgpack.svg)](https://www.npmjs.com/package/@msgpack/msgpack) ![CI](https://github.com/msgpack/msgpack-javascript/workflows/CI/badge.svg) [![minzip](https://badgen.net/bundlephobia/minzip/@msgpack/msgpack)](https://bundlephobia.com/result?p=@msgpack/msgpack) [![tree-shaking](https://badgen.net/bundlephobia/tree-shaking/@msgpack/msgpack)](https://bundlephobia.com/result?p=@msgpack/msgpack) +[![npm version](https://img.shields.io/npm/v/@msgpack/msgpack.svg)](https://www.npmjs.com/package/@msgpack/msgpack) ![CI](https://github.com/msgpack/msgpack-javascript/workflows/CI/badge.svg) [![codecov](https://codecov.io/gh/msgpack/msgpack-javascript/branch/master/graphs/badge.svg)](https://codecov.io/gh/msgpack/msgpack-javascript) [![minzip](https://badgen.net/bundlephobia/minzip/@msgpack/msgpack)](https://bundlephobia.com/result?p=@msgpack/msgpack) [![tree-shaking](https://badgen.net/bundlephobia/tree-shaking/@msgpack/msgpack)](https://bundlephobia.com/result?p=@msgpack/msgpack) This library is an implementation of **MessagePack** for TypeScript and JavaScript, providing a compact and efficient binary serialization format. Learn more about MessagePack at: diff --git a/package.json b/package.json index a9cdd12..e67d3fd 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "test:bun": "bun test test/bun.spec.ts", "test:fuzz": "npm exec --yes -- jsfuzz@git+https://gitlab.com/gitlab-org/security-products/analyzers/fuzzers/jsfuzz.git#39e6cf16613a0e30c7a7953f62e64292dbd5d3f3 --fuzzTime 60 --no-versifier test/decode.jsfuzz.js corpus", "cover:clean": "rimraf .nyc_output coverage/", - "cover:report": "npx nyc report --reporter=text-summary", + "cover:report": "npx nyc report --reporter=text-summary --reporter=html --reporter=json", "test:browser": "karma start --single-run", "test:browser:firefox": "karma start --single-run --browsers FirefoxHeadless", "test:browser:chrome": "karma start --single-run --browsers ChromeHeadless", From e059f46849c925bd02bc41d85e7c642d7bfb62a4 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Sun, 25 May 2025 09:24:11 +0900 Subject: [PATCH 27/32] Revert "do not send coverage report to codecova (operation timed out)" This reverts commit 35b294a289eb007e5fa80b09cf45391bce5f7e8c. --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb4dd7c..e26aaa9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,10 @@ jobs: - run: npm install -g nyc - run: npm ci - run: npm run test:cover + - uses: codecov/codecov-action@v5 + with: + files: coverage/coverage-final.json + token: ${{ secrets.CODECOV_TOKEN }} browser: runs-on: ubuntu-latest From ffadd95f94ba893f77bfa15a846990d8141d7559 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Sun, 25 May 2025 09:29:37 +0900 Subject: [PATCH 28/32] update deps --- package-lock.json | 710 +++++++++++++++++++++++----------------------- 1 file changed, 354 insertions(+), 356 deletions(-) diff --git a/package-lock.json b/package-lock.json index ee6c7d1..72e9712 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,7 @@ "rimraf": "latest", "ts-loader": "latest", "ts-node": "latest", - "tsimp": "^2.0.12", + "tsimp": "latest", "typescript": "latest", "webpack": "latest", "webpack-cli": "latest" @@ -84,9 +84,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", - "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", + "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", "dev": true, "license": "MIT", "dependencies": { @@ -113,9 +113,9 @@ } }, "node_modules/@eslint/compat": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-1.2.6.tgz", - "integrity": "sha512-k7HNCqApoDHM6XzT30zGoETj+D+uUcZUb+IVAJmar3u6bvHf7hhHJcWx09QHj4/a2qrKZMWU0E16tvkiAdv06Q==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-1.2.9.tgz", + "integrity": "sha512-gCdSY54n7k+driCadyMNv8JSPzYLeDVM/ikZRtvtROBpRdFSkS8W9A82MqsaY7lZuwL0wiapgD0NT1xT0hyJsA==", "dev": true, "license": "Apache-2.0", "engines": { @@ -131,9 +131,9 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz", - "integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==", + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.20.0.tgz", + "integrity": "sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -145,10 +145,20 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@eslint/config-helpers": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.2.tgz", + "integrity": "sha512-+GPzk8PlG0sPpzdU5ZvIRMPidzAnZDl/s9L+y13iodqvb8leL53bTannOrQ/Im7UkpsmFU5Ily5U60LWixnmLg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@eslint/core": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.11.0.tgz", - "integrity": "sha512-DWUB2pksgNEb6Bz2fggIy1wh6fGgZP4Xyy/Mt0QZPiloKKXerbqq9D3SBQTlCRYOrcRPu4vuz+CGjwdfqxnoWA==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.14.0.tgz", + "integrity": "sha512-qIbV0/JZr7iSDjqAc60IqbLdsj9GDt16xQtWD+B78d/HAlvysGdZZ6rpJHGAc2T0FQx1X6thsSPdnoiGKdNtdg==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -159,9 +169,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", - "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", "dev": true, "license": "MIT", "dependencies": { @@ -183,13 +193,16 @@ } }, "node_modules/@eslint/js": { - "version": "9.20.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.20.0.tgz", - "integrity": "sha512-iZA07H9io9Wn836aVTytRaNqh00Sad+EamwOVJT12GTLw1VGMFV/4JaME+JjLtr9fiGaoWgYnS54wrfWsSs4oQ==", + "version": "9.27.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.27.0.tgz", + "integrity": "sha512-G5JD9Tu5HJEu4z2Uo4aHY2sLV64B7CDMXxFzqzjl3NKd6RVzSXNoE80jk7Y0lJkTTkjiIhBAqmlYwjuBY3tvpA==", "dev": true, "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" } }, "node_modules/@eslint/object-schema": { @@ -203,32 +216,19 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.5.tgz", - "integrity": "sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.1.tgz", + "integrity": "sha512-0J+zgWxHN+xXONWIyPWKFMgVuJoZuGiIFu8yxk7RJjxkzpGmyja5wRFqZIVtjDVOQpV+Rw0iOAjYPE2eQyjr0w==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/core": "^0.10.0", + "@eslint/core": "^0.14.0", "levn": "^0.4.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@eslint/plugin-kit/node_modules/@eslint/core": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.10.0.tgz", - "integrity": "sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@types/json-schema": "^7.0.15" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, "node_modules/@humanfs/core": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", @@ -282,9 +282,9 @@ } }, "node_modules/@humanwhocodes/retry": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", - "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", "dev": true, "license": "Apache-2.0", "engines": { @@ -637,9 +637,9 @@ "license": "MIT" }, "node_modules/@types/cors": { - "version": "2.8.17", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz", - "integrity": "sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==", + "version": "2.8.18", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.18.tgz", + "integrity": "sha512-nX3d0sxJW41CqQvfOzVG1NCTXfFDrDWIghCZncpHeWlVFd81zxB/DLhg7avFg6eHLCRX7ckBmoIIcqa++upvJA==", "dev": true, "license": "MIT", "dependencies": { @@ -669,9 +669,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", - "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", + "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", "dev": true, "license": "MIT" }, @@ -690,9 +690,9 @@ "license": "MIT" }, "node_modules/@types/lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-w/P33JFeySuhN6JLkysYUK2gEmy9kHHFN7E8ro0tkfmlDOgxBDzWEZ/J8cWA+fHqFevpswDTFZnDx+R9lbL6xw==", + "version": "4.17.17", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.17.tgz", + "integrity": "sha512-RRVJ+J3J+WmyOTqnz3PiBLA501eKwXl2noseKOrNo/6+XEHjTAxO4xHvxQB6QuNm+s4WRbn6rSiap8+EA+ykFQ==", "dev": true, "license": "MIT" }, @@ -704,31 +704,31 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.13.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.1.tgz", - "integrity": "sha512-jK8uzQlrvXqEU91UxiK5J7pKHyzgnI1Qnl0QDHIgVGuolJhRb9EEl28Cj9b3rGR8B2lhFCtvIm5os8lFnO/1Ew==", + "version": "22.15.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.21.tgz", + "integrity": "sha512-EV/37Td6c+MgKAbkcLG6vqZ2zEYHD7bvSrzqqs2RIhbA6w3x+Dqz8MZM3sP6kGTeLrdoOgKZe+Xja7tUB2DNkQ==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~6.20.0" + "undici-types": "~6.21.0" } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.23.0.tgz", - "integrity": "sha512-vBz65tJgRrA1Q5gWlRfvoH+w943dq9K1p1yDBY2pc+a1nbBLZp7fB9+Hk8DaALUbzjqlMfgaqlVPT1REJdkt/w==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.32.1.tgz", + "integrity": "sha512-6u6Plg9nP/J1GRpe/vcjjabo6Uc5YQPAMxsgQyGC/I0RuukiG1wIe3+Vtg3IrSCVJDmqK3j8adrtzXSENRtFgg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.23.0", - "@typescript-eslint/type-utils": "8.23.0", - "@typescript-eslint/utils": "8.23.0", - "@typescript-eslint/visitor-keys": "8.23.0", + "@typescript-eslint/scope-manager": "8.32.1", + "@typescript-eslint/type-utils": "8.32.1", + "@typescript-eslint/utils": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1", "graphemer": "^1.4.0", - "ignore": "^5.3.1", + "ignore": "^7.0.0", "natural-compare": "^1.4.0", - "ts-api-utils": "^2.0.1" + "ts-api-utils": "^2.1.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -740,20 +740,30 @@ "peerDependencies": { "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.8.0" + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.4.tgz", + "integrity": "sha512-gJzzk+PQNznz8ysRrC0aOkBNVRBDtE1n53IqyqEf3PXrYwomFs5q4pGMizBMJF+ykh03insJ27hB8gSrD2Hn8A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" } }, "node_modules/@typescript-eslint/parser": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.23.0.tgz", - "integrity": "sha512-h2lUByouOXFAlMec2mILeELUbME5SZRN/7R9Cw2RD2lRQQY08MWMM+PmVVKKJNK1aIwqTo9t/0CvOxwPbRIE2Q==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.32.1.tgz", + "integrity": "sha512-LKMrmwCPoLhM45Z00O1ulb6jwyVr2kr3XJp+G+tSEZcbauNnScewcQwtJqXDhXeYPDEjZ8C1SjXm015CirEmGg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.23.0", - "@typescript-eslint/types": "8.23.0", - "@typescript-eslint/typescript-estree": "8.23.0", - "@typescript-eslint/visitor-keys": "8.23.0", + "@typescript-eslint/scope-manager": "8.32.1", + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/typescript-estree": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1", "debug": "^4.3.4" }, "engines": { @@ -765,18 +775,18 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.8.0" + "typescript": ">=4.8.4 <5.9.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.23.0.tgz", - "integrity": "sha512-OGqo7+dXHqI7Hfm+WqkZjKjsiRtFUQHPdGMXzk5mYXhJUedO7e/Y7i8AK3MyLMgZR93TX4bIzYrfyVjLC+0VSw==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.32.1.tgz", + "integrity": "sha512-7IsIaIDeZn7kffk7qXC3o6Z4UblZJKV3UBpkvRNpr5NSyLji7tvTcvmnMNYuYLyh26mN8W723xpo3i4MlD33vA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.23.0", - "@typescript-eslint/visitor-keys": "8.23.0" + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -787,16 +797,16 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.23.0.tgz", - "integrity": "sha512-iIuLdYpQWZKbiH+RkCGc6iu+VwscP5rCtQ1lyQ7TYuKLrcZoeJVpcLiG8DliXVkUxirW/PWlmS+d6yD51L9jvA==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.32.1.tgz", + "integrity": "sha512-mv9YpQGA8iIsl5KyUPi+FGLm7+bA4fgXaeRcFKRDRwDMu4iwrSHeDPipwueNXhdIIZltwCJv+NkxftECbIZWfA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.23.0", - "@typescript-eslint/utils": "8.23.0", + "@typescript-eslint/typescript-estree": "8.32.1", + "@typescript-eslint/utils": "8.32.1", "debug": "^4.3.4", - "ts-api-utils": "^2.0.1" + "ts-api-utils": "^2.1.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -807,13 +817,13 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.8.0" + "typescript": ">=4.8.4 <5.9.0" } }, "node_modules/@typescript-eslint/types": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.23.0.tgz", - "integrity": "sha512-1sK4ILJbCmZOTt9k4vkoulT6/y5CHJ1qUYxqpF1K/DBAd8+ZUL4LlSCxOssuH5m4rUaaN0uS0HlVPvd45zjduQ==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.32.1.tgz", + "integrity": "sha512-YmybwXUJcgGqgAp6bEsgpPXEg6dcCyPyCSr0CAAueacR/CCBi25G3V8gGQ2kRzQRBNol7VQknxMs9HvVa9Rvfg==", "dev": true, "license": "MIT", "engines": { @@ -825,20 +835,20 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.23.0.tgz", - "integrity": "sha512-LcqzfipsB8RTvH8FX24W4UUFk1bl+0yTOf9ZA08XngFwMg4Kj8A+9hwz8Cr/ZS4KwHrmo9PJiLZkOt49vPnuvQ==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.32.1.tgz", + "integrity": "sha512-Y3AP9EIfYwBb4kWGb+simvPaqQoT5oJuzzj9m0i6FCY6SPvlomY2Ei4UEMm7+FXtlNJbor80ximyslzaQF6xhg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.23.0", - "@typescript-eslint/visitor-keys": "8.23.0", + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", - "ts-api-utils": "^2.0.1" + "ts-api-utils": "^2.1.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -848,7 +858,7 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <5.8.0" + "typescript": ">=4.8.4 <5.9.0" } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { @@ -878,16 +888,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.23.0.tgz", - "integrity": "sha512-uB/+PSo6Exu02b5ZEiVtmY6RVYO7YU5xqgzTIVZwTHvvK3HsL8tZZHFaTLFtRG3CsV4A5mhOv+NZx5BlhXPyIA==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.32.1.tgz", + "integrity": "sha512-DsSFNIgLSrc89gpq1LJB7Hm1YpuhK086DRDJSNrewcGvYloWW1vZLHBTIvarKZDcAORIy/uWNx8Gad+4oMpkSA==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.23.0", - "@typescript-eslint/types": "8.23.0", - "@typescript-eslint/typescript-estree": "8.23.0" + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/scope-manager": "8.32.1", + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/typescript-estree": "8.32.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -898,17 +908,17 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.8.0" + "typescript": ">=4.8.4 <5.9.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.23.0.tgz", - "integrity": "sha512-oWWhcWDLwDfu++BGTZcmXWqpwtkwb5o7fxUIGksMQQDSdPW9prsSnfIOZMlsj4vBOSrcnjIUZMiIjODgGosFhQ==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.32.1.tgz", + "integrity": "sha512-ar0tjQfObzhSaW3C3QNmTc5ofj0hDoNQ5XWrCy6zDyabdr0TWhCkClp+rywGNj/odAFBVzzJrK4tEq5M4Hmu4w==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.23.0", + "@typescript-eslint/types": "8.32.1", "eslint-visitor-keys": "^4.2.0" }, "engines": { @@ -1169,9 +1179,9 @@ } }, "node_modules/acorn": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", - "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", "dev": true, "license": "MIT", "bin": { @@ -1263,26 +1273,6 @@ "dev": true, "license": "MIT" }, - "node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "ajv": "^6.9.1" - } - }, - "node_modules/ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -1376,18 +1366,19 @@ } }, "node_modules/array.prototype.findlastindex": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", - "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz", + "integrity": "sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", + "es-abstract": "^1.23.9", "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "es-shim-unscopables": "^1.0.2" + "es-object-atoms": "^1.1.1", + "es-shim-unscopables": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -1632,9 +1623,9 @@ "license": "ISC" }, "node_modules/browserslist": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", - "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "version": "4.24.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.5.tgz", + "integrity": "sha512-FDToo4Wo82hIdgc1CQ+NQD0hEhmpPjrZ3hiUgwgOG6IuTdlpr8jdjyG24P6cNP1yJpTLzS5OcGgSw0xmDU1/Tw==", "dev": true, "funding": [ { @@ -1652,10 +1643,10 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001688", - "electron-to-chromium": "^1.5.73", + "caniuse-lite": "^1.0.30001716", + "electron-to-chromium": "^1.5.149", "node-releases": "^2.0.19", - "update-browserslist-db": "^1.1.1" + "update-browserslist-db": "^1.1.3" }, "bin": { "browserslist": "cli.js" @@ -1726,9 +1717,9 @@ } }, "node_modules/call-bind-apply-helpers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", - "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1740,14 +1731,14 @@ } }, "node_modules/call-bound": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", - "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", "dev": true, "license": "MIT", "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "get-intrinsic": "^1.2.6" + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" }, "engines": { "node": ">= 0.4" @@ -1780,9 +1771,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001699", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001699.tgz", - "integrity": "sha512-b+uH5BakXZ9Do9iK+CkDmctUSEqZl+SP056vc5usa0PL+ev5OHw003rZXcnjNDv3L8P5j6rwT6C0BPKSikW08w==", + "version": "1.0.30001718", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001718.tgz", + "integrity": "sha512-AflseV1ahcSunK53NfEs9gFWgOEmzr0f+kaMFA4xiLZlr9Hzt7HxcSpIFcnNCUkz6R6dWKa54rUz3HUmI3nVcw==", "dev": true, "funding": [ { @@ -1987,9 +1978,9 @@ } }, "node_modules/core-js": { - "version": "3.40.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.40.0.tgz", - "integrity": "sha512-7vsMc/Lty6AGnn7uFpYT56QesI5D2Y/UkgKounk87OP9Z2H9Z8kj6jzcSGAxFmUtDOS0ntK6lbQz+Nsa0Jj6mQ==", + "version": "3.42.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.42.0.tgz", + "integrity": "sha512-Sz4PP4ZA+Rq4II21qkNqOEDTDrCvcANId3xpIgB34NDkWc3UduWj2dqEtN9yZIq8Dk3HyPI33x9sqqU5C8sr0g==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -2106,9 +2097,9 @@ } }, "node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2208,9 +2199,9 @@ "license": "MIT" }, "node_modules/diff": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", - "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -2273,9 +2264,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.96", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.96.tgz", - "integrity": "sha512-8AJUW6dh75Fm/ny8+kZKJzI1pgoE8bKLZlzDU2W1ENd+DXKJrx7I7l9hb8UWR4ojlnb5OlixMt00QWiYJoVw1w==", + "version": "1.5.157", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.157.tgz", + "integrity": "sha512-/0ybgsQd1muo8QlnuTpKwtl0oX5YMlUGbm8xyqgDU00motRkKFFbUJySAQBWcY79rVqNLWIWa87BGVGClwAB2w==", "dev": true, "license": "ISC" }, @@ -2389,9 +2380,9 @@ } }, "node_modules/es-abstract": { - "version": "1.23.9", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.9.tgz", - "integrity": "sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA==", + "version": "1.23.10", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.10.tgz", + "integrity": "sha512-MtUbM072wlJNyeYAe0mhzrD+M6DIJa96CZAOBBrhDbgKnB4MApIKefcyAB1eOdYn8cUNZgvwBvEzdoAYsxgEIw==", "dev": true, "license": "MIT", "dependencies": { @@ -2399,18 +2390,18 @@ "arraybuffer.prototype.slice": "^1.0.4", "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", - "call-bound": "^1.0.3", + "call-bound": "^1.0.4", "data-view-buffer": "^1.0.2", "data-view-byte-length": "^1.0.2", "data-view-byte-offset": "^1.0.1", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", + "es-object-atoms": "^1.1.1", "es-set-tostringtag": "^2.1.0", "es-to-primitive": "^1.3.0", "function.prototype.name": "^1.1.8", - "get-intrinsic": "^1.2.7", - "get-proto": "^1.0.0", + "get-intrinsic": "^1.3.0", + "get-proto": "^1.0.1", "get-symbol-description": "^1.1.0", "globalthis": "^1.0.4", "gopd": "^1.2.0", @@ -2426,13 +2417,13 @@ "is-shared-array-buffer": "^1.0.4", "is-string": "^1.1.1", "is-typed-array": "^1.1.15", - "is-weakref": "^1.1.0", + "is-weakref": "^1.1.1", "math-intrinsics": "^1.1.0", - "object-inspect": "^1.13.3", + "object-inspect": "^1.13.4", "object-keys": "^1.1.1", "object.assign": "^4.1.7", "own-keys": "^1.0.1", - "regexp.prototype.flags": "^1.5.3", + "regexp.prototype.flags": "^1.5.4", "safe-array-concat": "^1.1.3", "safe-push-apply": "^1.0.0", "safe-regex-test": "^1.1.0", @@ -2445,7 +2436,7 @@ "typed-array-byte-offset": "^1.0.4", "typed-array-length": "^1.0.7", "unbox-primitive": "^1.1.0", - "which-typed-array": "^1.1.18" + "which-typed-array": "^1.1.19" }, "engines": { "node": ">= 0.4" @@ -2475,9 +2466,9 @@ } }, "node_modules/es-module-lexer": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.6.0.tgz", - "integrity": "sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", "dev": true, "license": "MIT" }, @@ -2511,13 +2502,16 @@ } }, "node_modules/es-shim-unscopables": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", - "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", + "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", "dev": true, "license": "MIT", "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/es-to-primitive": { @@ -2569,22 +2563,23 @@ } }, "node_modules/eslint": { - "version": "9.20.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.20.0.tgz", - "integrity": "sha512-aL4F8167Hg4IvsW89ejnpTwx+B/UQRzJPGgbIOl+4XqffWsahVVsLEWoZvnrVuwpWmnRd7XeXmQI1zlKcFDteA==", + "version": "9.27.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.27.0.tgz", + "integrity": "sha512-ixRawFQuMB9DZ7fjU3iGGganFDp3+45bPOdaRurcFHSXO1e/sYwUX/FtQZpLZJR6SjMoJH8hR2pPEAfDyCoU2Q==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.19.0", - "@eslint/core": "^0.11.0", - "@eslint/eslintrc": "^3.2.0", - "@eslint/js": "9.20.0", - "@eslint/plugin-kit": "^0.2.5", + "@eslint/config-array": "^0.20.0", + "@eslint/config-helpers": "^0.2.1", + "@eslint/core": "^0.14.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.27.0", + "@eslint/plugin-kit": "^0.3.1", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.4.1", + "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", @@ -2592,7 +2587,7 @@ "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.2.0", + "eslint-scope": "^8.3.0", "eslint-visitor-keys": "^4.2.0", "espree": "^10.3.0", "esquery": "^1.5.0", @@ -2629,13 +2624,16 @@ } }, "node_modules/eslint-config-prettier": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.0.1.tgz", - "integrity": "sha512-lZBts941cyJyeaooiKxAtzoPHTN+GbQTJFAIdQbRhA4/8whaAraEh47Whw/ZFfrjNSnlAxqfm9i0XVAEkULjCw==", + "version": "10.1.5", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.5.tgz", + "integrity": "sha512-zc1UmCpNltmVY34vuLRV61r1K27sWuX39E+uyUnY8xS2Bex88VV9cugG+UZbRSRGtGyFboj+D8JODyme1plMpw==", "dev": true, "license": "MIT", "bin": { - "eslint-config-prettier": "build/bin/cli.js" + "eslint-config-prettier": "bin/cli.js" + }, + "funding": { + "url": "https://opencollective.com/eslint-config-prettier" }, "peerDependencies": { "eslint": ">=7.0.0" @@ -2757,9 +2755,9 @@ } }, "node_modules/eslint-scope": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", - "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz", + "integrity": "sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -2979,9 +2977,9 @@ } }, "node_modules/fastq": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.0.tgz", - "integrity": "sha512-7SFSRCNjBQIZH/xZR3iy5iQYR8aGBE0h3VG6/cwlbrpdciNYBMotQav8c1XI3HjHH+NikUpP53nPdlZSdWmFzA==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", "dev": true, "license": "ISC", "dependencies": { @@ -3105,9 +3103,9 @@ } }, "node_modules/flatted": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", - "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", "dev": true, "license": "ISC" }, @@ -3133,9 +3131,9 @@ } }, "node_modules/for-each": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.4.tgz", - "integrity": "sha512-kKaIINnFpzW6ffJNDjjyjrk21BkDx38c0xa/klsT8VzLCaMEefv4ZTacrcVR4DmgTeBra++jMDAfS/tS799YDw==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", "dev": true, "license": "MIT", "dependencies": { @@ -3149,13 +3147,13 @@ } }, "node_modules/foreground-child": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", - "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", "dev": true, "license": "ISC", "dependencies": { - "cross-spawn": "^7.0.0", + "cross-spawn": "^7.0.6", "signal-exit": "^4.0.1" }, "engines": { @@ -3254,18 +3252,18 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", - "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "dev": true, "license": "MIT", "dependencies": { - "call-bind-apply-helpers": "^1.0.1", + "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", + "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", - "get-proto": "^1.0.0", + "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", @@ -4797,25 +4795,25 @@ } }, "node_modules/mocha": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.1.0.tgz", - "integrity": "sha512-8uJR5RTC2NgpY3GrYcgpZrsEd9zKbPDpob1RezyR2upGHRQtHWofmzTMzTMSV6dru3tj5Ukt0+Vnq1qhFEEwAg==", + "version": "11.5.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.5.0.tgz", + "integrity": "sha512-VKDjhy6LMTKm0WgNEdlY77YVsD49LZnPSXJAaPNL9NRYQADxvORsyG1DIQY6v53BKTnlNbEE2MbVCDbnxr4K3w==", "dev": true, "license": "MIT", "dependencies": { - "ansi-colors": "^4.1.3", "browser-stdout": "^1.3.1", - "chokidar": "^3.5.3", + "chokidar": "^4.0.1", "debug": "^4.3.5", - "diff": "^5.2.0", + "diff": "^7.0.0", "escape-string-regexp": "^4.0.0", "find-up": "^5.0.0", "glob": "^10.4.5", "he": "^1.2.0", "js-yaml": "^4.1.0", "log-symbols": "^4.1.0", - "minimatch": "^5.1.6", + "minimatch": "^9.0.5", "ms": "^2.1.3", + "picocolors": "^1.1.1", "serialize-javascript": "^6.0.2", "strip-json-comments": "^3.1.1", "supports-color": "^8.1.1", @@ -4842,6 +4840,22 @@ "balanced-match": "^1.0.0" } }, + "node_modules/mocha/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/mocha/node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -4878,7 +4892,7 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mocha/node_modules/glob/node_modules/minimatch": { + "node_modules/mocha/node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", @@ -4894,17 +4908,18 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mocha/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "node_modules/mocha/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, + "license": "MIT", "engines": { - "node": ">=10" + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" } }, "node_modules/mocha/node_modules/supports-color": { @@ -5392,9 +5407,9 @@ } }, "node_modules/pirates": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", - "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", "dev": true, "license": "MIT", "engines": { @@ -5498,9 +5513,9 @@ } }, "node_modules/prettier": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", - "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", + "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", "dev": true, "license": "MIT", "bin": { @@ -5755,9 +5770,9 @@ } }, "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", "dev": true, "license": "MIT", "engines": { @@ -5803,9 +5818,9 @@ } }, "node_modules/rimraf/node_modules/glob": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.1.tgz", - "integrity": "sha512-zrQDm8XPnYEKawJScsnM0QzobJxlT/kHOOlRTio8IH/GrmxRE5fjllkzdaHclIuNjUQTJYH2xHNIGfdpJkDJUw==", + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.2.tgz", + "integrity": "sha512-YT7U7Vye+t5fZ/QMkBFrTJ7ZQxInIUjwyAjVj84CYXqgBdv30MFUPGnBR6sQaVq6Is15wYJUsnzTuWaGRBhBAQ==", "dev": true, "license": "ISC", "dependencies": { @@ -5827,9 +5842,9 @@ } }, "node_modules/rimraf/node_modules/jackspeak": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.2.tgz", - "integrity": "sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.1.tgz", + "integrity": "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -5843,9 +5858,9 @@ } }, "node_modules/rimraf/node_modules/lru-cache": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.2.tgz", - "integrity": "sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.1.0.tgz", + "integrity": "sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==", "dev": true, "license": "ISC", "engines": { @@ -5993,15 +6008,16 @@ "license": "MIT" }, "node_modules/schema-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", - "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.2.tgz", + "integrity": "sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==", "dev": true, "license": "MIT", "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" }, "engines": { "node": ">= 10.13.0" @@ -6011,10 +6027,47 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/schema-utils/node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/schema-utils/node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3" + }, + "peerDependencies": { + "ajv": "^8.8.2" + } + }, + "node_modules/schema-utils/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT" + }, "node_modules/semver": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", - "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", "dev": true, "license": "ISC", "bin": { @@ -6610,9 +6663,9 @@ } }, "node_modules/tapable": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", - "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.2.tgz", + "integrity": "sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg==", "dev": true, "license": "MIT", "engines": { @@ -6620,14 +6673,14 @@ } }, "node_modules/terser": { - "version": "5.38.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.38.1.tgz", - "integrity": "sha512-GWANVlPM/ZfYzuPHjq0nxT+EbOEDDN3Jwhwdg1D8TU8oSkktp8w64Uq4auuGLxFSoNTRDncTq2hQHX1Ld9KHkA==", + "version": "5.39.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.39.2.tgz", + "integrity": "sha512-yEPUmWve+VA78bI71BW70Dh0TuV4HHd+I5SHOAfS1+QBOmvmCiiffgjR8ryyEd3KIfvPGFqoADt8LdQ6XpXIvg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.8.2", + "acorn": "^8.14.0", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, @@ -6639,9 +6692,9 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.11", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.11.tgz", - "integrity": "sha512-RVCsMfuD0+cTt3EwX8hSl2Ks56EbFHWmhluwcqoPKtBnfjiT6olaq7PRIRfhyU8nnC2MrnDrBLfrD/RGE+cVXQ==", + "version": "5.3.14", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.14.tgz", + "integrity": "sha512-vkZjpUjb6OMS7dhV+tILUW6BhpDR7P2L/aQSAv+Uwk+m8KATX9EccViHTJR2qDtACKPIYndLGCyl3FMo+r2LMw==", "dev": true, "license": "MIT", "dependencies": { @@ -6684,63 +6737,6 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/terser-webpack-plugin/node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/terser-webpack-plugin/node_modules/ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.3" - }, - "peerDependencies": { - "ajv": "^8.8.2" - } - }, - "node_modules/terser-webpack-plugin/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "license": "MIT" - }, - "node_modules/terser-webpack-plugin/node_modules/schema-utils": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz", - "integrity": "sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.9.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.1.0" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, "node_modules/timestamp-nano": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/timestamp-nano/-/timestamp-nano-1.0.1.tgz", @@ -6785,9 +6781,9 @@ } }, "node_modules/ts-api-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", - "integrity": "sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", "dev": true, "license": "MIT", "engines": { @@ -7044,9 +7040,9 @@ } }, "node_modules/typescript": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", - "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -7104,9 +7100,9 @@ } }, "node_modules/undici-types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", "dev": true, "license": "MIT" }, @@ -7131,9 +7127,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz", - "integrity": "sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", + "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", "dev": true, "funding": [ { @@ -7243,9 +7239,9 @@ } }, "node_modules/watchpack": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", - "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.4.tgz", + "integrity": "sha512-c5EGNOiyxxV5qmTtAB7rbiXxi1ooX1pQKMLX/MIabJjRA0SJBQOjKF+KSVfHkr9U1cADPon0mRiVe/riyaiDUA==", "dev": true, "license": "MIT", "dependencies": { @@ -7257,14 +7253,15 @@ } }, "node_modules/webpack": { - "version": "5.97.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.97.1.tgz", - "integrity": "sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg==", + "version": "5.99.9", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.99.9.tgz", + "integrity": "sha512-brOPwM3JnmOa+7kd3NsmOUOwbDAj8FT9xDsG3IW0MgbN9yZV7Oi/s/+MNQ/EcSMqw7qfoRyXPoeEWT8zLVdVGg==", "dev": true, "license": "MIT", "dependencies": { "@types/eslint-scope": "^3.7.7", "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", "@webassemblyjs/ast": "^1.14.1", "@webassemblyjs/wasm-edit": "^1.14.1", "@webassemblyjs/wasm-parser": "^1.14.1", @@ -7281,9 +7278,9 @@ "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^3.2.0", + "schema-utils": "^4.3.2", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.10", + "terser-webpack-plugin": "^5.3.11", "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" }, @@ -7382,9 +7379,9 @@ } }, "node_modules/webpack-sources": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", - "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.3.0.tgz", + "integrity": "sha512-77R0RDmJfj9dyv5p3bM5pOHa+X8/ZkO9c7kpDstigkC4nIDobadsfSGCwB4bKhMVxqAok8tajaoR8rirM7+VFQ==", "dev": true, "license": "MIT", "engines": { @@ -7499,16 +7496,17 @@ } }, "node_modules/which-typed-array": { - "version": "1.1.18", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.18.tgz", - "integrity": "sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==", + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", + "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", "dev": true, "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "for-each": "^0.3.3", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-tostringtag": "^1.0.2" }, From 3d60fcf2e52238b58533a90d5be127ae8e2e721f Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Sun, 25 May 2025 09:54:30 +0900 Subject: [PATCH 29/32] fix doc --- README.md | 10 +++++----- src/decode.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f7c36cc..c0f4dc0 100644 --- a/README.md +++ b/README.md @@ -337,7 +337,7 @@ extensionCodec.register({ type: MYTYPE_EXT_TYPE, encode: (object, context) => { if (object instanceof MyType) { - context.track(object); // <-- like this + context.track(object); return encode(object.toJSON(), { extensionCodec, context }); } else { return null; @@ -346,7 +346,7 @@ extensionCodec.register({ decode: (data, extType, context) => { const decoded = decode(data, { extensionCodec, context }); const my = new MyType(decoded); - context.track(my); // <-- and like this + context.track(my); return my; }, }); @@ -356,7 +356,7 @@ import { encode, decode } from "@msgpack/msgpack"; const context = new MyContext(); -const encoded = = encode({myType: new MyType()}, { extensionCodec, context }); +const encoded = encode({ myType: new MyType() }, { extensionCodec, context }); const decoded = decode(encoded, { extensionCodec, context }); ``` @@ -376,7 +376,7 @@ So you might want to define a custom codec to handle bigint like this: ```typescript import { deepStrictEqual } from "assert"; -import { encode, decode, ExtensionCodec } from "@msgpack/msgpack"; +import { encode, decode, ExtensionCodec, DecodeError } from "@msgpack/msgpack"; // to define a custom codec: const BIGINT_EXT_TYPE = 0; // Any in 0-127 @@ -405,7 +405,7 @@ extensionCodec.register({ // to use it: const value = BigInt(Number.MAX_SAFE_INTEGER) + BigInt(1); -const encoded: = encode(value, { extensionCodec }); +const encoded = encode(value, { extensionCodec }); deepStrictEqual(decode(encoded, { extensionCodec }), value); ``` diff --git a/src/decode.ts b/src/decode.ts index 685fc10..3b8bf50 100644 --- a/src/decode.ts +++ b/src/decode.ts @@ -6,7 +6,7 @@ import type { SplitUndefined } from "./context.ts"; * It decodes a single MessagePack object in a buffer. * * This is a synchronous decoding function. - * See other variants for asynchronous decoding: {@link decodeAsync}, {@link decodeStream}, or {@link decodeArrayStream}. + * See other variants for asynchronous decoding: {@link decodeAsync}, {@link decodeMultiStream}, or {@link decodeArrayStream}. * * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. * @throws {@link DecodeError} if the buffer contains invalid data. From dd1a8db1541743ac2522e72082d725f4cb9da3d4 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Sun, 25 May 2025 10:05:42 +0900 Subject: [PATCH 30/32] add test:node_with_strip_types --- .github/workflows/ci.yml | 12 ++++++++++++ package.json | 1 + 2 files changed, 13 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e26aaa9..101c3dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,6 +81,18 @@ jobs: - run: bun install - run: npm run test:bun + node_with_strip_types: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + cache: npm + node-version: '24' + - run: npm ci + - run: npm run test:node_with_strip_types + timeline: runs-on: ubuntu-latest permissions: diff --git a/package.json b/package.json index e67d3fd..8dcbedd 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "test": "mocha 'test/**/*.test.ts'", "test:dist": "npm run lint && npm run test && npm run test:deno", "test:cover": "npm run cover:clean && npx nyc --no-clean npm run 'test' && npm run cover:report", + "test:node_with_strip_types": "node --experimental-strip-types test/deno_test.ts", "test:deno": "deno test --allow-read test/deno_*.ts", "test:bun": "bun test test/bun.spec.ts", "test:fuzz": "npm exec --yes -- jsfuzz@git+https://gitlab.com/gitlab-org/security-products/analyzers/fuzzers/jsfuzz.git#39e6cf16613a0e30c7a7953f62e64292dbd5d3f3 --fuzzTime 60 --no-versifier test/decode.jsfuzz.js corpus", From e69d665dbdbd35a0b24e05d64a4ec11691e448b5 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Sun, 25 May 2025 10:07:50 +0900 Subject: [PATCH 31/32] v3.1.2 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95211e8..4d8d5b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # This is the revision history of @msgpack/msgpack +## 3.1.2 2025-05-25 + +https://github.com/msgpack/msgpack-javascript/compare/v3.1.1...v3.1.2 + +* Make sure this library works with `node --experimental-strip-types` + ## 3.1.1 2025-03-12 https://github.com/msgpack/msgpack-javascript/compare/v3.1.0...v3.1.1 From 0e029176d954a9a3529b6d74e50c0685d1ec3aa2 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Sun, 25 May 2025 10:08:23 +0900 Subject: [PATCH 32/32] 3.1.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 72e9712..aa18342 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@msgpack/msgpack", - "version": "3.1.1", + "version": "3.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@msgpack/msgpack", - "version": "3.1.1", + "version": "3.1.2", "license": "ISC", "devDependencies": { "@eslint/compat": "latest", diff --git a/package.json b/package.json index 8dcbedd..d551488 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@msgpack/msgpack", - "version": "3.1.1", + "version": "3.1.2", "description": "MessagePack for ECMA-262/JavaScript/TypeScript", "author": "The MessagePack community", "license": "ISC",