sane-object
Validates an object against a list of parameters:
- keys: max number of total keys in object (and nested objects)
- depth: max depth in the object
- keyLength: max number of characters in a key (or nested object keys)
- types: allowed types in the objects values (or nested object values)
- number
- string
- boolean
- null
- undefined
Installation
$ npm install sane-object
API
var sane = ;var company = contacts: name: 'Blanca Benson' phone: home: '+1 (850) 515-3813' address: home: '661 Congress Street' company: name: 'SOPRANO' address: office: '754 Furman Street' ; ; // true; // false; // false; // false; // false
License
MIT © René Nielsen & Thomas Jensen @ src.agency