MCPcopy
hub / github.com/firecrawl/firecrawl / normalizeMonitorFormats

Function normalizeMonitorFormats

apps/api/src/services/monitoring/diff.ts:313–345  ·  view source on GitHub ↗
(formats: unknown)

Source from the content-addressed store, hash-verified

311 * addition, that mode is dropped (markdown is already requested elsewhere).
312 */
313export function normalizeMonitorFormats(formats: unknown): unknown[] {
314 if (!Array.isArray(formats)) return [];
315 const out: unknown[] = [];
316 for (const entry of formats) {
317 if (
318 entry &&
319 typeof entry === "object" &&
320 (entry as { type?: unknown }).type === "changeTracking"
321 ) {
322 const obj = entry as {
323 type: "changeTracking";
324 modes?: unknown;
325 schema?: unknown;
326 prompt?: unknown;
327 tag?: unknown;
328 };
329 const modes = Array.isArray(obj.modes) ? obj.modes : [];
330 if (modes.includes("json")) {
331 out.push({
332 type: "json",
333 ...(typeof obj.prompt === "string" ? { prompt: obj.prompt } : {}),
334 ...(obj.schema && typeof obj.schema === "object"
335 ? { schema: obj.schema }
336 : {}),
337 });
338 }
339 // git-diff mode is implicit via the markdown format already added.
340 continue;
341 }
342 out.push(entry);
343 }
344 return out;
345}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…