Home / Function/ get() — tailwindcss Function Reference

get() — tailwindcss Function Reference

Architecture documentation for the get() function in plugin-functions.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  fc2ae801_cb46_a61e_e1f0_f0d633f4f67e["get()"]
  67fcef46_defb_2c9b_ab9b_59ae912b91f5["createThemeFn()"]
  67fcef46_defb_2c9b_ab9b_59ae912b91f5 -->|calls| fc2ae801_cb46_a61e_e1f0_f0d633f4f67e
  57934fd1_bd18_f9cc_3777_870ee6aa0bf0["readFromCss()"]
  57934fd1_bd18_f9cc_3777_870ee6aa0bf0 -->|calls| fc2ae801_cb46_a61e_e1f0_f0d633f4f67e
  0aa64a1c_efd8_a69d_48ed_649b7a86c854["get()"]
  fc2ae801_cb46_a61e_e1f0_f0d633f4f67e -->|calls| 0aa64a1c_efd8_a69d_48ed_649b7a86c854
  style fc2ae801_cb46_a61e_e1f0_f0d633f4f67e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/compat/plugin-functions.ts lines 222–245

function get(obj: any, path: string[]) {
  for (let i = 0; i < path.length; ++i) {
    let key = path[i]

    // The key does not exist so concatenate it with the next key
    if (obj?.[key] === undefined) {
      if (path[i + 1] === undefined) {
        return undefined
      }

      path[i + 1] = `${key}-${path[i + 1]}`
      continue
    }

    // We never want to index into strings
    if (typeof obj === 'string') {
      return undefined
    }

    obj = obj[key]
  }

  return obj
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does get() do?
get() is a function in the tailwindcss codebase.
What does get() call?
get() calls 1 function(s): get.
What calls get()?
get() is called by 2 function(s): createThemeFn, readFromCss.

Analyze Your Own Codebase

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

Try Supermodel Free