feat: generate emojis pre
This commit is contained in:
15
src/utils/index.ts
Normal file
15
src/utils/index.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { meat, staple, vegetable } from '~/data/food'
|
||||
|
||||
export function generateEmojisFromStuff(stuff: string[]) {
|
||||
const emojis: string[] = []
|
||||
stuff.forEach((item) => {
|
||||
const kinds = [vegetable, meat, staple]
|
||||
kinds.forEach((kind) => {
|
||||
kind.forEach((m) => {
|
||||
if (m.name === item)
|
||||
emojis.push(m.emoji)
|
||||
})
|
||||
})
|
||||
})
|
||||
return emojis
|
||||
}
|
||||
Reference in New Issue
Block a user