1 | ;
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.isWasm = void 0;
|
4 | const eq_js_1 = require("../u8a/eq.js");
|
5 | const u8a_js_1 = require("./u8a.js");
|
6 | const WASM_MAGIC = new Uint8Array([0, 97, 115, 109]); // \0asm
|
7 | /**
|
8 | * @name isWasm
|
9 | * @summary Tests if the input has a WASM header
|
10 | * @description
|
11 | * Checks to see if the input Uint8Array contains a valid WASM header
|
12 | */
|
13 | function isWasm(value) {
|
14 | return (0, u8a_js_1.isU8a)(value) && (0, eq_js_1.u8aEq)(value.subarray(0, 4), WASM_MAGIC);
|
15 | }
|
16 | exports.isWasm = isWasm;
|