docs + freebox parsing issue #927

This commit is contained in:
jokob-sk
2025-01-03 22:20:45 +11:00
parent e6d2a1c138
commit bd198587cd
13 changed files with 116 additions and 131 deletions

View File

@@ -410,6 +410,14 @@ function isValidBase64(str) {
return invalidCharacters === '';
}
// -------------------------------------------------------------------
// Utility function to check if the value is already Base64
function isBase64(value) {
const base64Regex =
/^(?:[A-Za-z0-9+\/]{4})*?(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/;
return base64Regex.test(value);
}
// ----------------------------------------------------
function isValidJSON(jsonString) {
try {