From fbc35192fea0b13e95cd68676cbca42329712277 Mon Sep 17 00:00:00 2001 From: 0xpapercut <0xpapercut@gmail.com> Date: Fri, 3 May 2024 23:13:58 +0200 Subject: [PATCH] Fix wasm initialize function --- wypst.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/wypst.js b/wypst.js index 0718912..13d847f 100644 --- a/wypst.js +++ b/wypst.js @@ -41,27 +41,25 @@ function renderToString(expression, options) { return markup; } -function initialize() { - init(wasm); -} - -function debug() { - console.log(wasm.slice(10, 100)); +async function initialize(path) { + if (path) { + await init(path); + } else { + await init(wasm); + } } export default { render, renderToString, parseTree, - init, __typstContentTree: typstContentTree, + initialize, }; export { render, renderToString, parseTree, - init, initialize, - debug, };