You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{pick}from'lodash';import{test}from'vitest';// ✅test('Pick',function(){typea=Pick<{foo: number},// @ts-expect-error Should prevent picking missing properties'bar'>;// @ts-expect-error Non-picked properties should not existtypeb=a['foo'];});// ❌test('pick',function(){constp=pick({foo: 1},[// @ts-expect-error Should prevent picking missing properties'bar',// ❌ Does not cause a type error]);// @ts-expect-error Non-picked properties should not existp.foo===1;// ❌ Does not cause a type error});
I expected
pick
to agree with TypeScript'sPick
, but it does not:Also see
index.test-d.ts
in this codesandbox.Is the aim of
pick
to agree withPick
?The text was updated successfully, but these errors were encountered: