[add] Lobby 按鈕功能

This commit is contained in:
2022-05-08 20:36:56 +08:00
parent b644e0e0ab
commit d302a52d8d
105 changed files with 52578 additions and 3849 deletions

View File

@@ -1,16 +1,25 @@
interface StringConstructor {
interface StringConstructor {
IsNullOrEmpty: (value: string) => boolean;
Format: (format: string, ...args: any[]) => string;
IsNullOrWhiteSpace: (input: string) => boolean;
}
String.IsNullOrEmpty = function (value: string): boolean {
return value === undefined || value === null || value.trim() === '';
String.IsNullOrEmpty = function (value: string): boolean {
return value === undefined || value === null || value.trim() === "";
};
String.Format = function (format: string, ...args: any[]): string {
return format.replace(/{(\d+)}/g, (match, index) => {
let value = args[index];
if (value === null || value === undefined) return '';
return '' + value;
if (value === null || value === undefined) { return ""; }
return "" + value;
});
}
};
String.IsNullOrWhiteSpace = function (input: string): boolean {
if (typeof input === "undefined" || input == null) {
return true;
}
return input.replace(/\s/g, "").length < 1;
};