[whatwg/url] Invoking serializer "exclude fragment" from API (#628)

This is a bit of a long shot, but I figured I'd ask...

I found myself needing to serialize a URL via the API, but with "[exclude fragment](https://url.spec.whatwg.org/#url-serializer-exclude-fragment)" being true. 

I'm wondering, could we overload the serializer to accept `{excludeFragment: true}`... imagine something like:

```JS
const str = url.toString({ excludeFragment: true });
const json = url.toJSON({ excludeFragment: true });
```

It's a bit unconventional, but taking the optional argument would be nice for completeness. 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/628

Received on Wednesday, 11 August 2021 01:13:46 UTC