rekwest 5.2.8 → 5.3.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 +1 -0
- package/dist/mixin.js +7 -0
- package/package.json +9 -9
- package/src/mixin.mjs +8 -0
package/README.md
CHANGED
|
@@ -161,6 +161,7 @@ console.log(res.body);
|
|
|
161
161
|
* `arrayBuffer` **{AsyncFunction}** Reads the response and returns **ArrayBuffer**
|
|
162
162
|
* `blob` **{AsyncFunction}** Reads the response and returns **Blob**
|
|
163
163
|
* `body` **{AsyncFunction}** Reads the response and returns **Buffer** if `parse: false`
|
|
164
|
+
* `bytes` **{AsyncFunction}** Reads the response and returns **Uint8Array**
|
|
164
165
|
* `json` **{AsyncFunction}** Reads the response and returns **Object**
|
|
165
166
|
* `text` **{AsyncFunction}** Reads the response and returns **String**
|
|
166
167
|
* `bodyUsed` **{boolean}** Indicates whether the response were read or not
|
package/dist/mixin.js
CHANGED
|
@@ -39,6 +39,13 @@ const mixin = (res, {
|
|
|
39
39
|
return new _nodeBuffer.Blob([val]);
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
|
+
bytes: {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
value: async function () {
|
|
45
|
+
(0, _utils.brandCheck)(this, res?.constructor);
|
|
46
|
+
return new Uint8Array(await this.arrayBuffer());
|
|
47
|
+
}
|
|
48
|
+
},
|
|
42
49
|
json: {
|
|
43
50
|
enumerable: true,
|
|
44
51
|
value: async function () {
|
package/package.json
CHANGED
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
"url": "https://github.com/bricss/rekwest/issues"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
|
-
"@babel/cli": "^7.
|
|
12
|
-
"@babel/core": "^7.
|
|
11
|
+
"@babel/cli": "^7.26.4",
|
|
12
|
+
"@babel/core": "^7.26.0",
|
|
13
13
|
"@babel/eslint-parser": "^7.25.9",
|
|
14
|
-
"@babel/preset-env": "^7.
|
|
15
|
-
"@stylistic/eslint-plugin-js": "^2.
|
|
16
|
-
"c8": "^10.1.
|
|
17
|
-
"eslint": "^9.
|
|
18
|
-
"eslint-config-ultra-refined": "^3.
|
|
19
|
-
"mocha": "^
|
|
14
|
+
"@babel/preset-env": "^7.26.0",
|
|
15
|
+
"@stylistic/eslint-plugin-js": "^2.12.1",
|
|
16
|
+
"c8": "^10.1.3",
|
|
17
|
+
"eslint": "^9.17.0",
|
|
18
|
+
"eslint-config-ultra-refined": "^3.3.0",
|
|
19
|
+
"mocha": "^11.0.1"
|
|
20
20
|
},
|
|
21
21
|
"description": "The robust request library that humanity deserves 🌐",
|
|
22
22
|
"engines": {
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"test:bail": "mocha --bail",
|
|
71
71
|
"test:cover": "c8 --include=src --reporter=lcov --reporter=text npm test"
|
|
72
72
|
},
|
|
73
|
-
"version": "5.
|
|
73
|
+
"version": "5.3.0"
|
|
74
74
|
}
|
package/src/mixin.mjs
CHANGED
|
@@ -32,6 +32,14 @@ export const mixin = (res, { digest = false, parse = false } = {}) => {
|
|
|
32
32
|
return new Blob([val]);
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
|
+
bytes: {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
value: async function () {
|
|
38
|
+
brandCheck(this, res?.constructor);
|
|
39
|
+
|
|
40
|
+
return new Uint8Array(await this.arrayBuffer());
|
|
41
|
+
},
|
|
42
|
+
},
|
|
35
43
|
json: {
|
|
36
44
|
enumerable: true,
|
|
37
45
|
value: async function () {
|