18 lines
391 B
JavaScript
18 lines
391 B
JavaScript
/**
|
||
* 判断是否为空
|
||
* @param {*} name
|
||
* @returns false 为空 , true 不为空
|
||
*/
|
||
export const notNull = (name) => {
|
||
if(typeof(name) == "string") {
|
||
name = name.trim()
|
||
}
|
||
if(typeof(name) == "string") {
|
||
if(name == "") {
|
||
return false;
|
||
}
|
||
} else if(name === null || name === undefined) {
|
||
return false;
|
||
}
|
||
return true
|
||
} |