Files
lodash/upperCase.js
John-David Dalton 6cb3460fce Remove semicolons.
2017-02-05 22:22:04 -08:00

27 lines
649 B
JavaScript

import createCompounder from './.internal/createCompounder.js'
/**
* Converts `string`, as space separated words, to upper case.
*
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the upper cased string.
* @see camelCase, kebabCase, lowerCase, snakeCase, startCase, upperFirst
* @example
*
* upperCase('--foo-bar')
* // => 'FOO BAR'
*
* upperCase('fooBar')
* // => 'FOO BAR'
*
* upperCase('__foo_bar__')
* // => 'FOO BAR'
*/
const upperCase = createCompounder((result, word, index) =>
result + (index ? ' ' : '') + word.toUpperCase()
)
export default upperCase