MCPcopy Create free account
hub / github.com/ColmapView/Colmapview.github.io / toSnakeCase

Function toSnakeCase

src/config/configuration/converter.ts:3–5  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

1type JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue };
2
3function toSnakeCase(str: string): string {
4 return str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
5}
6
7function toCamelCase(str: string): string {
8 return str.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());

Callers 1

camelToSnakeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected