You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
use dockers for tests, use npm workspaces, add rejson & redisearch modules, fix some bugs
This commit is contained in:
15
packages/client/lib/commands/TIME.ts
Normal file
15
packages/client/lib/commands/TIME.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export function transformArguments(): Array<string> {
|
||||
return ['TIME'];
|
||||
}
|
||||
|
||||
interface TimeReply extends Date {
|
||||
microseconds: number;
|
||||
}
|
||||
|
||||
export function transformReply(reply: [string, string]): TimeReply {
|
||||
const seconds = Number(reply[0]),
|
||||
microseconds = Number(reply[1]),
|
||||
d: Partial<TimeReply> = new Date(seconds + Math.round(microseconds / 1000));
|
||||
d.microseconds = microseconds;
|
||||
return d as TimeReply;
|
||||
}
|
Reference in New Issue
Block a user