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

Method toJSON

projects/JavaScript/proto/test.js:15584–15597  ·  view source on GitHub ↗

* Convert struct to JSON * @this {!StructVector} * @returns {!object} Struct value for JSON

()

Source from the content-addressed store, hash-verified

15582 * @returns {!object} Struct value for JSON
15583 */
15584 toJSON () {
15585 return {
15586 f1: ((this.f1 != null) ? Array.from(this.f1, item => ((item != null) ? item : null)) : null),
15587 f2: ((this.f2 != null) ? Array.from(this.f2, item => ((item != null) ? item : null)) : null),
15588 f3: ((this.f3 != null) ? Array.from(this.f3, item => ((item != null) ? Buffer.from(item).toString('base64') : null)) : null),
15589 f4: ((this.f4 != null) ? Array.from(this.f4, item => ((item != null) ? Buffer.from(item).toString('base64') : null)) : null),
15590 f5: ((this.f5 != null) ? Array.from(this.f5, item => ((item != null) ? item : null)) : null),
15591 f6: ((this.f6 != null) ? Array.from(this.f6, item => ((item != null) ? item : null)) : null),
15592 f7: ((this.f7 != null) ? Array.from(this.f7, item => ((item != null) ? item : null)) : null),
15593 f8: ((this.f8 != null) ? Array.from(this.f8, item => ((item != null) ? item : null)) : null),
15594 f9: ((this.f9 != null) ? Array.from(this.f9, item => ((item != null) ? item : null)) : null),
15595 f10: ((this.f10 != null) ? Array.from(this.f10, item => ((item != null) ? item : null)) : null)
15596 }
15597 }
15598
15599 /**
15600 * Convert JSON to struct

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected