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

conkat

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

conkat

Merge arrays, object, maps, and sets

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

conkat

Merge arrays, objects, maps, and sets

Install

$ npm i -S conkat

Usage

Merge Arrays

import merge from 'conkat';

const a = [1, 2, 3];
const b = [4, 5, 6];

console.log(conkat(a, b));

// -> [1, 2, 3, 4, 5, 6]

Merge Objects

const a = {
  first_name: 'Vu',
}

const b = {
  last_name: 'Tran',
}

console.log(conkat(a, b));

// -> { first_name: 'Vu', last_name: 'Vu' }

Merge ES2015 Sets

const a = new Set();
a.add('foo');
a.add('bar');

const b = new Set();
b.add('baz');
b.add('qux');

console.log(conkat(a, b));

// -> Set { 'foo', 'bar', 'baz', 'qux' }

Merge ES2015 Maps

const a = new Map();
a.set('one', 1);
a.set('two', 2);

const b = new Map();
a.set('three', 3);

console.log(conkat(a, b));

// -> Map { 'one' => 1, 'two' => 2, 'three' => 3 }

License

MIT © Vu Tran

FAQs

Package last updated on 26 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts