mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-11 16:26:20 +00:00
17 lines
300 B
JavaScript
17 lines
300 B
JavaScript
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);
|
|
},
|
|
});
|
|
}
|