js-plugin
js-plugin copied to clipboard
[Bug]: Types for `from` and `to` are too restrictive
What did you expect? ð§
I'd expect from and to to accept any value compatible to path-to-regexp:
-
string -
string[] -
RegExp
What actually happened? ðµâð«
Only string is accepted, otherwise TypeScript complains
Solution
Use the type Path exported by swup for the types.
Swup and plugin versions ð
current versions
What browsers are you seeing the problem on? ð§
No response
Relevant log output ð€
No response
URL to minimal reproduction ð
n/a
Checked all these? ð
- [X] I have read and searched the official docs
- [X] I have checked discussions and existing issues for related problems
- [X] I agree to follow this project's Code of Conduct
- [X] I have provided all necessary information to the best of my knowledge