MCPcopy Create free account
hub / github.com/cloudflare/serverless-registry / shuffleArray

Function shuffleArray

test/index.test.ts:106–113  ·  view source on GitHub ↗
(array: T[])

Source from the content-addressed store, hash-verified

104}
105
106function shuffleArray<T>(array: T[]) {
107 for (let i = array.length - 1; i > 0; i--) {
108 const j = Math.floor(Math.random() * (i + 1));
109 [array[i], array[j]] = [array[j], array[i]];
110 }
111
112 return array;
113}
114
115function parseLinkHeaderURL(link: string): URL {
116 const rawURL = link.split(";")[0].trim();

Callers 1

index.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected