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

Method toJSON

projects/JavaScript/proto/test.js:2043–2091  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

2041 * @returns {!object} Struct value for JSON
2042 */
2043 toJSON () {
2044 return {
2045 id: ((this.id != null) ? this.id : null),
2046 f1: ((this.f1 != null) ? this.f1 : null),
2047 f2: ((this.f2 != null) ? this.f2 : null),
2048 f3: ((this.f3 != null) ? this.f3 : null),
2049 f4: ((this.f4 != null) ? this.f4 : null),
2050 f5: ((this.f5 != null) ? this.f5.charCodeAt(0) : null),
2051 f6: ((this.f6 != null) ? this.f6.charCodeAt(0) : null),
2052 f7: ((this.f7 != null) ? this.f7.charCodeAt(0) : null),
2053 f8: ((this.f8 != null) ? this.f8.charCodeAt(0) : null),
2054 f9: ((this.f9 != null) ? this.f9 : null),
2055 f10: ((this.f10 != null) ? this.f10 : null),
2056 f11: ((this.f11 != null) ? this.f11 : null),
2057 f12: ((this.f12 != null) ? this.f12 : null),
2058 f13: ((this.f13 != null) ? this.f13 : null),
2059 f14: ((this.f14 != null) ? this.f14 : null),
2060 f15: ((this.f15 != null) ? this.f15 : null),
2061 f16: ((this.f16 != null) ? this.f16 : null),
2062 f17: ((this.f17 != null) ? this.f17 : null),
2063 f18: ((this.f18 != null) ? this.f18 : null),
2064 f19: ((this.f19 != null) ? this.f19 : null),
2065 f20: ((this.f20 != null) ? this.f20 : null),
2066 f21: ((this.f21 != null) ? this.f21.toNumber() : null),
2067 f22: ((this.f22 != null) ? this.f22.toNumber() : null),
2068 f23: ((this.f23 != null) ? this.f23.toNumber() : null),
2069 f24: ((this.f24 != null) ? this.f24.toNumber() : null),
2070 f25: ((this.f25 != null) ? this.f25 : null),
2071 f26: ((this.f26 != null) ? this.f26 : null),
2072 f27: ((this.f27 != null) ? this.f27 : null),
2073 f28: ((this.f28 != null) ? this.f28 : null),
2074 f29: ((this.f29 != null) ? this.f29.toFixed() : null),
2075 f30: ((this.f30 != null) ? this.f30.toFixed() : null),
2076 f31: ((this.f31 != null) ? this.f31 : null),
2077 f32: ((this.f32 != null) ? this.f32 : null),
2078 f33: ((this.f33 != null) ? (this.f33.getTime() * 1000000) : null),
2079 f34: ((this.f34 != null) ? (this.f34.getTime() * 1000000) : null),
2080 f35: ((this.f35 != null) ? (this.f35.getTime() * 1000000) : null),
2081 f36: ((this.f36 != null) ? this.f36.toString() : null),
2082 f37: ((this.f37 != null) ? this.f37.toString() : null),
2083 f38: ((this.f38 != null) ? this.f38.toString() : null),
2084 f39: ((this.f39 != null) ? this.f39 : null),
2085 f40: ((this.f40 != null) ? this.f40 : null),
2086 f41: ((this.f41 != null) ? this.f41 : null),
2087 f42: ((this.f42 != null) ? this.f42 : null),
2088 f43: ((this.f43 != null) ? this.f43 : null),
2089 f44: ((this.f44 != null) ? this.f44 : null)
2090 }
2091 }
2092
2093 /**
2094 * Convert JSON to struct

Callers

nothing calls this directly

Calls 2

toNumberMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected