-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtools.js
27 lines (25 loc) · 956 Bytes
/
tools.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
* @Author: ltinerary
* @Date: 2023-03-27 07:00:59
* @LastEditTime: 2023-03-27 08:16:11
* @LastEditors: ltinerary
* @FilePath: /janet9527/tools.js
* @Description: 🎉🎉🎉
*/
const emjoiList = ['🤠', '🦒', '🦞', '🤩', '🍉', '🍓', '🐬', '🔔', '🎈', '✨', '📞', '🪸', '🏮', '🧱', '🍔', '🥩', '🍥', '🍨', '🧁', '🍰', '🍭', '🍒', '🌺', '🦢', '🍿', '🍑', '🍅', '🚕', '🚘', '🚖', '🚲', '🛵', '🚈', '🚊', '🛫', '🛰️', '🛸', '🚀', '🚁', '🚢', '🛟', '🌸', '🌶️', '🍄', '🏖️', '🏝️', '🫧', '🌈']
const emjoiLen = emjoiList.length;
const getRandom = (n, m) => {
return Math.floor(Math.random() * (m - n + 1) + n)
}
const getEmjoi = () => {
const index = getRandom(0, emjoiLen - 1);
return emjoiList[index]
}
const getImgeName = (url)=>{
return url.replace(/.+\./,"")
}
module.exports = {
getEmjoi,
getRandom,
getImgeName
};