@@ -79,16 +79,12 @@ tests](src/test/integration/index.ts).
7979#### ` WASMagicOptions `
8080
8181``` typescript
82- type ModuleOptions = {
83- locateFile? : (path : string , prefix : string ) => string ;
84- };
85-
8682type WASMagicOptions = {
8783 flags? : WASMagicFlags ;
8884 loadDefaultMagicfile? : boolean ;
8985 magicFiles? : Uint8Array [];
9086 stdio? : (stdioName : " stdout" | " stderr" , text : string ) => void ;
91- moduleOptions ? : ModuleOptions ;
87+ locateFile ? : ( path : string , prefix : string ) => string ;
9288};
9389```
9490
@@ -183,12 +179,7 @@ development of this module.
183179** Default** : ` (_stdioName: "stdout" | "stderr", _text: string) => {} ` (No
184180output)
185181
186- ##### ` moduleOptions `
187-
188- ` moduleOptions ` is an optional object that allows you to pass configuration
189- options directly to the underlying Emscripten WASM module.
190-
191- ###### ` moduleOptions.locateFile `
182+ ###### ` locateFile `
192183
193184` locateFile ` is a ` function ` that allows you to customize how the WASM module
194185locates the ` libmagic-wrapper.wasm ` file. This is particularly useful when
@@ -207,13 +198,11 @@ Example using a custom path:
207198import { WASMagic } from " wasmagic" ;
208199
209200const magic = await WASMagic .create ({
210- moduleOptions: {
211- locateFile : (path , prefix ) => {
212- if (path .endsWith (" .wasm" )) {
213- return ` /custom/path/to/${ path} ` ;
214- }
215- return prefix + path;
216- },
201+ locateFile : (path , prefix ) => {
202+ if (path .endsWith (" .wasm" )) {
203+ return ` /custom/path/to/${ path} ` ;
204+ }
205+ return prefix + path;
217206 },
218207});
219208```
0 commit comments