sindresorhus / camelcase-keys

Convert object keys to camel case
MIT License
689 stars 92 forks source link

fix: not recursively camelCase keys in nested objects when using union with null #119

Closed yutak23 closed 1 year ago

yutak23 commented 1 year ago

This ought to fix https://github.com/sindresorhus/camelcase-keys/issues/118.

The bug in the issue is due to the fact that the type ObjectOptional assumed only undefined (optional property), so I have fixed that part.

Supplemental information on testing

Since the type CamelCaseKeys cannot be tested as is, it is tested by specifying the type CamelCaseKeys for the variable after conversion with camelcaseKeys.

The test for index.d.ts before the modification failed as follows, but after the modification, the test passes because the union part works correctly.

image