Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// context is initially empty
// todo: think of adding the adaptOWRequestHere, too
const context = {
request: extractClientRequest(action),
};
if (params.content) {
// pass content param from request to context
context.content = params.content;
}
return createActionResponse(await pipe(cont, context, action));
}
// enhance logger if trace method is missing (eg. a winston logger)
if (actionParams.__ow_logger && !actionParams.__ow_logger.trace) {
actionParams.__ow_logger.trace = actionParams.__ow_logger.silly;
}
return logger(logger.trace(runner))(actionParams);
}