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

assetstream

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

assetstream - npm Package Compare versions

Comparing version 0.1.12 to 0.1.13

5

package.json
{
"name": "assetstream",
"version": "0.1.12",
"version": "0.1.13",
"description": "Stream and transform your browser assets.",

@@ -19,4 +19,5 @@ "repository": {

"mkdirp": "0.3.x",
"less": "1.4.x"
"less": "1.4.x",
"ferro": "0.2.x"
}
}

2

Source.js

@@ -29,3 +29,3 @@

if (error) {
self.emit('error', error);
console.error(ferro.stack(error));
} else if (self._assets) {

@@ -32,0 +32,0 @@ var lastIndex = self._assets.length - 1;

var Transform = require('stream').Transform;
var util = require('util');
var ferro = require('ferro');

@@ -25,6 +26,4 @@ util.inherits(AssetTransform, Transform);

if (error) {
console.error('Transform:', error.stack || error);
self.emit('error', error);
}
if (transformedAsset) {
console.error(ferro.stack(error));
} else if (transformedAsset) {
self.push(transformedAsset);

@@ -31,0 +30,0 @@ }

@@ -7,2 +7,3 @@

var path = require('path');
var ferro = require('ferro');
var SourceMapConsumer = require('source-map').SourceMapConsumer;

@@ -126,3 +127,3 @@ var SourceMapGenerator = require('source-map').SourceMapGenerator;

function bundleError(message) {
var error = new Error(message);
var error = ferro('BundleJavaScriptError', message);
if (bundleHasBeenBuilt) {

@@ -277,3 +278,6 @@ bundleCallback(error);

if (!asset.content.minified) {
callback(new Error('Can only bundle minified JavaScript modules.'));
callback(ferro(
'BundleJavaScriptError',
'Can only bundle minified JavaScript modules.'
));
return;

@@ -280,0 +284,0 @@ }

@@ -8,2 +8,3 @@

var isType = require('../../helper/isType');
var ferro = require('ferro');

@@ -37,3 +38,9 @@ function minifyJavaScriptAsset(cache, asset, callback) {

if (asset.event === 'update' && isType.javaScript(asset)) {
minifyJavaScriptAsset(cache, asset, callback);
minifyJavaScriptAsset(cache, asset, function(error, minifiedAsset) {
if (error) {
return callback(ferro('MinifyJavaScriptError', error));
}
callback(null, minifiedAsset);
});
} else {

@@ -40,0 +47,0 @@ callback(null, asset);

@@ -125,12 +125,20 @@

} catch (error) {
if (error instanceof UglifyJS.JS_Parse_Error) {
console.error('ERR: Parse error at ' + asset.path + ':' + error.line + ',' + error.col + ': ' + error.message + '\n' + error.stack);
} else {
console.error('ERR: Parse error at ' + asset.path + ':', error.stack || error);
var message = 'Failed to minify ' + asset.path;
if (error.line) {
message += ':' + error.line;
if (error.col) {
message += ':' + error.col;
}
}
if (error.message) {
message += ': ' + error.message;
}
var reportedError = new Error('Could not minify JS.');
reportedError.cause = error;
callback(reportedError, asset);
callback({
message: message,
path: asset.path,
line: error.line,
column: error.col
}, asset);
}
};
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