MCPcopy
hub / github.com/vuejs/core / normalizeDuration

Function normalizeDuration

packages/runtime-dom/src/components/Transition.ts:300–311  ·  view source on GitHub ↗
(
  duration: TransitionProps['duration'],
)

Source from the content-addressed store, hash-verified

298}
299
300function 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
313function NumberOf(val: unknown): number {
314 const res = toNumber(val)

Callers 1

resolveTransitionPropsFunction · 0.85

Calls 2

isObjectFunction · 0.90
NumberOfFunction · 0.85

Tested by

no test coverage detected