This repository contains a TypeScript library for deep merging JavaScript/TypeScript objects while preserving and inferring accurate type information in the merged result. The library provides both immutable (`deepmerge`) and mutable (`deepmergeInto`) variants, along with customizable versions (`deepmergeCustom`, `deepmergeIntoCustom`) that allow developers to tailor the merging behavior for specific data types or scenarios. The architecture features a clean separation of concerns: core merging logic, utility functions for object inspection and type-level operations, default merging strategies for different data types (objects, arrays, sets, maps), and sophisticated type definitions that track how types evolve through the merging process. The implementation handles edge cases correctly, including prototype pollution protection, non-enumerable properties, and symbols. Notably, the library has zero runtime dependencies, demonstrating a commitment to self-contained, reliable code. The type system is particularly impressive, using advanced TypeScript features to ensure that the merged result's type accurately reflects the combination of input types.
This repository is a collection of JavaScript interview questions and coding exercises, accompanied by a Node.js script for automatically generating a table of contents in the README. The core content consists of standalone JavaScript files that illustrate specific language concepts and patterns, such as closures, hoisting, event loop, and functional programming techniques. The repository includes several reusable utility implementations that demonstrate advanced JavaScript patterns. Notably, the debounce and throttle functions provide robust solutions for rate-limiting event handlers, while the deep merge function safely handles circular references during object merging using a WeakMap for tracking. These utilities are self-contained, have no internal dependencies, and can be easily extracted for use in other projects. The project is actively maintained, as evidenced by a recent commit (though the date appears to be in the future, indicating the most recent activity). It relies on a single external dependency (github-slugger) for generating anchor links, and the build process is automated via a GitHub workflow. While the majority of the content serves educational purposes, the highlighted components exhibit strong craftsmanship and adhere to modern JavaScript best practices.