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.4.0 to 1.4.1

3

ampersand-collection.js
var BackboneEvents = require('backbone-events-standalone');
var classExtend = require('ampersand-class-extend');
var isArray = require('is-array');
var bind = require('amp-bind');
var extend = require('extend-object');

@@ -240,3 +241,3 @@ var slice = [].slice;

} else {
this.models.sort(this.comparator.bind(this));
this.models.sort(bind(this.comparator,this));
}

@@ -243,0 +244,0 @@

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

@@ -9,2 +9,3 @@ "bugs": {

"dependencies": {
"amp-bind": "^1.0.1",
"ampersand-class-extend": "^1.0.0",

@@ -11,0 +12,0 @@ "backbone-events-standalone": "0.2.2",

@@ -168,2 +168,18 @@ var test = require('tape');

test('comparator as 2 arg has ref to "this"', function(t){
var boundCollection;
var Coll = Collection.extend({
comparator: function (m1, m2) {
boundCollection = this;
return 0;
}
});
var c = new Coll();
var moe = new Stooge({name: 'moe', id: '1'});
var larry = new Stooge({name: 'larry', id: '2'});
c.add([moe, larry]);
t.equal(c,boundCollection);
t.end();
});
test('should store reference to parent instance if passed', function (t) {

@@ -170,0 +186,0 @@ var parent = {};

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