#!/usr/bin/env node const fs = require('fs') const types = require('../customTypes') const typeinfoFile = process.argv[2] const inputWasmFile = process.argv[3] const outputWasmFile = process.argv[4] const typeinfo = JSON.parse(fs.readFileSync(typeinfoFile)) const inputWasm = fs.readFileSync(inputWasmFile) const buf = types.encodeJSON(typeinfo) const outputWasm = types.injectCustomSection(buf, inputWasm) fs.writeFileSync(outputWasmFile, outputWasm)