@@ -166,12 +166,12 @@ var _parseConfig = function _parseConfig(options, config) {
166166
167167 // validates config value is defined, is the correct type, and some additional value sanity checks
168168 var parseValidateAndLoad = function parseValidateAndLoad ( key ) {
169- if ( ! DEFAULT_OPTIONS . hasOwnProperty ( key ) ) {
169+ if ( ! options . hasOwnProperty ( key ) ) {
170170 return ; // skip bogus config values
171171 }
172172
173173 var inputValue = config [ key ] ;
174- var expectedType = type ( DEFAULT_OPTIONS [ key ] ) ;
174+ var expectedType = type ( options [ key ] ) ;
175175 if ( ! utils . validateInput ( inputValue , key + ' option' , expectedType ) ) {
176176 return ;
177177 }
@@ -180,14 +180,16 @@ var _parseConfig = function _parseConfig(options, config) {
180180 } else if ( ( expectedType === 'string' && ! utils . isEmptyString ( inputValue ) ) ||
181181 ( expectedType === 'number' && inputValue > 0 ) ) {
182182 options [ key ] = inputValue ;
183+ } else if ( expectedType === 'object' ) {
184+ _parseConfig ( options [ key ] , inputValue ) ;
183185 }
184- } ;
186+ } ;
185187
186- for ( var key in config ) {
188+ for ( var key in config ) {
187189 if ( config . hasOwnProperty ( key ) ) {
188190 parseValidateAndLoad ( key ) ;
189191 }
190- }
192+ }
191193} ;
192194
193195/**
@@ -921,7 +923,6 @@ AmplitudeClient.prototype._logEvent = function _logEvent(eventType, eventPropert
921923 sequence_number : sequenceNumber , // for ordering events and identifys
922924 groups : utils . truncate ( utils . validateGroups ( groups ) ) ,
923925 user_agent : this . _userAgent
924- // country: null
925926 } ;
926927
927928 if ( eventType === Constants . IDENTIFY_EVENT ) {
0 commit comments