keq 2.7.1 → 2.7.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/CHANGELOG.md +14 -0
- package/dist/esm/src/keq.d.ts +1 -1
- package/dist/esm/src/keq.js +2 -2
- package/dist/esm/src/types/keq-operation.d.ts +1 -1
- package/dist/esm/src/util/clone-body.js +1 -1
- package/dist/umd/src/keq.d.ts +1 -1
- package/dist/umd/src/keq.js +2 -2
- package/dist/umd/src/types/keq-operation.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [2.7.3](https://github.com/keq-request/keq/compare/v2.7.2...v2.7.3) (2024-08-13)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* .set(key, value) cannot set the number type value when adding a custom header ([2085cc6](https://github.com/keq-request/keq/commit/2085cc613f68b26018fdabb3b6bb39d0b208a50e))
|
|
11
|
+
|
|
12
|
+
## [2.7.2](https://github.com/keq-request/keq/compare/v2.7.1...v2.7.2) (2024-08-13)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Performance Improvements
|
|
16
|
+
|
|
17
|
+
* allow header to add number type fields ([bacacaa](https://github.com/keq-request/keq/commit/bacacaac66d9e249a6b66d539bafb94d9f064869))
|
|
18
|
+
|
|
5
19
|
## [2.7.1](https://github.com/keq-request/keq/compare/v2.7.0...v2.7.1) (2024-07-20)
|
|
6
20
|
|
|
7
21
|
|
package/dist/esm/src/keq.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare class Keq<OUTPUT, OPERATION extends Omit<KeqOperation, 'responseB
|
|
|
27
27
|
set<T extends keyof KeqBaseOperation['requestHeaders']>(name: T, value: KeqBaseOperation['requestHeaders'][T]): this;
|
|
28
28
|
set(headers: Headers): this;
|
|
29
29
|
set(headers: Record<string, string>): this;
|
|
30
|
-
set(name: string, value: string): this;
|
|
30
|
+
set(name: string, value: string | number): this;
|
|
31
31
|
/**
|
|
32
32
|
* Set request query/searchParams
|
|
33
33
|
*/
|
package/dist/esm/src/keq.js
CHANGED
|
@@ -39,14 +39,14 @@ export class Keq extends Core {
|
|
|
39
39
|
if (!isValidHeaderValue(value)) {
|
|
40
40
|
throw new Exception(`[Invalid header] Key: ${headersOrName} Value: ${value}`);
|
|
41
41
|
}
|
|
42
|
-
this.requestContext.headers.set(headersOrName, value);
|
|
42
|
+
this.requestContext.headers.set(headersOrName, String(value));
|
|
43
43
|
}
|
|
44
44
|
else if (typeof headersOrName === 'object') {
|
|
45
45
|
for (const [key, value] of Object.entries(headersOrName)) {
|
|
46
46
|
if (!isValidHeaderValue(value)) {
|
|
47
47
|
throw new Exception(`[Invalid header] Key: ${key} Value: ${value}`);
|
|
48
48
|
}
|
|
49
|
-
this.requestContext.headers.set(key, value);
|
|
49
|
+
this.requestContext.headers.set(key, String(value));
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
return this;
|
|
@@ -9,7 +9,7 @@ export interface KeqOperation {
|
|
|
9
9
|
[key: string]: string | string[] | number;
|
|
10
10
|
};
|
|
11
11
|
requestHeaders: {
|
|
12
|
-
[key: string]: string;
|
|
12
|
+
[key: string]: string | number;
|
|
13
13
|
};
|
|
14
14
|
requestBody: FormData | URLSearchParams | object | Array<any> | string;
|
|
15
15
|
responseBody: any;
|
package/dist/umd/src/keq.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare class Keq<OUTPUT, OPERATION extends Omit<KeqOperation, 'responseB
|
|
|
27
27
|
set<T extends keyof KeqBaseOperation['requestHeaders']>(name: T, value: KeqBaseOperation['requestHeaders'][T]): this;
|
|
28
28
|
set(headers: Headers): this;
|
|
29
29
|
set(headers: Record<string, string>): this;
|
|
30
|
-
set(name: string, value: string): this;
|
|
30
|
+
set(name: string, value: string | number): this;
|
|
31
31
|
/**
|
|
32
32
|
* Set request query/searchParams
|
|
33
33
|
*/
|
package/dist/umd/src/keq.js
CHANGED
|
@@ -51,14 +51,14 @@
|
|
|
51
51
|
if (!(0, is_valid_header_value_js_1.isValidHeaderValue)(value)) {
|
|
52
52
|
throw new exception_js_1.Exception(`[Invalid header] Key: ${headersOrName} Value: ${value}`);
|
|
53
53
|
}
|
|
54
|
-
this.requestContext.headers.set(headersOrName, value);
|
|
54
|
+
this.requestContext.headers.set(headersOrName, String(value));
|
|
55
55
|
}
|
|
56
56
|
else if (typeof headersOrName === 'object') {
|
|
57
57
|
for (const [key, value] of Object.entries(headersOrName)) {
|
|
58
58
|
if (!(0, is_valid_header_value_js_1.isValidHeaderValue)(value)) {
|
|
59
59
|
throw new exception_js_1.Exception(`[Invalid header] Key: ${key} Value: ${value}`);
|
|
60
60
|
}
|
|
61
|
-
this.requestContext.headers.set(key, value);
|
|
61
|
+
this.requestContext.headers.set(key, String(value));
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
return this;
|
|
@@ -9,7 +9,7 @@ export interface KeqOperation {
|
|
|
9
9
|
[key: string]: string | string[] | number;
|
|
10
10
|
};
|
|
11
11
|
requestHeaders: {
|
|
12
|
-
[key: string]: string;
|
|
12
|
+
[key: string]: string | number;
|
|
13
13
|
};
|
|
14
14
|
requestBody: FormData | URLSearchParams | object | Array<any> | string;
|
|
15
15
|
responseBody: any;
|