New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@baravak/array2object

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@baravak/array2object - npm Package Compare versions

Comparing version
1.0.3
to
1.4.0
+1
-1
build/index.d.ts

@@ -1,1 +0,1 @@

export declare function Array2Object(array: any[], key: string): Record<string, any>;
export declare function Array2Object(array: any[], key: string, value?: string): Record<string, any>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Array2Object = void 0;
function Array2Object(array, key) {
function Array2Object(array, key, value) {
return array.reduce((obj, item) => {
return {
...obj,
[item[key]]: item
[item[key]]: value === undefined ? item : item.value
};

@@ -10,0 +10,0 @@ }, {});

{
"name": "@baravak/array2object",
"version": "1.0.3",
"version": "1.4.0",
"description": "Convert array to object",

@@ -5,0 +5,0 @@ "main": "build/index.js",