Skip to content

Commit

Permalink
fix: esModuleInterop: true imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ert78gb committed Apr 20, 2020
1 parent d381966 commit 90f84fd
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/kboot/test/uhk-helpers/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { execSync } from 'child_process';
import { join } from 'path';
import { readFileSync } from 'fs';
import * as MemoryMap from 'nrf-intel-hex';
import MemoryMap from 'nrf-intel-hex';

export enum UhkReenumerationModes {
Bootloader = 'bootloader',
Expand Down
2 changes: 1 addition & 1 deletion packages/uhk-agent/src/dev-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Install DevTool extensions when Electron is in development mode
*/
import { app } from 'electron';
import * as isDev from 'electron-is-dev';
import isDev from 'electron-is-dev';

if (isDev) {

Expand Down
2 changes: 1 addition & 1 deletion packages/uhk-agent/src/electron-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { logger } from './services/logger.service';
import { AppUpdateService } from './services/app-update.service';
import { AppService } from './services/app.service';
import { SudoService } from './services/sudo.service';
import * as isDev from 'electron-is-dev';
import isDev from 'electron-is-dev';
import { setMenu } from './electron-menu';
import { loadWindowState, saveWindowState } from './util/window';
import { options, cliUsage } from './util';
Expand Down
2 changes: 1 addition & 1 deletion packages/uhk-agent/src/electron-menu.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { app, BrowserWindow, Menu, MenuItemConstructorOptions, systemPreferences } from 'electron';
import * as isDev from 'electron-is-dev';
import isDev from 'electron-is-dev';

export const setMenu = (win: BrowserWindow): void => {
if (process.platform !== 'darwin' || isDev) {
Expand Down
2 changes: 1 addition & 1 deletion packages/uhk-agent/src/services/app-update.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ipcMain } from 'electron';
import { autoUpdater } from 'electron-updater';
import { UpdateInfo, ProgressInfo } from 'builder-util-runtime';
import settings from 'electron-settings';
import * as isDev from 'electron-is-dev';
import isDev from 'electron-is-dev';
import storage from 'electron-settings';

import { ApplicationSettings, IpcEvents, LogService } from 'uhk-common';
Expand Down
2 changes: 1 addition & 1 deletion packages/uhk-agent/src/services/sudo.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ipcMain, app } from 'electron';
import { ipcMain } from 'electron';
import * as path from 'path';
import * as sudo from 'sudo-prompt';
import { dirSync } from 'tmp';
Expand Down
5 changes: 2 additions & 3 deletions packages/uhk-usb/src/util.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Device, devices } from 'node-hid';
import { readFile } from 'fs-extra';
import { EOL } from 'os';
import * as MemoryMap from 'nrf-intel-hex';
import MemoryMap from 'nrf-intel-hex';
import { Buffer, LogService } from 'uhk-common';

import { Constants, UsbCommand } from './constants';
Expand Down Expand Up @@ -126,9 +126,8 @@ export const getFileContentAsync = async (filePath: string): Promise<Array<strin

export const readBootloaderFirmwareFromHexFileAsync = async (hexFilePath: string): Promise<Map<any, any>> => {
const fileContent = await readFile(hexFilePath, { encoding: 'utf8' });
const fromHex = MemoryMap.fromHex ? MemoryMap.fromHex : MemoryMap.default.fromHex;

const memoryMap = fromHex(fileContent);
const memoryMap = MemoryMap.fromHex(fileContent);

return memoryMap;
};
Expand Down

0 comments on commit 90f84fd

Please sign in to comment.