UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

35 lines (34 loc) 922 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.upperFirst = void 0; const createCaseFirst_1 = __importDefault(require("./.internal/createCaseFirst")); /** * @ignore */ const internalUpperFirst = (0, createCaseFirst_1.default)("toUpperCase"); /** * Converts the first character of `string` to upper case. * * @since 5.5.1 * @category String * @param str The string to convert. * @returns Returns the converted string. * @see camelCase, kebabCase, lowerCase, snakeCase, startCase, upperCase * @example * * ```js * upperFirst('fred') * // => 'Fred' * * upperFirst('FRED') * // => 'FRED' * ``` */ function upperFirst(str = "") { return internalUpperFirst(str); } exports.upperFirst = upperFirst; exports.default = upperFirst;