Prettier 2.0 (#393)

This commit is contained in:
Steve Faulkner
2021-01-20 09:15:01 -06:00
committed by GitHub
parent c1937ca464
commit 4be53284b5
500 changed files with 41927 additions and 41838 deletions

View File

@@ -1,82 +1,82 @@
import * as _ from "underscore";
import { ConsoleDataType } from "../Explorer/Menus/NotificationConsole/NotificationConsoleComponent";
const _global = typeof self === "undefined" ? window : self;
/**
* @deprecated
* Use logConsoleInfo, logConsoleError, logConsoleProgress instead
* */
export function logConsoleMessage(type: ConsoleDataType, message: string, id?: string): string {
const dataExplorer = _global.dataExplorer;
if (dataExplorer) {
const date = new Date();
const formattedDate: string = new Intl.DateTimeFormat("en-EN", {
hour12: true,
hour: "numeric",
minute: "numeric"
}).format(date);
if (!id) {
id = _.uniqueId();
}
dataExplorer.logConsoleData({ type: type, date: formattedDate, message: message, id: id });
}
return id || "";
}
export function clearInProgressMessageWithId(id: string): void {
const dataExplorer = _global.dataExplorer;
dataExplorer && dataExplorer.deleteInProgressConsoleDataWithId(id);
}
export function logConsoleProgress(message: string): () => void {
const type = ConsoleDataType.InProgress;
const dataExplorer = _global.dataExplorer;
if (dataExplorer) {
const id = _.uniqueId();
const date = new Date();
const formattedDate: string = new Intl.DateTimeFormat("en-EN", {
hour12: true,
hour: "numeric",
minute: "numeric"
}).format(date);
dataExplorer.logConsoleData({ type, date: formattedDate, message, id });
return () => {
dataExplorer.deleteInProgressConsoleDataWithId(id);
};
} else {
return () => {
return;
};
}
}
export function logConsoleError(message: string): void {
const type = ConsoleDataType.Error;
const dataExplorer = _global.dataExplorer;
if (dataExplorer) {
const id = _.uniqueId();
const date = new Date();
const formattedDate: string = new Intl.DateTimeFormat("en-EN", {
hour12: true,
hour: "numeric",
minute: "numeric"
}).format(date);
dataExplorer.logConsoleData({ type, date: formattedDate, message, id });
}
}
export function logConsoleInfo(message: string): void {
const type = ConsoleDataType.Info;
const dataExplorer = _global.dataExplorer;
if (dataExplorer) {
const id = _.uniqueId();
const date = new Date();
const formattedDate: string = new Intl.DateTimeFormat("en-EN", {
hour12: true,
hour: "numeric",
minute: "numeric"
}).format(date);
dataExplorer.logConsoleData({ type, date: formattedDate, message, id });
}
}
import * as _ from "underscore";
import { ConsoleDataType } from "../Explorer/Menus/NotificationConsole/NotificationConsoleComponent";
const _global = typeof self === "undefined" ? window : self;
/**
* @deprecated
* Use logConsoleInfo, logConsoleError, logConsoleProgress instead
* */
export function logConsoleMessage(type: ConsoleDataType, message: string, id?: string): string {
const dataExplorer = _global.dataExplorer;
if (dataExplorer) {
const date = new Date();
const formattedDate: string = new Intl.DateTimeFormat("en-EN", {
hour12: true,
hour: "numeric",
minute: "numeric",
}).format(date);
if (!id) {
id = _.uniqueId();
}
dataExplorer.logConsoleData({ type: type, date: formattedDate, message: message, id: id });
}
return id || "";
}
export function clearInProgressMessageWithId(id: string): void {
const dataExplorer = _global.dataExplorer;
dataExplorer && dataExplorer.deleteInProgressConsoleDataWithId(id);
}
export function logConsoleProgress(message: string): () => void {
const type = ConsoleDataType.InProgress;
const dataExplorer = _global.dataExplorer;
if (dataExplorer) {
const id = _.uniqueId();
const date = new Date();
const formattedDate: string = new Intl.DateTimeFormat("en-EN", {
hour12: true,
hour: "numeric",
minute: "numeric",
}).format(date);
dataExplorer.logConsoleData({ type, date: formattedDate, message, id });
return () => {
dataExplorer.deleteInProgressConsoleDataWithId(id);
};
} else {
return () => {
return;
};
}
}
export function logConsoleError(message: string): void {
const type = ConsoleDataType.Error;
const dataExplorer = _global.dataExplorer;
if (dataExplorer) {
const id = _.uniqueId();
const date = new Date();
const formattedDate: string = new Intl.DateTimeFormat("en-EN", {
hour12: true,
hour: "numeric",
minute: "numeric",
}).format(date);
dataExplorer.logConsoleData({ type, date: formattedDate, message, id });
}
}
export function logConsoleInfo(message: string): void {
const type = ConsoleDataType.Info;
const dataExplorer = _global.dataExplorer;
if (dataExplorer) {
const id = _.uniqueId();
const date = new Date();
const formattedDate: string = new Intl.DateTimeFormat("en-EN", {
hour12: true,
hour: "numeric",
minute: "numeric",
}).format(date);
dataExplorer.logConsoleData({ type, date: formattedDate, message, id });
}
}