loro-crdt 1.2.0 → 1.2.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - adb6ab8: fix: panic when returned non-boolean value from text.iter(f) #578
8
+
3
9
  ## 1.2.0
4
10
 
5
11
  ### Minor Changes
package/base64/index.js CHANGED
@@ -3852,13 +3852,19 @@ class LoroText {
3852
3852
  * text.insert(0, "Hello");
3853
3853
  * text.iter((str) => (console.log(str), true));
3854
3854
  * ```
3855
- * @param {Function} callback
3855
+ * @param {(string) => boolean} callback
3856
3856
  */
3857
3857
  iter(callback) {
3858
3858
  try {
3859
- wasm.lorotext_iter(this.__wbg_ptr, addBorrowedObject(callback));
3859
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3860
+ wasm.lorotext_iter(retptr, this.__wbg_ptr, addHeapObject(callback));
3861
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
3862
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
3863
+ if (r1) {
3864
+ throw takeObject(r0);
3865
+ }
3860
3866
  } finally {
3861
- heap[stack_pointer++] = undefined;
3867
+ wasm.__wbindgen_add_to_stack_pointer(16);
3862
3868
  }
3863
3869
  }
3864
3870
  /**
@@ -6251,7 +6257,7 @@ var imports = /*#__PURE__*/Object.freeze({
6251
6257
  // Without this patch, Cloudflare Worker would raise issue like: "Uncaught TypeError: wasm2.__wbindgen_start is not a function"
6252
6258
 
6253
6259
 
6254
- import loro_wasm_bg_js from './loro_wasm_bg-543a4cca.js';
6260
+ import loro_wasm_bg_js from './loro_wasm_bg-101e42d1.js';
6255
6261
  const instance = new WebAssembly.Instance(loro_wasm_bg_js(), {
6256
6262
  "./loro_wasm_bg.js": imports,
6257
6263
  });
@@ -2542,9 +2542,9 @@ export class LoroText {
2542
2542
  * text.insert(0, "Hello");
2543
2543
  * text.iter((str) => (console.log(str), true));
2544
2544
  * ```
2545
- * @param {Function} callback
2545
+ * @param {(string) => boolean} callback
2546
2546
  */
2547
- iter(callback: Function): void;
2547
+ iter(callback: (string) => boolean): void;
2548
2548
  /**
2549
2549
  * Insert the string at the given index (utf-16 index).
2550
2550
  *