1.2.3 • Published 12 months ago

@jswork/next-filter-map v1.2.3

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

next-filter-map

Filter after map for next use reduce.

version license size download

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.