@technobuddha/library
Version:
A large library of useful functions
17 lines (16 loc) • 630 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.toSmallWordsCase = void 0;
/**
* Convert the first letter of each word in a string to lower case
*
* @param input The string to make small case
* @default upperCase false
* @returns string in small case
*/
function toSmallWordsCase(input, _a) {
var _b = _a === void 0 ? {} : _a, _c = _b.upperCase, upperCase = _c === void 0 ? false : _c;
return (upperCase ? input.toUpperCase() : input).replace(/\b\w/ug, function (c) { return c.toLowerCase(); });
}
exports.toSmallWordsCase = toSmallWordsCase;
exports.default = toSmallWordsCase;