intelicoreact 1.5.24 → 1.5.25

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.
@@ -5,9 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _utils = require("lib/dist/Functions/utils");
9
8
  var _ApiUtils = _interopRequireDefault(require("./ApiUtils"));
10
- var _utils2 = require("./_utils");
9
+ var _utils = require("./_utils");
11
10
  //? Префикс createRequest_ добавляется к крейтерам с целью разгрузить пространство имен
12
11
  const PREFIX_OF_CLASS_UTILS = "createRequest_";
13
12
  class ApiRequestCreators extends _ApiUtils.default {
@@ -16,7 +15,7 @@ class ApiRequestCreators extends _ApiUtils.default {
16
15
  const {
17
16
  requestsCreators
18
17
  } = settings || {};
19
- if ((0, _utils2.getIsOnlyAnObject)(requestsCreators)) _utils2.addCustomMethods.call(this, requestsCreators, PREFIX_OF_CLASS_UTILS);
18
+ if ((0, _utils.getIsOnlyAnObject)(requestsCreators)) _utils.addCustomMethods.call(this, requestsCreators, PREFIX_OF_CLASS_UTILS);
20
19
  }
21
20
 
22
21
  //? При типе toJson пользовательский callback на вход получит тело ответа реализованное методом Response.json()
@@ -46,7 +45,7 @@ class ApiRequestCreators extends _ApiUtils.default {
46
45
  var _safelyProps$callback3, _safelyProps$callback4;
47
46
  const output = {
48
47
  response: res,
49
- result: await this.getResponseBody(await (0, _utils2.getResponseClone)(res), 'json')
48
+ result: await this.getResponseBody(await (0, _utils.getResponseClone)(res), 'json')
50
49
  };
51
50
  return await ((_safelyProps$callback3 = (_safelyProps$callback4 = safelyProps.callback) === null || _safelyProps$callback4 === void 0 ? void 0 : _safelyProps$callback4.call(safelyProps, output)) !== null && _safelyProps$callback3 !== void 0 ? _safelyProps$callback3 : output);
52
51
  }
@@ -62,7 +61,7 @@ class ApiRequestCreators extends _ApiUtils.default {
62
61
  isGetBody: false,
63
62
  callback: async res => {
64
63
  var _safelyProps$callback5, _safelyProps$callback6;
65
- const output = await this.getResponseBody(await (0, _utils2.getResponseClone)(res), 'blob');
64
+ const output = await this.getResponseBody(await (0, _utils.getResponseClone)(res), 'blob');
66
65
  return await ((_safelyProps$callback5 = (_safelyProps$callback6 = safelyProps.callback) === null || _safelyProps$callback6 === void 0 ? void 0 : _safelyProps$callback6.call(safelyProps, output)) !== null && _safelyProps$callback5 !== void 0 ? _safelyProps$callback5 : output);
67
66
  }
68
67
  }, variant);
@@ -8,7 +8,7 @@ exports.addCustomMethods = addCustomMethods;
8
8
  exports.clone = void 0;
9
9
  exports.getInstanceOfFetchSystem = getInstanceOfFetchSystem;
10
10
  exports.getIsOnlyAnObject = getIsOnlyAnObject;
11
- exports.getResponseClone = void 0;
11
+ exports.omitKeys = exports.getResponseClone = void 0;
12
12
  var _AbortableFetch = _interopRequireDefault(require("./AbortableFetch"));
13
13
  function getIsOnlyAnObject(input) {
14
14
  return typeof input === "object" && input instanceof Object && !Array.isArray(input);
@@ -19,7 +19,22 @@ const clone = input => {
19
19
  for (const i in input) data[i] = clone(input[i]);
20
20
  return data;
21
21
  };
22
+
23
+ //принимает обьект и массив ключей обьекта
24
+ //возвращает обьект с теми полями, которых нет в массиве ключей
22
25
  exports.clone = clone;
26
+ const omitKeys = function () {
27
+ let obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
28
+ let keys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
29
+ return keys.reduce((acc, key) => {
30
+ const {
31
+ [key]: omit,
32
+ ...rest
33
+ } = acc;
34
+ return rest;
35
+ }, obj);
36
+ };
37
+ exports.omitKeys = omitKeys;
23
38
  const getResponseClone = async res => typeof (res === null || res === void 0 ? void 0 : res.clone) === "function" ? await res.clone() : clone(res);
24
39
  exports.getResponseClone = getResponseClone;
25
40
  function addCustomMethods(data, prefix) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "1.5.24",
3
+ "version": "1.5.25",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [