Fix Telemetry for String Case (#163)

This commit is contained in:
Steve Faulkner 2020-08-21 14:38:30 -05:00 committed by GitHub
parent 47a5c315b5
commit e837f574a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -114,13 +114,17 @@ export default class TelemetryProcessor {
return validTimestamp;
}
private static getData(data?: any): any {
private static getData(data: any = {}): any {
if (typeof data === "string") {
data = { message: data };
}
return {
// TODO: Need to `any` here since the window imports Explorer which can't be in strict mode yet
authType: (window as any).authType,
subscriptionId: userContext.subscriptionId,
platform: configContext.platform,
...(data ? data : [])
env: process.env.NODE_ENV,
...data
};
}
}