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

Method toString

projects/JavaScript/proto/test.js:13762–13927  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

13760 * @returns {!string} Struct value string
13761 */
13762 toString () {
13763 let result = ''
13764 result += 'StructArray('
13765 result += 'f1='
13766 if (this.f1 != null) {
13767 let first = true
13768 result += '[' + this.f1.length + ']['
13769 for (let item of this.f1) {
13770 result += first ? '' : ','
13771 result += item.toString()
13772 first = false
13773 }
13774 result += ']'
13775 } else {
13776 result += '[0][]'
13777 }
13778 result += ',f2='
13779 if (this.f2 != null) {
13780 let first = true
13781 result += '[' + this.f2.length + ']['
13782 for (let item of this.f2) {
13783 if (item != null) {
13784 result += first ? '' : ','
13785 result += item.toString()
13786 } else {
13787 result += first ? '' : ','
13788 result += 'null'
13789 }
13790 first = false
13791 }
13792 result += ']'
13793 } else {
13794 result += '[0][]'
13795 }
13796 result += ',f3='
13797 if (this.f3 != null) {
13798 let first = true
13799 result += '[' + this.f3.length + ']['
13800 for (let item of this.f3) {
13801 if (item != null) {
13802 result += first ? '' : ','
13803 result += 'bytes[' + item.length + ']'
13804 } else {
13805 result += first ? '' : ','
13806 result += 'null'
13807 }
13808 first = false
13809 }
13810 result += ']'
13811 } else {
13812 result += '[0][]'
13813 }
13814 result += ',f4='
13815 if (this.f4 != null) {
13816 let first = true
13817 result += '[' + this.f4.length + ']['
13818 for (let item of this.f4) {
13819 if (item != null) {

Callers 1

[util.inspect.custom]Method · 0.95

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected