2.0.0 • Published 2 years ago

merge-descriptors v2.0.0

Weekly downloads
15,788,822
License
MIT
Repository
github
Last release
2 years 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-sdktechbase-x-betateapackage-tatespoorman297supertiny-app-libstar-expresssuman-serverstories-fstesting-storybooktestweblibapitest-seedingteste_cegidtestprosvelte-component-libtiancaovue-compmentvcloudcam-playkit-js-hlsvarshaviber-botkit@dotconnor/next@digitalrakesh/jsui@dimcheify/dimui@dskdavid/flash_cli@cmmv/server
1.0.2

2 years ago

2.0.0

2 years ago

1.0.3

2 years ago

1.0.1

9 years ago

1.0.0

10 years ago

0.0.2

12 years ago

0.0.1

12 years ago