function isValidGroup(menuGroup, idsMenu) {
  let hasGroup;

  const isElem = menuGroup instanceof IdsMenuGroup;
  idsMenu.groups.forEach((group) => {
    if ((isElem && group.isEqualNode(menuGroup)) || (group?.id === menuGroup)) {
      hasGroup = group;
    }
  });
  return hasGroup;
}
/**
 * @private
 * @param {string|IdsMenuGroup} menuGroup the group to search for
 * @param {IdsMenu} idsMenu the parent menu element
 * @returns {IdsMenuGroup|undefined} if valid, a reference to the menu group.
 * Otherwise, returns undefined.
 */
@private
@param {string|IdsMenuGroup} menuGroup the group to search for
@param {IdsMenu} idsMenu the parent menu element
@returns {IdsMenuGroup|undefined} if valid, a reference to the menu group.
Otherwise, returns undefined.
@private @param { string|IdsMenuGroup } menuGroup the group to search for @param { IdsMenu } idsMenu the parent menu element @returns { IdsMenuGroup|undefined } if valid a reference to the menu group . Otherwise returns undefined .
function isValidGroup(menuGroup, idsMenu) {
  let hasGroup;
  const isElem = menuGroup instanceof IdsMenuGroup;
  idsMenu.groups.forEach((group) => {
    if ((isElem && group.isEqualNode(menuGroup)) || (group?.id === menuGroup)) {
      hasGroup = group;
    }
  });
  return hasGroup;
}
function isValidGroup ( menuGroup , idsMenu ) { let hasGroup ; const isElem = menuGroup instanceof IdsMenuGroup ; idsMenu . groups . forEach ( ( group ) => { if ( ( isElem && group . isEqualNode ( menuGroup ) ) || ( group ?. id === menuGroup ) ) { hasGroup = group ; } } ) ; return hasGroup ; }
@private
 @param {string|IdsMenuGroup} menuGroup the group to search for
 @param {IdsMenu} idsMenu the parent menu element
 @returns {IdsMenuGroup|undefined} if valid, a reference to the menu group.
@private @param { string|IdsMenuGroup } menuGroup the group to search for @param { IdsMenu } idsMenu the parent menu element @returns { IdsMenuGroup|undefined } if valid a reference to the menu group .