JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 67486514
  • Score
    100M100P100Q238904F
  • License MIT

ES6 Object.assign() ponyfill

Package Exports

  • object-assign
  • object-assign/package.json

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (object-assign) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

object-assign Build Status

ES6 Object.assign() ponyfill

Should be pretty close to the spec.

Ponyfill: A polyfill that doesn't overwrite the native method

Install

Download manually or with a package-manager.

npm

npm install --save object-assign

Bower

bower install --save object-assign

Component

component install sindresorhus/object-assign

Example

objectAssign({foo: 0}, {bar: 1});
//=> {foo: 0, bar: 1}

// multiple sources
[{bar: 1}, {baz: 2}].reduce(objectAssign, {foo: 0});
//=> {foo: 0, bar: 1, baz: 2}

API

objectAssign(target, source)

Assigns enumerable own properties of the source object to the target object and returns the target object.

Multiple sources

Unfortunately support for multiple sources aren't defined in the Object.assign spec.

However, you can easily achieve it with [target, source, source, ...].reduce(objectAssign).

Resources

License

MIT © Sindre Sorhus