UNPKG

@thiagoprz/fulltext-search-pipe

Version:

Angular pipe with full text search functionality

2 lines 1.4 kB
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("@thiagoprz/fulltext-search-pipe",["exports","@angular/core"],r):r(((e="undefined"!=typeof globalThis?globalThis:e||self).thiagoprz=e.thiagoprz||{},e.thiagoprz["fulltext-search-pipe"]={}),e.ng.core)}(this,(function(e,r){"use strict";var t=function(){function e(){}return e.prototype.transform=function(e,r,t){var o=this;return r?e.reduce((function(e,n){if("string"==typeof t)r=r.toString(),n[t]&&o.removeAccents(n[t].toLowerCase()).includes(o.removeAccents(r.toLowerCase()))&&e.push(n);else for(var a in t)if(n[t[a]]&&o.removeAccents(n[t[a]].toLowerCase()).includes(o.removeAccents(r.toLowerCase()))){e.push(n);break}return e}),[]):e},e.prototype.removeAccents=function(e){return e.replace(/á/g,"a").replace(/ã/g,"a").replace(/à/g,"a").replace(/é/g,"e").replace(/í/g,"i").replace(/ó/g,"o").replace(/ô/g,"o").replace(/õ/g,"o").replace(/ú/g,"u")},e}();t.decorators=[{type:r.Pipe,args:[{name:"FullTextSearch"}]},{type:r.Injectable}],t.ctorParameters=function(){return[]};var o=function(){};o.decorators=[{type:r.NgModule,args:[{declarations:[t],imports:[],exports:[t]}]}],e.FulltextSearchPipe=t,e.FulltextSearchPipeModule=o,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=thiagoprz-fulltext-search-pipe.umd.min.js.map