Return dotted keys containing
undefined
values within an object including nested objectsfindUndefindness({}) => [ keys ]
$ npm install --save find-undefinedness
const findUndefinedness = require('find-undefinedness');
const config = {
token: undefined,
username: 'brh55',
emoji: undefined
}
findUndefinedness(config);
//=> '[ 'token', 'emoji']
const findUndefinedness = require('find-undefinedness');
const user = {
name: undefined,
github: {
username: 'brh55',
repositories: {
personal: 43,
private: undefined
},
followers: {
username: 'rightlag',
repositories: {
personal: 20,
private: undefined
},
stars: 1
},
stars: 100
},
emoji: undefined
}
findUndefinedness(user);
//=> [ 'name', 'github.repositories.private', 'github.followers.repositories.private', 'emoji' ]
- Returns
<array>
of dot notation keys ifundefined
is found, elsenull
.*
object | <object>
Object in question containing keys with undefinedness
MIT © Brandon Him