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

Method #continueDecodeMapKey

packages/client/lib/RESP/decoder.ts:1013–1050  ·  view source on GitHub ↗
(map, remaining, keyCb, typeMapping, chunk)

Source from the content-addressed store, hash-verified

1011 }
1012
1013 #continueDecodeMapKey(map, remaining, keyCb, typeMapping, chunk) {
1014 const key = keyCb(chunk);
1015 if (typeof key === 'function') {
1016 return this.#continueDecodeMapKey.bind(
1017 this,
1018 map,
1019 remaining,
1020 key,
1021 typeMapping
1022 );
1023 }
1024
1025 if (this.#cursor >= chunk.length) {
1026 return this.#continueDecodeMapValue.bind(
1027 this,
1028 map,
1029 remaining,
1030 key,
1031 this.#decodeNestedType.bind(this, typeMapping),
1032 typeMapping
1033 );
1034 }
1035
1036 const value = this.#decodeNestedType(typeMapping, chunk);
1037 if (typeof value === 'function') {
1038 return this.#continueDecodeMapValue.bind(
1039 this,
1040 map,
1041 remaining,
1042 key,
1043 value,
1044 typeMapping
1045 );
1046 }
1047
1048 map.set(key, value);
1049 return this.#decodeMapAsMap(map, remaining - 1, typeMapping, chunk);
1050 }
1051
1052 #continueDecodeMapValue(map, remaining, key, valueCb, typeMapping, chunk) {
1053 const value = valueCb(chunk);

Callers

nothing calls this directly

Calls 3

#decodeNestedTypeMethod · 0.95
#decodeMapAsMapMethod · 0.95
setMethod · 0.45

Tested by

no test coverage detected