UNPKG

@redocly/graphql-docs

Version:

Redocly GraphQL docs

2 lines (1 loc) 467 B
import{isDefined as n}from"../../common/utils/is-defined.js";import{DEFAULT_MENU_GROUP_ID as o}from"../models/index.js";import{TYPE_GROUP_NAMES as p}from"./grouping/initial-group.js";function a(e,t){return t.groups.map(r=>e.get(r.name)).concat(e.get(o)).filter(n).filter(i).map(r=>({id:r.id,name:r.name,typeGroups:u(r.typeGroups)}))}function i(e){return e.typeGroups.size>0}function u(e){return Object.keys(p).map(t=>e.get(t)).filter(n)}export{a as orderMenuGroups};