(t?: ValueType)
| 103 | |
| 104 | // TODO: workaround a bug(?) that all types are returned as either none, u32 or f64 |
| 105 | export function matchW2CRType(t?: ValueType): string { |
| 106 | if (!t) { |
| 107 | return 'void'; |
| 108 | } |
| 109 | |
| 110 | // TODO: figure out why wasm2c returns u32 for number types sometimes |
| 111 | if (t.startsWith('i')) { |
| 112 | return t.replace(/^i/, 'u'); |
| 113 | } |
| 114 | return t; |
| 115 | } |