zhizhi/backend/bridge/node_modules/merge-descriptors
飞毛嘴帅气爱 3358796316 BC-M-BRIDGE-001-FM 环节0完成:初始化Node.js项目,搭建Express3020端口基础服务,实现根路径身份接口和请求日志中间件,创建config.json统一配置和README.md模块文档 2026-03-11 22:39:13 +08:00
..
index.d.ts BC-M-BRIDGE-001-FM 环节0完成:初始化Node.js项目,搭建Express3020端口基础服务,实现根路径身份接口和请求日志中间件,创建config.json统一配置和README.md模块文档 2026-03-11 22:39:13 +08:00
index.js BC-M-BRIDGE-001-FM 环节0完成:初始化Node.js项目,搭建Express3020端口基础服务,实现根路径身份接口和请求日志中间件,创建config.json统一配置和README.md模块文档 2026-03-11 22:39:13 +08:00
license BC-M-BRIDGE-001-FM 环节0完成:初始化Node.js项目,搭建Express3020端口基础服务,实现根路径身份接口和请求日志中间件,创建config.json统一配置和README.md模块文档 2026-03-11 22:39:13 +08:00
package.json BC-M-BRIDGE-001-FM 环节0完成:初始化Node.js项目,搭建Express3020端口基础服务,实现根路径身份接口和请求日志中间件,创建config.json统一配置和README.md模块文档 2026-03-11 22:39:13 +08:00
readme.md BC-M-BRIDGE-001-FM 环节0完成:初始化Node.js项目,搭建Express3020端口基础服务,实现根路径身份接口和请求日志中间件,创建config.json统一配置和README.md模块文档 2026-03-11 22:39:13 +08:00

readme.md

merge-descriptors

Merge objects using their property descriptors

Install

npm install merge-descriptors

Usage

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.