ramda-extension
Version:
Helpful functions built on top of the mighty Ramda
20 lines (19 loc) • 581 B
JavaScript
import { o, map, toLower } from 'ramda';
import splitByNonAlphaNumeric from './splitByNonAlphaNumeric';
import joinWithDot from './joinWithDot';
/**
* Converts string into dot.case.
*
* @func
* @category String
*
* @example
*
* R_.toDotCase('hello-world') // 'hello.world'
* R_.toDotCase('hello/*? world') // 'hello.world'
* R_.toDotCase(' hello -/ world/ ') // 'hello.world'
*
* @sig String -> String
*/
var toDotCase = /*#__PURE__*/o(joinWithDot, /*#__PURE__*/o( /*#__PURE__*/map(toLower), splitByNonAlphaNumeric));
export default toDotCase;