Skip to content

Commit 03d9c3a

Browse files
Merge pull request #23 from scup/build_fix
building the lib
2 parents 1c06e64 + 57588e1 commit 03d9c3a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/Speck.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ var Speck = function () {
7070

7171
newData[field] = (0, _lodash.isNil)(data[field]) ? this.schema[field].defaultValue : data[field];
7272

73-
if (this.schema[field].type) {
73+
if (this.schema[field].type || this.schema[field].builder) {
7474
newData[field] = this.applyEntityConstructor(this.schema[field], newData[field]);
7575
}
7676

@@ -141,7 +141,7 @@ var Speck = function () {
141141
value: function applyEntityConstructor(field, data) {
142142
var Type = field.type;
143143

144-
if (field.builder) {
144+
if ((0, _lodash.isFunction)(field.builder)) {
145145
return field.builder(data, Type);
146146
}
147147

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "speck-entity",
3-
"version": "0.1.5",
3+
"version": "0.1.6",
44
"description": "Domain entities with reactive validation",
55
"main": "lib/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)