kwhitley / itty-router

A little router.
MIT License
1.76k stars 78 forks source link

Bugfix/ts expect error is a bug #205

Closed Crisfole closed 9 months ago

Crisfole commented 9 months ago

Description

This fixes a few type places where you opt out of TS with 'expect-error' in the flow branch. Most are just instances of missing extends that you actually already had elsewhere. One is using an as instead of an ts-expect-error.

The problem with the expect-error is that if you miss something else you could introduce bugs since it is line level ignoring. By using an as you assert to the compiler it's getting something wrong, but in exchange the compiler trusts you and continues checking everything else that it can.

Related Issue

Link to the related issue: None

Type of Change (select one and follow subtasks)