From 27123e215a8f505bac1a0575d9ded30c4c886abe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zlatan=20Vasovi=C4=87?= Date: Sun, 2 Oct 2016 06:49:50 +0200 Subject: [PATCH] Fix build-index.js coding style (#1101) - Use single quotes consistently - Insert space before parenthesis in anonymous function declarations --- scripts/build-index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/build-index.js b/scripts/build-index.js index 5c3992ba4..98a62bf01 100644 --- a/scripts/build-index.js +++ b/scripts/build-index.js @@ -1,6 +1,6 @@ 'use strict'; -var glob = require("glob"); +var glob = require('glob'); function parsePlatform(pagefile) { return pagefile.split(/\//)[1]; @@ -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]) { @@ -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] @@ -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);