You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-17 19:41:06 +03:00
15 lines
369 B
TypeScript
15 lines
369 B
TypeScript
export type CommandOptions<T> = T & {
|
|
options: never;
|
|
};
|
|
|
|
const set = new WeakSet();
|
|
|
|
export function commandOptions<T extends object>(options: T): CommandOptions<T> {
|
|
set.add(options);
|
|
return options as CommandOptions<T>;
|
|
}
|
|
|
|
export function isCommandOptions<T extends object>(options: any): options is CommandOptions<T> {
|
|
return set.delete(options);
|
|
}
|