* fix: eslint warnings * refactor: use ramda + sanctuary instead of lodash * refactor: use prettier-standard for formatting * feat: enable security * feat: add graphql * chore: remove trailing commas from linter * docs: new scripts on react and new-admin-server * feat: handle authentication on graphql * fix: perf improvement to date picker * chore: add insecure-dev script to run servers
20 lines
491 B
JavaScript
20 lines
491 B
JavaScript
import * as R from 'ramda'
|
|
|
|
import S from './sanctuary'
|
|
|
|
const toFirstLower = S.compose(S.joinWith(''))(R.adjust(0, S.toLower))
|
|
const toFirstUpper = S.compose(S.joinWith(''))(R.adjust(0, S.toUpper))
|
|
const onlyFirstToUpper = S.compose(toFirstUpper)(S.toLower)
|
|
|
|
const splitOnUpper = R.compose(
|
|
S.splitOn(' '),
|
|
R.replace(/([A-Z])/g, ' $1'),
|
|
toFirstLower
|
|
)
|
|
const startCase = R.compose(
|
|
S.joinWith(' '),
|
|
S.map(onlyFirstToUpper),
|
|
splitOnUpper
|
|
)
|
|
|
|
export { startCase, onlyFirstToUpper }
|