Missing Deep Keys
Tells you what keys from one object are missing in another
Install
Ensure you have Node.js version 4 or higher installed. Then run the following:
$ npm install missing-deep-keys --save
Usage
const o1 = a: b: 2; // Base objectconst o2 = c: 1; // Comparison object const result = ; // Prints keys present in o1 but missing in o2console; // => ['a.b'] // Additionally include a parent object if its children are missingconst result2 = ;console; // => ['a', 'a.b']
API
missingDeepKeys(o1, o2, [showIntermediate])
Returns an array of keys present in o1 but missing in o2
o1, o2 | showIntermediate |
---|---|
Object ({} ) |
Boolean (false ) |
Tests
$ npm run test
License
MIT © Vlad Holubiev