Skip to content

Commit

Permalink
window not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Shirtiny committed Oct 9, 2022
1 parent 6567bb9 commit e6de484
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 9 deletions.
Empty file modified .scripts/build.sh
100644 → 100755
Empty file.
Empty file modified .scripts/init.sh
100644 → 100755
Empty file.
Empty file modified .scripts/publish.sh
100644 → 100755
Empty file.
Empty file modified .scripts/test.sh
100644 → 100755
Empty file.
Empty file modified .scripts/version.sh
100644 → 100755
Empty file.
10 changes: 2 additions & 8 deletions src/model/baseLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,12 @@ export class BaseLogger implements ILogger {
private _option: IBaseLoggerOption;

constructor(option?: IBaseLoggerOption) {
const DefaultOption: IBaseLoggerOption = {
log: window.console.log,
enable: true,
};

this._option = {
...DefaultOption,
enable:
typeof option?.enable === "boolean"
? option.enable
: DefaultOption.enable,
log: option?.log || DefaultOption.log,
: true,
log: option?.log,
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/model/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class LoggerOption implements IBaseLoggerOption {
constructor(param?: LoggerOptionParam) {
const defaultOptionParam = {
enable: true,
log: window.console.log,
log: window?.console?.log,
// miku!
level: 39,
shape: new Theme().shapes.slider,
Expand Down

0 comments on commit e6de484

Please sign in to comment.