Files
docs/node_modules/@algolia/autocomplete-shared/dist/esm/safelyRunOnBrowser.js
yinxue 9e1b8bdc9d
Some checks failed
CI Pipeline / build (push) Failing after 3m23s
first-commit
2025-08-27 14:05:33 +08:00

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;
}