nanolith
Version:
Multi-threading in no time with seamless TypeScript support.
1 lines • 156 B
JavaScript
import{isMainThread}from"worker_threads";export const assertIsNotMainThread=r=>{if(isMainThread)throw new Error(`${r} cannot be used on the main thread!`)};