Home / Function/ shuffle() — tailwindcss Function Reference

shuffle() — tailwindcss Function Reference

Architecture documentation for the shuffle() function in sort.test.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  5f081d8f_0601_8d87_b12d_6f8d6337bee4["shuffle()"]
  35c3c06c_16c4_cf74_8db0_ff582227714d["sort.test.ts"]
  5f081d8f_0601_8d87_b12d_6f8d6337bee4 -->|defined in| 35c3c06c_16c4_cf74_8db0_ff582227714d
  style 5f081d8f_0601_8d87_b12d_6f8d6337bee4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/sort.test.ts lines 122–129

function shuffle<T>(arr: T[]): T[] {
  for (let i = arr.length - 1; i > 0; i--) {
    let j = Math.round(Math.random() * i)
    ;[arr[i], arr[j]] = [arr[j], arr[i]]
  }

  return arr
}

Domain

Subdomains

Frequently Asked Questions

What does shuffle() do?
shuffle() is a function in the tailwindcss codebase, defined in packages/tailwindcss/src/sort.test.ts.
Where is shuffle() defined?
shuffle() is defined in packages/tailwindcss/src/sort.test.ts at line 122.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free