From 3574e29d1a82fc4676126fa4bc0efbeed8008e32 Mon Sep 17 00:00:00 2001 From: Max Wofford Date: Sat, 17 Aug 2024 11:06:56 -0400 Subject: [PATCH] Run formatter on random image generator --- .../arcade/showcase/random-not-found-img.js | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/components/arcade/showcase/random-not-found-img.js b/components/arcade/showcase/random-not-found-img.js index 302fa881..f49a6125 100644 --- a/components/arcade/showcase/random-not-found-img.js +++ b/components/arcade/showcase/random-not-found-img.js @@ -1,14 +1,19 @@ const notFoundImgs = [ - "https://cloud-6laa73jem-hack-club-bot.vercel.app/0not_found5.png", - "https://cloud-6laa73jem-hack-club-bot.vercel.app/1not_found4.png", - "https://cloud-6laa73jem-hack-club-bot.vercel.app/2not_found3.png", - "https://cloud-6laa73jem-hack-club-bot.vercel.app/3not_found2.png", - "https://cloud-6laa73jem-hack-club-bot.vercel.app/4not_found1.png", + 'https://cloud-6laa73jem-hack-club-bot.vercel.app/0not_found5.png', + 'https://cloud-6laa73jem-hack-club-bot.vercel.app/1not_found4.png', + 'https://cloud-6laa73jem-hack-club-bot.vercel.app/2not_found3.png', + 'https://cloud-6laa73jem-hack-club-bot.vercel.app/3not_found2.png', + 'https://cloud-6laa73jem-hack-club-bot.vercel.app/4not_found1.png' ] -const hashCode = s => s.split('').reduce((a,b)=>{a=((a<<5)-a)+b.charCodeAt(0);return a&a},0) -const randomNotFoundImg = (key) => { +const hashCode = (s='key') => + s.split('').reduce((a, b) => { + a = (a << 5) - a + b.charCodeAt(0) + return a & a + }, 0) + +const randomNotFoundImg = key => { return notFoundImgs[hashCode(key) % notFoundImgs.length] } -export default randomNotFoundImg \ No newline at end of file +export default randomNotFoundImg