function makeNodeItemForNodeId(traceElements, nodeId) {
  if (typeof nodeId !== 'number') {
    return;
  }

  const traceElement =
    traceElements.find(te => te.traceEventType === 'trace-engine' && te.nodeId === nodeId);
  const node = traceElement?.node;
  if (!node) {
    return;
  }

  return Audit.makeNodeItem(node);
}
@param {LH.Artifacts.TraceElement[]} traceElements
@param {number|null|undefined} nodeId
@return {LH.Audit.Details.NodeValue|undefined}