schema-llama
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -38,5 +38,15 @@ 'use strict'; | ||
for (const key of propKeys) { | ||
if (this[key] == null) { | ||
object[key] = null; | ||
continue; | ||
} | ||
if (this[key] == undefined) { | ||
continue; | ||
} | ||
if (this[key].toJSON === Function) { | ||
object[key] = this[key].toJSON(); | ||
} else if (this[key].constructor === Array) { | ||
} else if (this[key] && this[key].constructor === Array) { | ||
object[key] = this[key].map(toJSONHelper); | ||
@@ -43,0 +53,0 @@ } else { |
{ | ||
"name": "schema-llama", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "A more purely javascript es6 class generator. Takes the work out of validation, type checking, and more.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -30,5 +30,15 @@ import { TypeError, ValidationError, Error } from './errors'; | ||
for(const key of propKeys) { | ||
if(this[key] == null) { | ||
object[key] = null; | ||
continue; | ||
} | ||
if(this[key] == undefined) { | ||
continue; | ||
} | ||
if(this[key].toJSON === Function) { | ||
object[key] = this[key].toJSON(); | ||
} else if(this[key].constructor === Array) { | ||
} else if(this[key] && this[key].constructor === Array) { | ||
object[key] = this[key].map(toJSONHelper); | ||
@@ -35,0 +45,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24581
457