From 1d87c0a1a504fd7baf6081f5a2755b2dcb1431f2 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Fri, 20 May 2022 11:54:39 +0800 Subject: [PATCH] refactor: jsep node types --- .../spreadsheet/components/editColumn/FormulaOptions.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/components/project/spreadsheet/components/editColumn/FormulaOptions.vue b/packages/nc-gui/components/project/spreadsheet/components/editColumn/FormulaOptions.vue index a40a658afb..42c27af40b 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/editColumn/FormulaOptions.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/editColumn/FormulaOptions.vue @@ -236,7 +236,7 @@ export default { } }, validateAgainstMeta(pt, arr = []) { - if (pt.type === 'CallExpression') { + if (pt.type === jsep.CALL_EXP) { if (!this.availableFunctions.includes(pt.callee.name)) { arr.push(`'${pt.callee.name}' function is not available`) } @@ -251,7 +251,7 @@ export default { } } pt.arguments.map(arg => this.validateAgainstMeta(arg, arr)) - } else if (pt.type === 'Identifier') { + } else if (pt.type === jsep.IDENTIFIER) { if (this.meta.columns.filter(c => !this.column || this.column.id !== c.id).every(c => c.title !== pt.name)) { arr.push(`Column '${pt.name}' is not available`) } @@ -323,7 +323,7 @@ export default { arr.push('Can’t save field because it causes a circular reference') } } - } else if (pt.type === 'BinaryExpression') { + } else if (pt.type === jsep.BINARY_EXP) { if (!this.availableBinOps.includes(pt.operator)) { arr.push(`'${pt.operator}' operation is not available`) }