js-plugin icon indicating copy to clipboard operation
js-plugin copied to clipboard

[Bug]: Types for `from` and `to` are too restrictive

Open hirasso opened this issue 1 year ago • 0 comments

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? 📚

hirasso avatar Apr 05 '24 17:04 hirasso