utils-lib-js 1.0.13 → 1.0.16

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.
@@ -170,7 +170,7 @@ var RequestInit = function (_super) {
170
170
  var _a, _b;
171
171
  var params = _this.initAbort(_this.initDefaultParams(url, opts));
172
172
  var options = (0, url_1.parse)(params.url, true);
173
- return (_b = (_a = _this.reqFn) === null || _a === void 0 ? void 0 : _a.call(_this, __assign(__assign({}, params), options))) !== null && _b !== void 0 ? _b : params;
173
+ return (_b = (_a = _this.reqFn) === null || _a === void 0 ? void 0 : _a.call(_this, __assign(__assign({}, params), options))) !== null && _b !== void 0 ? _b : __assign(__assign({}, params), options);
174
174
  };
175
175
  return _this;
176
176
  }
@@ -193,7 +193,7 @@ var Request = function (_super) {
193
193
  return _this.errorFn(reject);
194
194
  });
195
195
  fetch(url, opts).then(function (response) {
196
- if (response.status >= 200 && response.status < 300) {
196
+ if ((response === null || response === void 0 ? void 0 : response.status) >= 200 && (response === null || response === void 0 ? void 0 : response.status) < 300) {
197
197
  return _this.getDataByType(opts.type, response);
198
198
  }
199
199
  return _this.errorFn(reject);
@@ -212,7 +212,7 @@ var Request = function (_super) {
212
212
  var params = _this.initHttpParams(_url, _opts);
213
213
  var signal = params.signal;
214
214
  var req = (0, http_1.request)(params, function (response) {
215
- if (response.statusCode >= 200 && response.statusCode < 300) {
215
+ if ((response === null || response === void 0 ? void 0 : response.statusCode) >= 200 && (response === null || response === void 0 ? void 0 : response.statusCode) < 300) {
216
216
  var data_1 = "";
217
217
  response.setEncoding('utf8');
218
218
  response.on('data', function (chunk) {
@@ -166,7 +166,7 @@ var RequestInit = function (_super) {
166
166
  var _a, _b;
167
167
  var params = _this.initAbort(_this.initDefaultParams(url, opts));
168
168
  var options = parse(params.url, true);
169
- return (_b = (_a = _this.reqFn) === null || _a === void 0 ? void 0 : _a.call(_this, __assign(__assign({}, params), options))) !== null && _b !== void 0 ? _b : params;
169
+ return (_b = (_a = _this.reqFn) === null || _a === void 0 ? void 0 : _a.call(_this, __assign(__assign({}, params), options))) !== null && _b !== void 0 ? _b : __assign(__assign({}, params), options);
170
170
  };
171
171
  return _this;
172
172
  }
@@ -189,7 +189,7 @@ var Request = function (_super) {
189
189
  return _this.errorFn(reject);
190
190
  });
191
191
  fetch(url, opts).then(function (response) {
192
- if (response.status >= 200 && response.status < 300) {
192
+ if ((response === null || response === void 0 ? void 0 : response.status) >= 200 && (response === null || response === void 0 ? void 0 : response.status) < 300) {
193
193
  return _this.getDataByType(opts.type, response);
194
194
  }
195
195
  return _this.errorFn(reject);
@@ -208,7 +208,7 @@ var Request = function (_super) {
208
208
  var params = _this.initHttpParams(_url, _opts);
209
209
  var signal = params.signal;
210
210
  var req = request(params, function (response) {
211
- if (response.statusCode >= 200 && response.statusCode < 300) {
211
+ if ((response === null || response === void 0 ? void 0 : response.statusCode) >= 200 && (response === null || response === void 0 ? void 0 : response.statusCode) < 300) {
212
212
  var data_1 = "";
213
213
  response.setEncoding('utf8');
214
214
  response.on('data', function (chunk) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utils-lib-js",
3
- "version": "1.0.13",
3
+ "version": "1.0.16",
4
4
  "description": "JavaScript工具函数,封装的一些常用的js函数",
5
5
  "main": "./dist/common/index.js",
6
6
  "types": "./dist/common/index.d.ts",