cli,frontend-app-api: more cleanup

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-09-05 18:07:27 +02:00
parent 888748f10b
commit 3f49724db8
6 changed files with 14 additions and 8 deletions
@@ -57,14 +57,14 @@ describe('getAvailablePlugins', () => {
{
module: {
testPlugin,
a: 1,
a: 'a',
b: null,
c: undefined,
d: Symbol('wat'),
e: () => {},
f: [],
g: {},
h: 'h',
h: class {},
i: NaN,
j: Infinity,
k: -Infinity,
@@ -80,6 +80,9 @@ describe('getAvailablePlugins', () => {
u: false,
v: true,
w: 0,
x: 1,
y: -1,
z: '',
},
},
],
@@ -30,7 +30,7 @@ export function getAvailablePlugins(): BackstagePlugin[] {
return (
discovered?.modules.flatMap(({ module: mod }) =>
Object.values(mod).flatMap(val => (isBackstagePlugin(val) ? [val] : [])),
Object.values(mod).filter(isBackstagePlugin),
) ?? []
);
}