extra-request 4.1.0 → 4.1.1

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.
@@ -3907,18 +3907,11 @@
3907
3907
  function appendPathname(pathname) {
3908
3908
  return (options) => {
3909
3909
  const base = es2018$c.go(() => {
3910
- const directoryPathname = es2018$c.go(() => {
3911
- let pathname = options.url.pathname;
3912
- if (!options.url.pathname.endsWith('/')) {
3913
- pathname += '/';
3914
- }
3915
- return pathname;
3916
- });
3917
3910
  const url = new URL(options.url.href);
3918
- url.pathname = directoryPathname;
3911
+ url.pathname = url.pathname.endsWith('/') ? url.pathname : `${url.pathname}/`;
3919
3912
  return url;
3920
3913
  });
3921
- const url = new URL(pathname, base);
3914
+ const url = new URL(pathname.replace(/^\/*/, ''), base);
3922
3915
  return Object.assign(Object.assign({}, options), { url });
3923
3916
  };
3924
3917
  }