- commit
- 7f7beea489b4696df2ae1063a68abad135ea0210
- parent
- 4c26def8388cb318e01ecbe65d02f65d8f9dc8c3
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2020-01-02 10:13
mv clone to utils.js
Diffstat
| M | src/index.js | 5 | +---- |
| A | src/utils.js | 3 | +++ |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/index.js b/src/index.js
@@ -2,6 +2,7 @@ import template from './template.js'; 2 2 import scenarios from './scenarios.js'; 3 3 import * as logic from './logic.js'; 4 4 import * as constants from './constants.js'; -1 5 import {clone} from './utils.js'; 5 6 6 7 let state, tree; 7 8 @@ -28,10 +29,6 @@ const on = function(eventType, selector, fn) { 28 29 }); 29 30 }; 30 3131 -1 const clone = function(obj) {32 -1 return JSON.parse(JSON.stringify(obj));33 -1 };34 -135 32 const play = function() { 36 33 if (!state.game.playing) { 37 34 return;
diff --git a/src/utils.js b/src/utils.js
@@ -0,0 +1,3 @@
-1 1 export const clone = function(obj) {
-1 2 return JSON.parse(JSON.stringify(obj));
-1 3 };