2.0.0 • Published 1 year ago

merge-descriptors v2.0.0

Weekly downloads
15,788,822
License
MIT
Repository
github
Last release
1 year ago

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.

expresscomponennenttchinjowwchinjowvuedragdropuploadimagesextensible-node-serverkoa-microframework@arisageha/react-lazyload@arisageha/react-lazyload-fixttdownapiali-oss-weiyieali-oss-weiyie1bb-chat@wgytcraft/express@frxf/frxf@texttree/demo-bsa-reference-rclwlite-avsdk-vod-upload-node-userswlite-avsdk-vod-upload-node-v2-ucs-tiktok-apiali-oss-weiyiweiyie-test-ts-ali-oss@oknesar/express@knotworkjs/coreanime-randomeni-chatbergen-api-clientrecurly-node-api@l1nyanm1ng/react-picture-vieweropenid-passportcthpb-plugin-socialkoa-reason@iobroker-community-adapters/iobroker.device-watcher@signalchain/express@dicta-io/storage-junctionsexpress-easy-staticlevibestliblevibestlib2levilibtest19levilibtest24levilibtest25levilibtest26levilibtest27levilibtest28levilibtest29nodejs-filesharenotespod-ali-ossunblock-block-save-variableshexa-node-commonexpress-extendedcclibyarntest@saaspe/componentshyperpass-sdkexpress-api-pack-trsklif-ui-kitsklif-apiondp149-tablesklif-ui@wacoco/y@unexpress/expressexpress-lessytaman-baca-masyarakattanngotchen-vuelayerstest-carosello-campuswlite-avsdk-vod-upload-nodewlite-avsdk-vod-upload-node-testweb-component-tester-bundlevue-button-test1webdatabasetest1webdatabasetest10webdesa-laravel-final-releasewebpack_component_fundxconfigjswhatsconcxivistudioswukong-sdkxiaoman-oss-sdkrzanumba1shainashaoyaosheejasgp-ads-testshadowjsshirin-common-packageshowgallerysf-web-componentssammihuesamc2samc3samc4samc5sam-carouselsallyabcsashsaturninoresponsis-gantt-task-reactreactofy-css-libraryreblend-routingreact-websockets
1.0.2

1 year ago

2.0.0

1 year ago

1.0.3

1 year ago

1.0.1

9 years ago

1.0.0

10 years ago

0.0.2

11 years ago

0.0.1

11 years ago