You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
23 lines
555 B
TypeScript
23 lines
555 B
TypeScript
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 { transformReplyBoolean as transformReply } from './generic-transformers';
|