{"id":15383153,"url":"https://github.com/jhildenbiddle/mergician","last_synced_at":"2025-04-09T13:04:43.285Z","repository":{"id":39735543,"uuid":"506419562","full_name":"jhildenbiddle/mergician","owner":"jhildenbiddle","description":"Uniquely flexible and light-weight utility for cloning and deep (recursive) merging of JavaScript objects. Supports descriptor values, accessor functions, and custom prototypes. Provides advanced options for customizing the clone/merge process.","archived":false,"fork":false,"pushed_at":"2024-08-21T10:58:37.000Z","size":934,"stargazers_count":78,"open_issues_count":3,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T02:02:52.702Z","etag":null,"topics":["accessor","array","clone","copy","deep","deep-merge","deepmerge","descriptor","duplicate","extend","filter","getter","immutable","javascript","merge","merge-deep","object","recursive","setter","sort"],"latest_commit_sha":null,"homepage":"https://jhildenbiddle.github.io/mergician/","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/jhildenbiddle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"jhildenbiddle"}},"created_at":"2022-06-22T22:08:32.000Z","updated_at":"2025-03-01T20:15:46.000Z","dependencies_parsed_at":"2024-02-13T06:23:30.796Z","dependency_job_id":"6480ec84-2131-4d3e-9270-ce837948a983","html_url":"https://github.com/jhildenbiddle/mergician","commit_stats":{"total_commits":128,"total_committers":2,"mean_commits":64.0,"dds":0.0234375,"last_synced_commit":"2ca2263aa10e7bb6eb187dcf07973a76da4947f7"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhildenbiddle%2Fmergician","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhildenbiddle%2Fmergician/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhildenbiddle%2Fmergician/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhildenbiddle%2Fmergician/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhildenbiddle","download_url":"https://codeload.github.com/jhildenbiddle/mergician/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045230,"owners_count":21038553,"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":["accessor","array","clone","copy","deep","deep-merge","deepmerge","descriptor","duplicate","extend","filter","getter","immutable","javascript","merge","merge-deep","object","recursive","setter","sort"],"created_at":"2024-10-01T14:35:33.423Z","updated_at":"2025-04-09T13:04:43.261Z","avatar_url":"https://github.com/jhildenbiddle.png","language":"JavaScript","funding_links":["https://github.com/sponsors/jhildenbiddle"],"categories":[],"sub_categories":[],"readme":"# Mergician\n\n[![NPM](https://img.shields.io/npm/v/mergician.svg?style=flat-square)](https://www.npmjs.com/package/mergician)\n[![GitHub Workflow Status (main)](https://img.shields.io/github/actions/workflow/status/jhildenbiddle/mergician/test.yml?branch=main\u0026label=checks\u0026style=flat-square)](https://github.com/jhildenbiddle/mergician/actions?query=branch%3Amain+)\n[![Codacy code quality](https://img.shields.io/codacy/grade/9831274fda2341129b76ff3582ec0df5/main?style=flat-square)](https://app.codacy.com/gh/jhildenbiddle/mergician/dashboard?branch=main)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://github.com/jhildenbiddle/mergician/blob/main/LICENSE)\n[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/mergician/badge)](https://www.jsdelivr.com/package/npm/mergician)\n[![Sponsor this project](https://img.shields.io/static/v1?style=flat-square\u0026label=Sponsor\u0026message=%E2%9D%A4\u0026logo=GitHub\u0026color=%23fe8e86)](https://github.com/sponsors/jhildenbiddle)\n\nMergician is a uniquely flexible and light-weight utility for cloning and deep (recursive) merging of JavaScript objects.\n\nUnlike native methods and other utilities, Mergician faithfully clones and merges objects by properly handling [descriptor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor) values, [accessor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) functions, and prototype properties while offering advanced options for customizing the clone/merge process.\n\n- 🚀 [Documentation \u0026 Demos](https://jhildenbiddle.github.io/mergician/)\n\n## Features\n\n- Deep (recursive) clone/merge JavaScript objects\n- Generates new object without modifying source object(s)\n- Clone/merge enumerable and non-enumerable properties\n- Clone/merge property [descriptor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor) values\n- Retain, skip, or convert [accessor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) functions to static values\n- Inspect, filter, and modify properties\n- Merge, skip, or hoist prototype properties\n- Merge or skip key intersections, unions, and differences\n- Merge, sort, and remove duplicate array items\n- IntelliSense / code hinting support\n- TypeScript support\n- Lightweight (2k min+gzip) and dependency-free\n\n**Platform Support**\n\n\u003cimg src=\"https://raw.githubusercontent.com/jhildenbiddle/mergician/main/docs/assets/img/node.svg\" valign=\"middle\" alt=\"\"\u003e \u003cspan valign=\"middle\"\u003eNode 10+\u003c/span\u003e\n\u003cbr\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/jhildenbiddle/mergician/main/docs/assets/img/chrome.svg\" valign=\"middle\" alt=\"\"\u003e \u003cspan valign=\"middle\"\u003eChrome 61+\u003c/span\u003e\n\u003cbr\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/jhildenbiddle/mergician/main/docs/assets/img/edge.svg\" valign=\"middle\" alt=\"\"\u003e \u003cspan valign=\"middle\"\u003eEdge 16+\u003c/span\u003e\n\u003cbr\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/jhildenbiddle/mergician/main/docs/assets/img/firefox.svg\" valign=\"middle\" alt=\"\"\u003e \u003cspan valign=\"middle\"\u003eFirefox 60+\u003c/span\u003e\n\u003cbr\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/jhildenbiddle/mergician/main/docs/assets/img/safari.svg\" valign=\"middle\" alt=\"\"\u003e \u003cspan valign=\"middle\"\u003eSafari 10.1+\u003c/span\u003e\n\n## Examples\n\nBasic object cloning using default options:\n\n```javascript\n// ES module shown. CommonJS module also available (see below).\nimport { mergician } from 'mergician';\n\nconst obj1 = { a: [1, 1], b: { c: 1, d: 1 } };\nconst clonedObj = mergician({}, obj1);\n\n// Results\nconsole.log(clonedObj); // { a: [1, 1], b: { c: 1, d: 1 } }\nconsole.log(clonedObj === obj1); // false\nconsole.log(clonedObj.a === obj1.a); // false\nconsole.log(clonedObj.b === obj1.b); // false\n```\n\nAdvanced object merging using custom options:\n\n```javascript\n// ES module shown. CommonJS module also available (see below).\nimport { mergician } from 'mergician';\n\nconst obj1 = { a: [1, 1], b: { c: 1, d: 1 } };\nconst obj2 = { a: [2, 2], b: { c: 2 } };\nconst obj3 = { e: 3 };\n\nconst mergedObj = mergician({\n  skipKeys: ['d'],\n  appendArrays: true,\n  dedupArrays: true,\n  filter({ depth, key, srcObj, srcVal, targetObj, targetVal }) {\n    if (key === 'e') {\n      targetObj['hello'] = 'world';\n      return false;\n    }\n  }\n})(obj1, obj2, obj3);\n\n// Result\nconsole.log(mergedObj); // { a: [1, 2], b: { c: 2 }, hello: 'world' }\n```\n\n## Installation\n\n**NPM**\n\n```bash\nnpm install mergician\n```\n\n```javascript\n// ES module\nimport { mergician } from 'mergician';\n```\n\n```javascript\n// CommonJS module\nconst { mergician } = require('mergician');\n```\n\n**CDN**\n\nAvailable on [jsdelivr](https://www.jsdelivr.com/package/npm/mergician) (below), [unpkg](https://unpkg.com/browse/mergician/), and other CDN services that auto-publish npm packages.\n\n\u003e 💡 Note the `@` version lock in the URLs below. This prevents breaking changes in future releases from affecting your project and is therefore the safest method of loading dependencies from a CDN. When a new major version is released, you will need to manually update your CDN URLs by changing the version after the `@` symbol.\n\n```javascript\n// ES module @ latest v2.x.x\nimport { mergician } from 'https://cdn.jsdelivr.net/npm/mergician@2';\n```\n\n## Usage \u0026 Options\n\nSee the [documentation site](https://jhildenbiddle.github.io/mergician/) for details.\n\n## Sponsorship\n\nA [sponsorship](https://github.com/sponsors/jhildenbiddle) is more than just a way to show appreciation for the open-source authors and projects we rely on; it can be the spark that ignites the next big idea, the inspiration to create something new, and the motivation to share so that others may benefit.\n\nIf you benefit from this project, please consider lending your support and encouraging future efforts by [becoming a sponsor](https://github.com/sponsors/jhildenbiddle).\n\nThank you! 🙏🏻\n\n## Contact \u0026 Support\n\n- Follow 👨🏻‍💻 **@jhildenbiddle** on [Twitter](https://twitter.com/jhildenbiddle) and [GitHub](https://github.com/jhildenbiddle) for announcements\n- Create a 💬 [GitHub issue](https://github.com/jhildenbiddle/mergician/issues) for bug reports, feature requests, or questions\n- Add a ⭐️ [star on GitHub](https://github.com/jhildenbiddle/mergician) and 🐦 [tweet](https://twitter.com/intent/tweet?url=https%3A%2F%2Fgithub.com%2Fjhildenbiddle%2Fmergician\u0026hashtags=developers,frontend,javascript) to promote the project\n- Become a 💖 [sponsor](https://github.com/sponsors/jhildenbiddle) to support the project and future efforts\n\n## License\n\nThis project is licensed under the [MIT license](https://github.com/jhildenbiddle/mergician/blob/main/LICENSE).\n\nCopyright (c) John Hildenbiddle ([@jhildenbiddle](https://twitter.com/jhildenbiddle))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhildenbiddle%2Fmergician","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhildenbiddle%2Fmergician","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhildenbiddle%2Fmergician/lists"}