fix: urlencoded formdata key value params ui

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
This commit is contained in:
liyasthomas
2022-01-22 19:12:23 +05:30
committed by Andrew Bastin
parent 1ba89a0f0b
commit b57b948107
3 changed files with 20 additions and 7 deletions

View File

@@ -4,4 +4,6 @@ export const tupleToRecord = <
>(
tuples: [KeyType, ValueType][]
): Record<KeyType, ValueType> =>
(Object.assign as any)(...tuples.map(([key, val]) => ({ [key]: val })))
tuples.length > 0
? (Object.assign as any)(...tuples.map(([key, val]) => ({ [key]: val })))
: {}