()
| 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected