You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
buffers, buffers everywhere...
This commit is contained in:
@ -1,19 +1,26 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
import { ScanOptions, pushScanArguments } from './generic-transformers';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export const IS_READ_ONLY = true;
|
||||
|
||||
export function transformArguments(key: string, cursor: number, options?: ScanOptions): Array<string> {
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
cursor: number,
|
||||
options?: ScanOptions
|
||||
): RedisCommandArguments {
|
||||
return pushScanArguments([
|
||||
'HSCAN',
|
||||
key
|
||||
], cursor, options);
|
||||
}
|
||||
|
||||
type HScanRawReply = [RedisCommandArgument, Array<RedisCommandArgument>];
|
||||
|
||||
export interface HScanTuple {
|
||||
field: string;
|
||||
value: string;
|
||||
field: RedisCommandArgument;
|
||||
value: RedisCommandArgument;
|
||||
}
|
||||
|
||||
interface HScanReply {
|
||||
@ -21,7 +28,7 @@ interface HScanReply {
|
||||
tuples: Array<HScanTuple>;
|
||||
}
|
||||
|
||||
export function transformReply([cursor, rawTuples]: [string, Array<string>]): HScanReply {
|
||||
export function transformReply([cursor, rawTuples]: HScanRawReply): HScanReply {
|
||||
const parsedTuples = [];
|
||||
for (let i = 0; i < rawTuples.length; i += 2) {
|
||||
parsedTuples.push({
|
||||
|
Reference in New Issue
Block a user