tea-extend is a minimalist JavaScript utility designed for performing shallow object merges, allowing properties from one or more source objects to be copied onto a destination object. This package was initially released around 2012, with its current and seemingly final version being 0.2.0. It predates the widespread adoption of native language features such as `Object.assign()` (ES2015) and object spread syntax (ES2018), which now provide equivalent and often more robust functionality directly within JavaScript. Consequently, tea-extend has likely seen no significant updates or active development for over a decade. Its primary differentiator at the time of its creation was providing a simple, early solution for object merging in both Node.js and browser environments (via Component.js) before these native alternatives became standard practice.
npm install tea-extendVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to use `tea-extend` for shallow merging and cloning objects, highlighting its shallow copy behavior.
For deep merging or cloning, use a dedicated deep merge library (e.g., `lodash.merge`, `rfdc`) or manually implement recursive cloning logic. For shallow merges, native `Object.assign()` or spread syntax are preferred.
In ESM projects, use `import * as teaExtend from 'tea-extend'; const extend = teaExtend.default;` to access the default export. However, for modern JavaScript, it is strongly recommended to replace `tea-extend` with native `Object.assign()` or object spread syntax for shallow merges.
Migrate your codebase to use `Object.assign()` or the object spread syntax for shallow object merging. This eliminates an external dependency and uses standard, actively maintained language features.
For CommonJS-only modules in an ESM project, access the default export via `import * as teaExtend from 'tea-extend'; const extend = teaExtend.default;`. Alternatively, ensure your file is a CommonJS module, or preferably, replace `tea-extend` with native `Object.assign()` or spread syntax.
Either convert your file to use ESM `import` syntax (see previous problem entry for how to import CJS modules in ESM) or ensure the file is treated as a CommonJS module. Given the package's age, the best fix is to replace `tea-extend` entirely with `Object.assign()` or object spread syntax.
No dependency data recorded yet.