From a099e98bd66c85b5a1b2c0c9aa561886b6c2bc67 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Thu, 7 Sep 2023 13:41:35 +0200 Subject: [PATCH] create error on call - fixes #569 --- README.md | 6 +++++- src/types/AbstractType.js | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 35bfbf6b..f15e5ea5 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,11 @@ hypercores and y-dat listens to changes and applies them to the Yjs document.
@liveblocks/yjs
-Liveblocks Yjs provides a fully hosted WebSocket infrastructure and persisted data store for Yjs documents. No configuration or maintenance is required. It also features Yjs webhook events, REST API to read and update Yjs documents, and a browser DevTools extension. +Liveblocks Yjs provides a fully +hosted WebSocket infrastructure and persisted data store for Yjs +documents. No configuration or maintenance is required. It also features +Yjs webhook events, REST API to read and update Yjs documents, and a +browser DevTools extension.
Matrix-CRDT
diff --git a/src/types/AbstractType.js b/src/types/AbstractType.js index 144cfc3c..3163b8da 100644 --- a/src/types/AbstractType.js +++ b/src/types/AbstractType.js @@ -683,7 +683,7 @@ export const typeListInsertGenericsAfter = (transaction, parent, referenceItem, packJsonContent() } -const lengthExceeded = error.create('Length exceeded!') +const lengthExceeded = () => error.create('Length exceeded!') /** * @param {Transaction} transaction @@ -696,7 +696,7 @@ const lengthExceeded = error.create('Length exceeded!') */ export const typeListInsertGenerics = (transaction, parent, index, content) => { if (index > parent._length) { - throw lengthExceeded + throw lengthExceeded() } if (index === 0) { if (parent._searchMarker) { @@ -798,7 +798,7 @@ export const typeListDelete = (transaction, parent, index, length) => { n = n.right } if (length > 0) { - throw lengthExceeded + throw lengthExceeded() } if (parent._searchMarker) { updateMarkerChanges(parent._searchMarker, startIndex, -startLength + length /* in case we remove the above exception */)