A lightweight utility to recursively merge two JSON objects in TypeScript. Supports replacing primitive values, arrays, and combining objects deeply
npm install json-glue

!GitHub Release
!NPM Version
A lightweight utility to recursively merge two JSON objects in TypeScript. Supports replacing primitive values, arrays, and combining objects deeply.
You can install this package using npm:
``sh`
npm install json-glue
`typescript
import { merge } from 'json-glue';
const obj1 = { a: 1, b: 2, c: { d: 3, e: 4 } };
const obj2 = { a: 5, c: { d: 6, f: 7 } };
const result = merge(obj1, obj2);
console.log(result);
`
Output:
`json`
{ "a": 5, "b": 2, "c": { "d": 6, "e": 4, "f": 7 } }
This project is licensed under the ISC License.
1. Fork the repository.
2. Create a new feature branch (git checkout -b feature/your-feature).git commit -m 'fix: fix the bug'
3. Commit your changes ().git push origin feature/your-feature`).
4. Push the branch (
5. Open a pull request.
For major changes, please open an issue first to discuss what you would like to change.