Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function assertSourcesSinks(sources, sinks, main, done, timeOpts = {}) {
const Time = mockTimeSource(timeOpts);
const _sources = Object.keys(sources).reduce((_sources, sourceKey) => {
const sourceObj = sources[sourceKey];
const diagram = Object.keys(sourceObj)[0];
const sourceOpts = sourceObj[diagram];
let obj = {};
let firstKey = Object.keys(sourceOpts)[0];
if (typeof sourceOpts[firstKey] === 'function') {
obj = {
[sourceKey]: {
// pass category to select
[firstKey]: (...args) =>
Time.diagram(diagram, sourceOpts[firstKey](...args)),
},
};
} else {
export function assertSourcesSinks(sources, sinks, main, done, timeOpts = {}) {
const Time = mockTimeSource(timeOpts);
const _sources = Object.keys(sources).reduce((_sources, sourceKey) => {
const sourceObj = sources[sourceKey];
const diagram = Object.keys(sourceObj)[0];
const sourceOpts = sourceObj[diagram];
let obj = {};
let firstKey = Object.keys(sourceOpts)[0];
if (typeof sourceOpts[firstKey] === 'function') {
obj = {
[sourceKey]: {
// pass category to select
[firstKey]: (...args) =>
Time.diagram(diagram, sourceOpts[firstKey](...args)),
},
};
} else if (firstKey === 'local') {