File tree Expand file tree Collapse file tree 5 files changed +11
-3
lines changed
Expand file tree Collapse file tree 5 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,9 @@ ctx <- NULL
55 ctx <<- V8 :: v8()
66 wd <- setwd(system.file(' js' , package = ' toml' ))
77 on.exit(setwd(wd ))
8- blob <- readBin(' index_bg .wasm' , raw(), 1e6 )
8+ blob <- readBin(' tomlr .wasm' , raw(), file.info( ' tomlr.wasm ' ) $ size )
99 ctx $ assign(' bytes' , blob )
1010 ctx $ eval(' var module = new WebAssembly.Module(bytes);' )
11- ctx $ source(' toml-edit-js.min .js' )
11+ ctx $ source(' tomlr .js' )
1212 ctx $ eval(' load_toml_edit_module(module)' , await = TRUE )
1313}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 1212 "text-decoding" : " ^1.0.0"
1313 },
1414 "scripts" : {
15- "build" : " esbuild toml-edit-js.js --minify --bundle --platform=neutral --format=iife --outfile=../inst/js/toml-edit-js.min. js && cp node_modules/@rainbowatcher/toml-edit-js/index_bg.wasm ../inst/js/index_bg .wasm"
15+ "build" : " esbuild toml-edit-js.js --minify --bundle --platform=neutral --format=iife --outfile=../inst/js/tomlr. js && cp node_modules/@rainbowatcher/toml-edit-js/index_bg.wasm ../inst/js/tomlr .wasm"
1616 }
1717}
Original file line number Diff line number Diff line change 1+ async function load_toml_edit_module ( module ) {
2+ var td = await import ( 'text-decoding/build/index' ) ;
3+ global . TextDecoder = td . TextDecoder ;
4+ global . TextEncoder = td . TextEncoder ;
5+ global . toml_edit = await import ( "@rainbowatcher/toml-edit-js/index" ) ;
6+ await toml_edit . initSync ( { module} ) ;
7+ }
8+ globalThis . load_toml_edit_module = load_toml_edit_module ;
You can’t perform that action at this time.
0 commit comments