feat: explicit client bypass
This commit is contained in:
parent
17153dc50a
commit
1554cea35b
|
@ -1,5 +1,5 @@
|
|||
module.exports = async (latus, req) => {
|
||||
const config = await latus.invokeReduceAsync(
|
||||
const plugins = await latus.invokeReduceAsync(
|
||||
'@latus/http/plugins',
|
||||
undefined,
|
||||
undefined,
|
||||
|
@ -8,6 +8,10 @@ module.exports = async (latus, req) => {
|
|||
const defaults = Object.keys(latus.originalConfig)
|
||||
.map((plugin) => {
|
||||
const config = {};
|
||||
if (false === plugins[plugin]) {
|
||||
delete plugins[plugin];
|
||||
return undefined;
|
||||
}
|
||||
[plugin, `${plugin}/client`].forEach((path) => {
|
||||
try {
|
||||
// eslint-disable-next-line no-eval
|
||||
|
@ -19,9 +23,10 @@ module.exports = async (latus, req) => {
|
|||
});
|
||||
return config;
|
||||
})
|
||||
.filter((config) => !!config)
|
||||
.reduce((r, o) => ({...r, ...o}), {});
|
||||
return {
|
||||
...defaults,
|
||||
...config,
|
||||
...plugins,
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user