(params: IFormulaParam[])
| 43 | * Flatten the value of the parameter |
| 44 | */ |
| 45 | export const flattenParams = (params: IFormulaParam[]): any[] => { |
| 46 | const value = params.reduce((prev, cur) => { |
| 47 | const { value, node } = cur; |
| 48 | |
| 49 | if (cur.node.valueType === BasicValueType.Array) { |
| 50 | const { field, context } = node as ValueOperandNode; |
| 51 | if (Field.bindContext(field, context.state).isComputed) { |
| 52 | const v = (Field.bindContext(field, context.state) as any).arrayValueToArrayStringValueArray(value); |
| 53 | return v != null ? [...prev, v] : prev; |
| 54 | } |
| 55 | } |
| 56 | return value != null ? [...prev, value] : prev; |
| 57 | }, [] as IFormulaParam[]); |
| 58 | return value.flat(Infinity); |
| 59 | }; |
| 60 | |
| 61 | enum SymbolType { |
| 62 | Equal = 'Equal', |
no test coverage detected