implement some of the commented todos

This commit is contained in:
Kevin Jahns
2019-04-09 04:01:37 +02:00
parent 1b06f59d1c
commit 52ec698635
24 changed files with 233 additions and 243 deletions

View File

@@ -2,8 +2,6 @@
* @module structs
*/
// TODO: ItemBinary should be able to merge with right (similar to other items). Or the other items (ItemJSON) should not be able to merge - extra byte + consistency
import {
AbstractItem,
AbstractItemRef,
@@ -59,15 +57,14 @@ export class ItemDeleted extends AbstractItem {
addToDeleteSet(transaction.deleteSet, this.id, this.length)
}
/**
* @param {StructStore} store
* @param {number} diff
*/
splitAt (store, diff) {
splitAt (diff) {
/**
* @type {ItemDeleted}
*/
// @ts-ignore
const right = splitItem(store, this, diff)
const right = splitItem(this, diff)
right._len -= diff
this._len = diff
return right