| 41 | } |
| 42 | |
| 43 | const DataSourcePlugin: PluginCreator<DataSourcePluginOptions> = options => { |
| 44 | return { |
| 45 | name: 'DataSourcePlugin', |
| 46 | deps: [], |
| 47 | init(ctx) { |
| 48 | const { config } = ctx |
| 49 | |
| 50 | config.set('dataSourceEngine', { |
| 51 | createRuntime, |
| 52 | createInterpret, |
| 53 | createDataSourceEngine: (dataSource: InterpretDataSource, engine: IDataSourceRuntimeContext) => { |
| 54 | return createDataSourceEngine(dataSource, engine, options) |
| 55 | }, |
| 56 | }) |
| 57 | }, |
| 58 | extend({ extend }) { |
| 59 | extend('Project', { |
| 60 | dataSource: { |
| 61 | get() { |
| 62 | return this.get('dataSource') |
| 63 | }, |
| 64 | }, |
| 65 | }) |
| 66 | }, |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | export default DataSourcePlugin |
nothing calls this directly
no outgoing calls
no test coverage detected