beyo-model-validation
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -52,3 +52,3 @@ | ||
modelDef.prototype.validate = { | ||
Object.defineProperty(modelDef.constructor.prototype, 'validate', { | ||
enumerable: true, | ||
@@ -60,3 +60,3 @@ configurable: false, | ||
} | ||
}; | ||
}); | ||
}); | ||
@@ -63,0 +63,0 @@ |
@@ -36,3 +36,2 @@ /* | ||
var searchCallback = optUtil.getFunction(options, 'searchCallback', defaultSearchCallback(model)); | ||
var mapper = model.__proto__.mapper; | ||
var filter; | ||
@@ -64,8 +63,11 @@ var otherModel; | ||
return function * searchCallback(filter) { | ||
var mapper = model.__proto__.mapper; | ||
var mapper = model.__proto__._mapper; | ||
var found; | ||
if (mapper && mapper.find) { | ||
return yield mapper.find(filter); | ||
found = yield mapper.find(filter); | ||
return found; | ||
} | ||
}; | ||
} |
{ | ||
"name": "beyo-model-validation", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Data validation for beyo models", | ||
@@ -35,5 +35,5 @@ "author": "Yanick Rochon <yanick.rochon@gmail.com>", | ||
"mocha": "^1.18.2", | ||
"co-mocha": "0.0.2" | ||
"co-mocha": "0.0.4" | ||
}, | ||
"license": "MIT" | ||
} |
@@ -34,6 +34,4 @@ | ||
before(function () { | ||
Model.once('define', function (options) { | ||
options.prototype.mapper = { | ||
value: dummyMapper() | ||
}; | ||
Model.once('define', function (e) { | ||
e.constructor.mapper = e.constructor.prototype._mapper = dummyMapper(); | ||
}); | ||
@@ -47,6 +45,4 @@ | ||
Model.once('define', function (options) { | ||
options.prototype.mapper = { | ||
value: dummyMapper({ knownValues: [ 2 ] }) | ||
}; | ||
Model.once('define', function (e) { | ||
e.constructor.mapper = e.constructor.prototype._mapper = dummyMapper({ knownValues: [ 2 ] }); | ||
}); | ||
@@ -53,0 +49,0 @@ |
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
88395
1918