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

Method toJSON

projects/JavaScript/proto/test.js:13943–13956  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

13941 * @returns {!object} Struct value for JSON
13942 */
13943 toJSON () {
13944 return {
13945 f1: ((this.f1 != null) ? Array.from(this.f1, item => ((item != null) ? item : null)) : null),
13946 f2: ((this.f2 != null) ? Array.from(this.f2, item => ((item != null) ? item : null)) : null),
13947 f3: ((this.f3 != null) ? Array.from(this.f3, item => ((item != null) ? Buffer.from(item).toString('base64') : null)) : null),
13948 f4: ((this.f4 != null) ? Array.from(this.f4, item => ((item != null) ? Buffer.from(item).toString('base64') : null)) : null),
13949 f5: ((this.f5 != null) ? Array.from(this.f5, item => ((item != null) ? item : null)) : null),
13950 f6: ((this.f6 != null) ? Array.from(this.f6, item => ((item != null) ? item : null)) : null),
13951 f7: ((this.f7 != null) ? Array.from(this.f7, item => ((item != null) ? item : null)) : null),
13952 f8: ((this.f8 != null) ? Array.from(this.f8, item => ((item != null) ? item : null)) : null),
13953 f9: ((this.f9 != null) ? Array.from(this.f9, item => ((item != null) ? item : null)) : null),
13954 f10: ((this.f10 != null) ? Array.from(this.f10, item => ((item != null) ? item : null)) : null)
13955 }
13956 }
13957
13958 /**
13959 * Convert JSON to struct

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected