MCPcopy Create free account
hub / github.com/Effect-TS/effect / appendFormDataValue

Function appendFormDataValue

packages/effect/src/unstable/http/HttpBody.ts:404–413  ·  view source on GitHub ↗
(formData: globalThis.FormData, key: string, value: FormDataCoercible)

Source from the content-addressed store, hash-verified

402export type FormDataCoercible = string | number | boolean | globalThis.File | globalThis.Blob | null | undefined
403
404const appendFormDataValue = (formData: globalThis.FormData, key: string, value: FormDataCoercible): void => {
405 if (value == null) {
406 return
407 }
408 if (typeof value === "object") {
409 formData.append(key, value)
410 return
411 }
412 formData.append(key, String(value))
413}
414
415/**
416 * Creates a `FormData` HTTP body from a record.

Callers 1

formDataRecordFunction · 0.85

Calls 1

StringInterface · 0.50

Tested by

no test coverage detected