Finished adding JSDoc for src/utils

This commit is contained in:
rainbow napkin 2025-08-31 03:44:23 -04:00
parent 2303c89bcf
commit 7b8c44158f
12 changed files with 229 additions and 20 deletions

View file

@ -18,8 +18,16 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
const validator = require('validator');//No express here, so regular validator it is!
//Create link cache
/**
* Basic RAM-Based cache of links, so we don't have to re-pull things after we get them
*/
module.exports.cache = new Map();
/**
* Validates links and returns a marked link object that can be returned to the client to format/embed accordingly
* @param {String} link - URL to Validate
* @returns {Object} Marked link object
*/
module.exports.markLink = async function(link){
//Check link cache for the requested link
const cachedLink = module.exports.cache.get(link);