Skip to content

Commit

Permalink
fix(fsevents): use any
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Sep 3, 2021
1 parent 5103e89 commit 48a11b4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/watch/fsevents-importer.ts
@@ -1,8 +1,10 @@
let fsEvents: typeof import('fsevents');
let fsEvents: any; // TODO find better type solution, fsevents is only being installed on macOS
let fsEventsImportError: Error | undefined;

const mod = 'fsevents';

export function loadFsEvents(): Promise<void> {
return import('fsevents')
return import(mod)
.then(namespace => {
fsEvents = namespace.default;
})
Expand All @@ -12,7 +14,7 @@ export function loadFsEvents(): Promise<void> {
}

// A call to this function will be injected into the chokidar code
export function getFsEvents(): typeof import('fsevents') {
export function getFsEvents(): any {
if (fsEventsImportError) throw fsEventsImportError;
return fsEvents;
}

0 comments on commit 48a11b4

Please sign in to comment.