MCPcopy Create free account
hub / github.com/uiwjs/react-codemirror / toSnakeCase

Function toSnakeCase

www/src/utils/utils.ts:1–6  ·  view source on GitHub ↗
(str: string = '')

Source from the content-addressed store, hash-verified

1export const toSnakeCase = (str: string = '') =>
2 str
3 .match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)
4 ?.map((x) => x.toLowerCase())
5 .join(',')
6 .split(',');
7
8export const toTitleCase = (str: string = '') =>
9 str

Callers 1

ComponentFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…