Comparing version 0.1.11 to 0.1.14
@@ -184,5 +184,37 @@ // Generated by CoffeeScript 1.6.2 | ||
Collection.prototype._reset = function(source) { | ||
Collection.prototype._reset = function(src) { | ||
var esrc, existingItem, found, i, item, newItem, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m; | ||
this._ignorePersist = true; | ||
this.source(source); | ||
src = src; | ||
esrc = this.source().concat(); | ||
for (i = _i = 0, _len = esrc.length; _i < _len; i = ++_i) { | ||
existingItem = esrc[i]; | ||
found = false; | ||
for (_j = 0, _len1 = src.length; _j < _len1; _j++) { | ||
newItem = src[_j]; | ||
if (existingItem.get("_id") === newItem._id) { | ||
found = true; | ||
break; | ||
} | ||
} | ||
if (!found) { | ||
this.splice(i, 1); | ||
} | ||
} | ||
for (_k = 0, _len2 = esrc.length; _k < _len2; _k++) { | ||
existingItem = esrc[_k]; | ||
for (i = _l = 0, _len3 = src.length; _l < _len3; i = ++_l) { | ||
newItem = src[i]; | ||
if (existingItem.get("_id") === newItem._id) { | ||
existingItem.set(newItem); | ||
src.splice(i, 1); | ||
break; | ||
} | ||
} | ||
} | ||
for (_m = 0, _len4 = src.length; _m < _len4; _m++) { | ||
item = src[_m]; | ||
this.push(item); | ||
} | ||
return this._ignorePersist = false; | ||
@@ -189,0 +221,0 @@ }; |
@@ -226,2 +226,10 @@ // Generated by CoffeeScript 1.6.2 | ||
Model.prototype.clone = function() { | ||
return this.schema.model(this); | ||
}; | ||
/* | ||
*/ | ||
Model.prototype._bindFields = function() { | ||
@@ -228,0 +236,0 @@ var field, fields, ignoreVirtuals, vfields, _fn, _fn1, _i, _j, _len, _len1, |
{ | ||
"name": "linen", | ||
"version": "0.1.11", | ||
"version": "0.1.14", | ||
"description": "```javascript", | ||
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70949
1664