typeof loggingEvent.data[0] === 'string' will fail if loggingEvent.data[0] was created via new String("some logging here"); My evidence:
node
> var s = "this is a string"; typeof s;
'string'
> var s = new String('this is a string'); typeof s;
'object'
> var s = "this is a string"; Object.prototype.toString.call(s) === '[object String]';
true
> var s = new String('this is a string'); Object.prototype.toString.call(s) === '[object String]';
true
Yes, this is truly a trivial change :) At any rate, here's my fix.
typeof
loggingEvent.data[0] === 'string'
will fail if loggingEvent.data[0] was created vianew String("some logging here");
My evidence:Yes, this is truly a trivial change :) At any rate, here's my fix.