@secret-momo/utils 1.1.1 → 1.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.
package/lib/url.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 移除 url 中的 query 参数
2
+ * 移除 url 中的 query 参数,并去掉末尾的 /
3
3
  */
4
4
  export declare function removeQueryParams(url: string): string;
5
5
  export declare function getRedirectUrl(url: string): Promise<string>;
package/lib/url.js CHANGED
@@ -1 +1 @@
1
- import{fetch as r,userAgent as a}from"./fetch.js";function n(e){return e.split("?")[0]??e}async function s(e){const t=await r(e,{method:"GET",redirect:"manual",headers:{"User-Agent":a}});return t.status>=300&&t.status<400&&t.headers.get("location")||e}export{s as getRedirectUrl,n as removeQueryParams};
1
+ import{fetch as r,userAgent as s}from"./fetch.js";function n(e){const t=e.split("?")[0]??e;return t.endsWith("/")?t.slice(0,-1):t}async function a(e){const t=await r(e,{method:"GET",redirect:"manual",headers:{"User-Agent":s}});return t.status>=300&&t.status<400&&t.headers.get("location")||e}export{a as getRedirectUrl,n as removeQueryParams};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secret-momo/utils",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "module": "src/index.ts",
5
5
  "type": "module",
6
6
  "publishConfig": {