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

normalize-offset

v0.86.0arrow_drop_down
v0.88.2
v0.86.0
v0.85.0
v0.84.0
STATUS
Passing
DOWNLOADS
16,146
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
A year ago
SIZE
498 B
Normalizes the offset value.
1 contributor
Install normalize-offset as a package?
Copied
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
Files
normalizeOffset.js
6 Lines(1 sloc)
1
2
3
4
5
6
7
/**
 * Normalizes the offset value.
 * @param {number|array} value The value to normalize.
 * @returns {number}
 */
export default value => ((typeof value === 'number' || typeof value === 'string') ? [value, value] : value)