@next-core/brick-kit 2.123.5 → 2.123.6

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.123.6](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.123.5...@next-core/brick-kit@2.123.6) (2022-07-21)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * some optimization ([b50ed9c](https://github.com/easyops-cn/next-core/commit/b50ed9c16925a3fb6849d337efa301aaa6a62c8d))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [2.123.5](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.123.4...@next-core/brick-kit@2.123.5) (2022-07-20)
7
18
 
8
19
  **Note:** Version bump only for package @next-core/brick-kit
@@ -6973,19 +6973,29 @@
6973
6973
  return flag;
6974
6974
  }
6975
6975
  function transformFormData(data) {
6976
+ if (data instanceof FormData) {
6977
+ return data;
6978
+ }
6979
+
6976
6980
  var formData = new FormData();
6977
6981
 
6978
- for (var [key, value] of Object.entries(data)) {
6982
+ var _loop = function (key, value) {
6979
6983
  if (Array.isArray(value)) {
6980
- (function () {
6981
- var k = "".concat(key, "[]");
6982
- value.forEach(v => {
6983
- formData.append(k, v);
6984
- });
6985
- })();
6984
+ value.forEach(v => {
6985
+ formData.append(key, v);
6986
+ });
6987
+ } else if (_.isObject(value) && !(value instanceof Blob) && !(value instanceof Date)) {
6988
+ Object.entries(value).forEach(_ref => {
6989
+ var [k, v] = _ref;
6990
+ formData.append("".concat(key, "[").concat(k, "]"), v);
6991
+ });
6986
6992
  } else {
6987
6993
  formData.append(key, value);
6988
6994
  }
6995
+ };
6996
+
6997
+ for (var [key, value] of Object.entries(data)) {
6998
+ _loop(key, value);
6989
6999
  }
6990
7000
 
6991
7001
  return formData;
@@ -6995,14 +7005,14 @@
6995
7005
  }
6996
7006
 
6997
7007
  function _CustomApi() {
6998
- _CustomApi = _asyncToGenerator__default["default"](function* (_ref) {
7008
+ _CustomApi = _asyncToGenerator__default["default"](function* (_ref2) {
6999
7009
  var {
7000
7010
  url,
7001
7011
  method = "GET",
7002
7012
  responseWrapper = true,
7003
7013
  ext_fields = [],
7004
7014
  request
7005
- } = _ref;
7015
+ } = _ref2;
7006
7016
  var isSimpleRequest = ["get", "delete", "head"].includes(method.toLowerCase());
7007
7017
  var response;
7008
7018