包详细信息

just-omit

angus-c152kMIT2.2.0

copy an object but omit the specified keys

object, omit, keys, no-dependencies

自述文件

just-omit

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-omit
yarn add just-omit

Copy an object but omit the specified keys

import omit from 'just-omit';

var obj = {a: 3, b: 5, c: 9};
omit(obj, ['a', 'c']); // {b: 5}
omit(obj, 'a', 'c'); // {b: 5}
omit(obj, ['a', 'b', 'd']); // {c: 9}
omit(obj, ['a', 'a']); // {b: 5, c: 9}

更新日志

just-omit

2.2.0

Minor Changes

  • Rename node module .js -> .cjs

2.1.2

Patch Changes

  • Type improvements

2.1.1

Patch Changes

  • fix: reorder exports to set default last #488

2.1.0

Minor Changes

  • package.json updates to fix #467 and #483