@intlayer/config
Version:
Retrieve Intlayer configurations and manage environment variables for both server-side and client-side environments.
15 lines (14 loc) • 541 B
JavaScript
//#region src/utils/stringFormatter/camelCaseToSentence.ts
/**
* Convert a string to sentence case
* e.g. 'my-new-component' → 'My new component'
*/
const camelCaseToSentence = (value) => {
if (!value) return "";
if (typeof value !== "string") return "";
const withSpaces = value.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2");
return withSpaces.charAt(0).toUpperCase() + withSpaces.slice(1).toLowerCase();
};
//#endregion
export { camelCaseToSentence };
//# sourceMappingURL=camelCaseToSentence.mjs.map