refactor: new node features (#5132)

Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
Sugden
2021-06-30 21:40:33 +01:00
committed by GitHub
parent f108746c15
commit 1e8f01253e
68 changed files with 305 additions and 360 deletions

View File

@@ -39,7 +39,7 @@ function message(key, args) {
const msg = messages.get(key);
if (!msg) throw new Error(`An invalid error message key was used: ${key}.`);
if (typeof msg === 'function') return msg(...args);
if (args === undefined || args.length === 0) return msg;
if (!args?.length) return msg;
args.unshift(msg);
return String(...args);
}