rekwest 7.2.7 → 8.0.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/README.md CHANGED
@@ -22,7 +22,7 @@ and [http2.request](https://nodejs.org/api/http2.html#clienthttp2sessionrequesth
22
22
 
23
23
  ## Prerequisites
24
24
 
25
- * Node.js `>=20.0.0`
25
+ * Node.js `>=22.0.0`
26
26
 
27
27
  ## Installation
28
28
 
package/dist/config.cjs CHANGED
@@ -46,7 +46,7 @@ const defaults = {
46
46
  headers: {
47
47
  [HTTP2_HEADER_ACCEPT]: `${_mediatypes.APPLICATION_JSON}, ${_mediatypes.TEXT_PLAIN}, ${_mediatypes.WILDCARD}`,
48
48
  [HTTP2_HEADER_ACCEPT_ENCODING]: `br,${isZstdSupported ? ' zstd, ' : ' '}gzip, deflate, deflate-raw`,
49
- [HTTP2_HEADER_USER_AGENT]: `node/${process.versions.node} ${process.platform}/${process.arch}`
49
+ [HTTP2_HEADER_USER_AGENT]: navigator.userAgent
50
50
  },
51
51
  method: HTTP2_METHOD_GET,
52
52
  parse: true,
package/dist/utils.cjs CHANGED
@@ -75,6 +75,10 @@ const deepMerge = (target, ...rest) => {
75
75
  for (const key of Object.getOwnPropertyNames(source)) {
76
76
  const sv = source[key];
77
77
  const tv = target[key];
78
+ if (sv instanceof Function) {
79
+ target[key] = source[key];
80
+ continue;
81
+ }
78
82
  if (Object(sv) === sv && Object(tv) === tv) {
79
83
  target[key] = deepMerge(tv, sv);
80
84
  continue;
package/package.json CHANGED
@@ -11,15 +11,15 @@
11
11
  "devDependencies": {
12
12
  "@babel/cli": "^7.28.6",
13
13
  "@babel/core": "^7.29.0",
14
- "@babel/preset-env": "^7.29.2",
14
+ "@babel/preset-env": "^7.29.5",
15
15
  "@eslint/markdown": "^8.0.1",
16
16
  "c8": "^11.0.0",
17
- "eslint": "^10.2.0",
18
- "eslint-config-ultra-refined": "^4.1.6",
17
+ "eslint": "^10.3.0",
18
+ "eslint-config-ultra-refined": "^4.1.7",
19
19
  "mocha": "^11.7.5"
20
20
  },
21
21
  "engines": {
22
- "node": ">=20.0.0"
22
+ "node": ">=22.0.0"
23
23
  },
24
24
  "exports": {
25
25
  "import": "./src/index.js",
@@ -72,5 +72,5 @@
72
72
  "test:cover": "c8 --include=src --reporter=lcov --reporter=text npm test"
73
73
  },
74
74
  "type": "module",
75
- "version": "7.2.7"
75
+ "version": "8.0.0"
76
76
  }
package/src/config.js CHANGED
@@ -50,7 +50,7 @@ const defaults = {
50
50
  headers: {
51
51
  [HTTP2_HEADER_ACCEPT]: `${ APPLICATION_JSON }, ${ TEXT_PLAIN }, ${ WILDCARD }`,
52
52
  [HTTP2_HEADER_ACCEPT_ENCODING]: `br,${ isZstdSupported ? ' zstd, ' : ' ' }gzip, deflate, deflate-raw`,
53
- [HTTP2_HEADER_USER_AGENT]: `node/${ process.versions.node } ${ process.platform }/${ process.arch }`,
53
+ [HTTP2_HEADER_USER_AGENT]: navigator.userAgent,
54
54
  },
55
55
  method: HTTP2_METHOD_GET,
56
56
  parse: true,
package/src/utils.js CHANGED
@@ -78,6 +78,11 @@ export const deepMerge = (target, ...rest) => {
78
78
  const sv = source[key];
79
79
  const tv = target[key];
80
80
 
81
+ if (sv instanceof Function) {
82
+ target[key] = source[key];
83
+ continue;
84
+ }
85
+
81
86
  if (Object(sv) === sv && Object(tv) === tv) {
82
87
  target[key] = deepMerge(tv, sv);
83
88
  continue;