( databaseModuleFilename?: ?string, webworkerModulesFilePath?: string, )
| 6 | import { SQLiteQueryExecutorWrapper } from './utils/sql-query-executor-wrapper.js'; |
| 7 | |
| 8 | async function getDatabaseModule( |
| 9 | databaseModuleFilename?: ?string, |
| 10 | webworkerModulesFilePath?: string, |
| 11 | ): Promise<EmscriptenModule> { |
| 12 | const fileName = databaseModuleFilename |
| 13 | ? databaseModuleFilename |
| 14 | : DEFAULT_COMM_QUERY_EXECUTOR_FILENAME; |
| 15 | |
| 16 | return await Module({ |
| 17 | locateFile: (path: string, prefix?: string) => { |
| 18 | if (webworkerModulesFilePath) { |
| 19 | return `${webworkerModulesFilePath}/${fileName}`; |
| 20 | } |
| 21 | return `${prefix ?? ''}${fileName}`; |
| 22 | }, |
| 23 | }); |
| 24 | } |
| 25 | |
| 26 | function createSQLiteQueryExecutor( |
| 27 | dbModule: EmscriptenModule, |
no test coverage detected