(type, chunk)
| 284 | } |
| 285 | |
| 286 | #decodeBigNumber(type, chunk) { |
| 287 | if (type === String) { |
| 288 | return this.#decodeSimpleString(String, chunk); |
| 289 | } |
| 290 | |
| 291 | switch (chunk[this.#cursor]) { |
| 292 | case ASCII['+']: |
| 293 | return this.#maybeDecodeBigNumberValue(false, chunk); |
| 294 | |
| 295 | case ASCII['-']: |
| 296 | return this.#maybeDecodeBigNumberValue(true, chunk); |
| 297 | |
| 298 | default: |
| 299 | return this.#decodeBigNumberValue( |
| 300 | false, |
| 301 | this.#decodeUnsingedBigNumber.bind(this, 0n), |
| 302 | chunk |
| 303 | ); |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | #maybeDecodeBigNumberValue(isNegative, chunk) { |
| 308 | const cb = this.#decodeUnsingedBigNumber.bind(this, 0n); |
no test coverage detected