Performs [].map() and [].filter() (in that order) on an array with a single iteration.
[].map()
[].filter()
import {filterMap} from '@augment-vir/common';const result = filterMap( [ 'a', 'b', '', ], // map callback (value) => { return `value-${value}`; }, // filter callback (mappedValue, originalValue) => { return !!originalValue; },);// result is `['value-a', 'value-b']` Copy
import {filterMap} from '@augment-vir/common';const result = filterMap( [ 'a', 'b', '', ], // map callback (value) => { return `value-${value}`; }, // filter callback (mappedValue, originalValue) => { return !!originalValue; },);// result is `['value-a', 'value-b']`
@augment-vir/common
Performs filterMap with a type guard filter.
filterMap
Performs a regular filterMap.
Performs
[].map()
and[].filter()
(in that order) on an array with a single iteration.Example
Package
@augment-vir/common