Skip to content

Commit

Permalink
Fix isomorphy, fix #254
Browse files Browse the repository at this point in the history
  • Loading branch information
terehov committed Aug 6, 2023
1 parent c4dc319 commit 155407f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class Logger<LogObj> extends BaseLogger<LogObj> {
// style only for blink browsers
settings.stylePrettyLogs = settings.stylePrettyLogs && isBrowser && !isBrowserBlinkEngine ? false : settings.stylePrettyLogs;

super(isBrowser && typeof(process) === 'undefined' ? BrowserRuntime : NodeRuntime, settings, logObj, isSafari ? 4 : 5);
super(isBrowser || process == undefined ? BrowserRuntime : NodeRuntime, settings, logObj, isSafari ? 4 : 5);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/runtime/nodejs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface IMetaStatic {
parentNames?: string[];
runtime: string;
runtimeVersion: string;
hostname: string;
hostname?: string;
}

export interface IMeta extends IMetaStatic {
Expand All @@ -34,8 +34,8 @@ export interface IMeta extends IMetaStatic {

const meta: IMetaStatic = {
runtime: "Nodejs",
runtimeVersion: (typeof process !== 'undefined') ? process.version : null,
hostname: hostname ? hostname() : null,
runtimeVersion: process?.version,
hostname: hostname ? hostname() : undefined,
};

export function getMeta(
Expand Down

0 comments on commit 155407f

Please sign in to comment.