File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -658,7 +658,7 @@ SnowPlow.Tracker = function Tracker(argmap) {
658658 var str = '' ;
659659
660660 var addNvPair = function ( key , value , encode ) {
661- if ( value !== undefined && value !== null && value !== '' ) {
661+ if ( SnowPlow . isNonEmptyString ( value ) ) {
662662 var sep = ( str . length > 0 ) ? "&" : "?" ;
663663 str += sep + key + '=' + ( encode ? SnowPlow . encodeWrapper ( value ) : value ) ;
664664 }
@@ -738,18 +738,15 @@ SnowPlow.Tracker = function Tracker(argmap) {
738738
739739 var addJson = function ( keyIfEncoded , keyIfNotEncoded , json ) {
740740
741- // Shortcircuit
742- if ( json === undefined || json === null || json === { } ) {
743- return ;
744- }
745-
746- var typed = appendTypes ( json ) ;
747- var str = JSON2 . stringify ( typed ) ;
748-
749- if ( base64Encode ) {
750- addRaw ( keyIfEncoded , SnowPlow . base64urlencode ( str ) ) ;
751- } else {
752- add ( keyIfNotEncoded , str ) ;
741+ if ( SnowPlow . isNonEmptyJson ( json ) ) {
742+ var typed = appendTypes ( json ) ;
743+ var str = JSON2 . stringify ( typed ) ;
744+
745+ if ( base64Encode ) {
746+ addRaw ( keyIfEncoded , SnowPlow . base64urlencode ( str ) ) ;
747+ } else {
748+ add ( keyIfNotEncoded , str ) ;
749+ }
753750 }
754751 } ;
755752
You can’t perform that action at this time.
0 commit comments