UNPKG
@xmini/qs
Version:
latest (0.1.5)
0.1.5
qs
@xmini/qs
/
copy.js
16 lines
(14 loc)
•
281 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"use strict"
;
Object
.
defineProperty
(
exports
,
"__esModule"
, {
value
:
true
});
exports
.
copy
= copy;
/** * 简单拷贝 * *
@param
{
any
} [data=''] 传入非 undefined *
@returns
{
Object
} 新对象 */
function
copy
(
data =
null
) {
return
JSON
.
parse
(
JSON
.
stringify
(data)); }