@loadmill/universal
Advanced tools
Comparing version 0.3.4 to 0.3.5
@@ -7,1 +7,2 @@ export declare function deleteOne(arr: any[], index: number): void; | ||
export declare const arrayify: (something: any) => any[]; | ||
export declare function uniqByKeepLast(arr: any[], cmp: any): any[]; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var reverse_1 = __importDefault(require("lodash/reverse")); | ||
var uniqBy_1 = __importDefault(require("lodash/uniqBy")); | ||
function deleteOne(arr, index) { | ||
@@ -31,2 +36,6 @@ if (index > -1) { | ||
exports.arrayify = function (something) { return Array.isArray(something) ? something : [something]; }; | ||
function uniqByKeepLast(arr, cmp) { | ||
return reverse_1.default(uniqBy_1.default(reverse_1.default(arr), cmp)); | ||
} | ||
exports.uniqByKeepLast = uniqByKeepLast; | ||
//# sourceMappingURL=array-utils.js.map |
@@ -6,2 +6,2 @@ export declare function stripSingleton(singleton: any, defaultValue?: any): any; | ||
}[]; | ||
export declare function firstKeyComparator(o1: any, o2: any): 1 | -1 | 0; | ||
export declare function firstKeyComparator(o1: any, o2: any): 1 | 0 | -1; |
{ | ||
"name": "@loadmill/universal", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"description": "Loadmill universal utilities", | ||
@@ -5,0 +5,0 @@ "main": "dist/", |
@@ -0,1 +1,4 @@ | ||
import reverse from 'lodash/reverse'; | ||
import uniqBy from 'lodash/uniqBy'; | ||
export function deleteOne(arr: any[], index: number) { | ||
@@ -27,1 +30,5 @@ if (index > -1) { | ||
export const arrayify = (something: any) => Array.isArray(something) ? something : [something]; | ||
export function uniqByKeepLast(arr: any[], cmp) { | ||
return reverse(uniqBy(reverse(arr), cmp)); | ||
} |
Sorry, the diff of this file is not supported yet
96727
1934