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

gulp.spritesmith

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp.spritesmith - npm Package Compare versions

Comparing version 4.1.2 to 4.2.0

2

CHANGELOG.md
# gulp.spritesmith changelog
4.2.0 - Moved to emitting errors rather than assert to be more gulp-like. Fixes #73
4.1.2 - Added `foundry` for release

@@ -3,0 +5,0 @@

36

lib/gulp-spritesmith.js

@@ -153,6 +153,13 @@ // Load our dependencies

// If we have a different amount of normal and retina images, complain and leave
assert(images.length === retinaImages.length,
'Retina settings detected but ' + retinaImages.length + ' retina images were found. ' +
'We have ' + images.length + ' normal images and expect these numbers to line up. ' +
'Please double check `retinaSrcFilter`.');
if (images.length !== retinaImages.length) {
var err = new Error('Retina settings detected but ' + retinaImages.length + ' retina images were found. ' +
'We have ' + images.length + ' normal images and expect these numbers to line up. ' +
'Please double check `retinaSrcFilter`.');
err.images = images;
err.retinaImages = retinaImages;
this.emit('error', err);
imgStream.push(null);
cssStream.push(null);
return cb();
}
}

@@ -286,9 +293,15 @@

// Generate groups for our coordinates
var errorEncountered = false;
retinaGroups = cleanCoords.map(function getRetinaGroups (normalSprite, i) {
// Assert that image sizes line up for debugging purposes
var retinaSprite = retinaCleanCoords[i];
assert(retinaSprite.width === normalSprite.width * 2 && retinaSprite.height === normalSprite.height * 2,
'Normal sprite has inconsistent size with retina sprite. ' +
'"' + normalSprite.name + '" is ' + normalSprite.width + 'x' + normalSprite.height + ' while ' +
'"' + retinaSprite.name + '" is ' + retinaSprite.width + 'x' + retinaSprite.height + '.');
if (retinaSprite.width !== normalSprite.width * 2 || retinaSprite.height !== normalSprite.height * 2) {
errorEncountered = true;
var err = new Error('Normal sprite has inconsistent size with retina sprite. ' +
'"' + normalSprite.name + '" is ' + normalSprite.width + 'x' + normalSprite.height + ' while ' +
'"' + retinaSprite.name + '" is ' + retinaSprite.width + 'x' + retinaSprite.height + '.');
err.normalSprite = normalSprite;
err.retinaSprite = retinaSprite;
that.emit('error', err);
}

@@ -302,2 +315,9 @@ // Generate our group

});
// If there was an error, then bail out
if (errorEncountered) {
imgStream.push(null);
cssStream.push(null);
return cb();
}
}

@@ -304,0 +324,0 @@

{
"name": "gulp.spritesmith",
"description": "Convert a set of images into a spritesheet and CSS variables via gulp",
"version": "4.1.2",
"version": "4.2.0",
"homepage": "https://github.com/twolfson/gulp.spritesmith",

@@ -6,0 +6,0 @@ "author": {

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