(
parser: CommandParser,
key: RedisArgument,
fields: HSETEXObject | HSETEXMap | HSETEXTuples,
options?: HSetExOptions
)
| 21 | |
| 22 | export default { |
| 23 | parseCommand( |
| 24 | parser: CommandParser, |
| 25 | key: RedisArgument, |
| 26 | fields: HSETEXObject | HSETEXMap | HSETEXTuples, |
| 27 | options?: HSetExOptions |
| 28 | ) { |
| 29 | parser.push('HSETEX'); |
| 30 | parser.pushKey(key); |
| 31 | |
| 32 | if (options?.mode) { |
| 33 | parser.push(options.mode) |
| 34 | } |
| 35 | if (options?.expiration) { |
| 36 | if (typeof options.expiration === 'string') { |
| 37 | parser.push(options.expiration); |
| 38 | } else if (options.expiration.type === 'KEEPTTL') { |
| 39 | parser.push('KEEPTTL'); |
| 40 | } else { |
| 41 | parser.push( |
| 42 | options.expiration.type, |
| 43 | options.expiration.value.toString() |
| 44 | ); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | parser.push('FIELDS') |
| 49 | if (fields instanceof Map) { |
| 50 | pushMap(parser, fields); |
| 51 | } else if (Array.isArray(fields)) { |
| 52 | pushTuples(parser, fields); |
| 53 | } else { |
| 54 | pushObject(parser, fields); |
| 55 | } |
| 56 | }, |
| 57 | transformReply: undefined as unknown as () => NumberReply<0 | 1> |
| 58 | } as const satisfies Command; |
| 59 |
nothing calls this directly
no test coverage detected