Add docstring to getLangFromFilename

pull/3/head
Brogan Clements 2021-12-03 15:10:35 -05:00
parent 8cdfb92e12
commit 17699bb3b9
1 changed files with 6 additions and 1 deletions

View File

@ -130,7 +130,12 @@ function parseListItem(listItem) {
return entry; 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) { function getLangFromFilename(filename) {
const dash = filename.lastIndexOf("-"); const dash = filename.lastIndexOf("-");
const dot = filename.lastIndexOf("."); const dot = filename.lastIndexOf(".");