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

ampersand-collection

Package Overview
Dependencies
Maintainers
4
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.16 to 1.3.17

2

ampersand-collection.js

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

} else {
id = attrs[targetProto.idAttribute || 'id'];
id = attrs[targetProto.idAttribute || this.mainIndex];
}

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

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

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

@@ -325,3 +325,3 @@ # ampersand-collection

Unlike a backbone collection it does not include underscore and all the array methods from underscore, though if you wish more functions than those built into modern browsers, you can mixin [ampersand-collection-underscore-mixin](#ampersand-collection-underscore-mixin) to get them.
Unlike a backbone collection it does not include underscore and all the array methods from underscore, though if you wish more functions than those built into modern browsers, you can mixin [ampersand-collection-underscore-mixin](https://github.com/AmpersandJS/ampersand-collection-underscore-mixin) to get them.

@@ -328,0 +328,0 @@ ```javascript

@@ -287,2 +287,14 @@ var test = require('tape');

test('Should prevent duplicate items when using non-standard mainIndex without model', function (t) {
var C = Collection.extend({
mainIndex: '_id'
});
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');
t.end();
});
test('Bug 20. Should prevent duplicate items when using non-standard idAttribute', function (t) {

@@ -289,0 +301,0 @@ var data = [{_id: '2'}];

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