sv-search-highlight
Version:
<p align="center"> <img style="text-align: center" src="https://angular-shortcode.web.app/assets/icons/logo-128.png"/> <h1 align="center">Angular Shortcode</h1> </p>
58 lines (50 loc) • 2 kB
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :
typeof define === 'function' && define.amd ? define('sv-search-highlight', ['exports', '@angular/core'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['sv-search-highlight'] = {}, global.ng.core));
}(this, (function (exports, core) { 'use strict';
var SvSearchHighlightPipe = /** @class */ (function () {
function SvSearchHighlightPipe() {
}
SvSearchHighlightPipe.prototype.transform = function (value, search) {
if (!value) {
return;
}
var re = new RegExp(search, 'gi');
var match = value.match(re);
return search ? value.replace(re, "<mark>" + (match && match[0]) + "</mark>") : value;
};
return SvSearchHighlightPipe;
}());
SvSearchHighlightPipe.decorators = [
{ type: core.Pipe, args: [{
name: 'svSearchHighlight'
},] }
];
var SvSearchHighlightModule = /** @class */ (function () {
function SvSearchHighlightModule() {
}
return SvSearchHighlightModule;
}());
SvSearchHighlightModule.decorators = [
{ type: core.NgModule, args: [{
declarations: [
SvSearchHighlightPipe
],
imports: [],
exports: [
SvSearchHighlightPipe
]
},] }
];
/*
* Public API Surface of sv-search-highlight
*/
/**
* Generated bundle index. Do not edit.
*/
exports.SvSearchHighlightModule = SvSearchHighlightModule;
exports.SvSearchHighlightPipe = SvSearchHighlightPipe;
Object.defineProperty(exports, '__esModule', { value: true });
})));
//# sourceMappingURL=sv-search-highlight.umd.js.map