fix lint error

This commit is contained in:
Remko Tronçon 2022-04-14 23:00:45 +02:00
parent 5aa2485cd4
commit c64957e41e

View file

@ -4,8 +4,9 @@ const isSafari =
typeof navigator != "undefined" &&
/^((?!chrome|android).)*safari/i.test(navigator.userAgent);
// eslint-disable-next-line no-unused-vars
const arrayToBase64 =
typeof "Buffer" === "undefined"
typeof Buffer === "undefined"
? function arrayToBase64(bytes) {
var binary = "";
var len = bytes.byteLength;
@ -14,7 +15,7 @@ const arrayToBase64 =
}
return window.btoa(binary);
}
: function arrayToBase64(bytes) {
: function arrayToBase64(s) {
return Buffer.from(s).toString("base64");
};