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

jscrambler

Package Overview
Dependencies
Maintainers
1
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 0.5.1 to 0.5.2

24

jscrambler.js

@@ -109,3 +109,4 @@ /**

var deferred = Q.defer();
this.zipProject(params.files);
this.zipProject(params.files, params.cwd);
delete params.cwd;
client.post('/code.json', params, function (err, res, body) {

@@ -179,3 +180,3 @@ this.cleanZipProject();

if (typeof config.filesSrc[i] === 'string') {
filesSrc = filesSrc.concat(glob.sync(config.filesSrc[i]));
filesSrc = filesSrc.concat(glob.sync(config.filesSrc[i], {dot: true}));
} else {

@@ -212,5 +213,6 @@ filesSrc.push(config.filesSrc[i]);

/**
* It zips all files inside the passed parameter into a single zip file.
* It zips all files inside the passed parameter into a single zip file. It
* accepts an optional `cwd` parameter.
*/
zipProject: function (files) {
zipProject: function (files, cwd) {
var hasFiles = false;

@@ -224,11 +226,17 @@ if (files.length === 1 && /^.*\.zip$/.test(files[0])) {

var buffer, name;
var path = cwd ? cwd + '/' + files[i] : files[i];
// If buffer
if (files[i].contents) {
name = path.relative(files[i].cwd, files[i].path);
buffer = files[i].contents;
} else if (!fs.statSync(files[i]).isDirectory()) {
}
// Else if it's a path and not a directory
else if (!fs.statSync(path).isDirectory()) {
name = files[i];
buffer = fs.readFileSync(files[i]);
} else {
zip.folder(files[i]);
buffer = fs.readFileSync(path);
}
// Else if it's a directory path
else {
zip.folder(path);
}
if (name) {

@@ -235,0 +243,0 @@ hasFiles = true;

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

@@ -33,3 +33,3 @@ "author": {

"jszip": "^2.2.2",
"glob": "^3.2.11"
"glob": "^4.0.2"
},

@@ -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