X-Git-Url: http://git.squeep.com/?p=squeep-mystery-box;a=blobdiff_plain;f=lib%2Fcommon.js;h=a47226f6e76fe355416380f3a77db24450481783;hp=fb3ec979524e668bfc5b85dded22a42c56117f41;hb=383899395bf599359d60337edb651af0592f82cb;hpb=6dbf84c8308199dc0ad0e601e0081aafbc72f681 diff --git a/lib/common.js b/lib/common.js index fb3ec97..a47226f 100644 --- a/lib/common.js +++ b/lib/common.js @@ -25,6 +25,9 @@ const fileScope = (filename) => { * @returns {String} */ const base64ToBase64URL = (input) => { + if (!input) { + return input; + } return input .replace(/=/g, '') .replace(/\+/g, '-') @@ -38,6 +41,9 @@ const base64ToBase64URL = (input) => { * @returns {String} */ const base64URLToBase64 = (input) => { + if (!input) { + return input; + } return base64RePad(input) .replace(/-/g, '+') .replace(/_/, '/');