import { isNumber, isObject, isArray, isString } from '@/utils/dataType'
export const isEmptyObject = function (value) {
if (isObject(value)) {
return Object.keys(value).length === 0
}
return false
}
export const isEmptyArray = function (value) {
if (isArray(value)) {
return value.length === 0
}
return false
}
export const isEmptyString = function (value) {
if (isString(value)) {
return value === ''
}
return false
}
export const isEmpty = function (value) {
if (isObject(value)) {
return isEmptyObject(value)
}
if (isArray(value)) {
return isEmptyArray(value)
}
if (isString(value)) {
return isEmptyString(value)
}
return isNull(value) || isUndefined(value)
}