ampersand-state
Advanced tools
Comparing version 4.5.3 to 4.5.4
@@ -351,3 +351,3 @@ /*$AMPERSAND_VERSION*/ | ||
var dataType = this._dataTypes[type]; | ||
return dataType && dataType.default; | ||
return dataType && dataType['default']; | ||
}, | ||
@@ -535,3 +535,3 @@ | ||
required: descArray[1], | ||
default: descArray[2] | ||
'default': descArray[2] | ||
}; | ||
@@ -545,10 +545,11 @@ } | ||
if (desc.default && typeof desc.default === 'object') { | ||
if (desc['default'] && typeof desc['default'] === 'object') { | ||
throw new TypeError('The default value for ' + name + ' cannot be an object/array, must be a value or a function which returns a value/object/array'); | ||
} | ||
def.default = desc.default; | ||
def['default'] = desc['default']; | ||
def.allowNull = desc.allowNull ? desc.allowNull : false; | ||
if (desc.setOnce) def.setOnce = true; | ||
if (def.required && isUndefined(def.default) && !def.setOnce) def.default = object._getDefaultForType(type); | ||
if (def.required && isUndefined(def['default']) && !def.setOnce) def['default'] = object._getDefaultForType(type); | ||
def.test = desc.test; | ||
@@ -609,3 +610,3 @@ def.values = desc.values; | ||
string: { | ||
default: function () { | ||
'default': function () { | ||
return ''; | ||
@@ -646,3 +647,3 @@ } | ||
}, | ||
default: function () { | ||
'default': function () { | ||
return new Date(); | ||
@@ -658,3 +659,3 @@ } | ||
}, | ||
default: function () { | ||
'default': function () { | ||
return []; | ||
@@ -678,3 +679,3 @@ } | ||
}, | ||
default: function () { | ||
'default': function () { | ||
return {}; | ||
@@ -681,0 +682,0 @@ } |
{ | ||
"name": "ampersand-state", | ||
"description": "An observable, extensible state object with derived watchable properties.", | ||
"version": "4.5.3", | ||
"version": "4.5.4", | ||
"author": "Henrik Joreteg <henrik@andyet.net>", | ||
@@ -6,0 +6,0 @@ "files": [ |
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
57250