()
| 15 | }; |
| 16 | |
| 17 | export const getPublicIpWithFallback = async () => { |
| 18 | // @ts-ignore |
| 19 | let ip = null; |
| 20 | try { |
| 21 | ip = await publicIpv4(); |
| 22 | } catch (error) { |
| 23 | console.log( |
| 24 | "Error obtaining public IPv4 address, falling back to IPv6", |
| 25 | // @ts-ignore |
| 26 | error.message, |
| 27 | ); |
| 28 | try { |
| 29 | ip = await publicIpv6(); |
| 30 | } catch (error) { |
| 31 | // @ts-ignore |
| 32 | console.error("Error obtaining public IPv6 address", error.message); |
| 33 | ip = null; |
| 34 | } |
| 35 | } |
| 36 | return ip; |
| 37 | }; |
| 38 | |
| 39 | export const readValidDirectory = ( |
| 40 | directory: string, |
no outgoing calls
no test coverage detected