MCPcopy Create free account
hub / github.com/nodejs/node / camelize

Function camelize

deps/v8/tools/turbolizer/src/common/util.ts:13–24  ·  view source on GitHub ↗
(obj: any)

Source from the content-addressed store, hash-verified

11}
12
13export function camelize(obj: any): any {
14 if (Array.isArray(obj)) {
15 return obj.map(value => camelize(value));
16 } else if (obj !== null && obj.constructor === Object) {
17 return Object.keys(obj).reduce((result, key: string) => ({
18 ...result,
19 [snakeToCamel(key)]: camelize(obj[key])
20 }), {},
21 );
22 }
23 return obj;
24}
25
26export function sortUnique<T>(arr: Array<T>, comparator: (a: T, b: T) => number,
27 equals: (a: T, b: T) => boolean): Array<T> {

Callers 1

parsePhasesMethod · 0.90

Calls 4

snakeToCamelFunction · 0.85
reduceMethod · 0.80
mapMethod · 0.65
keysMethod · 0.65

Tested by

no test coverage detected