text: //  Source object
  //  The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner'
  //  The default value to use if the key doesn't exist
  
  var GetValue = function (source, key, defaultValue)
  {
      if (!source || typeof source === 'number')
      {
          return defaultValue;
      }
      else if (source.hasOwnProperty(key))
      {
          return source[key];
      }
      else if (key.indexOf('.'))
      {
          var keys = key.split('.');
          var parent = source;
          var value = defaultValue;
  
          //  Use for loop here so we can break early
          for (var i = 0; i < keys.length; i++)
          {
              if (parent.hasOwnProperty(keys[i]))
              {
                  //  Yes it has a key property, let's carry on down
                  value = parent[keys[i]];
  
                  parent = parent[keys[i]];
              }
              else
              {
                  //  Can't go any further, so reset to default
                  value = defaultValue;
                  break;
              }
          }
  
          return value;
      }
      else
      {
          return defaultValue;
      }
  };
  
  module.exports = GetValue;
  