@technobuddha/library
Version:
A large library of useful functions
16 lines (15 loc) • 590 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.toCapitalCase = void 0;
/**
* Capitalize the first letter of a string
* @param input The string to capitalize
* @param __namedParameters see {@link Options}
* @default lowerCase default
*/
function toCapitalCase(input, _a) {
var _b = _a === void 0 ? {} : _a, _c = _b.lowerCase, lowerCase = _c === void 0 ? false : _c;
return input.charAt(0).toUpperCase() + (lowerCase ? input.slice(1).toLowerCase() : input.slice(1));
}
exports.toCapitalCase = toCapitalCase;
exports.default = toCapitalCase;