mirror of
https://github.com/tale/headplane.git
synced 2026-08-13 15:07:24 +00:00
Support previous API interface as well
This commit is contained in:
+16
-5
@@ -54,9 +54,20 @@ export function mapNodes(
|
||||
}
|
||||
|
||||
export function sortNodeTags(nodes: Machine[]): string[] {
|
||||
return Array.from(
|
||||
new Set(
|
||||
nodes.flatMap((node) => node.tags),
|
||||
),
|
||||
).sort();
|
||||
try {
|
||||
return Array.from(
|
||||
new Set(
|
||||
nodes.flatMap((node) => node.tags),
|
||||
),
|
||||
).sort();
|
||||
} catch {
|
||||
return Array.from(
|
||||
new Set(
|
||||
nodes.flatMap(({ validTags, forcedTags }) => [
|
||||
...validTags,
|
||||
...forcedTags,
|
||||
]),
|
||||
),
|
||||
).sort();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user