Skip to content

Commit 050948a

Browse files
committed
Added Shallow Object clone.
1 parent 345a77a commit 050948a

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

v3/src/utils/object/Clone.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
var Clone = function (obj)
2+
{
3+
var clone = {};
4+
5+
for (var key in obj)
6+
{
7+
clone[key] = obj[key];
8+
}
9+
10+
return clone;
11+
};
12+
13+
module.exports = Clone;

v3/src/utils/object/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
module.exports = {
44

5+
Clone: require('./Clone'),
56
Extend: require('./Extend'),
67
GetAdvancedValue: require('./GetAdvancedValue'),
78
GetMinMaxValue: require('./GetMinMaxValue'),

0 commit comments

Comments
 (0)