MCPcopy
hub / github.com/di-sukharev/opencommit / parseCustomHeaders

Function parseCustomHeaders

out/cli.cjs:84584–84601  ·  view source on GitHub ↗
(headers)

Source from the content-addressed store, hash-verified

84582 OpenAI2.FineTuning = FineTuning;
84583 OpenAI2.Beta = Beta;
84584 OpenAI2.Batches = Batches;
84585 OpenAI2.BatchesPage = BatchesPage;
84586 OpenAI2.Uploads = Uploads;
84587})(OpenAI || (OpenAI = {}));
84588
84589// src/utils/customHeaders.ts
84590function parseCustomHeaders(headers) {
84591 let parsedHeaders = {};
84592 if (!headers) {
84593 return parsedHeaders;
84594 }
84595 try {
84596 if (typeof headers === "object" && !Array.isArray(headers)) {
84597 parsedHeaders = headers;
84598 } else {
84599 parsedHeaders = JSON.parse(headers);
84600 }
84601 } catch {
84602 console.warn(
84603 "Invalid OCO_API_CUSTOM_HEADERS format, ignoring custom headers"
84604 );

Callers 2

constructorMethod · 0.70
getEngineFunction · 0.70

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…