UNPKG

bitfront-library

Version:

Angular CLI project with components and classes used by other Angular projects of the BIT foundation.

32 lines 1.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RemoveLineBreaksPipe = void 0; var core_1 = require("@angular/core"); var i0 = require("@angular/core"); var RemoveLineBreaksPipe = /** @class */ (function () { function RemoveLineBreaksPipe() { } RemoveLineBreaksPipe.prototype.transform = function (str) { if (str.indexOf("\n") > 0) { str = str .split("\n") .filter(function (line) { return line.trim().length > 0; }) .join(" // "); } if (str.length > 200) { str = str.substring(0, 200) + " ..."; } return str; }; RemoveLineBreaksPipe.ɵfac = function RemoveLineBreaksPipe_Factory(t) { return new (t || RemoveLineBreaksPipe)(); }; RemoveLineBreaksPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "removeLineBreaks", type: RemoveLineBreaksPipe, pure: true }); return RemoveLineBreaksPipe; }()); exports.RemoveLineBreaksPipe = RemoveLineBreaksPipe; (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RemoveLineBreaksPipe, [{ type: core_1.Pipe, args: [{ name: "removeLineBreaks" }] }], null, null); })(); //# sourceMappingURL=remove-line-breaks.pipe.js.map