MCPcopy
hub / github.com/typestyle/typestyle / classes

Function classes

src/internal/utilities.ts:22–28  ·  view source on GitHub ↗
(...classes: (string | false | undefined | null | { [className: string]: any })[])

Source from the content-addressed store, hash-verified

20 * Utility to join classes conditionally
21 */
22export function classes(...classes: (string | false | undefined | null | { [className: string]: any })[]): string {
23 return classes
24 .map(c => c && typeof c === 'object' ? Object.keys(c).map(key => !!c[key] && key) : [c])
25 .reduce((flattened, c) => flattened.concat(c), [] as string[])
26 .filter(c => !!c)
27 .join(' ');
28}
29
30/**
31 * Merges various styles into a single style object.

Callers 1

basic.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…