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

ampersand-collection

Package Overview
Dependencies
Maintainers
3
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ampersand-collection - npm Package Compare versions

Comparing version 1.3.11 to 1.3.12

2

ampersand-collection.js

@@ -162,3 +162,3 @@ var BackboneEvents = require('backbone-events-standalone');

var index = this._indexes[indexName || this.mainIndex];
return index[query] || index[query.id] || this._indexes.cid[query.cid];
return index[query] || index[query[this.mainIndex]] || this._indexes.cid[query.cid];
},

@@ -165,0 +165,0 @@

{
"name": "ampersand-collection",
"version": "1.3.11",
"version": "1.3.12",
"author": "Henrik Joreteg <henrik@andyet.net>",

@@ -5,0 +5,0 @@ "bugs": {

@@ -264,1 +264,23 @@ var test = require('tape');

});
test('Bug 14. Should prevent duplicate items when using non-standard idAttribute', function (t) {
var Model = State.extend({
idAttribute: '_id',
props: {
_id: 'string'
}
});
var C = Collection.extend({
mainIndex: '_id',
model: Model
});
var c = new C([{_id: '2'}, {_id: '2'}, {_id: '2'}]);
t.equal(c.length, 1, 'should still be 1');
c.add({_id: '2'});
t.equal(c.length, 1, 'should still be 1 if added later');
c.add(new Model({_id: '2'}));
t.equal(c.length, 1, 'should still be 1 if added as an instantiated model');
t.end();
});
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