Make Serializer.stringifyJsObject() private.
This commit is contained in:
@@ -8,13 +8,6 @@ abstract class Serializable<T> {
|
|||||||
private static maxDisplayedJsonLength = 160;
|
private static maxDisplayedJsonLength = 160;
|
||||||
private static enableDump = true;
|
private static enableDump = true;
|
||||||
|
|
||||||
strintifyJsObject(jsObject: any): string {
|
|
||||||
let json = JSON.stringify(jsObject);
|
|
||||||
return json.length > Serializable.maxDisplayedJsonLength
|
|
||||||
? json.substr(0, Serializable.maxDisplayedJsonLength) + '...'
|
|
||||||
: json;
|
|
||||||
}
|
|
||||||
|
|
||||||
fromJsObject(jsObject: any): Serializable<T> {
|
fromJsObject(jsObject: any): Serializable<T> {
|
||||||
let isArray = this instanceof ClassArray;
|
let isArray = this instanceof ClassArray;
|
||||||
this.dumpMethodName('fromJsObject');
|
this.dumpMethodName('fromJsObject');
|
||||||
@@ -86,4 +79,11 @@ abstract class Serializable<T> {
|
|||||||
let indentation = new Array(Serializable.depth + 1).join(' ');
|
let indentation = new Array(Serializable.depth + 1).join(' ');
|
||||||
this.dump(`${indentation}${this.constructor.name}.${methodName}: `);
|
this.dump(`${indentation}${this.constructor.name}.${methodName}: `);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private strintifyJsObject(jsObject: any): string {
|
||||||
|
let json = JSON.stringify(jsObject);
|
||||||
|
return json.length > Serializable.maxDisplayedJsonLength
|
||||||
|
? json.substr(0, Serializable.maxDisplayedJsonLength) + '...'
|
||||||
|
: json;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user