@visulima/string
Version:
Functions for manipulating strings.
12 lines (10 loc) • 460 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");
export { upperFirst as default };