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

collect.js

Package Overview
Dependencies
Maintainers
1
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

collect.js - npm Package Compare versions

Comparing version 3.0.11 to 3.0.12

2

package.json
{
"name": "collect.js",
"version": "3.0.11",
"version": "3.0.12",
"description": "Convenient and dependency free wrapper for working with arrays and objects.",

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

@@ -729,3 +729,7 @@ 'use strict';

if (fn === undefined) {
collection.sort();
if (this.every(item => typeof item === 'number')) {
collection.sort((a, b) => a - b);
} else {
collection.sort();
}
} else {

@@ -732,0 +736,0 @@ collection.sort(fn);

@@ -1364,8 +1364,8 @@ 'use strict';

it('should sort the collection', function () {
const collection = collect([5, 3, 1, 2, 4]);
const collection = collect([5, 3, 1, 2, 10, 4]);
const sorted = collection.sort();
expect(sorted.all()).to.eql([1, 2, 3, 4, 5]);
expect(collection.all()).to.eql([5, 3, 1, 2, 4]);
expect(sorted.all()).to.eql([1, 2, 3, 4, 5, 10]);
expect(collection.all()).to.eql([5, 3, 1, 2, 10, 4]);

@@ -1372,0 +1372,0 @@ const collection2 = collect([5, 3, 1, 2, 4]);

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