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

Function classNameSubsetMatch

packages/cli/src/batch-transform.ts:196–201  ·  view source on GitHub ↗

Check if AST static classes are a subset of the DOM classes provided.

(astClasses: string[], domClassName: string)

Source from the content-addressed store, hash-verified

194
195/** Check if AST static classes are a subset of the DOM classes provided. */
196function classNameSubsetMatch(astClasses: string[], domClassName: string): boolean {
197 if (astClasses.length === 0) return false;
198 const domClasses = domClassName.split(/\s+/).filter(Boolean);
199 // All AST classes should appear in DOM classes
200 return astClasses.every((c) => domClasses.includes(c));
201}
202
203/**
204 * Compute the nth-of-type index (0-based) for a JSX element among its

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected