Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mix2

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mix2

The YUI mix

  • 1.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
29K
decreased by-5.5%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

mix2

The port of YUI3's mix method for node. Mixins two objects.

Install

$ npm install mix2

Usage

const a = {a: 1}
const b = {b: 2}
const c = {a: 10, b: 20, c: 30}

mix(a, b)
console.log(a) // {a: 1, b: 2}

// Will not override the existing property 'a'
mix({a: 1}, c, false)             // {a: 1,  b: 20, c: 30}

// Only copy property 'a' and 'c', and override.
mix({a: 1}, c, true, ['a', 'c'])  // {a: 10, c: 30}

mix(receiver, supplier, [override], [copylist])

  • receiver Object
  • supplier Object
  • override Boolean=true Whether should override the existing property of receiver. Default to overriding(true)
  • copylist (Array.<String>)= If specified, only mix the specific keys in the array. Otherwise, mixin all properties.

Extend the object receiver with supplier, and returns receiver.

License

MIT

Keywords

FAQs

Package last updated on 11 May 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc