]> git.ipfire.org Git - thirdparty/vuejs/router.git/commit
fix: remove nullish params when resolving (#1814)
authorskirtle <65301168+skirtles-code@users.noreply.github.com>
Mon, 24 Apr 2023 07:50:07 +0000 (08:50 +0100)
committerGitHub <noreply@github.com>
Mon, 24 Apr 2023 07:50:07 +0000 (09:50 +0200)
commit15e20cbb7baedb42e44e10d5d69ffb2a3124360f
tree3723b1a52e141a7d0ea4d5e6519adfa5187934b2
parentdcafc02fe20cda13874d5236dc75101dbf0c7aa4
fix: remove nullish params when resolving (#1814)

NOTES: This change improves allows passing `null` or `undefined` to a param to completely drop. In practice, this should be better than casting it to an empty string but it should make no change if you check the absence of empty params with `!route.params.optional` rather than `route.params.optional !== ''` or any other stricter check. If you were doing stricter checks for optional params, make sure to change them to looser checks. Note that when resolving from the URL, optional parameters are always absent in the resolved object.
packages/router/__tests__/router.spec.ts
packages/router/src/router.ts