From 30976671de993b613e49dc815922b492ec67f1c5 Mon Sep 17 00:00:00 2001 From: Jake Date: Sun, 19 Oct 2014 15:40:56 -0500 Subject: [PATCH] Fix indentation --- skins.js | 100 +++++++++++++++++++++++++++---------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/skins.js b/skins.js index fae3ad1..5138b1e 100644 --- a/skins.js +++ b/skins.js @@ -9,56 +9,56 @@ var lwip = require('lwip'); * https://github.com/jomo/Crafatar */ module.exports = { - get_profile: function(uuid, callback) { - https.get("https://sessionserver.mojang.com/session/minecraft/profile/" + uuid, function(res) { - if (res.statusCode == "204") { - callback(null); - return null; - } - res.on('data', function(d) { - var profile = JSON.parse(d); - if (profile.error) callback(null); - callback(profile); - }); - - }).on('error', function(e) { - console.error(e); - }); - }, + get_profile: function(uuid, callback) { + https.get("https://sessionserver.mojang.com/session/minecraft/profile/" + uuid, function(res) { + if (res.statusCode == "204") { + callback(null); + return null; + } + res.on('data', function(d) { + var profile = JSON.parse(d); + if (profile.error) callback(null); + callback(profile); + }); + + }).on('error', function(e) { + console.error(e); + }); + }, - skin_url: function(profile) { - var url = null; - if (profile && profile.properties) { - profile.properties.forEach(function(prop) { - if (prop.name == 'textures') { - var json = Buffer(prop.value, 'base64').toString(); - var props = JSON.parse(json); - url = props.textures.SKIN.url; - } - }); - } - return url; - }, + skin_url: function(profile) { + var url = null; + if (profile && profile.properties) { + profile.properties.forEach(function(prop) { + if (prop.name == 'textures') { + var json = Buffer(prop.value, 'base64').toString(); + var props = JSON.parse(json); + url = props.textures.SKIN.url; + } + }); + } + return url; + }, - skin_file: function(url, filename, callback) { - var file = fs.createWriteStream(filename); - http.get(url, function(res) { - res.on('data', function(data) { - file.write(data); - }).on('end', function() { - file.end(); - callback(); - }); - }); - }, - extract_face: function(infile, size, callback) { - lwip.open(infile, function(err, image){ - image.batch() - .crop(8,8,15,15) - .resize(size, size, "nearest-neighbor") - .toBuffer('png', function(err, buffer){ - callback(buffer); - }); - }); - } + skin_file: function(url, filename, callback) { + var file = fs.createWriteStream(filename); + http.get(url, function(res) { + res.on('data', function(data) { + file.write(data); + }).on('end', function() { + file.end(); + callback(); + }); + }); + }, + extract_face: function(infile, size, callback) { + lwip.open(infile, function(err, image){ + image.batch() + .crop(8,8,15,15) + .resize(size, size, "nearest-neighbor") + .toBuffer('png', function(err, buffer){ + callback(buffer); + }); + }); + } }; \ No newline at end of file