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

Function snakeToCamel

src/config/configuration/converter.ts:39–57  ·  view source on GitHub ↗
(obj: unknown)

Source from the content-addressed store, hash-verified

37}
38
39export function snakeToCamel(obj: unknown): unknown {
40 if (obj === null || obj === undefined) {
41 return null;
42 }
43
44 if (Array.isArray(obj)) {
45 return obj.map(snakeToCamel);
46 }
47
48 if (isRecord(obj)) {
49 const result: Record<string, unknown> = {};
50 for (const [key, value] of Object.entries(obj)) {
51 result[toCamelCase(key)] = snakeToCamel(value);
52 }
53 return result;
54 }
55
56 return obj;
57}

Callers 2

parseConfigYamlFunction · 0.90
serializer.test.tsFile · 0.90

Calls 3

toCamelCaseFunction · 0.85
entriesMethod · 0.80
isRecordFunction · 0.70

Tested by

no test coverage detected