validity-number-or-null
Validity style validator to ensure a property is either null or numeric (and not NaN
).
Installation
npm install validity-number-or-null
Usage
Below is a simple example for usage with schemata:
var validity = schemata = createValidator = var schema = schema schema schema
API
var validate = createValidator()
validate(String:key, String:keyDisplayName, Object:object, Function:cb)
This is a validity compatible function, which in turn is used by schemata for schema validation.
The callback signature cb(err, errorMessage)
.
err
is anError
object if something bad happened andnull
otherwise.errorMessage
is aString
if a validation error happened andundefined
otherwise.
Licence
Licensed under the New BSD License