@loro-dev/flock 2.1.0 → 2.1.2

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/src/index.ts CHANGED
@@ -570,9 +570,8 @@ export class Flock {
570
570
  metadata?: MetadataMap,
571
571
  now?: number,
572
572
  ): void {
573
- const clonedValue = cloneJson(value);
574
573
  const metadataClone = cloneMetadata(metadata);
575
- put_with_meta_ffi(this.inner, key, clonedValue, metadataClone, now);
574
+ put_with_meta_ffi(this.inner, key, JSON.stringify(value), metadataClone, now);
576
575
  }
577
576
 
578
577
  private async putWithMetaWithHooks(
@@ -614,7 +613,7 @@ export class Flock {
614
613
  * @param now
615
614
  */
616
615
  put(key: KeyPart[], value: Value, now?: number): void {
617
- put_json_ffi(this.inner, key, value, now);
616
+ put_json_ffi(this.inner, key, JSON.stringify(value), now);
618
617
  }
619
618
 
620
619
  putWithMeta(key: KeyPart[], value: Value, options?: PutWithMetaOptions): void | Promise<void> {
@@ -776,7 +775,7 @@ export class Flock {
776
775
  }
777
776
 
778
777
  putMvr(key: KeyPart[], value: Value, now?: number): void {
779
- put_mvr_ffi(this.inner, key, value, now);
778
+ put_mvr_ffi(this.inner, key, JSON.stringify(value), now);
780
779
  }
781
780
 
782
781
  getMvr(key: KeyPart[]): Value[] {