diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-01-19 13:21:33 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-12-22 15:00:30 +0100 |
commit | 6568acc992edf405b976a88e3c8abad82fdfd91d (patch) | |
tree | 2173f3cd58b63f02af0f0da968bae4f13d4db21b /packages/gitbook-markdown/lib/langs.js | |
parent | b79f27cee7e601966caf1cef73b3b6222cb69fa0 (diff) | |
download | gitbook-6568acc992edf405b976a88e3c8abad82fdfd91d.zip gitbook-6568acc992edf405b976a88e3c8abad82fdfd91d.tar.gz gitbook-6568acc992edf405b976a88e3c8abad82fdfd91d.tar.bz2 |
Directly return list of langs
Diffstat (limited to 'packages/gitbook-markdown/lib/langs.js')
-rw-r--r-- | packages/gitbook-markdown/lib/langs.js | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/packages/gitbook-markdown/lib/langs.js b/packages/gitbook-markdown/lib/langs.js index 4b2a9a9..86da75a 100644 --- a/packages/gitbook-markdown/lib/langs.js +++ b/packages/gitbook-markdown/lib/langs.js @@ -5,20 +5,18 @@ var parseEntries = require("./summary").entries; var parseLangs = function(content) { var entries = parseEntries(content); - return { - list: _.chain(entries) - .filter(function(entry) { - return Boolean(entry.path); - }) - .map(function(entry) { - return { - title: entry.title, - path: entry.path, - lang: entry.path.replace("/", "") - }; - }) - .value() - }; + return _.chain(entries) + .filter(function(entry) { + return Boolean(entry.path); + }) + .map(function(entry) { + return { + title: entry.title, + path: entry.path, + lang: entry.path.replace("/", "") + }; + }) + .value(); }; module.exports = parseLangs; |