{"name":"deepmerge-ts","version":"4.2.2","keywords":["merge","deepmerge","deep merge","deep-merge","inferred types","inferred-types","recursive merge","recursive-merge","ts","ts merge","ts-merge","typescript","typescript merge","typescript-merge"],"author":{"name":"Rebecca Stevens","email":"rebecca.stevens@outlook.co.nz"},"license":"BSD-3-Clause","_id":"deepmerge-ts@4.2.2","maintainers":[{"name":"rebeccastevens","email":"rebecca.stevens@outlook.co.nz"}],"homepage":"https://github.com/RebeccaStevens/deepmerge-ts#readme","bugs":{"url":"https://github.com/RebeccaStevens/deepmerge-ts/issues"},"dist":{"shasum":"582bf34a37592dc8274b137617b539f871aaf11a","tarball":"http://registry-npm.ywwl.com/deepmerge-ts/download/deepmerge-ts-4.2.2.tgz","fileCount":10,"integrity":"sha512-Ka3Kb21tiWjvQvS9U+1Dx+aqFAHsdTnMdYptLTmC2VAmDFMugWMY1e15aTODstipmCun8iNuqeSfcx6rsUUk0Q==","signatures":[{"sig":"MEUCIF2lChJyuvqQ+ccxD/JCZrUbFW4C0GA2OUFZdiALu5D3AiEAnjOyjg1+4TbKPscF2I/+NTpy1VPtKhm07/+G7GUd7Ko=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":109952,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKFeLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2oA//deQdi+2po9YOoylzXJ8MG9Mg39sOoyDP90+NUy4W2lluvrmM\r\n69vDKi+uubxSlAyXweRUFVUHWuEqmGJp5h51QwJieBfXhYXs25iRKcyIuAdK\r\nXqFE5Zdhz8m0OheNsXf1mUu7qLzWimfRwhTnArebZEa+NeamYNr5A/IZpz/h\r\n8YR0XWn76iRfWgxBvAO2uCllXabNioEnc0hv+ZBcxz2M/YpYBviiFZZygGKS\r\nTnRiOPY3JG6hNscPFOAenRi3kQlG+YYeT+FhT5DMglsvL8HRcXle7zBi9tmo\r\nPOkBjW5WV7F2STWmekB5v5Wv9OLn/eaMKLdsfrLTmUdOC1DjMyP7Mw9z72TO\r\nf9psXxoajzbX+90noUilGVTI0StQUb8uLFGRnyWbpgrypfBf20ZJa8ZYJ3bg\r\n5dxALqgcPCYg98Zv8EEW3gNOYSQt2C+3W3bkrCGGzp300stbX+jCSpSKvxup\r\nQTiqIfILDPz+2saJix4oeAz2tksVX1snyr9jt1T8W68WqI2P2zZGmRVZkNXu\r\nUAQLLu1Jv2ZR0HL5g93EmKsHW85f26V2nrcxf8qsmkvuf7UZmwlw9CpOnWgE\r\n/jpfwZwJSg72EoXGRAEi02LZqekuqwGooQ/xHrSC6hPAX+pGDzYi58fCbb4B\r\nz7nSoEgDOTfGJ1lToNOZd6Zxyh18rG5uzos=\r\n=fLTU\r\n-----END PGP SIGNATURE-----\r\n","size":18545,"noattachment":false,"key":"/deepmerge-ts/-/deepmerge-ts-4.2.2.tgz"},"main":"dist/node/index.cjs","type":"module","types":"dist/node/types/legacy/v4_0.d.ts","module":"dist/node/index.mjs","denoify":{"out":"dist/deno","index":"src/index.ts","ports":{"is-plain-object":"https://raw.githubusercontent.com/jonschlinkert/is-plain-object/v5.0.0/is-plain-object.js"}},"engines":{"node":">=12.4.0"},"exports":{"types":{"import":"./dist/node/types/current/index.d.mts","require":"./dist/node/types/current/index.d.cts"},"import":"./dist/node/index.mjs","require":"./dist/node/index.cjs"},"gitHead":"5735fadce9c15b576fd5d386a31f93cb126686bd","scripts":{"cz":"git-cz","lint":"yarn lint:js && yarn lint:md","test":"yarn test:js && yarn test:types","build":"rimraf build && yarn build:npm && yarn build:deno && rimraf build && if-env-defined CI || yarn build:assume-unchanged","format":"prettier --write \"./**/*.{md,ts,yml}\"","lint:js":"eslint .","lint:md":"markdownlint \"**/*.md\" --config=.markdownlint.json --ignore-path=.markdownlintignore","prepare":"husky install","test:js":"c8 ava","benchmark":"yarn build && yarn link & cd benchmark && yarn benchmark; cd ..","build:npm":"rimraf dist/node types/current && rollup -c rollup.config.ts --configPlugin @rollup/plugin-typescript","build:deno":"rimraf dist/deno && tsc -p tsconfig.build.deno.json && denoify","test:types":"dtslint --localTs node_modules/typescript/lib --expectOnly tests/types","check-format":"prettier --list-different \"./**/*.{md,ts,yml}\"","check-spelling":"cspell --config=.cspell.json \"**/*.{md,ts}\"","build:assume-unchanged":"cd dist; git update-index --assume-unchanged $(git ls-files | tr '\n' ' '); cd .."},"_npmUser":{"name":"rebeccastevens","email":"rebecca.stevens@outlook.co.nz"},"repository":{"url":"git+https://github.com/RebeccaStevens/deepmerge-ts.git","type":"git"},"_npmVersion":"8.19.2","description":"Deeply merge 2 or more objects respecting type information.","directories":{},"sideEffects":false,"_nodeVersion":"16.17.0","typesVersions":{"<4.1":{"*":["dist/node/types/legacy/v4_0.d.ts"]},"<4.7":{"*":["dist/node/types/legacy/v4_6.d.ts"]},">=4.7":{"*":["dist/node/types/current/index.d.mts"]}},"_hasShrinkwrap":false,"packageManager":"yarn@3.2.3","devDependencies":{"c8":"^7.11.3","ava":"^4.3.1","husky":"^8.0.1","tslib":"^2.4.0","cspell":"^6.2.3","eslint":"^8.19.0","lodash":"^4.17.21","marked":"^4.0.17","rimraf":"^3.0.2","rollup":"^2.76.0","codecov":"^3.8.3","denoify":"^1.0.3","dtslint":"^4.2.1","ts-node":"^10.8.2","prettier":"^2.7.1","commitizen":"^4.2.4","typescript":"^4.7.4","@types/node":"^18.0.3","lint-staged":"^13.0.3","@types/lodash":"^4.14.182","if-env-defined":"^1.0.0","@commitlint/cli":"^17.0.3","markdownlint-cli":"^0.32.1","semantic-release":"^19.0.3","eslint-plugin-ava":"^13.2.0","rollup-plugin-dts":"^4.2.2","eslint-plugin-node":"^11.1.0","rollup-plugin-copy":"^3.4.0","source-map-support":"^0.5.21","@rollup/plugin-json":"^4.1.0","eslint-plugin-jsdoc":"^39.3.3","eslint-plugin-tsdoc":"^0.2.16","eslint-plugin-import":"^2.26.0","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^9.0.1","eslint-plugin-promise":"^6.0.0","eslint-plugin-sonarjs":"^0.15.0","eslint-plugin-unicorn":"^43.0.1","eslint-config-prettier":"^8.5.0","eslint-plugin-markdown":"^3.0.0","eslint-plugin-prettier":"^4.2.1","@semantic-release/github":"^8.0.5","eslint-plugin-functional":"^4.2.1","@rollup/plugin-typescript":"^8.3.3","@typescript-eslint/parser":"^5.30.5","@rollup/plugin-node-resolve":"^14.0.0","@semantic-release/changelog":"^6.0.1","eslint-plugin-eslint-plugin":"^5.0.6","rollup-plugin-auto-external":"^2.0.0","eslint-plugin-optimize-regex":"^1.2.1","@cspell/dict-cryptocurrencies":"^2.0.0","@rebeccastevens/eslint-config":"^1.3.23","eslint-plugin-eslint-comments":"^3.2.0","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.30.5","@semantic-release/commit-analyzer":"^9.0.2","eslint-import-resolver-typescript":"^3.2.5","@types/rollup-plugin-auto-external":"^2.0.2","@semantic-release/release-notes-generator":"^10.0.3"},"_npmOperationalInternal":{"tmp":"tmp/deepmerge-ts_4.2.2_1663588235178_0.6687062388720415","host":"s3://npm-registry-packages"},"readme":"<div align=\"center\">\n\n# DeepmergeTS\n\n[![npm version](https://img.shields.io/npm/v/deepmerge-ts.svg)](https://www.npmjs.com/package/deepmerge-ts)\n[![deno version](https://img.shields.io/github/v/tag/RebeccaStevens/deepmerge-ts?label=deno&sort=semver)](https://deno.land/x/deepmergets)\n[![CI](https://github.com/RebeccaStevens/deepmerge-ts/actions/workflows/release.yml/badge.svg)](https://github.com/RebeccaStevens/deepmerge-ts/actions/workflows/release.yml)\n[![Coverage Status](https://codecov.io/gh/RebeccaStevens/deepmerge-ts/branch/main/graph/badge.svg?token=MVpR1oAbIT)](https://codecov.io/gh/RebeccaStevens/deepmerge-ts)\\\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n[![GitHub Discussions](https://img.shields.io/github/discussions/RebeccaStevens/deepmerge-ts?style=flat-square)](https://github.com/RebeccaStevens/deepmerge-ts/discussions)\n[![BSD 3 Clause license](https://img.shields.io/github/license/RebeccaStevens/deepmerge-ts.svg?style=flat-square)](https://opensource.org/licenses/BSD-3-Clause)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](https://commitizen.github.io/cz-cli/)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)\n\nDeeply merge 2 or more objects respecting type information.\n\n![smart merge diagram](./assets/header.png)\n\n</div>\n\n## Donate\n\n[Any donations would be much appreciated](./DONATIONS.md). 😄\n\n### Enterprise Users\n\n`deepmerge-ts` is available as part of the Tidelift Subscription.\n\nTidelift is working with the maintainers of `deepmerge-ts` and a growing network of open source maintainers to ensure\nyour open source software supply chain meets enterprise standards now and into the future.\n[Learn more.](https://tidelift.com/subscription/pkg/npm-deepmerge-ts?utm_source=npm-deepmerge-ts&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)\n\n## Installation\n\n### Node\n\n```sh\n# Install with npm\nnpm install deepmerge-ts\n\n# Install with pnpm\npnpm add deepmerge-ts\n\n# Install with yarn\nyarn add deepmerge-ts\n```\n\n### Deno\n\n```jsonc\n// import_map.json\n{\n  \"imports\": {\n    \"deepmerge-ts\": \"https://deno.land/x/deepmergets@__version__/dist/deno/index.ts\",\n  },\n}\n```\n\n## Features\n\n- Smart merging - High performance.\n- Merged output has correct typing.\n- Record merging support.\n- Array merging support.\n- Map and Set merging support.\n- Customized merging.\n\n## Usage\n\n### Example using default config\n\n```js\nimport { deepmerge } from \"deepmerge-ts\";\n\nconst x = {\n  record: {\n    prop1: \"value1\",\n    prop2: \"value2\",\n  },\n  array: [1, 2, 3],\n  set: new Set([1, 2, 3]),\n  map: new Map([\n    [\"key1\", \"value1\"],\n    [\"key2\", \"value2\"],\n  ]),\n};\n\nconst y = {\n  record: {\n    prop1: \"changed\",\n    prop3: \"value3\",\n  },\n  array: [2, 3, 4],\n  set: new Set([2, 3, 4]),\n  map: new Map([\n    [\"key2\", \"changed\"],\n    [\"key3\", \"value3\"],\n  ]),\n};\n\nconst z = {\n  record: {\n    prop1: undefined,\n    prop3: undefined,\n    prop2: undefined,\n    prop4: undefined,\n  },\n  array: undefined,\n  set: undefined,\n  map: undefined,\n};\n\nconst merged = deepmerge(x, y, z);\n\nconsole.log(merged);\n\n// Prettierfied output:\n//\n// Object {\n//   \"record\": Object {\n//     \"prop1\": \"changed\",\n//     \"prop2\": \"value2\",\n//     \"prop3\": \"value3\",\n//     \"prop4\": undefined,\n//   },\n//   \"array\": Array [1, 2, 3, 2, 3, 4],\n//   \"set\": Set { 1, 2, 3, 4 },\n//   \"map\": Map {\n//     \"key1\" => \"value1\",\n//     \"key2\" => \"changed\",\n//     \"key3\" => \"value3\",\n//   },\n// }\n```\n\nYou can try out this example at\n[codesandbox.io](https://codesandbox.io/s/deepmerge-ts-example-iltxby?file=/src/example.ts).\n\n### Merging into a Target\n\nYou can use `deepmergeInto` if you want to update a target object with the merge result instead of creating a new\nobject.\n\nThis function is best used with objects that are all of the same type.\n\nNote: If the target object's type differs from the input objects, we'll assert that the target's type has changed\n(this is not done automatically with `deepmergeIntoCustom`).\n\n### Customized the Merging Process\n\nWe provide a customizer function for each of our main deepmerge functions: `deepmergeCustom` and `deepmergeIntoCustom`.\nYou can use these to customize the details of how values should be merged together.\n\nSee [deepmerge custom docs](./docs/deepmergeCustom.md) for more details.\n\n## Performance\n\nWe use smart merging instead of the classic merging strategy which some alternative libraries use. This vastly improves\nperformance, both in execution time and memory usage.\n\n### Classic Merge (not what we do)\n\nWith classic merging, each input is merged with the next input until all inputs are merged.\n\nThis strategy has large performance issues when lots of items need to be merged.\n\n![classic merge animation](./assets/classic-merge.gif)\n\n### Smart Merge (what we do)\n\nWith our smart merging, we look ahead to see what can be merged and only merge those things.\n\nIn addition to performance improvements, this strategy merges multiple inputs at once; allowing for benefits such as\ntaking averages of the inputs.\n\n![smart merge animation](./assets/smart-merge.gif)\n\n## API\n\nSee [API docs](./docs/API.md).\n","publish_time":1663588235327,"_cnpm_publish_time":1663588235327,"dist-tags":{"latest":"8.0.2"}}