Revert "[enhancement] 支持NaN类型"

This reverts commit d620a72585.
This commit is contained in:
VampireAchao 2023-03-15 09:59:48 +08:00
parent 5a4ed96e0d
commit 8efe8fb2fd
2 changed files with 2 additions and 9 deletions

View File

@ -533,19 +533,13 @@ public class BooleanUtil {
* 定义{@see https://developer.mozilla.org/zh-CN/docs/Glossary/Falsy}
*/
public static boolean isJsFalsy(Object value) {
if (FALSY_SET.contains(value)) {
return true;
}
if (value instanceof Double) {
return Double.isNaN((Double) value);
}
return false;
return FALSY_SET.contains(value);
}
/**
* 是否为真值(定义来源js)
* 所有除 false0-00n""nullundefined NaN 以外的皆为真值
* 由于java中无法使用值来代表undefined因此此处不做判断
* 由于java中无法使用值来代表undefined NaN因此此处不做判断
*
* @param value 参数
* @return 是否为真值

View File

@ -110,7 +110,6 @@ public class BooleanUtilTest {
Assert.assertTrue(BooleanUtil.isJsFalsy(-0.00F));
Assert.assertTrue(BooleanUtil.isJsFalsy(""));
Assert.assertTrue(BooleanUtil.isJsFalsy(null));
Assert.assertTrue(BooleanUtil.isJsFalsy(Math.sqrt(-1)));
}
@Test