@@ -48,6 +48,7 @@ exports.importWebAssembly = function (remoteEntry) {
4848 liftArray : __liftArray ,
4949 notnull : __notnull ,
5050 store_ref : __store_ref ,
51+ _exports : exports ,
5152 memory,
5253
5354 getModelName ( ) {
@@ -65,10 +66,6 @@ exports.importWebAssembly = function (remoteEntry) {
6566 return __liftString ( exports . getDomain ( ) >>> 0 )
6667 } ,
6768
68- callExportedFn ( fn , kv ) {
69- return exports [ fn ] ( kv )
70- } ,
71-
7269 ArrayOfStrings_ID : {
7370 // assembly/index/ArrayOfStrings_ID: u32
7471 valueOf ( ) {
@@ -79,9 +76,14 @@ exports.importWebAssembly = function (remoteEntry) {
7976 }
8077 } ,
8178
82- modelFactory ( kv ) {
83- // assembly/index/modelFactory(~lib/array/Array<~lib/array/Array<~lib/string/String>>) => ~lib/array/Array<~lib/array/Array<~lib/string/String>>
84- kv =
79+ modelFactory ( obj ) {
80+ const entries = Object . entries ( obj )
81+ . filter ( ( [ k , v ] ) =>
82+ [ 'string' , 'number' , 'boolean' ] . includes ( typeof v )
83+ )
84+ . map ( ( [ k , v ] ) => [ k , v . toString ( ) ] )
85+
86+ const kv =
8587 __lowerArray (
8688 ( pointer , value ) => {
8789 __store_ref (
@@ -98,7 +100,7 @@ exports.importWebAssembly = function (remoteEntry) {
98100 } ,
99101 5 ,
100102 2 ,
101- kv
103+ entries
102104 ) || __notnull ( )
103105
104106 return __liftArray (
@@ -134,6 +136,23 @@ exports.importWebAssembly = function (remoteEntry) {
134136 . reduce ( ( a , b ) => ( { ...a , ...b } ) )
135137 } ,
136138
139+ getCommands ( ) {
140+ // assembly/index/getCommands() => ~lib/array/Array<~lib/array/Array<~lib/string/String>>
141+ return __liftArray (
142+ pointer =>
143+ __liftArray (
144+ pointer =>
145+ __liftString ( new Uint32Array ( memory . buffer ) [ pointer >>> 2 ] ) ,
146+ 2 ,
147+ new Uint32Array ( memory . buffer ) [ pointer >>> 2 ]
148+ ) ,
149+ 2 ,
150+ exports . getCommands ( ) >>> 0
151+ )
152+ . map ( ( [ k , v ] ) => ( { [ k ] : v } ) )
153+ . reduce ( ( a , b ) => ( { ...a , ...b } ) )
154+ } ,
155+
137156 emitEvent ( kv ) {
138157 // assembly/index/emitEvent(~lib/array/Array<~lib/array/Array<~lib/string/String>>) => ~lib/array/Array<~lib/array/Array<~lib/string/String>>
139158 kv =
@@ -172,23 +191,6 @@ exports.importWebAssembly = function (remoteEntry) {
172191 )
173192 } ,
174193
175- getCommands ( ) {
176- // assembly/index/getCommands() => ~lib/array/Array<~lib/array/Array<~lib/string/String>>
177- return __liftArray (
178- pointer =>
179- __liftArray (
180- pointer =>
181- __liftString ( new Uint32Array ( memory . buffer ) [ pointer >>> 2 ] ) ,
182- 2 ,
183- new Uint32Array ( memory . buffer ) [ pointer >>> 2 ]
184- ) ,
185- 2 ,
186- exports . getCommands ( ) >>> 0
187- )
188- . map ( ( [ k , v ] ) => ( { [ k ] : v } ) )
189- . reduce ( ( a , b ) => ( { ...a , ...b } ) )
190- } ,
191-
192194 onUpdate ( kv ) {
193195 // assembly/index/onUpdate(~lib/array/Array<~lib/array/Array<~lib/string/String>>) => ~lib/array/Array<~lib/array/Array<~lib/string/String>>
194196 kv =
@@ -353,8 +355,8 @@ exports.importWebAssembly = function (remoteEntry) {
353355 }
354356 }
355357
356- function __notnull ( ) {
357- throw TypeError ( ' value must not be null' )
358+ function __notnull ( key ) {
359+ throw TypeError ( ` value must not be null ${ key } ` )
358360 }
359361
360362 function __store_ref ( pointer , value ) {
0 commit comments