Bug fixes

This commit is contained in:
Daniel Odendahl Jr
2018-04-04 19:14:20 +00:00
parent 95a37134ed
commit 8cbbcecb70
4 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ class Util {
static base64(text, mode = 'encode') {
if (mode === 'encode') return Buffer.from(text).toString('base64');
if (mode === 'decode') return Buffer.from(text, 'base64').toString('utf8');
if (mode === 'decode') return Buffer.from(text, 'base64').toString('utf8') || null;
throw new TypeError(`${mode} is not a supported base64 mode.`);
}