Home / Function/ parseObjectLiteralExpression() — ui Function Reference

parseObjectLiteralExpression() — ui Function Reference

Architecture documentation for the parseObjectLiteralExpression() function in update-tailwind-config.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  2bbe4a89_5776_ed01_9450_72290f2a14b4["parseObjectLiteralExpression()"]
  ef3e192c_eced_bc46_1021_689faf6b7065["update-tailwind-config.ts"]
  2bbe4a89_5776_ed01_9450_72290f2a14b4 -->|defined in| ef3e192c_eced_bc46_1021_689faf6b7065
  c5708093_d860_eaff_f0d3_0bcb8e1daa1e["parseObjectLiteral()"]
  c5708093_d860_eaff_f0d3_0bcb8e1daa1e -->|calls| 2bbe4a89_5776_ed01_9450_72290f2a14b4
  1b6e7fa0_bc96_f8a7_a3f6_05f58cecf28a["parseArrayLiteralExpression()"]
  1b6e7fa0_bc96_f8a7_a3f6_05f58cecf28a -->|calls| 2bbe4a89_5776_ed01_9450_72290f2a14b4
  10fab5e6_630a_34e4_e8b9_4929f6ad1c76["parseValue()"]
  10fab5e6_630a_34e4_e8b9_4929f6ad1c76 -->|calls| 2bbe4a89_5776_ed01_9450_72290f2a14b4
  1b6e7fa0_bc96_f8a7_a3f6_05f58cecf28a["parseArrayLiteralExpression()"]
  2bbe4a89_5776_ed01_9450_72290f2a14b4 -->|calls| 1b6e7fa0_bc96_f8a7_a3f6_05f58cecf28a
  10fab5e6_630a_34e4_e8b9_4929f6ad1c76["parseValue()"]
  2bbe4a89_5776_ed01_9450_72290f2a14b4 -->|calls| 10fab5e6_630a_34e4_e8b9_4929f6ad1c76
  style 2bbe4a89_5776_ed01_9450_72290f2a14b4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/shadcn/src/utils/updaters/update-tailwind-config.ts lines 436–459

function parseObjectLiteralExpression(node: ObjectLiteralExpression): any {
  const result: any = {}
  for (const property of node.getProperties()) {
    if (property.isKind(SyntaxKind.PropertyAssignment)) {
      const name = property.getName().replace(/\'/g, "")
      if (
        property.getInitializer()?.isKind(SyntaxKind.ObjectLiteralExpression)
      ) {
        result[name] = parseObjectLiteralExpression(
          property.getInitializer() as ObjectLiteralExpression
        )
      } else if (
        property.getInitializer()?.isKind(SyntaxKind.ArrayLiteralExpression)
      ) {
        result[name] = parseArrayLiteralExpression(
          property.getInitializer() as ArrayLiteralExpression
        )
      } else {
        result[name] = parseValue(property.getInitializer())
      }
    }
  }
  return result
}

Subdomains

Frequently Asked Questions

What does parseObjectLiteralExpression() do?
parseObjectLiteralExpression() is a function in the ui codebase, defined in packages/shadcn/src/utils/updaters/update-tailwind-config.ts.
Where is parseObjectLiteralExpression() defined?
parseObjectLiteralExpression() is defined in packages/shadcn/src/utils/updaters/update-tailwind-config.ts at line 436.
What does parseObjectLiteralExpression() call?
parseObjectLiteralExpression() calls 2 function(s): parseArrayLiteralExpression, parseValue.
What calls parseObjectLiteralExpression()?
parseObjectLiteralExpression() is called by 3 function(s): parseArrayLiteralExpression, parseObjectLiteral, parseValue.

Analyze Your Own Codebase

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

Try Supermodel Free