tutuca 0.9.96 → 0.9.97

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.
@@ -9334,7 +9334,7 @@ class WeakMapDomCache {
9334
9334
  const key = keys[i];
9335
9335
  let next = cur.get(key);
9336
9336
  if (!next) {
9337
- if (typeof key !== "object") {
9337
+ if (!isWeakKey(key)) {
9338
9338
  this.badKey += 1;
9339
9339
  return;
9340
9340
  }
@@ -9347,7 +9347,7 @@ class WeakMapDomCache {
9347
9347
  const leaf = cur.get(lastKey);
9348
9348
  if (leaf)
9349
9349
  leaf[cacheKey] = v;
9350
- else if (typeof lastKey === "object")
9350
+ else if (isWeakKey(lastKey))
9351
9351
  cur.set(lastKey, { [cacheKey]: v });
9352
9352
  else
9353
9353
  this.badKey += 1;
@@ -9359,6 +9359,7 @@ class WeakMapDomCache {
9359
9359
  return { hit, miss, badKey };
9360
9360
  }
9361
9361
  }
9362
+ var isWeakKey = (k) => k !== null && (typeof k === "object" || typeof k === "function");
9362
9363
 
9363
9364
  // src/vdom.js
9364
9365
  function childOpts(vnode, ns, opts) {
@@ -1322,6 +1322,8 @@ class RequestHandler {
1322
1322
  import { isIndexed, isKeyed } from "immutable";
1323
1323
 
1324
1324
  // src/cache.js
1325
+ var isWeakKey = (k) => k !== null && (typeof k === "object" || typeof k === "function");
1326
+
1325
1327
  class NullDomCache {
1326
1328
  get(_keys, _cacheKey) {}
1327
1329
  set(_keys, _cacheKey, _v) {}
@@ -1365,7 +1367,7 @@ class WeakMapDomCache {
1365
1367
  const key = keys[i];
1366
1368
  let next = cur.get(key);
1367
1369
  if (!next) {
1368
- if (typeof key !== "object") {
1370
+ if (!isWeakKey(key)) {
1369
1371
  this.badKey += 1;
1370
1372
  return;
1371
1373
  }
@@ -1378,7 +1380,7 @@ class WeakMapDomCache {
1378
1380
  const leaf = cur.get(lastKey);
1379
1381
  if (leaf)
1380
1382
  leaf[cacheKey] = v;
1381
- else if (typeof lastKey === "object")
1383
+ else if (isWeakKey(lastKey))
1382
1384
  cur.set(lastKey, { [cacheKey]: v });
1383
1385
  else
1384
1386
  this.badKey += 1;
@@ -8973,6 +8973,8 @@ class RequestHandler {
8973
8973
  }
8974
8974
 
8975
8975
  // src/cache.js
8976
+ var isWeakKey = (k) => k !== null && (typeof k === "object" || typeof k === "function");
8977
+
8976
8978
  class NullDomCache {
8977
8979
  get(_keys, _cacheKey) {}
8978
8980
  set(_keys, _cacheKey, _v) {}
@@ -9016,7 +9018,7 @@ class WeakMapDomCache {
9016
9018
  const key = keys[i];
9017
9019
  let next = cur.get(key);
9018
9020
  if (!next) {
9019
- if (typeof key !== "object") {
9021
+ if (!isWeakKey(key)) {
9020
9022
  this.badKey += 1;
9021
9023
  return;
9022
9024
  }
@@ -9029,7 +9031,7 @@ class WeakMapDomCache {
9029
9031
  const leaf = cur.get(lastKey);
9030
9032
  if (leaf)
9031
9033
  leaf[cacheKey] = v;
9032
- else if (typeof lastKey === "object")
9034
+ else if (isWeakKey(lastKey))
9033
9035
  cur.set(lastKey, { [cacheKey]: v });
9034
9036
  else
9035
9037
  this.badKey += 1;