Skip to content

Commit

Permalink
chore: apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] committed Dec 29, 2023
1 parent ea9343f commit e2f8a51
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,24 @@ const unplugin = createUnplugin<UnwasmPluginOptions>((opts) => {
this.addWatchFile(id);

const buff = await fs.readFile(id);
return buff.toString('binary');
return buff.toString("binary");
},
transform(code, id) {
if (!id.endsWith(".wasm")) {
return;
}

const buff = Buffer.from(code, 'binary')
const buff = Buffer.from(code, "binary");
const name = `wasm/${basename(id, ".wasm")}-${sha1(buff)}.wasm`;
const parsed = parse(name, buff);

const asset = assets[name] = <WasmAsset>{
const asset = (assets[name] = <WasmAsset>{
name,
id,
source: buff,
imports: parsed.imports,
exports: parsed.exports,
};
});

return {
code: getWasmBinding(asset, opts),
Expand Down

0 comments on commit e2f8a51

Please sign in to comment.