Skip to content

Commit 2882bea

Browse files
committed
removeEmptyでDate型が除外されてしまうのを修正
1 parent 5c19484 commit 2882bea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/remove.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import _ from 'lodash'
22

33
export const removeEmpty = (obj) => {
44
return _.transform(obj, function (result, value, key) {
5-
if (!_.isEmpty(value) || _.isBoolean(value)) {
6-
if (typeof value === 'object') {
5+
if (!_.isEmpty(value) || _.isBoolean(value) || _.isDate(value)) {
6+
if (typeof value === 'object' && !_.isDate(value)) {
77
result[key] = removeEmpty(value)
88
} else {
99
result[key] = value

0 commit comments

Comments
 (0)