(error: unknown)
| 101 | } |
| 102 | |
| 103 | function toErrorCode(error: unknown): BrowserOPFSWorkerErrorCode { |
| 104 | if (error instanceof PersistenceUnavailableError) { |
| 105 | return `PERSISTENCE_UNAVAILABLE` |
| 106 | } |
| 107 | if (error instanceof InvalidPersistedCollectionConfigError) { |
| 108 | return `INVALID_CONFIG` |
| 109 | } |
| 110 | return `INTERNAL` |
| 111 | } |
| 112 | |
| 113 | async function closeWorkerDatabase(): Promise<void> { |
| 114 | const sqlite3 = sqlite3Instance |
no outgoing calls
no test coverage detected