corebasic 1.0.162 → 1.0.163

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/libs/utils.js +9 -0
  2. package/package.json +1 -1
package/libs/utils.js CHANGED
@@ -38,6 +38,15 @@ export function isEmptyJson(json) {
38
38
  return true
39
39
  }
40
40
 
41
+ export function uniqueObjects(array, key) {
42
+ // remove duplicates from array of objects with key
43
+ return [
44
+ ...new Map(
45
+ array.map(item => [item[key], item])
46
+ ).values()
47
+ ]
48
+ }
49
+
41
50
  // --------------
42
51
  // Parse Numbers
43
52
  // --------------
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "corebasic",
3
3
  "type": "module",
4
- "version": "1.0.162",
4
+ "version": "1.0.163",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "scripts": {