ngrx-store-localstorage
ngrx-store-localstorage copied to clipboard
Fix typing for KeyConfiguration
The type for KeyConfiguration doesn't allow for a child key to contain a simple string next to other KeyConfigurations.
keys: [
{ doorway: ['settings'] },
'router',
{
jwtAuth: [
{ jwt: ['sub', 'subjectDn'] },
'token',
{
userPreferences: ['darkMode', 'acknowledgedCompliance']
}
]
}
],
It errors out on token
saying it's not assignable to type of KeyConfiguration.
If I modify the type to be
interface KeyConfiguration {
[key: string]: Keys | Options | ((key: string, value: any) => any);
}
Then it all seems to work just fine. Might need more testing with some other deep object scenarios, but it seems to work so far for me in the case above.