( value: unknown, timestampUnit: TimestampUnit, )
| 265 | }; |
| 266 | |
| 267 | export const normalizeTimeValue = ( |
| 268 | value: unknown, |
| 269 | timestampUnit: TimestampUnit, |
| 270 | ): number | undefined => { |
| 271 | const timestamp = isNumber(value) |
| 272 | ? timestampUnit == SECOND_UNIT |
| 273 | ? value * 1000 |
| 274 | : value |
| 275 | : isString(value) && ISO_DATE.test(value) |
| 276 | ? getTime(value) |
| 277 | : value instanceof Date |
| 278 | ? getTime(value) |
| 279 | : undefined; |
| 280 | return isFiniteNumber(timestamp) ? timestamp : undefined; |
| 281 | }; |
| 282 | |
| 283 | export const getTickBounds = ( |
| 284 | [xMin, xMax, yMin, yMax]: Bounds, |
no test coverage detected
searching dependent graphs…