npm.io
1.1.0 • Published 9 years ago

boundless-utils-object-intersection

Licence
MIT
Version
1.1.0
Deps
0
Vulns
0
Weekly
0
Stars
239

objectIntersection

Returns an intersection of the first argument against the second argument's keys.

Installation

npm i boundless-utils-object-intersection --save

Then use it like:

/** @jsx createElement */

import intersect from 'boundless-utils-object-intersection';

const obj1 = { foo: 'bar', bar: 'baz', baz: 'fizz' };
const obj2 = { bar: 'x' };

intersect(obj1, obj2); // returns `{bar: 'baz'}`