2.0.0 • Published 5 months ago

merge-descriptors v2.0.0

Weekly downloads
15,788,822
License
MIT
Repository
github
Last release
5 months 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-api@314oner_npm/universal-components-libraryondp149-tablesklif-uianime-photosandrazanand93.jsonangellaapp.ioappxgen@anonybit-modules/videoreconstructionarunsartefaktasreader@zhangchongzhi/webpack@afria/afria-librariesagentia-asset-manageraitoalajsabbasdemopackagealph-serverali-ossali-oss-csgali-oss-lcbali-oss-reactmaali-oss-sdkali-oss-slimali-oss-upali-oss-with-react-nativeali-oss-xcb@alta-ng-timeago/hiamtanh-altaali-mtsalisselisss-lab3@torgeircook/cssjson@shivarajapple/first-library@s524797336/ali-oss@snailcode.net/basic-stat@skeetboothppq/component-library@skedulr/nebula-ui-library@wacoco/y@thismr/bitmindtest-coreadditionmultiplicationapiadditionsubtractionapiadvancewd@-xun/ctl@zeromake/egg-mock
1.0.2

5 months ago

2.0.0

5 months ago

1.0.3

5 months ago

1.0.1

8 years ago

1.0.0

9 years ago

0.0.2

10 years ago

0.0.1

10 years ago