Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
fix(sheet): formula boolean value (#1360)
Univer9a8a4bea037d
diff --git a/packages/engine-formula/src/engine/ast-node/value-node.ts b/packages/engine-formula/src/engine/ast-node/value-node.tsindex 16cbffa0d2..4d4e40644d 100644--- a/packages/engine-formula/src/engine/ast-node/value-node.ts+++ b/packages/engine-formula/src/engine/ast-node/value-node.ts@@ -43,7 +43,7 @@ export class ValueNodeFactory extends BaseAstNodeFactory {}_checkValueNode(token: string) {- if (isNaN(Number(token))) {+ if (Number.isNaN(Number(token))) {const tokenTrim = token.trim();const startToken = tokenTrim.charAt(0);const endToken = tokenTrim.charAt(tokenTrim.length - 1);@@ -58,8 +58,10 @@ export class ValueNodeFactory extends BaseAstNodeFactory {if (startToken === '{' && endToken === '}') {return this.create(tokenTrim);}- if (tokenTrim === BooleanValue.TRUE || tokenTrim === BooleanValue.FALSE) {- return this.create(tokenTrim);++ const tokenTrimUpper = tokenTrim.toUpperCase();+ if (tokenTrimUpper === BooleanValue.TRUE || tokenTrimUpper === BooleanValue.FALSE) {+ return this.create(tokenTrimUpper);}} else {return this.create(token);