@noah-libjs/request 0.0.47 → 0.0.49

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
@@ -1,4 +1,4 @@
1
- # Rslib project 19
1
+ # Rslib project 20
2
2
 
3
3
  ## Setup
4
4
 
package/dist/Request.d.ts CHANGED
@@ -12,7 +12,7 @@ export declare class Request extends EventEmitter<{
12
12
  token?: string;
13
13
  constructor(config?: IRequest_SpawnConfig);
14
14
  static CONFIG: {
15
- successCode: number[];
15
+ successCode: (string | number)[];
16
16
  };
17
17
  static logger: MyLog;
18
18
  static checkRTCode(res?: AxiosResponse<any>): boolean;
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
9
9
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
10
  import axios, { Axios } from 'axios';
11
11
  import utils from 'axios/lib/utils';
12
- import { MyLog, EventEmitter, getSearchParamsAll, isFunction, safe_async_call, expect_array, isString, cache_fetch, get } from '@noah-libjs/utils';
12
+ import { MyLog, EventEmitter, getSearchParamsAll, isNil, isObject, isFunction, safe_async_call, expect_array, isString, cache_fetch, get } from '@noah-libjs/utils';
13
13
  import bind from 'axios/lib/helpers/bind';
14
14
  var codeMessage = {
15
15
  200: '服务器成功返回请求的数据。',
@@ -264,7 +264,7 @@ Object.defineProperty(Request, "CONFIG", {
264
264
  configurable: true,
265
265
  writable: true,
266
266
  value: {
267
- successCode: [200, 1, 0]
267
+ successCode: [200, 1, 0, '200']
268
268
  }
269
269
  });
270
270
  Object.defineProperty(Request, "logger", {
@@ -275,7 +275,7 @@ Object.defineProperty(Request, "logger", {
275
275
  });
276
276
  var request = new Request();
277
277
  function doUnboxing(res) {
278
- var isBoxing = typeof (res === null || res === void 0 ? void 0 : res.code) === 'number' && !!res.data;
278
+ var isBoxing = (!isNil(res === null || res === void 0 ? void 0 : res.code) || !isNil(res === null || res === void 0 ? void 0 : res.status)) && isObject(res.data);
279
279
  if (isBoxing) {
280
280
  return res.data;
281
281
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noah-libjs/request",
3
- "version": "0.0.47",
3
+ "version": "0.0.49",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -21,7 +21,7 @@
21
21
  "access": "public"
22
22
  },
23
23
  "dependencies": {
24
- "@noah-libjs/utils": "^0.0.47",
24
+ "@noah-libjs/utils": "^0.0.49",
25
25
  "axios": "^0.26.1",
26
26
  "store": "2.x"
27
27
  },
@@ -32,5 +32,5 @@
32
32
  "keywords": [],
33
33
  "author": "",
34
34
  "license": "MIT",
35
- "gitHead": "65fad1bda9cd7a2e3290e236c4e7dac1b56b83a3"
35
+ "gitHead": "79e2242954102e2d87978912eff9ab8d7cbd1b7d"
36
36
  }