refactor: replace own shuffle function with external froebel shuffle

master
Katja Lutz 2 years ago
parent b5530130ef
commit 0462e70229

@ -33,9 +33,8 @@ import {
getDomain,
getHost,
onClickFocus,
shuffle,
} from "~/util";
import { capitalize } from "froebel";
import { capitalize, shuffle } from "froebel";
import { markdownHelpUrl } from "./Markdown";
import AgileCalculator from "./AgileCalculator";

@ -46,18 +46,6 @@ export const resetInput =
el.dispatchEvent(event);
};
// https://dev.to/codebubb/how-to-shuffle-an-array-in-javascript-2ikj
export const shuffle = (list: any[]) => {
for (let i = list.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
const temp = list[i];
list[i] = list[j];
list[j] = temp;
}
return list;
};
export const getDomain = () =>
import.meta.env.SSR ? process.env.DOMAIN || "localhost" : location.hostname;

Loading…
Cancel
Save