4.1.1 • Published 7 years ago

object-assign v4.1.1

Weekly downloads
26,588,509
License
MIT
Repository
github
Last release
7 years ago

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

Related

License

MIT © Sindre Sorhus

prop-typescorsfbjsmzreact-app-polyfillpug-loadmultermultipipereact-helmetcreate-react-classgulp-utilis-expressioncuc-gaf@plone/volto@huyhpham/rn-line@uukit/scripts@dyng/kdjsal-react-scriptsarchetype-librarybabel-js-handlercomponennentt@teambit/legacy@christensena/react-scripts@christensena/react-scripts-tseasy-select-rnimily-pinyinvuedragdropuploadimages@fatihkydev/gatsby-source-datocmsdecorators-and-sass-react-scriptsaccra-minify-csspopsmart-common-authreact-native-bluetooth2rl-image-loaderkilli8n-react-native-fast-image@nia3208/forevertransform-pinyin-utilhae-testpipihomehfsyun-toplusextensible-node-serverreact-zh-libreact-cmp-zhlibpostcss-adapt@darrinholst/protractor-cucumber-framework@paperlesspost/react-scriptskeeper-formspostcss-px-to-vw-includepostcss-pxtorem-abcflowbuilder-testdt-ai-worksdraft-js-compositionqm-ux-gmaerolito-nextrn-send-smssitka-webccb-huisample-zarla-kittheme-chalk-previewzarla-kitkolbeinsson88-assignment5kolbeinsson88-stylesreact-helmet-ie8r15-happy-routeractive-react-scriptsinsticc_dummy_module6@tantei/reactcryptomktinsticc_dummy_module8rulework-react-data-gridbaltimorecounty-react-componentslokationgew-nodejs-api-clientreact-slick-x@zhanghaox/react-zh-lib@ikangxu/i5ting_tocflipsheettwirlcard@rafibarash/react-scriptscustom-vuxace-plus-portalreact-native-redux-lang@arisageha/react-lazyload@arisageha/react-lazyload-fixagile-director-backreact-pageable-tablenode-bittrex-api-perfdropdown-multiselect@cashremit/cr-streamline-iconsvue-croppa2@ironbay/react-scripts-legos@jjavery/react-scripts@enbock/time-trackerrube-toolspixi-aliminiapp-engine@omake/react-scripts@doen/postcss-px-to-viewportdotsbi-react-scripts-tspostcss-px-to-viewport-multiplecustom-react-scripts-with-modulesopinionated-react-scripts
4.1.1

7 years ago

4.1.0

8 years ago

4.0.1

9 years ago

4.0.0

9 years ago

2.1.1

9 years ago

2.0.1

9 years ago

3.0.0

9 years ago

2.1.0

9 years ago

2.0.0

9 years ago

1.0.0

10 years ago

0.4.0

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago