partition-object
v1.0.2
Published
Splits an object into two, one with the specified keys (pick) and one without the specified keys (omit).
Downloads
7
Readme
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)