MOON
Server: Apache
System: Linux vps.erhabenn.com.br 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64
User: machen (1008)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //opt/lck-backend/node_modules/merge-descriptors/readme.md
# merge-descriptors

> Merge objects using their property descriptors

## Install

```sh
npm install merge-descriptors
```

## Usage

```js
import mergeDescriptors from 'merge-descriptors';

const thing = {
	get name() {
		return 'John'
	}
}

const animal = {};

mergeDescriptors(animal, thing);

console.log(animal.name);
//=> 'John'
```

## API

### merge(destination, source, overwrite?)

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.

Returns the modified destination object.

#### destination

Type: `object`

The object to receive properties.

#### source

Type: `object`

The object providing properties.

#### overwrite

Type: `boolean`\
Default: `true`

A boolean to control overwriting of existing properties.