Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

appolo-utils

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appolo-utils - npm Package Compare versions

Comparing version 0.0.36 to 0.0.37

17

lib/arrays.js

@@ -75,4 +75,21 @@ "use strict";

}
static uniqBy(arr, criteria) {
let dic = new Map(), out = [];
if (!arr || !arr.length) {
return [];
}
for (let i = 0; i < arr.length; i++) {
let item = arr[i], key = criteria(item, i);
if (!dic.has(key)) {
dic.set(key, 1);
out.push(item);
}
}
return out;
}
static uniq(arr) {
return Arrays.uniqBy(arr, (item) => item);
}
}
exports.Arrays = Arrays;
//# sourceMappingURL=arrays.js.map

@@ -110,2 +110,23 @@ import {Classes} from "./classes";

}
public static uniqBy<T>(arr: T[], criteria: (value: T, i?: number) => any): T[] {
let dic = new Map<any, 1>(), out = [];
if (!arr || !arr.length) {
return []
}
for (let i = 0; i < arr.length; i++) {
let item = arr[i], key = criteria(item, i);
if (!dic.has(key)) {
dic.set(key, 1);
out.push(item)
}
}
return out;
}
public static uniq<T>(arr: T[]): T[] {
return Arrays.uniqBy(arr, (item) => item)
}
}

2

package.json

@@ -17,3 +17,3 @@ {

"main": "./index.js",
"version": "0.0.36",
"version": "0.0.37",
"license": "MIT",

@@ -20,0 +20,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

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