Introduce libSquoosh

This commit is contained in:
Surma
2021-05-19 12:15:00 +01:00
parent 25754b91b7
commit 392aced394
19 changed files with 86 additions and 100 deletions

View File

@@ -0,0 +1,16 @@
import { fileURLToPath } from 'url';
export function pathify(path) {
if (path.startsWith('file://')) {
path = fileURLToPath(path);
}
return path;
}
export function instantiateEmscriptenWasm(factory, path) {
return factory({
locateFile() {
return pathify(path);
},
});
}