mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-23 23:27:09 +00:00
Add contributors list
This commit is contained in:
@@ -322,6 +322,16 @@ export async function writeZip(entries: [string, string][]): Promise<string> {
|
||||
return await writer.close()
|
||||
}
|
||||
|
||||
export function shuffle<T>(array: T[]) {
|
||||
let i = array.length
|
||||
while (i != 0) {
|
||||
const j = Math.floor(Math.random() * i)
|
||||
i -= 1;
|
||||
[array[i], array[j]] = [array[j], array[i]]
|
||||
}
|
||||
return array
|
||||
}
|
||||
|
||||
export function computeIfAbsent<K, V>(map: Map<K, V>, key: K, getter: (key: K) => V): V {
|
||||
const existing = map.get(key)
|
||||
if (existing) {
|
||||
|
||||
Reference in New Issue
Block a user