Skip to content

Commit 155407f

Browse files
committed
Fix isomorphy, fix #254
1 parent c4dc319 commit 155407f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class Logger<LogObj> extends BaseLogger<LogObj> {
1717
// style only for blink browsers
1818
settings.stylePrettyLogs = settings.stylePrettyLogs && isBrowser && !isBrowserBlinkEngine ? false : settings.stylePrettyLogs;
1919

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

2323
/**

src/runtime/nodejs/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface IMetaStatic {
2222
parentNames?: string[];
2323
runtime: string;
2424
runtimeVersion: string;
25-
hostname: string;
25+
hostname?: string;
2626
}
2727

2828
export interface IMeta extends IMetaStatic {
@@ -34,8 +34,8 @@ export interface IMeta extends IMetaStatic {
3434

3535
const meta: IMetaStatic = {
3636
runtime: "Nodejs",
37-
runtimeVersion: (typeof process !== 'undefined') ? process.version : null,
38-
hostname: hostname ? hostname() : null,
37+
runtimeVersion: process?.version,
38+
hostname: hostname ? hostname() : undefined,
3939
};
4040

4141
export function getMeta(

0 commit comments

Comments
 (0)