mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-19 19:55:51 +00:00
Simplify the error check
This commit is contained in:
@@ -94,10 +94,7 @@ async function fundWallet(
|
||||
|
||||
if (
|
||||
options?.faucetHost != null &&
|
||||
(options.faucetHost.startsWith('ws://') ||
|
||||
options.faucetHost.startsWith('wss://') ||
|
||||
options.faucetHost.startsWith('http://') ||
|
||||
options.faucetHost.startsWith('https://'))
|
||||
/^(http|https|ws|wss):\/\//.test(options.faucetHost)
|
||||
) {
|
||||
throw new XRPLFaucetError(
|
||||
`Invalid format for faucetHost. Should not include ws(s)/http(s) prefix. Received '${options.faucetHost}'.`,
|
||||
|
||||
Reference in New Issue
Block a user