Package Exports
- deep-check
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (deep-check) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
deep-check
Check that properties of a deeply-nested object exist.
install
$ npm install deep-check
usage
The schema used to check if values are present can be itself a deeply nested object:
var deepCheck = require('deep-check')
var data = {
fruit:{
citrus:{
lemons:10,
oranges:12
}
},
orders:{
settings:{
id:12
}
}
}
var schema = {
fruit:{
citrus:{
lemons:true,
weight:true
}
},
orders:{
settings:true,
history:true
}
}
var missing = deepCheck(data, schema)
console.log(missing)
// ['fruit.citrus.weight', 'orders.history']
Or you can use an array with dot-notation:
var schema = [
'fruit.citrus.lemons',
'fruit.apples',
'orders.settings',
'orders.history'
]
var missing = deepCheck(data, schema)
console.log(missing)
// ['fruit.apples', 'orders.history']
license
MIT