MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/functions-framework-nodejs / getJSONWithContext

Function getJSONWithContext

src/logger.ts:150–160  ·  view source on GitHub ↗
(json: any, context: ExecutionContext)

Source from the content-addressed store, hash-verified

148
149// eslint-disable-next-line @typescript-eslint/no-explicit-any
150function getJSONWithContext(json: any, context: ExecutionContext) {
151 if (EXECUTION_CONTEXT_LABELS_KEY in json) {
152 json[EXECUTION_CONTEXT_LABELS_KEY]['execution_id'] = context.executionId;
153 } else {
154 json[EXECUTION_CONTEXT_LABELS_KEY] = {execution_id: context.executionId};
155 }
156 if (!(EXECUTION_CONTEXT_SPAN_ID_KEY in json)) {
157 json[EXECUTION_CONTEXT_SPAN_ID_KEY] = context.spanId;
158 }
159 return json;
160}
161
162function processData(data: Uint8Array | string, encoding?: BufferEncoding) {
163 let decodedData;

Callers 1

getModifiedDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected