(type, typeMapping, chunk)
| 680 | } |
| 681 | |
| 682 | #decodeNestedTypeValue(type, typeMapping, chunk) { |
| 683 | switch (type) { |
| 684 | case RESP_TYPES.NULL: |
| 685 | return this.#decodeNull(); |
| 686 | |
| 687 | case RESP_TYPES.BOOLEAN: |
| 688 | return this.#decodeBoolean(chunk); |
| 689 | |
| 690 | case RESP_TYPES.NUMBER: |
| 691 | return this.#decodeNumber(typeMapping[RESP_TYPES.NUMBER], chunk); |
| 692 | |
| 693 | case RESP_TYPES.BIG_NUMBER: |
| 694 | return this.#decodeBigNumber(typeMapping[RESP_TYPES.BIG_NUMBER], chunk); |
| 695 | |
| 696 | case RESP_TYPES.DOUBLE: |
| 697 | return this.#decodeDouble(typeMapping[RESP_TYPES.DOUBLE], chunk); |
| 698 | |
| 699 | case RESP_TYPES.SIMPLE_STRING: |
| 700 | return this.#decodeSimpleString(typeMapping[RESP_TYPES.SIMPLE_STRING], chunk); |
| 701 | |
| 702 | case RESP_TYPES.BLOB_STRING: |
| 703 | return this.#decodeBlobString(typeMapping[RESP_TYPES.BLOB_STRING], chunk); |
| 704 | |
| 705 | case RESP_TYPES.VERBATIM_STRING: |
| 706 | return this.#decodeVerbatimString(typeMapping[RESP_TYPES.VERBATIM_STRING], chunk); |
| 707 | |
| 708 | case RESP_TYPES.SIMPLE_ERROR: |
| 709 | return this.#decodeSimpleError(chunk); |
| 710 | |
| 711 | case RESP_TYPES.BLOB_ERROR: |
| 712 | return this.#decodeBlobError(chunk); |
| 713 | |
| 714 | case RESP_TYPES.ARRAY: |
| 715 | return this.#decodeArray(typeMapping, chunk); |
| 716 | |
| 717 | case RESP_TYPES.SET: |
| 718 | return this.#decodeSet(typeMapping, chunk); |
| 719 | |
| 720 | case RESP_TYPES.MAP: |
| 721 | return this.#decodeMap(typeMapping, chunk); |
| 722 | |
| 723 | default: |
| 724 | throw new Error(`Unknown RESP type ${type} "${String.fromCharCode(type)}"`); |
| 725 | } |
| 726 | } |
| 727 | |
| 728 | #decodeArray(typeMapping, chunk) { |
| 729 | // RESP 2 null |
no test coverage detected