diff options
Diffstat (limited to 'library/moment/src/lib/units/aliases.js')
-rw-r--r-- | library/moment/src/lib/units/aliases.js | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/library/moment/src/lib/units/aliases.js b/library/moment/src/lib/units/aliases.js deleted file mode 100644 index 4ad513384..000000000 --- a/library/moment/src/lib/units/aliases.js +++ /dev/null @@ -1,29 +0,0 @@ -import hasOwnProp from '../utils/has-own-prop'; - -var aliases = {}; - -export function addUnitAlias (unit, shorthand) { - var lowerCase = unit.toLowerCase(); - aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit; -} - -export function normalizeUnits(units) { - return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; -} - -export function normalizeObjectUnits(inputObject) { - var normalizedInput = {}, - normalizedProp, - prop; - - for (prop in inputObject) { - if (hasOwnProp(inputObject, prop)) { - normalizedProp = normalizeUnits(prop); - if (normalizedProp) { - normalizedInput[normalizedProp] = inputObject[prop]; - } - } - } - - return normalizedInput; -} |