@jnode/request 2.1.1 → 2.1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jnode/request",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "Simple HTTP(s) requesting package for Node.js.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -139,11 +139,11 @@ class RequestResponse {
139
139
  }
140
140
 
141
141
  async text(encoding = 'utf8') {
142
- return this['_text_' + encoding] = this['_text_' + encoding] ?? (await this.buffer()).toString(encoding);
142
+ return this['_text_' + encoding] ?? (this['_text_' + encoding] = (await this.buffer()).toString(encoding));
143
143
  }
144
144
 
145
145
  async json(encoding = 'utf8') {
146
- return this['_json_' + encoding] = this['_json_' + encoding] ?? JSON.parse((await this.text(encoding)));
146
+ return this['_json_' + encoding] ?? (this['_json_' + encoding] = JSON.parse(await this.text(encoding)));
147
147
  }
148
148
 
149
149
  rl() {