UNPKG

graphdb-workbench

Version:
2 lines 1.11 kB
export const __webpack_id__=75331;export const __webpack_ids__=[30690,75331];export const __webpack_modules__={30690:(t,e,r)=>{r.r(e),r.d(e,{UrlUtils:()=>i});const s=/^(h|ht|htt|http|https|http:|https:|http:\/|https:\/|http:\/\/|https:\/\/|https?:\/\/[\S]*)$/i,o=/^(f|ft|ftp|ftps|ftp:|ftps:|ftp:\/|ftps:\/|ftp:\/\/|ftps:\/\/[\S]*)$/i;class i{static isValidUrl(t){return s.test(t)||o.test(t)}static doesNotContain(t,e){return!new RegExp(e).test(t)}static doesNotUseProtocol(t,e){return!new RegExp("^("+e.join("|")+")://","i").test(t)}}},75331:(t,e,r)=>{r.r(e);var s=r(30690);angular.module("graphdb.framework.core.directives.validate-url",[]).directive("validateUrl",function(){return{restrict:"A",require:"ngModel",link:function(t,e,r,o){o.$validators.validUrl=function(t,e){if(o.$isEmpty(e))return"false"!==r.allowEmpty;if(!s.UrlUtils.isValidUrl(e))return!1;if(r.exclude&&!s.UrlUtils.doesNotContain(e,r.exclude))return!1;if(r.excludeProtocol){const t=r.excludeProtocol.split(",");if(!s.UrlUtils.doesNotUseProtocol(e,t))return!1}return!0}}}})}}; //# sourceMappingURL=75331.f7b18e5c6552da1a711d.bundle.js.map