UNPKG

ramda-extension

Version:

Helpful functions built on top of the mighty Ramda

21 lines (20 loc) 634 B
import { o, map } from 'ramda'; import splitByNonAlphaNumeric from './splitByNonAlphaNumeric'; import toUpperFirst from './toUpperFirst'; import listToString from './listToString'; /** * Converts string into PascalCase. * * @func * @category String * * @example * * R_.toPascalCase('hello-world') // 'HelloWorld' * R_.toPascalCase('hello- world') // 'HelloWorld' * R_.toPascalCase(' hello-/ world/ ') // 'HelloWorld' * * @sig String -> String */ var toPascalCase = /*#__PURE__*/o(listToString, /*#__PURE__*/o( /*#__PURE__*/map(toUpperFirst), splitByNonAlphaNumeric)); export default toPascalCase;