miniprogram-wxcloudservice
Version:
微信小程序云开发工具库
18 lines (16 loc) • 409 B
JavaScript
const isNull = (value) => {
if (value === null || value === undefined || value === '') {
return true;
}
return false
}
const isEmpty = (value) => {
if (Array.isArray(value) && value.length === 0) return true
if (typeof value === 'object' && Object.keys(value).length === 0) return true
if (isNull(value)) return true
return false
}
module.exports = {
isNull,
isEmpty
}