partition-object
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

partition-object

Splits an object into two, one with the specified keys (pick) and one without the specified keys (omit).

const [withFoo, withBar] = partitionObject({ foo: 1, bar: 2 }, ['foo']);

withFoo.foo; // 1
withFoo.bar; // undefined (and typescript error)

withBar.bar; // 2
withBar.foo; // undefined (and typescript error)

Readme

Keywords

none

Package Sidebar

Install

npm i partition-object

Weekly Downloads

3

Version

1.0.2

License

MIT

Unpacked Size

6.07 kB

Total Files

12

Last publish

Collaborators

  • joeflateau