ywana-core8 0.0.372 → 0.0.375

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/dist/index.cjs CHANGED
@@ -16,24 +16,6 @@ var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
16
16
  var ResumableJS__default = /*#__PURE__*/_interopDefaultLegacy(ResumableJS);
17
17
  var equal__default = /*#__PURE__*/_interopDefaultLegacy(equal);
18
18
 
19
- function _extends() {
20
- _extends = Object.assign || function (target) {
21
- for (var i = 1; i < arguments.length; i++) {
22
- var source = arguments[i];
23
-
24
- for (var key in source) {
25
- if (Object.prototype.hasOwnProperty.call(source, key)) {
26
- target[key] = source[key];
27
- }
28
- }
29
- }
30
-
31
- return target;
32
- };
33
-
34
- return _extends.apply(this, arguments);
35
- }
36
-
37
19
  function _catch$2(body, recover) {
38
20
  try {
39
21
  var result = body();
@@ -55,16 +37,19 @@ var fetchAsync = function fetchAsync(method, URL, body, token, headers) {
55
37
 
56
38
  try {
57
39
  console.log('FETCH', method, URL);
40
+ var requestHeaders = Object.assign({}, {
41
+ "Accept": "application/json",
42
+ "Content-Type": "application/json",
43
+ "x-access-token": token
44
+ }, headers);
58
45
  var request = {
59
46
  method: method,
60
47
  mode: 'cors',
61
- headers: _extends({
62
- "Accept": "application/json",
63
- "Content-Type": "application/json",
64
- "x-access-token": token
65
- }, headers),
48
+ headers: requestHeaders,
66
49
  body: body
67
50
  };
51
+ console.log("HTTP Client", request);
52
+ if (headers) request.headers = request.headers;
68
53
  return Promise.resolve(_catch$2(function () {
69
54
  return Promise.resolve(fetch(URL, request)).then(function (response) {
70
55
  var _exit;
@@ -515,6 +500,24 @@ var Header = function Header(props) {
515
500
  }, props.children));
516
501
  };
517
502
 
503
+ function _extends() {
504
+ _extends = Object.assign || function (target) {
505
+ for (var i = 1; i < arguments.length; i++) {
506
+ var source = arguments[i];
507
+
508
+ for (var key in source) {
509
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
510
+ target[key] = source[key];
511
+ }
512
+ }
513
+ }
514
+
515
+ return target;
516
+ };
517
+
518
+ return _extends.apply(this, arguments);
519
+ }
520
+
518
521
  /**
519
522
  * List
520
523
  */