Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

linen

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

linen - npm Package Compare versions

Comparing version 0.3.21 to 0.3.23

test/transport/ref-test.js

55

lib/field/controllers/dataMapper/decor/collections/model.js

@@ -72,2 +72,57 @@ // Generated by CoffeeScript 1.6.2

ModelCollection.prototype.reset = function(src) {
var esrc, existingItem, found, i, item, newItem, src2, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _results;
src2 = src.concat();
esrc = this.source().concat();
for (_i = 0, _len = esrc.length; _i < _len; _i++) {
existingItem = esrc[_i];
for (i = _j = 0, _len1 = src.length; _j < _len1; i = ++_j) {
newItem = src[i];
if (this._compare(existingItem, newItem)) {
if (this.field.options.ref) {
existingItem.set(newItem);
src.splice(i, 1);
}
break;
}
}
}
for (i = _k = 0, _len2 = esrc.length; _k < _len2; i = ++_k) {
existingItem = esrc[i];
found = false;
for (_l = 0, _len3 = src2.length; _l < _len3; _l++) {
newItem = src2[_l];
if (this._compare(existingItem, newItem)) {
found = true;
break;
}
}
if (!found) {
this.splice(i, 1);
}
}
_results = [];
for (_m = 0, _len4 = src.length; _m < _len4; _m++) {
item = src[_m];
_results.push(this.push(item));
}
return _results;
};
/*
*/
ModelCollection.prototype._compare = function(a, b) {
var aid;
aid = a.get("_id");
return (aid === b._id) || (aid === b);
};
/*
*/
ModelCollection.prototype._onInsert = function(model) {

@@ -74,0 +129,0 @@ var _this = this;

2

lib/field/controllers/dataMapper/decor/refCollection.js

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

}
c = new ModelCollection(this, model);
c = model.get(this.field.path) || new ModelCollection(this, model);
c.reset(toarray(source));

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

@@ -68,2 +68,5 @@ // Generated by CoffeeScript 1.6.2

};
model.fetch = function(next) {
return _this.load(model, next);
};
model.reload = function(next) {

@@ -70,0 +73,0 @@ return _this.reload(model, next);

{
"name": "linen",
"version": "0.3.21",
"version": "0.3.23",
"description": "Linen (line-in) maps API's to [bindable](/classdojo/bindable.js) `objects`, and `collections`. At [classdojo](http://classdojo.com), we use `linen` to abstract our API from front-end, so we don't necessarily depend on any sort of API while developing new components. This allows us to rapidly build prototypes which can be wired up later.",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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