19 lines
393 B
TypeScript
19 lines
393 B
TypeScript
|
export default class Utilities {
|
||
|
/**
|
||
|
*
|
||
|
* @param time (ms)
|
||
|
* @returns
|
||
|
*/
|
||
|
public static delay(time: number): Promise<any> {
|
||
|
return new Promise((resolve) => setTimeout(resolve, time));
|
||
|
}
|
||
|
|
||
|
public static getJson(json: string): any {
|
||
|
try {
|
||
|
return JSON.parse(json);
|
||
|
} catch (error) {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
}
|