From 17699bb3b9bcf737b39595f8140f9b34d792824a Mon Sep 17 00:00:00 2001 From: Brogan Clements Date: Fri, 3 Dec 2021 15:10:35 -0500 Subject: [PATCH] Add docstring to getLangFromFilename --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 69e22fe..fef1259 100644 --- a/index.js +++ b/index.js @@ -130,7 +130,12 @@ function parseListItem(listItem) { return entry; } -// from free-programming-books-lint +/** + * Determines the language a certain file is based on the format + * from the FreeEbookFoundation GitHub page + * @param {String} filename A filename in the format kept by all markdown files on the FreeProgrammingBooks Github + * @returns {String} The language the file is + */ function getLangFromFilename(filename) { const dash = filename.lastIndexOf("-"); const dot = filename.lastIndexOf(".");