ianstormtaylor / superstruct

A simple and composable way to validate data in JavaScript (and TypeScript).
https://docs.superstructjs.org
MIT License
6.96k stars 223 forks source link

Fixes #1192 - extends abstract (and non-abstract) class #1193

Open matthew-dean opened 10 months ago

matthew-dean commented 10 months ago

I tested this as a PNPM patch, and it seemed to work locally. It's the same syntax InstanceType uses.

I think, in TypeScript terms, new () => any is a subtype of abstract new () => any, so this ends up covering both cases.