({ publicServerURL, required = false })
| 496 | } |
| 497 | |
| 498 | static validatePublicServerURL({ publicServerURL, required = false }) { |
| 499 | if (!publicServerURL) { |
| 500 | if (!required) { |
| 501 | return; |
| 502 | } |
| 503 | throw 'The option publicServerURL is required.'; |
| 504 | } |
| 505 | |
| 506 | const type = typeof publicServerURL; |
| 507 | |
| 508 | if (type === 'string') { |
| 509 | if (!publicServerURL.startsWith('http://') && !publicServerURL.startsWith('https://')) { |
| 510 | throw 'The option publicServerURL must be a valid URL starting with http:// or https://.'; |
| 511 | } |
| 512 | return; |
| 513 | } |
| 514 | |
| 515 | if (type === 'function') { |
| 516 | return; |
| 517 | } |
| 518 | |
| 519 | throw `The option publicServerURL must be a string or function, but got ${type}.`; |
| 520 | } |
| 521 | |
| 522 | static validateEmailConfiguration({ |
| 523 | emailAdapter, |
no outgoing calls
no test coverage detected