Packages

A web application in pursuit of meaning in life.

Retired package: Complete rewrite, scratch old versions

Current section

Files

Jump to
udia assets node_modules mout src string hyphenate.js
Raw

assets/node_modules/mout/src/string/hyphenate.js

define(['../lang/toString', './slugify', './unCamelCase'], function(toString, slugify, unCamelCase){
/**
* Replaces spaces with hyphens, split camelCase text, remove non-word chars, remove accents and convert to lower case.
*/
function hyphenate(str){
str = toString(str);
str = unCamelCase(str);
return slugify(str, "-");
}
return hyphenate;
});