Further tweak the display of the buffer dump.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user