UNPKG

@technobuddha/library

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