UNPKG

fetch-to-curl-ts

Version:
10 lines (9 loc) 410 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.toTupleArray = void 0; const toTupleArray = (headers) => "entries" in headers && typeof headers.entries === "function" ? [...headers] : Object.entries(headers).flatMap(([key, value]) => typeof value === "string" ? [[key, value]] : value.map((val) => [key, val])); exports.toTupleArray = toTupleArray;