diff --git a/lib/index.ts b/lib/index.ts index 0673c3a..2188e50 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -204,7 +204,7 @@ export class UI { const match = source.match(/^ */) const leadingWhitespace = match ? match[0].length : 0 const target = previousLine.text - const targetTextWidth = mixin.stringWidth(target.trimRight()) + const targetTextWidth = mixin.stringWidth(target.trimEnd()) if (!previousLine.span) { return source @@ -223,13 +223,13 @@ export class UI { previousLine.hidden = true - return target.trimRight() + ' '.repeat(leadingWhitespace - targetTextWidth) + source.trimLeft() + return target.trimEnd() + ' '.repeat(leadingWhitespace - targetTextWidth) + source.trimStart() } private rasterize (row: ColumnArray) { const rrows: string[][] = [] const widths = this.columnWidths(row) - let wrapped + let wrapped: string[] // word wrap all columns, and create // a data-structure that is easy to rasterize. diff --git a/tsconfig.json b/tsconfig.json index d5d8c21..5b52b82 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,11 +7,11 @@ "target": "es2017", "moduleResolution": "node", "module": "es2015" - }, + }, "include": [ "lib/**/*.ts" ], "exclude": [ "lib/cjs.ts" ] -} \ No newline at end of file +}