( duration: TransitionProps['duration'], )
| 298 | } |
| 299 | |
| 300 | function normalizeDuration( |
| 301 | duration: TransitionProps['duration'], |
| 302 | ): [number, number] | null { |
| 303 | if (duration == null) { |
| 304 | return null |
| 305 | } else if (isObject(duration)) { |
| 306 | return [NumberOf(duration.enter), NumberOf(duration.leave)] |
| 307 | } else { |
| 308 | const n = NumberOf(duration) |
| 309 | return [n, n] |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | function NumberOf(val: unknown): number { |
| 314 | const res = toNumber(val) |
no test coverage detected