UNPKG

286 BJavaScriptView Raw
1'use strict';
2
3const 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
12exports.deepTraverse = deepTraverse;
\No newline at end of file