@ahoo-wang/fetcher 2.8.2 → 2.8.3
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.es.js +132 -127
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/orderedCapable.d.ts +29 -11
- package/dist/orderedCapable.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/orderedCapable.d.ts
CHANGED
|
@@ -1,22 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Interface for objects that can be ordered
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Lower
|
|
7
|
-
*
|
|
4
|
+
* This interface allows objects to specify their execution or display order.
|
|
5
|
+
* Objects implementing this interface can be sorted using the `toSorted` function.
|
|
6
|
+
* Lower order values indicate higher priority (executed/displayed first).
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const interceptor: OrderedCapable = { order: 10 };
|
|
11
|
+
* const highPriority: OrderedCapable = { order: -5 };
|
|
12
|
+
* ```
|
|
8
13
|
*/
|
|
9
14
|
export interface OrderedCapable {
|
|
10
15
|
/**
|
|
11
|
-
*
|
|
16
|
+
* Optional order value for sorting
|
|
17
|
+
*
|
|
18
|
+
* - Lower values have higher priority (sorted first)
|
|
19
|
+
* - Supports negative, zero, and positive numbers
|
|
20
|
+
* - Defaults to 0 if undefined
|
|
21
|
+
* - Equal values maintain original relative order (stable sort)
|
|
12
22
|
*
|
|
13
|
-
*
|
|
14
|
-
* positive numbers are all supported.
|
|
15
|
-
* When multiple elements have the same order value, their relative order
|
|
16
|
-
* will remain unchanged (stable sort).
|
|
23
|
+
* @default 0
|
|
17
24
|
*/
|
|
18
|
-
order
|
|
25
|
+
order?: number;
|
|
19
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Comparator function for sorting OrderedCapable elements
|
|
29
|
+
*
|
|
30
|
+
* Compares two elements based on their order property. Elements with lower order values
|
|
31
|
+
* are sorted first. If order is undefined, defaults to DEFAULT_ORDER (0).
|
|
32
|
+
*
|
|
33
|
+
* @param a - First element to compare
|
|
34
|
+
* @param b - Second element to compare
|
|
35
|
+
* @returns Negative if a < b, positive if a > b, zero if equal
|
|
36
|
+
*/
|
|
37
|
+
export declare function sortOrder<T extends OrderedCapable>(a: T, b: T): number;
|
|
20
38
|
/**
|
|
21
39
|
* Sorts an array of elements that implement the OrderedCapable interface
|
|
22
40
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orderedCapable.d.ts","sourceRoot":"","sources":["../src/orderedCapable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"orderedCapable.d.ts","sourceRoot":"","sources":["../src/orderedCapable.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,MAAM,CAEtE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,cAAc,EAC/C,KAAK,EAAE,CAAC,EAAE,EACV,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,GAC5B,CAAC,EAAE,CAKL"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ahoo-wang/fetcher",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.3",
|
|
4
4
|
"description": "Fetcher is not just another HTTP client—it's a complete ecosystem designed for modern web development with native LLM\nstreaming API support. Built on the native Fetch API, Fetcher provides an Axios-like experience with powerful features\nwhile maintaining an incredibly small footprint.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fetch",
|