MCPcopy Index your code
hub / github.com/redis/node-redis / #decodeNestedTypeValue

Method #decodeNestedTypeValue

packages/client/lib/RESP/decoder.ts:682–726  ·  view source on GitHub ↗
(type, typeMapping, chunk)

Source from the content-addressed store, hash-verified

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

Callers 2

#decodeNestedTypeMethod · 0.95
#decodeMapKeyValueMethod · 0.95

Calls 13

#decodeNullMethod · 0.95
#decodeBooleanMethod · 0.95
#decodeNumberMethod · 0.95
#decodeBigNumberMethod · 0.95
#decodeDoubleMethod · 0.95
#decodeSimpleStringMethod · 0.95
#decodeBlobStringMethod · 0.95
#decodeVerbatimStringMethod · 0.95
#decodeSimpleErrorMethod · 0.95
#decodeBlobErrorMethod · 0.95
#decodeArrayMethod · 0.95
#decodeSetMethod · 0.95

Tested by

no test coverage detected