diff --git a/src/types/YArray.js b/src/types/YArray.js index ce60de78..38b4e11f 100644 --- a/src/types/YArray.js +++ b/src/types/YArray.js @@ -25,16 +25,7 @@ import { typeListSlice } from './AbstractType.js' * @template T * @extends YEvent> */ -export class YArrayEvent extends YEvent { - /** - * @param {YArray} yarray The changed type - * @param {Transaction} transaction The transaction object - */ - constructor (yarray, transaction) { - super(yarray, transaction) - this._transaction = transaction - } -} +export class YArrayEvent extends YEvent {} /** * A shared Array implementation. @@ -171,9 +162,9 @@ export class YArray extends AbstractType { } /** - * Preppends content to this YArray. + * Prepends content to this YArray. * - * @param {Array} content Array of content to preppend. + * @param {Array} content Array of content to prepend. */ unshift (content) { this.insert(0, content) @@ -215,7 +206,8 @@ export class YArray extends AbstractType { } /** - * Transforms this YArray to a JavaScript Array. + * Returns a portion of this YArray into a JavaScript Array selected + * from start to end (end not included). * * @param {number} [start] * @param {number} [end] diff --git a/src/types/YXmlFragment.js b/src/types/YXmlFragment.js index 2f37684a..1445139c 100644 --- a/src/types/YXmlFragment.js +++ b/src/types/YXmlFragment.js @@ -380,9 +380,9 @@ export class YXmlFragment extends AbstractType { } /** - * Preppends content to this YArray. + * Prepends content to this YArray. * - * @param {Array} content Array of content to preppend. + * @param {Array} content Array of content to prepend. */ unshift (content) { this.insert(0, content) @@ -399,7 +399,8 @@ export class YXmlFragment extends AbstractType { } /** - * Transforms this YArray to a JavaScript Array. + * Returns a portion of this YXmlFragment into a JavaScript Array selected + * from start to end (end not included). * * @param {number} [start] * @param {number} [end] diff --git a/src/utils/Transaction.js b/src/utils/Transaction.js index 829589ec..9792d32e 100644 --- a/src/utils/Transaction.js +++ b/src/utils/Transaction.js @@ -225,7 +225,7 @@ const tryGcDeleteSet = (ds, store, gcFilter) => { */ const tryMergeDeleteSet = (ds, store) => { // try to merge deleted / gc'd items - // merge from right to left for better efficiecy and so we don't miss any merge targets + // merge from right to left for better efficiency and so we don't miss any merge targets ds.clients.forEach((deleteItems, client) => { const structs = /** @type {Array} */ (store.clients.get(client)) for (let di = deleteItems.length - 1; di >= 0; di--) { diff --git a/src/utils/encoding.js b/src/utils/encoding.js index 2277a140..08a9602d 100644 --- a/src/utils/encoding.js +++ b/src/utils/encoding.js @@ -154,7 +154,7 @@ export const readClientsStructRefs = (decoder, doc) => { // @type {string|null} const struct = new Item( createID(client, clock), - null, // leftd + null, // left (info & binary.BIT8) === binary.BIT8 ? decoder.readLeftID() : null, // origin null, // right (info & binary.BIT7) === binary.BIT7 ? decoder.readRightID() : null, // right origin @@ -178,7 +178,7 @@ export const readClientsStructRefs = (decoder, doc) => { const struct = new Item( createID(client, clock), - null, // leftd + null, // left origin, // origin null, // right rightOrigin, // right origin @@ -370,7 +370,7 @@ export const writeStructsFromTransaction = (encoder, transaction) => writeClient /** * Read and apply a document update. * - * This function has the same effect as `applyUpdate` but accepts an decoder. + * This function has the same effect as `applyUpdate` but accepts a decoder. * * @param {decoding.Decoder} decoder * @param {Doc} ydoc @@ -451,7 +451,7 @@ export const readUpdateV2 = (decoder, ydoc, transactionOrigin, structDecoder = n /** * Read and apply a document update. * - * This function has the same effect as `applyUpdate` but accepts an decoder. + * This function has the same effect as `applyUpdate` but accepts a decoder. * * @param {decoding.Decoder} decoder * @param {Doc} ydoc