🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More
Socket
Book a DemoSign in
Socket

object-array-utils

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-array-utils - npm Package Compare versions

Comparing version
2.9.0
to
2.10.0
+1
-1
package.json
{
"name": "object-array-utils",
"version": "2.9.0",
"version": "2.10.0",
"description": "Utilities for working with arrays and objects",

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

@@ -455,2 +455,6 @@ function isNullOrUndefined(v) {

function sortProperties(o) {
return Object.fromEntries(Object.entries(o).sort(([k1], [k2]) => k1 < k2 ? -1 : 1));
}
export {

@@ -483,3 +487,4 @@ areArraysEqual,

removeArrayElements,
sortProperties,
takeProperties
}

@@ -19,2 +19,3 @@ import {

removeArrayElements,
sortProperties,
takeProperties

@@ -219,1 +220,7 @@ } from './index';

});
test('sortProperties', () => {
expect(Object.keys({ b: 2, a: 1, c: 3 })).toEqual(['b', 'a', 'c']);
expect(Object.keys({ b: 2, a: 1, c: 3 })).not.toEqual(['a', 'b', 'c']);
expect(Object.keys(sortProperties({ b: 2, a: 1, c: 3 }))).toEqual(['a', 'b', 'c']);
});