ts-object-path
ts-object-path copied to clipboard
Bug report: There is no type checking on arrays.
Take this example from the tests:
it('Works with arrays', () => {
const o: ITest = { one: 5, four: [null, { firrst: 4 }] };
expect(get<ITest, number>(o, (p) => p.four[0].firrst)).toBeUndefined();
expect(get<ITest, number>(o, (p) => p.four[1].firrst)).toEqual(4);
});
Expected:
The type of the element returned from the indexed access on the four array is null | {firrst: number}
.
Actual:
It is any