Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function encodeModuleExport(n) {
var out = [];
assertNotIdentifierNode(n.descr.id);
var exportTypeByteString = constants.exportTypesByName[n.descr.exportType];
if (typeof exportTypeByteString === "undefined") {
throw new Error("Unknown export of type: " + n.descr.exportType);
}
var exportTypeByte = parseInt(exportTypeByteString, 10);
out.push.apply(out, _toConsumableArray(encodeUTF8Vec(n.name)));
out.push(exportTypeByte); // $FlowIgnore
out.push.apply(out, _toConsumableArray(encodeU32(n.descr.id.value)));
return out;
}
export function encodeTypeInstruction(n) {
export function encodeModuleExport(n: ModuleExport): Array {
const out = [];
assertNotIdentifierNode(n.descr.id);
const exportTypeByteString = constants.exportTypesByName[n.descr.exportType];
if (typeof exportTypeByteString === "undefined") {
throw new Error("Unknown export of type: " + n.descr.exportType);
}
const exportTypeByte = parseInt(exportTypeByteString, 10);
out.push(...encodeUTF8Vec(n.name));
out.push(exportTypeByte);
// $FlowIgnore
out.push(...encodeU32(n.descr.id.value));
return out;
}
export function encodeModuleExport(n) {
var out = [];
assertNotIdentifierNode(n.descr.id);
var exportTypeByteString = constants.exportTypesByName[n.descr.exportType];
if (typeof exportTypeByteString === "undefined") {
throw new Error("Unknown export of type: " + n.descr.exportType);
}
var exportTypeByte = parseInt(exportTypeByteString, 10);
out.push.apply(out, _toConsumableArray(encodeUTF8Vec(n.name)));
out.push(exportTypeByte); // $FlowIgnore
out.push.apply(out, _toConsumableArray(encodeU32(n.descr.id.value)));
return out;
}
export function encodeTypeInstruction(n) {