Permalink
Browse files

Fix lint errors [ci skip]

  • Loading branch information...
1 parent f2ca519 commit 781bc1e6723e4267e22bcd5cd9e5d160328e28d1 @brianloveswords brianloveswords committed Sep 19, 2012
Showing with 14 additions and 6 deletions.
  1. +12 −0 .jshintrc
  2. +2 −6 lib/bakery.js
View
@@ -0,0 +1,12 @@
+{
+ "node": true,
+ "indent": 2,
+ "trailing": true,
+ "sub": true,
+ "white": true,
+ "laxbreak": true,
+ "noarg": true,
+ "undef": true,
+ "lastsemic": true,
+ "strict": false
+}
View
@@ -10,18 +10,16 @@ var util = require('util');
var streampng = require('streampng');
var KEYWORD = 'openbadges';
-
function createChunk(url) {
return streampng.Chunk.tEXt({
keyword: KEYWORD,
text: url
});
}
-exports.bake = function(options, callback) {
+exports.bake = function bake(options, callback) {
var buffer = options.image;
var png = streampng(buffer);
-
// #TODO: make sure the url is set
var chunk = createChunk(options.url);
var existingChunk;
@@ -31,15 +29,13 @@ exports.bake = function(options, callback) {
return false;
}
});
-
if (existingChunk) {
- var msg = util.format('This image already has a chunk with the `%s` keyword (contains: %j)', KEYWORD, chunk.text)
+ var msg = util.format('This image already has a chunk with the `%s` keyword (contains: %j)', KEYWORD, chunk.text);
var error = new Error(msg);
error.code = 'IMAGE_ALREADY_BAKED';
error.contents = existingChunk.text;
return callback(error);
}
-
return png.out(callback);
};

0 comments on commit 781bc1e

Please sign in to comment.