blueflag-record
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -41,3 +41,3 @@ "use strict"; | ||
start: { | ||
notSetValue: new Date('2000-01-01'), | ||
notSetValue: '2000-01-01', | ||
get: function get(value) { | ||
@@ -123,3 +123,6 @@ return new Date(value); | ||
}); | ||
it('applies config.get to the value', function () { | ||
it('will not apply getters to toObject', function () { | ||
expect(new DateRecord({}).toObject().start).toBe('2000-01-01'); | ||
}); | ||
it('applies getter to the value', function () { | ||
var date = new DateRecord({ | ||
@@ -130,2 +133,6 @@ start: '2001-01-01' | ||
}); | ||
it('applies getter to the notSetValue', function () { | ||
var date = new DateRecord({}); | ||
expect(date.start).toEqual(new Date('2000-01-01')); | ||
}); | ||
}); | ||
@@ -132,0 +139,0 @@ describe('setters', function () { |
@@ -98,9 +98,3 @@ "use strict"; | ||
get: nonEnumerable(function (key, notFoundValue) { | ||
var value = _this._data[key]; | ||
if (value !== undefined) { | ||
return (keyConfig[key].get || indentity)(value); | ||
} | ||
return notFoundValue || (0, _get.default)(key)(_this._notSetValues); | ||
return getter(key, _this._data[key] || notFoundValue || _this._notSetValues[key]); | ||
}), | ||
@@ -107,0 +101,0 @@ getIn: nonEnumerable(function (path, notFoundValue) { |
{ | ||
"main": "lib/index.js", | ||
"name": "blueflag-record", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "An Unmutable compatible record", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
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
14868
354