1.0.4 • Published 5 years ago

deep-copy.js v1.0.4

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years ago

deepCopy

概述

这是一个进行深拷贝的js插件

Usage(使用)

发布成功后就可以使用了。使用有两种形式,一种是 npm 安装,一种是 <script> 引用。

npm 安装:

npm install --save deep-copy.js
import deepCopy from 'deep-copy.js'
let a = [1, 2, 3]
let b = deepCopy(a)
b[0] = 4
console.log(a, b); // [1, 2, 3] [4, 2, 3]
// 或者
const deepCopy = require('deep-copy.js')
let a = [1, 2, 3]
let b = deepCopy(a)
b[0] = 4
console.log(a, b); // [1, 2, 3] [4, 2, 3]

<script>使用

<script src="//unpkg.com/deep-copy.js@1.0.4/lib/index.js"></script>
<script>
  console.log(window.deepCopy);
  let a = [1, 2, 3]
  let b = deepCopy(a)
  b[0] = 4
  console.log(a, b); // [1, 2, 3] [4, 2, 3]
</script>

支持深拷贝的数据类型

Number, String, Boolean, Array, Object, Node, Date

run(运行)

# git clone ...
git clone https://github.com/nongshuqiner/deep-copy.js.git

# enter
cd deep-copy.js

# install dependencies
npm install

# open examples HTML
npm run examples

# 运行此命令将所有代码从 src 目录编译到 lib
npm run build

# 测试
npm run test

Donation(打赏)

payment-code.png

Contact me(联系我)

Just Contact Me At:

License

MIT Copyright (c) 2018 - forever Naufal Rabbani

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago