Files
api/app/core/modules/debug/get-context.ts
2020-11-11 16:13:30 +10:30

18 lines
429 B
TypeScript

/*!
* Copyright 2019-2020 Lime Technology Inc. All rights reserved.
* Written by: Alexis Tyler
*/
import { CoreContext, CoreResult } from '../../types';
/**
* Get internal context object.
*/
export const getContext = (context: CoreContext): CoreResult => {
return {
text: `Context: ${JSON.stringify(context, null, 2)}`,
json: context,
html: `<h1>Context</h1>\n<pre>${JSON.stringify(context, null, 2)}</pre>`
};
};