1 | ;
|
2 |
|
3 | const deepTraverse = function(obj, func) {
|
4 | for (let i in obj) {
|
5 | func.apply(this, [i, obj[i], obj]);
|
6 | if (obj[i] !== null && typeof(obj[i]) == 'object') {
|
7 | deepTraverse(obj[i], func);
|
8 | }
|
9 | }
|
10 | };
|
11 |
|
12 | exports.deepTraverse = deepTraverse; |
\ | No newline at end of file |