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

Version Path
playbook_ui-10.13.0 app/pb_kits/playbook/utilities/text.js
playbook_ui-10.13.0.pre.node.update app/pb_kits/playbook/utilities/text.js
playbook_ui-10.12.0 app/pb_kits/playbook/utilities/text.js
playbook_ui-10.11.0 app/pb_kits/playbook/utilities/text.js
playbook_ui-10.10.0 app/pb_kits/playbook/utilities/text.js
playbook_ui-10.9.0 app/pb_kits/playbook/utilities/text.js
playbook_ui-10.8.1.pre.alpha.flexdeps app/pb_kits/playbook/utilities/text.js
playbook_ui-10.9.0.pre.alpha1 app/pb_kits/playbook/utilities/text.js
playbook_ui-10.8.0 app/pb_kits/playbook/utilities/text.js
playbook_ui-10.7.1 app/pb_kits/playbook/utilities/text.js
playbook_ui-10.7.0 app/pb_kits/playbook/utilities/text.js
playbook_ui-10.6.2.pre.alpha.dep app/pb_kits/playbook/utilities/text.js
playbook_ui-10.6.1.pre.alpha1 app/pb_kits/playbook/utilities/text.js
playbook_ui-10.6.0 app/pb_kits/playbook/utilities/text.js
playbook_ui-10.5.0 app/pb_kits/playbook/utilities/text.js
playbook_ui-10.4.0 app/pb_kits/playbook/utilities/text.js
playbook_ui-10.3.0 app/pb_kits/playbook/utilities/text.js
playbook_ui-10.2.1.alpha.sisensefix app/pb_kits/playbook/utilities/text.js
playbook_ui-10.2.1 app/pb_kits/playbook/utilities/text.js
playbook_ui-10.2.0 app/pb_kits/playbook/utilities/text.js