Comparing version 1.0.0-alpha.10 to 1.0.0-alpha.11
@@ -0,1 +1,5 @@ | ||
# 1.0.0-alpha.11 | ||
* [FIX] test defaultValue for undefined, not truthiness | ||
# 1.0.0-alpha.10 | ||
@@ -2,0 +6,0 @@ |
@@ -374,3 +374,3 @@ "use strict"; | ||
if (!(typeof (attr.type.validate) === 'function')) return [3 /*break*/, 5]; | ||
if (_.isNil(value) && attr.defaultValue) { | ||
if (_.isNil(value) && typeof (attr.defaultValue) !== 'undefined') { | ||
value = association_1.isLazyLoad(attr.defaultValue) ? | ||
@@ -377,0 +377,0 @@ attr.defaultValue() : |
{ | ||
"name": "modelsafe", | ||
"version": "1.0.0-alpha.10", | ||
"version": "1.0.0-alpha.11", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "bugs": "https://github.com/creativecuriositystudio/modelsafe/issues", |
@@ -345,3 +345,3 @@ /** Contains the model classes and decorators. */ | ||
if (typeof (attr.type.validate) === 'function') { | ||
if (_.isNil(value) && attr.defaultValue) { | ||
if (_.isNil(value) && typeof (attr.defaultValue) !== 'undefined') { | ||
value = isLazyLoad(attr.defaultValue) ? | ||
@@ -348,0 +348,0 @@ (attr.defaultValue as () => ModelConstructor<any>)() : |
Sorry, the diff of this file is not supported yet
343485