index.js
function setConfigObject (config, prev) {
    Object.keys(config).forEach(function (key) {
      var value = config[key]
      var fullKey = prev ? prev + '.' + key : key

      // if the value is an inner object and we have dot-notation
      // enabled, treat inner objects in config the same as
      // heavily nested dot notations (foo.bar.apple).
      if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) {
        // if the value is an object but not an array, check nested object
        setConfigObject(value, fullKey)
      } else {
        // setting arguments via CLI takes precedence over
        // values within the config file.
        if (!hasKey(argv, fullKey.split('.')) || (flags.defaulted[fullKey]) || (flags.arrays[fullKey] && configuration['combine-arrays'])) {
          setArg(fullKey, value)
        }
      }
    })
  }
function setConfigObject (config, prev) {
    Object.keys(config).forEach(function (key) {
      var value = config[key]
      var fullKey = prev ? prev + '.' + key : key

      // if the value is an inner object and we have dot-notation
      // enabled, treat inner objects in config the same as
      // heavily nested dot notations (foo.bar.apple).
      if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) {
        // if the value is an object but not an array, check nested object
        setConfigObject(value, fullKey)
      } else {
        // setting arguments via CLI takes precedence over
        // values within the config file.
        if (!hasKey(argv, fullKey.split('.')) || (flags.defaulted[fullKey]) || (flags.arrays[fullKey] && configuration['combine-arrays'])) {
          setArg(fullKey, value)
        }
      }
    })
  }
function setConfigObject ( config , prev ) { Object . keys ( config ) . forEach ( function ( key ) { var value = config [ key ] var fullKey = prev ? prev + '.' + key : key // if the value is an inner object and we have dot-notation // enabled, treat inner objects in config the same as // heavily nested dot notations (foo.bar.apple). if ( typeof value === 'object' && value !== null && ! Array . isArray ( value ) && configuration [ 'dot-notation' ] ) { // if the value is an object but not an array, check nested object setConfigObject ( value , fullKey ) } else { // setting arguments via CLI takes precedence over // values within the config file. if ( ! hasKey ( argv , fullKey . split ( '.' ) ) || ( flags . defaulted [ fullKey ] ) || ( flags . arrays [ fullKey ] && configuration [ 'combine-arrays' ] ) ) { setArg ( fullKey , value ) } } } ) }
set args from config object. it recursively checks nested objects.
set args from config object . it recursively checks nested objects .