ramda-extension
Version:
Helpful functions built on top of the mighty Ramda
32 lines (26 loc) • 884 B
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _ramda = require("ramda");
var _splitByNonAlphaNumeric = _interopRequireDefault(require("./splitByNonAlphaNumeric"));
var _joinWithDash = _interopRequireDefault(require("./joinWithDash"));
/**
* Converts string into kebab-case.
*
* @func
* @category String
*
* @example
*
* R_.toKebabCase('hello-world') // 'hello-world'
* R_.toKebabCase('hello- world') // 'hello-world'
* R_.toKebabCase(' hello-/ world/ ') // 'hello-world'
*
* @sig String -> String
*/
var toKebabCase = (0, _ramda.o)(_joinWithDash.default, (0, _ramda.o)((0, _ramda.map)(_ramda.toLower), _splitByNonAlphaNumeric.default));
var _default = toKebabCase;
exports.default = _default;