alge icon indicating copy to clipboard operation
alge copied to clipboard

decoder return type should forbid excess properties

Open jasonkuhrt opened this issue 3 years ago • 1 comments

Screenshot

CleanShot 2022-08-20 at 23 11 41@2x

Description

size2 should not be allowed because it is not a known property. (Notice size is not required because it has a default).

jasonkuhrt avatar Aug 20 '22 21:08 jasonkuhrt

Oh darn, right, this is not possible currently:

  • https://github.com/microsoft/TypeScript/issues/241
  • https://stackoverflow.com/questions/63258306/how-to-force-typescript-excess-property-check-on-function-return-value
  • https://github.com/microsoft/TypeScript/pull/40311

jasonkuhrt avatar Aug 24 '22 03:08 jasonkuhrt