quanstructor
Advanced tools
Comparing version 0.4.0 to 0.4.1
{ | ||
"name": "quanstructor", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Exceptionally powerful object model builder for complex architectures", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -157,3 +157,3 @@ let { defined } = require('./lib/Statics') | ||
else { | ||
let value = obj[attrib] || ( self.specs[ attrib ].hasOwnProperty('default') ? self.assigner.cloneObject( self.specs[ attrib ].default ) : v.defaultValue( self.specs[ attrib ].validation ) ) | ||
let value = obj[attrib] || ( self.specs[ attrib ].hasOwnProperty('default') ? (_.isFunction( self.specs[ attrib ].default ) ? self.specs[ attrib ].default() : self.assigner.cloneObject( self.specs[ attrib ].default )) : v.defaultValue( self.specs[ attrib ].validation ) ) | ||
if ( self.specs[ attrib ]._allowNull || defined(value) ) | ||
@@ -206,3 +206,3 @@ res[ attrib ] = value | ||
for (let attrib of this.views[ space ] ) { | ||
let value = this.specs[ attrib ].hasOwnProperty('default') ? this.specs[ attrib ].default : v.defaultValue( this.specs[ attrib ].validation ) | ||
let value = this.specs[ attrib ].hasOwnProperty('default') ? (_.isFunction(this.specs[ attrib ].default) ? this.specs[ attrib ].default() : this.specs[ attrib ].default) : v.defaultValue( this.specs[ attrib ].validation ) | ||
if ( this.specs[ attrib ].Quanstructor ) { | ||
@@ -209,0 +209,0 @@ res[ attrib ] = _.isArray( value ) |
@@ -38,3 +38,3 @@ const Quastructor = require( '../Quanstructor' ) | ||
let Absoluter = Quastructor.newQuanstructor( 'Person', { | ||
passportID: { spaces: [ 'database', 'secret' ], validation: REQUIRED }, | ||
passportID: { default: () => { return Date.now() + '?' }, spaces: [ 'database', 'secret' ], validation: REQUIRED }, | ||
address: { space: SPACE_SUPP, default: { street: '', county: '', country: '', postal: '' }, validation: { | ||
@@ -41,0 +41,0 @@ street: REQUIRED, county: REQUIRED, country: REQUIRED, postal: REQUIRED |
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
18677