@jswork/next-filter-map

1.2.3 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i @jswork/next-filter-map

Homepage

js.work

Weekly Downloads

84

Version

1.2.3

License

MIT

Unpacked Size

5.25 kB

Total Files

6

Last publish

Collaborators

  • afeiship