Commit 47371880 by James Ooi

Trim leading and trailing whitespace from event data

parent 6f54ea12
......@@ -237,7 +237,7 @@ var Foresight = /** @class */ (function () {
* @private
*/
Foresight.prototype._parseEventString = function (eventString) {
var split = eventString.split(';');
var split = eventString.split(';').map(function (s) { return s.trim(); });
var category = split[0], action = split[1], label = split[2];
// If only one argument is provided, then the argument is the action
if (split.length === 1) {
......
......@@ -201,7 +201,7 @@ class Foresight {
* @private
*/
private _parseEventString(eventString: string): Partial<EventData> {
const split = eventString.split(';');
const split = eventString.split(';').map(s => s.trim());
let [ category, action, label ] = split;
// If only one argument is provided, then the argument is the action
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment