(exception: unknown)
| 163 | // https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Exception |
| 164 | // @ts-expect-error - WebAssembly.Exception is a valid class |
| 165 | function isWebAssemblyException(exception: unknown): exception is WebAssembly.Exception { |
| 166 | // Check for support |
| 167 | // @ts-expect-error - WebAssembly.Exception is a valid class |
| 168 | // oxlint-disable-next-line typescript/prefer-optional-chain |
| 169 | if (typeof WebAssembly !== 'undefined' && typeof WebAssembly.Exception !== 'undefined') { |
| 170 | // @ts-expect-error - WebAssembly.Exception is a valid class |
| 171 | return exception instanceof WebAssembly.Exception; |
| 172 | } else { |
| 173 | return false; |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * Extracts from errors what we use as the exception `type` in error events. |
no outgoing calls
no test coverage detected