- filterMap<ElementType, MappedEntry, TypeGuarded>(
inputArray: readonly ElementType[],
mapCallback: (
entry: ElementType,
index: number,
originalArray: readonly ElementType[],
) => MappedEntry,
filterCallback: (
mappedOutput: MappedEntry,
originalEntry: ElementType,
index: number,
originalArray: readonly ElementType[],
) => mappedOutput is TypeGuarded,
): TypeGuarded[] Type Parameters
- ElementType
- MappedEntry
- TypeGuarded
- filterMap<ElementType, MappedEntry>(
inputArray: readonly ElementType[],
mapCallback: (
entry: ElementType,
index: number,
originalArray: readonly ElementType[],
) => MappedEntry,
filterCallback: (
mappedOutput: MappedEntry,
originalEntry: ElementType,
index: number,
originalArray: readonly ElementType[],
) => boolean,
): MappedEntry[]
Performs
[].map()
and[].filter()
(in that order) on an array with a single iteration.Example
Package
@augment-vir/common