documentation and fix tests
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { default as Item } from './Item.js'
|
||||
import { logID } from '../MessageHandler/messageToString.js'
|
||||
import { logItemHelper } from '../MessageHandler/messageToString.js'
|
||||
|
||||
export default class ItemFormat extends Item {
|
||||
constructor () {
|
||||
@@ -30,9 +30,13 @@ export default class ItemFormat extends Item {
|
||||
encoder.writeVarString(this.key)
|
||||
encoder.writeVarString(JSON.stringify(this.value))
|
||||
}
|
||||
/**
|
||||
* 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 `ItemFormat(id:${logID(this._id)},key:${JSON.stringify(this.key)},value:${JSON.stringify(this.value)},left:${logID(left)},origin:${logID(origin)},right:${logID(this._right)},parent:${logID(this._parent)},parentSub:${this._parentSub})`
|
||||
return logItemHelper('ItemFormat', this, `key:${JSON.stringify(this.key)},value:${JSON.stringify(this.value)}`)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user