typeson-registry 14.2.1 → 14.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2114,8 +2114,25 @@ const structuredCloningThrowing = expObj.concat({
2114
2114
  // HTML-SPECIFIC
2115
2115
  'Event',
2116
2116
  // Also in Node `worker_threads` (currently experimental)
2117
- 'MessageChannel'
2117
+ 'MessageChannel',
2118
+ 'MessagePort'
2118
2119
  ].includes(stringTag) ||
2120
+ // Node's native `worker_threads` `MessageChannel`/
2121
+ // `MessagePort` don't set `Symbol.toStringTag` per
2122
+ // https://github.com/nodejs/node/issues/65527
2123
+ // (verified directly:
2124
+ // `{}.toString.call(new MessageChannel())` is
2125
+ // `"[object Object]"`, and `.port1`'s is
2126
+ // `"[object EventTarget]"`, its own base class), so the
2127
+ // `stringTag` check above can't catch them there; a real
2128
+ // browser's `MessagePort`/`MessageChannel` already match
2129
+ // via `stringTag` (or, for `MessagePort`, would need its
2130
+ // own `stringTag` entry if ever seen failing to match) --
2131
+ // this is purely a fallback for environments (like Node)
2132
+ // that don't set the tag.
2133
+ (val && val.constructor && [
2134
+ 'MessageChannel', 'MessagePort'
2135
+ ].includes(val.constructor.name)) ||
2119
2136
  // 1. `IsDetachedBuffer` (a process not called within the
2120
2137
  // ECMAScript spec)
2121
2138
  ([