mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 20:25:48 +00:00
Simplify the error check
This commit is contained in:
@@ -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}'.`,
|
||||||
|
|||||||
Reference in New Issue
Block a user