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

Function pushObject

packages/client/lib/commands/HSETEX.ts:93–106  ·  view source on GitHub ↗
(parser: CommandParser, object: HSETEXObject)

Source from the content-addressed store, hash-verified

91}
92
93function pushObject(parser: CommandParser, object: HSETEXObject): void {
94 const len = Object.keys(object).length
95 if (len == 0) {
96 throw Error('object without keys')
97 }
98
99 parser.push(len.toString())
100 for (const key of Object.keys(object)) {
101 parser.push(
102 convertValue(key),
103 convertValue(object[key])
104 );
105 }
106}
107
108function convertValue(value: HashTypes): RedisArgument {
109 return typeof value === 'number' ? value.toString() : value;

Callers 1

parseCommandFunction · 0.70

Calls 4

keysMethod · 0.80
convertValueFunction · 0.70
toStringMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected