Skip to content

Commit e313c0a

Browse files
authored
fix: use local glob types (#339)
1 parent 7c10c67 commit e313c0a

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

src/asar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
} from './filesystem';
1111
import * as disk from './disk';
1212
import { crawl as crawlFilesystem, determineFileType } from './crawlfs';
13-
import { IOptions } from 'glob';
13+
import { IOptions } from './types/glob';
1414

1515
/**
1616
* Whether a directory should be excluded from packing due to the `--unpack-dir" option.

src/crawlfs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { promisify } from 'util';
2-
import { glob as _glob, IOptions } from 'glob';
2+
import { glob as _glob } from 'glob';
33

44
import fs from './wrapped-fs';
55
import { Stats } from 'fs';
6+
import { IOptions } from './types/glob';
67

78
const glob = promisify(_glob);
89

src/types/ambient.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* TODO(erikian): remove this file once we upgrade to the latest `glob` version.
3+
* https://github.com/electron/asar/pull/332#issuecomment-2435407933
4+
*/
5+
declare module 'glob' {
6+
export function glob(
7+
pattern: string,
8+
options: import('./glob').IOptions,
9+
cb: (err: Error | null, matches: string[]) => void,
10+
): unknown;
11+
}

src/types/glob.d.ts renamed to src/types/glob.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,6 @@
22
* TODO(erikian): remove this file once we upgrade to the latest `glob` version.
33
* https://github.com/electron/asar/pull/332#issuecomment-2435407933
44
*/
5-
6-
declare module 'glob' {
7-
export function glob(
8-
pattern: string,
9-
options: IGlobOptions,
10-
cb: (err: Error | null, matches: string[]) => void,
11-
): unknown;
12-
13-
export interface IOptions extends IGlobOptions {}
14-
}
15-
165
interface IMinimatchOptions {
176
/**
187
* Dump a ton of stuff to stderr.
@@ -135,7 +124,7 @@ interface IMinimatchOptions {
135124
windowsPathsNoEscape?: boolean;
136125
}
137126

138-
export interface IGlobOptions extends IMinimatchOptions {
127+
export interface IOptions extends IMinimatchOptions {
139128
cwd?: string | undefined;
140129
root?: string | undefined;
141130
dot?: boolean | undefined;

0 commit comments

Comments
 (0)