keq 2.7.1 → 2.7.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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
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.2](https://github.com/keq-request/keq/compare/v2.7.1...v2.7.2) (2024-08-13)
6
+
7
+
8
+ ### Performance Improvements
9
+
10
+ * allow header to add number type fields ([bacacaa](https://github.com/keq-request/keq/commit/bacacaac66d9e249a6b66d539bafb94d9f064869))
11
+
5
12
  ## [2.7.1](https://github.com/keq-request/keq/compare/v2.7.0...v2.7.1) (2024-07-20)
6
13
 
7
14
 
@@ -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;
@@ -1,4 +1,4 @@
1
- import { isBuffer } from "../is/is-buffer.js";
1
+ import { isBuffer } from '../is/is-buffer.js';
2
2
  import { isBlob } from '../is/is-blob.js';
3
3
  import { isFile } from '../is/is-file.js';
4
4
  import { isFormData } from '../is/is-form-data.js';
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keq",
3
- "version": "2.7.1",
3
+ "version": "2.7.2",
4
4
  "description": "Request API write by Typescript for flexibility, readability, and a low learning curve.",
5
5
  "keywords": [
6
6
  "request",