copier

Copies the enumerable properties of one or more objects to a target object.

3 个版本
安装
npm install copier
yarn add copier
pnpm add copier
bun add copier
README

copier

A JavaScript object property copier. Copies the enumerable properties of one or more objects to a target object.

Installation

Server:

$ npm install copier

Client:

$ component install shannonmoeller/copier.js

API

copier(target, objs...)

Copies the enumerable properties of one or more objects to a target object.

var copier = require('copier'),
    foo = { a: 1, b: 2 },
    bar = { b: 3, c: 4 };

copier({}, foo, bar); // returns { a: 1, b: 3, c: 4 }

// foo and bar remain unchanged

copier(foo, bar); // foo now equals { a: 1, b: 3, c: 4 }

License

MIT

版本列表
0.0.3 2012-12-30
0.0.2 2012-12-30
0.0.1 2012-12-30