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

array-tools

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-tools - npm Package Compare versions

Comparing version 1.4.4 to 1.4.5

17

lib/array-tools.js

@@ -423,5 +423,16 @@ "use strict";

return function tryIt(a, b){
var x = a[property] || null;
var y = b[property] || null;
var result = x < y ? -1 : x > y ? 1 : 0;
var result;
var x = a[property];
var y = b[property];
if (typeof x === "undefined" && typeof y !== "undefined"){
result = -1;
} else if (typeof x !== "undefined" && typeof y === "undefined"){
result = 1;
} else if (typeof x === "undefined" && typeof y === "undefined"){
result = 0;
} else {
var result = x < y ? -1 : x > y ? 1 : 0;
}
if (result === 0){

@@ -428,0 +439,0 @@ if (props.length){

2

package.json
{
"name": "array-tools",
"author": "Lloyd Brookes <75pound@gmail.com>",
"version": "1.4.4",
"version": "1.4.5",
"description": "Useful functions for working with arrays",

@@ -6,0 +6,0 @@ "repository": "https://github.com/75lb/array-tools.git",

@@ -37,1 +37,8 @@ var test = require("tape");

});
test("sortBy, with undefined vals 2", function(t){
var fixture = [ { a: "yeah" }, { }, { a: "what" } ];
var expected = [ { }, { a: "what" }, { a: "yeah" } ];
t.deepEqual(a.sortBy(fixture, "a"), expected);
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