yesmeck / remix-routes

Typesafe routing for your Remix apps.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Empty params always required

moishinetzer opened this issue · comments

It seems the latest release introduced a bug that requires the second param to always be required, even when the route does not require any paths.

I was surprised the test-suite doesnt catch this, I'll try make a PR for it.

image

It seems as though whilst this package tests for functionality. However, it doesn't test for type safety specifically. I'm unsure how to approach this, but if you can direct me a bit, I'm happy to do so.

Furthermore, if there are params, the third parameter is also required. For example: $path("/foo/:bar", { bar: "baz" }, {}) works instead of just $path("/foo/:bar", { bar: "baz" }).

Sorry for the bug, the original generated types are very simple, so I didn't add tests for them. Now they are relatively complex now, I'm adding type check to CI in #44

Should be fixed in 1.4.1