style: auto-fix linting issues
This commit is contained in:
parent
bd7f77a103
commit
557a77d4f3
1 changed files with 15 additions and 13 deletions
|
|
@ -108,9 +108,11 @@ const syncManager = {
|
||||||
.replace(/\bNone\b/g, 'null');
|
.replace(/\bNone\b/g, 'null');
|
||||||
|
|
||||||
// Basic safety check: ensure it looks like a structure and doesn't contain obvious code vectors
|
// Basic safety check: ensure it looks like a structure and doesn't contain obvious code vectors
|
||||||
if ((jsFriendly.trim().startsWith('[') || jsFriendly.trim().startsWith('{')) &&
|
if (
|
||||||
!jsFriendly.match(/function|=>|window|document|alert|eval/)) {
|
(jsFriendly.trim().startsWith('[') || jsFriendly.trim().startsWith('{')) &&
|
||||||
return (new Function('return ' + jsFriendly))();
|
!jsFriendly.match(/function|=>|window|document|alert|eval/)
|
||||||
|
) {
|
||||||
|
return new Function('return ' + jsFriendly)();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue