(type, chunk)
| 234 | } |
| 235 | |
| 236 | #decodeNumber(type, chunk) { |
| 237 | if (type === String) { |
| 238 | return this.#decodeSimpleString(String, chunk); |
| 239 | } |
| 240 | |
| 241 | switch (chunk[this.#cursor]) { |
| 242 | case ASCII['+']: |
| 243 | return this.#maybeDecodeNumberValue(false, chunk); |
| 244 | |
| 245 | case ASCII['-']: |
| 246 | return this.#maybeDecodeNumberValue(true, chunk); |
| 247 | |
| 248 | default: |
| 249 | return this.#decodeNumberValue( |
| 250 | false, |
| 251 | this.#decodeUnsingedNumber.bind(this, 0), |
| 252 | chunk |
| 253 | ); |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | #maybeDecodeNumberValue(isNegative, chunk) { |
| 258 | const cb = this.#decodeUnsingedNumber.bind(this, 0); |
no test coverage detected