solidjs / solid-router

A universal router for Solid inspired by Ember and React Router
MIT License
1.14k stars 146 forks source link

Fix types for cache functions with all optional arguments #392

Closed Brendonovich closed 6 months ago

Brendonovich commented 6 months ago

cache functions with all optional arguments are currently casted to (...args: never[]) => T as [] apparently extends tuples with all optional values. This fixes that by doing the [] extends comparison against the argument list with optionality removed. This should be fine since the only important part of that check is whether there are >0 arguments, we don't really care about the types.

changeset-bot[bot] commented 6 months ago

🦋 Changeset detected

Latest commit: 94797e138772237a27b87577ac58f346e5ad31d3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | --------------- | ----- | | @solidjs/router | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

ryansolid commented 6 months ago

I don't know better but I trust you.