Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

252 B
Raw Blame
export const camelCaseToWords = (str: string) => {
  return str
    .replaceAll('_', ' ')
    .trim()
    .replaceAll(/([A-Z])/g, ' $1')
    .trim()
    .replace(/^./, (str) => str.toUpperCase())
    .replaceAll(/\s./g, (str) => str.toUpperCase());
};