mirror of
https://github.com/imezx/Warp.git
synced 2025-04-25 07:30:02 +00:00
11 lines
227 B
JavaScript
11 lines
227 B
JavaScript
|
/**
|
||
|
* Safely runs code meant for browser environments only.
|
||
|
*/
|
||
|
export function safelyRunOnBrowser(callback) {
|
||
|
if (typeof window !== 'undefined') {
|
||
|
return callback({
|
||
|
window: window
|
||
|
});
|
||
|
}
|
||
|
return undefined;
|
||
|
}
|