@ng-doc/ui-kit
Version:
<!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/ng-doc/ng-doc"> <img src="https://ng-doc.com/assets/images/ng-doc.svg?raw=true" alt="Logo" height="150px"> </a>
32 lines (28 loc) • 1.31 kB
JavaScript
import * as i0 from '@angular/core';
import { Pipe } from '@angular/core';
class NgDocHighlighterPipe {
transform(input, positions) {
positions
.sort((a, b) => b.start - a.start)
.forEach((position) => {
const { start, length } = position;
const end = start + length;
input = `${input.slice(0, start)}<mark class="ng-doc-mark">${input.slice(start, end)}</mark>${input.slice(end)}`;
});
return input;
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgDocHighlighterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: NgDocHighlighterPipe, isStandalone: true, name: "ngDocHighlighterPipe" }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgDocHighlighterPipe, decorators: [{
type: Pipe,
args: [{
name: 'ngDocHighlighterPipe',
standalone: true,
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { NgDocHighlighterPipe };
//# sourceMappingURL=ng-doc-ui-kit-pipes-highlighter.mjs.map