From d1d82092bbc96a59982abc6093f02b0b8142a5c3 Mon Sep 17 00:00:00 2001 From: edlsh Date: Thu, 1 Jan 2026 23:56:37 -0500 Subject: [PATCH] refactor: use structuredClone instead of JSON parse/stringify --- packages/plugin/script/publish.ts | 2 +- packages/sdk/js/script/publish.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/plugin/script/publish.ts b/packages/plugin/script/publish.ts index 647b56e5e2dd..9ac6d35db212 100755 --- a/packages/plugin/script/publish.ts +++ b/packages/plugin/script/publish.ts @@ -7,7 +7,7 @@ process.chdir(dir) await $`bun tsc` const pkg = await import("../package.json").then((m) => m.default) -const original = JSON.parse(JSON.stringify(pkg)) +const original = structuredClone(pkg) for (const [key, value] of Object.entries(pkg.exports)) { const file = value.replace("./src/", "./dist/").replace(".ts", "") // @ts-ignore diff --git a/packages/sdk/js/script/publish.ts b/packages/sdk/js/script/publish.ts index 79701b50e788..89fcda561697 100755 --- a/packages/sdk/js/script/publish.ts +++ b/packages/sdk/js/script/publish.ts @@ -9,7 +9,7 @@ process.chdir(dir) await import("./build") const pkg = await import("../package.json").then((m) => m.default) -const original = JSON.parse(JSON.stringify(pkg)) +const original = structuredClone(pkg) for (const [key, value] of Object.entries(pkg.exports)) { const file = value.replace("./src/", "./dist/").replace(".ts", "") /// @ts-expect-error