object-array-utils
Advanced tools
+1
-1
| { | ||
| "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": { |
+5
-0
@@ -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']); | ||
| }); |
38273
1.15%568
1.79%