mesqueeb / copy-anything

An optimised way to copy'ing (cloning) an Object or Array. A small and simple integration

Home Page:https://npmjs.com/copy-anything

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feat Request] would be great to have exclude keys option

ShravanSunder opened this issue · comments

props in Option is great. However it would be great to have an exclude keys option as well.

That way we can exclude certain keys.

Thanks! I offloaded that logic into a separate utility.

Try this:

import { copy } from 'copy-anything'
import { omit } from 'filter-anything'

const copied = omit(copy({ a: 1, b: 2}), ['b'])
// { a: 1 }