Would be nice to have an isObjectvalidator. For example this could be used in validation functions after a request has been parsed by node.js.
If you're interested I could create a pull request for you.
This has been brought up before but rejected since it's a string validation library only. You can always mixin your own functions to the validator object
validator.isObject = function (obj) {
return typeof obj === 'object';
};
Even tho this is a string validation library, I honestly feel this should be added.
Why not parse an object to string (JSON.stringify) and check for valid JSON?
I agree that it would be useful
Most helpful comment
Even tho this is a string validation library, I honestly feel this should be added.
Why not parse an object to string (JSON.stringify) and check for valid JSON?