Home / File/ env.ts — tailwindcss Source File

env.ts — tailwindcss Source File

Architecture documentation for env.ts, a typescript file in the tailwindcss codebase. 0 imports, 2 dependents.

File typescript NodeServer Resolver 2 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  8a0c5151_23cc_8e52_a43f_4b6b9c7d2706["env.ts"]
  053a1720_4def_9dd0_2fcc_5c8d2739f15d["index.ts"]
  053a1720_4def_9dd0_2fcc_5c8d2739f15d --> 8a0c5151_23cc_8e52_a43f_4b6b9c7d2706
  bd16b7ea_bbf0_4269_b855_66ce2c516e3e["instrumentation.ts"]
  bd16b7ea_bbf0_4269_b855_66ce2c516e3e --> 8a0c5151_23cc_8e52_a43f_4b6b9c7d2706
  style 8a0c5151_23cc_8e52_a43f_4b6b9c7d2706 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

export const DEBUG = resolveDebug(process.env.DEBUG)

function resolveDebug(debug: typeof process.env.DEBUG) {
  if (typeof debug === 'boolean') {
    return debug
  }

  if (debug === undefined) {
    return false
  }

  // Environment variables are strings, so convert to boolean
  if (debug === 'true' || debug === '1') {
    return true
  }

  if (debug === 'false' || debug === '0') {
    return false
  }

  // Keep the debug convention into account:
  // DEBUG=* -> This enables all debug modes
  // DEBUG=projectA,projectB,projectC -> This enables debug for projectA, projectB and projectC
  // DEBUG=projectA:* -> This enables all debug modes for projectA (if you have sub-types)
  // DEBUG=projectA,-projectB -> This enables debug for projectA and explicitly disables it for projectB

  if (debug === '*') {
    return true
  }

  let debuggers = debug.split(',').map((d) => d.split(':')[0])

  // Ignoring tailwindcss
  if (debuggers.includes('-tailwindcss')) {
    return false
  }

  // Including tailwindcss
  if (debuggers.includes('tailwindcss')) {
    return true
  }

  return false
}

Domain

Subdomains

Functions

Frequently Asked Questions

What does env.ts do?
env.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the NodeServer domain, Resolver subdomain.
What functions are defined in env.ts?
env.ts defines 1 function(s): resolveDebug.
What files import env.ts?
env.ts is imported by 2 file(s): index.ts, instrumentation.ts.
Where is env.ts in the architecture?
env.ts is located at packages/@tailwindcss-node/src/env.ts (domain: NodeServer, subdomain: Resolver, directory: packages/@tailwindcss-node/src).

Analyze Your Own Codebase

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

Try Supermodel Free