Removed redundant condition

This commit is contained in:
sanex3339
2020-01-02 16:15:23 +03:00
parent 37784ff97b
commit 8c82ed4886
2 changed files with 2 additions and 6 deletions
@@ -46,10 +46,6 @@ export class ReservedStringObfuscatingGuard implements IObfuscatingGuard {
* @returns {boolean}
*/
private isReservedString (value: string): boolean {
if (!this.options.reservedStrings.length) {
return false;
}
return this.options.reservedStrings
.some((reservedString: string) => {
return new RegExp(reservedString, 'g').exec(value) !== null;
@@ -8,7 +8,7 @@ import { readFileAsString } from '../../../../../helpers/readFileAsString';
describe('ReservedStringObfuscatingGuard', () => {
describe('check', () => {
describe('`reservedString` option is enabled', () => {
describe('`reservedStrings` option is enabled', () => {
const obfuscatingGuardRegExp: RegExp = /var test1 *= *'foo' *\+ *'foo'; *var test2 *= *'barbar'; *var test3 *= *'baz' *\+ *'baz';/;
let obfuscatedCode: string;
@@ -32,7 +32,7 @@ describe('ReservedStringObfuscatingGuard', () => {
});
});
describe('`reservedString` option is disabled', () => {
describe('`reservedStrings` option is disabled', () => {
const obfuscatingGuardRegExp: RegExp = /var test1 *= *'foo' *\+ *'foo'; *var test2 *= *'bar' *\+ *'bar'; *var test3 *= *'baz' *\+ *'baz';/;
let obfuscatedCode: string;