(time: string)
| 1 | const cssTimeToMs = (time: string): number => { |
| 2 | const match = time.match(/^([\d.]+)(m?s)$/) |
| 3 | if (!match) { |
| 4 | return 0 |
| 5 | } |
| 6 | const [, amount, unit] = match |
| 7 | return Number(amount) * (unit === 'ms' ? 1 : 1000) |
| 8 | } |
| 9 | |
| 10 | export default cssTimeToMs |
no outgoing calls
no test coverage detected
searching dependent graphs…