From 337cc1e202c3deca4a9e340c97ab93690185332f Mon Sep 17 00:00:00 2001 From: Bartosz Sypytkowski Date: Fri, 30 Jun 2023 20:23:32 +0200 Subject: [PATCH] changed weak link serialization to use restEncoder --- src/types/YWeakLink.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/types/YWeakLink.js b/src/types/YWeakLink.js index f362d89a..f1ee1c74 100644 --- a/src/types/YWeakLink.js +++ b/src/types/YWeakLink.js @@ -8,7 +8,9 @@ import { createID, getItemCleanStart, callTypeObservers, - YWeakLinkRefID + YWeakLinkRefID, + writeID, + readID } from "../internals.js" /** @@ -132,7 +134,7 @@ export class YWeakLink extends AbstractType { encoder.writeTypeRef(YWeakLinkRefID) const flags = 0 // flags that could be used in the future encoding.writeUint8(encoder.restEncoder, flags) - encoder.writeLeftID(this._id) + writeID(encoder.restEncoder, this._id) } } @@ -143,7 +145,7 @@ export class YWeakLink extends AbstractType { */ export const readYWeakLink = decoder => { const flags = decoding.readUint8(decoder.restDecoder) - const id = decoder.readLeftID() + const id = readID(decoder.restDecoder) return new YWeakLink(id, null) }