Big update!Announcing Socket for GitHub 1.0. Learn more
Socket
BlogLoveFAQ
Install
Log in

object-assign

Package Overview
Dependencies
0
Maintainers
3
Versions
17
Issues
File Explorer

Advanced tools

object-assign

ES2015 `Object.assign()` ponyfill

    4.1.1latest

Version published
Maintainers
3
Weekly downloads
32,878,988
increased by0.2%

Weekly downloads

Readme

Source

object-assign Build Status

ES2015 Object.assign() ponyfill

Use the built-in

Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), support Object.assign() :tada:. If you target only those environments, then by all means, use Object.assign() instead of this package.

Install

$ npm install --save object-assign

Usage

const objectAssign = require('object-assign'); objectAssign({foo: 0}, {bar: 1}); //=> {foo: 0, bar: 1} // multiple sources objectAssign({foo: 0}, {bar: 1}, {baz: 2}); //=> {foo: 0, bar: 1, baz: 2} // overwrites equal keys objectAssign({foo: 0}, {foo: 1}, {foo: 2}); //=> {foo: 2} // ignores null and undefined sources objectAssign({foo: 0}, null, {bar: 1}, undefined); //=> {foo: 0, bar: 1}

API

objectAssign(target, [source, ...])

Assigns enumerable own properties of source objects to the target object and returns the target object. Additional source objects will overwrite previous ones.

Resources

License

MIT © Sindre Sorhus

Keywords

FAQs

What is object-assign?

ES2015 `Object.assign()` ponyfill

Is object-assign popular?

The npm package object-assign receives a total of 26,891,585 weekly downloads. As such, object-assign popularity was classified as popular.

Is object-assign well maintained?

We found that object-assign demonstrated a not healthy version release cadence and project activity. It has 3 open source maintainers collaborating on the project.

Last updated on 16 Jan 2017
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc