@iyio/common
Advanced tools
Comparing version 0.5.3 to 0.5.10
@@ -39,1 +39,2 @@ export declare const aryRemoveItem: <T>(ary: T[], item: T) => boolean; | ||
export declare const aryUnshiftUniqueMany: <T>(ary: T[] | null | undefined, values: T[]) => number; | ||
export declare const aryUnique: <T>(ary: T[]) => T[]; |
@@ -252,2 +252,12 @@ export const aryRemoveItem = (ary, item) => { | ||
}; | ||
export const aryUnique = (ary) => { | ||
const unique = []; | ||
for (let i = 0; i < ary.length; i++) { | ||
const item = ary[i]; | ||
if (!unique.includes(item)) { | ||
unique.push(item); | ||
} | ||
} | ||
return unique; | ||
}; | ||
//# sourceMappingURL=array.js.map |
{ | ||
"name": "@iyio/common", | ||
"version": "0.5.3", | ||
"version": "0.5.10", | ||
"sideEffects": false, | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -39,1 +39,2 @@ export declare const aryRemoveItem: <T>(ary: T[], item: T) => boolean; | ||
export declare const aryUnshiftUniqueMany: <T>(ary: T[] | null | undefined, values: T[]) => number; | ||
export declare const aryUnique: <T>(ary: T[]) => T[]; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.aryUnshiftUniqueMany = exports.aryUnshiftUnique = exports.aryPushUniqueMany = exports.aryPushUnique = exports.aryShallowUnorderedCompare = exports.aryMoveItems = exports.uint32ArrayToNumberArray = exports.arySingle = exports.aryRandomValueOrUndefined = exports.aryRandomValue = exports.aryRandomize = exports.aryReverseOrderByStr = exports.aryReverseOrderBy = exports.aryOrderByStr = exports.aryOrderBy = exports.aryReverseOrderByNumbers = exports.aryOrderByNumbers = exports.sortNumbersReverseCallback = exports.sortNumbersCallback = exports.aryReverseOrderByStrings = exports.aryOrderByStrings = exports.sortStringsReverseCallback = exports.sortStringsCallback = exports.arySum = exports.aryCount = exports.asArrayItem = exports.asArray = exports.aryDuplicateRemoveItem = exports.aryRemoveAll = exports.aryRemoveFirst = exports.aryRemoveWhere = exports.aryRemoveItem = void 0; | ||
exports.aryUnique = exports.aryUnshiftUniqueMany = exports.aryUnshiftUnique = exports.aryPushUniqueMany = exports.aryPushUnique = exports.aryShallowUnorderedCompare = exports.aryMoveItems = exports.uint32ArrayToNumberArray = exports.arySingle = exports.aryRandomValueOrUndefined = exports.aryRandomValue = exports.aryRandomize = exports.aryReverseOrderByStr = exports.aryReverseOrderBy = exports.aryOrderByStr = exports.aryOrderBy = exports.aryReverseOrderByNumbers = exports.aryOrderByNumbers = exports.sortNumbersReverseCallback = exports.sortNumbersCallback = exports.aryReverseOrderByStrings = exports.aryOrderByStrings = exports.sortStringsReverseCallback = exports.sortStringsCallback = exports.arySum = exports.aryCount = exports.asArrayItem = exports.asArray = exports.aryDuplicateRemoveItem = exports.aryRemoveAll = exports.aryRemoveFirst = exports.aryRemoveWhere = exports.aryRemoveItem = void 0; | ||
const aryRemoveItem = (ary, item) => { | ||
@@ -287,2 +287,13 @@ if (!ary) { | ||
exports.aryUnshiftUniqueMany = aryUnshiftUniqueMany; | ||
const aryUnique = (ary) => { | ||
const unique = []; | ||
for (let i = 0; i < ary.length; i++) { | ||
const item = ary[i]; | ||
if (!unique.includes(item)) { | ||
unique.push(item); | ||
} | ||
} | ||
return unique; | ||
}; | ||
exports.aryUnique = aryUnique; | ||
//# sourceMappingURL=array.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2137653
34776