provide a declaration for 'process' needed for nodejs detect

We provide no further type information as it will not be used except for a presence check for nodejs detection.
This commit is contained in:
David Fiala
2023-10-19 11:19:27 -07:00
committed by GitHub
parent 6c5fb36c36
commit 0d0166b4bc
+1
View File
@@ -12,6 +12,7 @@ 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 process !== 'undefined') ? true : false;
const userAgent = (isNode) ? 'node' : navigator.userAgent;