File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,16 +66,14 @@ type CamelCaseKeys<
6666 ]
6767 ? T [ P ]
6868 : [ Deep ] extends [ true ]
69- ? T [ P ] extends Record < string , any >
70- ? CamelCaseKeys <
71- T [ P ] ,
72- Deep ,
73- IsPascalCase ,
74- Exclude ,
75- StopPaths ,
76- AppendPath < Path , P >
77- >
78- : T [ P ]
69+ ? CamelCaseKeys <
70+ T [ P ] ,
71+ Deep ,
72+ IsPascalCase ,
73+ Exclude ,
74+ StopPaths ,
75+ AppendPath < Path , P >
76+ >
7977 : T [ P ] ;
8078 }
8179 // Return anything else as-is.
Original file line number Diff line number Diff line change @@ -36,6 +36,26 @@ expectType<{fooBar: {fooBar: {fooBar: boolean}}}>(
3636 )
3737) ;
3838
39+ interface ObjectOrUndefined {
40+ foo_bar : {
41+ foo_bar : {
42+ foo_bar : boolean ;
43+ } | undefined ;
44+ } ;
45+ }
46+
47+ const objectOrUndefined : ObjectOrUndefined = {
48+ foo_bar : {
49+ foo_bar : {
50+ foo_bar : true
51+ }
52+ }
53+ } ;
54+
55+ expectType < { fooBar : { fooBar : { fooBar : boolean } | undefined } } > (
56+ camelcaseKeys ( objectOrUndefined , { deep : true } )
57+ ) ;
58+
3959expectType < { FooBar : boolean } > (
4060 camelcaseKeys ( { 'foo-bar' : true } , { pascalCase : true } )
4161) ;
You can’t perform that action at this time.
0 commit comments