Comparing version 8.2.20 to 8.2.21
{ | ||
"name": "hybrids", | ||
"version": "8.2.20", | ||
"version": "8.2.21", | ||
"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", |
@@ -283,3 +283,3 @@ import * as cache from "./cache.js"; | ||
return { | ||
get: config.enumerable ? () => {} : () => config.create({}), | ||
get: config.enumerable ? () => null : () => config.create({}), | ||
set: config.enumerable | ||
@@ -1046,3 +1046,6 @@ ? (id, values) => values | ||
throw TypeError( | ||
`Storage 'get' method must return a Promise, an instance, or null: ${result}`, | ||
stringifyModel( | ||
Model, | ||
`Storage 'get' method must return a Promise, an instance, or null: ${result}`, | ||
), | ||
); | ||
@@ -1226,3 +1229,6 @@ } | ||
throw TypeError( | ||
`Storage 'set' method must return a Promise, an instance, or null: ${result}`, | ||
stringifyModel( | ||
config.model, | ||
`Storage 'set' method must return a Promise, an instance, or null: ${result}`, | ||
), | ||
); | ||
@@ -1233,2 +1239,11 @@ } | ||
.then((data) => { | ||
if (data === undefined || typeof data !== "object") { | ||
throw TypeError( | ||
stringifyModel( | ||
config.model, | ||
`Storage 'set' method must resolve to an instance, or null: ${data}`, | ||
), | ||
); | ||
} | ||
const resultModel = | ||
@@ -1239,3 +1254,6 @@ data === localModel ? localModel : config.create(data); | ||
throw TypeError( | ||
`Local and storage data must have the same id: '${id}', '${resultModel.id}'`, | ||
stringifyModel( | ||
config.model, | ||
`Local and storage data must have the same id: '${id}', '${resultModel.id}'`, | ||
), | ||
); | ||
@@ -1242,0 +1260,0 @@ } |
import { camelToDash } from "./utils.js"; | ||
const setters = { | ||
string: String, | ||
string: (v) => String(v ?? ""), | ||
number: Number, | ||
@@ -6,0 +6,0 @@ boolean: Boolean, |
206643
6551