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

Method toString

projects/JavaScript/proto/test.js:15403–15568  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

15401 * @returns {!string} Struct value string
15402 */
15403 toString () {
15404 let result = ''
15405 result += 'StructVector('
15406 result += 'f1='
15407 if (this.f1 != null) {
15408 let first = true
15409 result += '[' + this.f1.length + ']['
15410 for (let item of this.f1) {
15411 result += first ? '' : ','
15412 result += item.toString()
15413 first = false
15414 }
15415 result += ']'
15416 } else {
15417 result += '[0][]'
15418 }
15419 result += ',f2='
15420 if (this.f2 != null) {
15421 let first = true
15422 result += '[' + this.f2.length + ']['
15423 for (let item of this.f2) {
15424 if (item != null) {
15425 result += first ? '' : ','
15426 result += item.toString()
15427 } else {
15428 result += first ? '' : ','
15429 result += 'null'
15430 }
15431 first = false
15432 }
15433 result += ']'
15434 } else {
15435 result += '[0][]'
15436 }
15437 result += ',f3='
15438 if (this.f3 != null) {
15439 let first = true
15440 result += '[' + this.f3.length + ']['
15441 for (let item of this.f3) {
15442 if (item != null) {
15443 result += first ? '' : ','
15444 result += 'bytes[' + item.length + ']'
15445 } else {
15446 result += first ? '' : ','
15447 result += 'null'
15448 }
15449 first = false
15450 }
15451 result += ']'
15452 } else {
15453 result += '[0][]'
15454 }
15455 result += ',f4='
15456 if (this.f4 != null) {
15457 let first = true
15458 result += '[' + this.f4.length + ']['
15459 for (let item of this.f4) {
15460 if (item != null) {

Callers 1

[util.inspect.custom]Method · 0.95

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected