File size: 494 Bytes
00df61d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
 * @license
 * Copyright 2023 The Emscripten Authors
 * SPDX-License-Identifier: MIT
 */

addToLibrary({
  $FETCHFS__deps: ['$stringToUTF8OnStack', 'wasmfs_create_fetch_backend'],
  $FETCHFS: {
    createBackend(opts) {
      return withStackSave(
        () => _wasmfs_create_fetch_backend(
          stringToUTF8OnStack(opts.base_url ?? ""),
          opts.chunkSize | 0
        )
      );
    },
  },
});

if (!WASMFS) {
  error("using -lfetchfs.js requires using WasmFS (-sWASMFS)");
}