documentation and fix tests

This commit is contained in:
Kevin Jahns
2018-03-29 11:58:02 +02:00
parent 61149b458a
commit 135c6d31be
22 changed files with 341 additions and 115 deletions

View File

@@ -1,5 +1,5 @@
import { splitHelper, default as Item } from './Item.js'
import { logID } from '../MessageHandler/messageToString.js'
import { logItemHelper } from '../MessageHandler/messageToString.js'
export default class ItemJSON extends Item {
constructor () {
@@ -45,10 +45,14 @@ export default class ItemJSON extends Item {
encoder.writeVarString(encoded)
}
}
/**
* Transform this YXml Type to a readable format.
* Useful for logging as all Items and Delete implement this method.
*
* @private
*/
_logString () {
const left = this._left !== null ? this._left._lastId : null
const origin = this._origin !== null ? this._origin._lastId : null
return `ItemJSON(id:${logID(this._id)},content:${JSON.stringify(this._content)},left:${logID(left)},origin:${logID(origin)},right:${logID(this._right)},parent:${logID(this._parent)},parentSub:${this._parentSub})`
return logItemHelper('ItemJSON', this, `content:${JSON.stringify(this._content)}`)
}
_splitAt (y, diff) {
if (diff === 0) {