typescript: Fix some issues with recent changes.

In domain-util, we were using `import * as ` syntax which
compiled down to `__importStar(require('...'))` which were
not giving the same result as before and causing errors. This
fixes that.

In logger-util, we were missing the call to .apply function
so it should have been `this._log.apply(...)`, but then when we
use apply typescript still complains about merging string with any[]
so we decided to go with bind.
This commit is contained in:
Priyank Patel
2019-06-20 08:55:17 -04:00
committed by Akash Nimare
parent 79d0688bcd
commit fb700350f9
2 changed files with 4 additions and 3 deletions

View File

@@ -3,8 +3,8 @@
import fs from 'fs';
import path from 'path';
import JsonDB from 'node-json-db';
import * as request from 'request';
import * as escape from 'escape-html';
import request from 'request';
import escape from 'escape-html';
import Logger = require('./logger-util');
import electron = require('electron');

View File

@@ -114,7 +114,8 @@ class Logger {
setupConsoleMethod(type: string): void {
this[type] = (...args: any[]) => {
this._log(null, [type].concat(args));
const log = this._log.bind(this, type, ...args);
log();
};
}