create error on call - fixes #569

This commit is contained in:
Kevin Jahns 2023-09-07 13:41:35 +02:00
parent 1b0da31d00
commit a099e98bd6
2 changed files with 8 additions and 4 deletions

View File

@ -145,7 +145,11 @@ hypercores and y-dat listens to changes and applies them to the Yjs document.
</dd>
<dt><a href="https://github.com/liveblocks/liveblocks">@liveblocks/yjs</a></dt>
<dd>
<a href="https://liveblocks.io/document/yjs">Liveblocks Yjs</a> 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.
<a href="https://liveblocks.io/document/yjs">Liveblocks Yjs</a> 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.
</dd>
<dt><a href="https://github.com/yousefED/matrix-crdt">Matrix-CRDT</a></dt>
<dd>

View File

@ -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 */)