UNPKG

ng-elasticsearch-sanitize

Version:
2 lines 492 B
!function(a,b){b.a=a,function(){"use strict";angular.module("lx.escapeElastic",[]).service("escapeElastic",function(){var a,b;return function(c){return c=c.replace(/([-!(){}\[\]^"~*?:\+\/\\])/g,"\\$1").replace(/(\|\|)/g,"\\$1").replace(/(\&\&)/g,"\\$1"),_.map(["AND","OR","NOT"],function(d){a="s*\\b("+d+")\\b\\s*",b=new RegExp(a,"g"),c=c.replace(b,_.map(d.split(""),function(a){return"\\"+a}).join("")+" ")}),c}})}()}({},function(){return this}()); //# sourceMappingURL=ng-elastic-escape.map