Socket
Book a DemoInstallSign in
Socket

combine-same-keys

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

combine-same-keys

Combine all properties sharing the same key into a single object

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

combine-same-keys Build Status

Combine all properties sharing the same key into a single object

Install

npm i combine-same-keys

Usage

import combineSameKeys from 'combine-same-keys'

combineSameKeys(
  {
    foo: { color: 'red' },
    bar: { fontSize: 16 }
  },

  {
    foo: {
      backgroundColor: 'gold',
      lineHeight: 0
    }
  },

  { baz: { opacity: 1 } }
)

/*
{ foo: { color: 'red', backgroundColor: 'gold', lineHeight: 0 },
      bar: { fontSize: 16 },
      baz: { opacity: 1 } }
*/

API

combineSameKeys(...args)

args

Type: rest parameter with Object entries

License

MIT © Rafael Rinaldi

Keywords

combine

FAQs

Package last updated on 16 Mar 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