UNPKG

fwk-pipes

Version:

Framework with common pipes

23 lines 696 B
import { Pipe } from '@angular/core'; var SearchInfoPipe = (function () { function SearchInfoPipe() { } SearchInfoPipe.prototype.transform = function (arr, txt) { if (!arr) return []; var res = arr.filter(function (item) { if (!txt) txt = ""; var str = JSON.stringify(item).toLowerCase(); var idx = str.indexOf(txt.toLowerCase()); return (idx !== -1); }); return res; }; SearchInfoPipe.decorators = [ { type: Pipe, args: [{ name: 'searchInfo' },] }, ]; return SearchInfoPipe; }()); export { SearchInfoPipe }; //# sourceMappingURL=searchInfo.pipe.js.map