MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / describeFormData

Function describeFormData

apps/kimi-web/src/api/daemon/http.ts:65–79  ·  view source on GitHub ↗

Trace-only FormData summary: field names + file name/size/type, never content.

(formData: FormData)

Source from the content-addressed store, hash-verified

63
64/** Trace-only FormData summary: field names + file name/size/type, never content. */
65function describeFormData(formData: FormData): unknown {
66 try {
67 const fields: Array<Record<string, unknown>> = [];
68 formData.forEach((value, field) => {
69 if (typeof value === 'string') {
70 fields.push({ field, value });
71 } else {
72 fields.push({ field, file: value.name, size: value.size, type: value.type });
73 }
74 });
75 return { formData: fields };
76 } catch {
77 return '[FormData]';
78 }
79}
80
81async function readResponsePreview(response: Response): Promise<string | undefined> {
82 try {

Callers 1

postFormMethod · 0.85

Calls 2

forEachMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected