Extensions: Simplify the configure() function (#64958)

refactor: stop passing the extension to the `configure()` function
This commit is contained in:
Levente Balogh
2023-03-20 10:41:15 +01:00
committed by GitHub
parent 46cba5f993
commit 788e4a7f19
9 changed files with 33 additions and 70 deletions
@@ -20,9 +20,12 @@ export function getPluginExtensions<T extends object = {}>(
const extensions = configureFuncs.reduce<PluginExtension[]>((result, configure) => {
const extension = configure(context);
// If the configure() function returns `undefined`, the extension is not displayed
if (extension) {
result.push(extension);
}
return result;
}, []);