Skip to content

Commit

Permalink
use es6 declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
chris48s committed Dec 31, 2017
1 parent 4dc1fa2 commit 2e80a95
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1687,10 +1687,10 @@ cache(function(data, match, sendBadge, request) {
// CDNJS version integration
camp.route(/^\/cdnjs\/v\/(.*)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var library = encodeURIComponent(match[1]); // eg, "express" or "@user/express"
var format = match[2];
var apiUrl = 'https://api.cdnjs.com/libraries/' + library + '?fields=version';
var badgeData = getBadgeData('cdnjs', data);
const library = encodeURIComponent(match[1]); // eg, "express" or "@user/express"
const format = match[2];
const apiUrl = 'https://api.cdnjs.com/libraries/' + library + '?fields=version';
const badgeData = getBadgeData('cdnjs', data);
request(apiUrl, function(err, res, buffer) {
if (err != null) {
badgeData.text[1] = 'inaccessible';
Expand Down

0 comments on commit 2e80a95

Please sign in to comment.