Merge pull request #4851 from davidfiala/fix-xterm-node21

proper isNode detection for node v21.0.0
This commit is contained in:
Daniel Imms
2023-10-19 11:38:49 -07:00
committed by GitHub
+2 -1
View File
@@ -12,8 +12,9 @@ interface INavigator {
// We're declaring a navigator global here as we expect it in all runtimes (node and browser), but
// we want this module to live in common.
declare const navigator: INavigator;
declare const process: unknown;
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;