Files
authentication/src/utils/pointless.js

12 lines
419 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.
export const pointless = (authtext) => {
// 定义一个包含所有非法值的数组
var invalidValues = ["", null, "null", "Null", NaN, "NaN", "nan", undefined, "undefined", " ", '\s'];
// 检查NaN,因为NaN不等于自身,需要特殊处理
if (isNaN(authtext)) {
return false;
}
// 检查authtext是否在invalidValues数组中
return !invalidValues.includes(authtext);
}