@xylabs/array
v5.0.65
Published
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Readme
@xylabs/array
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Reference
@xylabs/array
Functions
functions
containsAll
function containsAll<T>(source, target): boolean;Type Parameters
T
T
Parameters
source
T[]
target
T[]
Returns
boolean
distinct
function distinct<T>(
value,
index,
array): boolean;Type Parameters
T
T
Parameters
value
T
index
number
array
T[]
Returns
boolean
filterAs
function filterAs<In, Out>(x, predicate): NonNullable<Out>[];Type Parameters
In
In
Out
Out
Parameters
x
In[]
predicate
(a) => Out
Returns
NonNullable<Out>[]
filterAsync
function filterAsync<T>(array, predicate): Promise<T[]>;Returns the elements of an array that meet the condition specified in a callback function.
Type Parameters
T
T
Parameters
array
T[]
The array to filter.
predicate
(value, index, array) => Promise<boolean>
A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
Returns
Promise<T[]>
The elements of an array that meet the condition specified in a callback function.
findAs
function findAs<In, Out>(x, predicate): undefined | NonNullable<Out>;Type Parameters
In
In
Out
Out
Parameters
x
In[]
predicate
(a) => Out
Returns
undefined | NonNullable<Out>
findLastAs
function findLastAs<In, Out>(x, predicate): undefined | NonNullable<Out>;Type Parameters
In
In
Out
Out
Parameters
x
In[]
predicate
(a) => Out
Returns
undefined | NonNullable<Out>
flatten
function flatten<T>(a?, b?): T[];Type Parameters
T
T
Parameters
a?
T | ConcatArray<T>
b?
T | ConcatArray<T>
Returns
T[]
uniq
function uniq<T>(arr): T[];Type Parameters
T
T
Parameters
arr
T[]
Returns
T[]
uniqBy
function uniqBy<T, I>(arr, iteratee): T[];Type Parameters
T
T
I
I
Parameters
arr
T[]
iteratee
(item) => I
Returns
T[]
Part of sdk-js
Maintainers
License
See the LICENSE file for license details
