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

jscrambler

Package Overview
Dependencies
Maintainers
9
Versions
177
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jscrambler - npm Package Compare versions

Comparing version 5.3.1 to 5.3.2

dist/test.js

29

dist/bin/jscrambler.js

@@ -20,2 +20,6 @@ #!/usr/bin/env node

var _filesizeParser = require('filesize-parser');
var _filesizeParser2 = _interopRequireDefault(_filesizeParser);
var _config3 = require('../config');

@@ -46,4 +50,15 @@

_commander2.default.version(require('../../package.json').version).usage('[options] <file ...>').option('-a, --access-key <accessKey>', 'Access key').option('-c, --config <config>', 'JScrambler configuration options').option('-H, --host <host>', 'Hostname').option('-i, --application-id <id>', 'Application ID').option('-o, --output-dir <dir>', 'Output directory').option('-p, --port <port>', 'Port').option('--protocol <protocol>', 'Protocol (http or https)').option('--cafile <path>', 'Internal certificate authority').option('-C, --cwd <dir>', 'Current Working Directory').option('-s, --secret-key <secretKey>', 'Secret key').option('-m, --source-maps <id>', 'Download source maps').option('-R, --randomization-seed <seed>', 'Set randomization seed').option('--recommended-order <bool>', 'Use recommended order', validateBool('recommended-order')).option('-W, --werror <bool>', 'Set werror flag value (default: true)', validateBool('werror')).option('--tolerate-minification <bool>', 'Don\'t detect minification as malicious tampering (default: true)', validateBool('tolerate-minification')).option('--jscramblerVersion <version>', 'Use a specific Jscrambler version').option('--debugMode', 'Protect in debug mode').parse(process.argv);
var validateCodeHardeningThreshold = function validateCodeHardeningThreshold(val) {
var inBytes = void 0;
try {
inBytes = (0, _filesizeParser2.default)(val);
} catch (e) {
console.error('*code-hardening-threshold* requires a valid <threshold> value. Format: {number}{unit="b,kb,mb"}. Example: --code-hardening-threshold 200kb');
process.exit(1);
}
return inBytes;
};
_commander2.default.version(require('../../package.json').version).usage('[options] <file ...>').option('-a, --access-key <accessKey>', 'Access key').option('-c, --config <config>', 'JScrambler configuration options').option('-H, --host <host>', 'Hostname').option('-i, --application-id <id>', 'Application ID').option('-o, --output-dir <dir>', 'Output directory').option('-p, --port <port>', 'Port').option('--protocol <protocol>', 'Protocol (http or https)').option('--cafile <path>', 'Internal certificate authority').option('-C, --cwd <dir>', 'Current Working Directory').option('-s, --secret-key <secretKey>', 'Secret key').option('-m, --source-maps <id>', 'Download source maps').option('-R, --randomization-seed <seed>', 'Set randomization seed').option('--code-hardening-threshold <threshold>', 'Set code hardening file size threshold. Format: {value}{unit="b,kb,mb"}. Example: 200kb', validateCodeHardeningThreshold).option('--recommended-order <bool>', 'Use recommended order', validateBool('recommended-order')).option('-W, --werror <bool>', 'Set werror flag value (default: true)', validateBool('werror')).option('--tolerate-minification <bool>', 'Don\'t detect minification as malicious tampering (default: true)', validateBool('tolerate-minification')).option('--jscramblerVersion <version>', 'Use a specific Jscrambler version').option('--debugMode', 'Protect in debug mode').parse(process.argv);
var globSrc = void 0,

@@ -78,2 +93,8 @@ filesSrc = void 0,

config.debugMode = _commander2.default.debugMode || config.debugMode;
// handle codeHardening = 0
if (typeof _commander2.default.codeHardeningThreshold === 'undefined') {
config.codeHardeningThreshold = config.codeHardeningThreshold ? validateCodeHardeningThreshold(config.codeHardeningThreshold) : undefined;
} else {
config.codeHardeningThreshold = _commander2.default.codeHardeningThreshold;
}

@@ -156,3 +177,4 @@ if (config.jscramblerVersion && !/^(?:\d+\.\d+(?:-f)?|stable|latest)$/.test(config.jscramblerVersion)) {

debugMode = _config2.debugMode,
proxy = _config2.proxy;
proxy = _config2.proxy,
codeHardeningThreshold = _config2.codeHardeningThreshold;

@@ -234,3 +256,4 @@

debugMode: debugMode,
proxy: proxy
proxy: proxy,
codeHardeningThreshold: codeHardeningThreshold
};

@@ -237,0 +260,0 @@ _context2.prev = 1;

7

dist/index.js

@@ -162,3 +162,3 @@ 'use strict';

var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(configPathOrObject, destCallback) {
var _config, finalConfig, applicationId, host, port, protocol, cafile, keys, sources, _finalConfig$stream, stream, cwd, params, applicationTypes, languageSpecifications, sourceMaps, randomizationSeed, areSubscribersOrdered, useRecommendedOrder, _finalConfig$bail, bail, jscramblerVersion, debugMode, proxy, clientId, tolerateMinification, accessKey, secretKey, client, filesSrc, filesDest, source, removeSourceRes, zipped, _filesSrc, i, l, content, updateData, applicationUpdate, updateApplicationRes, createApplicationProtectionRes, protectionId, protection, url, sourcesErrors, _url, download;
var _config, finalConfig, applicationId, host, port, protocol, cafile, keys, sources, _finalConfig$stream, stream, cwd, params, applicationTypes, languageSpecifications, sourceMaps, randomizationSeed, areSubscribersOrdered, useRecommendedOrder, _finalConfig$bail, bail, jscramblerVersion, debugMode, proxy, clientId, tolerateMinification, codeHardeningThreshold, accessKey, secretKey, client, filesSrc, filesDest, source, removeSourceRes, zipped, _filesSrc, i, l, content, updateData, applicationUpdate, updateApplicationRes, createApplicationProtectionRes, protectionId, protection, url, sourcesErrors, _url, download;

@@ -171,3 +171,3 @@ return regeneratorRuntime.wrap(function _callee$(_context) {

finalConfig = (0, _lodash2.default)(_config, _config3.default);
applicationId = finalConfig.applicationId, host = finalConfig.host, port = finalConfig.port, protocol = finalConfig.protocol, cafile = finalConfig.cafile, keys = finalConfig.keys, sources = finalConfig.sources, _finalConfig$stream = finalConfig.stream, stream = _finalConfig$stream === undefined ? true : _finalConfig$stream, cwd = finalConfig.cwd, params = finalConfig.params, applicationTypes = finalConfig.applicationTypes, languageSpecifications = finalConfig.languageSpecifications, sourceMaps = finalConfig.sourceMaps, randomizationSeed = finalConfig.randomizationSeed, areSubscribersOrdered = finalConfig.areSubscribersOrdered, useRecommendedOrder = finalConfig.useRecommendedOrder, _finalConfig$bail = finalConfig.bail, bail = _finalConfig$bail === undefined ? true : _finalConfig$bail, jscramblerVersion = finalConfig.jscramblerVersion, debugMode = finalConfig.debugMode, proxy = finalConfig.proxy, clientId = finalConfig.clientId, tolerateMinification = finalConfig.tolerateMinification;
applicationId = finalConfig.applicationId, host = finalConfig.host, port = finalConfig.port, protocol = finalConfig.protocol, cafile = finalConfig.cafile, keys = finalConfig.keys, sources = finalConfig.sources, _finalConfig$stream = finalConfig.stream, stream = _finalConfig$stream === undefined ? true : _finalConfig$stream, cwd = finalConfig.cwd, params = finalConfig.params, applicationTypes = finalConfig.applicationTypes, languageSpecifications = finalConfig.languageSpecifications, sourceMaps = finalConfig.sourceMaps, randomizationSeed = finalConfig.randomizationSeed, areSubscribersOrdered = finalConfig.areSubscribersOrdered, useRecommendedOrder = finalConfig.useRecommendedOrder, _finalConfig$bail = finalConfig.bail, bail = _finalConfig$bail === undefined ? true : _finalConfig$bail, jscramblerVersion = finalConfig.jscramblerVersion, debugMode = finalConfig.debugMode, proxy = finalConfig.proxy, clientId = finalConfig.clientId, tolerateMinification = finalConfig.tolerateMinification, codeHardeningThreshold = finalConfig.codeHardeningThreshold;
accessKey = keys.accessKey, secretKey = keys.secretKey;

@@ -310,3 +310,4 @@ client = new this.Client({

debugMode: !!debugMode,
tolerateMinification: tolerateMinification
tolerateMinification: tolerateMinification,
codeHardeningThreshold: codeHardeningThreshold
};

@@ -313,0 +314,0 @@

{
"name": "jscrambler",
"description": "Jscrambler API client.",
"version": "5.3.1",
"version": "5.3.2",
"homepage": "https://github.com/jscrambler/jscrambler",

@@ -36,2 +36,3 @@ "author": {

"commander": "^2.8.1",
"filesize-parser": "1.5.0",
"fs-extra": "^0.30.0",

@@ -38,0 +39,0 @@ "glob": "^7.0.3",

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