(type, chunk)
| 334 | } |
| 335 | |
| 336 | #decodeDouble(type, chunk) { |
| 337 | if (type === String) { |
| 338 | return this.#decodeSimpleString(String, chunk); |
| 339 | } |
| 340 | |
| 341 | switch (chunk[this.#cursor]) { |
| 342 | case ASCII.n: |
| 343 | this.#cursor += 5; // skip nan\r\n |
| 344 | return NaN; |
| 345 | |
| 346 | case ASCII['+']: |
| 347 | return this.#maybeDecodeDoubleInteger(false, chunk); |
| 348 | |
| 349 | case ASCII['-']: |
| 350 | return this.#maybeDecodeDoubleInteger(true, chunk); |
| 351 | |
| 352 | default: |
| 353 | return this.#decodeDoubleInteger(false, 0, chunk); |
| 354 | } |
| 355 | } |
| 356 | |
| 357 | #maybeDecodeDoubleInteger(isNegative, chunk) { |
| 358 | return ++this.#cursor === chunk.length ? |
no test coverage detected