pinball/assets/_Game/Scripts/Utilities/Utilities.ts

19 lines
393 B
TypeScript
Raw Normal View History

2024-02-28 03:25:11 -08:00
export default class Utilities {
2024-03-03 00:23:29 -08:00
/**
*
* @param time (ms)
* @returns
*/
2024-02-28 03:25:11 -08:00
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;
}
}
}