Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

restringer

Package Overview
Dependencies
Maintainers
2
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

restringer - npm Package Compare versions

Comparing version 1.9.1 to 1.10.0

src/modules/safe/simplifyIfStatements.js

2

package.json
{
"name": "restringer",
"version": "1.9.1",
"version": "1.10.0",
"description": "Deobfuscate Javascript with emphasis on reconstructing strings",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -28,2 +28,3 @@ module.exports = {

simplifyCalls: require(__dirname + '/simplifyCalls'),
simplifyIfStatements: require(__dirname + '/simplifyIfStatements'),
unwrapFunctionShells: require(__dirname + '/unwrapFunctionShells'),

@@ -30,0 +31,0 @@ unwrapIIFEs: require(__dirname + '/unwrapIIFEs'),

@@ -36,2 +36,3 @@ #!/usr/bin/env node

simplifyCalls,
simplifyIfStatements,
rearrangeSwitches,

@@ -127,2 +128,3 @@ unwrapIIFEs,

unwrapIIFEs,
simplifyIfStatements,
];

@@ -129,0 +131,0 @@ }

@@ -540,2 +540,51 @@ const {generateFlatAST} = require('flast');

},
{
enabled: true,
name: 'simplifyIfStatements - TP-1 (empty blocks)',
func: __dirname + '/../src/modules/safe/simplifyIfStatements',
source: `if (J) {} else {}`,
expected: `J;`,
},
{
enabled: true,
name: 'simplifyIfStatements - TP-2 (empty block, empty alternate statement)',
func: __dirname + '/../src/modules/safe/simplifyIfStatements',
source: `if (J) {} else;`,
expected: `J;`,
},
{
enabled: true,
name: 'simplifyIfStatements - TP-3 (empty block, populated alternate expression)',
func: __dirname + '/../src/modules/safe/simplifyIfStatements',
source: `if (J) {} else J();`,
expected: `if (!J)\n J();`,
},
{
enabled: true,
name: 'simplifyIfStatements - TP-4 (empty block, populated alternate block)',
func: __dirname + '/../src/modules/safe/simplifyIfStatements',
source: `if (J) {} else {J()}`,
expected: `if (!J) {\n J();\n}`,
},
{
enabled: true,
name: 'simplifyIfStatements - TP-5 (empty statements)',
func: __dirname + '/../src/modules/safe/simplifyIfStatements',
source: `if (J); else;`,
expected: `J;`,
},
{
enabled: true,
name: 'simplifyIfStatements - TP-6 (empty statement, no alternate)',
func: __dirname + '/../src/modules/safe/simplifyIfStatements',
source: `if (J);`,
expected: `J;`,
},
{
enabled: true,
name: 'simplifyIfStatements - TP-7 (empty block, no alternate)',
func: __dirname + '/../src/modules/safe/simplifyIfStatements',
source: `if (J) {}`,
expected: `J;`,
},

@@ -542,0 +591,0 @@ // Unsafe

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc