extra-request 4.1.0 → 4.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3901,18 +3901,15 @@ function pathname(pathname) {
3901
3901
  function appendPathname(pathname) {
3902
3902
  return (options) => {
3903
3903
  const base = es2018$c.go(() => {
3904
- const directoryPathname = es2018$c.go(() => {
3905
- let pathname = options.url.pathname;
3906
- if (!options.url.pathname.endsWith('/')) {
3907
- pathname += '/';
3908
- }
3909
- return pathname;
3910
- });
3911
3904
  const url = new URL(options.url.href);
3912
- url.pathname = directoryPathname;
3905
+ url.pathname = url.pathname.endsWith('/')
3906
+ ? url.pathname
3907
+ : `${url.pathname}/`;
3913
3908
  return url;
3914
3909
  });
3915
- const url = new URL(pathname, base);
3910
+ const url = new URL(pathname.replace(/^\/*/, ''), base);
3911
+ url.search = base.search;
3912
+ url.hash = base.hash;
3916
3913
  return Object.assign(Object.assign({}, options), { url });
3917
3914
  };
3918
3915
  }