salary-management-front/pc4mobx/hrmSalary/util/validate.js

18 lines
391 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 判断是否为空
* @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
}