@lucania/schema 3.1.3 → 3.1.4
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/build/index.js +4 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -262,6 +262,9 @@
|
|
|
262
262
|
}
|
|
263
263
|
const type = typeof value;
|
|
264
264
|
if (type === "object") {
|
|
265
|
+
if (value.constructor === undefined) {
|
|
266
|
+
return type;
|
|
267
|
+
}
|
|
265
268
|
const constructor = value.constructor.name;
|
|
266
269
|
if (constructor === "Object") {
|
|
267
270
|
return type;
|
|
@@ -707,7 +710,7 @@
|
|
|
707
710
|
return output;
|
|
708
711
|
}
|
|
709
712
|
convert(value, pass) {
|
|
710
|
-
pass.assert(typeof value === "object", `Unable to convert ${ObjectSchema.getType(value)} to object.`);
|
|
713
|
+
pass.assert(typeof value === "object" && value !== null, `Unable to convert ${ObjectSchema.getType(value)} to object.`);
|
|
711
714
|
const model = {};
|
|
712
715
|
for (const key in this.subschema) {
|
|
713
716
|
const nestedSchema = this.subschema[key];
|