From 8cdfb92e12bd1ec209d0cadcff0022230546c20a Mon Sep 17 00:00:00 2001 From: Brogan Clements Date: Fri, 3 Dec 2021 15:08:05 -0500 Subject: [PATCH] Add docstring to getMediaFromDirectory --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index fc48ffc..69e22fe 100644 --- a/index.js +++ b/index.js @@ -159,6 +159,11 @@ function getFilesFromDir(dir) { .map((file) => path.join(dir, file)); } +/** + * Retrieves the folder name from a string representing a directory and file + * @param {String} dir A string representing a directory in the format "./directory/file" + * @returns {String} The extracted directory name + */ function getMediaFromDirectory(dir) { const slash = dir.lastIndexOf("/"); let mediaType = dir.slice(2, slash);