export var getExtensionLozengeData = function getExtensionLozengeData(_ref) {
  var node = _ref.node,
    type = _ref.type;
  if (!node.attrs.parameters) {
    return;
  }
  var macroMetadata = node.attrs.parameters.macroMetadata;
  // EDITOR-4007: guard against non-array placeholder to prevent `TypeError: ... forEach is not a function`.
  var hasValidPlaceholder = macroMetadata && Array.isArray(macroMetadata.placeholder);
  if (hasValidPlaceholder) {
    var placeholderData;
    // Ignored via go/ees005
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    macroMetadata.placeholder.forEach(function (placeholder) {
      if (placeholder.type === type && placeholder.data && placeholder.data.url) {
        placeholderData = placeholder.data;
      }
    });
    return placeholderData;
  }
  return;
};