0.0.4 • Published 9 years ago

check-js v0.0.4

Weekly downloads
15
License
-
Repository
github
Last release
9 years ago

checkJS

A JSON validator with schema and sanification(optional).


The validation is performed with a depth-first search on the schema object.

TODO:

  • deep test for complexObjects (mixed type).
  • deep test for require flag.
  • test for .use('validator'|'sanitizer', function)
  • test for the parse() function
  • test fot hidden fields
  • an adapter to use (validatorJS)[https://github.com/chriso/validator.js] as validate function and provide the respective sanitize function
  • (with same types).
  • remove lodash as mandadory dependencies.
  • remove validatorJS as mandadory dependencies.
  • a decent README.

DONE:

  • a good method to change/extends validate and sanitize functions (choosen the use() keyword).
    • trim the object at a deep checkJS.with(schema).trimAtDeep(deep);
    • override required with .overrideRequired();
    • default all fielda are required.
    • explore simple type.
    • explore simple Object.
    • explore Objects within an Object.
    • explore simple array (one level).
    • explore complex array (with object).

Promise for the next major versions:

  • fixed length, minimal length and maximal legth for the Array type.
  • array with in array, aka matrix, should be described in the schema and
  • explored.
  • provide a way to describe a multi typed array (needed?)
  • recursive object definition, aka trees, should be described and explored.
0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago