New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

diamond.js

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

diamond.js - npm Package Compare versions

Comparing version 0.2.5 to 0.2.6

16

lib/model.js

@@ -37,3 +37,4 @@ // Generated by CoffeeScript 1.7.1

this.properties = new Object;
this.name = this.constructor.name;
this.collection = this.constructor.collection || this.constructor.name.toLowerCase();
this.hasError = false;
_ref = this.constructor.properties;

@@ -67,7 +68,8 @@ for (k in _ref) {

Model.prototype.validate = function(options) {
var error, errors, k, v, _ref;
var error, k, v, _ref;
if (options == null) {
options = {};
}
errors = {};
this.hasError = false;
this.errors = new Object;
_ref = this.constructor.validations;

@@ -78,6 +80,10 @@ for (k in _ref) {

if (error) {
errors[k] = error;
this.hasError = true;
}
if (error) {
this.errors[k] = error;
}
}
return errors;
this.errors = this.hasError ? this.errors : null;
return this.errors;
};

@@ -84,0 +90,0 @@

@@ -27,7 +27,15 @@ // Generated by CoffeeScript 1.7.1

Storage.prototype.save = function(callback) {
return Diamond.getInstance().db.save(this, callback);
if (!this.hasError) {
return Diamond.getInstance().db.save(this, callback);
} else {
return callback(this.errors);
}
};
Storage.prototype.update = function(options, callback) {
return Diamond.getInstance().db.update(this, options, this.oroperties, callback);
if (!this.hasError) {
return Diamond.getInstance().db.update(this, options, this.properties, callback);
} else {
return callback(this.errors);
}
};

@@ -34,0 +42,0 @@

{
"name": "diamond.js",
"description": "MVC web framework",
"version": "0.2.5",
"version": "0.2.6",
"author": {

@@ -6,0 +6,0 @@ "name": "Arthur Xavier",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc