From afa87af01c79a9baa539f2992d32154d2a4739bd Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Sat, 14 Feb 2026 14:46:37 -0800 Subject: task: delete vanilla js prototype\n\n- Removed vanilla/ directory and web/dist/vanilla directory\n- Updated Makefile, Dockerfile, and CI workflow to remove vanilla references\n- Cleaned up web/web.go to remove vanilla embed and routes\n- Verified build and tests pass\n\nCloses NK-2tcnmq --- .../node_modules/@vitest/utils/dist/serialize.js | 118 --------------------- 1 file changed, 118 deletions(-) delete mode 100644 vanilla/node_modules/@vitest/utils/dist/serialize.js (limited to 'vanilla/node_modules/@vitest/utils/dist/serialize.js') diff --git a/vanilla/node_modules/@vitest/utils/dist/serialize.js b/vanilla/node_modules/@vitest/utils/dist/serialize.js deleted file mode 100644 index f3ad0ad..0000000 --- a/vanilla/node_modules/@vitest/utils/dist/serialize.js +++ /dev/null @@ -1,118 +0,0 @@ -const IS_RECORD_SYMBOL = "@@__IMMUTABLE_RECORD__@@"; -const IS_COLLECTION_SYMBOL = "@@__IMMUTABLE_ITERABLE__@@"; -function isImmutable(v) { - return v && (v[IS_COLLECTION_SYMBOL] || v[IS_RECORD_SYMBOL]); -} -const OBJECT_PROTO = Object.getPrototypeOf({}); -function getUnserializableMessage(err) { - if (err instanceof Error) { - return `: ${err.message}`; - } - if (typeof err === "string") { - return `: ${err}`; - } - return ""; -} -// https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm -function serializeValue(val, seen = new WeakMap()) { - if (!val || typeof val === "string") { - return val; - } - if (val instanceof Error && "toJSON" in val && typeof val.toJSON === "function") { - const jsonValue = val.toJSON(); - if (jsonValue && jsonValue !== val && typeof jsonValue === "object") { - if (typeof val.message === "string") { - safe(() => jsonValue.message ?? (jsonValue.message = normalizeErrorMessage(val.message))); - } - if (typeof val.stack === "string") { - safe(() => jsonValue.stack ?? (jsonValue.stack = val.stack)); - } - if (typeof val.name === "string") { - safe(() => jsonValue.name ?? (jsonValue.name = val.name)); - } - if (val.cause != null) { - safe(() => jsonValue.cause ?? (jsonValue.cause = serializeValue(val.cause, seen))); - } - } - return serializeValue(jsonValue, seen); - } - if (typeof val === "function") { - return `Function<${val.name || "anonymous"}>`; - } - if (typeof val === "symbol") { - return val.toString(); - } - if (typeof val !== "object") { - return val; - } - if (typeof Buffer !== "undefined" && val instanceof Buffer) { - return ``; - } - if (typeof Uint8Array !== "undefined" && val instanceof Uint8Array) { - return ``; - } - // cannot serialize immutables as immutables - if (isImmutable(val)) { - return serializeValue(val.toJSON(), seen); - } - if (val instanceof Promise || val.constructor && val.constructor.prototype === "AsyncFunction") { - return "Promise"; - } - if (typeof Element !== "undefined" && val instanceof Element) { - return val.tagName; - } - if (typeof val.toJSON === "function") { - return serializeValue(val.toJSON(), seen); - } - if (seen.has(val)) { - return seen.get(val); - } - if (Array.isArray(val)) { - // eslint-disable-next-line unicorn/no-new-array -- we need to keep sparse arrays ([1,,3]) - const clone = new Array(val.length); - seen.set(val, clone); - val.forEach((e, i) => { - try { - clone[i] = serializeValue(e, seen); - } catch (err) { - clone[i] = getUnserializableMessage(err); - } - }); - return clone; - } else { - // Objects with `Error` constructors appear to cause problems during worker communication - // using `MessagePort`, so the serialized error object is being recreated as plain object. - const clone = Object.create(null); - seen.set(val, clone); - let obj = val; - while (obj && obj !== OBJECT_PROTO) { - Object.getOwnPropertyNames(obj).forEach((key) => { - if (key in clone) { - return; - } - try { - clone[key] = serializeValue(val[key], seen); - } catch (err) { - // delete in case it has a setter from prototype that might throw - delete clone[key]; - clone[key] = getUnserializableMessage(err); - } - }); - obj = Object.getPrototypeOf(obj); - } - if (val instanceof Error) { - safe(() => val.message = normalizeErrorMessage(val.message)); - } - return clone; - } -} -function safe(fn) { - try { - return fn(); - } catch {} -} -function normalizeErrorMessage(message) { - return message.replace(/__(vite_ssr_import|vi_import)_\d+__\./g, ""); -} - -export { serializeValue }; -- cgit v1.2.3