MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / toString

Method toString

projects/JavaScript/proto/test.js:17044–17209  ·  view source on GitHub ↗

* Convert struct to string * @this {!StructList} * @returns {!string} Struct value string

()

Source from the content-addressed store, hash-verified

17042 * @returns {!string} Struct value string
17043 */
17044 toString () {
17045 let result = ''
17046 result += 'StructList('
17047 result += 'f1='
17048 if (this.f1 != null) {
17049 let first = true
17050 result += '[' + this.f1.length + ']<'
17051 for (let item of this.f1) {
17052 result += first ? '' : ','
17053 result += item.toString()
17054 first = false
17055 }
17056 result += '>'
17057 } else {
17058 result += '[0]<>'
17059 }
17060 result += ',f2='
17061 if (this.f2 != null) {
17062 let first = true
17063 result += '[' + this.f2.length + ']<'
17064 for (let item of this.f2) {
17065 if (item != null) {
17066 result += first ? '' : ','
17067 result += item.toString()
17068 } else {
17069 result += first ? '' : ','
17070 result += 'null'
17071 }
17072 first = false
17073 }
17074 result += '>'
17075 } else {
17076 result += '[0]<>'
17077 }
17078 result += ',f3='
17079 if (this.f3 != null) {
17080 let first = true
17081 result += '[' + this.f3.length + ']<'
17082 for (let item of this.f3) {
17083 if (item != null) {
17084 result += first ? '' : ','
17085 result += 'bytes[' + item.length + ']'
17086 } else {
17087 result += first ? '' : ','
17088 result += 'null'
17089 }
17090 first = false
17091 }
17092 result += '>'
17093 } else {
17094 result += '[0]<>'
17095 }
17096 result += ',f4='
17097 if (this.f4 != null) {
17098 let first = true
17099 result += '[' + this.f4.length + ']<'
17100 for (let item of this.f4) {
17101 if (item != null) {

Callers 1

[util.inspect.custom]Method · 0.95

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected