fix(core): update

This commit is contained in:
2022-09-13 19:23:11 +02:00
parent 36bcb9265a
commit 5e961f7a5b
5 changed files with 23 additions and 17 deletions

View File

@@ -66,4 +66,14 @@ export let base64 = {
decode: (stringArg: string) => {
return plugins.jsBase64.decode(stringArg);
},
/**
*
* @param stringArg
* checks wether the string is base64 encoded
*/
isBase64: (stringArg: string) => {
const regex = /^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)?$/;
return regex.test(stringArg);
},
};