MCPcopy Index your code
hub / github.com/ReactTooltip/react-tooltip / cssTimeToMs

Function cssTimeToMs

src/utils/css-time-to-ms.ts:1–8  ·  view source on GitHub ↗
(time: string)

Source from the content-addressed store, hash-verified

1const 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
10export default cssTimeToMs

Callers 2

TooltipFunction · 0.90
utils.spec.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…