Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
287 B
3
Indexable
Never
/// <reference lib="webworker" />

function convertToArrayProducts(data:any){
  return Object.values(data).flatMap((child: any) => Object.values(child.Productos))
}

addEventListener('message', ({ data }) => {
  const response = convertToArrayProducts(data);
  postMessage(response);
});