We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
camelToSnakeObjectDeep
1 parent 6dbce47 commit f236a51Copy full SHA for f236a51
alchemy/src/util/camel-to-snake.ts
@@ -14,7 +14,11 @@ export function camelToSnakeObjectDeep<T extends object | undefined>(
14
.replace(/([a-z])([A-Z])/g, "$1_$2") // Handle normal camelCase: "fooBar" -> "foo_Bar"
15
.toLowerCase(),
16
Array.isArray(value)
17
- ? value.map(camelToSnakeObjectDeep)
+ ? value.map((element) =>
18
+ typeof element === "object" && element !== null
19
+ ? camelToSnakeObjectDeep(element)
20
+ : element,
21
+ )
22
: typeof value === "object" && value !== null
23
? camelToSnakeObjectDeep(value)
24
: value,
0 commit comments