File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,16 +64,14 @@ export enum WASMagicFlags {
6464 NO_CHECK_SIMH = 0x0800000 ,
6565}
6666
67- type ModuleOptions = {
68- locateFile ?: ( path : string , prefix : string ) => string ,
69- }
67+ export type LibmagicLocateFile = LibmagicModule [ "locateFile" ] ;
7068
7169export type WASMagicOptions = {
7270 flags ?: WASMagicFlags ;
7371 loadDefaultMagicfile ?: boolean ;
7472 magicFiles ?: Uint8Array [ ] ;
7573 stdio ?: StdioOverrideFunction ;
76- moduleOptions ?: ModuleOptions ;
74+ locateFile ?: LibmagicLocateFile ;
7775} ;
7876
7977type WASMagicOptionsComplete = {
@@ -94,7 +92,9 @@ export class WASMagic {
9492 static async create (
9593 options : WASMagicOptions = defaultWASMagicOptions ,
9694 ) : Promise < WASMagic > {
97- const Module = await libmagicFactory ( options . moduleOptions ) ;
95+ const Module = await libmagicFactory ( {
96+ locateFile : options . locateFile ,
97+ } ) ;
9898 return new WASMagic ( Module , options ) ;
9999 }
100100
You can’t perform that action at this time.
0 commit comments