@automerge/sedimentree 0.8.1 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/wasm-base64.cjs +1 -1
- package/dist/cjs/web-bindings.cjs +136 -23
- package/dist/cjs/web.cjs +137 -24
- package/dist/esm/wasm-base64.js +1 -1
- package/dist/iife/index.js +137 -24
- package/dist/index.d.ts +7 -0
- package/dist/sedimentree.wasm +0 -0
- package/dist/wasm_bindgen/bundler/sedimentree_wasm.d.ts +7 -0
- package/dist/wasm_bindgen/bundler/sedimentree_wasm_bg.js +144 -24
- package/dist/wasm_bindgen/bundler/sedimentree_wasm_bg.wasm +0 -0
- package/dist/wasm_bindgen/bundler/sedimentree_wasm_bg.wasm.d.ts +10 -9
- package/dist/wasm_bindgen/nodejs/sedimentree_wasm.cjs +144 -24
- package/dist/wasm_bindgen/nodejs/sedimentree_wasm.d.ts +7 -0
- package/dist/wasm_bindgen/nodejs/sedimentree_wasm_bg.wasm +0 -0
- package/dist/wasm_bindgen/nodejs/sedimentree_wasm_bg.wasm.d.ts +10 -9
- package/dist/wasm_bindgen/web/sedimentree_wasm.d.ts +17 -9
- package/dist/wasm_bindgen/web/sedimentree_wasm.js +144 -24
- package/dist/wasm_bindgen/web/sedimentree_wasm_bg.wasm +0 -0
- package/dist/wasm_bindgen/web/sedimentree_wasm_bg.wasm.d.ts +10 -9
- package/package.json +1 -1
- /package/dist/wasm_bindgen/bundler/snippets/{sedimentree_wasm-7c7e743695651440 → sedimentree_wasm-c507f5285f2927a0}/inline0.js +0 -0
- /package/dist/wasm_bindgen/bundler/snippets/{sedimentree_wasm-7c7e743695651440 → sedimentree_wasm-c507f5285f2927a0}/inline1.js +0 -0
- /package/dist/wasm_bindgen/bundler/snippets/{sedimentree_wasm-7c7e743695651440 → sedimentree_wasm-c507f5285f2927a0}/inline2.js +0 -0
- /package/dist/wasm_bindgen/nodejs/snippets/{sedimentree_wasm-7c7e743695651440 → sedimentree_wasm-c507f5285f2927a0}/inline0.js +0 -0
- /package/dist/wasm_bindgen/nodejs/snippets/{sedimentree_wasm-7c7e743695651440 → sedimentree_wasm-c507f5285f2927a0}/inline1.js +0 -0
- /package/dist/wasm_bindgen/nodejs/snippets/{sedimentree_wasm-7c7e743695651440 → sedimentree_wasm-c507f5285f2927a0}/inline2.js +0 -0
- /package/dist/wasm_bindgen/web/snippets/{sedimentree_wasm-7c7e743695651440 → sedimentree_wasm-c507f5285f2927a0}/inline0.js +0 -0
- /package/dist/wasm_bindgen/web/snippets/{sedimentree_wasm-7c7e743695651440 → sedimentree_wasm-c507f5285f2927a0}/inline1.js +0 -0
- /package/dist/wasm_bindgen/web/snippets/{sedimentree_wasm-7c7e743695651440 → sedimentree_wasm-c507f5285f2927a0}/inline2.js +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,9 @@ export interface SedimentreeStorage {
|
|
|
21
21
|
loadAllFragments(sedimentreeId: SedimentreeId): Promise<FragmentWithBlob[]>;
|
|
22
22
|
deleteFragment(sedimentreeId: SedimentreeId, digest: Digest): Promise<void>;
|
|
23
23
|
deleteAllFragments(sedimentreeId: SedimentreeId): Promise<void>;
|
|
24
|
+
|
|
25
|
+
// Batch save: write all commits + fragments in a single storage transaction.
|
|
26
|
+
saveBatchAll(sedimentreeId: SedimentreeId, commits: Array<{digest: Digest, signedCommit: SignedLooseCommit, blob: Uint8Array}>, fragments: Array<{digest: Digest, signedFragment: SignedFragment, blob: Uint8Array}>): Promise<number>;
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
|
|
@@ -309,6 +312,10 @@ export class MemoryStorage {
|
|
|
309
312
|
* Create a new in-memory storage instance.
|
|
310
313
|
*/
|
|
311
314
|
constructor();
|
|
315
|
+
/**
|
|
316
|
+
* Save commits and fragments in a single batch.
|
|
317
|
+
*/
|
|
318
|
+
saveBatchAll(sedimentree_id: SedimentreeId, commits: Array<any>, fragments: Array<any>): Promise<any>;
|
|
312
319
|
/**
|
|
313
320
|
* Save a commit with its blob.
|
|
314
321
|
*/
|
package/dist/sedimentree.wasm
CHANGED
|
Binary file
|
|
@@ -21,6 +21,9 @@ export interface SedimentreeStorage {
|
|
|
21
21
|
loadAllFragments(sedimentreeId: SedimentreeId): Promise<FragmentWithBlob[]>;
|
|
22
22
|
deleteFragment(sedimentreeId: SedimentreeId, digest: Digest): Promise<void>;
|
|
23
23
|
deleteAllFragments(sedimentreeId: SedimentreeId): Promise<void>;
|
|
24
|
+
|
|
25
|
+
// Batch save: write all commits + fragments in a single storage transaction.
|
|
26
|
+
saveBatchAll(sedimentreeId: SedimentreeId, commits: Array<{digest: Digest, signedCommit: SignedLooseCommit, blob: Uint8Array}>, fragments: Array<{digest: Digest, signedFragment: SignedFragment, blob: Uint8Array}>): Promise<number>;
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
|
|
@@ -309,6 +312,10 @@ export class MemoryStorage {
|
|
|
309
312
|
* Create a new in-memory storage instance.
|
|
310
313
|
*/
|
|
311
314
|
constructor();
|
|
315
|
+
/**
|
|
316
|
+
* Save commits and fragments in a single batch.
|
|
317
|
+
*/
|
|
318
|
+
saveBatchAll(sedimentree_id: SedimentreeId, commits: Array<any>, fragments: Array<any>): Promise<any>;
|
|
312
319
|
/**
|
|
313
320
|
* Save a commit with its blob.
|
|
314
321
|
*/
|
|
@@ -46,7 +46,7 @@ export class BlobMeta {
|
|
|
46
46
|
* @param {Uint8Array} blob
|
|
47
47
|
*/
|
|
48
48
|
constructor(blob) {
|
|
49
|
-
const ptr0 = passArray8ToWasm0(blob, wasm.
|
|
49
|
+
const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_export);
|
|
50
50
|
const len0 = WASM_VECTOR_LEN;
|
|
51
51
|
const ret = wasm.blobmeta_new(ptr0, len0);
|
|
52
52
|
this.__wbg_ptr = ret >>> 0;
|
|
@@ -232,7 +232,7 @@ export class Digest {
|
|
|
232
232
|
* @returns {Digest}
|
|
233
233
|
*/
|
|
234
234
|
static fromBase58(s) {
|
|
235
|
-
const ptr0 = passStringToWasm0(s, wasm.
|
|
235
|
+
const ptr0 = passStringToWasm0(s, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
236
236
|
const len0 = WASM_VECTOR_LEN;
|
|
237
237
|
const ret = wasm.digest_fromBase58(ptr0, len0);
|
|
238
238
|
if (ret[2]) {
|
|
@@ -250,7 +250,7 @@ export class Digest {
|
|
|
250
250
|
* @returns {Digest}
|
|
251
251
|
*/
|
|
252
252
|
static fromBytes(bytes) {
|
|
253
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.
|
|
253
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
254
254
|
const len0 = WASM_VECTOR_LEN;
|
|
255
255
|
const ret = wasm.digest_fromBytes(ptr0, len0);
|
|
256
256
|
if (ret[2]) {
|
|
@@ -268,7 +268,7 @@ export class Digest {
|
|
|
268
268
|
* @returns {Digest}
|
|
269
269
|
*/
|
|
270
270
|
static fromHexString(s) {
|
|
271
|
-
const ptr0 = passStringToWasm0(s, wasm.
|
|
271
|
+
const ptr0 = passStringToWasm0(s, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
272
272
|
const len0 = WASM_VECTOR_LEN;
|
|
273
273
|
const ret = wasm.digest_fromHexString(ptr0, len0);
|
|
274
274
|
if (ret[2]) {
|
|
@@ -285,7 +285,7 @@ export class Digest {
|
|
|
285
285
|
* @param {Uint8Array} bytes
|
|
286
286
|
*/
|
|
287
287
|
constructor(bytes) {
|
|
288
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.
|
|
288
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
289
289
|
const len0 = WASM_VECTOR_LEN;
|
|
290
290
|
const ret = wasm.digest_new(ptr0, len0);
|
|
291
291
|
if (ret[2]) {
|
|
@@ -392,9 +392,9 @@ export class Fragment {
|
|
|
392
392
|
var ptr0 = sedimentree_id.__destroy_into_raw();
|
|
393
393
|
_assertClass(head, Digest);
|
|
394
394
|
var ptr1 = head.__destroy_into_raw();
|
|
395
|
-
const ptr2 = passArrayJsValueToWasm0(boundary, wasm.
|
|
395
|
+
const ptr2 = passArrayJsValueToWasm0(boundary, wasm.__wbindgen_export);
|
|
396
396
|
const len2 = WASM_VECTOR_LEN;
|
|
397
|
-
const ptr3 = passArrayJsValueToWasm0(checkpoints, wasm.
|
|
397
|
+
const ptr3 = passArrayJsValueToWasm0(checkpoints, wasm.__wbindgen_export);
|
|
398
398
|
const len3 = WASM_VECTOR_LEN;
|
|
399
399
|
_assertClass(blob_meta, BlobMeta);
|
|
400
400
|
var ptr4 = blob_meta.__destroy_into_raw();
|
|
@@ -550,7 +550,7 @@ export class LooseCommit {
|
|
|
550
550
|
constructor(sedimentree_id, parents, blob_meta) {
|
|
551
551
|
_assertClass(sedimentree_id, SedimentreeId);
|
|
552
552
|
var ptr0 = sedimentree_id.__destroy_into_raw();
|
|
553
|
-
const ptr1 = passArrayJsValueToWasm0(parents, wasm.
|
|
553
|
+
const ptr1 = passArrayJsValueToWasm0(parents, wasm.__wbindgen_export);
|
|
554
554
|
const len1 = WASM_VECTOR_LEN;
|
|
555
555
|
_assertClass(blob_meta, BlobMeta);
|
|
556
556
|
const ret = wasm.loosecommit_new(ptr0, ptr1, len1, blob_meta.__wbg_ptr);
|
|
@@ -722,6 +722,18 @@ export class MemoryStorage {
|
|
|
722
722
|
MemoryStorageFinalization.register(this, this.__wbg_ptr, this);
|
|
723
723
|
return this;
|
|
724
724
|
}
|
|
725
|
+
/**
|
|
726
|
+
* Save commits and fragments in a single batch.
|
|
727
|
+
* @param {SedimentreeId} sedimentree_id
|
|
728
|
+
* @param {Array<any>} commits
|
|
729
|
+
* @param {Array<any>} fragments
|
|
730
|
+
* @returns {Promise<any>}
|
|
731
|
+
*/
|
|
732
|
+
saveBatchAll(sedimentree_id, commits, fragments) {
|
|
733
|
+
_assertClass(sedimentree_id, SedimentreeId);
|
|
734
|
+
const ret = wasm.memorystorage_saveBatchAll(this.__wbg_ptr, sedimentree_id.__wbg_ptr, commits, fragments);
|
|
735
|
+
return ret;
|
|
736
|
+
}
|
|
725
737
|
/**
|
|
726
738
|
* Save a commit with its blob.
|
|
727
739
|
* @param {SedimentreeId} sedimentree_id
|
|
@@ -800,9 +812,9 @@ export class Sedimentree {
|
|
|
800
812
|
* @param {LooseCommit[]} commits
|
|
801
813
|
*/
|
|
802
814
|
constructor(fragments, commits) {
|
|
803
|
-
const ptr0 = passArrayJsValueToWasm0(fragments, wasm.
|
|
815
|
+
const ptr0 = passArrayJsValueToWasm0(fragments, wasm.__wbindgen_export);
|
|
804
816
|
const len0 = WASM_VECTOR_LEN;
|
|
805
|
-
const ptr1 = passArrayJsValueToWasm0(commits, wasm.
|
|
817
|
+
const ptr1 = passArrayJsValueToWasm0(commits, wasm.__wbindgen_export);
|
|
806
818
|
const len1 = WASM_VECTOR_LEN;
|
|
807
819
|
const ret = wasm.sedimentree_new(ptr0, len0, ptr1, len1);
|
|
808
820
|
this.__wbg_ptr = ret >>> 0;
|
|
@@ -851,7 +863,7 @@ export class SedimentreeId {
|
|
|
851
863
|
* @returns {SedimentreeId}
|
|
852
864
|
*/
|
|
853
865
|
static fromBytes(bytes) {
|
|
854
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.
|
|
866
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
855
867
|
const len0 = WASM_VECTOR_LEN;
|
|
856
868
|
const ret = wasm.sedimentreeid_fromBytes(ptr0, len0);
|
|
857
869
|
if (ret[2]) {
|
|
@@ -928,6 +940,12 @@ export class SignedFragment {
|
|
|
928
940
|
SignedFragmentFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
929
941
|
return obj;
|
|
930
942
|
}
|
|
943
|
+
static __unwrap(jsValue) {
|
|
944
|
+
if (!(jsValue instanceof SignedFragment)) {
|
|
945
|
+
return 0;
|
|
946
|
+
}
|
|
947
|
+
return jsValue.__destroy_into_raw();
|
|
948
|
+
}
|
|
931
949
|
__destroy_into_raw() {
|
|
932
950
|
const ptr = this.__wbg_ptr;
|
|
933
951
|
this.__wbg_ptr = 0;
|
|
@@ -999,6 +1017,12 @@ export class SignedLooseCommit {
|
|
|
999
1017
|
SignedLooseCommitFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1000
1018
|
return obj;
|
|
1001
1019
|
}
|
|
1020
|
+
static __unwrap(jsValue) {
|
|
1021
|
+
if (!(jsValue instanceof SignedLooseCommit)) {
|
|
1022
|
+
return 0;
|
|
1023
|
+
}
|
|
1024
|
+
return jsValue.__destroy_into_raw();
|
|
1025
|
+
}
|
|
1002
1026
|
__destroy_into_raw() {
|
|
1003
1027
|
const ptr = this.__wbg_ptr;
|
|
1004
1028
|
this.__wbg_ptr = 0;
|
|
@@ -1058,24 +1082,31 @@ export class SignedLooseCommit {
|
|
|
1058
1082
|
}
|
|
1059
1083
|
}
|
|
1060
1084
|
if (Symbol.dispose) SignedLooseCommit.prototype[Symbol.dispose] = SignedLooseCommit.prototype.free;
|
|
1061
|
-
export function
|
|
1085
|
+
export function __wbg___wasm_refgen_toWasmDigest_476b24805f220005(arg0) {
|
|
1062
1086
|
const ret = arg0.__wasm_refgen_toWasmDigest();
|
|
1063
1087
|
_assertClass(ret, Digest);
|
|
1064
1088
|
var ptr1 = ret.__destroy_into_raw();
|
|
1065
1089
|
return ptr1;
|
|
1066
1090
|
}
|
|
1067
|
-
export function
|
|
1091
|
+
export function __wbg___wasm_refgen_toWasmFragment_10dd1ff9b3934840(arg0) {
|
|
1068
1092
|
const ret = arg0.__wasm_refgen_toWasmFragment();
|
|
1069
1093
|
_assertClass(ret, Fragment);
|
|
1070
1094
|
var ptr1 = ret.__destroy_into_raw();
|
|
1071
1095
|
return ptr1;
|
|
1072
1096
|
}
|
|
1073
|
-
export function
|
|
1097
|
+
export function __wbg___wasm_refgen_toWasmLooseCommit_f36ad6a9389cee03(arg0) {
|
|
1074
1098
|
const ret = arg0.__wasm_refgen_toWasmLooseCommit();
|
|
1075
1099
|
_assertClass(ret, LooseCommit);
|
|
1076
1100
|
var ptr1 = ret.__destroy_into_raw();
|
|
1077
1101
|
return ptr1;
|
|
1078
1102
|
}
|
|
1103
|
+
export function __wbg___wbindgen_debug_string_5398f5bb970e0daa(arg0, arg1) {
|
|
1104
|
+
const ret = debugString(arg1);
|
|
1105
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1106
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1107
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1108
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1109
|
+
}
|
|
1079
1110
|
export function __wbg___wbindgen_is_function_3c846841762788c1(arg0) {
|
|
1080
1111
|
const ret = typeof(arg0) === 'function';
|
|
1081
1112
|
return ret;
|
|
@@ -1112,14 +1143,30 @@ export function __wbg_fragmentwithblob_new(arg0) {
|
|
|
1112
1143
|
const ret = FragmentWithBlob.__wrap(arg0);
|
|
1113
1144
|
return ret;
|
|
1114
1145
|
}
|
|
1146
|
+
export function __wbg_get_3ef1eba1850ade27() { return handleError(function (arg0, arg1) {
|
|
1147
|
+
const ret = Reflect.get(arg0, arg1);
|
|
1148
|
+
return ret;
|
|
1149
|
+
}, arguments); }
|
|
1150
|
+
export function __wbg_get_unchecked_329cfe50afab7352(arg0, arg1) {
|
|
1151
|
+
const ret = arg0[arg1 >>> 0];
|
|
1152
|
+
return ret;
|
|
1153
|
+
}
|
|
1115
1154
|
export function __wbg_isSafeInteger_ecd6a7f9c3e053cd(arg0) {
|
|
1116
1155
|
const ret = Number.isSafeInteger(arg0);
|
|
1117
1156
|
return ret;
|
|
1118
1157
|
}
|
|
1158
|
+
export function __wbg_length_b3416cf66a5452c8(arg0) {
|
|
1159
|
+
const ret = arg0.length;
|
|
1160
|
+
return ret;
|
|
1161
|
+
}
|
|
1119
1162
|
export function __wbg_length_ea16607d7b61445b(arg0) {
|
|
1120
1163
|
const ret = arg0.length;
|
|
1121
1164
|
return ret;
|
|
1122
1165
|
}
|
|
1166
|
+
export function __wbg_new_5f486cdf45a04d78(arg0) {
|
|
1167
|
+
const ret = new Uint8Array(arg0);
|
|
1168
|
+
return ret;
|
|
1169
|
+
}
|
|
1123
1170
|
export function __wbg_new_a70fbab9066b301f() {
|
|
1124
1171
|
const ret = new Array();
|
|
1125
1172
|
return ret;
|
|
@@ -1139,7 +1186,7 @@ export function __wbg_new_typed_aaaeaf29cf802876(arg0, arg1) {
|
|
|
1139
1186
|
const a = state0.a;
|
|
1140
1187
|
state0.a = 0;
|
|
1141
1188
|
try {
|
|
1142
|
-
return
|
|
1189
|
+
return __wasm_bindgen_func_elem_552_67(a, state0.b, arg0, arg1);
|
|
1143
1190
|
} finally {
|
|
1144
1191
|
state0.a = a;
|
|
1145
1192
|
}
|
|
@@ -1175,6 +1222,14 @@ export function __wbg_sedimentreeid_new(arg0) {
|
|
|
1175
1222
|
export function __wbg_set_name_7ef37fe858379aaf(arg0, arg1, arg2) {
|
|
1176
1223
|
arg0.name = getStringFromWasm0(arg1, arg2);
|
|
1177
1224
|
}
|
|
1225
|
+
export function __wbg_signedfragment_unwrap(arg0) {
|
|
1226
|
+
const ret = SignedFragment.__unwrap(arg0);
|
|
1227
|
+
return ret;
|
|
1228
|
+
}
|
|
1229
|
+
export function __wbg_signedloosecommit_unwrap(arg0) {
|
|
1230
|
+
const ret = SignedLooseCommit.__unwrap(arg0);
|
|
1231
|
+
return ret;
|
|
1232
|
+
}
|
|
1178
1233
|
export function __wbg_static_accessor_GLOBAL_8adb955bd33fac2f() {
|
|
1179
1234
|
const ret = typeof global === 'undefined' ? null : global;
|
|
1180
1235
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
@@ -1196,8 +1251,8 @@ export function __wbg_then_098abe61755d12f6(arg0, arg1) {
|
|
|
1196
1251
|
return ret;
|
|
1197
1252
|
}
|
|
1198
1253
|
export function __wbindgen_cast_0000000000000001(arg0, arg1) {
|
|
1199
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1200
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1254
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 70, function: Function { arguments: [Externref], shim_idx: 132, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1255
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_385, __wasm_bindgen_func_elem_552);
|
|
1201
1256
|
return ret;
|
|
1202
1257
|
}
|
|
1203
1258
|
export function __wbindgen_cast_0000000000000002(arg0) {
|
|
@@ -1219,15 +1274,15 @@ export function __wbindgen_init_externref_table() {
|
|
|
1219
1274
|
table.set(offset + 2, true);
|
|
1220
1275
|
table.set(offset + 3, false);
|
|
1221
1276
|
}
|
|
1222
|
-
function
|
|
1223
|
-
const ret = wasm.
|
|
1277
|
+
function __wasm_bindgen_func_elem_552(arg0, arg1, arg2) {
|
|
1278
|
+
const ret = wasm.__wasm_bindgen_func_elem_552(arg0, arg1, arg2);
|
|
1224
1279
|
if (ret[1]) {
|
|
1225
1280
|
throw takeFromExternrefTable0(ret[0]);
|
|
1226
1281
|
}
|
|
1227
1282
|
}
|
|
1228
1283
|
|
|
1229
|
-
function
|
|
1230
|
-
wasm.
|
|
1284
|
+
function __wasm_bindgen_func_elem_552_67(arg0, arg1, arg2, arg3) {
|
|
1285
|
+
wasm.__wasm_bindgen_func_elem_552_67(arg0, arg1, arg2, arg3);
|
|
1231
1286
|
}
|
|
1232
1287
|
|
|
1233
1288
|
const MemoryStorageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -1274,7 +1329,7 @@ const SignedLooseCommitFinalization = (typeof FinalizationRegistry === 'undefine
|
|
|
1274
1329
|
: new FinalizationRegistry(ptr => wasm.__wbg_signedloosecommit_free(ptr >>> 0, 1));
|
|
1275
1330
|
|
|
1276
1331
|
function addToExternrefTable0(obj) {
|
|
1277
|
-
const idx = wasm.
|
|
1332
|
+
const idx = wasm.__wbindgen_export4();
|
|
1278
1333
|
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
1279
1334
|
return idx;
|
|
1280
1335
|
}
|
|
@@ -1289,6 +1344,71 @@ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
|
1289
1344
|
? { register: () => {}, unregister: () => {} }
|
|
1290
1345
|
: new FinalizationRegistry(state => state.dtor(state.a, state.b));
|
|
1291
1346
|
|
|
1347
|
+
function debugString(val) {
|
|
1348
|
+
// primitive types
|
|
1349
|
+
const type = typeof val;
|
|
1350
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
1351
|
+
return `${val}`;
|
|
1352
|
+
}
|
|
1353
|
+
if (type == 'string') {
|
|
1354
|
+
return `"${val}"`;
|
|
1355
|
+
}
|
|
1356
|
+
if (type == 'symbol') {
|
|
1357
|
+
const description = val.description;
|
|
1358
|
+
if (description == null) {
|
|
1359
|
+
return 'Symbol';
|
|
1360
|
+
} else {
|
|
1361
|
+
return `Symbol(${description})`;
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
if (type == 'function') {
|
|
1365
|
+
const name = val.name;
|
|
1366
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
1367
|
+
return `Function(${name})`;
|
|
1368
|
+
} else {
|
|
1369
|
+
return 'Function';
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
// objects
|
|
1373
|
+
if (Array.isArray(val)) {
|
|
1374
|
+
const length = val.length;
|
|
1375
|
+
let debug = '[';
|
|
1376
|
+
if (length > 0) {
|
|
1377
|
+
debug += debugString(val[0]);
|
|
1378
|
+
}
|
|
1379
|
+
for(let i = 1; i < length; i++) {
|
|
1380
|
+
debug += ', ' + debugString(val[i]);
|
|
1381
|
+
}
|
|
1382
|
+
debug += ']';
|
|
1383
|
+
return debug;
|
|
1384
|
+
}
|
|
1385
|
+
// Test for built-in
|
|
1386
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
1387
|
+
let className;
|
|
1388
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
1389
|
+
className = builtInMatches[1];
|
|
1390
|
+
} else {
|
|
1391
|
+
// Failed to match the standard '[object ClassName]'
|
|
1392
|
+
return toString.call(val);
|
|
1393
|
+
}
|
|
1394
|
+
if (className == 'Object') {
|
|
1395
|
+
// we're a user defined class or Object
|
|
1396
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
1397
|
+
// easier than looping through ownProperties of `val`.
|
|
1398
|
+
try {
|
|
1399
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
1400
|
+
} catch (_) {
|
|
1401
|
+
return 'Object';
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
// errors
|
|
1405
|
+
if (val instanceof Error) {
|
|
1406
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
1407
|
+
}
|
|
1408
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
1409
|
+
return className;
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1292
1412
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
1293
1413
|
ptr = ptr >>> 0;
|
|
1294
1414
|
const mem = getDataViewMemory0();
|
|
@@ -1331,7 +1451,7 @@ function handleError(f, args) {
|
|
|
1331
1451
|
return f.apply(this, args);
|
|
1332
1452
|
} catch (e) {
|
|
1333
1453
|
const idx = addToExternrefTable0(e);
|
|
1334
|
-
wasm.
|
|
1454
|
+
wasm.__wbindgen_export3(idx);
|
|
1335
1455
|
}
|
|
1336
1456
|
}
|
|
1337
1457
|
|
|
@@ -1423,7 +1543,7 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
1423
1543
|
|
|
1424
1544
|
function takeFromExternrefTable0(idx) {
|
|
1425
1545
|
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
1426
|
-
wasm.
|
|
1546
|
+
wasm.__wbindgen_export5(idx);
|
|
1427
1547
|
return value;
|
|
1428
1548
|
}
|
|
1429
1549
|
|
|
Binary file
|
|
@@ -72,23 +72,24 @@ export const memorystorage_listFragmentDigests: (a: number, b: number) => any;
|
|
|
72
72
|
export const memorystorage_loadAllFragments: (a: number, b: number) => any;
|
|
73
73
|
export const memorystorage_deleteFragment: (a: number, b: number, c: number) => any;
|
|
74
74
|
export const memorystorage_deleteAllFragments: (a: number, b: number) => any;
|
|
75
|
+
export const memorystorage_saveBatchAll: (a: number, b: number, c: any, d: any) => any;
|
|
75
76
|
export const depth___wasm_refgen_toWasmDepth: (a: number) => number;
|
|
76
77
|
export const fragmentwithblob_new: (a: number, b: any) => number;
|
|
77
78
|
export const __wbg_sedimentreeid_free: (a: number, b: number) => void;
|
|
78
79
|
export const __wbg_fragmentwithblob_free: (a: number, b: number) => void;
|
|
79
80
|
export const __wbg_signedloosecommit_free: (a: number, b: number) => void;
|
|
80
|
-
export const sedimentreeid___wasm_refgen_toWasmSedimentreeId: (a: number) => number;
|
|
81
81
|
export const sedimentreeid_toBytes: (a: number) => [number, number];
|
|
82
|
+
export const sedimentreeid___wasm_refgen_toWasmSedimentreeId: (a: number) => number;
|
|
82
83
|
export const fragmentwithblob_blob: (a: number) => any;
|
|
83
|
-
export const
|
|
84
|
-
export const
|
|
85
|
-
export const
|
|
86
|
-
export const __wbindgen_export: (a: number) =>
|
|
87
|
-
export const __wbindgen_export2: () => number;
|
|
84
|
+
export const __wasm_bindgen_func_elem_385: (a: number, b: number) => void;
|
|
85
|
+
export const __wasm_bindgen_func_elem_552: (a: number, b: number, c: any) => [number, number];
|
|
86
|
+
export const __wasm_bindgen_func_elem_552_67: (a: number, b: number, c: any, d: any) => void;
|
|
87
|
+
export const __wbindgen_export: (a: number, b: number) => number;
|
|
88
|
+
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
89
|
+
export const __wbindgen_export3: (a: number) => void;
|
|
90
|
+
export const __wbindgen_export4: () => number;
|
|
88
91
|
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
89
|
-
export const
|
|
90
|
-
export const __wbindgen_export4: (a: number) => void;
|
|
91
|
-
export const __wbindgen_export5: (a: number, b: number, c: number, d: number) => number;
|
|
92
|
+
export const __wbindgen_export5: (a: number) => void;
|
|
92
93
|
export const __wbindgen_export6: (a: number, b: number, c: number) => void;
|
|
93
94
|
export const __wbindgen_export7: (a: number, b: number) => void;
|
|
94
95
|
export const __wbindgen_start: () => void;
|