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

Function formDataRecord

packages/effect/src/unstable/http/HttpBody.ts:425–437  ·  view source on GitHub ↗
(entries: FormDataInput)

Source from the content-addressed store, hash-verified

423 * @since 4.0.0
424 */
425export const formDataRecord = (entries: FormDataInput): FormData => {
426 const data = new globalThis.FormData()
427 for (const [key, value] of Object.entries(entries)) {
428 if (Array.isArray(value)) {
429 for (const item of value) {
430 appendFormDataValue(data, key, item)
431 }
432 } else {
433 appendFormDataValue(data, key, value as FormDataCoercible)
434 }
435 }
436 return formData(data)
437}
438
439/**
440 * HTTP body variant backed by a stream of `Uint8Array` chunks.

Callers

nothing calls this directly

Calls 2

appendFormDataValueFunction · 0.85
formDataFunction · 0.70

Tested by

no test coverage detected