(parser: CommandParser, object: HSETEXObject)
| 91 | } |
| 92 | |
| 93 | function 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 | |
| 108 | function convertValue(value: HashTypes): RedisArgument { |
| 109 | return typeof value === 'number' ? value.toString() : value; |
no test coverage detected