@stoplight/elements 7.3.7 → 7.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -88,21 +88,24 @@ const computeAPITree = (serviceNode, config = {}) => {
88
88
  });
89
89
  });
90
90
  groups.forEach(group => {
91
- tree.push({
92
- title: group.title,
93
- items: group.items.flatMap(operationNode => {
94
- if (mergedConfig.hideInternal && operationNode.data.internal) {
95
- return [];
96
- }
97
- return {
98
- id: operationNode.uri,
99
- slug: operationNode.uri,
100
- title: operationNode.name,
101
- type: operationNode.type,
102
- meta: operationNode.data.method,
103
- };
104
- }),
91
+ const items = group.items.flatMap(operationNode => {
92
+ if (mergedConfig.hideInternal && operationNode.data.internal) {
93
+ return [];
94
+ }
95
+ return {
96
+ id: operationNode.uri,
97
+ slug: operationNode.uri,
98
+ title: operationNode.name,
99
+ type: operationNode.type,
100
+ meta: operationNode.data.method,
101
+ };
105
102
  });
103
+ if (items.length > 0) {
104
+ tree.push({
105
+ title: group.title,
106
+ items,
107
+ });
108
+ }
106
109
  });
107
110
  }
108
111
  let schemaNodes = serviceNode.children.filter(node => node.type === NodeType.Model);
package/index.js CHANGED
@@ -115,21 +115,24 @@ const computeAPITree = (serviceNode, config = {}) => {
115
115
  });
116
116
  });
117
117
  groups.forEach(group => {
118
- tree.push({
119
- title: group.title,
120
- items: group.items.flatMap(operationNode => {
121
- if (mergedConfig.hideInternal && operationNode.data.internal) {
122
- return [];
123
- }
124
- return {
125
- id: operationNode.uri,
126
- slug: operationNode.uri,
127
- title: operationNode.name,
128
- type: operationNode.type,
129
- meta: operationNode.data.method,
130
- };
131
- }),
118
+ const items = group.items.flatMap(operationNode => {
119
+ if (mergedConfig.hideInternal && operationNode.data.internal) {
120
+ return [];
121
+ }
122
+ return {
123
+ id: operationNode.uri,
124
+ slug: operationNode.uri,
125
+ title: operationNode.name,
126
+ type: operationNode.type,
127
+ meta: operationNode.data.method,
128
+ };
132
129
  });
130
+ if (items.length > 0) {
131
+ tree.push({
132
+ title: group.title,
133
+ items,
134
+ });
135
+ }
133
136
  });
134
137
  }
135
138
  let schemaNodes = serviceNode.children.filter(node => node.type === types.NodeType.Model);
package/index.mjs CHANGED
@@ -88,21 +88,24 @@ const computeAPITree = (serviceNode, config = {}) => {
88
88
  });
89
89
  });
90
90
  groups.forEach(group => {
91
- tree.push({
92
- title: group.title,
93
- items: group.items.flatMap(operationNode => {
94
- if (mergedConfig.hideInternal && operationNode.data.internal) {
95
- return [];
96
- }
97
- return {
98
- id: operationNode.uri,
99
- slug: operationNode.uri,
100
- title: operationNode.name,
101
- type: operationNode.type,
102
- meta: operationNode.data.method,
103
- };
104
- }),
91
+ const items = group.items.flatMap(operationNode => {
92
+ if (mergedConfig.hideInternal && operationNode.data.internal) {
93
+ return [];
94
+ }
95
+ return {
96
+ id: operationNode.uri,
97
+ slug: operationNode.uri,
98
+ title: operationNode.name,
99
+ type: operationNode.type,
100
+ meta: operationNode.data.method,
101
+ };
105
102
  });
103
+ if (items.length > 0) {
104
+ tree.push({
105
+ title: group.title,
106
+ items,
107
+ });
108
+ }
106
109
  });
107
110
  }
108
111
  let schemaNodes = serviceNode.children.filter(node => node.type === NodeType.Model);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoplight/elements",
3
- "version": "7.3.7",
3
+ "version": "7.3.8",
4
4
  "description": "UI components for composing beautiful developer documentation.",
5
5
  "keywords": [],
6
6
  "main": "./index.js",