Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 | 1x 1x 1x 1x | /* eslint-disable n/no-sync */
import { existsSync } from 'node:fs';
export const getWorkerFile = (name: string): string => {
const filePath = new URL(`../dist/workers/${name}.mjs`, import.meta.url)
.pathname;
// Check that the file exists
Iif (!existsSync(filePath)) {
throw new Error(`Worker file ${name} not found`);
}
return filePath;
};
|