move common dir
All checks were successful
Deploy App / docker (ubuntu-latest) (push) Successful in 1m9s
All checks were successful
Deploy App / docker (ubuntu-latest) (push) Successful in 1m9s
This commit is contained in:
17
src/app/common/server.ts
Normal file
17
src/app/common/server.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { getServer, ServerPlatform } from "mcutils-library";
|
||||
|
||||
/**
|
||||
* Checks if the server is valid.
|
||||
*
|
||||
* @param platform the server's platform
|
||||
* @param query the hostname for the server
|
||||
* @returns true if valid, false otherwise
|
||||
*/
|
||||
export async function isValidServer(platform: ServerPlatform, query: string): Promise<boolean> {
|
||||
try {
|
||||
await getServer(platform, query);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user