Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/henry781/deep-merge
https://github.com/henry781/deep-merge
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/henry781/deep-merge
- Owner: henry781
- Created: 2019-12-05T20:24:02.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-03-25T21:22:36.000Z (over 2 years ago)
- Last Synced: 2024-10-04T02:53:44.943Z (about 1 month ago)
- Language: TypeScript
- Size: 128 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# deep-merge
[![Build Status](https://travis-ci.com/henry781/deep-merge.svg?branch=master)](https://travis-ci.com/henry781/deep-merge)Deep merge allows to merge with context.
```
const obj1 = {
A: 'A obj1',
};
const obj2 = {
B: 'B obj2',
};let result = Merge.merge({}, obj1, {context: 'obj1'});
result = Merge.merge(result, obj2, {context: 'obj2'});console.log(result._context.A);
// obj1console.log(result._context.B);
// obj2console.log(result);
// {
// A: "A obj1",
// B: "B obj2"
// }
```