7 lines
106 B
TypeScript
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,
|
||
|
});
|