1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

add missing FIRST_KEY_INDEX (#2028)

This commit is contained in:
Leibale Eidelman
2022-03-08 17:26:13 -05:00
committed by GitHub
parent f79e14c8c3
commit c57da8b78b
9 changed files with 17 additions and 8 deletions

View File

@@ -1,6 +1,8 @@
import { RedisCommandArgument, RedisCommandArguments } from '.'; import { RedisCommandArgument, RedisCommandArguments } from '.';
import { pushVerdictArguments } from './generic-transformers'; import { pushVerdictArguments } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments( export function transformArguments(
keys: RedisCommandArgument | Array<RedisCommandArgument> keys: RedisCommandArgument | Array<RedisCommandArgument>
): RedisCommandArguments { ): RedisCommandArguments {

View File

@@ -1,5 +1,7 @@
import { RedisCommandArgument, RedisCommandArguments } from '.'; import { RedisCommandArgument, RedisCommandArguments } from '.';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: RedisCommandArgument): RedisCommandArguments { export function transformArguments(key: RedisCommandArgument): RedisCommandArguments {
return ['DUMP', key]; return ['DUMP', key];
} }

View File

@@ -1,6 +1,8 @@
import { RedisCommandArgument, RedisCommandArguments } from '.'; import { RedisCommandArgument, RedisCommandArguments } from '.';
import { GeoCoordinates } from './generic-transformers'; import { GeoCoordinates } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
interface GeoMember extends GeoCoordinates { interface GeoMember extends GeoCoordinates {
member: RedisCommandArgument; member: RedisCommandArgument;
} }
@@ -21,8 +23,6 @@ interface GeoAddCommonOptions {
type GeoAddOptions = SetGuards & GeoAddCommonOptions; type GeoAddOptions = SetGuards & GeoAddCommonOptions;
export const FIRST_KEY_INDEX = 1;
export function transformArguments( export function transformArguments(
key: RedisCommandArgument, toAdd: GeoMember | Array<GeoMember>, key: RedisCommandArgument, toAdd: GeoMember | Array<GeoMember>,
options?: GeoAddOptions options?: GeoAddOptions

View File

@@ -1,5 +1,7 @@
import { RedisCommandArgument, RedisCommandArguments } from '.'; import { RedisCommandArgument, RedisCommandArguments } from '.';
export const FIRST_KEY_INDEX = 1;
type Types = RedisCommandArgument | number; type Types = RedisCommandArgument | number;
type HSETObject = Record<string | number, Types>; type HSETObject = Record<string | number, Types>;
@@ -8,8 +10,6 @@ type HSETMap = Map<Types, Types>;
type HSETTuples = Array<[Types, Types]> | Array<Types>; type HSETTuples = Array<[Types, Types]> | Array<Types>;
export const FIRST_KEY_INDEX = 1;
type GenericArguments = [key: RedisCommandArgument]; type GenericArguments = [key: RedisCommandArgument];
type SingleFieldArguments = [...generic: GenericArguments, field: Types, value: Types]; type SingleFieldArguments = [...generic: GenericArguments, field: Types, value: Types];

View File

@@ -1,5 +1,7 @@
import { RedisCommandArgument, RedisCommandArguments } from '.'; import { RedisCommandArgument, RedisCommandArguments } from '.';
export const FIRST_KEY_INDEX = 1;
export const IS_READ_ONLY = true; export const IS_READ_ONLY = true;
export function transformArguments( export function transformArguments(

View File

@@ -1,9 +1,9 @@
import { RedisCommandArgument, RedisCommandArguments } from '.'; import { RedisCommandArgument, RedisCommandArguments } from '.';
export type LMoveSide = 'LEFT' | 'RIGHT';
export const FIRST_KEY_INDEX = 1; export const FIRST_KEY_INDEX = 1;
export type LMoveSide = 'LEFT' | 'RIGHT';
export function transformArguments( export function transformArguments(
source: RedisCommandArgument, source: RedisCommandArgument,
destination: RedisCommandArgument, destination: RedisCommandArgument,

View File

@@ -1,3 +1,5 @@
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string, db: number): Array<string> { export function transformArguments(key: string, db: number): Array<string> {
return ['MOVE', key, db.toString()]; return ['MOVE', key, db.toString()];
} }

View File

@@ -2,7 +2,6 @@ export const FIRST_KEY_INDEX = 1;
export const IS_READ_ONLY = true; export const IS_READ_ONLY = true;
interface SortOptions { interface SortOptions {
BY?: string; BY?: string;
LIMIT?: { LIMIT?: {
@@ -25,7 +24,7 @@ export function transformArguments(key: string, options?: SortOptions): Array<st
if (options?.LIMIT) { if (options?.LIMIT) {
args.push( args.push(
'LIMIT', 'LIMIT',
options.LIMIT.offset.toString(), options.LIMIT.offset.toString(),
options.LIMIT.count.toString() options.LIMIT.count.toString()
); );
} }

View File

@@ -1,6 +1,8 @@
import { RedisCommandArguments } from '.'; import { RedisCommandArguments } from '.';
import { pushVerdictArguments } from './generic-transformers'; import { pushVerdictArguments } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export function transformArguments(key: string | Array<string>): RedisCommandArguments { export function transformArguments(key: string | Array<string>): RedisCommandArguments {
return pushVerdictArguments(['WATCH'], key); return pushVerdictArguments(['WATCH'], key);
} }