Function filterMap

Performs [].map() and [].filter() (in that order) on an array with a single iteration.

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']`