Skip to content

Commit

Permalink
Make process node check stricter
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Mar 16, 2024
1 parent 47409f3 commit 37efeeb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/Platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface INavigator {
declare const navigator: INavigator;
declare const process: unknown;

export const isNode = (typeof process !== 'undefined') ? true : false;
export const isNode = (typeof process !== 'undefined' && 'title' in (process as any)) ? true : false;
const userAgent = (isNode) ? 'node' : navigator.userAgent;
const platform = (isNode) ? 'node' : navigator.platform;

Expand Down

0 comments on commit 37efeeb

Please sign in to comment.