Added inline web-woker helper function