MCPcopy Create free account
hub / github.com/donghaxkim/react-rewrite / buildClass

Function buildClass

packages/cli/src/transform.ts:277–284  ·  view source on GitHub ↗

* Build the target class string from an update descriptor.

(update: ClassNameUpdate)

Source from the content-addressed store, hash-verified

275 * Build the target class string from an update descriptor.
276 */
277function buildClass(update: ClassNameUpdate): string {
278 if (update.standalone) {
279 return update.tailwindToken ?? `${update.tailwindPrefix}-[${update.value}]`;
280 }
281 return update.tailwindToken
282 ? `${update.tailwindPrefix}-${update.tailwindToken}`
283 : `${update.tailwindPrefix}-[${update.value}]`;
284}
285
286/**
287 * Check whether a class string matches a given Tailwind prefix.

Callers 2

applyUpdateFunction · 0.85
mutateClassNameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected