Skip to content

Commit

Permalink
Fix build-index.js coding style (tldr-pages#1101)
Browse files Browse the repository at this point in the history
- Use single quotes consistently
- Insert space before parenthesis in anonymous function declarations
  • Loading branch information
zlatanvasovic authored and agnivade committed Oct 2, 2016
1 parent 7555812 commit 27123e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/build-index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var glob = require("glob");
var glob = require('glob');

function parsePlatform(pagefile) {
return pagefile.split(/\//)[1];
Expand All @@ -11,7 +11,7 @@ function parsePagename(pagefile) {
}

function buildShortPagesIndex(files) {
var reducer = function(index, file) {
var reducer = function (index, file) {
var os = parsePlatform(file);
var page = parsePagename(file);
if (index[page]) {
Expand All @@ -28,7 +28,7 @@ function buildShortPagesIndex(files) {
function buildPagesIndex(shortIndex) {
return Object.keys(shortIndex)
.sort()
.map(function(page) {
.map(function (page) {
return {
name: page,
platform: shortIndex[page]
Expand All @@ -43,7 +43,7 @@ function saveIndex(index) {
console.log(JSON.stringify(indexFile));
}

glob("pages/**/*.md", function (er, files) {
glob('pages/**/*.md', function (er, files) {
var shortIndex = buildShortPagesIndex(files);
var index = buildPagesIndex(shortIndex);
saveIndex(index);
Expand Down

0 comments on commit 27123e2

Please sign in to comment.