unjs/ufo

`searchParams` and `query` cannot be correctly mutated on $URL instance

Closed this issue · 1 comments

Environment

ufo@1.3.2

node 18.18.0

Reproduction

https://stackblitz.com/edit/stackblitz-starters-nmd1v4?file=package-lock.json

Describe the bug

  1. Query cannot be correctly mutated in case of $URL without / at the end
  2. searchParams method creates new URLSearchParams instance which cannot be mutated. I would like the same behavior as in browser/node URL. Maybe it shouldn't be a getter, just a class field?

Additional context

No response

Logs

No response

pi0 commented

Hi dear @vara855 thanks for reporting this issue. Since we are deprecating $URL support, this issue is probably not going to be solved. I would highly recommend to upgrade to native URL with new URL.