storaq
Library for storing, querying and validating data in lists or dictionaries.
Simple:
const Lyst = Lyst; var list = ; list; var steve = list;
Optional item validation by custom structure definition:
const Diqt = Diqt; var diqt = type: 'object' strict: false structure: name: 'string' items: 'array' pet: name: 'string' type: 'any' ; diqt; // worksdiqt; // throws error
Item Definition Explanation:
/* acceptable type strings: * 'any' * 'object' * 'array' // uses Array.isArray() for validation * 'number', * 'string', * 'boolean'*/itemDefinition = type: 'any' strict: true /* = ONLY given structure keys allowed. false = structure keys required, but additional ones allowed */ structure: name: 'string' something: 'any' myArray: 'array' // array content will NOT be checked someObject: 'object' // 'object' keys will just be validated with typeof, but subStructure: // sub structures like this will be recursively checked. name: 'string' number: 'number' ;