Skip to content

Commit

Permalink
Move Uint8Array up
Browse files Browse the repository at this point in the history
  • Loading branch information
syrusakbary committed Oct 11, 2019
1 parent c67b189 commit 5c7a8ec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A small library to detect which features of WebAssembly are supported.
- ✅ Runs in Node
- ✅ Provided as an ES6 module, CommonJS and UMD module.
- ✅ CSP compatible
- ✅ Only ~501B gzipped
- ✅ Only ~504B gzipped

## Installation

Expand Down
4 changes: 2 additions & 2 deletions rollup-plugins/index-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ export default function({ indexPath, pluginFolder }) {
const importName = `${pluginName}_internal`;
return `
import { default as ${importName} } from "./${pluginFolder}/${plugin}/index.js";
export const ${pluginName} = ${importName}.bind(null, ${module}, validate);
export const ${pluginName} = ${importName}.bind(null, new Uint8Array(${module}), validate);
`;
}
return `
export const ${pluginName} = validate.bind(null, ${module});
export const ${pluginName} = validate.bind(null, new Uint8Array(${module}));
`;
})
);
Expand Down
2 changes: 1 addition & 1 deletion src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
// be called quite often and by having our own function terser can give it
// a one-letter name.
export async function validate(module) {
return WebAssembly.validate(new Uint8Array(module));
return WebAssembly.validate(module);
}

0 comments on commit 5c7a8ec

Please sign in to comment.