1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-05 13:35:23 +02:00

feature/profile-cards (#391)

* unify format

* pass variables

* remove namespace

* rename

* group-card init

* shuffle + icons

* remove console.logs

* token CRUD

* update changelog

* add profile link

* consolidate mealplan to profile dashboard

* update docs

* add query parameter to search page

* update test routes

* update python depts

* basic token tests

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden 2021-05-06 21:08:27 -08:00 committed by GitHub
parent f4384167f6
commit 95ec13161f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 977 additions and 449 deletions

View file

@ -28,4 +28,22 @@ export const recipe = {
randomRecipe(list) {
return list[Math.floor(Math.random() * list.length)];
},
shuffle(list) {
let last = list.length;
let n;
while (last > 0) {
n = rand(last);
swap(list, n, --last);
}
},
};
const rand = n =>
Math.floor(Math.random() * n)
function swap(t, i, j) {
let q = t[i];
t[i] = t[j];
t[j] = q;
return t;
}