Further tweak the display of the buffer dump.

This commit is contained in:
László Monda
2016-04-03 19:05:55 +02:00
parent c92831907b
commit a0ed4bd5a7
2 changed files with 2 additions and 5 deletions

View File

@@ -22,10 +22,7 @@ abstract class Serializable<T> {
fromBinary(buffer: UhkBuffer): T {
let indentation = new Array(Serializable.depth + 1).join(' ');
let isArray = this instanceof UhkArray;
process.stdout.write(`${indentation}${this.constructor.name}.fromBinary: [`);
if (isArray) {
process.stdout.write('\n');
}
process.stdout.write(`${indentation}${this.constructor.name}.fromBinary:` + (isArray ? '\n' : ' ['));
Serializable.depth++;
buffer.enableDump = !isArray;
let value = this._fromBinary(buffer);

View File

@@ -142,7 +142,7 @@ class UhkBuffer {
dump(value) {
if (this.enableDump) {
if (!UhkBuffer.isFirstElementToDump) {
process.stdout.write(' ');
process.stdout.write(', ');
}
process.stdout.write(value);
if (UhkBuffer.isFirstElementToDump) {