-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
191 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// Import Third-party Dependencies | ||
import { Utils } from "@nodesecure/sec-literal"; | ||
|
||
export function verify(analysis, prefix) { | ||
export function verify(sourceFile, prefix) { | ||
const pValue = Object.keys(prefix).pop(); | ||
const regexStr = `^${Utils.escapeRegExp(pValue)}[a-zA-Z]{1,2}[0-9]{0,2}$`; | ||
|
||
return analysis.identifiersName.every(({ name }) => new RegExp(regexStr).test(name)); | ||
return sourceFile.identifiersName.every(({ name }) => new RegExp(regexStr).test(name)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// CONSTANTS | ||
const kJSFuckMinimumDoubleUnaryExpr = 5; | ||
|
||
export function verify(analysis) { | ||
const hasZeroAssign = analysis.idtypes.assignExpr === 0 | ||
&& analysis.idtypes.functionDeclaration === 0 | ||
&& analysis.idtypes.property === 0 | ||
&& analysis.idtypes.variableDeclarator === 0; | ||
export function verify(sourceFile) { | ||
const hasZeroAssign = sourceFile.idtypes.assignExpr === 0 | ||
&& sourceFile.idtypes.functionDeclaration === 0 | ||
&& sourceFile.idtypes.property === 0 | ||
&& sourceFile.idtypes.variableDeclarator === 0; | ||
|
||
return hasZeroAssign && analysis.counter.doubleUnaryArray >= kJSFuckMinimumDoubleUnaryExpr; | ||
return hasZeroAssign && sourceFile.counter.doubleUnaryArray >= kJSFuckMinimumDoubleUnaryExpr; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
export function verify(analysis) { | ||
if (analysis.counter.memberExpr > 0) { | ||
export function verify(sourceFile) { | ||
if (sourceFile.counter.memberExpr > 0) { | ||
return false; | ||
} | ||
|
||
const hasSomePatterns = analysis.counter.doubleUnaryArray > 0 | ||
|| analysis.counter.deepBinaryExpr > 0 | ||
|| analysis.counter.encodedArrayValue > 0 | ||
|| analysis.hasDictionaryString; | ||
const hasSomePatterns = sourceFile.counter.doubleUnaryArray > 0 | ||
|| sourceFile.counter.deepBinaryExpr > 0 | ||
|| sourceFile.counter.encodedArrayValue > 0 | ||
|| sourceFile.hasDictionaryString; | ||
|
||
// TODO: hasPrefixedIdentifiers only work for hexadecimal id names generator | ||
return analysis.hasPrefixedIdentifiers && hasSomePatterns; | ||
return sourceFile.hasPrefixedIdentifiers && hasSomePatterns; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.