TypeScript Deep Merge Utility
JSON →ts-deepmerge is a TypeScript utility library providing a robust deep merge function. It automatically infers the return type based on input objects without mutating the source objects, a key differentiator from many mutable merge utilities. Objects and arrays are merged recursively, while primitive values like numbers and strings are overwritten. Merging occurs in the order of arguments provided, giving precedence to later arguments. The current stable version is 7.0.3. As a utility library, its release cadence is driven by new features, bug fixes, or TypeScript version updates rather than a strict schedule. It differentiates itself by strong TypeScript type inference and non-mutation by default, supporting both ESM and CommonJS environments. It also offers an `options` mechanism to customize merge behavior, such as how arrays are handled.
Traffic · last 30 days ↓43% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · 🇫🇷 France · 🇪🇸 Spain