I have next code:
contents.map((content) => {
    const element = Object.assign({}, content);
    if (element.type === 'blabla') {
      element.data.id = await getId();
    }
    return element;
  });
But it fails with next error:
The 'await' operator can only be used in an 'async' function
 
     
    