#!/usr/bin/env node
"use strict";
const fs = require("fs");
const wasm = fs.readFileSync("lib/mappings.wasm");
const b64 = wasm.toString("base64");
const code = `"use strict";
var wasmB64 = "${b64}";
function b64ToBuffer(b64) {
  var raw = atob(b64);
  var arr = new Uint8Array(raw.length);
  for (var i = 0; i < raw.length; i++) arr[i] = raw.charCodeAt(i);
  return arr.buffer;
}
module.exports = function readWasm() {
  return Promise.resolve(b64ToBuffer(wasmB64));
};
module.exports.initialize = function() {};
`;
fs.writeFileSync("debian/read-wasm-inline.js", code);
