diff --git a/package.json b/package.json index 462ccadd..9e731cf9 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "prettier": "^2.3.2", "request": "^2.88.2", "request-promise": "^4.2.6", + "serialize-javascript": "^6.0.0", "ts-node": "^10.1.0", "ts-results": "^3.3.0", "tslint": "^5.12.1", diff --git a/routes/readWasm.js b/routes/readWasm.js index 06f5c5bd..f048fb40 100644 --- a/routes/readWasm.js +++ b/routes/readWasm.js @@ -2,17 +2,23 @@ require("dotenv").config(); var express = require("express"); var router = express.Router(); var routerJsClient=require('../JsClients/ROUTER/src/utils') +//const v8 = require('v8'); +var serialize = require('serialize-javascript'); router.route("/getWasmData").get(async function (req, res, next) { try { let wasmData= routerJsClient.getBinary('JsClients/ROUTER/wasm/purse-proxy.wasm'); - console.log(wasmData) - + console.log(wasmData); + //console.log(v8.serialize(wasmData)); + console.log(serialize({ arr : wasmData})); + //JSON.parse(JSON.stringify(wasmData)); + serialize({ arr : wasmData}); return res.status(200).json({ success: true, message: "Wasm data successfully read and converted. ", - wasmData: wasmData, + // wasmData: v8.serialize(wasmData), + wasmData: serialize({ arr : wasmData}), }); } catch (error) {