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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tutuca",
3
- "version": "0.9.96",
3
+ "version": "0.9.97",
4
4
  "type": "module",
5
5
  "description": "Zero-dependency SPA framework with immutable state and virtual DOM",
6
6
  "main": "./dist/tutuca.js",
@@ -1224,6 +1224,8 @@ class RequestHandler {
1224
1224
  import { isIndexed, isKeyed } from "immutable";
1225
1225
 
1226
1226
  // src/cache.js
1227
+ var isWeakKey = (k) => k !== null && (typeof k === "object" || typeof k === "function");
1228
+
1227
1229
  class NullDomCache {
1228
1230
  get(_keys, _cacheKey) {}
1229
1231
  set(_keys, _cacheKey, _v) {}
@@ -1267,7 +1269,7 @@ class WeakMapDomCache {
1267
1269
  const key = keys[i];
1268
1270
  let next = cur.get(key);
1269
1271
  if (!next) {
1270
- if (typeof key !== "object") {
1272
+ if (!isWeakKey(key)) {
1271
1273
  this.badKey += 1;
1272
1274
  return;
1273
1275
  }
@@ -1280,7 +1282,7 @@ class WeakMapDomCache {
1280
1282
  const leaf = cur.get(lastKey);
1281
1283
  if (leaf)
1282
1284
  leaf[cacheKey] = v;
1283
- else if (typeof lastKey === "object")
1285
+ else if (isWeakKey(lastKey))
1284
1286
  cur.set(lastKey, { [cacheKey]: v });
1285
1287
  else
1286
1288
  this.badKey += 1;