(value: JSExpression | JSFunction, context: IDataSourceRuntimeContext)
| 46 | } |
| 47 | |
| 48 | export const getRuntimeJsValue = (value: JSExpression | JSFunction, context: IDataSourceRuntimeContext) => { |
| 49 | if (!['JSExpression', 'JSFunction'].includes(value.type)) { |
| 50 | console.error(`translate error, value is ${JSON.stringify(value)}`) |
| 51 | return '' |
| 52 | } |
| 53 | // TODO: 类型修复 |
| 54 | const code = value.compiled || value.value |
| 55 | return value.type === 'JSFunction' ? transformFunction(code, context) : transformExpression(code, context) |
| 56 | } |
| 57 | |
| 58 | export const getRuntimeBaseValue = (type: string, value: any) => { |
| 59 | switch (type) { |
no test coverage detected