Huge News!Announcing our $40M Series B led by Abstract Ventures.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.24 to 0.2.25

27

lib/model.js

@@ -5,3 +5,4 @@ // Generated by CoffeeScript 1.8.0

__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
__slice = [].slice;

@@ -23,2 +24,26 @@ Property = require('./model/property');

Model.hasOne = function(name, type, options) {
if (options == null) {
options = {};
}
this.properties = this.properties || new Object;
options.key || (options.key = "_id");
this.properties[name] = 0;
return this.properties[name] = new Property(this, name, (function() {
var args;
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
return (function(func, args, ctor) {
ctor.prototype = func.prototype;
var child = new ctor, result = func.apply(child, args);
return Object(result) === result ? result : child;
})(type, args, function(){});
}), {
save: function(m) {
return (typeof m.get === "function" ? m.get(options.key) : void 0) || m;
}
});
};
Model.hasMany = function() {};
Model.validation = function(name, options) {

@@ -25,0 +50,0 @@ this.validations = this.validations || new Object;

2

lib/model/property.js

@@ -42,3 +42,3 @@ // Generated by CoffeeScript 1.8.0

} else if (value.constructor !== this.type) {
value = this.type.prototype && !isPrimitive(this.type) ? new this.type(value) : this.type(value);
value = this.type(value);
}

@@ -45,0 +45,0 @@ return value;

{
"name": "diamond.js",
"description": "Generic MVC web framework",
"version": "0.2.24",
"version": "0.2.25",
"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