loopback-ds-computed-mixin
Advanced tools
Comparing version 1.0.2 to 1.0.3
14
index.js
@@ -10,17 +10,9 @@ var debug = require('debug')('loopback-ds-computed-mixin'); | ||
_.mapKeys(options.properties, function(callback, property) { | ||
var removeProperty = false; | ||
if (_.isUndefined(Model.definition.properties[property])) { | ||
console.warn('Property %s on %s is undefined', property, Model.modelName); | ||
removeProperty = true; | ||
debug('Property %s on %s is undefined', property, Model.modelName); | ||
} | ||
if (typeof Model[callback] !== 'function') { | ||
console.warn('Callback %s for %s is not a model function', callback, property); | ||
removeProperty = true; | ||
debug('Callback %s for %s is not a model function', callback, property); | ||
} | ||
if (removeProperty) { | ||
debug('Remove computed property %s for %s ', property, Model.modelName); | ||
delete options.properties[property]; | ||
} | ||
}); | ||
@@ -41,3 +33,3 @@ | ||
if (typeof Model[callback] !== 'function') { | ||
console.warn('Function %s not found on Model', callback); | ||
debug('Function %s not found on Model', callback); | ||
return false; | ||
@@ -44,0 +36,0 @@ } |
{ | ||
"name": "loopback-ds-computed-mixin", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A mixin for the LoopBack framework that adds computed properties to a model.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
7239
133
1