updux/foo.ts
2023-03-02 11:10:25 -05:00

7 lines
106 B
TypeScript

const foo = <A, B>(x: Partial<{ a: A; b: B }>) => x as B;
const y = foo({
a: 'potato',
b: 2,
});