@technobuddha/library
Version:
A large library of useful functions
15 lines (14 loc) • 442 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.toDashCase = void 0;
/**
* Convert an identifier string to a dash form
*
* @param input The identifier string
* @returns the ientifier in dash form
*/
function toDashCase(input) {
return input.trim().replace(/[-_.\s]+\w/ug, function (c) { return "-" + c.slice(-1); }).toLowerCase();
}
exports.toDashCase = toDashCase;
exports.default = toDashCase;