aiv367-merge
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

aiv367-merge

介绍

本模块提供两个对象深拷贝函数,一种是遇数组合并模式(merge),一种是遇数组替换模式 (merge2)。

Gitee

https://gitee.com/aiv367/aiv367-merge

安装

npm i aiv367-merge --save

使用

ES6 Module:

import merge from 'aiv367-merge'; //遇数组合并
import {merge2} from 'aiv367-merge'; //遇数组替换

merge({ a: [1, 2] }, { a: [3, 4] }, { c: 1 });
//返回结果
// {a: [1, 2, 3, 4], c: 1}

merge2({ a: [1, 2] }, { a: [3, 4] }, { c: 1 });
//返回结果
// {a: [3, 4], c: 1}

Readme

Keywords

Package Sidebar

Install

npm i aiv367-merge

Weekly Downloads

1

Version

1.1.3

License

MIT

Unpacked Size

4.83 kB

Total Files

6

Last publish

Collaborators

  • aiv367