Liam
18a782243e
All checks were successful
Deploy App / docker (ubuntu-latest) (push) Successful in 1m9s
18 lines
431 B
TypeScript
18 lines
431 B
TypeScript
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;
|
|
}
|
|
}
|