Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Commit

Permalink
Fix lint errors [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
brianloveswords committed Sep 19, 2012
1 parent f2ca519 commit 781bc1e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 12 additions & 0 deletions .jshintrc
@@ -0,0 +1,12 @@
{
"node": true,
"indent": 2,
"trailing": true,
"sub": true,
"white": true,
"laxbreak": true,
"noarg": true,
"undef": true,
"lastsemic": true,
"strict": false
}
8 changes: 2 additions & 6 deletions lib/bakery.js
Expand Up @@ -10,18 +10,16 @@ var util = require('util');
var streampng = require('streampng'); var streampng = require('streampng');
var KEYWORD = 'openbadges'; var KEYWORD = 'openbadges';



function createChunk(url) { function createChunk(url) {
return streampng.Chunk.tEXt({ return streampng.Chunk.tEXt({
keyword: KEYWORD, keyword: KEYWORD,
text: url text: url
}); });
} }


exports.bake = function(options, callback) { exports.bake = function bake(options, callback) {
var buffer = options.image; var buffer = options.image;
var png = streampng(buffer); var png = streampng(buffer);

// #TODO: make sure the url is set // #TODO: make sure the url is set
var chunk = createChunk(options.url); var chunk = createChunk(options.url);
var existingChunk; var existingChunk;
Expand All @@ -31,15 +29,13 @@ exports.bake = function(options, callback) {
return false; return false;
} }
}); });

if (existingChunk) { 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); var error = new Error(msg);
error.code = 'IMAGE_ALREADY_BAKED'; error.code = 'IMAGE_ALREADY_BAKED';
error.contents = existingChunk.text; error.contents = existingChunk.text;
return callback(error); return callback(error);
} }

return png.out(callback); return png.out(callback);
}; };


Expand Down

0 comments on commit 781bc1e

Please sign in to comment.