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

Function buildShouldFetch

packages/plugin-datasource/src/utils.ts:103–112  ·  view source on GitHub ↗
(ds: InterpretDataSourceConfig, context: IDataSourceRuntimeContext)

Source from the content-addressed store, hash-verified

101}
102
103export const buildShouldFetch = (ds: InterpretDataSourceConfig, context: IDataSourceRuntimeContext) => {
104 if (!ds.options || !ds.shouldFetch) {
105 return true // 默认为 true
106 }
107 if (isJSExpression(ds.shouldFetch) || isJSFunction(ds.shouldFetch)) {
108 return getRuntimeJsValue(ds.shouldFetch, context)
109 }
110
111 return getRuntimeBaseValue('boolean', ds.shouldFetch)
112}
113
114export const buildOptions = (ds: InterpretDataSourceConfig, context: IDataSourceRuntimeContext) => {
115 const { options } = ds

Callers 1

adapt2RuntimeFunction · 0.90

Calls 4

isJSExpressionFunction · 0.90
isJSFunctionFunction · 0.90
getRuntimeJsValueFunction · 0.85
getRuntimeBaseValueFunction · 0.85

Tested by

no test coverage detected