New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ifdef-loader

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ifdef-loader - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

2

package.json
{
"name": "ifdef-loader",
"version": "0.0.9",
"version": "0.0.10",
"description": "#ifdef conditional Webpack loader",

@@ -5,0 +5,0 @@ "main": "ifdef-loader.js",

@@ -13,14 +13,14 @@ "use strict";

var cond = evaluate(startInfo.condition, startInfo.keyword, defs);
if (!cond) {
blank_code(lines, startInfo.line, endLine);
if (cond) {
if (verbose) {
console.log("matched condition #" + startInfo.keyword + " " + startInfo.condition + " => excluded lines [" + (startInfo.line + 1) + "-" + (endLine + 1) + "]");
console.log("matched condition #" + startInfo.keyword + " " + startInfo.condition + " => including lines [" + (startInfo.line + 1) + "-" + (endLine + 1) + "]");
}
blank_code(lines, startInfo.line, startInfo.line);
blank_code(lines, endLine, endLine);
}
else {
blank_code(lines, startInfo.line, endLine);
if (verbose) {
console.log("unmatched condition #" + startInfo.keyword + " " + startInfo.condition);
console.log("not matched condition #" + startInfo.keyword + " " + startInfo.condition + " => excluding lines [" + (startInfo.line + 1) + "-" + (endLine + 1) + "]");
}
blank_code(lines, startInfo.line, startInfo.line);
blank_code(lines, endLine, endLine);
}

@@ -79,7 +79,7 @@ n = startInfo.line;

function evaluate(condition, keyword, defs) {
var code = "";
var code = "(function(){";
for (var key in defs) {
code += "var " + key + " = " + JSON.stringify(defs[key]) + ";";
}
code += "(" + condition + ") ? true : false";
code += "return (" + condition + ") ? true : false;})()";
var result;

@@ -86,0 +86,0 @@ try {

@@ -21,14 +21,14 @@ interface IStart {

if(!cond) {
blank_code(lines, startInfo.line, endLine);
if(cond) {
if(verbose) {
console.log(`matched condition #${startInfo.keyword} ${startInfo.condition} => excluded lines [${startInfo.line+1}-${endLine+1}]`);
console.log(`matched condition #${startInfo.keyword} ${startInfo.condition} => including lines [${startInfo.line+1}-${endLine+1}]`);
}
blank_code(lines, startInfo.line, startInfo.line);
blank_code(lines, endLine, endLine);
}
else {
blank_code(lines, startInfo.line, endLine);
if(verbose) {
console.log(`unmatched condition #${startInfo.keyword} ${startInfo.condition}`);
console.log(`not matched condition #${startInfo.keyword} ${startInfo.condition} => excluding lines [${startInfo.line+1}-${endLine+1}]`);
}
blank_code(lines, startInfo.line, startInfo.line);
blank_code(lines, endLine, endLine);
}

@@ -99,8 +99,7 @@

let code = "";
let code = "(function(){";
for(let key in defs) {
code += `var ${key} = ${JSON.stringify(defs[key])};`;
}
code += `(${condition}) ? true : false`;
//console.log(code);
code += `return (${condition}) ? true : false;})()`;

@@ -107,0 +106,0 @@ let result: boolean;

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