New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

array-sorter

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-sorter - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

6

lib/index.js

@@ -7,5 +7,6 @@ module.exports = (array, locales, localeOptions) => {

let subLevelFunctions;
let numberOfOperations = 0;
const sortObjectArray = (itemA, itemB) => {
for (let i = 0; i < sortOperations.length; i++) {
for (let i = 0; i < numberOfOperations; i++) {
let { valueRetriever, valueComparer, sortAscending } = sortOperations[i];

@@ -25,3 +26,3 @@ let valA = sortAscending ? valueRetriever(itemA) : valueRetriever(itemB);

if (typeof valA === 'string' || typeof valB === 'string') {
equality = valA.localeCompare(valB, sortLocales, sortLocaleOptions);
equality = ('' + valA).localeCompare(('' + valB), sortLocales, sortLocaleOptions);
}

@@ -41,2 +42,3 @@ else {

if (data === null || data === undefined || !Array.isArray(data)) return;
numberOfOperations = sortOperations.length;
data.sort(sortObjectArray);

@@ -43,0 +45,0 @@ };

{
"name": "array-sorter",
"version": "0.0.2",
"version": "0.0.3",
"description": "Sort an array of objects by one or more properties in any order. Multiple properties and custom comparison functions can be used.",

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

@@ -12,3 +12,3 @@ # array-sorter

```bash
$ npm install array-sorter --save
$ npm i array-sorter
```

@@ -15,0 +15,0 @@

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