UNPKG

@xylabs/threads

Version:

Web workers & worker threads as simple as a function call

12 lines (8 loc) 330 B
/* eslint-disable @typescript-eslint/no-explicit-any */ import { Worker as WorkerImplementation } from './index-node.ts' declare const window: any if (typeof globalThis !== 'undefined') { ;(globalThis as any).Worker = WorkerImplementation } else if (window !== undefined) { ;(window as any).Worker = WorkerImplementation }