merge-descriptors
- Version 2.0.0
- Published
- 4.37 kB
- No dependencies
- MIT license
Install
npm i merge-descriptors
yarn add merge-descriptors
pnpm add merge-descriptors
Overview
Merge objects using their property descriptors
Index
Functions
Functions
function mergeDescriptors
mergeDescriptors: <T, U>( destination: T, source: U, overwrite?: boolean) => T & U;
Merges "own" properties from a source to a destination object, including non-enumerable and accessor-defined properties. It retains original values and descriptors, ensuring the destination receives a complete and accurate copy of the source's properties.
Parameter destination
The object to receive properties.
Parameter source
The object providing properties.
Parameter overwrite
Optional boolean to control overwriting of existing properties. Defaults to true.
Returns
The modified destination object.
Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (2)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/merge-descriptors
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/merge-descriptors)
- HTML<a href="https://www.jsdocs.io/package/merge-descriptors"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 1214 ms. - Missing or incorrect documentation? Open an issue for this package.