Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const mergedOptions = { ...options, ...customOptions }
return {
builder: new Builder(mergedContext, mergedOptions),
logger: new Logger(mergedContext, mergedOptions),
registry: new Registry(mergedContext, mergedOptions),
rewriter: new Rewriter(mergedContext, mergedOptions),
events: new Events(mergedContext, mergedOptions),
}
}
const [apps, router, workspaces, logger, events, billing, rewriter] = getToken()
? [
new Apps(context, options),
new Router(context, options),
new Workspaces(context, options),
new Logger(context),
new Events(context),
new Billing(context, options),
new Rewriter(context, options),
]
: [
interceptor('apps'),
interceptor('router'),
interceptor('workspaces'),
interceptor('logger'),
interceptor('events'),
interceptor('billing'),
interceptor('rewriter'),
]
export { apps, router, workspaces, logger, events, createClients, billing, rewriter }
const createClients = (customContext: Partial = {}, customOptions: InstanceOptions = {}) => {
const mergedContext = { ...context, ...customContext }
const mergedOptions = { ...options, ...customOptions }
return {
builder: new Builder(mergedContext, mergedOptions),
logger: new Logger(mergedContext, mergedOptions),
registry: new Registry(mergedContext, mergedOptions),
rewriter: new Rewriter(mergedContext, mergedOptions),
events: new Events(mergedContext, mergedOptions),
}
}