MCPcopy Create free account
hub / github.com/Easy-Editor/EasyEditor / getRuntimeJsValue

Function getRuntimeJsValue

packages/plugin-datasource/src/utils.ts:48–56  ·  view source on GitHub ↗
(value: JSExpression | JSFunction, context: IDataSourceRuntimeContext)

Source from the content-addressed store, hash-verified

46}
47
48export 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
58export const getRuntimeBaseValue = (type: string, value: any) => {
59 switch (type) {

Callers 3

adapt2RuntimeFunction · 0.90
buildShouldFetchFunction · 0.85

Calls 3

transformFunctionFunction · 0.85
transformExpressionFunction · 0.85
errorMethod · 0.45

Tested by

no test coverage detected