mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
chore(node): upgrade to Node 20
This commit is contained in:
@@ -8,7 +8,7 @@ import common from '../../common';
|
||||
const commonErrors = common.errorMessages.common;
|
||||
const apiErrors = common.errorMessages.api;
|
||||
|
||||
export default function apiError (msgKey, vars = {}) {
|
||||
function apiError (msgKey, vars = {}) {
|
||||
let message = apiErrors[msgKey];
|
||||
if (!message) message = commonErrors[msgKey];
|
||||
if (!message) throw new Error(`Error processing the API message "${msgKey}".`);
|
||||
@@ -18,3 +18,7 @@ export default function apiError (msgKey, vars = {}) {
|
||||
// TODO cache the result of template() ? More memory usage, faster output
|
||||
return _.template(message)(clonedVars);
|
||||
}
|
||||
|
||||
export {
|
||||
apiError,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user