Sfoglia il codice sorgente

fix: Correct inverted instanceof check in SignalReader.read()

Also make tmp_value non-const because it gets modified later.

Solves these eslint issues:

/puter/packages/phoenix/src/ansi-shell/ioutil/SignalReader.js
  45:14  error  Unexpected negating the left operand of 'instanceof' operator  no-unsafe-negation
  46:13  error  'tmp_value' is constant                                        no-const-assign
Sam Atkins 1 anno fa
parent
commit
d4c2b492ef
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      packages/phoenix/src/ansi-shell/ioutil/SignalReader.js

+ 2 - 2
packages/phoenix/src/ansi-shell/ioutil/SignalReader.js

@@ -40,9 +40,9 @@ export class SignalReader extends ProxyReader {
             return { value, done };
         }
 
-        const tmp_value = value;
+        let tmp_value = value;
 
-        if ( ! tmp_value instanceof Uint8Array ) {
+        if ( ! (tmp_value instanceof Uint8Array) ) {
             tmp_value = encoder.encode(value);
         }