From 6bde679a5f5818c6915f52794bf209300f52786e Mon Sep 17 00:00:00 2001 From: Sviatoslav Abakumov Date: Sun, 18 Jan 2026 23:05:08 +0400 Subject: [PATCH] fix(tui): use the non-null assertion operator instead of assert() --- packages/tui/src/components/editor.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/tui/src/components/editor.ts b/packages/tui/src/components/editor.ts index 3c28e1fb..ed173937 100644 --- a/packages/tui/src/components/editor.ts +++ b/packages/tui/src/components/editor.ts @@ -1,4 +1,3 @@ -import assert from "node:assert"; import type { AutocompleteProvider, CombinedAutocompleteProvider } from "../autocomplete.js"; import { getEditorKeybindings } from "../keybindings.js"; import { matchesKey } from "../keys.js"; @@ -1621,8 +1620,7 @@ export class Editor implements Component, Focusable { this.deleteYankedText(); // Rotate the ring: move end to front - const lastEntry = this.killRing.pop(); - assert(lastEntry !== undefined); // Since killRing was not empty + const lastEntry = this.killRing.pop()!; this.killRing.unshift(lastEntry); // Insert the new most recent entry (now at end after rotation)