proper isNode detection for node v21.0.0

This commit is contained in:
David Fiala
2023-10-19 09:52:29 -07:00
committed by GitHub
parent 1c880f5199
commit 6c5fb36c36
+1 -1
View File
@@ -13,7 +13,7 @@ interface INavigator {
// we want this module to live in common.
declare const navigator: INavigator;
export const isNode = (typeof navigator === 'undefined') ? true : false;
export const isNode = (typeof process !== 'undefined') ? true : false;
const userAgent = (isNode) ? 'node' : navigator.userAgent;
const platform = (isNode) ? 'node' : navigator.platform;