if(Array.isArray(options)){// keep compatibility with <=0.2.0
protocols=options;
options={};
}
if(protocols!=null&&!Array.isArray(protocols)){
if(protocols!=null&&!Array.isArray(protocols)){
thrownewError(`Permitted protocol list must be an array`);
thrownewError(`Permitted protocol list must be an array`);
}
}
@ -35,7 +46,11 @@ module.exports = function (protocols) {
returnnewValidationError(`Must be a URL with one of the following protocols: ${validProtocolList} - but got ${parsedProtocol.toUpperCase()} instead`,{code:"validatem.is-url.wrong-protocol"});
returnnewValidationError(`Must be a URL with one of the following protocols: ${validProtocolList} - but got ${parsedProtocol.toUpperCase()} instead`,{code:"validatem.is-url.wrong-protocol"});