src/lib/walkObject.js
function _walkObject(object, callback, path, config) {
  const {walkArrays, walkArraysMatchingKeys} = config;
  Object.keys(object).forEach(key => {
    // Callback can force traversal to stop by returning `true`.
    if (callback(key, object, path.get(object, key))) {
      return;
    }

    const value = object[key];
    if (isPlainObject(value) || doArrayWalk(key, value, walkArrays, walkArraysMatchingKeys)) {
      _walkObject(value, callback, path.set(object, key), config);
    }
  });
}
function _walkObject(object, callback, path, config) {
  const {walkArrays, walkArraysMatchingKeys} = config;
  Object.keys(object).forEach(key => {
    // Callback can force traversal to stop by returning `true`.
    if (callback(key, object, path.get(object, key))) {
      return;
    }

    const value = object[key];
    if (isPlainObject(value) || doArrayWalk(key, value, walkArrays, walkArraysMatchingKeys)) {
      _walkObject(value, callback, path.set(object, key), config);
    }
  });
}
function _walkObject ( object , callback , path , config ) { const { walkArrays , walkArraysMatchingKeys } = config ; Object . keys ( object ) . forEach ( key => { // Callback can force traversal to stop by returning `true`. if ( callback ( key , object , path . get ( object , key ) ) ) { return ; } const value = object [ key ] ; if ( isPlainObject ( value ) || doArrayWalk ( key , value , walkArrays , walkArraysMatchingKeys ) ) { _walkObject ( value , callback , path . set ( object , key ) , config ) ; } } ) ; }
The function that walkObject calls at each node.

@callback walkObjectCallback
@param {string|number} key The current key, which may be nested.
@param {object} parent The object which owns the 'key' as a prop.
@param {Array} path The keys that lead to the 'parent' object.
@returns {boolean} True if the value at 'key' should *not* be traversed into
if it happens to be an object. I.e., you don't need to
return anything if you want the default traversal of the
whole object.
 
Walks through object and recurses if necessary.

@param {object} object The top-level or nested object we're walking through.
@param {walkObjectCallback} callback Called at each object node.
@param {Array} path The keys that lead from to top-level object to this one.
@param {object} config configuration object
@param {string} config.walkArrays flag allowing array walking
@param {Array} config.walkArraysMatchingKeys An array of keys permitting
array walking
@param {string} config.pathType Either 'array' or 'nestedProperty'. Array
based paths return string keys in an array up
until the current key position.
NestedProperty style returns a single
concatenated "nestedProperty" style string.
@returns {void}
@private
The function that walkObject calls at each node .