Comparing version 9.1.1 to 9.1.2
{ | ||
"name": "hybrids", | ||
"version": "9.1.1", | ||
"version": "9.1.2", | ||
"description": "A JavaScript framework for creating fully-featured web applications, components libraries, and single web components with unique declarative and functional architecture", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -117,3 +117,9 @@ import * as emitter from "./emitter.js"; | ||
export function assert(target, key, value) { | ||
export function assert(target, key, value, force) { | ||
if (context && !force) { | ||
throw Error( | ||
`Try to assert value of the '${key}' inside of the value function`, | ||
); | ||
} | ||
const entry = getEntry(target, key); | ||
@@ -120,0 +126,0 @@ |
@@ -321,7 +321,12 @@ import * as cache from "./cache.js"; | ||
cache.assert(model, "state", { | ||
state, | ||
value, | ||
error: (state === "error" ? value : lastConfig?.error) || false, | ||
}); | ||
cache.assert( | ||
model, | ||
"state", | ||
{ | ||
state, | ||
value, | ||
error: (state === "error" ? value : lastConfig?.error) || false, | ||
}, | ||
true, | ||
); | ||
@@ -1626,3 +1631,3 @@ return model; | ||
definitions.set(clone, config); | ||
cache.assert(clone, "state", getModelState(nextModel)); | ||
cache.assert(clone, "state", getModelState(nextModel), true); | ||
@@ -1629,0 +1634,0 @@ return clone; |
210090
6690