summaryrefslogtreecommitdiff
path: root/docs/src/components/Examples/Functions/get-hero-img.js
diff options
context:
space:
mode:
Diffstat (limited to 'docs/src/components/Examples/Functions/get-hero-img.js')
-rw-r--r--docs/src/components/Examples/Functions/get-hero-img.js18
1 files changed, 0 insertions, 18 deletions
diff --git a/docs/src/components/Examples/Functions/get-hero-img.js b/docs/src/components/Examples/Functions/get-hero-img.js
deleted file mode 100644
index 8ed1ac9b3..000000000
--- a/docs/src/components/Examples/Functions/get-hero-img.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import fs from 'node:fs/promises'
-import randomIndex from './random-index'
-
-
-/**
- * getHeroImg
- * @returns url of random Hero Image from './public/images'
- */
-export default async function getHeroImg(){
- try {
- const data =[]
- const paths =await fs.readdir('./public/images',{filesOnly:true})
- paths.map(path=>data.push(`/images/${path}`))
- return data[randomIndex(paths.length)]
- } catch (error) {
- console.log(error)
- }
-}