UNPKG

@technobuddha/library

Version:
15 lines (14 loc) 442 B
"use strict"; 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;