dot-diver
dot-diver copied to clipboard
Index signature in object gets ignored
Example Type:
export type ExampleType = {
id: number
} & Record<`test_data.${string}`, number | string | boolean>
Here test_data.foo is not a valid path in getByPath and will throw a typescript error.
Well this is not actually a error. Path with '.' have to be ignored at the moment, since we can't distinguish between actually accessing a nested object or accessing a property which key contains a '.'. Any idea for a elegant solution to still allow this? @saibotk
Closing this issue for now, since i see now way to allow properties with dots.