MCPcopy
hub / github.com/redis/node-redis / #decodeTypeValue

Method #decodeTypeValue

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

Source from the content-addressed store, hash-verified

101 }
102
103 #decodeTypeValue(type, chunk) {
104 switch (type) {
105 case RESP_TYPES.NULL:
106 this.onReply(this.#decodeNull());
107 return false;
108
109 case RESP_TYPES.BOOLEAN:
110 return this.#handleDecodedValue(
111 this.onReply,
112 this.#decodeBoolean(chunk)
113 );
114
115 case RESP_TYPES.NUMBER:
116 return this.#handleDecodedValue(
117 this.onReply,
118 this.#decodeNumber(
119 this.getTypeMapping()[RESP_TYPES.NUMBER],
120 chunk
121 )
122 );
123
124 case RESP_TYPES.BIG_NUMBER:
125 return this.#handleDecodedValue(
126 this.onReply,
127 this.#decodeBigNumber(
128 this.getTypeMapping()[RESP_TYPES.BIG_NUMBER],
129 chunk
130 )
131 );
132
133 case RESP_TYPES.DOUBLE:
134 return this.#handleDecodedValue(
135 this.onReply,
136 this.#decodeDouble(
137 this.getTypeMapping()[RESP_TYPES.DOUBLE],
138 chunk
139 )
140 );
141
142 case RESP_TYPES.SIMPLE_STRING:
143 return this.#handleDecodedValue(
144 this.onReply,
145 this.#decodeSimpleString(
146 this.getTypeMapping()[RESP_TYPES.SIMPLE_STRING],
147 chunk
148 )
149 );
150
151 case RESP_TYPES.BLOB_STRING:
152 return this.#handleDecodedValue(
153 this.onReply,
154 this.#decodeBlobString(
155 this.getTypeMapping()[RESP_TYPES.BLOB_STRING],
156 chunk
157 )
158 );
159
160 case RESP_TYPES.VERBATIM_STRING:

Callers 2

writeMethod · 0.95

Calls 15

#decodeNullMethod · 0.95
#handleDecodedValueMethod · 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

Tested by

no test coverage detected