Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const queries = targets.map(q => {
if (q.datasource === ExpressionDatasourceID) {
expressionCount++;
return {
...q,
datasourceId: this.id,
orgId,
};
}
const dsName = q.datasource && q.datasource !== 'default' ? q.datasource : config.defaultDatasource;
const ds = config.datasources[dsName];
if (!ds) {
throw new Error('Unknown Datasource: ' + q.datasource);
}
return {
...q,
datasourceId: ds.id,
intervalMs,
maxDataPoints,
orgId,
};
});
const req: Promise = getBackendSrv()