@visulima/string
Version:
Functions for manipulating strings.
14 lines (11 loc) • 470 B
JavaScript
;
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
const upperFirst = /* @__PURE__ */ __name((value, options) => {
if (typeof value !== "string" || value === "") {
return "";
}
const firstChar = options?.locale ? value[0].toLocaleUpperCase(options.locale) : value[0].toUpperCase();
return firstChar + value.slice(1);
}, "upperFirst");
module.exports = upperFirst;