1.0.0 • Published 1 year ago

@patomation/omit-deep v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
1 year ago

Omit Deep

A utility to clone an object without certain keys This is great to lazily send data back to a graphql server without having to worry about the __typename having to be in your input.

Usage

import { omitDeep } from '@patomation/omit-deep'

const before = {
  __typename: 'remove',
  keep: 'me',
  deep: {
    __typename: 'remove',
    keep: 'this one'
  }
}
// Remove __typename key
const after = omitDeep(before, '__typename')
// After = 
// {
//   keep: 'me',
//   deep: {
//     keep: 'this one'
//   }
// }

Only the key you specify is removed.

Install

npm i @patomation/omit-deep

Test

npm run test

supports naming convention: moduleName.test.ts Check out ava

1.0.0

1 year ago

0.0.1

3 years ago

0.0.0

3 years ago