mirror of
https://github.com/imezx/Warp.git
synced 2025-04-24 15:10:03 +00:00
11 lines
No EOL
227 B
JavaScript
11 lines
No EOL
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;
|
|
} |