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,11 +1,15 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
import { ScanOptions, pushScanArguments } from './generic-transformers';
|
||||
|
||||
export const IS_READ_ONLY = true;
|
||||
export interface ScanCommandOptions extends ScanOptions {
|
||||
TYPE?: string;
|
||||
TYPE?: RedisCommandArgument;
|
||||
}
|
||||
|
||||
export function transformArguments(cursor: number, options?: ScanCommandOptions): Array<string> {
|
||||
export function transformArguments(
|
||||
cursor: number,
|
||||
options?: ScanCommandOptions
|
||||
): RedisCommandArguments {
|
||||
const args = pushScanArguments(['SCAN'], cursor, options);
|
||||
|
||||
if (options?.TYPE) {
|
||||
@@ -15,12 +19,14 @@ export function transformArguments(cursor: number, options?: ScanCommandOptions)
|
||||
return args;
|
||||
}
|
||||
|
||||
type ScanRawReply = [string, Array<string>];
|
||||
|
||||
export interface ScanReply {
|
||||
cursor: number;
|
||||
keys: Array<string>;
|
||||
keys: Array<RedisCommandArgument>;
|
||||
}
|
||||
|
||||
export function transformReply([cursor, keys]: [string, Array<string>]): ScanReply {
|
||||
export function transformReply([cursor, keys]: ScanRawReply): ScanReply {
|
||||
return {
|
||||
cursor: Number(cursor),
|
||||
keys
|
||||
|
Reference in New Issue
Block a user