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

Method #continueDecodeMapAsObjectKey

packages/client/lib/RESP/decoder.ts:1122–1160  ·  view source on GitHub ↗
(object, remaining, keyCb, typeMapping, chunk)

Source from the content-addressed store, hash-verified

1120 }
1121
1122 #continueDecodeMapAsObjectKey(object, remaining, keyCb, typeMapping, chunk) {
1123 const key = keyCb(chunk);
1124 if (typeof key === 'function') {
1125 return this.#continueDecodeMapAsObjectKey.bind(
1126 this,
1127 object,
1128 remaining,
1129 key,
1130 typeMapping
1131 );
1132 }
1133
1134 if (this.#cursor >= chunk.length) {
1135 return this.#continueDecodeMapAsObjectValue.bind(
1136 this,
1137 object,
1138 remaining,
1139 key,
1140 this.#decodeNestedType.bind(this, typeMapping),
1141 typeMapping
1142 );
1143 }
1144
1145 const value = this.#decodeNestedType(typeMapping, chunk);
1146 if (typeof value === 'function') {
1147 return this.#continueDecodeMapAsObjectValue.bind(
1148 this,
1149 object,
1150 remaining,
1151 key,
1152 value,
1153 typeMapping
1154 );
1155 }
1156
1157 object[key] = value;
1158
1159 return this.#decodeMapAsObject(object, remaining - 1, typeMapping, chunk);
1160 }
1161
1162 #continueDecodeMapAsObjectValue(object, remaining, key, valueCb, typeMapping, chunk) {
1163 const value = valueCb(chunk);

Callers

nothing calls this directly

Calls 2

#decodeNestedTypeMethod · 0.95
#decodeMapAsObjectMethod · 0.95

Tested by

no test coverage detected