export default (value, params) => {
    const isUrl = /^https?:\/\/([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w\.\(\)%-]*)*\/?$/
    .test(value);

    const domain = params && params[0];

    if (domain && isUrl) {
        return new RegExp(`^https?:\/\/(([\da-z\.-]+)\.)*(${params[0].replace('.', '\\$&')})`)
        .test(value);
    }

    return isUrl;
};

@@ -1,352 +1,129 @@
-export default (value, params) =%3E %7B%0A    const isUrl = /%5Ehttps?:%5C/%5C/(%5B%5Cda-z%5C.-%5D+)%5C.(%5Ba-z%5C.%5D%7B2,6%7D)(%5B%5C/%5Cw%5C.%5C(%5C)%25-%5D*)*%5C/?$/%0A    .test(value);%0A%0A    con
+import isURL from 'validator/lib/isURL';%0A%0Aexport default (value, domains) =%3E isURL(value, %7B host_whiteli
 st
+:
  domain
- = params && params%5B0%5D;%0A%0A    if (domain && isUrl) %7B%0A        return new RegExp(%60%5Ehttps?:%5C/%5C/((%5B%5Cda-z%5C.-%5D+)%5C.)*($%7Bparams%5B0%5D.replace('.', '%5C%5C$&')%7D)%60)%0A        .test(value);%0A    %7D%0A%0A    return isUrl;%0A%7D
+s %7C%7C false %7D)
 ;%0A

use the validator isURL