UNPKG

@technobuddha/library

Version:
15 lines (14 loc) 436 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.toDotCase = void 0; /** * Convert an identifier string to a dot form * * @param input The identifier string * @returns the identifier in dot form */ function toDotCase(input) { return input.trim().replace(/[-_.\s]+\w/ug, function (c) { return "." + c.slice(-1); }).toLowerCase(); } exports.toDotCase = toDotCase; exports.default = toDotCase;