rwsdk
Version:
Build fast, server-driven webapps on Cloudflare with SSR, RSC, and realtime
8 lines (7 loc) • 371 B
text/typescript
/**
* Efficiently checks if a React directive (e.g., "use server", "use client")
* is present in the code. Optimized for performance with a two-step approach:
* 1. Quick string search to see if directive exists anywhere
* 2. Line-by-line check only if the directive might be present
*/
export declare function hasDirective(code: string, directive: string): boolean;