{"id":13671229,"url":"https://github.com/jonschlinkert/assign-deep","last_synced_at":"2025-04-09T18:23:25.371Z","repository":{"id":27822245,"uuid":"31311902","full_name":"jonschlinkert/assign-deep","owner":"jonschlinkert","description":"Deeply assign the enumerable properties of source objects to a destination object.","archived":false,"fork":false,"pushed_at":"2022-02-24T20:10:30.000Z","size":38,"stargazers_count":78,"open_issues_count":7,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T12:58:33.778Z","etag":null,"topics":["assign","enumerable-properties","extend","javascript","jonschlinkert","merge","nodejs","object"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonschlinkert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-25T12:09:17.000Z","updated_at":"2024-10-08T14:44:47.000Z","dependencies_parsed_at":"2022-08-30T14:51:24.737Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/assign-deep","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fassign-deep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fassign-deep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fassign-deep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fassign-deep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/assign-deep/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248086035,"owners_count":21045257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assign","enumerable-properties","extend","javascript","jonschlinkert","merge","nodejs","object"],"created_at":"2024-08-02T09:01:03.585Z","updated_at":"2025-04-09T18:23:25.352Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","readme":"# assign-deep [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/assign-deep.svg?style=flat)](https://www.npmjs.com/package/assign-deep) [![NPM monthly downloads](https://img.shields.io/npm/dm/assign-deep.svg?style=flat)](https://npmjs.org/package/assign-deep) [![NPM total downloads](https://img.shields.io/npm/dt/assign-deep.svg?style=flat)](https://npmjs.org/package/assign-deep) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/assign-deep.svg?style=flat\u0026label=Travis)](https://travis-ci.org/jonschlinkert/assign-deep)\n\n\u003e Deeply assign the values of all enumerable-own-properties and symbols from one or more source objects to a target object. Returns the target object.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save assign-deep\n```\n\n## Heads up!\n\n[Please update](https://github.com/update/update) to version 1.0.1 or later, a critical bug was fixed in that version.\n\n## Behavior\n\n* This follows the same behavior as [Object.assign()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign), and thus _does not_ deep clone values.\n* The first argument is the \"target\" object.\n* To shallow clone, pass an empty object as the first argument.\n* One or more additional (\"source\") objects may be passed.\n* When multiple objects are passed, properties in _later_ objects will overwrite same-named properties in _earlier_ objects. Thus, properties in the target object will be overwritten by same-named properties in other objects.\n* Only enumerable and own properties are copied.\n* String and Symbol properties are copied.\n* Sparse arguments are skipped, so this does not throw on `null` or `undefined` source values.\n* Like [Object.assign()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign), `[[Get]]` is used on source objects and `[[Set]]` is used on the target, so it will invoke getters and setters. Therefore it assigns properties versus just copying or defining new properties. _Note that this should not be used for merging new properties into a prototype if the merge sources contain getters and you do not want `[[Get]]` to be used on the getters. For copying property definitions and their enumerability into prototypes `Object.getOwnPropertyDescriptor()` and `Object.defineProperty()` should be used instead._\n\n## Usage\n\n```js\nconst assign = require('assign-deep');\n\nconst config = {\n  admin: true,\n  author: {\n    name: { first: 'Joe' }\n  }\n};\n\nconst locals = {\n  admin: false,\n  author: {\n    name: { last: 'Smith' },\n    username: 'joesmith'\n  }\n};\n\nconsole.log(assign(config, locals));\n// {\n//   admin: false,\n//   author: {\n//     name: { first: 'Joe', last: 'Smith' },\n//     username: 'joesmith'\n//   }\n// }\n```\n\n## About\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eContributing\u003c/strong\u003e\u003c/summary\u003e\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eRunning Tests\u003c/strong\u003e\u003c/summary\u003e\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eBuilding docs\u003c/strong\u003e\u003c/summary\u003e\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n\u003c/details\u003e\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [assign-symbols](https://www.npmjs.com/package/assign-symbols): Assign the enumerable es6 Symbol properties from one or more objects to the first object… [more](https://github.com/jonschlinkert/assign-symbols) | [homepage](https://github.com/jonschlinkert/assign-symbols \"Assign the enumerable es6 Symbol properties from one or more objects to the first object passed on the arguments. Can be used as a supplement to other extend, assign or merge methods as a polyfill for the Symbols part of the es6 Object.assign method.\")\n* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow \"Extend an object with the properties of additional objects. node.js/javascript util.\")\n* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep \"Recursively merge values in a javascript object.\")\n* [mixin-deep](https://www.npmjs.com/package/mixin-deep): Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone… [more](https://github.com/jonschlinkert/mixin-deep) | [homepage](https://github.com/jonschlinkert/mixin-deep \"Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. No dependencies.\")\n\n### Contributors\n\n| **Commits** | **Contributor** |  \n| --- | --- |  \n| 31 | [jonschlinkert](https://github.com/jonschlinkert) |  \n| 14 | [doowb](https://github.com/doowb) |  \n\n### Author\n\n**Jon Schlinkert**\n\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n\n### License\n\nCopyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on June 19, 2019._","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=W8YFZ425KND68"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fassign-deep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Fassign-deep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fassign-deep/lists"}