@ahoo-wang/fetcher 0.6.8 → 0.8.0

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/urls.d.ts CHANGED
@@ -1,16 +1,34 @@
1
1
  /**
2
- * 检查给定的 URL 是否为绝对 URL
2
+ * Checks if the given URL is an absolute URL
3
3
  *
4
- * @param url - 需要检查的 URL 字符串
5
- * @returns boolean - 如果是绝对 URL 返回 true,否则返回 false
4
+ * @param url - URL string to check
5
+ * @returns boolean - Returns true if it's an absolute URL, false otherwise
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * isAbsoluteURL('https://api.example.com/users'); // true
10
+ * isAbsoluteURL('/users'); // false
11
+ * isAbsoluteURL('users'); // false
12
+ * ```
6
13
  */
7
14
  export declare function isAbsoluteURL(url: string): boolean;
8
15
  /**
9
- * 将基础 URL 和相对 URL 组合成完整的 URL
16
+ * Combines a base URL and a relative URL into a complete URL
17
+ *
18
+ * @param baseURL - Base URL
19
+ * @param relativeURL - Relative URL
20
+ * @returns string - Combined complete URL
21
+ *
22
+ * @remarks
23
+ * If the relative URL is already an absolute URL, it will be returned as-is.
24
+ * Otherwise, the base URL and relative URL will be combined with proper path separator handling.
10
25
  *
11
- * @param baseURL - 基础 URL
12
- * @param relativeURL - 相对 URL
13
- * @returns string - 组合后的完整 URL
26
+ * @example
27
+ * ```typescript
28
+ * combineURLs('https://api.example.com', '/users'); // https://api.example.com/users
29
+ * combineURLs('https://api.example.com/', 'users'); // https://api.example.com/users
30
+ * combineURLs('https://api.example.com', 'https://other.com/users'); // https://other.com/users
31
+ * ```
14
32
  */
15
33
  export declare function combineURLs(baseURL: string, relativeURL: string): string;
16
34
  //# sourceMappingURL=urls.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"urls.d.ts","sourceRoot":"","sources":["../src/urls.ts"],"names":[],"mappings":"AAaA;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,WAExC;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UAQ/D"}
1
+ {"version":3,"file":"urls.d.ts","sourceRoot":"","sources":["../src/urls.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,WAExC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UAQ/D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ahoo-wang/fetcher",
3
- "version": "0.6.8",
3
+ "version": "0.8.0",
4
4
  "description": "Ultra-lightweight (1.9kB) HTTP client with built-in path parameters and Axios-like API",
5
5
  "keywords": [
6
6
  "fetch",