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

jscrambler-metro-plugin

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jscrambler-metro-plugin - npm Package Compare versions

Comparing version 5.5.30 to 5.5.31

@@ -18,3 +18,2 @@ const path = require('path');

const JSCRAMBLER_EXTS = /.(j|t)s(x)?$/i;
const JSCRAMBLER_EXCLUDE_LIST_TRANSFORMATIONS = ['globalVariableIndirection'];

@@ -35,4 +34,3 @@ module.exports = {

JSCRAMBLER_END_ANNOTATION,
JSCRAMBLER_EXCLUDE_LIST_TRANSFORMATIONS,
JSCRAMBLER_EXTS
}

@@ -30,3 +30,2 @@ const {copy, emptyDir, mkdirp, readFile, writeFile} = require('fs-extra');

addBundleArgsToExcludeList,
getExcludeListOptions,
wrapCodeWithTags

@@ -58,3 +57,3 @@ } = require('./utils');

let filteredFileNames = fileNames;
const excludeListOptions = getExcludeListOptions(config);
const excludeList = [];

@@ -92,3 +91,3 @@ const supportsEntryPoint = await jscrambler.introspectFieldOnMethod.call(

);
addBundleArgsToExcludeList(metroBundleChunks[0], excludeListOptions);
addBundleArgsToExcludeList(metroBundleChunks[0], excludeList);
const metroUserFilesOnly = metroBundleChunks.slice(1).map((c, i) => {

@@ -98,3 +97,3 @@ const s = c.split(JSCRAMBLER_END_ANNOTATION);

if (i < metroBundleChunks.length - 2) {
addBundleArgsToExcludeList(s[1], excludeListOptions);
addBundleArgsToExcludeList(s[1], excludeList);
}

@@ -136,2 +135,3 @@ return s[0];

config.clientId = JSCRAMBLER_CLIENT_ID;
config.excludeList = excludeList;

@@ -138,0 +138,0 @@

@@ -13,3 +13,2 @@ const fs = require('fs');

BUNDLE_DEV_CLI_ARG,
JSCRAMBLER_EXCLUDE_LIST_TRANSFORMATIONS,
BUNDLE_CMD

@@ -226,7 +225,3 @@ } = require('./constants');

const addBundleArgsToExcludeList = (chunk, excludeListOptions = []) => {
if (excludeListOptions.length === 0) {
return;
}
const addBundleArgsToExcludeList = (chunk, excludeList) => {
const regex = /\(([0-9a-zA-Z_,]+)\){$/gm;

@@ -236,6 +231,4 @@ const m = regex.exec(chunk);

for (const arg of m[1].split(",")) {
for (const excludeList of excludeListOptions) {
if (!excludeList.includes(arg)) {
excludeList.push(arg);
}
if (!excludeList.includes(arg)) {
excludeList.push(arg);
}

@@ -246,35 +239,6 @@ }

console.error(`Unable to add global variables to the exclude list. If you want to proceed, please remove the transformations: *${JSCRAMBLER_EXCLUDE_LIST_TRANSFORMATIONS}*`);
console.error(`Unable to add global variables to the exclude list.`);
process.exit(1);
};
const getExcludeListOptions = config => {
const excludeListOptions = [];
if (!Array.isArray(config.params)) {
return excludeListOptions;
}
for (const param of config.params) {
if (param.status !== 0 && JSCRAMBLER_EXCLUDE_LIST_TRANSFORMATIONS.includes(param.name)) {
if (!param.options) {
param.options = {
excludeList: [],
};
} else if (!Array.isArray(param.options.excludeList)) {
if (typeof param.options.excludeList !== "undefined") {
console.error(`Exclude list option in ${param.name} must be an array.`);
process.exit(1);
}
param.options.excludeList = [];
}
excludeListOptions.push(param.options.excludeList);
}
}
return excludeListOptions;
}
module.exports = {

@@ -290,4 +254,3 @@ buildModuleSourceMap,

addBundleArgsToExcludeList,
getExcludeListOptions,
wrapCodeWithTags
};
{
"name": "jscrambler-metro-plugin",
"version": "5.5.30",
"version": "5.5.31",
"description": "A plugin to use metro with Jscrambler",

@@ -12,3 +12,3 @@ "main": "lib/index.js",

"fs-extra": "^8.0.1",
"jscrambler": "^5.5.25"
"jscrambler": "^5.5.31"
},

@@ -15,0 +15,0 @@ "keywords": [