import createCompounder from './.internal/createCompounder.js'; /** * Converts `string`, as space separated words, to upper case. * * @static * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the upper cased string. * @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;