refactor: Make loop condition non-constant

Resolves this eslint issue:

/puter/packages/phoenix/src/ansi-shell/readline/readline.js
  154:33  error  Unexpected constant condition  no-constant-condition
This commit is contained in:
Sam Atkins 2024-05-01 11:08:06 +01:00
parent 6d895dff42
commit 50d75cd2f9

View File

@ -151,11 +151,7 @@ const ReadlineProcessorBuilder = builder => builder
if ( completions.length > 1 ) {
let inCommon = '';
for ( let i=0 ; true ; i++ ) {
if ( ! completions.every(completion => {
return completion.length > i;
}) ) break;
for ( let i=0 ; completions.every(completion => completion.length > i) ; i++ ) {
let matches = true;
const chrFirst = completions[0][i];