rocjs / roc

🐦 Modern JavaScript Development Ecosystem
MIT License
425 stars 23 forks source link

isShape validator and better documentation generation #183

Open dlmr opened 7 years ago

dlmr commented 7 years ago

Adds a new validator that can be used most specifically for Hook validation.

This PR also improves the information in the documentation generation for isArray, isObject and oneOf validators giving information about the types that they wrap.

This through a new syntax for the documentation generation when describing wrapped validators. [TYPE] means that the type is optional, <TYPE> means that it is required. A question mark in front of the type, ?TYPE means that it can be empty.

Array(<String>) means that null and undefined are allowed as values but not empty strings as an example.