Simplify the error check

This commit is contained in:
Jackson Mills
2022-05-26 16:55:59 -07:00
parent 83db1abe4f
commit 2e99cf6449

View File

@@ -94,10 +94,7 @@ async function fundWallet(
if ( if (
options?.faucetHost != null && options?.faucetHost != null &&
(options.faucetHost.startsWith('ws://') || /^(http|https|ws|wss):\/\//.test(options.faucetHost)
options.faucetHost.startsWith('wss://') ||
options.faucetHost.startsWith('http://') ||
options.faucetHost.startsWith('https://'))
) { ) {
throw new XRPLFaucetError( throw new XRPLFaucetError(
`Invalid format for faucetHost. Should not include ws(s)/http(s) prefix. Received '${options.faucetHost}'.`, `Invalid format for faucetHost. Should not include ws(s)/http(s) prefix. Received '${options.faucetHost}'.`,