COLLECTED BY
Organization:
Internet Archive
Focused crawls are collections of frequently-updated webcrawl data from narrow (as opposed to broad or wide) web crawls, often focused on a single domain or subdomain.
The Wayback Machine - https://web.archive.org/web/20201220222735/https://github.com/lodash/lodash/blob/master/upperCase.js
Permalink
Cannot retrieve contributors at this time
29 lines (27 sloc)
723 Bytes
import words from './words.js'
import toString from './toString.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 = ( string ) => (
words ( toString ( string ) . replace ( /[ '\u 2019] /g , '' ) ) . reduce ( ( result , word , index ) => (
result + ( index ? ' ' : '' ) + word . toUpperCase ( )
) , '' )
)
export default upperCase
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.