You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-13 10:02:24 +03:00
25 lines
591 B
TypeScript
25 lines
591 B
TypeScript
import { transformReplyBoolean } from './generic-transformers';
|
|
|
|
interface CopyCommandOptions {
|
|
destinationDb?: number;
|
|
replace?: boolean;
|
|
}
|
|
|
|
export const FIRST_KEY_INDEX = 1;
|
|
|
|
export function transformArguments(source: string, destination: string, options?: CopyCommandOptions): Array<string> {
|
|
const args = ['COPY', source, destination];
|
|
|
|
if (options?.destinationDb) {
|
|
args.push('DB', options.destinationDb.toString());
|
|
}
|
|
|
|
if (options?.replace) {
|
|
args.push('REPLACE');
|
|
}
|
|
|
|
return args;
|
|
}
|
|
|
|
export const transformReply = transformReplyBoolean;
|