@zat-design/sisyphus-react 3.9.8-beta.4 → 3.9.8-beta.5

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.
@@ -7,9 +7,16 @@ var filterObject = function filterObject(data) {
7
7
  if (!isObject(data) || data === null) return data;
8
8
  // ['1', undefined] ['1', ''] 视为相等
9
9
  if (Array.isArray(data)) {
10
- return data.map(function (item) {
11
- return isEmpty(item) ? null : item;
10
+ // 数组中全是empty值的话 视为null
11
+ var isFillNull = true;
12
+ var arr = data.map(function (item) {
13
+ if (isEmpty(item)) {
14
+ return null;
15
+ }
16
+ isFillNull = false;
17
+ return item;
12
18
  });
19
+ return isFillNull ? null : arr;
13
20
  }
14
21
  var resData = {};
15
22
  Object.keys(data).forEach(function (key) {
@@ -6,9 +6,16 @@ var filterObject = function filterObject(data) {
6
6
  if (!isObject(data) || data === null) return data;
7
7
  // ['1', undefined] ['1', ''] 视为相等
8
8
  if (Array.isArray(data)) {
9
- return data.map(function (item) {
10
- return isEmpty(item) ? null : item;
9
+ // 数组中全是empty值的话 视为null
10
+ var isFillNull = true;
11
+ var arr = data.map(function (item) {
12
+ if (isEmpty(item)) {
13
+ return null;
14
+ }
15
+ isFillNull = false;
16
+ return item;
11
17
  });
18
+ return isFillNull ? null : arr;
12
19
  }
13
20
  var resData = {};
14
21
  Object.keys(data).forEach(function (key) {
@@ -13,9 +13,16 @@ var filterObject = function filterObject(data) {
13
13
  if (!(0, _lodash.isObject)(data) || data === null) return data;
14
14
  // ['1', undefined] ['1', ''] 视为相等
15
15
  if (Array.isArray(data)) {
16
- return data.map(function (item) {
17
- return isEmpty(item) ? null : item;
16
+ // 数组中全是empty值的话 视为null
17
+ var isFillNull = true;
18
+ var arr = data.map(function (item) {
19
+ if (isEmpty(item)) {
20
+ return null;
21
+ }
22
+ isFillNull = false;
23
+ return item;
18
24
  });
25
+ return isFillNull ? null : arr;
19
26
  }
20
27
  var resData = {};
21
28
  Object.keys(data).forEach(function (key) {
@@ -12,9 +12,16 @@ var filterObject = function filterObject(data) {
12
12
  if (!(0, _lodash.isObject)(data) || data === null) return data;
13
13
  // ['1', undefined] ['1', ''] 视为相等
14
14
  if (Array.isArray(data)) {
15
- return data.map(function (item) {
16
- return (0, _utils.isEmpty)(item) ? null : item;
15
+ // 数组中全是empty值的话 视为null
16
+ var isFillNull = true;
17
+ var arr = data.map(function (item) {
18
+ if ((0, _utils.isEmpty)(item)) {
19
+ return null;
20
+ }
21
+ isFillNull = false;
22
+ return item;
17
23
  });
24
+ return isFillNull ? null : arr;
18
25
  }
19
26
  var resData = {};
20
27
  Object.keys(data).forEach(function (key) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.9.8-beta.4",
3
+ "version": "3.9.8-beta.5",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",