Skip to content

Commit

Permalink
Update nanobar import to ESM style
Browse files Browse the repository at this point in the history
  • Loading branch information
jmerle committed Dec 30, 2023
1 parent 6ee466b commit fc72c86
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/content.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-expect-error There are no types for this import
import Nanobar from 'nanobar';
import type { Runtime } from 'webextension-polyfill';
import { Message, MessageAction } from './models/messaging';
import { Parser } from './parsers/Parser';
Expand All @@ -6,9 +8,6 @@ import { browser } from './utils/browser';
import { config } from './utils/config';
import { noop } from './utils/noop';

// This package has no types
const Nanobar = require('nanobar');

declare global {
interface Window {
nanoBar: {
Expand Down
4 changes: 2 additions & 2 deletions tests/build/expose-parsers.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// @ts-expect-error There are no types for this import
import Nanobar from 'nanobar';
import { parsers } from '../../src/parsers/parsers';

for (const parser of parsers) {
(window as any)[parser.constructor.name] = parser;
}

// This package has no types
const Nanobar = require('nanobar');
window.nanoBar = new Nanobar();
window.nanoBar.total = 0;
window.nanoBar.advance = () => {};

0 comments on commit fc72c86

Please sign in to comment.