From a9fd82885907d8702484297d89ee3b8c41752f37 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Tue, 17 May 2022 12:21:43 +0800 Subject: [PATCH] refactor: remove substituteColumnIdWithAliasInFormula as now it is in sdk --- .../lib/noco/meta/helpers/formulaHelpers.ts | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/packages/nocodb/src/lib/noco/meta/helpers/formulaHelpers.ts b/packages/nocodb/src/lib/noco/meta/helpers/formulaHelpers.ts index b87441f351..8f114447b6 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/formulaHelpers.ts +++ b/packages/nocodb/src/lib/noco/meta/helpers/formulaHelpers.ts @@ -58,35 +58,3 @@ export async function substituteColumnAliasWithIdInFormula( await substituteId(parsedFormula); return jsepTreeToFormula(parsedFormula); } - -// not in use -// export function substituteColumnIdWithAliasInFormula( -// formula, -// columns: Column[] -// ) { -// const substituteId = (pt: any) => { -// if (pt.type === 'CallExpression') { -// for (const arg of pt.arguments || []) { -// substituteId(arg); -// } -// } else if (pt.type === 'Literal') { -// return; -// } else if (pt.type === 'Identifier') { -// const colNameOrId = pt.name; -// const column = columns.find( -// c => -// c.id === colNameOrId || -// c.column_name === colNameOrId || -// c.title === colNameOrId -// ); -// pt.name = column.id; -// } else if (pt.type === 'BinaryExpression') { -// substituteId(pt.left); -// substituteId(pt.right); -// } -// }; -// -// const parsedFormula = jsep(formula); -// substituteId(parsedFormula); -// return jsepTreeToFormula(parsedFormula); -// }