@noir-lang/noirc_abi
Advanced tools
Comparing version
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export const memory: WebAssembly.Memory; | ||
export function abiEncode(a: number, b: number, c: number, d: number): void; | ||
export function abiDecode(a: number, b: number, c: number): void; | ||
export function serializeWitness(a: number, b: number): void; | ||
export function abiDecodeError(a: number, b: number, c: number): void; | ||
export function __wbindgen_malloc(a: number): number; | ||
export function __wbindgen_realloc(a: number, b: number, c: number): number; | ||
export function __wbindgen_add_to_stack_pointer(a: number): number; | ||
export function __wbindgen_free(a: number, b: number): void; | ||
export function wasm_bindgen__convert__closures__invoke2_mut__h56728cbaf4bbea81(a: number, b: number, c: number, d: number): void; | ||
export function __wbindgen_exn_store(a: number): void; | ||
export const abiEncode: (a: any, b: any, c: number) => [number, number, number]; | ||
export const abiDecode: (a: any, b: any) => [number, number, number]; | ||
export const serializeWitness: (a: any) => [number, number, number, number]; | ||
export const abiDecodeError: (a: any, b: any) => [number, number, number]; | ||
export const __wbindgen_free: (a: number, b: number, c: number) => void; | ||
export const __wbindgen_exn_store: (a: number) => void; | ||
export const __externref_table_alloc: () => number; | ||
export const __wbindgen_export_3: WebAssembly.Table; | ||
export const __wbindgen_malloc: (a: number, b: number) => number; | ||
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; | ||
export const __externref_table_dealloc: (a: number) => void; | ||
export const closure167_externref_shim: (a: number, b: number, c: any, d: any) => void; | ||
export const __wbindgen_start: () => void; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* @param {Abi} abi | ||
* @param {InputMap} inputs | ||
* @param {InputValue | undefined} return_value | ||
* @returns {WitnessMap} | ||
*/ | ||
export function abiEncode(abi: Abi, inputs: InputMap, return_value?: InputValue): WitnessMap; | ||
/** | ||
* @param {Abi} abi | ||
* @param {WitnessMap} witness_map | ||
* @returns {any} | ||
*/ | ||
export function abiEncode(abi: Abi, inputs: InputMap, return_value?: InputValue | null): WitnessMap; | ||
export function abiDecode(abi: Abi, witness_map: WitnessMap): any; | ||
/** | ||
* @param {WitnessMap} witness_map | ||
* @returns {Uint8Array} | ||
*/ | ||
export function serializeWitness(witness_map: WitnessMap): Uint8Array; | ||
/** | ||
* @param {Abi} abi | ||
* @param {RawAssertionPayload} raw_error | ||
* @returns {any} | ||
*/ | ||
export function abiDecodeError(abi: Abi, raw_error: RawAssertionPayload): any; | ||
@@ -27,0 +7,0 @@ |
@@ -0,23 +1,42 @@ | ||
let imports = {}; | ||
imports['__wbindgen_placeholder__'] = module.exports; | ||
let wasm; | ||
const { TextEncoder, TextDecoder } = require(`util`); | ||
const { TextDecoder, TextEncoder } = require(`util`); | ||
const heap = new Array(128).fill(undefined); | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
heap.push(undefined, null, true, false); | ||
cachedTextDecoder.decode(); | ||
function getObject(idx) { return heap[idx]; } | ||
let cachedUint8ArrayMemory0 = null; | ||
let WASM_VECTOR_LEN = 0; | ||
function getUint8ArrayMemory0() { | ||
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { | ||
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); | ||
} | ||
return cachedUint8ArrayMemory0; | ||
} | ||
let cachedUint8Memory0 = null; | ||
function getStringFromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); | ||
} | ||
function getUint8Memory0() { | ||
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) { | ||
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer); | ||
function addToExternrefTable0(obj) { | ||
const idx = wasm.__externref_table_alloc(); | ||
wasm.__wbindgen_export_3.set(idx, obj); | ||
return idx; | ||
} | ||
function handleError(f, args) { | ||
try { | ||
return f.apply(this, args); | ||
} catch (e) { | ||
const idx = addToExternrefTable0(e); | ||
wasm.__wbindgen_exn_store(idx); | ||
} | ||
return cachedUint8Memory0; | ||
} | ||
let WASM_VECTOR_LEN = 0; | ||
let cachedTextEncoder = new TextEncoder('utf-8'); | ||
@@ -42,4 +61,4 @@ | ||
const buf = cachedTextEncoder.encode(arg); | ||
const ptr = malloc(buf.length) >>> 0; | ||
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf); | ||
const ptr = malloc(buf.length, 1) >>> 0; | ||
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf); | ||
WASM_VECTOR_LEN = buf.length; | ||
@@ -50,5 +69,5 @@ return ptr; | ||
let len = arg.length; | ||
let ptr = malloc(len) >>> 0; | ||
let ptr = malloc(len, 1) >>> 0; | ||
const mem = getUint8Memory0(); | ||
const mem = getUint8ArrayMemory0(); | ||
@@ -67,7 +86,8 @@ let offset = 0; | ||
} | ||
ptr = realloc(ptr, len, len = offset + arg.length * 3) >>> 0; | ||
const view = getUint8Memory0().subarray(ptr + offset, ptr + len); | ||
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; | ||
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); | ||
const ret = encodeString(arg, view); | ||
offset += ret.written; | ||
ptr = realloc(ptr, len, offset, 1) >>> 0; | ||
} | ||
@@ -79,96 +99,45 @@ | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
let cachedDataViewMemory0 = null; | ||
let cachedInt32Memory0 = null; | ||
function getInt32Memory0() { | ||
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { | ||
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); | ||
function getDataViewMemory0() { | ||
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { | ||
cachedDataViewMemory0 = new DataView(wasm.memory.buffer); | ||
} | ||
return cachedInt32Memory0; | ||
return cachedDataViewMemory0; | ||
} | ||
let heap_next = heap.length; | ||
function dropObject(idx) { | ||
if (idx < 132) return; | ||
heap[idx] = heap_next; | ||
heap_next = idx; | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
function takeObject(idx) { | ||
const ret = getObject(idx); | ||
dropObject(idx); | ||
return ret; | ||
function takeFromExternrefTable0(idx) { | ||
const value = wasm.__wbindgen_export_3.get(idx); | ||
wasm.__externref_table_dealloc(idx); | ||
return value; | ||
} | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
heap[idx] = obj; | ||
return idx; | ||
} | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
cachedTextDecoder.decode(); | ||
function getStringFromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
let cachedFloat64Memory0 = null; | ||
function getFloat64Memory0() { | ||
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) { | ||
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer); | ||
} | ||
return cachedFloat64Memory0; | ||
} | ||
/** | ||
* @param {Abi} abi | ||
* @param {InputMap} inputs | ||
* @param {InputValue | undefined} return_value | ||
* @returns {WitnessMap} | ||
*/ | ||
* @param {Abi} abi | ||
* @param {InputMap} inputs | ||
* @param {InputValue | null} [return_value] | ||
* @returns {WitnessMap} | ||
*/ | ||
module.exports.abiEncode = function(abi, inputs, return_value) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.abiEncode(retptr, addHeapObject(abi), addHeapObject(inputs), isLikeNone(return_value) ? 0 : addHeapObject(return_value)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
const ret = wasm.abiEncode(abi, inputs, isLikeNone(return_value) ? 0 : addToExternrefTable0(return_value)); | ||
if (ret[2]) { | ||
throw takeFromExternrefTable0(ret[1]); | ||
} | ||
return takeFromExternrefTable0(ret[0]); | ||
}; | ||
/** | ||
* @param {Abi} abi | ||
* @param {WitnessMap} witness_map | ||
* @returns {any} | ||
*/ | ||
* @param {Abi} abi | ||
* @param {WitnessMap} witness_map | ||
* @returns {any} | ||
*/ | ||
module.exports.abiDecode = function(abi, witness_map) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.abiDecode(retptr, addHeapObject(abi), addHeapObject(witness_map)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
const ret = wasm.abiDecode(abi, witness_map); | ||
if (ret[2]) { | ||
throw takeFromExternrefTable0(ret[1]); | ||
} | ||
return takeFromExternrefTable0(ret[0]); | ||
}; | ||
@@ -178,119 +147,41 @@ | ||
ptr = ptr >>> 0; | ||
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len); | ||
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len); | ||
} | ||
/** | ||
* @param {WitnessMap} witness_map | ||
* @returns {Uint8Array} | ||
*/ | ||
* @param {WitnessMap} witness_map | ||
* @returns {Uint8Array} | ||
*/ | ||
module.exports.serializeWitness = function(witness_map) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.serializeWitness(retptr, addHeapObject(witness_map)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
var r3 = getInt32Memory0()[retptr / 4 + 3]; | ||
if (r3) { | ||
throw takeObject(r2); | ||
} | ||
var v1 = getArrayU8FromWasm0(r0, r1).slice(); | ||
wasm.__wbindgen_free(r0, r1 * 1); | ||
return v1; | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
const ret = wasm.serializeWitness(witness_map); | ||
if (ret[3]) { | ||
throw takeFromExternrefTable0(ret[2]); | ||
} | ||
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice(); | ||
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1); | ||
return v1; | ||
}; | ||
/** | ||
* @param {Abi} abi | ||
* @param {RawAssertionPayload} raw_error | ||
* @returns {any} | ||
*/ | ||
* @param {Abi} abi | ||
* @param {RawAssertionPayload} raw_error | ||
* @returns {any} | ||
*/ | ||
module.exports.abiDecodeError = function(abi, raw_error) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.abiDecodeError(retptr, addHeapObject(abi), addHeapObject(raw_error)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
const ret = wasm.abiDecodeError(abi, raw_error); | ||
if (ret[2]) { | ||
throw takeFromExternrefTable0(ret[1]); | ||
} | ||
return takeFromExternrefTable0(ret[0]); | ||
}; | ||
function __wbg_adapter_28(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h56728cbaf4bbea81(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
function __wbg_adapter_30(arg0, arg1, arg2, arg3) { | ||
wasm.closure167_externref_shim(arg0, arg1, arg2, arg3); | ||
} | ||
function handleError(f, args) { | ||
try { | ||
return f.apply(this, args); | ||
} catch (e) { | ||
wasm.__wbindgen_exn_store(addHeapObject(e)); | ||
} | ||
} | ||
module.exports.__wbg_constructor_4993331818866f11 = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_string_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'string' ? obj : undefined; | ||
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len1 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len1; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr1; | ||
}; | ||
module.exports.__wbindgen_object_drop_ref = function(arg0) { | ||
takeObject(arg0); | ||
}; | ||
module.exports.__wbg_new_5b651b9b6590037e = function() { | ||
const ret = new Map(); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_number_new = function(arg0) { | ||
const ret = arg0; | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_string_new = function(arg0, arg1) { | ||
const ret = getStringFromWasm0(arg0, arg1); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_number_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'number' ? obj : undefined; | ||
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; | ||
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); | ||
}; | ||
module.exports.__wbindgen_is_undefined = function(arg0) { | ||
const ret = getObject(arg0) === undefined; | ||
module.exports.__wbg_constructor_bc5e3569b1bc20f1 = function(arg0) { | ||
const ret = new Error(arg0); | ||
return ret; | ||
}; | ||
module.exports.__wbg_new_abda76e883ba8a5f = function() { | ||
const ret = new Error(); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) { | ||
const ret = getObject(arg1).stack; | ||
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len1 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len1; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr1; | ||
}; | ||
module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) { | ||
module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) { | ||
let deferred0_0; | ||
@@ -303,7 +194,7 @@ let deferred0_1; | ||
} finally { | ||
wasm.__wbindgen_free(deferred0_0, deferred0_1); | ||
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); | ||
} | ||
}; | ||
module.exports.__wbg_forEach_942772130a8d06a6 = function(arg0, arg1, arg2) { | ||
module.exports.__wbg_forEach_e1cf6f7c8ecb7dae = function(arg0, arg1, arg2) { | ||
try { | ||
@@ -315,3 +206,3 @@ var state0 = {a: arg1, b: arg2}; | ||
try { | ||
return __wbg_adapter_28(a, state0.b, arg0, arg1); | ||
return __wbg_adapter_30(a, state0.b, arg0, arg1); | ||
} finally { | ||
@@ -321,3 +212,3 @@ state0.a = a; | ||
}; | ||
getObject(arg0).forEach(cb0); | ||
arg0.forEach(cb0); | ||
} finally { | ||
@@ -328,17 +219,77 @@ state0.a = state0.b = 0; | ||
module.exports.__wbg_set_da7be7bf0e037b14 = function(arg0, arg1, arg2) { | ||
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2)); | ||
return addHeapObject(ret); | ||
module.exports.__wbg_new_0b7dab710d4e469e = function() { | ||
const ret = new Map(); | ||
return ret; | ||
}; | ||
module.exports.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) { | ||
module.exports.__wbg_new_8a6f238a6ece86ea = function() { | ||
const ret = new Error(); | ||
return ret; | ||
}; | ||
module.exports.__wbg_parse_def2e24ef1252aff = function() { return handleError(function (arg0, arg1) { | ||
const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
return ret; | ||
}, arguments) }; | ||
module.exports.__wbg_stringify_d06ad2addc54d51e = function() { return handleError(function (arg0) { | ||
const ret = JSON.stringify(getObject(arg0)); | ||
return addHeapObject(ret); | ||
module.exports.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) { | ||
const ret = arg0.set(arg1, arg2); | ||
return ret; | ||
}; | ||
module.exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) { | ||
const ret = arg1.stack; | ||
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len1 = WASM_VECTOR_LEN; | ||
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); | ||
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); | ||
}; | ||
module.exports.__wbg_stringify_f7ed6987935b4a24 = function() { return handleError(function (arg0) { | ||
const ret = JSON.stringify(arg0); | ||
return ret; | ||
}, arguments) }; | ||
module.exports.__wbindgen_init_externref_table = function() { | ||
const table = wasm.__wbindgen_export_3; | ||
const offset = table.grow(4); | ||
table.set(0, undefined); | ||
table.set(offset + 0, undefined); | ||
table.set(offset + 1, null); | ||
table.set(offset + 2, true); | ||
table.set(offset + 3, false); | ||
; | ||
}; | ||
module.exports.__wbindgen_is_undefined = function(arg0) { | ||
const ret = arg0 === undefined; | ||
return ret; | ||
}; | ||
module.exports.__wbindgen_number_get = function(arg0, arg1) { | ||
const obj = arg1; | ||
const ret = typeof(obj) === 'number' ? obj : undefined; | ||
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true); | ||
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true); | ||
}; | ||
module.exports.__wbindgen_number_new = function(arg0) { | ||
const ret = arg0; | ||
return ret; | ||
}; | ||
module.exports.__wbindgen_string_get = function(arg0, arg1) { | ||
const obj = arg1; | ||
const ret = typeof(obj) === 'string' ? obj : undefined; | ||
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len1 = WASM_VECTOR_LEN; | ||
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); | ||
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); | ||
}; | ||
module.exports.__wbindgen_string_new = function(arg0, arg1) { | ||
const ret = getStringFromWasm0(arg0, arg1); | ||
return ret; | ||
}; | ||
module.exports.__wbindgen_throw = function(arg0, arg1) { | ||
@@ -356,1 +307,3 @@ throw new Error(getStringFromWasm0(arg0, arg1)); | ||
wasm.__wbindgen_start(); | ||
@@ -6,3 +6,3 @@ { | ||
], | ||
"version": "1.0.0-beta.3-f0c1c7b.nightly", | ||
"version": "1.0.0-beta.3-fdd2fe7.nightly", | ||
"license": "(MIT OR Apache-2.0)", | ||
@@ -40,3 +40,3 @@ "homepage": "https://noir-lang.org/", | ||
"dependencies": { | ||
"@noir-lang/types": "1.0.0-beta.3-f0c1c7b.nightly" | ||
"@noir-lang/types": "1.0.0-beta.3-fdd2fe7.nightly" | ||
}, | ||
@@ -43,0 +43,0 @@ "devDependencies": { |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export const memory: WebAssembly.Memory; | ||
export function abiEncode(a: number, b: number, c: number, d: number): void; | ||
export function abiDecode(a: number, b: number, c: number): void; | ||
export function serializeWitness(a: number, b: number): void; | ||
export function abiDecodeError(a: number, b: number, c: number): void; | ||
export function __wbindgen_malloc(a: number): number; | ||
export function __wbindgen_realloc(a: number, b: number, c: number): number; | ||
export function __wbindgen_add_to_stack_pointer(a: number): number; | ||
export function __wbindgen_free(a: number, b: number): void; | ||
export function wasm_bindgen__convert__closures__invoke2_mut__h56728cbaf4bbea81(a: number, b: number, c: number, d: number): void; | ||
export function __wbindgen_exn_store(a: number): void; | ||
export const abiEncode: (a: any, b: any, c: number) => [number, number, number]; | ||
export const abiDecode: (a: any, b: any) => [number, number, number]; | ||
export const serializeWitness: (a: any) => [number, number, number, number]; | ||
export const abiDecodeError: (a: any, b: any) => [number, number, number]; | ||
export const __wbindgen_free: (a: number, b: number, c: number) => void; | ||
export const __wbindgen_exn_store: (a: number) => void; | ||
export const __externref_table_alloc: () => number; | ||
export const __wbindgen_export_3: WebAssembly.Table; | ||
export const __wbindgen_malloc: (a: number, b: number) => number; | ||
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; | ||
export const __externref_table_dealloc: (a: number) => void; | ||
export const closure167_externref_shim: (a: number, b: number, c: any, d: any) => void; | ||
export const __wbindgen_start: () => void; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* @param {Abi} abi | ||
* @param {InputMap} inputs | ||
* @param {InputValue | undefined} return_value | ||
* @returns {WitnessMap} | ||
*/ | ||
export function abiEncode(abi: Abi, inputs: InputMap, return_value?: InputValue): WitnessMap; | ||
/** | ||
* @param {Abi} abi | ||
* @param {WitnessMap} witness_map | ||
* @returns {any} | ||
*/ | ||
export function abiEncode(abi: Abi, inputs: InputMap, return_value?: InputValue | null): WitnessMap; | ||
export function abiDecode(abi: Abi, witness_map: WitnessMap): any; | ||
/** | ||
* @param {WitnessMap} witness_map | ||
* @returns {Uint8Array} | ||
*/ | ||
export function serializeWitness(witness_map: WitnessMap): Uint8Array; | ||
/** | ||
* @param {Abi} abi | ||
* @param {RawAssertionPayload} raw_error | ||
* @returns {any} | ||
*/ | ||
export function abiDecodeError(abi: Abi, raw_error: RawAssertionPayload): any; | ||
@@ -41,12 +21,15 @@ | ||
readonly memory: WebAssembly.Memory; | ||
readonly abiEncode: (a: number, b: number, c: number, d: number) => void; | ||
readonly abiDecode: (a: number, b: number, c: number) => void; | ||
readonly serializeWitness: (a: number, b: number) => void; | ||
readonly abiDecodeError: (a: number, b: number, c: number) => void; | ||
readonly __wbindgen_malloc: (a: number) => number; | ||
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number; | ||
readonly __wbindgen_add_to_stack_pointer: (a: number) => number; | ||
readonly __wbindgen_free: (a: number, b: number) => void; | ||
readonly wasm_bindgen__convert__closures__invoke2_mut__h56728cbaf4bbea81: (a: number, b: number, c: number, d: number) => void; | ||
readonly abiEncode: (a: any, b: any, c: number) => [number, number, number]; | ||
readonly abiDecode: (a: any, b: any) => [number, number, number]; | ||
readonly serializeWitness: (a: any) => [number, number, number, number]; | ||
readonly abiDecodeError: (a: any, b: any) => [number, number, number]; | ||
readonly __wbindgen_free: (a: number, b: number, c: number) => void; | ||
readonly __wbindgen_exn_store: (a: number) => void; | ||
readonly __externref_table_alloc: () => number; | ||
readonly __wbindgen_export_3: WebAssembly.Table; | ||
readonly __wbindgen_malloc: (a: number, b: number) => number; | ||
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; | ||
readonly __externref_table_dealloc: (a: number) => void; | ||
readonly closure167_externref_shim: (a: number, b: number, c: any, d: any) => void; | ||
readonly __wbindgen_start: () => void; | ||
} | ||
@@ -59,7 +42,7 @@ | ||
* | ||
* @param {SyncInitInput} module | ||
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated. | ||
* | ||
* @returns {InitOutput} | ||
*/ | ||
export function initSync(module: SyncInitInput): InitOutput; | ||
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput; | ||
@@ -70,6 +53,6 @@ /** | ||
* | ||
* @param {InitInput | Promise<InitInput>} module_or_path | ||
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated. | ||
* | ||
* @returns {Promise<InitOutput>} | ||
*/ | ||
export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>; | ||
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>; |
let wasm; | ||
const heap = new Array(128).fill(undefined); | ||
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); | ||
heap.push(undefined, null, true, false); | ||
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; | ||
function getObject(idx) { return heap[idx]; } | ||
let cachedUint8ArrayMemory0 = null; | ||
let WASM_VECTOR_LEN = 0; | ||
function getUint8ArrayMemory0() { | ||
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { | ||
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); | ||
} | ||
return cachedUint8ArrayMemory0; | ||
} | ||
let cachedUint8Memory0 = null; | ||
function getStringFromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); | ||
} | ||
function getUint8Memory0() { | ||
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) { | ||
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer); | ||
function addToExternrefTable0(obj) { | ||
const idx = wasm.__externref_table_alloc(); | ||
wasm.__wbindgen_export_3.set(idx, obj); | ||
return idx; | ||
} | ||
function handleError(f, args) { | ||
try { | ||
return f.apply(this, args); | ||
} catch (e) { | ||
const idx = addToExternrefTable0(e); | ||
wasm.__wbindgen_exn_store(idx); | ||
} | ||
return cachedUint8Memory0; | ||
} | ||
let WASM_VECTOR_LEN = 0; | ||
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } ); | ||
@@ -39,4 +57,4 @@ | ||
const buf = cachedTextEncoder.encode(arg); | ||
const ptr = malloc(buf.length) >>> 0; | ||
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf); | ||
const ptr = malloc(buf.length, 1) >>> 0; | ||
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf); | ||
WASM_VECTOR_LEN = buf.length; | ||
@@ -47,5 +65,5 @@ return ptr; | ||
let len = arg.length; | ||
let ptr = malloc(len) >>> 0; | ||
let ptr = malloc(len, 1) >>> 0; | ||
const mem = getUint8Memory0(); | ||
const mem = getUint8ArrayMemory0(); | ||
@@ -64,7 +82,8 @@ let offset = 0; | ||
} | ||
ptr = realloc(ptr, len, len = offset + arg.length * 3) >>> 0; | ||
const view = getUint8Memory0().subarray(ptr + offset, ptr + len); | ||
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; | ||
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); | ||
const ret = encodeString(arg, view); | ||
offset += ret.written; | ||
ptr = realloc(ptr, len, offset, 1) >>> 0; | ||
} | ||
@@ -76,96 +95,45 @@ | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
let cachedDataViewMemory0 = null; | ||
let cachedInt32Memory0 = null; | ||
function getInt32Memory0() { | ||
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { | ||
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); | ||
function getDataViewMemory0() { | ||
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { | ||
cachedDataViewMemory0 = new DataView(wasm.memory.buffer); | ||
} | ||
return cachedInt32Memory0; | ||
return cachedDataViewMemory0; | ||
} | ||
let heap_next = heap.length; | ||
function dropObject(idx) { | ||
if (idx < 132) return; | ||
heap[idx] = heap_next; | ||
heap_next = idx; | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
function takeObject(idx) { | ||
const ret = getObject(idx); | ||
dropObject(idx); | ||
return ret; | ||
function takeFromExternrefTable0(idx) { | ||
const value = wasm.__wbindgen_export_3.get(idx); | ||
wasm.__externref_table_dealloc(idx); | ||
return value; | ||
} | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
heap[idx] = obj; | ||
return idx; | ||
} | ||
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); | ||
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; | ||
function getStringFromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
let cachedFloat64Memory0 = null; | ||
function getFloat64Memory0() { | ||
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) { | ||
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer); | ||
} | ||
return cachedFloat64Memory0; | ||
} | ||
/** | ||
* @param {Abi} abi | ||
* @param {InputMap} inputs | ||
* @param {InputValue | undefined} return_value | ||
* @returns {WitnessMap} | ||
*/ | ||
* @param {Abi} abi | ||
* @param {InputMap} inputs | ||
* @param {InputValue | null} [return_value] | ||
* @returns {WitnessMap} | ||
*/ | ||
export function abiEncode(abi, inputs, return_value) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.abiEncode(retptr, addHeapObject(abi), addHeapObject(inputs), isLikeNone(return_value) ? 0 : addHeapObject(return_value)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
const ret = wasm.abiEncode(abi, inputs, isLikeNone(return_value) ? 0 : addToExternrefTable0(return_value)); | ||
if (ret[2]) { | ||
throw takeFromExternrefTable0(ret[1]); | ||
} | ||
return takeFromExternrefTable0(ret[0]); | ||
} | ||
/** | ||
* @param {Abi} abi | ||
* @param {WitnessMap} witness_map | ||
* @returns {any} | ||
*/ | ||
* @param {Abi} abi | ||
* @param {WitnessMap} witness_map | ||
* @returns {any} | ||
*/ | ||
export function abiDecode(abi, witness_map) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.abiDecode(retptr, addHeapObject(abi), addHeapObject(witness_map)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
const ret = wasm.abiDecode(abi, witness_map); | ||
if (ret[2]) { | ||
throw takeFromExternrefTable0(ret[1]); | ||
} | ||
return takeFromExternrefTable0(ret[0]); | ||
} | ||
@@ -175,60 +143,35 @@ | ||
ptr = ptr >>> 0; | ||
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len); | ||
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len); | ||
} | ||
/** | ||
* @param {WitnessMap} witness_map | ||
* @returns {Uint8Array} | ||
*/ | ||
* @param {WitnessMap} witness_map | ||
* @returns {Uint8Array} | ||
*/ | ||
export function serializeWitness(witness_map) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.serializeWitness(retptr, addHeapObject(witness_map)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
var r3 = getInt32Memory0()[retptr / 4 + 3]; | ||
if (r3) { | ||
throw takeObject(r2); | ||
} | ||
var v1 = getArrayU8FromWasm0(r0, r1).slice(); | ||
wasm.__wbindgen_free(r0, r1 * 1); | ||
return v1; | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
const ret = wasm.serializeWitness(witness_map); | ||
if (ret[3]) { | ||
throw takeFromExternrefTable0(ret[2]); | ||
} | ||
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice(); | ||
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1); | ||
return v1; | ||
} | ||
/** | ||
* @param {Abi} abi | ||
* @param {RawAssertionPayload} raw_error | ||
* @returns {any} | ||
*/ | ||
* @param {Abi} abi | ||
* @param {RawAssertionPayload} raw_error | ||
* @returns {any} | ||
*/ | ||
export function abiDecodeError(abi, raw_error) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.abiDecodeError(retptr, addHeapObject(abi), addHeapObject(raw_error)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
const ret = wasm.abiDecodeError(abi, raw_error); | ||
if (ret[2]) { | ||
throw takeFromExternrefTable0(ret[1]); | ||
} | ||
return takeFromExternrefTable0(ret[0]); | ||
} | ||
function __wbg_adapter_28(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h56728cbaf4bbea81(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
function __wbg_adapter_30(arg0, arg1, arg2, arg3) { | ||
wasm.closure167_externref_shim(arg0, arg1, arg2, arg3); | ||
} | ||
function handleError(f, args) { | ||
try { | ||
return f.apply(this, args); | ||
} catch (e) { | ||
wasm.__wbindgen_exn_store(addHeapObject(e)); | ||
} | ||
} | ||
async function __wbg_load(module, imports) { | ||
@@ -242,3 +185,3 @@ if (typeof Response === 'function' && module instanceof Response) { | ||
if (module.headers.get('Content-Type') != 'application/wasm') { | ||
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); | ||
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); | ||
@@ -269,51 +212,7 @@ } else { | ||
imports.wbg = {}; | ||
imports.wbg.__wbg_constructor_4993331818866f11 = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_string_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'string' ? obj : undefined; | ||
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len1 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len1; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr1; | ||
}; | ||
imports.wbg.__wbindgen_object_drop_ref = function(arg0) { | ||
takeObject(arg0); | ||
}; | ||
imports.wbg.__wbg_new_5b651b9b6590037e = function() { | ||
const ret = new Map(); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_number_new = function(arg0) { | ||
const ret = arg0; | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_string_new = function(arg0, arg1) { | ||
const ret = getStringFromWasm0(arg0, arg1); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_number_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'number' ? obj : undefined; | ||
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; | ||
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); | ||
}; | ||
imports.wbg.__wbindgen_is_undefined = function(arg0) { | ||
const ret = getObject(arg0) === undefined; | ||
imports.wbg.__wbg_constructor_bc5e3569b1bc20f1 = function(arg0) { | ||
const ret = new Error(arg0); | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_new_abda76e883ba8a5f = function() { | ||
const ret = new Error(); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) { | ||
const ret = getObject(arg1).stack; | ||
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len1 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len1; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr1; | ||
}; | ||
imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) { | ||
imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) { | ||
let deferred0_0; | ||
@@ -326,6 +225,6 @@ let deferred0_1; | ||
} finally { | ||
wasm.__wbindgen_free(deferred0_0, deferred0_1); | ||
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); | ||
} | ||
}; | ||
imports.wbg.__wbg_forEach_942772130a8d06a6 = function(arg0, arg1, arg2) { | ||
imports.wbg.__wbg_forEach_e1cf6f7c8ecb7dae = function(arg0, arg1, arg2) { | ||
try { | ||
@@ -337,3 +236,3 @@ var state0 = {a: arg1, b: arg2}; | ||
try { | ||
return __wbg_adapter_28(a, state0.b, arg0, arg1); | ||
return __wbg_adapter_30(a, state0.b, arg0, arg1); | ||
} finally { | ||
@@ -343,3 +242,3 @@ state0.a = a; | ||
}; | ||
getObject(arg0).forEach(cb0); | ||
arg0.forEach(cb0); | ||
} finally { | ||
@@ -349,14 +248,65 @@ state0.a = state0.b = 0; | ||
}; | ||
imports.wbg.__wbg_set_da7be7bf0e037b14 = function(arg0, arg1, arg2) { | ||
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2)); | ||
return addHeapObject(ret); | ||
imports.wbg.__wbg_new_0b7dab710d4e469e = function() { | ||
const ret = new Map(); | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) { | ||
imports.wbg.__wbg_new_8a6f238a6ece86ea = function() { | ||
const ret = new Error(); | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_parse_def2e24ef1252aff = function() { return handleError(function (arg0, arg1) { | ||
const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
return ret; | ||
}, arguments) }; | ||
imports.wbg.__wbg_stringify_d06ad2addc54d51e = function() { return handleError(function (arg0) { | ||
const ret = JSON.stringify(getObject(arg0)); | ||
return addHeapObject(ret); | ||
imports.wbg.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) { | ||
const ret = arg0.set(arg1, arg2); | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) { | ||
const ret = arg1.stack; | ||
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len1 = WASM_VECTOR_LEN; | ||
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); | ||
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); | ||
}; | ||
imports.wbg.__wbg_stringify_f7ed6987935b4a24 = function() { return handleError(function (arg0) { | ||
const ret = JSON.stringify(arg0); | ||
return ret; | ||
}, arguments) }; | ||
imports.wbg.__wbindgen_init_externref_table = function() { | ||
const table = wasm.__wbindgen_export_3; | ||
const offset = table.grow(4); | ||
table.set(0, undefined); | ||
table.set(offset + 0, undefined); | ||
table.set(offset + 1, null); | ||
table.set(offset + 2, true); | ||
table.set(offset + 3, false); | ||
; | ||
}; | ||
imports.wbg.__wbindgen_is_undefined = function(arg0) { | ||
const ret = arg0 === undefined; | ||
return ret; | ||
}; | ||
imports.wbg.__wbindgen_number_get = function(arg0, arg1) { | ||
const obj = arg1; | ||
const ret = typeof(obj) === 'number' ? obj : undefined; | ||
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true); | ||
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true); | ||
}; | ||
imports.wbg.__wbindgen_number_new = function(arg0) { | ||
const ret = arg0; | ||
return ret; | ||
}; | ||
imports.wbg.__wbindgen_string_get = function(arg0, arg1) { | ||
const obj = arg1; | ||
const ret = typeof(obj) === 'string' ? obj : undefined; | ||
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len1 = WASM_VECTOR_LEN; | ||
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); | ||
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); | ||
}; | ||
imports.wbg.__wbindgen_string_new = function(arg0, arg1) { | ||
const ret = getStringFromWasm0(arg0, arg1); | ||
return ret; | ||
}; | ||
imports.wbg.__wbindgen_throw = function(arg0, arg1) { | ||
@@ -369,3 +319,3 @@ throw new Error(getStringFromWasm0(arg0, arg1)); | ||
function __wbg_init_memory(imports, maybe_memory) { | ||
function __wbg_init_memory(imports, memory) { | ||
@@ -377,7 +327,7 @@ } | ||
__wbg_init.__wbindgen_wasm_module = module; | ||
cachedFloat64Memory0 = null; | ||
cachedInt32Memory0 = null; | ||
cachedUint8Memory0 = null; | ||
cachedDataViewMemory0 = null; | ||
cachedUint8ArrayMemory0 = null; | ||
wasm.__wbindgen_start(); | ||
return wasm; | ||
@@ -389,2 +339,11 @@ } | ||
if (typeof module !== 'undefined') { | ||
if (Object.getPrototypeOf(module) === Object.prototype) { | ||
({module} = module) | ||
} else { | ||
console.warn('using deprecated parameters for `initSync()`; pass a single object instead') | ||
} | ||
} | ||
const imports = __wbg_get_imports(); | ||
@@ -403,12 +362,21 @@ | ||
async function __wbg_init(input) { | ||
async function __wbg_init(module_or_path) { | ||
if (wasm !== undefined) return wasm; | ||
if (typeof input === 'undefined') { | ||
input = new URL('noirc_abi_wasm_bg.wasm', import.meta.url); | ||
if (typeof module_or_path !== 'undefined') { | ||
if (Object.getPrototypeOf(module_or_path) === Object.prototype) { | ||
({module_or_path} = module_or_path) | ||
} else { | ||
console.warn('using deprecated parameters for the initialization function; pass a single object instead') | ||
} | ||
} | ||
if (typeof module_or_path === 'undefined') { | ||
module_or_path = new URL('noirc_abi_wasm_bg.wasm', import.meta.url); | ||
} | ||
const imports = __wbg_get_imports(); | ||
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) { | ||
input = fetch(input); | ||
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) { | ||
module_or_path = fetch(module_or_path); | ||
} | ||
@@ -418,3 +386,3 @@ | ||
const { instance, module } = await __wbg_load(await input, imports); | ||
const { instance, module } = await __wbg_load(await module_or_path, imports); | ||
@@ -424,3 +392,3 @@ return __wbg_finalize_init(instance, module); | ||
export { initSync } | ||
export { initSync }; | ||
export default __wbg_init; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1248631
12.01%656
-13.23%2
100%+ Added
- Removed