From de26be56c13fad355a19aac041df9c437fc7ece6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Breitbart?= Date: Mon, 27 Aug 2018 17:11:40 +0200 Subject: [PATCH] change type of IPartialLineData --- src/TerminalLine.ts | 2 +- src/renderer/CharacterJoinerRegistry.test.ts | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/TerminalLine.ts b/src/TerminalLine.ts index 7f944191..186e2f58 100644 --- a/src/TerminalLine.ts +++ b/src/TerminalLine.ts @@ -95,7 +95,7 @@ export class TerminalLine { this.push(fill); } } - + /** replace cells from pos to pos + n - 1 with fill */ public replaceCells(start: number, end: number, fill: CharData): void { while (start < end && start < this.length) this.set(start++, fill); // Note: fill is not cloned diff --git a/src/renderer/CharacterJoinerRegistry.test.ts b/src/renderer/CharacterJoinerRegistry.test.ts index d427ef5e..d7cd1ce4 100644 --- a/src/renderer/CharacterJoinerRegistry.test.ts +++ b/src/renderer/CharacterJoinerRegistry.test.ts @@ -260,16 +260,13 @@ describe('CharacterJoinerRegistry', () => { }); }); -interface IPartialLineData { - [0]: string; - [1]?: number; -} +type IPartialLineData = ([string] | [string, number]); function lineData(data: IPartialLineData[]): TerminalLine { const tline = new TerminalLine(); for (let i = 0; i < data.length; ++i) { const line = data[i][0]; - const attr = data[i][1] || 0; + const attr = (data[i][1] || 0); line.split('').map(char => tline.push([attr, char, 1, char.charCodeAt(0)])); } return tline;