MCPcopy Create free account
hub / github.com/redis/RedisInsight / readResolve

Method readResolve

redisinsight/ui/src/utils/formatters/java-date.ts:22–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20 }
21
22 readResolve() {
23 let timeValue: number
24
25 // Handle two's complement conversion for negative numbers
26 if (this.time > this.JAVA_MAX_LONG) {
27 // If the number is larger than MAX_LONG, it's a negative number in two's complement
28 timeValue = Number(this.time - this.TWO_COMPLEMENT_MAX_LONG)
29 } else {
30 timeValue = Number(this.time)
31 }
32
33 const date = new Date(timeValue)
34
35 // Validate the date
36 if (Number.isNaN(date.getTime())) {
37 throw new Error(
38 `Invalid date value: ${timeValue} (original: ${this.time})`,
39 )
40 }
41
42 return date
43 }
44}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected