Sha256: 8340d281243a1690009c5e43be50ea698f2cb966c6dd55495932805a133a37b1
Contents?: true
Size: 411 Bytes
Versions: 351
Compression:
Stored size: 411 Bytes
Contents
import { filter, isEmpty } from 'lodash' const titleizedWord = (string) => ( string.charAt(0).toUpperCase() + string.slice(1).toLowerCase() ) export const titleize = (sentence) => ( isEmpty(sentence) ? sentence : sentence.split(' ').map(titleizedWord).join(' ') ) const notEmpty = (value) => !isEmpty(value) export const joinPresent = (array, separator) => ( filter(array, notEmpty).join(separator) )
Version data entries
351 entries across 351 versions & 1 rubygems