Start sharing components as a team!Share components as a team!Join Bit to build your applications faster.Get Started Free

normalize-transition-duration

v0.86.0arrow_drop_down
v0.88.2
v0.86.0
v0.85.0
v0.84.0
STATUS
Passing
DOWNLOADS
16,156
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
A year ago
SIZE
494 B
Normalizes the duration of a transition.
1 contributor
Install normalize-transition-duration as a package?
Copied
npm i @bit/sem[email protected]0.86.0
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
Files
normalizeTransitionDuration.js
9 Lines(3 sloc)
1
2
3
4
5
6
7
8
9
10
/**
 * Normalizes the duration of a transition.
 * @param {number|object} duration The value to normalize.
 * @param {'hide'|'show'} type The type of transition.
 * @returns {number}
 */
export default (duration, type) => (
  (typeof duration === 'number' || typeof duration === 'string') ? duration : duration[type]
)