mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-21 18:01:39 +00:00
Add more files to strict compile. Update CONTRIBUTING.md (#63)
* Add more files to strict compile. Update CONTRIBUTING.md to recommend FluentUI use * Remove eslint-disable and use non-null assertion
This commit is contained in:
@@ -5,7 +5,7 @@ export class LocalStorageUtility {
|
||||
return !!localStorage.getItem(StorageKey[key]);
|
||||
}
|
||||
|
||||
public static getEntryString(key: StorageKey): string {
|
||||
public static getEntryString(key: StorageKey): string | null {
|
||||
return localStorage.getItem(StorageKey[key]);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ export class SessionStorageUtility {
|
||||
return !!sessionStorage.getItem(StorageKey[key]);
|
||||
}
|
||||
|
||||
public static getEntryString(key: StorageKey): string {
|
||||
public static getEntryString(key: StorageKey): string | null {
|
||||
return sessionStorage.getItem(StorageKey[key]);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
export class StringUtility {
|
||||
public static toNumber(num: string): number {
|
||||
public static toNumber(num: string | null): number {
|
||||
return Number(num);
|
||||
}
|
||||
|
||||
public static toBoolean(valueStr: string): boolean {
|
||||
public static toBoolean(valueStr: string | null): boolean {
|
||||
return valueStr === "true";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,33 +82,35 @@ export default class TelemetryProcessor {
|
||||
}
|
||||
|
||||
public static traceOpen(action: Action, data?: any, timestamp?: number): number {
|
||||
const validTimestamp = timestamp || Date.now();
|
||||
MessageHandler.sendMessage({
|
||||
type: MessageTypes.TelemetryInfo,
|
||||
data: {
|
||||
action: Action[action],
|
||||
actionModifier: ActionModifiers.Open,
|
||||
timestamp: timestamp || Date.now(),
|
||||
timestamp: validTimestamp,
|
||||
data: JSON.stringify(data)
|
||||
}
|
||||
});
|
||||
|
||||
appInsights.startTrackEvent(Action[action]);
|
||||
return timestamp;
|
||||
return validTimestamp;
|
||||
}
|
||||
|
||||
public static traceMark(action: Action, data?: any, timestamp?: number): number {
|
||||
const validTimestamp = timestamp || Date.now();
|
||||
MessageHandler.sendMessage({
|
||||
type: MessageTypes.TelemetryInfo,
|
||||
data: {
|
||||
action: Action[action],
|
||||
actionModifier: ActionModifiers.Mark,
|
||||
timestamp: timestamp || Date.now(),
|
||||
timestamp: validTimestamp,
|
||||
data: JSON.stringify(data)
|
||||
}
|
||||
});
|
||||
|
||||
appInsights.startTrackEvent(Action[action]);
|
||||
return timestamp;
|
||||
return validTimestamp;
|
||||
}
|
||||
|
||||
private static getData(data?: any): any {
|
||||
|
||||
Reference in New Issue
Block a user