Socket
Socket
Sign inDemoInstall

jscrambler

Package Overview
Dependencies
Maintainers
1
Versions
171
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 0.5.0 to 0.5.1

3

jscrambler-client.js

@@ -128,3 +128,4 @@ 'use strict';

access_key: this.options.accessKey,
timestamp: new Date().toISOString()
timestamp: new Date().toISOString(),
user_agent: 'Node'
});

@@ -131,0 +132,0 @@ if (method === 'POST' && params.files) handleFileParams(params);

@@ -213,21 +213,32 @@ /**

zipProject: function (files) {
var zip = new JSZip();
for (var i = 0, l = files.length; i < l; ++i) {
var buffer, name;
if (files[i].contents) {
name = path.relative(files[i].cwd, files[i].path);
buffer = files[i].contents;
} else if (!fs.statSync(files[i]).isDirectory()) {
name = files[i];
buffer = fs.readFileSync(files[i]);
var hasFiles = false;
if (files.length === 1 && /^.*\.zip$/.test(files[0])) {
hasFiles = true;
fs.outputFileSync('.tmp.zip', fs.readFileSync(files[0]));
} else {
var zip = new JSZip();
for (var i = 0, l = files.length; i < l; ++i) {
var buffer, name;
if (files[i].contents) {
name = path.relative(files[i].cwd, files[i].path);
buffer = files[i].contents;
} else if (!fs.statSync(files[i]).isDirectory()) {
name = files[i];
buffer = fs.readFileSync(files[i]);
} else {
zip.folder(files[i]);
}
if (name) {
hasFiles = true;
zip.file(name, buffer);
}
}
if (hasFiles) {
fs.outputFileSync('.tmp.zip', zip.generate({type: 'nodebuffer'}), {encoding: 'base64'});
files[0] = '.tmp.zip';
files.length = 1;
} else {
zip.folder(files[i]);
throw new Error('No source files found. If you intend to send a whole directory sufix your path with "**" (e.g. ./my-directory/**)');
}
if (name) {
zip.file(name, buffer);
}
}
fs.outputFileSync('.tmp.zip', zip.generate({type: 'nodebuffer'}), {encoding: 'base64'});
files[0] = '.tmp.zip';
files.length = 1;
},

@@ -234,0 +245,0 @@ /**

{
"name": "jscrambler",
"description": "JScrambler API client.",
"version": "0.5.0",
"version": "0.5.1",
"homepage": "https://github.com/auditmark/node-jscrambler",

@@ -32,4 +32,4 @@ "author": {

"fs-extra": "^0.8.1",
"jszip": "^2.2.0",
"glob": "^3.2.9"
"jszip": "^2.2.2",
"glob": "^3.2.11"
},

@@ -36,0 +36,0 @@ "main": "jscrambler",

Sorry, the diff of this file is not supported yet

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