0.1.3 • Published 7 years ago

gonzazoid.checkoff.js v0.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Usage is simple — first parameter is verifiable object, second — object-pattern, the structure of which repeats the structure that we expect to see in the object under test. Suppose we want to check whether target object has req.body.formData.to property and is this property an array:

if type checking is not needed we can specify null in the pattern object and as a result we have an analog of any in typescript:

That is, for verification it is enough to specify in the pattern the value of the same type that you want to get in the object being checked: