Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Return the function vs isFn check in i18n middleware
Browse files Browse the repository at this point in the history
Return the function instead of returning the isFn() instead of true when a function is sent
  • Loading branch information
B77Mills committed Jul 11, 2022
1 parent b40807a commit 811cba1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/marko-web-theme-monorail/middleware/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

0 comments on commit 811cba1

Please sign in to comment.