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.
@@ -3936,18 +3936,11 @@ function pathname(pathname) {
3936
3936
  function appendPathname(pathname) {
3937
3937
  return (options) => {
3938
3938
  const base = es2018$c.go(() => {
3939
- const directoryPathname = es2018$c.go(() => {
3940
- let pathname = options.url.pathname;
3941
- if (!options.url.pathname.endsWith('/')) {
3942
- pathname += '/';
3943
- }
3944
- return pathname;
3945
- });
3946
3939
  const url = new URL(options.url.href);
3947
- url.pathname = directoryPathname;
3940
+ url.pathname = url.pathname.endsWith('/') ? url.pathname : `${url.pathname}/`;
3948
3941
  return url;
3949
3942
  });
3950
- const url = new URL(pathname, base);
3943
+ const url = new URL(pathname.replace(/^\/*/, ''), base);
3951
3944
  return {
3952
3945
  ...options,
3953
3946
  url