diff --git a/server/util/getUserByUsername.js b/server/util/getUserByUsername.js new file mode 100644 index 0000000..6ca0b3f --- /dev/null +++ b/server/util/getUserByUsername.js @@ -0,0 +1,10 @@ +module.exports = function(username) { + let user = null; + for (let i = 0; i < global.users.length; i++) { + if (global.users[i].username == username) { + user = global.users[i]; + break; + } + } + return user; +} \ No newline at end of file