From 811cba1d9ae9c65e0259f28ddfe8820d633a9f29 Mon Sep 17 00:00:00 2001 From: Brian Miller Date: Mon, 11 Jul 2022 08:09:13 -0500 Subject: [PATCH] Return the function vs isFn check in i18n middleware Return the function instead of returning the isFn() instead of true when a function is sent --- packages/marko-web-theme-monorail/middleware/i18n.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/marko-web-theme-monorail/middleware/i18n.js b/packages/marko-web-theme-monorail/middleware/i18n.js index 0066fae46..b0420cd09 100644 --- a/packages/marko-web-theme-monorail/middleware/i18n.js +++ b/packages/marko-web-theme-monorail/middleware/i18n.js @@ -7,6 +7,6 @@ const isFn = f => typeof f === 'function'; */ module.exports = (app, fn) => { const defaultFn = v => v; - const i18n = isFn(fn) || defaultFn; + const i18n = isFn(fn) ? fn : defaultFn; set(app.locals, 'i18n', i18n); };