UNPKG

@technobuddha/library

Version:
17 lines (16 loc) 630 B
"use strict"; 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;