lamassu-server/new-lamassu-admin/src/utils/string.js
Rafael Taranto b8e0c2175b feat: add graphql support (#349)
* 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
2019-12-24 15:36:41 +01:00

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 }