* Loads a DataSource from a file * If the path provided is a JSON, it instantiates a juggler.DataSource with the config as the only argument * Else it requires it like a compiled loopback datasource * @param modulePath * @returns juggler.DataSource
(modulePath)
| 44 | * @returns juggler.DataSource |
| 45 | */ |
| 46 | function loadDataSource(modulePath) { |
| 47 | const ds = require(modulePath); |
| 48 | const key = Object.keys(ds)[0]; |
| 49 | const val = new ds[key](); |
| 50 | return val; |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Loads a compiled loopback datasource by name |
no test coverage detected