UNPKG

@gvray/eskit

Version:

A rich and colorful toolkit about typescript and javascript.

32 lines 1.08 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var toString_1 = __importDefault(require("./toString")); /** * Converts the first character of a string to lowercase. * 将字符串的第一个字符转换为小写。 * * @param value - The string to convert / 要转换的字符串 * @returns The string with the first character in lowercase / 第一个字符为小写的字符串 * * @example * ```typescript * lowerFirst('Apple') // "apple" * lowerFirst('HELLO WORLD') // "hELLO WORLD" * lowerFirst('Hello') // "hello" * lowerFirst('') // "" * lowerFirst('A') // "a" * lowerFirst('123ABC') // "123ABC" * lowerFirst('Åpple') // "åpple" (works with Unicode) * ``` * * @since 1.0.0 */ var lowerFirst = function (value) { var str = (0, toString_1.default)(value); return str.charAt(0).toLowerCase() + str.substring(1); }; exports.default = lowerFirst; //# sourceMappingURL=lowerFirst.js.map