@jswork/next-filter-map
v1.2.3
Published
Filter after map for next use reduce.
Downloads
419
Readme
next-filter-map
Filter after map for next use reduce.
installation
npm install -S @jswork/next-filter-map
usage
import '@jswork/next-filter-map';
const options = [
{ name: 'One', assigned: true },
{ name: 'Two', assigned: false },
{ name: 'Three', assigned: true }
];
const reduced = nx.filterMap(
options,
(item) => {
return [item.assigned, { name: item.name }];
}
);
// [ { name: 'One' }, { name: 'Three' } ]
license
Code released under the MIT license.