@deot/helper-route 1.1.4 → 1.1.5

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.
package/dist/index.cjs CHANGED
@@ -59,10 +59,11 @@ const parse = (url, options) => {
59
59
  query[key] = typeof options$.parse === "function" ? options$.parse(value$) : value$;
60
60
  });
61
61
  }
62
- const sIndex = prefix.indexOf("/");
62
+ const pIndex = prefix.indexOf("://");
63
+ const sIndex = prefix.indexOf("/", pIndex === -1 ? 0 : pIndex + 3);
63
64
  return {
64
65
  origin: (sIndex !== -1 ? prefix.slice(0, sIndex) : prefix) || "",
65
- path: prefix.slice(sIndex),
66
+ path: sIndex !== -1 ? prefix.slice(sIndex) : "",
66
67
  query
67
68
  };
68
69
  };
@@ -88,10 +88,11 @@ var HelperRoute = (function (exports) {
88
88
  query[key] = typeof options$.parse === "function" ? options$.parse(value$) : value$;
89
89
  });
90
90
  }
91
- const sIndex = prefix.indexOf("/");
91
+ const pIndex = prefix.indexOf("://");
92
+ const sIndex = prefix.indexOf("/", pIndex === -1 ? 0 : pIndex + 3);
92
93
  return {
93
94
  origin: (sIndex !== -1 ? prefix.slice(0, sIndex) : prefix) || "",
94
- path: prefix.slice(sIndex),
95
+ path: sIndex !== -1 ? prefix.slice(sIndex) : "",
95
96
  query
96
97
  };
97
98
  };
package/dist/index.js CHANGED
@@ -55,10 +55,11 @@ const parse = (url, options) => {
55
55
  query[key] = typeof options$.parse === "function" ? options$.parse(value$) : value$;
56
56
  });
57
57
  }
58
- const sIndex = prefix.indexOf("/");
58
+ const pIndex = prefix.indexOf("://");
59
+ const sIndex = prefix.indexOf("/", pIndex === -1 ? 0 : pIndex + 3);
59
60
  return {
60
61
  origin: (sIndex !== -1 ? prefix.slice(0, sIndex) : prefix) || "",
61
- path: prefix.slice(sIndex),
62
+ path: sIndex !== -1 ? prefix.slice(sIndex) : "",
62
63
  query
63
64
  };
64
65
  };
@@ -91,10 +91,11 @@
91
91
  query[key] = typeof options$.parse === "function" ? options$.parse(value$) : value$;
92
92
  });
93
93
  }
94
- const sIndex = prefix.indexOf("/");
94
+ const pIndex = prefix.indexOf("://");
95
+ const sIndex = prefix.indexOf("/", pIndex === -1 ? 0 : pIndex + 3);
95
96
  return {
96
97
  origin: (sIndex !== -1 ? prefix.slice(0, sIndex) : prefix) || "",
97
- path: prefix.slice(sIndex),
98
+ path: sIndex !== -1 ? prefix.slice(sIndex) : "",
98
99
  query
99
100
  };
100
101
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deot/helper-route",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",