Fixes, and made firegex responsive

This commit is contained in:
DomySh
2022-06-15 01:23:54 +02:00
parent 3f56a2cb3b
commit c639b43448
10 changed files with 211 additions and 154 deletions

View File

@@ -160,15 +160,9 @@ export function okNotify(title:string, description:string ){
}
export function validateRegex(pattern:string) {
var parts = pattern.split('/'),
regex = pattern,
options = "";
if (parts.length > 1) {
regex = parts[1];
options = parts[2];
}
return true; // TO TEST
try {
new RegExp(regex, options);
new RegExp(pattern);
return true;
}
catch(e) {
@@ -178,4 +172,4 @@ export function validateRegex(pattern:string) {
export function b64encode(data:string){
return Buffer.from(data).toString('base64')
}
}