Allow a custom rule's onError implementation to override that rule's information URL for each error.

This commit is contained in:
David Anson 2023-07-11 21:44:45 -07:00
parent 14974e52a9
commit c699b8e22b
7 changed files with 235 additions and 18 deletions

View file

@ -73,7 +73,12 @@ module.exports.isEmptyString = function isEmptyString(str) {
// Returns true iff the input is an object
module.exports.isObject = function isObject(obj) {
return (obj !== null) && (typeof obj === "object") && !Array.isArray(obj);
return !!obj && (typeof obj === "object") && !Array.isArray(obj);
};
// Returns true iff the input is a URL
module.exports.isUrl = function isUrl(obj) {
return !!obj && (Object.getPrototypeOf(obj) === URL.prototype);
};
/**