Socket
Socket
Sign inDemoInstall

loopback-ds-computed-mixin

Package Overview
Dependencies
3
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

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": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc