MCPcopy Create free account
hub / github.com/axios/axios / arrayToObject

Function arrayToObject

lib/helpers/formDataToJSON.js:55–66  ·  view source on GitHub ↗

* Convert an array to an object. * * @param {Array } arr - The array to convert to an object. * * @returns An object with the same keys and values as the array.

(arr)

Source from the content-addressed store, hash-verified

53 * @returns An object with the same keys and values as the array.
54 */
55function arrayToObject(arr) {
56 const obj = {};
57 const keys = Object.keys(arr);
58 let i;
59 const len = keys.length;
60 let key;
61 for (i = 0; i < len; i++) {
62 key = keys[i];
63 obj[key] = arr[key];
64 }
65 return obj;
66}
67
68/**
69 * It takes a FormData object and returns a JavaScript object

Callers 1

buildPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected