maxun-core
Version:
Core package for Maxun, responsible for data extraction
16 lines (15 loc) • 545 B
JavaScript
/**
* ESLint rule in case there is only one util function
* (it still does not represent the "utils" file)
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.arrayToObject = void 0;
/* eslint-disable import/prefer-default-export */
/**
* Converts an array of scalars to an object with **items** of the array **for keys**.
*/
function arrayToObject(array) {
return array.reduce((p, x) => (Object.assign(Object.assign({}, p), { [x]: [] })), {});
}
exports.arrayToObject = arrayToObject;
;