From 4c5bc13c7fe86e7e45638c5f26899e8891238747 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Wed, 24 Sep 2014 19:11:53 +0200 Subject: [PATCH] Check style fixes --- lib/cartodb/template_maps.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/cartodb/template_maps.js b/lib/cartodb/template_maps.js index c5ca91d4..8e61a42c 100644 --- a/lib/cartodb/template_maps.js +++ b/lib/cartodb/template_maps.js @@ -38,7 +38,7 @@ function TemplateMaps(redis_pool, signed_maps, opts) { // // We have the following datastores: // - // 1. User teplates: set of per-user map templates + // 1. User templates: set of per-user map templates // NOTE: each template would have an associated auth // reference, see signed_maps.js @@ -150,7 +150,7 @@ o._checkInvalidTemplate = function(template) { if ( ! phold[k].hasOwnProperty('type') ) { return new Error("Missing type for placeholder '" + k + "'"); } - }; + } // Check certificate validity var cert = this.getTemplateCertificate(template); @@ -168,12 +168,11 @@ o._checkInvalidTemplate = function(template) { // SignedMaps.addCertificate or SignedMaps.authorizedByCert // o.getTemplateCertificate = function(template) { - var cert = { - version: '0.0.1', - template_id: template.name, - auth: template.auth + return { + version: '0.0.1', + template_id: template.name, + auth: template.auth }; - return cert; }; // Add a template @@ -519,9 +518,8 @@ o.getTemplate = function(owner, tpl_id, callback) { }, function parseTemplate(err, tpl_val) { if ( err ) throw err; - var tpl = JSON.parse(tpl_val); // Should we strip auth_id ? - return tpl; + return JSON.parse(tpl_val); }, function finish(err, tpl) { callback(err, tpl);