page wrapper
This commit is contained in:
15
apps/website/lib/utils.ts
Normal file
15
apps/website/lib/utils.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Utility function to check if code is running on server or client
|
||||
* @returns true if running on server (SSR), false if running on client (browser)
|
||||
*/
|
||||
export function isServer(): boolean {
|
||||
return typeof window === 'undefined';
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility function to check if code is running on client
|
||||
* @returns true if running on client (browser), false if running on server (SSR)
|
||||
*/
|
||||
export function isClient(): boolean {
|
||||
return typeof window !== 'undefined';
|
||||
}
|
||||
Reference in New Issue
Block a user