@jswork/filter-keys-deep
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

filter-keys-deep

Filter out specified keys from an object (support deep structure).

version license size download

installation

npm install @jswork/filter-keys-deep

usage

import filterKeysDeep from '@jswork/filter-keys-deep';

const obj = {
  a: 1,
  b: 2,
  items: [
    { name: 'apple', price: 10, is_editing: true },
    { name: 'banana', price: 20, is_editing: false },
  ]
};


const result = filterKeysDeep(obj, ['is_editing']);

console.log(result);
/* expected output:
  {
    a: 1,
    b: 2,
    items: [
      { name: 'apple', price: 10 },
      { name: 'banana', price: 20 }
    ]
  }
*/

license

Code released under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i @jswork/filter-keys-deep

Weekly Downloads

6

Version

1.0.1

License

MIT

Unpacked Size

9.13 kB

Total Files

9

Last publish

Collaborators

  • afeiship