Skip to content

Commit 54effe9

Browse files
committed
Replace cloneDeep method of Lodash from JSON
1 parent a1c18ff commit 54effe9

File tree

1 file changed

+4
-2
lines changed
  • packages/optimizely-sdk/lib/utils/fns

1 file changed

+4
-2
lines changed

packages/optimizely-sdk/lib/utils/fns/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = {
2929
var to = Object(target);
3030
for (var index = 1; index < arguments.length; index++) {
3131
var nextSource = arguments[index];
32-
if (nextSource !== null && nextSource !== undefined) {
32+
if (nextSource !== null && nextSource !== undefined) {
3333
for (var nextKey in nextSource) {
3434
// Avoid bugs when hasOwnProperty is shadowed
3535
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
@@ -41,7 +41,9 @@ module.exports = {
4141
return to;
4242
}
4343
},
44-
cloneDeep: require('lodash/cloneDeep'),
44+
cloneDeep: function(object) {
45+
return JSON.parse(JSON.stringify(object));
46+
},
4547
currentTimestamp: function() {
4648
return Math.round(new Date().getTime());
4749
},

0 commit comments

Comments
 (0)