Home / Class/ DefaultMap Class — tailwindcss Architecture

DefaultMap Class — tailwindcss Architecture

Architecture documentation for the DefaultMap class in index.ts from the tailwindcss codebase.

Entity Profile

Source Code

packages/@tailwindcss-vite/src/index.ts lines 230–245

class DefaultMap<K, V> extends Map<K, V> {
  constructor(private factory: (key: K, self: DefaultMap<K, V>) => V) {
    super()
  }

  get(key: K): V {
    let value = super.get(key)

    if (value === undefined) {
      value = this.factory(key, this)
      this.set(key, value)
    }

    return value
  }
}

Analyze Your Own Codebase

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

Try Supermodel Free