@zat-design/sisyphus-react 3.9.5-beta.6 → 3.9.5-beta.7

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.
@@ -3,7 +3,13 @@ import { isEmpty } from '../../utils';
3
3
  // 过滤对象中undefined字段
4
4
  // 防止{a: '1'} {a: '1', b: undefined | null}被认为不相等
5
5
  var filterObject = function filterObject(data) {
6
- if (!isObject(data) || Array.isArray(data) || data === null) return data;
6
+ if (!isObject(data) || data === null) return data;
7
+ // ['1', undefined] ['1', ''] 视为相等
8
+ if (Array.isArray(data)) {
9
+ return data.map(function (item) {
10
+ return isEmpty(item) ? null : item;
11
+ });
12
+ }
7
13
  var resData = {};
8
14
  Object.keys(data).forEach(function (key) {
9
15
  if (!isEmpty(data[key])) {
@@ -9,7 +9,13 @@ var _utils = require("../../utils");
9
9
  // 过滤对象中undefined字段
10
10
  // 防止{a: '1'} {a: '1', b: undefined | null}被认为不相等
11
11
  var filterObject = function filterObject(data) {
12
- if (!(0, _lodash.isObject)(data) || Array.isArray(data) || data === null) return data;
12
+ if (!(0, _lodash.isObject)(data) || data === null) return data;
13
+ // ['1', undefined] ['1', ''] 视为相等
14
+ if (Array.isArray(data)) {
15
+ return data.map(function (item) {
16
+ return (0, _utils.isEmpty)(item) ? null : item;
17
+ });
18
+ }
13
19
  var resData = {};
14
20
  Object.keys(data).forEach(function (key) {
15
21
  if (!(0, _utils.isEmpty)(data[key])) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.9.5-beta.6",
3
+ "version": "3.9.5-beta.7",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",