ChecKey
Check Keys existence with whitelist, like rails/strong_parameters.

Usage
var checkey = require('checkey')
var schema = {
require: ['name'],
permit: ['web', 'mail']
}
var result1 = checkey({
name: 'shokai'
}, schema)
console.log('result1 is valid => ', result1.isValid)
var result2 = checkey({
name: 'shokai',
web: 'http://shokai.org',
mail: 'hashimoto@shokai.org'
}, schema)
console.log('result2 is valid => ', result2.isValid)
var result3 = checkey({
fullname: 'Sho Hashimoto',
web: 'http://shokai.org',
mail: 'hashimoto@shokai.org'
}, schema)
console.log('result3 is valid => ', result3.isValid)
console.log(result3.errors)
Develop
install dependencies
% npm install
build
% npm run build
or
% npm run watch
test
% npm test