-
- Notifications
You must be signed in to change notification settings - Fork 1
Description
This was my first TypeScript project and I'm really struggling with how to deal with types on freeform objects. That is to say, I need to operate on objects that I don't control, so I can't define a tight schema for them.
That's where KeyableObject comes in. I created this interface to represent an object which may or may not have a key property.
I was able to avoid any almost everywhere, except for in two of the KeyGenerators parameters (actually, in the GeneratorFuncs that the KeyGenerators provide).
https://github.com/dlh3/react-key-generator/blob/master/src/keyGenerators.ts#L14-L23
I would appreciate any community help to eliminate those two uses of any, and perhaps cleanup the typing in any other ways you see fit.
I am hoping I can convince @cwparsons to help out here. 😉