@instantdb/core
Advanced tools
Comparing version 0.5.16 to 0.5.17
@@ -8,2 +8,9 @@ import { produce } from "immer"; | ||
} | ||
// (XXX): Temporary workaround for missing attrs | ||
// Once we can repro this issue, we can remove this in favor of | ||
// getAttrAsserting; | ||
// -- As an aside, what should happen if we can't find an attr? | ||
function getAttr(attrs, attrId) { | ||
return attrs[attrId]; | ||
} | ||
function getAttrAsserting(attrs, attrId) { | ||
@@ -42,3 +49,9 @@ const attr = attrs[attrId]; | ||
const [eid, aid, v] = triple; | ||
const attr = getAttrAsserting(attrs, aid); | ||
const attr = getAttr(attrs, aid); | ||
// (XXX): Temporary workaround for missing attrs | ||
// Once we can repro this issue, we can remove this check | ||
if (!attr) { | ||
console.warn("no such attr", aid, "attrs", attrs); | ||
return indexMap; | ||
} | ||
if (hasEA(attr)) { | ||
@@ -45,0 +58,0 @@ setIn(indexMap, ["ea", eid, aid], triple); |
@@ -11,2 +11,9 @@ "use strict"; | ||
} | ||
// (XXX): Temporary workaround for missing attrs | ||
// Once we can repro this issue, we can remove this in favor of | ||
// getAttrAsserting; | ||
// -- As an aside, what should happen if we can't find an attr? | ||
function getAttr(attrs, attrId) { | ||
return attrs[attrId]; | ||
} | ||
function getAttrAsserting(attrs, attrId) { | ||
@@ -45,3 +52,9 @@ const attr = attrs[attrId]; | ||
const [eid, aid, v] = triple; | ||
const attr = getAttrAsserting(attrs, aid); | ||
const attr = getAttr(attrs, aid); | ||
// (XXX): Temporary workaround for missing attrs | ||
// Once we can repro this issue, we can remove this check | ||
if (!attr) { | ||
console.warn("no such attr", aid, "attrs", attrs); | ||
return indexMap; | ||
} | ||
if (hasEA(attr)) { | ||
@@ -48,0 +61,0 @@ setIn(indexMap, ["ea", eid, aid], triple); |
{ | ||
"name": "@instantdb/core", | ||
"version": "0.5.16", | ||
"version": "0.5.17", | ||
"description": "Instant's core local abstraction", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -11,2 +11,10 @@ import { produce } from "immer"; | ||
// (XXX): Temporary workaround for missing attrs | ||
// Once we can repro this issue, we can remove this in favor of | ||
// getAttrAsserting; | ||
// -- As an aside, what should happen if we can't find an attr? | ||
function getAttr(attrs, attrId) { | ||
return attrs[attrId]; | ||
} | ||
function getAttrAsserting(attrs, attrId) { | ||
@@ -44,3 +52,11 @@ const attr = attrs[attrId]; | ||
const [eid, aid, v] = triple; | ||
const attr = getAttrAsserting(attrs, aid); | ||
const attr = getAttr(attrs, aid); | ||
// (XXX): Temporary workaround for missing attrs | ||
// Once we can repro this issue, we can remove this check | ||
if (!attr) { | ||
console.warn("no such attr", aid, "attrs", attrs) | ||
return indexMap; | ||
} | ||
if (hasEA(attr)) { | ||
@@ -47,0 +63,0 @@ setIn(indexMap, ["ea", eid, aid], triple); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1383538
29318