mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Bug fixes
This commit is contained in:
+1
-1
@@ -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.`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user