@hestia-earth/utils
Advanced tools
Comparing version 0.10.3 to 0.10.4
@@ -25,3 +25,6 @@ "use strict"; | ||
exports.isEqual = exports.intersection = exports.unique = void 0; | ||
var unique = function (values) { return __spreadArray([], __read(new Set(values))); }; | ||
var unique = function (values) { | ||
return values.some(function (v) { return typeof v === 'object'; }) ? | ||
__spreadArray([], __read(new Set(values.map(function (v) { return JSON.stringify(v); })))).map(function (v) { return JSON.parse(v); }) : __spreadArray([], __read(new Set(values))); | ||
}; | ||
exports.unique = unique; | ||
@@ -28,0 +31,0 @@ var intersection = function (array1, array2) { return array1.filter(function (x) { return array2.includes(x); }); }; |
{ | ||
"name": "@hestia-earth/utils", | ||
"version": "0.10.3", | ||
"version": "0.10.4", | ||
"description": "Hestia Utils library", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -6,3 +6,6 @@ /** | ||
*/ | ||
export const unique = <T>(values: T[]): T[] => [...new Set(values)]; | ||
export const unique = <T>(values: T[]): T[] => | ||
values.some(v => typeof v === 'object') ? | ||
[...new Set(values.map(v => JSON.stringify(v)))].map(v => JSON.parse(v)) : | ||
[...new Set(values)]; | ||
@@ -9,0 +12,0 @@ /** |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44112
754