@mongez/reinforcements 1.0.18 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var Immutable = require('Immutable');
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Make a deep copy for the given object and its nested objects as well
|
|
7
|
+
*/
|
|
5
8
|
function clone(object) {
|
|
6
|
-
return
|
|
9
|
+
return Immutable.fromJS(object).toJS();
|
|
7
10
|
}
|
|
8
11
|
|
|
9
12
|
module.exports = clone;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fromJS } from 'Immutable';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Make a deep copy for the given object and its nested objects as well
|
|
5
|
+
*/
|
|
3
6
|
function clone(object) {
|
|
4
|
-
return
|
|
7
|
+
return fromJS(object).toJS();
|
|
5
8
|
}
|
|
6
9
|
|
|
7
10
|
export { clone as default };
|
package/package.json
CHANGED