Extend random and roll syntax for frontend compatibility

This commit is contained in:
Cohee
2023-08-08 22:36:42 +03:00
parent ef3a9a810e
commit 2fea218661
2 changed files with 14 additions and 4 deletions

View File

@ -4,6 +4,10 @@ export function onlyUnique(value, index, array) {
return array.indexOf(value) === index;
}
export function isDigitsOnly(str) {
return /^\d+$/.test(str);
}
export function shuffle(array) {
let currentIndex = array.length,
randomIndex;