UNPKG
create-lbgcli
Version:
latest (1.0.2)
1.0.2
前端脚手架模板
create-lbgcli
/
template-h5
/
node_modules
/
underscore
/
modules
/
clone.js
10 lines
(8 loc)
•
290 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
import
isObject
from
'./isObject.js'
;
import
isArray
from
'./isArray.js'
;
import
extend
from
'./extend.js'
;
// Create a (shallow-cloned) duplicate of an object.
export
default
function
clone
(
obj
) {
if
(!
isObject
(obj))
return
obj;
return
isArray
(obj) ? obj.
slice
() :
extend
({}, obj); }