Socket
Socket
Sign inDemoInstall

buddy

Package Overview
Dependencies
273
Maintainers
2
Versions
180
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.13.6 to 6.13.7

50

lib/File.js

@@ -354,24 +354,21 @@ 'use strict';

return workflow.reduce(
(tasks, task) => {
if (task.includes(':')) {
const conditions = task.split(':');
return workflow.reduce((tasks, task) => {
if (task.includes(':')) {
const conditions = task.split(':');
task = conditions.pop();
const passed = conditions.every(condition => {
const negative = condition.charAt(0) == '!';
task = conditions.pop();
const passed = conditions.every(condition => {
const negative = condition.charAt(0) == '!';
condition = negative ? condition.slice(1) : condition;
const test = condition in buildOptions ? buildOptions[condition] : this[condition];
condition = negative ? condition.slice(1) : condition;
const test = condition in buildOptions ? buildOptions[condition] : this[condition];
return negative ? !test : test;
});
return negative ? !test : test;
});
if (!passed) return tasks;
}
tasks.push(task);
return tasks;
},
[]
);
if (!passed) return tasks;
}
tasks.push(task);
return tasks;
}, []);
}

@@ -468,2 +465,13 @@

/**
* Hash 'content'
* @param {Boolean} forWrite
* @returns {String}
*/
hashContent(forWrite = false) {
return forWrite
? md5([this, ...this.getAllDependencies()].map(file => file.content).join(''))
: md5(this.content || this.fileContent);
}
/**
* Read and store file contents

@@ -486,3 +494,3 @@ * @param {Object} buildOptions

this.fileContent = this.readFileContent();
this.hash = md5(this.fileContent);
this.hash = this.hashContent(false);

@@ -577,5 +585,3 @@ debug(`load: ${strong(this.relpath)}`, 4);

this.writeDate = Date.now();
// TODO: add header
// Hash based on content + dependencies
this.writeHash = md5([this.content, ...this.getAllDependencies().map(file => file.content)].join(''));
this.writeHash = this.hashContent(true);

@@ -582,0 +588,0 @@ // Generate unique path

@@ -170,2 +170,25 @@ 'use strict';

/**
* Hash 'content'
* @param {Boolean} forWrite
* @returns {String}
*/
hashContent(forWrite = false) {
return forWrite
? md5(
// TODO: add header
[this, ...this.getAllDependencies()]
.reduce((contents, file) => {
contents.push(file.content);
// Include hashes of dynamic builds which are not yet inlined
if (file.dynamicDependencyReferences.length > 0) {
contents.push(...file.dynamicDependencyReferences.map(ref => ref.file.writeHash));
}
return contents;
}, [])
.join('')
)
: md5(this.content || this.fileContent);
}
/**
* Read and store file contents

@@ -172,0 +195,0 @@ * @param {Object} buildOptions

{
"name": "buddy",
"description": "A fast, simple build tool for web projects.",
"version": "6.13.6",
"version": "6.13.7",
"author": "popeindustries <alex@pope-industries.com>",

@@ -18,3 +18,3 @@ "keywords": [

"dependencies": {
"async": "2.4.1",
"async": "2.5.0",
"autoprefixer": "7.1.1",

@@ -36,7 +36,7 @@ "babel-core": "6.25.0",

"portscanner": "2.1.1",
"postcss": "6.0.2",
"postcss": "6.0.3",
"pretty-bytes": "4.0.2",
"recur-fs": "2.2.4",
"source-map": "0.5.6",
"uglify-js": "3.0.18"
"uglify-js": "3.0.20"
},

@@ -43,0 +43,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc