Test case
3 generated files · +6 −6test/inputs/graphql/github1.graphql
Mgraphql-flowdefault / TopLevel.js+2 −2
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 122 | 122 | return invalidValue(l(ref || "object"), val, key, parent); |
| 123 | 123 | } |
| 124 | - const result: any = {}; | |
| 124 | + const result: any = Object.create(null); | |
| 125 | 125 | Object.getOwnPropertyNames(props).forEach(key => { |
| 126 | 126 | const prop = props[key]; |
| 127 | 127 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 132 | 132 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 133 | 133 | } |
| 134 | 134 | }); |
| 135 | - return result; | |
| 135 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | if (typ === "any") return val; |
Mgraphql-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mgraphql-typescriptdefault / TopLevel.ts+2 −2
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 122 | 122 | return invalidValue(l(ref || "object"), val, key, parent); |
| 123 | 123 | } |
| 124 | - const result: any = {}; | |
| 124 | + const result: any = Object.create(null); | |
| 125 | 125 | Object.getOwnPropertyNames(props).forEach(key => { |
| 126 | 126 | const prop = props[key]; |
| 127 | 127 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 132 | 132 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 133 | 133 | } |
| 134 | 134 | }); |
| 135 | - return result; | |
| 135 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/graphql/github2.graphql
Mgraphql-flowdefault / TopLevel.js+2 −2
| @@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 130 | 130 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 131 | 131 | return invalidValue(l(ref || "object"), val, key, parent); |
| 132 | 132 | } |
| 133 | - const result: any = {}; | |
| 133 | + const result: any = Object.create(null); | |
| 134 | 134 | Object.getOwnPropertyNames(props).forEach(key => { |
| 135 | 135 | const prop = props[key]; |
| 136 | 136 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 142 | 142 | } |
| 143 | 143 | }); |
| 144 | - return result; | |
| 144 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | if (typ === "any") return val; |
Mgraphql-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mgraphql-typescriptdefault / TopLevel.ts+2 −2
| @@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 130 | 130 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 131 | 131 | return invalidValue(l(ref || "object"), val, key, parent); |
| 132 | 132 | } |
| 133 | - const result: any = {}; | |
| 133 | + const result: any = Object.create(null); | |
| 134 | 134 | Object.getOwnPropertyNames(props).forEach(key => { |
| 135 | 135 | const prop = props[key]; |
| 136 | 136 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 142 | 142 | } |
| 143 | 143 | }); |
| 144 | - return result; | |
| 144 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/graphql/github3.graphql
Mgraphql-flowdefault / TopLevel.js+2 −2
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 139 | 139 | return invalidValue(l(ref || "object"), val, key, parent); |
| 140 | 140 | } |
| 141 | - const result: any = {}; | |
| 141 | + const result: any = Object.create(null); | |
| 142 | 142 | Object.getOwnPropertyNames(props).forEach(key => { |
| 143 | 143 | const prop = props[key]; |
| 144 | 144 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 149 | 149 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 150 | 150 | } |
| 151 | 151 | }); |
| 152 | - return result; | |
| 152 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | if (typ === "any") return val; |
Mgraphql-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mgraphql-typescriptdefault / TopLevel.ts+2 −2
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 136 | 136 | return invalidValue(l(ref || "object"), val, key, parent); |
| 137 | 137 | } |
| 138 | - const result: any = {}; | |
| 138 | + const result: any = Object.create(null); | |
| 139 | 139 | Object.getOwnPropertyNames(props).forEach(key => { |
| 140 | 140 | const prop = props[key]; |
| 141 | 141 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 146 | 146 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 147 | 147 | } |
| 148 | 148 | }); |
| 149 | - return result; | |
| 149 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/graphql/github4.graphql
Mgraphql-flowdefault / TopLevel.js+2 −2
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 140 | 140 | return invalidValue(l(ref || "object"), val, key, parent); |
| 141 | 141 | } |
| 142 | - const result: any = {}; | |
| 142 | + const result: any = Object.create(null); | |
| 143 | 143 | Object.getOwnPropertyNames(props).forEach(key => { |
| 144 | 144 | const prop = props[key]; |
| 145 | 145 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -150,7 +150,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 150 | 150 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 151 | 151 | } |
| 152 | 152 | }); |
| 153 | - return result; | |
| 153 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | if (typ === "any") return val; |
Mgraphql-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mgraphql-typescriptdefault / TopLevel.ts+2 −2
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 137 | 137 | return invalidValue(l(ref || "object"), val, key, parent); |
| 138 | 138 | } |
| 139 | - const result: any = {}; | |
| 139 | + const result: any = Object.create(null); | |
| 140 | 140 | Object.getOwnPropertyNames(props).forEach(key => { |
| 141 | 141 | const prop = props[key]; |
| 142 | 142 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 148 | 148 | } |
| 149 | 149 | }); |
| 150 | - return result; | |
| 150 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/graphql/github5.graphql
Mgraphql-flowdefault / TopLevel.js+2 −2
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 122 | 122 | return invalidValue(l(ref || "object"), val, key, parent); |
| 123 | 123 | } |
| 124 | - const result: any = {}; | |
| 124 | + const result: any = Object.create(null); | |
| 125 | 125 | Object.getOwnPropertyNames(props).forEach(key => { |
| 126 | 126 | const prop = props[key]; |
| 127 | 127 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 132 | 132 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 133 | 133 | } |
| 134 | 134 | }); |
| 135 | - return result; | |
| 135 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | if (typ === "any") return val; |
Mgraphql-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mgraphql-typescriptdefault / TopLevel.ts+2 −2
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 122 | 122 | return invalidValue(l(ref || "object"), val, key, parent); |
| 123 | 123 | } |
| 124 | - const result: any = {}; | |
| 124 | + const result: any = Object.create(null); | |
| 125 | 125 | Object.getOwnPropertyNames(props).forEach(key => { |
| 126 | 126 | const prop = props[key]; |
| 127 | 127 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 132 | 132 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 133 | 133 | } |
| 134 | 134 | }); |
| 135 | - return result; | |
| 135 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/graphql/github6.graphql
Mgraphql-flowdefault / TopLevel.js+2 −2
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 122 | 122 | return invalidValue(l(ref || "object"), val, key, parent); |
| 123 | 123 | } |
| 124 | - const result: any = {}; | |
| 124 | + const result: any = Object.create(null); | |
| 125 | 125 | Object.getOwnPropertyNames(props).forEach(key => { |
| 126 | 126 | const prop = props[key]; |
| 127 | 127 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 132 | 132 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 133 | 133 | } |
| 134 | 134 | }); |
| 135 | - return result; | |
| 135 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | if (typ === "any") return val; |
Mgraphql-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mgraphql-typescriptdefault / TopLevel.ts+2 −2
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 122 | 122 | return invalidValue(l(ref || "object"), val, key, parent); |
| 123 | 123 | } |
| 124 | - const result: any = {}; | |
| 124 | + const result: any = Object.create(null); | |
| 125 | 125 | Object.getOwnPropertyNames(props).forEach(key => { |
| 126 | 126 | const prop = props[key]; |
| 127 | 127 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 132 | 132 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 133 | 133 | } |
| 134 | 134 | }); |
| 135 | - return result; | |
| 135 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/graphql/github7.graphql
Mgraphql-flowdefault / TopLevel.js+2 −2
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 143 | 143 | return invalidValue(l(ref || "object"), val, key, parent); |
| 144 | 144 | } |
| 145 | - const result: any = {}; | |
| 145 | + const result: any = Object.create(null); | |
| 146 | 146 | Object.getOwnPropertyNames(props).forEach(key => { |
| 147 | 147 | const prop = props[key]; |
| 148 | 148 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -153,7 +153,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 153 | 153 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 154 | 154 | } |
| 155 | 155 | }); |
| 156 | - return result; | |
| 156 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | if (typ === "any") return val; |
Mgraphql-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mgraphql-typescriptdefault / TopLevel.ts+2 −2
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 143 | 143 | return invalidValue(l(ref || "object"), val, key, parent); |
| 144 | 144 | } |
| 145 | - const result: any = {}; | |
| 145 | + const result: any = Object.create(null); | |
| 146 | 146 | Object.getOwnPropertyNames(props).forEach(key => { |
| 147 | 147 | const prop = props[key]; |
| 148 | 148 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -153,7 +153,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 153 | 153 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 154 | 154 | } |
| 155 | 155 | }); |
| 156 | - return result; | |
| 156 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/graphql/github8.graphql
Mgraphql-flowdefault / TopLevel.js+2 −2
| @@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 132 | 132 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 133 | 133 | return invalidValue(l(ref || "object"), val, key, parent); |
| 134 | 134 | } |
| 135 | - const result: any = {}; | |
| 135 | + const result: any = Object.create(null); | |
| 136 | 136 | Object.getOwnPropertyNames(props).forEach(key => { |
| 137 | 137 | const prop = props[key]; |
| 138 | 138 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 144 | 144 | } |
| 145 | 145 | }); |
| 146 | - return result; | |
| 146 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | if (typ === "any") return val; |
Mgraphql-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mgraphql-typescriptdefault / TopLevel.ts+2 −2
| @@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 130 | 130 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 131 | 131 | return invalidValue(l(ref || "object"), val, key, parent); |
| 132 | 132 | } |
| 133 | - const result: any = {}; | |
| 133 | + const result: any = Object.create(null); | |
| 134 | 134 | Object.getOwnPropertyNames(props).forEach(key => { |
| 135 | 135 | const prop = props[key]; |
| 136 | 136 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 142 | 142 | } |
| 143 | 143 | }); |
| 144 | - return result; | |
| 144 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/graphql/github9.graphql
Mgraphql-flowdefault / TopLevel.js+2 −2
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 140 | 140 | return invalidValue(l(ref || "object"), val, key, parent); |
| 141 | 141 | } |
| 142 | - const result: any = {}; | |
| 142 | + const result: any = Object.create(null); | |
| 143 | 143 | Object.getOwnPropertyNames(props).forEach(key => { |
| 144 | 144 | const prop = props[key]; |
| 145 | 145 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -150,7 +150,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 150 | 150 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 151 | 151 | } |
| 152 | 152 | }); |
| 153 | - return result; | |
| 153 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | if (typ === "any") return val; |
Mgraphql-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mgraphql-typescriptdefault / TopLevel.ts+2 −2
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 134 | 134 | return invalidValue(l(ref || "object"), val, key, parent); |
| 135 | 135 | } |
| 136 | - const result: any = {}; | |
| 136 | + const result: any = Object.create(null); | |
| 137 | 137 | Object.getOwnPropertyNames(props).forEach(key => { |
| 138 | 138 | const prop = props[key]; |
| 139 | 139 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 145 | 145 | } |
| 146 | 146 | }); |
| 147 | - return result; | |
| 147 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/00c36.json
Mflowdefault / TopLevel.js+2 −2
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 136 | 136 | return invalidValue(l(ref || "object"), val, key, parent); |
| 137 | 137 | } |
| 138 | - const result: any = {}; | |
| 138 | + const result: any = Object.create(null); | |
| 139 | 139 | Object.getOwnPropertyNames(props).forEach(key => { |
| 140 | 140 | const prop = props[key]; |
| 141 | 141 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 146 | 146 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 147 | 147 | } |
| 148 | 148 | }); |
| 149 | - return result; | |
| 149 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 131 | 131 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 132 | 132 | return invalidValue(l(ref || "object"), val, key, parent); |
| 133 | 133 | } |
| 134 | - const result: any = {}; | |
| 134 | + const result: any = Object.create(null); | |
| 135 | 135 | Object.getOwnPropertyNames(props).forEach(key => { |
| 136 | 136 | const prop = props[key]; |
| 137 | 137 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 143 | 143 | } |
| 144 | 144 | }); |
| 145 | - return result; | |
| 145 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/00ec5.json
Melmdefault / QuickType.elm+9 −1
| @@ -160,7 +160,7 @@ provider = | ||
| 160 | 160 | encodeProvider : Provider -> Jenc.Value |
| 161 | 161 | encodeProvider x = |
| 162 | 162 | Jenc.object |
| 163 | - [ ("properties", Jenc.dict identity encodeProperty x.properties) | |
| 163 | + [ ("properties", makeDictEncoder identity encodeProperty x.properties) | |
| 164 | 164 | ] |
| 165 | 165 | |
| 166 | 166 | property : Jdec.Decoder Property |
| @@ -303,6 +303,14 @@ encodeSchema x = | ||
| 303 | 303 | |
| 304 | 304 | --- encoder helpers |
| 305 | 305 | |
| 306 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 307 | +makeDictEncoder f m r = | |
| 308 | + r | |
| 309 | + |> Dict.toList | |
| 310 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 311 | + |> String.join "," | |
| 312 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 313 | + | |
| 306 | 314 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 307 | 315 | makeNullableEncoder f m = |
| 308 | 316 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -174,7 +174,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 174 | 174 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 175 | 175 | return invalidValue(l(ref || "object"), val, key, parent); |
| 176 | 176 | } |
| 177 | - const result: any = {}; | |
| 177 | + const result: any = Object.create(null); | |
| 178 | 178 | Object.getOwnPropertyNames(props).forEach(key => { |
| 179 | 179 | const prop = props[key]; |
| 180 | 180 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -185,7 +185,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 185 | 185 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 186 | 186 | } |
| 187 | 187 | }); |
| 188 | - return result; | |
| 188 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -173,7 +173,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 173 | 173 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 174 | 174 | return invalidValue(l(ref || "object"), val, key, parent); |
| 175 | 175 | } |
| 176 | - const result: any = {}; | |
| 176 | + const result: any = Object.create(null); | |
| 177 | 177 | Object.getOwnPropertyNames(props).forEach(key => { |
| 178 | 178 | const prop = props[key]; |
| 179 | 179 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -184,7 +184,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 184 | 184 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 185 | 185 | } |
| 186 | 186 | }); |
| 187 | - return result; | |
| 187 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/010b1.json
Mflowdefault / TopLevel.js+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 117 | 117 | return invalidValue(l(ref || "object"), val, key, parent); |
| 118 | 118 | } |
| 119 | - const result: any = {}; | |
| 119 | + const result: any = Object.create(null); | |
| 120 | 120 | Object.getOwnPropertyNames(props).forEach(key => { |
| 121 | 121 | const prop = props[key]; |
| 122 | 122 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - return result; | |
| 130 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/016af.json
Mflowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/033b1.json
Melmdefault / QuickType.elm+9 −1
| @@ -51,11 +51,19 @@ encodeQuickType x = | ||
| 51 | 51 | Jenc.object |
| 52 | 52 | [ ("base", Jenc.string x.base) |
| 53 | 53 | , ("date", Jenc.string x.date) |
| 54 | - , ("rates", Jenc.dict identity Jenc.float x.rates) | |
| 54 | + , ("rates", makeDictEncoder identity Jenc.float x.rates) | |
| 55 | 55 | ] |
| 56 | 56 | |
| 57 | 57 | --- encoder helpers |
| 58 | 58 | |
| 59 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 60 | +makeDictEncoder f m r = | |
| 61 | + r | |
| 62 | + |> Dict.toList | |
| 63 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 64 | + |> String.join "," | |
| 65 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 66 | + | |
| 59 | 67 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 60 | 68 | makeNullableEncoder f m = |
| 61 | 69 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/050b0.json
Mflowdefault / TopLevel.js+2 −2
| @@ -163,7 +163,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 163 | 163 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 164 | 164 | return invalidValue(l(ref || "object"), val, key, parent); |
| 165 | 165 | } |
| 166 | - const result: any = {}; | |
| 166 | + const result: any = Object.create(null); | |
| 167 | 167 | Object.getOwnPropertyNames(props).forEach(key => { |
| 168 | 168 | const prop = props[key]; |
| 169 | 169 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -174,7 +174,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 174 | 174 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 175 | 175 | } |
| 176 | 176 | }); |
| 177 | - return result; | |
| 177 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 148 | 148 | return invalidValue(l(ref || "object"), val, key, parent); |
| 149 | 149 | } |
| 150 | - const result: any = {}; | |
| 150 | + const result: any = Object.create(null); | |
| 151 | 151 | Object.getOwnPropertyNames(props).forEach(key => { |
| 152 | 152 | const prop = props[key]; |
| 153 | 153 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 158 | 158 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 159 | 159 | } |
| 160 | 160 | }); |
| 161 | - return result; | |
| 161 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/06bee.json
Mflowdefault / TopLevel.js+2 −2
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 152 | 152 | return invalidValue(l(ref || "object"), val, key, parent); |
| 153 | 153 | } |
| 154 | - const result: any = {}; | |
| 154 | + const result: any = Object.create(null); | |
| 155 | 155 | Object.getOwnPropertyNames(props).forEach(key => { |
| 156 | 156 | const prop = props[key]; |
| 157 | 157 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -162,7 +162,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 162 | 162 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 163 | 163 | } |
| 164 | 164 | }); |
| 165 | - return result; | |
| 165 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 143 | 143 | return invalidValue(l(ref || "object"), val, key, parent); |
| 144 | 144 | } |
| 145 | - const result: any = {}; | |
| 145 | + const result: any = Object.create(null); | |
| 146 | 146 | Object.getOwnPropertyNames(props).forEach(key => { |
| 147 | 147 | const prop = props[key]; |
| 148 | 148 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -153,7 +153,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 153 | 153 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 154 | 154 | } |
| 155 | 155 | }); |
| 156 | - return result; | |
| 156 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/07540.json
Mflowdefault / TopLevel.js+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 107 | 107 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 108 | 108 | return invalidValue(l(ref || "object"), val, key, parent); |
| 109 | 109 | } |
| 110 | - const result: any = {}; | |
| 110 | + const result: any = Object.create(null); | |
| 111 | 111 | Object.getOwnPropertyNames(props).forEach(key => { |
| 112 | 112 | const prop = props[key]; |
| 113 | 113 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 118 | 118 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 119 | 119 | } |
| 120 | 120 | }); |
| 121 | - return result; | |
| 121 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/0779f.json
Mflowdefault / TopLevel.js+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/07c75.json
Mflowdefault / TopLevel.js+2 −2
| @@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 132 | 132 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 133 | 133 | return invalidValue(l(ref || "object"), val, key, parent); |
| 134 | 134 | } |
| 135 | - const result: any = {}; | |
| 135 | + const result: any = Object.create(null); | |
| 136 | 136 | Object.getOwnPropertyNames(props).forEach(key => { |
| 137 | 137 | const prop = props[key]; |
| 138 | 138 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 144 | 144 | } |
| 145 | 145 | }); |
| 146 | - return result; | |
| 146 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 132 | 132 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 133 | 133 | return invalidValue(l(ref || "object"), val, key, parent); |
| 134 | 134 | } |
| 135 | - const result: any = {}; | |
| 135 | + const result: any = Object.create(null); | |
| 136 | 136 | Object.getOwnPropertyNames(props).forEach(key => { |
| 137 | 137 | const prop = props[key]; |
| 138 | 138 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 144 | 144 | } |
| 145 | 145 | }); |
| 146 | - return result; | |
| 146 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/09f54.json
Melmdefault / QuickType.elm+9 −1
| @@ -61,7 +61,7 @@ quickType = | ||
| 61 | 61 | encodeQuickType : QuickType -> Jenc.Value |
| 62 | 62 | encodeQuickType x = |
| 63 | 63 | Jenc.object |
| 64 | - [ ("data", Jenc.dict identity encodeDatum x.data) | |
| 64 | + [ ("data", makeDictEncoder identity encodeDatum x.data) | |
| 65 | 65 | , ("description", encodeDescription x.description) |
| 66 | 66 | ] |
| 67 | 67 | |
| @@ -97,6 +97,14 @@ encodeDescription x = | ||
| 97 | 97 | |
| 98 | 98 | --- encoder helpers |
| 99 | 99 | |
| 100 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 101 | +makeDictEncoder f m r = | |
| 102 | + r | |
| 103 | + |> Dict.toList | |
| 104 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 105 | + |> String.join "," | |
| 106 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 107 | + | |
| 100 | 108 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 101 | 109 | makeNullableEncoder f m = |
| 102 | 110 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 121 | 121 | return invalidValue(l(ref || "object"), val, key, parent); |
| 122 | 122 | } |
| 123 | - const result: any = {}; | |
| 123 | + const result: any = Object.create(null); | |
| 124 | 124 | Object.getOwnPropertyNames(props).forEach(key => { |
| 125 | 125 | const prop = props[key]; |
| 126 | 126 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 131 | 131 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 132 | 132 | } |
| 133 | 133 | }); |
| 134 | - return result; | |
| 134 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 121 | 121 | return invalidValue(l(ref || "object"), val, key, parent); |
| 122 | 122 | } |
| 123 | - const result: any = {}; | |
| 123 | + const result: any = Object.create(null); | |
| 124 | 124 | Object.getOwnPropertyNames(props).forEach(key => { |
| 125 | 125 | const prop = props[key]; |
| 126 | 126 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 131 | 131 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 132 | 132 | } |
| 133 | 133 | }); |
| 134 | - return result; | |
| 134 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/0a358.json
Mflowdefault / TopLevel.js+2 −2
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 126 | 126 | return invalidValue(l(ref || "object"), val, key, parent); |
| 127 | 127 | } |
| 128 | - const result: any = {}; | |
| 128 | + const result: any = Object.create(null); | |
| 129 | 129 | Object.getOwnPropertyNames(props).forEach(key => { |
| 130 | 130 | const prop = props[key]; |
| 131 | 131 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 137 | 137 | } |
| 138 | 138 | }); |
| 139 | - return result; | |
| 139 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 123 | 123 | return invalidValue(l(ref || "object"), val, key, parent); |
| 124 | 124 | } |
| 125 | - const result: any = {}; | |
| 125 | + const result: any = Object.create(null); | |
| 126 | 126 | Object.getOwnPropertyNames(props).forEach(key => { |
| 127 | 127 | const prop = props[key]; |
| 128 | 128 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 134 | 134 | } |
| 135 | 135 | }); |
| 136 | - return result; | |
| 136 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/0a91a.json
Mflowdefault / TopLevel.js+2 −2
| @@ -327,7 +327,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 327 | 327 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 328 | 328 | return invalidValue(l(ref || "object"), val, key, parent); |
| 329 | 329 | } |
| 330 | - const result: any = {}; | |
| 330 | + const result: any = Object.create(null); | |
| 331 | 331 | Object.getOwnPropertyNames(props).forEach(key => { |
| 332 | 332 | const prop = props[key]; |
| 333 | 333 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -338,7 +338,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 338 | 338 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 339 | 339 | } |
| 340 | 340 | }); |
| 341 | - return result; | |
| 341 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -322,7 +322,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 322 | 322 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 323 | 323 | return invalidValue(l(ref || "object"), val, key, parent); |
| 324 | 324 | } |
| 325 | - const result: any = {}; | |
| 325 | + const result: any = Object.create(null); | |
| 326 | 326 | Object.getOwnPropertyNames(props).forEach(key => { |
| 327 | 327 | const prop = props[key]; |
| 328 | 328 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -333,7 +333,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 333 | 333 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 334 | 334 | } |
| 335 | 335 | }); |
| 336 | - return result; | |
| 336 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/0b91a.json
Mflowdefault / TopLevel.js+2 −2
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 148 | 148 | return invalidValue(l(ref || "object"), val, key, parent); |
| 149 | 149 | } |
| 150 | - const result: any = {}; | |
| 150 | + const result: any = Object.create(null); | |
| 151 | 151 | Object.getOwnPropertyNames(props).forEach(key => { |
| 152 | 152 | const prop = props[key]; |
| 153 | 153 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 158 | 158 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 159 | 159 | } |
| 160 | 160 | }); |
| 161 | - return result; | |
| 161 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 148 | 148 | return invalidValue(l(ref || "object"), val, key, parent); |
| 149 | 149 | } |
| 150 | - const result: any = {}; | |
| 150 | + const result: any = Object.create(null); | |
| 151 | 151 | Object.getOwnPropertyNames(props).forEach(key => { |
| 152 | 152 | const prop = props[key]; |
| 153 | 153 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 158 | 158 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 159 | 159 | } |
| 160 | 160 | }); |
| 161 | - return result; | |
| 161 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/0cffa.json
Mflowdefault / TopLevel.js+2 −2
| @@ -222,7 +222,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 222 | 222 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 223 | 223 | return invalidValue(l(ref || "object"), val, key, parent); |
| 224 | 224 | } |
| 225 | - const result: any = {}; | |
| 225 | + const result: any = Object.create(null); | |
| 226 | 226 | Object.getOwnPropertyNames(props).forEach(key => { |
| 227 | 227 | const prop = props[key]; |
| 228 | 228 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 233 | 233 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 234 | 234 | } |
| 235 | 235 | }); |
| 236 | - return result; | |
| 236 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -215,7 +215,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 215 | 215 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 216 | 216 | return invalidValue(l(ref || "object"), val, key, parent); |
| 217 | 217 | } |
| 218 | - const result: any = {}; | |
| 218 | + const result: any = Object.create(null); | |
| 219 | 219 | Object.getOwnPropertyNames(props).forEach(key => { |
| 220 | 220 | const prop = props[key]; |
| 221 | 221 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -226,7 +226,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 226 | 226 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 227 | 227 | } |
| 228 | 228 | }); |
| 229 | - return result; | |
| 229 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/0e0c2.json
Mflowdefault / TopLevel.js+2 −2
| @@ -184,7 +184,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 184 | 184 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 185 | 185 | return invalidValue(l(ref || "object"), val, key, parent); |
| 186 | 186 | } |
| 187 | - const result: any = {}; | |
| 187 | + const result: any = Object.create(null); | |
| 188 | 188 | Object.getOwnPropertyNames(props).forEach(key => { |
| 189 | 189 | const prop = props[key]; |
| 190 | 190 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -195,7 +195,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 195 | 195 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 196 | 196 | } |
| 197 | 197 | }); |
| 198 | - return result; | |
| 198 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -178,7 +178,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 178 | 178 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 179 | 179 | return invalidValue(l(ref || "object"), val, key, parent); |
| 180 | 180 | } |
| 181 | - const result: any = {}; | |
| 181 | + const result: any = Object.create(null); | |
| 182 | 182 | Object.getOwnPropertyNames(props).forEach(key => { |
| 183 | 183 | const prop = props[key]; |
| 184 | 184 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -189,7 +189,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 189 | 189 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 190 | 190 | } |
| 191 | 191 | }); |
| 192 | - return result; | |
| 192 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/0fecf.json
Mflowdefault / TopLevel.js+2 −2
| @@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 107 | 107 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 108 | 108 | return invalidValue(l(ref || "object"), val, key, parent); |
| 109 | 109 | } |
| 110 | - const result: any = {}; | |
| 110 | + const result: any = Object.create(null); | |
| 111 | 111 | Object.getOwnPropertyNames(props).forEach(key => { |
| 112 | 112 | const prop = props[key]; |
| 113 | 113 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 118 | 118 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 119 | 119 | } |
| 120 | 120 | }); |
| 121 | - return result; | |
| 121 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 107 | 107 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 108 | 108 | return invalidValue(l(ref || "object"), val, key, parent); |
| 109 | 109 | } |
| 110 | - const result: any = {}; | |
| 110 | + const result: any = Object.create(null); | |
| 111 | 111 | Object.getOwnPropertyNames(props).forEach(key => { |
| 112 | 112 | const prop = props[key]; |
| 113 | 113 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 118 | 118 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 119 | 119 | } |
| 120 | 120 | }); |
| 121 | - return result; | |
| 121 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/10be4.json
Mflowdefault / TopLevel.js+2 −2
| @@ -174,7 +174,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 174 | 174 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 175 | 175 | return invalidValue(l(ref || "object"), val, key, parent); |
| 176 | 176 | } |
| 177 | - const result: any = {}; | |
| 177 | + const result: any = Object.create(null); | |
| 178 | 178 | Object.getOwnPropertyNames(props).forEach(key => { |
| 179 | 179 | const prop = props[key]; |
| 180 | 180 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -185,7 +185,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 185 | 185 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 186 | 186 | } |
| 187 | 187 | }); |
| 188 | - return result; | |
| 188 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 148 | 148 | return invalidValue(l(ref || "object"), val, key, parent); |
| 149 | 149 | } |
| 150 | - const result: any = {}; | |
| 150 | + const result: any = Object.create(null); | |
| 151 | 151 | Object.getOwnPropertyNames(props).forEach(key => { |
| 152 | 152 | const prop = props[key]; |
| 153 | 153 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 158 | 158 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 159 | 159 | } |
| 160 | 160 | }); |
| 161 | - return result; | |
| 161 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/112b5.json
Mflowdefault / TopLevel.js+2 −2
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 121 | 121 | return invalidValue(l(ref || "object"), val, key, parent); |
| 122 | 122 | } |
| 123 | - const result: any = {}; | |
| 123 | + const result: any = Object.create(null); | |
| 124 | 124 | Object.getOwnPropertyNames(props).forEach(key => { |
| 125 | 125 | const prop = props[key]; |
| 126 | 126 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 131 | 131 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 132 | 132 | } |
| 133 | 133 | }); |
| 134 | - return result; | |
| 134 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/127a1.json
Mflowdefault / TopLevel.js+2 −2
| @@ -221,7 +221,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 221 | 221 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 222 | 222 | return invalidValue(l(ref || "object"), val, key, parent); |
| 223 | 223 | } |
| 224 | - const result: any = {}; | |
| 224 | + const result: any = Object.create(null); | |
| 225 | 225 | Object.getOwnPropertyNames(props).forEach(key => { |
| 226 | 226 | const prop = props[key]; |
| 227 | 227 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -232,7 +232,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 232 | 232 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 233 | 233 | } |
| 234 | 234 | }); |
| 235 | - return result; | |
| 235 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -215,7 +215,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 215 | 215 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 216 | 216 | return invalidValue(l(ref || "object"), val, key, parent); |
| 217 | 217 | } |
| 218 | - const result: any = {}; | |
| 218 | + const result: any = Object.create(null); | |
| 219 | 219 | Object.getOwnPropertyNames(props).forEach(key => { |
| 220 | 220 | const prop = props[key]; |
| 221 | 221 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -226,7 +226,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 226 | 226 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 227 | 227 | } |
| 228 | 228 | }); |
| 229 | - return result; | |
| 229 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/13d8d.json
Mflowdefault / TopLevel.js+2 −2
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 134 | 134 | return invalidValue(l(ref || "object"), val, key, parent); |
| 135 | 135 | } |
| 136 | - const result: any = {}; | |
| 136 | + const result: any = Object.create(null); | |
| 137 | 137 | Object.getOwnPropertyNames(props).forEach(key => { |
| 138 | 138 | const prop = props[key]; |
| 139 | 139 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 145 | 145 | } |
| 146 | 146 | }); |
| 147 | - return result; | |
| 147 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 134 | 134 | return invalidValue(l(ref || "object"), val, key, parent); |
| 135 | 135 | } |
| 136 | - const result: any = {}; | |
| 136 | + const result: any = Object.create(null); | |
| 137 | 137 | Object.getOwnPropertyNames(props).forEach(key => { |
| 138 | 138 | const prop = props[key]; |
| 139 | 139 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 145 | 145 | } |
| 146 | 146 | }); |
| 147 | - return result; | |
| 147 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/14d38.json
Mflowdefault / TopLevel.js+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/167d6.json
Melmdefault / QuickType.elm+9 −1
| @@ -51,11 +51,19 @@ encodeQuickType x = | ||
| 51 | 51 | Jenc.object |
| 52 | 52 | [ ("base", Jenc.string x.base) |
| 53 | 53 | , ("date", Jenc.string x.date) |
| 54 | - , ("rates", Jenc.dict identity Jenc.float x.rates) | |
| 54 | + , ("rates", makeDictEncoder identity Jenc.float x.rates) | |
| 55 | 55 | ] |
| 56 | 56 | |
| 57 | 57 | --- encoder helpers |
| 58 | 58 | |
| 59 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 60 | +makeDictEncoder f m r = | |
| 61 | + r | |
| 62 | + |> Dict.toList | |
| 63 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 64 | + |> String.join "," | |
| 65 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 66 | + | |
| 59 | 67 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 60 | 68 | makeNullableEncoder f m = |
| 61 | 69 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/16bc5.json
Mflowdefault / TopLevel.js+2 −2
| @@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 205 | 205 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 206 | 206 | return invalidValue(l(ref || "object"), val, key, parent); |
| 207 | 207 | } |
| 208 | - const result: any = {}; | |
| 208 | + const result: any = Object.create(null); | |
| 209 | 209 | Object.getOwnPropertyNames(props).forEach(key => { |
| 210 | 210 | const prop = props[key]; |
| 211 | 211 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 216 | 216 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 217 | 217 | } |
| 218 | 218 | }); |
| 219 | - return result; | |
| 219 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 205 | 205 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 206 | 206 | return invalidValue(l(ref || "object"), val, key, parent); |
| 207 | 207 | } |
| 208 | - const result: any = {}; | |
| 208 | + const result: any = Object.create(null); | |
| 209 | 209 | Object.getOwnPropertyNames(props).forEach(key => { |
| 210 | 210 | const prop = props[key]; |
| 211 | 211 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 216 | 216 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 217 | 217 | } |
| 218 | 218 | }); |
| 219 | - return result; | |
| 219 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/176f1.json
Mflowdefault / TopLevel.js+2 −2
| @@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 132 | 132 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 133 | 133 | return invalidValue(l(ref || "object"), val, key, parent); |
| 134 | 134 | } |
| 135 | - const result: any = {}; | |
| 135 | + const result: any = Object.create(null); | |
| 136 | 136 | Object.getOwnPropertyNames(props).forEach(key => { |
| 137 | 137 | const prop = props[key]; |
| 138 | 138 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 144 | 144 | } |
| 145 | 145 | }); |
| 146 | - return result; | |
| 146 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 132 | 132 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 133 | 133 | return invalidValue(l(ref || "object"), val, key, parent); |
| 134 | 134 | } |
| 135 | - const result: any = {}; | |
| 135 | + const result: any = Object.create(null); | |
| 136 | 136 | Object.getOwnPropertyNames(props).forEach(key => { |
| 137 | 137 | const prop = props[key]; |
| 138 | 138 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 144 | 144 | } |
| 145 | 145 | }); |
| 146 | - return result; | |
| 146 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/1a7f5.json
Mflowdefault / TopLevel.js+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 117 | 117 | return invalidValue(l(ref || "object"), val, key, parent); |
| 118 | 118 | } |
| 119 | - const result: any = {}; | |
| 119 | + const result: any = Object.create(null); | |
| 120 | 120 | Object.getOwnPropertyNames(props).forEach(key => { |
| 121 | 121 | const prop = props[key]; |
| 122 | 122 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - return result; | |
| 130 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/1b28c.json
Mflowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/1b409.json
Mflowdefault / TopLevel.js+2 −2
| @@ -198,7 +198,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 198 | 198 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 199 | 199 | return invalidValue(l(ref || "object"), val, key, parent); |
| 200 | 200 | } |
| 201 | - const result: any = {}; | |
| 201 | + const result: any = Object.create(null); | |
| 202 | 202 | Object.getOwnPropertyNames(props).forEach(key => { |
| 203 | 203 | const prop = props[key]; |
| 204 | 204 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -209,7 +209,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 209 | 209 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 210 | 210 | } |
| 211 | 211 | }); |
| 212 | - return result; | |
| 212 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -181,7 +181,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 181 | 181 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 182 | 182 | return invalidValue(l(ref || "object"), val, key, parent); |
| 183 | 183 | } |
| 184 | - const result: any = {}; | |
| 184 | + const result: any = Object.create(null); | |
| 185 | 185 | Object.getOwnPropertyNames(props).forEach(key => { |
| 186 | 186 | const prop = props[key]; |
| 187 | 187 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -192,7 +192,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 192 | 192 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 193 | 193 | } |
| 194 | 194 | }); |
| 195 | - return result; | |
| 195 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/2465e.json
Mflowdefault / TopLevel.js+2 −2
| @@ -180,7 +180,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 180 | 180 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 181 | 181 | return invalidValue(l(ref || "object"), val, key, parent); |
| 182 | 182 | } |
| 183 | - const result: any = {}; | |
| 183 | + const result: any = Object.create(null); | |
| 184 | 184 | Object.getOwnPropertyNames(props).forEach(key => { |
| 185 | 185 | const prop = props[key]; |
| 186 | 186 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -191,7 +191,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 191 | 191 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 192 | 192 | } |
| 193 | 193 | }); |
| 194 | - return result; | |
| 194 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -180,7 +180,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 180 | 180 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 181 | 181 | return invalidValue(l(ref || "object"), val, key, parent); |
| 182 | 182 | } |
| 183 | - const result: any = {}; | |
| 183 | + const result: any = Object.create(null); | |
| 184 | 184 | Object.getOwnPropertyNames(props).forEach(key => { |
| 185 | 185 | const prop = props[key]; |
| 186 | 186 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -191,7 +191,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 191 | 191 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 192 | 192 | } |
| 193 | 193 | }); |
| 194 | - return result; | |
| 194 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/24f52.json
Mflowdefault / TopLevel.js+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/262f0.json
Mflowdefault / TopLevel.js+2 −2
| @@ -210,7 +210,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 210 | 210 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 211 | 211 | return invalidValue(l(ref || "object"), val, key, parent); |
| 212 | 212 | } |
| 213 | - const result: any = {}; | |
| 213 | + const result: any = Object.create(null); | |
| 214 | 214 | Object.getOwnPropertyNames(props).forEach(key => { |
| 215 | 215 | const prop = props[key]; |
| 216 | 216 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -221,7 +221,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 221 | 221 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 222 | 222 | } |
| 223 | 223 | }); |
| 224 | - return result; | |
| 224 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -207,7 +207,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 207 | 207 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 208 | 208 | return invalidValue(l(ref || "object"), val, key, parent); |
| 209 | 209 | } |
| 210 | - const result: any = {}; | |
| 210 | + const result: any = Object.create(null); | |
| 211 | 211 | Object.getOwnPropertyNames(props).forEach(key => { |
| 212 | 212 | const prop = props[key]; |
| 213 | 213 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -218,7 +218,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 218 | 218 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 219 | 219 | } |
| 220 | 220 | }); |
| 221 | - return result; | |
| 221 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/26b49.json
Mflowdefault / TopLevel.js+2 −2
| @@ -219,7 +219,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 219 | 219 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 220 | 220 | return invalidValue(l(ref || "object"), val, key, parent); |
| 221 | 221 | } |
| 222 | - const result: any = {}; | |
| 222 | + const result: any = Object.create(null); | |
| 223 | 223 | Object.getOwnPropertyNames(props).forEach(key => { |
| 224 | 224 | const prop = props[key]; |
| 225 | 225 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -230,7 +230,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 230 | 230 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 231 | 231 | } |
| 232 | 232 | }); |
| 233 | - return result; | |
| 233 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -214,7 +214,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 214 | 214 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 215 | 215 | return invalidValue(l(ref || "object"), val, key, parent); |
| 216 | 216 | } |
| 217 | - const result: any = {}; | |
| 217 | + const result: any = Object.create(null); | |
| 218 | 218 | Object.getOwnPropertyNames(props).forEach(key => { |
| 219 | 219 | const prop = props[key]; |
| 220 | 220 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -225,7 +225,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 225 | 225 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 226 | 226 | } |
| 227 | 227 | }); |
| 228 | - return result; | |
| 228 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/26c9c.json
Mflowdefault / TopLevel.js+2 −2
| @@ -294,7 +294,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 294 | 294 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 295 | 295 | return invalidValue(l(ref || "object"), val, key, parent); |
| 296 | 296 | } |
| 297 | - const result: any = {}; | |
| 297 | + const result: any = Object.create(null); | |
| 298 | 298 | Object.getOwnPropertyNames(props).forEach(key => { |
| 299 | 299 | const prop = props[key]; |
| 300 | 300 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -305,7 +305,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 305 | 305 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 306 | 306 | } |
| 307 | 307 | }); |
| 308 | - return result; | |
| 308 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -294,7 +294,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 294 | 294 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 295 | 295 | return invalidValue(l(ref || "object"), val, key, parent); |
| 296 | 296 | } |
| 297 | - const result: any = {}; | |
| 297 | + const result: any = Object.create(null); | |
| 298 | 298 | Object.getOwnPropertyNames(props).forEach(key => { |
| 299 | 299 | const prop = props[key]; |
| 300 | 300 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -305,7 +305,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 305 | 305 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 306 | 306 | } |
| 307 | 307 | }); |
| 308 | - return result; | |
| 308 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/27332.json
Mflowdefault / TopLevel.js+2 −2
| @@ -260,7 +260,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 260 | 260 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 261 | 261 | return invalidValue(l(ref || "object"), val, key, parent); |
| 262 | 262 | } |
| 263 | - const result: any = {}; | |
| 263 | + const result: any = Object.create(null); | |
| 264 | 264 | Object.getOwnPropertyNames(props).forEach(key => { |
| 265 | 265 | const prop = props[key]; |
| 266 | 266 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -271,7 +271,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 271 | 271 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 272 | 272 | } |
| 273 | 273 | }); |
| 274 | - return result; | |
| 274 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -246,7 +246,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 246 | 246 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 247 | 247 | return invalidValue(l(ref || "object"), val, key, parent); |
| 248 | 248 | } |
| 249 | - const result: any = {}; | |
| 249 | + const result: any = Object.create(null); | |
| 250 | 250 | Object.getOwnPropertyNames(props).forEach(key => { |
| 251 | 251 | const prop = props[key]; |
| 252 | 252 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -257,7 +257,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 257 | 257 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 258 | 258 | } |
| 259 | 259 | }); |
| 260 | - return result; | |
| 260 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/29f47.json
Mflowdefault / TopLevel.js+2 −2
| @@ -246,7 +246,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 246 | 246 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 247 | 247 | return invalidValue(l(ref || "object"), val, key, parent); |
| 248 | 248 | } |
| 249 | - const result: any = {}; | |
| 249 | + const result: any = Object.create(null); | |
| 250 | 250 | Object.getOwnPropertyNames(props).forEach(key => { |
| 251 | 251 | const prop = props[key]; |
| 252 | 252 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -257,7 +257,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 257 | 257 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 258 | 258 | } |
| 259 | 259 | }); |
| 260 | - return result; | |
| 260 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 233 | 233 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 234 | 234 | return invalidValue(l(ref || "object"), val, key, parent); |
| 235 | 235 | } |
| 236 | - const result: any = {}; | |
| 236 | + const result: any = Object.create(null); | |
| 237 | 237 | Object.getOwnPropertyNames(props).forEach(key => { |
| 238 | 238 | const prop = props[key]; |
| 239 | 239 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -244,7 +244,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 244 | 244 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 245 | 245 | } |
| 246 | 246 | }); |
| 247 | - return result; | |
| 247 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/2d4e2.json
Mflowdefault / TopLevel.js+2 −2
| @@ -214,7 +214,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 214 | 214 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 215 | 215 | return invalidValue(l(ref || "object"), val, key, parent); |
| 216 | 216 | } |
| 217 | - const result: any = {}; | |
| 217 | + const result: any = Object.create(null); | |
| 218 | 218 | Object.getOwnPropertyNames(props).forEach(key => { |
| 219 | 219 | const prop = props[key]; |
| 220 | 220 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -225,7 +225,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 225 | 225 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 226 | 226 | } |
| 227 | 227 | }); |
| 228 | - return result; | |
| 228 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -191,7 +191,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 191 | 191 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 192 | 192 | return invalidValue(l(ref || "object"), val, key, parent); |
| 193 | 193 | } |
| 194 | - const result: any = {}; | |
| 194 | + const result: any = Object.create(null); | |
| 195 | 195 | Object.getOwnPropertyNames(props).forEach(key => { |
| 196 | 196 | const prop = props[key]; |
| 197 | 197 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -202,7 +202,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 202 | 202 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 203 | 203 | } |
| 204 | 204 | }); |
| 205 | - return result; | |
| 205 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/2df80.json
Mflowdefault / TopLevel.js+2 −2
| @@ -180,7 +180,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 180 | 180 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 181 | 181 | return invalidValue(l(ref || "object"), val, key, parent); |
| 182 | 182 | } |
| 183 | - const result: any = {}; | |
| 183 | + const result: any = Object.create(null); | |
| 184 | 184 | Object.getOwnPropertyNames(props).forEach(key => { |
| 185 | 185 | const prop = props[key]; |
| 186 | 186 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -191,7 +191,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 191 | 191 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 192 | 192 | } |
| 193 | 193 | }); |
| 194 | - return result; | |
| 194 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 137 | 137 | return invalidValue(l(ref || "object"), val, key, parent); |
| 138 | 138 | } |
| 139 | - const result: any = {}; | |
| 139 | + const result: any = Object.create(null); | |
| 140 | 140 | Object.getOwnPropertyNames(props).forEach(key => { |
| 141 | 141 | const prop = props[key]; |
| 142 | 142 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 148 | 148 | } |
| 149 | 149 | }); |
| 150 | - return result; | |
| 150 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/31189.json
Mflowdefault / TopLevel.js+2 −2
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 136 | 136 | return invalidValue(l(ref || "object"), val, key, parent); |
| 137 | 137 | } |
| 138 | - const result: any = {}; | |
| 138 | + const result: any = Object.create(null); | |
| 139 | 139 | Object.getOwnPropertyNames(props).forEach(key => { |
| 140 | 140 | const prop = props[key]; |
| 141 | 141 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 146 | 146 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 147 | 147 | } |
| 148 | 148 | }); |
| 149 | - return result; | |
| 149 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -134,7 +134,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 134 | 134 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 135 | 135 | return invalidValue(l(ref || "object"), val, key, parent); |
| 136 | 136 | } |
| 137 | - const result: any = {}; | |
| 137 | + const result: any = Object.create(null); | |
| 138 | 138 | Object.getOwnPropertyNames(props).forEach(key => { |
| 139 | 139 | const prop = props[key]; |
| 140 | 140 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 146 | 146 | } |
| 147 | 147 | }); |
| 148 | - return result; | |
| 148 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/32431.json
Mflowdefault / TopLevel.js+2 −2
| @@ -178,7 +178,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 178 | 178 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 179 | 179 | return invalidValue(l(ref || "object"), val, key, parent); |
| 180 | 180 | } |
| 181 | - const result: any = {}; | |
| 181 | + const result: any = Object.create(null); | |
| 182 | 182 | Object.getOwnPropertyNames(props).forEach(key => { |
| 183 | 183 | const prop = props[key]; |
| 184 | 184 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -189,7 +189,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 189 | 189 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 190 | 190 | } |
| 191 | 191 | }); |
| 192 | - return result; | |
| 192 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -170,7 +170,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 170 | 170 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 171 | 171 | return invalidValue(l(ref || "object"), val, key, parent); |
| 172 | 172 | } |
| 173 | - const result: any = {}; | |
| 173 | + const result: any = Object.create(null); | |
| 174 | 174 | Object.getOwnPropertyNames(props).forEach(key => { |
| 175 | 175 | const prop = props[key]; |
| 176 | 176 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -181,7 +181,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 181 | 181 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 182 | 182 | } |
| 183 | 183 | }); |
| 184 | - return result; | |
| 184 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/32d5c.json
Mflowdefault / TopLevel.js+2 −2
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 117 | 117 | return invalidValue(l(ref || "object"), val, key, parent); |
| 118 | 118 | } |
| 119 | - const result: any = {}; | |
| 119 | + const result: any = Object.create(null); | |
| 120 | 120 | Object.getOwnPropertyNames(props).forEach(key => { |
| 121 | 121 | const prop = props[key]; |
| 122 | 122 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - return result; | |
| 130 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 117 | 117 | return invalidValue(l(ref || "object"), val, key, parent); |
| 118 | 118 | } |
| 119 | - const result: any = {}; | |
| 119 | + const result: any = Object.create(null); | |
| 120 | 120 | Object.getOwnPropertyNames(props).forEach(key => { |
| 121 | 121 | const prop = props[key]; |
| 122 | 122 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - return result; | |
| 130 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/337ed.json
Mflowdefault / TopLevel.js+2 −2
| @@ -175,7 +175,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 175 | 175 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 176 | 176 | return invalidValue(l(ref || "object"), val, key, parent); |
| 177 | 177 | } |
| 178 | - const result: any = {}; | |
| 178 | + const result: any = Object.create(null); | |
| 179 | 179 | Object.getOwnPropertyNames(props).forEach(key => { |
| 180 | 180 | const prop = props[key]; |
| 181 | 181 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -186,7 +186,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 186 | 186 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 187 | 187 | } |
| 188 | 188 | }); |
| 189 | - return result; | |
| 189 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -165,7 +165,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 165 | 165 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 166 | 166 | return invalidValue(l(ref || "object"), val, key, parent); |
| 167 | 167 | } |
| 168 | - const result: any = {}; | |
| 168 | + const result: any = Object.create(null); | |
| 169 | 169 | Object.getOwnPropertyNames(props).forEach(key => { |
| 170 | 170 | const prop = props[key]; |
| 171 | 171 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -176,7 +176,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 176 | 176 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 177 | 177 | } |
| 178 | 178 | }); |
| 179 | - return result; | |
| 179 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/33d2e.json
Mflowdefault / TopLevel.js+2 −2
| @@ -160,7 +160,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 160 | 160 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 161 | 161 | return invalidValue(l(ref || "object"), val, key, parent); |
| 162 | 162 | } |
| 163 | - const result: any = {}; | |
| 163 | + const result: any = Object.create(null); | |
| 164 | 164 | Object.getOwnPropertyNames(props).forEach(key => { |
| 165 | 165 | const prop = props[key]; |
| 166 | 166 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -171,7 +171,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 171 | 171 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 172 | 172 | } |
| 173 | 173 | }); |
| 174 | - return result; | |
| 174 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -148,7 +148,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 148 | 148 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 149 | 149 | return invalidValue(l(ref || "object"), val, key, parent); |
| 150 | 150 | } |
| 151 | - const result: any = {}; | |
| 151 | + const result: any = Object.create(null); | |
| 152 | 152 | Object.getOwnPropertyNames(props).forEach(key => { |
| 153 | 153 | const prop = props[key]; |
| 154 | 154 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -159,7 +159,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 159 | 159 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 160 | 160 | } |
| 161 | 161 | }); |
| 162 | - return result; | |
| 162 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/34702.json
Mflowdefault / TopLevel.js+2 −2
| @@ -195,7 +195,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 195 | 195 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 196 | 196 | return invalidValue(l(ref || "object"), val, key, parent); |
| 197 | 197 | } |
| 198 | - const result: any = {}; | |
| 198 | + const result: any = Object.create(null); | |
| 199 | 199 | Object.getOwnPropertyNames(props).forEach(key => { |
| 200 | 200 | const prop = props[key]; |
| 201 | 201 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -206,7 +206,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 206 | 206 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 207 | 207 | } |
| 208 | 208 | }); |
| 209 | - return result; | |
| 209 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -162,7 +162,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 162 | 162 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 163 | 163 | return invalidValue(l(ref || "object"), val, key, parent); |
| 164 | 164 | } |
| 165 | - const result: any = {}; | |
| 165 | + const result: any = Object.create(null); | |
| 166 | 166 | Object.getOwnPropertyNames(props).forEach(key => { |
| 167 | 167 | const prop = props[key]; |
| 168 | 168 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -173,7 +173,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 173 | 173 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 174 | 174 | } |
| 175 | 175 | }); |
| 176 | - return result; | |
| 176 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/3536b.json
Mflowdefault / TopLevel.js+2 −2
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 143 | 143 | return invalidValue(l(ref || "object"), val, key, parent); |
| 144 | 144 | } |
| 145 | - const result: any = {}; | |
| 145 | + const result: any = Object.create(null); | |
| 146 | 146 | Object.getOwnPropertyNames(props).forEach(key => { |
| 147 | 147 | const prop = props[key]; |
| 148 | 148 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -153,7 +153,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 153 | 153 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 154 | 154 | } |
| 155 | 155 | }); |
| 156 | - return result; | |
| 156 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 137 | 137 | return invalidValue(l(ref || "object"), val, key, parent); |
| 138 | 138 | } |
| 139 | - const result: any = {}; | |
| 139 | + const result: any = Object.create(null); | |
| 140 | 140 | Object.getOwnPropertyNames(props).forEach(key => { |
| 141 | 141 | const prop = props[key]; |
| 142 | 142 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 148 | 148 | } |
| 149 | 149 | }); |
| 150 | - return result; | |
| 150 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/3659d.json
Mflowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/36d5d.json
Mflowdefault / TopLevel.js+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/3a6b3.json
Mflowdefault / TopLevel.js+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/3e9a3.json
Mflowdefault / TopLevel.js+2 −2
| @@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 132 | 132 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 133 | 133 | return invalidValue(l(ref || "object"), val, key, parent); |
| 134 | 134 | } |
| 135 | - const result: any = {}; | |
| 135 | + const result: any = Object.create(null); | |
| 136 | 136 | Object.getOwnPropertyNames(props).forEach(key => { |
| 137 | 137 | const prop = props[key]; |
| 138 | 138 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 144 | 144 | } |
| 145 | 145 | }); |
| 146 | - return result; | |
| 146 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 132 | 132 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 133 | 133 | return invalidValue(l(ref || "object"), val, key, parent); |
| 134 | 134 | } |
| 135 | - const result: any = {}; | |
| 135 | + const result: any = Object.create(null); | |
| 136 | 136 | Object.getOwnPropertyNames(props).forEach(key => { |
| 137 | 137 | const prop = props[key]; |
| 138 | 138 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 144 | 144 | } |
| 145 | 145 | }); |
| 146 | - return result; | |
| 146 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/3f1ce.json
Mflowdefault / TopLevel.js+2 −2
| @@ -208,7 +208,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 208 | 208 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 209 | 209 | return invalidValue(l(ref || "object"), val, key, parent); |
| 210 | 210 | } |
| 211 | - const result: any = {}; | |
| 211 | + const result: any = Object.create(null); | |
| 212 | 212 | Object.getOwnPropertyNames(props).forEach(key => { |
| 213 | 213 | const prop = props[key]; |
| 214 | 214 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -219,7 +219,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 219 | 219 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 220 | 220 | } |
| 221 | 221 | }); |
| 222 | - return result; | |
| 222 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -207,7 +207,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 207 | 207 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 208 | 208 | return invalidValue(l(ref || "object"), val, key, parent); |
| 209 | 209 | } |
| 210 | - const result: any = {}; | |
| 210 | + const result: any = Object.create(null); | |
| 211 | 211 | Object.getOwnPropertyNames(props).forEach(key => { |
| 212 | 212 | const prop = props[key]; |
| 213 | 213 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -218,7 +218,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 218 | 218 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 219 | 219 | } |
| 220 | 220 | }); |
| 221 | - return result; | |
| 221 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/421d4.json
Mflowdefault / TopLevel.js+2 −2
| @@ -221,7 +221,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 221 | 221 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 222 | 222 | return invalidValue(l(ref || "object"), val, key, parent); |
| 223 | 223 | } |
| 224 | - const result: any = {}; | |
| 224 | + const result: any = Object.create(null); | |
| 225 | 225 | Object.getOwnPropertyNames(props).forEach(key => { |
| 226 | 226 | const prop = props[key]; |
| 227 | 227 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -232,7 +232,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 232 | 232 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 233 | 233 | } |
| 234 | 234 | }); |
| 235 | - return result; | |
| 235 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -218,7 +218,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 218 | 218 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 219 | 219 | return invalidValue(l(ref || "object"), val, key, parent); |
| 220 | 220 | } |
| 221 | - const result: any = {}; | |
| 221 | + const result: any = Object.create(null); | |
| 222 | 222 | Object.getOwnPropertyNames(props).forEach(key => { |
| 223 | 223 | const prop = props[key]; |
| 224 | 224 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -229,7 +229,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 229 | 229 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 230 | 230 | } |
| 231 | 231 | }); |
| 232 | - return result; | |
| 232 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/437e7.json
Mflowdefault / TopLevel.js+2 −2
| @@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 216 | 216 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 217 | 217 | return invalidValue(l(ref || "object"), val, key, parent); |
| 218 | 218 | } |
| 219 | - const result: any = {}; | |
| 219 | + const result: any = Object.create(null); | |
| 220 | 220 | Object.getOwnPropertyNames(props).forEach(key => { |
| 221 | 221 | const prop = props[key]; |
| 222 | 222 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -227,7 +227,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 227 | 227 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 228 | 228 | } |
| 229 | 229 | }); |
| 230 | - return result; | |
| 230 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -211,7 +211,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 211 | 211 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 212 | 212 | return invalidValue(l(ref || "object"), val, key, parent); |
| 213 | 213 | } |
| 214 | - const result: any = {}; | |
| 214 | + const result: any = Object.create(null); | |
| 215 | 215 | Object.getOwnPropertyNames(props).forEach(key => { |
| 216 | 216 | const prop = props[key]; |
| 217 | 217 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -222,7 +222,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 222 | 222 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 223 | 223 | } |
| 224 | 224 | }); |
| 225 | - return result; | |
| 225 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/43970.json
Mflowdefault / TopLevel.js+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/43eaf.json
Melmdefault / QuickType.elm+9 −1
| @@ -51,11 +51,19 @@ encodeQuickType x = | ||
| 51 | 51 | Jenc.object |
| 52 | 52 | [ ("base", Jenc.string x.base) |
| 53 | 53 | , ("date", Jenc.string x.date) |
| 54 | - , ("rates", Jenc.dict identity Jenc.float x.rates) | |
| 54 | + , ("rates", makeDictEncoder identity Jenc.float x.rates) | |
| 55 | 55 | ] |
| 56 | 56 | |
| 57 | 57 | --- encoder helpers |
| 58 | 58 | |
| 59 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 60 | +makeDictEncoder f m r = | |
| 61 | + r | |
| 62 | + |> Dict.toList | |
| 63 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 64 | + |> String.join "," | |
| 65 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 66 | + | |
| 59 | 67 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 60 | 68 | makeNullableEncoder f m = |
| 61 | 69 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/458db.json
Mflowdefault / TopLevel.js+2 −2
| @@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 149 | 149 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 150 | 150 | return invalidValue(l(ref || "object"), val, key, parent); |
| 151 | 151 | } |
| 152 | - const result: any = {}; | |
| 152 | + const result: any = Object.create(null); | |
| 153 | 153 | Object.getOwnPropertyNames(props).forEach(key => { |
| 154 | 154 | const prop = props[key]; |
| 155 | 155 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -160,7 +160,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 160 | 160 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 161 | 161 | } |
| 162 | 162 | }); |
| 163 | - return result; | |
| 163 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -148,7 +148,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 148 | 148 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 149 | 149 | return invalidValue(l(ref || "object"), val, key, parent); |
| 150 | 150 | } |
| 151 | - const result: any = {}; | |
| 151 | + const result: any = Object.create(null); | |
| 152 | 152 | Object.getOwnPropertyNames(props).forEach(key => { |
| 153 | 153 | const prop = props[key]; |
| 154 | 154 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -159,7 +159,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 159 | 159 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 160 | 160 | } |
| 161 | 161 | }); |
| 162 | - return result; | |
| 162 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/4961a.json
Mflowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/4a0d7.json
Mflowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/4a455.json
Mflowdefault / TopLevel.js+2 −2
| @@ -150,7 +150,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 150 | 150 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 151 | 151 | return invalidValue(l(ref || "object"), val, key, parent); |
| 152 | 152 | } |
| 153 | - const result: any = {}; | |
| 153 | + const result: any = Object.create(null); | |
| 154 | 154 | Object.getOwnPropertyNames(props).forEach(key => { |
| 155 | 155 | const prop = props[key]; |
| 156 | 156 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -161,7 +161,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 161 | 161 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 162 | 162 | } |
| 163 | 163 | }); |
| 164 | - return result; | |
| 164 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 148 | 148 | return invalidValue(l(ref || "object"), val, key, parent); |
| 149 | 149 | } |
| 150 | - const result: any = {}; | |
| 150 | + const result: any = Object.create(null); | |
| 151 | 151 | Object.getOwnPropertyNames(props).forEach(key => { |
| 152 | 152 | const prop = props[key]; |
| 153 | 153 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 158 | 158 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 159 | 159 | } |
| 160 | 160 | }); |
| 161 | - return result; | |
| 161 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/4c547.json
Mflowdefault / TopLevel.js+2 −2
| @@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 205 | 205 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 206 | 206 | return invalidValue(l(ref || "object"), val, key, parent); |
| 207 | 207 | } |
| 208 | - const result: any = {}; | |
| 208 | + const result: any = Object.create(null); | |
| 209 | 209 | Object.getOwnPropertyNames(props).forEach(key => { |
| 210 | 210 | const prop = props[key]; |
| 211 | 211 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 216 | 216 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 217 | 217 | } |
| 218 | 218 | }); |
| 219 | - return result; | |
| 219 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 205 | 205 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 206 | 206 | return invalidValue(l(ref || "object"), val, key, parent); |
| 207 | 207 | } |
| 208 | - const result: any = {}; | |
| 208 | + const result: any = Object.create(null); | |
| 209 | 209 | Object.getOwnPropertyNames(props).forEach(key => { |
| 210 | 210 | const prop = props[key]; |
| 211 | 211 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 216 | 216 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 217 | 217 | } |
| 218 | 218 | }); |
| 219 | - return result; | |
| 219 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/4d6fb.json
Mflowdefault / TopLevel.js+2 −2
| @@ -255,7 +255,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 255 | 255 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 256 | 256 | return invalidValue(l(ref || "object"), val, key, parent); |
| 257 | 257 | } |
| 258 | - const result: any = {}; | |
| 258 | + const result: any = Object.create(null); | |
| 259 | 259 | Object.getOwnPropertyNames(props).forEach(key => { |
| 260 | 260 | const prop = props[key]; |
| 261 | 261 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -266,7 +266,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 266 | 266 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 267 | 267 | } |
| 268 | 268 | }); |
| 269 | - return result; | |
| 269 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -245,7 +245,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 245 | 245 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 246 | 246 | return invalidValue(l(ref || "object"), val, key, parent); |
| 247 | 247 | } |
| 248 | - const result: any = {}; | |
| 248 | + const result: any = Object.create(null); | |
| 249 | 249 | Object.getOwnPropertyNames(props).forEach(key => { |
| 250 | 250 | const prop = props[key]; |
| 251 | 251 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -256,7 +256,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 256 | 256 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 257 | 257 | } |
| 258 | 258 | }); |
| 259 | - return result; | |
| 259 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/4e336.json
Mflowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/54147.json
Mflowdefault / TopLevel.js+2 −2
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 124 | 124 | return invalidValue(l(ref || "object"), val, key, parent); |
| 125 | 125 | } |
| 126 | - const result: any = {}; | |
| 126 | + const result: any = Object.create(null); | |
| 127 | 127 | Object.getOwnPropertyNames(props).forEach(key => { |
| 128 | 128 | const prop = props[key]; |
| 129 | 129 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -134,7 +134,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 134 | 134 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 135 | 135 | } |
| 136 | 136 | }); |
| 137 | - return result; | |
| 137 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 121 | 121 | return invalidValue(l(ref || "object"), val, key, parent); |
| 122 | 122 | } |
| 123 | - const result: any = {}; | |
| 123 | + const result: any = Object.create(null); | |
| 124 | 124 | Object.getOwnPropertyNames(props).forEach(key => { |
| 125 | 125 | const prop = props[key]; |
| 126 | 126 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 131 | 131 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 132 | 132 | } |
| 133 | 133 | }); |
| 134 | - return result; | |
| 134 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/54d32.json
Mflowdefault / TopLevel.js+2 −2
| @@ -129,7 +129,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 129 | 129 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 130 | 130 | return invalidValue(l(ref || "object"), val, key, parent); |
| 131 | 131 | } |
| 132 | - const result: any = {}; | |
| 132 | + const result: any = Object.create(null); | |
| 133 | 133 | Object.getOwnPropertyNames(props).forEach(key => { |
| 134 | 134 | const prop = props[key]; |
| 135 | 135 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 141 | 141 | } |
| 142 | 142 | }); |
| 143 | - return result; | |
| 143 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 125 | 125 | return invalidValue(l(ref || "object"), val, key, parent); |
| 126 | 126 | } |
| 127 | - const result: any = {}; | |
| 127 | + const result: any = Object.create(null); | |
| 128 | 128 | Object.getOwnPropertyNames(props).forEach(key => { |
| 129 | 129 | const prop = props[key]; |
| 130 | 130 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 136 | 136 | } |
| 137 | 137 | }); |
| 138 | - return result; | |
| 138 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/570ec.json
Mflowdefault / TopLevel.js+2 −2
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 143 | 143 | return invalidValue(l(ref || "object"), val, key, parent); |
| 144 | 144 | } |
| 145 | - const result: any = {}; | |
| 145 | + const result: any = Object.create(null); | |
| 146 | 146 | Object.getOwnPropertyNames(props).forEach(key => { |
| 147 | 147 | const prop = props[key]; |
| 148 | 148 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -153,7 +153,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 153 | 153 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 154 | 154 | } |
| 155 | 155 | }); |
| 156 | - return result; | |
| 156 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 140 | 140 | return invalidValue(l(ref || "object"), val, key, parent); |
| 141 | 141 | } |
| 142 | - const result: any = {}; | |
| 142 | + const result: any = Object.create(null); | |
| 143 | 143 | Object.getOwnPropertyNames(props).forEach(key => { |
| 144 | 144 | const prop = props[key]; |
| 145 | 145 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -150,7 +150,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 150 | 150 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 151 | 151 | } |
| 152 | 152 | }); |
| 153 | - return result; | |
| 153 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/5dd0d.json
Mflowdefault / TopLevel.js+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/5eae5.json
Mflowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/5eb20.json
Mflowdefault / TopLevel.js+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/5f3a1.json
Melmdefault / QuickType.elm+9 −1
| @@ -51,11 +51,19 @@ encodeQuickType x = | ||
| 51 | 51 | Jenc.object |
| 52 | 52 | [ ("base", Jenc.string x.base) |
| 53 | 53 | , ("date", Jenc.string x.date) |
| 54 | - , ("rates", Jenc.dict identity Jenc.float x.rates) | |
| 54 | + , ("rates", makeDictEncoder identity Jenc.float x.rates) | |
| 55 | 55 | ] |
| 56 | 56 | |
| 57 | 57 | --- encoder helpers |
| 58 | 58 | |
| 59 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 60 | +makeDictEncoder f m r = | |
| 61 | + r | |
| 62 | + |> Dict.toList | |
| 63 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 64 | + |> String.join "," | |
| 65 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 66 | + | |
| 59 | 67 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 60 | 68 | makeNullableEncoder f m = |
| 61 | 69 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/5f7fe.json
Mflowdefault / TopLevel.js+2 −2
| @@ -295,7 +295,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 295 | 295 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 296 | 296 | return invalidValue(l(ref || "object"), val, key, parent); |
| 297 | 297 | } |
| 298 | - const result: any = {}; | |
| 298 | + const result: any = Object.create(null); | |
| 299 | 299 | Object.getOwnPropertyNames(props).forEach(key => { |
| 300 | 300 | const prop = props[key]; |
| 301 | 301 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -306,7 +306,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 306 | 306 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 307 | 307 | } |
| 308 | 308 | }); |
| 309 | - return result; | |
| 309 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -292,7 +292,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 292 | 292 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 293 | 293 | return invalidValue(l(ref || "object"), val, key, parent); |
| 294 | 294 | } |
| 295 | - const result: any = {}; | |
| 295 | + const result: any = Object.create(null); | |
| 296 | 296 | Object.getOwnPropertyNames(props).forEach(key => { |
| 297 | 297 | const prop = props[key]; |
| 298 | 298 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -303,7 +303,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 303 | 303 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 304 | 304 | } |
| 305 | 305 | }); |
| 306 | - return result; | |
| 306 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/617e8.json
Mflowdefault / TopLevel.js+2 −2
| @@ -294,7 +294,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 294 | 294 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 295 | 295 | return invalidValue(l(ref || "object"), val, key, parent); |
| 296 | 296 | } |
| 297 | - const result: any = {}; | |
| 297 | + const result: any = Object.create(null); | |
| 298 | 298 | Object.getOwnPropertyNames(props).forEach(key => { |
| 299 | 299 | const prop = props[key]; |
| 300 | 300 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -305,7 +305,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 305 | 305 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 306 | 306 | } |
| 307 | 307 | }); |
| 308 | - return result; | |
| 308 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -291,7 +291,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 291 | 291 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 292 | 292 | return invalidValue(l(ref || "object"), val, key, parent); |
| 293 | 293 | } |
| 294 | - const result: any = {}; | |
| 294 | + const result: any = Object.create(null); | |
| 295 | 295 | Object.getOwnPropertyNames(props).forEach(key => { |
| 296 | 296 | const prop = props[key]; |
| 297 | 297 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -302,7 +302,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 302 | 302 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 303 | 303 | } |
| 304 | 304 | }); |
| 305 | - return result; | |
| 305 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/61b66.json
Mflowdefault / TopLevel.js+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/6260a.json
Melmdefault / QuickType.elm+9 −1
| @@ -51,11 +51,19 @@ encodeQuickType x = | ||
| 51 | 51 | Jenc.object |
| 52 | 52 | [ ("base", Jenc.string x.base) |
| 53 | 53 | , ("date", Jenc.string x.date) |
| 54 | - , ("rates", Jenc.dict identity Jenc.float x.rates) | |
| 54 | + , ("rates", makeDictEncoder identity Jenc.float x.rates) | |
| 55 | 55 | ] |
| 56 | 56 | |
| 57 | 57 | --- encoder helpers |
| 58 | 58 | |
| 59 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 60 | +makeDictEncoder f m r = | |
| 61 | + r | |
| 62 | + |> Dict.toList | |
| 63 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 64 | + |> String.join "," | |
| 65 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 66 | + | |
| 59 | 67 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 60 | 68 | makeNullableEncoder f m = |
| 61 | 69 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/65dec.json
Mflowdefault / TopLevel.js+2 −2
| @@ -194,7 +194,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 194 | 194 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 195 | 195 | return invalidValue(l(ref || "object"), val, key, parent); |
| 196 | 196 | } |
| 197 | - const result: any = {}; | |
| 197 | + const result: any = Object.create(null); | |
| 198 | 198 | Object.getOwnPropertyNames(props).forEach(key => { |
| 199 | 199 | const prop = props[key]; |
| 200 | 200 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 205 | 205 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 206 | 206 | } |
| 207 | 207 | }); |
| 208 | - return result; | |
| 208 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -170,7 +170,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 170 | 170 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 171 | 171 | return invalidValue(l(ref || "object"), val, key, parent); |
| 172 | 172 | } |
| 173 | - const result: any = {}; | |
| 173 | + const result: any = Object.create(null); | |
| 174 | 174 | Object.getOwnPropertyNames(props).forEach(key => { |
| 175 | 175 | const prop = props[key]; |
| 176 | 176 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -181,7 +181,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 181 | 181 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 182 | 182 | } |
| 183 | 183 | }); |
| 184 | - return result; | |
| 184 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/66121.json
Mflowdefault / TopLevel.js+2 −2
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 152 | 152 | return invalidValue(l(ref || "object"), val, key, parent); |
| 153 | 153 | } |
| 154 | - const result: any = {}; | |
| 154 | + const result: any = Object.create(null); | |
| 155 | 155 | Object.getOwnPropertyNames(props).forEach(key => { |
| 156 | 156 | const prop = props[key]; |
| 157 | 157 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -162,7 +162,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 162 | 162 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 163 | 163 | } |
| 164 | 164 | }); |
| 165 | - return result; | |
| 165 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 143 | 143 | return invalidValue(l(ref || "object"), val, key, parent); |
| 144 | 144 | } |
| 145 | - const result: any = {}; | |
| 145 | + const result: any = Object.create(null); | |
| 146 | 146 | Object.getOwnPropertyNames(props).forEach(key => { |
| 147 | 147 | const prop = props[key]; |
| 148 | 148 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -153,7 +153,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 153 | 153 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 154 | 154 | } |
| 155 | 155 | }); |
| 156 | - return result; | |
| 156 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/6617c.json
Mflowdefault / TopLevel.js+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/67c03.json
Mflowdefault / TopLevel.js+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/68c30.json
Mflowdefault / TopLevel.js+2 −2
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 139 | 139 | return invalidValue(l(ref || "object"), val, key, parent); |
| 140 | 140 | } |
| 141 | - const result: any = {}; | |
| 141 | + const result: any = Object.create(null); | |
| 142 | 142 | Object.getOwnPropertyNames(props).forEach(key => { |
| 143 | 143 | const prop = props[key]; |
| 144 | 144 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 149 | 149 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 150 | 150 | } |
| 151 | 151 | }); |
| 152 | - return result; | |
| 152 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 139 | 139 | return invalidValue(l(ref || "object"), val, key, parent); |
| 140 | 140 | } |
| 141 | - const result: any = {}; | |
| 141 | + const result: any = Object.create(null); | |
| 142 | 142 | Object.getOwnPropertyNames(props).forEach(key => { |
| 143 | 143 | const prop = props[key]; |
| 144 | 144 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 149 | 149 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 150 | 150 | } |
| 151 | 151 | }); |
| 152 | - return result; | |
| 152 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/6c155.json
Mflowdefault / TopLevel.js+2 −2
| @@ -160,7 +160,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 160 | 160 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 161 | 161 | return invalidValue(l(ref || "object"), val, key, parent); |
| 162 | 162 | } |
| 163 | - const result: any = {}; | |
| 163 | + const result: any = Object.create(null); | |
| 164 | 164 | Object.getOwnPropertyNames(props).forEach(key => { |
| 165 | 165 | const prop = props[key]; |
| 166 | 166 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -171,7 +171,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 171 | 171 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 172 | 172 | } |
| 173 | 173 | }); |
| 174 | - return result; | |
| 174 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -160,7 +160,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 160 | 160 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 161 | 161 | return invalidValue(l(ref || "object"), val, key, parent); |
| 162 | 162 | } |
| 163 | - const result: any = {}; | |
| 163 | + const result: any = Object.create(null); | |
| 164 | 164 | Object.getOwnPropertyNames(props).forEach(key => { |
| 165 | 165 | const prop = props[key]; |
| 166 | 166 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -171,7 +171,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 171 | 171 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 172 | 172 | } |
| 173 | 173 | }); |
| 174 | - return result; | |
| 174 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/6de06.json
Mflowdefault / TopLevel.js+2 −2
| @@ -255,7 +255,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 255 | 255 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 256 | 256 | return invalidValue(l(ref || "object"), val, key, parent); |
| 257 | 257 | } |
| 258 | - const result: any = {}; | |
| 258 | + const result: any = Object.create(null); | |
| 259 | 259 | Object.getOwnPropertyNames(props).forEach(key => { |
| 260 | 260 | const prop = props[key]; |
| 261 | 261 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -266,7 +266,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 266 | 266 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 267 | 267 | } |
| 268 | 268 | }); |
| 269 | - return result; | |
| 269 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -250,7 +250,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 250 | 250 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 251 | 251 | return invalidValue(l(ref || "object"), val, key, parent); |
| 252 | 252 | } |
| 253 | - const result: any = {}; | |
| 253 | + const result: any = Object.create(null); | |
| 254 | 254 | Object.getOwnPropertyNames(props).forEach(key => { |
| 255 | 255 | const prop = props[key]; |
| 256 | 256 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -261,7 +261,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 261 | 261 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 262 | 262 | } |
| 263 | 263 | }); |
| 264 | - return result; | |
| 264 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/6dec6.json
Mflowdefault / TopLevel.js+2 −2
| @@ -210,7 +210,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 210 | 210 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 211 | 211 | return invalidValue(l(ref || "object"), val, key, parent); |
| 212 | 212 | } |
| 213 | - const result: any = {}; | |
| 213 | + const result: any = Object.create(null); | |
| 214 | 214 | Object.getOwnPropertyNames(props).forEach(key => { |
| 215 | 215 | const prop = props[key]; |
| 216 | 216 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -221,7 +221,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 221 | 221 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 222 | 222 | } |
| 223 | 223 | }); |
| 224 | - return result; | |
| 224 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -207,7 +207,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 207 | 207 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 208 | 208 | return invalidValue(l(ref || "object"), val, key, parent); |
| 209 | 209 | } |
| 210 | - const result: any = {}; | |
| 210 | + const result: any = Object.create(null); | |
| 211 | 211 | Object.getOwnPropertyNames(props).forEach(key => { |
| 212 | 212 | const prop = props[key]; |
| 213 | 213 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -218,7 +218,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 218 | 218 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 219 | 219 | } |
| 220 | 220 | }); |
| 221 | - return result; | |
| 221 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/6eb00.json
Mflowdefault / TopLevel.js+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/70c77.json
Melmdefault / QuickType.elm+9 −1
| @@ -51,11 +51,19 @@ encodeQuickType x = | ||
| 51 | 51 | Jenc.object |
| 52 | 52 | [ ("base", Jenc.string x.base) |
| 53 | 53 | , ("date", Jenc.string x.date) |
| 54 | - , ("rates", Jenc.dict identity Jenc.float x.rates) | |
| 54 | + , ("rates", makeDictEncoder identity Jenc.float x.rates) | |
| 55 | 55 | ] |
| 56 | 56 | |
| 57 | 57 | --- encoder helpers |
| 58 | 58 | |
| 59 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 60 | +makeDictEncoder f m r = | |
| 61 | + r | |
| 62 | + |> Dict.toList | |
| 63 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 64 | + |> String.join "," | |
| 65 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 66 | + | |
| 59 | 67 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 60 | 68 | makeNullableEncoder f m = |
| 61 | 69 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/734ad.json
Mflowdefault / TopLevel.js+2 −2
| @@ -181,7 +181,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 181 | 181 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 182 | 182 | return invalidValue(l(ref || "object"), val, key, parent); |
| 183 | 183 | } |
| 184 | - const result: any = {}; | |
| 184 | + const result: any = Object.create(null); | |
| 185 | 185 | Object.getOwnPropertyNames(props).forEach(key => { |
| 186 | 186 | const prop = props[key]; |
| 187 | 187 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -192,7 +192,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 192 | 192 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 193 | 193 | } |
| 194 | 194 | }); |
| 195 | - return result; | |
| 195 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -176,7 +176,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 176 | 176 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 177 | 177 | return invalidValue(l(ref || "object"), val, key, parent); |
| 178 | 178 | } |
| 179 | - const result: any = {}; | |
| 179 | + const result: any = Object.create(null); | |
| 180 | 180 | Object.getOwnPropertyNames(props).forEach(key => { |
| 181 | 181 | const prop = props[key]; |
| 182 | 182 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -187,7 +187,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 187 | 187 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 188 | 188 | } |
| 189 | 189 | }); |
| 190 | - return result; | |
| 190 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/75912.json
Melmdefault / QuickType.elm+9 −1
| @@ -51,11 +51,19 @@ encodeQuickType x = | ||
| 51 | 51 | Jenc.object |
| 52 | 52 | [ ("base", Jenc.string x.base) |
| 53 | 53 | , ("date", Jenc.string x.date) |
| 54 | - , ("rates", Jenc.dict identity Jenc.float x.rates) | |
| 54 | + , ("rates", makeDictEncoder identity Jenc.float x.rates) | |
| 55 | 55 | ] |
| 56 | 56 | |
| 57 | 57 | --- encoder helpers |
| 58 | 58 | |
| 59 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 60 | +makeDictEncoder f m r = | |
| 61 | + r | |
| 62 | + |> Dict.toList | |
| 63 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 64 | + |> String.join "," | |
| 65 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 66 | + | |
| 59 | 67 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 60 | 68 | makeNullableEncoder f m = |
| 61 | 69 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/7681c.json
Mflowdefault / TopLevel.js+2 −2
| @@ -223,7 +223,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 223 | 223 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 224 | 224 | return invalidValue(l(ref || "object"), val, key, parent); |
| 225 | 225 | } |
| 226 | - const result: any = {}; | |
| 226 | + const result: any = Object.create(null); | |
| 227 | 227 | Object.getOwnPropertyNames(props).forEach(key => { |
| 228 | 228 | const prop = props[key]; |
| 229 | 229 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -234,7 +234,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 234 | 234 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 235 | 235 | } |
| 236 | 236 | }); |
| 237 | - return result; | |
| 237 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -215,7 +215,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 215 | 215 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 216 | 216 | return invalidValue(l(ref || "object"), val, key, parent); |
| 217 | 217 | } |
| 218 | - const result: any = {}; | |
| 218 | + const result: any = Object.create(null); | |
| 219 | 219 | Object.getOwnPropertyNames(props).forEach(key => { |
| 220 | 220 | const prop = props[key]; |
| 221 | 221 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -226,7 +226,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 226 | 226 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 227 | 227 | } |
| 228 | 228 | }); |
| 229 | - return result; | |
| 229 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/76ae1.json
Melmdefault / QuickType.elm+9 −1
| @@ -316,7 +316,7 @@ article = | ||
| 316 | 316 | encodeArticle : Article -> Jenc.Value |
| 317 | 317 | encodeArticle x = |
| 318 | 318 | Jenc.object |
| 319 | - [ ("properties", Jenc.dict identity encodeProperty x.properties) | |
| 319 | + [ ("properties", makeDictEncoder identity encodeProperty x.properties) | |
| 320 | 320 | ] |
| 321 | 321 | |
| 322 | 322 | property : Jdec.Decoder Property |
| @@ -722,6 +722,14 @@ encodeSchemaType x = case x of | ||
| 722 | 722 | |
| 723 | 723 | --- encoder helpers |
| 724 | 724 | |
| 725 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 726 | +makeDictEncoder f m r = | |
| 727 | + r | |
| 728 | + |> Dict.toList | |
| 729 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 730 | + |> String.join "," | |
| 731 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 732 | + | |
| 725 | 733 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 726 | 734 | makeNullableEncoder f m = |
| 727 | 735 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -291,7 +291,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 291 | 291 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 292 | 292 | return invalidValue(l(ref || "object"), val, key, parent); |
| 293 | 293 | } |
| 294 | - const result: any = {}; | |
| 294 | + const result: any = Object.create(null); | |
| 295 | 295 | Object.getOwnPropertyNames(props).forEach(key => { |
| 296 | 296 | const prop = props[key]; |
| 297 | 297 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -302,7 +302,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 302 | 302 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 303 | 303 | } |
| 304 | 304 | }); |
| 305 | - return result; | |
| 305 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -288,7 +288,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 288 | 288 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 289 | 289 | return invalidValue(l(ref || "object"), val, key, parent); |
| 290 | 290 | } |
| 291 | - const result: any = {}; | |
| 291 | + const result: any = Object.create(null); | |
| 292 | 292 | Object.getOwnPropertyNames(props).forEach(key => { |
| 293 | 293 | const prop = props[key]; |
| 294 | 294 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -299,7 +299,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 299 | 299 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 300 | 300 | } |
| 301 | 301 | }); |
| 302 | - return result; | |
| 302 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/77392.json
Mflowdefault / TopLevel.js+2 −2
| @@ -134,7 +134,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 134 | 134 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 135 | 135 | return invalidValue(l(ref || "object"), val, key, parent); |
| 136 | 136 | } |
| 137 | - const result: any = {}; | |
| 137 | + const result: any = Object.create(null); | |
| 138 | 138 | Object.getOwnPropertyNames(props).forEach(key => { |
| 139 | 139 | const prop = props[key]; |
| 140 | 140 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 146 | 146 | } |
| 147 | 147 | }); |
| 148 | - return result; | |
| 148 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 123 | 123 | return invalidValue(l(ref || "object"), val, key, parent); |
| 124 | 124 | } |
| 125 | - const result: any = {}; | |
| 125 | + const result: any = Object.create(null); | |
| 126 | 126 | Object.getOwnPropertyNames(props).forEach(key => { |
| 127 | 127 | const prop = props[key]; |
| 128 | 128 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 134 | 134 | } |
| 135 | 135 | }); |
| 136 | - return result; | |
| 136 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/7d397.json
Melmdefault / QuickType.elm+9 −1
| @@ -170,7 +170,7 @@ listClass = | ||
| 170 | 170 | encodeListClass : ListClass -> Jenc.Value |
| 171 | 171 | encodeListClass x = |
| 172 | 172 | Jenc.object |
| 173 | - [ ("properties", Jenc.dict identity encodeProperty x.properties) | |
| 173 | + [ ("properties", makeDictEncoder identity encodeProperty x.properties) | |
| 174 | 174 | ] |
| 175 | 175 | |
| 176 | 176 | property : Jdec.Decoder Property |
| @@ -339,6 +339,14 @@ encodeItems x = | ||
| 339 | 339 | |
| 340 | 340 | --- encoder helpers |
| 341 | 341 | |
| 342 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 343 | +makeDictEncoder f m r = | |
| 344 | + r | |
| 345 | + |> Dict.toList | |
| 346 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 347 | + |> String.join "," | |
| 348 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 349 | + | |
| 342 | 350 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 343 | 351 | makeNullableEncoder f m = |
| 344 | 352 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -182,7 +182,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 182 | 182 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 183 | 183 | return invalidValue(l(ref || "object"), val, key, parent); |
| 184 | 184 | } |
| 185 | - const result: any = {}; | |
| 185 | + const result: any = Object.create(null); | |
| 186 | 186 | Object.getOwnPropertyNames(props).forEach(key => { |
| 187 | 187 | const prop = props[key]; |
| 188 | 188 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -193,7 +193,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 193 | 193 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 194 | 194 | } |
| 195 | 195 | }); |
| 196 | - return result; | |
| 196 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -180,7 +180,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 180 | 180 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 181 | 181 | return invalidValue(l(ref || "object"), val, key, parent); |
| 182 | 182 | } |
| 183 | - const result: any = {}; | |
| 183 | + const result: any = Object.create(null); | |
| 184 | 184 | Object.getOwnPropertyNames(props).forEach(key => { |
| 185 | 185 | const prop = props[key]; |
| 186 | 186 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -191,7 +191,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 191 | 191 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 192 | 192 | } |
| 193 | 193 | }); |
| 194 | - return result; | |
| 194 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/7d722.json
Mflowdefault / TopLevel.js+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/7df41.json
Mflowdefault / TopLevel.js+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/7dfa6.json
Mflowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/7eb30.json
Mflowdefault / TopLevel.js+2 −2
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 152 | 152 | return invalidValue(l(ref || "object"), val, key, parent); |
| 153 | 153 | } |
| 154 | - const result: any = {}; | |
| 154 | + const result: any = Object.create(null); | |
| 155 | 155 | Object.getOwnPropertyNames(props).forEach(key => { |
| 156 | 156 | const prop = props[key]; |
| 157 | 157 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -162,7 +162,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 162 | 162 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 163 | 163 | } |
| 164 | 164 | }); |
| 165 | - return result; | |
| 165 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 145 | 145 | return invalidValue(l(ref || "object"), val, key, parent); |
| 146 | 146 | } |
| 147 | - const result: any = {}; | |
| 147 | + const result: any = Object.create(null); | |
| 148 | 148 | Object.getOwnPropertyNames(props).forEach(key => { |
| 149 | 149 | const prop = props[key]; |
| 150 | 150 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -155,7 +155,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 155 | 155 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 156 | 156 | } |
| 157 | 157 | }); |
| 158 | - return result; | |
| 158 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/7f568.json
Melmdefault / QuickType.elm+9 −1
| @@ -103,7 +103,7 @@ encodeQuickTypeElement x = | ||
| 103 | 103 | , ("commits_url", Jenc.string x.commitsURL) |
| 104 | 104 | , ("created_at", Jenc.string x.createdAt) |
| 105 | 105 | , ("description", makeNullableEncoder Jenc.string x.description) |
| 106 | - , ("files", Jenc.dict identity encodeFile x.files) | |
| 106 | + , ("files", makeDictEncoder identity encodeFile x.files) | |
| 107 | 107 | , ("forks_url", Jenc.string x.forksURL) |
| 108 | 108 | , ("git_pull_url", Jenc.string x.gitPullURL) |
| 109 | 109 | , ("git_push_url", Jenc.string x.gitPushURL) |
| @@ -163,6 +163,14 @@ encodeLanguage x = case x of | ||
| 163 | 163 | |
| 164 | 164 | --- encoder helpers |
| 165 | 165 | |
| 166 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 167 | +makeDictEncoder f m r = | |
| 168 | + r | |
| 169 | + |> Dict.toList | |
| 170 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 171 | + |> String.join "," | |
| 172 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 173 | + | |
| 166 | 174 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 167 | 175 | makeNullableEncoder f m = |
| 168 | 176 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 139 | 139 | return invalidValue(l(ref || "object"), val, key, parent); |
| 140 | 140 | } |
| 141 | - const result: any = {}; | |
| 141 | + const result: any = Object.create(null); | |
| 142 | 142 | Object.getOwnPropertyNames(props).forEach(key => { |
| 143 | 143 | const prop = props[key]; |
| 144 | 144 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 149 | 149 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 150 | 150 | } |
| 151 | 151 | }); |
| 152 | - return result; | |
| 152 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 137 | 137 | return invalidValue(l(ref || "object"), val, key, parent); |
| 138 | 138 | } |
| 139 | - const result: any = {}; | |
| 139 | + const result: any = Object.create(null); | |
| 140 | 140 | Object.getOwnPropertyNames(props).forEach(key => { |
| 141 | 141 | const prop = props[key]; |
| 142 | 142 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 148 | 148 | } |
| 149 | 149 | }); |
| 150 | - return result; | |
| 150 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/7fbfb.json
Mflowdefault / TopLevel.js+2 −2
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 136 | 136 | return invalidValue(l(ref || "object"), val, key, parent); |
| 137 | 137 | } |
| 138 | - const result: any = {}; | |
| 138 | + const result: any = Object.create(null); | |
| 139 | 139 | Object.getOwnPropertyNames(props).forEach(key => { |
| 140 | 140 | const prop = props[key]; |
| 141 | 141 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 146 | 146 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 147 | 147 | } |
| 148 | 148 | }); |
| 149 | - return result; | |
| 149 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 131 | 131 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 132 | 132 | return invalidValue(l(ref || "object"), val, key, parent); |
| 133 | 133 | } |
| 134 | - const result: any = {}; | |
| 134 | + const result: any = Object.create(null); | |
| 135 | 135 | Object.getOwnPropertyNames(props).forEach(key => { |
| 136 | 136 | const prop = props[key]; |
| 137 | 137 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 143 | 143 | } |
| 144 | 144 | }); |
| 145 | - return result; | |
| 145 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/80aff.json
Mflowdefault / TopLevel.js+2 −2
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 127 | 127 | return invalidValue(l(ref || "object"), val, key, parent); |
| 128 | 128 | } |
| 129 | - const result: any = {}; | |
| 129 | + const result: any = Object.create(null); | |
| 130 | 130 | Object.getOwnPropertyNames(props).forEach(key => { |
| 131 | 131 | const prop = props[key]; |
| 132 | 132 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 138 | 138 | } |
| 139 | 139 | }); |
| 140 | - return result; | |
| 140 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 124 | 124 | return invalidValue(l(ref || "object"), val, key, parent); |
| 125 | 125 | } |
| 126 | - const result: any = {}; | |
| 126 | + const result: any = Object.create(null); | |
| 127 | 127 | Object.getOwnPropertyNames(props).forEach(key => { |
| 128 | 128 | const prop = props[key]; |
| 129 | 129 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -134,7 +134,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 134 | 134 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 135 | 135 | } |
| 136 | 136 | }); |
| 137 | - return result; | |
| 137 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/82509.json
Mflowdefault / TopLevel.js+2 −2
| @@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 107 | 107 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 108 | 108 | return invalidValue(l(ref || "object"), val, key, parent); |
| 109 | 109 | } |
| 110 | - const result: any = {}; | |
| 110 | + const result: any = Object.create(null); | |
| 111 | 111 | Object.getOwnPropertyNames(props).forEach(key => { |
| 112 | 112 | const prop = props[key]; |
| 113 | 113 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 118 | 118 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 119 | 119 | } |
| 120 | 120 | }); |
| 121 | - return result; | |
| 121 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 107 | 107 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 108 | 108 | return invalidValue(l(ref || "object"), val, key, parent); |
| 109 | 109 | } |
| 110 | - const result: any = {}; | |
| 110 | + const result: any = Object.create(null); | |
| 111 | 111 | Object.getOwnPropertyNames(props).forEach(key => { |
| 112 | 112 | const prop = props[key]; |
| 113 | 113 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 118 | 118 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 119 | 119 | } |
| 120 | 120 | }); |
| 121 | - return result; | |
| 121 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/8592b.json
Mflowdefault / TopLevel.js+2 −2
| @@ -230,7 +230,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 230 | 230 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 231 | 231 | return invalidValue(l(ref || "object"), val, key, parent); |
| 232 | 232 | } |
| 233 | - const result: any = {}; | |
| 233 | + const result: any = Object.create(null); | |
| 234 | 234 | Object.getOwnPropertyNames(props).forEach(key => { |
| 235 | 235 | const prop = props[key]; |
| 236 | 236 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -241,7 +241,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 241 | 241 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 242 | 242 | } |
| 243 | 243 | }); |
| 244 | - return result; | |
| 244 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -219,7 +219,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 219 | 219 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 220 | 220 | return invalidValue(l(ref || "object"), val, key, parent); |
| 221 | 221 | } |
| 222 | - const result: any = {}; | |
| 222 | + const result: any = Object.create(null); | |
| 223 | 223 | Object.getOwnPropertyNames(props).forEach(key => { |
| 224 | 224 | const prop = props[key]; |
| 225 | 225 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -230,7 +230,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 230 | 230 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 231 | 231 | } |
| 232 | 232 | }); |
| 233 | - return result; | |
| 233 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/88130.json
Mflowdefault / TopLevel.js+2 −2
| @@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 205 | 205 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 206 | 206 | return invalidValue(l(ref || "object"), val, key, parent); |
| 207 | 207 | } |
| 208 | - const result: any = {}; | |
| 208 | + const result: any = Object.create(null); | |
| 209 | 209 | Object.getOwnPropertyNames(props).forEach(key => { |
| 210 | 210 | const prop = props[key]; |
| 211 | 211 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 216 | 216 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 217 | 217 | } |
| 218 | 218 | }); |
| 219 | - return result; | |
| 219 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 205 | 205 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 206 | 206 | return invalidValue(l(ref || "object"), val, key, parent); |
| 207 | 207 | } |
| 208 | - const result: any = {}; | |
| 208 | + const result: any = Object.create(null); | |
| 209 | 209 | Object.getOwnPropertyNames(props).forEach(key => { |
| 210 | 210 | const prop = props[key]; |
| 211 | 211 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 216 | 216 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 217 | 217 | } |
| 218 | 218 | }); |
| 219 | - return result; | |
| 219 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/8a62c.json
Mflowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/908db.json
Mflowdefault / TopLevel.js+2 −2
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 117 | 117 | return invalidValue(l(ref || "object"), val, key, parent); |
| 118 | 118 | } |
| 119 | - const result: any = {}; | |
| 119 | + const result: any = Object.create(null); | |
| 120 | 120 | Object.getOwnPropertyNames(props).forEach(key => { |
| 121 | 121 | const prop = props[key]; |
| 122 | 122 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - return result; | |
| 130 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 117 | 117 | return invalidValue(l(ref || "object"), val, key, parent); |
| 118 | 118 | } |
| 119 | - const result: any = {}; | |
| 119 | + const result: any = Object.create(null); | |
| 120 | 120 | Object.getOwnPropertyNames(props).forEach(key => { |
| 121 | 121 | const prop = props[key]; |
| 122 | 122 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - return result; | |
| 130 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/9617f.json
Melmdefault / QuickType.elm+9 −1
| @@ -51,11 +51,19 @@ encodeQuickType x = | ||
| 51 | 51 | Jenc.object |
| 52 | 52 | [ ("base", Jenc.string x.base) |
| 53 | 53 | , ("date", Jenc.string x.date) |
| 54 | - , ("rates", Jenc.dict identity Jenc.float x.rates) | |
| 54 | + , ("rates", makeDictEncoder identity Jenc.float x.rates) | |
| 55 | 55 | ] |
| 56 | 56 | |
| 57 | 57 | --- encoder helpers |
| 58 | 58 | |
| 59 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 60 | +makeDictEncoder f m r = | |
| 61 | + r | |
| 62 | + |> Dict.toList | |
| 63 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 64 | + |> String.join "," | |
| 65 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 66 | + | |
| 59 | 67 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 60 | 68 | makeNullableEncoder f m = |
| 61 | 69 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/96f7c.json
Mflowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/9847b.json
Mflowdefault / TopLevel.js+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/9929c.json
Mflowdefault / TopLevel.js+2 −2
| @@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 205 | 205 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 206 | 206 | return invalidValue(l(ref || "object"), val, key, parent); |
| 207 | 207 | } |
| 208 | - const result: any = {}; | |
| 208 | + const result: any = Object.create(null); | |
| 209 | 209 | Object.getOwnPropertyNames(props).forEach(key => { |
| 210 | 210 | const prop = props[key]; |
| 211 | 211 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 216 | 216 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 217 | 217 | } |
| 218 | 218 | }); |
| 219 | - return result; | |
| 219 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 205 | 205 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 206 | 206 | return invalidValue(l(ref || "object"), val, key, parent); |
| 207 | 207 | } |
| 208 | - const result: any = {}; | |
| 208 | + const result: any = Object.create(null); | |
| 209 | 209 | Object.getOwnPropertyNames(props).forEach(key => { |
| 210 | 210 | const prop = props[key]; |
| 211 | 211 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 216 | 216 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 217 | 217 | } |
| 218 | 218 | }); |
| 219 | - return result; | |
| 219 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/996bd.json
Mflowdefault / TopLevel.js+2 −2
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 152 | 152 | return invalidValue(l(ref || "object"), val, key, parent); |
| 153 | 153 | } |
| 154 | - const result: any = {}; | |
| 154 | + const result: any = Object.create(null); | |
| 155 | 155 | Object.getOwnPropertyNames(props).forEach(key => { |
| 156 | 156 | const prop = props[key]; |
| 157 | 157 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -162,7 +162,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 162 | 162 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 163 | 163 | } |
| 164 | 164 | }); |
| 165 | - return result; | |
| 165 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/9a503.json
Mflowdefault / TopLevel.js+2 −2
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 138 | 138 | return invalidValue(l(ref || "object"), val, key, parent); |
| 139 | 139 | } |
| 140 | - const result: any = {}; | |
| 140 | + const result: any = Object.create(null); | |
| 141 | 141 | Object.getOwnPropertyNames(props).forEach(key => { |
| 142 | 142 | const prop = props[key]; |
| 143 | 143 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -148,7 +148,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 148 | 148 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 149 | 149 | } |
| 150 | 150 | }); |
| 151 | - return result; | |
| 151 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -134,7 +134,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 134 | 134 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 135 | 135 | return invalidValue(l(ref || "object"), val, key, parent); |
| 136 | 136 | } |
| 137 | - const result: any = {}; | |
| 137 | + const result: any = Object.create(null); | |
| 138 | 138 | Object.getOwnPropertyNames(props).forEach(key => { |
| 139 | 139 | const prop = props[key]; |
| 140 | 140 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 146 | 146 | } |
| 147 | 147 | }); |
| 148 | - return result; | |
| 148 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/9ac3b.json
Mflowdefault / TopLevel.js+2 −2
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 139 | 139 | return invalidValue(l(ref || "object"), val, key, parent); |
| 140 | 140 | } |
| 141 | - const result: any = {}; | |
| 141 | + const result: any = Object.create(null); | |
| 142 | 142 | Object.getOwnPropertyNames(props).forEach(key => { |
| 143 | 143 | const prop = props[key]; |
| 144 | 144 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 149 | 149 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 150 | 150 | } |
| 151 | 151 | }); |
| 152 | - return result; | |
| 152 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 131 | 131 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 132 | 132 | return invalidValue(l(ref || "object"), val, key, parent); |
| 133 | 133 | } |
| 134 | - const result: any = {}; | |
| 134 | + const result: any = Object.create(null); | |
| 135 | 135 | Object.getOwnPropertyNames(props).forEach(key => { |
| 136 | 136 | const prop = props[key]; |
| 137 | 137 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 143 | 143 | } |
| 144 | 144 | }); |
| 145 | - return result; | |
| 145 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/9eed5.json
Mflowdefault / TopLevel.js+2 −2
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 137 | 137 | return invalidValue(l(ref || "object"), val, key, parent); |
| 138 | 138 | } |
| 139 | - const result: any = {}; | |
| 139 | + const result: any = Object.create(null); | |
| 140 | 140 | Object.getOwnPropertyNames(props).forEach(key => { |
| 141 | 141 | const prop = props[key]; |
| 142 | 142 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 148 | 148 | } |
| 149 | 149 | }); |
| 150 | - return result; | |
| 150 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -134,7 +134,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 134 | 134 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 135 | 135 | return invalidValue(l(ref || "object"), val, key, parent); |
| 136 | 136 | } |
| 137 | - const result: any = {}; | |
| 137 | + const result: any = Object.create(null); | |
| 138 | 138 | Object.getOwnPropertyNames(props).forEach(key => { |
| 139 | 139 | const prop = props[key]; |
| 140 | 140 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 146 | 146 | } |
| 147 | 147 | }); |
| 148 | - return result; | |
| 148 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/a0496.json
Mflowdefault / TopLevel.js+2 −2
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 129 | 129 | return invalidValue(l(ref || "object"), val, key, parent); |
| 130 | 130 | } |
| 131 | - const result: any = {}; | |
| 131 | + const result: any = Object.create(null); | |
| 132 | 132 | Object.getOwnPropertyNames(props).forEach(key => { |
| 133 | 133 | const prop = props[key]; |
| 134 | 134 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 140 | 140 | } |
| 141 | 141 | }); |
| 142 | - return result; | |
| 142 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 126 | 126 | return invalidValue(l(ref || "object"), val, key, parent); |
| 127 | 127 | } |
| 128 | - const result: any = {}; | |
| 128 | + const result: any = Object.create(null); | |
| 129 | 129 | Object.getOwnPropertyNames(props).forEach(key => { |
| 130 | 130 | const prop = props[key]; |
| 131 | 131 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 137 | 137 | } |
| 138 | 138 | }); |
| 139 | - return result; | |
| 139 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/a1eca.json
Mflowdefault / TopLevel.js+2 −2
| @@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 205 | 205 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 206 | 206 | return invalidValue(l(ref || "object"), val, key, parent); |
| 207 | 207 | } |
| 208 | - const result: any = {}; | |
| 208 | + const result: any = Object.create(null); | |
| 209 | 209 | Object.getOwnPropertyNames(props).forEach(key => { |
| 210 | 210 | const prop = props[key]; |
| 211 | 211 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 216 | 216 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 217 | 217 | } |
| 218 | 218 | }); |
| 219 | - return result; | |
| 219 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 205 | 205 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 206 | 206 | return invalidValue(l(ref || "object"), val, key, parent); |
| 207 | 207 | } |
| 208 | - const result: any = {}; | |
| 208 | + const result: any = Object.create(null); | |
| 209 | 209 | Object.getOwnPropertyNames(props).forEach(key => { |
| 210 | 210 | const prop = props[key]; |
| 211 | 211 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 216 | 216 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 217 | 217 | } |
| 218 | 218 | }); |
| 219 | - return result; | |
| 219 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/a3d8c.json
Mflowdefault / TopLevel.js+2 −2
| @@ -223,7 +223,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 223 | 223 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 224 | 224 | return invalidValue(l(ref || "object"), val, key, parent); |
| 225 | 225 | } |
| 226 | - const result: any = {}; | |
| 226 | + const result: any = Object.create(null); | |
| 227 | 227 | Object.getOwnPropertyNames(props).forEach(key => { |
| 228 | 228 | const prop = props[key]; |
| 229 | 229 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -234,7 +234,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 234 | 234 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 235 | 235 | } |
| 236 | 236 | }); |
| 237 | - return result; | |
| 237 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -217,7 +217,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 217 | 217 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 218 | 218 | return invalidValue(l(ref || "object"), val, key, parent); |
| 219 | 219 | } |
| 220 | - const result: any = {}; | |
| 220 | + const result: any = Object.create(null); | |
| 221 | 221 | Object.getOwnPropertyNames(props).forEach(key => { |
| 222 | 222 | const prop = props[key]; |
| 223 | 223 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -228,7 +228,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 228 | 228 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 229 | 229 | } |
| 230 | 230 | }); |
| 231 | - return result; | |
| 231 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/a45b0.json
Mflowdefault / TopLevel.js+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 117 | 117 | return invalidValue(l(ref || "object"), val, key, parent); |
| 118 | 118 | } |
| 119 | - const result: any = {}; | |
| 119 | + const result: any = Object.create(null); | |
| 120 | 120 | Object.getOwnPropertyNames(props).forEach(key => { |
| 121 | 121 | const prop = props[key]; |
| 122 | 122 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - return result; | |
| 130 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/a71df.json
Mflowdefault / TopLevel.js+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/a9691.json
Melmdefault / QuickType.elm+9 −1
| @@ -51,11 +51,19 @@ encodeQuickType x = | ||
| 51 | 51 | Jenc.object |
| 52 | 52 | [ ("base", Jenc.string x.base) |
| 53 | 53 | , ("date", Jenc.string x.date) |
| 54 | - , ("rates", Jenc.dict identity Jenc.float x.rates) | |
| 54 | + , ("rates", makeDictEncoder identity Jenc.float x.rates) | |
| 55 | 55 | ] |
| 56 | 56 | |
| 57 | 57 | --- encoder helpers |
| 58 | 58 | |
| 59 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 60 | +makeDictEncoder f m r = | |
| 61 | + r | |
| 62 | + |> Dict.toList | |
| 63 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 64 | + |> String.join "," | |
| 65 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 66 | + | |
| 59 | 67 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 60 | 68 | makeNullableEncoder f m = |
| 61 | 69 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/ab0d1.json
Mflowdefault / TopLevel.js+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 117 | 117 | return invalidValue(l(ref || "object"), val, key, parent); |
| 118 | 118 | } |
| 119 | - const result: any = {}; | |
| 119 | + const result: any = Object.create(null); | |
| 120 | 120 | Object.getOwnPropertyNames(props).forEach(key => { |
| 121 | 121 | const prop = props[key]; |
| 122 | 122 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - return result; | |
| 130 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/abb4b.json
Mflowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/ac944.json
Melmdefault / QuickType.elm+9 −1
| @@ -51,11 +51,19 @@ encodeQuickType x = | ||
| 51 | 51 | Jenc.object |
| 52 | 52 | [ ("base", Jenc.string x.base) |
| 53 | 53 | , ("date", Jenc.string x.date) |
| 54 | - , ("rates", Jenc.dict identity Jenc.float x.rates) | |
| 54 | + , ("rates", makeDictEncoder identity Jenc.float x.rates) | |
| 55 | 55 | ] |
| 56 | 56 | |
| 57 | 57 | --- encoder helpers |
| 58 | 58 | |
| 59 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 60 | +makeDictEncoder f m r = | |
| 61 | + r | |
| 62 | + |> Dict.toList | |
| 63 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 64 | + |> String.join "," | |
| 65 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 66 | + | |
| 59 | 67 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 60 | 68 | makeNullableEncoder f m = |
| 61 | 69 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/ad8be.json
Mflowdefault / TopLevel.js+2 −2
| @@ -174,7 +174,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 174 | 174 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 175 | 175 | return invalidValue(l(ref || "object"), val, key, parent); |
| 176 | 176 | } |
| 177 | - const result: any = {}; | |
| 177 | + const result: any = Object.create(null); | |
| 178 | 178 | Object.getOwnPropertyNames(props).forEach(key => { |
| 179 | 179 | const prop = props[key]; |
| 180 | 180 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -185,7 +185,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 185 | 185 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 186 | 186 | } |
| 187 | 187 | }); |
| 188 | - return result; | |
| 188 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 148 | 148 | return invalidValue(l(ref || "object"), val, key, parent); |
| 149 | 149 | } |
| 150 | - const result: any = {}; | |
| 150 | + const result: any = Object.create(null); | |
| 151 | 151 | Object.getOwnPropertyNames(props).forEach(key => { |
| 152 | 152 | const prop = props[key]; |
| 153 | 153 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 158 | 158 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 159 | 159 | } |
| 160 | 160 | }); |
| 161 | - return result; | |
| 161 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/ae7f0.json
Mflowdefault / TopLevel.js+2 −2
| @@ -204,7 +204,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 204 | 204 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 205 | 205 | return invalidValue(l(ref || "object"), val, key, parent); |
| 206 | 206 | } |
| 207 | - const result: any = {}; | |
| 207 | + const result: any = Object.create(null); | |
| 208 | 208 | Object.getOwnPropertyNames(props).forEach(key => { |
| 209 | 209 | const prop = props[key]; |
| 210 | 210 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -215,7 +215,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 215 | 215 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 216 | 216 | } |
| 217 | 217 | }); |
| 218 | - return result; | |
| 218 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -195,7 +195,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 195 | 195 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 196 | 196 | return invalidValue(l(ref || "object"), val, key, parent); |
| 197 | 197 | } |
| 198 | - const result: any = {}; | |
| 198 | + const result: any = Object.create(null); | |
| 199 | 199 | Object.getOwnPropertyNames(props).forEach(key => { |
| 200 | 200 | const prop = props[key]; |
| 201 | 201 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -206,7 +206,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 206 | 206 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 207 | 207 | } |
| 208 | 208 | }); |
| 209 | - return result; | |
| 209 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/ae9ca.json
Mflowdefault / TopLevel.js+2 −2
| @@ -153,7 +153,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 153 | 153 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 154 | 154 | return invalidValue(l(ref || "object"), val, key, parent); |
| 155 | 155 | } |
| 156 | - const result: any = {}; | |
| 156 | + const result: any = Object.create(null); | |
| 157 | 157 | Object.getOwnPropertyNames(props).forEach(key => { |
| 158 | 158 | const prop = props[key]; |
| 159 | 159 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -164,7 +164,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 164 | 164 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 165 | 165 | } |
| 166 | 166 | }); |
| 167 | - return result; | |
| 167 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 144 | 144 | return invalidValue(l(ref || "object"), val, key, parent); |
| 145 | 145 | } |
| 146 | - const result: any = {}; | |
| 146 | + const result: any = Object.create(null); | |
| 147 | 147 | Object.getOwnPropertyNames(props).forEach(key => { |
| 148 | 148 | const prop = props[key]; |
| 149 | 149 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -154,7 +154,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 154 | 154 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 155 | 155 | } |
| 156 | 156 | }); |
| 157 | - return result; | |
| 157 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/af2d1.json
Mflowdefault / TopLevel.js+2 −2
| @@ -215,7 +215,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 215 | 215 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 216 | 216 | return invalidValue(l(ref || "object"), val, key, parent); |
| 217 | 217 | } |
| 218 | - const result: any = {}; | |
| 218 | + const result: any = Object.create(null); | |
| 219 | 219 | Object.getOwnPropertyNames(props).forEach(key => { |
| 220 | 220 | const prop = props[key]; |
| 221 | 221 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -226,7 +226,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 226 | 226 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 227 | 227 | } |
| 228 | 228 | }); |
| 229 | - return result; | |
| 229 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -193,7 +193,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 193 | 193 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 194 | 194 | return invalidValue(l(ref || "object"), val, key, parent); |
| 195 | 195 | } |
| 196 | - const result: any = {}; | |
| 196 | + const result: any = Object.create(null); | |
| 197 | 197 | Object.getOwnPropertyNames(props).forEach(key => { |
| 198 | 198 | const prop = props[key]; |
| 199 | 199 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -204,7 +204,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 204 | 204 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 205 | 205 | } |
| 206 | 206 | }); |
| 207 | - return result; | |
| 207 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/b4865.json
Mflowdefault / TopLevel.js+2 −2
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 136 | 136 | return invalidValue(l(ref || "object"), val, key, parent); |
| 137 | 137 | } |
| 138 | - const result: any = {}; | |
| 138 | + const result: any = Object.create(null); | |
| 139 | 139 | Object.getOwnPropertyNames(props).forEach(key => { |
| 140 | 140 | const prop = props[key]; |
| 141 | 141 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 146 | 146 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 147 | 147 | } |
| 148 | 148 | }); |
| 149 | - return result; | |
| 149 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 131 | 131 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 132 | 132 | return invalidValue(l(ref || "object"), val, key, parent); |
| 133 | 133 | } |
| 134 | - const result: any = {}; | |
| 134 | + const result: any = Object.create(null); | |
| 135 | 135 | Object.getOwnPropertyNames(props).forEach(key => { |
| 136 | 136 | const prop = props[key]; |
| 137 | 137 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 143 | 143 | } |
| 144 | 144 | }); |
| 145 | - return result; | |
| 145 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/b6f2c.json
Mflowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/b6fe5.json
Mflowdefault / TopLevel.js+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/b9f64.json
Mflowdefault / TopLevel.js+2 −2
| @@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 107 | 107 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 108 | 108 | return invalidValue(l(ref || "object"), val, key, parent); |
| 109 | 109 | } |
| 110 | - const result: any = {}; | |
| 110 | + const result: any = Object.create(null); | |
| 111 | 111 | Object.getOwnPropertyNames(props).forEach(key => { |
| 112 | 112 | const prop = props[key]; |
| 113 | 113 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 118 | 118 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 119 | 119 | } |
| 120 | 120 | }); |
| 121 | - return result; | |
| 121 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 107 | 107 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 108 | 108 | return invalidValue(l(ref || "object"), val, key, parent); |
| 109 | 109 | } |
| 110 | - const result: any = {}; | |
| 110 | + const result: any = Object.create(null); | |
| 111 | 111 | Object.getOwnPropertyNames(props).forEach(key => { |
| 112 | 112 | const prop = props[key]; |
| 113 | 113 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 118 | 118 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 119 | 119 | } |
| 120 | 120 | }); |
| 121 | - return result; | |
| 121 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/bb1ec.json
Mflowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/be234.json
Mflowdefault / TopLevel.js+2 −2
| @@ -269,7 +269,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 269 | 269 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 270 | 270 | return invalidValue(l(ref || "object"), val, key, parent); |
| 271 | 271 | } |
| 272 | - const result: any = {}; | |
| 272 | + const result: any = Object.create(null); | |
| 273 | 273 | Object.getOwnPropertyNames(props).forEach(key => { |
| 274 | 274 | const prop = props[key]; |
| 275 | 275 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -280,7 +280,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 280 | 280 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 281 | 281 | } |
| 282 | 282 | }); |
| 283 | - return result; | |
| 283 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -256,7 +256,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 256 | 256 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 257 | 257 | return invalidValue(l(ref || "object"), val, key, parent); |
| 258 | 258 | } |
| 259 | - const result: any = {}; | |
| 259 | + const result: any = Object.create(null); | |
| 260 | 260 | Object.getOwnPropertyNames(props).forEach(key => { |
| 261 | 261 | const prop = props[key]; |
| 262 | 262 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -267,7 +267,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 267 | 267 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 268 | 268 | } |
| 269 | 269 | }); |
| 270 | - return result; | |
| 270 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/c0356.json
Melmdefault / QuickType.elm+9 −1
| @@ -60,7 +60,7 @@ quickType = | ||
| 60 | 60 | encodeQuickType : QuickType -> Jenc.Value |
| 61 | 61 | encodeQuickType x = |
| 62 | 62 | Jenc.object |
| 63 | - [ ("data", Jenc.dict identity encodeDatum x.data) | |
| 63 | + [ ("data", makeDictEncoder identity encodeDatum x.data) | |
| 64 | 64 | , ("description", encodeDescription x.description) |
| 65 | 65 | ] |
| 66 | 66 | |
| @@ -94,6 +94,14 @@ encodeDescription x = | ||
| 94 | 94 | |
| 95 | 95 | --- encoder helpers |
| 96 | 96 | |
| 97 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 98 | +makeDictEncoder f m r = | |
| 99 | + r | |
| 100 | + |> Dict.toList | |
| 101 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 102 | + |> String.join "," | |
| 103 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 104 | + | |
| 97 | 105 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 98 | 106 | makeNullableEncoder f m = |
| 99 | 107 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 120 | 120 | return invalidValue(l(ref || "object"), val, key, parent); |
| 121 | 121 | } |
| 122 | - const result: any = {}; | |
| 122 | + const result: any = Object.create(null); | |
| 123 | 123 | Object.getOwnPropertyNames(props).forEach(key => { |
| 124 | 124 | const prop = props[key]; |
| 125 | 125 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 130 | 130 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 131 | 131 | } |
| 132 | 132 | }); |
| 133 | - return result; | |
| 133 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 120 | 120 | return invalidValue(l(ref || "object"), val, key, parent); |
| 121 | 121 | } |
| 122 | - const result: any = {}; | |
| 122 | + const result: any = Object.create(null); | |
| 123 | 123 | Object.getOwnPropertyNames(props).forEach(key => { |
| 124 | 124 | const prop = props[key]; |
| 125 | 125 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 130 | 130 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 131 | 131 | } |
| 132 | 132 | }); |
| 133 | - return result; | |
| 133 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/c0a3a.json
Mflowdefault / TopLevel.js+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/c3303.json
Mflowdefault / TopLevel.js+2 −2
| @@ -220,7 +220,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 220 | 220 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 221 | 221 | return invalidValue(l(ref || "object"), val, key, parent); |
| 222 | 222 | } |
| 223 | - const result: any = {}; | |
| 223 | + const result: any = Object.create(null); | |
| 224 | 224 | Object.getOwnPropertyNames(props).forEach(key => { |
| 225 | 225 | const prop = props[key]; |
| 226 | 226 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -231,7 +231,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 231 | 231 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 232 | 232 | } |
| 233 | 233 | }); |
| 234 | - return result; | |
| 234 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -214,7 +214,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 214 | 214 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 215 | 215 | return invalidValue(l(ref || "object"), val, key, parent); |
| 216 | 216 | } |
| 217 | - const result: any = {}; | |
| 217 | + const result: any = Object.create(null); | |
| 218 | 218 | Object.getOwnPropertyNames(props).forEach(key => { |
| 219 | 219 | const prop = props[key]; |
| 220 | 220 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -225,7 +225,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 225 | 225 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 226 | 226 | } |
| 227 | 227 | }); |
| 228 | - return result; | |
| 228 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/c6cfd.json
Mflowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/c8c7e.json
Mflowdefault / TopLevel.js+2 −2
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 136 | 136 | return invalidValue(l(ref || "object"), val, key, parent); |
| 137 | 137 | } |
| 138 | - const result: any = {}; | |
| 138 | + const result: any = Object.create(null); | |
| 139 | 139 | Object.getOwnPropertyNames(props).forEach(key => { |
| 140 | 140 | const prop = props[key]; |
| 141 | 141 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 146 | 146 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 147 | 147 | } |
| 148 | 148 | }); |
| 149 | - return result; | |
| 149 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 131 | 131 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 132 | 132 | return invalidValue(l(ref || "object"), val, key, parent); |
| 133 | 133 | } |
| 134 | - const result: any = {}; | |
| 134 | + const result: any = Object.create(null); | |
| 135 | 135 | Object.getOwnPropertyNames(props).forEach(key => { |
| 136 | 136 | const prop = props[key]; |
| 137 | 137 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 143 | 143 | } |
| 144 | 144 | }); |
| 145 | - return result; | |
| 145 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/cb0cc.json
Mflowdefault / TopLevel.js+2 −2
| @@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 130 | 130 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 131 | 131 | return invalidValue(l(ref || "object"), val, key, parent); |
| 132 | 132 | } |
| 133 | - const result: any = {}; | |
| 133 | + const result: any = Object.create(null); | |
| 134 | 134 | Object.getOwnPropertyNames(props).forEach(key => { |
| 135 | 135 | const prop = props[key]; |
| 136 | 136 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 142 | 142 | } |
| 143 | 143 | }); |
| 144 | - return result; | |
| 144 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 125 | 125 | return invalidValue(l(ref || "object"), val, key, parent); |
| 126 | 126 | } |
| 127 | - const result: any = {}; | |
| 127 | + const result: any = Object.create(null); | |
| 128 | 128 | Object.getOwnPropertyNames(props).forEach(key => { |
| 129 | 129 | const prop = props[key]; |
| 130 | 130 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 136 | 136 | } |
| 137 | 137 | }); |
| 138 | - return result; | |
| 138 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/cb81e.json
Melmdefault / QuickType.elm+9 −1
| @@ -55,7 +55,7 @@ quickType = | ||
| 55 | 55 | encodeQuickType : QuickType -> Jenc.Value |
| 56 | 56 | encodeQuickType x = |
| 57 | 57 | Jenc.object |
| 58 | - [ ("data", Jenc.dict identity Jenc.string x.data) | |
| 58 | + [ ("data", makeDictEncoder identity Jenc.string x.data) | |
| 59 | 59 | , ("description", encodeDescription x.description) |
| 60 | 60 | ] |
| 61 | 61 | |
| @@ -78,6 +78,14 @@ encodeDescription x = | ||
| 78 | 78 | |
| 79 | 79 | --- encoder helpers |
| 80 | 80 | |
| 81 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 82 | +makeDictEncoder f m r = | |
| 83 | + r | |
| 84 | + |> Dict.toList | |
| 85 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 86 | + |> String.join "," | |
| 87 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 88 | + | |
| 81 | 89 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 82 | 90 | makeNullableEncoder f m = |
| 83 | 91 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/ccd18.json
Mflowdefault / TopLevel.js+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/cd238.json
Mflowdefault / TopLevel.js+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 141 | 141 | return invalidValue(l(ref || "object"), val, key, parent); |
| 142 | 142 | } |
| 143 | - const result: any = {}; | |
| 143 | + const result: any = Object.create(null); | |
| 144 | 144 | Object.getOwnPropertyNames(props).forEach(key => { |
| 145 | 145 | const prop = props[key]; |
| 146 | 146 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | - return result; | |
| 154 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/cd463.json
Melmdefault / QuickType.elm+9 −1
| @@ -51,11 +51,19 @@ encodeQuickType x = | ||
| 51 | 51 | Jenc.object |
| 52 | 52 | [ ("base", Jenc.string x.base) |
| 53 | 53 | , ("date", Jenc.string x.date) |
| 54 | - , ("rates", Jenc.dict identity Jenc.float x.rates) | |
| 54 | + , ("rates", makeDictEncoder identity Jenc.float x.rates) | |
| 55 | 55 | ] |
| 56 | 56 | |
| 57 | 57 | --- encoder helpers |
| 58 | 58 | |
| 59 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 60 | +makeDictEncoder f m r = | |
| 61 | + r | |
| 62 | + |> Dict.toList | |
| 63 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 64 | + |> String.join "," | |
| 65 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 66 | + | |
| 59 | 67 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 60 | 68 | makeNullableEncoder f m = |
| 61 | 69 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/cda6c.json
Mflowdefault / TopLevel.js+2 −2
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 136 | 136 | return invalidValue(l(ref || "object"), val, key, parent); |
| 137 | 137 | } |
| 138 | - const result: any = {}; | |
| 138 | + const result: any = Object.create(null); | |
| 139 | 139 | Object.getOwnPropertyNames(props).forEach(key => { |
| 140 | 140 | const prop = props[key]; |
| 141 | 141 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 146 | 146 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 147 | 147 | } |
| 148 | 148 | }); |
| 149 | - return result; | |
| 149 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 131 | 131 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 132 | 132 | return invalidValue(l(ref || "object"), val, key, parent); |
| 133 | 133 | } |
| 134 | - const result: any = {}; | |
| 134 | + const result: any = Object.create(null); | |
| 135 | 135 | Object.getOwnPropertyNames(props).forEach(key => { |
| 136 | 136 | const prop = props[key]; |
| 137 | 137 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 143 | 143 | } |
| 144 | 144 | }); |
| 145 | - return result; | |
| 145 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/cf0d8.json
Mflowdefault / TopLevel.js+2 −2
| @@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 205 | 205 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 206 | 206 | return invalidValue(l(ref || "object"), val, key, parent); |
| 207 | 207 | } |
| 208 | - const result: any = {}; | |
| 208 | + const result: any = Object.create(null); | |
| 209 | 209 | Object.getOwnPropertyNames(props).forEach(key => { |
| 210 | 210 | const prop = props[key]; |
| 211 | 211 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 216 | 216 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 217 | 217 | } |
| 218 | 218 | }); |
| 219 | - return result; | |
| 219 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 205 | 205 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 206 | 206 | return invalidValue(l(ref || "object"), val, key, parent); |
| 207 | 207 | } |
| 208 | - const result: any = {}; | |
| 208 | + const result: any = Object.create(null); | |
| 209 | 209 | Object.getOwnPropertyNames(props).forEach(key => { |
| 210 | 210 | const prop = props[key]; |
| 211 | 211 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 216 | 216 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 217 | 217 | } |
| 218 | 218 | }); |
| 219 | - return result; | |
| 219 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/cfbce.json
Melmdefault / QuickType.elm+9 −1
| @@ -51,11 +51,19 @@ encodeQuickType x = | ||
| 51 | 51 | Jenc.object |
| 52 | 52 | [ ("base", Jenc.string x.base) |
| 53 | 53 | , ("date", Jenc.string x.date) |
| 54 | - , ("rates", Jenc.dict identity Jenc.float x.rates) | |
| 54 | + , ("rates", makeDictEncoder identity Jenc.float x.rates) | |
| 55 | 55 | ] |
| 56 | 56 | |
| 57 | 57 | --- encoder helpers |
| 58 | 58 | |
| 59 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 60 | +makeDictEncoder f m r = | |
| 61 | + r | |
| 62 | + |> Dict.toList | |
| 63 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 64 | + |> String.join "," | |
| 65 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 66 | + | |
| 59 | 67 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 60 | 68 | makeNullableEncoder f m = |
| 61 | 69 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/d0908.json
Mflowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/d23d5.json
Mflowdefault / TopLevel.js+2 −2
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 126 | 126 | return invalidValue(l(ref || "object"), val, key, parent); |
| 127 | 127 | } |
| 128 | - const result: any = {}; | |
| 128 | + const result: any = Object.create(null); | |
| 129 | 129 | Object.getOwnPropertyNames(props).forEach(key => { |
| 130 | 130 | const prop = props[key]; |
| 131 | 131 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 137 | 137 | } |
| 138 | 138 | }); |
| 139 | - return result; | |
| 139 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 123 | 123 | return invalidValue(l(ref || "object"), val, key, parent); |
| 124 | 124 | } |
| 125 | - const result: any = {}; | |
| 125 | + const result: any = Object.create(null); | |
| 126 | 126 | Object.getOwnPropertyNames(props).forEach(key => { |
| 127 | 127 | const prop = props[key]; |
| 128 | 128 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 134 | 134 | } |
| 135 | 135 | }); |
| 136 | - return result; | |
| 136 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/dbfb3.json
Mflowdefault / TopLevel.js+2 −2
| @@ -209,7 +209,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 209 | 209 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 210 | 210 | return invalidValue(l(ref || "object"), val, key, parent); |
| 211 | 211 | } |
| 212 | - const result: any = {}; | |
| 212 | + const result: any = Object.create(null); | |
| 213 | 213 | Object.getOwnPropertyNames(props).forEach(key => { |
| 214 | 214 | const prop = props[key]; |
| 215 | 215 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -220,7 +220,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 220 | 220 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 221 | 221 | } |
| 222 | 222 | }); |
| 223 | - return result; | |
| 223 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -207,7 +207,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 207 | 207 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 208 | 208 | return invalidValue(l(ref || "object"), val, key, parent); |
| 209 | 209 | } |
| 210 | - const result: any = {}; | |
| 210 | + const result: any = Object.create(null); | |
| 211 | 211 | Object.getOwnPropertyNames(props).forEach(key => { |
| 212 | 212 | const prop = props[key]; |
| 213 | 213 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -218,7 +218,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 218 | 218 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 219 | 219 | } |
| 220 | 220 | }); |
| 221 | - return result; | |
| 221 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/dc44f.json
Mflowdefault / TopLevel.js+2 −2
| @@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 233 | 233 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 234 | 234 | return invalidValue(l(ref || "object"), val, key, parent); |
| 235 | 235 | } |
| 236 | - const result: any = {}; | |
| 236 | + const result: any = Object.create(null); | |
| 237 | 237 | Object.getOwnPropertyNames(props).forEach(key => { |
| 238 | 238 | const prop = props[key]; |
| 239 | 239 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -244,7 +244,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 244 | 244 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 245 | 245 | } |
| 246 | 246 | }); |
| 247 | - return result; | |
| 247 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -175,7 +175,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 175 | 175 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 176 | 176 | return invalidValue(l(ref || "object"), val, key, parent); |
| 177 | 177 | } |
| 178 | - const result: any = {}; | |
| 178 | + const result: any = Object.create(null); | |
| 179 | 179 | Object.getOwnPropertyNames(props).forEach(key => { |
| 180 | 180 | const prop = props[key]; |
| 181 | 181 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -186,7 +186,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 186 | 186 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 187 | 187 | } |
| 188 | 188 | }); |
| 189 | - return result; | |
| 189 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/dd1ce.json
Mflowdefault / TopLevel.js+2 −2
| @@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 233 | 233 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 234 | 234 | return invalidValue(l(ref || "object"), val, key, parent); |
| 235 | 235 | } |
| 236 | - const result: any = {}; | |
| 236 | + const result: any = Object.create(null); | |
| 237 | 237 | Object.getOwnPropertyNames(props).forEach(key => { |
| 238 | 238 | const prop = props[key]; |
| 239 | 239 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -244,7 +244,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 244 | 244 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 245 | 245 | } |
| 246 | 246 | }); |
| 247 | - return result; | |
| 247 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -175,7 +175,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 175 | 175 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 176 | 176 | return invalidValue(l(ref || "object"), val, key, parent); |
| 177 | 177 | } |
| 178 | - const result: any = {}; | |
| 178 | + const result: any = Object.create(null); | |
| 179 | 179 | Object.getOwnPropertyNames(props).forEach(key => { |
| 180 | 180 | const prop = props[key]; |
| 181 | 181 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -186,7 +186,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 186 | 186 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 187 | 187 | } |
| 188 | 188 | }); |
| 189 | - return result; | |
| 189 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/dec3a.json
Mflowdefault / TopLevel.js+2 −2
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 169 | 169 | return invalidValue(l(ref || "object"), val, key, parent); |
| 170 | 170 | } |
| 171 | - const result: any = {}; | |
| 171 | + const result: any = Object.create(null); | |
| 172 | 172 | Object.getOwnPropertyNames(props).forEach(key => { |
| 173 | 173 | const prop = props[key]; |
| 174 | 174 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -179,7 +179,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 179 | 179 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 180 | 180 | } |
| 181 | 181 | }); |
| 182 | - return result; | |
| 182 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 169 | 169 | return invalidValue(l(ref || "object"), val, key, parent); |
| 170 | 170 | } |
| 171 | - const result: any = {}; | |
| 171 | + const result: any = Object.create(null); | |
| 172 | 172 | Object.getOwnPropertyNames(props).forEach(key => { |
| 173 | 173 | const prop = props[key]; |
| 174 | 174 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -179,7 +179,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 179 | 179 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 180 | 180 | } |
| 181 | 181 | }); |
| 182 | - return result; | |
| 182 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/df957.json
Mflowdefault / TopLevel.js+2 −2
| @@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 205 | 205 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 206 | 206 | return invalidValue(l(ref || "object"), val, key, parent); |
| 207 | 207 | } |
| 208 | - const result: any = {}; | |
| 208 | + const result: any = Object.create(null); | |
| 209 | 209 | Object.getOwnPropertyNames(props).forEach(key => { |
| 210 | 210 | const prop = props[key]; |
| 211 | 211 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 216 | 216 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 217 | 217 | } |
| 218 | 218 | }); |
| 219 | - return result; | |
| 219 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 205 | 205 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 206 | 206 | return invalidValue(l(ref || "object"), val, key, parent); |
| 207 | 207 | } |
| 208 | - const result: any = {}; | |
| 208 | + const result: any = Object.create(null); | |
| 209 | 209 | Object.getOwnPropertyNames(props).forEach(key => { |
| 210 | 210 | const prop = props[key]; |
| 211 | 211 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 216 | 216 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 217 | 217 | } |
| 218 | 218 | }); |
| 219 | - return result; | |
| 219 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/e0ac7.json
Mflowdefault / TopLevel.js+2 −2
| @@ -217,7 +217,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 217 | 217 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 218 | 218 | return invalidValue(l(ref || "object"), val, key, parent); |
| 219 | 219 | } |
| 220 | - const result: any = {}; | |
| 220 | + const result: any = Object.create(null); | |
| 221 | 221 | Object.getOwnPropertyNames(props).forEach(key => { |
| 222 | 222 | const prop = props[key]; |
| 223 | 223 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -228,7 +228,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 228 | 228 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 229 | 229 | } |
| 230 | 230 | }); |
| 231 | - return result; | |
| 231 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -213,7 +213,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 213 | 213 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 214 | 214 | return invalidValue(l(ref || "object"), val, key, parent); |
| 215 | 215 | } |
| 216 | - const result: any = {}; | |
| 216 | + const result: any = Object.create(null); | |
| 217 | 217 | Object.getOwnPropertyNames(props).forEach(key => { |
| 218 | 218 | const prop = props[key]; |
| 219 | 219 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -224,7 +224,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 224 | 224 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 225 | 225 | } |
| 226 | 226 | }); |
| 227 | - return result; | |
| 227 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/e2915.json
Mflowdefault / TopLevel.js+2 −2
| @@ -208,7 +208,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 208 | 208 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 209 | 209 | return invalidValue(l(ref || "object"), val, key, parent); |
| 210 | 210 | } |
| 211 | - const result: any = {}; | |
| 211 | + const result: any = Object.create(null); | |
| 212 | 212 | Object.getOwnPropertyNames(props).forEach(key => { |
| 213 | 213 | const prop = props[key]; |
| 214 | 214 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -219,7 +219,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 219 | 219 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 220 | 220 | } |
| 221 | 221 | }); |
| 222 | - return result; | |
| 222 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -207,7 +207,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 207 | 207 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 208 | 208 | return invalidValue(l(ref || "object"), val, key, parent); |
| 209 | 209 | } |
| 210 | - const result: any = {}; | |
| 210 | + const result: any = Object.create(null); | |
| 211 | 211 | Object.getOwnPropertyNames(props).forEach(key => { |
| 212 | 212 | const prop = props[key]; |
| 213 | 213 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -218,7 +218,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 218 | 218 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 219 | 219 | } |
| 220 | 220 | }); |
| 221 | - return result; | |
| 221 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/e2a58.json
Mflowdefault / TopLevel.js+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/e324e.json
Melmdefault / QuickType.elm+9 −1
| @@ -166,7 +166,7 @@ rate = | ||
| 166 | 166 | encodeRate : Rate -> Jenc.Value |
| 167 | 167 | encodeRate x = |
| 168 | 168 | Jenc.object |
| 169 | - [ ("properties", Jenc.dict identity encodeProperty x.properties) | |
| 169 | + [ ("properties", makeDictEncoder identity encodeProperty x.properties) | |
| 170 | 170 | ] |
| 171 | 171 | |
| 172 | 172 | property : Jdec.Decoder Property |
| @@ -322,6 +322,14 @@ encodeItems x = | ||
| 322 | 322 | |
| 323 | 323 | --- encoder helpers |
| 324 | 324 | |
| 325 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 326 | +makeDictEncoder f m r = | |
| 327 | + r | |
| 328 | + |> Dict.toList | |
| 329 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 330 | + |> String.join "," | |
| 331 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 332 | + | |
| 325 | 333 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 326 | 334 | makeNullableEncoder f m = |
| 327 | 335 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -179,7 +179,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 179 | 179 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 180 | 180 | return invalidValue(l(ref || "object"), val, key, parent); |
| 181 | 181 | } |
| 182 | - const result: any = {}; | |
| 182 | + const result: any = Object.create(null); | |
| 183 | 183 | Object.getOwnPropertyNames(props).forEach(key => { |
| 184 | 184 | const prop = props[key]; |
| 185 | 185 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -190,7 +190,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 190 | 190 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 191 | 191 | } |
| 192 | 192 | }); |
| 193 | - return result; | |
| 193 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -178,7 +178,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 178 | 178 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 179 | 179 | return invalidValue(l(ref || "object"), val, key, parent); |
| 180 | 180 | } |
| 181 | - const result: any = {}; | |
| 181 | + const result: any = Object.create(null); | |
| 182 | 182 | Object.getOwnPropertyNames(props).forEach(key => { |
| 183 | 183 | const prop = props[key]; |
| 184 | 184 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -189,7 +189,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 189 | 189 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 190 | 190 | } |
| 191 | 191 | }); |
| 192 | - return result; | |
| 192 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/e53b5.json
Mflowdefault / TopLevel.js+2 −2
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 136 | 136 | return invalidValue(l(ref || "object"), val, key, parent); |
| 137 | 137 | } |
| 138 | - const result: any = {}; | |
| 138 | + const result: any = Object.create(null); | |
| 139 | 139 | Object.getOwnPropertyNames(props).forEach(key => { |
| 140 | 140 | const prop = props[key]; |
| 141 | 141 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 146 | 146 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 147 | 147 | } |
| 148 | 148 | }); |
| 149 | - return result; | |
| 149 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 131 | 131 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 132 | 132 | return invalidValue(l(ref || "object"), val, key, parent); |
| 133 | 133 | } |
| 134 | - const result: any = {}; | |
| 134 | + const result: any = Object.create(null); | |
| 135 | 135 | Object.getOwnPropertyNames(props).forEach(key => { |
| 136 | 136 | const prop = props[key]; |
| 137 | 137 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 143 | 143 | } |
| 144 | 144 | }); |
| 145 | - return result; | |
| 145 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/e64a0.json
Mflowdefault / TopLevel.js+2 −2
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 121 | 121 | return invalidValue(l(ref || "object"), val, key, parent); |
| 122 | 122 | } |
| 123 | - const result: any = {}; | |
| 123 | + const result: any = Object.create(null); | |
| 124 | 124 | Object.getOwnPropertyNames(props).forEach(key => { |
| 125 | 125 | const prop = props[key]; |
| 126 | 126 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 131 | 131 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 132 | 132 | } |
| 133 | 133 | }); |
| 134 | - return result; | |
| 134 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/e8a0b.json
Mflowdefault / TopLevel.js+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 117 | 117 | return invalidValue(l(ref || "object"), val, key, parent); |
| 118 | 118 | } |
| 119 | - const result: any = {}; | |
| 119 | + const result: any = Object.create(null); | |
| 120 | 120 | Object.getOwnPropertyNames(props).forEach(key => { |
| 121 | 121 | const prop = props[key]; |
| 122 | 122 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - return result; | |
| 130 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/e8b04.json
Mflowdefault / TopLevel.js+2 −2
| @@ -377,7 +377,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 377 | 377 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 378 | 378 | return invalidValue(l(ref || "object"), val, key, parent); |
| 379 | 379 | } |
| 380 | - const result: any = {}; | |
| 380 | + const result: any = Object.create(null); | |
| 381 | 381 | Object.getOwnPropertyNames(props).forEach(key => { |
| 382 | 382 | const prop = props[key]; |
| 383 | 383 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -388,7 +388,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 388 | 388 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 389 | 389 | } |
| 390 | 390 | }); |
| 391 | - return result; | |
| 391 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -338,7 +338,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 338 | 338 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 339 | 339 | return invalidValue(l(ref || "object"), val, key, parent); |
| 340 | 340 | } |
| 341 | - const result: any = {}; | |
| 341 | + const result: any = Object.create(null); | |
| 342 | 342 | Object.getOwnPropertyNames(props).forEach(key => { |
| 343 | 343 | const prop = props[key]; |
| 344 | 344 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -349,7 +349,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 349 | 349 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 350 | 350 | } |
| 351 | 351 | }); |
| 352 | - return result; | |
| 352 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/ed095.json
Melmdefault / QuickType.elm+9 −1
| @@ -36,10 +36,18 @@ quickType : Jdec.Decoder QuickType | ||
| 36 | 36 | quickType = Jdec.dict Jdec.string |
| 37 | 37 | |
| 38 | 38 | quickTypeToString : QuickType -> String |
| 39 | -quickTypeToString r = Jenc.encode 0 (Jenc.dict identity Jenc.string r) | |
| 39 | +quickTypeToString r = Jenc.encode 0 (makeDictEncoder identity Jenc.string r) | |
| 40 | 40 | |
| 41 | 41 | --- encoder helpers |
| 42 | 42 | |
| 43 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 44 | +makeDictEncoder f m r = | |
| 45 | + r | |
| 46 | + |> Dict.toList | |
| 47 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 48 | + |> String.join "," | |
| 49 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 50 | + | |
| 43 | 51 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 44 | 52 | makeNullableEncoder f m = |
| 45 | 53 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 105 | 105 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 106 | 106 | return invalidValue(l(ref || "object"), val, key, parent); |
| 107 | 107 | } |
| 108 | - const result: any = {}; | |
| 108 | + const result: any = Object.create(null); | |
| 109 | 109 | Object.getOwnPropertyNames(props).forEach(key => { |
| 110 | 110 | const prop = props[key]; |
| 111 | 111 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 117 | 117 | } |
| 118 | 118 | }); |
| 119 | - return result; | |
| 119 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 105 | 105 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 106 | 106 | return invalidValue(l(ref || "object"), val, key, parent); |
| 107 | 107 | } |
| 108 | - const result: any = {}; | |
| 108 | + const result: any = Object.create(null); | |
| 109 | 109 | Object.getOwnPropertyNames(props).forEach(key => { |
| 110 | 110 | const prop = props[key]; |
| 111 | 111 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 117 | 117 | } |
| 118 | 118 | }); |
| 119 | - return result; | |
| 119 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/f22f5.json
Mflowdefault / TopLevel.js+2 −2
| @@ -201,7 +201,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 201 | 201 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 202 | 202 | return invalidValue(l(ref || "object"), val, key, parent); |
| 203 | 203 | } |
| 204 | - const result: any = {}; | |
| 204 | + const result: any = Object.create(null); | |
| 205 | 205 | Object.getOwnPropertyNames(props).forEach(key => { |
| 206 | 206 | const prop = props[key]; |
| 207 | 207 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -212,7 +212,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 212 | 212 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 213 | 213 | } |
| 214 | 214 | }); |
| 215 | - return result; | |
| 215 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -193,7 +193,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 193 | 193 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 194 | 194 | return invalidValue(l(ref || "object"), val, key, parent); |
| 195 | 195 | } |
| 196 | - const result: any = {}; | |
| 196 | + const result: any = Object.create(null); | |
| 197 | 197 | Object.getOwnPropertyNames(props).forEach(key => { |
| 198 | 198 | const prop = props[key]; |
| 199 | 199 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -204,7 +204,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 204 | 204 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 205 | 205 | } |
| 206 | 206 | }); |
| 207 | - return result; | |
| 207 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/f3139.json
Mflowdefault / TopLevel.js+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/f3edf.json
Mflowdefault / TopLevel.js+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 117 | 117 | return invalidValue(l(ref || "object"), val, key, parent); |
| 118 | 118 | } |
| 119 | - const result: any = {}; | |
| 119 | + const result: any = Object.create(null); | |
| 120 | 120 | Object.getOwnPropertyNames(props).forEach(key => { |
| 121 | 121 | const prop = props[key]; |
| 122 | 122 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - return result; | |
| 130 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/f466a.json
Mflowdefault / TopLevel.js+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 117 | 117 | return invalidValue(l(ref || "object"), val, key, parent); |
| 118 | 118 | } |
| 119 | - const result: any = {}; | |
| 119 | + const result: any = Object.create(null); | |
| 120 | 120 | Object.getOwnPropertyNames(props).forEach(key => { |
| 121 | 121 | const prop = props[key]; |
| 122 | 122 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - return result; | |
| 130 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/f6a65.json
Mflowdefault / TopLevel.js+2 −2
| @@ -224,7 +224,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 224 | 224 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 225 | 225 | return invalidValue(l(ref || "object"), val, key, parent); |
| 226 | 226 | } |
| 227 | - const result: any = {}; | |
| 227 | + const result: any = Object.create(null); | |
| 228 | 228 | Object.getOwnPropertyNames(props).forEach(key => { |
| 229 | 229 | const prop = props[key]; |
| 230 | 230 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -235,7 +235,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 235 | 235 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 236 | 236 | } |
| 237 | 237 | }); |
| 238 | - return result; | |
| 238 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -215,7 +215,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 215 | 215 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 216 | 216 | return invalidValue(l(ref || "object"), val, key, parent); |
| 217 | 217 | } |
| 218 | - const result: any = {}; | |
| 218 | + const result: any = Object.create(null); | |
| 219 | 219 | Object.getOwnPropertyNames(props).forEach(key => { |
| 220 | 220 | const prop = props[key]; |
| 221 | 221 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -226,7 +226,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 226 | 226 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 227 | 227 | } |
| 228 | 228 | }); |
| 229 | - return result; | |
| 229 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/f74d5.json
Mflowdefault / TopLevel.js+2 −2
| @@ -223,7 +223,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 223 | 223 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 224 | 224 | return invalidValue(l(ref || "object"), val, key, parent); |
| 225 | 225 | } |
| 226 | - const result: any = {}; | |
| 226 | + const result: any = Object.create(null); | |
| 227 | 227 | Object.getOwnPropertyNames(props).forEach(key => { |
| 228 | 228 | const prop = props[key]; |
| 229 | 229 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -234,7 +234,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 234 | 234 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 235 | 235 | } |
| 236 | 236 | }); |
| 237 | - return result; | |
| 237 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -217,7 +217,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 217 | 217 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 218 | 218 | return invalidValue(l(ref || "object"), val, key, parent); |
| 219 | 219 | } |
| 220 | - const result: any = {}; | |
| 220 | + const result: any = Object.create(null); | |
| 221 | 221 | Object.getOwnPropertyNames(props).forEach(key => { |
| 222 | 222 | const prop = props[key]; |
| 223 | 223 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -228,7 +228,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 228 | 228 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 229 | 229 | } |
| 230 | 230 | }); |
| 231 | - return result; | |
| 231 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/f82d9.json
Mflowdefault / TopLevel.js+2 −2
| @@ -192,7 +192,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 192 | 192 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 193 | 193 | return invalidValue(l(ref || "object"), val, key, parent); |
| 194 | 194 | } |
| 195 | - const result: any = {}; | |
| 195 | + const result: any = Object.create(null); | |
| 196 | 196 | Object.getOwnPropertyNames(props).forEach(key => { |
| 197 | 197 | const prop = props[key]; |
| 198 | 198 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -203,7 +203,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 203 | 203 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 204 | 204 | } |
| 205 | 205 | }); |
| 206 | - return result; | |
| 206 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -191,7 +191,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 191 | 191 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 192 | 192 | return invalidValue(l(ref || "object"), val, key, parent); |
| 193 | 193 | } |
| 194 | - const result: any = {}; | |
| 194 | + const result: any = Object.create(null); | |
| 195 | 195 | Object.getOwnPropertyNames(props).forEach(key => { |
| 196 | 196 | const prop = props[key]; |
| 197 | 197 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -202,7 +202,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 202 | 202 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 203 | 203 | } |
| 204 | 204 | }); |
| 205 | - return result; | |
| 205 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/f974d.json
Mflowdefault / TopLevel.js+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/faff5.json
Mflowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/misc/fcca3.json
Mflowdefault / TopLevel.js+2 −2
| @@ -320,7 +320,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 320 | 320 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 321 | 321 | return invalidValue(l(ref || "object"), val, key, parent); |
| 322 | 322 | } |
| 323 | - const result: any = {}; | |
| 323 | + const result: any = Object.create(null); | |
| 324 | 324 | Object.getOwnPropertyNames(props).forEach(key => { |
| 325 | 325 | const prop = props[key]; |
| 326 | 326 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -331,7 +331,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 331 | 331 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 332 | 332 | } |
| 333 | 333 | }); |
| 334 | - return result; | |
| 334 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -317,7 +317,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 317 | 317 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 318 | 318 | return invalidValue(l(ref || "object"), val, key, parent); |
| 319 | 319 | } |
| 320 | - const result: any = {}; | |
| 320 | + const result: any = Object.create(null); | |
| 321 | 321 | Object.getOwnPropertyNames(props).forEach(key => { |
| 322 | 322 | const prop = props[key]; |
| 323 | 323 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -328,7 +328,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 328 | 328 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 329 | 329 | } |
| 330 | 330 | }); |
| 331 | - return result; | |
| 331 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/misc/fd329.json
Melmdefault / QuickType.elm+9 −1
| @@ -61,7 +61,7 @@ quickType = | ||
| 61 | 61 | encodeQuickType : QuickType -> Jenc.Value |
| 62 | 62 | encodeQuickType x = |
| 63 | 63 | Jenc.object |
| 64 | - [ ("data", Jenc.dict identity encodeDatum x.data) | |
| 64 | + [ ("data", makeDictEncoder identity encodeDatum x.data) | |
| 65 | 65 | , ("description", encodeDescription x.description) |
| 66 | 66 | ] |
| 67 | 67 | |
| @@ -97,6 +97,14 @@ encodeDescription x = | ||
| 97 | 97 | |
| 98 | 98 | --- encoder helpers |
| 99 | 99 | |
| 100 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 101 | +makeDictEncoder f m r = | |
| 102 | + r | |
| 103 | + |> Dict.toList | |
| 104 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 105 | + |> String.join "," | |
| 106 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 107 | + | |
| 100 | 108 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 101 | 109 | makeNullableEncoder f m = |
| 102 | 110 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 121 | 121 | return invalidValue(l(ref || "object"), val, key, parent); |
| 122 | 122 | } |
| 123 | - const result: any = {}; | |
| 123 | + const result: any = Object.create(null); | |
| 124 | 124 | Object.getOwnPropertyNames(props).forEach(key => { |
| 125 | 125 | const prop = props[key]; |
| 126 | 126 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 131 | 131 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 132 | 132 | } |
| 133 | 133 | }); |
| 134 | - return result; | |
| 134 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 121 | 121 | return invalidValue(l(ref || "object"), val, key, parent); |
| 122 | 122 | } |
| 123 | - const result: any = {}; | |
| 123 | + const result: any = Object.create(null); | |
| 124 | 124 | Object.getOwnPropertyNames(props).forEach(key => { |
| 125 | 125 | const prop = props[key]; |
| 126 | 126 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 131 | 131 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 132 | 132 | } |
| 133 | 133 | }); |
| 134 | - return result; | |
| 134 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/blns-object.json
Mflowdefault / TopLevel.js+2 −2
| @@ -702,7 +702,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 702 | 702 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 703 | 703 | return invalidValue(l(ref || "object"), val, key, parent); |
| 704 | 704 | } |
| 705 | - const result: any = {}; | |
| 705 | + const result: any = Object.create(null); | |
| 706 | 706 | Object.getOwnPropertyNames(props).forEach(key => { |
| 707 | 707 | const prop = props[key]; |
| 708 | 708 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -713,7 +713,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 713 | 713 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 714 | 714 | } |
| 715 | 715 | }); |
| 716 | - return result; | |
| 716 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 717 | 717 | } |
| 718 | 718 | |
| 719 | 719 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -702,7 +702,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 702 | 702 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 703 | 703 | return invalidValue(l(ref || "object"), val, key, parent); |
| 704 | 704 | } |
| 705 | - const result: any = {}; | |
| 705 | + const result: any = Object.create(null); | |
| 706 | 706 | Object.getOwnPropertyNames(props).forEach(key => { |
| 707 | 707 | const prop = props[key]; |
| 708 | 708 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -713,7 +713,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 713 | 713 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 714 | 714 | } |
| 715 | 715 | }); |
| 716 | - return result; | |
| 716 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 717 | 717 | } |
| 718 | 718 | |
| 719 | 719 | if (typ === "any") return val; |
Test case
4 generated files · +17 −9test/inputs/json/priority/bug2037.json
Melmdefault / QuickType.elm+11 −3
| @@ -60,7 +60,7 @@ quickType = | ||
| 60 | 60 | encodeQuickType : QuickType -> Jenc.Value |
| 61 | 61 | encodeQuickType x = |
| 62 | 62 | Jenc.object |
| 63 | - [ ("mission_specs", Jenc.dict identity encodeMissionSpec x.missionSpecs) | |
| 63 | + [ ("mission_specs", makeDictEncoder identity encodeMissionSpec x.missionSpecs) | |
| 64 | 64 | ] |
| 65 | 65 | |
| 66 | 66 | missionSpec : Jdec.Decoder MissionSpec |
| @@ -71,7 +71,7 @@ missionSpec = | ||
| 71 | 71 | encodeMissionSpec : MissionSpec -> Jenc.Value |
| 72 | 72 | encodeMissionSpec x = |
| 73 | 73 | Jenc.object |
| 74 | - [ ("objectives", Jenc.dict identity encodeObjective x.objectives) | |
| 74 | + [ ("objectives", makeDictEncoder identity encodeObjective x.objectives) | |
| 75 | 75 | ] |
| 76 | 76 | |
| 77 | 77 | objective : Jdec.Decoder Objective |
| @@ -82,7 +82,7 @@ objective = | ||
| 82 | 82 | encodeObjective : Objective -> Jenc.Value |
| 83 | 83 | encodeObjective x = |
| 84 | 84 | Jenc.object |
| 85 | - [ ("rewards", Jenc.dict identity encodeReward x.rewards) | |
| 85 | + [ ("rewards", makeDictEncoder identity encodeReward x.rewards) | |
| 86 | 86 | ] |
| 87 | 87 | |
| 88 | 88 | reward : Jdec.Decoder Reward |
| @@ -97,6 +97,14 @@ encodeReward x = | ||
| 97 | 97 | |
| 98 | 98 | --- encoder helpers |
| 99 | 99 | |
| 100 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 101 | +makeDictEncoder f m r = | |
| 102 | + r | |
| 103 | + |> Dict.toList | |
| 104 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 105 | + |> String.join "," | |
| 106 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 107 | + | |
| 100 | 108 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 101 | 109 | makeNullableEncoder f m = |
| 102 | 110 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 118 | 118 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 119 | 119 | return invalidValue(l(ref || "object"), val, key, parent); |
| 120 | 120 | } |
| 121 | - const result: any = {}; | |
| 121 | + const result: any = Object.create(null); | |
| 122 | 122 | Object.getOwnPropertyNames(props).forEach(key => { |
| 123 | 123 | const prop = props[key]; |
| 124 | 124 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -129,7 +129,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 129 | 129 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 130 | 130 | } |
| 131 | 131 | }); |
| 132 | - return result; | |
| 132 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/bug2521.json
Mflowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/bug2590.json
Mflowdefault / TopLevel.js+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/bug2663.json
Mflowdefault / TopLevel.js+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/bug2793.json
Mflowdefault / TopLevel.js+2 −2
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 117 | 117 | return invalidValue(l(ref || "object"), val, key, parent); |
| 118 | 118 | } |
| 119 | - const result: any = {}; | |
| 119 | + const result: any = Object.create(null); | |
| 120 | 120 | Object.getOwnPropertyNames(props).forEach(key => { |
| 121 | 121 | const prop = props[key]; |
| 122 | 122 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - return result; | |
| 130 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/bug427.json
Mflowdefault / TopLevel.js+2 −2
| @@ -718,7 +718,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 718 | 718 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 719 | 719 | return invalidValue(l(ref || "object"), val, key, parent); |
| 720 | 720 | } |
| 721 | - const result: any = {}; | |
| 721 | + const result: any = Object.create(null); | |
| 722 | 722 | Object.getOwnPropertyNames(props).forEach(key => { |
| 723 | 723 | const prop = props[key]; |
| 724 | 724 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -729,7 +729,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 729 | 729 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 730 | 730 | } |
| 731 | 731 | }); |
| 732 | - return result; | |
| 732 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 733 | 733 | } |
| 734 | 734 | |
| 735 | 735 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -664,7 +664,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 664 | 664 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 665 | 665 | return invalidValue(l(ref || "object"), val, key, parent); |
| 666 | 666 | } |
| 667 | - const result: any = {}; | |
| 667 | + const result: any = Object.create(null); | |
| 668 | 668 | Object.getOwnPropertyNames(props).forEach(key => { |
| 669 | 669 | const prop = props[key]; |
| 670 | 670 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -675,7 +675,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 675 | 675 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 676 | 676 | } |
| 677 | 677 | }); |
| 678 | - return result; | |
| 678 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 679 | 679 | } |
| 680 | 680 | |
| 681 | 681 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/bug790.json
Mflowdefault / TopLevel.js+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/priority/bug855-short.json
Melmdefault / QuickType.elm+9 −1
| @@ -45,7 +45,7 @@ quickType : Jdec.Decoder QuickType | ||
| 45 | 45 | quickType = Jdec.dict quickTypeValue |
| 46 | 46 | |
| 47 | 47 | quickTypeToString : QuickType -> String |
| 48 | -quickTypeToString r = Jenc.encode 0 (Jenc.dict identity encodeQuickTypeValue r) | |
| 48 | +quickTypeToString r = Jenc.encode 0 (makeDictEncoder identity encodeQuickTypeValue r) | |
| 49 | 49 | |
| 50 | 50 | quickTypeValue : Jdec.Decoder QuickTypeValue |
| 51 | 51 | quickTypeValue = |
| @@ -68,6 +68,14 @@ encodeQuickTypeValue x = | ||
| 68 | 68 | |
| 69 | 69 | --- encoder helpers |
| 70 | 70 | |
| 71 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 72 | +makeDictEncoder f m r = | |
| 73 | + r | |
| 74 | + |> Dict.toList | |
| 75 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 76 | + |> String.join "," | |
| 77 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 78 | + | |
| 71 | 79 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 72 | 80 | makeNullableEncoder f m = |
| 73 | 81 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/bug863.json
Mflowdefault / TopLevel.js+2 −2
| @@ -193,7 +193,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 193 | 193 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 194 | 194 | return invalidValue(l(ref || "object"), val, key, parent); |
| 195 | 195 | } |
| 196 | - const result: any = {}; | |
| 196 | + const result: any = Object.create(null); | |
| 197 | 197 | Object.getOwnPropertyNames(props).forEach(key => { |
| 198 | 198 | const prop = props[key]; |
| 199 | 199 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -204,7 +204,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 204 | 204 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 205 | 205 | } |
| 206 | 206 | }); |
| 207 | - return result; | |
| 207 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -177,7 +177,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 177 | 177 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 178 | 178 | return invalidValue(l(ref || "object"), val, key, parent); |
| 179 | 179 | } |
| 180 | - const result: any = {}; | |
| 180 | + const result: any = Object.create(null); | |
| 181 | 181 | Object.getOwnPropertyNames(props).forEach(key => { |
| 182 | 182 | const prop = props[key]; |
| 183 | 183 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -188,7 +188,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 188 | 188 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 189 | 189 | } |
| 190 | 190 | }); |
| 191 | - return result; | |
| 191 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/priority/coin-pairs.json
Melmdefault / QuickType.elm+9 −1
| @@ -59,7 +59,7 @@ quickType = | ||
| 59 | 59 | encodeQuickType : QuickType -> Jenc.Value |
| 60 | 60 | encodeQuickType x = |
| 61 | 61 | Jenc.object |
| 62 | - [ ("pairs", Jenc.dict identity encodePair x.pairs) | |
| 62 | + [ ("pairs", makeDictEncoder identity encodePair x.pairs) | |
| 63 | 63 | , ("server_time", Jenc.int x.serverTime) |
| 64 | 64 | ] |
| 65 | 65 | |
| @@ -90,6 +90,14 @@ encodePair x = | ||
| 90 | 90 | |
| 91 | 91 | --- encoder helpers |
| 92 | 92 | |
| 93 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 94 | +makeDictEncoder f m r = | |
| 95 | + r | |
| 96 | + |> Dict.toList | |
| 97 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 98 | + |> String.join "," | |
| 99 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 100 | + | |
| 93 | 101 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 94 | 102 | makeNullableEncoder f m = |
| 95 | 103 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 120 | 120 | return invalidValue(l(ref || "object"), val, key, parent); |
| 121 | 121 | } |
| 122 | - const result: any = {}; | |
| 122 | + const result: any = Object.create(null); | |
| 123 | 123 | Object.getOwnPropertyNames(props).forEach(key => { |
| 124 | 124 | const prop = props[key]; |
| 125 | 125 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 130 | 130 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 131 | 131 | } |
| 132 | 132 | }); |
| 133 | - return result; | |
| 133 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 120 | 120 | return invalidValue(l(ref || "object"), val, key, parent); |
| 121 | 121 | } |
| 122 | - const result: any = {}; | |
| 122 | + const result: any = Object.create(null); | |
| 123 | 123 | Object.getOwnPropertyNames(props).forEach(key => { |
| 124 | 124 | const prop = props[key]; |
| 125 | 125 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 130 | 130 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 131 | 131 | } |
| 132 | 132 | }); |
| 133 | - return result; | |
| 133 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | if (typ === "any") return val; |
Test case
22 generated files · +83 −67test/inputs/json/priority/combinations1.json
Melmarray-type-array--eed288b23e27 / QuickType.elm+17 −9
| @@ -642,7 +642,7 @@ encodeQuickType x = | ||
| 642 | 642 | , ("fuzzy", Jenc.array encodeFuzzy x.fuzzy) |
| 643 | 643 | , ("gardenwards", Jenc.array encodeGardenward x.gardenwards) |
| 644 | 644 | , ("generalissimo", Jenc.array encodeGeneralissimo x.generalissimo) |
| 645 | - , ("habeas", Jenc.array (makeNullableEncoder (Jenc.dict identity Jenc.int)) x.habeas) | |
| 645 | + , ("habeas", Jenc.array (makeNullableEncoder (makeDictEncoder identity Jenc.int)) x.habeas) | |
| 646 | 646 | , ("hemicrystalline", Jenc.array encodeHemicrystalline x.hemicrystalline) |
| 647 | 647 | , ("hemocoele", Jenc.array encodeHemocoeleElement x.hemocoele) |
| 648 | 648 | , ("hoister", Jenc.array encodeHoister x.hoister) |
| @@ -916,7 +916,7 @@ consilience = | ||
| 916 | 916 | encodeConsilience : Consilience -> Jenc.Value |
| 917 | 917 | encodeConsilience x = case x of |
| 918 | 918 | DoubleInConsilience y -> Jenc.float y |
| 919 | - IntegerMapInConsilience y -> Jenc.dict identity Jenc.int y | |
| 919 | + IntegerMapInConsilience y -> makeDictEncoder identity Jenc.int y | |
| 920 | 920 | |
| 921 | 921 | constructor : Jdec.Decoder Constructor |
| 922 | 922 | constructor = |
| @@ -928,7 +928,7 @@ constructor = | ||
| 928 | 928 | encodeConstructor : Constructor -> Jenc.Value |
| 929 | 929 | encodeConstructor x = case x of |
| 930 | 930 | BoolInConstructor y -> Jenc.bool y |
| 931 | - UnionMapInConstructor y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y | |
| 931 | + UnionMapInConstructor y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y | |
| 932 | 932 | |
| 933 | 933 | continuative : Jdec.Decoder Continuative |
| 934 | 934 | continuative = |
| @@ -940,7 +940,7 @@ continuative = | ||
| 940 | 940 | encodeContinuative : Continuative -> Jenc.Value |
| 941 | 941 | encodeContinuative x = case x of |
| 942 | 942 | StringInContinuative y -> Jenc.string y |
| 943 | - IntegerMapInContinuative y -> Jenc.dict identity Jenc.int y | |
| 943 | + IntegerMapInContinuative y -> makeDictEncoder identity Jenc.int y | |
| 944 | 944 | |
| 945 | 945 | credulityElement : Jdec.Decoder CredulityElement |
| 946 | 946 | credulityElement = |
| @@ -1017,7 +1017,7 @@ encodeCreviced : Creviced -> Jenc.Value | ||
| 1017 | 1017 | encodeCreviced x = case x of |
| 1018 | 1018 | BoolInCreviced y -> Jenc.bool y |
| 1019 | 1019 | StringInCreviced y -> Jenc.string y |
| 1020 | - IntegerMapInCreviced y -> Jenc.dict identity Jenc.int y | |
| 1020 | + IntegerMapInCreviced y -> makeDictEncoder identity Jenc.int y | |
| 1021 | 1021 | |
| 1022 | 1022 | deruralizeElement : Jdec.Decoder DeruralizeElement |
| 1023 | 1023 | deruralizeElement = |
| @@ -1171,7 +1171,7 @@ encodeEleutheromania : Eleutheromania -> Jenc.Value | ||
| 1171 | 1171 | encodeEleutheromania x = case x of |
| 1172 | 1172 | StringInEleutheromania y -> Jenc.string y |
| 1173 | 1173 | DoubleInEleutheromania y -> Jenc.float y |
| 1174 | - IntegerMapInEleutheromania y -> Jenc.dict identity Jenc.int y | |
| 1174 | + IntegerMapInEleutheromania y -> makeDictEncoder identity Jenc.int y | |
| 1175 | 1175 | |
| 1176 | 1176 | encrust : Jdec.Decoder Encrust |
| 1177 | 1177 | encrust = |
| @@ -1469,7 +1469,7 @@ fuzzy = | ||
| 1469 | 1469 | encodeFuzzy : Fuzzy -> Jenc.Value |
| 1470 | 1470 | encodeFuzzy x = case x of |
| 1471 | 1471 | IntegerInFuzzy y -> Jenc.int y |
| 1472 | - UnionMapInFuzzy y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y | |
| 1472 | + UnionMapInFuzzy y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y | |
| 1473 | 1473 | |
| 1474 | 1474 | gardenward : Jdec.Decoder Gardenward |
| 1475 | 1475 | gardenward = |
| @@ -1497,7 +1497,7 @@ encodeGeneralissimo : Generalissimo -> Jenc.Value | ||
| 1497 | 1497 | encodeGeneralissimo x = case x of |
| 1498 | 1498 | BoolInGeneralissimo y -> Jenc.bool y |
| 1499 | 1499 | NullInGeneralissimo -> Jenc.null |
| 1500 | - IntegerMapInGeneralissimo y -> Jenc.dict identity Jenc.int y | |
| 1500 | + IntegerMapInGeneralissimo y -> makeDictEncoder identity Jenc.int y | |
| 1501 | 1501 | |
| 1502 | 1502 | hemicrystalline : Jdec.Decoder Hemicrystalline |
| 1503 | 1503 | hemicrystalline = |
| @@ -1695,10 +1695,18 @@ jacutinga = | ||
| 1695 | 1695 | encodeJacutinga : Jacutinga -> Jenc.Value |
| 1696 | 1696 | encodeJacutinga x = case x of |
| 1697 | 1697 | IntegerArrayInJacutinga y -> Jenc.array Jenc.int y |
| 1698 | - UnionMapInJacutinga y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y | |
| 1698 | + UnionMapInJacutinga y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y | |
| 1699 | 1699 | |
| 1700 | 1700 | --- encoder helpers |
| 1701 | 1701 | |
| 1702 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 1703 | +makeDictEncoder f m r = | |
| 1704 | + r | |
| 1705 | + |> Dict.toList | |
| 1706 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 1707 | + |> String.join "," | |
| 1708 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 1709 | + | |
| 1702 | 1710 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 1703 | 1711 | makeNullableEncoder f m = |
| 1704 | 1712 | case m of |
Melmdefault / QuickType.elm+17 −9
| @@ -641,7 +641,7 @@ encodeQuickType x = | ||
| 641 | 641 | , ("fuzzy", Jenc.list encodeFuzzy x.fuzzy) |
| 642 | 642 | , ("gardenwards", Jenc.list encodeGardenward x.gardenwards) |
| 643 | 643 | , ("generalissimo", Jenc.list encodeGeneralissimo x.generalissimo) |
| 644 | - , ("habeas", Jenc.list (makeNullableEncoder (Jenc.dict identity Jenc.int)) x.habeas) | |
| 644 | + , ("habeas", Jenc.list (makeNullableEncoder (makeDictEncoder identity Jenc.int)) x.habeas) | |
| 645 | 645 | , ("hemicrystalline", Jenc.list encodeHemicrystalline x.hemicrystalline) |
| 646 | 646 | , ("hemocoele", Jenc.list encodeHemocoeleElement x.hemocoele) |
| 647 | 647 | , ("hoister", Jenc.list encodeHoister x.hoister) |
| @@ -915,7 +915,7 @@ consilience = | ||
| 915 | 915 | encodeConsilience : Consilience -> Jenc.Value |
| 916 | 916 | encodeConsilience x = case x of |
| 917 | 917 | DoubleInConsilience y -> Jenc.float y |
| 918 | - IntegerMapInConsilience y -> Jenc.dict identity Jenc.int y | |
| 918 | + IntegerMapInConsilience y -> makeDictEncoder identity Jenc.int y | |
| 919 | 919 | |
| 920 | 920 | constructor : Jdec.Decoder Constructor |
| 921 | 921 | constructor = |
| @@ -927,7 +927,7 @@ constructor = | ||
| 927 | 927 | encodeConstructor : Constructor -> Jenc.Value |
| 928 | 928 | encodeConstructor x = case x of |
| 929 | 929 | BoolInConstructor y -> Jenc.bool y |
| 930 | - UnionMapInConstructor y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y | |
| 930 | + UnionMapInConstructor y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y | |
| 931 | 931 | |
| 932 | 932 | continuative : Jdec.Decoder Continuative |
| 933 | 933 | continuative = |
| @@ -939,7 +939,7 @@ continuative = | ||
| 939 | 939 | encodeContinuative : Continuative -> Jenc.Value |
| 940 | 940 | encodeContinuative x = case x of |
| 941 | 941 | StringInContinuative y -> Jenc.string y |
| 942 | - IntegerMapInContinuative y -> Jenc.dict identity Jenc.int y | |
| 942 | + IntegerMapInContinuative y -> makeDictEncoder identity Jenc.int y | |
| 943 | 943 | |
| 944 | 944 | credulityElement : Jdec.Decoder CredulityElement |
| 945 | 945 | credulityElement = |
| @@ -1016,7 +1016,7 @@ encodeCreviced : Creviced -> Jenc.Value | ||
| 1016 | 1016 | encodeCreviced x = case x of |
| 1017 | 1017 | BoolInCreviced y -> Jenc.bool y |
| 1018 | 1018 | StringInCreviced y -> Jenc.string y |
| 1019 | - IntegerMapInCreviced y -> Jenc.dict identity Jenc.int y | |
| 1019 | + IntegerMapInCreviced y -> makeDictEncoder identity Jenc.int y | |
| 1020 | 1020 | |
| 1021 | 1021 | deruralizeElement : Jdec.Decoder DeruralizeElement |
| 1022 | 1022 | deruralizeElement = |
| @@ -1170,7 +1170,7 @@ encodeEleutheromania : Eleutheromania -> Jenc.Value | ||
| 1170 | 1170 | encodeEleutheromania x = case x of |
| 1171 | 1171 | StringInEleutheromania y -> Jenc.string y |
| 1172 | 1172 | DoubleInEleutheromania y -> Jenc.float y |
| 1173 | - IntegerMapInEleutheromania y -> Jenc.dict identity Jenc.int y | |
| 1173 | + IntegerMapInEleutheromania y -> makeDictEncoder identity Jenc.int y | |
| 1174 | 1174 | |
| 1175 | 1175 | encrust : Jdec.Decoder Encrust |
| 1176 | 1176 | encrust = |
| @@ -1468,7 +1468,7 @@ fuzzy = | ||
| 1468 | 1468 | encodeFuzzy : Fuzzy -> Jenc.Value |
| 1469 | 1469 | encodeFuzzy x = case x of |
| 1470 | 1470 | IntegerInFuzzy y -> Jenc.int y |
| 1471 | - UnionMapInFuzzy y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y | |
| 1471 | + UnionMapInFuzzy y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y | |
| 1472 | 1472 | |
| 1473 | 1473 | gardenward : Jdec.Decoder Gardenward |
| 1474 | 1474 | gardenward = |
| @@ -1496,7 +1496,7 @@ encodeGeneralissimo : Generalissimo -> Jenc.Value | ||
| 1496 | 1496 | encodeGeneralissimo x = case x of |
| 1497 | 1497 | BoolInGeneralissimo y -> Jenc.bool y |
| 1498 | 1498 | NullInGeneralissimo -> Jenc.null |
| 1499 | - IntegerMapInGeneralissimo y -> Jenc.dict identity Jenc.int y | |
| 1499 | + IntegerMapInGeneralissimo y -> makeDictEncoder identity Jenc.int y | |
| 1500 | 1500 | |
| 1501 | 1501 | hemicrystalline : Jdec.Decoder Hemicrystalline |
| 1502 | 1502 | hemicrystalline = |
| @@ -1694,10 +1694,18 @@ jacutinga = | ||
| 1694 | 1694 | encodeJacutinga : Jacutinga -> Jenc.Value |
| 1695 | 1695 | encodeJacutinga x = case x of |
| 1696 | 1696 | IntegerArrayInJacutinga y -> Jenc.list Jenc.int y |
| 1697 | - UnionMapInJacutinga y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y | |
| 1697 | + UnionMapInJacutinga y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y | |
| 1698 | 1698 | |
| 1699 | 1699 | --- encoder helpers |
| 1700 | 1700 | |
| 1701 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 1702 | +makeDictEncoder f m r = | |
| 1703 | + r | |
| 1704 | + |> Dict.toList | |
| 1705 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 1706 | + |> String.join "," | |
| 1707 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 1708 | + | |
| 1701 | 1709 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 1702 | 1710 | makeNullableEncoder f m = |
| 1703 | 1711 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 499 | 499 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 500 | 500 | return invalidValue(l(ref || "object"), val, key, parent); |
| 501 | 501 | } |
| 502 | - const result: any = {}; | |
| 502 | + const result: any = Object.create(null); | |
| 503 | 503 | Object.getOwnPropertyNames(props).forEach(key => { |
| 504 | 504 | const prop = props[key]; |
| 505 | 505 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 510 | 510 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 511 | 511 | } |
| 512 | 512 | }); |
| 513 | - return result; | |
| 513 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | if (typ === "any") return val; |
Mflownice-property-names-true--f4d7920ee2ce / TopLevel.js+2 −2
| @@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 499 | 499 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 500 | 500 | return invalidValue(l(ref || "object"), val, key, parent); |
| 501 | 501 | } |
| 502 | - const result: any = {}; | |
| 502 | + const result: any = Object.create(null); | |
| 503 | 503 | Object.getOwnPropertyNames(props).forEach(key => { |
| 504 | 504 | const prop = props[key]; |
| 505 | 505 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 510 | 510 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 511 | 511 | } |
| 512 | 512 | }); |
| 513 | - return result; | |
| 513 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | if (typ === "any") return val; |
Mflowprefer-unions-false--a5053c0a486d / TopLevel.js+2 −2
| @@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 499 | 499 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 500 | 500 | return invalidValue(l(ref || "object"), val, key, parent); |
| 501 | 501 | } |
| 502 | - const result: any = {}; | |
| 502 | + const result: any = Object.create(null); | |
| 503 | 503 | Object.getOwnPropertyNames(props).forEach(key => { |
| 504 | 504 | const prop = props[key]; |
| 505 | 505 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 510 | 510 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 511 | 511 | } |
| 512 | 512 | }); |
| 513 | - return result; | |
| 513 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | if (typ === "any") return val; |
Mflowprefer-unknown-false--f1ab9e45d823 / TopLevel.js+2 −2
| @@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 499 | 499 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 500 | 500 | return invalidValue(l(ref || "object"), val, key, parent); |
| 501 | 501 | } |
| 502 | - const result: any = {}; | |
| 502 | + const result: any = Object.create(null); | |
| 503 | 503 | Object.getOwnPropertyNames(props).forEach(key => { |
| 504 | 504 | const prop = props[key]; |
| 505 | 505 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 510 | 510 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 511 | 511 | } |
| 512 | 512 | }); |
| 513 | - return result; | |
| 513 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | if (typ === "any") return val; |
Mflowruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+2 −2
| @@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 499 | 499 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 500 | 500 | return invalidValue(l(ref || "object"), val, key, parent); |
| 501 | 501 | } |
| 502 | - const result: any = {}; | |
| 502 | + const result: any = Object.create(null); | |
| 503 | 503 | Object.getOwnPropertyNames(props).forEach(key => { |
| 504 | 504 | const prop = props[key]; |
| 505 | 505 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 510 | 510 | result[key] = val[key]; |
| 511 | 511 | } |
| 512 | 512 | }); |
| 513 | - return result; | |
| 513 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | if (typ === "any") return val; |
Mjavascriptconverters-top-level--67aa452ed509 / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mjavascriptraw-type-any--474b307c39db / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mjavascriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = val[key]; |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptacronym-style-pascal--d9e0c1bd777a / TopLevel.ts+2 −2
| @@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 499 | 499 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 500 | 500 | return invalidValue(l(ref || "object"), val, key, parent); |
| 501 | 501 | } |
| 502 | - const result: any = {}; | |
| 502 | + const result: any = Object.create(null); | |
| 503 | 503 | Object.getOwnPropertyNames(props).forEach(key => { |
| 504 | 504 | const prop = props[key]; |
| 505 | 505 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 510 | 510 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 511 | 511 | } |
| 512 | 512 | }); |
| 513 | - return result; | |
| 513 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | if (typ === "any") return val; |
Mtypescriptconverters-all-objects--3a443babd1cb / TopLevel.ts+2 −2
| @@ -603,7 +603,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 603 | 603 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 604 | 604 | return invalidValue(l(ref || "object"), val, key, parent); |
| 605 | 605 | } |
| 606 | - const result: any = {}; | |
| 606 | + const result: any = Object.create(null); | |
| 607 | 607 | Object.getOwnPropertyNames(props).forEach(key => { |
| 608 | 608 | const prop = props[key]; |
| 609 | 609 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -614,7 +614,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 614 | 614 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 615 | 615 | } |
| 616 | 616 | }); |
| 617 | - return result; | |
| 617 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 618 | 618 | } |
| 619 | 619 | |
| 620 | 620 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 499 | 499 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 500 | 500 | return invalidValue(l(ref || "object"), val, key, parent); |
| 501 | 501 | } |
| 502 | - const result: any = {}; | |
| 502 | + const result: any = Object.create(null); | |
| 503 | 503 | Object.getOwnPropertyNames(props).forEach(key => { |
| 504 | 504 | const prop = props[key]; |
| 505 | 505 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 510 | 510 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 511 | 511 | } |
| 512 | 512 | }); |
| 513 | - return result; | |
| 513 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | if (typ === "any") return val; |
Mtypescriptnice-property-names-true--f4d7920ee2ce / TopLevel.ts+2 −2
| @@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 499 | 499 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 500 | 500 | return invalidValue(l(ref || "object"), val, key, parent); |
| 501 | 501 | } |
| 502 | - const result: any = {}; | |
| 502 | + const result: any = Object.create(null); | |
| 503 | 503 | Object.getOwnPropertyNames(props).forEach(key => { |
| 504 | 504 | const prop = props[key]; |
| 505 | 505 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 510 | 510 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 511 | 511 | } |
| 512 | 512 | }); |
| 513 | - return result; | |
| 513 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | if (typ === "any") return val; |
Mtypescriptprefer-const-values-true--6b26e4d1265c / TopLevel.ts+2 −2
| @@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 499 | 499 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 500 | 500 | return invalidValue(l(ref || "object"), val, key, parent); |
| 501 | 501 | } |
| 502 | - const result: any = {}; | |
| 502 | + const result: any = Object.create(null); | |
| 503 | 503 | Object.getOwnPropertyNames(props).forEach(key => { |
| 504 | 504 | const prop = props[key]; |
| 505 | 505 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 510 | 510 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 511 | 511 | } |
| 512 | 512 | }); |
| 513 | - return result; | |
| 513 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | if (typ === "any") return val; |
Mtypescriptprefer-types-true--df33e18681f9 / TopLevel.ts+2 −2
| @@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 499 | 499 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 500 | 500 | return invalidValue(l(ref || "object"), val, key, parent); |
| 501 | 501 | } |
| 502 | - const result: any = {}; | |
| 502 | + const result: any = Object.create(null); | |
| 503 | 503 | Object.getOwnPropertyNames(props).forEach(key => { |
| 504 | 504 | const prop = props[key]; |
| 505 | 505 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 510 | 510 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 511 | 511 | } |
| 512 | 512 | }); |
| 513 | - return result; | |
| 513 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | if (typ === "any") return val; |
Mtypescriptprefer-unions-false--a5053c0a486d / TopLevel.ts+2 −2
| @@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 499 | 499 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 500 | 500 | return invalidValue(l(ref || "object"), val, key, parent); |
| 501 | 501 | } |
| 502 | - const result: any = {}; | |
| 502 | + const result: any = Object.create(null); | |
| 503 | 503 | Object.getOwnPropertyNames(props).forEach(key => { |
| 504 | 504 | const prop = props[key]; |
| 505 | 505 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 510 | 510 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 511 | 511 | } |
| 512 | 512 | }); |
| 513 | - return result; | |
| 513 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | if (typ === "any") return val; |
Mtypescriptprefer-unknown-false--f1ab9e45d823 / TopLevel.ts+2 −2
| @@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 499 | 499 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 500 | 500 | return invalidValue(l(ref || "object"), val, key, parent); |
| 501 | 501 | } |
| 502 | - const result: any = {}; | |
| 502 | + const result: any = Object.create(null); | |
| 503 | 503 | Object.getOwnPropertyNames(props).forEach(key => { |
| 504 | 504 | const prop = props[key]; |
| 505 | 505 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 510 | 510 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 511 | 511 | } |
| 512 | 512 | }); |
| 513 | - return result; | |
| 513 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | if (typ === "any") return val; |
Mtypescriptraw-type-any--474b307c39db / TopLevel.ts+2 −2
| @@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 499 | 499 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 500 | 500 | return invalidValue(l(ref || "object"), val, key, parent); |
| 501 | 501 | } |
| 502 | - const result: any = {}; | |
| 502 | + const result: any = Object.create(null); | |
| 503 | 503 | Object.getOwnPropertyNames(props).forEach(key => { |
| 504 | 504 | const prop = props[key]; |
| 505 | 505 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 510 | 510 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 511 | 511 | } |
| 512 | 512 | }); |
| 513 | - return result; | |
| 513 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | if (typ === "any") return val; |
Mtypescriptreadonly-true--24da4fc107df / TopLevel.ts+11 −11
| @@ -39,7 +39,7 @@ export interface TopLevel { | ||
| 39 | 39 | readonly fuzzy: Fuzzy[]; |
| 40 | 40 | readonly gardenwards: Gardenward[]; |
| 41 | 41 | readonly generalissimo: Generalissimo[]; |
| 42 | - readonly habeas: ({ [key: string]: number } | null)[]; | |
| 42 | + readonly habeas: ({ readonly [key: string]: number } | null)[]; | |
| 43 | 43 | readonly hemicrystalline: Hemicrystalline[]; |
| 44 | 44 | readonly hemocoele: HemocoeleElement[]; |
| 45 | 45 | readonly hoister: Hoister[]; |
| @@ -150,11 +150,11 @@ export interface CoadjustClass { | ||
| 150 | 150 | readonly unchargeable?: null; |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | -export type Consilience = number | { [key: string]: number }; | |
| 153 | +export type Consilience = number | { readonly [key: string]: number }; | |
| 154 | 154 | |
| 155 | -export type Constructor = boolean | { [key: string]: number | null }; | |
| 155 | +export type Constructor = boolean | { readonly [key: string]: number | null }; | |
| 156 | 156 | |
| 157 | -export type Continuative = { [key: string]: number } | string; | |
| 157 | +export type Continuative = { readonly [key: string]: number } | string; | |
| 158 | 158 | |
| 159 | 159 | export type CredulityElement = CredulityClass | number | string; |
| 160 | 160 | |
| @@ -181,7 +181,7 @@ export interface CredulityClass { | ||
| 181 | 181 | readonly wharp: null; |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | -export type Creviced = boolean | { [key: string]: number } | string; | |
| 184 | +export type Creviced = boolean | { readonly [key: string]: number } | string; | |
| 185 | 185 | |
| 186 | 186 | export type DeruralizeElement = null[] | boolean | DeruralizeClass; |
| 187 | 187 | |
| @@ -235,7 +235,7 @@ export interface DiaereseClass { | ||
| 235 | 235 | |
| 236 | 236 | export type Downstroke = null[] | boolean | string; |
| 237 | 237 | |
| 238 | -export type Eleutheromania = number | { [key: string]: number } | string; | |
| 238 | +export type Eleutheromania = number | { readonly [key: string]: number } | string; | |
| 239 | 239 | |
| 240 | 240 | export interface Encrust { |
| 241 | 241 | readonly Hibernia: null; |
| @@ -343,11 +343,11 @@ export interface FlagmakingClass { | ||
| 343 | 343 | |
| 344 | 344 | export type Fluorometer = number | null | string; |
| 345 | 345 | |
| 346 | -export type Fuzzy = number | { [key: string]: number | null }; | |
| 346 | +export type Fuzzy = number | { readonly [key: string]: number | null }; | |
| 347 | 347 | |
| 348 | 348 | export type Gardenward = number[] | boolean | string; |
| 349 | 349 | |
| 350 | -export type Generalissimo = boolean | { [key: string]: number } | null; | |
| 350 | +export type Generalissimo = boolean | { readonly [key: string]: number } | null; | |
| 351 | 351 | |
| 352 | 352 | export type Hemicrystalline = CimeliaClass | string; |
| 353 | 353 | |
| @@ -401,7 +401,7 @@ export interface Interacinar { | ||
| 401 | 401 | readonly untrimmed: null; |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | -export type Jacutinga = number[] | { [key: string]: number | null }; | |
| 404 | +export type Jacutinga = number[] | { readonly [key: string]: number | null }; | |
| 405 | 405 | |
| 406 | 406 | // Converts JSON strings to/from your types |
| 407 | 407 | // and asserts the results of JSON.parse at runtime |
| @@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 499 | 499 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 500 | 500 | return invalidValue(l(ref || "object"), val, key, parent); |
| 501 | 501 | } |
| 502 | - const result: any = {}; | |
| 502 | + const result: any = Object.create(null); | |
| 503 | 503 | Object.getOwnPropertyNames(props).forEach(key => { |
| 504 | 504 | const prop = props[key]; |
| 505 | 505 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 510 | 510 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 511 | 511 | } |
| 512 | 512 | }); |
| 513 | - return result; | |
| 513 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | if (typ === "any") return val; |
Mtypescriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.ts+2 −2
| @@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 499 | 499 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 500 | 500 | return invalidValue(l(ref || "object"), val, key, parent); |
| 501 | 501 | } |
| 502 | - const result: any = {}; | |
| 502 | + const result: any = Object.create(null); | |
| 503 | 503 | Object.getOwnPropertyNames(props).forEach(key => { |
| 504 | 504 | const prop = props[key]; |
| 505 | 505 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -510,7 +510,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 510 | 510 | result[key] = val[key]; |
| 511 | 511 | } |
| 512 | 512 | }); |
| 513 | - return result; | |
| 513 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | if (typ === "any") return val; |
Test case
22 generated files · +92 −76test/inputs/json/priority/combinations2.json
Melmarray-type-array--eed288b23e27 / QuickType.elm+20 −12
| @@ -579,13 +579,13 @@ encodeQuickType x = | ||
| 579 | 579 | , ("amphithyron", Jenc.array (makeNullableEncoder encodeAmphithyron) x.amphithyron) |
| 580 | 580 | , ("Andriana", Jenc.array (makeNullableEncoder Jenc.string) x.andriana) |
| 581 | 581 | , ("ankee", Jenc.array encodeAnkeeElement x.ankee) |
| 582 | - , ("annihilator", Jenc.array (makeNullableEncoder (Jenc.dict identity (makeNullableEncoder Jenc.int))) x.annihilator) | |
| 582 | + , ("annihilator", Jenc.array (makeNullableEncoder (makeDictEncoder identity (makeNullableEncoder Jenc.int))) x.annihilator) | |
| 583 | 583 | , ("annulose", always Jenc.null x.annulose) |
| 584 | 584 | , ("Ansarie", Jenc.array encodeAnsarieElement x.ansarie) |
| 585 | 585 | , ("aphasia", Jenc.array encodeAphasia x.aphasia) |
| 586 | 586 | , ("asprawl", Jenc.array encodeAsprawl x.asprawl) |
| 587 | 587 | , ("attractive", Jenc.array (makeNullableEncoder Jenc.bool) x.attractive) |
| 588 | - , ("barksome", Jenc.dict identity Jenc.int x.barksome) | |
| 588 | + , ("barksome", makeDictEncoder identity Jenc.int x.barksome) | |
| 589 | 589 | , ("bedesman", Jenc.array encodeBedesman x.bedesman) |
| 590 | 590 | , ("belard", Jenc.array encodeBelard x.belard) |
| 591 | 591 | , ("bocking", Jenc.array encodeBocking x.bocking) |
| @@ -612,7 +612,7 @@ encodeQuickType x = | ||
| 612 | 612 | , ("School", Jenc.array encodeSchool x.school) |
| 613 | 613 | , ("Shakespearolater", Jenc.array encodeShakespearolater x.shakespearolater) |
| 614 | 614 | , ("Svan", Jenc.array Jenc.float x.svan) |
| 615 | - , ("Wayao", Jenc.dict identity Jenc.float x.wayao) | |
| 615 | + , ("Wayao", makeDictEncoder identity Jenc.float x.wayao) | |
| 616 | 616 | ] |
| 617 | 617 | |
| 618 | 618 | abranchiata : Jdec.Decoder Abranchiata |
| @@ -641,7 +641,7 @@ encodeAcademe : Academe -> Jenc.Value | ||
| 641 | 641 | encodeAcademe x = case x of |
| 642 | 642 | IntegerArrayInAcademe y -> Jenc.array Jenc.int y |
| 643 | 643 | IntegerInAcademe y -> Jenc.int y |
| 644 | - IntegerMapInAcademe y -> Jenc.dict identity Jenc.int y | |
| 644 | + IntegerMapInAcademe y -> makeDictEncoder identity Jenc.int y | |
| 645 | 645 | |
| 646 | 646 | acquirable : Jdec.Decoder Acquirable |
| 647 | 647 | acquirable = |
| @@ -653,7 +653,7 @@ acquirable = | ||
| 653 | 653 | encodeAcquirable : Acquirable -> Jenc.Value |
| 654 | 654 | encodeAcquirable x = case x of |
| 655 | 655 | UnionArrayInAcquirable y -> Jenc.array (makeNullableEncoder Jenc.int) y |
| 656 | - IntegerMapInAcquirable y -> Jenc.dict identity Jenc.int y | |
| 656 | + IntegerMapInAcquirable y -> makeDictEncoder identity Jenc.int y | |
| 657 | 657 | |
| 658 | 658 | aerometry : Jdec.Decoder Aerometry |
| 659 | 659 | aerometry = |
| @@ -1034,7 +1034,7 @@ encodeBocking : Bocking -> Jenc.Value | ||
| 1034 | 1034 | encodeBocking x = case x of |
| 1035 | 1035 | IntegerArrayInBocking y -> Jenc.array Jenc.int y |
| 1036 | 1036 | BoolInBocking y -> Jenc.bool y |
| 1037 | - IntegerMapInBocking y -> Jenc.dict identity Jenc.int y | |
| 1037 | + IntegerMapInBocking y -> makeDictEncoder identity Jenc.int y | |
| 1038 | 1038 | |
| 1039 | 1039 | brawlingly : Jdec.Decoder Brawlingly |
| 1040 | 1040 | brawlingly = |
| @@ -1046,7 +1046,7 @@ brawlingly = | ||
| 1046 | 1046 | encodeBrawlingly : Brawlingly -> Jenc.Value |
| 1047 | 1047 | encodeBrawlingly x = case x of |
| 1048 | 1048 | NullArrayInBrawlingly y -> Jenc.array (always Jenc.null) y |
| 1049 | - UnionMapInBrawlingly y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y | |
| 1049 | + UnionMapInBrawlingly y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y | |
| 1050 | 1050 | |
| 1051 | 1051 | brookie : Jdec.Decoder Brookie |
| 1052 | 1052 | brookie = |
| @@ -1098,7 +1098,7 @@ encodeCatallactic : Catallactic -> Jenc.Value | ||
| 1098 | 1098 | encodeCatallactic x = case x of |
| 1099 | 1099 | NullArrayInCatallactic y -> Jenc.array (always Jenc.null) y |
| 1100 | 1100 | BoolInCatallactic y -> Jenc.bool y |
| 1101 | - IntegerMapInCatallactic y -> Jenc.dict identity Jenc.int y | |
| 1101 | + IntegerMapInCatallactic y -> makeDictEncoder identity Jenc.int y | |
| 1102 | 1102 | |
| 1103 | 1103 | cemental : Jdec.Decoder Cemental |
| 1104 | 1104 | cemental = |
| @@ -1112,7 +1112,7 @@ encodeCemental : Cemental -> Jenc.Value | ||
| 1112 | 1112 | encodeCemental x = case x of |
| 1113 | 1113 | IntegerArrayInCemental y -> Jenc.array Jenc.int y |
| 1114 | 1114 | DoubleInCemental y -> Jenc.float y |
| 1115 | - IntegerMapInCemental y -> Jenc.dict identity Jenc.int y | |
| 1115 | + IntegerMapInCemental y -> makeDictEncoder identity Jenc.int y | |
| 1116 | 1116 | |
| 1117 | 1117 | chytridiaceaeElement : Jdec.Decoder ChytridiaceaeElement |
| 1118 | 1118 | chytridiaceaeElement = |
| @@ -1284,7 +1284,7 @@ eupatorium = | ||
| 1284 | 1284 | encodeEupatorium : Eupatorium -> Jenc.Value |
| 1285 | 1285 | encodeEupatorium x = case x of |
| 1286 | 1286 | NullArrayInEupatorium y -> Jenc.array (always Jenc.null) y |
| 1287 | - IntegerMapInEupatorium y -> Jenc.dict identity Jenc.int y | |
| 1287 | + IntegerMapInEupatorium y -> makeDictEncoder identity Jenc.int y | |
| 1288 | 1288 | |
| 1289 | 1289 | gryphosaurusElement : Jdec.Decoder GryphosaurusElement |
| 1290 | 1290 | gryphosaurusElement = |
| @@ -1359,7 +1359,7 @@ koryak = | ||
| 1359 | 1359 | encodeKoryak : Koryak -> Jenc.Value |
| 1360 | 1360 | encodeKoryak x = case x of |
| 1361 | 1361 | StringInKoryak y -> Jenc.string y |
| 1362 | - UnionMapInKoryak y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y | |
| 1362 | + UnionMapInKoryak y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y | |
| 1363 | 1363 | |
| 1364 | 1364 | laviniaElement : Jdec.Decoder LaviniaElement |
| 1365 | 1365 | laviniaElement = |
| @@ -1547,7 +1547,7 @@ encodeSchool : School -> Jenc.Value | ||
| 1547 | 1547 | encodeSchool x = case x of |
| 1548 | 1548 | IntegerInSchool y -> Jenc.int y |
| 1549 | 1549 | NullInSchool -> Jenc.null |
| 1550 | - IntegerMapInSchool y -> Jenc.dict identity Jenc.int y | |
| 1550 | + IntegerMapInSchool y -> makeDictEncoder identity Jenc.int y | |
| 1551 | 1551 | |
| 1552 | 1552 | shakespearolater : Jdec.Decoder Shakespearolater |
| 1553 | 1553 | shakespearolater = |
| @@ -1565,6 +1565,14 @@ encodeShakespearolater x = case x of | ||
| 1565 | 1565 | |
| 1566 | 1566 | --- encoder helpers |
| 1567 | 1567 | |
| 1568 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 1569 | +makeDictEncoder f m r = | |
| 1570 | + r | |
| 1571 | + |> Dict.toList | |
| 1572 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 1573 | + |> String.join "," | |
| 1574 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 1575 | + | |
| 1568 | 1576 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 1569 | 1577 | makeNullableEncoder f m = |
| 1570 | 1578 | case m of |
Melmdefault / QuickType.elm+20 −12
| @@ -578,13 +578,13 @@ encodeQuickType x = | ||
| 578 | 578 | , ("amphithyron", Jenc.list (makeNullableEncoder encodeAmphithyron) x.amphithyron) |
| 579 | 579 | , ("Andriana", Jenc.list (makeNullableEncoder Jenc.string) x.andriana) |
| 580 | 580 | , ("ankee", Jenc.list encodeAnkeeElement x.ankee) |
| 581 | - , ("annihilator", Jenc.list (makeNullableEncoder (Jenc.dict identity (makeNullableEncoder Jenc.int))) x.annihilator) | |
| 581 | + , ("annihilator", Jenc.list (makeNullableEncoder (makeDictEncoder identity (makeNullableEncoder Jenc.int))) x.annihilator) | |
| 582 | 582 | , ("annulose", always Jenc.null x.annulose) |
| 583 | 583 | , ("Ansarie", Jenc.list encodeAnsarieElement x.ansarie) |
| 584 | 584 | , ("aphasia", Jenc.list encodeAphasia x.aphasia) |
| 585 | 585 | , ("asprawl", Jenc.list encodeAsprawl x.asprawl) |
| 586 | 586 | , ("attractive", Jenc.list (makeNullableEncoder Jenc.bool) x.attractive) |
| 587 | - , ("barksome", Jenc.dict identity Jenc.int x.barksome) | |
| 587 | + , ("barksome", makeDictEncoder identity Jenc.int x.barksome) | |
| 588 | 588 | , ("bedesman", Jenc.list encodeBedesman x.bedesman) |
| 589 | 589 | , ("belard", Jenc.list encodeBelard x.belard) |
| 590 | 590 | , ("bocking", Jenc.list encodeBocking x.bocking) |
| @@ -611,7 +611,7 @@ encodeQuickType x = | ||
| 611 | 611 | , ("School", Jenc.list encodeSchool x.school) |
| 612 | 612 | , ("Shakespearolater", Jenc.list encodeShakespearolater x.shakespearolater) |
| 613 | 613 | , ("Svan", Jenc.list Jenc.float x.svan) |
| 614 | - , ("Wayao", Jenc.dict identity Jenc.float x.wayao) | |
| 614 | + , ("Wayao", makeDictEncoder identity Jenc.float x.wayao) | |
| 615 | 615 | ] |
| 616 | 616 | |
| 617 | 617 | abranchiata : Jdec.Decoder Abranchiata |
| @@ -640,7 +640,7 @@ encodeAcademe : Academe -> Jenc.Value | ||
| 640 | 640 | encodeAcademe x = case x of |
| 641 | 641 | IntegerArrayInAcademe y -> Jenc.list Jenc.int y |
| 642 | 642 | IntegerInAcademe y -> Jenc.int y |
| 643 | - IntegerMapInAcademe y -> Jenc.dict identity Jenc.int y | |
| 643 | + IntegerMapInAcademe y -> makeDictEncoder identity Jenc.int y | |
| 644 | 644 | |
| 645 | 645 | acquirable : Jdec.Decoder Acquirable |
| 646 | 646 | acquirable = |
| @@ -652,7 +652,7 @@ acquirable = | ||
| 652 | 652 | encodeAcquirable : Acquirable -> Jenc.Value |
| 653 | 653 | encodeAcquirable x = case x of |
| 654 | 654 | UnionArrayInAcquirable y -> Jenc.list (makeNullableEncoder Jenc.int) y |
| 655 | - IntegerMapInAcquirable y -> Jenc.dict identity Jenc.int y | |
| 655 | + IntegerMapInAcquirable y -> makeDictEncoder identity Jenc.int y | |
| 656 | 656 | |
| 657 | 657 | aerometry : Jdec.Decoder Aerometry |
| 658 | 658 | aerometry = |
| @@ -1033,7 +1033,7 @@ encodeBocking : Bocking -> Jenc.Value | ||
| 1033 | 1033 | encodeBocking x = case x of |
| 1034 | 1034 | IntegerArrayInBocking y -> Jenc.list Jenc.int y |
| 1035 | 1035 | BoolInBocking y -> Jenc.bool y |
| 1036 | - IntegerMapInBocking y -> Jenc.dict identity Jenc.int y | |
| 1036 | + IntegerMapInBocking y -> makeDictEncoder identity Jenc.int y | |
| 1037 | 1037 | |
| 1038 | 1038 | brawlingly : Jdec.Decoder Brawlingly |
| 1039 | 1039 | brawlingly = |
| @@ -1045,7 +1045,7 @@ brawlingly = | ||
| 1045 | 1045 | encodeBrawlingly : Brawlingly -> Jenc.Value |
| 1046 | 1046 | encodeBrawlingly x = case x of |
| 1047 | 1047 | NullArrayInBrawlingly y -> Jenc.list (always Jenc.null) y |
| 1048 | - UnionMapInBrawlingly y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y | |
| 1048 | + UnionMapInBrawlingly y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y | |
| 1049 | 1049 | |
| 1050 | 1050 | brookie : Jdec.Decoder Brookie |
| 1051 | 1051 | brookie = |
| @@ -1097,7 +1097,7 @@ encodeCatallactic : Catallactic -> Jenc.Value | ||
| 1097 | 1097 | encodeCatallactic x = case x of |
| 1098 | 1098 | NullArrayInCatallactic y -> Jenc.list (always Jenc.null) y |
| 1099 | 1099 | BoolInCatallactic y -> Jenc.bool y |
| 1100 | - IntegerMapInCatallactic y -> Jenc.dict identity Jenc.int y | |
| 1100 | + IntegerMapInCatallactic y -> makeDictEncoder identity Jenc.int y | |
| 1101 | 1101 | |
| 1102 | 1102 | cemental : Jdec.Decoder Cemental |
| 1103 | 1103 | cemental = |
| @@ -1111,7 +1111,7 @@ encodeCemental : Cemental -> Jenc.Value | ||
| 1111 | 1111 | encodeCemental x = case x of |
| 1112 | 1112 | IntegerArrayInCemental y -> Jenc.list Jenc.int y |
| 1113 | 1113 | DoubleInCemental y -> Jenc.float y |
| 1114 | - IntegerMapInCemental y -> Jenc.dict identity Jenc.int y | |
| 1114 | + IntegerMapInCemental y -> makeDictEncoder identity Jenc.int y | |
| 1115 | 1115 | |
| 1116 | 1116 | chytridiaceaeElement : Jdec.Decoder ChytridiaceaeElement |
| 1117 | 1117 | chytridiaceaeElement = |
| @@ -1283,7 +1283,7 @@ eupatorium = | ||
| 1283 | 1283 | encodeEupatorium : Eupatorium -> Jenc.Value |
| 1284 | 1284 | encodeEupatorium x = case x of |
| 1285 | 1285 | NullArrayInEupatorium y -> Jenc.list (always Jenc.null) y |
| 1286 | - IntegerMapInEupatorium y -> Jenc.dict identity Jenc.int y | |
| 1286 | + IntegerMapInEupatorium y -> makeDictEncoder identity Jenc.int y | |
| 1287 | 1287 | |
| 1288 | 1288 | gryphosaurusElement : Jdec.Decoder GryphosaurusElement |
| 1289 | 1289 | gryphosaurusElement = |
| @@ -1358,7 +1358,7 @@ koryak = | ||
| 1358 | 1358 | encodeKoryak : Koryak -> Jenc.Value |
| 1359 | 1359 | encodeKoryak x = case x of |
| 1360 | 1360 | StringInKoryak y -> Jenc.string y |
| 1361 | - UnionMapInKoryak y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y | |
| 1361 | + UnionMapInKoryak y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y | |
| 1362 | 1362 | |
| 1363 | 1363 | laviniaElement : Jdec.Decoder LaviniaElement |
| 1364 | 1364 | laviniaElement = |
| @@ -1546,7 +1546,7 @@ encodeSchool : School -> Jenc.Value | ||
| 1546 | 1546 | encodeSchool x = case x of |
| 1547 | 1547 | IntegerInSchool y -> Jenc.int y |
| 1548 | 1548 | NullInSchool -> Jenc.null |
| 1549 | - IntegerMapInSchool y -> Jenc.dict identity Jenc.int y | |
| 1549 | + IntegerMapInSchool y -> makeDictEncoder identity Jenc.int y | |
| 1550 | 1550 | |
| 1551 | 1551 | shakespearolater : Jdec.Decoder Shakespearolater |
| 1552 | 1552 | shakespearolater = |
| @@ -1564,6 +1564,14 @@ encodeShakespearolater x = case x of | ||
| 1564 | 1564 | |
| 1565 | 1565 | --- encoder helpers |
| 1566 | 1566 | |
| 1567 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 1568 | +makeDictEncoder f m r = | |
| 1569 | + r | |
| 1570 | + |> Dict.toList | |
| 1571 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 1572 | + |> String.join "," | |
| 1573 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 1574 | + | |
| 1567 | 1575 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 1568 | 1576 | makeNullableEncoder f m = |
| 1569 | 1577 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 451 | 451 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 452 | 452 | return invalidValue(l(ref || "object"), val, key, parent); |
| 453 | 453 | } |
| 454 | - const result: any = {}; | |
| 454 | + const result: any = Object.create(null); | |
| 455 | 455 | Object.getOwnPropertyNames(props).forEach(key => { |
| 456 | 456 | const prop = props[key]; |
| 457 | 457 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 462 | 462 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 463 | 463 | } |
| 464 | 464 | }); |
| 465 | - return result; | |
| 465 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | if (typ === "any") return val; |
Mflownice-property-names-true--f4d7920ee2ce / TopLevel.js+2 −2
| @@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 451 | 451 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 452 | 452 | return invalidValue(l(ref || "object"), val, key, parent); |
| 453 | 453 | } |
| 454 | - const result: any = {}; | |
| 454 | + const result: any = Object.create(null); | |
| 455 | 455 | Object.getOwnPropertyNames(props).forEach(key => { |
| 456 | 456 | const prop = props[key]; |
| 457 | 457 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 462 | 462 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 463 | 463 | } |
| 464 | 464 | }); |
| 465 | - return result; | |
| 465 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | if (typ === "any") return val; |
Mflowprefer-unions-false--a5053c0a486d / TopLevel.js+2 −2
| @@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 451 | 451 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 452 | 452 | return invalidValue(l(ref || "object"), val, key, parent); |
| 453 | 453 | } |
| 454 | - const result: any = {}; | |
| 454 | + const result: any = Object.create(null); | |
| 455 | 455 | Object.getOwnPropertyNames(props).forEach(key => { |
| 456 | 456 | const prop = props[key]; |
| 457 | 457 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 462 | 462 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 463 | 463 | } |
| 464 | 464 | }); |
| 465 | - return result; | |
| 465 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | if (typ === "any") return val; |
Mflowprefer-unknown-false--f1ab9e45d823 / TopLevel.js+2 −2
| @@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 451 | 451 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 452 | 452 | return invalidValue(l(ref || "object"), val, key, parent); |
| 453 | 453 | } |
| 454 | - const result: any = {}; | |
| 454 | + const result: any = Object.create(null); | |
| 455 | 455 | Object.getOwnPropertyNames(props).forEach(key => { |
| 456 | 456 | const prop = props[key]; |
| 457 | 457 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 462 | 462 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 463 | 463 | } |
| 464 | 464 | }); |
| 465 | - return result; | |
| 465 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | if (typ === "any") return val; |
Mflowruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+2 −2
| @@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 451 | 451 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 452 | 452 | return invalidValue(l(ref || "object"), val, key, parent); |
| 453 | 453 | } |
| 454 | - const result: any = {}; | |
| 454 | + const result: any = Object.create(null); | |
| 455 | 455 | Object.getOwnPropertyNames(props).forEach(key => { |
| 456 | 456 | const prop = props[key]; |
| 457 | 457 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 462 | 462 | result[key] = val[key]; |
| 463 | 463 | } |
| 464 | 464 | }); |
| 465 | - return result; | |
| 465 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | if (typ === "any") return val; |
Mjavascriptconverters-top-level--67aa452ed509 / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mjavascriptraw-type-any--474b307c39db / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mjavascriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = val[key]; |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptacronym-style-pascal--d9e0c1bd777a / TopLevel.ts+2 −2
| @@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 451 | 451 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 452 | 452 | return invalidValue(l(ref || "object"), val, key, parent); |
| 453 | 453 | } |
| 454 | - const result: any = {}; | |
| 454 | + const result: any = Object.create(null); | |
| 455 | 455 | Object.getOwnPropertyNames(props).forEach(key => { |
| 456 | 456 | const prop = props[key]; |
| 457 | 457 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 462 | 462 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 463 | 463 | } |
| 464 | 464 | }); |
| 465 | - return result; | |
| 465 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | if (typ === "any") return val; |
Mtypescriptconverters-all-objects--3a443babd1cb / TopLevel.ts+2 −2
| @@ -531,7 +531,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 531 | 531 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 532 | 532 | return invalidValue(l(ref || "object"), val, key, parent); |
| 533 | 533 | } |
| 534 | - const result: any = {}; | |
| 534 | + const result: any = Object.create(null); | |
| 535 | 535 | Object.getOwnPropertyNames(props).forEach(key => { |
| 536 | 536 | const prop = props[key]; |
| 537 | 537 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -542,7 +542,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 542 | 542 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 543 | 543 | } |
| 544 | 544 | }); |
| 545 | - return result; | |
| 545 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 546 | 546 | } |
| 547 | 547 | |
| 548 | 548 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 451 | 451 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 452 | 452 | return invalidValue(l(ref || "object"), val, key, parent); |
| 453 | 453 | } |
| 454 | - const result: any = {}; | |
| 454 | + const result: any = Object.create(null); | |
| 455 | 455 | Object.getOwnPropertyNames(props).forEach(key => { |
| 456 | 456 | const prop = props[key]; |
| 457 | 457 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 462 | 462 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 463 | 463 | } |
| 464 | 464 | }); |
| 465 | - return result; | |
| 465 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | if (typ === "any") return val; |
Mtypescriptnice-property-names-true--f4d7920ee2ce / TopLevel.ts+2 −2
| @@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 451 | 451 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 452 | 452 | return invalidValue(l(ref || "object"), val, key, parent); |
| 453 | 453 | } |
| 454 | - const result: any = {}; | |
| 454 | + const result: any = Object.create(null); | |
| 455 | 455 | Object.getOwnPropertyNames(props).forEach(key => { |
| 456 | 456 | const prop = props[key]; |
| 457 | 457 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 462 | 462 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 463 | 463 | } |
| 464 | 464 | }); |
| 465 | - return result; | |
| 465 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | if (typ === "any") return val; |
Mtypescriptprefer-const-values-true--6b26e4d1265c / TopLevel.ts+2 −2
| @@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 451 | 451 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 452 | 452 | return invalidValue(l(ref || "object"), val, key, parent); |
| 453 | 453 | } |
| 454 | - const result: any = {}; | |
| 454 | + const result: any = Object.create(null); | |
| 455 | 455 | Object.getOwnPropertyNames(props).forEach(key => { |
| 456 | 456 | const prop = props[key]; |
| 457 | 457 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 462 | 462 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 463 | 463 | } |
| 464 | 464 | }); |
| 465 | - return result; | |
| 465 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | if (typ === "any") return val; |
Mtypescriptprefer-types-true--df33e18681f9 / TopLevel.ts+2 −2
| @@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 451 | 451 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 452 | 452 | return invalidValue(l(ref || "object"), val, key, parent); |
| 453 | 453 | } |
| 454 | - const result: any = {}; | |
| 454 | + const result: any = Object.create(null); | |
| 455 | 455 | Object.getOwnPropertyNames(props).forEach(key => { |
| 456 | 456 | const prop = props[key]; |
| 457 | 457 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 462 | 462 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 463 | 463 | } |
| 464 | 464 | }); |
| 465 | - return result; | |
| 465 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | if (typ === "any") return val; |
Mtypescriptprefer-unions-false--a5053c0a486d / TopLevel.ts+2 −2
| @@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 451 | 451 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 452 | 452 | return invalidValue(l(ref || "object"), val, key, parent); |
| 453 | 453 | } |
| 454 | - const result: any = {}; | |
| 454 | + const result: any = Object.create(null); | |
| 455 | 455 | Object.getOwnPropertyNames(props).forEach(key => { |
| 456 | 456 | const prop = props[key]; |
| 457 | 457 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 462 | 462 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 463 | 463 | } |
| 464 | 464 | }); |
| 465 | - return result; | |
| 465 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | if (typ === "any") return val; |
Mtypescriptprefer-unknown-false--f1ab9e45d823 / TopLevel.ts+2 −2
| @@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 451 | 451 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 452 | 452 | return invalidValue(l(ref || "object"), val, key, parent); |
| 453 | 453 | } |
| 454 | - const result: any = {}; | |
| 454 | + const result: any = Object.create(null); | |
| 455 | 455 | Object.getOwnPropertyNames(props).forEach(key => { |
| 456 | 456 | const prop = props[key]; |
| 457 | 457 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 462 | 462 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 463 | 463 | } |
| 464 | 464 | }); |
| 465 | - return result; | |
| 465 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | if (typ === "any") return val; |
Mtypescriptraw-type-any--474b307c39db / TopLevel.ts+2 −2
| @@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 451 | 451 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 452 | 452 | return invalidValue(l(ref || "object"), val, key, parent); |
| 453 | 453 | } |
| 454 | - const result: any = {}; | |
| 454 | + const result: any = Object.create(null); | |
| 455 | 455 | Object.getOwnPropertyNames(props).forEach(key => { |
| 456 | 456 | const prop = props[key]; |
| 457 | 457 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 462 | 462 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 463 | 463 | } |
| 464 | 464 | }); |
| 465 | - return result; | |
| 465 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | if (typ === "any") return val; |
Mtypescriptreadonly-true--24da4fc107df / TopLevel.ts+14 −14
| @@ -27,7 +27,7 @@ export interface TopLevel { | ||
| 27 | 27 | readonly School: School[]; |
| 28 | 28 | readonly Shakespearolater: Shakespearolater[]; |
| 29 | 29 | readonly Svan: number[]; |
| 30 | - readonly Wayao: { [key: string]: number }; | |
| 30 | + readonly Wayao: { readonly [key: string]: number }; | |
| 31 | 31 | readonly academe: Academe[]; |
| 32 | 32 | readonly acquirable: Acquirable[]; |
| 33 | 33 | readonly aerometry: Aerometry[]; |
| @@ -37,12 +37,12 @@ export interface TopLevel { | ||
| 37 | 37 | readonly ambassage: Ambassage[]; |
| 38 | 38 | readonly amphithyron: (Amphithyron | null)[]; |
| 39 | 39 | readonly ankee: AnkeeElement[]; |
| 40 | - readonly annihilator: ({ [key: string]: number | null } | null)[]; | |
| 40 | + readonly annihilator: ({ readonly [key: string]: number | null } | null)[]; | |
| 41 | 41 | readonly annulose: null; |
| 42 | 42 | readonly aphasia: Aphasia[]; |
| 43 | 43 | readonly asprawl: Asprawl[]; |
| 44 | 44 | readonly attractive: (boolean | null)[]; |
| 45 | - readonly barksome: { [key: string]: number }; | |
| 45 | + readonly barksome: { readonly [key: string]: number }; | |
| 46 | 46 | readonly bedesman: Bedesman[]; |
| 47 | 47 | readonly belard: Belard[]; |
| 48 | 48 | readonly bocking: Bocking[]; |
| @@ -141,7 +141,7 @@ export type Endomyce = number | string; | ||
| 141 | 141 | |
| 142 | 142 | export type Epinephelidae = boolean | number | string; |
| 143 | 143 | |
| 144 | -export type Eupatorium = null[] | { [key: string]: number }; | |
| 144 | +export type Eupatorium = null[] | { readonly [key: string]: number }; | |
| 145 | 145 | |
| 146 | 146 | export type GryphosaurusElement = number[] | GryphosaurusClass | string; |
| 147 | 147 | |
| @@ -168,7 +168,7 @@ export interface GryphosaurusClass { | ||
| 168 | 168 | readonly underntime: null; |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | -export type Koryak = { [key: string]: number | null } | string; | |
| 171 | +export type Koryak = { readonly [key: string]: number | null } | string; | |
| 172 | 172 | |
| 173 | 173 | export type LaviniaElement = LaviniaClass | string; |
| 174 | 174 | |
| @@ -239,13 +239,13 @@ export type Rhomboganoidei = number[] | Rebecca | string; | ||
| 239 | 239 | |
| 240 | 240 | export type Ruellia = boolean | Rebecca | string; |
| 241 | 241 | |
| 242 | -export type School = number | { [key: string]: number } | null; | |
| 242 | +export type School = number | { readonly [key: string]: number } | null; | |
| 243 | 243 | |
| 244 | 244 | export type Shakespearolater = number[] | number | string; |
| 245 | 245 | |
| 246 | -export type Academe = number[] | number | { [key: string]: number }; | |
| 246 | +export type Academe = number[] | number | { readonly [key: string]: number }; | |
| 247 | 247 | |
| 248 | -export type Acquirable = (number | null)[] | { [key: string]: number }; | |
| 248 | +export type Acquirable = (number | null)[] | { readonly [key: string]: number }; | |
| 249 | 249 | |
| 250 | 250 | export type Aerometry = boolean | number; |
| 251 | 251 | |
| @@ -341,9 +341,9 @@ export type Bedesman = boolean | number | string; | ||
| 341 | 341 | |
| 342 | 342 | export type Belard = number[] | Rebecca | number; |
| 343 | 343 | |
| 344 | -export type Bocking = number[] | boolean | { [key: string]: number }; | |
| 344 | +export type Bocking = number[] | boolean | { readonly [key: string]: number }; | |
| 345 | 345 | |
| 346 | -export type Brawlingly = null[] | { [key: string]: number | null }; | |
| 346 | +export type Brawlingly = null[] | { readonly [key: string]: number | null }; | |
| 347 | 347 | |
| 348 | 348 | export type Brookie = number[] | Rebecca; |
| 349 | 349 | |
| @@ -351,9 +351,9 @@ export type Bumboatman = null[] | null | string; | ||
| 351 | 351 | |
| 352 | 352 | export type Calaverite = number[] | string; |
| 353 | 353 | |
| 354 | -export type Catallactic = null[] | boolean | { [key: string]: number }; | |
| 354 | +export type Catallactic = null[] | boolean | { readonly [key: string]: number }; | |
| 355 | 355 | |
| 356 | -export type Cemental = number[] | number | { [key: string]: number }; | |
| 356 | +export type Cemental = number[] | number | { readonly [key: string]: number }; | |
| 357 | 357 | |
| 358 | 358 | // Converts JSON strings to/from your types |
| 359 | 359 | // and asserts the results of JSON.parse at runtime |
| @@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 451 | 451 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 452 | 452 | return invalidValue(l(ref || "object"), val, key, parent); |
| 453 | 453 | } |
| 454 | - const result: any = {}; | |
| 454 | + const result: any = Object.create(null); | |
| 455 | 455 | Object.getOwnPropertyNames(props).forEach(key => { |
| 456 | 456 | const prop = props[key]; |
| 457 | 457 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 462 | 462 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 463 | 463 | } |
| 464 | 464 | }); |
| 465 | - return result; | |
| 465 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | if (typ === "any") return val; |
Mtypescriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.ts+2 −2
| @@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 451 | 451 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 452 | 452 | return invalidValue(l(ref || "object"), val, key, parent); |
| 453 | 453 | } |
| 454 | - const result: any = {}; | |
| 454 | + const result: any = Object.create(null); | |
| 455 | 455 | Object.getOwnPropertyNames(props).forEach(key => { |
| 456 | 456 | const prop = props[key]; |
| 457 | 457 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -462,7 +462,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 462 | 462 | result[key] = val[key]; |
| 463 | 463 | } |
| 464 | 464 | }); |
| 465 | - return result; | |
| 465 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | if (typ === "any") return val; |
Test case
22 generated files · +77 −61test/inputs/json/priority/combinations3.json
Melmarray-type-array--eed288b23e27 / QuickType.elm+15 −7
| @@ -714,7 +714,7 @@ encodeQuickType x = | ||
| 714 | 714 | , ("prefreshman", Jenc.array encodePrefreshmanElement x.prefreshman) |
| 715 | 715 | , ("prehensility", Jenc.array encodePrehensility x.prehensility) |
| 716 | 716 | , ("prevoidance", Jenc.array encodePrevoidance x.prevoidance) |
| 717 | - , ("probant", Jenc.array (Jenc.dict identity (makeNullableEncoder Jenc.int)) x.probant) | |
| 717 | + , ("probant", Jenc.array (makeDictEncoder identity (makeNullableEncoder Jenc.int)) x.probant) | |
| 718 | 718 | , ("protext", Jenc.array encodeProtext x.protext) |
| 719 | 719 | ] |
| 720 | 720 | |
| @@ -789,7 +789,7 @@ kongoni = | ||
| 789 | 789 | encodeKongoni : Kongoni -> Jenc.Value |
| 790 | 790 | encodeKongoni x = case x of |
| 791 | 791 | IntegerArrayInKongoni y -> Jenc.array Jenc.int y |
| 792 | - IntegerMapInKongoni y -> Jenc.dict identity Jenc.int y | |
| 792 | + IntegerMapInKongoni y -> makeDictEncoder identity Jenc.int y | |
| 793 | 793 | |
| 794 | 794 | ladronismElement : Jdec.Decoder LadronismElement |
| 795 | 795 | ladronismElement = |
| @@ -1462,7 +1462,7 @@ paleographically = | ||
| 1462 | 1462 | encodePaleographically : Paleographically -> Jenc.Value |
| 1463 | 1463 | encodePaleographically x = case x of |
| 1464 | 1464 | DoubleInPaleographically y -> Jenc.float y |
| 1465 | - UnionMapInPaleographically y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y | |
| 1465 | + UnionMapInPaleographically y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y | |
| 1466 | 1466 | |
| 1467 | 1467 | pamphletwise : Jdec.Decoder Pamphletwise |
| 1468 | 1468 | pamphletwise = |
| @@ -1476,7 +1476,7 @@ encodePamphletwise : Pamphletwise -> Jenc.Value | ||
| 1476 | 1476 | encodePamphletwise x = case x of |
| 1477 | 1477 | IntegerInPamphletwise y -> Jenc.int y |
| 1478 | 1478 | StringInPamphletwise y -> Jenc.string y |
| 1479 | - IntegerMapInPamphletwise y -> Jenc.dict identity Jenc.int y | |
| 1479 | + IntegerMapInPamphletwise y -> makeDictEncoder identity Jenc.int y | |
| 1480 | 1480 | |
| 1481 | 1481 | pediatric : Jdec.Decoder Pediatric |
| 1482 | 1482 | pediatric = |
| @@ -1613,7 +1613,7 @@ placuntiti = | ||
| 1613 | 1613 | encodePlacuntiti : Placuntiti -> Jenc.Value |
| 1614 | 1614 | encodePlacuntiti x = case x of |
| 1615 | 1615 | IntegerInPlacuntiti y -> Jenc.int y |
| 1616 | - IntegerMapInPlacuntiti y -> Jenc.dict identity Jenc.int y | |
| 1616 | + IntegerMapInPlacuntiti y -> makeDictEncoder identity Jenc.int y | |
| 1617 | 1617 | |
| 1618 | 1618 | plectopterous : Jdec.Decoder Plectopterous |
| 1619 | 1619 | plectopterous = |
| @@ -1625,7 +1625,7 @@ plectopterous = | ||
| 1625 | 1625 | encodePlectopterous : Plectopterous -> Jenc.Value |
| 1626 | 1626 | encodePlectopterous x = case x of |
| 1627 | 1627 | DoubleInPlectopterous y -> Jenc.float y |
| 1628 | - IntegerMapInPlectopterous y -> Jenc.dict identity Jenc.int y | |
| 1628 | + IntegerMapInPlectopterous y -> makeDictEncoder identity Jenc.int y | |
| 1629 | 1629 | |
| 1630 | 1630 | pneumocele : Jdec.Decoder Pneumocele |
| 1631 | 1631 | pneumocele = |
| @@ -1710,7 +1710,7 @@ encodePoormaster : Poormaster -> Jenc.Value | ||
| 1710 | 1710 | encodePoormaster x = case x of |
| 1711 | 1711 | IntegerArrayInPoormaster y -> Jenc.array Jenc.int y |
| 1712 | 1712 | NullInPoormaster -> Jenc.null |
| 1713 | - IntegerMapInPoormaster y -> Jenc.dict identity Jenc.int y | |
| 1713 | + IntegerMapInPoormaster y -> makeDictEncoder identity Jenc.int y | |
| 1714 | 1714 | |
| 1715 | 1715 | potwhiskyElement : Jdec.Decoder PotwhiskyElement |
| 1716 | 1716 | potwhiskyElement = |
| @@ -1896,6 +1896,14 @@ encodeProtext x = case x of | ||
| 1896 | 1896 | |
| 1897 | 1897 | --- encoder helpers |
| 1898 | 1898 | |
| 1899 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 1900 | +makeDictEncoder f m r = | |
| 1901 | + r | |
| 1902 | + |> Dict.toList | |
| 1903 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 1904 | + |> String.join "," | |
| 1905 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 1906 | + | |
| 1899 | 1907 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 1900 | 1908 | makeNullableEncoder f m = |
| 1901 | 1909 | case m of |
Melmdefault / QuickType.elm+15 −7
| @@ -713,7 +713,7 @@ encodeQuickType x = | ||
| 713 | 713 | , ("prefreshman", Jenc.list encodePrefreshmanElement x.prefreshman) |
| 714 | 714 | , ("prehensility", Jenc.list encodePrehensility x.prehensility) |
| 715 | 715 | , ("prevoidance", Jenc.list encodePrevoidance x.prevoidance) |
| 716 | - , ("probant", Jenc.list (Jenc.dict identity (makeNullableEncoder Jenc.int)) x.probant) | |
| 716 | + , ("probant", Jenc.list (makeDictEncoder identity (makeNullableEncoder Jenc.int)) x.probant) | |
| 717 | 717 | , ("protext", Jenc.list encodeProtext x.protext) |
| 718 | 718 | ] |
| 719 | 719 | |
| @@ -788,7 +788,7 @@ kongoni = | ||
| 788 | 788 | encodeKongoni : Kongoni -> Jenc.Value |
| 789 | 789 | encodeKongoni x = case x of |
| 790 | 790 | IntegerArrayInKongoni y -> Jenc.list Jenc.int y |
| 791 | - IntegerMapInKongoni y -> Jenc.dict identity Jenc.int y | |
| 791 | + IntegerMapInKongoni y -> makeDictEncoder identity Jenc.int y | |
| 792 | 792 | |
| 793 | 793 | ladronismElement : Jdec.Decoder LadronismElement |
| 794 | 794 | ladronismElement = |
| @@ -1461,7 +1461,7 @@ paleographically = | ||
| 1461 | 1461 | encodePaleographically : Paleographically -> Jenc.Value |
| 1462 | 1462 | encodePaleographically x = case x of |
| 1463 | 1463 | DoubleInPaleographically y -> Jenc.float y |
| 1464 | - UnionMapInPaleographically y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y | |
| 1464 | + UnionMapInPaleographically y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y | |
| 1465 | 1465 | |
| 1466 | 1466 | pamphletwise : Jdec.Decoder Pamphletwise |
| 1467 | 1467 | pamphletwise = |
| @@ -1475,7 +1475,7 @@ encodePamphletwise : Pamphletwise -> Jenc.Value | ||
| 1475 | 1475 | encodePamphletwise x = case x of |
| 1476 | 1476 | IntegerInPamphletwise y -> Jenc.int y |
| 1477 | 1477 | StringInPamphletwise y -> Jenc.string y |
| 1478 | - IntegerMapInPamphletwise y -> Jenc.dict identity Jenc.int y | |
| 1478 | + IntegerMapInPamphletwise y -> makeDictEncoder identity Jenc.int y | |
| 1479 | 1479 | |
| 1480 | 1480 | pediatric : Jdec.Decoder Pediatric |
| 1481 | 1481 | pediatric = |
| @@ -1612,7 +1612,7 @@ placuntiti = | ||
| 1612 | 1612 | encodePlacuntiti : Placuntiti -> Jenc.Value |
| 1613 | 1613 | encodePlacuntiti x = case x of |
| 1614 | 1614 | IntegerInPlacuntiti y -> Jenc.int y |
| 1615 | - IntegerMapInPlacuntiti y -> Jenc.dict identity Jenc.int y | |
| 1615 | + IntegerMapInPlacuntiti y -> makeDictEncoder identity Jenc.int y | |
| 1616 | 1616 | |
| 1617 | 1617 | plectopterous : Jdec.Decoder Plectopterous |
| 1618 | 1618 | plectopterous = |
| @@ -1624,7 +1624,7 @@ plectopterous = | ||
| 1624 | 1624 | encodePlectopterous : Plectopterous -> Jenc.Value |
| 1625 | 1625 | encodePlectopterous x = case x of |
| 1626 | 1626 | DoubleInPlectopterous y -> Jenc.float y |
| 1627 | - IntegerMapInPlectopterous y -> Jenc.dict identity Jenc.int y | |
| 1627 | + IntegerMapInPlectopterous y -> makeDictEncoder identity Jenc.int y | |
| 1628 | 1628 | |
| 1629 | 1629 | pneumocele : Jdec.Decoder Pneumocele |
| 1630 | 1630 | pneumocele = |
| @@ -1709,7 +1709,7 @@ encodePoormaster : Poormaster -> Jenc.Value | ||
| 1709 | 1709 | encodePoormaster x = case x of |
| 1710 | 1710 | IntegerArrayInPoormaster y -> Jenc.list Jenc.int y |
| 1711 | 1711 | NullInPoormaster -> Jenc.null |
| 1712 | - IntegerMapInPoormaster y -> Jenc.dict identity Jenc.int y | |
| 1712 | + IntegerMapInPoormaster y -> makeDictEncoder identity Jenc.int y | |
| 1713 | 1713 | |
| 1714 | 1714 | potwhiskyElement : Jdec.Decoder PotwhiskyElement |
| 1715 | 1715 | potwhiskyElement = |
| @@ -1895,6 +1895,14 @@ encodeProtext x = case x of | ||
| 1895 | 1895 | |
| 1896 | 1896 | --- encoder helpers |
| 1897 | 1897 | |
| 1898 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 1899 | +makeDictEncoder f m r = | |
| 1900 | + r | |
| 1901 | + |> Dict.toList | |
| 1902 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 1903 | + |> String.join "," | |
| 1904 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 1905 | + | |
| 1898 | 1906 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 1899 | 1907 | makeNullableEncoder f m = |
| 1900 | 1908 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 555 | 555 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 556 | 556 | return invalidValue(l(ref || "object"), val, key, parent); |
| 557 | 557 | } |
| 558 | - const result: any = {}; | |
| 558 | + const result: any = Object.create(null); | |
| 559 | 559 | Object.getOwnPropertyNames(props).forEach(key => { |
| 560 | 560 | const prop = props[key]; |
| 561 | 561 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 566 | 566 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 567 | 567 | } |
| 568 | 568 | }); |
| 569 | - return result; | |
| 569 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | if (typ === "any") return val; |
Mflownice-property-names-true--f4d7920ee2ce / TopLevel.js+2 −2
| @@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 555 | 555 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 556 | 556 | return invalidValue(l(ref || "object"), val, key, parent); |
| 557 | 557 | } |
| 558 | - const result: any = {}; | |
| 558 | + const result: any = Object.create(null); | |
| 559 | 559 | Object.getOwnPropertyNames(props).forEach(key => { |
| 560 | 560 | const prop = props[key]; |
| 561 | 561 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 566 | 566 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 567 | 567 | } |
| 568 | 568 | }); |
| 569 | - return result; | |
| 569 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | if (typ === "any") return val; |
Mflowprefer-unions-false--a5053c0a486d / TopLevel.js+2 −2
| @@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 555 | 555 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 556 | 556 | return invalidValue(l(ref || "object"), val, key, parent); |
| 557 | 557 | } |
| 558 | - const result: any = {}; | |
| 558 | + const result: any = Object.create(null); | |
| 559 | 559 | Object.getOwnPropertyNames(props).forEach(key => { |
| 560 | 560 | const prop = props[key]; |
| 561 | 561 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 566 | 566 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 567 | 567 | } |
| 568 | 568 | }); |
| 569 | - return result; | |
| 569 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | if (typ === "any") return val; |
Mflowprefer-unknown-false--f1ab9e45d823 / TopLevel.js+2 −2
| @@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 555 | 555 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 556 | 556 | return invalidValue(l(ref || "object"), val, key, parent); |
| 557 | 557 | } |
| 558 | - const result: any = {}; | |
| 558 | + const result: any = Object.create(null); | |
| 559 | 559 | Object.getOwnPropertyNames(props).forEach(key => { |
| 560 | 560 | const prop = props[key]; |
| 561 | 561 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 566 | 566 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 567 | 567 | } |
| 568 | 568 | }); |
| 569 | - return result; | |
| 569 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | if (typ === "any") return val; |
Mflowruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+2 −2
| @@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 555 | 555 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 556 | 556 | return invalidValue(l(ref || "object"), val, key, parent); |
| 557 | 557 | } |
| 558 | - const result: any = {}; | |
| 558 | + const result: any = Object.create(null); | |
| 559 | 559 | Object.getOwnPropertyNames(props).forEach(key => { |
| 560 | 560 | const prop = props[key]; |
| 561 | 561 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 566 | 566 | result[key] = val[key]; |
| 567 | 567 | } |
| 568 | 568 | }); |
| 569 | - return result; | |
| 569 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | if (typ === "any") return val; |
Mjavascriptconverters-top-level--67aa452ed509 / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mjavascriptraw-type-any--474b307c39db / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mjavascriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = val[key]; |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptacronym-style-pascal--d9e0c1bd777a / TopLevel.ts+2 −2
| @@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 555 | 555 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 556 | 556 | return invalidValue(l(ref || "object"), val, key, parent); |
| 557 | 557 | } |
| 558 | - const result: any = {}; | |
| 558 | + const result: any = Object.create(null); | |
| 559 | 559 | Object.getOwnPropertyNames(props).forEach(key => { |
| 560 | 560 | const prop = props[key]; |
| 561 | 561 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 566 | 566 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 567 | 567 | } |
| 568 | 568 | }); |
| 569 | - return result; | |
| 569 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | if (typ === "any") return val; |
Mtypescriptconverters-all-objects--3a443babd1cb / TopLevel.ts+2 −2
| @@ -667,7 +667,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 667 | 667 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 668 | 668 | return invalidValue(l(ref || "object"), val, key, parent); |
| 669 | 669 | } |
| 670 | - const result: any = {}; | |
| 670 | + const result: any = Object.create(null); | |
| 671 | 671 | Object.getOwnPropertyNames(props).forEach(key => { |
| 672 | 672 | const prop = props[key]; |
| 673 | 673 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -678,7 +678,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 678 | 678 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 679 | 679 | } |
| 680 | 680 | }); |
| 681 | - return result; | |
| 681 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 682 | 682 | } |
| 683 | 683 | |
| 684 | 684 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 555 | 555 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 556 | 556 | return invalidValue(l(ref || "object"), val, key, parent); |
| 557 | 557 | } |
| 558 | - const result: any = {}; | |
| 558 | + const result: any = Object.create(null); | |
| 559 | 559 | Object.getOwnPropertyNames(props).forEach(key => { |
| 560 | 560 | const prop = props[key]; |
| 561 | 561 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 566 | 566 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 567 | 567 | } |
| 568 | 568 | }); |
| 569 | - return result; | |
| 569 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | if (typ === "any") return val; |
Mtypescriptnice-property-names-true--f4d7920ee2ce / TopLevel.ts+2 −2
| @@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 555 | 555 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 556 | 556 | return invalidValue(l(ref || "object"), val, key, parent); |
| 557 | 557 | } |
| 558 | - const result: any = {}; | |
| 558 | + const result: any = Object.create(null); | |
| 559 | 559 | Object.getOwnPropertyNames(props).forEach(key => { |
| 560 | 560 | const prop = props[key]; |
| 561 | 561 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 566 | 566 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 567 | 567 | } |
| 568 | 568 | }); |
| 569 | - return result; | |
| 569 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | if (typ === "any") return val; |
Mtypescriptprefer-const-values-true--6b26e4d1265c / TopLevel.ts+2 −2
| @@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 555 | 555 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 556 | 556 | return invalidValue(l(ref || "object"), val, key, parent); |
| 557 | 557 | } |
| 558 | - const result: any = {}; | |
| 558 | + const result: any = Object.create(null); | |
| 559 | 559 | Object.getOwnPropertyNames(props).forEach(key => { |
| 560 | 560 | const prop = props[key]; |
| 561 | 561 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 566 | 566 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 567 | 567 | } |
| 568 | 568 | }); |
| 569 | - return result; | |
| 569 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | if (typ === "any") return val; |
Mtypescriptprefer-types-true--df33e18681f9 / TopLevel.ts+2 −2
| @@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 555 | 555 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 556 | 556 | return invalidValue(l(ref || "object"), val, key, parent); |
| 557 | 557 | } |
| 558 | - const result: any = {}; | |
| 558 | + const result: any = Object.create(null); | |
| 559 | 559 | Object.getOwnPropertyNames(props).forEach(key => { |
| 560 | 560 | const prop = props[key]; |
| 561 | 561 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 566 | 566 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 567 | 567 | } |
| 568 | 568 | }); |
| 569 | - return result; | |
| 569 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | if (typ === "any") return val; |
Mtypescriptprefer-unions-false--a5053c0a486d / TopLevel.ts+2 −2
| @@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 555 | 555 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 556 | 556 | return invalidValue(l(ref || "object"), val, key, parent); |
| 557 | 557 | } |
| 558 | - const result: any = {}; | |
| 558 | + const result: any = Object.create(null); | |
| 559 | 559 | Object.getOwnPropertyNames(props).forEach(key => { |
| 560 | 560 | const prop = props[key]; |
| 561 | 561 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 566 | 566 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 567 | 567 | } |
| 568 | 568 | }); |
| 569 | - return result; | |
| 569 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | if (typ === "any") return val; |
Mtypescriptprefer-unknown-false--f1ab9e45d823 / TopLevel.ts+2 −2
| @@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 555 | 555 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 556 | 556 | return invalidValue(l(ref || "object"), val, key, parent); |
| 557 | 557 | } |
| 558 | - const result: any = {}; | |
| 558 | + const result: any = Object.create(null); | |
| 559 | 559 | Object.getOwnPropertyNames(props).forEach(key => { |
| 560 | 560 | const prop = props[key]; |
| 561 | 561 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 566 | 566 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 567 | 567 | } |
| 568 | 568 | }); |
| 569 | - return result; | |
| 569 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | if (typ === "any") return val; |
Mtypescriptraw-type-any--474b307c39db / TopLevel.ts+2 −2
| @@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 555 | 555 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 556 | 556 | return invalidValue(l(ref || "object"), val, key, parent); |
| 557 | 557 | } |
| 558 | - const result: any = {}; | |
| 558 | + const result: any = Object.create(null); | |
| 559 | 559 | Object.getOwnPropertyNames(props).forEach(key => { |
| 560 | 560 | const prop = props[key]; |
| 561 | 561 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 566 | 566 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 567 | 567 | } |
| 568 | 568 | }); |
| 569 | - return result; | |
| 569 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | if (typ === "any") return val; |
Mtypescriptreadonly-true--24da4fc107df / TopLevel.ts+9 −9
| @@ -48,7 +48,7 @@ export interface TopLevel { | ||
| 48 | 48 | readonly prefreshman: PrefreshmanElement[]; |
| 49 | 49 | readonly prehensility: Prehensility[]; |
| 50 | 50 | readonly prevoidance: Prevoidance[]; |
| 51 | - readonly probant: { [key: string]: number | null }[]; | |
| 51 | + readonly probant: { readonly [key: string]: number | null }[]; | |
| 52 | 52 | readonly protext: Protext[]; |
| 53 | 53 | } |
| 54 | 54 | |
| @@ -77,7 +77,7 @@ export interface JurorClass { | ||
| 77 | 77 | readonly uninhabitedness: null; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | -export type Kongoni = number[] | { [key: string]: number }; | |
| 80 | +export type Kongoni = number[] | { readonly [key: string]: number }; | |
| 81 | 81 | |
| 82 | 82 | export type LadronismElement = LadronismClass | number | string; |
| 83 | 83 | |
| @@ -323,9 +323,9 @@ export interface OutrivalClass { | ||
| 323 | 323 | readonly unpaced: null; |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | -export type Paleographically = number | { [key: string]: number | null }; | |
| 326 | +export type Paleographically = number | { readonly [key: string]: number | null }; | |
| 327 | 327 | |
| 328 | -export type Pamphletwise = number | { [key: string]: number } | string; | |
| 328 | +export type Pamphletwise = number | { readonly [key: string]: number } | string; | |
| 329 | 329 | |
| 330 | 330 | export type Pediatric = boolean | number | null; |
| 331 | 331 | |
| @@ -365,9 +365,9 @@ export type Piffler = null[] | MonaziteClass; | ||
| 365 | 365 | |
| 366 | 366 | export type Pithful = boolean | number | null; |
| 367 | 367 | |
| 368 | -export type Placuntiti = number | { [key: string]: number }; | |
| 368 | +export type Placuntiti = number | { readonly [key: string]: number }; | |
| 369 | 369 | |
| 370 | -export type Plectopterous = number | { [key: string]: number }; | |
| 370 | +export type Plectopterous = number | { readonly [key: string]: number }; | |
| 371 | 371 | |
| 372 | 372 | export interface Pneumocele { |
| 373 | 373 | readonly Carbonarism?: null; |
| @@ -399,7 +399,7 @@ export interface Pneumocele { | ||
| 399 | 399 | |
| 400 | 400 | export type Poliorcetic = boolean | MonaziteClass; |
| 401 | 401 | |
| 402 | -export type Poormaster = number[] | { [key: string]: number } | null; | |
| 402 | +export type Poormaster = number[] | { readonly [key: string]: number } | null; | |
| 403 | 403 | |
| 404 | 404 | export type PotwhiskyElement = PotwhiskyClass | number | null; |
| 405 | 405 | |
| @@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 555 | 555 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 556 | 556 | return invalidValue(l(ref || "object"), val, key, parent); |
| 557 | 557 | } |
| 558 | - const result: any = {}; | |
| 558 | + const result: any = Object.create(null); | |
| 559 | 559 | Object.getOwnPropertyNames(props).forEach(key => { |
| 560 | 560 | const prop = props[key]; |
| 561 | 561 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 566 | 566 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 567 | 567 | } |
| 568 | 568 | }); |
| 569 | - return result; | |
| 569 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | if (typ === "any") return val; |
Mtypescriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.ts+2 −2
| @@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 555 | 555 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 556 | 556 | return invalidValue(l(ref || "object"), val, key, parent); |
| 557 | 557 | } |
| 558 | - const result: any = {}; | |
| 558 | + const result: any = Object.create(null); | |
| 559 | 559 | Object.getOwnPropertyNames(props).forEach(key => { |
| 560 | 560 | const prop = props[key]; |
| 561 | 561 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -566,7 +566,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 566 | 566 | result[key] = val[key]; |
| 567 | 567 | } |
| 568 | 568 | }); |
| 569 | - return result; | |
| 569 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | if (typ === "any") return val; |
Test case
22 generated files · +89 −73test/inputs/json/priority/combinations4.json
Melmarray-type-array--eed288b23e27 / QuickType.elm+19 −11
| @@ -830,7 +830,7 @@ encodeQuickType x = | ||
| 830 | 830 | , ("untasked", Jenc.array encodeUntasked x.untasked) |
| 831 | 831 | , ("unvarying", Jenc.array encodeUnvarying x.unvarying) |
| 832 | 832 | , ("vehemently", Jenc.array encodeVehemently x.vehemently) |
| 833 | - , ("warriorship", Jenc.dict identity Jenc.bool x.warriorship) | |
| 833 | + , ("warriorship", makeDictEncoder identity Jenc.bool x.warriorship) | |
| 834 | 834 | , ("whitepot", Jenc.array encodeWhitepot x.whitepot) |
| 835 | 835 | , ("wrothy", Jenc.array encodeWrothyElement x.wrothy) |
| 836 | 836 | ] |
| @@ -1014,7 +1014,7 @@ querier = | ||
| 1014 | 1014 | encodeQuerier : Querier -> Jenc.Value |
| 1015 | 1015 | encodeQuerier x = case x of |
| 1016 | 1016 | BoolInQuerier y -> Jenc.bool y |
| 1017 | - IntegerMapInQuerier y -> Jenc.dict identity Jenc.int y | |
| 1017 | + IntegerMapInQuerier y -> makeDictEncoder identity Jenc.int y | |
| 1018 | 1018 | |
| 1019 | 1019 | rebarbative : Jdec.Decoder Rebarbative |
| 1020 | 1020 | rebarbative = |
| @@ -1312,7 +1312,7 @@ encodeSaprophilous : Saprophilous -> Jenc.Value | ||
| 1312 | 1312 | encodeSaprophilous x = case x of |
| 1313 | 1313 | NullInSaprophilous -> Jenc.null |
| 1314 | 1314 | StringInSaprophilous y -> Jenc.string y |
| 1315 | - IntegerMapInSaprophilous y -> Jenc.dict identity Jenc.int y | |
| 1315 | + IntegerMapInSaprophilous y -> makeDictEncoder identity Jenc.int y | |
| 1316 | 1316 | |
| 1317 | 1317 | saxtenElement : Jdec.Decoder SaxtenElement |
| 1318 | 1318 | saxtenElement = |
| @@ -1446,7 +1446,7 @@ encodeScoffer : Scoffer -> Jenc.Value | ||
| 1446 | 1446 | encodeScoffer x = case x of |
| 1447 | 1447 | NullArrayInScoffer y -> Jenc.array (always Jenc.null) y |
| 1448 | 1448 | NullInScoffer -> Jenc.null |
| 1449 | - IntegerMapInScoffer y -> Jenc.dict identity Jenc.int y | |
| 1449 | + IntegerMapInScoffer y -> makeDictEncoder identity Jenc.int y | |
| 1450 | 1450 | |
| 1451 | 1451 | scrampum : Jdec.Decoder Scrampum |
| 1452 | 1452 | scrampum = |
| @@ -1632,7 +1632,7 @@ encodeStimulability : Stimulability -> Jenc.Value | ||
| 1632 | 1632 | encodeStimulability x = case x of |
| 1633 | 1633 | BoolInStimulability y -> Jenc.bool y |
| 1634 | 1634 | IntegerInStimulability y -> Jenc.int y |
| 1635 | - IntegerMapInStimulability y -> Jenc.dict identity Jenc.int y | |
| 1635 | + IntegerMapInStimulability y -> makeDictEncoder identity Jenc.int y | |
| 1636 | 1636 | |
| 1637 | 1637 | strangleable : Jdec.Decoder Strangleable |
| 1638 | 1638 | strangleable = |
| @@ -1852,7 +1852,7 @@ encodeUnbeginning : Unbeginning -> Jenc.Value | ||
| 1852 | 1852 | encodeUnbeginning x = case x of |
| 1853 | 1853 | NullArrayInUnbeginning y -> Jenc.array (always Jenc.null) y |
| 1854 | 1854 | StringInUnbeginning y -> Jenc.string y |
| 1855 | - IntegerMapInUnbeginning y -> Jenc.dict identity Jenc.int y | |
| 1855 | + IntegerMapInUnbeginning y -> makeDictEncoder identity Jenc.int y | |
| 1856 | 1856 | |
| 1857 | 1857 | undesirability : Jdec.Decoder Undesirability |
| 1858 | 1858 | undesirability = |
| @@ -1866,7 +1866,7 @@ encodeUndesirability : Undesirability -> Jenc.Value | ||
| 1866 | 1866 | encodeUndesirability x = case x of |
| 1867 | 1867 | IntegerArrayInUndesirability y -> Jenc.array Jenc.int y |
| 1868 | 1868 | StringInUndesirability y -> Jenc.string y |
| 1869 | - IntegerMapInUndesirability y -> Jenc.dict identity Jenc.int y | |
| 1869 | + IntegerMapInUndesirability y -> makeDictEncoder identity Jenc.int y | |
| 1870 | 1870 | |
| 1871 | 1871 | unerasing : Jdec.Decoder Unerasing |
| 1872 | 1872 | unerasing = |
| @@ -1880,7 +1880,7 @@ encodeUnerasing : Unerasing -> Jenc.Value | ||
| 1880 | 1880 | encodeUnerasing x = case x of |
| 1881 | 1881 | NullArrayInUnerasing y -> Jenc.array (always Jenc.null) y |
| 1882 | 1882 | IntegerInUnerasing y -> Jenc.int y |
| 1883 | - IntegerMapInUnerasing y -> Jenc.dict identity Jenc.int y | |
| 1883 | + IntegerMapInUnerasing y -> makeDictEncoder identity Jenc.int y | |
| 1884 | 1884 | |
| 1885 | 1885 | unguentarium : Jdec.Decoder Unguentarium |
| 1886 | 1886 | unguentarium = |
| @@ -1979,7 +1979,7 @@ encodeUnmortgaged : Unmortgaged -> Jenc.Value | ||
| 1979 | 1979 | encodeUnmortgaged x = case x of |
| 1980 | 1980 | NullInUnmortgaged -> Jenc.null |
| 1981 | 1981 | DoubleInUnmortgaged y -> Jenc.float y |
| 1982 | - IntegerMapInUnmortgaged y -> Jenc.dict identity Jenc.int y | |
| 1982 | + IntegerMapInUnmortgaged y -> makeDictEncoder identity Jenc.int y | |
| 1983 | 1983 | |
| 1984 | 1984 | unobstructed : Jdec.Decoder Unobstructed |
| 1985 | 1985 | unobstructed = |
| @@ -2098,7 +2098,7 @@ encodeUntasked : Untasked -> Jenc.Value | ||
| 2098 | 2098 | encodeUntasked x = case x of |
| 2099 | 2099 | NullArrayInUntasked y -> Jenc.array (always Jenc.null) y |
| 2100 | 2100 | DoubleInUntasked y -> Jenc.float y |
| 2101 | - IntegerMapInUntasked y -> Jenc.dict identity Jenc.int y | |
| 2101 | + IntegerMapInUntasked y -> makeDictEncoder identity Jenc.int y | |
| 2102 | 2102 | |
| 2103 | 2103 | unvarying : Jdec.Decoder Unvarying |
| 2104 | 2104 | unvarying = |
| @@ -2112,7 +2112,7 @@ encodeUnvarying : Unvarying -> Jenc.Value | ||
| 2112 | 2112 | encodeUnvarying x = case x of |
| 2113 | 2113 | BoolInUnvarying y -> Jenc.bool y |
| 2114 | 2114 | DoubleInUnvarying y -> Jenc.float y |
| 2115 | - IntegerMapInUnvarying y -> Jenc.dict identity Jenc.int y | |
| 2115 | + IntegerMapInUnvarying y -> makeDictEncoder identity Jenc.int y | |
| 2116 | 2116 | |
| 2117 | 2117 | vehemently : Jdec.Decoder Vehemently |
| 2118 | 2118 | vehemently = |
| @@ -2203,6 +2203,14 @@ encodeWrothyClass x = | ||
| 2203 | 2203 | |
| 2204 | 2204 | --- encoder helpers |
| 2205 | 2205 | |
| 2206 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 2207 | +makeDictEncoder f m r = | |
| 2208 | + r | |
| 2209 | + |> Dict.toList | |
| 2210 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 2211 | + |> String.join "," | |
| 2212 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 2213 | + | |
| 2206 | 2214 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 2207 | 2215 | makeNullableEncoder f m = |
| 2208 | 2216 | case m of |
Melmdefault / QuickType.elm+19 −11
| @@ -829,7 +829,7 @@ encodeQuickType x = | ||
| 829 | 829 | , ("untasked", Jenc.list encodeUntasked x.untasked) |
| 830 | 830 | , ("unvarying", Jenc.list encodeUnvarying x.unvarying) |
| 831 | 831 | , ("vehemently", Jenc.list encodeVehemently x.vehemently) |
| 832 | - , ("warriorship", Jenc.dict identity Jenc.bool x.warriorship) | |
| 832 | + , ("warriorship", makeDictEncoder identity Jenc.bool x.warriorship) | |
| 833 | 833 | , ("whitepot", Jenc.list encodeWhitepot x.whitepot) |
| 834 | 834 | , ("wrothy", Jenc.list encodeWrothyElement x.wrothy) |
| 835 | 835 | ] |
| @@ -1013,7 +1013,7 @@ querier = | ||
| 1013 | 1013 | encodeQuerier : Querier -> Jenc.Value |
| 1014 | 1014 | encodeQuerier x = case x of |
| 1015 | 1015 | BoolInQuerier y -> Jenc.bool y |
| 1016 | - IntegerMapInQuerier y -> Jenc.dict identity Jenc.int y | |
| 1016 | + IntegerMapInQuerier y -> makeDictEncoder identity Jenc.int y | |
| 1017 | 1017 | |
| 1018 | 1018 | rebarbative : Jdec.Decoder Rebarbative |
| 1019 | 1019 | rebarbative = |
| @@ -1311,7 +1311,7 @@ encodeSaprophilous : Saprophilous -> Jenc.Value | ||
| 1311 | 1311 | encodeSaprophilous x = case x of |
| 1312 | 1312 | NullInSaprophilous -> Jenc.null |
| 1313 | 1313 | StringInSaprophilous y -> Jenc.string y |
| 1314 | - IntegerMapInSaprophilous y -> Jenc.dict identity Jenc.int y | |
| 1314 | + IntegerMapInSaprophilous y -> makeDictEncoder identity Jenc.int y | |
| 1315 | 1315 | |
| 1316 | 1316 | saxtenElement : Jdec.Decoder SaxtenElement |
| 1317 | 1317 | saxtenElement = |
| @@ -1445,7 +1445,7 @@ encodeScoffer : Scoffer -> Jenc.Value | ||
| 1445 | 1445 | encodeScoffer x = case x of |
| 1446 | 1446 | NullArrayInScoffer y -> Jenc.list (always Jenc.null) y |
| 1447 | 1447 | NullInScoffer -> Jenc.null |
| 1448 | - IntegerMapInScoffer y -> Jenc.dict identity Jenc.int y | |
| 1448 | + IntegerMapInScoffer y -> makeDictEncoder identity Jenc.int y | |
| 1449 | 1449 | |
| 1450 | 1450 | scrampum : Jdec.Decoder Scrampum |
| 1451 | 1451 | scrampum = |
| @@ -1631,7 +1631,7 @@ encodeStimulability : Stimulability -> Jenc.Value | ||
| 1631 | 1631 | encodeStimulability x = case x of |
| 1632 | 1632 | BoolInStimulability y -> Jenc.bool y |
| 1633 | 1633 | IntegerInStimulability y -> Jenc.int y |
| 1634 | - IntegerMapInStimulability y -> Jenc.dict identity Jenc.int y | |
| 1634 | + IntegerMapInStimulability y -> makeDictEncoder identity Jenc.int y | |
| 1635 | 1635 | |
| 1636 | 1636 | strangleable : Jdec.Decoder Strangleable |
| 1637 | 1637 | strangleable = |
| @@ -1851,7 +1851,7 @@ encodeUnbeginning : Unbeginning -> Jenc.Value | ||
| 1851 | 1851 | encodeUnbeginning x = case x of |
| 1852 | 1852 | NullArrayInUnbeginning y -> Jenc.list (always Jenc.null) y |
| 1853 | 1853 | StringInUnbeginning y -> Jenc.string y |
| 1854 | - IntegerMapInUnbeginning y -> Jenc.dict identity Jenc.int y | |
| 1854 | + IntegerMapInUnbeginning y -> makeDictEncoder identity Jenc.int y | |
| 1855 | 1855 | |
| 1856 | 1856 | undesirability : Jdec.Decoder Undesirability |
| 1857 | 1857 | undesirability = |
| @@ -1865,7 +1865,7 @@ encodeUndesirability : Undesirability -> Jenc.Value | ||
| 1865 | 1865 | encodeUndesirability x = case x of |
| 1866 | 1866 | IntegerArrayInUndesirability y -> Jenc.list Jenc.int y |
| 1867 | 1867 | StringInUndesirability y -> Jenc.string y |
| 1868 | - IntegerMapInUndesirability y -> Jenc.dict identity Jenc.int y | |
| 1868 | + IntegerMapInUndesirability y -> makeDictEncoder identity Jenc.int y | |
| 1869 | 1869 | |
| 1870 | 1870 | unerasing : Jdec.Decoder Unerasing |
| 1871 | 1871 | unerasing = |
| @@ -1879,7 +1879,7 @@ encodeUnerasing : Unerasing -> Jenc.Value | ||
| 1879 | 1879 | encodeUnerasing x = case x of |
| 1880 | 1880 | NullArrayInUnerasing y -> Jenc.list (always Jenc.null) y |
| 1881 | 1881 | IntegerInUnerasing y -> Jenc.int y |
| 1882 | - IntegerMapInUnerasing y -> Jenc.dict identity Jenc.int y | |
| 1882 | + IntegerMapInUnerasing y -> makeDictEncoder identity Jenc.int y | |
| 1883 | 1883 | |
| 1884 | 1884 | unguentarium : Jdec.Decoder Unguentarium |
| 1885 | 1885 | unguentarium = |
| @@ -1978,7 +1978,7 @@ encodeUnmortgaged : Unmortgaged -> Jenc.Value | ||
| 1978 | 1978 | encodeUnmortgaged x = case x of |
| 1979 | 1979 | NullInUnmortgaged -> Jenc.null |
| 1980 | 1980 | DoubleInUnmortgaged y -> Jenc.float y |
| 1981 | - IntegerMapInUnmortgaged y -> Jenc.dict identity Jenc.int y | |
| 1981 | + IntegerMapInUnmortgaged y -> makeDictEncoder identity Jenc.int y | |
| 1982 | 1982 | |
| 1983 | 1983 | unobstructed : Jdec.Decoder Unobstructed |
| 1984 | 1984 | unobstructed = |
| @@ -2097,7 +2097,7 @@ encodeUntasked : Untasked -> Jenc.Value | ||
| 2097 | 2097 | encodeUntasked x = case x of |
| 2098 | 2098 | NullArrayInUntasked y -> Jenc.list (always Jenc.null) y |
| 2099 | 2099 | DoubleInUntasked y -> Jenc.float y |
| 2100 | - IntegerMapInUntasked y -> Jenc.dict identity Jenc.int y | |
| 2100 | + IntegerMapInUntasked y -> makeDictEncoder identity Jenc.int y | |
| 2101 | 2101 | |
| 2102 | 2102 | unvarying : Jdec.Decoder Unvarying |
| 2103 | 2103 | unvarying = |
| @@ -2111,7 +2111,7 @@ encodeUnvarying : Unvarying -> Jenc.Value | ||
| 2111 | 2111 | encodeUnvarying x = case x of |
| 2112 | 2112 | BoolInUnvarying y -> Jenc.bool y |
| 2113 | 2113 | DoubleInUnvarying y -> Jenc.float y |
| 2114 | - IntegerMapInUnvarying y -> Jenc.dict identity Jenc.int y | |
| 2114 | + IntegerMapInUnvarying y -> makeDictEncoder identity Jenc.int y | |
| 2115 | 2115 | |
| 2116 | 2116 | vehemently : Jdec.Decoder Vehemently |
| 2117 | 2117 | vehemently = |
| @@ -2202,6 +2202,14 @@ encodeWrothyClass x = | ||
| 2202 | 2202 | |
| 2203 | 2203 | --- encoder helpers |
| 2204 | 2204 | |
| 2205 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 2206 | +makeDictEncoder f m r = | |
| 2207 | + r | |
| 2208 | + |> Dict.toList | |
| 2209 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 2210 | + |> String.join "," | |
| 2211 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 2212 | + | |
| 2205 | 2213 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 2206 | 2214 | makeNullableEncoder f m = |
| 2207 | 2215 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 625 | 625 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 626 | 626 | return invalidValue(l(ref || "object"), val, key, parent); |
| 627 | 627 | } |
| 628 | - const result: any = {}; | |
| 628 | + const result: any = Object.create(null); | |
| 629 | 629 | Object.getOwnPropertyNames(props).forEach(key => { |
| 630 | 630 | const prop = props[key]; |
| 631 | 631 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 636 | 636 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 637 | 637 | } |
| 638 | 638 | }); |
| 639 | - return result; | |
| 639 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | if (typ === "any") return val; |
Mflownice-property-names-true--f4d7920ee2ce / TopLevel.js+2 −2
| @@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 625 | 625 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 626 | 626 | return invalidValue(l(ref || "object"), val, key, parent); |
| 627 | 627 | } |
| 628 | - const result: any = {}; | |
| 628 | + const result: any = Object.create(null); | |
| 629 | 629 | Object.getOwnPropertyNames(props).forEach(key => { |
| 630 | 630 | const prop = props[key]; |
| 631 | 631 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 636 | 636 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 637 | 637 | } |
| 638 | 638 | }); |
| 639 | - return result; | |
| 639 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | if (typ === "any") return val; |
Mflowprefer-unions-false--a5053c0a486d / TopLevel.js+2 −2
| @@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 625 | 625 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 626 | 626 | return invalidValue(l(ref || "object"), val, key, parent); |
| 627 | 627 | } |
| 628 | - const result: any = {}; | |
| 628 | + const result: any = Object.create(null); | |
| 629 | 629 | Object.getOwnPropertyNames(props).forEach(key => { |
| 630 | 630 | const prop = props[key]; |
| 631 | 631 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 636 | 636 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 637 | 637 | } |
| 638 | 638 | }); |
| 639 | - return result; | |
| 639 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | if (typ === "any") return val; |
Mflowprefer-unknown-false--f1ab9e45d823 / TopLevel.js+2 −2
| @@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 625 | 625 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 626 | 626 | return invalidValue(l(ref || "object"), val, key, parent); |
| 627 | 627 | } |
| 628 | - const result: any = {}; | |
| 628 | + const result: any = Object.create(null); | |
| 629 | 629 | Object.getOwnPropertyNames(props).forEach(key => { |
| 630 | 630 | const prop = props[key]; |
| 631 | 631 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 636 | 636 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 637 | 637 | } |
| 638 | 638 | }); |
| 639 | - return result; | |
| 639 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | if (typ === "any") return val; |
Mflowruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+2 −2
| @@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 625 | 625 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 626 | 626 | return invalidValue(l(ref || "object"), val, key, parent); |
| 627 | 627 | } |
| 628 | - const result: any = {}; | |
| 628 | + const result: any = Object.create(null); | |
| 629 | 629 | Object.getOwnPropertyNames(props).forEach(key => { |
| 630 | 630 | const prop = props[key]; |
| 631 | 631 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 636 | 636 | result[key] = val[key]; |
| 637 | 637 | } |
| 638 | 638 | }); |
| 639 | - return result; | |
| 639 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | if (typ === "any") return val; |
Mjavascriptconverters-top-level--67aa452ed509 / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mjavascriptraw-type-any--474b307c39db / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mjavascriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = val[key]; |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptacronym-style-pascal--d9e0c1bd777a / TopLevel.ts+2 −2
| @@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 625 | 625 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 626 | 626 | return invalidValue(l(ref || "object"), val, key, parent); |
| 627 | 627 | } |
| 628 | - const result: any = {}; | |
| 628 | + const result: any = Object.create(null); | |
| 629 | 629 | Object.getOwnPropertyNames(props).forEach(key => { |
| 630 | 630 | const prop = props[key]; |
| 631 | 631 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 636 | 636 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 637 | 637 | } |
| 638 | 638 | }); |
| 639 | - return result; | |
| 639 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | if (typ === "any") return val; |
Mtypescriptconverters-all-objects--3a443babd1cb / TopLevel.ts+2 −2
| @@ -753,7 +753,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 753 | 753 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 754 | 754 | return invalidValue(l(ref || "object"), val, key, parent); |
| 755 | 755 | } |
| 756 | - const result: any = {}; | |
| 756 | + const result: any = Object.create(null); | |
| 757 | 757 | Object.getOwnPropertyNames(props).forEach(key => { |
| 758 | 758 | const prop = props[key]; |
| 759 | 759 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -764,7 +764,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 764 | 764 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 765 | 765 | } |
| 766 | 766 | }); |
| 767 | - return result; | |
| 767 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 768 | 768 | } |
| 769 | 769 | |
| 770 | 770 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 625 | 625 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 626 | 626 | return invalidValue(l(ref || "object"), val, key, parent); |
| 627 | 627 | } |
| 628 | - const result: any = {}; | |
| 628 | + const result: any = Object.create(null); | |
| 629 | 629 | Object.getOwnPropertyNames(props).forEach(key => { |
| 630 | 630 | const prop = props[key]; |
| 631 | 631 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 636 | 636 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 637 | 637 | } |
| 638 | 638 | }); |
| 639 | - return result; | |
| 639 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | if (typ === "any") return val; |
Mtypescriptnice-property-names-true--f4d7920ee2ce / TopLevel.ts+2 −2
| @@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 625 | 625 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 626 | 626 | return invalidValue(l(ref || "object"), val, key, parent); |
| 627 | 627 | } |
| 628 | - const result: any = {}; | |
| 628 | + const result: any = Object.create(null); | |
| 629 | 629 | Object.getOwnPropertyNames(props).forEach(key => { |
| 630 | 630 | const prop = props[key]; |
| 631 | 631 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 636 | 636 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 637 | 637 | } |
| 638 | 638 | }); |
| 639 | - return result; | |
| 639 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | if (typ === "any") return val; |
Mtypescriptprefer-const-values-true--6b26e4d1265c / TopLevel.ts+2 −2
| @@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 625 | 625 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 626 | 626 | return invalidValue(l(ref || "object"), val, key, parent); |
| 627 | 627 | } |
| 628 | - const result: any = {}; | |
| 628 | + const result: any = Object.create(null); | |
| 629 | 629 | Object.getOwnPropertyNames(props).forEach(key => { |
| 630 | 630 | const prop = props[key]; |
| 631 | 631 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 636 | 636 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 637 | 637 | } |
| 638 | 638 | }); |
| 639 | - return result; | |
| 639 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | if (typ === "any") return val; |
Mtypescriptprefer-types-true--df33e18681f9 / TopLevel.ts+2 −2
| @@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 625 | 625 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 626 | 626 | return invalidValue(l(ref || "object"), val, key, parent); |
| 627 | 627 | } |
| 628 | - const result: any = {}; | |
| 628 | + const result: any = Object.create(null); | |
| 629 | 629 | Object.getOwnPropertyNames(props).forEach(key => { |
| 630 | 630 | const prop = props[key]; |
| 631 | 631 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 636 | 636 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 637 | 637 | } |
| 638 | 638 | }); |
| 639 | - return result; | |
| 639 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | if (typ === "any") return val; |
Mtypescriptprefer-unions-false--a5053c0a486d / TopLevel.ts+2 −2
| @@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 625 | 625 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 626 | 626 | return invalidValue(l(ref || "object"), val, key, parent); |
| 627 | 627 | } |
| 628 | - const result: any = {}; | |
| 628 | + const result: any = Object.create(null); | |
| 629 | 629 | Object.getOwnPropertyNames(props).forEach(key => { |
| 630 | 630 | const prop = props[key]; |
| 631 | 631 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 636 | 636 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 637 | 637 | } |
| 638 | 638 | }); |
| 639 | - return result; | |
| 639 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | if (typ === "any") return val; |
Mtypescriptprefer-unknown-false--f1ab9e45d823 / TopLevel.ts+2 −2
| @@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 625 | 625 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 626 | 626 | return invalidValue(l(ref || "object"), val, key, parent); |
| 627 | 627 | } |
| 628 | - const result: any = {}; | |
| 628 | + const result: any = Object.create(null); | |
| 629 | 629 | Object.getOwnPropertyNames(props).forEach(key => { |
| 630 | 630 | const prop = props[key]; |
| 631 | 631 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 636 | 636 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 637 | 637 | } |
| 638 | 638 | }); |
| 639 | - return result; | |
| 639 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | if (typ === "any") return val; |
Mtypescriptraw-type-any--474b307c39db / TopLevel.ts+2 −2
| @@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 625 | 625 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 626 | 626 | return invalidValue(l(ref || "object"), val, key, parent); |
| 627 | 627 | } |
| 628 | - const result: any = {}; | |
| 628 | + const result: any = Object.create(null); | |
| 629 | 629 | Object.getOwnPropertyNames(props).forEach(key => { |
| 630 | 630 | const prop = props[key]; |
| 631 | 631 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 636 | 636 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 637 | 637 | } |
| 638 | 638 | }); |
| 639 | - return result; | |
| 639 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | if (typ === "any") return val; |
Mtypescriptreadonly-true--24da4fc107df / TopLevel.ts+13 −13
| @@ -57,7 +57,7 @@ export interface TopLevel { | ||
| 57 | 57 | readonly untasked: Untasked[]; |
| 58 | 58 | readonly unvarying: Unvarying[]; |
| 59 | 59 | readonly vehemently: Vehemently[]; |
| 60 | - readonly warriorship: { [key: string]: boolean }; | |
| 60 | + readonly warriorship: { readonly [key: string]: boolean }; | |
| 61 | 61 | readonly whitepot: Whitepot[]; |
| 62 | 62 | readonly wrothy: WrothyElement[]; |
| 63 | 63 | } |
| @@ -124,7 +124,7 @@ export interface QuebrachineClass { | ||
| 124 | 124 | readonly nonbookish: null; |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | -export type Querier = boolean | { [key: string]: number }; | |
| 127 | +export type Querier = boolean | { readonly [key: string]: number }; | |
| 128 | 128 | |
| 129 | 129 | export type Rebarbative = number[] | boolean | number; |
| 130 | 130 | |
| @@ -235,7 +235,7 @@ export interface SantirClass { | ||
| 235 | 235 | readonly vorticular: null; |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | -export type Saprophilous = { [key: string]: number } | null | string; | |
| 238 | +export type Saprophilous = { readonly [key: string]: number } | null | string; | |
| 239 | 239 | |
| 240 | 240 | export type SaxtenElement = SaxtenClass | string; |
| 241 | 241 | |
| @@ -290,7 +290,7 @@ export interface Scatty { | ||
| 290 | 290 | readonly uncombated: null; |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | -export type Scoffer = null[] | { [key: string]: number } | null; | |
| 293 | +export type Scoffer = null[] | { readonly [key: string]: number } | null; | |
| 294 | 294 | |
| 295 | 295 | export type Scrampum = number[] | boolean | null; |
| 296 | 296 | |
| @@ -353,7 +353,7 @@ export interface Staghunting { | ||
| 353 | 353 | |
| 354 | 354 | export type Stagmometer = (number | null)[] | string; |
| 355 | 355 | |
| 356 | -export type Stimulability = boolean | number | { [key: string]: number }; | |
| 356 | +export type Stimulability = boolean | number | { readonly [key: string]: number }; | |
| 357 | 357 | |
| 358 | 358 | export type Strangleable = null[] | number; |
| 359 | 359 | |
| @@ -425,11 +425,11 @@ export interface TruantcyClass { | ||
| 425 | 425 | readonly windwaywardly?: null; |
| 426 | 426 | } |
| 427 | 427 | |
| 428 | -export type Unbeginning = null[] | { [key: string]: number } | string; | |
| 428 | +export type Unbeginning = null[] | { readonly [key: string]: number } | string; | |
| 429 | 429 | |
| 430 | -export type Undesirability = number[] | { [key: string]: number } | string; | |
| 430 | +export type Undesirability = number[] | { readonly [key: string]: number } | string; | |
| 431 | 431 | |
| 432 | -export type Unerasing = null[] | number | { [key: string]: number }; | |
| 432 | +export type Unerasing = null[] | number | { readonly [key: string]: number }; | |
| 433 | 433 | |
| 434 | 434 | export type Unguentarium = null[] | number | null; |
| 435 | 435 | |
| @@ -463,7 +463,7 @@ export interface UnimpeachablyClass { | ||
| 463 | 463 | readonly unsuggestedness?: number; |
| 464 | 464 | } |
| 465 | 465 | |
| 466 | -export type Unmortgaged = number | { [key: string]: number } | null; | |
| 466 | +export type Unmortgaged = number | { readonly [key: string]: number } | null; | |
| 467 | 467 | |
| 468 | 468 | export type Unobstructed = QuebrachineClass | number | null; |
| 469 | 469 | |
| @@ -496,9 +496,9 @@ export interface UnstressedClass { | ||
| 496 | 496 | readonly vowellessness: null; |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | -export type Untasked = null[] | number | { [key: string]: number }; | |
| 499 | +export type Untasked = null[] | number | { readonly [key: string]: number }; | |
| 500 | 500 | |
| 501 | -export type Unvarying = boolean | number | { [key: string]: number }; | |
| 501 | +export type Unvarying = boolean | number | { readonly [key: string]: number }; | |
| 502 | 502 | |
| 503 | 503 | export type Vehemently = null[] | boolean | null; |
| 504 | 504 | |
| @@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 625 | 625 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 626 | 626 | return invalidValue(l(ref || "object"), val, key, parent); |
| 627 | 627 | } |
| 628 | - const result: any = {}; | |
| 628 | + const result: any = Object.create(null); | |
| 629 | 629 | Object.getOwnPropertyNames(props).forEach(key => { |
| 630 | 630 | const prop = props[key]; |
| 631 | 631 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 636 | 636 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 637 | 637 | } |
| 638 | 638 | }); |
| 639 | - return result; | |
| 639 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | if (typ === "any") return val; |
Mtypescriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.ts+2 −2
| @@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 625 | 625 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 626 | 626 | return invalidValue(l(ref || "object"), val, key, parent); |
| 627 | 627 | } |
| 628 | - const result: any = {}; | |
| 628 | + const result: any = Object.create(null); | |
| 629 | 629 | Object.getOwnPropertyNames(props).forEach(key => { |
| 630 | 630 | const prop = props[key]; |
| 631 | 631 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -636,7 +636,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 636 | 636 | result[key] = val[key]; |
| 637 | 637 | } |
| 638 | 638 | }); |
| 639 | - return result; | |
| 639 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/combined-enum.json
Mflowdefault / TopLevel.js+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/direct-recursive.json
Mflowdefault / TopLevel.js+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/empty-enum.json
Mflowdefault / TopLevel.js+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/identifiers.json
Mflowdefault / TopLevel.js+2 −2
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 139 | 139 | return invalidValue(l(ref || "object"), val, key, parent); |
| 140 | 140 | } |
| 141 | - const result: any = {}; | |
| 141 | + const result: any = Object.create(null); | |
| 142 | 142 | Object.getOwnPropertyNames(props).forEach(key => { |
| 143 | 143 | const prop = props[key]; |
| 144 | 144 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 149 | 149 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 150 | 150 | } |
| 151 | 151 | }); |
| 152 | - return result; | |
| 152 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 136 | 136 | return invalidValue(l(ref || "object"), val, key, parent); |
| 137 | 137 | } |
| 138 | - const result: any = {}; | |
| 138 | + const result: any = Object.create(null); | |
| 139 | 139 | Object.getOwnPropertyNames(props).forEach(key => { |
| 140 | 140 | const prop = props[key]; |
| 141 | 141 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 146 | 146 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 147 | 147 | } |
| 148 | 148 | }); |
| 149 | - return result; | |
| 149 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/issue2680-object-array.json
Mflowdefault / TopLevel.js+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/issue2680-scalar-array.json
Mflowdefault / TopLevel.js+2 −2
| @@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 105 | 105 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 106 | 106 | return invalidValue(l(ref || "object"), val, key, parent); |
| 107 | 107 | } |
| 108 | - const result: any = {}; | |
| 108 | + const result: any = Object.create(null); | |
| 109 | 109 | Object.getOwnPropertyNames(props).forEach(key => { |
| 110 | 110 | const prop = props[key]; |
| 111 | 111 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 117 | 117 | } |
| 118 | 118 | }); |
| 119 | - return result; | |
| 119 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 105 | 105 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 106 | 106 | return invalidValue(l(ref || "object"), val, key, parent); |
| 107 | 107 | } |
| 108 | - const result: any = {}; | |
| 108 | + const result: any = Object.create(null); | |
| 109 | 109 | Object.getOwnPropertyNames(props).forEach(key => { |
| 110 | 110 | const prop = props[key]; |
| 111 | 111 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 117 | 117 | } |
| 118 | 118 | }); |
| 119 | - return result; | |
| 119 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | if (typ === "any") return val; |
Test case
62 generated files · +7,994 −4,394test/inputs/json/priority/keywords.json
Mcjsondefault / TopLevel.c+577 −317
| @@ -6483,6 +6483,61 @@ void cJSON_DeleteFrom(struct From * x) { | ||
| 6483 | 6483 | } |
| 6484 | 6484 | } |
| 6485 | 6485 | |
| 6486 | +struct FromDict * cJSON_ParseFromDict(const char * s) { | |
| 6487 | + struct FromDict * x = NULL; | |
| 6488 | + if (NULL != s) { | |
| 6489 | + cJSON * j = cJSON_Parse(s); | |
| 6490 | + if (NULL != j) { | |
| 6491 | + x = cJSON_GetFromDictValue(j); | |
| 6492 | + cJSON_Delete(j); | |
| 6493 | + } | |
| 6494 | + } | |
| 6495 | + return x; | |
| 6496 | +} | |
| 6497 | + | |
| 6498 | +struct FromDict * cJSON_GetFromDictValue(const cJSON * j) { | |
| 6499 | + struct FromDict * x = NULL; | |
| 6500 | + if (NULL != j) { | |
| 6501 | + if (NULL != (x = cJSON_malloc(sizeof(struct FromDict)))) { | |
| 6502 | + memset(x, 0, sizeof(struct FromDict)); | |
| 6503 | + if (!cJSON_HasObjectItem(j, "from_dict")) { cJSON_DeleteFromDict(x); return NULL; } | |
| 6504 | + if (cJSON_HasObjectItem(j, "from_dict")) { | |
| 6505 | + if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "from_dict"))) { cJSON_DeleteFromDict(x); return NULL; } | |
| 6506 | + x->from_dict = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "from_dict")); | |
| 6507 | + } | |
| 6508 | + } | |
| 6509 | + } | |
| 6510 | + return x; | |
| 6511 | +} | |
| 6512 | + | |
| 6513 | +cJSON * cJSON_CreateFromDict(const struct FromDict * x) { | |
| 6514 | + cJSON * j = NULL; | |
| 6515 | + if (NULL != x) { | |
| 6516 | + if (NULL != (j = cJSON_CreateObject())) { | |
| 6517 | + cJSON_AddNumberToObject(j, "from_dict", x->from_dict); | |
| 6518 | + } | |
| 6519 | + } | |
| 6520 | + return j; | |
| 6521 | +} | |
| 6522 | + | |
| 6523 | +char * cJSON_PrintFromDict(const struct FromDict * x) { | |
| 6524 | + char * s = NULL; | |
| 6525 | + if (NULL != x) { | |
| 6526 | + cJSON * j = cJSON_CreateFromDict(x); | |
| 6527 | + if (NULL != j) { | |
| 6528 | + s = cJSON_Print(j); | |
| 6529 | + cJSON_Delete(j); | |
| 6530 | + } | |
| 6531 | + } | |
| 6532 | + return s; | |
| 6533 | +} | |
| 6534 | + | |
| 6535 | +void cJSON_DeleteFromDict(struct FromDict * x) { | |
| 6536 | + if (NULL != x) { | |
| 6537 | + cJSON_free(x); | |
| 6538 | + } | |
| 6539 | +} | |
| 6540 | + | |
| 6486 | 6541 | struct FromJson * cJSON_ParseFromJson(const char * s) { |
| 6487 | 6542 | struct FromJson * x = NULL; |
| 6488 | 6543 | if (NULL != s) { |
| @@ -7693,61 +7748,6 @@ void cJSON_DeleteFriend(struct Friend * x) { | ||
| 7693 | 7748 | } |
| 7694 | 7749 | } |
| 7695 | 7750 | |
| 7696 | -struct Goto * cJSON_ParseGoto(const char * s) { | |
| 7697 | - struct Goto * x = NULL; | |
| 7698 | - if (NULL != s) { | |
| 7699 | - cJSON * j = cJSON_Parse(s); | |
| 7700 | - if (NULL != j) { | |
| 7701 | - x = cJSON_GetGotoValue(j); | |
| 7702 | - cJSON_Delete(j); | |
| 7703 | - } | |
| 7704 | - } | |
| 7705 | - return x; | |
| 7706 | -} | |
| 7707 | - | |
| 7708 | -struct Goto * cJSON_GetGotoValue(const cJSON * j) { | |
| 7709 | - struct Goto * x = NULL; | |
| 7710 | - if (NULL != j) { | |
| 7711 | - if (NULL != (x = cJSON_malloc(sizeof(struct Goto)))) { | |
| 7712 | - memset(x, 0, sizeof(struct Goto)); | |
| 7713 | - if (!cJSON_HasObjectItem(j, "goto")) { cJSON_DeleteGoto(x); return NULL; } | |
| 7714 | - if (cJSON_HasObjectItem(j, "goto")) { | |
| 7715 | - if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "goto"))) { cJSON_DeleteGoto(x); return NULL; } | |
| 7716 | - x->goto_goto = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "goto")); | |
| 7717 | - } | |
| 7718 | - } | |
| 7719 | - } | |
| 7720 | - return x; | |
| 7721 | -} | |
| 7722 | - | |
| 7723 | -cJSON * cJSON_CreateGoto(const struct Goto * x) { | |
| 7724 | - cJSON * j = NULL; | |
| 7725 | - if (NULL != x) { | |
| 7726 | - if (NULL != (j = cJSON_CreateObject())) { | |
| 7727 | - cJSON_AddNumberToObject(j, "goto", x->goto_goto); | |
| 7728 | - } | |
| 7729 | - } | |
| 7730 | - return j; | |
| 7731 | -} | |
| 7732 | - | |
| 7733 | -char * cJSON_PrintGoto(const struct Goto * x) { | |
| 7734 | - char * s = NULL; | |
| 7735 | - if (NULL != x) { | |
| 7736 | - cJSON * j = cJSON_CreateGoto(x); | |
| 7737 | - if (NULL != j) { | |
| 7738 | - s = cJSON_Print(j); | |
| 7739 | - cJSON_Delete(j); | |
| 7740 | - } | |
| 7741 | - } | |
| 7742 | - return s; | |
| 7743 | -} | |
| 7744 | - | |
| 7745 | -void cJSON_DeleteGoto(struct Goto * x) { | |
| 7746 | - if (NULL != x) { | |
| 7747 | - cJSON_free(x); | |
| 7748 | - } | |
| 7749 | -} | |
| 7750 | - | |
| 7751 | 7751 | struct Obj2False * cJSON_ParseObj2False(const char * s) { |
| 7752 | 7752 | struct Obj2False * x = NULL; |
| 7753 | 7753 | if (NULL != s) { |
| @@ -8065,6 +8065,12 @@ struct Obj2 * cJSON_GetObj2Value(const cJSON * j) { | ||
| 8065 | 8065 | x->from = cJSON_GetFromValue(cJSON_GetObjectItemCaseSensitive(j, "from")); |
| 8066 | 8066 | if (NULL == x->from) { cJSON_DeleteObj2(x); return NULL; } |
| 8067 | 8067 | } |
| 8068 | + if (!cJSON_HasObjectItem(j, "from_dict")) { cJSON_DeleteObj2(x); return NULL; } | |
| 8069 | + if (cJSON_HasObjectItem(j, "from_dict")) { | |
| 8070 | + if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "from_dict"))) { cJSON_DeleteObj2(x); return NULL; } | |
| 8071 | + x->from_dict = cJSON_GetFromDictValue(cJSON_GetObjectItemCaseSensitive(j, "from_dict")); | |
| 8072 | + if (NULL == x->from_dict) { cJSON_DeleteObj2(x); return NULL; } | |
| 8073 | + } | |
| 8068 | 8074 | if (!cJSON_HasObjectItem(j, "from_json")) { cJSON_DeleteObj2(x); return NULL; } |
| 8069 | 8075 | if (cJSON_HasObjectItem(j, "from_json")) { |
| 8070 | 8076 | if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "from_json"))) { cJSON_DeleteObj2(x); return NULL; } |
| @@ -8197,12 +8203,6 @@ struct Obj2 * cJSON_GetObj2Value(const cJSON * j) { | ||
| 8197 | 8203 | x->obj2_friend = cJSON_GetFriendValue(cJSON_GetObjectItemCaseSensitive(j, "friend")); |
| 8198 | 8204 | if (NULL == x->obj2_friend) { cJSON_DeleteObj2(x); return NULL; } |
| 8199 | 8205 | } |
| 8200 | - if (!cJSON_HasObjectItem(j, "goto")) { cJSON_DeleteObj2(x); return NULL; } | |
| 8201 | - if (cJSON_HasObjectItem(j, "goto")) { | |
| 8202 | - if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "goto"))) { cJSON_DeleteObj2(x); return NULL; } | |
| 8203 | - x->obj2_goto = cJSON_GetGotoValue(cJSON_GetObjectItemCaseSensitive(j, "goto")); | |
| 8204 | - if (NULL == x->obj2_goto) { cJSON_DeleteObj2(x); return NULL; } | |
| 8205 | - } | |
| 8206 | 8206 | if (!cJSON_HasObjectItem(j, "false")) { cJSON_DeleteObj2(x); return NULL; } |
| 8207 | 8207 | if (cJSON_HasObjectItem(j, "false")) { |
| 8208 | 8208 | if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "false"))) { cJSON_DeleteObj2(x); return NULL; } |
| @@ -8259,6 +8259,7 @@ cJSON * cJSON_CreateObj2(const struct Obj2 * x) { | ||
| 8259 | 8259 | cJSON_AddItemToObject(j, "foreach", cJSON_CreateForeach(x->foreach)); |
| 8260 | 8260 | cJSON_AddItemToObject(j, "FormatException", cJSON_CreateFormatException(x->format_exception)); |
| 8261 | 8261 | cJSON_AddItemToObject(j, "from", cJSON_CreateFrom(x->from)); |
| 8262 | + cJSON_AddItemToObject(j, "from_dict", cJSON_CreateFromDict(x->from_dict)); | |
| 8262 | 8263 | cJSON_AddItemToObject(j, "from_json", cJSON_CreateFromJson(x->from_json)); |
| 8263 | 8264 | cJSON_AddItemToObject(j, "func", cJSON_CreateFunc(x->func)); |
| 8264 | 8265 | cJSON_AddItemToObject(j, "function", cJSON_CreateFunction(x->function)); |
| @@ -8281,7 +8282,6 @@ cJSON * cJSON_CreateObj2(const struct Obj2 * x) { | ||
| 8281 | 8282 | cJSON_AddItemToObject(j, "float", cJSON_CreateFloat(x->obj2_float)); |
| 8282 | 8283 | cJSON_AddItemToObject(j, "for", cJSON_CreateFor(x->obj2_for)); |
| 8283 | 8284 | cJSON_AddItemToObject(j, "friend", cJSON_CreateFriend(x->obj2_friend)); |
| 8284 | - cJSON_AddItemToObject(j, "goto", cJSON_CreateGoto(x->obj2_goto)); | |
| 8285 | 8285 | cJSON_AddItemToObject(j, "false", cJSON_CreateObj2False(x->purple_false)); |
| 8286 | 8286 | } |
| 8287 | 8287 | } |
| @@ -8422,6 +8422,9 @@ void cJSON_DeleteObj2(struct Obj2 * x) { | ||
| 8422 | 8422 | if (NULL != x->from) { |
| 8423 | 8423 | cJSON_DeleteFrom(x->from); |
| 8424 | 8424 | } |
| 8425 | + if (NULL != x->from_dict) { | |
| 8426 | + cJSON_DeleteFromDict(x->from_dict); | |
| 8427 | + } | |
| 8425 | 8428 | if (NULL != x->from_json) { |
| 8426 | 8429 | cJSON_DeleteFromJson(x->from_json); |
| 8427 | 8430 | } |
| @@ -8488,9 +8491,6 @@ void cJSON_DeleteObj2(struct Obj2 * x) { | ||
| 8488 | 8491 | if (NULL != x->obj2_friend) { |
| 8489 | 8492 | cJSON_DeleteFriend(x->obj2_friend); |
| 8490 | 8493 | } |
| 8491 | - if (NULL != x->obj2_goto) { | |
| 8492 | - cJSON_DeleteGoto(x->obj2_goto); | |
| 8493 | - } | |
| 8494 | 8494 | if (NULL != x->purple_false) { |
| 8495 | 8495 | cJSON_DeleteObj2False(x->purple_false); |
| 8496 | 8496 | } |
| @@ -11141,6 +11141,61 @@ void cJSON_DeleteMapEntry(struct MapEntry * x) { | ||
| 11141 | 11141 | } |
| 11142 | 11142 | } |
| 11143 | 11143 | |
| 11144 | +struct MarshalJson * cJSON_ParseMarshalJson(const char * s) { | |
| 11145 | + struct MarshalJson * x = NULL; | |
| 11146 | + if (NULL != s) { | |
| 11147 | + cJSON * j = cJSON_Parse(s); | |
| 11148 | + if (NULL != j) { | |
| 11149 | + x = cJSON_GetMarshalJsonValue(j); | |
| 11150 | + cJSON_Delete(j); | |
| 11151 | + } | |
| 11152 | + } | |
| 11153 | + return x; | |
| 11154 | +} | |
| 11155 | + | |
| 11156 | +struct MarshalJson * cJSON_GetMarshalJsonValue(const cJSON * j) { | |
| 11157 | + struct MarshalJson * x = NULL; | |
| 11158 | + if (NULL != j) { | |
| 11159 | + if (NULL != (x = cJSON_malloc(sizeof(struct MarshalJson)))) { | |
| 11160 | + memset(x, 0, sizeof(struct MarshalJson)); | |
| 11161 | + if (!cJSON_HasObjectItem(j, "MarshalJSON")) { cJSON_DeleteMarshalJson(x); return NULL; } | |
| 11162 | + if (cJSON_HasObjectItem(j, "MarshalJSON")) { | |
| 11163 | + if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "MarshalJSON"))) { cJSON_DeleteMarshalJson(x); return NULL; } | |
| 11164 | + x->marshal_json = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "MarshalJSON")); | |
| 11165 | + } | |
| 11166 | + } | |
| 11167 | + } | |
| 11168 | + return x; | |
| 11169 | +} | |
| 11170 | + | |
| 11171 | +cJSON * cJSON_CreateMarshalJson(const struct MarshalJson * x) { | |
| 11172 | + cJSON * j = NULL; | |
| 11173 | + if (NULL != x) { | |
| 11174 | + if (NULL != (j = cJSON_CreateObject())) { | |
| 11175 | + cJSON_AddNumberToObject(j, "MarshalJSON", x->marshal_json); | |
| 11176 | + } | |
| 11177 | + } | |
| 11178 | + return j; | |
| 11179 | +} | |
| 11180 | + | |
| 11181 | +char * cJSON_PrintMarshalJson(const struct MarshalJson * x) { | |
| 11182 | + char * s = NULL; | |
| 11183 | + if (NULL != x) { | |
| 11184 | + cJSON * j = cJSON_CreateMarshalJson(x); | |
| 11185 | + if (NULL != j) { | |
| 11186 | + s = cJSON_Print(j); | |
| 11187 | + cJSON_Delete(j); | |
| 11188 | + } | |
| 11189 | + } | |
| 11190 | + return s; | |
| 11191 | +} | |
| 11192 | + | |
| 11193 | +void cJSON_DeleteMarshalJson(struct MarshalJson * x) { | |
| 11194 | + if (NULL != x) { | |
| 11195 | + cJSON_free(x); | |
| 11196 | + } | |
| 11197 | +} | |
| 11198 | + | |
| 11144 | 11199 | struct MetadataPropertyHandling * cJSON_ParseMetadataPropertyHandling(const char * s) { |
| 11145 | 11200 | struct MetadataPropertyHandling * x = NULL; |
| 11146 | 11201 | if (NULL != s) { |
| @@ -11471,6 +11526,61 @@ void cJSON_DeleteNo(struct No * x) { | ||
| 11471 | 11526 | } |
| 11472 | 11527 | } |
| 11473 | 11528 | |
| 11529 | +struct Goto * cJSON_ParseGoto(const char * s) { | |
| 11530 | + struct Goto * x = NULL; | |
| 11531 | + if (NULL != s) { | |
| 11532 | + cJSON * j = cJSON_Parse(s); | |
| 11533 | + if (NULL != j) { | |
| 11534 | + x = cJSON_GetGotoValue(j); | |
| 11535 | + cJSON_Delete(j); | |
| 11536 | + } | |
| 11537 | + } | |
| 11538 | + return x; | |
| 11539 | +} | |
| 11540 | + | |
| 11541 | +struct Goto * cJSON_GetGotoValue(const cJSON * j) { | |
| 11542 | + struct Goto * x = NULL; | |
| 11543 | + if (NULL != j) { | |
| 11544 | + if (NULL != (x = cJSON_malloc(sizeof(struct Goto)))) { | |
| 11545 | + memset(x, 0, sizeof(struct Goto)); | |
| 11546 | + if (!cJSON_HasObjectItem(j, "goto")) { cJSON_DeleteGoto(x); return NULL; } | |
| 11547 | + if (cJSON_HasObjectItem(j, "goto")) { | |
| 11548 | + if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "goto"))) { cJSON_DeleteGoto(x); return NULL; } | |
| 11549 | + x->goto_goto = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "goto")); | |
| 11550 | + } | |
| 11551 | + } | |
| 11552 | + } | |
| 11553 | + return x; | |
| 11554 | +} | |
| 11555 | + | |
| 11556 | +cJSON * cJSON_CreateGoto(const struct Goto * x) { | |
| 11557 | + cJSON * j = NULL; | |
| 11558 | + if (NULL != x) { | |
| 11559 | + if (NULL != (j = cJSON_CreateObject())) { | |
| 11560 | + cJSON_AddNumberToObject(j, "goto", x->goto_goto); | |
| 11561 | + } | |
| 11562 | + } | |
| 11563 | + return j; | |
| 11564 | +} | |
| 11565 | + | |
| 11566 | +char * cJSON_PrintGoto(const struct Goto * x) { | |
| 11567 | + char * s = NULL; | |
| 11568 | + if (NULL != x) { | |
| 11569 | + cJSON * j = cJSON_CreateGoto(x); | |
| 11570 | + if (NULL != j) { | |
| 11571 | + s = cJSON_Print(j); | |
| 11572 | + cJSON_Delete(j); | |
| 11573 | + } | |
| 11574 | + } | |
| 11575 | + return s; | |
| 11576 | +} | |
| 11577 | + | |
| 11578 | +void cJSON_DeleteGoto(struct Goto * x) { | |
| 11579 | + if (NULL != x) { | |
| 11580 | + cJSON_free(x); | |
| 11581 | + } | |
| 11582 | +} | |
| 11583 | + | |
| 11474 | 11584 | struct If * cJSON_ParseIf(const char * s) { |
| 11475 | 11585 | struct If * x = NULL; |
| 11476 | 11586 | if (NULL != s) { |
| @@ -11966,61 +12076,6 @@ void cJSON_DeleteNew(struct New * x) { | ||
| 11966 | 12076 | } |
| 11967 | 12077 | } |
| 11968 | 12078 | |
| 11969 | -struct Noexcept * cJSON_ParseNoexcept(const char * s) { | |
| 11970 | - struct Noexcept * x = NULL; | |
| 11971 | - if (NULL != s) { | |
| 11972 | - cJSON * j = cJSON_Parse(s); | |
| 11973 | - if (NULL != j) { | |
| 11974 | - x = cJSON_GetNoexceptValue(j); | |
| 11975 | - cJSON_Delete(j); | |
| 11976 | - } | |
| 11977 | - } | |
| 11978 | - return x; | |
| 11979 | -} | |
| 11980 | - | |
| 11981 | -struct Noexcept * cJSON_GetNoexceptValue(const cJSON * j) { | |
| 11982 | - struct Noexcept * x = NULL; | |
| 11983 | - if (NULL != j) { | |
| 11984 | - if (NULL != (x = cJSON_malloc(sizeof(struct Noexcept)))) { | |
| 11985 | - memset(x, 0, sizeof(struct Noexcept)); | |
| 11986 | - if (!cJSON_HasObjectItem(j, "noexcept")) { cJSON_DeleteNoexcept(x); return NULL; } | |
| 11987 | - if (cJSON_HasObjectItem(j, "noexcept")) { | |
| 11988 | - if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "noexcept"))) { cJSON_DeleteNoexcept(x); return NULL; } | |
| 11989 | - x->noexcept_noexcept = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "noexcept")); | |
| 11990 | - } | |
| 11991 | - } | |
| 11992 | - } | |
| 11993 | - return x; | |
| 11994 | -} | |
| 11995 | - | |
| 11996 | -cJSON * cJSON_CreateNoexcept(const struct Noexcept * x) { | |
| 11997 | - cJSON * j = NULL; | |
| 11998 | - if (NULL != x) { | |
| 11999 | - if (NULL != (j = cJSON_CreateObject())) { | |
| 12000 | - cJSON_AddNumberToObject(j, "noexcept", x->noexcept_noexcept); | |
| 12001 | - } | |
| 12002 | - } | |
| 12003 | - return j; | |
| 12004 | -} | |
| 12005 | - | |
| 12006 | -char * cJSON_PrintNoexcept(const struct Noexcept * x) { | |
| 12007 | - char * s = NULL; | |
| 12008 | - if (NULL != x) { | |
| 12009 | - cJSON * j = cJSON_CreateNoexcept(x); | |
| 12010 | - if (NULL != j) { | |
| 12011 | - s = cJSON_Print(j); | |
| 12012 | - cJSON_Delete(j); | |
| 12013 | - } | |
| 12014 | - } | |
| 12015 | - return s; | |
| 12016 | -} | |
| 12017 | - | |
| 12018 | -void cJSON_DeleteNoexcept(struct Noexcept * x) { | |
| 12019 | - if (NULL != x) { | |
| 12020 | - cJSON_free(x); | |
| 12021 | - } | |
| 12022 | -} | |
| 12023 | - | |
| 12024 | 12079 | struct Obj3 * cJSON_ParseObj3(const char * s) { |
| 12025 | 12080 | struct Obj3 * x = NULL; |
| 12026 | 12081 | if (NULL != s) { |
| @@ -12331,6 +12386,12 @@ struct Obj3 * cJSON_GetObj3Value(const cJSON * j) { | ||
| 12331 | 12386 | x->map_entry = cJSON_GetMapEntryValue(cJSON_GetObjectItemCaseSensitive(j, "MapEntry")); |
| 12332 | 12387 | if (NULL == x->map_entry) { cJSON_DeleteObj3(x); return NULL; } |
| 12333 | 12388 | } |
| 12389 | + if (!cJSON_HasObjectItem(j, "MarshalJSON")) { cJSON_DeleteObj3(x); return NULL; } | |
| 12390 | + if (cJSON_HasObjectItem(j, "MarshalJSON")) { | |
| 12391 | + if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "MarshalJSON"))) { cJSON_DeleteObj3(x); return NULL; } | |
| 12392 | + x->marshal_json = cJSON_GetMarshalJsonValue(cJSON_GetObjectItemCaseSensitive(j, "MarshalJSON")); | |
| 12393 | + if (NULL == x->marshal_json) { cJSON_DeleteObj3(x); return NULL; } | |
| 12394 | + } | |
| 12334 | 12395 | if (!cJSON_HasObjectItem(j, "metadata_property_handling")) { cJSON_DeleteObj3(x); return NULL; } |
| 12335 | 12396 | if (cJSON_HasObjectItem(j, "metadata_property_handling")) { |
| 12336 | 12397 | if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "metadata_property_handling"))) { cJSON_DeleteObj3(x); return NULL; } |
| @@ -12367,6 +12428,12 @@ struct Obj3 * cJSON_GetObj3Value(const cJSON * j) { | ||
| 12367 | 12428 | x->no = cJSON_GetNoValue(cJSON_GetObjectItemCaseSensitive(j, "NO")); |
| 12368 | 12429 | if (NULL == x->no) { cJSON_DeleteObj3(x); return NULL; } |
| 12369 | 12430 | } |
| 12431 | + if (!cJSON_HasObjectItem(j, "goto")) { cJSON_DeleteObj3(x); return NULL; } | |
| 12432 | + if (cJSON_HasObjectItem(j, "goto")) { | |
| 12433 | + if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "goto"))) { cJSON_DeleteObj3(x); return NULL; } | |
| 12434 | + x->obj3_goto = cJSON_GetGotoValue(cJSON_GetObjectItemCaseSensitive(j, "goto")); | |
| 12435 | + if (NULL == x->obj3_goto) { cJSON_DeleteObj3(x); return NULL; } | |
| 12436 | + } | |
| 12370 | 12437 | if (!cJSON_HasObjectItem(j, "if")) { cJSON_DeleteObj3(x); return NULL; } |
| 12371 | 12438 | if (cJSON_HasObjectItem(j, "if")) { |
| 12372 | 12439 | if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "if"))) { cJSON_DeleteObj3(x); return NULL; } |
| @@ -12421,12 +12488,6 @@ struct Obj3 * cJSON_GetObj3Value(const cJSON * j) { | ||
| 12421 | 12488 | x->obj3_new = cJSON_GetNewValue(cJSON_GetObjectItemCaseSensitive(j, "new")); |
| 12422 | 12489 | if (NULL == x->obj3_new) { cJSON_DeleteObj3(x); return NULL; } |
| 12423 | 12490 | } |
| 12424 | - if (!cJSON_HasObjectItem(j, "noexcept")) { cJSON_DeleteObj3(x); return NULL; } | |
| 12425 | - if (cJSON_HasObjectItem(j, "noexcept")) { | |
| 12426 | - if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "noexcept"))) { cJSON_DeleteObj3(x); return NULL; } | |
| 12427 | - x->obj3_noexcept = cJSON_GetNoexceptValue(cJSON_GetObjectItemCaseSensitive(j, "noexcept")); | |
| 12428 | - if (NULL == x->obj3_noexcept) { cJSON_DeleteObj3(x); return NULL; } | |
| 12429 | - } | |
| 12430 | 12491 | } |
| 12431 | 12492 | } |
| 12432 | 12493 | return x; |
| @@ -12485,12 +12546,14 @@ cJSON * cJSON_CreateObj3(const struct Obj3 * x) { | ||
| 12485 | 12546 | cJSON_AddItemToObject(j, "lock", cJSON_CreateLock(x->lock)); |
| 12486 | 12547 | cJSON_AddItemToObject(j, "map", cJSON_CreateMap(x->map)); |
| 12487 | 12548 | cJSON_AddItemToObject(j, "MapEntry", cJSON_CreateMapEntry(x->map_entry)); |
| 12549 | + cJSON_AddItemToObject(j, "MarshalJSON", cJSON_CreateMarshalJson(x->marshal_json)); | |
| 12488 | 12550 | cJSON_AddItemToObject(j, "metadata_property_handling", cJSON_CreateMetadataPropertyHandling(x->metadata_property_handling)); |
| 12489 | 12551 | cJSON_AddItemToObject(j, "mutating", cJSON_CreateMutating(x->mutating)); |
| 12490 | 12552 | cJSON_AddItemToObject(j, "native", cJSON_CreateNative(x->native)); |
| 12491 | 12553 | cJSON_AddItemToObject(j, "newtonsoft", cJSON_CreateNewtonsoft(x->newtonsoft)); |
| 12492 | 12554 | cJSON_AddItemToObject(j, "nil", cJSON_CreateNil(x->nil)); |
| 12493 | 12555 | cJSON_AddItemToObject(j, "NO", cJSON_CreateNo(x->no)); |
| 12556 | + cJSON_AddItemToObject(j, "goto", cJSON_CreateGoto(x->obj3_goto)); | |
| 12494 | 12557 | cJSON_AddItemToObject(j, "if", cJSON_CreateIf(x->obj3_if)); |
| 12495 | 12558 | cJSON_AddItemToObject(j, "import", cJSON_CreateImport(x->obj3_import)); |
| 12496 | 12559 | cJSON_AddItemToObject(j, "inline", cJSON_CreateInline(x->obj3_inline)); |
| @@ -12500,7 +12563,6 @@ cJSON * cJSON_CreateObj3(const struct Obj3 * x) { | ||
| 12500 | 12563 | cJSON_AddItemToObject(j, "mutable", cJSON_CreateMutable(x->obj3_mutable)); |
| 12501 | 12564 | cJSON_AddItemToObject(j, "namespace", cJSON_CreateNamespace(x->obj3_namespace)); |
| 12502 | 12565 | cJSON_AddItemToObject(j, "new", cJSON_CreateNew(x->obj3_new)); |
| 12503 | - cJSON_AddItemToObject(j, "noexcept", cJSON_CreateNoexcept(x->obj3_noexcept)); | |
| 12504 | 12566 | } |
| 12505 | 12567 | } |
| 12506 | 12568 | return j; |
| @@ -12664,6 +12726,9 @@ void cJSON_DeleteObj3(struct Obj3 * x) { | ||
| 12664 | 12726 | if (NULL != x->map_entry) { |
| 12665 | 12727 | cJSON_DeleteMapEntry(x->map_entry); |
| 12666 | 12728 | } |
| 12729 | + if (NULL != x->marshal_json) { | |
| 12730 | + cJSON_DeleteMarshalJson(x->marshal_json); | |
| 12731 | + } | |
| 12667 | 12732 | if (NULL != x->metadata_property_handling) { |
| 12668 | 12733 | cJSON_DeleteMetadataPropertyHandling(x->metadata_property_handling); |
| 12669 | 12734 | } |
| @@ -12682,6 +12747,9 @@ void cJSON_DeleteObj3(struct Obj3 * x) { | ||
| 12682 | 12747 | if (NULL != x->no) { |
| 12683 | 12748 | cJSON_DeleteNo(x->no); |
| 12684 | 12749 | } |
| 12750 | + if (NULL != x->obj3_goto) { | |
| 12751 | + cJSON_DeleteGoto(x->obj3_goto); | |
| 12752 | + } | |
| 12685 | 12753 | if (NULL != x->obj3_if) { |
| 12686 | 12754 | cJSON_DeleteIf(x->obj3_if); |
| 12687 | 12755 | } |
| @@ -12709,9 +12777,6 @@ void cJSON_DeleteObj3(struct Obj3 * x) { | ||
| 12709 | 12777 | if (NULL != x->obj3_new) { |
| 12710 | 12778 | cJSON_DeleteNew(x->obj3_new); |
| 12711 | 12779 | } |
| 12712 | - if (NULL != x->obj3_noexcept) { | |
| 12713 | - cJSON_DeleteNoexcept(x->obj3_noexcept); | |
| 12714 | - } | |
| 12715 | 12780 | cJSON_free(x); |
| 12716 | 12781 | } |
| 12717 | 12782 | } |
| @@ -13266,6 +13331,61 @@ void cJSON_DeleteNumberClass(struct NumberClass * x) { | ||
| 13266 | 13331 | } |
| 13267 | 13332 | } |
| 13268 | 13333 | |
| 13334 | +struct Noexcept * cJSON_ParseNoexcept(const char * s) { | |
| 13335 | + struct Noexcept * x = NULL; | |
| 13336 | + if (NULL != s) { | |
| 13337 | + cJSON * j = cJSON_Parse(s); | |
| 13338 | + if (NULL != j) { | |
| 13339 | + x = cJSON_GetNoexceptValue(j); | |
| 13340 | + cJSON_Delete(j); | |
| 13341 | + } | |
| 13342 | + } | |
| 13343 | + return x; | |
| 13344 | +} | |
| 13345 | + | |
| 13346 | +struct Noexcept * cJSON_GetNoexceptValue(const cJSON * j) { | |
| 13347 | + struct Noexcept * x = NULL; | |
| 13348 | + if (NULL != j) { | |
| 13349 | + if (NULL != (x = cJSON_malloc(sizeof(struct Noexcept)))) { | |
| 13350 | + memset(x, 0, sizeof(struct Noexcept)); | |
| 13351 | + if (!cJSON_HasObjectItem(j, "noexcept")) { cJSON_DeleteNoexcept(x); return NULL; } | |
| 13352 | + if (cJSON_HasObjectItem(j, "noexcept")) { | |
| 13353 | + if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "noexcept"))) { cJSON_DeleteNoexcept(x); return NULL; } | |
| 13354 | + x->noexcept_noexcept = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "noexcept")); | |
| 13355 | + } | |
| 13356 | + } | |
| 13357 | + } | |
| 13358 | + return x; | |
| 13359 | +} | |
| 13360 | + | |
| 13361 | +cJSON * cJSON_CreateNoexcept(const struct Noexcept * x) { | |
| 13362 | + cJSON * j = NULL; | |
| 13363 | + if (NULL != x) { | |
| 13364 | + if (NULL != (j = cJSON_CreateObject())) { | |
| 13365 | + cJSON_AddNumberToObject(j, "noexcept", x->noexcept_noexcept); | |
| 13366 | + } | |
| 13367 | + } | |
| 13368 | + return j; | |
| 13369 | +} | |
| 13370 | + | |
| 13371 | +char * cJSON_PrintNoexcept(const struct Noexcept * x) { | |
| 13372 | + char * s = NULL; | |
| 13373 | + if (NULL != x) { | |
| 13374 | + cJSON * j = cJSON_CreateNoexcept(x); | |
| 13375 | + if (NULL != j) { | |
| 13376 | + s = cJSON_Print(j); | |
| 13377 | + cJSON_Delete(j); | |
| 13378 | + } | |
| 13379 | + } | |
| 13380 | + return s; | |
| 13381 | +} | |
| 13382 | + | |
| 13383 | +void cJSON_DeleteNoexcept(struct Noexcept * x) { | |
| 13384 | + if (NULL != x) { | |
| 13385 | + cJSON_free(x); | |
| 13386 | + } | |
| 13387 | +} | |
| 13388 | + | |
| 13269 | 13389 | struct NoneClass * cJSON_ParseNoneClass(const char * s) { |
| 13270 | 13390 | struct NoneClass * x = NULL; |
| 13271 | 13391 | if (NULL != s) { |
| @@ -16194,61 +16314,6 @@ void cJSON_DeleteSel(struct Sel * x) { | ||
| 16194 | 16314 | } |
| 16195 | 16315 | } |
| 16196 | 16316 | |
| 16197 | -struct Select * cJSON_ParseSelect(const char * s) { | |
| 16198 | - struct Select * x = NULL; | |
| 16199 | - if (NULL != s) { | |
| 16200 | - cJSON * j = cJSON_Parse(s); | |
| 16201 | - if (NULL != j) { | |
| 16202 | - x = cJSON_GetSelectValue(j); | |
| 16203 | - cJSON_Delete(j); | |
| 16204 | - } | |
| 16205 | - } | |
| 16206 | - return x; | |
| 16207 | -} | |
| 16208 | - | |
| 16209 | -struct Select * cJSON_GetSelectValue(const cJSON * j) { | |
| 16210 | - struct Select * x = NULL; | |
| 16211 | - if (NULL != j) { | |
| 16212 | - if (NULL != (x = cJSON_malloc(sizeof(struct Select)))) { | |
| 16213 | - memset(x, 0, sizeof(struct Select)); | |
| 16214 | - if (!cJSON_HasObjectItem(j, "select")) { cJSON_DeleteSelect(x); return NULL; } | |
| 16215 | - if (cJSON_HasObjectItem(j, "select")) { | |
| 16216 | - if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "select"))) { cJSON_DeleteSelect(x); return NULL; } | |
| 16217 | - x->select = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "select")); | |
| 16218 | - } | |
| 16219 | - } | |
| 16220 | - } | |
| 16221 | - return x; | |
| 16222 | -} | |
| 16223 | - | |
| 16224 | -cJSON * cJSON_CreateSelect(const struct Select * x) { | |
| 16225 | - cJSON * j = NULL; | |
| 16226 | - if (NULL != x) { | |
| 16227 | - if (NULL != (j = cJSON_CreateObject())) { | |
| 16228 | - cJSON_AddNumberToObject(j, "select", x->select); | |
| 16229 | - } | |
| 16230 | - } | |
| 16231 | - return j; | |
| 16232 | -} | |
| 16233 | - | |
| 16234 | -char * cJSON_PrintSelect(const struct Select * x) { | |
| 16235 | - char * s = NULL; | |
| 16236 | - if (NULL != x) { | |
| 16237 | - cJSON * j = cJSON_CreateSelect(x); | |
| 16238 | - if (NULL != j) { | |
| 16239 | - s = cJSON_Print(j); | |
| 16240 | - cJSON_Delete(j); | |
| 16241 | - } | |
| 16242 | - } | |
| 16243 | - return s; | |
| 16244 | -} | |
| 16245 | - | |
| 16246 | -void cJSON_DeleteSelect(struct Select * x) { | |
| 16247 | - if (NULL != x) { | |
| 16248 | - cJSON_free(x); | |
| 16249 | - } | |
| 16250 | -} | |
| 16251 | - | |
| 16252 | 16317 | struct Obj4 * cJSON_ParseObj4(const char * s) { |
| 16253 | 16318 | struct Obj4 * x = NULL; |
| 16254 | 16319 | if (NULL != s) { |
| @@ -16331,6 +16396,12 @@ struct Obj4 * cJSON_GetObj4Value(const cJSON * j) { | ||
| 16331 | 16396 | x->number = cJSON_GetNumberClassValue(cJSON_GetObjectItemCaseSensitive(j, "number")); |
| 16332 | 16397 | if (NULL == x->number) { cJSON_DeleteObj4(x); return NULL; } |
| 16333 | 16398 | } |
| 16399 | + if (!cJSON_HasObjectItem(j, "noexcept")) { cJSON_DeleteObj4(x); return NULL; } | |
| 16400 | + if (cJSON_HasObjectItem(j, "noexcept")) { | |
| 16401 | + if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "noexcept"))) { cJSON_DeleteObj4(x); return NULL; } | |
| 16402 | + x->obj4_noexcept = cJSON_GetNoexceptValue(cJSON_GetObjectItemCaseSensitive(j, "noexcept")); | |
| 16403 | + if (NULL == x->obj4_noexcept) { cJSON_DeleteObj4(x); return NULL; } | |
| 16404 | + } | |
| 16334 | 16405 | if (!cJSON_HasObjectItem(j, "none")) { cJSON_DeleteObj4(x); return NULL; } |
| 16335 | 16406 | if (cJSON_HasObjectItem(j, "none")) { |
| 16336 | 16407 | if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "none"))) { cJSON_DeleteObj4(x); return NULL; } |
| @@ -16649,12 +16720,6 @@ struct Obj4 * cJSON_GetObj4Value(const cJSON * j) { | ||
| 16649 | 16720 | x->sel = cJSON_GetSelValue(cJSON_GetObjectItemCaseSensitive(j, "SEL")); |
| 16650 | 16721 | if (NULL == x->sel) { cJSON_DeleteObj4(x); return NULL; } |
| 16651 | 16722 | } |
| 16652 | - if (!cJSON_HasObjectItem(j, "select")) { cJSON_DeleteObj4(x); return NULL; } | |
| 16653 | - if (cJSON_HasObjectItem(j, "select")) { | |
| 16654 | - if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "select"))) { cJSON_DeleteObj4(x); return NULL; } | |
| 16655 | - x->select = cJSON_GetSelectValue(cJSON_GetObjectItemCaseSensitive(j, "select")); | |
| 16656 | - if (NULL == x->select) { cJSON_DeleteObj4(x); return NULL; } | |
| 16657 | - } | |
| 16658 | 16723 | } |
| 16659 | 16724 | } |
| 16660 | 16725 | return x; |
| @@ -16675,6 +16740,7 @@ cJSON * cJSON_CreateObj4(const struct Obj4 * x) { | ||
| 16675 | 16740 | cJSON_AddItemToObject(j, "NSString", cJSON_CreateNsString(x->ns_string)); |
| 16676 | 16741 | cJSON_AddItemToObject(j, "NULL", cJSON_CreateNullClass(x->null)); |
| 16677 | 16742 | cJSON_AddItemToObject(j, "number", cJSON_CreateNumberClass(x->number)); |
| 16743 | + cJSON_AddItemToObject(j, "noexcept", cJSON_CreateNoexcept(x->obj4_noexcept)); | |
| 16678 | 16744 | cJSON_AddItemToObject(j, "none", cJSON_CreateNoneClass(x->obj4_none)); |
| 16679 | 16745 | cJSON_AddItemToObject(j, "not", cJSON_CreateNot(x->obj4_not)); |
| 16680 | 16746 | cJSON_AddItemToObject(j, "not_eq", cJSON_CreateNotEq(x->obj4_not_eq)); |
| @@ -16728,7 +16794,6 @@ cJSON * cJSON_CreateObj4(const struct Obj4 * x) { | ||
| 16728 | 16794 | cJSON_AddItemToObject(j, "sbyte", cJSON_CreateSbyte(x->sbyte)); |
| 16729 | 16795 | cJSON_AddItemToObject(j, "sealed", cJSON_CreateSealed(x->sealed)); |
| 16730 | 16796 | cJSON_AddItemToObject(j, "SEL", cJSON_CreateSel(x->sel)); |
| 16731 | - cJSON_AddItemToObject(j, "select", cJSON_CreateSelect(x->select)); | |
| 16732 | 16797 | } |
| 16733 | 16798 | } |
| 16734 | 16799 | return j; |
| @@ -16778,6 +16843,9 @@ void cJSON_DeleteObj4(struct Obj4 * x) { | ||
| 16778 | 16843 | if (NULL != x->number) { |
| 16779 | 16844 | cJSON_DeleteNumberClass(x->number); |
| 16780 | 16845 | } |
| 16846 | + if (NULL != x->obj4_noexcept) { | |
| 16847 | + cJSON_DeleteNoexcept(x->obj4_noexcept); | |
| 16848 | + } | |
| 16781 | 16849 | if (NULL != x->obj4_none) { |
| 16782 | 16850 | cJSON_DeleteNoneClass(x->obj4_none); |
| 16783 | 16851 | } |
| @@ -16937,9 +17005,6 @@ void cJSON_DeleteObj4(struct Obj4 * x) { | ||
| 16937 | 17005 | if (NULL != x->sel) { |
| 16938 | 17006 | cJSON_DeleteSel(x->sel); |
| 16939 | 17007 | } |
| 16940 | - if (NULL != x->select) { | |
| 16941 | - cJSON_DeleteSelect(x->select); | |
| 16942 | - } | |
| 16943 | 17008 | cJSON_free(x); |
| 16944 | 17009 | } |
| 16945 | 17010 | } |
| @@ -18209,47 +18274,47 @@ void cJSON_DeleteUnion(struct Union * x) { | ||
| 18209 | 18274 | } |
| 18210 | 18275 | } |
| 18211 | 18276 | |
| 18212 | -struct Unsigned * cJSON_ParseUnsigned(const char * s) { | |
| 18213 | - struct Unsigned * x = NULL; | |
| 18277 | +struct PrimitiveKind * cJSON_ParsePrimitiveKind(const char * s) { | |
| 18278 | + struct PrimitiveKind * x = NULL; | |
| 18214 | 18279 | if (NULL != s) { |
| 18215 | 18280 | cJSON * j = cJSON_Parse(s); |
| 18216 | 18281 | if (NULL != j) { |
| 18217 | - x = cJSON_GetUnsignedValue(j); | |
| 18282 | + x = cJSON_GetPrimitiveKindValue(j); | |
| 18218 | 18283 | cJSON_Delete(j); |
| 18219 | 18284 | } |
| 18220 | 18285 | } |
| 18221 | 18286 | return x; |
| 18222 | 18287 | } |
| 18223 | 18288 | |
| 18224 | -struct Unsigned * cJSON_GetUnsignedValue(const cJSON * j) { | |
| 18225 | - struct Unsigned * x = NULL; | |
| 18289 | +struct PrimitiveKind * cJSON_GetPrimitiveKindValue(const cJSON * j) { | |
| 18290 | + struct PrimitiveKind * x = NULL; | |
| 18226 | 18291 | if (NULL != j) { |
| 18227 | - if (NULL != (x = cJSON_malloc(sizeof(struct Unsigned)))) { | |
| 18228 | - memset(x, 0, sizeof(struct Unsigned)); | |
| 18229 | - if (!cJSON_HasObjectItem(j, "unsigned")) { cJSON_DeleteUnsigned(x); return NULL; } | |
| 18230 | - if (cJSON_HasObjectItem(j, "unsigned")) { | |
| 18231 | - if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "unsigned"))) { cJSON_DeleteUnsigned(x); return NULL; } | |
| 18232 | - x->unsigned_unsigned = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "unsigned")); | |
| 18292 | + if (NULL != (x = cJSON_malloc(sizeof(struct PrimitiveKind)))) { | |
| 18293 | + memset(x, 0, sizeof(struct PrimitiveKind)); | |
| 18294 | + if (!cJSON_HasObjectItem(j, "PrimitiveKind")) { cJSON_DeletePrimitiveKind(x); return NULL; } | |
| 18295 | + if (cJSON_HasObjectItem(j, "PrimitiveKind")) { | |
| 18296 | + if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "PrimitiveKind"))) { cJSON_DeletePrimitiveKind(x); return NULL; } | |
| 18297 | + x->primitive_kind = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "PrimitiveKind")); | |
| 18233 | 18298 | } |
| 18234 | 18299 | } |
| 18235 | 18300 | } |
| 18236 | 18301 | return x; |
| 18237 | 18302 | } |
| 18238 | 18303 | |
| 18239 | -cJSON * cJSON_CreateUnsigned(const struct Unsigned * x) { | |
| 18304 | +cJSON * cJSON_CreatePrimitiveKind(const struct PrimitiveKind * x) { | |
| 18240 | 18305 | cJSON * j = NULL; |
| 18241 | 18306 | if (NULL != x) { |
| 18242 | 18307 | if (NULL != (j = cJSON_CreateObject())) { |
| 18243 | - cJSON_AddNumberToObject(j, "unsigned", x->unsigned_unsigned); | |
| 18308 | + cJSON_AddNumberToObject(j, "PrimitiveKind", x->primitive_kind); | |
| 18244 | 18309 | } |
| 18245 | 18310 | } |
| 18246 | 18311 | return j; |
| 18247 | 18312 | } |
| 18248 | 18313 | |
| 18249 | -char * cJSON_PrintUnsigned(const struct Unsigned * x) { | |
| 18314 | +char * cJSON_PrintPrimitiveKind(const struct PrimitiveKind * x) { | |
| 18250 | 18315 | char * s = NULL; |
| 18251 | 18316 | if (NULL != x) { |
| 18252 | - cJSON * j = cJSON_CreateUnsigned(x); | |
| 18317 | + cJSON * j = cJSON_CreatePrimitiveKind(x); | |
| 18253 | 18318 | if (NULL != j) { |
| 18254 | 18319 | s = cJSON_Print(j); |
| 18255 | 18320 | cJSON_Delete(j); |
| @@ -18258,53 +18323,53 @@ char * cJSON_PrintUnsigned(const struct Unsigned * x) { | ||
| 18258 | 18323 | return s; |
| 18259 | 18324 | } |
| 18260 | 18325 | |
| 18261 | -void cJSON_DeleteUnsigned(struct Unsigned * x) { | |
| 18326 | +void cJSON_DeletePrimitiveKind(struct PrimitiveKind * x) { | |
| 18262 | 18327 | if (NULL != x) { |
| 18263 | 18328 | cJSON_free(x); |
| 18264 | 18329 | } |
| 18265 | 18330 | } |
| 18266 | 18331 | |
| 18267 | -struct PrimitiveKind * cJSON_ParsePrimitiveKind(const char * s) { | |
| 18268 | - struct PrimitiveKind * x = NULL; | |
| 18332 | +struct Obj5True * cJSON_ParseObj5True(const char * s) { | |
| 18333 | + struct Obj5True * x = NULL; | |
| 18269 | 18334 | if (NULL != s) { |
| 18270 | 18335 | cJSON * j = cJSON_Parse(s); |
| 18271 | 18336 | if (NULL != j) { |
| 18272 | - x = cJSON_GetPrimitiveKindValue(j); | |
| 18337 | + x = cJSON_GetObj5TrueValue(j); | |
| 18273 | 18338 | cJSON_Delete(j); |
| 18274 | 18339 | } |
| 18275 | 18340 | } |
| 18276 | 18341 | return x; |
| 18277 | 18342 | } |
| 18278 | 18343 | |
| 18279 | -struct PrimitiveKind * cJSON_GetPrimitiveKindValue(const cJSON * j) { | |
| 18280 | - struct PrimitiveKind * x = NULL; | |
| 18344 | +struct Obj5True * cJSON_GetObj5TrueValue(const cJSON * j) { | |
| 18345 | + struct Obj5True * x = NULL; | |
| 18281 | 18346 | if (NULL != j) { |
| 18282 | - if (NULL != (x = cJSON_malloc(sizeof(struct PrimitiveKind)))) { | |
| 18283 | - memset(x, 0, sizeof(struct PrimitiveKind)); | |
| 18284 | - if (!cJSON_HasObjectItem(j, "PrimitiveKind")) { cJSON_DeletePrimitiveKind(x); return NULL; } | |
| 18285 | - if (cJSON_HasObjectItem(j, "PrimitiveKind")) { | |
| 18286 | - if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "PrimitiveKind"))) { cJSON_DeletePrimitiveKind(x); return NULL; } | |
| 18287 | - x->primitive_kind = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "PrimitiveKind")); | |
| 18347 | + if (NULL != (x = cJSON_malloc(sizeof(struct Obj5True)))) { | |
| 18348 | + memset(x, 0, sizeof(struct Obj5True)); | |
| 18349 | + if (!cJSON_HasObjectItem(j, "true")) { cJSON_DeleteObj5True(x); return NULL; } | |
| 18350 | + if (cJSON_HasObjectItem(j, "true")) { | |
| 18351 | + if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "true"))) { cJSON_DeleteObj5True(x); return NULL; } | |
| 18352 | + x->true_true = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "true")); | |
| 18288 | 18353 | } |
| 18289 | 18354 | } |
| 18290 | 18355 | } |
| 18291 | 18356 | return x; |
| 18292 | 18357 | } |
| 18293 | 18358 | |
| 18294 | -cJSON * cJSON_CreatePrimitiveKind(const struct PrimitiveKind * x) { | |
| 18359 | +cJSON * cJSON_CreateObj5True(const struct Obj5True * x) { | |
| 18295 | 18360 | cJSON * j = NULL; |
| 18296 | 18361 | if (NULL != x) { |
| 18297 | 18362 | if (NULL != (j = cJSON_CreateObject())) { |
| 18298 | - cJSON_AddNumberToObject(j, "PrimitiveKind", x->primitive_kind); | |
| 18363 | + cJSON_AddNumberToObject(j, "true", x->true_true); | |
| 18299 | 18364 | } |
| 18300 | 18365 | } |
| 18301 | 18366 | return j; |
| 18302 | 18367 | } |
| 18303 | 18368 | |
| 18304 | -char * cJSON_PrintPrimitiveKind(const struct PrimitiveKind * x) { | |
| 18369 | +char * cJSON_PrintObj5True(const struct Obj5True * x) { | |
| 18305 | 18370 | char * s = NULL; |
| 18306 | 18371 | if (NULL != x) { |
| 18307 | - cJSON * j = cJSON_CreatePrimitiveKind(x); | |
| 18372 | + cJSON * j = cJSON_CreateObj5True(x); | |
| 18308 | 18373 | if (NULL != j) { |
| 18309 | 18374 | s = cJSON_Print(j); |
| 18310 | 18375 | cJSON_Delete(j); |
| @@ -18313,53 +18378,53 @@ char * cJSON_PrintPrimitiveKind(const struct PrimitiveKind * x) { | ||
| 18313 | 18378 | return s; |
| 18314 | 18379 | } |
| 18315 | 18380 | |
| 18316 | -void cJSON_DeletePrimitiveKind(struct PrimitiveKind * x) { | |
| 18381 | +void cJSON_DeleteObj5True(struct Obj5True * x) { | |
| 18317 | 18382 | if (NULL != x) { |
| 18318 | 18383 | cJSON_free(x); |
| 18319 | 18384 | } |
| 18320 | 18385 | } |
| 18321 | 18386 | |
| 18322 | -struct Obj5True * cJSON_ParseObj5True(const char * s) { | |
| 18323 | - struct Obj5True * x = NULL; | |
| 18387 | +struct Select * cJSON_ParseSelect(const char * s) { | |
| 18388 | + struct Select * x = NULL; | |
| 18324 | 18389 | if (NULL != s) { |
| 18325 | 18390 | cJSON * j = cJSON_Parse(s); |
| 18326 | 18391 | if (NULL != j) { |
| 18327 | - x = cJSON_GetObj5TrueValue(j); | |
| 18392 | + x = cJSON_GetSelectValue(j); | |
| 18328 | 18393 | cJSON_Delete(j); |
| 18329 | 18394 | } |
| 18330 | 18395 | } |
| 18331 | 18396 | return x; |
| 18332 | 18397 | } |
| 18333 | 18398 | |
| 18334 | -struct Obj5True * cJSON_GetObj5TrueValue(const cJSON * j) { | |
| 18335 | - struct Obj5True * x = NULL; | |
| 18399 | +struct Select * cJSON_GetSelectValue(const cJSON * j) { | |
| 18400 | + struct Select * x = NULL; | |
| 18336 | 18401 | if (NULL != j) { |
| 18337 | - if (NULL != (x = cJSON_malloc(sizeof(struct Obj5True)))) { | |
| 18338 | - memset(x, 0, sizeof(struct Obj5True)); | |
| 18339 | - if (!cJSON_HasObjectItem(j, "true")) { cJSON_DeleteObj5True(x); return NULL; } | |
| 18340 | - if (cJSON_HasObjectItem(j, "true")) { | |
| 18341 | - if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "true"))) { cJSON_DeleteObj5True(x); return NULL; } | |
| 18342 | - x->true_true = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "true")); | |
| 18402 | + if (NULL != (x = cJSON_malloc(sizeof(struct Select)))) { | |
| 18403 | + memset(x, 0, sizeof(struct Select)); | |
| 18404 | + if (!cJSON_HasObjectItem(j, "select")) { cJSON_DeleteSelect(x); return NULL; } | |
| 18405 | + if (cJSON_HasObjectItem(j, "select")) { | |
| 18406 | + if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "select"))) { cJSON_DeleteSelect(x); return NULL; } | |
| 18407 | + x->select = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "select")); | |
| 18343 | 18408 | } |
| 18344 | 18409 | } |
| 18345 | 18410 | } |
| 18346 | 18411 | return x; |
| 18347 | 18412 | } |
| 18348 | 18413 | |
| 18349 | -cJSON * cJSON_CreateObj5True(const struct Obj5True * x) { | |
| 18414 | +cJSON * cJSON_CreateSelect(const struct Select * x) { | |
| 18350 | 18415 | cJSON * j = NULL; |
| 18351 | 18416 | if (NULL != x) { |
| 18352 | 18417 | if (NULL != (j = cJSON_CreateObject())) { |
| 18353 | - cJSON_AddNumberToObject(j, "true", x->true_true); | |
| 18418 | + cJSON_AddNumberToObject(j, "select", x->select); | |
| 18354 | 18419 | } |
| 18355 | 18420 | } |
| 18356 | 18421 | return j; |
| 18357 | 18422 | } |
| 18358 | 18423 | |
| 18359 | -char * cJSON_PrintObj5True(const struct Obj5True * x) { | |
| 18424 | +char * cJSON_PrintSelect(const struct Select * x) { | |
| 18360 | 18425 | char * s = NULL; |
| 18361 | 18426 | if (NULL != x) { |
| 18362 | - cJSON * j = cJSON_CreateObj5True(x); | |
| 18427 | + cJSON * j = cJSON_CreateSelect(x); | |
| 18363 | 18428 | if (NULL != j) { |
| 18364 | 18429 | s = cJSON_Print(j); |
| 18365 | 18430 | cJSON_Delete(j); |
| @@ -18368,7 +18433,7 @@ char * cJSON_PrintObj5True(const struct Obj5True * x) { | ||
| 18368 | 18433 | return s; |
| 18369 | 18434 | } |
| 18370 | 18435 | |
| 18371 | -void cJSON_DeleteObj5True(struct Obj5True * x) { | |
| 18436 | +void cJSON_DeleteSelect(struct Select * x) { | |
| 18372 | 18437 | if (NULL != x) { |
| 18373 | 18438 | cJSON_free(x); |
| 18374 | 18439 | } |
| @@ -19694,6 +19759,61 @@ void cJSON_DeleteTimeZone(struct TimeZone * x) { | ||
| 19694 | 19759 | } |
| 19695 | 19760 | } |
| 19696 | 19761 | |
| 19762 | +struct ToDict * cJSON_ParseToDict(const char * s) { | |
| 19763 | + struct ToDict * x = NULL; | |
| 19764 | + if (NULL != s) { | |
| 19765 | + cJSON * j = cJSON_Parse(s); | |
| 19766 | + if (NULL != j) { | |
| 19767 | + x = cJSON_GetToDictValue(j); | |
| 19768 | + cJSON_Delete(j); | |
| 19769 | + } | |
| 19770 | + } | |
| 19771 | + return x; | |
| 19772 | +} | |
| 19773 | + | |
| 19774 | +struct ToDict * cJSON_GetToDictValue(const cJSON * j) { | |
| 19775 | + struct ToDict * x = NULL; | |
| 19776 | + if (NULL != j) { | |
| 19777 | + if (NULL != (x = cJSON_malloc(sizeof(struct ToDict)))) { | |
| 19778 | + memset(x, 0, sizeof(struct ToDict)); | |
| 19779 | + if (!cJSON_HasObjectItem(j, "to_dict")) { cJSON_DeleteToDict(x); return NULL; } | |
| 19780 | + if (cJSON_HasObjectItem(j, "to_dict")) { | |
| 19781 | + if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "to_dict"))) { cJSON_DeleteToDict(x); return NULL; } | |
| 19782 | + x->to_dict = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "to_dict")); | |
| 19783 | + } | |
| 19784 | + } | |
| 19785 | + } | |
| 19786 | + return x; | |
| 19787 | +} | |
| 19788 | + | |
| 19789 | +cJSON * cJSON_CreateToDict(const struct ToDict * x) { | |
| 19790 | + cJSON * j = NULL; | |
| 19791 | + if (NULL != x) { | |
| 19792 | + if (NULL != (j = cJSON_CreateObject())) { | |
| 19793 | + cJSON_AddNumberToObject(j, "to_dict", x->to_dict); | |
| 19794 | + } | |
| 19795 | + } | |
| 19796 | + return j; | |
| 19797 | +} | |
| 19798 | + | |
| 19799 | +char * cJSON_PrintToDict(const struct ToDict * x) { | |
| 19800 | + char * s = NULL; | |
| 19801 | + if (NULL != x) { | |
| 19802 | + cJSON * j = cJSON_CreateToDict(x); | |
| 19803 | + if (NULL != j) { | |
| 19804 | + s = cJSON_Print(j); | |
| 19805 | + cJSON_Delete(j); | |
| 19806 | + } | |
| 19807 | + } | |
| 19808 | + return s; | |
| 19809 | +} | |
| 19810 | + | |
| 19811 | +void cJSON_DeleteToDict(struct ToDict * x) { | |
| 19812 | + if (NULL != x) { | |
| 19813 | + cJSON_free(x); | |
| 19814 | + } | |
| 19815 | +} | |
| 19816 | + | |
| 19697 | 19817 | struct ToJson * cJSON_ParseToJson(const char * s) { |
| 19698 | 19818 | struct ToJson * x = NULL; |
| 19699 | 19819 | if (NULL != s) { |
| @@ -20244,6 +20364,61 @@ void cJSON_DeleteUndefined(struct Undefined * x) { | ||
| 20244 | 20364 | } |
| 20245 | 20365 | } |
| 20246 | 20366 | |
| 20367 | +struct UnmarshalJson * cJSON_ParseUnmarshalJson(const char * s) { | |
| 20368 | + struct UnmarshalJson * x = NULL; | |
| 20369 | + if (NULL != s) { | |
| 20370 | + cJSON * j = cJSON_Parse(s); | |
| 20371 | + if (NULL != j) { | |
| 20372 | + x = cJSON_GetUnmarshalJsonValue(j); | |
| 20373 | + cJSON_Delete(j); | |
| 20374 | + } | |
| 20375 | + } | |
| 20376 | + return x; | |
| 20377 | +} | |
| 20378 | + | |
| 20379 | +struct UnmarshalJson * cJSON_GetUnmarshalJsonValue(const cJSON * j) { | |
| 20380 | + struct UnmarshalJson * x = NULL; | |
| 20381 | + if (NULL != j) { | |
| 20382 | + if (NULL != (x = cJSON_malloc(sizeof(struct UnmarshalJson)))) { | |
| 20383 | + memset(x, 0, sizeof(struct UnmarshalJson)); | |
| 20384 | + if (!cJSON_HasObjectItem(j, "UnmarshalJSON")) { cJSON_DeleteUnmarshalJson(x); return NULL; } | |
| 20385 | + if (cJSON_HasObjectItem(j, "UnmarshalJSON")) { | |
| 20386 | + if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "UnmarshalJSON"))) { cJSON_DeleteUnmarshalJson(x); return NULL; } | |
| 20387 | + x->unmarshal_json = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "UnmarshalJSON")); | |
| 20388 | + } | |
| 20389 | + } | |
| 20390 | + } | |
| 20391 | + return x; | |
| 20392 | +} | |
| 20393 | + | |
| 20394 | +cJSON * cJSON_CreateUnmarshalJson(const struct UnmarshalJson * x) { | |
| 20395 | + cJSON * j = NULL; | |
| 20396 | + if (NULL != x) { | |
| 20397 | + if (NULL != (j = cJSON_CreateObject())) { | |
| 20398 | + cJSON_AddNumberToObject(j, "UnmarshalJSON", x->unmarshal_json); | |
| 20399 | + } | |
| 20400 | + } | |
| 20401 | + return j; | |
| 20402 | +} | |
| 20403 | + | |
| 20404 | +char * cJSON_PrintUnmarshalJson(const struct UnmarshalJson * x) { | |
| 20405 | + char * s = NULL; | |
| 20406 | + if (NULL != x) { | |
| 20407 | + cJSON * j = cJSON_CreateUnmarshalJson(x); | |
| 20408 | + if (NULL != j) { | |
| 20409 | + s = cJSON_Print(j); | |
| 20410 | + cJSON_Delete(j); | |
| 20411 | + } | |
| 20412 | + } | |
| 20413 | + return s; | |
| 20414 | +} | |
| 20415 | + | |
| 20416 | +void cJSON_DeleteUnmarshalJson(struct UnmarshalJson * x) { | |
| 20417 | + if (NULL != x) { | |
| 20418 | + cJSON_free(x); | |
| 20419 | + } | |
| 20420 | +} | |
| 20421 | + | |
| 20247 | 20422 | struct Unowned * cJSON_ParseUnowned(const char * s) { |
| 20248 | 20423 | struct Unowned * x = NULL; |
| 20249 | 20424 | if (NULL != s) { |
| @@ -20409,61 +20584,6 @@ void cJSON_DeleteUseSerializers(struct UseSerializers * x) { | ||
| 20409 | 20584 | } |
| 20410 | 20585 | } |
| 20411 | 20586 | |
| 20412 | -struct Ushort * cJSON_ParseUshort(const char * s) { | |
| 20413 | - struct Ushort * x = NULL; | |
| 20414 | - if (NULL != s) { | |
| 20415 | - cJSON * j = cJSON_Parse(s); | |
| 20416 | - if (NULL != j) { | |
| 20417 | - x = cJSON_GetUshortValue(j); | |
| 20418 | - cJSON_Delete(j); | |
| 20419 | - } | |
| 20420 | - } | |
| 20421 | - return x; | |
| 20422 | -} | |
| 20423 | - | |
| 20424 | -struct Ushort * cJSON_GetUshortValue(const cJSON * j) { | |
| 20425 | - struct Ushort * x = NULL; | |
| 20426 | - if (NULL != j) { | |
| 20427 | - if (NULL != (x = cJSON_malloc(sizeof(struct Ushort)))) { | |
| 20428 | - memset(x, 0, sizeof(struct Ushort)); | |
| 20429 | - if (!cJSON_HasObjectItem(j, "ushort")) { cJSON_DeleteUshort(x); return NULL; } | |
| 20430 | - if (cJSON_HasObjectItem(j, "ushort")) { | |
| 20431 | - if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "ushort"))) { cJSON_DeleteUshort(x); return NULL; } | |
| 20432 | - x->ushort = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "ushort")); | |
| 20433 | - } | |
| 20434 | - } | |
| 20435 | - } | |
| 20436 | - return x; | |
| 20437 | -} | |
| 20438 | - | |
| 20439 | -cJSON * cJSON_CreateUshort(const struct Ushort * x) { | |
| 20440 | - cJSON * j = NULL; | |
| 20441 | - if (NULL != x) { | |
| 20442 | - if (NULL != (j = cJSON_CreateObject())) { | |
| 20443 | - cJSON_AddNumberToObject(j, "ushort", x->ushort); | |
| 20444 | - } | |
| 20445 | - } | |
| 20446 | - return j; | |
| 20447 | -} | |
| 20448 | - | |
| 20449 | -char * cJSON_PrintUshort(const struct Ushort * x) { | |
| 20450 | - char * s = NULL; | |
| 20451 | - if (NULL != x) { | |
| 20452 | - cJSON * j = cJSON_CreateUshort(x); | |
| 20453 | - if (NULL != j) { | |
| 20454 | - s = cJSON_Print(j); | |
| 20455 | - cJSON_Delete(j); | |
| 20456 | - } | |
| 20457 | - } | |
| 20458 | - return s; | |
| 20459 | -} | |
| 20460 | - | |
| 20461 | -void cJSON_DeleteUshort(struct Ushort * x) { | |
| 20462 | - if (NULL != x) { | |
| 20463 | - cJSON_free(x); | |
| 20464 | - } | |
| 20465 | -} | |
| 20466 | - | |
| 20467 | 20587 | struct Obj5 * cJSON_ParseObj5(const char * s) { |
| 20468 | 20588 | struct Obj5 * x = NULL; |
| 20469 | 20589 | if (NULL != s) { |
| @@ -20624,12 +20744,6 @@ struct Obj5 * cJSON_GetObj5Value(const cJSON * j) { | ||
| 20624 | 20744 | x->obj5_union = cJSON_GetUnionValue(cJSON_GetObjectItemCaseSensitive(j, "union")); |
| 20625 | 20745 | if (NULL == x->obj5_union) { cJSON_DeleteObj5(x); return NULL; } |
| 20626 | 20746 | } |
| 20627 | - if (!cJSON_HasObjectItem(j, "unsigned")) { cJSON_DeleteObj5(x); return NULL; } | |
| 20628 | - if (cJSON_HasObjectItem(j, "unsigned")) { | |
| 20629 | - if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "unsigned"))) { cJSON_DeleteObj5(x); return NULL; } | |
| 20630 | - x->obj5_unsigned = cJSON_GetUnsignedValue(cJSON_GetObjectItemCaseSensitive(j, "unsigned")); | |
| 20631 | - if (NULL == x->obj5_unsigned) { cJSON_DeleteObj5(x); return NULL; } | |
| 20632 | - } | |
| 20633 | 20747 | if (!cJSON_HasObjectItem(j, "PrimitiveKind")) { cJSON_DeleteObj5(x); return NULL; } |
| 20634 | 20748 | if (cJSON_HasObjectItem(j, "PrimitiveKind")) { |
| 20635 | 20749 | if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "PrimitiveKind"))) { cJSON_DeleteObj5(x); return NULL; } |
| @@ -20642,6 +20756,12 @@ struct Obj5 * cJSON_GetObj5Value(const cJSON * j) { | ||
| 20642 | 20756 | x->purple_true = cJSON_GetObj5TrueValue(cJSON_GetObjectItemCaseSensitive(j, "true")); |
| 20643 | 20757 | if (NULL == x->purple_true) { cJSON_DeleteObj5(x); return NULL; } |
| 20644 | 20758 | } |
| 20759 | + if (!cJSON_HasObjectItem(j, "select")) { cJSON_DeleteObj5(x); return NULL; } | |
| 20760 | + if (cJSON_HasObjectItem(j, "select")) { | |
| 20761 | + if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "select"))) { cJSON_DeleteObj5(x); return NULL; } | |
| 20762 | + x->select = cJSON_GetSelectValue(cJSON_GetObjectItemCaseSensitive(j, "select")); | |
| 20763 | + if (NULL == x->select) { cJSON_DeleteObj5(x); return NULL; } | |
| 20764 | + } | |
| 20645 | 20765 | if (!cJSON_HasObjectItem(j, "Self")) { cJSON_DeleteObj5(x); return NULL; } |
| 20646 | 20766 | if (cJSON_HasObjectItem(j, "Self")) { |
| 20647 | 20767 | if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "Self"))) { cJSON_DeleteObj5(x); return NULL; } |
| @@ -20786,6 +20906,12 @@ struct Obj5 * cJSON_GetObj5Value(const cJSON * j) { | ||
| 20786 | 20906 | x->time_zone = cJSON_GetTimeZoneValue(cJSON_GetObjectItemCaseSensitive(j, "TimeZone")); |
| 20787 | 20907 | if (NULL == x->time_zone) { cJSON_DeleteObj5(x); return NULL; } |
| 20788 | 20908 | } |
| 20909 | + if (!cJSON_HasObjectItem(j, "to_dict")) { cJSON_DeleteObj5(x); return NULL; } | |
| 20910 | + if (cJSON_HasObjectItem(j, "to_dict")) { | |
| 20911 | + if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "to_dict"))) { cJSON_DeleteObj5(x); return NULL; } | |
| 20912 | + x->to_dict = cJSON_GetToDictValue(cJSON_GetObjectItemCaseSensitive(j, "to_dict")); | |
| 20913 | + if (NULL == x->to_dict) { cJSON_DeleteObj5(x); return NULL; } | |
| 20914 | + } | |
| 20789 | 20915 | if (!cJSON_HasObjectItem(j, "to_json")) { cJSON_DeleteObj5(x); return NULL; } |
| 20790 | 20916 | if (cJSON_HasObjectItem(j, "to_json")) { |
| 20791 | 20917 | if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "to_json"))) { cJSON_DeleteObj5(x); return NULL; } |
| @@ -20846,6 +20972,12 @@ struct Obj5 * cJSON_GetObj5Value(const cJSON * j) { | ||
| 20846 | 20972 | x->undefined = cJSON_GetUndefinedValue(cJSON_GetObjectItemCaseSensitive(j, "undefined")); |
| 20847 | 20973 | if (NULL == x->undefined) { cJSON_DeleteObj5(x); return NULL; } |
| 20848 | 20974 | } |
| 20975 | + if (!cJSON_HasObjectItem(j, "UnmarshalJSON")) { cJSON_DeleteObj5(x); return NULL; } | |
| 20976 | + if (cJSON_HasObjectItem(j, "UnmarshalJSON")) { | |
| 20977 | + if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "UnmarshalJSON"))) { cJSON_DeleteObj5(x); return NULL; } | |
| 20978 | + x->unmarshal_json = cJSON_GetUnmarshalJsonValue(cJSON_GetObjectItemCaseSensitive(j, "UnmarshalJSON")); | |
| 20979 | + if (NULL == x->unmarshal_json) { cJSON_DeleteObj5(x); return NULL; } | |
| 20980 | + } | |
| 20849 | 20981 | if (!cJSON_HasObjectItem(j, "unowned")) { cJSON_DeleteObj5(x); return NULL; } |
| 20850 | 20982 | if (cJSON_HasObjectItem(j, "unowned")) { |
| 20851 | 20983 | if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "unowned"))) { cJSON_DeleteObj5(x); return NULL; } |
| @@ -20864,12 +20996,6 @@ struct Obj5 * cJSON_GetObj5Value(const cJSON * j) { | ||
| 20864 | 20996 | x->use_serializers = cJSON_GetUseSerializersValue(cJSON_GetObjectItemCaseSensitive(j, "UseSerializers")); |
| 20865 | 20997 | if (NULL == x->use_serializers) { cJSON_DeleteObj5(x); return NULL; } |
| 20866 | 20998 | } |
| 20867 | - if (!cJSON_HasObjectItem(j, "ushort")) { cJSON_DeleteObj5(x); return NULL; } | |
| 20868 | - if (cJSON_HasObjectItem(j, "ushort")) { | |
| 20869 | - if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "ushort"))) { cJSON_DeleteObj5(x); return NULL; } | |
| 20870 | - x->ushort = cJSON_GetUshortValue(cJSON_GetObjectItemCaseSensitive(j, "ushort")); | |
| 20871 | - if (NULL == x->ushort) { cJSON_DeleteObj5(x); return NULL; } | |
| 20872 | - } | |
| 20873 | 20999 | } |
| 20874 | 21000 | } |
| 20875 | 21001 | return x; |
| @@ -20903,9 +21029,9 @@ cJSON * cJSON_CreateObj5(const struct Obj5 * x) { | ||
| 20903 | 21029 | cJSON_AddItemToObject(j, "typename", cJSON_CreateTypename(x->obj5_typename)); |
| 20904 | 21030 | cJSON_AddItemToObject(j, "typeof", cJSON_CreateTypeof(x->obj5_typeof)); |
| 20905 | 21031 | cJSON_AddItemToObject(j, "union", cJSON_CreateUnion(x->obj5_union)); |
| 20906 | - cJSON_AddItemToObject(j, "unsigned", cJSON_CreateUnsigned(x->obj5_unsigned)); | |
| 20907 | 21032 | cJSON_AddItemToObject(j, "PrimitiveKind", cJSON_CreatePrimitiveKind(x->primitive_kind)); |
| 20908 | 21033 | cJSON_AddItemToObject(j, "true", cJSON_CreateObj5True(x->purple_true)); |
| 21034 | + cJSON_AddItemToObject(j, "select", cJSON_CreateSelect(x->select)); | |
| 20909 | 21035 | cJSON_AddItemToObject(j, "Self", cJSON_CreateSelf(x->self)); |
| 20910 | 21036 | cJSON_AddItemToObject(j, "Sendable", cJSON_CreateSendable(x->sendable)); |
| 20911 | 21037 | cJSON_AddItemToObject(j, "SerialDescriptor", cJSON_CreateSerialDescriptor(x->serial_descriptor)); |
| @@ -20930,6 +21056,7 @@ cJSON * cJSON_CreateObj5(const struct Obj5 * x) { | ||
| 20930 | 21056 | cJSON_AddItemToObject(j, "TimeOnly", cJSON_CreateTimeOnly(x->time_only)); |
| 20931 | 21057 | cJSON_AddItemToObject(j, "TimeOnlyConverter", cJSON_CreateTimeOnlyConverter(x->time_only_converter)); |
| 20932 | 21058 | cJSON_AddItemToObject(j, "TimeZone", cJSON_CreateTimeZone(x->time_zone)); |
| 21059 | + cJSON_AddItemToObject(j, "to_dict", cJSON_CreateToDict(x->to_dict)); | |
| 20933 | 21060 | cJSON_AddItemToObject(j, "to_json", cJSON_CreateToJson(x->to_json)); |
| 20934 | 21061 | cJSON_AddItemToObject(j, "toString", cJSON_CreateToString(x->to_string)); |
| 20935 | 21062 | cJSON_AddItemToObject(j, "top_level", cJSON_CreateTopLevelClass(x->top_level)); |
| @@ -20940,10 +21067,10 @@ cJSON * cJSON_CreateObj5(const struct Obj5 * x) { | ||
| 20940 | 21067 | cJSON_AddItemToObject(j, "ulong", cJSON_CreateUlong(x->ulong)); |
| 20941 | 21068 | cJSON_AddItemToObject(j, "unchecked", cJSON_CreateUnchecked(x->unchecked)); |
| 20942 | 21069 | cJSON_AddItemToObject(j, "undefined", cJSON_CreateUndefined(x->undefined)); |
| 21070 | + cJSON_AddItemToObject(j, "UnmarshalJSON", cJSON_CreateUnmarshalJson(x->unmarshal_json)); | |
| 20943 | 21071 | cJSON_AddItemToObject(j, "unowned", cJSON_CreateUnowned(x->unowned)); |
| 20944 | 21072 | cJSON_AddItemToObject(j, "unsafe", cJSON_CreateUnsafe(x->unsafe)); |
| 20945 | 21073 | cJSON_AddItemToObject(j, "UseSerializers", cJSON_CreateUseSerializers(x->use_serializers)); |
| 20946 | - cJSON_AddItemToObject(j, "ushort", cJSON_CreateUshort(x->ushort)); | |
| 20947 | 21074 | } |
| 20948 | 21075 | } |
| 20949 | 21076 | return j; |
| @@ -21032,15 +21159,15 @@ void cJSON_DeleteObj5(struct Obj5 * x) { | ||
| 21032 | 21159 | if (NULL != x->obj5_union) { |
| 21033 | 21160 | cJSON_DeleteUnion(x->obj5_union); |
| 21034 | 21161 | } |
| 21035 | - if (NULL != x->obj5_unsigned) { | |
| 21036 | - cJSON_DeleteUnsigned(x->obj5_unsigned); | |
| 21037 | - } | |
| 21038 | 21162 | if (NULL != x->primitive_kind) { |
| 21039 | 21163 | cJSON_DeletePrimitiveKind(x->primitive_kind); |
| 21040 | 21164 | } |
| 21041 | 21165 | if (NULL != x->purple_true) { |
| 21042 | 21166 | cJSON_DeleteObj5True(x->purple_true); |
| 21043 | 21167 | } |
| 21168 | + if (NULL != x->select) { | |
| 21169 | + cJSON_DeleteSelect(x->select); | |
| 21170 | + } | |
| 21044 | 21171 | if (NULL != x->self) { |
| 21045 | 21172 | cJSON_DeleteSelf(x->self); |
| 21046 | 21173 | } |
| @@ -21113,6 +21240,9 @@ void cJSON_DeleteObj5(struct Obj5 * x) { | ||
| 21113 | 21240 | if (NULL != x->time_zone) { |
| 21114 | 21241 | cJSON_DeleteTimeZone(x->time_zone); |
| 21115 | 21242 | } |
| 21243 | + if (NULL != x->to_dict) { | |
| 21244 | + cJSON_DeleteToDict(x->to_dict); | |
| 21245 | + } | |
| 21116 | 21246 | if (NULL != x->to_json) { |
| 21117 | 21247 | cJSON_DeleteToJson(x->to_json); |
| 21118 | 21248 | } |
| @@ -21143,6 +21273,9 @@ void cJSON_DeleteObj5(struct Obj5 * x) { | ||
| 21143 | 21273 | if (NULL != x->undefined) { |
| 21144 | 21274 | cJSON_DeleteUndefined(x->undefined); |
| 21145 | 21275 | } |
| 21276 | + if (NULL != x->unmarshal_json) { | |
| 21277 | + cJSON_DeleteUnmarshalJson(x->unmarshal_json); | |
| 21278 | + } | |
| 21146 | 21279 | if (NULL != x->unowned) { |
| 21147 | 21280 | cJSON_DeleteUnowned(x->unowned); |
| 21148 | 21281 | } |
| @@ -21152,9 +21285,61 @@ void cJSON_DeleteObj5(struct Obj5 * x) { | ||
| 21152 | 21285 | if (NULL != x->use_serializers) { |
| 21153 | 21286 | cJSON_DeleteUseSerializers(x->use_serializers); |
| 21154 | 21287 | } |
| 21155 | - if (NULL != x->ushort) { | |
| 21156 | - cJSON_DeleteUshort(x->ushort); | |
| 21288 | + cJSON_free(x); | |
| 21289 | + } | |
| 21290 | +} | |
| 21291 | + | |
| 21292 | +struct Unsigned * cJSON_ParseUnsigned(const char * s) { | |
| 21293 | + struct Unsigned * x = NULL; | |
| 21294 | + if (NULL != s) { | |
| 21295 | + cJSON * j = cJSON_Parse(s); | |
| 21296 | + if (NULL != j) { | |
| 21297 | + x = cJSON_GetUnsignedValue(j); | |
| 21298 | + cJSON_Delete(j); | |
| 21157 | 21299 | } |
| 21300 | + } | |
| 21301 | + return x; | |
| 21302 | +} | |
| 21303 | + | |
| 21304 | +struct Unsigned * cJSON_GetUnsignedValue(const cJSON * j) { | |
| 21305 | + struct Unsigned * x = NULL; | |
| 21306 | + if (NULL != j) { | |
| 21307 | + if (NULL != (x = cJSON_malloc(sizeof(struct Unsigned)))) { | |
| 21308 | + memset(x, 0, sizeof(struct Unsigned)); | |
| 21309 | + if (!cJSON_HasObjectItem(j, "unsigned")) { cJSON_DeleteUnsigned(x); return NULL; } | |
| 21310 | + if (cJSON_HasObjectItem(j, "unsigned")) { | |
| 21311 | + if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "unsigned"))) { cJSON_DeleteUnsigned(x); return NULL; } | |
| 21312 | + x->unsigned_unsigned = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "unsigned")); | |
| 21313 | + } | |
| 21314 | + } | |
| 21315 | + } | |
| 21316 | + return x; | |
| 21317 | +} | |
| 21318 | + | |
| 21319 | +cJSON * cJSON_CreateUnsigned(const struct Unsigned * x) { | |
| 21320 | + cJSON * j = NULL; | |
| 21321 | + if (NULL != x) { | |
| 21322 | + if (NULL != (j = cJSON_CreateObject())) { | |
| 21323 | + cJSON_AddNumberToObject(j, "unsigned", x->unsigned_unsigned); | |
| 21324 | + } | |
| 21325 | + } | |
| 21326 | + return j; | |
| 21327 | +} | |
| 21328 | + | |
| 21329 | +char * cJSON_PrintUnsigned(const struct Unsigned * x) { | |
| 21330 | + char * s = NULL; | |
| 21331 | + if (NULL != x) { | |
| 21332 | + cJSON * j = cJSON_CreateUnsigned(x); | |
| 21333 | + if (NULL != j) { | |
| 21334 | + s = cJSON_Print(j); | |
| 21335 | + cJSON_Delete(j); | |
| 21336 | + } | |
| 21337 | + } | |
| 21338 | + return s; | |
| 21339 | +} | |
| 21340 | + | |
| 21341 | +void cJSON_DeleteUnsigned(struct Unsigned * x) { | |
| 21342 | + if (NULL != x) { | |
| 21158 | 21343 | cJSON_free(x); |
| 21159 | 21344 | } |
| 21160 | 21345 | } |
| @@ -21599,6 +21784,61 @@ void cJSON_DeleteXorEq(struct XorEq * x) { | ||
| 21599 | 21784 | } |
| 21600 | 21785 | } |
| 21601 | 21786 | |
| 21787 | +struct Ushort * cJSON_ParseUshort(const char * s) { | |
| 21788 | + struct Ushort * x = NULL; | |
| 21789 | + if (NULL != s) { | |
| 21790 | + cJSON * j = cJSON_Parse(s); | |
| 21791 | + if (NULL != j) { | |
| 21792 | + x = cJSON_GetUshortValue(j); | |
| 21793 | + cJSON_Delete(j); | |
| 21794 | + } | |
| 21795 | + } | |
| 21796 | + return x; | |
| 21797 | +} | |
| 21798 | + | |
| 21799 | +struct Ushort * cJSON_GetUshortValue(const cJSON * j) { | |
| 21800 | + struct Ushort * x = NULL; | |
| 21801 | + if (NULL != j) { | |
| 21802 | + if (NULL != (x = cJSON_malloc(sizeof(struct Ushort)))) { | |
| 21803 | + memset(x, 0, sizeof(struct Ushort)); | |
| 21804 | + if (!cJSON_HasObjectItem(j, "ushort")) { cJSON_DeleteUshort(x); return NULL; } | |
| 21805 | + if (cJSON_HasObjectItem(j, "ushort")) { | |
| 21806 | + if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "ushort"))) { cJSON_DeleteUshort(x); return NULL; } | |
| 21807 | + x->ushort = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "ushort")); | |
| 21808 | + } | |
| 21809 | + } | |
| 21810 | + } | |
| 21811 | + return x; | |
| 21812 | +} | |
| 21813 | + | |
| 21814 | +cJSON * cJSON_CreateUshort(const struct Ushort * x) { | |
| 21815 | + cJSON * j = NULL; | |
| 21816 | + if (NULL != x) { | |
| 21817 | + if (NULL != (j = cJSON_CreateObject())) { | |
| 21818 | + cJSON_AddNumberToObject(j, "ushort", x->ushort); | |
| 21819 | + } | |
| 21820 | + } | |
| 21821 | + return j; | |
| 21822 | +} | |
| 21823 | + | |
| 21824 | +char * cJSON_PrintUshort(const struct Ushort * x) { | |
| 21825 | + char * s = NULL; | |
| 21826 | + if (NULL != x) { | |
| 21827 | + cJSON * j = cJSON_CreateUshort(x); | |
| 21828 | + if (NULL != j) { | |
| 21829 | + s = cJSON_Print(j); | |
| 21830 | + cJSON_Delete(j); | |
| 21831 | + } | |
| 21832 | + } | |
| 21833 | + return s; | |
| 21834 | +} | |
| 21835 | + | |
| 21836 | +void cJSON_DeleteUshort(struct Ushort * x) { | |
| 21837 | + if (NULL != x) { | |
| 21838 | + cJSON_free(x); | |
| 21839 | + } | |
| 21840 | +} | |
| 21841 | + | |
| 21602 | 21842 | struct Utf8JsonReader * cJSON_ParseUtf8JsonReader(const char * s) { |
| 21603 | 21843 | struct Utf8JsonReader * x = NULL; |
| 21604 | 21844 | if (NULL != s) { |
| @@ -22171,6 +22411,12 @@ struct Obj6 * cJSON_GetObj6Value(const cJSON * j) { | ||
| 22171 | 22411 | if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "dummy"))) { cJSON_DeleteObj6(x); return NULL; } |
| 22172 | 22412 | x->dummy = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "dummy")); |
| 22173 | 22413 | } |
| 22414 | + if (!cJSON_HasObjectItem(j, "unsigned")) { cJSON_DeleteObj6(x); return NULL; } | |
| 22415 | + if (cJSON_HasObjectItem(j, "unsigned")) { | |
| 22416 | + if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "unsigned"))) { cJSON_DeleteObj6(x); return NULL; } | |
| 22417 | + x->obj6_unsigned = cJSON_GetUnsignedValue(cJSON_GetObjectItemCaseSensitive(j, "unsigned")); | |
| 22418 | + if (NULL == x->obj6_unsigned) { cJSON_DeleteObj6(x); return NULL; } | |
| 22419 | + } | |
| 22174 | 22420 | if (!cJSON_HasObjectItem(j, "using")) { cJSON_DeleteObj6(x); return NULL; } |
| 22175 | 22421 | if (cJSON_HasObjectItem(j, "using")) { |
| 22176 | 22422 | if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "using"))) { cJSON_DeleteObj6(x); return NULL; } |
| @@ -22219,6 +22465,12 @@ struct Obj6 * cJSON_GetObj6Value(const cJSON * j) { | ||
| 22219 | 22465 | x->obj6_xor_eq = cJSON_GetXorEqValue(cJSON_GetObjectItemCaseSensitive(j, "xor_eq")); |
| 22220 | 22466 | if (NULL == x->obj6_xor_eq) { cJSON_DeleteObj6(x); return NULL; } |
| 22221 | 22467 | } |
| 22468 | + if (!cJSON_HasObjectItem(j, "ushort")) { cJSON_DeleteObj6(x); return NULL; } | |
| 22469 | + if (cJSON_HasObjectItem(j, "ushort")) { | |
| 22470 | + if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "ushort"))) { cJSON_DeleteObj6(x); return NULL; } | |
| 22471 | + x->ushort = cJSON_GetUshortValue(cJSON_GetObjectItemCaseSensitive(j, "ushort")); | |
| 22472 | + if (NULL == x->ushort) { cJSON_DeleteObj6(x); return NULL; } | |
| 22473 | + } | |
| 22222 | 22474 | if (!cJSON_HasObjectItem(j, "Utf8JsonReader")) { cJSON_DeleteObj6(x); return NULL; } |
| 22223 | 22475 | if (cJSON_HasObjectItem(j, "Utf8JsonReader")) { |
| 22224 | 22476 | if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "Utf8JsonReader"))) { cJSON_DeleteObj6(x); return NULL; } |
| @@ -22289,6 +22541,7 @@ cJSON * cJSON_CreateObj6(const struct Obj6 * x) { | ||
| 22289 | 22541 | if (NULL != x) { |
| 22290 | 22542 | if (NULL != (j = cJSON_CreateObject())) { |
| 22291 | 22543 | cJSON_AddNumberToObject(j, "dummy", x->dummy); |
| 22544 | + cJSON_AddItemToObject(j, "unsigned", cJSON_CreateUnsigned(x->obj6_unsigned)); | |
| 22292 | 22545 | cJSON_AddItemToObject(j, "using", cJSON_CreateUsing(x->obj6_using)); |
| 22293 | 22546 | cJSON_AddItemToObject(j, "virtual", cJSON_CreateVirtual(x->obj6_virtual)); |
| 22294 | 22547 | cJSON_AddItemToObject(j, "void", cJSON_CreateVoid(x->obj6_void)); |
| @@ -22297,6 +22550,7 @@ cJSON * cJSON_CreateObj6(const struct Obj6 * x) { | ||
| 22297 | 22550 | cJSON_AddItemToObject(j, "while", cJSON_CreateWhile(x->obj6_while)); |
| 22298 | 22551 | cJSON_AddItemToObject(j, "xor", cJSON_CreateXor(x->obj6_xor)); |
| 22299 | 22552 | cJSON_AddItemToObject(j, "xor_eq", cJSON_CreateXorEq(x->obj6_xor_eq)); |
| 22553 | + cJSON_AddItemToObject(j, "ushort", cJSON_CreateUshort(x->ushort)); | |
| 22300 | 22554 | cJSON_AddItemToObject(j, "Utf8JsonReader", cJSON_CreateUtf8JsonReader(x->utf8_json_reader)); |
| 22301 | 22555 | cJSON_AddItemToObject(j, "Utf8JsonWriter", cJSON_CreateUtf8JsonWriter(x->utf8_json_writer)); |
| 22302 | 22556 | cJSON_AddItemToObject(j, "UUID", cJSON_CreateUuid(x->uuid)); |
| @@ -22326,6 +22580,9 @@ char * cJSON_PrintObj6(const struct Obj6 * x) { | ||
| 22326 | 22580 | |
| 22327 | 22581 | void cJSON_DeleteObj6(struct Obj6 * x) { |
| 22328 | 22582 | if (NULL != x) { |
| 22583 | + if (NULL != x->obj6_unsigned) { | |
| 22584 | + cJSON_DeleteUnsigned(x->obj6_unsigned); | |
| 22585 | + } | |
| 22329 | 22586 | if (NULL != x->obj6_using) { |
| 22330 | 22587 | cJSON_DeleteUsing(x->obj6_using); |
| 22331 | 22588 | } |
| @@ -22350,6 +22607,9 @@ void cJSON_DeleteObj6(struct Obj6 * x) { | ||
| 22350 | 22607 | if (NULL != x->obj6_xor_eq) { |
| 22351 | 22608 | cJSON_DeleteXorEq(x->obj6_xor_eq); |
| 22352 | 22609 | } |
| 22610 | + if (NULL != x->ushort) { | |
| 22611 | + cJSON_DeleteUshort(x->ushort); | |
| 22612 | + } | |
| 22353 | 22613 | if (NULL != x->utf8_json_reader) { |
| 22354 | 22614 | cJSON_DeleteUtf8JsonReader(x->utf8_json_reader); |
| 22355 | 22615 | } |
Mcjsondefault / TopLevel.h+99 −55
| @@ -537,6 +537,10 @@ struct From { | ||
| 537 | 537 | int64_t from; |
| 538 | 538 | }; |
| 539 | 539 | |
| 540 | +struct FromDict { | |
| 541 | + int64_t from_dict; | |
| 542 | +}; | |
| 543 | + | |
| 540 | 544 | struct FromJson { |
| 541 | 545 | int64_t from_json; |
| 542 | 546 | }; |
| @@ -625,10 +629,6 @@ struct Friend { | ||
| 625 | 629 | int64_t friend_friend; |
| 626 | 630 | }; |
| 627 | 631 | |
| 628 | -struct Goto { | |
| 629 | - int64_t goto_goto; | |
| 630 | -}; | |
| 631 | - | |
| 632 | 632 | struct Obj2False { |
| 633 | 633 | int64_t false_false; |
| 634 | 634 | }; |
| @@ -675,6 +675,7 @@ struct Obj2 { | ||
| 675 | 675 | struct Foreach * foreach; |
| 676 | 676 | struct FormatException * format_exception; |
| 677 | 677 | struct From * from; |
| 678 | + struct FromDict * from_dict; | |
| 678 | 679 | struct FromJson * from_json; |
| 679 | 680 | struct Func * func; |
| 680 | 681 | struct Function * function; |
| @@ -697,7 +698,6 @@ struct Obj2 { | ||
| 697 | 698 | struct Float * obj2_float; |
| 698 | 699 | struct For * obj2_for; |
| 699 | 700 | struct Friend * obj2_friend; |
| 700 | - struct Goto * obj2_goto; | |
| 701 | 701 | struct Obj2False * purple_false; |
| 702 | 702 | }; |
| 703 | 703 | |
| @@ -893,6 +893,10 @@ struct MapEntry { | ||
| 893 | 893 | int64_t map_entry; |
| 894 | 894 | }; |
| 895 | 895 | |
| 896 | +struct MarshalJson { | |
| 897 | + int64_t marshal_json; | |
| 898 | +}; | |
| 899 | + | |
| 896 | 900 | struct MetadataPropertyHandling { |
| 897 | 901 | int64_t metadata_property_handling; |
| 898 | 902 | }; |
| @@ -917,6 +921,10 @@ struct No { | ||
| 917 | 921 | int64_t no; |
| 918 | 922 | }; |
| 919 | 923 | |
| 924 | +struct Goto { | |
| 925 | + int64_t goto_goto; | |
| 926 | +}; | |
| 927 | + | |
| 920 | 928 | struct If { |
| 921 | 929 | int64_t if_if; |
| 922 | 930 | }; |
| @@ -953,10 +961,6 @@ struct New { | ||
| 953 | 961 | int64_t new_new; |
| 954 | 962 | }; |
| 955 | 963 | |
| 956 | -struct Noexcept { | |
| 957 | - int64_t noexcept_noexcept; | |
| 958 | -}; | |
| 959 | - | |
| 960 | 964 | struct Obj3 { |
| 961 | 965 | int64_t dummy; |
| 962 | 966 | struct Guard * guard; |
| @@ -1007,12 +1011,14 @@ struct Obj3 { | ||
| 1007 | 1011 | struct Lock * lock; |
| 1008 | 1012 | struct Map * map; |
| 1009 | 1013 | struct MapEntry * map_entry; |
| 1014 | + struct MarshalJson * marshal_json; | |
| 1010 | 1015 | struct MetadataPropertyHandling * metadata_property_handling; |
| 1011 | 1016 | struct Mutating * mutating; |
| 1012 | 1017 | struct Native * native; |
| 1013 | 1018 | struct Newtonsoft * newtonsoft; |
| 1014 | 1019 | struct Nil * nil; |
| 1015 | 1020 | struct No * no; |
| 1021 | + struct Goto * obj3_goto; | |
| 1016 | 1022 | struct If * obj3_if; |
| 1017 | 1023 | struct Import * obj3_import; |
| 1018 | 1024 | struct Inline * obj3_inline; |
| @@ -1022,7 +1028,6 @@ struct Obj3 { | ||
| 1022 | 1028 | struct Mutable * obj3_mutable; |
| 1023 | 1029 | struct Namespace * obj3_namespace; |
| 1024 | 1030 | struct New * obj3_new; |
| 1025 | - struct Noexcept * obj3_noexcept; | |
| 1026 | 1031 | }; |
| 1027 | 1032 | |
| 1028 | 1033 | struct NoSuchMethod { |
| @@ -1065,6 +1070,10 @@ struct NumberClass { | ||
| 1065 | 1070 | int64_t number; |
| 1066 | 1071 | }; |
| 1067 | 1072 | |
| 1073 | +struct Noexcept { | |
| 1074 | + int64_t noexcept_noexcept; | |
| 1075 | +}; | |
| 1076 | + | |
| 1068 | 1077 | struct NoneClass { |
| 1069 | 1078 | int64_t none; |
| 1070 | 1079 | }; |
| @@ -1277,10 +1286,6 @@ struct Sel { | ||
| 1277 | 1286 | int64_t sel; |
| 1278 | 1287 | }; |
| 1279 | 1288 | |
| 1280 | -struct Select { | |
| 1281 | - int64_t select; | |
| 1282 | -}; | |
| 1283 | - | |
| 1284 | 1289 | struct Obj4 { |
| 1285 | 1290 | int64_t dummy; |
| 1286 | 1291 | struct NoSuchMethod * no_such_method; |
| @@ -1293,6 +1298,7 @@ struct Obj4 { | ||
| 1293 | 1298 | struct NsString * ns_string; |
| 1294 | 1299 | struct NullClass * null; |
| 1295 | 1300 | struct NumberClass * number; |
| 1301 | + struct Noexcept * obj4_noexcept; | |
| 1296 | 1302 | struct NoneClass * obj4_none; |
| 1297 | 1303 | struct Not * obj4_not; |
| 1298 | 1304 | struct NotEq * obj4_not_eq; |
| @@ -1346,7 +1352,6 @@ struct Obj4 { | ||
| 1346 | 1352 | struct Sbyte * sbyte; |
| 1347 | 1353 | struct Sealed * sealed; |
| 1348 | 1354 | struct Sel * sel; |
| 1349 | - struct Select * select; | |
| 1350 | 1355 | }; |
| 1351 | 1356 | |
| 1352 | 1357 | struct KSerializer { |
| @@ -1441,10 +1446,6 @@ struct Union { | ||
| 1441 | 1446 | int64_t union_union; |
| 1442 | 1447 | }; |
| 1443 | 1448 | |
| 1444 | -struct Unsigned { | |
| 1445 | - int64_t unsigned_unsigned; | |
| 1446 | -}; | |
| 1447 | - | |
| 1448 | 1449 | struct PrimitiveKind { |
| 1449 | 1450 | int64_t primitive_kind; |
| 1450 | 1451 | }; |
| @@ -1453,6 +1454,10 @@ struct Obj5True { | ||
| 1453 | 1454 | int64_t true_true; |
| 1454 | 1455 | }; |
| 1455 | 1456 | |
| 1457 | +struct Select { | |
| 1458 | + int64_t select; | |
| 1459 | +}; | |
| 1460 | + | |
| 1456 | 1461 | struct Self { |
| 1457 | 1462 | int64_t self; |
| 1458 | 1463 | }; |
| @@ -1549,6 +1554,10 @@ struct TimeZone { | ||
| 1549 | 1554 | int64_t time_zone; |
| 1550 | 1555 | }; |
| 1551 | 1556 | |
| 1557 | +struct ToDict { | |
| 1558 | + int64_t to_dict; | |
| 1559 | +}; | |
| 1560 | + | |
| 1552 | 1561 | struct ToJson { |
| 1553 | 1562 | int64_t to_json; |
| 1554 | 1563 | }; |
| @@ -1589,6 +1598,10 @@ struct Undefined { | ||
| 1589 | 1598 | int64_t undefined; |
| 1590 | 1599 | }; |
| 1591 | 1600 | |
| 1601 | +struct UnmarshalJson { | |
| 1602 | + int64_t unmarshal_json; | |
| 1603 | +}; | |
| 1604 | + | |
| 1592 | 1605 | struct Unowned { |
| 1593 | 1606 | int64_t unowned; |
| 1594 | 1607 | }; |
| @@ -1601,10 +1614,6 @@ struct UseSerializers { | ||
| 1601 | 1614 | int64_t use_serializers; |
| 1602 | 1615 | }; |
| 1603 | 1616 | |
| 1604 | -struct Ushort { | |
| 1605 | - int64_t ushort; | |
| 1606 | -}; | |
| 1607 | - | |
| 1608 | 1617 | struct Obj5 { |
| 1609 | 1618 | int64_t dummy; |
| 1610 | 1619 | struct KSerializer * k_serializer; |
| @@ -1630,9 +1639,9 @@ struct Obj5 { | ||
| 1630 | 1639 | struct Typename * obj5_typename; |
| 1631 | 1640 | struct Typeof * obj5_typeof; |
| 1632 | 1641 | struct Union * obj5_union; |
| 1633 | - struct Unsigned * obj5_unsigned; | |
| 1634 | 1642 | struct PrimitiveKind * primitive_kind; |
| 1635 | 1643 | struct Obj5True * purple_true; |
| 1644 | + struct Select * select; | |
| 1636 | 1645 | struct Self * self; |
| 1637 | 1646 | struct Sendable * sendable; |
| 1638 | 1647 | struct SerialDescriptor * serial_descriptor; |
| @@ -1657,6 +1666,7 @@ struct Obj5 { | ||
| 1657 | 1666 | struct TimeOnly * time_only; |
| 1658 | 1667 | struct TimeOnlyConverter * time_only_converter; |
| 1659 | 1668 | struct TimeZone * time_zone; |
| 1669 | + struct ToDict * to_dict; | |
| 1660 | 1670 | struct ToJson * to_json; |
| 1661 | 1671 | struct ToString * to_string; |
| 1662 | 1672 | struct TopLevelClass * top_level; |
| @@ -1667,10 +1677,14 @@ struct Obj5 { | ||
| 1667 | 1677 | struct Ulong * ulong; |
| 1668 | 1678 | struct Unchecked * unchecked; |
| 1669 | 1679 | struct Undefined * undefined; |
| 1680 | + struct UnmarshalJson * unmarshal_json; | |
| 1670 | 1681 | struct Unowned * unowned; |
| 1671 | 1682 | struct Unsafe * unsafe; |
| 1672 | 1683 | struct UseSerializers * use_serializers; |
| 1673 | - struct Ushort * ushort; | |
| 1684 | +}; | |
| 1685 | + | |
| 1686 | +struct Unsigned { | |
| 1687 | + int64_t unsigned_unsigned; | |
| 1674 | 1688 | }; |
| 1675 | 1689 | |
| 1676 | 1690 | struct Using { |
| @@ -1705,6 +1719,10 @@ struct XorEq { | ||
| 1705 | 1719 | int64_t xor_eq_xor_eq; |
| 1706 | 1720 | }; |
| 1707 | 1721 | |
| 1722 | +struct Ushort { | |
| 1723 | + int64_t ushort; | |
| 1724 | +}; | |
| 1725 | + | |
| 1708 | 1726 | struct Utf8JsonReader { |
| 1709 | 1727 | int64_t utf8_json_reader; |
| 1710 | 1728 | }; |
| @@ -1747,6 +1765,7 @@ struct Yield { | ||
| 1747 | 1765 | |
| 1748 | 1766 | struct Obj6 { |
| 1749 | 1767 | int64_t dummy; |
| 1768 | + struct Unsigned * obj6_unsigned; | |
| 1750 | 1769 | struct Using * obj6_using; |
| 1751 | 1770 | struct Virtual * obj6_virtual; |
| 1752 | 1771 | struct Void * obj6_void; |
| @@ -1755,6 +1774,7 @@ struct Obj6 { | ||
| 1755 | 1774 | struct While * obj6_while; |
| 1756 | 1775 | struct Xor * obj6_xor; |
| 1757 | 1776 | struct XorEq * obj6_xor_eq; |
| 1777 | + struct Ushort * ushort; | |
| 1758 | 1778 | struct Utf8JsonReader * utf8_json_reader; |
| 1759 | 1779 | struct Utf8JsonWriter * utf8_json_writer; |
| 1760 | 1780 | struct Uuid * uuid; |
| @@ -2410,6 +2430,12 @@ cJSON * cJSON_CreateFrom(const struct From * x); | ||
| 2410 | 2430 | char * cJSON_PrintFrom(const struct From * x); |
| 2411 | 2431 | void cJSON_DeleteFrom(struct From * x); |
| 2412 | 2432 | |
| 2433 | +struct FromDict * cJSON_ParseFromDict(const char * s); | |
| 2434 | +struct FromDict * cJSON_GetFromDictValue(const cJSON * j); | |
| 2435 | +cJSON * cJSON_CreateFromDict(const struct FromDict * x); | |
| 2436 | +char * cJSON_PrintFromDict(const struct FromDict * x); | |
| 2437 | +void cJSON_DeleteFromDict(struct FromDict * x); | |
| 2438 | + | |
| 2413 | 2439 | struct FromJson * cJSON_ParseFromJson(const char * s); |
| 2414 | 2440 | struct FromJson * cJSON_GetFromJsonValue(const cJSON * j); |
| 2415 | 2441 | cJSON * cJSON_CreateFromJson(const struct FromJson * x); |
| @@ -2542,12 +2568,6 @@ cJSON * cJSON_CreateFriend(const struct Friend * x); | ||
| 2542 | 2568 | char * cJSON_PrintFriend(const struct Friend * x); |
| 2543 | 2569 | void cJSON_DeleteFriend(struct Friend * x); |
| 2544 | 2570 | |
| 2545 | -struct Goto * cJSON_ParseGoto(const char * s); | |
| 2546 | -struct Goto * cJSON_GetGotoValue(const cJSON * j); | |
| 2547 | -cJSON * cJSON_CreateGoto(const struct Goto * x); | |
| 2548 | -char * cJSON_PrintGoto(const struct Goto * x); | |
| 2549 | -void cJSON_DeleteGoto(struct Goto * x); | |
| 2550 | - | |
| 2551 | 2571 | struct Obj2False * cJSON_ParseObj2False(const char * s); |
| 2552 | 2572 | struct Obj2False * cJSON_GetObj2FalseValue(const cJSON * j); |
| 2553 | 2573 | cJSON * cJSON_CreateObj2False(const struct Obj2False * x); |
| @@ -2848,6 +2868,12 @@ cJSON * cJSON_CreateMapEntry(const struct MapEntry * x); | ||
| 2848 | 2868 | char * cJSON_PrintMapEntry(const struct MapEntry * x); |
| 2849 | 2869 | void cJSON_DeleteMapEntry(struct MapEntry * x); |
| 2850 | 2870 | |
| 2871 | +struct MarshalJson * cJSON_ParseMarshalJson(const char * s); | |
| 2872 | +struct MarshalJson * cJSON_GetMarshalJsonValue(const cJSON * j); | |
| 2873 | +cJSON * cJSON_CreateMarshalJson(const struct MarshalJson * x); | |
| 2874 | +char * cJSON_PrintMarshalJson(const struct MarshalJson * x); | |
| 2875 | +void cJSON_DeleteMarshalJson(struct MarshalJson * x); | |
| 2876 | + | |
| 2851 | 2877 | struct MetadataPropertyHandling * cJSON_ParseMetadataPropertyHandling(const char * s); |
| 2852 | 2878 | struct MetadataPropertyHandling * cJSON_GetMetadataPropertyHandlingValue(const cJSON * j); |
| 2853 | 2879 | cJSON * cJSON_CreateMetadataPropertyHandling(const struct MetadataPropertyHandling * x); |
| @@ -2884,6 +2910,12 @@ cJSON * cJSON_CreateNo(const struct No * x); | ||
| 2884 | 2910 | char * cJSON_PrintNo(const struct No * x); |
| 2885 | 2911 | void cJSON_DeleteNo(struct No * x); |
| 2886 | 2912 | |
| 2913 | +struct Goto * cJSON_ParseGoto(const char * s); | |
| 2914 | +struct Goto * cJSON_GetGotoValue(const cJSON * j); | |
| 2915 | +cJSON * cJSON_CreateGoto(const struct Goto * x); | |
| 2916 | +char * cJSON_PrintGoto(const struct Goto * x); | |
| 2917 | +void cJSON_DeleteGoto(struct Goto * x); | |
| 2918 | + | |
| 2887 | 2919 | struct If * cJSON_ParseIf(const char * s); |
| 2888 | 2920 | struct If * cJSON_GetIfValue(const cJSON * j); |
| 2889 | 2921 | cJSON * cJSON_CreateIf(const struct If * x); |
| @@ -2938,12 +2970,6 @@ cJSON * cJSON_CreateNew(const struct New * x); | ||
| 2938 | 2970 | char * cJSON_PrintNew(const struct New * x); |
| 2939 | 2971 | void cJSON_DeleteNew(struct New * x); |
| 2940 | 2972 | |
| 2941 | -struct Noexcept * cJSON_ParseNoexcept(const char * s); | |
| 2942 | -struct Noexcept * cJSON_GetNoexceptValue(const cJSON * j); | |
| 2943 | -cJSON * cJSON_CreateNoexcept(const struct Noexcept * x); | |
| 2944 | -char * cJSON_PrintNoexcept(const struct Noexcept * x); | |
| 2945 | -void cJSON_DeleteNoexcept(struct Noexcept * x); | |
| 2946 | - | |
| 2947 | 2973 | struct Obj3 * cJSON_ParseObj3(const char * s); |
| 2948 | 2974 | struct Obj3 * cJSON_GetObj3Value(const cJSON * j); |
| 2949 | 2975 | cJSON * cJSON_CreateObj3(const struct Obj3 * x); |
| @@ -3010,6 +3036,12 @@ cJSON * cJSON_CreateNumberClass(const struct NumberClass * x); | ||
| 3010 | 3036 | char * cJSON_PrintNumberClass(const struct NumberClass * x); |
| 3011 | 3037 | void cJSON_DeleteNumberClass(struct NumberClass * x); |
| 3012 | 3038 | |
| 3039 | +struct Noexcept * cJSON_ParseNoexcept(const char * s); | |
| 3040 | +struct Noexcept * cJSON_GetNoexceptValue(const cJSON * j); | |
| 3041 | +cJSON * cJSON_CreateNoexcept(const struct Noexcept * x); | |
| 3042 | +char * cJSON_PrintNoexcept(const struct Noexcept * x); | |
| 3043 | +void cJSON_DeleteNoexcept(struct Noexcept * x); | |
| 3044 | + | |
| 3013 | 3045 | struct NoneClass * cJSON_ParseNoneClass(const char * s); |
| 3014 | 3046 | struct NoneClass * cJSON_GetNoneClassValue(const cJSON * j); |
| 3015 | 3047 | cJSON * cJSON_CreateNoneClass(const struct NoneClass * x); |
| @@ -3328,12 +3360,6 @@ cJSON * cJSON_CreateSel(const struct Sel * x); | ||
| 3328 | 3360 | char * cJSON_PrintSel(const struct Sel * x); |
| 3329 | 3361 | void cJSON_DeleteSel(struct Sel * x); |
| 3330 | 3362 | |
| 3331 | -struct Select * cJSON_ParseSelect(const char * s); | |
| 3332 | -struct Select * cJSON_GetSelectValue(const cJSON * j); | |
| 3333 | -cJSON * cJSON_CreateSelect(const struct Select * x); | |
| 3334 | -char * cJSON_PrintSelect(const struct Select * x); | |
| 3335 | -void cJSON_DeleteSelect(struct Select * x); | |
| 3336 | - | |
| 3337 | 3363 | struct Obj4 * cJSON_ParseObj4(const char * s); |
| 3338 | 3364 | struct Obj4 * cJSON_GetObj4Value(const cJSON * j); |
| 3339 | 3365 | cJSON * cJSON_CreateObj4(const struct Obj4 * x); |
| @@ -3478,12 +3504,6 @@ cJSON * cJSON_CreateUnion(const struct Union * x); | ||
| 3478 | 3504 | char * cJSON_PrintUnion(const struct Union * x); |
| 3479 | 3505 | void cJSON_DeleteUnion(struct Union * x); |
| 3480 | 3506 | |
| 3481 | -struct Unsigned * cJSON_ParseUnsigned(const char * s); | |
| 3482 | -struct Unsigned * cJSON_GetUnsignedValue(const cJSON * j); | |
| 3483 | -cJSON * cJSON_CreateUnsigned(const struct Unsigned * x); | |
| 3484 | -char * cJSON_PrintUnsigned(const struct Unsigned * x); | |
| 3485 | -void cJSON_DeleteUnsigned(struct Unsigned * x); | |
| 3486 | - | |
| 3487 | 3507 | struct PrimitiveKind * cJSON_ParsePrimitiveKind(const char * s); |
| 3488 | 3508 | struct PrimitiveKind * cJSON_GetPrimitiveKindValue(const cJSON * j); |
| 3489 | 3509 | cJSON * cJSON_CreatePrimitiveKind(const struct PrimitiveKind * x); |
| @@ -3496,6 +3516,12 @@ cJSON * cJSON_CreateObj5True(const struct Obj5True * x); | ||
| 3496 | 3516 | char * cJSON_PrintObj5True(const struct Obj5True * x); |
| 3497 | 3517 | void cJSON_DeleteObj5True(struct Obj5True * x); |
| 3498 | 3518 | |
| 3519 | +struct Select * cJSON_ParseSelect(const char * s); | |
| 3520 | +struct Select * cJSON_GetSelectValue(const cJSON * j); | |
| 3521 | +cJSON * cJSON_CreateSelect(const struct Select * x); | |
| 3522 | +char * cJSON_PrintSelect(const struct Select * x); | |
| 3523 | +void cJSON_DeleteSelect(struct Select * x); | |
| 3524 | + | |
| 3499 | 3525 | struct Self * cJSON_ParseSelf(const char * s); |
| 3500 | 3526 | struct Self * cJSON_GetSelfValue(const cJSON * j); |
| 3501 | 3527 | cJSON * cJSON_CreateSelf(const struct Self * x); |
| @@ -3640,6 +3666,12 @@ cJSON * cJSON_CreateTimeZone(const struct TimeZone * x); | ||
| 3640 | 3666 | char * cJSON_PrintTimeZone(const struct TimeZone * x); |
| 3641 | 3667 | void cJSON_DeleteTimeZone(struct TimeZone * x); |
| 3642 | 3668 | |
| 3669 | +struct ToDict * cJSON_ParseToDict(const char * s); | |
| 3670 | +struct ToDict * cJSON_GetToDictValue(const cJSON * j); | |
| 3671 | +cJSON * cJSON_CreateToDict(const struct ToDict * x); | |
| 3672 | +char * cJSON_PrintToDict(const struct ToDict * x); | |
| 3673 | +void cJSON_DeleteToDict(struct ToDict * x); | |
| 3674 | + | |
| 3643 | 3675 | struct ToJson * cJSON_ParseToJson(const char * s); |
| 3644 | 3676 | struct ToJson * cJSON_GetToJsonValue(const cJSON * j); |
| 3645 | 3677 | cJSON * cJSON_CreateToJson(const struct ToJson * x); |
| @@ -3700,6 +3732,12 @@ cJSON * cJSON_CreateUndefined(const struct Undefined * x); | ||
| 3700 | 3732 | char * cJSON_PrintUndefined(const struct Undefined * x); |
| 3701 | 3733 | void cJSON_DeleteUndefined(struct Undefined * x); |
| 3702 | 3734 | |
| 3735 | +struct UnmarshalJson * cJSON_ParseUnmarshalJson(const char * s); | |
| 3736 | +struct UnmarshalJson * cJSON_GetUnmarshalJsonValue(const cJSON * j); | |
| 3737 | +cJSON * cJSON_CreateUnmarshalJson(const struct UnmarshalJson * x); | |
| 3738 | +char * cJSON_PrintUnmarshalJson(const struct UnmarshalJson * x); | |
| 3739 | +void cJSON_DeleteUnmarshalJson(struct UnmarshalJson * x); | |
| 3740 | + | |
| 3703 | 3741 | struct Unowned * cJSON_ParseUnowned(const char * s); |
| 3704 | 3742 | struct Unowned * cJSON_GetUnownedValue(const cJSON * j); |
| 3705 | 3743 | cJSON * cJSON_CreateUnowned(const struct Unowned * x); |
| @@ -3718,18 +3756,18 @@ cJSON * cJSON_CreateUseSerializers(const struct UseSerializers * x); | ||
| 3718 | 3756 | char * cJSON_PrintUseSerializers(const struct UseSerializers * x); |
| 3719 | 3757 | void cJSON_DeleteUseSerializers(struct UseSerializers * x); |
| 3720 | 3758 | |
| 3721 | -struct Ushort * cJSON_ParseUshort(const char * s); | |
| 3722 | -struct Ushort * cJSON_GetUshortValue(const cJSON * j); | |
| 3723 | -cJSON * cJSON_CreateUshort(const struct Ushort * x); | |
| 3724 | -char * cJSON_PrintUshort(const struct Ushort * x); | |
| 3725 | -void cJSON_DeleteUshort(struct Ushort * x); | |
| 3726 | - | |
| 3727 | 3759 | struct Obj5 * cJSON_ParseObj5(const char * s); |
| 3728 | 3760 | struct Obj5 * cJSON_GetObj5Value(const cJSON * j); |
| 3729 | 3761 | cJSON * cJSON_CreateObj5(const struct Obj5 * x); |
| 3730 | 3762 | char * cJSON_PrintObj5(const struct Obj5 * x); |
| 3731 | 3763 | void cJSON_DeleteObj5(struct Obj5 * x); |
| 3732 | 3764 | |
| 3765 | +struct Unsigned * cJSON_ParseUnsigned(const char * s); | |
| 3766 | +struct Unsigned * cJSON_GetUnsignedValue(const cJSON * j); | |
| 3767 | +cJSON * cJSON_CreateUnsigned(const struct Unsigned * x); | |
| 3768 | +char * cJSON_PrintUnsigned(const struct Unsigned * x); | |
| 3769 | +void cJSON_DeleteUnsigned(struct Unsigned * x); | |
| 3770 | + | |
| 3733 | 3771 | struct Using * cJSON_ParseUsing(const char * s); |
| 3734 | 3772 | struct Using * cJSON_GetUsingValue(const cJSON * j); |
| 3735 | 3773 | cJSON * cJSON_CreateUsing(const struct Using * x); |
| @@ -3778,6 +3816,12 @@ cJSON * cJSON_CreateXorEq(const struct XorEq * x); | ||
| 3778 | 3816 | char * cJSON_PrintXorEq(const struct XorEq * x); |
| 3779 | 3817 | void cJSON_DeleteXorEq(struct XorEq * x); |
| 3780 | 3818 | |
| 3819 | +struct Ushort * cJSON_ParseUshort(const char * s); | |
| 3820 | +struct Ushort * cJSON_GetUshortValue(const cJSON * j); | |
| 3821 | +cJSON * cJSON_CreateUshort(const struct Ushort * x); | |
| 3822 | +char * cJSON_PrintUshort(const struct Ushort * x); | |
| 3823 | +void cJSON_DeleteUshort(struct Ushort * x); | |
| 3824 | + | |
| 3781 | 3825 | struct Utf8JsonReader * cJSON_ParseUtf8JsonReader(const char * s); |
| 3782 | 3826 | struct Utf8JsonReader * cJSON_GetUtf8JsonReaderValue(const cJSON * j); |
| 3783 | 3827 | cJSON * cJSON_CreateUtf8JsonReader(const struct Utf8JsonReader * x); |
Mcplusplusdefault / quicktype.hpp+314 −174
| @@ -1823,6 +1823,20 @@ namespace quicktype { | ||
| 1823 | 1823 | void set_from(const int64_t & value) { this->from = value; } |
| 1824 | 1824 | }; |
| 1825 | 1825 | |
| 1826 | + class FromDict { | |
| 1827 | + public: | |
| 1828 | + FromDict() = default; | |
| 1829 | + virtual ~FromDict() = default; | |
| 1830 | + | |
| 1831 | + private: | |
| 1832 | + int64_t from_dict; | |
| 1833 | + | |
| 1834 | + public: | |
| 1835 | + const int64_t & get_from_dict() const { return from_dict; } | |
| 1836 | + int64_t & get_mutable_from_dict() { return from_dict; } | |
| 1837 | + void set_from_dict(const int64_t & value) { this->from_dict = value; } | |
| 1838 | + }; | |
| 1839 | + | |
| 1826 | 1840 | class FromJson { |
| 1827 | 1841 | public: |
| 1828 | 1842 | FromJson() = default; |
| @@ -2131,20 +2145,6 @@ namespace quicktype { | ||
| 2131 | 2145 | void set_friend_friend(const int64_t & value) { this->friend_friend = value; } |
| 2132 | 2146 | }; |
| 2133 | 2147 | |
| 2134 | - class Goto { | |
| 2135 | - public: | |
| 2136 | - Goto() = default; | |
| 2137 | - virtual ~Goto() = default; | |
| 2138 | - | |
| 2139 | - private: | |
| 2140 | - int64_t goto_goto; | |
| 2141 | - | |
| 2142 | - public: | |
| 2143 | - const int64_t & get_goto_goto() const { return goto_goto; } | |
| 2144 | - int64_t & get_mutable_goto_goto() { return goto_goto; } | |
| 2145 | - void set_goto_goto(const int64_t & value) { this->goto_goto = value; } | |
| 2146 | - }; | |
| 2147 | - | |
| 2148 | 2148 | class FalseClass { |
| 2149 | 2149 | public: |
| 2150 | 2150 | FalseClass() = default; |
| @@ -2206,6 +2206,7 @@ namespace quicktype { | ||
| 2206 | 2206 | Foreach foreach; |
| 2207 | 2207 | FormatException format_exception; |
| 2208 | 2208 | From from; |
| 2209 | + FromDict from_dict; | |
| 2209 | 2210 | FromJson from_json; |
| 2210 | 2211 | Func func; |
| 2211 | 2212 | Function function; |
| @@ -2228,7 +2229,6 @@ namespace quicktype { | ||
| 2228 | 2229 | Float obj2_float; |
| 2229 | 2230 | For obj2_for; |
| 2230 | 2231 | Friend obj2_friend; |
| 2231 | - Goto obj2_goto; | |
| 2232 | 2232 | FalseClass purple_false; |
| 2233 | 2233 | |
| 2234 | 2234 | public: |
| @@ -2396,6 +2396,10 @@ namespace quicktype { | ||
| 2396 | 2396 | From & get_mutable_from() { return from; } |
| 2397 | 2397 | void set_from(const From & value) { this->from = value; } |
| 2398 | 2398 | |
| 2399 | + const FromDict & get_from_dict() const { return from_dict; } | |
| 2400 | + FromDict & get_mutable_from_dict() { return from_dict; } | |
| 2401 | + void set_from_dict(const FromDict & value) { this->from_dict = value; } | |
| 2402 | + | |
| 2399 | 2403 | const FromJson & get_from_json() const { return from_json; } |
| 2400 | 2404 | FromJson & get_mutable_from_json() { return from_json; } |
| 2401 | 2405 | void set_from_json(const FromJson & value) { this->from_json = value; } |
| @@ -2484,10 +2488,6 @@ namespace quicktype { | ||
| 2484 | 2488 | Friend & get_mutable_obj2_friend() { return obj2_friend; } |
| 2485 | 2489 | void set_obj2_friend(const Friend & value) { this->obj2_friend = value; } |
| 2486 | 2490 | |
| 2487 | - const Goto & get_obj2_goto() const { return obj2_goto; } | |
| 2488 | - Goto & get_mutable_obj2_goto() { return obj2_goto; } | |
| 2489 | - void set_obj2_goto(const Goto & value) { this->obj2_goto = value; } | |
| 2490 | - | |
| 2491 | 2491 | const FalseClass & get_purple_false() const { return purple_false; } |
| 2492 | 2492 | FalseClass & get_mutable_purple_false() { return purple_false; } |
| 2493 | 2493 | void set_purple_false(const FalseClass & value) { this->purple_false = value; } |
| @@ -3165,6 +3165,20 @@ namespace quicktype { | ||
| 3165 | 3165 | void set_map_entry(const int64_t & value) { this->map_entry = value; } |
| 3166 | 3166 | }; |
| 3167 | 3167 | |
| 3168 | + class MarshalJson { | |
| 3169 | + public: | |
| 3170 | + MarshalJson() = default; | |
| 3171 | + virtual ~MarshalJson() = default; | |
| 3172 | + | |
| 3173 | + private: | |
| 3174 | + int64_t marshal_json; | |
| 3175 | + | |
| 3176 | + public: | |
| 3177 | + const int64_t & get_marshal_json() const { return marshal_json; } | |
| 3178 | + int64_t & get_mutable_marshal_json() { return marshal_json; } | |
| 3179 | + void set_marshal_json(const int64_t & value) { this->marshal_json = value; } | |
| 3180 | + }; | |
| 3181 | + | |
| 3168 | 3182 | class MetadataPropertyHandling { |
| 3169 | 3183 | public: |
| 3170 | 3184 | MetadataPropertyHandling() = default; |
| @@ -3249,6 +3263,20 @@ namespace quicktype { | ||
| 3249 | 3263 | void set_no(const int64_t & value) { this->no = value; } |
| 3250 | 3264 | }; |
| 3251 | 3265 | |
| 3266 | + class Goto { | |
| 3267 | + public: | |
| 3268 | + Goto() = default; | |
| 3269 | + virtual ~Goto() = default; | |
| 3270 | + | |
| 3271 | + private: | |
| 3272 | + int64_t goto_goto; | |
| 3273 | + | |
| 3274 | + public: | |
| 3275 | + const int64_t & get_goto_goto() const { return goto_goto; } | |
| 3276 | + int64_t & get_mutable_goto_goto() { return goto_goto; } | |
| 3277 | + void set_goto_goto(const int64_t & value) { this->goto_goto = value; } | |
| 3278 | + }; | |
| 3279 | + | |
| 3252 | 3280 | class If { |
| 3253 | 3281 | public: |
| 3254 | 3282 | If() = default; |
| @@ -3375,20 +3403,6 @@ namespace quicktype { | ||
| 3375 | 3403 | void set_new_new(const int64_t & value) { this->new_new = value; } |
| 3376 | 3404 | }; |
| 3377 | 3405 | |
| 3378 | - class Noexcept { | |
| 3379 | - public: | |
| 3380 | - Noexcept() = default; | |
| 3381 | - virtual ~Noexcept() = default; | |
| 3382 | - | |
| 3383 | - private: | |
| 3384 | - int64_t noexcept_noexcept; | |
| 3385 | - | |
| 3386 | - public: | |
| 3387 | - const int64_t & get_noexcept_noexcept() const { return noexcept_noexcept; } | |
| 3388 | - int64_t & get_mutable_noexcept_noexcept() { return noexcept_noexcept; } | |
| 3389 | - void set_noexcept_noexcept(const int64_t & value) { this->noexcept_noexcept = value; } | |
| 3390 | - }; | |
| 3391 | - | |
| 3392 | 3406 | class Obj3 { |
| 3393 | 3407 | public: |
| 3394 | 3408 | Obj3() = default; |
| @@ -3444,12 +3458,14 @@ namespace quicktype { | ||
| 3444 | 3458 | Lock lock; |
| 3445 | 3459 | Map map; |
| 3446 | 3460 | MapEntry map_entry; |
| 3461 | + MarshalJson marshal_json; | |
| 3447 | 3462 | MetadataPropertyHandling metadata_property_handling; |
| 3448 | 3463 | Mutating mutating; |
| 3449 | 3464 | Native native; |
| 3450 | 3465 | Newtonsoft newtonsoft; |
| 3451 | 3466 | Nil nil; |
| 3452 | 3467 | No no; |
| 3468 | + Goto obj3_goto; | |
| 3453 | 3469 | If obj3_if; |
| 3454 | 3470 | Import obj3_import; |
| 3455 | 3471 | Inline obj3_inline; |
| @@ -3459,7 +3475,6 @@ namespace quicktype { | ||
| 3459 | 3475 | Mutable obj3_mutable; |
| 3460 | 3476 | Namespace obj3_namespace; |
| 3461 | 3477 | New obj3_new; |
| 3462 | - Noexcept obj3_noexcept; | |
| 3463 | 3478 | |
| 3464 | 3479 | public: |
| 3465 | 3480 | const int64_t & get_dummy() const { return dummy; } |
| @@ -3658,6 +3673,10 @@ namespace quicktype { | ||
| 3658 | 3673 | MapEntry & get_mutable_map_entry() { return map_entry; } |
| 3659 | 3674 | void set_map_entry(const MapEntry & value) { this->map_entry = value; } |
| 3660 | 3675 | |
| 3676 | + const MarshalJson & get_marshal_json() const { return marshal_json; } | |
| 3677 | + MarshalJson & get_mutable_marshal_json() { return marshal_json; } | |
| 3678 | + void set_marshal_json(const MarshalJson & value) { this->marshal_json = value; } | |
| 3679 | + | |
| 3661 | 3680 | const MetadataPropertyHandling & get_metadata_property_handling() const { return metadata_property_handling; } |
| 3662 | 3681 | MetadataPropertyHandling & get_mutable_metadata_property_handling() { return metadata_property_handling; } |
| 3663 | 3682 | void set_metadata_property_handling(const MetadataPropertyHandling & value) { this->metadata_property_handling = value; } |
| @@ -3682,6 +3701,10 @@ namespace quicktype { | ||
| 3682 | 3701 | No & get_mutable_no() { return no; } |
| 3683 | 3702 | void set_no(const No & value) { this->no = value; } |
| 3684 | 3703 | |
| 3704 | + const Goto & get_obj3_goto() const { return obj3_goto; } | |
| 3705 | + Goto & get_mutable_obj3_goto() { return obj3_goto; } | |
| 3706 | + void set_obj3_goto(const Goto & value) { this->obj3_goto = value; } | |
| 3707 | + | |
| 3685 | 3708 | const If & get_obj3_if() const { return obj3_if; } |
| 3686 | 3709 | If & get_mutable_obj3_if() { return obj3_if; } |
| 3687 | 3710 | void set_obj3_if(const If & value) { this->obj3_if = value; } |
| @@ -3717,10 +3740,6 @@ namespace quicktype { | ||
| 3717 | 3740 | const New & get_obj3_new() const { return obj3_new; } |
| 3718 | 3741 | New & get_mutable_obj3_new() { return obj3_new; } |
| 3719 | 3742 | void set_obj3_new(const New & value) { this->obj3_new = value; } |
| 3720 | - | |
| 3721 | - const Noexcept & get_obj3_noexcept() const { return obj3_noexcept; } | |
| 3722 | - Noexcept & get_mutable_obj3_noexcept() { return obj3_noexcept; } | |
| 3723 | - void set_obj3_noexcept(const Noexcept & value) { this->obj3_noexcept = value; } | |
| 3724 | 3743 | }; |
| 3725 | 3744 | |
| 3726 | 3745 | class NoSuchMethod { |
| @@ -3863,6 +3882,20 @@ namespace quicktype { | ||
| 3863 | 3882 | void set_number(const int64_t & value) { this->number = value; } |
| 3864 | 3883 | }; |
| 3865 | 3884 | |
| 3885 | + class Noexcept { | |
| 3886 | + public: | |
| 3887 | + Noexcept() = default; | |
| 3888 | + virtual ~Noexcept() = default; | |
| 3889 | + | |
| 3890 | + private: | |
| 3891 | + int64_t noexcept_noexcept; | |
| 3892 | + | |
| 3893 | + public: | |
| 3894 | + const int64_t & get_noexcept_noexcept() const { return noexcept_noexcept; } | |
| 3895 | + int64_t & get_mutable_noexcept_noexcept() { return noexcept_noexcept; } | |
| 3896 | + void set_noexcept_noexcept(const int64_t & value) { this->noexcept_noexcept = value; } | |
| 3897 | + }; | |
| 3898 | + | |
| 3866 | 3899 | class NoneClass { |
| 3867 | 3900 | public: |
| 3868 | 3901 | NoneClass() = default; |
| @@ -4605,20 +4638,6 @@ namespace quicktype { | ||
| 4605 | 4638 | void set_sel(const int64_t & value) { this->sel = value; } |
| 4606 | 4639 | }; |
| 4607 | 4640 | |
| 4608 | - class Select { | |
| 4609 | - public: | |
| 4610 | - Select() = default; | |
| 4611 | - virtual ~Select() = default; | |
| 4612 | - | |
| 4613 | - private: | |
| 4614 | - int64_t select; | |
| 4615 | - | |
| 4616 | - public: | |
| 4617 | - const int64_t & get_select() const { return select; } | |
| 4618 | - int64_t & get_mutable_select() { return select; } | |
| 4619 | - void set_select(const int64_t & value) { this->select = value; } | |
| 4620 | - }; | |
| 4621 | - | |
| 4622 | 4641 | class Obj4 { |
| 4623 | 4642 | public: |
| 4624 | 4643 | Obj4() = default; |
| @@ -4636,6 +4655,7 @@ namespace quicktype { | ||
| 4636 | 4655 | NsString ns_string; |
| 4637 | 4656 | Null null; |
| 4638 | 4657 | Number number; |
| 4658 | + Noexcept obj4_noexcept; | |
| 4639 | 4659 | NoneClass obj4_none; |
| 4640 | 4660 | Not obj4_not; |
| 4641 | 4661 | NotEq obj4_not_eq; |
| @@ -4689,7 +4709,6 @@ namespace quicktype { | ||
| 4689 | 4709 | Sbyte sbyte; |
| 4690 | 4710 | Sealed sealed; |
| 4691 | 4711 | Sel sel; |
| 4692 | - Select select; | |
| 4693 | 4712 | |
| 4694 | 4713 | public: |
| 4695 | 4714 | const int64_t & get_dummy() const { return dummy; } |
| @@ -4736,6 +4755,10 @@ namespace quicktype { | ||
| 4736 | 4755 | Number & get_mutable_number() { return number; } |
| 4737 | 4756 | void set_number(const Number & value) { this->number = value; } |
| 4738 | 4757 | |
| 4758 | + const Noexcept & get_obj4_noexcept() const { return obj4_noexcept; } | |
| 4759 | + Noexcept & get_mutable_obj4_noexcept() { return obj4_noexcept; } | |
| 4760 | + void set_obj4_noexcept(const Noexcept & value) { this->obj4_noexcept = value; } | |
| 4761 | + | |
| 4739 | 4762 | const NoneClass & get_obj4_none() const { return obj4_none; } |
| 4740 | 4763 | NoneClass & get_mutable_obj4_none() { return obj4_none; } |
| 4741 | 4764 | void set_obj4_none(const NoneClass & value) { this->obj4_none = value; } |
| @@ -4947,10 +4970,6 @@ namespace quicktype { | ||
| 4947 | 4970 | const Sel & get_sel() const { return sel; } |
| 4948 | 4971 | Sel & get_mutable_sel() { return sel; } |
| 4949 | 4972 | void set_sel(const Sel & value) { this->sel = value; } |
| 4950 | - | |
| 4951 | - const Select & get_select() const { return select; } | |
| 4952 | - Select & get_mutable_select() { return select; } | |
| 4953 | - void set_select(const Select & value) { this->select = value; } | |
| 4954 | 4973 | }; |
| 4955 | 4974 | |
| 4956 | 4975 | class KSerializer { |
| @@ -5261,20 +5280,6 @@ namespace quicktype { | ||
| 5261 | 5280 | void set_union_union(const int64_t & value) { this->union_union = value; } |
| 5262 | 5281 | }; |
| 5263 | 5282 | |
| 5264 | - class Unsigned { | |
| 5265 | - public: | |
| 5266 | - Unsigned() = default; | |
| 5267 | - virtual ~Unsigned() = default; | |
| 5268 | - | |
| 5269 | - private: | |
| 5270 | - int64_t unsigned_unsigned; | |
| 5271 | - | |
| 5272 | - public: | |
| 5273 | - const int64_t & get_unsigned_unsigned() const { return unsigned_unsigned; } | |
| 5274 | - int64_t & get_mutable_unsigned_unsigned() { return unsigned_unsigned; } | |
| 5275 | - void set_unsigned_unsigned(const int64_t & value) { this->unsigned_unsigned = value; } | |
| 5276 | - }; | |
| 5277 | - | |
| 5278 | 5283 | class PrimitiveKind { |
| 5279 | 5284 | public: |
| 5280 | 5285 | PrimitiveKind() = default; |
| @@ -5303,6 +5308,20 @@ namespace quicktype { | ||
| 5303 | 5308 | void set_true_true(const int64_t & value) { this->true_true = value; } |
| 5304 | 5309 | }; |
| 5305 | 5310 | |
| 5311 | + class Select { | |
| 5312 | + public: | |
| 5313 | + Select() = default; | |
| 5314 | + virtual ~Select() = default; | |
| 5315 | + | |
| 5316 | + private: | |
| 5317 | + int64_t select; | |
| 5318 | + | |
| 5319 | + public: | |
| 5320 | + const int64_t & get_select() const { return select; } | |
| 5321 | + int64_t & get_mutable_select() { return select; } | |
| 5322 | + void set_select(const int64_t & value) { this->select = value; } | |
| 5323 | + }; | |
| 5324 | + | |
| 5306 | 5325 | class Self { |
| 5307 | 5326 | public: |
| 5308 | 5327 | Self() = default; |
| @@ -5639,6 +5658,20 @@ namespace quicktype { | ||
| 5639 | 5658 | void set_time_zone(const int64_t & value) { this->time_zone = value; } |
| 5640 | 5659 | }; |
| 5641 | 5660 | |
| 5661 | + class ToDict { | |
| 5662 | + public: | |
| 5663 | + ToDict() = default; | |
| 5664 | + virtual ~ToDict() = default; | |
| 5665 | + | |
| 5666 | + private: | |
| 5667 | + int64_t to_dict; | |
| 5668 | + | |
| 5669 | + public: | |
| 5670 | + const int64_t & get_to_dict() const { return to_dict; } | |
| 5671 | + int64_t & get_mutable_to_dict() { return to_dict; } | |
| 5672 | + void set_to_dict(const int64_t & value) { this->to_dict = value; } | |
| 5673 | + }; | |
| 5674 | + | |
| 5642 | 5675 | class ToJson { |
| 5643 | 5676 | public: |
| 5644 | 5677 | ToJson() = default; |
| @@ -5793,6 +5826,20 @@ namespace quicktype { | ||
| 5793 | 5826 | void set_undefined(const int64_t & value) { this->undefined = value; } |
| 5794 | 5827 | }; |
| 5795 | 5828 | |
| 5829 | + class UnmarshalJson { | |
| 5830 | + public: | |
| 5831 | + UnmarshalJson() = default; | |
| 5832 | + virtual ~UnmarshalJson() = default; | |
| 5833 | + | |
| 5834 | + private: | |
| 5835 | + int64_t unmarshal_json; | |
| 5836 | + | |
| 5837 | + public: | |
| 5838 | + const int64_t & get_unmarshal_json() const { return unmarshal_json; } | |
| 5839 | + int64_t & get_mutable_unmarshal_json() { return unmarshal_json; } | |
| 5840 | + void set_unmarshal_json(const int64_t & value) { this->unmarshal_json = value; } | |
| 5841 | + }; | |
| 5842 | + | |
| 5796 | 5843 | class Unowned { |
| 5797 | 5844 | public: |
| 5798 | 5845 | Unowned() = default; |
| @@ -5835,20 +5882,6 @@ namespace quicktype { | ||
| 5835 | 5882 | void set_use_serializers(const int64_t & value) { this->use_serializers = value; } |
| 5836 | 5883 | }; |
| 5837 | 5884 | |
| 5838 | - class Ushort { | |
| 5839 | - public: | |
| 5840 | - Ushort() = default; | |
| 5841 | - virtual ~Ushort() = default; | |
| 5842 | - | |
| 5843 | - private: | |
| 5844 | - int64_t ushort; | |
| 5845 | - | |
| 5846 | - public: | |
| 5847 | - const int64_t & get_ushort() const { return ushort; } | |
| 5848 | - int64_t & get_mutable_ushort() { return ushort; } | |
| 5849 | - void set_ushort(const int64_t & value) { this->ushort = value; } | |
| 5850 | - }; | |
| 5851 | - | |
| 5852 | 5885 | class Obj5 { |
| 5853 | 5886 | public: |
| 5854 | 5887 | Obj5() = default; |
| @@ -5878,9 +5911,9 @@ namespace quicktype { | ||
| 5878 | 5911 | Typeid obj5_typeid; |
| 5879 | 5912 | Typename obj5_typename; |
| 5880 | 5913 | Union obj5_union; |
| 5881 | - Unsigned obj5_unsigned; | |
| 5882 | 5914 | PrimitiveKind primitive_kind; |
| 5883 | 5915 | TrueClass purple_true; |
| 5916 | + Select select; | |
| 5884 | 5917 | Self self; |
| 5885 | 5918 | Sendable sendable; |
| 5886 | 5919 | SerialDescriptor serial_descriptor; |
| @@ -5905,6 +5938,7 @@ namespace quicktype { | ||
| 5905 | 5938 | TimeOnly time_only; |
| 5906 | 5939 | TimeOnlyConverter time_only_converter; |
| 5907 | 5940 | TimeZone time_zone; |
| 5941 | + ToDict to_dict; | |
| 5908 | 5942 | ToJson to_json; |
| 5909 | 5943 | ToString to_string; |
| 5910 | 5944 | TopLevelClass top_level; |
| @@ -5916,10 +5950,10 @@ namespace quicktype { | ||
| 5916 | 5950 | Ulong ulong; |
| 5917 | 5951 | Unchecked unchecked; |
| 5918 | 5952 | Undefined undefined; |
| 5953 | + UnmarshalJson unmarshal_json; | |
| 5919 | 5954 | Unowned unowned; |
| 5920 | 5955 | Unsafe unsafe; |
| 5921 | 5956 | UseSerializers use_serializers; |
| 5922 | - Ushort ushort; | |
| 5923 | 5957 | |
| 5924 | 5958 | public: |
| 5925 | 5959 | const int64_t & get_dummy() const { return dummy; } |
| @@ -6014,10 +6048,6 @@ namespace quicktype { | ||
| 6014 | 6048 | Union & get_mutable_obj5_union() { return obj5_union; } |
| 6015 | 6049 | void set_obj5_union(const Union & value) { this->obj5_union = value; } |
| 6016 | 6050 | |
| 6017 | - const Unsigned & get_obj5_unsigned() const { return obj5_unsigned; } | |
| 6018 | - Unsigned & get_mutable_obj5_unsigned() { return obj5_unsigned; } | |
| 6019 | - void set_obj5_unsigned(const Unsigned & value) { this->obj5_unsigned = value; } | |
| 6020 | - | |
| 6021 | 6051 | const PrimitiveKind & get_primitive_kind() const { return primitive_kind; } |
| 6022 | 6052 | PrimitiveKind & get_mutable_primitive_kind() { return primitive_kind; } |
| 6023 | 6053 | void set_primitive_kind(const PrimitiveKind & value) { this->primitive_kind = value; } |
| @@ -6026,6 +6056,10 @@ namespace quicktype { | ||
| 6026 | 6056 | TrueClass & get_mutable_purple_true() { return purple_true; } |
| 6027 | 6057 | void set_purple_true(const TrueClass & value) { this->purple_true = value; } |
| 6028 | 6058 | |
| 6059 | + const Select & get_select() const { return select; } | |
| 6060 | + Select & get_mutable_select() { return select; } | |
| 6061 | + void set_select(const Select & value) { this->select = value; } | |
| 6062 | + | |
| 6029 | 6063 | const Self & get_self() const { return self; } |
| 6030 | 6064 | Self & get_mutable_self() { return self; } |
| 6031 | 6065 | void set_self(const Self & value) { this->self = value; } |
| @@ -6122,6 +6156,10 @@ namespace quicktype { | ||
| 6122 | 6156 | TimeZone & get_mutable_time_zone() { return time_zone; } |
| 6123 | 6157 | void set_time_zone(const TimeZone & value) { this->time_zone = value; } |
| 6124 | 6158 | |
| 6159 | + const ToDict & get_to_dict() const { return to_dict; } | |
| 6160 | + ToDict & get_mutable_to_dict() { return to_dict; } | |
| 6161 | + void set_to_dict(const ToDict & value) { this->to_dict = value; } | |
| 6162 | + | |
| 6125 | 6163 | const ToJson & get_to_json() const { return to_json; } |
| 6126 | 6164 | ToJson & get_mutable_to_json() { return to_json; } |
| 6127 | 6165 | void set_to_json(const ToJson & value) { this->to_json = value; } |
| @@ -6166,6 +6204,10 @@ namespace quicktype { | ||
| 6166 | 6204 | Undefined & get_mutable_undefined() { return undefined; } |
| 6167 | 6205 | void set_undefined(const Undefined & value) { this->undefined = value; } |
| 6168 | 6206 | |
| 6207 | + const UnmarshalJson & get_unmarshal_json() const { return unmarshal_json; } | |
| 6208 | + UnmarshalJson & get_mutable_unmarshal_json() { return unmarshal_json; } | |
| 6209 | + void set_unmarshal_json(const UnmarshalJson & value) { this->unmarshal_json = value; } | |
| 6210 | + | |
| 6169 | 6211 | const Unowned & get_unowned() const { return unowned; } |
| 6170 | 6212 | Unowned & get_mutable_unowned() { return unowned; } |
| 6171 | 6213 | void set_unowned(const Unowned & value) { this->unowned = value; } |
| @@ -6177,10 +6219,20 @@ namespace quicktype { | ||
| 6177 | 6219 | const UseSerializers & get_use_serializers() const { return use_serializers; } |
| 6178 | 6220 | UseSerializers & get_mutable_use_serializers() { return use_serializers; } |
| 6179 | 6221 | void set_use_serializers(const UseSerializers & value) { this->use_serializers = value; } |
| 6222 | + }; | |
| 6180 | 6223 | |
| 6181 | - const Ushort & get_ushort() const { return ushort; } | |
| 6182 | - Ushort & get_mutable_ushort() { return ushort; } | |
| 6183 | - void set_ushort(const Ushort & value) { this->ushort = value; } | |
| 6224 | + class Unsigned { | |
| 6225 | + public: | |
| 6226 | + Unsigned() = default; | |
| 6227 | + virtual ~Unsigned() = default; | |
| 6228 | + | |
| 6229 | + private: | |
| 6230 | + int64_t unsigned_unsigned; | |
| 6231 | + | |
| 6232 | + public: | |
| 6233 | + const int64_t & get_unsigned_unsigned() const { return unsigned_unsigned; } | |
| 6234 | + int64_t & get_mutable_unsigned_unsigned() { return unsigned_unsigned; } | |
| 6235 | + void set_unsigned_unsigned(const int64_t & value) { this->unsigned_unsigned = value; } | |
| 6184 | 6236 | }; |
| 6185 | 6237 | |
| 6186 | 6238 | class Using { |
| @@ -6295,6 +6347,20 @@ namespace quicktype { | ||
| 6295 | 6347 | void set_xor_eq_xor_eq(const int64_t & value) { this->xor_eq_xor_eq = value; } |
| 6296 | 6348 | }; |
| 6297 | 6349 | |
| 6350 | + class Ushort { | |
| 6351 | + public: | |
| 6352 | + Ushort() = default; | |
| 6353 | + virtual ~Ushort() = default; | |
| 6354 | + | |
| 6355 | + private: | |
| 6356 | + int64_t ushort; | |
| 6357 | + | |
| 6358 | + public: | |
| 6359 | + const int64_t & get_ushort() const { return ushort; } | |
| 6360 | + int64_t & get_mutable_ushort() { return ushort; } | |
| 6361 | + void set_ushort(const int64_t & value) { this->ushort = value; } | |
| 6362 | + }; | |
| 6363 | + | |
| 6298 | 6364 | class Utf8JsonReader { |
| 6299 | 6365 | public: |
| 6300 | 6366 | Utf8JsonReader() = default; |
| @@ -6442,6 +6508,7 @@ namespace quicktype { | ||
| 6442 | 6508 | |
| 6443 | 6509 | private: |
| 6444 | 6510 | int64_t dummy; |
| 6511 | + Unsigned obj6_unsigned; | |
| 6445 | 6512 | Using obj6_using; |
| 6446 | 6513 | Virtual obj6_virtual; |
| 6447 | 6514 | Void obj6_void; |
| @@ -6450,6 +6517,7 @@ namespace quicktype { | ||
| 6450 | 6517 | While obj6_while; |
| 6451 | 6518 | Xor obj6_xor; |
| 6452 | 6519 | XorEq obj6_xor_eq; |
| 6520 | + Ushort ushort; | |
| 6453 | 6521 | Utf8JsonReader utf8_json_reader; |
| 6454 | 6522 | Utf8JsonWriter utf8_json_writer; |
| 6455 | 6523 | Uuid uuid; |
| @@ -6466,6 +6534,10 @@ namespace quicktype { | ||
| 6466 | 6534 | int64_t & get_mutable_dummy() { return dummy; } |
| 6467 | 6535 | void set_dummy(const int64_t & value) { this->dummy = value; } |
| 6468 | 6536 | |
| 6537 | + const Unsigned & get_obj6_unsigned() const { return obj6_unsigned; } | |
| 6538 | + Unsigned & get_mutable_obj6_unsigned() { return obj6_unsigned; } | |
| 6539 | + void set_obj6_unsigned(const Unsigned & value) { this->obj6_unsigned = value; } | |
| 6540 | + | |
| 6469 | 6541 | const Using & get_obj6_using() const { return obj6_using; } |
| 6470 | 6542 | Using & get_mutable_obj6_using() { return obj6_using; } |
| 6471 | 6543 | void set_obj6_using(const Using & value) { this->obj6_using = value; } |
| @@ -6498,6 +6570,10 @@ namespace quicktype { | ||
| 6498 | 6570 | XorEq & get_mutable_obj6_xor_eq() { return obj6_xor_eq; } |
| 6499 | 6571 | void set_obj6_xor_eq(const XorEq & value) { this->obj6_xor_eq = value; } |
| 6500 | 6572 | |
| 6573 | + const Ushort & get_ushort() const { return ushort; } | |
| 6574 | + Ushort & get_mutable_ushort() { return ushort; } | |
| 6575 | + void set_ushort(const Ushort & value) { this->ushort = value; } | |
| 6576 | + | |
| 6501 | 6577 | const Utf8JsonReader & get_utf8_json_reader() const { return utf8_json_reader; } |
| 6502 | 6578 | Utf8JsonReader & get_mutable_utf8_json_reader() { return utf8_json_reader; } |
| 6503 | 6579 | void set_utf8_json_reader(const Utf8JsonReader & value) { this->utf8_json_reader = value; } |
| @@ -6900,6 +6976,9 @@ namespace quicktype { | ||
| 6900 | 6976 | void from_json(const json & j, From & x); |
| 6901 | 6977 | void to_json(json & j, const From & x); |
| 6902 | 6978 | |
| 6979 | + void from_json(const json & j, FromDict & x); | |
| 6980 | + void to_json(json & j, const FromDict & x); | |
| 6981 | + | |
| 6903 | 6982 | void from_json(const json & j, FromJson & x); |
| 6904 | 6983 | void to_json(json & j, const FromJson & x); |
| 6905 | 6984 | |
| @@ -6966,9 +7045,6 @@ namespace quicktype { | ||
| 6966 | 7045 | void from_json(const json & j, Friend & x); |
| 6967 | 7046 | void to_json(json & j, const Friend & x); |
| 6968 | 7047 | |
| 6969 | - void from_json(const json & j, Goto & x); | |
| 6970 | - void to_json(json & j, const Goto & x); | |
| 6971 | - | |
| 6972 | 7048 | void from_json(const json & j, FalseClass & x); |
| 6973 | 7049 | void to_json(json & j, const FalseClass & x); |
| 6974 | 7050 | |
| @@ -7119,6 +7195,9 @@ namespace quicktype { | ||
| 7119 | 7195 | void from_json(const json & j, MapEntry & x); |
| 7120 | 7196 | void to_json(json & j, const MapEntry & x); |
| 7121 | 7197 | |
| 7198 | + void from_json(const json & j, MarshalJson & x); | |
| 7199 | + void to_json(json & j, const MarshalJson & x); | |
| 7200 | + | |
| 7122 | 7201 | void from_json(const json & j, MetadataPropertyHandling & x); |
| 7123 | 7202 | void to_json(json & j, const MetadataPropertyHandling & x); |
| 7124 | 7203 | |
| @@ -7137,6 +7216,9 @@ namespace quicktype { | ||
| 7137 | 7216 | void from_json(const json & j, No & x); |
| 7138 | 7217 | void to_json(json & j, const No & x); |
| 7139 | 7218 | |
| 7219 | + void from_json(const json & j, Goto & x); | |
| 7220 | + void to_json(json & j, const Goto & x); | |
| 7221 | + | |
| 7140 | 7222 | void from_json(const json & j, If & x); |
| 7141 | 7223 | void to_json(json & j, const If & x); |
| 7142 | 7224 | |
| @@ -7164,9 +7246,6 @@ namespace quicktype { | ||
| 7164 | 7246 | void from_json(const json & j, New & x); |
| 7165 | 7247 | void to_json(json & j, const New & x); |
| 7166 | 7248 | |
| 7167 | - void from_json(const json & j, Noexcept & x); | |
| 7168 | - void to_json(json & j, const Noexcept & x); | |
| 7169 | - | |
| 7170 | 7249 | void from_json(const json & j, Obj3 & x); |
| 7171 | 7250 | void to_json(json & j, const Obj3 & x); |
| 7172 | 7251 | |
| @@ -7200,6 +7279,9 @@ namespace quicktype { | ||
| 7200 | 7279 | void from_json(const json & j, Number & x); |
| 7201 | 7280 | void to_json(json & j, const Number & x); |
| 7202 | 7281 | |
| 7282 | + void from_json(const json & j, Noexcept & x); | |
| 7283 | + void to_json(json & j, const Noexcept & x); | |
| 7284 | + | |
| 7203 | 7285 | void from_json(const json & j, NoneClass & x); |
| 7204 | 7286 | void to_json(json & j, const NoneClass & x); |
| 7205 | 7287 | |
| @@ -7359,9 +7441,6 @@ namespace quicktype { | ||
| 7359 | 7441 | void from_json(const json & j, Sel & x); |
| 7360 | 7442 | void to_json(json & j, const Sel & x); |
| 7361 | 7443 | |
| 7362 | - void from_json(const json & j, Select & x); | |
| 7363 | - void to_json(json & j, const Select & x); | |
| 7364 | - | |
| 7365 | 7444 | void from_json(const json & j, Obj4 & x); |
| 7366 | 7445 | void to_json(json & j, const Obj4 & x); |
| 7367 | 7446 | |
| @@ -7431,15 +7510,15 @@ namespace quicktype { | ||
| 7431 | 7510 | void from_json(const json & j, Union & x); |
| 7432 | 7511 | void to_json(json & j, const Union & x); |
| 7433 | 7512 | |
| 7434 | - void from_json(const json & j, Unsigned & x); | |
| 7435 | - void to_json(json & j, const Unsigned & x); | |
| 7436 | - | |
| 7437 | 7513 | void from_json(const json & j, PrimitiveKind & x); |
| 7438 | 7514 | void to_json(json & j, const PrimitiveKind & x); |
| 7439 | 7515 | |
| 7440 | 7516 | void from_json(const json & j, TrueClass & x); |
| 7441 | 7517 | void to_json(json & j, const TrueClass & x); |
| 7442 | 7518 | |
| 7519 | + void from_json(const json & j, Select & x); | |
| 7520 | + void to_json(json & j, const Select & x); | |
| 7521 | + | |
| 7443 | 7522 | void from_json(const json & j, Self & x); |
| 7444 | 7523 | void to_json(json & j, const Self & x); |
| 7445 | 7524 | |
| @@ -7512,6 +7591,9 @@ namespace quicktype { | ||
| 7512 | 7591 | void from_json(const json & j, TimeZone & x); |
| 7513 | 7592 | void to_json(json & j, const TimeZone & x); |
| 7514 | 7593 | |
| 7594 | + void from_json(const json & j, ToDict & x); | |
| 7595 | + void to_json(json & j, const ToDict & x); | |
| 7596 | + | |
| 7515 | 7597 | void from_json(const json & j, ToJson & x); |
| 7516 | 7598 | void to_json(json & j, const ToJson & x); |
| 7517 | 7599 | |
| @@ -7545,6 +7627,9 @@ namespace quicktype { | ||
| 7545 | 7627 | void from_json(const json & j, Undefined & x); |
| 7546 | 7628 | void to_json(json & j, const Undefined & x); |
| 7547 | 7629 | |
| 7630 | + void from_json(const json & j, UnmarshalJson & x); | |
| 7631 | + void to_json(json & j, const UnmarshalJson & x); | |
| 7632 | + | |
| 7548 | 7633 | void from_json(const json & j, Unowned & x); |
| 7549 | 7634 | void to_json(json & j, const Unowned & x); |
| 7550 | 7635 | |
| @@ -7554,12 +7639,12 @@ namespace quicktype { | ||
| 7554 | 7639 | void from_json(const json & j, UseSerializers & x); |
| 7555 | 7640 | void to_json(json & j, const UseSerializers & x); |
| 7556 | 7641 | |
| 7557 | - void from_json(const json & j, Ushort & x); | |
| 7558 | - void to_json(json & j, const Ushort & x); | |
| 7559 | - | |
| 7560 | 7642 | void from_json(const json & j, Obj5 & x); |
| 7561 | 7643 | void to_json(json & j, const Obj5 & x); |
| 7562 | 7644 | |
| 7645 | + void from_json(const json & j, Unsigned & x); | |
| 7646 | + void to_json(json & j, const Unsigned & x); | |
| 7647 | + | |
| 7563 | 7648 | void from_json(const json & j, Using & x); |
| 7564 | 7649 | void to_json(json & j, const Using & x); |
| 7565 | 7650 | |
| @@ -7584,6 +7669,9 @@ namespace quicktype { | ||
| 7584 | 7669 | void from_json(const json & j, XorEq & x); |
| 7585 | 7670 | void to_json(json & j, const XorEq & x); |
| 7586 | 7671 | |
| 7672 | + void from_json(const json & j, Ushort & x); | |
| 7673 | + void to_json(json & j, const Ushort & x); | |
| 7674 | + | |
| 7587 | 7675 | void from_json(const json & j, Utf8JsonReader & x); |
| 7588 | 7676 | void to_json(json & j, const Utf8JsonReader & x); |
| 7589 | 7677 | |
| @@ -8905,6 +8993,17 @@ namespace quicktype { | ||
| 8905 | 8993 | j["from"] = x.get_from(); |
| 8906 | 8994 | } |
| 8907 | 8995 | |
| 8996 | + inline void from_json(const json & j, FromDict& x) { | |
| 8997 | + if (!j.is_object()) throw std::runtime_error("Expected object"); | |
| 8998 | + if (j.find("from_dict") != j.end() && !j.at("from_dict").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8999 | + x.set_from_dict(j.at("from_dict").get<int64_t>()); | |
| 9000 | + } | |
| 9001 | + | |
| 9002 | + inline void to_json(json & j, const FromDict & x) { | |
| 9003 | + j = json::object(); | |
| 9004 | + j["from_dict"] = x.get_from_dict(); | |
| 9005 | + } | |
| 9006 | + | |
| 8908 | 9007 | inline void from_json(const json & j, FromJson& x) { |
| 8909 | 9008 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8910 | 9009 | if (j.find("from_json") != j.end() && !j.at("from_json").is_number_integer()) throw std::runtime_error("Expected integer"); |
| @@ -9147,17 +9246,6 @@ namespace quicktype { | ||
| 9147 | 9246 | j["friend"] = x.get_friend_friend(); |
| 9148 | 9247 | } |
| 9149 | 9248 | |
| 9150 | - inline void from_json(const json & j, Goto& x) { | |
| 9151 | - if (!j.is_object()) throw std::runtime_error("Expected object"); | |
| 9152 | - if (j.find("goto") != j.end() && !j.at("goto").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9153 | - x.set_goto_goto(j.at("goto").get<int64_t>()); | |
| 9154 | - } | |
| 9155 | - | |
| 9156 | - inline void to_json(json & j, const Goto & x) { | |
| 9157 | - j = json::object(); | |
| 9158 | - j["goto"] = x.get_goto_goto(); | |
| 9159 | - } | |
| 9160 | - | |
| 9161 | 9249 | inline void from_json(const json & j, FalseClass& x) { |
| 9162 | 9250 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9163 | 9251 | if (j.find("false") != j.end() && !j.at("false").is_number_integer()) throw std::runtime_error("Expected integer"); |
| @@ -9213,6 +9301,7 @@ namespace quicktype { | ||
| 9213 | 9301 | x.set_foreach(j.at("foreach").get<Foreach>()); |
| 9214 | 9302 | x.set_format_exception(j.at("FormatException").get<FormatException>()); |
| 9215 | 9303 | x.set_from(j.at("from").get<From>()); |
| 9304 | + x.set_from_dict(j.at("from_dict").get<FromDict>()); | |
| 9216 | 9305 | x.set_from_json(j.at("from_json").get<FromJson>()); |
| 9217 | 9306 | x.set_func(j.at("func").get<Func>()); |
| 9218 | 9307 | x.set_function(j.at("function").get<Function>()); |
| @@ -9235,7 +9324,6 @@ namespace quicktype { | ||
| 9235 | 9324 | x.set_obj2_float(j.at("float").get<Float>()); |
| 9236 | 9325 | x.set_obj2_for(j.at("for").get<For>()); |
| 9237 | 9326 | x.set_obj2_friend(j.at("friend").get<Friend>()); |
| 9238 | - x.set_obj2_goto(j.at("goto").get<Goto>()); | |
| 9239 | 9327 | x.set_purple_false(j.at("false").get<FalseClass>()); |
| 9240 | 9328 | } |
| 9241 | 9329 | |
| @@ -9282,6 +9370,7 @@ namespace quicktype { | ||
| 9282 | 9370 | j["foreach"] = x.get_foreach(); |
| 9283 | 9371 | j["FormatException"] = x.get_format_exception(); |
| 9284 | 9372 | j["from"] = x.get_from(); |
| 9373 | + j["from_dict"] = x.get_from_dict(); | |
| 9285 | 9374 | j["from_json"] = x.get_from_json(); |
| 9286 | 9375 | j["func"] = x.get_func(); |
| 9287 | 9376 | j["function"] = x.get_function(); |
| @@ -9304,7 +9393,6 @@ namespace quicktype { | ||
| 9304 | 9393 | j["float"] = x.get_obj2_float(); |
| 9305 | 9394 | j["for"] = x.get_obj2_for(); |
| 9306 | 9395 | j["friend"] = x.get_obj2_friend(); |
| 9307 | - j["goto"] = x.get_obj2_goto(); | |
| 9308 | 9396 | j["false"] = x.get_purple_false(); |
| 9309 | 9397 | } |
| 9310 | 9398 | |
| @@ -9835,6 +9923,17 @@ namespace quicktype { | ||
| 9835 | 9923 | j["MapEntry"] = x.get_map_entry(); |
| 9836 | 9924 | } |
| 9837 | 9925 | |
| 9926 | + inline void from_json(const json & j, MarshalJson& x) { | |
| 9927 | + if (!j.is_object()) throw std::runtime_error("Expected object"); | |
| 9928 | + if (j.find("MarshalJSON") != j.end() && !j.at("MarshalJSON").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9929 | + x.set_marshal_json(j.at("MarshalJSON").get<int64_t>()); | |
| 9930 | + } | |
| 9931 | + | |
| 9932 | + inline void to_json(json & j, const MarshalJson & x) { | |
| 9933 | + j = json::object(); | |
| 9934 | + j["MarshalJSON"] = x.get_marshal_json(); | |
| 9935 | + } | |
| 9936 | + | |
| 9838 | 9937 | inline void from_json(const json & j, MetadataPropertyHandling& x) { |
| 9839 | 9938 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9840 | 9939 | if (j.find("metadata_property_handling") != j.end() && !j.at("metadata_property_handling").is_number_integer()) throw std::runtime_error("Expected integer"); |
| @@ -9901,6 +10000,17 @@ namespace quicktype { | ||
| 9901 | 10000 | j["NO"] = x.get_no(); |
| 9902 | 10001 | } |
| 9903 | 10002 | |
| 10003 | + inline void from_json(const json & j, Goto& x) { | |
| 10004 | + if (!j.is_object()) throw std::runtime_error("Expected object"); | |
| 10005 | + if (j.find("goto") != j.end() && !j.at("goto").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 10006 | + x.set_goto_goto(j.at("goto").get<int64_t>()); | |
| 10007 | + } | |
| 10008 | + | |
| 10009 | + inline void to_json(json & j, const Goto & x) { | |
| 10010 | + j = json::object(); | |
| 10011 | + j["goto"] = x.get_goto_goto(); | |
| 10012 | + } | |
| 10013 | + | |
| 9904 | 10014 | inline void from_json(const json & j, If& x) { |
| 9905 | 10015 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9906 | 10016 | if (j.find("if") != j.end() && !j.at("if").is_number_integer()) throw std::runtime_error("Expected integer"); |
| @@ -10000,17 +10110,6 @@ namespace quicktype { | ||
| 10000 | 10110 | j["new"] = x.get_new_new(); |
| 10001 | 10111 | } |
| 10002 | 10112 | |
| 10003 | - inline void from_json(const json & j, Noexcept& x) { | |
| 10004 | - if (!j.is_object()) throw std::runtime_error("Expected object"); | |
| 10005 | - if (j.find("noexcept") != j.end() && !j.at("noexcept").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 10006 | - x.set_noexcept_noexcept(j.at("noexcept").get<int64_t>()); | |
| 10007 | - } | |
| 10008 | - | |
| 10009 | - inline void to_json(json & j, const Noexcept & x) { | |
| 10010 | - j = json::object(); | |
| 10011 | - j["noexcept"] = x.get_noexcept_noexcept(); | |
| 10012 | - } | |
| 10013 | - | |
| 10014 | 10113 | inline void from_json(const json & j, Obj3& x) { |
| 10015 | 10114 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 10016 | 10115 | if (j.find("dummy") != j.end() && !j.at("dummy").is_number_integer()) throw std::runtime_error("Expected integer"); |
| @@ -10063,12 +10162,14 @@ namespace quicktype { | ||
| 10063 | 10162 | x.set_lock(j.at("lock").get<Lock>()); |
| 10064 | 10163 | x.set_map(j.at("map").get<Map>()); |
| 10065 | 10164 | x.set_map_entry(j.at("MapEntry").get<MapEntry>()); |
| 10165 | + x.set_marshal_json(j.at("MarshalJSON").get<MarshalJson>()); | |
| 10066 | 10166 | x.set_metadata_property_handling(j.at("metadata_property_handling").get<MetadataPropertyHandling>()); |
| 10067 | 10167 | x.set_mutating(j.at("mutating").get<Mutating>()); |
| 10068 | 10168 | x.set_native(j.at("native").get<Native>()); |
| 10069 | 10169 | x.set_newtonsoft(j.at("newtonsoft").get<Newtonsoft>()); |
| 10070 | 10170 | x.set_nil(j.at("nil").get<Nil>()); |
| 10071 | 10171 | x.set_no(j.at("NO").get<No>()); |
| 10172 | + x.set_obj3_goto(j.at("goto").get<Goto>()); | |
| 10072 | 10173 | x.set_obj3_if(j.at("if").get<If>()); |
| 10073 | 10174 | x.set_obj3_import(j.at("import").get<Import>()); |
| 10074 | 10175 | x.set_obj3_inline(j.at("inline").get<Inline>()); |
| @@ -10078,7 +10179,6 @@ namespace quicktype { | ||
| 10078 | 10179 | x.set_obj3_mutable(j.at("mutable").get<Mutable>()); |
| 10079 | 10180 | x.set_obj3_namespace(j.at("namespace").get<Namespace>()); |
| 10080 | 10181 | x.set_obj3_new(j.at("new").get<New>()); |
| 10081 | - x.set_obj3_noexcept(j.at("noexcept").get<Noexcept>()); | |
| 10082 | 10182 | } |
| 10083 | 10183 | |
| 10084 | 10184 | inline void to_json(json & j, const Obj3 & x) { |
| @@ -10132,12 +10232,14 @@ namespace quicktype { | ||
| 10132 | 10232 | j["lock"] = x.get_lock(); |
| 10133 | 10233 | j["map"] = x.get_map(); |
| 10134 | 10234 | j["MapEntry"] = x.get_map_entry(); |
| 10235 | + j["MarshalJSON"] = x.get_marshal_json(); | |
| 10135 | 10236 | j["metadata_property_handling"] = x.get_metadata_property_handling(); |
| 10136 | 10237 | j["mutating"] = x.get_mutating(); |
| 10137 | 10238 | j["native"] = x.get_native(); |
| 10138 | 10239 | j["newtonsoft"] = x.get_newtonsoft(); |
| 10139 | 10240 | j["nil"] = x.get_nil(); |
| 10140 | 10241 | j["NO"] = x.get_no(); |
| 10242 | + j["goto"] = x.get_obj3_goto(); | |
| 10141 | 10243 | j["if"] = x.get_obj3_if(); |
| 10142 | 10244 | j["import"] = x.get_obj3_import(); |
| 10143 | 10245 | j["inline"] = x.get_obj3_inline(); |
| @@ -10147,7 +10249,6 @@ namespace quicktype { | ||
| 10147 | 10249 | j["mutable"] = x.get_obj3_mutable(); |
| 10148 | 10250 | j["namespace"] = x.get_obj3_namespace(); |
| 10149 | 10251 | j["new"] = x.get_obj3_new(); |
| 10150 | - j["noexcept"] = x.get_obj3_noexcept(); | |
| 10151 | 10252 | } |
| 10152 | 10253 | |
| 10153 | 10254 | inline void from_json(const json & j, NoSuchMethod& x) { |
| @@ -10260,6 +10361,17 @@ namespace quicktype { | ||
| 10260 | 10361 | j["number"] = x.get_number(); |
| 10261 | 10362 | } |
| 10262 | 10363 | |
| 10364 | + inline void from_json(const json & j, Noexcept& x) { | |
| 10365 | + if (!j.is_object()) throw std::runtime_error("Expected object"); | |
| 10366 | + if (j.find("noexcept") != j.end() && !j.at("noexcept").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 10367 | + x.set_noexcept_noexcept(j.at("noexcept").get<int64_t>()); | |
| 10368 | + } | |
| 10369 | + | |
| 10370 | + inline void to_json(json & j, const Noexcept & x) { | |
| 10371 | + j = json::object(); | |
| 10372 | + j["noexcept"] = x.get_noexcept_noexcept(); | |
| 10373 | + } | |
| 10374 | + | |
| 10263 | 10375 | inline void from_json(const json & j, NoneClass& x) { |
| 10264 | 10376 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 10265 | 10377 | if (j.find("none") != j.end() && !j.at("none").is_number_integer()) throw std::runtime_error("Expected integer"); |
| @@ -10843,17 +10955,6 @@ namespace quicktype { | ||
| 10843 | 10955 | j["SEL"] = x.get_sel(); |
| 10844 | 10956 | } |
| 10845 | 10957 | |
| 10846 | - inline void from_json(const json & j, Select& x) { | |
| 10847 | - if (!j.is_object()) throw std::runtime_error("Expected object"); | |
| 10848 | - if (j.find("select") != j.end() && !j.at("select").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 10849 | - x.set_select(j.at("select").get<int64_t>()); | |
| 10850 | - } | |
| 10851 | - | |
| 10852 | - inline void to_json(json & j, const Select & x) { | |
| 10853 | - j = json::object(); | |
| 10854 | - j["select"] = x.get_select(); | |
| 10855 | - } | |
| 10856 | - | |
| 10857 | 10958 | inline void from_json(const json & j, Obj4& x) { |
| 10858 | 10959 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 10859 | 10960 | if (j.find("dummy") != j.end() && !j.at("dummy").is_number_integer()) throw std::runtime_error("Expected integer"); |
| @@ -10868,6 +10969,7 @@ namespace quicktype { | ||
| 10868 | 10969 | x.set_ns_string(j.at("NSString").get<NsString>()); |
| 10869 | 10970 | x.set_null(j.at("NULL").get<Null>()); |
| 10870 | 10971 | x.set_number(j.at("number").get<Number>()); |
| 10972 | + x.set_obj4_noexcept(j.at("noexcept").get<Noexcept>()); | |
| 10871 | 10973 | x.set_obj4_none(j.at("none").get<NoneClass>()); |
| 10872 | 10974 | x.set_obj4_not(j.at("not").get<Not>()); |
| 10873 | 10975 | x.set_obj4_not_eq(j.at("not_eq").get<NotEq>()); |
| @@ -10921,7 +11023,6 @@ namespace quicktype { | ||
| 10921 | 11023 | x.set_sbyte(j.at("sbyte").get<Sbyte>()); |
| 10922 | 11024 | x.set_sealed(j.at("sealed").get<Sealed>()); |
| 10923 | 11025 | x.set_sel(j.at("SEL").get<Sel>()); |
| 10924 | - x.set_select(j.at("select").get<Select>()); | |
| 10925 | 11026 | } |
| 10926 | 11027 | |
| 10927 | 11028 | inline void to_json(json & j, const Obj4 & x) { |
| @@ -10937,6 +11038,7 @@ namespace quicktype { | ||
| 10937 | 11038 | j["NSString"] = x.get_ns_string(); |
| 10938 | 11039 | j["NULL"] = x.get_null(); |
| 10939 | 11040 | j["number"] = x.get_number(); |
| 11041 | + j["noexcept"] = x.get_obj4_noexcept(); | |
| 10940 | 11042 | j["none"] = x.get_obj4_none(); |
| 10941 | 11043 | j["not"] = x.get_obj4_not(); |
| 10942 | 11044 | j["not_eq"] = x.get_obj4_not_eq(); |
| @@ -10990,7 +11092,6 @@ namespace quicktype { | ||
| 10990 | 11092 | j["sbyte"] = x.get_sbyte(); |
| 10991 | 11093 | j["sealed"] = x.get_sealed(); |
| 10992 | 11094 | j["SEL"] = x.get_sel(); |
| 10993 | - j["select"] = x.get_select(); | |
| 10994 | 11095 | } |
| 10995 | 11096 | |
| 10996 | 11097 | inline void from_json(const json & j, KSerializer& x) { |
| @@ -11235,17 +11336,6 @@ namespace quicktype { | ||
| 11235 | 11336 | j["union"] = x.get_union_union(); |
| 11236 | 11337 | } |
| 11237 | 11338 | |
| 11238 | - inline void from_json(const json & j, Unsigned& x) { | |
| 11239 | - if (!j.is_object()) throw std::runtime_error("Expected object"); | |
| 11240 | - if (j.find("unsigned") != j.end() && !j.at("unsigned").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 11241 | - x.set_unsigned_unsigned(j.at("unsigned").get<int64_t>()); | |
| 11242 | - } | |
| 11243 | - | |
| 11244 | - inline void to_json(json & j, const Unsigned & x) { | |
| 11245 | - j = json::object(); | |
| 11246 | - j["unsigned"] = x.get_unsigned_unsigned(); | |
| 11247 | - } | |
| 11248 | - | |
| 11249 | 11339 | inline void from_json(const json & j, PrimitiveKind& x) { |
| 11250 | 11340 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 11251 | 11341 | if (j.find("PrimitiveKind") != j.end() && !j.at("PrimitiveKind").is_number_integer()) throw std::runtime_error("Expected integer"); |
| @@ -11268,6 +11358,17 @@ namespace quicktype { | ||
| 11268 | 11358 | j["true"] = x.get_true_true(); |
| 11269 | 11359 | } |
| 11270 | 11360 | |
| 11361 | + inline void from_json(const json & j, Select& x) { | |
| 11362 | + if (!j.is_object()) throw std::runtime_error("Expected object"); | |
| 11363 | + if (j.find("select") != j.end() && !j.at("select").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 11364 | + x.set_select(j.at("select").get<int64_t>()); | |
| 11365 | + } | |
| 11366 | + | |
| 11367 | + inline void to_json(json & j, const Select & x) { | |
| 11368 | + j = json::object(); | |
| 11369 | + j["select"] = x.get_select(); | |
| 11370 | + } | |
| 11371 | + | |
| 11271 | 11372 | inline void from_json(const json & j, Self& x) { |
| 11272 | 11373 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 11273 | 11374 | if (j.find("Self") != j.end() && !j.at("Self").is_number_integer()) throw std::runtime_error("Expected integer"); |
| @@ -11532,6 +11633,17 @@ namespace quicktype { | ||
| 11532 | 11633 | j["TimeZone"] = x.get_time_zone(); |
| 11533 | 11634 | } |
| 11534 | 11635 | |
| 11636 | + inline void from_json(const json & j, ToDict& x) { | |
| 11637 | + if (!j.is_object()) throw std::runtime_error("Expected object"); | |
| 11638 | + if (j.find("to_dict") != j.end() && !j.at("to_dict").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 11639 | + x.set_to_dict(j.at("to_dict").get<int64_t>()); | |
| 11640 | + } | |
| 11641 | + | |
| 11642 | + inline void to_json(json & j, const ToDict & x) { | |
| 11643 | + j = json::object(); | |
| 11644 | + j["to_dict"] = x.get_to_dict(); | |
| 11645 | + } | |
| 11646 | + | |
| 11535 | 11647 | inline void from_json(const json & j, ToJson& x) { |
| 11536 | 11648 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 11537 | 11649 | if (j.find("to_json") != j.end() && !j.at("to_json").is_number_integer()) throw std::runtime_error("Expected integer"); |
| @@ -11653,6 +11765,17 @@ namespace quicktype { | ||
| 11653 | 11765 | j["undefined"] = x.get_undefined(); |
| 11654 | 11766 | } |
| 11655 | 11767 | |
| 11768 | + inline void from_json(const json & j, UnmarshalJson& x) { | |
| 11769 | + if (!j.is_object()) throw std::runtime_error("Expected object"); | |
| 11770 | + if (j.find("UnmarshalJSON") != j.end() && !j.at("UnmarshalJSON").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 11771 | + x.set_unmarshal_json(j.at("UnmarshalJSON").get<int64_t>()); | |
| 11772 | + } | |
| 11773 | + | |
| 11774 | + inline void to_json(json & j, const UnmarshalJson & x) { | |
| 11775 | + j = json::object(); | |
| 11776 | + j["UnmarshalJSON"] = x.get_unmarshal_json(); | |
| 11777 | + } | |
| 11778 | + | |
| 11656 | 11779 | inline void from_json(const json & j, Unowned& x) { |
| 11657 | 11780 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 11658 | 11781 | if (j.find("unowned") != j.end() && !j.at("unowned").is_number_integer()) throw std::runtime_error("Expected integer"); |
| @@ -11686,17 +11809,6 @@ namespace quicktype { | ||
| 11686 | 11809 | j["UseSerializers"] = x.get_use_serializers(); |
| 11687 | 11810 | } |
| 11688 | 11811 | |
| 11689 | - inline void from_json(const json & j, Ushort& x) { | |
| 11690 | - if (!j.is_object()) throw std::runtime_error("Expected object"); | |
| 11691 | - if (j.find("ushort") != j.end() && !j.at("ushort").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 11692 | - x.set_ushort(j.at("ushort").get<int64_t>()); | |
| 11693 | - } | |
| 11694 | - | |
| 11695 | - inline void to_json(json & j, const Ushort & x) { | |
| 11696 | - j = json::object(); | |
| 11697 | - j["ushort"] = x.get_ushort(); | |
| 11698 | - } | |
| 11699 | - | |
| 11700 | 11812 | inline void from_json(const json & j, Obj5& x) { |
| 11701 | 11813 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 11702 | 11814 | if (j.find("dummy") != j.end() && !j.at("dummy").is_number_integer()) throw std::runtime_error("Expected integer"); |
| @@ -11723,9 +11835,9 @@ namespace quicktype { | ||
| 11723 | 11835 | x.set_obj5_typeid(j.at("typeid").get<Typeid>()); |
| 11724 | 11836 | x.set_obj5_typename(j.at("typename").get<Typename>()); |
| 11725 | 11837 | x.set_obj5_union(j.at("union").get<Union>()); |
| 11726 | - x.set_obj5_unsigned(j.at("unsigned").get<Unsigned>()); | |
| 11727 | 11838 | x.set_primitive_kind(j.at("PrimitiveKind").get<PrimitiveKind>()); |
| 11728 | 11839 | x.set_purple_true(j.at("true").get<TrueClass>()); |
| 11840 | + x.set_select(j.at("select").get<Select>()); | |
| 11729 | 11841 | x.set_self(j.at("Self").get<Self>()); |
| 11730 | 11842 | x.set_sendable(j.at("Sendable").get<Sendable>()); |
| 11731 | 11843 | x.set_serial_descriptor(j.at("SerialDescriptor").get<SerialDescriptor>()); |
| @@ -11750,6 +11862,7 @@ namespace quicktype { | ||
| 11750 | 11862 | x.set_time_only(j.at("TimeOnly").get<TimeOnly>()); |
| 11751 | 11863 | x.set_time_only_converter(j.at("TimeOnlyConverter").get<TimeOnlyConverter>()); |
| 11752 | 11864 | x.set_time_zone(j.at("TimeZone").get<TimeZone>()); |
| 11865 | + x.set_to_dict(j.at("to_dict").get<ToDict>()); | |
| 11753 | 11866 | x.set_to_json(j.at("to_json").get<ToJson>()); |
| 11754 | 11867 | x.set_to_string(j.at("toString").get<ToString>()); |
| 11755 | 11868 | x.set_top_level(j.at("top_level").get<TopLevelClass>()); |
| @@ -11761,10 +11874,10 @@ namespace quicktype { | ||
| 11761 | 11874 | x.set_ulong(j.at("ulong").get<Ulong>()); |
| 11762 | 11875 | x.set_unchecked(j.at("unchecked").get<Unchecked>()); |
| 11763 | 11876 | x.set_undefined(j.at("undefined").get<Undefined>()); |
| 11877 | + x.set_unmarshal_json(j.at("UnmarshalJSON").get<UnmarshalJson>()); | |
| 11764 | 11878 | x.set_unowned(j.at("unowned").get<Unowned>()); |
| 11765 | 11879 | x.set_unsafe(j.at("unsafe").get<Unsafe>()); |
| 11766 | 11880 | x.set_use_serializers(j.at("UseSerializers").get<UseSerializers>()); |
| 11767 | - x.set_ushort(j.at("ushort").get<Ushort>()); | |
| 11768 | 11881 | } |
| 11769 | 11882 | |
| 11770 | 11883 | inline void to_json(json & j, const Obj5 & x) { |
| @@ -11792,9 +11905,9 @@ namespace quicktype { | ||
| 11792 | 11905 | j["typeid"] = x.get_obj5_typeid(); |
| 11793 | 11906 | j["typename"] = x.get_obj5_typename(); |
| 11794 | 11907 | j["union"] = x.get_obj5_union(); |
| 11795 | - j["unsigned"] = x.get_obj5_unsigned(); | |
| 11796 | 11908 | j["PrimitiveKind"] = x.get_primitive_kind(); |
| 11797 | 11909 | j["true"] = x.get_purple_true(); |
| 11910 | + j["select"] = x.get_select(); | |
| 11798 | 11911 | j["Self"] = x.get_self(); |
| 11799 | 11912 | j["Sendable"] = x.get_sendable(); |
| 11800 | 11913 | j["SerialDescriptor"] = x.get_serial_descriptor(); |
| @@ -11819,6 +11932,7 @@ namespace quicktype { | ||
| 11819 | 11932 | j["TimeOnly"] = x.get_time_only(); |
| 11820 | 11933 | j["TimeOnlyConverter"] = x.get_time_only_converter(); |
| 11821 | 11934 | j["TimeZone"] = x.get_time_zone(); |
| 11935 | + j["to_dict"] = x.get_to_dict(); | |
| 11822 | 11936 | j["to_json"] = x.get_to_json(); |
| 11823 | 11937 | j["toString"] = x.get_to_string(); |
| 11824 | 11938 | j["top_level"] = x.get_top_level(); |
| @@ -11830,10 +11944,21 @@ namespace quicktype { | ||
| 11830 | 11944 | j["ulong"] = x.get_ulong(); |
| 11831 | 11945 | j["unchecked"] = x.get_unchecked(); |
| 11832 | 11946 | j["undefined"] = x.get_undefined(); |
| 11947 | + j["UnmarshalJSON"] = x.get_unmarshal_json(); | |
| 11833 | 11948 | j["unowned"] = x.get_unowned(); |
| 11834 | 11949 | j["unsafe"] = x.get_unsafe(); |
| 11835 | 11950 | j["UseSerializers"] = x.get_use_serializers(); |
| 11836 | - j["ushort"] = x.get_ushort(); | |
| 11951 | + } | |
| 11952 | + | |
| 11953 | + inline void from_json(const json & j, Unsigned& x) { | |
| 11954 | + if (!j.is_object()) throw std::runtime_error("Expected object"); | |
| 11955 | + if (j.find("unsigned") != j.end() && !j.at("unsigned").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 11956 | + x.set_unsigned_unsigned(j.at("unsigned").get<int64_t>()); | |
| 11957 | + } | |
| 11958 | + | |
| 11959 | + inline void to_json(json & j, const Unsigned & x) { | |
| 11960 | + j = json::object(); | |
| 11961 | + j["unsigned"] = x.get_unsigned_unsigned(); | |
| 11837 | 11962 | } |
| 11838 | 11963 | |
| 11839 | 11964 | inline void from_json(const json & j, Using& x) { |
| @@ -11924,6 +12049,17 @@ namespace quicktype { | ||
| 11924 | 12049 | j["xor_eq"] = x.get_xor_eq_xor_eq(); |
| 11925 | 12050 | } |
| 11926 | 12051 | |
| 12052 | + inline void from_json(const json & j, Ushort& x) { | |
| 12053 | + if (!j.is_object()) throw std::runtime_error("Expected object"); | |
| 12054 | + if (j.find("ushort") != j.end() && !j.at("ushort").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 12055 | + x.set_ushort(j.at("ushort").get<int64_t>()); | |
| 12056 | + } | |
| 12057 | + | |
| 12058 | + inline void to_json(json & j, const Ushort & x) { | |
| 12059 | + j = json::object(); | |
| 12060 | + j["ushort"] = x.get_ushort(); | |
| 12061 | + } | |
| 12062 | + | |
| 11927 | 12063 | inline void from_json(const json & j, Utf8JsonReader& x) { |
| 11928 | 12064 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 11929 | 12065 | if (j.find("Utf8JsonReader") != j.end() && !j.at("Utf8JsonReader").is_number_integer()) throw std::runtime_error("Expected integer"); |
| @@ -12038,6 +12174,7 @@ namespace quicktype { | ||
| 12038 | 12174 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 12039 | 12175 | if (j.find("dummy") != j.end() && !j.at("dummy").is_number_integer()) throw std::runtime_error("Expected integer"); |
| 12040 | 12176 | x.set_dummy(j.at("dummy").get<int64_t>()); |
| 12177 | + x.set_obj6_unsigned(j.at("unsigned").get<Unsigned>()); | |
| 12041 | 12178 | x.set_obj6_using(j.at("using").get<Using>()); |
| 12042 | 12179 | x.set_obj6_virtual(j.at("virtual").get<Virtual>()); |
| 12043 | 12180 | x.set_obj6_void(j.at("void").get<Void>()); |
| @@ -12046,6 +12183,7 @@ namespace quicktype { | ||
| 12046 | 12183 | x.set_obj6_while(j.at("while").get<While>()); |
| 12047 | 12184 | x.set_obj6_xor(j.at("xor").get<Xor>()); |
| 12048 | 12185 | x.set_obj6_xor_eq(j.at("xor_eq").get<XorEq>()); |
| 12186 | + x.set_ushort(j.at("ushort").get<Ushort>()); | |
| 12049 | 12187 | x.set_utf8_json_reader(j.at("Utf8JsonReader").get<Utf8JsonReader>()); |
| 12050 | 12188 | x.set_utf8_json_writer(j.at("Utf8JsonWriter").get<Utf8JsonWriter>()); |
| 12051 | 12189 | x.set_uuid(j.at("UUID").get<Uuid>()); |
| @@ -12061,6 +12199,7 @@ namespace quicktype { | ||
| 12061 | 12199 | inline void to_json(json & j, const Obj6 & x) { |
| 12062 | 12200 | j = json::object(); |
| 12063 | 12201 | j["dummy"] = x.get_dummy(); |
| 12202 | + j["unsigned"] = x.get_obj6_unsigned(); | |
| 12064 | 12203 | j["using"] = x.get_obj6_using(); |
| 12065 | 12204 | j["virtual"] = x.get_obj6_virtual(); |
| 12066 | 12205 | j["void"] = x.get_obj6_void(); |
| @@ -12069,6 +12208,7 @@ namespace quicktype { | ||
| 12069 | 12208 | j["while"] = x.get_obj6_while(); |
| 12070 | 12209 | j["xor"] = x.get_obj6_xor(); |
| 12071 | 12210 | j["xor_eq"] = x.get_obj6_xor_eq(); |
| 12211 | + j["ushort"] = x.get_ushort(); | |
| 12072 | 12212 | j["Utf8JsonReader"] = x.get_utf8_json_reader(); |
| 12073 | 12213 | j["Utf8JsonWriter"] = x.get_utf8_json_writer(); |
| 12074 | 12214 | j["UUID"] = x.get_uuid(); |
Mcrystaldefault / TopLevel.cr+78 −42
| @@ -692,6 +692,8 @@ class Obj2 | ||
| 692 | 692 | |
| 693 | 693 | property from : From |
| 694 | 694 | |
| 695 | + property from_dict : FromDict | |
| 696 | + | |
| 695 | 697 | property from_json : FromJson |
| 696 | 698 | |
| 697 | 699 | property func : Func |
| @@ -704,8 +706,6 @@ class Obj2 | ||
| 704 | 706 | |
| 705 | 707 | property go : Go |
| 706 | 708 | |
| 707 | - property goto : Goto | |
| 708 | - | |
| 709 | 709 | @[JSON::Field(key: "def")] |
| 710 | 710 | property obj2_def : Def |
| 711 | 711 | |
| @@ -1041,6 +1041,12 @@ class From | ||
| 1041 | 1041 | property from : Int64 |
| 1042 | 1042 | end |
| 1043 | 1043 | |
| 1044 | +class FromDict | |
| 1045 | + include JSON::Serializable | |
| 1046 | + | |
| 1047 | + property from_dict : Int64 | |
| 1048 | +end | |
| 1049 | + | |
| 1044 | 1050 | class FromJson |
| 1045 | 1051 | include JSON::Serializable |
| 1046 | 1052 | |
| @@ -1077,12 +1083,6 @@ class Go | ||
| 1077 | 1083 | property go : Int64 |
| 1078 | 1084 | end |
| 1079 | 1085 | |
| 1080 | -class Goto | |
| 1081 | - include JSON::Serializable | |
| 1082 | - | |
| 1083 | - property goto : Int64 | |
| 1084 | -end | |
| 1085 | - | |
| 1086 | 1086 | class Def |
| 1087 | 1087 | include JSON::Serializable |
| 1088 | 1088 | |
| @@ -1137,6 +1137,8 @@ class Obj3 | ||
| 1137 | 1137 | |
| 1138 | 1138 | property dummy : Int64 |
| 1139 | 1139 | |
| 1140 | + property goto : Goto | |
| 1141 | + | |
| 1140 | 1142 | property guard : Guard |
| 1141 | 1143 | |
| 1142 | 1144 | @[JSON::Field(key: "hasOwnProperty")] |
| @@ -1258,6 +1260,9 @@ class Obj3 | ||
| 1258 | 1260 | @[JSON::Field(key: "MapEntry")] |
| 1259 | 1261 | property map_entry : MapEntry |
| 1260 | 1262 | |
| 1263 | + @[JSON::Field(key: "MarshalJSON")] | |
| 1264 | + property marshal_json : MarshalJson | |
| 1265 | + | |
| 1261 | 1266 | property metadata_property_handling : MetadataPropertyHandling |
| 1262 | 1267 | |
| 1263 | 1268 | property mutable : Mutable |
| @@ -1275,8 +1280,6 @@ class Obj3 | ||
| 1275 | 1280 | @[JSON::Field(key: "NO")] |
| 1276 | 1281 | property no : No |
| 1277 | 1282 | |
| 1278 | - property noexcept : Noexcept | |
| 1279 | - | |
| 1280 | 1283 | @[JSON::Field(key: "if")] |
| 1281 | 1284 | property obj3_if : If |
| 1282 | 1285 | |
| @@ -1290,6 +1293,12 @@ class Obj3 | ||
| 1290 | 1293 | property obj3_nil : NilClass |
| 1291 | 1294 | end |
| 1292 | 1295 | |
| 1296 | +class Goto | |
| 1297 | + include JSON::Serializable | |
| 1298 | + | |
| 1299 | + property goto : Int64 | |
| 1300 | +end | |
| 1301 | + | |
| 1293 | 1302 | class Guard |
| 1294 | 1303 | include JSON::Serializable |
| 1295 | 1304 | |
| @@ -1615,6 +1624,13 @@ class MapEntry | ||
| 1615 | 1624 | property map_entry : Int64 |
| 1616 | 1625 | end |
| 1617 | 1626 | |
| 1627 | +class MarshalJson | |
| 1628 | + include JSON::Serializable | |
| 1629 | + | |
| 1630 | + @[JSON::Field(key: "MarshalJSON")] | |
| 1631 | + property marshal_json : Int64 | |
| 1632 | +end | |
| 1633 | + | |
| 1618 | 1634 | class MetadataPropertyHandling |
| 1619 | 1635 | include JSON::Serializable |
| 1620 | 1636 | |
| @@ -1664,12 +1680,6 @@ class No | ||
| 1664 | 1680 | property no : Int64 |
| 1665 | 1681 | end |
| 1666 | 1682 | |
| 1667 | -class Noexcept | |
| 1668 | - include JSON::Serializable | |
| 1669 | - | |
| 1670 | - property noexcept : Int64 | |
| 1671 | -end | |
| 1672 | - | |
| 1673 | 1683 | class If |
| 1674 | 1684 | include JSON::Serializable |
| 1675 | 1685 | |
| @@ -1706,6 +1716,8 @@ class Obj4 | ||
| 1706 | 1716 | @[JSON::Field(key: "noSuchMethod")] |
| 1707 | 1717 | property no_such_method : NoSuchMethod |
| 1708 | 1718 | |
| 1719 | + property noexcept : Noexcept | |
| 1720 | + | |
| 1709 | 1721 | property nonatomic : Nonatomic |
| 1710 | 1722 | |
| 1711 | 1723 | @[JSON::Field(key: "None")] |
| @@ -1762,9 +1774,6 @@ class Obj4 | ||
| 1762 | 1774 | @[JSON::Field(key: "return")] |
| 1763 | 1775 | property obj4_return : Return |
| 1764 | 1776 | |
| 1765 | - @[JSON::Field(key: "select")] | |
| 1766 | - property obj4_select : Select | |
| 1767 | - | |
| 1768 | 1777 | property object : ObjectClass |
| 1769 | 1778 | |
| 1770 | 1779 | @[JSON::Field(key: "ObjectMapper")] |
| @@ -1861,6 +1870,12 @@ class NoSuchMethod | ||
| 1861 | 1870 | property no_such_method : Int64 |
| 1862 | 1871 | end |
| 1863 | 1872 | |
| 1873 | +class Noexcept | |
| 1874 | + include JSON::Serializable | |
| 1875 | + | |
| 1876 | + property noexcept : Int64 | |
| 1877 | +end | |
| 1878 | + | |
| 1864 | 1879 | class Nonatomic |
| 1865 | 1880 | include JSON::Serializable |
| 1866 | 1881 | |
| @@ -1998,13 +2013,6 @@ class Return | ||
| 1998 | 2013 | property return_return : Int64 |
| 1999 | 2014 | end |
| 2000 | 2015 | |
| 2001 | -class Select | |
| 2002 | - include JSON::Serializable | |
| 2003 | - | |
| 2004 | - @[JSON::Field(key: "select")] | |
| 2005 | - property select_select : Int64 | |
| 2006 | -end | |
| 2007 | - | |
| 2008 | 2016 | class ObjectClass |
| 2009 | 2017 | include JSON::Serializable |
| 2010 | 2018 | |
| @@ -2265,6 +2273,9 @@ class Obj5 | ||
| 2265 | 2273 | @[JSON::Field(key: "KSerializer")] |
| 2266 | 2274 | property k_serializer : KSerializer |
| 2267 | 2275 | |
| 2276 | + @[JSON::Field(key: "select")] | |
| 2277 | + property obj5_select : Select | |
| 2278 | + | |
| 2268 | 2279 | @[JSON::Field(key: "Self")] |
| 2269 | 2280 | property obj5_self : Self |
| 2270 | 2281 | |
| @@ -2383,6 +2394,8 @@ class Obj5 | ||
| 2383 | 2394 | @[JSON::Field(key: "TimeZone")] |
| 2384 | 2395 | property time_zone : TimeZone |
| 2385 | 2396 | |
| 2397 | + property to_dict : ToDict | |
| 2398 | + | |
| 2386 | 2399 | @[JSON::Field(key: "toString")] |
| 2387 | 2400 | property to_string : ToString |
| 2388 | 2401 | |
| @@ -2408,16 +2421,15 @@ class Obj5 | ||
| 2408 | 2421 | |
| 2409 | 2422 | property undefined : Undefined |
| 2410 | 2423 | |
| 2424 | + @[JSON::Field(key: "UnmarshalJSON")] | |
| 2425 | + property unmarshal_json : UnmarshalJson | |
| 2426 | + | |
| 2411 | 2427 | property unowned : Unowned |
| 2412 | 2428 | |
| 2413 | 2429 | property unsafe : Unsafe |
| 2414 | 2430 | |
| 2415 | - property unsigned : Unsigned | |
| 2416 | - | |
| 2417 | 2431 | @[JSON::Field(key: "UseSerializers")] |
| 2418 | 2432 | property use_serializers : UseSerializers |
| 2419 | - | |
| 2420 | - property ushort : Ushort | |
| 2421 | 2433 | end |
| 2422 | 2434 | |
| 2423 | 2435 | class KSerializer |
| @@ -2427,6 +2439,13 @@ class KSerializer | ||
| 2427 | 2439 | property k_serializer : Int64 |
| 2428 | 2440 | end |
| 2429 | 2441 | |
| 2442 | +class Select | |
| 2443 | + include JSON::Serializable | |
| 2444 | + | |
| 2445 | + @[JSON::Field(key: "select")] | |
| 2446 | + property select_select : Int64 | |
| 2447 | +end | |
| 2448 | + | |
| 2430 | 2449 | class Self |
| 2431 | 2450 | include JSON::Serializable |
| 2432 | 2451 | |
| @@ -2729,6 +2748,12 @@ class TimeZone | ||
| 2729 | 2748 | property time_zone : Int64 |
| 2730 | 2749 | end |
| 2731 | 2750 | |
| 2751 | +class ToDict | |
| 2752 | + include JSON::Serializable | |
| 2753 | + | |
| 2754 | + property to_dict : Int64 | |
| 2755 | +end | |
| 2756 | + | |
| 2732 | 2757 | class ToString |
| 2733 | 2758 | include JSON::Serializable |
| 2734 | 2759 | |
| @@ -2802,22 +2827,23 @@ class Undefined | ||
| 2802 | 2827 | property undefined : Int64 |
| 2803 | 2828 | end |
| 2804 | 2829 | |
| 2805 | -class Unowned | |
| 2830 | +class UnmarshalJson | |
| 2806 | 2831 | include JSON::Serializable |
| 2807 | 2832 | |
| 2808 | - property unowned : Int64 | |
| 2833 | + @[JSON::Field(key: "UnmarshalJSON")] | |
| 2834 | + property unmarshal_json : Int64 | |
| 2809 | 2835 | end |
| 2810 | 2836 | |
| 2811 | -class Unsafe | |
| 2837 | +class Unowned | |
| 2812 | 2838 | include JSON::Serializable |
| 2813 | 2839 | |
| 2814 | - property unsafe : Int64 | |
| 2840 | + property unowned : Int64 | |
| 2815 | 2841 | end |
| 2816 | 2842 | |
| 2817 | -class Unsigned | |
| 2843 | +class Unsafe | |
| 2818 | 2844 | include JSON::Serializable |
| 2819 | 2845 | |
| 2820 | - property unsigned : Int64 | |
| 2846 | + property unsafe : Int64 | |
| 2821 | 2847 | end |
| 2822 | 2848 | |
| 2823 | 2849 | class UseSerializers |
| @@ -2827,12 +2853,6 @@ class UseSerializers | ||
| 2827 | 2853 | property use_serializers : Int64 |
| 2828 | 2854 | end |
| 2829 | 2855 | |
| 2830 | -class Ushort | |
| 2831 | - include JSON::Serializable | |
| 2832 | - | |
| 2833 | - property ushort : Int64 | |
| 2834 | -end | |
| 2835 | - | |
| 2836 | 2856 | class Obj6 |
| 2837 | 2857 | include JSON::Serializable |
| 2838 | 2858 | |
| @@ -2847,6 +2867,10 @@ class Obj6 | ||
| 2847 | 2867 | @[JSON::Field(key: "yield")] |
| 2848 | 2868 | property obj6_yield : Yield |
| 2849 | 2869 | |
| 2870 | + property unsigned : Unsigned | |
| 2871 | + | |
| 2872 | + property ushort : Ushort | |
| 2873 | + | |
| 2850 | 2874 | property using : Using |
| 2851 | 2875 | |
| 2852 | 2876 | @[JSON::Field(key: "Utf8JsonReader")] |
| @@ -2904,6 +2928,18 @@ class Yield | ||
| 2904 | 2928 | property yield_yield : Int64 |
| 2905 | 2929 | end |
| 2906 | 2930 | |
| 2931 | +class Unsigned | |
| 2932 | + include JSON::Serializable | |
| 2933 | + | |
| 2934 | + property unsigned : Int64 | |
| 2935 | +end | |
| 2936 | + | |
| 2937 | +class Ushort | |
| 2938 | + include JSON::Serializable | |
| 2939 | + | |
| 2940 | + property ushort : Int64 | |
| 2941 | +end | |
| 2942 | + | |
| 2907 | 2943 | class Using |
| 2908 | 2944 | include JSON::Serializable |
Mcsharp-recordsdefault / QuickType.cs+80 −44
| @@ -799,6 +799,9 @@ namespace QuickType | ||
| 799 | 799 | [JsonProperty("from", Required = Required.Always)] |
| 800 | 800 | public From From { get; set; } |
| 801 | 801 | |
| 802 | + [JsonProperty("from_dict", Required = Required.Always)] | |
| 803 | + public FromDict FromDict { get; set; } | |
| 804 | + | |
| 802 | 805 | [JsonProperty("func", Required = Required.Always)] |
| 803 | 806 | public Func Func { get; set; } |
| 804 | 807 | |
| @@ -814,9 +817,6 @@ namespace QuickType | ||
| 814 | 817 | [JsonProperty("go", Required = Required.Always)] |
| 815 | 818 | public Go Go { get; set; } |
| 816 | 819 | |
| 817 | - [JsonProperty("goto", Required = Required.Always)] | |
| 818 | - public Goto Goto { get; set; } | |
| 819 | - | |
| 820 | 820 | [JsonProperty("equalityContract", Required = Required.Always)] |
| 821 | 821 | public EqualityContractClass Obj2EqualityContract { get; set; } |
| 822 | 822 | |
| @@ -1157,6 +1157,12 @@ namespace QuickType | ||
| 1157 | 1157 | public long FromFrom { get; set; } |
| 1158 | 1158 | } |
| 1159 | 1159 | |
| 1160 | + public partial record FromDict | |
| 1161 | + { | |
| 1162 | + [JsonProperty("from_dict", Required = Required.Always)] | |
| 1163 | + public long FromDictFromDict { get; set; } | |
| 1164 | + } | |
| 1165 | + | |
| 1160 | 1166 | public partial record Func |
| 1161 | 1167 | { |
| 1162 | 1168 | [JsonProperty("func", Required = Required.Always)] |
| @@ -1187,12 +1193,6 @@ namespace QuickType | ||
| 1187 | 1193 | public long GoGo { get; set; } |
| 1188 | 1194 | } |
| 1189 | 1195 | |
| 1190 | - public partial record Goto | |
| 1191 | - { | |
| 1192 | - [JsonProperty("goto", Required = Required.Always)] | |
| 1193 | - public long GotoGoto { get; set; } | |
| 1194 | - } | |
| 1195 | - | |
| 1196 | 1196 | public partial record EqualityContractClass |
| 1197 | 1197 | { |
| 1198 | 1198 | [JsonProperty("equalityContract", Required = Required.Always)] |
| @@ -1216,6 +1216,9 @@ namespace QuickType | ||
| 1216 | 1216 | [JsonProperty("dummy", Required = Required.Always)] |
| 1217 | 1217 | public long Dummy { get; set; } |
| 1218 | 1218 | |
| 1219 | + [JsonProperty("goto", Required = Required.Always)] | |
| 1220 | + public Goto Goto { get; set; } | |
| 1221 | + | |
| 1219 | 1222 | [JsonProperty("guard", Required = Required.Always)] |
| 1220 | 1223 | public Guard Guard { get; set; } |
| 1221 | 1224 | |
| @@ -1375,6 +1378,9 @@ namespace QuickType | ||
| 1375 | 1378 | [JsonProperty("MapEntry", Required = Required.Always)] |
| 1376 | 1379 | public MapEntry MapEntry { get; set; } |
| 1377 | 1380 | |
| 1381 | + [JsonProperty("MarshalJSON", Required = Required.Always)] | |
| 1382 | + public MarshalJson MarshalJson { get; set; } | |
| 1383 | + | |
| 1378 | 1384 | [JsonProperty("metadata_property_handling", Required = Required.Always)] |
| 1379 | 1385 | public MetadataPropertyHandlingClass MetadataPropertyHandling { get; set; } |
| 1380 | 1386 | |
| @@ -1404,9 +1410,12 @@ namespace QuickType | ||
| 1404 | 1410 | |
| 1405 | 1411 | [JsonProperty("NO", Required = Required.Always)] |
| 1406 | 1412 | public No No { get; set; } |
| 1413 | + } | |
| 1407 | 1414 | |
| 1408 | - [JsonProperty("noexcept", Required = Required.Always)] | |
| 1409 | - public Noexcept Noexcept { get; set; } | |
| 1415 | + public partial record Goto | |
| 1416 | + { | |
| 1417 | + [JsonProperty("goto", Required = Required.Always)] | |
| 1418 | + public long GotoGoto { get; set; } | |
| 1410 | 1419 | } |
| 1411 | 1420 | |
| 1412 | 1421 | public partial record Guard |
| @@ -1727,6 +1736,12 @@ namespace QuickType | ||
| 1727 | 1736 | public long MapEntryMapEntry { get; set; } |
| 1728 | 1737 | } |
| 1729 | 1738 | |
| 1739 | + public partial record MarshalJson | |
| 1740 | + { | |
| 1741 | + [JsonProperty("MarshalJSON", Required = Required.Always)] | |
| 1742 | + public long MarshalJsonMarshalJson { get; set; } | |
| 1743 | + } | |
| 1744 | + | |
| 1730 | 1745 | public partial record MetadataPropertyHandlingClass |
| 1731 | 1746 | { |
| 1732 | 1747 | [JsonProperty("metadata_property_handling", Required = Required.Always)] |
| @@ -1787,12 +1802,6 @@ namespace QuickType | ||
| 1787 | 1802 | public long NoNo { get; set; } |
| 1788 | 1803 | } |
| 1789 | 1804 | |
| 1790 | - public partial record Noexcept | |
| 1791 | - { | |
| 1792 | - [JsonProperty("noexcept", Required = Required.Always)] | |
| 1793 | - public long NoexceptNoexcept { get; set; } | |
| 1794 | - } | |
| 1795 | - | |
| 1796 | 1805 | public partial record Obj4 |
| 1797 | 1806 | { |
| 1798 | 1807 | [JsonProperty("dummy", Required = Required.Always)] |
| @@ -1801,6 +1810,9 @@ namespace QuickType | ||
| 1801 | 1810 | [JsonProperty("noSuchMethod", Required = Required.Always)] |
| 1802 | 1811 | public NoSuchMethod NoSuchMethod { get; set; } |
| 1803 | 1812 | |
| 1813 | + [JsonProperty("noexcept", Required = Required.Always)] | |
| 1814 | + public Noexcept Noexcept { get; set; } | |
| 1815 | + | |
| 1804 | 1816 | [JsonProperty("nonatomic", Required = Required.Always)] |
| 1805 | 1817 | public Nonatomic Nonatomic { get; set; } |
| 1806 | 1818 | |
| @@ -1986,9 +1998,6 @@ namespace QuickType | ||
| 1986 | 1998 | |
| 1987 | 1999 | [JsonProperty("SEL", Required = Required.Always)] |
| 1988 | 2000 | public Sel Sel { get; set; } |
| 1989 | - | |
| 1990 | - [JsonProperty("select", Required = Required.Always)] | |
| 1991 | - public Select Select { get; set; } | |
| 1992 | 2001 | } |
| 1993 | 2002 | |
| 1994 | 2003 | public partial record NoSuchMethod |
| @@ -1997,6 +2006,12 @@ namespace QuickType | ||
| 1997 | 2006 | public long NoSuchMethodNoSuchMethod { get; set; } |
| 1998 | 2007 | } |
| 1999 | 2008 | |
| 2009 | + public partial record Noexcept | |
| 2010 | + { | |
| 2011 | + [JsonProperty("noexcept", Required = Required.Always)] | |
| 2012 | + public long NoexceptNoexcept { get; set; } | |
| 2013 | + } | |
| 2014 | + | |
| 2000 | 2015 | public partial record Nonatomic |
| 2001 | 2016 | { |
| 2002 | 2017 | [JsonProperty("nonatomic", Required = Required.Always)] |
| @@ -2369,12 +2384,6 @@ namespace QuickType | ||
| 2369 | 2384 | public long SelSel { get; set; } |
| 2370 | 2385 | } |
| 2371 | 2386 | |
| 2372 | - public partial record Select | |
| 2373 | - { | |
| 2374 | - [JsonProperty("select", Required = Required.Always)] | |
| 2375 | - public long SelectSelect { get; set; } | |
| 2376 | - } | |
| 2377 | - | |
| 2378 | 2387 | public partial record Obj5 |
| 2379 | 2388 | { |
| 2380 | 2389 | [JsonProperty("dummy", Required = Required.Always)] |
| @@ -2401,6 +2410,9 @@ namespace QuickType | ||
| 2401 | 2410 | [JsonProperty("PrimitiveKind", Required = Required.Always)] |
| 2402 | 2411 | public PrimitiveKind PrimitiveKind { get; set; } |
| 2403 | 2412 | |
| 2413 | + [JsonProperty("select", Required = Required.Always)] | |
| 2414 | + public Select Select { get; set; } | |
| 2415 | + | |
| 2404 | 2416 | [JsonProperty("Self", Required = Required.Always)] |
| 2405 | 2417 | public Self Self { get; set; } |
| 2406 | 2418 | |
| @@ -2512,6 +2524,9 @@ namespace QuickType | ||
| 2512 | 2524 | [JsonProperty("TimeZone", Required = Required.Always)] |
| 2513 | 2525 | public TimeZone TimeZone { get; set; } |
| 2514 | 2526 | |
| 2527 | + [JsonProperty("to_dict", Required = Required.Always)] | |
| 2528 | + public ToDict ToDict { get; set; } | |
| 2529 | + | |
| 2515 | 2530 | [JsonProperty("top_level", Required = Required.Always)] |
| 2516 | 2531 | public TopLevelClass TopLevel { get; set; } |
| 2517 | 2532 | |
| @@ -2557,20 +2572,17 @@ namespace QuickType | ||
| 2557 | 2572 | [JsonProperty("union", Required = Required.Always)] |
| 2558 | 2573 | public Union Union { get; set; } |
| 2559 | 2574 | |
| 2575 | + [JsonProperty("UnmarshalJSON", Required = Required.Always)] | |
| 2576 | + public UnmarshalJson UnmarshalJson { get; set; } | |
| 2577 | + | |
| 2560 | 2578 | [JsonProperty("unowned", Required = Required.Always)] |
| 2561 | 2579 | public Unowned Unowned { get; set; } |
| 2562 | 2580 | |
| 2563 | 2581 | [JsonProperty("unsafe", Required = Required.Always)] |
| 2564 | 2582 | public Unsafe Unsafe { get; set; } |
| 2565 | 2583 | |
| 2566 | - [JsonProperty("unsigned", Required = Required.Always)] | |
| 2567 | - public Unsigned Unsigned { get; set; } | |
| 2568 | - | |
| 2569 | 2584 | [JsonProperty("UseSerializers", Required = Required.Always)] |
| 2570 | 2585 | public UseSerializers UseSerializers { get; set; } |
| 2571 | - | |
| 2572 | - [JsonProperty("ushort", Required = Required.Always)] | |
| 2573 | - public Ushort Ushort { get; set; } | |
| 2574 | 2586 | } |
| 2575 | 2587 | |
| 2576 | 2588 | public partial record KSerializer |
| @@ -2615,6 +2627,12 @@ namespace QuickType | ||
| 2615 | 2627 | public long PrimitiveKindPrimitiveKind { get; set; } |
| 2616 | 2628 | } |
| 2617 | 2629 | |
| 2630 | + public partial record Select | |
| 2631 | + { | |
| 2632 | + [JsonProperty("select", Required = Required.Always)] | |
| 2633 | + public long SelectSelect { get; set; } | |
| 2634 | + } | |
| 2635 | + | |
| 2618 | 2636 | public partial record Self |
| 2619 | 2637 | { |
| 2620 | 2638 | [JsonProperty("Self", Required = Required.Always)] |
| @@ -2837,6 +2855,12 @@ namespace QuickType | ||
| 2837 | 2855 | public long TimeZoneTimeZone { get; set; } |
| 2838 | 2856 | } |
| 2839 | 2857 | |
| 2858 | + public partial record ToDict | |
| 2859 | + { | |
| 2860 | + [JsonProperty("to_dict", Required = Required.Always)] | |
| 2861 | + public long ToDictToDict { get; set; } | |
| 2862 | + } | |
| 2863 | + | |
| 2840 | 2864 | public partial record TopLevelClass |
| 2841 | 2865 | { |
| 2842 | 2866 | [JsonProperty("top_level", Required = Required.Always)] |
| @@ -2927,6 +2951,12 @@ namespace QuickType | ||
| 2927 | 2951 | public long UnionUnion { get; set; } |
| 2928 | 2952 | } |
| 2929 | 2953 | |
| 2954 | + public partial record UnmarshalJson | |
| 2955 | + { | |
| 2956 | + [JsonProperty("UnmarshalJSON", Required = Required.Always)] | |
| 2957 | + public long UnmarshalJsonUnmarshalJson { get; set; } | |
| 2958 | + } | |
| 2959 | + | |
| 2930 | 2960 | public partial record Unowned |
| 2931 | 2961 | { |
| 2932 | 2962 | [JsonProperty("unowned", Required = Required.Always)] |
| @@ -2939,29 +2969,23 @@ namespace QuickType | ||
| 2939 | 2969 | public long UnsafeUnsafe { get; set; } |
| 2940 | 2970 | } |
| 2941 | 2971 | |
| 2942 | - public partial record Unsigned | |
| 2943 | - { | |
| 2944 | - [JsonProperty("unsigned", Required = Required.Always)] | |
| 2945 | - public long UnsignedUnsigned { get; set; } | |
| 2946 | - } | |
| 2947 | - | |
| 2948 | 2972 | public partial record UseSerializers |
| 2949 | 2973 | { |
| 2950 | 2974 | [JsonProperty("UseSerializers", Required = Required.Always)] |
| 2951 | 2975 | public long UseSerializersUseSerializers { get; set; } |
| 2952 | 2976 | } |
| 2953 | 2977 | |
| 2954 | - public partial record Ushort | |
| 2955 | - { | |
| 2956 | - [JsonProperty("ushort", Required = Required.Always)] | |
| 2957 | - public long UshortUshort { get; set; } | |
| 2958 | - } | |
| 2959 | - | |
| 2960 | 2978 | public partial record Obj6 |
| 2961 | 2979 | { |
| 2962 | 2980 | [JsonProperty("dummy", Required = Required.Always)] |
| 2963 | 2981 | public long Dummy { get; set; } |
| 2964 | 2982 | |
| 2983 | + [JsonProperty("unsigned", Required = Required.Always)] | |
| 2984 | + public Unsigned Unsigned { get; set; } | |
| 2985 | + | |
| 2986 | + [JsonProperty("ushort", Required = Required.Always)] | |
| 2987 | + public Ushort Ushort { get; set; } | |
| 2988 | + | |
| 2965 | 2989 | [JsonProperty("using", Required = Required.Always)] |
| 2966 | 2990 | public Using Using { get; set; } |
| 2967 | 2991 | |
| @@ -3017,6 +3041,18 @@ namespace QuickType | ||
| 3017 | 3041 | public Yield Yield { get; set; } |
| 3018 | 3042 | } |
| 3019 | 3043 | |
| 3044 | + public partial record Unsigned | |
| 3045 | + { | |
| 3046 | + [JsonProperty("unsigned", Required = Required.Always)] | |
| 3047 | + public long UnsignedUnsigned { get; set; } | |
| 3048 | + } | |
| 3049 | + | |
| 3050 | + public partial record Ushort | |
| 3051 | + { | |
| 3052 | + [JsonProperty("ushort", Required = Required.Always)] | |
| 3053 | + public long UshortUshort { get; set; } | |
| 3054 | + } | |
| 3055 | + | |
| 3020 | 3056 | public partial record Using |
| 3021 | 3057 | { |
| 3022 | 3058 | [JsonProperty("using", Required = Required.Always)] |
Mcsharp-SystemTextJsondefault / QuickType.cs+97 −53
| @@ -992,6 +992,10 @@ namespace QuickType | ||
| 992 | 992 | [JsonPropertyName("from")] |
| 993 | 993 | public From From { get; set; } |
| 994 | 994 | |
| 995 | + [JsonRequired] | |
| 996 | + [JsonPropertyName("from_dict")] | |
| 997 | + public FromDict FromDict { get; set; } | |
| 998 | + | |
| 995 | 999 | [JsonRequired] |
| 996 | 1000 | [JsonPropertyName("func")] |
| 997 | 1001 | public Func Func { get; set; } |
| @@ -1012,10 +1016,6 @@ namespace QuickType | ||
| 1012 | 1016 | [JsonPropertyName("go")] |
| 1013 | 1017 | public Go Go { get; set; } |
| 1014 | 1018 | |
| 1015 | - [JsonRequired] | |
| 1016 | - [JsonPropertyName("goto")] | |
| 1017 | - public Goto Goto { get; set; } | |
| 1018 | - | |
| 1019 | 1019 | [JsonRequired] |
| 1020 | 1020 | [JsonPropertyName("false")] |
| 1021 | 1021 | public FalseClass Obj2False { get; set; } |
| @@ -1417,6 +1417,13 @@ namespace QuickType | ||
| 1417 | 1417 | public long FromFrom { get; set; } |
| 1418 | 1418 | } |
| 1419 | 1419 | |
| 1420 | + public partial class FromDict | |
| 1421 | + { | |
| 1422 | + [JsonRequired] | |
| 1423 | + [JsonPropertyName("from_dict")] | |
| 1424 | + public long FromDictFromDict { get; set; } | |
| 1425 | + } | |
| 1426 | + | |
| 1420 | 1427 | public partial class Func |
| 1421 | 1428 | { |
| 1422 | 1429 | [JsonRequired] |
| @@ -1452,13 +1459,6 @@ namespace QuickType | ||
| 1452 | 1459 | public long GoGo { get; set; } |
| 1453 | 1460 | } |
| 1454 | 1461 | |
| 1455 | - public partial class Goto | |
| 1456 | - { | |
| 1457 | - [JsonRequired] | |
| 1458 | - [JsonPropertyName("goto")] | |
| 1459 | - public long GotoGoto { get; set; } | |
| 1460 | - } | |
| 1461 | - | |
| 1462 | 1462 | public partial class FalseClass |
| 1463 | 1463 | { |
| 1464 | 1464 | [JsonRequired] |
| @@ -1479,6 +1479,10 @@ namespace QuickType | ||
| 1479 | 1479 | [JsonPropertyName("dummy")] |
| 1480 | 1480 | public long Dummy { get; set; } |
| 1481 | 1481 | |
| 1482 | + [JsonRequired] | |
| 1483 | + [JsonPropertyName("goto")] | |
| 1484 | + public Goto Goto { get; set; } | |
| 1485 | + | |
| 1482 | 1486 | [JsonRequired] |
| 1483 | 1487 | [JsonPropertyName("guard")] |
| 1484 | 1488 | public Guard Guard { get; set; } |
| @@ -1691,6 +1695,10 @@ namespace QuickType | ||
| 1691 | 1695 | [JsonPropertyName("MapEntry")] |
| 1692 | 1696 | public MapEntry MapEntry { get; set; } |
| 1693 | 1697 | |
| 1698 | + [JsonRequired] | |
| 1699 | + [JsonPropertyName("MarshalJSON")] | |
| 1700 | + public MarshalJson MarshalJson { get; set; } | |
| 1701 | + | |
| 1694 | 1702 | [JsonRequired] |
| 1695 | 1703 | [JsonPropertyName("metadata_property_handling")] |
| 1696 | 1704 | public MetadataPropertyHandling MetadataPropertyHandling { get; set; } |
| @@ -1730,10 +1738,13 @@ namespace QuickType | ||
| 1730 | 1738 | [JsonRequired] |
| 1731 | 1739 | [JsonPropertyName("NO")] |
| 1732 | 1740 | public No No { get; set; } |
| 1741 | + } | |
| 1733 | 1742 | |
| 1743 | + public partial class Goto | |
| 1744 | + { | |
| 1734 | 1745 | [JsonRequired] |
| 1735 | - [JsonPropertyName("noexcept")] | |
| 1736 | - public Noexcept Noexcept { get; set; } | |
| 1746 | + [JsonPropertyName("goto")] | |
| 1747 | + public long GotoGoto { get; set; } | |
| 1737 | 1748 | } |
| 1738 | 1749 | |
| 1739 | 1750 | public partial class Guard |
| @@ -2107,6 +2118,13 @@ namespace QuickType | ||
| 2107 | 2118 | public long MapEntryMapEntry { get; set; } |
| 2108 | 2119 | } |
| 2109 | 2120 | |
| 2121 | + public partial class MarshalJson | |
| 2122 | + { | |
| 2123 | + [JsonRequired] | |
| 2124 | + [JsonPropertyName("MarshalJSON")] | |
| 2125 | + public long MarshalJsonMarshalJson { get; set; } | |
| 2126 | + } | |
| 2127 | + | |
| 2110 | 2128 | public partial class MetadataPropertyHandling |
| 2111 | 2129 | { |
| 2112 | 2130 | [JsonRequired] |
| @@ -2177,13 +2195,6 @@ namespace QuickType | ||
| 2177 | 2195 | public long NoNo { get; set; } |
| 2178 | 2196 | } |
| 2179 | 2197 | |
| 2180 | - public partial class Noexcept | |
| 2181 | - { | |
| 2182 | - [JsonRequired] | |
| 2183 | - [JsonPropertyName("noexcept")] | |
| 2184 | - public long NoexceptNoexcept { get; set; } | |
| 2185 | - } | |
| 2186 | - | |
| 2187 | 2198 | public partial class Obj4 |
| 2188 | 2199 | { |
| 2189 | 2200 | [JsonRequired] |
| @@ -2194,6 +2205,10 @@ namespace QuickType | ||
| 2194 | 2205 | [JsonPropertyName("noSuchMethod")] |
| 2195 | 2206 | public NoSuchMethod NoSuchMethod { get; set; } |
| 2196 | 2207 | |
| 2208 | + [JsonRequired] | |
| 2209 | + [JsonPropertyName("noexcept")] | |
| 2210 | + public Noexcept Noexcept { get; set; } | |
| 2211 | + | |
| 2197 | 2212 | [JsonRequired] |
| 2198 | 2213 | [JsonPropertyName("nonatomic")] |
| 2199 | 2214 | public Nonatomic Nonatomic { get; set; } |
| @@ -2441,10 +2456,6 @@ namespace QuickType | ||
| 2441 | 2456 | [JsonRequired] |
| 2442 | 2457 | [JsonPropertyName("SEL")] |
| 2443 | 2458 | public Sel Sel { get; set; } |
| 2444 | - | |
| 2445 | - [JsonRequired] | |
| 2446 | - [JsonPropertyName("select")] | |
| 2447 | - public Select Select { get; set; } | |
| 2448 | 2459 | } |
| 2449 | 2460 | |
| 2450 | 2461 | public partial class NoSuchMethod |
| @@ -2454,6 +2465,13 @@ namespace QuickType | ||
| 2454 | 2465 | public long NoSuchMethodNoSuchMethod { get; set; } |
| 2455 | 2466 | } |
| 2456 | 2467 | |
| 2468 | + public partial class Noexcept | |
| 2469 | + { | |
| 2470 | + [JsonRequired] | |
| 2471 | + [JsonPropertyName("noexcept")] | |
| 2472 | + public long NoexceptNoexcept { get; set; } | |
| 2473 | + } | |
| 2474 | + | |
| 2457 | 2475 | public partial class Nonatomic |
| 2458 | 2476 | { |
| 2459 | 2477 | [JsonRequired] |
| @@ -2888,13 +2906,6 @@ namespace QuickType | ||
| 2888 | 2906 | public long SelSel { get; set; } |
| 2889 | 2907 | } |
| 2890 | 2908 | |
| 2891 | - public partial class Select | |
| 2892 | - { | |
| 2893 | - [JsonRequired] | |
| 2894 | - [JsonPropertyName("select")] | |
| 2895 | - public long SelectSelect { get; set; } | |
| 2896 | - } | |
| 2897 | - | |
| 2898 | 2909 | public partial class Obj5 |
| 2899 | 2910 | { |
| 2900 | 2911 | [JsonRequired] |
| @@ -2929,6 +2940,10 @@ namespace QuickType | ||
| 2929 | 2940 | [JsonPropertyName("PrimitiveKind")] |
| 2930 | 2941 | public PrimitiveKind PrimitiveKind { get; set; } |
| 2931 | 2942 | |
| 2943 | + [JsonRequired] | |
| 2944 | + [JsonPropertyName("select")] | |
| 2945 | + public Select Select { get; set; } | |
| 2946 | + | |
| 2932 | 2947 | [JsonRequired] |
| 2933 | 2948 | [JsonPropertyName("Self")] |
| 2934 | 2949 | public Self Self { get; set; } |
| @@ -3077,6 +3092,10 @@ namespace QuickType | ||
| 3077 | 3092 | [JsonPropertyName("TimeZone")] |
| 3078 | 3093 | public TimeZone TimeZone { get; set; } |
| 3079 | 3094 | |
| 3095 | + [JsonRequired] | |
| 3096 | + [JsonPropertyName("to_dict")] | |
| 3097 | + public ToDict ToDict { get; set; } | |
| 3098 | + | |
| 3080 | 3099 | [JsonRequired] |
| 3081 | 3100 | [JsonPropertyName("top_level")] |
| 3082 | 3101 | public TopLevelClass TopLevel { get; set; } |
| @@ -3137,6 +3156,10 @@ namespace QuickType | ||
| 3137 | 3156 | [JsonPropertyName("union")] |
| 3138 | 3157 | public Union Union { get; set; } |
| 3139 | 3158 | |
| 3159 | + [JsonRequired] | |
| 3160 | + [JsonPropertyName("UnmarshalJSON")] | |
| 3161 | + public UnmarshalJson UnmarshalJson { get; set; } | |
| 3162 | + | |
| 3140 | 3163 | [JsonRequired] |
| 3141 | 3164 | [JsonPropertyName("unowned")] |
| 3142 | 3165 | public Unowned Unowned { get; set; } |
| @@ -3145,17 +3168,9 @@ namespace QuickType | ||
| 3145 | 3168 | [JsonPropertyName("unsafe")] |
| 3146 | 3169 | public Unsafe Unsafe { get; set; } |
| 3147 | 3170 | |
| 3148 | - [JsonRequired] | |
| 3149 | - [JsonPropertyName("unsigned")] | |
| 3150 | - public Unsigned Unsigned { get; set; } | |
| 3151 | - | |
| 3152 | 3171 | [JsonRequired] |
| 3153 | 3172 | [JsonPropertyName("UseSerializers")] |
| 3154 | 3173 | public UseSerializers UseSerializers { get; set; } |
| 3155 | - | |
| 3156 | - [JsonRequired] | |
| 3157 | - [JsonPropertyName("ushort")] | |
| 3158 | - public Ushort Ushort { get; set; } | |
| 3159 | 3174 | } |
| 3160 | 3175 | |
| 3161 | 3176 | public partial class KSerializer |
| @@ -3207,6 +3222,13 @@ namespace QuickType | ||
| 3207 | 3222 | public long PrimitiveKindPrimitiveKind { get; set; } |
| 3208 | 3223 | } |
| 3209 | 3224 | |
| 3225 | + public partial class Select | |
| 3226 | + { | |
| 3227 | + [JsonRequired] | |
| 3228 | + [JsonPropertyName("select")] | |
| 3229 | + public long SelectSelect { get; set; } | |
| 3230 | + } | |
| 3231 | + | |
| 3210 | 3232 | public partial class Self |
| 3211 | 3233 | { |
| 3212 | 3234 | [JsonRequired] |
| @@ -3466,6 +3488,13 @@ namespace QuickType | ||
| 3466 | 3488 | public long TimeZoneTimeZone { get; set; } |
| 3467 | 3489 | } |
| 3468 | 3490 | |
| 3491 | + public partial class ToDict | |
| 3492 | + { | |
| 3493 | + [JsonRequired] | |
| 3494 | + [JsonPropertyName("to_dict")] | |
| 3495 | + public long ToDictToDict { get; set; } | |
| 3496 | + } | |
| 3497 | + | |
| 3469 | 3498 | public partial class TopLevelClass |
| 3470 | 3499 | { |
| 3471 | 3500 | [JsonRequired] |
| @@ -3571,6 +3600,13 @@ namespace QuickType | ||
| 3571 | 3600 | public long UnionUnion { get; set; } |
| 3572 | 3601 | } |
| 3573 | 3602 | |
| 3603 | + public partial class UnmarshalJson | |
| 3604 | + { | |
| 3605 | + [JsonRequired] | |
| 3606 | + [JsonPropertyName("UnmarshalJSON")] | |
| 3607 | + public long UnmarshalJsonUnmarshalJson { get; set; } | |
| 3608 | + } | |
| 3609 | + | |
| 3574 | 3610 | public partial class Unowned |
| 3575 | 3611 | { |
| 3576 | 3612 | [JsonRequired] |
| @@ -3585,13 +3621,6 @@ namespace QuickType | ||
| 3585 | 3621 | public long UnsafeUnsafe { get; set; } |
| 3586 | 3622 | } |
| 3587 | 3623 | |
| 3588 | - public partial class Unsigned | |
| 3589 | - { | |
| 3590 | - [JsonRequired] | |
| 3591 | - [JsonPropertyName("unsigned")] | |
| 3592 | - public long UnsignedUnsigned { get; set; } | |
| 3593 | - } | |
| 3594 | - | |
| 3595 | 3624 | public partial class UseSerializers |
| 3596 | 3625 | { |
| 3597 | 3626 | [JsonRequired] |
| @@ -3599,19 +3628,20 @@ namespace QuickType | ||
| 3599 | 3628 | public long UseSerializersUseSerializers { get; set; } |
| 3600 | 3629 | } |
| 3601 | 3630 | |
| 3602 | - public partial class Ushort | |
| 3603 | - { | |
| 3604 | - [JsonRequired] | |
| 3605 | - [JsonPropertyName("ushort")] | |
| 3606 | - public long UshortUshort { get; set; } | |
| 3607 | - } | |
| 3608 | - | |
| 3609 | 3631 | public partial class Obj6 |
| 3610 | 3632 | { |
| 3611 | 3633 | [JsonRequired] |
| 3612 | 3634 | [JsonPropertyName("dummy")] |
| 3613 | 3635 | public long Dummy { get; set; } |
| 3614 | 3636 | |
| 3637 | + [JsonRequired] | |
| 3638 | + [JsonPropertyName("unsigned")] | |
| 3639 | + public Unsigned Unsigned { get; set; } | |
| 3640 | + | |
| 3641 | + [JsonRequired] | |
| 3642 | + [JsonPropertyName("ushort")] | |
| 3643 | + public Ushort Ushort { get; set; } | |
| 3644 | + | |
| 3615 | 3645 | [JsonRequired] |
| 3616 | 3646 | [JsonPropertyName("using")] |
| 3617 | 3647 | public Using Using { get; set; } |
| @@ -3685,6 +3715,20 @@ namespace QuickType | ||
| 3685 | 3715 | public Yield Yield { get; set; } |
| 3686 | 3716 | } |
| 3687 | 3717 | |
| 3718 | + public partial class Unsigned | |
| 3719 | + { | |
| 3720 | + [JsonRequired] | |
| 3721 | + [JsonPropertyName("unsigned")] | |
| 3722 | + public long UnsignedUnsigned { get; set; } | |
| 3723 | + } | |
| 3724 | + | |
| 3725 | + public partial class Ushort | |
| 3726 | + { | |
| 3727 | + [JsonRequired] | |
| 3728 | + [JsonPropertyName("ushort")] | |
| 3729 | + public long UshortUshort { get; set; } | |
| 3730 | + } | |
| 3731 | + | |
| 3688 | 3732 | public partial class Using |
| 3689 | 3733 | { |
| 3690 | 3734 | [JsonRequired] |
Mcsharpdefault / QuickType.cs+80 −44
| @@ -802,6 +802,9 @@ namespace QuickType | ||
| 802 | 802 | [JsonProperty("from", Required = Required.Always)] |
| 803 | 803 | public From From { get; set; } |
| 804 | 804 | |
| 805 | + [JsonProperty("from_dict", Required = Required.Always)] | |
| 806 | + public FromDict FromDict { get; set; } | |
| 807 | + | |
| 805 | 808 | [JsonProperty("func", Required = Required.Always)] |
| 806 | 809 | public Func Func { get; set; } |
| 807 | 810 | |
| @@ -817,9 +820,6 @@ namespace QuickType | ||
| 817 | 820 | [JsonProperty("go", Required = Required.Always)] |
| 818 | 821 | public Go Go { get; set; } |
| 819 | 822 | |
| 820 | - [JsonProperty("goto", Required = Required.Always)] | |
| 821 | - public Goto Goto { get; set; } | |
| 822 | - | |
| 823 | 823 | [JsonProperty("false", Required = Required.Always)] |
| 824 | 824 | public FalseClass Obj2False { get; set; } |
| 825 | 825 | |
| @@ -1163,6 +1163,12 @@ namespace QuickType | ||
| 1163 | 1163 | public long FromFrom { get; set; } |
| 1164 | 1164 | } |
| 1165 | 1165 | |
| 1166 | + public partial class FromDict | |
| 1167 | + { | |
| 1168 | + [JsonProperty("from_dict", Required = Required.Always)] | |
| 1169 | + public long FromDictFromDict { get; set; } | |
| 1170 | + } | |
| 1171 | + | |
| 1166 | 1172 | public partial class Func |
| 1167 | 1173 | { |
| 1168 | 1174 | [JsonProperty("func", Required = Required.Always)] |
| @@ -1193,12 +1199,6 @@ namespace QuickType | ||
| 1193 | 1199 | public long GoGo { get; set; } |
| 1194 | 1200 | } |
| 1195 | 1201 | |
| 1196 | - public partial class Goto | |
| 1197 | - { | |
| 1198 | - [JsonProperty("goto", Required = Required.Always)] | |
| 1199 | - public long GotoGoto { get; set; } | |
| 1200 | - } | |
| 1201 | - | |
| 1202 | 1202 | public partial class FalseClass |
| 1203 | 1203 | { |
| 1204 | 1204 | [JsonProperty("false", Required = Required.Always)] |
| @@ -1216,6 +1216,9 @@ namespace QuickType | ||
| 1216 | 1216 | [JsonProperty("dummy", Required = Required.Always)] |
| 1217 | 1217 | public long Dummy { get; set; } |
| 1218 | 1218 | |
| 1219 | + [JsonProperty("goto", Required = Required.Always)] | |
| 1220 | + public Goto Goto { get; set; } | |
| 1221 | + | |
| 1219 | 1222 | [JsonProperty("guard", Required = Required.Always)] |
| 1220 | 1223 | public Guard Guard { get; set; } |
| 1221 | 1224 | |
| @@ -1375,6 +1378,9 @@ namespace QuickType | ||
| 1375 | 1378 | [JsonProperty("MapEntry", Required = Required.Always)] |
| 1376 | 1379 | public MapEntry MapEntry { get; set; } |
| 1377 | 1380 | |
| 1381 | + [JsonProperty("MarshalJSON", Required = Required.Always)] | |
| 1382 | + public MarshalJson MarshalJson { get; set; } | |
| 1383 | + | |
| 1378 | 1384 | [JsonProperty("metadata_property_handling", Required = Required.Always)] |
| 1379 | 1385 | public MetadataPropertyHandlingClass MetadataPropertyHandling { get; set; } |
| 1380 | 1386 | |
| @@ -1404,9 +1410,12 @@ namespace QuickType | ||
| 1404 | 1410 | |
| 1405 | 1411 | [JsonProperty("NO", Required = Required.Always)] |
| 1406 | 1412 | public No No { get; set; } |
| 1413 | + } | |
| 1407 | 1414 | |
| 1408 | - [JsonProperty("noexcept", Required = Required.Always)] | |
| 1409 | - public Noexcept Noexcept { get; set; } | |
| 1415 | + public partial class Goto | |
| 1416 | + { | |
| 1417 | + [JsonProperty("goto", Required = Required.Always)] | |
| 1418 | + public long GotoGoto { get; set; } | |
| 1410 | 1419 | } |
| 1411 | 1420 | |
| 1412 | 1421 | public partial class Guard |
| @@ -1727,6 +1736,12 @@ namespace QuickType | ||
| 1727 | 1736 | public long MapEntryMapEntry { get; set; } |
| 1728 | 1737 | } |
| 1729 | 1738 | |
| 1739 | + public partial class MarshalJson | |
| 1740 | + { | |
| 1741 | + [JsonProperty("MarshalJSON", Required = Required.Always)] | |
| 1742 | + public long MarshalJsonMarshalJson { get; set; } | |
| 1743 | + } | |
| 1744 | + | |
| 1730 | 1745 | public partial class MetadataPropertyHandlingClass |
| 1731 | 1746 | { |
| 1732 | 1747 | [JsonProperty("metadata_property_handling", Required = Required.Always)] |
| @@ -1787,12 +1802,6 @@ namespace QuickType | ||
| 1787 | 1802 | public long NoNo { get; set; } |
| 1788 | 1803 | } |
| 1789 | 1804 | |
| 1790 | - public partial class Noexcept | |
| 1791 | - { | |
| 1792 | - [JsonProperty("noexcept", Required = Required.Always)] | |
| 1793 | - public long NoexceptNoexcept { get; set; } | |
| 1794 | - } | |
| 1795 | - | |
| 1796 | 1805 | public partial class Obj4 |
| 1797 | 1806 | { |
| 1798 | 1807 | [JsonProperty("dummy", Required = Required.Always)] |
| @@ -1801,6 +1810,9 @@ namespace QuickType | ||
| 1801 | 1810 | [JsonProperty("noSuchMethod", Required = Required.Always)] |
| 1802 | 1811 | public NoSuchMethod NoSuchMethod { get; set; } |
| 1803 | 1812 | |
| 1813 | + [JsonProperty("noexcept", Required = Required.Always)] | |
| 1814 | + public Noexcept Noexcept { get; set; } | |
| 1815 | + | |
| 1804 | 1816 | [JsonProperty("nonatomic", Required = Required.Always)] |
| 1805 | 1817 | public Nonatomic Nonatomic { get; set; } |
| 1806 | 1818 | |
| @@ -1986,9 +1998,6 @@ namespace QuickType | ||
| 1986 | 1998 | |
| 1987 | 1999 | [JsonProperty("SEL", Required = Required.Always)] |
| 1988 | 2000 | public Sel Sel { get; set; } |
| 1989 | - | |
| 1990 | - [JsonProperty("select", Required = Required.Always)] | |
| 1991 | - public Select Select { get; set; } | |
| 1992 | 2001 | } |
| 1993 | 2002 | |
| 1994 | 2003 | public partial class NoSuchMethod |
| @@ -1997,6 +2006,12 @@ namespace QuickType | ||
| 1997 | 2006 | public long NoSuchMethodNoSuchMethod { get; set; } |
| 1998 | 2007 | } |
| 1999 | 2008 | |
| 2009 | + public partial class Noexcept | |
| 2010 | + { | |
| 2011 | + [JsonProperty("noexcept", Required = Required.Always)] | |
| 2012 | + public long NoexceptNoexcept { get; set; } | |
| 2013 | + } | |
| 2014 | + | |
| 2000 | 2015 | public partial class Nonatomic |
| 2001 | 2016 | { |
| 2002 | 2017 | [JsonProperty("nonatomic", Required = Required.Always)] |
| @@ -2369,12 +2384,6 @@ namespace QuickType | ||
| 2369 | 2384 | public long SelSel { get; set; } |
| 2370 | 2385 | } |
| 2371 | 2386 | |
| 2372 | - public partial class Select | |
| 2373 | - { | |
| 2374 | - [JsonProperty("select", Required = Required.Always)] | |
| 2375 | - public long SelectSelect { get; set; } | |
| 2376 | - } | |
| 2377 | - | |
| 2378 | 2387 | public partial class Obj5 |
| 2379 | 2388 | { |
| 2380 | 2389 | [JsonProperty("dummy", Required = Required.Always)] |
| @@ -2401,6 +2410,9 @@ namespace QuickType | ||
| 2401 | 2410 | [JsonProperty("PrimitiveKind", Required = Required.Always)] |
| 2402 | 2411 | public PrimitiveKind PrimitiveKind { get; set; } |
| 2403 | 2412 | |
| 2413 | + [JsonProperty("select", Required = Required.Always)] | |
| 2414 | + public Select Select { get; set; } | |
| 2415 | + | |
| 2404 | 2416 | [JsonProperty("Self", Required = Required.Always)] |
| 2405 | 2417 | public Self Self { get; set; } |
| 2406 | 2418 | |
| @@ -2512,6 +2524,9 @@ namespace QuickType | ||
| 2512 | 2524 | [JsonProperty("TimeZone", Required = Required.Always)] |
| 2513 | 2525 | public TimeZone TimeZone { get; set; } |
| 2514 | 2526 | |
| 2527 | + [JsonProperty("to_dict", Required = Required.Always)] | |
| 2528 | + public ToDict ToDict { get; set; } | |
| 2529 | + | |
| 2515 | 2530 | [JsonProperty("top_level", Required = Required.Always)] |
| 2516 | 2531 | public TopLevelClass TopLevel { get; set; } |
| 2517 | 2532 | |
| @@ -2557,20 +2572,17 @@ namespace QuickType | ||
| 2557 | 2572 | [JsonProperty("union", Required = Required.Always)] |
| 2558 | 2573 | public Union Union { get; set; } |
| 2559 | 2574 | |
| 2575 | + [JsonProperty("UnmarshalJSON", Required = Required.Always)] | |
| 2576 | + public UnmarshalJson UnmarshalJson { get; set; } | |
| 2577 | + | |
| 2560 | 2578 | [JsonProperty("unowned", Required = Required.Always)] |
| 2561 | 2579 | public Unowned Unowned { get; set; } |
| 2562 | 2580 | |
| 2563 | 2581 | [JsonProperty("unsafe", Required = Required.Always)] |
| 2564 | 2582 | public Unsafe Unsafe { get; set; } |
| 2565 | 2583 | |
| 2566 | - [JsonProperty("unsigned", Required = Required.Always)] | |
| 2567 | - public Unsigned Unsigned { get; set; } | |
| 2568 | - | |
| 2569 | 2584 | [JsonProperty("UseSerializers", Required = Required.Always)] |
| 2570 | 2585 | public UseSerializers UseSerializers { get; set; } |
| 2571 | - | |
| 2572 | - [JsonProperty("ushort", Required = Required.Always)] | |
| 2573 | - public Ushort Ushort { get; set; } | |
| 2574 | 2586 | } |
| 2575 | 2587 | |
| 2576 | 2588 | public partial class KSerializer |
| @@ -2615,6 +2627,12 @@ namespace QuickType | ||
| 2615 | 2627 | public long PrimitiveKindPrimitiveKind { get; set; } |
| 2616 | 2628 | } |
| 2617 | 2629 | |
| 2630 | + public partial class Select | |
| 2631 | + { | |
| 2632 | + [JsonProperty("select", Required = Required.Always)] | |
| 2633 | + public long SelectSelect { get; set; } | |
| 2634 | + } | |
| 2635 | + | |
| 2618 | 2636 | public partial class Self |
| 2619 | 2637 | { |
| 2620 | 2638 | [JsonProperty("Self", Required = Required.Always)] |
| @@ -2837,6 +2855,12 @@ namespace QuickType | ||
| 2837 | 2855 | public long TimeZoneTimeZone { get; set; } |
| 2838 | 2856 | } |
| 2839 | 2857 | |
| 2858 | + public partial class ToDict | |
| 2859 | + { | |
| 2860 | + [JsonProperty("to_dict", Required = Required.Always)] | |
| 2861 | + public long ToDictToDict { get; set; } | |
| 2862 | + } | |
| 2863 | + | |
| 2840 | 2864 | public partial class TopLevelClass |
| 2841 | 2865 | { |
| 2842 | 2866 | [JsonProperty("top_level", Required = Required.Always)] |
| @@ -2927,6 +2951,12 @@ namespace QuickType | ||
| 2927 | 2951 | public long UnionUnion { get; set; } |
| 2928 | 2952 | } |
| 2929 | 2953 | |
| 2954 | + public partial class UnmarshalJson | |
| 2955 | + { | |
| 2956 | + [JsonProperty("UnmarshalJSON", Required = Required.Always)] | |
| 2957 | + public long UnmarshalJsonUnmarshalJson { get; set; } | |
| 2958 | + } | |
| 2959 | + | |
| 2930 | 2960 | public partial class Unowned |
| 2931 | 2961 | { |
| 2932 | 2962 | [JsonProperty("unowned", Required = Required.Always)] |
| @@ -2939,29 +2969,23 @@ namespace QuickType | ||
| 2939 | 2969 | public long UnsafeUnsafe { get; set; } |
| 2940 | 2970 | } |
| 2941 | 2971 | |
| 2942 | - public partial class Unsigned | |
| 2943 | - { | |
| 2944 | - [JsonProperty("unsigned", Required = Required.Always)] | |
| 2945 | - public long UnsignedUnsigned { get; set; } | |
| 2946 | - } | |
| 2947 | - | |
| 2948 | 2972 | public partial class UseSerializers |
| 2949 | 2973 | { |
| 2950 | 2974 | [JsonProperty("UseSerializers", Required = Required.Always)] |
| 2951 | 2975 | public long UseSerializersUseSerializers { get; set; } |
| 2952 | 2976 | } |
| 2953 | 2977 | |
| 2954 | - public partial class Ushort | |
| 2955 | - { | |
| 2956 | - [JsonProperty("ushort", Required = Required.Always)] | |
| 2957 | - public long UshortUshort { get; set; } | |
| 2958 | - } | |
| 2959 | - | |
| 2960 | 2978 | public partial class Obj6 |
| 2961 | 2979 | { |
| 2962 | 2980 | [JsonProperty("dummy", Required = Required.Always)] |
| 2963 | 2981 | public long Dummy { get; set; } |
| 2964 | 2982 | |
| 2983 | + [JsonProperty("unsigned", Required = Required.Always)] | |
| 2984 | + public Unsigned Unsigned { get; set; } | |
| 2985 | + | |
| 2986 | + [JsonProperty("ushort", Required = Required.Always)] | |
| 2987 | + public Ushort Ushort { get; set; } | |
| 2988 | + | |
| 2965 | 2989 | [JsonProperty("using", Required = Required.Always)] |
| 2966 | 2990 | public Using Using { get; set; } |
| 2967 | 2991 | |
| @@ -3017,6 +3041,18 @@ namespace QuickType | ||
| 3017 | 3041 | public Yield Yield { get; set; } |
| 3018 | 3042 | } |
| 3019 | 3043 | |
| 3044 | + public partial class Unsigned | |
| 3045 | + { | |
| 3046 | + [JsonProperty("unsigned", Required = Required.Always)] | |
| 3047 | + public long UnsignedUnsigned { get; set; } | |
| 3048 | + } | |
| 3049 | + | |
| 3050 | + public partial class Ushort | |
| 3051 | + { | |
| 3052 | + [JsonProperty("ushort", Required = Required.Always)] | |
| 3053 | + public long UshortUshort { get; set; } | |
| 3054 | + } | |
| 3055 | + | |
| 3020 | 3056 | public partial class Using |
| 3021 | 3057 | { |
| 3022 | 3058 | [JsonProperty("using", Required = Required.Always)] |
Mdartdefault / TopLevel.dart+180 −100
| @@ -1390,11 +1390,11 @@ class Obj2 { | ||
| 1390 | 1390 | final FormatExceptionClass formatException; |
| 1391 | 1391 | final Friend friend; |
| 1392 | 1392 | final From from; |
| 1393 | + final FromDict fromDict; | |
| 1393 | 1394 | final Func func; |
| 1394 | 1395 | final FunctionClass function; |
| 1395 | 1396 | final Global global; |
| 1396 | 1397 | final Go go; |
| 1397 | - final Goto goto; | |
| 1398 | 1398 | final Default obj2Default; |
| 1399 | 1399 | final Do obj2Do; |
| 1400 | 1400 | final Double obj2Double; |
| @@ -1457,11 +1457,11 @@ class Obj2 { | ||
| 1457 | 1457 | required this.formatException, |
| 1458 | 1458 | required this.friend, |
| 1459 | 1459 | required this.from, |
| 1460 | + required this.fromDict, | |
| 1460 | 1461 | required this.func, |
| 1461 | 1462 | required this.function, |
| 1462 | 1463 | required this.global, |
| 1463 | 1464 | required this.go, |
| 1464 | - required this.goto, | |
| 1465 | 1465 | required this.obj2Default, |
| 1466 | 1466 | required this.obj2Do, |
| 1467 | 1467 | required this.obj2Double, |
| @@ -1525,11 +1525,11 @@ class Obj2 { | ||
| 1525 | 1525 | formatException: FormatExceptionClass.fromJson(json["FormatException"]), |
| 1526 | 1526 | friend: Friend.fromJson(json["friend"]), |
| 1527 | 1527 | from: From.fromJson(json["from"]), |
| 1528 | + fromDict: FromDict.fromJson(json["from_dict"]), | |
| 1528 | 1529 | func: Func.fromJson(json["func"]), |
| 1529 | 1530 | function: FunctionClass.fromJson(json["function"]), |
| 1530 | 1531 | global: Global.fromJson(json["global"]), |
| 1531 | 1532 | go: Go.fromJson(json["go"]), |
| 1532 | - goto: Goto.fromJson(json["goto"]), | |
| 1533 | 1533 | obj2Default: Default.fromJson(json["default"]), |
| 1534 | 1534 | obj2Do: Do.fromJson(json["do"]), |
| 1535 | 1535 | obj2Double: Double.fromJson(json["double"]), |
| @@ -1593,11 +1593,11 @@ class Obj2 { | ||
| 1593 | 1593 | "FormatException": formatException.toJson(), |
| 1594 | 1594 | "friend": friend.toJson(), |
| 1595 | 1595 | "from": from.toJson(), |
| 1596 | + "from_dict": fromDict.toJson(), | |
| 1596 | 1597 | "func": func.toJson(), |
| 1597 | 1598 | "function": function.toJson(), |
| 1598 | 1599 | "global": global.toJson(), |
| 1599 | 1600 | "go": go.toJson(), |
| 1600 | - "goto": goto.toJson(), | |
| 1601 | 1601 | "default": obj2Default.toJson(), |
| 1602 | 1602 | "do": obj2Do.toJson(), |
| 1603 | 1603 | "double": obj2Double.toJson(), |
| @@ -2330,6 +2330,22 @@ class From { | ||
| 2330 | 2330 | }; |
| 2331 | 2331 | } |
| 2332 | 2332 | |
| 2333 | +class FromDict { | |
| 2334 | + final int fromDict; | |
| 2335 | + | |
| 2336 | + FromDict({ | |
| 2337 | + required this.fromDict, | |
| 2338 | + }); | |
| 2339 | + | |
| 2340 | + factory FromDict.fromJson(Map<String, dynamic> json) => FromDict( | |
| 2341 | + fromDict: json["from_dict"], | |
| 2342 | + ); | |
| 2343 | + | |
| 2344 | + Map<String, dynamic> toJson() => { | |
| 2345 | + "from_dict": fromDict, | |
| 2346 | + }; | |
| 2347 | +} | |
| 2348 | + | |
| 2333 | 2349 | class Func { |
| 2334 | 2350 | final int func; |
| 2335 | 2351 | |
| @@ -2394,22 +2410,6 @@ class Go { | ||
| 2394 | 2410 | }; |
| 2395 | 2411 | } |
| 2396 | 2412 | |
| 2397 | -class Goto { | |
| 2398 | - final int goto; | |
| 2399 | - | |
| 2400 | - Goto({ | |
| 2401 | - required this.goto, | |
| 2402 | - }); | |
| 2403 | - | |
| 2404 | - factory Goto.fromJson(Map<String, dynamic> json) => Goto( | |
| 2405 | - goto: json["goto"], | |
| 2406 | - ); | |
| 2407 | - | |
| 2408 | - Map<String, dynamic> toJson() => { | |
| 2409 | - "goto": goto, | |
| 2410 | - }; | |
| 2411 | -} | |
| 2412 | - | |
| 2413 | 2413 | class Default { |
| 2414 | 2414 | final int defaultDefault; |
| 2415 | 2415 | |
| @@ -2652,6 +2652,7 @@ class FalseClass { | ||
| 2652 | 2652 | |
| 2653 | 2653 | class Obj3 { |
| 2654 | 2654 | final int dummy; |
| 2655 | + final Goto goto; | |
| 2655 | 2656 | final Guard guard; |
| 2656 | 2657 | final HasOwnProperty hasOwnProperty; |
| 2657 | 2658 | final Hashable hashable; |
| @@ -2697,6 +2698,7 @@ class Obj3 { | ||
| 2697 | 2698 | final Long long; |
| 2698 | 2699 | final MapClass map; |
| 2699 | 2700 | final MapEntryClass mapEntry; |
| 2701 | + final MarshalJson marshalJson; | |
| 2700 | 2702 | final MetadataPropertyHandling metadataPropertyHandling; |
| 2701 | 2703 | final Module module; |
| 2702 | 2704 | final Mutable mutable; |
| @@ -2706,7 +2708,6 @@ class Obj3 { | ||
| 2706 | 2708 | final Newtonsoft newtonsoft; |
| 2707 | 2709 | final Nil nil; |
| 2708 | 2710 | final No no; |
| 2709 | - final Noexcept noexcept; | |
| 2710 | 2711 | final HashCode obj3HashCode; |
| 2711 | 2712 | final If obj3If; |
| 2712 | 2713 | final Implements obj3Implements; |
| @@ -2719,6 +2720,7 @@ class Obj3 { | ||
| 2719 | 2720 | |
| 2720 | 2721 | Obj3({ |
| 2721 | 2722 | required this.dummy, |
| 2723 | + required this.goto, | |
| 2722 | 2724 | required this.guard, |
| 2723 | 2725 | required this.hasOwnProperty, |
| 2724 | 2726 | required this.hashable, |
| @@ -2764,6 +2766,7 @@ class Obj3 { | ||
| 2764 | 2766 | required this.long, |
| 2765 | 2767 | required this.map, |
| 2766 | 2768 | required this.mapEntry, |
| 2769 | + required this.marshalJson, | |
| 2767 | 2770 | required this.metadataPropertyHandling, |
| 2768 | 2771 | required this.module, |
| 2769 | 2772 | required this.mutable, |
| @@ -2773,7 +2776,6 @@ class Obj3 { | ||
| 2773 | 2776 | required this.newtonsoft, |
| 2774 | 2777 | required this.nil, |
| 2775 | 2778 | required this.no, |
| 2776 | - required this.noexcept, | |
| 2777 | 2779 | required this.obj3HashCode, |
| 2778 | 2780 | required this.obj3If, |
| 2779 | 2781 | required this.obj3Implements, |
| @@ -2787,6 +2789,7 @@ class Obj3 { | ||
| 2787 | 2789 | |
| 2788 | 2790 | factory Obj3.fromJson(Map<String, dynamic> json) => Obj3( |
| 2789 | 2791 | dummy: json["dummy"], |
| 2792 | + goto: Goto.fromJson(json["goto"]), | |
| 2790 | 2793 | guard: Guard.fromJson(json["guard"]), |
| 2791 | 2794 | hasOwnProperty: HasOwnProperty.fromJson(json["hasOwnProperty"]), |
| 2792 | 2795 | hashable: Hashable.fromJson(json["Hashable"]), |
| @@ -2832,6 +2835,7 @@ class Obj3 { | ||
| 2832 | 2835 | long: Long.fromJson(json["long"]), |
| 2833 | 2836 | map: MapClass.fromJson(json["map"]), |
| 2834 | 2837 | mapEntry: MapEntryClass.fromJson(json["MapEntry"]), |
| 2838 | + marshalJson: MarshalJson.fromJson(json["MarshalJSON"]), | |
| 2835 | 2839 | metadataPropertyHandling: MetadataPropertyHandling.fromJson(json["metadata_property_handling"]), |
| 2836 | 2840 | module: Module.fromJson(json["module"]), |
| 2837 | 2841 | mutable: Mutable.fromJson(json["mutable"]), |
| @@ -2841,7 +2845,6 @@ class Obj3 { | ||
| 2841 | 2845 | newtonsoft: Newtonsoft.fromJson(json["newtonsoft"]), |
| 2842 | 2846 | nil: Nil.fromJson(json["nil"]), |
| 2843 | 2847 | no: No.fromJson(json["NO"]), |
| 2844 | - noexcept: Noexcept.fromJson(json["noexcept"]), | |
| 2845 | 2848 | obj3HashCode: HashCode.fromJson(json["hashCode"]), |
| 2846 | 2849 | obj3If: If.fromJson(json["if"]), |
| 2847 | 2850 | obj3Implements: Implements.fromJson(json["implements"]), |
| @@ -2855,6 +2858,7 @@ class Obj3 { | ||
| 2855 | 2858 | |
| 2856 | 2859 | Map<String, dynamic> toJson() => { |
| 2857 | 2860 | "dummy": dummy, |
| 2861 | + "goto": goto.toJson(), | |
| 2858 | 2862 | "guard": guard.toJson(), |
| 2859 | 2863 | "hasOwnProperty": hasOwnProperty.toJson(), |
| 2860 | 2864 | "Hashable": hashable.toJson(), |
| @@ -2900,6 +2904,7 @@ class Obj3 { | ||
| 2900 | 2904 | "long": long.toJson(), |
| 2901 | 2905 | "map": map.toJson(), |
| 2902 | 2906 | "MapEntry": mapEntry.toJson(), |
| 2907 | + "MarshalJSON": marshalJson.toJson(), | |
| 2903 | 2908 | "metadata_property_handling": metadataPropertyHandling.toJson(), |
| 2904 | 2909 | "module": module.toJson(), |
| 2905 | 2910 | "mutable": mutable.toJson(), |
| @@ -2909,7 +2914,6 @@ class Obj3 { | ||
| 2909 | 2914 | "newtonsoft": newtonsoft.toJson(), |
| 2910 | 2915 | "nil": nil.toJson(), |
| 2911 | 2916 | "NO": no.toJson(), |
| 2912 | - "noexcept": noexcept.toJson(), | |
| 2913 | 2917 | "hashCode": obj3HashCode.toJson(), |
| 2914 | 2918 | "if": obj3If.toJson(), |
| 2915 | 2919 | "implements": obj3Implements.toJson(), |
| @@ -2922,6 +2926,22 @@ class Obj3 { | ||
| 2922 | 2926 | }; |
| 2923 | 2927 | } |
| 2924 | 2928 | |
| 2929 | +class Goto { | |
| 2930 | + final int goto; | |
| 2931 | + | |
| 2932 | + Goto({ | |
| 2933 | + required this.goto, | |
| 2934 | + }); | |
| 2935 | + | |
| 2936 | + factory Goto.fromJson(Map<String, dynamic> json) => Goto( | |
| 2937 | + goto: json["goto"], | |
| 2938 | + ); | |
| 2939 | + | |
| 2940 | + Map<String, dynamic> toJson() => { | |
| 2941 | + "goto": goto, | |
| 2942 | + }; | |
| 2943 | +} | |
| 2944 | + | |
| 2925 | 2945 | class Guard { |
| 2926 | 2946 | final int guard; |
| 2927 | 2947 | |
| @@ -3642,6 +3662,22 @@ class MapEntryClass { | ||
| 3642 | 3662 | }; |
| 3643 | 3663 | } |
| 3644 | 3664 | |
| 3665 | +class MarshalJson { | |
| 3666 | + final int marshalJson; | |
| 3667 | + | |
| 3668 | + MarshalJson({ | |
| 3669 | + required this.marshalJson, | |
| 3670 | + }); | |
| 3671 | + | |
| 3672 | + factory MarshalJson.fromJson(Map<String, dynamic> json) => MarshalJson( | |
| 3673 | + marshalJson: json["MarshalJSON"], | |
| 3674 | + ); | |
| 3675 | + | |
| 3676 | + Map<String, dynamic> toJson() => { | |
| 3677 | + "MarshalJSON": marshalJson, | |
| 3678 | + }; | |
| 3679 | +} | |
| 3680 | + | |
| 3645 | 3681 | class MetadataPropertyHandling { |
| 3646 | 3682 | final int metadataPropertyHandling; |
| 3647 | 3683 | |
| @@ -3786,22 +3822,6 @@ class No { | ||
| 3786 | 3822 | }; |
| 3787 | 3823 | } |
| 3788 | 3824 | |
| 3789 | -class Noexcept { | |
| 3790 | - final int noexcept; | |
| 3791 | - | |
| 3792 | - Noexcept({ | |
| 3793 | - required this.noexcept, | |
| 3794 | - }); | |
| 3795 | - | |
| 3796 | - factory Noexcept.fromJson(Map<String, dynamic> json) => Noexcept( | |
| 3797 | - noexcept: json["noexcept"], | |
| 3798 | - ); | |
| 3799 | - | |
| 3800 | - Map<String, dynamic> toJson() => { | |
| 3801 | - "noexcept": noexcept, | |
| 3802 | - }; | |
| 3803 | -} | |
| 3804 | - | |
| 3805 | 3825 | class HashCode { |
| 3806 | 3826 | final int hashCodeHashCode; |
| 3807 | 3827 | |
| @@ -3948,6 +3968,7 @@ class New { | ||
| 3948 | 3968 | |
| 3949 | 3969 | class Obj4 { |
| 3950 | 3970 | final int dummy; |
| 3971 | + final Noexcept noexcept; | |
| 3951 | 3972 | final Nonatomic nonatomic; |
| 3952 | 3973 | final None none; |
| 3953 | 3974 | final Nonlocal nonlocal; |
| @@ -4011,10 +4032,10 @@ class Obj4 { | ||
| 4011 | 4032 | final Sbyte sbyte; |
| 4012 | 4033 | final Sealed sealed; |
| 4013 | 4034 | final Sel sel; |
| 4014 | - final Select select; | |
| 4015 | 4035 | |
| 4016 | 4036 | Obj4({ |
| 4017 | 4037 | required this.dummy, |
| 4038 | + required this.noexcept, | |
| 4018 | 4039 | required this.nonatomic, |
| 4019 | 4040 | required this.none, |
| 4020 | 4041 | required this.nonlocal, |
| @@ -4078,11 +4099,11 @@ class Obj4 { | ||
| 4078 | 4099 | required this.sbyte, |
| 4079 | 4100 | required this.sealed, |
| 4080 | 4101 | required this.sel, |
| 4081 | - required this.select, | |
| 4082 | 4102 | }); |
| 4083 | 4103 | |
| 4084 | 4104 | factory Obj4.fromJson(Map<String, dynamic> json) => Obj4( |
| 4085 | 4105 | dummy: json["dummy"], |
| 4106 | + noexcept: Noexcept.fromJson(json["noexcept"]), | |
| 4086 | 4107 | nonatomic: Nonatomic.fromJson(json["nonatomic"]), |
| 4087 | 4108 | none: None.fromJson(json["None"]), |
| 4088 | 4109 | nonlocal: Nonlocal.fromJson(json["nonlocal"]), |
| @@ -4146,11 +4167,11 @@ class Obj4 { | ||
| 4146 | 4167 | sbyte: Sbyte.fromJson(json["sbyte"]), |
| 4147 | 4168 | sealed: Sealed.fromJson(json["sealed"]), |
| 4148 | 4169 | sel: Sel.fromJson(json["SEL"]), |
| 4149 | - select: Select.fromJson(json["select"]), | |
| 4150 | 4170 | ); |
| 4151 | 4171 | |
| 4152 | 4172 | Map<String, dynamic> toJson() => { |
| 4153 | 4173 | "dummy": dummy, |
| 4174 | + "noexcept": noexcept.toJson(), | |
| 4154 | 4175 | "nonatomic": nonatomic.toJson(), |
| 4155 | 4176 | "None": none.toJson(), |
| 4156 | 4177 | "nonlocal": nonlocal.toJson(), |
| @@ -4214,7 +4235,22 @@ class Obj4 { | ||
| 4214 | 4235 | "sbyte": sbyte.toJson(), |
| 4215 | 4236 | "sealed": sealed.toJson(), |
| 4216 | 4237 | "SEL": sel.toJson(), |
| 4217 | - "select": select.toJson(), | |
| 4238 | + }; | |
| 4239 | +} | |
| 4240 | + | |
| 4241 | +class Noexcept { | |
| 4242 | + final int noexcept; | |
| 4243 | + | |
| 4244 | + Noexcept({ | |
| 4245 | + required this.noexcept, | |
| 4246 | + }); | |
| 4247 | + | |
| 4248 | + factory Noexcept.fromJson(Map<String, dynamic> json) => Noexcept( | |
| 4249 | + noexcept: json["noexcept"], | |
| 4250 | + ); | |
| 4251 | + | |
| 4252 | + Map<String, dynamic> toJson() => { | |
| 4253 | + "noexcept": noexcept, | |
| 4218 | 4254 | }; |
| 4219 | 4255 | } |
| 4220 | 4256 | |
| @@ -5226,22 +5262,6 @@ class Sel { | ||
| 5226 | 5262 | }; |
| 5227 | 5263 | } |
| 5228 | 5264 | |
| 5229 | -class Select { | |
| 5230 | - final int select; | |
| 5231 | - | |
| 5232 | - Select({ | |
| 5233 | - required this.select, | |
| 5234 | - }); | |
| 5235 | - | |
| 5236 | - factory Select.fromJson(Map<String, dynamic> json) => Select( | |
| 5237 | - select: json["select"], | |
| 5238 | - ); | |
| 5239 | - | |
| 5240 | - Map<String, dynamic> toJson() => { | |
| 5241 | - "select": select, | |
| 5242 | - }; | |
| 5243 | -} | |
| 5244 | - | |
| 5245 | 5265 | class Obj5 { |
| 5246 | 5266 | final int dummy; |
| 5247 | 5267 | final KSerializer kSerializer; |
| @@ -5260,6 +5280,7 @@ class Obj5 { | ||
| 5260 | 5280 | final Typedef obj5Typedef; |
| 5261 | 5281 | final PrimitiveKind primitiveKind; |
| 5262 | 5282 | final TrueClass purpleTrue; |
| 5283 | + final Select select; | |
| 5263 | 5284 | final Self self; |
| 5264 | 5285 | final Sendable sendable; |
| 5265 | 5286 | final SerialDescriptor serialDescriptor; |
| @@ -5291,6 +5312,7 @@ class Obj5 { | ||
| 5291 | 5312 | final TimeOnly timeOnly; |
| 5292 | 5313 | final TimeOnlyConverter timeOnlyConverter; |
| 5293 | 5314 | final TimeZone timeZone; |
| 5315 | + final ToDict toDict; | |
| 5294 | 5316 | final TopLevelClass topLevel; |
| 5295 | 5317 | final Transient transient; |
| 5296 | 5318 | final Type type; |
| @@ -5303,11 +5325,10 @@ class Obj5 { | ||
| 5303 | 5325 | final Unchecked unchecked; |
| 5304 | 5326 | final Undefined undefined; |
| 5305 | 5327 | final Union union; |
| 5328 | + final UnmarshalJson unmarshalJson; | |
| 5306 | 5329 | final Unowned unowned; |
| 5307 | 5330 | final Unsafe unsafe; |
| 5308 | - final Unsigned unsigned; | |
| 5309 | 5331 | final UseSerializers useSerializers; |
| 5310 | - final Ushort ushort; | |
| 5311 | 5332 | |
| 5312 | 5333 | Obj5({ |
| 5313 | 5334 | required this.dummy, |
| @@ -5327,6 +5348,7 @@ class Obj5 { | ||
| 5327 | 5348 | required this.obj5Typedef, |
| 5328 | 5349 | required this.primitiveKind, |
| 5329 | 5350 | required this.purpleTrue, |
| 5351 | + required this.select, | |
| 5330 | 5352 | required this.self, |
| 5331 | 5353 | required this.sendable, |
| 5332 | 5354 | required this.serialDescriptor, |
| @@ -5358,6 +5380,7 @@ class Obj5 { | ||
| 5358 | 5380 | required this.timeOnly, |
| 5359 | 5381 | required this.timeOnlyConverter, |
| 5360 | 5382 | required this.timeZone, |
| 5383 | + required this.toDict, | |
| 5361 | 5384 | required this.topLevel, |
| 5362 | 5385 | required this.transient, |
| 5363 | 5386 | required this.type, |
| @@ -5370,11 +5393,10 @@ class Obj5 { | ||
| 5370 | 5393 | required this.unchecked, |
| 5371 | 5394 | required this.undefined, |
| 5372 | 5395 | required this.union, |
| 5396 | + required this.unmarshalJson, | |
| 5373 | 5397 | required this.unowned, |
| 5374 | 5398 | required this.unsafe, |
| 5375 | - required this.unsigned, | |
| 5376 | 5399 | required this.useSerializers, |
| 5377 | - required this.ushort, | |
| 5378 | 5400 | }); |
| 5379 | 5401 | |
| 5380 | 5402 | factory Obj5.fromJson(Map<String, dynamic> json) => Obj5( |
| @@ -5395,6 +5417,7 @@ class Obj5 { | ||
| 5395 | 5417 | obj5Typedef: Typedef.fromJson(json["typedef"]), |
| 5396 | 5418 | primitiveKind: PrimitiveKind.fromJson(json["PrimitiveKind"]), |
| 5397 | 5419 | purpleTrue: TrueClass.fromJson(json["true"]), |
| 5420 | + select: Select.fromJson(json["select"]), | |
| 5398 | 5421 | self: Self.fromJson(json["Self"]), |
| 5399 | 5422 | sendable: Sendable.fromJson(json["Sendable"]), |
| 5400 | 5423 | serialDescriptor: SerialDescriptor.fromJson(json["SerialDescriptor"]), |
| @@ -5426,6 +5449,7 @@ class Obj5 { | ||
| 5426 | 5449 | timeOnly: TimeOnly.fromJson(json["TimeOnly"]), |
| 5427 | 5450 | timeOnlyConverter: TimeOnlyConverter.fromJson(json["TimeOnlyConverter"]), |
| 5428 | 5451 | timeZone: TimeZone.fromJson(json["TimeZone"]), |
| 5452 | + toDict: ToDict.fromJson(json["to_dict"]), | |
| 5429 | 5453 | topLevel: TopLevelClass.fromJson(json["top_level"]), |
| 5430 | 5454 | transient: Transient.fromJson(json["transient"]), |
| 5431 | 5455 | type: Type.fromJson(json["Type"]), |
| @@ -5438,11 +5462,10 @@ class Obj5 { | ||
| 5438 | 5462 | unchecked: Unchecked.fromJson(json["unchecked"]), |
| 5439 | 5463 | undefined: Undefined.fromJson(json["undefined"]), |
| 5440 | 5464 | union: Union.fromJson(json["union"]), |
| 5465 | + unmarshalJson: UnmarshalJson.fromJson(json["UnmarshalJSON"]), | |
| 5441 | 5466 | unowned: Unowned.fromJson(json["unowned"]), |
| 5442 | 5467 | unsafe: Unsafe.fromJson(json["unsafe"]), |
| 5443 | - unsigned: Unsigned.fromJson(json["unsigned"]), | |
| 5444 | 5468 | useSerializers: UseSerializers.fromJson(json["UseSerializers"]), |
| 5445 | - ushort: Ushort.fromJson(json["ushort"]), | |
| 5446 | 5469 | ); |
| 5447 | 5470 | |
| 5448 | 5471 | Map<String, dynamic> toJson() => { |
| @@ -5463,6 +5486,7 @@ class Obj5 { | ||
| 5463 | 5486 | "typedef": obj5Typedef.toJson(), |
| 5464 | 5487 | "PrimitiveKind": primitiveKind.toJson(), |
| 5465 | 5488 | "true": purpleTrue.toJson(), |
| 5489 | + "select": select.toJson(), | |
| 5466 | 5490 | "Self": self.toJson(), |
| 5467 | 5491 | "Sendable": sendable.toJson(), |
| 5468 | 5492 | "SerialDescriptor": serialDescriptor.toJson(), |
| @@ -5494,6 +5518,7 @@ class Obj5 { | ||
| 5494 | 5518 | "TimeOnly": timeOnly.toJson(), |
| 5495 | 5519 | "TimeOnlyConverter": timeOnlyConverter.toJson(), |
| 5496 | 5520 | "TimeZone": timeZone.toJson(), |
| 5521 | + "to_dict": toDict.toJson(), | |
| 5497 | 5522 | "top_level": topLevel.toJson(), |
| 5498 | 5523 | "transient": transient.toJson(), |
| 5499 | 5524 | "Type": type.toJson(), |
| @@ -5506,11 +5531,10 @@ class Obj5 { | ||
| 5506 | 5531 | "unchecked": unchecked.toJson(), |
| 5507 | 5532 | "undefined": undefined.toJson(), |
| 5508 | 5533 | "union": union.toJson(), |
| 5534 | + "UnmarshalJSON": unmarshalJson.toJson(), | |
| 5509 | 5535 | "unowned": unowned.toJson(), |
| 5510 | 5536 | "unsafe": unsafe.toJson(), |
| 5511 | - "unsigned": unsigned.toJson(), | |
| 5512 | 5537 | "UseSerializers": useSerializers.toJson(), |
| 5513 | - "ushort": ushort.toJson(), | |
| 5514 | 5538 | }; |
| 5515 | 5539 | } |
| 5516 | 5540 | |
| @@ -5770,6 +5794,22 @@ class TrueClass { | ||
| 5770 | 5794 | }; |
| 5771 | 5795 | } |
| 5772 | 5796 | |
| 5797 | +class Select { | |
| 5798 | + final int select; | |
| 5799 | + | |
| 5800 | + Select({ | |
| 5801 | + required this.select, | |
| 5802 | + }); | |
| 5803 | + | |
| 5804 | + factory Select.fromJson(Map<String, dynamic> json) => Select( | |
| 5805 | + select: json["select"], | |
| 5806 | + ); | |
| 5807 | + | |
| 5808 | + Map<String, dynamic> toJson() => { | |
| 5809 | + "select": select, | |
| 5810 | + }; | |
| 5811 | +} | |
| 5812 | + | |
| 5773 | 5813 | class Self { |
| 5774 | 5814 | final int self; |
| 5775 | 5815 | |
| @@ -6266,6 +6306,22 @@ class TimeZone { | ||
| 6266 | 6306 | }; |
| 6267 | 6307 | } |
| 6268 | 6308 | |
| 6309 | +class ToDict { | |
| 6310 | + final int toDict; | |
| 6311 | + | |
| 6312 | + ToDict({ | |
| 6313 | + required this.toDict, | |
| 6314 | + }); | |
| 6315 | + | |
| 6316 | + factory ToDict.fromJson(Map<String, dynamic> json) => ToDict( | |
| 6317 | + toDict: json["to_dict"], | |
| 6318 | + ); | |
| 6319 | + | |
| 6320 | + Map<String, dynamic> toJson() => { | |
| 6321 | + "to_dict": toDict, | |
| 6322 | + }; | |
| 6323 | +} | |
| 6324 | + | |
| 6269 | 6325 | class TopLevelClass { |
| 6270 | 6326 | final int topLevel; |
| 6271 | 6327 | |
| @@ -6458,6 +6514,22 @@ class Union { | ||
| 6458 | 6514 | }; |
| 6459 | 6515 | } |
| 6460 | 6516 | |
| 6517 | +class UnmarshalJson { | |
| 6518 | + final int unmarshalJson; | |
| 6519 | + | |
| 6520 | + UnmarshalJson({ | |
| 6521 | + required this.unmarshalJson, | |
| 6522 | + }); | |
| 6523 | + | |
| 6524 | + factory UnmarshalJson.fromJson(Map<String, dynamic> json) => UnmarshalJson( | |
| 6525 | + unmarshalJson: json["UnmarshalJSON"], | |
| 6526 | + ); | |
| 6527 | + | |
| 6528 | + Map<String, dynamic> toJson() => { | |
| 6529 | + "UnmarshalJSON": unmarshalJson, | |
| 6530 | + }; | |
| 6531 | +} | |
| 6532 | + | |
| 6461 | 6533 | class Unowned { |
| 6462 | 6534 | final int unowned; |
| 6463 | 6535 | |
| @@ -6490,22 +6562,6 @@ class Unsafe { | ||
| 6490 | 6562 | }; |
| 6491 | 6563 | } |
| 6492 | 6564 | |
| 6493 | -class Unsigned { | |
| 6494 | - final int unsigned; | |
| 6495 | - | |
| 6496 | - Unsigned({ | |
| 6497 | - required this.unsigned, | |
| 6498 | - }); | |
| 6499 | - | |
| 6500 | - factory Unsigned.fromJson(Map<String, dynamic> json) => Unsigned( | |
| 6501 | - unsigned: json["unsigned"], | |
| 6502 | - ); | |
| 6503 | - | |
| 6504 | - Map<String, dynamic> toJson() => { | |
| 6505 | - "unsigned": unsigned, | |
| 6506 | - }; | |
| 6507 | -} | |
| 6508 | - | |
| 6509 | 6565 | class UseSerializers { |
| 6510 | 6566 | final int useSerializers; |
| 6511 | 6567 | |
| @@ -6522,22 +6578,6 @@ class UseSerializers { | ||
| 6522 | 6578 | }; |
| 6523 | 6579 | } |
| 6524 | 6580 | |
| 6525 | -class Ushort { | |
| 6526 | - final int ushort; | |
| 6527 | - | |
| 6528 | - Ushort({ | |
| 6529 | - required this.ushort, | |
| 6530 | - }); | |
| 6531 | - | |
| 6532 | - factory Ushort.fromJson(Map<String, dynamic> json) => Ushort( | |
| 6533 | - ushort: json["ushort"], | |
| 6534 | - ); | |
| 6535 | - | |
| 6536 | - Map<String, dynamic> toJson() => { | |
| 6537 | - "ushort": ushort, | |
| 6538 | - }; | |
| 6539 | -} | |
| 6540 | - | |
| 6541 | 6581 | class Obj6 { |
| 6542 | 6582 | final int dummy; |
| 6543 | 6583 | final Var obj6Var; |
| @@ -6545,6 +6585,8 @@ class Obj6 { | ||
| 6545 | 6585 | final While obj6While; |
| 6546 | 6586 | final With obj6With; |
| 6547 | 6587 | final Yield obj6Yield; |
| 6588 | + final Unsigned unsigned; | |
| 6589 | + final Ushort ushort; | |
| 6548 | 6590 | final Using using; |
| 6549 | 6591 | final Utf8JsonReader utf8JsonReader; |
| 6550 | 6592 | final Utf8JsonWriter utf8JsonWriter; |
| @@ -6566,6 +6608,8 @@ class Obj6 { | ||
| 6566 | 6608 | required this.obj6While, |
| 6567 | 6609 | required this.obj6With, |
| 6568 | 6610 | required this.obj6Yield, |
| 6611 | + required this.unsigned, | |
| 6612 | + required this.ushort, | |
| 6569 | 6613 | required this.using, |
| 6570 | 6614 | required this.utf8JsonReader, |
| 6571 | 6615 | required this.utf8JsonWriter, |
| @@ -6588,6 +6632,8 @@ class Obj6 { | ||
| 6588 | 6632 | obj6While: While.fromJson(json["while"]), |
| 6589 | 6633 | obj6With: With.fromJson(json["with"]), |
| 6590 | 6634 | obj6Yield: Yield.fromJson(json["yield"]), |
| 6635 | + unsigned: Unsigned.fromJson(json["unsigned"]), | |
| 6636 | + ushort: Ushort.fromJson(json["ushort"]), | |
| 6591 | 6637 | using: Using.fromJson(json["using"]), |
| 6592 | 6638 | utf8JsonReader: Utf8JsonReader.fromJson(json["Utf8JsonReader"]), |
| 6593 | 6639 | utf8JsonWriter: Utf8JsonWriter.fromJson(json["Utf8JsonWriter"]), |
| @@ -6610,6 +6656,8 @@ class Obj6 { | ||
| 6610 | 6656 | "while": obj6While.toJson(), |
| 6611 | 6657 | "with": obj6With.toJson(), |
| 6612 | 6658 | "yield": obj6Yield.toJson(), |
| 6659 | + "unsigned": unsigned.toJson(), | |
| 6660 | + "ushort": ushort.toJson(), | |
| 6613 | 6661 | "using": using.toJson(), |
| 6614 | 6662 | "Utf8JsonReader": utf8JsonReader.toJson(), |
| 6615 | 6663 | "Utf8JsonWriter": utf8JsonWriter.toJson(), |
| @@ -6706,6 +6754,38 @@ class Yield { | ||
| 6706 | 6754 | }; |
| 6707 | 6755 | } |
| 6708 | 6756 | |
| 6757 | +class Unsigned { | |
| 6758 | + final int unsigned; | |
| 6759 | + | |
| 6760 | + Unsigned({ | |
| 6761 | + required this.unsigned, | |
| 6762 | + }); | |
| 6763 | + | |
| 6764 | + factory Unsigned.fromJson(Map<String, dynamic> json) => Unsigned( | |
| 6765 | + unsigned: json["unsigned"], | |
| 6766 | + ); | |
| 6767 | + | |
| 6768 | + Map<String, dynamic> toJson() => { | |
| 6769 | + "unsigned": unsigned, | |
| 6770 | + }; | |
| 6771 | +} | |
| 6772 | + | |
| 6773 | +class Ushort { | |
| 6774 | + final int ushort; | |
| 6775 | + | |
| 6776 | + Ushort({ | |
| 6777 | + required this.ushort, | |
| 6778 | + }); | |
| 6779 | + | |
| 6780 | + factory Ushort.fromJson(Map<String, dynamic> json) => Ushort( | |
| 6781 | + ushort: json["ushort"], | |
| 6782 | + ); | |
| 6783 | + | |
| 6784 | + Map<String, dynamic> toJson() => { | |
| 6785 | + "ushort": ushort, | |
| 6786 | + }; | |
| 6787 | +} | |
| 6788 | + | |
| 6709 | 6789 | class Using { |
| 6710 | 6790 | final int using; |
Melixirdefault / QuickType.ex+385 −217
| @@ -4845,6 +4845,45 @@ defmodule From do | ||
| 4845 | 4845 | end |
| 4846 | 4846 | end |
| 4847 | 4847 | |
| 4848 | +defmodule FromDict do | |
| 4849 | + @enforce_keys [:from_dict] | |
| 4850 | + defstruct [:from_dict] | |
| 4851 | + | |
| 4852 | + @type t :: %__MODULE__{ | |
| 4853 | + from_dict: integer() | |
| 4854 | + } | |
| 4855 | + | |
| 4856 | + def decode_from_dict(value) when is_integer(value), do: value | |
| 4857 | + def decode_from_dict(_), do: {:error, "Unexpected type when decoding FromDict.from_dict"} | |
| 4858 | + | |
| 4859 | + def encode_from_dict(value) when is_integer(value), do: value | |
| 4860 | + def encode_from_dict(_), do: {:error, "Unexpected type when encoding FromDict.from_dict"} | |
| 4861 | + | |
| 4862 | + def from_map(m) do | |
| 4863 | + %FromDict{ | |
| 4864 | + from_dict: decode_from_dict(m["from_dict"]), | |
| 4865 | + } | |
| 4866 | + end | |
| 4867 | + | |
| 4868 | + def from_json(json) do | |
| 4869 | + json | |
| 4870 | + |> Jason.decode!() | |
| 4871 | + |> from_map() | |
| 4872 | + end | |
| 4873 | + | |
| 4874 | + def to_map(struct) do | |
| 4875 | + %{ | |
| 4876 | + "from_dict" => struct.from_dict, | |
| 4877 | + } | |
| 4878 | + end | |
| 4879 | + | |
| 4880 | + def to_json(struct) do | |
| 4881 | + struct | |
| 4882 | + |> to_map() | |
| 4883 | + |> Jason.encode!() | |
| 4884 | + end | |
| 4885 | +end | |
| 4886 | + | |
| 4848 | 4887 | defmodule FromJSON do |
| 4849 | 4888 | @enforce_keys [:from_json] |
| 4850 | 4889 | defstruct [:from_json] |
| @@ -5079,45 +5118,6 @@ defmodule Go do | ||
| 5079 | 5118 | end |
| 5080 | 5119 | end |
| 5081 | 5120 | |
| 5082 | -defmodule Goto do | |
| 5083 | - @enforce_keys [:goto] | |
| 5084 | - defstruct [:goto] | |
| 5085 | - | |
| 5086 | - @type t :: %__MODULE__{ | |
| 5087 | - goto: integer() | |
| 5088 | - } | |
| 5089 | - | |
| 5090 | - def decode_goto(value) when is_integer(value), do: value | |
| 5091 | - def decode_goto(_), do: {:error, "Unexpected type when decoding Goto.goto"} | |
| 5092 | - | |
| 5093 | - def encode_goto(value) when is_integer(value), do: value | |
| 5094 | - def encode_goto(_), do: {:error, "Unexpected type when encoding Goto.goto"} | |
| 5095 | - | |
| 5096 | - def from_map(m) do | |
| 5097 | - %Goto{ | |
| 5098 | - goto: decode_goto(m["goto"]), | |
| 5099 | - } | |
| 5100 | - end | |
| 5101 | - | |
| 5102 | - def from_json(json) do | |
| 5103 | - json | |
| 5104 | - |> Jason.decode!() | |
| 5105 | - |> from_map() | |
| 5106 | - end | |
| 5107 | - | |
| 5108 | - def to_map(struct) do | |
| 5109 | - %{ | |
| 5110 | - "goto" => struct.goto, | |
| 5111 | - } | |
| 5112 | - end | |
| 5113 | - | |
| 5114 | - def to_json(struct) do | |
| 5115 | - struct | |
| 5116 | - |> to_map() | |
| 5117 | - |> Jason.encode!() | |
| 5118 | - end | |
| 5119 | -end | |
| 5120 | - | |
| 5121 | 5121 | defmodule DefClass do |
| 5122 | 5122 | @enforce_keys [:def_def] |
| 5123 | 5123 | defstruct [:def_def] |
| @@ -5275,8 +5275,8 @@ defmodule FalseClass do | ||
| 5275 | 5275 | end |
| 5276 | 5276 | |
| 5277 | 5277 | defmodule Obj2 do |
| 5278 | - @enforce_keys [:date_formatter, :date_only, :date_only_converter, :date_parse_handling, :date_time, :date_time_styles, :debugger, :decimal, :declare, :decltype, :decode_string, :decoder, :decoding_error, :default, :defer, :deinit, :del, :delegate, :delete, :dict, :dictionary, :did_set, :double, :dummy, :dynamic, :dynamic_cast, :elif, :encode_quick_type, :encoder, :enum, :enum_values, :equality_contract, :equatable, :event, :except, :exception, :explicit, :export, :exposing, :extends, :extension, :extern, :fallthrough, :false_1, :fileprivate, :final, :finally, :fixed, :float, :for, :foreach, :format_exception, :friend, :from, :from_json, :func, :function, :get, :global, :go, :goto, :obj2_def, :obj2_do, :obj2_else, :obj2_false] | |
| 5279 | - defstruct [:date_formatter, :date_only, :date_only_converter, :date_parse_handling, :date_time, :date_time_styles, :debugger, :decimal, :declare, :decltype, :decode_string, :decoder, :decoding_error, :default, :defer, :deinit, :del, :delegate, :delete, :dict, :dictionary, :did_set, :double, :dummy, :dynamic, :dynamic_cast, :elif, :encode_quick_type, :encoder, :enum, :enum_values, :equality_contract, :equatable, :event, :except, :exception, :explicit, :export, :exposing, :extends, :extension, :extern, :fallthrough, :false_1, :fileprivate, :final, :finally, :fixed, :float, :for, :foreach, :format_exception, :friend, :from, :from_json, :func, :function, :get, :global, :go, :goto, :obj2_def, :obj2_do, :obj2_else, :obj2_false] | |
| 5278 | + @enforce_keys [:date_formatter, :date_only, :date_only_converter, :date_parse_handling, :date_time, :date_time_styles, :debugger, :decimal, :declare, :decltype, :decode_string, :decoder, :decoding_error, :default, :defer, :deinit, :del, :delegate, :delete, :dict, :dictionary, :did_set, :double, :dummy, :dynamic, :dynamic_cast, :elif, :encode_quick_type, :encoder, :enum, :enum_values, :equality_contract, :equatable, :event, :except, :exception, :explicit, :export, :exposing, :extends, :extension, :extern, :fallthrough, :false_1, :fileprivate, :final, :finally, :fixed, :float, :for, :foreach, :format_exception, :friend, :from, :from_dict, :from_json, :func, :function, :get, :global, :go, :obj2_def, :obj2_do, :obj2_else, :obj2_false] | |
| 5279 | + defstruct [:date_formatter, :date_only, :date_only_converter, :date_parse_handling, :date_time, :date_time_styles, :debugger, :decimal, :declare, :decltype, :decode_string, :decoder, :decoding_error, :default, :defer, :deinit, :del, :delegate, :delete, :dict, :dictionary, :did_set, :double, :dummy, :dynamic, :dynamic_cast, :elif, :encode_quick_type, :encoder, :enum, :enum_values, :equality_contract, :equatable, :event, :except, :exception, :explicit, :export, :exposing, :extends, :extension, :extern, :fallthrough, :false_1, :fileprivate, :final, :finally, :fixed, :float, :for, :foreach, :format_exception, :friend, :from, :from_dict, :from_json, :func, :function, :get, :global, :go, :obj2_def, :obj2_do, :obj2_else, :obj2_false] | |
| 5280 | 5280 | |
| 5281 | 5281 | @type t :: %__MODULE__{ |
| 5282 | 5282 | date_formatter: DateFormatter.t(), |
| @@ -5333,13 +5333,13 @@ defmodule Obj2 do | ||
| 5333 | 5333 | format_exception: FormatException.t(), |
| 5334 | 5334 | friend: Friend.t(), |
| 5335 | 5335 | from: From.t(), |
| 5336 | + from_dict: FromDict.t(), | |
| 5336 | 5337 | from_json: FromJSON.t(), |
| 5337 | 5338 | func: Func.t(), |
| 5338 | 5339 | function: FunctionClass.t(), |
| 5339 | 5340 | get: Get.t(), |
| 5340 | 5341 | global: Global.t(), |
| 5341 | 5342 | go: Go.t(), |
| 5342 | - goto: Goto.t(), | |
| 5343 | 5343 | obj2_def: DefClass.t(), |
| 5344 | 5344 | obj2_do: DoClass.t(), |
| 5345 | 5345 | obj2_else: ElseClass.t(), |
| @@ -5408,13 +5408,13 @@ defmodule Obj2 do | ||
| 5408 | 5408 | format_exception: FormatException.from_map(m["FormatException"]), |
| 5409 | 5409 | friend: Friend.from_map(m["friend"]), |
| 5410 | 5410 | from: From.from_map(m["from"]), |
| 5411 | + from_dict: FromDict.from_map(m["from_dict"]), | |
| 5411 | 5412 | from_json: FromJSON.from_map(m["from_json"]), |
| 5412 | 5413 | func: Func.from_map(m["func"]), |
| 5413 | 5414 | function: FunctionClass.from_map(m["function"]), |
| 5414 | 5415 | get: Get.from_map(m["get"]), |
| 5415 | 5416 | global: Global.from_map(m["global"]), |
| 5416 | 5417 | go: Go.from_map(m["go"]), |
| 5417 | - goto: Goto.from_map(m["goto"]), | |
| 5418 | 5418 | obj2_def: DefClass.from_map(m["def"]), |
| 5419 | 5419 | obj2_do: DoClass.from_map(m["do"]), |
| 5420 | 5420 | obj2_else: ElseClass.from_map(m["else"]), |
| @@ -5484,13 +5484,13 @@ defmodule Obj2 do | ||
| 5484 | 5484 | "FormatException" => FormatException.to_map(struct.format_exception), |
| 5485 | 5485 | "friend" => Friend.to_map(struct.friend), |
| 5486 | 5486 | "from" => From.to_map(struct.from), |
| 5487 | + "from_dict" => FromDict.to_map(struct.from_dict), | |
| 5487 | 5488 | "from_json" => FromJSON.to_map(struct.from_json), |
| 5488 | 5489 | "func" => Func.to_map(struct.func), |
| 5489 | 5490 | "function" => FunctionClass.to_map(struct.function), |
| 5490 | 5491 | "get" => Get.to_map(struct.get), |
| 5491 | 5492 | "global" => Global.to_map(struct.global), |
| 5492 | 5493 | "go" => Go.to_map(struct.go), |
| 5493 | - "goto" => Goto.to_map(struct.goto), | |
| 5494 | 5494 | "def" => DefClass.to_map(struct.obj2_def), |
| 5495 | 5495 | "do" => DoClass.to_map(struct.obj2_do), |
| 5496 | 5496 | "else" => ElseClass.to_map(struct.obj2_else), |
| @@ -5505,6 +5505,45 @@ defmodule Obj2 do | ||
| 5505 | 5505 | end |
| 5506 | 5506 | end |
| 5507 | 5507 | |
| 5508 | +defmodule Goto do | |
| 5509 | + @enforce_keys [:goto] | |
| 5510 | + defstruct [:goto] | |
| 5511 | + | |
| 5512 | + @type t :: %__MODULE__{ | |
| 5513 | + goto: integer() | |
| 5514 | + } | |
| 5515 | + | |
| 5516 | + def decode_goto(value) when is_integer(value), do: value | |
| 5517 | + def decode_goto(_), do: {:error, "Unexpected type when decoding Goto.goto"} | |
| 5518 | + | |
| 5519 | + def encode_goto(value) when is_integer(value), do: value | |
| 5520 | + def encode_goto(_), do: {:error, "Unexpected type when encoding Goto.goto"} | |
| 5521 | + | |
| 5522 | + def from_map(m) do | |
| 5523 | + %Goto{ | |
| 5524 | + goto: decode_goto(m["goto"]), | |
| 5525 | + } | |
| 5526 | + end | |
| 5527 | + | |
| 5528 | + def from_json(json) do | |
| 5529 | + json | |
| 5530 | + |> Jason.decode!() | |
| 5531 | + |> from_map() | |
| 5532 | + end | |
| 5533 | + | |
| 5534 | + def to_map(struct) do | |
| 5535 | + %{ | |
| 5536 | + "goto" => struct.goto, | |
| 5537 | + } | |
| 5538 | + end | |
| 5539 | + | |
| 5540 | + def to_json(struct) do | |
| 5541 | + struct | |
| 5542 | + |> to_map() | |
| 5543 | + |> Jason.encode!() | |
| 5544 | + end | |
| 5545 | +end | |
| 5546 | + | |
| 5508 | 5547 | defmodule Guard do |
| 5509 | 5548 | @enforce_keys [:guard] |
| 5510 | 5549 | defstruct [:guard] |
| @@ -7494,6 +7533,45 @@ defmodule MapEntry do | ||
| 7494 | 7533 | end |
| 7495 | 7534 | end |
| 7496 | 7535 | |
| 7536 | +defmodule MarshalJSON do | |
| 7537 | + @enforce_keys [:marshal_json] | |
| 7538 | + defstruct [:marshal_json] | |
| 7539 | + | |
| 7540 | + @type t :: %__MODULE__{ | |
| 7541 | + marshal_json: integer() | |
| 7542 | + } | |
| 7543 | + | |
| 7544 | + def decode_marshal_json(value) when is_integer(value), do: value | |
| 7545 | + def decode_marshal_json(_), do: {:error, "Unexpected type when decoding MarshalJSON.marshal_json"} | |
| 7546 | + | |
| 7547 | + def encode_marshal_json(value) when is_integer(value), do: value | |
| 7548 | + def encode_marshal_json(_), do: {:error, "Unexpected type when encoding MarshalJSON.marshal_json"} | |
| 7549 | + | |
| 7550 | + def from_map(m) do | |
| 7551 | + %MarshalJSON{ | |
| 7552 | + marshal_json: decode_marshal_json(m["MarshalJSON"]), | |
| 7553 | + } | |
| 7554 | + end | |
| 7555 | + | |
| 7556 | + def from_json(json) do | |
| 7557 | + json | |
| 7558 | + |> Jason.decode!() | |
| 7559 | + |> from_map() | |
| 7560 | + end | |
| 7561 | + | |
| 7562 | + def to_map(struct) do | |
| 7563 | + %{ | |
| 7564 | + "MarshalJSON" => struct.marshal_json, | |
| 7565 | + } | |
| 7566 | + end | |
| 7567 | + | |
| 7568 | + def to_json(struct) do | |
| 7569 | + struct | |
| 7570 | + |> to_map() | |
| 7571 | + |> Jason.encode!() | |
| 7572 | + end | |
| 7573 | +end | |
| 7574 | + | |
| 7497 | 7575 | defmodule MetadataPropertyHandling do |
| 7498 | 7576 | @enforce_keys [:metadata_property_handling] |
| 7499 | 7577 | defstruct [:metadata_property_handling] |
| @@ -7845,45 +7923,6 @@ defmodule No do | ||
| 7845 | 7923 | end |
| 7846 | 7924 | end |
| 7847 | 7925 | |
| 7848 | -defmodule Noexcept do | |
| 7849 | - @enforce_keys [:noexcept] | |
| 7850 | - defstruct [:noexcept] | |
| 7851 | - | |
| 7852 | - @type t :: %__MODULE__{ | |
| 7853 | - noexcept: integer() | |
| 7854 | - } | |
| 7855 | - | |
| 7856 | - def decode_noexcept(value) when is_integer(value), do: value | |
| 7857 | - def decode_noexcept(_), do: {:error, "Unexpected type when decoding Noexcept.noexcept"} | |
| 7858 | - | |
| 7859 | - def encode_noexcept(value) when is_integer(value), do: value | |
| 7860 | - def encode_noexcept(_), do: {:error, "Unexpected type when encoding Noexcept.noexcept"} | |
| 7861 | - | |
| 7862 | - def from_map(m) do | |
| 7863 | - %Noexcept{ | |
| 7864 | - noexcept: decode_noexcept(m["noexcept"]), | |
| 7865 | - } | |
| 7866 | - end | |
| 7867 | - | |
| 7868 | - def from_json(json) do | |
| 7869 | - json | |
| 7870 | - |> Jason.decode!() | |
| 7871 | - |> from_map() | |
| 7872 | - end | |
| 7873 | - | |
| 7874 | - def to_map(struct) do | |
| 7875 | - %{ | |
| 7876 | - "noexcept" => struct.noexcept, | |
| 7877 | - } | |
| 7878 | - end | |
| 7879 | - | |
| 7880 | - def to_json(struct) do | |
| 7881 | - struct | |
| 7882 | - |> to_map() | |
| 7883 | - |> Jason.encode!() | |
| 7884 | - end | |
| 7885 | -end | |
| 7886 | - | |
| 7887 | 7926 | defmodule ImportClass do |
| 7888 | 7927 | @enforce_keys [:import_import] |
| 7889 | 7928 | defstruct [:import_import] |
| @@ -8002,11 +8041,12 @@ defmodule NilClass do | ||
| 8002 | 8041 | end |
| 8003 | 8042 | |
| 8004 | 8043 | defmodule Obj3 do |
| 8005 | - @enforce_keys [:dummy, :guard, :has_own_property, :hash_code, :hashable, :hasher, :id, :if, :imp, :implements, :implicit, :indirect, :infix, :init, :inline, :inout, :instanceof, :int, :interface, :internal, :is, :iso_date_time_offset_converter, :iterable, :jdec, :jenc, :jpipe, :json, :json_any, :json_coding_key, :json_converter, :json_decoder, :json_encoder, :json_exception, :json_generator, :json_node, :json_null, :json_parser, :json_reader, :json_serializer, :json_token, :json_token_type, :json_writer, :lambda, :lazy, :left, :let, :list, :locale, :lock, :long, :map, :map_entry, :metadata_property_handling, :module, :mutable, :mutating, :namespace, :native, :new, :newtonsoft, :no, :noexcept, :obj3_import, :obj3_in, :obj3_nil] | |
| 8006 | - defstruct [:dummy, :guard, :has_own_property, :hash_code, :hashable, :hasher, :id, :if, :imp, :implements, :implicit, :indirect, :infix, :init, :inline, :inout, :instanceof, :int, :interface, :internal, :is, :iso_date_time_offset_converter, :iterable, :jdec, :jenc, :jpipe, :json, :json_any, :json_coding_key, :json_converter, :json_decoder, :json_encoder, :json_exception, :json_generator, :json_node, :json_null, :json_parser, :json_reader, :json_serializer, :json_token, :json_token_type, :json_writer, :lambda, :lazy, :left, :let, :list, :locale, :lock, :long, :map, :map_entry, :metadata_property_handling, :module, :mutable, :mutating, :namespace, :native, :new, :newtonsoft, :no, :noexcept, :obj3_import, :obj3_in, :obj3_nil] | |
| 8044 | + @enforce_keys [:dummy, :goto, :guard, :has_own_property, :hash_code, :hashable, :hasher, :id, :if, :imp, :implements, :implicit, :indirect, :infix, :init, :inline, :inout, :instanceof, :int, :interface, :internal, :is, :iso_date_time_offset_converter, :iterable, :jdec, :jenc, :jpipe, :json, :json_any, :json_coding_key, :json_converter, :json_decoder, :json_encoder, :json_exception, :json_generator, :json_node, :json_null, :json_parser, :json_reader, :json_serializer, :json_token, :json_token_type, :json_writer, :lambda, :lazy, :left, :let, :list, :locale, :lock, :long, :map, :map_entry, :marshal_json, :metadata_property_handling, :module, :mutable, :mutating, :namespace, :native, :new, :newtonsoft, :no, :obj3_import, :obj3_in, :obj3_nil] | |
| 8045 | + defstruct [:dummy, :goto, :guard, :has_own_property, :hash_code, :hashable, :hasher, :id, :if, :imp, :implements, :implicit, :indirect, :infix, :init, :inline, :inout, :instanceof, :int, :interface, :internal, :is, :iso_date_time_offset_converter, :iterable, :jdec, :jenc, :jpipe, :json, :json_any, :json_coding_key, :json_converter, :json_decoder, :json_encoder, :json_exception, :json_generator, :json_node, :json_null, :json_parser, :json_reader, :json_serializer, :json_token, :json_token_type, :json_writer, :lambda, :lazy, :left, :let, :list, :locale, :lock, :long, :map, :map_entry, :marshal_json, :metadata_property_handling, :module, :mutable, :mutating, :namespace, :native, :new, :newtonsoft, :no, :obj3_import, :obj3_in, :obj3_nil] | |
| 8007 | 8046 | |
| 8008 | 8047 | @type t :: %__MODULE__{ |
| 8009 | 8048 | dummy: integer(), |
| 8049 | + goto: Goto.t(), | |
| 8010 | 8050 | guard: Guard.t(), |
| 8011 | 8051 | has_own_property: HasOwnProperty.t(), |
| 8012 | 8052 | hash_code: HashCode.t(), |
| @@ -8058,6 +8098,7 @@ defmodule Obj3 do | ||
| 8058 | 8098 | long: Long.t(), |
| 8059 | 8099 | map: MapClass.t(), |
| 8060 | 8100 | map_entry: MapEntry.t(), |
| 8101 | + marshal_json: MarshalJSON.t(), | |
| 8061 | 8102 | metadata_property_handling: MetadataPropertyHandling.t(), |
| 8062 | 8103 | module: ModuleClass.t(), |
| 8063 | 8104 | mutable: Mutable.t(), |
| @@ -8067,7 +8108,6 @@ defmodule Obj3 do | ||
| 8067 | 8108 | new: New.t(), |
| 8068 | 8109 | newtonsoft: Newtonsoft.t(), |
| 8069 | 8110 | no: No.t(), |
| 8070 | - noexcept: Noexcept.t(), | |
| 8071 | 8111 | obj3_import: ImportClass.t(), |
| 8072 | 8112 | obj3_in: InClass.t(), |
| 8073 | 8113 | obj3_nil: NilClass.t() |
| @@ -8082,6 +8122,7 @@ defmodule Obj3 do | ||
| 8082 | 8122 | def from_map(m) do |
| 8083 | 8123 | %Obj3{ |
| 8084 | 8124 | dummy: decode_dummy(m["dummy"]), |
| 8125 | + goto: Goto.from_map(m["goto"]), | |
| 8085 | 8126 | guard: Guard.from_map(m["guard"]), |
| 8086 | 8127 | has_own_property: HasOwnProperty.from_map(m["hasOwnProperty"]), |
| 8087 | 8128 | hash_code: HashCode.from_map(m["hashCode"]), |
| @@ -8133,6 +8174,7 @@ defmodule Obj3 do | ||
| 8133 | 8174 | long: Long.from_map(m["long"]), |
| 8134 | 8175 | map: MapClass.from_map(m["map"]), |
| 8135 | 8176 | map_entry: MapEntry.from_map(m["MapEntry"]), |
| 8177 | + marshal_json: MarshalJSON.from_map(m["MarshalJSON"]), | |
| 8136 | 8178 | metadata_property_handling: MetadataPropertyHandling.from_map(m["metadata_property_handling"]), |
| 8137 | 8179 | module: ModuleClass.from_map(m["module"]), |
| 8138 | 8180 | mutable: Mutable.from_map(m["mutable"]), |
| @@ -8142,7 +8184,6 @@ defmodule Obj3 do | ||
| 8142 | 8184 | new: New.from_map(m["new"]), |
| 8143 | 8185 | newtonsoft: Newtonsoft.from_map(m["newtonsoft"]), |
| 8144 | 8186 | no: No.from_map(m["NO"]), |
| 8145 | - noexcept: Noexcept.from_map(m["noexcept"]), | |
| 8146 | 8187 | obj3_import: ImportClass.from_map(m["import"]), |
| 8147 | 8188 | obj3_in: InClass.from_map(m["in"]), |
| 8148 | 8189 | obj3_nil: NilClass.from_map(m["nil"]), |
| @@ -8158,6 +8199,7 @@ defmodule Obj3 do | ||
| 8158 | 8199 | def to_map(struct) do |
| 8159 | 8200 | %{ |
| 8160 | 8201 | "dummy" => struct.dummy, |
| 8202 | + "goto" => Goto.to_map(struct.goto), | |
| 8161 | 8203 | "guard" => Guard.to_map(struct.guard), |
| 8162 | 8204 | "hasOwnProperty" => HasOwnProperty.to_map(struct.has_own_property), |
| 8163 | 8205 | "hashCode" => HashCode.to_map(struct.hash_code), |
| @@ -8209,6 +8251,7 @@ defmodule Obj3 do | ||
| 8209 | 8251 | "long" => Long.to_map(struct.long), |
| 8210 | 8252 | "map" => MapClass.to_map(struct.map), |
| 8211 | 8253 | "MapEntry" => MapEntry.to_map(struct.map_entry), |
| 8254 | + "MarshalJSON" => MarshalJSON.to_map(struct.marshal_json), | |
| 8212 | 8255 | "metadata_property_handling" => MetadataPropertyHandling.to_map(struct.metadata_property_handling), |
| 8213 | 8256 | "module" => ModuleClass.to_map(struct.module), |
| 8214 | 8257 | "mutable" => Mutable.to_map(struct.mutable), |
| @@ -8218,7 +8261,6 @@ defmodule Obj3 do | ||
| 8218 | 8261 | "new" => New.to_map(struct.new), |
| 8219 | 8262 | "newtonsoft" => Newtonsoft.to_map(struct.newtonsoft), |
| 8220 | 8263 | "NO" => No.to_map(struct.no), |
| 8221 | - "noexcept" => Noexcept.to_map(struct.noexcept), | |
| 8222 | 8264 | "import" => ImportClass.to_map(struct.obj3_import), |
| 8223 | 8265 | "in" => InClass.to_map(struct.obj3_in), |
| 8224 | 8266 | "nil" => NilClass.to_map(struct.obj3_nil), |
| @@ -8271,6 +8313,45 @@ defmodule NoSuchMethod do | ||
| 8271 | 8313 | end |
| 8272 | 8314 | end |
| 8273 | 8315 | |
| 8316 | +defmodule Noexcept do | |
| 8317 | + @enforce_keys [:noexcept] | |
| 8318 | + defstruct [:noexcept] | |
| 8319 | + | |
| 8320 | + @type t :: %__MODULE__{ | |
| 8321 | + noexcept: integer() | |
| 8322 | + } | |
| 8323 | + | |
| 8324 | + def decode_noexcept(value) when is_integer(value), do: value | |
| 8325 | + def decode_noexcept(_), do: {:error, "Unexpected type when decoding Noexcept.noexcept"} | |
| 8326 | + | |
| 8327 | + def encode_noexcept(value) when is_integer(value), do: value | |
| 8328 | + def encode_noexcept(_), do: {:error, "Unexpected type when encoding Noexcept.noexcept"} | |
| 8329 | + | |
| 8330 | + def from_map(m) do | |
| 8331 | + %Noexcept{ | |
| 8332 | + noexcept: decode_noexcept(m["noexcept"]), | |
| 8333 | + } | |
| 8334 | + end | |
| 8335 | + | |
| 8336 | + def from_json(json) do | |
| 8337 | + json | |
| 8338 | + |> Jason.decode!() | |
| 8339 | + |> from_map() | |
| 8340 | + end | |
| 8341 | + | |
| 8342 | + def to_map(struct) do | |
| 8343 | + %{ | |
| 8344 | + "noexcept" => struct.noexcept, | |
| 8345 | + } | |
| 8346 | + end | |
| 8347 | + | |
| 8348 | + def to_json(struct) do | |
| 8349 | + struct | |
| 8350 | + |> to_map() | |
| 8351 | + |> Jason.encode!() | |
| 8352 | + end | |
| 8353 | +end | |
| 8354 | + | |
| 8274 | 8355 | defmodule Nonatomic do |
| 8275 | 8356 | @enforce_keys [:nonatomic] |
| 8276 | 8357 | defstruct [:nonatomic] |
| @@ -10689,52 +10770,14 @@ defmodule Sel do | ||
| 10689 | 10770 | end |
| 10690 | 10771 | end |
| 10691 | 10772 | |
| 10692 | -defmodule Select do | |
| 10693 | - @enforce_keys [:select] | |
| 10694 | - defstruct [:select] | |
| 10695 | - | |
| 10696 | - @type t :: %__MODULE__{ | |
| 10697 | - select: integer() | |
| 10698 | - } | |
| 10699 | - | |
| 10700 | - def decode_select(value) when is_integer(value), do: value | |
| 10701 | - def decode_select(_), do: {:error, "Unexpected type when decoding Select.select"} | |
| 10702 | - | |
| 10703 | - def encode_select(value) when is_integer(value), do: value | |
| 10704 | - def encode_select(_), do: {:error, "Unexpected type when encoding Select.select"} | |
| 10705 | - | |
| 10706 | - def from_map(m) do | |
| 10707 | - %Select{ | |
| 10708 | - select: decode_select(m["select"]), | |
| 10709 | - } | |
| 10710 | - end | |
| 10711 | - | |
| 10712 | - def from_json(json) do | |
| 10713 | - json | |
| 10714 | - |> Jason.decode!() | |
| 10715 | - |> from_map() | |
| 10716 | - end | |
| 10717 | - | |
| 10718 | - def to_map(struct) do | |
| 10719 | - %{ | |
| 10720 | - "select" => struct.select, | |
| 10721 | - } | |
| 10722 | - end | |
| 10723 | - | |
| 10724 | - def to_json(struct) do | |
| 10725 | - struct | |
| 10726 | - |> to_map() | |
| 10727 | - |> Jason.encode!() | |
| 10728 | - end | |
| 10729 | -end | |
| 10730 | - | |
| 10731 | -defmodule Obj4 do | |
| 10732 | - @enforce_keys [:dummy, :no_such_method, :nonatomic, :none, :nonlocal, :nonmutating, :not_eq, :ns_error, :ns_object, :ns_string, :null, :nullptr, :number, :obj4_none, :obj4_not, :obj4_null, :obj4_or, :obj4_protocol, :object, :object_mapper, :of, :oneway, :open, :operator, :optional, :or_eq, :out, :override, :package, :params, :pass, :port, :postfix, :precedence, :prefix, :print, :print_members, :printf, :private, :protected, :protocol, :public, :quicktype, :raise, :range, :readonly, :ref, :reg_exp, :register, :reinterpret_cast, :repeat, :require, :required, :requires, :restrict, :retain, :rethrows, :return, :right, :runtime_type, :s, :sbyte, :sealed, :sel, :select] | |
| 10733 | - defstruct [:dummy, :no_such_method, :nonatomic, :none, :nonlocal, :nonmutating, :not_eq, :ns_error, :ns_object, :ns_string, :null, :nullptr, :number, :obj4_none, :obj4_not, :obj4_null, :obj4_or, :obj4_protocol, :object, :object_mapper, :of, :oneway, :open, :operator, :optional, :or_eq, :out, :override, :package, :params, :pass, :port, :postfix, :precedence, :prefix, :print, :print_members, :printf, :private, :protected, :protocol, :public, :quicktype, :raise, :range, :readonly, :ref, :reg_exp, :register, :reinterpret_cast, :repeat, :require, :required, :requires, :restrict, :retain, :rethrows, :return, :right, :runtime_type, :s, :sbyte, :sealed, :sel, :select] | |
| 10773 | +defmodule Obj4 do | |
| 10774 | + @enforce_keys [:dummy, :no_such_method, :noexcept, :nonatomic, :none, :nonlocal, :nonmutating, :not_eq, :ns_error, :ns_object, :ns_string, :null, :nullptr, :number, :obj4_none, :obj4_not, :obj4_null, :obj4_or, :obj4_protocol, :object, :object_mapper, :of, :oneway, :open, :operator, :optional, :or_eq, :out, :override, :package, :params, :pass, :port, :postfix, :precedence, :prefix, :print, :print_members, :printf, :private, :protected, :protocol, :public, :quicktype, :raise, :range, :readonly, :ref, :reg_exp, :register, :reinterpret_cast, :repeat, :require, :required, :requires, :restrict, :retain, :rethrows, :return, :right, :runtime_type, :s, :sbyte, :sealed, :sel] | |
| 10775 | + defstruct [:dummy, :no_such_method, :noexcept, :nonatomic, :none, :nonlocal, :nonmutating, :not_eq, :ns_error, :ns_object, :ns_string, :null, :nullptr, :number, :obj4_none, :obj4_not, :obj4_null, :obj4_or, :obj4_protocol, :object, :object_mapper, :of, :oneway, :open, :operator, :optional, :or_eq, :out, :override, :package, :params, :pass, :port, :postfix, :precedence, :prefix, :print, :print_members, :printf, :private, :protected, :protocol, :public, :quicktype, :raise, :range, :readonly, :ref, :reg_exp, :register, :reinterpret_cast, :repeat, :require, :required, :requires, :restrict, :retain, :rethrows, :return, :right, :runtime_type, :s, :sbyte, :sealed, :sel] | |
| 10734 | 10776 | |
| 10735 | 10777 | @type t :: %__MODULE__{ |
| 10736 | 10778 | dummy: integer(), |
| 10737 | 10779 | no_such_method: NoSuchMethod.t(), |
| 10780 | + noexcept: Noexcept.t(), | |
| 10738 | 10781 | nonatomic: Nonatomic.t(), |
| 10739 | 10782 | none: None.t(), |
| 10740 | 10783 | nonlocal: Nonlocal.t(), |
| @@ -10796,8 +10839,7 @@ defmodule Obj4 do | ||
| 10796 | 10839 | s: S.t(), |
| 10797 | 10840 | sbyte: Sbyte.t(), |
| 10798 | 10841 | sealed: Sealed.t(), |
| 10799 | - sel: Sel.t(), | |
| 10800 | - select: Select.t() | |
| 10842 | + sel: Sel.t() | |
| 10801 | 10843 | } |
| 10802 | 10844 | |
| 10803 | 10845 | def decode_dummy(value) when is_integer(value), do: value |
| @@ -10810,6 +10852,7 @@ defmodule Obj4 do | ||
| 10810 | 10852 | %Obj4{ |
| 10811 | 10853 | dummy: decode_dummy(m["dummy"]), |
| 10812 | 10854 | no_such_method: NoSuchMethod.from_map(m["noSuchMethod"]), |
| 10855 | + noexcept: Noexcept.from_map(m["noexcept"]), | |
| 10813 | 10856 | nonatomic: Nonatomic.from_map(m["nonatomic"]), |
| 10814 | 10857 | none: None.from_map(m["None"]), |
| 10815 | 10858 | nonlocal: Nonlocal.from_map(m["nonlocal"]), |
| @@ -10872,7 +10915,6 @@ defmodule Obj4 do | ||
| 10872 | 10915 | sbyte: Sbyte.from_map(m["sbyte"]), |
| 10873 | 10916 | sealed: Sealed.from_map(m["sealed"]), |
| 10874 | 10917 | sel: Sel.from_map(m["SEL"]), |
| 10875 | - select: Select.from_map(m["select"]), | |
| 10876 | 10918 | } |
| 10877 | 10919 | end |
| 10878 | 10920 | |
| @@ -10886,6 +10928,7 @@ defmodule Obj4 do | ||
| 10886 | 10928 | %{ |
| 10887 | 10929 | "dummy" => struct.dummy, |
| 10888 | 10930 | "noSuchMethod" => NoSuchMethod.to_map(struct.no_such_method), |
| 10931 | + "noexcept" => Noexcept.to_map(struct.noexcept), | |
| 10889 | 10932 | "nonatomic" => Nonatomic.to_map(struct.nonatomic), |
| 10890 | 10933 | "None" => None.to_map(struct.none), |
| 10891 | 10934 | "nonlocal" => Nonlocal.to_map(struct.nonlocal), |
| @@ -10948,7 +10991,6 @@ defmodule Obj4 do | ||
| 10948 | 10991 | "sbyte" => Sbyte.to_map(struct.sbyte), |
| 10949 | 10992 | "sealed" => Sealed.to_map(struct.sealed), |
| 10950 | 10993 | "SEL" => Sel.to_map(struct.sel), |
| 10951 | - "select" => Select.to_map(struct.select), | |
| 10952 | 10994 | } |
| 10953 | 10995 | end |
| 10954 | 10996 | |
| @@ -11154,6 +11196,45 @@ defmodule PrimitiveKind do | ||
| 11154 | 11196 | end |
| 11155 | 11197 | end |
| 11156 | 11198 | |
| 11199 | +defmodule Select do | |
| 11200 | + @enforce_keys [:select] | |
| 11201 | + defstruct [:select] | |
| 11202 | + | |
| 11203 | + @type t :: %__MODULE__{ | |
| 11204 | + select: integer() | |
| 11205 | + } | |
| 11206 | + | |
| 11207 | + def decode_select(value) when is_integer(value), do: value | |
| 11208 | + def decode_select(_), do: {:error, "Unexpected type when decoding Select.select"} | |
| 11209 | + | |
| 11210 | + def encode_select(value) when is_integer(value), do: value | |
| 11211 | + def encode_select(_), do: {:error, "Unexpected type when encoding Select.select"} | |
| 11212 | + | |
| 11213 | + def from_map(m) do | |
| 11214 | + %Select{ | |
| 11215 | + select: decode_select(m["select"]), | |
| 11216 | + } | |
| 11217 | + end | |
| 11218 | + | |
| 11219 | + def from_json(json) do | |
| 11220 | + json | |
| 11221 | + |> Jason.decode!() | |
| 11222 | + |> from_map() | |
| 11223 | + end | |
| 11224 | + | |
| 11225 | + def to_map(struct) do | |
| 11226 | + %{ | |
| 11227 | + "select" => struct.select, | |
| 11228 | + } | |
| 11229 | + end | |
| 11230 | + | |
| 11231 | + def to_json(struct) do | |
| 11232 | + struct | |
| 11233 | + |> to_map() | |
| 11234 | + |> Jason.encode!() | |
| 11235 | + end | |
| 11236 | +end | |
| 11237 | + | |
| 11157 | 11238 | defmodule Self do |
| 11158 | 11239 | @enforce_keys [:self] |
| 11159 | 11240 | defstruct [:self] |
| @@ -12597,6 +12678,45 @@ defmodule TimeZone do | ||
| 12597 | 12678 | end |
| 12598 | 12679 | end |
| 12599 | 12680 | |
| 12681 | +defmodule ToDict do | |
| 12682 | + @enforce_keys [:to_dict] | |
| 12683 | + defstruct [:to_dict] | |
| 12684 | + | |
| 12685 | + @type t :: %__MODULE__{ | |
| 12686 | + to_dict: integer() | |
| 12687 | + } | |
| 12688 | + | |
| 12689 | + def decode_to_dict(value) when is_integer(value), do: value | |
| 12690 | + def decode_to_dict(_), do: {:error, "Unexpected type when decoding ToDict.to_dict"} | |
| 12691 | + | |
| 12692 | + def encode_to_dict(value) when is_integer(value), do: value | |
| 12693 | + def encode_to_dict(_), do: {:error, "Unexpected type when encoding ToDict.to_dict"} | |
| 12694 | + | |
| 12695 | + def from_map(m) do | |
| 12696 | + %ToDict{ | |
| 12697 | + to_dict: decode_to_dict(m["to_dict"]), | |
| 12698 | + } | |
| 12699 | + end | |
| 12700 | + | |
| 12701 | + def from_json(json) do | |
| 12702 | + json | |
| 12703 | + |> Jason.decode!() | |
| 12704 | + |> from_map() | |
| 12705 | + end | |
| 12706 | + | |
| 12707 | + def to_map(struct) do | |
| 12708 | + %{ | |
| 12709 | + "to_dict" => struct.to_dict, | |
| 12710 | + } | |
| 12711 | + end | |
| 12712 | + | |
| 12713 | + def to_json(struct) do | |
| 12714 | + struct | |
| 12715 | + |> to_map() | |
| 12716 | + |> Jason.encode!() | |
| 12717 | + end | |
| 12718 | +end | |
| 12719 | + | |
| 12600 | 12720 | defmodule ToJSON do |
| 12601 | 12721 | @enforce_keys [:to_json] |
| 12602 | 12722 | defstruct [:to_json] |
| @@ -13260,23 +13380,23 @@ defmodule Union do | ||
| 13260 | 13380 | end |
| 13261 | 13381 | end |
| 13262 | 13382 | |
| 13263 | -defmodule Unowned do | |
| 13264 | - @enforce_keys [:unowned] | |
| 13265 | - defstruct [:unowned] | |
| 13383 | +defmodule UnmarshalJSON do | |
| 13384 | + @enforce_keys [:unmarshal_json] | |
| 13385 | + defstruct [:unmarshal_json] | |
| 13266 | 13386 | |
| 13267 | 13387 | @type t :: %__MODULE__{ |
| 13268 | - unowned: integer() | |
| 13388 | + unmarshal_json: integer() | |
| 13269 | 13389 | } |
| 13270 | 13390 | |
| 13271 | - def decode_unowned(value) when is_integer(value), do: value | |
| 13272 | - def decode_unowned(_), do: {:error, "Unexpected type when decoding Unowned.unowned"} | |
| 13391 | + def decode_unmarshal_json(value) when is_integer(value), do: value | |
| 13392 | + def decode_unmarshal_json(_), do: {:error, "Unexpected type when decoding UnmarshalJSON.unmarshal_json"} | |
| 13273 | 13393 | |
| 13274 | - def encode_unowned(value) when is_integer(value), do: value | |
| 13275 | - def encode_unowned(_), do: {:error, "Unexpected type when encoding Unowned.unowned"} | |
| 13394 | + def encode_unmarshal_json(value) when is_integer(value), do: value | |
| 13395 | + def encode_unmarshal_json(_), do: {:error, "Unexpected type when encoding UnmarshalJSON.unmarshal_json"} | |
| 13276 | 13396 | |
| 13277 | 13397 | def from_map(m) do |
| 13278 | - %Unowned{ | |
| 13279 | - unowned: decode_unowned(m["unowned"]), | |
| 13398 | + %UnmarshalJSON{ | |
| 13399 | + unmarshal_json: decode_unmarshal_json(m["UnmarshalJSON"]), | |
| 13280 | 13400 | } |
| 13281 | 13401 | end |
| 13282 | 13402 | |
| @@ -13288,7 +13408,7 @@ defmodule Unowned do | ||
| 13288 | 13408 | |
| 13289 | 13409 | def to_map(struct) do |
| 13290 | 13410 | %{ |
| 13291 | - "unowned" => struct.unowned, | |
| 13411 | + "UnmarshalJSON" => struct.unmarshal_json, | |
| 13292 | 13412 | } |
| 13293 | 13413 | end |
| 13294 | 13414 | |
| @@ -13299,23 +13419,23 @@ defmodule Unowned do | ||
| 13299 | 13419 | end |
| 13300 | 13420 | end |
| 13301 | 13421 | |
| 13302 | -defmodule Unsafe do | |
| 13303 | - @enforce_keys [:unsafe] | |
| 13304 | - defstruct [:unsafe] | |
| 13422 | +defmodule Unowned do | |
| 13423 | + @enforce_keys [:unowned] | |
| 13424 | + defstruct [:unowned] | |
| 13305 | 13425 | |
| 13306 | 13426 | @type t :: %__MODULE__{ |
| 13307 | - unsafe: integer() | |
| 13427 | + unowned: integer() | |
| 13308 | 13428 | } |
| 13309 | 13429 | |
| 13310 | - def decode_unsafe(value) when is_integer(value), do: value | |
| 13311 | - def decode_unsafe(_), do: {:error, "Unexpected type when decoding Unsafe.unsafe"} | |
| 13430 | + def decode_unowned(value) when is_integer(value), do: value | |
| 13431 | + def decode_unowned(_), do: {:error, "Unexpected type when decoding Unowned.unowned"} | |
| 13312 | 13432 | |
| 13313 | - def encode_unsafe(value) when is_integer(value), do: value | |
| 13314 | - def encode_unsafe(_), do: {:error, "Unexpected type when encoding Unsafe.unsafe"} | |
| 13433 | + def encode_unowned(value) when is_integer(value), do: value | |
| 13434 | + def encode_unowned(_), do: {:error, "Unexpected type when encoding Unowned.unowned"} | |
| 13315 | 13435 | |
| 13316 | 13436 | def from_map(m) do |
| 13317 | - %Unsafe{ | |
| 13318 | - unsafe: decode_unsafe(m["unsafe"]), | |
| 13437 | + %Unowned{ | |
| 13438 | + unowned: decode_unowned(m["unowned"]), | |
| 13319 | 13439 | } |
| 13320 | 13440 | end |
| 13321 | 13441 | |
| @@ -13327,7 +13447,7 @@ defmodule Unsafe do | ||
| 13327 | 13447 | |
| 13328 | 13448 | def to_map(struct) do |
| 13329 | 13449 | %{ |
| 13330 | - "unsafe" => struct.unsafe, | |
| 13450 | + "unowned" => struct.unowned, | |
| 13331 | 13451 | } |
| 13332 | 13452 | end |
| 13333 | 13453 | |
| @@ -13338,23 +13458,23 @@ defmodule Unsafe do | ||
| 13338 | 13458 | end |
| 13339 | 13459 | end |
| 13340 | 13460 | |
| 13341 | -defmodule Unsigned do | |
| 13342 | - @enforce_keys [:unsigned] | |
| 13343 | - defstruct [:unsigned] | |
| 13461 | +defmodule Unsafe do | |
| 13462 | + @enforce_keys [:unsafe] | |
| 13463 | + defstruct [:unsafe] | |
| 13344 | 13464 | |
| 13345 | 13465 | @type t :: %__MODULE__{ |
| 13346 | - unsigned: integer() | |
| 13466 | + unsafe: integer() | |
| 13347 | 13467 | } |
| 13348 | 13468 | |
| 13349 | - def decode_unsigned(value) when is_integer(value), do: value | |
| 13350 | - def decode_unsigned(_), do: {:error, "Unexpected type when decoding Unsigned.unsigned"} | |
| 13469 | + def decode_unsafe(value) when is_integer(value), do: value | |
| 13470 | + def decode_unsafe(_), do: {:error, "Unexpected type when decoding Unsafe.unsafe"} | |
| 13351 | 13471 | |
| 13352 | - def encode_unsigned(value) when is_integer(value), do: value | |
| 13353 | - def encode_unsigned(_), do: {:error, "Unexpected type when encoding Unsigned.unsigned"} | |
| 13472 | + def encode_unsafe(value) when is_integer(value), do: value | |
| 13473 | + def encode_unsafe(_), do: {:error, "Unexpected type when encoding Unsafe.unsafe"} | |
| 13354 | 13474 | |
| 13355 | 13475 | def from_map(m) do |
| 13356 | - %Unsigned{ | |
| 13357 | - unsigned: decode_unsigned(m["unsigned"]), | |
| 13476 | + %Unsafe{ | |
| 13477 | + unsafe: decode_unsafe(m["unsafe"]), | |
| 13358 | 13478 | } |
| 13359 | 13479 | end |
| 13360 | 13480 | |
| @@ -13366,7 +13486,7 @@ defmodule Unsigned do | ||
| 13366 | 13486 | |
| 13367 | 13487 | def to_map(struct) do |
| 13368 | 13488 | %{ |
| 13369 | - "unsigned" => struct.unsigned, | |
| 13489 | + "unsafe" => struct.unsafe, | |
| 13370 | 13490 | } |
| 13371 | 13491 | end |
| 13372 | 13492 | |
| @@ -13416,48 +13536,9 @@ defmodule UseSerializers do | ||
| 13416 | 13536 | end |
| 13417 | 13537 | end |
| 13418 | 13538 | |
| 13419 | -defmodule Ushort do | |
| 13420 | - @enforce_keys [:ushort] | |
| 13421 | - defstruct [:ushort] | |
| 13422 | - | |
| 13423 | - @type t :: %__MODULE__{ | |
| 13424 | - ushort: integer() | |
| 13425 | - } | |
| 13426 | - | |
| 13427 | - def decode_ushort(value) when is_integer(value), do: value | |
| 13428 | - def decode_ushort(_), do: {:error, "Unexpected type when decoding Ushort.ushort"} | |
| 13429 | - | |
| 13430 | - def encode_ushort(value) when is_integer(value), do: value | |
| 13431 | - def encode_ushort(_), do: {:error, "Unexpected type when encoding Ushort.ushort"} | |
| 13432 | - | |
| 13433 | - def from_map(m) do | |
| 13434 | - %Ushort{ | |
| 13435 | - ushort: decode_ushort(m["ushort"]), | |
| 13436 | - } | |
| 13437 | - end | |
| 13438 | - | |
| 13439 | - def from_json(json) do | |
| 13440 | - json | |
| 13441 | - |> Jason.decode!() | |
| 13442 | - |> from_map() | |
| 13443 | - end | |
| 13444 | - | |
| 13445 | - def to_map(struct) do | |
| 13446 | - %{ | |
| 13447 | - "ushort" => struct.ushort, | |
| 13448 | - } | |
| 13449 | - end | |
| 13450 | - | |
| 13451 | - def to_json(struct) do | |
| 13452 | - struct | |
| 13453 | - |> to_map() | |
| 13454 | - |> Jason.encode!() | |
| 13455 | - end | |
| 13456 | -end | |
| 13457 | - | |
| 13458 | 13539 | defmodule Obj5 do |
| 13459 | - @enforce_keys [:dummy, :k_serializer, :obj5_self, :obj5_true, :obj5_type, :primitive_kind, :self, :sendable, :serial_descriptor, :serial_name, :serializable, :serialize, :serializer_provider, :set, :short, :signed, :simple_module, :sizeof, :stackalloc, :standards, :static, :static_assert, :static_cast, :std_deserializer, :std_serializer, :strictfp, :string, :struct, :subscript, :super, :switch, :symbol, :synchronized, :system, :template, :then, :this, :thread_local, :throw, :throws, :time_only, :time_only_converter, :time_zone, :to_json, :to_string, :top_level, :transient, :true_1, :try, :type, :typealias, :typedef, :typeid, :typename, :typeof, :uint, :ulong, :unchecked, :undefined, :union, :unowned, :unsafe, :unsigned, :use_serializers, :ushort] | |
| 13460 | - defstruct [:dummy, :k_serializer, :obj5_self, :obj5_true, :obj5_type, :primitive_kind, :self, :sendable, :serial_descriptor, :serial_name, :serializable, :serialize, :serializer_provider, :set, :short, :signed, :simple_module, :sizeof, :stackalloc, :standards, :static, :static_assert, :static_cast, :std_deserializer, :std_serializer, :strictfp, :string, :struct, :subscript, :super, :switch, :symbol, :synchronized, :system, :template, :then, :this, :thread_local, :throw, :throws, :time_only, :time_only_converter, :time_zone, :to_json, :to_string, :top_level, :transient, :true_1, :try, :type, :typealias, :typedef, :typeid, :typename, :typeof, :uint, :ulong, :unchecked, :undefined, :union, :unowned, :unsafe, :unsigned, :use_serializers, :ushort] | |
| 13540 | + @enforce_keys [:dummy, :k_serializer, :obj5_self, :obj5_true, :obj5_type, :primitive_kind, :select, :self, :sendable, :serial_descriptor, :serial_name, :serializable, :serialize, :serializer_provider, :set, :short, :signed, :simple_module, :sizeof, :stackalloc, :standards, :static, :static_assert, :static_cast, :std_deserializer, :std_serializer, :strictfp, :string, :struct, :subscript, :super, :switch, :symbol, :synchronized, :system, :template, :then, :this, :thread_local, :throw, :throws, :time_only, :time_only_converter, :time_zone, :to_dict, :to_json, :to_string, :top_level, :transient, :true_1, :try, :type, :typealias, :typedef, :typeid, :typename, :typeof, :uint, :ulong, :unchecked, :undefined, :union, :unmarshal_json, :unowned, :unsafe, :use_serializers] | |
| 13541 | + defstruct [:dummy, :k_serializer, :obj5_self, :obj5_true, :obj5_type, :primitive_kind, :select, :self, :sendable, :serial_descriptor, :serial_name, :serializable, :serialize, :serializer_provider, :set, :short, :signed, :simple_module, :sizeof, :stackalloc, :standards, :static, :static_assert, :static_cast, :std_deserializer, :std_serializer, :strictfp, :string, :struct, :subscript, :super, :switch, :symbol, :synchronized, :system, :template, :then, :this, :thread_local, :throw, :throws, :time_only, :time_only_converter, :time_zone, :to_dict, :to_json, :to_string, :top_level, :transient, :true_1, :try, :type, :typealias, :typedef, :typeid, :typename, :typeof, :uint, :ulong, :unchecked, :undefined, :union, :unmarshal_json, :unowned, :unsafe, :use_serializers] | |
| 13461 | 13542 | |
| 13462 | 13543 | @type t :: %__MODULE__{ |
| 13463 | 13544 | dummy: integer(), |
| @@ -13466,6 +13547,7 @@ defmodule Obj5 do | ||
| 13466 | 13547 | obj5_true: TrueClass.t(), |
| 13467 | 13548 | obj5_type: TypeClass.t(), |
| 13468 | 13549 | primitive_kind: PrimitiveKind.t(), |
| 13550 | + select: Select.t(), | |
| 13469 | 13551 | self: Self.t(), |
| 13470 | 13552 | sendable: Sendable.t(), |
| 13471 | 13553 | serial_descriptor: SerialDescriptor.t(), |
| @@ -13503,6 +13585,7 @@ defmodule Obj5 do | ||
| 13503 | 13585 | time_only: TimeOnly.t(), |
| 13504 | 13586 | time_only_converter: TimeOnlyConverter.t(), |
| 13505 | 13587 | time_zone: TimeZone.t(), |
| 13588 | + to_dict: ToDict.t(), | |
| 13506 | 13589 | to_json: ToJSON.t(), |
| 13507 | 13590 | to_string: ToString.t(), |
| 13508 | 13591 | top_level: TopLevelClass.t(), |
| @@ -13520,11 +13603,10 @@ defmodule Obj5 do | ||
| 13520 | 13603 | unchecked: Unchecked.t(), |
| 13521 | 13604 | undefined: Undefined.t(), |
| 13522 | 13605 | union: Union.t(), |
| 13606 | + unmarshal_json: UnmarshalJSON.t(), | |
| 13523 | 13607 | unowned: Unowned.t(), |
| 13524 | 13608 | unsafe: Unsafe.t(), |
| 13525 | - unsigned: Unsigned.t(), | |
| 13526 | - use_serializers: UseSerializers.t(), | |
| 13527 | - ushort: Ushort.t() | |
| 13609 | + use_serializers: UseSerializers.t() | |
| 13528 | 13610 | } |
| 13529 | 13611 | |
| 13530 | 13612 | def decode_dummy(value) when is_integer(value), do: value |
| @@ -13541,6 +13623,7 @@ defmodule Obj5 do | ||
| 13541 | 13623 | obj5_true: TrueClass.from_map(m["True"]), |
| 13542 | 13624 | obj5_type: TypeClass.from_map(m["type"]), |
| 13543 | 13625 | primitive_kind: PrimitiveKind.from_map(m["PrimitiveKind"]), |
| 13626 | + select: Select.from_map(m["select"]), | |
| 13544 | 13627 | self: Self.from_map(m["Self"]), |
| 13545 | 13628 | sendable: Sendable.from_map(m["Sendable"]), |
| 13546 | 13629 | serial_descriptor: SerialDescriptor.from_map(m["SerialDescriptor"]), |
| @@ -13578,6 +13661,7 @@ defmodule Obj5 do | ||
| 13578 | 13661 | time_only: TimeOnly.from_map(m["TimeOnly"]), |
| 13579 | 13662 | time_only_converter: TimeOnlyConverter.from_map(m["TimeOnlyConverter"]), |
| 13580 | 13663 | time_zone: TimeZone.from_map(m["TimeZone"]), |
| 13664 | + to_dict: ToDict.from_map(m["to_dict"]), | |
| 13581 | 13665 | to_json: ToJSON.from_map(m["to_json"]), |
| 13582 | 13666 | to_string: ToString.from_map(m["toString"]), |
| 13583 | 13667 | top_level: TopLevelClass.from_map(m["top_level"]), |
| @@ -13595,11 +13679,10 @@ defmodule Obj5 do | ||
| 13595 | 13679 | unchecked: Unchecked.from_map(m["unchecked"]), |
| 13596 | 13680 | undefined: Undefined.from_map(m["undefined"]), |
| 13597 | 13681 | union: Union.from_map(m["union"]), |
| 13682 | + unmarshal_json: UnmarshalJSON.from_map(m["UnmarshalJSON"]), | |
| 13598 | 13683 | unowned: Unowned.from_map(m["unowned"]), |
| 13599 | 13684 | unsafe: Unsafe.from_map(m["unsafe"]), |
| 13600 | - unsigned: Unsigned.from_map(m["unsigned"]), | |
| 13601 | 13685 | use_serializers: UseSerializers.from_map(m["UseSerializers"]), |
| 13602 | - ushort: Ushort.from_map(m["ushort"]), | |
| 13603 | 13686 | } |
| 13604 | 13687 | end |
| 13605 | 13688 | |
| @@ -13617,6 +13700,7 @@ defmodule Obj5 do | ||
| 13617 | 13700 | "True" => TrueClass.to_map(struct.obj5_true), |
| 13618 | 13701 | "type" => TypeClass.to_map(struct.obj5_type), |
| 13619 | 13702 | "PrimitiveKind" => PrimitiveKind.to_map(struct.primitive_kind), |
| 13703 | + "select" => Select.to_map(struct.select), | |
| 13620 | 13704 | "Self" => Self.to_map(struct.self), |
| 13621 | 13705 | "Sendable" => Sendable.to_map(struct.sendable), |
| 13622 | 13706 | "SerialDescriptor" => SerialDescriptor.to_map(struct.serial_descriptor), |
| @@ -13654,6 +13738,7 @@ defmodule Obj5 do | ||
| 13654 | 13738 | "TimeOnly" => TimeOnly.to_map(struct.time_only), |
| 13655 | 13739 | "TimeOnlyConverter" => TimeOnlyConverter.to_map(struct.time_only_converter), |
| 13656 | 13740 | "TimeZone" => TimeZone.to_map(struct.time_zone), |
| 13741 | + "to_dict" => ToDict.to_map(struct.to_dict), | |
| 13657 | 13742 | "to_json" => ToJSON.to_map(struct.to_json), |
| 13658 | 13743 | "toString" => ToString.to_map(struct.to_string), |
| 13659 | 13744 | "top_level" => TopLevelClass.to_map(struct.top_level), |
| @@ -13671,11 +13756,88 @@ defmodule Obj5 do | ||
| 13671 | 13756 | "unchecked" => Unchecked.to_map(struct.unchecked), |
| 13672 | 13757 | "undefined" => Undefined.to_map(struct.undefined), |
| 13673 | 13758 | "union" => Union.to_map(struct.union), |
| 13759 | + "UnmarshalJSON" => UnmarshalJSON.to_map(struct.unmarshal_json), | |
| 13674 | 13760 | "unowned" => Unowned.to_map(struct.unowned), |
| 13675 | 13761 | "unsafe" => Unsafe.to_map(struct.unsafe), |
| 13676 | - "unsigned" => Unsigned.to_map(struct.unsigned), | |
| 13677 | 13762 | "UseSerializers" => UseSerializers.to_map(struct.use_serializers), |
| 13678 | - "ushort" => Ushort.to_map(struct.ushort), | |
| 13763 | + } | |
| 13764 | + end | |
| 13765 | + | |
| 13766 | + def to_json(struct) do | |
| 13767 | + struct | |
| 13768 | + |> to_map() | |
| 13769 | + |> Jason.encode!() | |
| 13770 | + end | |
| 13771 | +end | |
| 13772 | + | |
| 13773 | +defmodule Unsigned do | |
| 13774 | + @enforce_keys [:unsigned] | |
| 13775 | + defstruct [:unsigned] | |
| 13776 | + | |
| 13777 | + @type t :: %__MODULE__{ | |
| 13778 | + unsigned: integer() | |
| 13779 | + } | |
| 13780 | + | |
| 13781 | + def decode_unsigned(value) when is_integer(value), do: value | |
| 13782 | + def decode_unsigned(_), do: {:error, "Unexpected type when decoding Unsigned.unsigned"} | |
| 13783 | + | |
| 13784 | + def encode_unsigned(value) when is_integer(value), do: value | |
| 13785 | + def encode_unsigned(_), do: {:error, "Unexpected type when encoding Unsigned.unsigned"} | |
| 13786 | + | |
| 13787 | + def from_map(m) do | |
| 13788 | + %Unsigned{ | |
| 13789 | + unsigned: decode_unsigned(m["unsigned"]), | |
| 13790 | + } | |
| 13791 | + end | |
| 13792 | + | |
| 13793 | + def from_json(json) do | |
| 13794 | + json | |
| 13795 | + |> Jason.decode!() | |
| 13796 | + |> from_map() | |
| 13797 | + end | |
| 13798 | + | |
| 13799 | + def to_map(struct) do | |
| 13800 | + %{ | |
| 13801 | + "unsigned" => struct.unsigned, | |
| 13802 | + } | |
| 13803 | + end | |
| 13804 | + | |
| 13805 | + def to_json(struct) do | |
| 13806 | + struct | |
| 13807 | + |> to_map() | |
| 13808 | + |> Jason.encode!() | |
| 13809 | + end | |
| 13810 | +end | |
| 13811 | + | |
| 13812 | +defmodule Ushort do | |
| 13813 | + @enforce_keys [:ushort] | |
| 13814 | + defstruct [:ushort] | |
| 13815 | + | |
| 13816 | + @type t :: %__MODULE__{ | |
| 13817 | + ushort: integer() | |
| 13818 | + } | |
| 13819 | + | |
| 13820 | + def decode_ushort(value) when is_integer(value), do: value | |
| 13821 | + def decode_ushort(_), do: {:error, "Unexpected type when decoding Ushort.ushort"} | |
| 13822 | + | |
| 13823 | + def encode_ushort(value) when is_integer(value), do: value | |
| 13824 | + def encode_ushort(_), do: {:error, "Unexpected type when encoding Ushort.ushort"} | |
| 13825 | + | |
| 13826 | + def from_map(m) do | |
| 13827 | + %Ushort{ | |
| 13828 | + ushort: decode_ushort(m["ushort"]), | |
| 13829 | + } | |
| 13830 | + end | |
| 13831 | + | |
| 13832 | + def from_json(json) do | |
| 13833 | + json | |
| 13834 | + |> Jason.decode!() | |
| 13835 | + |> from_map() | |
| 13836 | + end | |
| 13837 | + | |
| 13838 | + def to_map(struct) do | |
| 13839 | + %{ | |
| 13840 | + "ushort" => struct.ushort, | |
| 13679 | 13841 | } |
| 13680 | 13842 | end |
| 13681 | 13843 | |
| @@ -14389,11 +14551,13 @@ defmodule Yield do | ||
| 14389 | 14551 | end |
| 14390 | 14552 | |
| 14391 | 14553 | defmodule Obj6 do |
| 14392 | - @enforce_keys [:dummy, :using, :utf8_json_reader, :utf8_json_writer, :uuid, :var, :virtual, :void, :volatile, :wchar_t, :weak, :where, :while, :will_set, :with, :xor, :xor_eq, :yes, :yield] | |
| 14393 | - defstruct [:dummy, :using, :utf8_json_reader, :utf8_json_writer, :uuid, :var, :virtual, :void, :volatile, :wchar_t, :weak, :where, :while, :will_set, :with, :xor, :xor_eq, :yes, :yield] | |
| 14554 | + @enforce_keys [:dummy, :unsigned, :ushort, :using, :utf8_json_reader, :utf8_json_writer, :uuid, :var, :virtual, :void, :volatile, :wchar_t, :weak, :where, :while, :will_set, :with, :xor, :xor_eq, :yes, :yield] | |
| 14555 | + defstruct [:dummy, :unsigned, :ushort, :using, :utf8_json_reader, :utf8_json_writer, :uuid, :var, :virtual, :void, :volatile, :wchar_t, :weak, :where, :while, :will_set, :with, :xor, :xor_eq, :yes, :yield] | |
| 14394 | 14556 | |
| 14395 | 14557 | @type t :: %__MODULE__{ |
| 14396 | 14558 | dummy: integer(), |
| 14559 | + unsigned: Unsigned.t(), | |
| 14560 | + ushort: Ushort.t(), | |
| 14397 | 14561 | using: Using.t(), |
| 14398 | 14562 | utf8_json_reader: Utf8JSONReader.t(), |
| 14399 | 14563 | utf8_json_writer: Utf8JSONWriter.t(), |
| @@ -14423,6 +14587,8 @@ defmodule Obj6 do | ||
| 14423 | 14587 | def from_map(m) do |
| 14424 | 14588 | %Obj6{ |
| 14425 | 14589 | dummy: decode_dummy(m["dummy"]), |
| 14590 | + unsigned: Unsigned.from_map(m["unsigned"]), | |
| 14591 | + ushort: Ushort.from_map(m["ushort"]), | |
| 14426 | 14592 | using: Using.from_map(m["using"]), |
| 14427 | 14593 | utf8_json_reader: Utf8JSONReader.from_map(m["Utf8JsonReader"]), |
| 14428 | 14594 | utf8_json_writer: Utf8JSONWriter.from_map(m["Utf8JsonWriter"]), |
| @@ -14453,6 +14619,8 @@ defmodule Obj6 do | ||
| 14453 | 14619 | def to_map(struct) do |
| 14454 | 14620 | %{ |
| 14455 | 14621 | "dummy" => struct.dummy, |
| 14622 | + "unsigned" => Unsigned.to_map(struct.unsigned), | |
| 14623 | + "ushort" => Ushort.to_map(struct.ushort), | |
| 14456 | 14624 | "using" => Using.to_map(struct.using), |
| 14457 | 14625 | "Utf8JsonReader" => Utf8JSONReader.to_map(struct.utf8_json_reader), |
| 14458 | 14626 | "Utf8JsonWriter" => Utf8JSONWriter.to_map(struct.utf8_json_writer), |
Melmdefault / QuickType.elm+171 −95
| @@ -133,19 +133,20 @@ module QuickType exposing | ||
| 133 | 133 | , FormatException |
| 134 | 134 | , Friend |
| 135 | 135 | , From |
| 136 | + , FromDict | |
| 136 | 137 | , FromJSON |
| 137 | 138 | , Func |
| 138 | 139 | , Function |
| 139 | 140 | , Get |
| 140 | 141 | , Global |
| 141 | 142 | , Go |
| 142 | - , Goto | |
| 143 | 143 | , Decoder |
| 144 | 144 | , Else |
| 145 | 145 | , Exposing |
| 146 | 146 | , Obj2False |
| 147 | 147 | , FloatClass |
| 148 | 148 | , Obj3 |
| 149 | + , Goto | |
| 149 | 150 | , Guard |
| 150 | 151 | , HasOwnProperty |
| 151 | 152 | , HashCode |
| @@ -193,6 +194,7 @@ module QuickType exposing | ||
| 193 | 194 | , Long |
| 194 | 195 | , Map |
| 195 | 196 | , MapEntry |
| 197 | + , MarshalJSON | |
| 196 | 198 | , MetadataPropertyHandling |
| 197 | 199 | , Mutable |
| 198 | 200 | , Mutating |
| @@ -202,7 +204,6 @@ module QuickType exposing | ||
| 202 | 204 | , Newtonsoft |
| 203 | 205 | , Nil |
| 204 | 206 | , No |
| 205 | - , Noexcept | |
| 206 | 207 | , If |
| 207 | 208 | , Import |
| 208 | 209 | , In |
| @@ -212,6 +213,7 @@ module QuickType exposing | ||
| 212 | 213 | , Module |
| 213 | 214 | , Obj4 |
| 214 | 215 | , NoSuchMethod |
| 216 | + , Noexcept | |
| 215 | 217 | , Nonatomic |
| 216 | 218 | , None |
| 217 | 219 | , Nonlocal |
| @@ -274,7 +276,6 @@ module QuickType exposing | ||
| 274 | 276 | , Sbyte |
| 275 | 277 | , Sealed |
| 276 | 278 | , Sel |
| 277 | - , Select | |
| 278 | 279 | , Obj5 |
| 279 | 280 | , KSerializer |
| 280 | 281 | , SelfClass |
| @@ -284,6 +285,7 @@ module QuickType exposing | ||
| 284 | 285 | , Type |
| 285 | 286 | , PrimitiveKind |
| 286 | 287 | , TypeClass |
| 288 | + , Select | |
| 287 | 289 | , Self |
| 288 | 290 | , Sendable |
| 289 | 291 | , SerialDescriptor |
| @@ -319,6 +321,7 @@ module QuickType exposing | ||
| 319 | 321 | , TimeOnly |
| 320 | 322 | , TimeOnlyConverter |
| 321 | 323 | , TimeZone |
| 324 | + , ToDict | |
| 322 | 325 | , ToJSON |
| 323 | 326 | , ToString |
| 324 | 327 | , TopLevel |
| @@ -335,13 +338,14 @@ module QuickType exposing | ||
| 335 | 338 | , Unchecked |
| 336 | 339 | , Undefined |
| 337 | 340 | , Union |
| 341 | + , UnmarshalJSON | |
| 338 | 342 | , Unowned |
| 339 | 343 | , Unsafe |
| 340 | - , Unsigned | |
| 341 | 344 | , UseSerializers |
| 342 | - , Ushort | |
| 343 | 345 | , Obj6 |
| 344 | 346 | , Where |
| 347 | + , Unsigned | |
| 348 | + , Ushort | |
| 345 | 349 | , Using |
| 346 | 350 | , Utf8JSONReader |
| 347 | 351 | , Utf8JSONWriter |
| @@ -755,13 +759,13 @@ type alias Obj2 = | ||
| 755 | 759 | , formatException : FormatException |
| 756 | 760 | , friend : Friend |
| 757 | 761 | , from : From |
| 762 | + , fromDict : FromDict | |
| 758 | 763 | , fromJSON : FromJSON |
| 759 | 764 | , func : Func |
| 760 | 765 | , function : Function |
| 761 | 766 | , get : Get |
| 762 | 767 | , global : Global |
| 763 | 768 | , go : Go |
| 764 | - , goto : Goto | |
| 765 | 769 | , obj2Decoder : Decoder |
| 766 | 770 | , obj2Else : Else |
| 767 | 771 | , obj2Exposing : Exposing |
| @@ -981,6 +985,10 @@ type alias From = | ||
| 981 | 985 | { from : Int |
| 982 | 986 | } |
| 983 | 987 | |
| 988 | +type alias FromDict = | |
| 989 | + { fromDict : Int | |
| 990 | + } | |
| 991 | + | |
| 984 | 992 | type alias FromJSON = |
| 985 | 993 | { fromJSON : Int |
| 986 | 994 | } |
| @@ -1005,10 +1013,6 @@ type alias Go = | ||
| 1005 | 1013 | { go : Int |
| 1006 | 1014 | } |
| 1007 | 1015 | |
| 1008 | -type alias Goto = | |
| 1009 | - { goto : Int | |
| 1010 | - } | |
| 1011 | - | |
| 1012 | 1016 | type alias Decoder = |
| 1013 | 1017 | { decoderDecoder : Int |
| 1014 | 1018 | } |
| @@ -1031,6 +1035,7 @@ type alias FloatClass = | ||
| 1031 | 1035 | |
| 1032 | 1036 | type alias Obj3 = |
| 1033 | 1037 | { dummy : Int |
| 1038 | + , goto : Goto | |
| 1034 | 1039 | , guard : Guard |
| 1035 | 1040 | , hasOwnProperty : HasOwnProperty |
| 1036 | 1041 | , hashCode : HashCode |
| @@ -1078,6 +1083,7 @@ type alias Obj3 = | ||
| 1078 | 1083 | , long : Long |
| 1079 | 1084 | , map : Map |
| 1080 | 1085 | , mapEntry : MapEntry |
| 1086 | + , marshalJSON : MarshalJSON | |
| 1081 | 1087 | , metadataPropertyHandling : MetadataPropertyHandling |
| 1082 | 1088 | , mutable : Mutable |
| 1083 | 1089 | , mutating : Mutating |
| @@ -1087,7 +1093,6 @@ type alias Obj3 = | ||
| 1087 | 1093 | , newtonsoft : Newtonsoft |
| 1088 | 1094 | , nil : Nil |
| 1089 | 1095 | , no : No |
| 1090 | - , noexcept : Noexcept | |
| 1091 | 1096 | , obj3If : If |
| 1092 | 1097 | , obj3Import : Import |
| 1093 | 1098 | , obj3In : In |
| @@ -1097,6 +1102,10 @@ type alias Obj3 = | ||
| 1097 | 1102 | , obj3Module : Module |
| 1098 | 1103 | } |
| 1099 | 1104 | |
| 1105 | +type alias Goto = | |
| 1106 | + { goto : Int | |
| 1107 | + } | |
| 1108 | + | |
| 1100 | 1109 | type alias Guard = |
| 1101 | 1110 | { guard : Int |
| 1102 | 1111 | } |
| @@ -1285,6 +1294,10 @@ type alias MapEntry = | ||
| 1285 | 1294 | { mapEntry : Int |
| 1286 | 1295 | } |
| 1287 | 1296 | |
| 1297 | +type alias MarshalJSON = | |
| 1298 | + { marshalJSON : Int | |
| 1299 | + } | |
| 1300 | + | |
| 1288 | 1301 | type alias MetadataPropertyHandling = |
| 1289 | 1302 | { metadataPropertyHandling : Int |
| 1290 | 1303 | } |
| @@ -1321,10 +1334,6 @@ type alias No = | ||
| 1321 | 1334 | { no : Int |
| 1322 | 1335 | } |
| 1323 | 1336 | |
| 1324 | -type alias Noexcept = | |
| 1325 | - { noexcept : Int | |
| 1326 | - } | |
| 1327 | - | |
| 1328 | 1337 | type alias If = |
| 1329 | 1338 | { ifIf : Int |
| 1330 | 1339 | } |
| @@ -1356,6 +1365,7 @@ type alias Module = | ||
| 1356 | 1365 | type alias Obj4 = |
| 1357 | 1366 | { dummy : Int |
| 1358 | 1367 | , noSuchMethod : NoSuchMethod |
| 1368 | + , noexcept : Noexcept | |
| 1359 | 1369 | , nonatomic : Nonatomic |
| 1360 | 1370 | , none : None |
| 1361 | 1371 | , nonlocal : Nonlocal |
| @@ -1418,13 +1428,16 @@ type alias Obj4 = | ||
| 1418 | 1428 | , sbyte : Sbyte |
| 1419 | 1429 | , sealed : Sealed |
| 1420 | 1430 | , sel : Sel |
| 1421 | - , select : Select | |
| 1422 | 1431 | } |
| 1423 | 1432 | |
| 1424 | 1433 | type alias NoSuchMethod = |
| 1425 | 1434 | { noSuchMethod : Int |
| 1426 | 1435 | } |
| 1427 | 1436 | |
| 1437 | +type alias Noexcept = | |
| 1438 | + { noexcept : Int | |
| 1439 | + } | |
| 1440 | + | |
| 1428 | 1441 | type alias Nonatomic = |
| 1429 | 1442 | { nonatomic : Int |
| 1430 | 1443 | } |
| @@ -1673,10 +1686,6 @@ type alias Sel = | ||
| 1673 | 1686 | { sel : Int |
| 1674 | 1687 | } |
| 1675 | 1688 | |
| 1676 | -type alias Select = | |
| 1677 | - { select : Int | |
| 1678 | - } | |
| 1679 | - | |
| 1680 | 1689 | type alias Obj5 = |
| 1681 | 1690 | { dummy : Int |
| 1682 | 1691 | , kSerializer : KSerializer |
| @@ -1687,6 +1696,7 @@ type alias Obj5 = | ||
| 1687 | 1696 | , obj5Type : Type |
| 1688 | 1697 | , primitiveKind : PrimitiveKind |
| 1689 | 1698 | , purpleType : TypeClass |
| 1699 | + , select : Select | |
| 1690 | 1700 | , self : Self |
| 1691 | 1701 | , sendable : Sendable |
| 1692 | 1702 | , serialDescriptor : SerialDescriptor |
| @@ -1722,6 +1732,7 @@ type alias Obj5 = | ||
| 1722 | 1732 | , timeOnly : TimeOnly |
| 1723 | 1733 | , timeOnlyConverter : TimeOnlyConverter |
| 1724 | 1734 | , timeZone : TimeZone |
| 1735 | + , toDict : ToDict | |
| 1725 | 1736 | , toJSON : ToJSON |
| 1726 | 1737 | , toString : ToString |
| 1727 | 1738 | , topLevel : TopLevel |
| @@ -1738,11 +1749,10 @@ type alias Obj5 = | ||
| 1738 | 1749 | , unchecked : Unchecked |
| 1739 | 1750 | , undefined : Undefined |
| 1740 | 1751 | , union : Union |
| 1752 | + , unmarshalJSON : UnmarshalJSON | |
| 1741 | 1753 | , unowned : Unowned |
| 1742 | 1754 | , unsafe : Unsafe |
| 1743 | - , unsigned : Unsigned | |
| 1744 | 1755 | , useSerializers : UseSerializers |
| 1745 | - , ushort : Ushort | |
| 1746 | 1756 | } |
| 1747 | 1757 | |
| 1748 | 1758 | type alias KSerializer = |
| @@ -1777,6 +1787,10 @@ type alias TypeClass = | ||
| 1777 | 1787 | { typeType : Int |
| 1778 | 1788 | } |
| 1779 | 1789 | |
| 1790 | +type alias Select = | |
| 1791 | + { select : Int | |
| 1792 | + } | |
| 1793 | + | |
| 1780 | 1794 | type alias Self = |
| 1781 | 1795 | { self : Int |
| 1782 | 1796 | } |
| @@ -1917,6 +1931,10 @@ type alias TimeZone = | ||
| 1917 | 1931 | { timeZone : Int |
| 1918 | 1932 | } |
| 1919 | 1933 | |
| 1934 | +type alias ToDict = | |
| 1935 | + { toDict : Int | |
| 1936 | + } | |
| 1937 | + | |
| 1920 | 1938 | type alias ToJSON = |
| 1921 | 1939 | { toJSON : Int |
| 1922 | 1940 | } |
| @@ -1981,6 +1999,10 @@ type alias Union = | ||
| 1981 | 1999 | { union : Int |
| 1982 | 2000 | } |
| 1983 | 2001 | |
| 2002 | +type alias UnmarshalJSON = | |
| 2003 | + { unmarshalJSON : Int | |
| 2004 | + } | |
| 2005 | + | |
| 1984 | 2006 | type alias Unowned = |
| 1985 | 2007 | { unowned : Int |
| 1986 | 2008 | } |
| @@ -1989,21 +2011,15 @@ type alias Unsafe = | ||
| 1989 | 2011 | { unsafe : Int |
| 1990 | 2012 | } |
| 1991 | 2013 | |
| 1992 | -type alias Unsigned = | |
| 1993 | - { unsigned : Int | |
| 1994 | - } | |
| 1995 | - | |
| 1996 | 2014 | type alias UseSerializers = |
| 1997 | 2015 | { useSerializers : Int |
| 1998 | 2016 | } |
| 1999 | 2017 | |
| 2000 | -type alias Ushort = | |
| 2001 | - { ushort : Int | |
| 2002 | - } | |
| 2003 | - | |
| 2004 | 2018 | type alias Obj6 = |
| 2005 | 2019 | { dummy : Int |
| 2006 | 2020 | , obj6Where : Where |
| 2021 | + , unsigned : Unsigned | |
| 2022 | + , ushort : Ushort | |
| 2007 | 2023 | , using : Using |
| 2008 | 2024 | , utf8JSONReader : Utf8JSONReader |
| 2009 | 2025 | , utf8JSONWriter : Utf8JSONWriter |
| @@ -2027,6 +2043,14 @@ type alias Where = | ||
| 2027 | 2043 | { whereWhere : Int |
| 2028 | 2044 | } |
| 2029 | 2045 | |
| 2046 | +type alias Unsigned = | |
| 2047 | + { unsigned : Int | |
| 2048 | + } | |
| 2049 | + | |
| 2050 | +type alias Ushort = | |
| 2051 | + { ushort : Int | |
| 2052 | + } | |
| 2053 | + | |
| 2030 | 2054 | type alias Using = |
| 2031 | 2055 | { using : Int |
| 2032 | 2056 | } |
| @@ -3028,13 +3052,13 @@ obj2 = | ||
| 3028 | 3052 | |> Jpipe.required "FormatException" formatException |
| 3029 | 3053 | |> Jpipe.required "friend" friend |
| 3030 | 3054 | |> Jpipe.required "from" from |
| 3055 | + |> Jpipe.required "from_dict" fromDict | |
| 3031 | 3056 | |> Jpipe.required "from_json" fromJSON |
| 3032 | 3057 | |> Jpipe.required "func" func |
| 3033 | 3058 | |> Jpipe.required "function" function |
| 3034 | 3059 | |> Jpipe.required "get" get |
| 3035 | 3060 | |> Jpipe.required "global" global |
| 3036 | 3061 | |> Jpipe.required "go" go |
| 3037 | - |> Jpipe.required "goto" goto | |
| 3038 | 3062 | |> Jpipe.required "Decoder" purpleDecoder |
| 3039 | 3063 | |> Jpipe.required "else" purpleElse |
| 3040 | 3064 | |> Jpipe.required "exposing" purpleExposing |
| @@ -3097,13 +3121,13 @@ encodeObj2 x = | ||
| 3097 | 3121 | , ("FormatException", encodeFormatException x.formatException) |
| 3098 | 3122 | , ("friend", encodeFriend x.friend) |
| 3099 | 3123 | , ("from", encodeFrom x.from) |
| 3124 | + , ("from_dict", encodeFromDict x.fromDict) | |
| 3100 | 3125 | , ("from_json", encodeFromJSON x.fromJSON) |
| 3101 | 3126 | , ("func", encodeFunc x.func) |
| 3102 | 3127 | , ("function", encodeFunction x.function) |
| 3103 | 3128 | , ("get", encodeGet x.get) |
| 3104 | 3129 | , ("global", encodeGlobal x.global) |
| 3105 | 3130 | , ("go", encodeGo x.go) |
| 3106 | - , ("goto", encodeGoto x.goto) | |
| 3107 | 3131 | , ("Decoder", encodeDecoder x.obj2Decoder) |
| 3108 | 3132 | , ("else", encodeElse x.obj2Else) |
| 3109 | 3133 | , ("exposing", encodeExposing x.obj2Exposing) |
| @@ -3698,6 +3722,17 @@ encodeFrom x = | ||
| 3698 | 3722 | [ ("from", Jenc.int x.from) |
| 3699 | 3723 | ] |
| 3700 | 3724 | |
| 3725 | +fromDict : Jdec.Decoder FromDict | |
| 3726 | +fromDict = | |
| 3727 | + Jdec.succeed FromDict | |
| 3728 | + |> Jpipe.required "from_dict" Jdec.int | |
| 3729 | + | |
| 3730 | +encodeFromDict : FromDict -> Jenc.Value | |
| 3731 | +encodeFromDict x = | |
| 3732 | + Jenc.object | |
| 3733 | + [ ("from_dict", Jenc.int x.fromDict) | |
| 3734 | + ] | |
| 3735 | + | |
| 3701 | 3736 | fromJSON : Jdec.Decoder FromJSON |
| 3702 | 3737 | fromJSON = |
| 3703 | 3738 | Jdec.succeed FromJSON |
| @@ -3764,17 +3799,6 @@ encodeGo x = | ||
| 3764 | 3799 | [ ("go", Jenc.int x.go) |
| 3765 | 3800 | ] |
| 3766 | 3801 | |
| 3767 | -goto : Jdec.Decoder Goto | |
| 3768 | -goto = | |
| 3769 | - Jdec.succeed Goto | |
| 3770 | - |> Jpipe.required "goto" Jdec.int | |
| 3771 | - | |
| 3772 | -encodeGoto : Goto -> Jenc.Value | |
| 3773 | -encodeGoto x = | |
| 3774 | - Jenc.object | |
| 3775 | - [ ("goto", Jenc.int x.goto) | |
| 3776 | - ] | |
| 3777 | - | |
| 3778 | 3802 | purpleDecoder : Jdec.Decoder Decoder |
| 3779 | 3803 | purpleDecoder = |
| 3780 | 3804 | Jdec.succeed Decoder |
| @@ -3834,6 +3858,7 @@ obj3 : Jdec.Decoder Obj3 | ||
| 3834 | 3858 | obj3 = |
| 3835 | 3859 | Jdec.succeed Obj3 |
| 3836 | 3860 | |> Jpipe.required "dummy" Jdec.int |
| 3861 | + |> Jpipe.required "goto" goto | |
| 3837 | 3862 | |> Jpipe.required "guard" guard |
| 3838 | 3863 | |> Jpipe.required "hasOwnProperty" hasOwnProperty |
| 3839 | 3864 | |> Jpipe.required "hashCode" hashCode |
| @@ -3881,6 +3906,7 @@ obj3 = | ||
| 3881 | 3906 | |> Jpipe.required "long" long |
| 3882 | 3907 | |> Jpipe.required "map" map |
| 3883 | 3908 | |> Jpipe.required "MapEntry" mapEntry |
| 3909 | + |> Jpipe.required "MarshalJSON" marshalJSON | |
| 3884 | 3910 | |> Jpipe.required "metadata_property_handling" metadataPropertyHandling |
| 3885 | 3911 | |> Jpipe.required "mutable" mutable |
| 3886 | 3912 | |> Jpipe.required "mutating" mutating |
| @@ -3890,7 +3916,6 @@ obj3 = | ||
| 3890 | 3916 | |> Jpipe.required "newtonsoft" newtonsoft |
| 3891 | 3917 | |> Jpipe.required "nil" nil |
| 3892 | 3918 | |> Jpipe.required "NO" no |
| 3893 | - |> Jpipe.required "noexcept" noexcept | |
| 3894 | 3919 | |> Jpipe.required "if" purpleIf |
| 3895 | 3920 | |> Jpipe.required "import" purpleImport |
| 3896 | 3921 | |> Jpipe.required "in" purpleIn |
| @@ -3903,6 +3928,7 @@ encodeObj3 : Obj3 -> Jenc.Value | ||
| 3903 | 3928 | encodeObj3 x = |
| 3904 | 3929 | Jenc.object |
| 3905 | 3930 | [ ("dummy", Jenc.int x.dummy) |
| 3931 | + , ("goto", encodeGoto x.goto) | |
| 3906 | 3932 | , ("guard", encodeGuard x.guard) |
| 3907 | 3933 | , ("hasOwnProperty", encodeHasOwnProperty x.hasOwnProperty) |
| 3908 | 3934 | , ("hashCode", encodeHashCode x.hashCode) |
| @@ -3950,6 +3976,7 @@ encodeObj3 x = | ||
| 3950 | 3976 | , ("long", encodeLong x.long) |
| 3951 | 3977 | , ("map", encodeMap x.map) |
| 3952 | 3978 | , ("MapEntry", encodeMapEntry x.mapEntry) |
| 3979 | + , ("MarshalJSON", encodeMarshalJSON x.marshalJSON) | |
| 3953 | 3980 | , ("metadata_property_handling", encodeMetadataPropertyHandling x.metadataPropertyHandling) |
| 3954 | 3981 | , ("mutable", encodeMutable x.mutable) |
| 3955 | 3982 | , ("mutating", encodeMutating x.mutating) |
| @@ -3959,7 +3986,6 @@ encodeObj3 x = | ||
| 3959 | 3986 | , ("newtonsoft", encodeNewtonsoft x.newtonsoft) |
| 3960 | 3987 | , ("nil", encodeNil x.nil) |
| 3961 | 3988 | , ("NO", encodeNo x.no) |
| 3962 | - , ("noexcept", encodeNoexcept x.noexcept) | |
| 3963 | 3989 | , ("if", encodeIf x.obj3If) |
| 3964 | 3990 | , ("import", encodeImport x.obj3Import) |
| 3965 | 3991 | , ("in", encodeIn x.obj3In) |
| @@ -3969,6 +3995,17 @@ encodeObj3 x = | ||
| 3969 | 3995 | , ("module", encodeModule x.obj3Module) |
| 3970 | 3996 | ] |
| 3971 | 3997 | |
| 3998 | +goto : Jdec.Decoder Goto | |
| 3999 | +goto = | |
| 4000 | + Jdec.succeed Goto | |
| 4001 | + |> Jpipe.required "goto" Jdec.int | |
| 4002 | + | |
| 4003 | +encodeGoto : Goto -> Jenc.Value | |
| 4004 | +encodeGoto x = | |
| 4005 | + Jenc.object | |
| 4006 | + [ ("goto", Jenc.int x.goto) | |
| 4007 | + ] | |
| 4008 | + | |
| 3972 | 4009 | guard : Jdec.Decoder Guard |
| 3973 | 4010 | guard = |
| 3974 | 4011 | Jdec.succeed Guard |
| @@ -4486,6 +4523,17 @@ encodeMapEntry x = | ||
| 4486 | 4523 | [ ("MapEntry", Jenc.int x.mapEntry) |
| 4487 | 4524 | ] |
| 4488 | 4525 | |
| 4526 | +marshalJSON : Jdec.Decoder MarshalJSON | |
| 4527 | +marshalJSON = | |
| 4528 | + Jdec.succeed MarshalJSON | |
| 4529 | + |> Jpipe.required "MarshalJSON" Jdec.int | |
| 4530 | + | |
| 4531 | +encodeMarshalJSON : MarshalJSON -> Jenc.Value | |
| 4532 | +encodeMarshalJSON x = | |
| 4533 | + Jenc.object | |
| 4534 | + [ ("MarshalJSON", Jenc.int x.marshalJSON) | |
| 4535 | + ] | |
| 4536 | + | |
| 4489 | 4537 | metadataPropertyHandling : Jdec.Decoder MetadataPropertyHandling |
| 4490 | 4538 | metadataPropertyHandling = |
| 4491 | 4539 | Jdec.succeed MetadataPropertyHandling |
| @@ -4585,17 +4633,6 @@ encodeNo x = | ||
| 4585 | 4633 | [ ("NO", Jenc.int x.no) |
| 4586 | 4634 | ] |
| 4587 | 4635 | |
| 4588 | -noexcept : Jdec.Decoder Noexcept | |
| 4589 | -noexcept = | |
| 4590 | - Jdec.succeed Noexcept | |
| 4591 | - |> Jpipe.required "noexcept" Jdec.int | |
| 4592 | - | |
| 4593 | -encodeNoexcept : Noexcept -> Jenc.Value | |
| 4594 | -encodeNoexcept x = | |
| 4595 | - Jenc.object | |
| 4596 | - [ ("noexcept", Jenc.int x.noexcept) | |
| 4597 | - ] | |
| 4598 | - | |
| 4599 | 4636 | purpleIf : Jdec.Decoder If |
| 4600 | 4637 | purpleIf = |
| 4601 | 4638 | Jdec.succeed If |
| @@ -4678,6 +4715,7 @@ obj4 = | ||
| 4678 | 4715 | Jdec.succeed Obj4 |
| 4679 | 4716 | |> Jpipe.required "dummy" Jdec.int |
| 4680 | 4717 | |> Jpipe.required "noSuchMethod" noSuchMethod |
| 4718 | + |> Jpipe.required "noexcept" noexcept | |
| 4681 | 4719 | |> Jpipe.required "nonatomic" nonatomic |
| 4682 | 4720 | |> Jpipe.required "None" none |
| 4683 | 4721 | |> Jpipe.required "nonlocal" nonlocal |
| @@ -4740,13 +4778,13 @@ obj4 = | ||
| 4740 | 4778 | |> Jpipe.required "sbyte" sbyte |
| 4741 | 4779 | |> Jpipe.required "sealed" sealed |
| 4742 | 4780 | |> Jpipe.required "SEL" sel |
| 4743 | - |> Jpipe.required "select" select | |
| 4744 | 4781 | |
| 4745 | 4782 | encodeObj4 : Obj4 -> Jenc.Value |
| 4746 | 4783 | encodeObj4 x = |
| 4747 | 4784 | Jenc.object |
| 4748 | 4785 | [ ("dummy", Jenc.int x.dummy) |
| 4749 | 4786 | , ("noSuchMethod", encodeNoSuchMethod x.noSuchMethod) |
| 4787 | + , ("noexcept", encodeNoexcept x.noexcept) | |
| 4750 | 4788 | , ("nonatomic", encodeNonatomic x.nonatomic) |
| 4751 | 4789 | , ("None", encodeNone x.none) |
| 4752 | 4790 | , ("nonlocal", encodeNonlocal x.nonlocal) |
| @@ -4809,7 +4847,6 @@ encodeObj4 x = | ||
| 4809 | 4847 | , ("sbyte", encodeSbyte x.sbyte) |
| 4810 | 4848 | , ("sealed", encodeSealed x.sealed) |
| 4811 | 4849 | , ("SEL", encodeSel x.sel) |
| 4812 | - , ("select", encodeSelect x.select) | |
| 4813 | 4850 | ] |
| 4814 | 4851 | |
| 4815 | 4852 | noSuchMethod : Jdec.Decoder NoSuchMethod |
| @@ -4823,6 +4860,17 @@ encodeNoSuchMethod x = | ||
| 4823 | 4860 | [ ("noSuchMethod", Jenc.int x.noSuchMethod) |
| 4824 | 4861 | ] |
| 4825 | 4862 | |
| 4863 | +noexcept : Jdec.Decoder Noexcept | |
| 4864 | +noexcept = | |
| 4865 | + Jdec.succeed Noexcept | |
| 4866 | + |> Jpipe.required "noexcept" Jdec.int | |
| 4867 | + | |
| 4868 | +encodeNoexcept : Noexcept -> Jenc.Value | |
| 4869 | +encodeNoexcept x = | |
| 4870 | + Jenc.object | |
| 4871 | + [ ("noexcept", Jenc.int x.noexcept) | |
| 4872 | + ] | |
| 4873 | + | |
| 4826 | 4874 | nonatomic : Jdec.Decoder Nonatomic |
| 4827 | 4875 | nonatomic = |
| 4828 | 4876 | Jdec.succeed Nonatomic |
| @@ -5505,17 +5553,6 @@ encodeSel x = | ||
| 5505 | 5553 | [ ("SEL", Jenc.int x.sel) |
| 5506 | 5554 | ] |
| 5507 | 5555 | |
| 5508 | -select : Jdec.Decoder Select | |
| 5509 | -select = | |
| 5510 | - Jdec.succeed Select | |
| 5511 | - |> Jpipe.required "select" Jdec.int | |
| 5512 | - | |
| 5513 | -encodeSelect : Select -> Jenc.Value | |
| 5514 | -encodeSelect x = | |
| 5515 | - Jenc.object | |
| 5516 | - [ ("select", Jenc.int x.select) | |
| 5517 | - ] | |
| 5518 | - | |
| 5519 | 5556 | obj5 : Jdec.Decoder Obj5 |
| 5520 | 5557 | obj5 = |
| 5521 | 5558 | Jdec.succeed Obj5 |
| @@ -5528,6 +5565,7 @@ obj5 = | ||
| 5528 | 5565 | |> Jpipe.required "Type" purpleType |
| 5529 | 5566 | |> Jpipe.required "PrimitiveKind" primitiveKind |
| 5530 | 5567 | |> Jpipe.required "type" typeClass |
| 5568 | + |> Jpipe.required "select" select | |
| 5531 | 5569 | |> Jpipe.required "Self" self |
| 5532 | 5570 | |> Jpipe.required "Sendable" sendable |
| 5533 | 5571 | |> Jpipe.required "SerialDescriptor" serialDescriptor |
| @@ -5563,6 +5601,7 @@ obj5 = | ||
| 5563 | 5601 | |> Jpipe.required "TimeOnly" timeOnly |
| 5564 | 5602 | |> Jpipe.required "TimeOnlyConverter" timeOnlyConverter |
| 5565 | 5603 | |> Jpipe.required "TimeZone" timeZone |
| 5604 | + |> Jpipe.required "to_dict" toDict | |
| 5566 | 5605 | |> Jpipe.required "to_json" toJSON |
| 5567 | 5606 | |> Jpipe.required "toString" toString |
| 5568 | 5607 | |> Jpipe.required "top_level" topLevel |
| @@ -5579,11 +5618,10 @@ obj5 = | ||
| 5579 | 5618 | |> Jpipe.required "unchecked" unchecked |
| 5580 | 5619 | |> Jpipe.required "undefined" undefined |
| 5581 | 5620 | |> Jpipe.required "union" union |
| 5621 | + |> Jpipe.required "UnmarshalJSON" unmarshalJSON | |
| 5582 | 5622 | |> Jpipe.required "unowned" unowned |
| 5583 | 5623 | |> Jpipe.required "unsafe" unsafe |
| 5584 | - |> Jpipe.required "unsigned" unsigned | |
| 5585 | 5624 | |> Jpipe.required "UseSerializers" useSerializers |
| 5586 | - |> Jpipe.required "ushort" ushort | |
| 5587 | 5625 | |
| 5588 | 5626 | encodeObj5 : Obj5 -> Jenc.Value |
| 5589 | 5627 | encodeObj5 x = |
| @@ -5597,6 +5635,7 @@ encodeObj5 x = | ||
| 5597 | 5635 | , ("Type", encodeType x.obj5Type) |
| 5598 | 5636 | , ("PrimitiveKind", encodePrimitiveKind x.primitiveKind) |
| 5599 | 5637 | , ("type", encodeTypeClass x.purpleType) |
| 5638 | + , ("select", encodeSelect x.select) | |
| 5600 | 5639 | , ("Self", encodeSelf x.self) |
| 5601 | 5640 | , ("Sendable", encodeSendable x.sendable) |
| 5602 | 5641 | , ("SerialDescriptor", encodeSerialDescriptor x.serialDescriptor) |
| @@ -5632,6 +5671,7 @@ encodeObj5 x = | ||
| 5632 | 5671 | , ("TimeOnly", encodeTimeOnly x.timeOnly) |
| 5633 | 5672 | , ("TimeOnlyConverter", encodeTimeOnlyConverter x.timeOnlyConverter) |
| 5634 | 5673 | , ("TimeZone", encodeTimeZone x.timeZone) |
| 5674 | + , ("to_dict", encodeToDict x.toDict) | |
| 5635 | 5675 | , ("to_json", encodeToJSON x.toJSON) |
| 5636 | 5676 | , ("toString", encodeToString x.toString) |
| 5637 | 5677 | , ("top_level", encodeTopLevel x.topLevel) |
| @@ -5648,11 +5688,10 @@ encodeObj5 x = | ||
| 5648 | 5688 | , ("unchecked", encodeUnchecked x.unchecked) |
| 5649 | 5689 | , ("undefined", encodeUndefined x.undefined) |
| 5650 | 5690 | , ("union", encodeUnion x.union) |
| 5691 | + , ("UnmarshalJSON", encodeUnmarshalJSON x.unmarshalJSON) | |
| 5651 | 5692 | , ("unowned", encodeUnowned x.unowned) |
| 5652 | 5693 | , ("unsafe", encodeUnsafe x.unsafe) |
| 5653 | - , ("unsigned", encodeUnsigned x.unsigned) | |
| 5654 | 5694 | , ("UseSerializers", encodeUseSerializers x.useSerializers) |
| 5655 | - , ("ushort", encodeUshort x.ushort) | |
| 5656 | 5695 | ] |
| 5657 | 5696 | |
| 5658 | 5697 | kSerializer : Jdec.Decoder KSerializer |
| @@ -5743,6 +5782,17 @@ encodeTypeClass x = | ||
| 5743 | 5782 | [ ("type", Jenc.int x.typeType) |
| 5744 | 5783 | ] |
| 5745 | 5784 | |
| 5785 | +select : Jdec.Decoder Select | |
| 5786 | +select = | |
| 5787 | + Jdec.succeed Select | |
| 5788 | + |> Jpipe.required "select" Jdec.int | |
| 5789 | + | |
| 5790 | +encodeSelect : Select -> Jenc.Value | |
| 5791 | +encodeSelect x = | |
| 5792 | + Jenc.object | |
| 5793 | + [ ("select", Jenc.int x.select) | |
| 5794 | + ] | |
| 5795 | + | |
| 5746 | 5796 | self : Jdec.Decoder Self |
| 5747 | 5797 | self = |
| 5748 | 5798 | Jdec.succeed Self |
| @@ -6128,6 +6178,17 @@ encodeTimeZone x = | ||
| 6128 | 6178 | [ ("TimeZone", Jenc.int x.timeZone) |
| 6129 | 6179 | ] |
| 6130 | 6180 | |
| 6181 | +toDict : Jdec.Decoder ToDict | |
| 6182 | +toDict = | |
| 6183 | + Jdec.succeed ToDict | |
| 6184 | + |> Jpipe.required "to_dict" Jdec.int | |
| 6185 | + | |
| 6186 | +encodeToDict : ToDict -> Jenc.Value | |
| 6187 | +encodeToDict x = | |
| 6188 | + Jenc.object | |
| 6189 | + [ ("to_dict", Jenc.int x.toDict) | |
| 6190 | + ] | |
| 6191 | + | |
| 6131 | 6192 | toJSON : Jdec.Decoder ToJSON |
| 6132 | 6193 | toJSON = |
| 6133 | 6194 | Jdec.succeed ToJSON |
| @@ -6304,6 +6365,17 @@ encodeUnion x = | ||
| 6304 | 6365 | [ ("union", Jenc.int x.union) |
| 6305 | 6366 | ] |
| 6306 | 6367 | |
| 6368 | +unmarshalJSON : Jdec.Decoder UnmarshalJSON | |
| 6369 | +unmarshalJSON = | |
| 6370 | + Jdec.succeed UnmarshalJSON | |
| 6371 | + |> Jpipe.required "UnmarshalJSON" Jdec.int | |
| 6372 | + | |
| 6373 | +encodeUnmarshalJSON : UnmarshalJSON -> Jenc.Value | |
| 6374 | +encodeUnmarshalJSON x = | |
| 6375 | + Jenc.object | |
| 6376 | + [ ("UnmarshalJSON", Jenc.int x.unmarshalJSON) | |
| 6377 | + ] | |
| 6378 | + | |
| 6307 | 6379 | unowned : Jdec.Decoder Unowned |
| 6308 | 6380 | unowned = |
| 6309 | 6381 | Jdec.succeed Unowned |
| @@ -6326,17 +6398,6 @@ encodeUnsafe x = | ||
| 6326 | 6398 | [ ("unsafe", Jenc.int x.unsafe) |
| 6327 | 6399 | ] |
| 6328 | 6400 | |
| 6329 | -unsigned : Jdec.Decoder Unsigned | |
| 6330 | -unsigned = | |
| 6331 | - Jdec.succeed Unsigned | |
| 6332 | - |> Jpipe.required "unsigned" Jdec.int | |
| 6333 | - | |
| 6334 | -encodeUnsigned : Unsigned -> Jenc.Value | |
| 6335 | -encodeUnsigned x = | |
| 6336 | - Jenc.object | |
| 6337 | - [ ("unsigned", Jenc.int x.unsigned) | |
| 6338 | - ] | |
| 6339 | - | |
| 6340 | 6401 | useSerializers : Jdec.Decoder UseSerializers |
| 6341 | 6402 | useSerializers = |
| 6342 | 6403 | Jdec.succeed UseSerializers |
| @@ -6348,22 +6409,13 @@ encodeUseSerializers x = | ||
| 6348 | 6409 | [ ("UseSerializers", Jenc.int x.useSerializers) |
| 6349 | 6410 | ] |
| 6350 | 6411 | |
| 6351 | -ushort : Jdec.Decoder Ushort | |
| 6352 | -ushort = | |
| 6353 | - Jdec.succeed Ushort | |
| 6354 | - |> Jpipe.required "ushort" Jdec.int | |
| 6355 | - | |
| 6356 | -encodeUshort : Ushort -> Jenc.Value | |
| 6357 | -encodeUshort x = | |
| 6358 | - Jenc.object | |
| 6359 | - [ ("ushort", Jenc.int x.ushort) | |
| 6360 | - ] | |
| 6361 | - | |
| 6362 | 6412 | obj6 : Jdec.Decoder Obj6 |
| 6363 | 6413 | obj6 = |
| 6364 | 6414 | Jdec.succeed Obj6 |
| 6365 | 6415 | |> Jpipe.required "dummy" Jdec.int |
| 6366 | 6416 | |> Jpipe.required "where" purpleWhere |
| 6417 | + |> Jpipe.required "unsigned" unsigned | |
| 6418 | + |> Jpipe.required "ushort" ushort | |
| 6367 | 6419 | |> Jpipe.required "using" using |
| 6368 | 6420 | |> Jpipe.required "Utf8JsonReader" utf8JSONReader |
| 6369 | 6421 | |> Jpipe.required "Utf8JsonWriter" utf8JSONWriter |
| @@ -6387,6 +6439,8 @@ encodeObj6 x = | ||
| 6387 | 6439 | Jenc.object |
| 6388 | 6440 | [ ("dummy", Jenc.int x.dummy) |
| 6389 | 6441 | , ("where", encodeWhere x.obj6Where) |
| 6442 | + , ("unsigned", encodeUnsigned x.unsigned) | |
| 6443 | + , ("ushort", encodeUshort x.ushort) | |
| 6390 | 6444 | , ("using", encodeUsing x.using) |
| 6391 | 6445 | , ("Utf8JsonReader", encodeUtf8JSONReader x.utf8JSONReader) |
| 6392 | 6446 | , ("Utf8JsonWriter", encodeUtf8JSONWriter x.utf8JSONWriter) |
| @@ -6417,6 +6471,28 @@ encodeWhere x = | ||
| 6417 | 6471 | [ ("where", Jenc.int x.whereWhere) |
| 6418 | 6472 | ] |
| 6419 | 6473 | |
| 6474 | +unsigned : Jdec.Decoder Unsigned | |
| 6475 | +unsigned = | |
| 6476 | + Jdec.succeed Unsigned | |
| 6477 | + |> Jpipe.required "unsigned" Jdec.int | |
| 6478 | + | |
| 6479 | +encodeUnsigned : Unsigned -> Jenc.Value | |
| 6480 | +encodeUnsigned x = | |
| 6481 | + Jenc.object | |
| 6482 | + [ ("unsigned", Jenc.int x.unsigned) | |
| 6483 | + ] | |
| 6484 | + | |
| 6485 | +ushort : Jdec.Decoder Ushort | |
| 6486 | +ushort = | |
| 6487 | + Jdec.succeed Ushort | |
| 6488 | + |> Jpipe.required "ushort" Jdec.int | |
| 6489 | + | |
| 6490 | +encodeUshort : Ushort -> Jenc.Value | |
| 6491 | +encodeUshort x = | |
| 6492 | + Jenc.object | |
| 6493 | + [ ("ushort", Jenc.int x.ushort) | |
| 6494 | + ] | |
| 6495 | + | |
| 6420 | 6496 | using : Jdec.Decoder Using |
| 6421 | 6497 | using = |
| 6422 | 6498 | Jdec.succeed Using |
Mflowdefault / TopLevel.js+83 −47
| @@ -402,13 +402,13 @@ export type Obj2 = { | ||
| 402 | 402 | foreach: Foreach; |
| 403 | 403 | friend: Friend; |
| 404 | 404 | from: From; |
| 405 | + from_dict: FromDict; | |
| 405 | 406 | from_json: FromJSON; |
| 406 | 407 | func: Func; |
| 407 | 408 | function: Function; |
| 408 | 409 | get: Get; |
| 409 | 410 | global: Global; |
| 410 | 411 | go: Go; |
| 411 | - goto: Goto; | |
| 412 | 412 | }; |
| 413 | 413 | |
| 414 | 414 | export type DateFormatter = { |
| @@ -643,6 +643,10 @@ export type From = { | ||
| 643 | 643 | from: number; |
| 644 | 644 | }; |
| 645 | 645 | |
| 646 | +export type FromDict = { | |
| 647 | + from_dict: number; | |
| 648 | +}; | |
| 649 | + | |
| 646 | 650 | export type FromJSON = { |
| 647 | 651 | from_json: number; |
| 648 | 652 | }; |
| @@ -667,10 +671,6 @@ export type Go = { | ||
| 667 | 671 | go: number; |
| 668 | 672 | }; |
| 669 | 673 | |
| 670 | -export type Goto = { | |
| 671 | - goto: number; | |
| 672 | -}; | |
| 673 | - | |
| 674 | 674 | export type Obj3 = { |
| 675 | 675 | Hashable: Hashable; |
| 676 | 676 | Hasher: Hasher; |
| @@ -689,8 +689,10 @@ export type Obj3 = { | ||
| 689 | 689 | JsonTokenType: JSONTokenType; |
| 690 | 690 | Locale: Locale; |
| 691 | 691 | MapEntry: MapEntry; |
| 692 | + MarshalJSON: MarshalJSON; | |
| 692 | 693 | NO: No; |
| 693 | 694 | dummy: number; |
| 695 | + goto: Goto; | |
| 694 | 696 | guard: Guard; |
| 695 | 697 | hasOwnProperty: HasOwnProperty; |
| 696 | 698 | hashCode: HashCode; |
| @@ -736,7 +738,6 @@ export type Obj3 = { | ||
| 736 | 738 | new: New; |
| 737 | 739 | newtonsoft: Newtonsoft; |
| 738 | 740 | nil: Nil; |
| 739 | - noexcept: Noexcept; | |
| 740 | 741 | }; |
| 741 | 742 | |
| 742 | 743 | export type Hashable = { |
| @@ -807,10 +808,18 @@ export type MapEntry = { | ||
| 807 | 808 | MapEntry: number; |
| 808 | 809 | }; |
| 809 | 810 | |
| 811 | +export type MarshalJSON = { | |
| 812 | + MarshalJSON: number; | |
| 813 | +}; | |
| 814 | + | |
| 810 | 815 | export type No = { |
| 811 | 816 | NO: number; |
| 812 | 817 | }; |
| 813 | 818 | |
| 819 | +export type Goto = { | |
| 820 | + goto: number; | |
| 821 | +}; | |
| 822 | + | |
| 814 | 823 | export type Guard = { |
| 815 | 824 | guard: number; |
| 816 | 825 | }; |
| @@ -991,10 +1000,6 @@ export type Nil = { | ||
| 991 | 1000 | nil: number; |
| 992 | 1001 | }; |
| 993 | 1002 | |
| 994 | -export type Noexcept = { | |
| 995 | - noexcept: number; | |
| 996 | -}; | |
| 997 | - | |
| 998 | 1003 | export type Obj4 = { |
| 999 | 1004 | NSError: NSError; |
| 1000 | 1005 | NSObject: NSObject; |
| @@ -1007,6 +1012,7 @@ export type Obj4 = { | ||
| 1007 | 1012 | SEL: Sel; |
| 1008 | 1013 | dummy: number; |
| 1009 | 1014 | noSuchMethod: NoSuchMethod; |
| 1015 | + noexcept: Noexcept; | |
| 1010 | 1016 | nonatomic: Nonatomic; |
| 1011 | 1017 | none: NoneClass; |
| 1012 | 1018 | nonlocal: Nonlocal; |
| @@ -1060,7 +1066,6 @@ export type Obj4 = { | ||
| 1060 | 1066 | s: S; |
| 1061 | 1067 | sbyte: Sbyte; |
| 1062 | 1068 | sealed: Sealed; |
| 1063 | - select: Select; | |
| 1064 | 1069 | }; |
| 1065 | 1070 | |
| 1066 | 1071 | export type NSError = { |
| @@ -1103,6 +1108,10 @@ export type NoSuchMethod = { | ||
| 1103 | 1108 | noSuchMethod: number; |
| 1104 | 1109 | }; |
| 1105 | 1110 | |
| 1111 | +export type Noexcept = { | |
| 1112 | + noexcept: number; | |
| 1113 | +}; | |
| 1114 | + | |
| 1106 | 1115 | export type Nonatomic = { |
| 1107 | 1116 | nonatomic: number; |
| 1108 | 1117 | }; |
| @@ -1315,10 +1324,6 @@ export type Sealed = { | ||
| 1315 | 1324 | sealed: number; |
| 1316 | 1325 | }; |
| 1317 | 1326 | |
| 1318 | -export type Select = { | |
| 1319 | - select: number; | |
| 1320 | -}; | |
| 1321 | - | |
| 1322 | 1327 | export type Obj5 = { |
| 1323 | 1328 | KSerializer: KSerializer; |
| 1324 | 1329 | PrimitiveKind: PrimitiveKind; |
| @@ -1337,8 +1342,10 @@ export type Obj5 = { | ||
| 1337 | 1342 | TimeZone: TimeZone; |
| 1338 | 1343 | True: True; |
| 1339 | 1344 | Type: Type; |
| 1345 | + UnmarshalJSON: UnmarshalJSON; | |
| 1340 | 1346 | UseSerializers: UseSerializers; |
| 1341 | 1347 | dummy: number; |
| 1348 | + select: Select; | |
| 1342 | 1349 | self: SelfClass; |
| 1343 | 1350 | serialize: Serialize; |
| 1344 | 1351 | set: Set; |
| @@ -1365,6 +1372,7 @@ export type Obj5 = { | ||
| 1365 | 1372 | throw: Throw; |
| 1366 | 1373 | throws: Throws; |
| 1367 | 1374 | toString: ToString; |
| 1375 | + to_dict: ToDict; | |
| 1368 | 1376 | to_json: ToJSON; |
| 1369 | 1377 | top_level: TopLevelClass; |
| 1370 | 1378 | transient: Transient; |
| @@ -1383,8 +1391,6 @@ export type Obj5 = { | ||
| 1383 | 1391 | union: Union; |
| 1384 | 1392 | unowned: Unowned; |
| 1385 | 1393 | unsafe: Unsafe; |
| 1386 | - unsigned: Unsigned; | |
| 1387 | - ushort: Ushort; | |
| 1388 | 1394 | }; |
| 1389 | 1395 | |
| 1390 | 1396 | export type KSerializer = { |
| @@ -1455,10 +1461,18 @@ export type Type = { | ||
| 1455 | 1461 | Type: number; |
| 1456 | 1462 | }; |
| 1457 | 1463 | |
| 1464 | +export type UnmarshalJSON = { | |
| 1465 | + UnmarshalJSON: number; | |
| 1466 | +}; | |
| 1467 | + | |
| 1458 | 1468 | export type UseSerializers = { |
| 1459 | 1469 | UseSerializers: number; |
| 1460 | 1470 | }; |
| 1461 | 1471 | |
| 1472 | +export type Select = { | |
| 1473 | + select: number; | |
| 1474 | +}; | |
| 1475 | + | |
| 1462 | 1476 | export type SelfClass = { |
| 1463 | 1477 | self: number; |
| 1464 | 1478 | }; |
| @@ -1563,6 +1577,10 @@ export type ToString = { | ||
| 1563 | 1577 | toString: number; |
| 1564 | 1578 | }; |
| 1565 | 1579 | |
| 1580 | +export type ToDict = { | |
| 1581 | + to_dict: number; | |
| 1582 | +}; | |
| 1583 | + | |
| 1566 | 1584 | export type ToJSON = { |
| 1567 | 1585 | to_json: number; |
| 1568 | 1586 | }; |
| @@ -1635,20 +1653,14 @@ export type Unsafe = { | ||
| 1635 | 1653 | unsafe: number; |
| 1636 | 1654 | }; |
| 1637 | 1655 | |
| 1638 | -export type Unsigned = { | |
| 1639 | - unsigned: number; | |
| 1640 | -}; | |
| 1641 | - | |
| 1642 | -export type Ushort = { | |
| 1643 | - ushort: number; | |
| 1644 | -}; | |
| 1645 | - | |
| 1646 | 1656 | export type Obj6 = { |
| 1647 | 1657 | UUID: UUID; |
| 1648 | 1658 | Utf8JsonReader: Utf8JSONReader; |
| 1649 | 1659 | Utf8JsonWriter: Utf8JSONWriter; |
| 1650 | 1660 | YES: Yes; |
| 1651 | 1661 | dummy: number; |
| 1662 | + unsigned: Unsigned; | |
| 1663 | + ushort: Ushort; | |
| 1652 | 1664 | using: Using; |
| 1653 | 1665 | var: Var; |
| 1654 | 1666 | virtual: Virtual; |
| @@ -1681,6 +1693,14 @@ export type Yes = { | ||
| 1681 | 1693 | YES: number; |
| 1682 | 1694 | }; |
| 1683 | 1695 | |
| 1696 | +export type Unsigned = { | |
| 1697 | + unsigned: number; | |
| 1698 | +}; | |
| 1699 | + | |
| 1700 | +export type Ushort = { | |
| 1701 | + ushort: number; | |
| 1702 | +}; | |
| 1703 | + | |
| 1684 | 1704 | export type Using = { |
| 1685 | 1705 | using: number; |
| 1686 | 1706 | }; |
| @@ -1831,7 +1851,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 1831 | 1851 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 1832 | 1852 | return invalidValue(l(ref || "object"), val, key, parent); |
| 1833 | 1853 | } |
| 1834 | - const result: any = {}; | |
| 1854 | + const result: any = Object.create(null); | |
| 1835 | 1855 | Object.getOwnPropertyNames(props).forEach(key => { |
| 1836 | 1856 | const prop = props[key]; |
| 1837 | 1857 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -1842,7 +1862,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 1842 | 1862 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 1843 | 1863 | } |
| 1844 | 1864 | }); |
| 1845 | - return result; | |
| 1865 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 1846 | 1866 | } |
| 1847 | 1867 | |
| 1848 | 1868 | if (typ === "any") return val; |
| @@ -2250,13 +2270,13 @@ const typeMap: any = { | ||
| 2250 | 2270 | { json: "foreach", js: "foreach", typ: r("Foreach") }, |
| 2251 | 2271 | { json: "friend", js: "friend", typ: r("Friend") }, |
| 2252 | 2272 | { json: "from", js: "from", typ: r("From") }, |
| 2273 | + { json: "from_dict", js: "from_dict", typ: r("FromDict") }, | |
| 2253 | 2274 | { json: "from_json", js: "from_json", typ: r("FromJSON") }, |
| 2254 | 2275 | { json: "func", js: "func", typ: r("Func") }, |
| 2255 | 2276 | { json: "function", js: "function", typ: r("Function") }, |
| 2256 | 2277 | { json: "get", js: "get", typ: r("Get") }, |
| 2257 | 2278 | { json: "global", js: "global", typ: r("Global") }, |
| 2258 | 2279 | { json: "go", js: "go", typ: r("Go") }, |
| 2259 | - { json: "goto", js: "goto", typ: r("Goto") }, | |
| 2260 | 2280 | ], false), |
| 2261 | 2281 | "DateFormatter": o([ |
| 2262 | 2282 | { json: "DateFormatter", js: "DateFormatter", typ: i(0) }, |
| @@ -2429,6 +2449,9 @@ const typeMap: any = { | ||
| 2429 | 2449 | "From": o([ |
| 2430 | 2450 | { json: "from", js: "from", typ: i(0) }, |
| 2431 | 2451 | ], false), |
| 2452 | + "FromDict": o([ | |
| 2453 | + { json: "from_dict", js: "from_dict", typ: i(0) }, | |
| 2454 | + ], false), | |
| 2432 | 2455 | "FromJSON": o([ |
| 2433 | 2456 | { json: "from_json", js: "from_json", typ: i(0) }, |
| 2434 | 2457 | ], false), |
| @@ -2447,9 +2470,6 @@ const typeMap: any = { | ||
| 2447 | 2470 | "Go": o([ |
| 2448 | 2471 | { json: "go", js: "go", typ: i(0) }, |
| 2449 | 2472 | ], false), |
| 2450 | - "Goto": o([ | |
| 2451 | - { json: "goto", js: "goto", typ: i(0) }, | |
| 2452 | - ], false), | |
| 2453 | 2473 | "Obj3": o([ |
| 2454 | 2474 | { json: "Hashable", js: "Hashable", typ: r("Hashable") }, |
| 2455 | 2475 | { json: "Hasher", js: "Hasher", typ: r("Hasher") }, |
| @@ -2468,8 +2488,10 @@ const typeMap: any = { | ||
| 2468 | 2488 | { json: "JsonTokenType", js: "JsonTokenType", typ: r("JSONTokenType") }, |
| 2469 | 2489 | { json: "Locale", js: "Locale", typ: r("Locale") }, |
| 2470 | 2490 | { json: "MapEntry", js: "MapEntry", typ: r("MapEntry") }, |
| 2491 | + { json: "MarshalJSON", js: "MarshalJSON", typ: r("MarshalJSON") }, | |
| 2471 | 2492 | { json: "NO", js: "NO", typ: r("No") }, |
| 2472 | 2493 | { json: "dummy", js: "dummy", typ: i(0) }, |
| 2494 | + { json: "goto", js: "goto", typ: r("Goto") }, | |
| 2473 | 2495 | { json: "guard", js: "guard", typ: r("Guard") }, |
| 2474 | 2496 | { json: "hasOwnProperty", js: "hasOwnProperty", typ: r("HasOwnProperty") }, |
| 2475 | 2497 | { json: "hashCode", js: "hashCode", typ: r("HashCode") }, |
| @@ -2515,7 +2537,6 @@ const typeMap: any = { | ||
| 2515 | 2537 | { json: "new", js: "new", typ: r("New") }, |
| 2516 | 2538 | { json: "newtonsoft", js: "newtonsoft", typ: r("Newtonsoft") }, |
| 2517 | 2539 | { json: "nil", js: "nil", typ: r("Nil") }, |
| 2518 | - { json: "noexcept", js: "noexcept", typ: r("Noexcept") }, | |
| 2519 | 2540 | ], false), |
| 2520 | 2541 | "Hashable": o([ |
| 2521 | 2542 | { json: "Hashable", js: "Hashable", typ: i(0) }, |
| @@ -2568,9 +2589,15 @@ const typeMap: any = { | ||
| 2568 | 2589 | "MapEntry": o([ |
| 2569 | 2590 | { json: "MapEntry", js: "MapEntry", typ: i(0) }, |
| 2570 | 2591 | ], false), |
| 2592 | + "MarshalJSON": o([ | |
| 2593 | + { json: "MarshalJSON", js: "MarshalJSON", typ: i(0) }, | |
| 2594 | + ], false), | |
| 2571 | 2595 | "No": o([ |
| 2572 | 2596 | { json: "NO", js: "NO", typ: i(0) }, |
| 2573 | 2597 | ], false), |
| 2598 | + "Goto": o([ | |
| 2599 | + { json: "goto", js: "goto", typ: i(0) }, | |
| 2600 | + ], false), | |
| 2574 | 2601 | "Guard": o([ |
| 2575 | 2602 | { json: "guard", js: "guard", typ: i(0) }, |
| 2576 | 2603 | ], false), |
| @@ -2706,9 +2733,6 @@ const typeMap: any = { | ||
| 2706 | 2733 | "Nil": o([ |
| 2707 | 2734 | { json: "nil", js: "nil", typ: i(0) }, |
| 2708 | 2735 | ], false), |
| 2709 | - "Noexcept": o([ | |
| 2710 | - { json: "noexcept", js: "noexcept", typ: i(0) }, | |
| 2711 | - ], false), | |
| 2712 | 2736 | "Obj4": o([ |
| 2713 | 2737 | { json: "NSError", js: "NSError", typ: r("NSError") }, |
| 2714 | 2738 | { json: "NSObject", js: "NSObject", typ: r("NSObject") }, |
| @@ -2721,6 +2745,7 @@ const typeMap: any = { | ||
| 2721 | 2745 | { json: "SEL", js: "SEL", typ: r("Sel") }, |
| 2722 | 2746 | { json: "dummy", js: "dummy", typ: i(0) }, |
| 2723 | 2747 | { json: "noSuchMethod", js: "noSuchMethod", typ: r("NoSuchMethod") }, |
| 2748 | + { json: "noexcept", js: "noexcept", typ: r("Noexcept") }, | |
| 2724 | 2749 | { json: "nonatomic", js: "nonatomic", typ: r("Nonatomic") }, |
| 2725 | 2750 | { json: "none", js: "none", typ: r("NoneClass") }, |
| 2726 | 2751 | { json: "nonlocal", js: "nonlocal", typ: r("Nonlocal") }, |
| @@ -2774,7 +2799,6 @@ const typeMap: any = { | ||
| 2774 | 2799 | { json: "s", js: "s", typ: r("S") }, |
| 2775 | 2800 | { json: "sbyte", js: "sbyte", typ: r("Sbyte") }, |
| 2776 | 2801 | { json: "sealed", js: "sealed", typ: r("Sealed") }, |
| 2777 | - { json: "select", js: "select", typ: r("Select") }, | |
| 2778 | 2802 | ], false), |
| 2779 | 2803 | "NSError": o([ |
| 2780 | 2804 | { json: "NSError", js: "NSError", typ: i(0) }, |
| @@ -2806,6 +2830,9 @@ const typeMap: any = { | ||
| 2806 | 2830 | "NoSuchMethod": o([ |
| 2807 | 2831 | { json: "noSuchMethod", js: "noSuchMethod", typ: i(0) }, |
| 2808 | 2832 | ], false), |
| 2833 | + "Noexcept": o([ | |
| 2834 | + { json: "noexcept", js: "noexcept", typ: i(0) }, | |
| 2835 | + ], false), | |
| 2809 | 2836 | "Nonatomic": o([ |
| 2810 | 2837 | { json: "nonatomic", js: "nonatomic", typ: i(0) }, |
| 2811 | 2838 | ], false), |
| @@ -2965,9 +2992,6 @@ const typeMap: any = { | ||
| 2965 | 2992 | "Sealed": o([ |
| 2966 | 2993 | { json: "sealed", js: "sealed", typ: i(0) }, |
| 2967 | 2994 | ], false), |
| 2968 | - "Select": o([ | |
| 2969 | - { json: "select", js: "select", typ: i(0) }, | |
| 2970 | - ], false), | |
| 2971 | 2995 | "Obj5": o([ |
| 2972 | 2996 | { json: "KSerializer", js: "KSerializer", typ: r("KSerializer") }, |
| 2973 | 2997 | { json: "PrimitiveKind", js: "PrimitiveKind", typ: r("PrimitiveKind") }, |
| @@ -2986,8 +3010,10 @@ const typeMap: any = { | ||
| 2986 | 3010 | { json: "TimeZone", js: "TimeZone", typ: r("TimeZone") }, |
| 2987 | 3011 | { json: "True", js: "True", typ: r("True") }, |
| 2988 | 3012 | { json: "Type", js: "Type", typ: r("Type") }, |
| 3013 | + { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: r("UnmarshalJSON") }, | |
| 2989 | 3014 | { json: "UseSerializers", js: "UseSerializers", typ: r("UseSerializers") }, |
| 2990 | 3015 | { json: "dummy", js: "dummy", typ: i(0) }, |
| 3016 | + { json: "select", js: "select", typ: r("Select") }, | |
| 2991 | 3017 | { json: "self", js: "self", typ: r("SelfClass") }, |
| 2992 | 3018 | { json: "serialize", js: "serialize", typ: r("Serialize") }, |
| 2993 | 3019 | { json: "set", js: "set", typ: r("Set") }, |
| @@ -3014,6 +3040,7 @@ const typeMap: any = { | ||
| 3014 | 3040 | { json: "throw", js: "throw", typ: r("Throw") }, |
| 3015 | 3041 | { json: "throws", js: "throws", typ: r("Throws") }, |
| 3016 | 3042 | { json: "toString", js: "toString", typ: r("ToString") }, |
| 3043 | + { json: "to_dict", js: "to_dict", typ: r("ToDict") }, | |
| 3017 | 3044 | { json: "to_json", js: "to_json", typ: r("ToJSON") }, |
| 3018 | 3045 | { json: "top_level", js: "top_level", typ: r("TopLevelClass") }, |
| 3019 | 3046 | { json: "transient", js: "transient", typ: r("Transient") }, |
| @@ -3032,8 +3059,6 @@ const typeMap: any = { | ||
| 3032 | 3059 | { json: "union", js: "union", typ: r("Union") }, |
| 3033 | 3060 | { json: "unowned", js: "unowned", typ: r("Unowned") }, |
| 3034 | 3061 | { json: "unsafe", js: "unsafe", typ: r("Unsafe") }, |
| 3035 | - { json: "unsigned", js: "unsigned", typ: r("Unsigned") }, | |
| 3036 | - { json: "ushort", js: "ushort", typ: r("Ushort") }, | |
| 3037 | 3062 | ], false), |
| 3038 | 3063 | "KSerializer": o([ |
| 3039 | 3064 | { json: "KSerializer", js: "KSerializer", typ: i(0) }, |
| @@ -3086,9 +3111,15 @@ const typeMap: any = { | ||
| 3086 | 3111 | "Type": o([ |
| 3087 | 3112 | { json: "Type", js: "Type", typ: i(0) }, |
| 3088 | 3113 | ], false), |
| 3114 | + "UnmarshalJSON": o([ | |
| 3115 | + { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: i(0) }, | |
| 3116 | + ], false), | |
| 3089 | 3117 | "UseSerializers": o([ |
| 3090 | 3118 | { json: "UseSerializers", js: "UseSerializers", typ: i(0) }, |
| 3091 | 3119 | ], false), |
| 3120 | + "Select": o([ | |
| 3121 | + { json: "select", js: "select", typ: i(0) }, | |
| 3122 | + ], false), | |
| 3092 | 3123 | "SelfClass": o([ |
| 3093 | 3124 | { json: "self", js: "self", typ: i(0) }, |
| 3094 | 3125 | ], false), |
| @@ -3167,6 +3198,9 @@ const typeMap: any = { | ||
| 3167 | 3198 | "ToString": o([ |
| 3168 | 3199 | { json: "toString", js: "toString", typ: i(0) }, |
| 3169 | 3200 | ], false), |
| 3201 | + "ToDict": o([ | |
| 3202 | + { json: "to_dict", js: "to_dict", typ: i(0) }, | |
| 3203 | + ], false), | |
| 3170 | 3204 | "ToJSON": o([ |
| 3171 | 3205 | { json: "to_json", js: "to_json", typ: i(0) }, |
| 3172 | 3206 | ], false), |
| @@ -3221,18 +3255,14 @@ const typeMap: any = { | ||
| 3221 | 3255 | "Unsafe": o([ |
| 3222 | 3256 | { json: "unsafe", js: "unsafe", typ: i(0) }, |
| 3223 | 3257 | ], false), |
| 3224 | - "Unsigned": o([ | |
| 3225 | - { json: "unsigned", js: "unsigned", typ: i(0) }, | |
| 3226 | - ], false), | |
| 3227 | - "Ushort": o([ | |
| 3228 | - { json: "ushort", js: "ushort", typ: i(0) }, | |
| 3229 | - ], false), | |
| 3230 | 3258 | "Obj6": o([ |
| 3231 | 3259 | { json: "UUID", js: "UUID", typ: r("UUID") }, |
| 3232 | 3260 | { json: "Utf8JsonReader", js: "Utf8JsonReader", typ: r("Utf8JSONReader") }, |
| 3233 | 3261 | { json: "Utf8JsonWriter", js: "Utf8JsonWriter", typ: r("Utf8JSONWriter") }, |
| 3234 | 3262 | { json: "YES", js: "YES", typ: r("Yes") }, |
| 3235 | 3263 | { json: "dummy", js: "dummy", typ: i(0) }, |
| 3264 | + { json: "unsigned", js: "unsigned", typ: r("Unsigned") }, | |
| 3265 | + { json: "ushort", js: "ushort", typ: r("Ushort") }, | |
| 3236 | 3266 | { json: "using", js: "using", typ: r("Using") }, |
| 3237 | 3267 | { json: "var", js: "var", typ: r("Var") }, |
| 3238 | 3268 | { json: "virtual", js: "virtual", typ: r("Virtual") }, |
| @@ -3260,6 +3290,12 @@ const typeMap: any = { | ||
| 3260 | 3290 | "Yes": o([ |
| 3261 | 3291 | { json: "YES", js: "YES", typ: i(0) }, |
| 3262 | 3292 | ], false), |
| 3293 | + "Unsigned": o([ | |
| 3294 | + { json: "unsigned", js: "unsigned", typ: i(0) }, | |
| 3295 | + ], false), | |
| 3296 | + "Ushort": o([ | |
| 3297 | + { json: "ushort", js: "ushort", typ: i(0) }, | |
| 3298 | + ], false), | |
| 3263 | 3299 | "Using": o([ |
| 3264 | 3300 | { json: "using", js: "using", typ: i(0) }, |
| 3265 | 3301 | ], false), |
Mgolangdefault / quicktype.go+45 −25
| @@ -412,13 +412,13 @@ type Obj2 struct { | ||
| 412 | 412 | FormatException FormatException `json:"FormatException"` |
| 413 | 413 | Friend Friend `json:"friend"` |
| 414 | 414 | From From `json:"from"` |
| 415 | + FromDict FromDict `json:"from_dict"` | |
| 415 | 416 | FromJSON FromJSON `json:"from_json"` |
| 416 | 417 | Func Func `json:"func"` |
| 417 | 418 | Function Function `json:"function"` |
| 418 | 419 | Get Get `json:"get"` |
| 419 | 420 | Global Global `json:"global"` |
| 420 | 421 | Go Go `json:"go"` |
| 421 | - Goto Goto `json:"goto"` | |
| 422 | 422 | Obj2False FalseClass `json:"false"` |
| 423 | 423 | } |
| 424 | 424 | |
| @@ -646,6 +646,10 @@ type From struct { | ||
| 646 | 646 | From int64 `json:"from"` |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | +type FromDict struct { | |
| 650 | + FromDict int64 `json:"from_dict"` | |
| 651 | +} | |
| 652 | + | |
| 649 | 653 | type FromJSON struct { |
| 650 | 654 | FromJSON int64 `json:"from_json"` |
| 651 | 655 | } |
| @@ -670,16 +674,13 @@ type Go struct { | ||
| 670 | 674 | Go int64 `json:"go"` |
| 671 | 675 | } |
| 672 | 676 | |
| 673 | -type Goto struct { | |
| 674 | - Goto int64 `json:"goto"` | |
| 675 | -} | |
| 676 | - | |
| 677 | 677 | type FalseClass struct { |
| 678 | 678 | False int64 `json:"false"` |
| 679 | 679 | } |
| 680 | 680 | |
| 681 | 681 | type Obj3 struct { |
| 682 | 682 | Dummy int64 `json:"dummy"` |
| 683 | + Goto Goto `json:"goto"` | |
| 683 | 684 | Guard Guard `json:"guard"` |
| 684 | 685 | HasOwnProperty HasOwnProperty `json:"hasOwnProperty"` |
| 685 | 686 | HashCode HashCode `json:"hashCode"` |
| @@ -733,6 +734,7 @@ type Obj3 struct { | ||
| 733 | 734 | Long Long `json:"long"` |
| 734 | 735 | Map Map `json:"map"` |
| 735 | 736 | MapEntry MapEntry `json:"MapEntry"` |
| 737 | + MarshalJSON MarshalJSON `json:"MarshalJSON"` | |
| 736 | 738 | MetadataPropertyHandling MetadataPropertyHandling `json:"metadata_property_handling"` |
| 737 | 739 | Module Module `json:"module"` |
| 738 | 740 | Mutable Mutable `json:"mutable"` |
| @@ -743,7 +745,10 @@ type Obj3 struct { | ||
| 743 | 745 | Newtonsoft Newtonsoft `json:"newtonsoft"` |
| 744 | 746 | Nil Nil `json:"nil"` |
| 745 | 747 | No No `json:"NO"` |
| 746 | - Noexcept Noexcept `json:"noexcept"` | |
| 748 | +} | |
| 749 | + | |
| 750 | +type Goto struct { | |
| 751 | + Goto int64 `json:"goto"` | |
| 747 | 752 | } |
| 748 | 753 | |
| 749 | 754 | type Guard struct { |
| @@ -958,6 +963,10 @@ type MapEntry struct { | ||
| 958 | 963 | MapEntry int64 `json:"MapEntry"` |
| 959 | 964 | } |
| 960 | 965 | |
| 966 | +type MarshalJSON struct { | |
| 967 | + MarshalJSON int64 `json:"MarshalJSON"` | |
| 968 | +} | |
| 969 | + | |
| 961 | 970 | type MetadataPropertyHandling struct { |
| 962 | 971 | MetadataPropertyHandling int64 `json:"metadata_property_handling"` |
| 963 | 972 | } |
| @@ -998,16 +1007,13 @@ type No struct { | ||
| 998 | 1007 | No int64 `json:"NO"` |
| 999 | 1008 | } |
| 1000 | 1009 | |
| 1001 | -type Noexcept struct { | |
| 1002 | - Noexcept int64 `json:"noexcept"` | |
| 1003 | -} | |
| 1004 | - | |
| 1005 | 1010 | type Obj4 struct { |
| 1006 | 1011 | Dummy int64 `json:"dummy"` |
| 1007 | 1012 | NSError NSError `json:"NSError"` |
| 1008 | 1013 | NSObject NSObject `json:"NSObject"` |
| 1009 | 1014 | NSString NSString `json:"NSString"` |
| 1010 | 1015 | NoSuchMethod NoSuchMethod `json:"noSuchMethod"` |
| 1016 | + Noexcept Noexcept `json:"noexcept"` | |
| 1011 | 1017 | Nonatomic Nonatomic `json:"nonatomic"` |
| 1012 | 1018 | None None `json:"None"` |
| 1013 | 1019 | Nonlocal Nonlocal `json:"nonlocal"` |
| @@ -1067,7 +1073,6 @@ type Obj4 struct { | ||
| 1067 | 1073 | Sbyte Sbyte `json:"sbyte"` |
| 1068 | 1074 | Sealed Sealed `json:"sealed"` |
| 1069 | 1075 | Sel Sel `json:"SEL"` |
| 1070 | - Select Select `json:"select"` | |
| 1071 | 1076 | } |
| 1072 | 1077 | |
| 1073 | 1078 | type NSError struct { |
| @@ -1086,6 +1091,10 @@ type NoSuchMethod struct { | ||
| 1086 | 1091 | NoSuchMethod int64 `json:"noSuchMethod"` |
| 1087 | 1092 | } |
| 1088 | 1093 | |
| 1094 | +type Noexcept struct { | |
| 1095 | + Noexcept int64 `json:"noexcept"` | |
| 1096 | +} | |
| 1097 | + | |
| 1089 | 1098 | type Nonatomic struct { |
| 1090 | 1099 | Nonatomic int64 `json:"nonatomic"` |
| 1091 | 1100 | } |
| @@ -1322,10 +1331,6 @@ type Sel struct { | ||
| 1322 | 1331 | Sel int64 `json:"SEL"` |
| 1323 | 1332 | } |
| 1324 | 1333 | |
| 1325 | -type Select struct { | |
| 1326 | - Select int64 `json:"select"` | |
| 1327 | -} | |
| 1328 | - | |
| 1329 | 1334 | type Obj5 struct { |
| 1330 | 1335 | Dummy int64 `json:"dummy"` |
| 1331 | 1336 | KSerializer KSerializer `json:"KSerializer"` |
| @@ -1333,6 +1338,7 @@ type Obj5 struct { | ||
| 1333 | 1338 | Obj5True TrueClass `json:"true"` |
| 1334 | 1339 | Obj5Type TypeClass `json:"type"` |
| 1335 | 1340 | PrimitiveKind PrimitiveKind `json:"PrimitiveKind"` |
| 1341 | + Select Select `json:"select"` | |
| 1336 | 1342 | Self Self `json:"Self"` |
| 1337 | 1343 | Sendable Sendable `json:"Sendable"` |
| 1338 | 1344 | SerialDescriptor SerialDescriptor `json:"SerialDescriptor"` |
| @@ -1370,6 +1376,7 @@ type Obj5 struct { | ||
| 1370 | 1376 | TimeOnly TimeOnly `json:"TimeOnly"` |
| 1371 | 1377 | TimeOnlyConverter TimeOnlyConverter `json:"TimeOnlyConverter"` |
| 1372 | 1378 | TimeZone TimeZone `json:"TimeZone"` |
| 1379 | + ToDict ToDict `json:"to_dict"` | |
| 1373 | 1380 | ToJSON ToJSON `json:"to_json"` |
| 1374 | 1381 | ToString ToString `json:"toString"` |
| 1375 | 1382 | TopLevel TopLevelClass `json:"top_level"` |
| @@ -1387,11 +1394,10 @@ type Obj5 struct { | ||
| 1387 | 1394 | Unchecked Unchecked `json:"unchecked"` |
| 1388 | 1395 | Undefined Undefined `json:"undefined"` |
| 1389 | 1396 | Union Union `json:"union"` |
| 1397 | + UnmarshalJSON UnmarshalJSON `json:"UnmarshalJSON"` | |
| 1390 | 1398 | Unowned Unowned `json:"unowned"` |
| 1391 | 1399 | Unsafe Unsafe `json:"unsafe"` |
| 1392 | - Unsigned Unsigned `json:"unsigned"` | |
| 1393 | 1400 | UseSerializers UseSerializers `json:"UseSerializers"` |
| 1394 | - Ushort Ushort `json:"ushort"` | |
| 1395 | 1401 | } |
| 1396 | 1402 | |
| 1397 | 1403 | type KSerializer struct { |
| @@ -1414,6 +1420,10 @@ type PrimitiveKind struct { | ||
| 1414 | 1420 | PrimitiveKind int64 `json:"PrimitiveKind"` |
| 1415 | 1421 | } |
| 1416 | 1422 | |
| 1423 | +type Select struct { | |
| 1424 | + Select int64 `json:"select"` | |
| 1425 | +} | |
| 1426 | + | |
| 1417 | 1427 | type Self struct { |
| 1418 | 1428 | Self int64 `json:"Self"` |
| 1419 | 1429 | } |
| @@ -1562,6 +1572,10 @@ type TimeZone struct { | ||
| 1562 | 1572 | TimeZone int64 `json:"TimeZone"` |
| 1563 | 1573 | } |
| 1564 | 1574 | |
| 1575 | +type ToDict struct { | |
| 1576 | + ToDict int64 `json:"to_dict"` | |
| 1577 | +} | |
| 1578 | + | |
| 1565 | 1579 | type ToJSON struct { |
| 1566 | 1580 | ToJSON int64 `json:"to_json"` |
| 1567 | 1581 | } |
| @@ -1630,6 +1644,10 @@ type Union struct { | ||
| 1630 | 1644 | Union int64 `json:"union"` |
| 1631 | 1645 | } |
| 1632 | 1646 | |
| 1647 | +type UnmarshalJSON struct { | |
| 1648 | + UnmarshalJSON int64 `json:"UnmarshalJSON"` | |
| 1649 | +} | |
| 1650 | + | |
| 1633 | 1651 | type Unowned struct { |
| 1634 | 1652 | Unowned int64 `json:"unowned"` |
| 1635 | 1653 | } |
| @@ -1638,21 +1656,15 @@ type Unsafe struct { | ||
| 1638 | 1656 | Unsafe int64 `json:"unsafe"` |
| 1639 | 1657 | } |
| 1640 | 1658 | |
| 1641 | -type Unsigned struct { | |
| 1642 | - Unsigned int64 `json:"unsigned"` | |
| 1643 | -} | |
| 1644 | - | |
| 1645 | 1659 | type UseSerializers struct { |
| 1646 | 1660 | UseSerializers int64 `json:"UseSerializers"` |
| 1647 | 1661 | } |
| 1648 | 1662 | |
| 1649 | -type Ushort struct { | |
| 1650 | - Ushort int64 `json:"ushort"` | |
| 1651 | -} | |
| 1652 | - | |
| 1653 | 1663 | type Obj6 struct { |
| 1654 | 1664 | Dummy int64 `json:"dummy"` |
| 1655 | 1665 | UUID UUID `json:"UUID"` |
| 1666 | + Unsigned Unsigned `json:"unsigned"` | |
| 1667 | + Ushort Ushort `json:"ushort"` | |
| 1656 | 1668 | Using Using `json:"using"` |
| 1657 | 1669 | Utf8JSONReader Utf8JSONReader `json:"Utf8JsonReader"` |
| 1658 | 1670 | Utf8JSONWriter Utf8JSONWriter `json:"Utf8JsonWriter"` |
| @@ -1676,6 +1688,14 @@ type UUID struct { | ||
| 1676 | 1688 | UUID int64 `json:"UUID"` |
| 1677 | 1689 | } |
| 1678 | 1690 | |
| 1691 | +type Unsigned struct { | |
| 1692 | + Unsigned int64 `json:"unsigned"` | |
| 1693 | +} | |
| 1694 | + | |
| 1695 | +type Ushort struct { | |
| 1696 | + Ushort int64 `json:"ushort"` | |
| 1697 | +} | |
| 1698 | + | |
| 1679 | 1699 | type Using struct { |
| 1680 | 1700 | Using int64 `json:"using"` |
| 1681 | 1701 | } |
Mhaskelldefault / QuickType.hs+167 −95
| @@ -122,18 +122,19 @@ module QuickType | ||
| 122 | 122 | , FormatException (..) |
| 123 | 123 | , Friend (..) |
| 124 | 124 | , From (..) |
| 125 | + , FromDict (..) | |
| 125 | 126 | , FromJSONClass (..) |
| 126 | 127 | , Func (..) |
| 127 | 128 | , Function (..) |
| 128 | 129 | , Get (..) |
| 129 | 130 | , Global (..) |
| 130 | 131 | , Go (..) |
| 131 | - , Goto (..) | |
| 132 | 132 | , Default (..) |
| 133 | 133 | , Do (..) |
| 134 | 134 | , Else (..) |
| 135 | 135 | , Obj2False (..) |
| 136 | 136 | , Obj3 (..) |
| 137 | + , Goto (..) | |
| 137 | 138 | , Guard (..) |
| 138 | 139 | , HasOwnProperty (..) |
| 139 | 140 | , HashCode (..) |
| @@ -181,6 +182,7 @@ module QuickType | ||
| 181 | 182 | , Long (..) |
| 182 | 183 | , MapClass (..) |
| 183 | 184 | , MapEntry (..) |
| 185 | + , MarshalJSON (..) | |
| 184 | 186 | , MetadataPropertyHandling (..) |
| 185 | 187 | , Mutable (..) |
| 186 | 188 | , Mutating (..) |
| @@ -190,7 +192,6 @@ module QuickType | ||
| 190 | 192 | , Newtonsoft (..) |
| 191 | 193 | , Nil (..) |
| 192 | 194 | , No (..) |
| 193 | - , Noexcept (..) | |
| 194 | 195 | , ID (..) |
| 195 | 196 | , If (..) |
| 196 | 197 | , Import (..) |
| @@ -200,6 +201,7 @@ module QuickType | ||
| 200 | 201 | , Module (..) |
| 201 | 202 | , Obj4 (..) |
| 202 | 203 | , NoSuchMethod (..) |
| 204 | + , Noexcept (..) | |
| 203 | 205 | , Nonatomic (..) |
| 204 | 206 | , None (..) |
| 205 | 207 | , Nonlocal (..) |
| @@ -262,7 +264,6 @@ module QuickType | ||
| 262 | 264 | , Sbyte (..) |
| 263 | 265 | , Sealed (..) |
| 264 | 266 | , Sel (..) |
| 265 | - , Select (..) | |
| 266 | 267 | , Obj5 (..) |
| 267 | 268 | , KSerializer (..) |
| 268 | 269 | , SelfClass (..) |
| @@ -271,6 +272,7 @@ module QuickType | ||
| 271 | 272 | , Type (..) |
| 272 | 273 | , PrimitiveKind (..) |
| 273 | 274 | , TypeClass (..) |
| 275 | + , Select (..) | |
| 274 | 276 | , Self (..) |
| 275 | 277 | , Sendable (..) |
| 276 | 278 | , SerialDescriptor (..) |
| @@ -307,6 +309,7 @@ module QuickType | ||
| 307 | 309 | , TimeOnly (..) |
| 308 | 310 | , TimeOnlyConverter (..) |
| 309 | 311 | , TimeZone (..) |
| 312 | + , ToDict (..) | |
| 310 | 313 | , ToJSONClass (..) |
| 311 | 314 | , ToString (..) |
| 312 | 315 | , TopLevel (..) |
| @@ -323,13 +326,14 @@ module QuickType | ||
| 323 | 326 | , Unchecked (..) |
| 324 | 327 | , Undefined (..) |
| 325 | 328 | , Union (..) |
| 329 | + , UnmarshalJSON (..) | |
| 326 | 330 | , Unowned (..) |
| 327 | 331 | , Unsafe (..) |
| 328 | - , Unsigned (..) | |
| 329 | 332 | , UseSerializers (..) |
| 330 | - , Ushort (..) | |
| 331 | 333 | , Obj6 (..) |
| 332 | 334 | , Where (..) |
| 335 | + , Unsigned (..) | |
| 336 | + , Ushort (..) | |
| 333 | 337 | , Using (..) |
| 334 | 338 | , Utf8JSONReader (..) |
| 335 | 339 | , Utf8JSONWriter (..) |
| @@ -746,13 +750,13 @@ data Obj2 = Obj2 | ||
| 746 | 750 | , formatExceptionObj2 :: FormatException |
| 747 | 751 | , friendObj2 :: Friend |
| 748 | 752 | , fromObj2 :: From |
| 753 | + , fromDictObj2 :: FromDict | |
| 749 | 754 | , fromJSONObj2 :: FromJSONClass |
| 750 | 755 | , funcObj2 :: Func |
| 751 | 756 | , functionObj2 :: Function |
| 752 | 757 | , getObj2 :: Get |
| 753 | 758 | , globalObj2 :: Global |
| 754 | 759 | , goObj2 :: Go |
| 755 | - , gotoObj2 :: Goto | |
| 756 | 760 | , obj2DefaultObj2 :: Default |
| 757 | 761 | , obj2DoObj2 :: Do |
| 758 | 762 | , obj2ElseObj2 :: Else |
| @@ -976,6 +980,10 @@ data From = From | ||
| 976 | 980 | { fromFrom :: Int |
| 977 | 981 | } deriving (Show) |
| 978 | 982 | |
| 983 | +data FromDict = FromDict | |
| 984 | + { fromDictFromDict :: Int | |
| 985 | + } deriving (Show) | |
| 986 | + | |
| 979 | 987 | data FromJSONClass = FromJSONClass |
| 980 | 988 | { fromJSONFromJSONClass :: Int |
| 981 | 989 | } deriving (Show) |
| @@ -1000,10 +1008,6 @@ data Go = Go | ||
| 1000 | 1008 | { goGo :: Int |
| 1001 | 1009 | } deriving (Show) |
| 1002 | 1010 | |
| 1003 | -data Goto = Goto | |
| 1004 | - { gotoGoto :: Int | |
| 1005 | - } deriving (Show) | |
| 1006 | - | |
| 1007 | 1011 | data Default = Default |
| 1008 | 1012 | { defaultDefaultDefault :: Int |
| 1009 | 1013 | } deriving (Show) |
| @@ -1022,6 +1026,7 @@ data Obj2False = Obj2False | ||
| 1022 | 1026 | |
| 1023 | 1027 | data Obj3 = Obj3 |
| 1024 | 1028 | { dummyObj3 :: Int |
| 1029 | + , gotoObj3 :: Goto | |
| 1025 | 1030 | , guardObj3 :: Guard |
| 1026 | 1031 | , hasOwnPropertyObj3 :: HasOwnProperty |
| 1027 | 1032 | , hashCodeObj3 :: HashCode |
| @@ -1069,6 +1074,7 @@ data Obj3 = Obj3 | ||
| 1069 | 1074 | , longObj3 :: Long |
| 1070 | 1075 | , mapObj3 :: MapClass |
| 1071 | 1076 | , mapEntryObj3 :: MapEntry |
| 1077 | + , marshalJSONObj3 :: MarshalJSON | |
| 1072 | 1078 | , metadataPropertyHandlingObj3 :: MetadataPropertyHandling |
| 1073 | 1079 | , mutableObj3 :: Mutable |
| 1074 | 1080 | , mutatingObj3 :: Mutating |
| @@ -1078,7 +1084,6 @@ data Obj3 = Obj3 | ||
| 1078 | 1084 | , newtonsoftObj3 :: Newtonsoft |
| 1079 | 1085 | , nilObj3 :: Nil |
| 1080 | 1086 | , noObj3 :: No |
| 1081 | - , noexceptObj3 :: Noexcept | |
| 1082 | 1087 | , obj3IDObj3 :: ID |
| 1083 | 1088 | , obj3IfObj3 :: If |
| 1084 | 1089 | , obj3ImportObj3 :: Import |
| @@ -1088,6 +1093,10 @@ data Obj3 = Obj3 | ||
| 1088 | 1093 | , obj3ModuleObj3 :: Module |
| 1089 | 1094 | } deriving (Show) |
| 1090 | 1095 | |
| 1096 | +data Goto = Goto | |
| 1097 | + { gotoGoto :: Int | |
| 1098 | + } deriving (Show) | |
| 1099 | + | |
| 1091 | 1100 | data Guard = Guard |
| 1092 | 1101 | { guardGuard :: Int |
| 1093 | 1102 | } deriving (Show) |
| @@ -1276,6 +1285,10 @@ data MapEntry = MapEntry | ||
| 1276 | 1285 | { mapEntryMapEntry :: Int |
| 1277 | 1286 | } deriving (Show) |
| 1278 | 1287 | |
| 1288 | +data MarshalJSON = MarshalJSON | |
| 1289 | + { marshalJSONMarshalJSON :: Int | |
| 1290 | + } deriving (Show) | |
| 1291 | + | |
| 1279 | 1292 | data MetadataPropertyHandling = MetadataPropertyHandling |
| 1280 | 1293 | { metadataPropertyHandlingMetadataPropertyHandling :: Int |
| 1281 | 1294 | } deriving (Show) |
| @@ -1312,10 +1325,6 @@ data No = No | ||
| 1312 | 1325 | { noNo :: Int |
| 1313 | 1326 | } deriving (Show) |
| 1314 | 1327 | |
| 1315 | -data Noexcept = Noexcept | |
| 1316 | - { noexceptNoexcept :: Int | |
| 1317 | - } deriving (Show) | |
| 1318 | - | |
| 1319 | 1328 | data ID = ID |
| 1320 | 1329 | { idIDID :: Int |
| 1321 | 1330 | } deriving (Show) |
| @@ -1347,6 +1356,7 @@ data Module = Module | ||
| 1347 | 1356 | data Obj4 = Obj4 |
| 1348 | 1357 | { dummyObj4 :: Int |
| 1349 | 1358 | , noSuchMethodObj4 :: NoSuchMethod |
| 1359 | + , noexceptObj4 :: Noexcept | |
| 1350 | 1360 | , nonatomicObj4 :: Nonatomic |
| 1351 | 1361 | , noneObj4 :: None |
| 1352 | 1362 | , nonlocalObj4 :: Nonlocal |
| @@ -1409,13 +1419,16 @@ data Obj4 = Obj4 | ||
| 1409 | 1419 | , sbyteObj4 :: Sbyte |
| 1410 | 1420 | , sealedObj4 :: Sealed |
| 1411 | 1421 | , selObj4 :: Sel |
| 1412 | - , selectObj4 :: Select | |
| 1413 | 1422 | } deriving (Show) |
| 1414 | 1423 | |
| 1415 | 1424 | data NoSuchMethod = NoSuchMethod |
| 1416 | 1425 | { noSuchMethodNoSuchMethod :: Int |
| 1417 | 1426 | } deriving (Show) |
| 1418 | 1427 | |
| 1428 | +data Noexcept = Noexcept | |
| 1429 | + { noexceptNoexcept :: Int | |
| 1430 | + } deriving (Show) | |
| 1431 | + | |
| 1419 | 1432 | data Nonatomic = Nonatomic |
| 1420 | 1433 | { nonatomicNonatomic :: Int |
| 1421 | 1434 | } deriving (Show) |
| @@ -1664,10 +1677,6 @@ data Sel = Sel | ||
| 1664 | 1677 | { selSel :: Int |
| 1665 | 1678 | } deriving (Show) |
| 1666 | 1679 | |
| 1667 | -data Select = Select | |
| 1668 | - { selectSelect :: Int | |
| 1669 | - } deriving (Show) | |
| 1670 | - | |
| 1671 | 1680 | data Obj5 = Obj5 |
| 1672 | 1681 | { dummyObj5 :: Int |
| 1673 | 1682 | , kSerializerObj5 :: KSerializer |
| @@ -1677,6 +1686,7 @@ data Obj5 = Obj5 | ||
| 1677 | 1686 | , obj5TypeObj5 :: Type |
| 1678 | 1687 | , primitiveKindObj5 :: PrimitiveKind |
| 1679 | 1688 | , purpleTypeObj5 :: TypeClass |
| 1689 | + , selectObj5 :: Select | |
| 1680 | 1690 | , selfObj5 :: Self |
| 1681 | 1691 | , sendableObj5 :: Sendable |
| 1682 | 1692 | , serialDescriptorObj5 :: SerialDescriptor |
| @@ -1713,6 +1723,7 @@ data Obj5 = Obj5 | ||
| 1713 | 1723 | , timeOnlyObj5 :: TimeOnly |
| 1714 | 1724 | , timeOnlyConverterObj5 :: TimeOnlyConverter |
| 1715 | 1725 | , timeZoneObj5 :: TimeZone |
| 1726 | + , toDictObj5 :: ToDict | |
| 1716 | 1727 | , toJSONObj5 :: ToJSONClass |
| 1717 | 1728 | , toStringObj5 :: ToString |
| 1718 | 1729 | , topLevelObj5 :: TopLevel |
| @@ -1729,11 +1740,10 @@ data Obj5 = Obj5 | ||
| 1729 | 1740 | , uncheckedObj5 :: Unchecked |
| 1730 | 1741 | , undefinedObj5 :: Undefined |
| 1731 | 1742 | , unionObj5 :: Union |
| 1743 | + , unmarshalJSONObj5 :: UnmarshalJSON | |
| 1732 | 1744 | , unownedObj5 :: Unowned |
| 1733 | 1745 | , unsafeObj5 :: Unsafe |
| 1734 | - , unsignedObj5 :: Unsigned | |
| 1735 | 1746 | , useSerializersObj5 :: UseSerializers |
| 1736 | - , ushortObj5 :: Ushort | |
| 1737 | 1747 | } deriving (Show) |
| 1738 | 1748 | |
| 1739 | 1749 | data KSerializer = KSerializer |
| @@ -1764,6 +1774,10 @@ data TypeClass = TypeClass | ||
| 1764 | 1774 | { typeTypeTypeClass :: Int |
| 1765 | 1775 | } deriving (Show) |
| 1766 | 1776 | |
| 1777 | +data Select = Select | |
| 1778 | + { selectSelect :: Int | |
| 1779 | + } deriving (Show) | |
| 1780 | + | |
| 1767 | 1781 | data Self = Self |
| 1768 | 1782 | { selfSelf :: Int |
| 1769 | 1783 | } deriving (Show) |
| @@ -1908,6 +1922,10 @@ data TimeZone = TimeZone | ||
| 1908 | 1922 | { timeZoneTimeZone :: Int |
| 1909 | 1923 | } deriving (Show) |
| 1910 | 1924 | |
| 1925 | +data ToDict = ToDict | |
| 1926 | + { toDictToDict :: Int | |
| 1927 | + } deriving (Show) | |
| 1928 | + | |
| 1911 | 1929 | data ToJSONClass = ToJSONClass |
| 1912 | 1930 | { toJSONToJSONClass :: Int |
| 1913 | 1931 | } deriving (Show) |
| @@ -1972,6 +1990,10 @@ data Union = Union | ||
| 1972 | 1990 | { unionUnion :: Int |
| 1973 | 1991 | } deriving (Show) |
| 1974 | 1992 | |
| 1993 | +data UnmarshalJSON = UnmarshalJSON | |
| 1994 | + { unmarshalJSONUnmarshalJSON :: Int | |
| 1995 | + } deriving (Show) | |
| 1996 | + | |
| 1975 | 1997 | data Unowned = Unowned |
| 1976 | 1998 | { unownedUnowned :: Int |
| 1977 | 1999 | } deriving (Show) |
| @@ -1980,21 +2002,15 @@ data Unsafe = Unsafe | ||
| 1980 | 2002 | { unsafeUnsafe :: Int |
| 1981 | 2003 | } deriving (Show) |
| 1982 | 2004 | |
| 1983 | -data Unsigned = Unsigned | |
| 1984 | - { unsignedUnsigned :: Int | |
| 1985 | - } deriving (Show) | |
| 1986 | - | |
| 1987 | 2005 | data UseSerializers = UseSerializers |
| 1988 | 2006 | { useSerializersUseSerializers :: Int |
| 1989 | 2007 | } deriving (Show) |
| 1990 | 2008 | |
| 1991 | -data Ushort = Ushort | |
| 1992 | - { ushortUshort :: Int | |
| 1993 | - } deriving (Show) | |
| 1994 | - | |
| 1995 | 2009 | data Obj6 = Obj6 |
| 1996 | 2010 | { dummyObj6 :: Int |
| 1997 | 2011 | , obj6WhereObj6 :: Where |
| 2012 | + , unsignedObj6 :: Unsigned | |
| 2013 | + , ushortObj6 :: Ushort | |
| 1998 | 2014 | , usingObj6 :: Using |
| 1999 | 2015 | , utf8JSONReaderObj6 :: Utf8JSONReader |
| 2000 | 2016 | , utf8JSONWriterObj6 :: Utf8JSONWriter |
| @@ -2018,6 +2034,14 @@ data Where = Where | ||
| 2018 | 2034 | { whereWhereWhere :: Int |
| 2019 | 2035 | } deriving (Show) |
| 2020 | 2036 | |
| 2037 | +data Unsigned = Unsigned | |
| 2038 | + { unsignedUnsigned :: Int | |
| 2039 | + } deriving (Show) | |
| 2040 | + | |
| 2041 | +data Ushort = Ushort | |
| 2042 | + { ushortUshort :: Int | |
| 2043 | + } deriving (Show) | |
| 2044 | + | |
| 2021 | 2045 | data Using = Using |
| 2022 | 2046 | { usingUsing :: Int |
| 2023 | 2047 | } deriving (Show) |
| @@ -2890,7 +2914,7 @@ instance FromJSON ClassClass where | ||
| 2890 | 2914 | <$> v .: "class" |
| 2891 | 2915 | |
| 2892 | 2916 | instance ToJSON Obj2 where |
| 2893 | - toJSON (Obj2 dateFormatterObj2 dateOnlyObj2 dateOnlyConverterObj2 dateParseHandlingObj2 dateTimeObj2 dateTimeStylesObj2 debuggerObj2 decimalObj2 declareObj2 decltypeObj2 decodeStringObj2 decoderObj2 decodingErrorObj2 defObj2 deferObj2 deinitObj2 delObj2 delegateObj2 deleteObj2 dictObj2 dictionaryObj2 didSetObj2 doubleObj2 dummyObj2 dynamicObj2 dynamicCastObj2 elifObj2 encodeQuickTypeObj2 encoderObj2 enumObj2 enumValuesObj2 equalityContractObj2 equatableObj2 eventObj2 exceptObj2 exceptionObj2 explicitObj2 exportObj2 exposingObj2 extendsObj2 extensionObj2 externObj2 fallthroughObj2 falseObj2 fileprivateObj2 finalObj2 finallyObj2 fixedObj2 floatObj2 forObj2 foreachObj2 formatExceptionObj2 friendObj2 fromObj2 fromJSONObj2 funcObj2 functionObj2 getObj2 globalObj2 goObj2 gotoObj2 obj2DefaultObj2 obj2DoObj2 obj2ElseObj2 obj2FalseObj2) = | |
| 2917 | + toJSON (Obj2 dateFormatterObj2 dateOnlyObj2 dateOnlyConverterObj2 dateParseHandlingObj2 dateTimeObj2 dateTimeStylesObj2 debuggerObj2 decimalObj2 declareObj2 decltypeObj2 decodeStringObj2 decoderObj2 decodingErrorObj2 defObj2 deferObj2 deinitObj2 delObj2 delegateObj2 deleteObj2 dictObj2 dictionaryObj2 didSetObj2 doubleObj2 dummyObj2 dynamicObj2 dynamicCastObj2 elifObj2 encodeQuickTypeObj2 encoderObj2 enumObj2 enumValuesObj2 equalityContractObj2 equatableObj2 eventObj2 exceptObj2 exceptionObj2 explicitObj2 exportObj2 exposingObj2 extendsObj2 extensionObj2 externObj2 fallthroughObj2 falseObj2 fileprivateObj2 finalObj2 finallyObj2 fixedObj2 floatObj2 forObj2 foreachObj2 formatExceptionObj2 friendObj2 fromObj2 fromDictObj2 fromJSONObj2 funcObj2 functionObj2 getObj2 globalObj2 goObj2 obj2DefaultObj2 obj2DoObj2 obj2ElseObj2 obj2FalseObj2) = | |
| 2894 | 2918 | object $ foldMap (maybe [] pure) |
| 2895 | 2919 | [ Just $ "DateFormatter" .= dateFormatterObj2 |
| 2896 | 2920 | , Just $ "DateOnly" .= dateOnlyObj2 |
| @@ -2946,13 +2970,13 @@ instance ToJSON Obj2 where | ||
| 2946 | 2970 | , Just $ "FormatException" .= formatExceptionObj2 |
| 2947 | 2971 | , Just $ "friend" .= friendObj2 |
| 2948 | 2972 | , Just $ "from" .= fromObj2 |
| 2973 | + , Just $ "from_dict" .= fromDictObj2 | |
| 2949 | 2974 | , Just $ "from_json" .= fromJSONObj2 |
| 2950 | 2975 | , Just $ "func" .= funcObj2 |
| 2951 | 2976 | , Just $ "function" .= functionObj2 |
| 2952 | 2977 | , Just $ "get" .= getObj2 |
| 2953 | 2978 | , Just $ "global" .= globalObj2 |
| 2954 | 2979 | , Just $ "go" .= goObj2 |
| 2955 | - , Just $ "goto" .= gotoObj2 | |
| 2956 | 2980 | , Just $ "default" .= obj2DefaultObj2 |
| 2957 | 2981 | , Just $ "do" .= obj2DoObj2 |
| 2958 | 2982 | , Just $ "else" .= obj2ElseObj2 |
| @@ -3015,13 +3039,13 @@ instance FromJSON Obj2 where | ||
| 3015 | 3039 | <*> v .: "FormatException" |
| 3016 | 3040 | <*> v .: "friend" |
| 3017 | 3041 | <*> v .: "from" |
| 3042 | + <*> v .: "from_dict" | |
| 3018 | 3043 | <*> v .: "from_json" |
| 3019 | 3044 | <*> v .: "func" |
| 3020 | 3045 | <*> v .: "function" |
| 3021 | 3046 | <*> v .: "get" |
| 3022 | 3047 | <*> v .: "global" |
| 3023 | 3048 | <*> v .: "go" |
| 3024 | - <*> v .: "goto" | |
| 3025 | 3049 | <*> v .: "default" |
| 3026 | 3050 | <*> v .: "do" |
| 3027 | 3051 | <*> v .: "else" |
| @@ -3567,6 +3591,16 @@ instance FromJSON From where | ||
| 3567 | 3591 | parseJSON (Object v) = From |
| 3568 | 3592 | <$> v .: "from" |
| 3569 | 3593 | |
| 3594 | +instance ToJSON FromDict where | |
| 3595 | + toJSON (FromDict fromDictFromDict) = | |
| 3596 | + object $ foldMap (maybe [] pure) | |
| 3597 | + [ Just $ "from_dict" .= fromDictFromDict | |
| 3598 | + ] | |
| 3599 | + | |
| 3600 | +instance FromJSON FromDict where | |
| 3601 | + parseJSON (Object v) = FromDict | |
| 3602 | + <$> v .: "from_dict" | |
| 3603 | + | |
| 3570 | 3604 | instance ToJSON FromJSONClass where |
| 3571 | 3605 | toJSON (FromJSONClass fromJSONFromJSONClass) = |
| 3572 | 3606 | object $ foldMap (maybe [] pure) |
| @@ -3627,16 +3661,6 @@ instance FromJSON Go where | ||
| 3627 | 3661 | parseJSON (Object v) = Go |
| 3628 | 3662 | <$> v .: "go" |
| 3629 | 3663 | |
| 3630 | -instance ToJSON Goto where | |
| 3631 | - toJSON (Goto gotoGoto) = | |
| 3632 | - object $ foldMap (maybe [] pure) | |
| 3633 | - [ Just $ "goto" .= gotoGoto | |
| 3634 | - ] | |
| 3635 | - | |
| 3636 | -instance FromJSON Goto where | |
| 3637 | - parseJSON (Object v) = Goto | |
| 3638 | - <$> v .: "goto" | |
| 3639 | - | |
| 3640 | 3664 | instance ToJSON Default where |
| 3641 | 3665 | toJSON (Default defaultDefaultDefault) = |
| 3642 | 3666 | object $ foldMap (maybe [] pure) |
| @@ -3678,9 +3702,10 @@ instance FromJSON Obj2False where | ||
| 3678 | 3702 | <$> v .: "false" |
| 3679 | 3703 | |
| 3680 | 3704 | instance ToJSON Obj3 where |
| 3681 | - toJSON (Obj3 dummyObj3 guardObj3 hasOwnPropertyObj3 hashCodeObj3 hashableObj3 hasherObj3 impObj3 implementsObj3 implicitObj3 indirectObj3 initObj3 inlineObj3 inoutObj3 instanceofObj3 intObj3 interfaceObj3 internalObj3 isObj3 isoDateTimeOffsetConverterObj3 iterableObj3 jdecObj3 jencObj3 jpipeObj3 jsonObj3 jsonAnyObj3 jsonCodingKeyObj3 jsonConverterObj3 jsonDecoderObj3 jsonEncoderObj3 jsonExceptionObj3 jsonGeneratorObj3 jsonNodeObj3 jsonNullObj3 jsonParserObj3 jsonReaderObj3 jsonSerializerObj3 jsonTokenObj3 jsonTokenTypeObj3 jsonWriterObj3 lambdaObj3 lazyObj3 leftObj3 listObj3 localeObj3 lockObj3 longObj3 mapObj3 mapEntryObj3 metadataPropertyHandlingObj3 mutableObj3 mutatingObj3 namespaceObj3 nativeObj3 newObj3 newtonsoftObj3 nilObj3 noObj3 noexceptObj3 obj3IDObj3 obj3IfObj3 obj3ImportObj3 obj3InObj3 obj3InfixObj3 obj3LetObj3 obj3ModuleObj3) = | |
| 3705 | + toJSON (Obj3 dummyObj3 gotoObj3 guardObj3 hasOwnPropertyObj3 hashCodeObj3 hashableObj3 hasherObj3 impObj3 implementsObj3 implicitObj3 indirectObj3 initObj3 inlineObj3 inoutObj3 instanceofObj3 intObj3 interfaceObj3 internalObj3 isObj3 isoDateTimeOffsetConverterObj3 iterableObj3 jdecObj3 jencObj3 jpipeObj3 jsonObj3 jsonAnyObj3 jsonCodingKeyObj3 jsonConverterObj3 jsonDecoderObj3 jsonEncoderObj3 jsonExceptionObj3 jsonGeneratorObj3 jsonNodeObj3 jsonNullObj3 jsonParserObj3 jsonReaderObj3 jsonSerializerObj3 jsonTokenObj3 jsonTokenTypeObj3 jsonWriterObj3 lambdaObj3 lazyObj3 leftObj3 listObj3 localeObj3 lockObj3 longObj3 mapObj3 mapEntryObj3 marshalJSONObj3 metadataPropertyHandlingObj3 mutableObj3 mutatingObj3 namespaceObj3 nativeObj3 newObj3 newtonsoftObj3 nilObj3 noObj3 obj3IDObj3 obj3IfObj3 obj3ImportObj3 obj3InObj3 obj3InfixObj3 obj3LetObj3 obj3ModuleObj3) = | |
| 3682 | 3706 | object $ foldMap (maybe [] pure) |
| 3683 | 3707 | [ Just $ "dummy" .= dummyObj3 |
| 3708 | + , Just $ "goto" .= gotoObj3 | |
| 3684 | 3709 | , Just $ "guard" .= guardObj3 |
| 3685 | 3710 | , Just $ "hasOwnProperty" .= hasOwnPropertyObj3 |
| 3686 | 3711 | , Just $ "hashCode" .= hashCodeObj3 |
| @@ -3728,6 +3753,7 @@ instance ToJSON Obj3 where | ||
| 3728 | 3753 | , Just $ "long" .= longObj3 |
| 3729 | 3754 | , Just $ "map" .= mapObj3 |
| 3730 | 3755 | , Just $ "MapEntry" .= mapEntryObj3 |
| 3756 | + , Just $ "MarshalJSON" .= marshalJSONObj3 | |
| 3731 | 3757 | , Just $ "metadata_property_handling" .= metadataPropertyHandlingObj3 |
| 3732 | 3758 | , Just $ "mutable" .= mutableObj3 |
| 3733 | 3759 | , Just $ "mutating" .= mutatingObj3 |
| @@ -3737,7 +3763,6 @@ instance ToJSON Obj3 where | ||
| 3737 | 3763 | , Just $ "newtonsoft" .= newtonsoftObj3 |
| 3738 | 3764 | , Just $ "nil" .= nilObj3 |
| 3739 | 3765 | , Just $ "NO" .= noObj3 |
| 3740 | - , Just $ "noexcept" .= noexceptObj3 | |
| 3741 | 3766 | , Just $ "id" .= obj3IDObj3 |
| 3742 | 3767 | , Just $ "if" .= obj3IfObj3 |
| 3743 | 3768 | , Just $ "import" .= obj3ImportObj3 |
| @@ -3750,6 +3775,7 @@ instance ToJSON Obj3 where | ||
| 3750 | 3775 | instance FromJSON Obj3 where |
| 3751 | 3776 | parseJSON (Object v) = Obj3 |
| 3752 | 3777 | <$> v .: "dummy" |
| 3778 | + <*> v .: "goto" | |
| 3753 | 3779 | <*> v .: "guard" |
| 3754 | 3780 | <*> v .: "hasOwnProperty" |
| 3755 | 3781 | <*> v .: "hashCode" |
| @@ -3797,6 +3823,7 @@ instance FromJSON Obj3 where | ||
| 3797 | 3823 | <*> v .: "long" |
| 3798 | 3824 | <*> v .: "map" |
| 3799 | 3825 | <*> v .: "MapEntry" |
| 3826 | + <*> v .: "MarshalJSON" | |
| 3800 | 3827 | <*> v .: "metadata_property_handling" |
| 3801 | 3828 | <*> v .: "mutable" |
| 3802 | 3829 | <*> v .: "mutating" |
| @@ -3806,7 +3833,6 @@ instance FromJSON Obj3 where | ||
| 3806 | 3833 | <*> v .: "newtonsoft" |
| 3807 | 3834 | <*> v .: "nil" |
| 3808 | 3835 | <*> v .: "NO" |
| 3809 | - <*> v .: "noexcept" | |
| 3810 | 3836 | <*> v .: "id" |
| 3811 | 3837 | <*> v .: "if" |
| 3812 | 3838 | <*> v .: "import" |
| @@ -3815,6 +3841,16 @@ instance FromJSON Obj3 where | ||
| 3815 | 3841 | <*> v .: "let" |
| 3816 | 3842 | <*> v .: "module" |
| 3817 | 3843 | |
| 3844 | +instance ToJSON Goto where | |
| 3845 | + toJSON (Goto gotoGoto) = | |
| 3846 | + object $ foldMap (maybe [] pure) | |
| 3847 | + [ Just $ "goto" .= gotoGoto | |
| 3848 | + ] | |
| 3849 | + | |
| 3850 | +instance FromJSON Goto where | |
| 3851 | + parseJSON (Object v) = Goto | |
| 3852 | + <$> v .: "goto" | |
| 3853 | + | |
| 3818 | 3854 | instance ToJSON Guard where |
| 3819 | 3855 | toJSON (Guard guardGuard) = |
| 3820 | 3856 | object $ foldMap (maybe [] pure) |
| @@ -4285,6 +4321,16 @@ instance FromJSON MapEntry where | ||
| 4285 | 4321 | parseJSON (Object v) = MapEntry |
| 4286 | 4322 | <$> v .: "MapEntry" |
| 4287 | 4323 | |
| 4324 | +instance ToJSON MarshalJSON where | |
| 4325 | + toJSON (MarshalJSON marshalJSONMarshalJSON) = | |
| 4326 | + object $ foldMap (maybe [] pure) | |
| 4327 | + [ Just $ "MarshalJSON" .= marshalJSONMarshalJSON | |
| 4328 | + ] | |
| 4329 | + | |
| 4330 | +instance FromJSON MarshalJSON where | |
| 4331 | + parseJSON (Object v) = MarshalJSON | |
| 4332 | + <$> v .: "MarshalJSON" | |
| 4333 | + | |
| 4288 | 4334 | instance ToJSON MetadataPropertyHandling where |
| 4289 | 4335 | toJSON (MetadataPropertyHandling metadataPropertyHandlingMetadataPropertyHandling) = |
| 4290 | 4336 | object $ foldMap (maybe [] pure) |
| @@ -4375,16 +4421,6 @@ instance FromJSON No where | ||
| 4375 | 4421 | parseJSON (Object v) = No |
| 4376 | 4422 | <$> v .: "NO" |
| 4377 | 4423 | |
| 4378 | -instance ToJSON Noexcept where | |
| 4379 | - toJSON (Noexcept noexceptNoexcept) = | |
| 4380 | - object $ foldMap (maybe [] pure) | |
| 4381 | - [ Just $ "noexcept" .= noexceptNoexcept | |
| 4382 | - ] | |
| 4383 | - | |
| 4384 | -instance FromJSON Noexcept where | |
| 4385 | - parseJSON (Object v) = Noexcept | |
| 4386 | - <$> v .: "noexcept" | |
| 4387 | - | |
| 4388 | 4424 | instance ToJSON ID where |
| 4389 | 4425 | toJSON (ID idIDID) = |
| 4390 | 4426 | object $ foldMap (maybe [] pure) |
| @@ -4456,10 +4492,11 @@ instance FromJSON Module where | ||
| 4456 | 4492 | <$> v .: "module" |
| 4457 | 4493 | |
| 4458 | 4494 | instance ToJSON Obj4 where |
| 4459 | - toJSON (Obj4 dummyObj4 noSuchMethodObj4 nonatomicObj4 noneObj4 nonlocalObj4 nonmutatingObj4 notObj4 notEqObj4 nsErrorObj4 nsObjectObj4 nsStringObj4 nullObj4 nullptrObj4 numberObj4 obj4NoneObj4 obj4NullObj4 obj4OfObj4 obj4ProtocolObj4 objectObj4 objectMapperObj4 onewayObj4 openObj4 operatorObj4 optionalObj4 orObj4 orEqObj4 outObj4 overrideObj4 packageObj4 paramsObj4 passObj4 portObj4 postfixObj4 precedenceObj4 prefixObj4 printObj4 printMembersObj4 printfObj4 privateObj4 protectedObj4 protocolObj4 publicObj4 quicktypeObj4 raiseObj4 rangeObj4 readonlyObj4 refObj4 regExpObj4 registerObj4 reinterpretCastObj4 repeatObj4 requireObj4 requiredObj4 requiresObj4 restrictObj4 retainObj4 rethrowsObj4 returnObj4 rightObj4 runtimeTypeObj4 sObj4 sbyteObj4 sealedObj4 selObj4 selectObj4) = | |
| 4495 | + toJSON (Obj4 dummyObj4 noSuchMethodObj4 noexceptObj4 nonatomicObj4 noneObj4 nonlocalObj4 nonmutatingObj4 notObj4 notEqObj4 nsErrorObj4 nsObjectObj4 nsStringObj4 nullObj4 nullptrObj4 numberObj4 obj4NoneObj4 obj4NullObj4 obj4OfObj4 obj4ProtocolObj4 objectObj4 objectMapperObj4 onewayObj4 openObj4 operatorObj4 optionalObj4 orObj4 orEqObj4 outObj4 overrideObj4 packageObj4 paramsObj4 passObj4 portObj4 postfixObj4 precedenceObj4 prefixObj4 printObj4 printMembersObj4 printfObj4 privateObj4 protectedObj4 protocolObj4 publicObj4 quicktypeObj4 raiseObj4 rangeObj4 readonlyObj4 refObj4 regExpObj4 registerObj4 reinterpretCastObj4 repeatObj4 requireObj4 requiredObj4 requiresObj4 restrictObj4 retainObj4 rethrowsObj4 returnObj4 rightObj4 runtimeTypeObj4 sObj4 sbyteObj4 sealedObj4 selObj4) = | |
| 4460 | 4496 | object $ foldMap (maybe [] pure) |
| 4461 | 4497 | [ Just $ "dummy" .= dummyObj4 |
| 4462 | 4498 | , Just $ "noSuchMethod" .= noSuchMethodObj4 |
| 4499 | + , Just $ "noexcept" .= noexceptObj4 | |
| 4463 | 4500 | , Just $ "nonatomic" .= nonatomicObj4 |
| 4464 | 4501 | , Just $ "None" .= noneObj4 |
| 4465 | 4502 | , Just $ "nonlocal" .= nonlocalObj4 |
| @@ -4522,13 +4559,13 @@ instance ToJSON Obj4 where | ||
| 4522 | 4559 | , Just $ "sbyte" .= sbyteObj4 |
| 4523 | 4560 | , Just $ "sealed" .= sealedObj4 |
| 4524 | 4561 | , Just $ "SEL" .= selObj4 |
| 4525 | - , Just $ "select" .= selectObj4 | |
| 4526 | 4562 | ] |
| 4527 | 4563 | |
| 4528 | 4564 | instance FromJSON Obj4 where |
| 4529 | 4565 | parseJSON (Object v) = Obj4 |
| 4530 | 4566 | <$> v .: "dummy" |
| 4531 | 4567 | <*> v .: "noSuchMethod" |
| 4568 | + <*> v .: "noexcept" | |
| 4532 | 4569 | <*> v .: "nonatomic" |
| 4533 | 4570 | <*> v .: "None" |
| 4534 | 4571 | <*> v .: "nonlocal" |
| @@ -4591,7 +4628,6 @@ instance FromJSON Obj4 where | ||
| 4591 | 4628 | <*> v .: "sbyte" |
| 4592 | 4629 | <*> v .: "sealed" |
| 4593 | 4630 | <*> v .: "SEL" |
| 4594 | - <*> v .: "select" | |
| 4595 | 4631 | |
| 4596 | 4632 | instance ToJSON NoSuchMethod where |
| 4597 | 4633 | toJSON (NoSuchMethod noSuchMethodNoSuchMethod) = |
| @@ -4603,6 +4639,16 @@ instance FromJSON NoSuchMethod where | ||
| 4603 | 4639 | parseJSON (Object v) = NoSuchMethod |
| 4604 | 4640 | <$> v .: "noSuchMethod" |
| 4605 | 4641 | |
| 4642 | +instance ToJSON Noexcept where | |
| 4643 | + toJSON (Noexcept noexceptNoexcept) = | |
| 4644 | + object $ foldMap (maybe [] pure) | |
| 4645 | + [ Just $ "noexcept" .= noexceptNoexcept | |
| 4646 | + ] | |
| 4647 | + | |
| 4648 | +instance FromJSON Noexcept where | |
| 4649 | + parseJSON (Object v) = Noexcept | |
| 4650 | + <$> v .: "noexcept" | |
| 4651 | + | |
| 4606 | 4652 | instance ToJSON Nonatomic where |
| 4607 | 4653 | toJSON (Nonatomic nonatomicNonatomic) = |
| 4608 | 4654 | object $ foldMap (maybe [] pure) |
| @@ -5223,18 +5269,8 @@ instance FromJSON Sel where | ||
| 5223 | 5269 | parseJSON (Object v) = Sel |
| 5224 | 5270 | <$> v .: "SEL" |
| 5225 | 5271 | |
| 5226 | -instance ToJSON Select where | |
| 5227 | - toJSON (Select selectSelect) = | |
| 5228 | - object $ foldMap (maybe [] pure) | |
| 5229 | - [ Just $ "select" .= selectSelect | |
| 5230 | - ] | |
| 5231 | - | |
| 5232 | -instance FromJSON Select where | |
| 5233 | - parseJSON (Object v) = Select | |
| 5234 | - <$> v .: "select" | |
| 5235 | - | |
| 5236 | 5272 | instance ToJSON Obj5 where |
| 5237 | - toJSON (Obj5 dummyObj5 kSerializerObj5 obj5SelfObj5 obj5ThenObj5 obj5TrueObj5 obj5TypeObj5 primitiveKindObj5 purpleTypeObj5 selfObj5 sendableObj5 serialDescriptorObj5 serialNameObj5 serializableObj5 serializeObj5 serializerProviderObj5 setObj5 shortObj5 signedObj5 simpleModuleObj5 sizeofObj5 stackallocObj5 standardsObj5 staticObj5 staticAssertObj5 staticCastObj5 stdDeserializerObj5 stdSerializerObj5 strictfpObj5 stringObj5 structObj5 subscriptObj5 superObj5 switchObj5 symbolObj5 synchronizedObj5 systemObj5 templateObj5 thisObj5 threadLocalObj5 throwObj5 throwsObj5 timeOnlyObj5 timeOnlyConverterObj5 timeZoneObj5 toJSONObj5 toStringObj5 topLevelObj5 transientObj5 trueObj5 tryObj5 typealiasObj5 typedefObj5 typeidObj5 typenameObj5 typeofObj5 uintObj5 ulongObj5 uncheckedObj5 undefinedObj5 unionObj5 unownedObj5 unsafeObj5 unsignedObj5 useSerializersObj5 ushortObj5) = | |
| 5273 | + toJSON (Obj5 dummyObj5 kSerializerObj5 obj5SelfObj5 obj5ThenObj5 obj5TrueObj5 obj5TypeObj5 primitiveKindObj5 purpleTypeObj5 selectObj5 selfObj5 sendableObj5 serialDescriptorObj5 serialNameObj5 serializableObj5 serializeObj5 serializerProviderObj5 setObj5 shortObj5 signedObj5 simpleModuleObj5 sizeofObj5 stackallocObj5 standardsObj5 staticObj5 staticAssertObj5 staticCastObj5 stdDeserializerObj5 stdSerializerObj5 strictfpObj5 stringObj5 structObj5 subscriptObj5 superObj5 switchObj5 symbolObj5 synchronizedObj5 systemObj5 templateObj5 thisObj5 threadLocalObj5 throwObj5 throwsObj5 timeOnlyObj5 timeOnlyConverterObj5 timeZoneObj5 toDictObj5 toJSONObj5 toStringObj5 topLevelObj5 transientObj5 trueObj5 tryObj5 typealiasObj5 typedefObj5 typeidObj5 typenameObj5 typeofObj5 uintObj5 ulongObj5 uncheckedObj5 undefinedObj5 unionObj5 unmarshalJSONObj5 unownedObj5 unsafeObj5 useSerializersObj5) = | |
| 5238 | 5274 | object $ foldMap (maybe [] pure) |
| 5239 | 5275 | [ Just $ "dummy" .= dummyObj5 |
| 5240 | 5276 | , Just $ "KSerializer" .= kSerializerObj5 |
| @@ -5244,6 +5280,7 @@ instance ToJSON Obj5 where | ||
| 5244 | 5280 | , Just $ "Type" .= obj5TypeObj5 |
| 5245 | 5281 | , Just $ "PrimitiveKind" .= primitiveKindObj5 |
| 5246 | 5282 | , Just $ "type" .= purpleTypeObj5 |
| 5283 | + , Just $ "select" .= selectObj5 | |
| 5247 | 5284 | , Just $ "Self" .= selfObj5 |
| 5248 | 5285 | , Just $ "Sendable" .= sendableObj5 |
| 5249 | 5286 | , Just $ "SerialDescriptor" .= serialDescriptorObj5 |
| @@ -5280,6 +5317,7 @@ instance ToJSON Obj5 where | ||
| 5280 | 5317 | , Just $ "TimeOnly" .= timeOnlyObj5 |
| 5281 | 5318 | , Just $ "TimeOnlyConverter" .= timeOnlyConverterObj5 |
| 5282 | 5319 | , Just $ "TimeZone" .= timeZoneObj5 |
| 5320 | + , Just $ "to_dict" .= toDictObj5 | |
| 5283 | 5321 | , Just $ "to_json" .= toJSONObj5 |
| 5284 | 5322 | , Just $ "toString" .= toStringObj5 |
| 5285 | 5323 | , Just $ "top_level" .= topLevelObj5 |
| @@ -5296,11 +5334,10 @@ instance ToJSON Obj5 where | ||
| 5296 | 5334 | , Just $ "unchecked" .= uncheckedObj5 |
| 5297 | 5335 | , Just $ "undefined" .= undefinedObj5 |
| 5298 | 5336 | , Just $ "union" .= unionObj5 |
| 5337 | + , Just $ "UnmarshalJSON" .= unmarshalJSONObj5 | |
| 5299 | 5338 | , Just $ "unowned" .= unownedObj5 |
| 5300 | 5339 | , Just $ "unsafe" .= unsafeObj5 |
| 5301 | - , Just $ "unsigned" .= unsignedObj5 | |
| 5302 | 5340 | , Just $ "UseSerializers" .= useSerializersObj5 |
| 5303 | - , Just $ "ushort" .= ushortObj5 | |
| 5304 | 5341 | ] |
| 5305 | 5342 | |
| 5306 | 5343 | instance FromJSON Obj5 where |
| @@ -5313,6 +5350,7 @@ instance FromJSON Obj5 where | ||
| 5313 | 5350 | <*> v .: "Type" |
| 5314 | 5351 | <*> v .: "PrimitiveKind" |
| 5315 | 5352 | <*> v .: "type" |
| 5353 | + <*> v .: "select" | |
| 5316 | 5354 | <*> v .: "Self" |
| 5317 | 5355 | <*> v .: "Sendable" |
| 5318 | 5356 | <*> v .: "SerialDescriptor" |
| @@ -5349,6 +5387,7 @@ instance FromJSON Obj5 where | ||
| 5349 | 5387 | <*> v .: "TimeOnly" |
| 5350 | 5388 | <*> v .: "TimeOnlyConverter" |
| 5351 | 5389 | <*> v .: "TimeZone" |
| 5390 | + <*> v .: "to_dict" | |
| 5352 | 5391 | <*> v .: "to_json" |
| 5353 | 5392 | <*> v .: "toString" |
| 5354 | 5393 | <*> v .: "top_level" |
| @@ -5365,11 +5404,10 @@ instance FromJSON Obj5 where | ||
| 5365 | 5404 | <*> v .: "unchecked" |
| 5366 | 5405 | <*> v .: "undefined" |
| 5367 | 5406 | <*> v .: "union" |
| 5407 | + <*> v .: "UnmarshalJSON" | |
| 5368 | 5408 | <*> v .: "unowned" |
| 5369 | 5409 | <*> v .: "unsafe" |
| 5370 | - <*> v .: "unsigned" | |
| 5371 | 5410 | <*> v .: "UseSerializers" |
| 5372 | - <*> v .: "ushort" | |
| 5373 | 5411 | |
| 5374 | 5412 | instance ToJSON KSerializer where |
| 5375 | 5413 | toJSON (KSerializer kSerializerKSerializer) = |
| @@ -5441,6 +5479,16 @@ instance FromJSON TypeClass where | ||
| 5441 | 5479 | parseJSON (Object v) = TypeClass |
| 5442 | 5480 | <$> v .: "type" |
| 5443 | 5481 | |
| 5482 | +instance ToJSON Select where | |
| 5483 | + toJSON (Select selectSelect) = | |
| 5484 | + object $ foldMap (maybe [] pure) | |
| 5485 | + [ Just $ "select" .= selectSelect | |
| 5486 | + ] | |
| 5487 | + | |
| 5488 | +instance FromJSON Select where | |
| 5489 | + parseJSON (Object v) = Select | |
| 5490 | + <$> v .: "select" | |
| 5491 | + | |
| 5444 | 5492 | instance ToJSON Self where |
| 5445 | 5493 | toJSON (Self selfSelf) = |
| 5446 | 5494 | object $ foldMap (maybe [] pure) |
| @@ -5801,6 +5849,16 @@ instance FromJSON TimeZone where | ||
| 5801 | 5849 | parseJSON (Object v) = TimeZone |
| 5802 | 5850 | <$> v .: "TimeZone" |
| 5803 | 5851 | |
| 5852 | +instance ToJSON ToDict where | |
| 5853 | + toJSON (ToDict toDictToDict) = | |
| 5854 | + object $ foldMap (maybe [] pure) | |
| 5855 | + [ Just $ "to_dict" .= toDictToDict | |
| 5856 | + ] | |
| 5857 | + | |
| 5858 | +instance FromJSON ToDict where | |
| 5859 | + parseJSON (Object v) = ToDict | |
| 5860 | + <$> v .: "to_dict" | |
| 5861 | + | |
| 5804 | 5862 | instance ToJSON ToJSONClass where |
| 5805 | 5863 | toJSON (ToJSONClass toJSONToJSONClass) = |
| 5806 | 5864 | object $ foldMap (maybe [] pure) |
| @@ -5961,6 +6019,16 @@ instance FromJSON Union where | ||
| 5961 | 6019 | parseJSON (Object v) = Union |
| 5962 | 6020 | <$> v .: "union" |
| 5963 | 6021 | |
| 6022 | +instance ToJSON UnmarshalJSON where | |
| 6023 | + toJSON (UnmarshalJSON unmarshalJSONUnmarshalJSON) = | |
| 6024 | + object $ foldMap (maybe [] pure) | |
| 6025 | + [ Just $ "UnmarshalJSON" .= unmarshalJSONUnmarshalJSON | |
| 6026 | + ] | |
| 6027 | + | |
| 6028 | +instance FromJSON UnmarshalJSON where | |
| 6029 | + parseJSON (Object v) = UnmarshalJSON | |
| 6030 | + <$> v .: "UnmarshalJSON" | |
| 6031 | + | |
| 5964 | 6032 | instance ToJSON Unowned where |
| 5965 | 6033 | toJSON (Unowned unownedUnowned) = |
| 5966 | 6034 | object $ foldMap (maybe [] pure) |
| @@ -5981,16 +6049,6 @@ instance FromJSON Unsafe where | ||
| 5981 | 6049 | parseJSON (Object v) = Unsafe |
| 5982 | 6050 | <$> v .: "unsafe" |
| 5983 | 6051 | |
| 5984 | -instance ToJSON Unsigned where | |
| 5985 | - toJSON (Unsigned unsignedUnsigned) = | |
| 5986 | - object $ foldMap (maybe [] pure) | |
| 5987 | - [ Just $ "unsigned" .= unsignedUnsigned | |
| 5988 | - ] | |
| 5989 | - | |
| 5990 | -instance FromJSON Unsigned where | |
| 5991 | - parseJSON (Object v) = Unsigned | |
| 5992 | - <$> v .: "unsigned" | |
| 5993 | - | |
| 5994 | 6052 | instance ToJSON UseSerializers where |
| 5995 | 6053 | toJSON (UseSerializers useSerializersUseSerializers) = |
| 5996 | 6054 | object $ foldMap (maybe [] pure) |
| @@ -6001,21 +6059,13 @@ instance FromJSON UseSerializers where | ||
| 6001 | 6059 | parseJSON (Object v) = UseSerializers |
| 6002 | 6060 | <$> v .: "UseSerializers" |
| 6003 | 6061 | |
| 6004 | -instance ToJSON Ushort where | |
| 6005 | - toJSON (Ushort ushortUshort) = | |
| 6006 | - object $ foldMap (maybe [] pure) | |
| 6007 | - [ Just $ "ushort" .= ushortUshort | |
| 6008 | - ] | |
| 6009 | - | |
| 6010 | -instance FromJSON Ushort where | |
| 6011 | - parseJSON (Object v) = Ushort | |
| 6012 | - <$> v .: "ushort" | |
| 6013 | - | |
| 6014 | 6062 | instance ToJSON Obj6 where |
| 6015 | - toJSON (Obj6 dummyObj6 obj6WhereObj6 usingObj6 utf8JSONReaderObj6 utf8JSONWriterObj6 uuidObj6 varObj6 virtualObj6 voidObj6 volatileObj6 wcharTObj6 weakObj6 whileObj6 willSetObj6 withObj6 xorObj6 xorEqObj6 yesObj6 yieldObj6) = | |
| 6063 | + toJSON (Obj6 dummyObj6 obj6WhereObj6 unsignedObj6 ushortObj6 usingObj6 utf8JSONReaderObj6 utf8JSONWriterObj6 uuidObj6 varObj6 virtualObj6 voidObj6 volatileObj6 wcharTObj6 weakObj6 whileObj6 willSetObj6 withObj6 xorObj6 xorEqObj6 yesObj6 yieldObj6) = | |
| 6016 | 6064 | object $ foldMap (maybe [] pure) |
| 6017 | 6065 | [ Just $ "dummy" .= dummyObj6 |
| 6018 | 6066 | , Just $ "where" .= obj6WhereObj6 |
| 6067 | + , Just $ "unsigned" .= unsignedObj6 | |
| 6068 | + , Just $ "ushort" .= ushortObj6 | |
| 6019 | 6069 | , Just $ "using" .= usingObj6 |
| 6020 | 6070 | , Just $ "Utf8JsonReader" .= utf8JSONReaderObj6 |
| 6021 | 6071 | , Just $ "Utf8JsonWriter" .= utf8JSONWriterObj6 |
| @@ -6039,6 +6089,8 @@ instance FromJSON Obj6 where | ||
| 6039 | 6089 | parseJSON (Object v) = Obj6 |
| 6040 | 6090 | <$> v .: "dummy" |
| 6041 | 6091 | <*> v .: "where" |
| 6092 | + <*> v .: "unsigned" | |
| 6093 | + <*> v .: "ushort" | |
| 6042 | 6094 | <*> v .: "using" |
| 6043 | 6095 | <*> v .: "Utf8JsonReader" |
| 6044 | 6096 | <*> v .: "Utf8JsonWriter" |
| @@ -6067,6 +6119,26 @@ instance FromJSON Where where | ||
| 6067 | 6119 | parseJSON (Object v) = Where |
| 6068 | 6120 | <$> v .: "where" |
| 6069 | 6121 | |
| 6122 | +instance ToJSON Unsigned where | |
| 6123 | + toJSON (Unsigned unsignedUnsigned) = | |
| 6124 | + object $ foldMap (maybe [] pure) | |
| 6125 | + [ Just $ "unsigned" .= unsignedUnsigned | |
| 6126 | + ] | |
| 6127 | + | |
| 6128 | +instance FromJSON Unsigned where | |
| 6129 | + parseJSON (Object v) = Unsigned | |
| 6130 | + <$> v .: "unsigned" | |
| 6131 | + | |
| 6132 | +instance ToJSON Ushort where | |
| 6133 | + toJSON (Ushort ushortUshort) = | |
| 6134 | + object $ foldMap (maybe [] pure) | |
| 6135 | + [ Just $ "ushort" .= ushortUshort | |
| 6136 | + ] | |
| 6137 | + | |
| 6138 | +instance FromJSON Ushort where | |
| 6139 | + parseJSON (Object v) = Ushort | |
| 6140 | + <$> v .: "ushort" | |
| 6141 | + | |
| 6070 | 6142 | instance ToJSON Using where |
| 6071 | 6143 | toJSON (Using usingUsing) = |
| 6072 | 6144 | object $ foldMap (maybe [] pure) |
Ajava-datetime-legacydefault / src / main / java / io / quicktype / FromDict.java+12 −0
| @@ -0,0 +1,12 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +public class FromDict { | |
| 6 | + private long fromDict; | |
| 7 | + | |
| 8 | + @JsonProperty("from_dict") | |
| 9 | + public long getFromDict() { return fromDict; } | |
| 10 | + @JsonProperty("from_dict") | |
| 11 | + public void setFromDict(long value) { this.fromDict = value; } | |
| 12 | +} |
Ajava-datetime-legacydefault / src / main / java / io / quicktype / MarshalJSON.java+12 −0
| @@ -0,0 +1,12 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +public class MarshalJSON { | |
| 6 | + private long marshalJSON; | |
| 7 | + | |
| 8 | + @JsonProperty("MarshalJSON") | |
| 9 | + public long getMarshalJSON() { return marshalJSON; } | |
| 10 | + @JsonProperty("MarshalJSON") | |
| 11 | + public void setMarshalJSON(long value) { this.marshalJSON = value; } | |
| 12 | +} |
Mjava-datetime-legacydefault / src / main / java / io / quicktype / Obj2.java+6 −6
| @@ -49,6 +49,7 @@ public class Obj2 { | ||
| 49 | 49 | private FormatException formatException; |
| 50 | 50 | private Friend friend; |
| 51 | 51 | private From from; |
| 52 | + private FromDict fromDict; | |
| 52 | 53 | private FromJSON fromJSON; |
| 53 | 54 | private Func func; |
| 54 | 55 | private Function function; |
| @@ -66,7 +67,6 @@ public class Obj2 { | ||
| 66 | 67 | private Finally obj2Finally; |
| 67 | 68 | private Float obj2Float; |
| 68 | 69 | private For obj2For; |
| 69 | - private Goto obj2Goto; | |
| 70 | 70 | private FalseClass purpleFalse; |
| 71 | 71 | |
| 72 | 72 | @JsonProperty("DateFormatter") |
| @@ -299,6 +299,11 @@ public class Obj2 { | ||
| 299 | 299 | @JsonProperty("from") |
| 300 | 300 | public void setFrom(From value) { this.from = value; } |
| 301 | 301 | |
| 302 | + @JsonProperty("from_dict") | |
| 303 | + public FromDict getFromDict() { return fromDict; } | |
| 304 | + @JsonProperty("from_dict") | |
| 305 | + public void setFromDict(FromDict value) { this.fromDict = value; } | |
| 306 | + | |
| 302 | 307 | @JsonProperty("from_json") |
| 303 | 308 | public FromJSON getFromJSON() { return fromJSON; } |
| 304 | 309 | @JsonProperty("from_json") |
| @@ -384,11 +389,6 @@ public class Obj2 { | ||
| 384 | 389 | @JsonProperty("for") |
| 385 | 390 | public void setObj2For(For value) { this.obj2For = value; } |
| 386 | 391 | |
| 387 | - @JsonProperty("goto") | |
| 388 | - public Goto getObj2Goto() { return obj2Goto; } | |
| 389 | - @JsonProperty("goto") | |
| 390 | - public void setObj2Goto(Goto value) { this.obj2Goto = value; } | |
| 391 | - | |
| 392 | 392 | @JsonProperty("false") |
| 393 | 393 | public FalseClass getPurpleFalse() { return purpleFalse; } |
| 394 | 394 | @JsonProperty("false") |
Mjava-datetime-legacydefault / src / main / java / io / quicktype / Obj3.java+11 −5
| @@ -50,6 +50,7 @@ public class Obj3 { | ||
| 50 | 50 | private Lock lock; |
| 51 | 51 | private MapClass map; |
| 52 | 52 | private MapEntry mapEntry; |
| 53 | + private MarshalJSON marshalJSON; | |
| 53 | 54 | private MetadataPropertyHandling metadataPropertyHandling; |
| 54 | 55 | private Module module; |
| 55 | 56 | private Mutable mutable; |
| @@ -58,7 +59,7 @@ public class Obj3 { | ||
| 58 | 59 | private Newtonsoft newtonsoft; |
| 59 | 60 | private Nil nil; |
| 60 | 61 | private No no; |
| 61 | - private Noexcept noexcept; | |
| 62 | + private Goto obj3Goto; | |
| 62 | 63 | private If obj3If; |
| 63 | 64 | private Implements obj3Implements; |
| 64 | 65 | private Import obj3Import; |
| @@ -304,6 +305,11 @@ public class Obj3 { | ||
| 304 | 305 | @JsonProperty("MapEntry") |
| 305 | 306 | public void setMapEntry(MapEntry value) { this.mapEntry = value; } |
| 306 | 307 | |
| 308 | + @JsonProperty("MarshalJSON") | |
| 309 | + public MarshalJSON getMarshalJSON() { return marshalJSON; } | |
| 310 | + @JsonProperty("MarshalJSON") | |
| 311 | + public void setMarshalJSON(MarshalJSON value) { this.marshalJSON = value; } | |
| 312 | + | |
| 307 | 313 | @JsonProperty("metadata_property_handling") |
| 308 | 314 | public MetadataPropertyHandling getMetadataPropertyHandling() { return metadataPropertyHandling; } |
| 309 | 315 | @JsonProperty("metadata_property_handling") |
| @@ -344,10 +350,10 @@ public class Obj3 { | ||
| 344 | 350 | @JsonProperty("NO") |
| 345 | 351 | public void setNo(No value) { this.no = value; } |
| 346 | 352 | |
| 347 | - @JsonProperty("noexcept") | |
| 348 | - public Noexcept getNoexcept() { return noexcept; } | |
| 349 | - @JsonProperty("noexcept") | |
| 350 | - public void setNoexcept(Noexcept value) { this.noexcept = value; } | |
| 353 | + @JsonProperty("goto") | |
| 354 | + public Goto getObj3Goto() { return obj3Goto; } | |
| 355 | + @JsonProperty("goto") | |
| 356 | + public void setObj3Goto(Goto value) { this.obj3Goto = value; } | |
| 351 | 357 | |
| 352 | 358 | @JsonProperty("if") |
| 353 | 359 | public If getObj3If() { return obj3If; } |
Mjava-datetime-legacydefault / src / main / java / io / quicktype / Obj4.java+6 −6
| @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.*; | ||
| 5 | 5 | public class Obj4 { |
| 6 | 6 | private long dummy; |
| 7 | 7 | private NoSuchMethod noSuchMethod; |
| 8 | + private Noexcept noexcept; | |
| 8 | 9 | private Nonatomic nonatomic; |
| 9 | 10 | private NoneClass none; |
| 10 | 11 | private Nonlocal nonlocal; |
| @@ -67,7 +68,6 @@ public class Obj4 { | ||
| 67 | 68 | private Sbyte sbyte; |
| 68 | 69 | private Sealed sealed; |
| 69 | 70 | private Sel sel; |
| 70 | - private Select select; | |
| 71 | 71 | |
| 72 | 72 | @JsonProperty("dummy") |
| 73 | 73 | public long getDummy() { return dummy; } |
| @@ -79,6 +79,11 @@ public class Obj4 { | ||
| 79 | 79 | @JsonProperty("noSuchMethod") |
| 80 | 80 | public void setNoSuchMethod(NoSuchMethod value) { this.noSuchMethod = value; } |
| 81 | 81 | |
| 82 | + @JsonProperty("noexcept") | |
| 83 | + public Noexcept getNoexcept() { return noexcept; } | |
| 84 | + @JsonProperty("noexcept") | |
| 85 | + public void setNoexcept(Noexcept value) { this.noexcept = value; } | |
| 86 | + | |
| 82 | 87 | @JsonProperty("nonatomic") |
| 83 | 88 | public Nonatomic getNonatomic() { return nonatomic; } |
| 84 | 89 | @JsonProperty("nonatomic") |
| @@ -388,9 +393,4 @@ public class Obj4 { | ||
| 388 | 393 | public Sel getSel() { return sel; } |
| 389 | 394 | @JsonProperty("SEL") |
| 390 | 395 | public void setSel(Sel value) { this.sel = value; } |
| 391 | - | |
| 392 | - @JsonProperty("select") | |
| 393 | - public Select getSelect() { return select; } | |
| 394 | - @JsonProperty("select") | |
| 395 | - public void setSelect(Select value) { this.select = value; } | |
| 396 | 396 | } |
Mjava-datetime-legacydefault / src / main / java / io / quicktype / Obj5.java+18 −12
| @@ -21,6 +21,7 @@ public class Obj5 { | ||
| 21 | 21 | private TypeClass obj5Type; |
| 22 | 22 | private PrimitiveKind primitiveKind; |
| 23 | 23 | private TrueClass purpleTrue; |
| 24 | + private Select select; | |
| 24 | 25 | private Self self; |
| 25 | 26 | private Sendable sendable; |
| 26 | 27 | private SerialDescriptor serialDescriptor; |
| @@ -49,6 +50,7 @@ public class Obj5 { | ||
| 49 | 50 | private TimeOnly timeOnly; |
| 50 | 51 | private TimeOnlyConverter timeOnlyConverter; |
| 51 | 52 | private TimeZone timeZone; |
| 53 | + private ToDict toDict; | |
| 52 | 54 | private ToJSON toJSON; |
| 53 | 55 | private ToString toString; |
| 54 | 56 | private TopLevelClass topLevel; |
| @@ -63,11 +65,10 @@ public class Obj5 { | ||
| 63 | 65 | private Unchecked unchecked; |
| 64 | 66 | private Undefined undefined; |
| 65 | 67 | private Union union; |
| 68 | + private UnmarshalJSON unmarshalJSON; | |
| 66 | 69 | private Unowned unowned; |
| 67 | 70 | private Unsafe unsafe; |
| 68 | - private Unsigned unsigned; | |
| 69 | 71 | private UseSerializers useSerializers; |
| 70 | - private Ushort ushort; | |
| 71 | 72 | |
| 72 | 73 | @JsonProperty("dummy") |
| 73 | 74 | public long getDummy() { return dummy; } |
| @@ -159,6 +160,11 @@ public class Obj5 { | ||
| 159 | 160 | @JsonProperty("true") |
| 160 | 161 | public void setPurpleTrue(TrueClass value) { this.purpleTrue = value; } |
| 161 | 162 | |
| 163 | + @JsonProperty("select") | |
| 164 | + public Select getSelect() { return select; } | |
| 165 | + @JsonProperty("select") | |
| 166 | + public void setSelect(Select value) { this.select = value; } | |
| 167 | + | |
| 162 | 168 | @JsonProperty("Self") |
| 163 | 169 | public Self getSelf() { return self; } |
| 164 | 170 | @JsonProperty("Self") |
| @@ -299,6 +305,11 @@ public class Obj5 { | ||
| 299 | 305 | @JsonProperty("TimeZone") |
| 300 | 306 | public void setTimeZone(TimeZone value) { this.timeZone = value; } |
| 301 | 307 | |
| 308 | + @JsonProperty("to_dict") | |
| 309 | + public ToDict getToDict() { return toDict; } | |
| 310 | + @JsonProperty("to_dict") | |
| 311 | + public void setToDict(ToDict value) { this.toDict = value; } | |
| 312 | + | |
| 302 | 313 | @JsonProperty("to_json") |
| 303 | 314 | public ToJSON getToJSON() { return toJSON; } |
| 304 | 315 | @JsonProperty("to_json") |
| @@ -369,6 +380,11 @@ public class Obj5 { | ||
| 369 | 380 | @JsonProperty("union") |
| 370 | 381 | public void setUnion(Union value) { this.union = value; } |
| 371 | 382 | |
| 383 | + @JsonProperty("UnmarshalJSON") | |
| 384 | + public UnmarshalJSON getUnmarshalJSON() { return unmarshalJSON; } | |
| 385 | + @JsonProperty("UnmarshalJSON") | |
| 386 | + public void setUnmarshalJSON(UnmarshalJSON value) { this.unmarshalJSON = value; } | |
| 387 | + | |
| 372 | 388 | @JsonProperty("unowned") |
| 373 | 389 | public Unowned getUnowned() { return unowned; } |
| 374 | 390 | @JsonProperty("unowned") |
| @@ -379,18 +395,8 @@ public class Obj5 { | ||
| 379 | 395 | @JsonProperty("unsafe") |
| 380 | 396 | public void setUnsafe(Unsafe value) { this.unsafe = value; } |
| 381 | 397 | |
| 382 | - @JsonProperty("unsigned") | |
| 383 | - public Unsigned getUnsigned() { return unsigned; } | |
| 384 | - @JsonProperty("unsigned") | |
| 385 | - public void setUnsigned(Unsigned value) { this.unsigned = value; } | |
| 386 | - | |
| 387 | 398 | @JsonProperty("UseSerializers") |
| 388 | 399 | public UseSerializers getUseSerializers() { return useSerializers; } |
| 389 | 400 | @JsonProperty("UseSerializers") |
| 390 | 401 | public void setUseSerializers(UseSerializers value) { this.useSerializers = value; } |
| 391 | - | |
| 392 | - @JsonProperty("ushort") | |
| 393 | - public Ushort getUshort() { return ushort; } | |
| 394 | - @JsonProperty("ushort") | |
| 395 | - public void setUshort(Ushort value) { this.ushort = value; } | |
| 396 | 402 | } |
Mjava-datetime-legacydefault / src / main / java / io / quicktype / Obj6.java+12 −0
| @@ -7,6 +7,8 @@ public class Obj6 { | ||
| 7 | 7 | private Void obj6Void; |
| 8 | 8 | private Volatile obj6Volatile; |
| 9 | 9 | private While obj6While; |
| 10 | + private Unsigned unsigned; | |
| 11 | + private Ushort ushort; | |
| 10 | 12 | private Using using; |
| 11 | 13 | private Utf8JSONReader utf8JSONReader; |
| 12 | 14 | private Utf8JSONWriter utf8JSONWriter; |
| @@ -43,6 +45,16 @@ public class Obj6 { | ||
| 43 | 45 | @JsonProperty("while") |
| 44 | 46 | public void setObj6While(While value) { this.obj6While = value; } |
| 45 | 47 | |
| 48 | + @JsonProperty("unsigned") | |
| 49 | + public Unsigned getUnsigned() { return unsigned; } | |
| 50 | + @JsonProperty("unsigned") | |
| 51 | + public void setUnsigned(Unsigned value) { this.unsigned = value; } | |
| 52 | + | |
| 53 | + @JsonProperty("ushort") | |
| 54 | + public Ushort getUshort() { return ushort; } | |
| 55 | + @JsonProperty("ushort") | |
| 56 | + public void setUshort(Ushort value) { this.ushort = value; } | |
| 57 | + | |
| 46 | 58 | @JsonProperty("using") |
| 47 | 59 | public Using getUsing() { return using; } |
| 48 | 60 | @JsonProperty("using") |
Ajava-datetime-legacydefault / src / main / java / io / quicktype / ToDict.java+12 −0
| @@ -0,0 +1,12 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +public class ToDict { | |
| 6 | + private long toDict; | |
| 7 | + | |
| 8 | + @JsonProperty("to_dict") | |
| 9 | + public long getToDict() { return toDict; } | |
| 10 | + @JsonProperty("to_dict") | |
| 11 | + public void setToDict(long value) { this.toDict = value; } | |
| 12 | +} |
Ajava-datetime-legacydefault / src / main / java / io / quicktype / UnmarshalJSON.java+12 −0
| @@ -0,0 +1,12 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +public class UnmarshalJSON { | |
| 6 | + private long unmarshalJSON; | |
| 7 | + | |
| 8 | + @JsonProperty("UnmarshalJSON") | |
| 9 | + public long getUnmarshalJSON() { return unmarshalJSON; } | |
| 10 | + @JsonProperty("UnmarshalJSON") | |
| 11 | + public void setUnmarshalJSON(long value) { this.unmarshalJSON = value; } | |
| 12 | +} |
Ajava-lombokdefault / src / main / java / io / quicktype / FromDict.java+12 −0
| @@ -0,0 +1,12 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +public class FromDict { | |
| 6 | + private long fromDict; | |
| 7 | + | |
| 8 | + @JsonProperty("from_dict") | |
| 9 | + public long getFromDict() { return fromDict; } | |
| 10 | + @JsonProperty("from_dict") | |
| 11 | + public void setFromDict(long value) { this.fromDict = value; } | |
| 12 | +} |
Ajava-lombokdefault / src / main / java / io / quicktype / MarshalJSON.java+12 −0
| @@ -0,0 +1,12 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +public class MarshalJSON { | |
| 6 | + private long marshalJSON; | |
| 7 | + | |
| 8 | + @JsonProperty("MarshalJSON") | |
| 9 | + public long getMarshalJSON() { return marshalJSON; } | |
| 10 | + @JsonProperty("MarshalJSON") | |
| 11 | + public void setMarshalJSON(long value) { this.marshalJSON = value; } | |
| 12 | +} |
Mjava-lombokdefault / src / main / java / io / quicktype / Obj2.java+6 −6
| @@ -49,6 +49,7 @@ public class Obj2 { | ||
| 49 | 49 | private FormatException formatException; |
| 50 | 50 | private Friend friend; |
| 51 | 51 | private From from; |
| 52 | + private FromDict fromDict; | |
| 52 | 53 | private FromJSON fromJSON; |
| 53 | 54 | private Func func; |
| 54 | 55 | private Function function; |
| @@ -66,7 +67,6 @@ public class Obj2 { | ||
| 66 | 67 | private Finally obj2Finally; |
| 67 | 68 | private Float obj2Float; |
| 68 | 69 | private For obj2For; |
| 69 | - private Goto obj2Goto; | |
| 70 | 70 | private FalseClass purpleFalse; |
| 71 | 71 | |
| 72 | 72 | @JsonProperty("DateFormatter") |
| @@ -299,6 +299,11 @@ public class Obj2 { | ||
| 299 | 299 | @JsonProperty("from") |
| 300 | 300 | public void setFrom(From value) { this.from = value; } |
| 301 | 301 | |
| 302 | + @JsonProperty("from_dict") | |
| 303 | + public FromDict getFromDict() { return fromDict; } | |
| 304 | + @JsonProperty("from_dict") | |
| 305 | + public void setFromDict(FromDict value) { this.fromDict = value; } | |
| 306 | + | |
| 302 | 307 | @JsonProperty("from_json") |
| 303 | 308 | public FromJSON getFromJSON() { return fromJSON; } |
| 304 | 309 | @JsonProperty("from_json") |
| @@ -384,11 +389,6 @@ public class Obj2 { | ||
| 384 | 389 | @JsonProperty("for") |
| 385 | 390 | public void setObj2For(For value) { this.obj2For = value; } |
| 386 | 391 | |
| 387 | - @JsonProperty("goto") | |
| 388 | - public Goto getObj2Goto() { return obj2Goto; } | |
| 389 | - @JsonProperty("goto") | |
| 390 | - public void setObj2Goto(Goto value) { this.obj2Goto = value; } | |
| 391 | - | |
| 392 | 392 | @JsonProperty("false") |
| 393 | 393 | public FalseClass getPurpleFalse() { return purpleFalse; } |
| 394 | 394 | @JsonProperty("false") |
Mjava-lombokdefault / src / main / java / io / quicktype / Obj3.java+11 −5
| @@ -50,6 +50,7 @@ public class Obj3 { | ||
| 50 | 50 | private Lock lock; |
| 51 | 51 | private MapClass map; |
| 52 | 52 | private MapEntry mapEntry; |
| 53 | + private MarshalJSON marshalJSON; | |
| 53 | 54 | private MetadataPropertyHandling metadataPropertyHandling; |
| 54 | 55 | private Module module; |
| 55 | 56 | private Mutable mutable; |
| @@ -58,7 +59,7 @@ public class Obj3 { | ||
| 58 | 59 | private Newtonsoft newtonsoft; |
| 59 | 60 | private Nil nil; |
| 60 | 61 | private No no; |
| 61 | - private Noexcept noexcept; | |
| 62 | + private Goto obj3Goto; | |
| 62 | 63 | private If obj3If; |
| 63 | 64 | private Implements obj3Implements; |
| 64 | 65 | private Import obj3Import; |
| @@ -304,6 +305,11 @@ public class Obj3 { | ||
| 304 | 305 | @JsonProperty("MapEntry") |
| 305 | 306 | public void setMapEntry(MapEntry value) { this.mapEntry = value; } |
| 306 | 307 | |
| 308 | + @JsonProperty("MarshalJSON") | |
| 309 | + public MarshalJSON getMarshalJSON() { return marshalJSON; } | |
| 310 | + @JsonProperty("MarshalJSON") | |
| 311 | + public void setMarshalJSON(MarshalJSON value) { this.marshalJSON = value; } | |
| 312 | + | |
| 307 | 313 | @JsonProperty("metadata_property_handling") |
| 308 | 314 | public MetadataPropertyHandling getMetadataPropertyHandling() { return metadataPropertyHandling; } |
| 309 | 315 | @JsonProperty("metadata_property_handling") |
| @@ -344,10 +350,10 @@ public class Obj3 { | ||
| 344 | 350 | @JsonProperty("NO") |
| 345 | 351 | public void setNo(No value) { this.no = value; } |
| 346 | 352 | |
| 347 | - @JsonProperty("noexcept") | |
| 348 | - public Noexcept getNoexcept() { return noexcept; } | |
| 349 | - @JsonProperty("noexcept") | |
| 350 | - public void setNoexcept(Noexcept value) { this.noexcept = value; } | |
| 353 | + @JsonProperty("goto") | |
| 354 | + public Goto getObj3Goto() { return obj3Goto; } | |
| 355 | + @JsonProperty("goto") | |
| 356 | + public void setObj3Goto(Goto value) { this.obj3Goto = value; } | |
| 351 | 357 | |
| 352 | 358 | @JsonProperty("if") |
| 353 | 359 | public If getObj3If() { return obj3If; } |
Mjava-lombokdefault / src / main / java / io / quicktype / Obj4.java+6 −6
| @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.*; | ||
| 5 | 5 | public class Obj4 { |
| 6 | 6 | private long dummy; |
| 7 | 7 | private NoSuchMethod noSuchMethod; |
| 8 | + private Noexcept noexcept; | |
| 8 | 9 | private Nonatomic nonatomic; |
| 9 | 10 | private NoneClass none; |
| 10 | 11 | private Nonlocal nonlocal; |
| @@ -67,7 +68,6 @@ public class Obj4 { | ||
| 67 | 68 | private Sbyte sbyte; |
| 68 | 69 | private Sealed sealed; |
| 69 | 70 | private Sel sel; |
| 70 | - private Select select; | |
| 71 | 71 | |
| 72 | 72 | @JsonProperty("dummy") |
| 73 | 73 | public long getDummy() { return dummy; } |
| @@ -79,6 +79,11 @@ public class Obj4 { | ||
| 79 | 79 | @JsonProperty("noSuchMethod") |
| 80 | 80 | public void setNoSuchMethod(NoSuchMethod value) { this.noSuchMethod = value; } |
| 81 | 81 | |
| 82 | + @JsonProperty("noexcept") | |
| 83 | + public Noexcept getNoexcept() { return noexcept; } | |
| 84 | + @JsonProperty("noexcept") | |
| 85 | + public void setNoexcept(Noexcept value) { this.noexcept = value; } | |
| 86 | + | |
| 82 | 87 | @JsonProperty("nonatomic") |
| 83 | 88 | public Nonatomic getNonatomic() { return nonatomic; } |
| 84 | 89 | @JsonProperty("nonatomic") |
| @@ -388,9 +393,4 @@ public class Obj4 { | ||
| 388 | 393 | public Sel getSel() { return sel; } |
| 389 | 394 | @JsonProperty("SEL") |
| 390 | 395 | public void setSel(Sel value) { this.sel = value; } |
| 391 | - | |
| 392 | - @JsonProperty("select") | |
| 393 | - public Select getSelect() { return select; } | |
| 394 | - @JsonProperty("select") | |
| 395 | - public void setSelect(Select value) { this.select = value; } | |
| 396 | 396 | } |
Mjava-lombokdefault / src / main / java / io / quicktype / Obj5.java+18 −12
| @@ -21,6 +21,7 @@ public class Obj5 { | ||
| 21 | 21 | private TypeClass obj5Type; |
| 22 | 22 | private PrimitiveKind primitiveKind; |
| 23 | 23 | private TrueClass purpleTrue; |
| 24 | + private Select select; | |
| 24 | 25 | private Self self; |
| 25 | 26 | private Sendable sendable; |
| 26 | 27 | private SerialDescriptor serialDescriptor; |
| @@ -49,6 +50,7 @@ public class Obj5 { | ||
| 49 | 50 | private TimeOnly timeOnly; |
| 50 | 51 | private TimeOnlyConverter timeOnlyConverter; |
| 51 | 52 | private TimeZone timeZone; |
| 53 | + private ToDict toDict; | |
| 52 | 54 | private ToJSON toJSON; |
| 53 | 55 | private ToString toString; |
| 54 | 56 | private TopLevelClass topLevel; |
| @@ -63,11 +65,10 @@ public class Obj5 { | ||
| 63 | 65 | private Unchecked unchecked; |
| 64 | 66 | private Undefined undefined; |
| 65 | 67 | private Union union; |
| 68 | + private UnmarshalJSON unmarshalJSON; | |
| 66 | 69 | private Unowned unowned; |
| 67 | 70 | private Unsafe unsafe; |
| 68 | - private Unsigned unsigned; | |
| 69 | 71 | private UseSerializers useSerializers; |
| 70 | - private Ushort ushort; | |
| 71 | 72 | |
| 72 | 73 | @JsonProperty("dummy") |
| 73 | 74 | public long getDummy() { return dummy; } |
| @@ -159,6 +160,11 @@ public class Obj5 { | ||
| 159 | 160 | @JsonProperty("true") |
| 160 | 161 | public void setPurpleTrue(TrueClass value) { this.purpleTrue = value; } |
| 161 | 162 | |
| 163 | + @JsonProperty("select") | |
| 164 | + public Select getSelect() { return select; } | |
| 165 | + @JsonProperty("select") | |
| 166 | + public void setSelect(Select value) { this.select = value; } | |
| 167 | + | |
| 162 | 168 | @JsonProperty("Self") |
| 163 | 169 | public Self getSelf() { return self; } |
| 164 | 170 | @JsonProperty("Self") |
| @@ -299,6 +305,11 @@ public class Obj5 { | ||
| 299 | 305 | @JsonProperty("TimeZone") |
| 300 | 306 | public void setTimeZone(TimeZone value) { this.timeZone = value; } |
| 301 | 307 | |
| 308 | + @JsonProperty("to_dict") | |
| 309 | + public ToDict getToDict() { return toDict; } | |
| 310 | + @JsonProperty("to_dict") | |
| 311 | + public void setToDict(ToDict value) { this.toDict = value; } | |
| 312 | + | |
| 302 | 313 | @JsonProperty("to_json") |
| 303 | 314 | public ToJSON getToJSON() { return toJSON; } |
| 304 | 315 | @JsonProperty("to_json") |
| @@ -369,6 +380,11 @@ public class Obj5 { | ||
| 369 | 380 | @JsonProperty("union") |
| 370 | 381 | public void setUnion(Union value) { this.union = value; } |
| 371 | 382 | |
| 383 | + @JsonProperty("UnmarshalJSON") | |
| 384 | + public UnmarshalJSON getUnmarshalJSON() { return unmarshalJSON; } | |
| 385 | + @JsonProperty("UnmarshalJSON") | |
| 386 | + public void setUnmarshalJSON(UnmarshalJSON value) { this.unmarshalJSON = value; } | |
| 387 | + | |
| 372 | 388 | @JsonProperty("unowned") |
| 373 | 389 | public Unowned getUnowned() { return unowned; } |
| 374 | 390 | @JsonProperty("unowned") |
| @@ -379,18 +395,8 @@ public class Obj5 { | ||
| 379 | 395 | @JsonProperty("unsafe") |
| 380 | 396 | public void setUnsafe(Unsafe value) { this.unsafe = value; } |
| 381 | 397 | |
| 382 | - @JsonProperty("unsigned") | |
| 383 | - public Unsigned getUnsigned() { return unsigned; } | |
| 384 | - @JsonProperty("unsigned") | |
| 385 | - public void setUnsigned(Unsigned value) { this.unsigned = value; } | |
| 386 | - | |
| 387 | 398 | @JsonProperty("UseSerializers") |
| 388 | 399 | public UseSerializers getUseSerializers() { return useSerializers; } |
| 389 | 400 | @JsonProperty("UseSerializers") |
| 390 | 401 | public void setUseSerializers(UseSerializers value) { this.useSerializers = value; } |
| 391 | - | |
| 392 | - @JsonProperty("ushort") | |
| 393 | - public Ushort getUshort() { return ushort; } | |
| 394 | - @JsonProperty("ushort") | |
| 395 | - public void setUshort(Ushort value) { this.ushort = value; } | |
| 396 | 402 | } |
Mjava-lombokdefault / src / main / java / io / quicktype / Obj6.java+12 −0
| @@ -7,6 +7,8 @@ public class Obj6 { | ||
| 7 | 7 | private Void obj6Void; |
| 8 | 8 | private Volatile obj6Volatile; |
| 9 | 9 | private While obj6While; |
| 10 | + private Unsigned unsigned; | |
| 11 | + private Ushort ushort; | |
| 10 | 12 | private Using using; |
| 11 | 13 | private Utf8JSONReader utf8JSONReader; |
| 12 | 14 | private Utf8JSONWriter utf8JSONWriter; |
| @@ -43,6 +45,16 @@ public class Obj6 { | ||
| 43 | 45 | @JsonProperty("while") |
| 44 | 46 | public void setObj6While(While value) { this.obj6While = value; } |
| 45 | 47 | |
| 48 | + @JsonProperty("unsigned") | |
| 49 | + public Unsigned getUnsigned() { return unsigned; } | |
| 50 | + @JsonProperty("unsigned") | |
| 51 | + public void setUnsigned(Unsigned value) { this.unsigned = value; } | |
| 52 | + | |
| 53 | + @JsonProperty("ushort") | |
| 54 | + public Ushort getUshort() { return ushort; } | |
| 55 | + @JsonProperty("ushort") | |
| 56 | + public void setUshort(Ushort value) { this.ushort = value; } | |
| 57 | + | |
| 46 | 58 | @JsonProperty("using") |
| 47 | 59 | public Using getUsing() { return using; } |
| 48 | 60 | @JsonProperty("using") |
Ajava-lombokdefault / src / main / java / io / quicktype / ToDict.java+12 −0
| @@ -0,0 +1,12 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +public class ToDict { | |
| 6 | + private long toDict; | |
| 7 | + | |
| 8 | + @JsonProperty("to_dict") | |
| 9 | + public long getToDict() { return toDict; } | |
| 10 | + @JsonProperty("to_dict") | |
| 11 | + public void setToDict(long value) { this.toDict = value; } | |
| 12 | +} |
Ajava-lombokdefault / src / main / java / io / quicktype / UnmarshalJSON.java+12 −0
| @@ -0,0 +1,12 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +public class UnmarshalJSON { | |
| 6 | + private long unmarshalJSON; | |
| 7 | + | |
| 8 | + @JsonProperty("UnmarshalJSON") | |
| 9 | + public long getUnmarshalJSON() { return unmarshalJSON; } | |
| 10 | + @JsonProperty("UnmarshalJSON") | |
| 11 | + public void setUnmarshalJSON(long value) { this.unmarshalJSON = value; } | |
| 12 | +} |
Ajavadefault / src / main / java / io / quicktype / FromDict.java+12 −0
| @@ -0,0 +1,12 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +public class FromDict { | |
| 6 | + private long fromDict; | |
| 7 | + | |
| 8 | + @JsonProperty("from_dict") | |
| 9 | + public long getFromDict() { return fromDict; } | |
| 10 | + @JsonProperty("from_dict") | |
| 11 | + public void setFromDict(long value) { this.fromDict = value; } | |
| 12 | +} |
Ajavadefault / src / main / java / io / quicktype / MarshalJSON.java+12 −0
| @@ -0,0 +1,12 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +public class MarshalJSON { | |
| 6 | + private long marshalJSON; | |
| 7 | + | |
| 8 | + @JsonProperty("MarshalJSON") | |
| 9 | + public long getMarshalJSON() { return marshalJSON; } | |
| 10 | + @JsonProperty("MarshalJSON") | |
| 11 | + public void setMarshalJSON(long value) { this.marshalJSON = value; } | |
| 12 | +} |
Mjavadefault / src / main / java / io / quicktype / Obj2.java+6 −6
| @@ -49,6 +49,7 @@ public class Obj2 { | ||
| 49 | 49 | private FormatException formatException; |
| 50 | 50 | private Friend friend; |
| 51 | 51 | private From from; |
| 52 | + private FromDict fromDict; | |
| 52 | 53 | private FromJSON fromJSON; |
| 53 | 54 | private Func func; |
| 54 | 55 | private Function function; |
| @@ -66,7 +67,6 @@ public class Obj2 { | ||
| 66 | 67 | private Finally obj2Finally; |
| 67 | 68 | private Float obj2Float; |
| 68 | 69 | private For obj2For; |
| 69 | - private Goto obj2Goto; | |
| 70 | 70 | private FalseClass purpleFalse; |
| 71 | 71 | |
| 72 | 72 | @JsonProperty("DateFormatter") |
| @@ -299,6 +299,11 @@ public class Obj2 { | ||
| 299 | 299 | @JsonProperty("from") |
| 300 | 300 | public void setFrom(From value) { this.from = value; } |
| 301 | 301 | |
| 302 | + @JsonProperty("from_dict") | |
| 303 | + public FromDict getFromDict() { return fromDict; } | |
| 304 | + @JsonProperty("from_dict") | |
| 305 | + public void setFromDict(FromDict value) { this.fromDict = value; } | |
| 306 | + | |
| 302 | 307 | @JsonProperty("from_json") |
| 303 | 308 | public FromJSON getFromJSON() { return fromJSON; } |
| 304 | 309 | @JsonProperty("from_json") |
| @@ -384,11 +389,6 @@ public class Obj2 { | ||
| 384 | 389 | @JsonProperty("for") |
| 385 | 390 | public void setObj2For(For value) { this.obj2For = value; } |
| 386 | 391 | |
| 387 | - @JsonProperty("goto") | |
| 388 | - public Goto getObj2Goto() { return obj2Goto; } | |
| 389 | - @JsonProperty("goto") | |
| 390 | - public void setObj2Goto(Goto value) { this.obj2Goto = value; } | |
| 391 | - | |
| 392 | 392 | @JsonProperty("false") |
| 393 | 393 | public FalseClass getPurpleFalse() { return purpleFalse; } |
| 394 | 394 | @JsonProperty("false") |
Mjavadefault / src / main / java / io / quicktype / Obj3.java+11 −5
| @@ -50,6 +50,7 @@ public class Obj3 { | ||
| 50 | 50 | private Lock lock; |
| 51 | 51 | private MapClass map; |
| 52 | 52 | private MapEntry mapEntry; |
| 53 | + private MarshalJSON marshalJSON; | |
| 53 | 54 | private MetadataPropertyHandling metadataPropertyHandling; |
| 54 | 55 | private Module module; |
| 55 | 56 | private Mutable mutable; |
| @@ -58,7 +59,7 @@ public class Obj3 { | ||
| 58 | 59 | private Newtonsoft newtonsoft; |
| 59 | 60 | private Nil nil; |
| 60 | 61 | private No no; |
| 61 | - private Noexcept noexcept; | |
| 62 | + private Goto obj3Goto; | |
| 62 | 63 | private If obj3If; |
| 63 | 64 | private Implements obj3Implements; |
| 64 | 65 | private Import obj3Import; |
| @@ -304,6 +305,11 @@ public class Obj3 { | ||
| 304 | 305 | @JsonProperty("MapEntry") |
| 305 | 306 | public void setMapEntry(MapEntry value) { this.mapEntry = value; } |
| 306 | 307 | |
| 308 | + @JsonProperty("MarshalJSON") | |
| 309 | + public MarshalJSON getMarshalJSON() { return marshalJSON; } | |
| 310 | + @JsonProperty("MarshalJSON") | |
| 311 | + public void setMarshalJSON(MarshalJSON value) { this.marshalJSON = value; } | |
| 312 | + | |
| 307 | 313 | @JsonProperty("metadata_property_handling") |
| 308 | 314 | public MetadataPropertyHandling getMetadataPropertyHandling() { return metadataPropertyHandling; } |
| 309 | 315 | @JsonProperty("metadata_property_handling") |
| @@ -344,10 +350,10 @@ public class Obj3 { | ||
| 344 | 350 | @JsonProperty("NO") |
| 345 | 351 | public void setNo(No value) { this.no = value; } |
| 346 | 352 | |
| 347 | - @JsonProperty("noexcept") | |
| 348 | - public Noexcept getNoexcept() { return noexcept; } | |
| 349 | - @JsonProperty("noexcept") | |
| 350 | - public void setNoexcept(Noexcept value) { this.noexcept = value; } | |
| 353 | + @JsonProperty("goto") | |
| 354 | + public Goto getObj3Goto() { return obj3Goto; } | |
| 355 | + @JsonProperty("goto") | |
| 356 | + public void setObj3Goto(Goto value) { this.obj3Goto = value; } | |
| 351 | 357 | |
| 352 | 358 | @JsonProperty("if") |
| 353 | 359 | public If getObj3If() { return obj3If; } |
Mjavadefault / src / main / java / io / quicktype / Obj4.java+6 −6
| @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.*; | ||
| 5 | 5 | public class Obj4 { |
| 6 | 6 | private long dummy; |
| 7 | 7 | private NoSuchMethod noSuchMethod; |
| 8 | + private Noexcept noexcept; | |
| 8 | 9 | private Nonatomic nonatomic; |
| 9 | 10 | private NoneClass none; |
| 10 | 11 | private Nonlocal nonlocal; |
| @@ -67,7 +68,6 @@ public class Obj4 { | ||
| 67 | 68 | private Sbyte sbyte; |
| 68 | 69 | private Sealed sealed; |
| 69 | 70 | private Sel sel; |
| 70 | - private Select select; | |
| 71 | 71 | |
| 72 | 72 | @JsonProperty("dummy") |
| 73 | 73 | public long getDummy() { return dummy; } |
| @@ -79,6 +79,11 @@ public class Obj4 { | ||
| 79 | 79 | @JsonProperty("noSuchMethod") |
| 80 | 80 | public void setNoSuchMethod(NoSuchMethod value) { this.noSuchMethod = value; } |
| 81 | 81 | |
| 82 | + @JsonProperty("noexcept") | |
| 83 | + public Noexcept getNoexcept() { return noexcept; } | |
| 84 | + @JsonProperty("noexcept") | |
| 85 | + public void setNoexcept(Noexcept value) { this.noexcept = value; } | |
| 86 | + | |
| 82 | 87 | @JsonProperty("nonatomic") |
| 83 | 88 | public Nonatomic getNonatomic() { return nonatomic; } |
| 84 | 89 | @JsonProperty("nonatomic") |
| @@ -388,9 +393,4 @@ public class Obj4 { | ||
| 388 | 393 | public Sel getSel() { return sel; } |
| 389 | 394 | @JsonProperty("SEL") |
| 390 | 395 | public void setSel(Sel value) { this.sel = value; } |
| 391 | - | |
| 392 | - @JsonProperty("select") | |
| 393 | - public Select getSelect() { return select; } | |
| 394 | - @JsonProperty("select") | |
| 395 | - public void setSelect(Select value) { this.select = value; } | |
| 396 | 396 | } |
Mjavadefault / src / main / java / io / quicktype / Obj5.java+18 −12
| @@ -21,6 +21,7 @@ public class Obj5 { | ||
| 21 | 21 | private TypeClass obj5Type; |
| 22 | 22 | private PrimitiveKind primitiveKind; |
| 23 | 23 | private TrueClass purpleTrue; |
| 24 | + private Select select; | |
| 24 | 25 | private Self self; |
| 25 | 26 | private Sendable sendable; |
| 26 | 27 | private SerialDescriptor serialDescriptor; |
| @@ -49,6 +50,7 @@ public class Obj5 { | ||
| 49 | 50 | private TimeOnly timeOnly; |
| 50 | 51 | private TimeOnlyConverter timeOnlyConverter; |
| 51 | 52 | private TimeZone timeZone; |
| 53 | + private ToDict toDict; | |
| 52 | 54 | private ToJSON toJSON; |
| 53 | 55 | private ToString toString; |
| 54 | 56 | private TopLevelClass topLevel; |
| @@ -63,11 +65,10 @@ public class Obj5 { | ||
| 63 | 65 | private Unchecked unchecked; |
| 64 | 66 | private Undefined undefined; |
| 65 | 67 | private Union union; |
| 68 | + private UnmarshalJSON unmarshalJSON; | |
| 66 | 69 | private Unowned unowned; |
| 67 | 70 | private Unsafe unsafe; |
| 68 | - private Unsigned unsigned; | |
| 69 | 71 | private UseSerializers useSerializers; |
| 70 | - private Ushort ushort; | |
| 71 | 72 | |
| 72 | 73 | @JsonProperty("dummy") |
| 73 | 74 | public long getDummy() { return dummy; } |
| @@ -159,6 +160,11 @@ public class Obj5 { | ||
| 159 | 160 | @JsonProperty("true") |
| 160 | 161 | public void setPurpleTrue(TrueClass value) { this.purpleTrue = value; } |
| 161 | 162 | |
| 163 | + @JsonProperty("select") | |
| 164 | + public Select getSelect() { return select; } | |
| 165 | + @JsonProperty("select") | |
| 166 | + public void setSelect(Select value) { this.select = value; } | |
| 167 | + | |
| 162 | 168 | @JsonProperty("Self") |
| 163 | 169 | public Self getSelf() { return self; } |
| 164 | 170 | @JsonProperty("Self") |
| @@ -299,6 +305,11 @@ public class Obj5 { | ||
| 299 | 305 | @JsonProperty("TimeZone") |
| 300 | 306 | public void setTimeZone(TimeZone value) { this.timeZone = value; } |
| 301 | 307 | |
| 308 | + @JsonProperty("to_dict") | |
| 309 | + public ToDict getToDict() { return toDict; } | |
| 310 | + @JsonProperty("to_dict") | |
| 311 | + public void setToDict(ToDict value) { this.toDict = value; } | |
| 312 | + | |
| 302 | 313 | @JsonProperty("to_json") |
| 303 | 314 | public ToJSON getToJSON() { return toJSON; } |
| 304 | 315 | @JsonProperty("to_json") |
| @@ -369,6 +380,11 @@ public class Obj5 { | ||
| 369 | 380 | @JsonProperty("union") |
| 370 | 381 | public void setUnion(Union value) { this.union = value; } |
| 371 | 382 | |
| 383 | + @JsonProperty("UnmarshalJSON") | |
| 384 | + public UnmarshalJSON getUnmarshalJSON() { return unmarshalJSON; } | |
| 385 | + @JsonProperty("UnmarshalJSON") | |
| 386 | + public void setUnmarshalJSON(UnmarshalJSON value) { this.unmarshalJSON = value; } | |
| 387 | + | |
| 372 | 388 | @JsonProperty("unowned") |
| 373 | 389 | public Unowned getUnowned() { return unowned; } |
| 374 | 390 | @JsonProperty("unowned") |
| @@ -379,18 +395,8 @@ public class Obj5 { | ||
| 379 | 395 | @JsonProperty("unsafe") |
| 380 | 396 | public void setUnsafe(Unsafe value) { this.unsafe = value; } |
| 381 | 397 | |
| 382 | - @JsonProperty("unsigned") | |
| 383 | - public Unsigned getUnsigned() { return unsigned; } | |
| 384 | - @JsonProperty("unsigned") | |
| 385 | - public void setUnsigned(Unsigned value) { this.unsigned = value; } | |
| 386 | - | |
| 387 | 398 | @JsonProperty("UseSerializers") |
| 388 | 399 | public UseSerializers getUseSerializers() { return useSerializers; } |
| 389 | 400 | @JsonProperty("UseSerializers") |
| 390 | 401 | public void setUseSerializers(UseSerializers value) { this.useSerializers = value; } |
| 391 | - | |
| 392 | - @JsonProperty("ushort") | |
| 393 | - public Ushort getUshort() { return ushort; } | |
| 394 | - @JsonProperty("ushort") | |
| 395 | - public void setUshort(Ushort value) { this.ushort = value; } | |
| 396 | 402 | } |
Mjavadefault / src / main / java / io / quicktype / Obj6.java+12 −0
| @@ -7,6 +7,8 @@ public class Obj6 { | ||
| 7 | 7 | private Void obj6Void; |
| 8 | 8 | private Volatile obj6Volatile; |
| 9 | 9 | private While obj6While; |
| 10 | + private Unsigned unsigned; | |
| 11 | + private Ushort ushort; | |
| 10 | 12 | private Using using; |
| 11 | 13 | private Utf8JSONReader utf8JSONReader; |
| 12 | 14 | private Utf8JSONWriter utf8JSONWriter; |
| @@ -43,6 +45,16 @@ public class Obj6 { | ||
| 43 | 45 | @JsonProperty("while") |
| 44 | 46 | public void setObj6While(While value) { this.obj6While = value; } |
| 45 | 47 | |
| 48 | + @JsonProperty("unsigned") | |
| 49 | + public Unsigned getUnsigned() { return unsigned; } | |
| 50 | + @JsonProperty("unsigned") | |
| 51 | + public void setUnsigned(Unsigned value) { this.unsigned = value; } | |
| 52 | + | |
| 53 | + @JsonProperty("ushort") | |
| 54 | + public Ushort getUshort() { return ushort; } | |
| 55 | + @JsonProperty("ushort") | |
| 56 | + public void setUshort(Ushort value) { this.ushort = value; } | |
| 57 | + | |
| 46 | 58 | @JsonProperty("using") |
| 47 | 59 | public Using getUsing() { return using; } |
| 48 | 60 | @JsonProperty("using") |
Ajavadefault / src / main / java / io / quicktype / ToDict.java+12 −0
| @@ -0,0 +1,12 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +public class ToDict { | |
| 6 | + private long toDict; | |
| 7 | + | |
| 8 | + @JsonProperty("to_dict") | |
| 9 | + public long getToDict() { return toDict; } | |
| 10 | + @JsonProperty("to_dict") | |
| 11 | + public void setToDict(long value) { this.toDict = value; } | |
| 12 | +} |
Ajavadefault / src / main / java / io / quicktype / UnmarshalJSON.java+12 −0
| @@ -0,0 +1,12 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +public class UnmarshalJSON { | |
| 6 | + private long unmarshalJSON; | |
| 7 | + | |
| 8 | + @JsonProperty("UnmarshalJSON") | |
| 9 | + public long getUnmarshalJSON() { return unmarshalJSON; } | |
| 10 | + @JsonProperty("UnmarshalJSON") | |
| 11 | + public void setUnmarshalJSON(long value) { this.unmarshalJSON = value; } | |
| 12 | +} |
Mjavascript-prop-typesdefault / toplevel.js+45 −25
| @@ -137,13 +137,13 @@ let _For; | ||
| 137 | 137 | let _Foreach; |
| 138 | 138 | let _Friend; |
| 139 | 139 | let _From; |
| 140 | +let _FromDict; | |
| 140 | 141 | let _FromJSON; |
| 141 | 142 | let _Func; |
| 142 | 143 | let _Function; |
| 143 | 144 | let _Get; |
| 144 | 145 | let _Global; |
| 145 | 146 | let _Go; |
| 146 | -let _Goto; | |
| 147 | 147 | let _Obj3; |
| 148 | 148 | let _Hashable; |
| 149 | 149 | let _Hasher; |
| @@ -162,7 +162,9 @@ let _JSONReader; | ||
| 162 | 162 | let _JSONTokenType; |
| 163 | 163 | let _Locale; |
| 164 | 164 | let _MapEntry; |
| 165 | +let _MarshalJSON; | |
| 165 | 166 | let _No; |
| 167 | +let _Goto; | |
| 166 | 168 | let _Guard; |
| 167 | 169 | let _HasOwnProperty; |
| 168 | 170 | let _HashCode; |
| @@ -208,7 +210,6 @@ let _Native; | ||
| 208 | 210 | let _New; |
| 209 | 211 | let _Newtonsoft; |
| 210 | 212 | let _Nil; |
| 211 | -let _Noexcept; | |
| 212 | 213 | let _Obj4; |
| 213 | 214 | let _NSError; |
| 214 | 215 | let _NSObject; |
| @@ -220,6 +221,7 @@ let _Protocol; | ||
| 220 | 221 | let _RegExp; |
| 221 | 222 | let _Sel; |
| 222 | 223 | let _NoSuchMethod; |
| 224 | +let _Noexcept; | |
| 223 | 225 | let _Nonatomic; |
| 224 | 226 | let _NoneClass; |
| 225 | 227 | let _Nonlocal; |
| @@ -273,7 +275,6 @@ let _RuntimeType; | ||
| 273 | 275 | let _S; |
| 274 | 276 | let _Sbyte; |
| 275 | 277 | let _Sealed; |
| 276 | -let _Select; | |
| 277 | 278 | let _Obj5; |
| 278 | 279 | let _KSerializer; |
| 279 | 280 | let _PrimitiveKind; |
| @@ -292,7 +293,9 @@ let _TimeOnlyConverter; | ||
| 292 | 293 | let _TimeZone; |
| 293 | 294 | let _True; |
| 294 | 295 | let _Type; |
| 296 | +let _UnmarshalJSON; | |
| 295 | 297 | let _UseSerializers; |
| 298 | +let _Select; | |
| 296 | 299 | let _SelfClass; |
| 297 | 300 | let _Serialize; |
| 298 | 301 | let _Set; |
| @@ -319,6 +322,7 @@ let _ThreadLocal; | ||
| 319 | 322 | let _Throw; |
| 320 | 323 | let _Throws; |
| 321 | 324 | let _ToString; |
| 325 | +let _ToDict; | |
| 322 | 326 | let _ToJSON; |
| 323 | 327 | let _TopLevelClass; |
| 324 | 328 | let _Transient; |
| @@ -337,13 +341,13 @@ let _Undefined; | ||
| 337 | 341 | let _Union; |
| 338 | 342 | let _Unowned; |
| 339 | 343 | let _Unsafe; |
| 340 | -let _Unsigned; | |
| 341 | -let _Ushort; | |
| 342 | 344 | let _Obj6; |
| 343 | 345 | let _UUID; |
| 344 | 346 | let _Utf8JSONReader; |
| 345 | 347 | let _Utf8JSONWriter; |
| 346 | 348 | let _Yes; |
| 349 | +let _Unsigned; | |
| 350 | +let _Ushort; | |
| 347 | 351 | let _Using; |
| 348 | 352 | let _Var; |
| 349 | 353 | let _Virtual; |
| @@ -789,6 +793,9 @@ _Friend = PropTypes.shape({ | ||
| 789 | 793 | _From = PropTypes.shape({ |
| 790 | 794 | "from": PropTypes.oneOfType([Integer]).isRequired, |
| 791 | 795 | }); |
| 796 | +_FromDict = PropTypes.shape({ | |
| 797 | + "from_dict": PropTypes.oneOfType([Integer]).isRequired, | |
| 798 | +}); | |
| 792 | 799 | _FromJSON = PropTypes.shape({ |
| 793 | 800 | "from_json": PropTypes.oneOfType([Integer]).isRequired, |
| 794 | 801 | }); |
| @@ -807,9 +814,6 @@ _Global = PropTypes.shape({ | ||
| 807 | 814 | _Go = PropTypes.shape({ |
| 808 | 815 | "go": PropTypes.oneOfType([Integer]).isRequired, |
| 809 | 816 | }); |
| 810 | -_Goto = PropTypes.shape({ | |
| 811 | - "goto": PropTypes.oneOfType([Integer]).isRequired, | |
| 812 | -}); | |
| 813 | 817 | _Obj2 = PropTypes.shape({ |
| 814 | 818 | "DateFormatter": _DateFormatter, |
| 815 | 819 | "DateOnly": _DateOnly, |
| @@ -869,13 +873,13 @@ _Obj2 = PropTypes.shape({ | ||
| 869 | 873 | "foreach": _Foreach, |
| 870 | 874 | "friend": _Friend, |
| 871 | 875 | "from": _From, |
| 876 | + "from_dict": _FromDict, | |
| 872 | 877 | "from_json": _FromJSON, |
| 873 | 878 | "func": _Func, |
| 874 | 879 | "function": _Function, |
| 875 | 880 | "get": _Get, |
| 876 | 881 | "global": _Global, |
| 877 | 882 | "go": _Go, |
| 878 | - "goto": _Goto, | |
| 879 | 883 | }); |
| 880 | 884 | _Hashable = PropTypes.shape({ |
| 881 | 885 | "Hashable": PropTypes.oneOfType([Integer]).isRequired, |
| @@ -928,9 +932,15 @@ _Locale = PropTypes.shape({ | ||
| 928 | 932 | _MapEntry = PropTypes.shape({ |
| 929 | 933 | "MapEntry": PropTypes.oneOfType([Integer]).isRequired, |
| 930 | 934 | }); |
| 935 | +_MarshalJSON = PropTypes.shape({ | |
| 936 | + "MarshalJSON": PropTypes.oneOfType([Integer]).isRequired, | |
| 937 | +}); | |
| 931 | 938 | _No = PropTypes.shape({ |
| 932 | 939 | "NO": PropTypes.oneOfType([Integer]).isRequired, |
| 933 | 940 | }); |
| 941 | +_Goto = PropTypes.shape({ | |
| 942 | + "goto": PropTypes.oneOfType([Integer]).isRequired, | |
| 943 | +}); | |
| 934 | 944 | _Guard = PropTypes.shape({ |
| 935 | 945 | "guard": PropTypes.oneOfType([Integer]).isRequired, |
| 936 | 946 | }); |
| @@ -1066,9 +1076,6 @@ _Newtonsoft = PropTypes.shape({ | ||
| 1066 | 1076 | _Nil = PropTypes.shape({ |
| 1067 | 1077 | "nil": PropTypes.oneOfType([Integer]).isRequired, |
| 1068 | 1078 | }); |
| 1069 | -_Noexcept = PropTypes.shape({ | |
| 1070 | - "noexcept": PropTypes.oneOfType([Integer]).isRequired, | |
| 1071 | -}); | |
| 1072 | 1079 | _Obj3 = PropTypes.shape({ |
| 1073 | 1080 | "Hashable": _Hashable, |
| 1074 | 1081 | "Hasher": _Hasher, |
| @@ -1087,8 +1094,10 @@ _Obj3 = PropTypes.shape({ | ||
| 1087 | 1094 | "JsonTokenType": _JSONTokenType, |
| 1088 | 1095 | "Locale": _Locale, |
| 1089 | 1096 | "MapEntry": _MapEntry, |
| 1097 | + "MarshalJSON": _MarshalJSON, | |
| 1090 | 1098 | "NO": _No, |
| 1091 | 1099 | "dummy": PropTypes.oneOfType([Integer]).isRequired, |
| 1100 | + "goto": _Goto, | |
| 1092 | 1101 | "guard": _Guard, |
| 1093 | 1102 | "hasOwnProperty": _HasOwnProperty, |
| 1094 | 1103 | "hashCode": _HashCode, |
| @@ -1134,7 +1143,6 @@ _Obj3 = PropTypes.shape({ | ||
| 1134 | 1143 | "new": _New, |
| 1135 | 1144 | "newtonsoft": _Newtonsoft, |
| 1136 | 1145 | "nil": _Nil, |
| 1137 | - "noexcept": _Noexcept, | |
| 1138 | 1146 | }); |
| 1139 | 1147 | _NSError = PropTypes.shape({ |
| 1140 | 1148 | "NSError": PropTypes.oneOfType([Integer]).isRequired, |
| @@ -1166,6 +1174,9 @@ _Sel = PropTypes.shape({ | ||
| 1166 | 1174 | _NoSuchMethod = PropTypes.shape({ |
| 1167 | 1175 | "noSuchMethod": PropTypes.oneOfType([Integer]).isRequired, |
| 1168 | 1176 | }); |
| 1177 | +_Noexcept = PropTypes.shape({ | |
| 1178 | + "noexcept": PropTypes.oneOfType([Integer]).isRequired, | |
| 1179 | +}); | |
| 1169 | 1180 | _Nonatomic = PropTypes.shape({ |
| 1170 | 1181 | "nonatomic": PropTypes.oneOfType([Integer]).isRequired, |
| 1171 | 1182 | }); |
| @@ -1325,9 +1336,6 @@ _Sbyte = PropTypes.shape({ | ||
| 1325 | 1336 | _Sealed = PropTypes.shape({ |
| 1326 | 1337 | "sealed": PropTypes.oneOfType([Integer]).isRequired, |
| 1327 | 1338 | }); |
| 1328 | -_Select = PropTypes.shape({ | |
| 1329 | - "select": PropTypes.oneOfType([Integer]).isRequired, | |
| 1330 | -}); | |
| 1331 | 1339 | _Obj4 = PropTypes.shape({ |
| 1332 | 1340 | "NSError": _NSError, |
| 1333 | 1341 | "NSObject": _NSObject, |
| @@ -1340,6 +1348,7 @@ _Obj4 = PropTypes.shape({ | ||
| 1340 | 1348 | "SEL": _Sel, |
| 1341 | 1349 | "dummy": PropTypes.oneOfType([Integer]).isRequired, |
| 1342 | 1350 | "noSuchMethod": _NoSuchMethod, |
| 1351 | + "noexcept": _Noexcept, | |
| 1343 | 1352 | "nonatomic": _Nonatomic, |
| 1344 | 1353 | "none": _NoneClass, |
| 1345 | 1354 | "nonlocal": _Nonlocal, |
| @@ -1393,7 +1402,6 @@ _Obj4 = PropTypes.shape({ | ||
| 1393 | 1402 | "s": _S, |
| 1394 | 1403 | "sbyte": _Sbyte, |
| 1395 | 1404 | "sealed": _Sealed, |
| 1396 | - "select": _Select, | |
| 1397 | 1405 | }); |
| 1398 | 1406 | _KSerializer = PropTypes.shape({ |
| 1399 | 1407 | "KSerializer": PropTypes.oneOfType([Integer]).isRequired, |
| @@ -1446,9 +1454,15 @@ _True = PropTypes.shape({ | ||
| 1446 | 1454 | _Type = PropTypes.shape({ |
| 1447 | 1455 | "Type": PropTypes.oneOfType([Integer]).isRequired, |
| 1448 | 1456 | }); |
| 1457 | +_UnmarshalJSON = PropTypes.shape({ | |
| 1458 | + "UnmarshalJSON": PropTypes.oneOfType([Integer]).isRequired, | |
| 1459 | +}); | |
| 1449 | 1460 | _UseSerializers = PropTypes.shape({ |
| 1450 | 1461 | "UseSerializers": PropTypes.oneOfType([Integer]).isRequired, |
| 1451 | 1462 | }); |
| 1463 | +_Select = PropTypes.shape({ | |
| 1464 | + "select": PropTypes.oneOfType([Integer]).isRequired, | |
| 1465 | +}); | |
| 1452 | 1466 | _SelfClass = PropTypes.shape({ |
| 1453 | 1467 | "self": PropTypes.oneOfType([Integer]).isRequired, |
| 1454 | 1468 | }); |
| @@ -1527,6 +1541,9 @@ _Throws = PropTypes.shape({ | ||
| 1527 | 1541 | _ToString = PropTypes.shape({ |
| 1528 | 1542 | "toString": PropTypes.oneOfType([Integer]).isRequired, |
| 1529 | 1543 | }); |
| 1544 | +_ToDict = PropTypes.shape({ | |
| 1545 | + "to_dict": PropTypes.oneOfType([Integer]).isRequired, | |
| 1546 | +}); | |
| 1530 | 1547 | _ToJSON = PropTypes.shape({ |
| 1531 | 1548 | "to_json": PropTypes.oneOfType([Integer]).isRequired, |
| 1532 | 1549 | }); |
| @@ -1581,12 +1598,6 @@ _Unowned = PropTypes.shape({ | ||
| 1581 | 1598 | _Unsafe = PropTypes.shape({ |
| 1582 | 1599 | "unsafe": PropTypes.oneOfType([Integer]).isRequired, |
| 1583 | 1600 | }); |
| 1584 | -_Unsigned = PropTypes.shape({ | |
| 1585 | - "unsigned": PropTypes.oneOfType([Integer]).isRequired, | |
| 1586 | -}); | |
| 1587 | -_Ushort = PropTypes.shape({ | |
| 1588 | - "ushort": PropTypes.oneOfType([Integer]).isRequired, | |
| 1589 | -}); | |
| 1590 | 1601 | _Obj5 = PropTypes.shape({ |
| 1591 | 1602 | "KSerializer": _KSerializer, |
| 1592 | 1603 | "PrimitiveKind": _PrimitiveKind, |
| @@ -1605,8 +1616,10 @@ _Obj5 = PropTypes.shape({ | ||
| 1605 | 1616 | "TimeZone": _TimeZone, |
| 1606 | 1617 | "True": _True, |
| 1607 | 1618 | "Type": _Type, |
| 1619 | + "UnmarshalJSON": _UnmarshalJSON, | |
| 1608 | 1620 | "UseSerializers": _UseSerializers, |
| 1609 | 1621 | "dummy": PropTypes.oneOfType([Integer]).isRequired, |
| 1622 | + "select": _Select, | |
| 1610 | 1623 | "self": _SelfClass, |
| 1611 | 1624 | "serialize": _Serialize, |
| 1612 | 1625 | "set": _Set, |
| @@ -1633,6 +1646,7 @@ _Obj5 = PropTypes.shape({ | ||
| 1633 | 1646 | "throw": _Throw, |
| 1634 | 1647 | "throws": _Throws, |
| 1635 | 1648 | "toString": _ToString, |
| 1649 | + "to_dict": _ToDict, | |
| 1636 | 1650 | "to_json": _ToJSON, |
| 1637 | 1651 | "top_level": _TopLevelClass, |
| 1638 | 1652 | "transient": _Transient, |
| @@ -1651,8 +1665,6 @@ _Obj5 = PropTypes.shape({ | ||
| 1651 | 1665 | "union": _Union, |
| 1652 | 1666 | "unowned": _Unowned, |
| 1653 | 1667 | "unsafe": _Unsafe, |
| 1654 | - "unsigned": _Unsigned, | |
| 1655 | - "ushort": _Ushort, | |
| 1656 | 1668 | }); |
| 1657 | 1669 | _UUID = PropTypes.shape({ |
| 1658 | 1670 | "UUID": PropTypes.oneOfType([Integer]).isRequired, |
| @@ -1666,6 +1678,12 @@ _Utf8JSONWriter = PropTypes.shape({ | ||
| 1666 | 1678 | _Yes = PropTypes.shape({ |
| 1667 | 1679 | "YES": PropTypes.oneOfType([Integer]).isRequired, |
| 1668 | 1680 | }); |
| 1681 | +_Unsigned = PropTypes.shape({ | |
| 1682 | + "unsigned": PropTypes.oneOfType([Integer]).isRequired, | |
| 1683 | +}); | |
| 1684 | +_Ushort = PropTypes.shape({ | |
| 1685 | + "ushort": PropTypes.oneOfType([Integer]).isRequired, | |
| 1686 | +}); | |
| 1669 | 1687 | _Using = PropTypes.shape({ |
| 1670 | 1688 | "using": PropTypes.oneOfType([Integer]).isRequired, |
| 1671 | 1689 | }); |
| @@ -1714,6 +1732,8 @@ _Obj6 = PropTypes.shape({ | ||
| 1714 | 1732 | "Utf8JsonWriter": _Utf8JSONWriter, |
| 1715 | 1733 | "YES": _Yes, |
| 1716 | 1734 | "dummy": PropTypes.oneOfType([Integer]).isRequired, |
| 1735 | + "unsigned": _Unsigned, | |
| 1736 | + "ushort": _Ushort, | |
| 1717 | 1737 | "using": _Using, |
| 1718 | 1738 | "var": _Var, |
| 1719 | 1739 | "virtual": _Virtual, |
Mjavascriptdefault / TopLevel.js+38 −22
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
| @@ -520,13 +520,13 @@ const typeMap = { | ||
| 520 | 520 | { json: "foreach", js: "foreach", typ: r("Foreach") }, |
| 521 | 521 | { json: "friend", js: "friend", typ: r("Friend") }, |
| 522 | 522 | { json: "from", js: "from", typ: r("From") }, |
| 523 | + { json: "from_dict", js: "from_dict", typ: r("FromDict") }, | |
| 523 | 524 | { json: "from_json", js: "from_json", typ: r("FromJSON") }, |
| 524 | 525 | { json: "func", js: "func", typ: r("Func") }, |
| 525 | 526 | { json: "function", js: "function", typ: r("Function") }, |
| 526 | 527 | { json: "get", js: "get", typ: r("Get") }, |
| 527 | 528 | { json: "global", js: "global", typ: r("Global") }, |
| 528 | 529 | { json: "go", js: "go", typ: r("Go") }, |
| 529 | - { json: "goto", js: "goto", typ: r("Goto") }, | |
| 530 | 530 | ], false), |
| 531 | 531 | "DateFormatter": o([ |
| 532 | 532 | { json: "DateFormatter", js: "DateFormatter", typ: i(0) }, |
| @@ -699,6 +699,9 @@ const typeMap = { | ||
| 699 | 699 | "From": o([ |
| 700 | 700 | { json: "from", js: "from", typ: i(0) }, |
| 701 | 701 | ], false), |
| 702 | + "FromDict": o([ | |
| 703 | + { json: "from_dict", js: "from_dict", typ: i(0) }, | |
| 704 | + ], false), | |
| 702 | 705 | "FromJSON": o([ |
| 703 | 706 | { json: "from_json", js: "from_json", typ: i(0) }, |
| 704 | 707 | ], false), |
| @@ -717,9 +720,6 @@ const typeMap = { | ||
| 717 | 720 | "Go": o([ |
| 718 | 721 | { json: "go", js: "go", typ: i(0) }, |
| 719 | 722 | ], false), |
| 720 | - "Goto": o([ | |
| 721 | - { json: "goto", js: "goto", typ: i(0) }, | |
| 722 | - ], false), | |
| 723 | 723 | "Obj3": o([ |
| 724 | 724 | { json: "Hashable", js: "Hashable", typ: r("Hashable") }, |
| 725 | 725 | { json: "Hasher", js: "Hasher", typ: r("Hasher") }, |
| @@ -738,8 +738,10 @@ const typeMap = { | ||
| 738 | 738 | { json: "JsonTokenType", js: "JsonTokenType", typ: r("JSONTokenType") }, |
| 739 | 739 | { json: "Locale", js: "Locale", typ: r("Locale") }, |
| 740 | 740 | { json: "MapEntry", js: "MapEntry", typ: r("MapEntry") }, |
| 741 | + { json: "MarshalJSON", js: "MarshalJSON", typ: r("MarshalJSON") }, | |
| 741 | 742 | { json: "NO", js: "NO", typ: r("No") }, |
| 742 | 743 | { json: "dummy", js: "dummy", typ: i(0) }, |
| 744 | + { json: "goto", js: "goto", typ: r("Goto") }, | |
| 743 | 745 | { json: "guard", js: "guard", typ: r("Guard") }, |
| 744 | 746 | { json: "hasOwnProperty", js: "hasOwnProperty", typ: r("HasOwnProperty") }, |
| 745 | 747 | { json: "hashCode", js: "hashCode", typ: r("HashCode") }, |
| @@ -785,7 +787,6 @@ const typeMap = { | ||
| 785 | 787 | { json: "new", js: "new", typ: r("New") }, |
| 786 | 788 | { json: "newtonsoft", js: "newtonsoft", typ: r("Newtonsoft") }, |
| 787 | 789 | { json: "nil", js: "nil", typ: r("Nil") }, |
| 788 | - { json: "noexcept", js: "noexcept", typ: r("Noexcept") }, | |
| 789 | 790 | ], false), |
| 790 | 791 | "Hashable": o([ |
| 791 | 792 | { json: "Hashable", js: "Hashable", typ: i(0) }, |
| @@ -838,9 +839,15 @@ const typeMap = { | ||
| 838 | 839 | "MapEntry": o([ |
| 839 | 840 | { json: "MapEntry", js: "MapEntry", typ: i(0) }, |
| 840 | 841 | ], false), |
| 842 | + "MarshalJSON": o([ | |
| 843 | + { json: "MarshalJSON", js: "MarshalJSON", typ: i(0) }, | |
| 844 | + ], false), | |
| 841 | 845 | "No": o([ |
| 842 | 846 | { json: "NO", js: "NO", typ: i(0) }, |
| 843 | 847 | ], false), |
| 848 | + "Goto": o([ | |
| 849 | + { json: "goto", js: "goto", typ: i(0) }, | |
| 850 | + ], false), | |
| 844 | 851 | "Guard": o([ |
| 845 | 852 | { json: "guard", js: "guard", typ: i(0) }, |
| 846 | 853 | ], false), |
| @@ -976,9 +983,6 @@ const typeMap = { | ||
| 976 | 983 | "Nil": o([ |
| 977 | 984 | { json: "nil", js: "nil", typ: i(0) }, |
| 978 | 985 | ], false), |
| 979 | - "Noexcept": o([ | |
| 980 | - { json: "noexcept", js: "noexcept", typ: i(0) }, | |
| 981 | - ], false), | |
| 982 | 986 | "Obj4": o([ |
| 983 | 987 | { json: "NSError", js: "NSError", typ: r("NSError") }, |
| 984 | 988 | { json: "NSObject", js: "NSObject", typ: r("NSObject") }, |
| @@ -991,6 +995,7 @@ const typeMap = { | ||
| 991 | 995 | { json: "SEL", js: "SEL", typ: r("Sel") }, |
| 992 | 996 | { json: "dummy", js: "dummy", typ: i(0) }, |
| 993 | 997 | { json: "noSuchMethod", js: "noSuchMethod", typ: r("NoSuchMethod") }, |
| 998 | + { json: "noexcept", js: "noexcept", typ: r("Noexcept") }, | |
| 994 | 999 | { json: "nonatomic", js: "nonatomic", typ: r("Nonatomic") }, |
| 995 | 1000 | { json: "none", js: "none", typ: r("NoneClass") }, |
| 996 | 1001 | { json: "nonlocal", js: "nonlocal", typ: r("Nonlocal") }, |
| @@ -1044,7 +1049,6 @@ const typeMap = { | ||
| 1044 | 1049 | { json: "s", js: "s", typ: r("S") }, |
| 1045 | 1050 | { json: "sbyte", js: "sbyte", typ: r("Sbyte") }, |
| 1046 | 1051 | { json: "sealed", js: "sealed", typ: r("Sealed") }, |
| 1047 | - { json: "select", js: "select", typ: r("Select") }, | |
| 1048 | 1052 | ], false), |
| 1049 | 1053 | "NSError": o([ |
| 1050 | 1054 | { json: "NSError", js: "NSError", typ: i(0) }, |
| @@ -1076,6 +1080,9 @@ const typeMap = { | ||
| 1076 | 1080 | "NoSuchMethod": o([ |
| 1077 | 1081 | { json: "noSuchMethod", js: "noSuchMethod", typ: i(0) }, |
| 1078 | 1082 | ], false), |
| 1083 | + "Noexcept": o([ | |
| 1084 | + { json: "noexcept", js: "noexcept", typ: i(0) }, | |
| 1085 | + ], false), | |
| 1079 | 1086 | "Nonatomic": o([ |
| 1080 | 1087 | { json: "nonatomic", js: "nonatomic", typ: i(0) }, |
| 1081 | 1088 | ], false), |
| @@ -1235,9 +1242,6 @@ const typeMap = { | ||
| 1235 | 1242 | "Sealed": o([ |
| 1236 | 1243 | { json: "sealed", js: "sealed", typ: i(0) }, |
| 1237 | 1244 | ], false), |
| 1238 | - "Select": o([ | |
| 1239 | - { json: "select", js: "select", typ: i(0) }, | |
| 1240 | - ], false), | |
| 1241 | 1245 | "Obj5": o([ |
| 1242 | 1246 | { json: "KSerializer", js: "KSerializer", typ: r("KSerializer") }, |
| 1243 | 1247 | { json: "PrimitiveKind", js: "PrimitiveKind", typ: r("PrimitiveKind") }, |
| @@ -1256,8 +1260,10 @@ const typeMap = { | ||
| 1256 | 1260 | { json: "TimeZone", js: "TimeZone", typ: r("TimeZone") }, |
| 1257 | 1261 | { json: "True", js: "True", typ: r("True") }, |
| 1258 | 1262 | { json: "Type", js: "Type", typ: r("Type") }, |
| 1263 | + { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: r("UnmarshalJSON") }, | |
| 1259 | 1264 | { json: "UseSerializers", js: "UseSerializers", typ: r("UseSerializers") }, |
| 1260 | 1265 | { json: "dummy", js: "dummy", typ: i(0) }, |
| 1266 | + { json: "select", js: "select", typ: r("Select") }, | |
| 1261 | 1267 | { json: "self", js: "self", typ: r("SelfClass") }, |
| 1262 | 1268 | { json: "serialize", js: "serialize", typ: r("Serialize") }, |
| 1263 | 1269 | { json: "set", js: "set", typ: r("Set") }, |
| @@ -1284,6 +1290,7 @@ const typeMap = { | ||
| 1284 | 1290 | { json: "throw", js: "throw", typ: r("Throw") }, |
| 1285 | 1291 | { json: "throws", js: "throws", typ: r("Throws") }, |
| 1286 | 1292 | { json: "toString", js: "toString", typ: r("ToString") }, |
| 1293 | + { json: "to_dict", js: "to_dict", typ: r("ToDict") }, | |
| 1287 | 1294 | { json: "to_json", js: "to_json", typ: r("ToJSON") }, |
| 1288 | 1295 | { json: "top_level", js: "top_level", typ: r("TopLevelClass") }, |
| 1289 | 1296 | { json: "transient", js: "transient", typ: r("Transient") }, |
| @@ -1302,8 +1309,6 @@ const typeMap = { | ||
| 1302 | 1309 | { json: "union", js: "union", typ: r("Union") }, |
| 1303 | 1310 | { json: "unowned", js: "unowned", typ: r("Unowned") }, |
| 1304 | 1311 | { json: "unsafe", js: "unsafe", typ: r("Unsafe") }, |
| 1305 | - { json: "unsigned", js: "unsigned", typ: r("Unsigned") }, | |
| 1306 | - { json: "ushort", js: "ushort", typ: r("Ushort") }, | |
| 1307 | 1312 | ], false), |
| 1308 | 1313 | "KSerializer": o([ |
| 1309 | 1314 | { json: "KSerializer", js: "KSerializer", typ: i(0) }, |
| @@ -1356,9 +1361,15 @@ const typeMap = { | ||
| 1356 | 1361 | "Type": o([ |
| 1357 | 1362 | { json: "Type", js: "Type", typ: i(0) }, |
| 1358 | 1363 | ], false), |
| 1364 | + "UnmarshalJSON": o([ | |
| 1365 | + { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: i(0) }, | |
| 1366 | + ], false), | |
| 1359 | 1367 | "UseSerializers": o([ |
| 1360 | 1368 | { json: "UseSerializers", js: "UseSerializers", typ: i(0) }, |
| 1361 | 1369 | ], false), |
| 1370 | + "Select": o([ | |
| 1371 | + { json: "select", js: "select", typ: i(0) }, | |
| 1372 | + ], false), | |
| 1362 | 1373 | "SelfClass": o([ |
| 1363 | 1374 | { json: "self", js: "self", typ: i(0) }, |
| 1364 | 1375 | ], false), |
| @@ -1437,6 +1448,9 @@ const typeMap = { | ||
| 1437 | 1448 | "ToString": o([ |
| 1438 | 1449 | { json: "toString", js: "toString", typ: i(0) }, |
| 1439 | 1450 | ], false), |
| 1451 | + "ToDict": o([ | |
| 1452 | + { json: "to_dict", js: "to_dict", typ: i(0) }, | |
| 1453 | + ], false), | |
| 1440 | 1454 | "ToJSON": o([ |
| 1441 | 1455 | { json: "to_json", js: "to_json", typ: i(0) }, |
| 1442 | 1456 | ], false), |
| @@ -1491,18 +1505,14 @@ const typeMap = { | ||
| 1491 | 1505 | "Unsafe": o([ |
| 1492 | 1506 | { json: "unsafe", js: "unsafe", typ: i(0) }, |
| 1493 | 1507 | ], false), |
| 1494 | - "Unsigned": o([ | |
| 1495 | - { json: "unsigned", js: "unsigned", typ: i(0) }, | |
| 1496 | - ], false), | |
| 1497 | - "Ushort": o([ | |
| 1498 | - { json: "ushort", js: "ushort", typ: i(0) }, | |
| 1499 | - ], false), | |
| 1500 | 1508 | "Obj6": o([ |
| 1501 | 1509 | { json: "UUID", js: "UUID", typ: r("UUID") }, |
| 1502 | 1510 | { json: "Utf8JsonReader", js: "Utf8JsonReader", typ: r("Utf8JSONReader") }, |
| 1503 | 1511 | { json: "Utf8JsonWriter", js: "Utf8JsonWriter", typ: r("Utf8JSONWriter") }, |
| 1504 | 1512 | { json: "YES", js: "YES", typ: r("Yes") }, |
| 1505 | 1513 | { json: "dummy", js: "dummy", typ: i(0) }, |
| 1514 | + { json: "unsigned", js: "unsigned", typ: r("Unsigned") }, | |
| 1515 | + { json: "ushort", js: "ushort", typ: r("Ushort") }, | |
| 1506 | 1516 | { json: "using", js: "using", typ: r("Using") }, |
| 1507 | 1517 | { json: "var", js: "var", typ: r("Var") }, |
| 1508 | 1518 | { json: "virtual", js: "virtual", typ: r("Virtual") }, |
| @@ -1530,6 +1540,12 @@ const typeMap = { | ||
| 1530 | 1540 | "Yes": o([ |
| 1531 | 1541 | { json: "YES", js: "YES", typ: i(0) }, |
| 1532 | 1542 | ], false), |
| 1543 | + "Unsigned": o([ | |
| 1544 | + { json: "unsigned", js: "unsigned", typ: i(0) }, | |
| 1545 | + ], false), | |
| 1546 | + "Ushort": o([ | |
| 1547 | + { json: "ushort", js: "ushort", typ: i(0) }, | |
| 1548 | + ], false), | |
| 1533 | 1549 | "Using": o([ |
| 1534 | 1550 | { json: "using", js: "using", typ: i(0) }, |
| 1535 | 1551 | ], false), |
Mkotlin-jacksondefault / TopLevel.kt+74 −42
| @@ -740,6 +740,9 @@ data class Obj2 ( | ||
| 740 | 740 | @get:JsonProperty(required=true)@field:JsonProperty(required=true) |
| 741 | 741 | val from: From, |
| 742 | 742 | |
| 743 | + @get:JsonProperty("from_dict", required=true)@field:JsonProperty("from_dict", required=true) | |
| 744 | + val fromDict: FromDict, | |
| 745 | + | |
| 743 | 746 | @get:JsonProperty("from_json", required=true)@field:JsonProperty("from_json", required=true) |
| 744 | 747 | val fromJSON: FromJSON, |
| 745 | 748 | |
| @@ -758,9 +761,6 @@ data class Obj2 ( | ||
| 758 | 761 | @get:JsonProperty(required=true)@field:JsonProperty(required=true) |
| 759 | 762 | val go: Go, |
| 760 | 763 | |
| 761 | - @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 762 | - val goto: Goto, | |
| 763 | - | |
| 764 | 764 | @get:JsonProperty("do", required=true)@field:JsonProperty("do", required=true) |
| 765 | 765 | val obj2Do: Do, |
| 766 | 766 | |
| @@ -1050,6 +1050,11 @@ data class From ( | ||
| 1050 | 1050 | val from: Long |
| 1051 | 1051 | ) |
| 1052 | 1052 | |
| 1053 | +data class FromDict ( | |
| 1054 | + @get:JsonProperty("from_dict", required=true)@field:JsonProperty("from_dict", required=true) | |
| 1055 | + val fromDict: Long | |
| 1056 | +) | |
| 1057 | + | |
| 1053 | 1058 | data class FromJSON ( |
| 1054 | 1059 | @get:JsonProperty("from_json", required=true)@field:JsonProperty("from_json", required=true) |
| 1055 | 1060 | val fromJSON: Long |
| @@ -1080,11 +1085,6 @@ data class Go ( | ||
| 1080 | 1085 | val go: Long |
| 1081 | 1086 | ) |
| 1082 | 1087 | |
| 1083 | -data class Goto ( | |
| 1084 | - @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 1085 | - val goto: Long | |
| 1086 | -) | |
| 1087 | - | |
| 1088 | 1088 | data class Do ( |
| 1089 | 1089 | @get:JsonProperty("do", required=true)@field:JsonProperty("do", required=true) |
| 1090 | 1090 | val doDo: Long |
| @@ -1114,6 +1114,9 @@ data class Obj3 ( | ||
| 1114 | 1114 | @get:JsonProperty(required=true)@field:JsonProperty(required=true) |
| 1115 | 1115 | val dummy: Long, |
| 1116 | 1116 | |
| 1117 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 1118 | + val goto: Goto, | |
| 1119 | + | |
| 1117 | 1120 | @get:JsonProperty(required=true)@field:JsonProperty(required=true) |
| 1118 | 1121 | val guard: Guard, |
| 1119 | 1122 | |
| @@ -1261,6 +1264,9 @@ data class Obj3 ( | ||
| 1261 | 1264 | @get:JsonProperty("MapEntry", required=true)@field:JsonProperty("MapEntry", required=true) |
| 1262 | 1265 | val mapEntry: MapEntry, |
| 1263 | 1266 | |
| 1267 | + @get:JsonProperty("MarshalJSON", required=true)@field:JsonProperty("MarshalJSON", required=true) | |
| 1268 | + val marshalJSON: MarshalJSON, | |
| 1269 | + | |
| 1264 | 1270 | @get:JsonProperty("metadata_property_handling", required=true)@field:JsonProperty("metadata_property_handling", required=true) |
| 1265 | 1271 | val metadataPropertyHandling: MetadataPropertyHandling, |
| 1266 | 1272 | |
| @@ -1291,9 +1297,6 @@ data class Obj3 ( | ||
| 1291 | 1297 | @get:JsonProperty("NO", required=true)@field:JsonProperty("NO", required=true) |
| 1292 | 1298 | val no: No, |
| 1293 | 1299 | |
| 1294 | - @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 1295 | - val noexcept: Noexcept, | |
| 1296 | - | |
| 1297 | 1300 | @get:JsonProperty("if", required=true)@field:JsonProperty("if", required=true) |
| 1298 | 1301 | val obj3If: If, |
| 1299 | 1302 | |
| @@ -1307,6 +1310,11 @@ data class Obj3 ( | ||
| 1307 | 1310 | val obj3Is: Is |
| 1308 | 1311 | ) |
| 1309 | 1312 | |
| 1313 | +data class Goto ( | |
| 1314 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 1315 | + val goto: Long | |
| 1316 | +) | |
| 1317 | + | |
| 1310 | 1318 | data class Guard ( |
| 1311 | 1319 | @get:JsonProperty(required=true)@field:JsonProperty(required=true) |
| 1312 | 1320 | val guard: Long |
| @@ -1552,6 +1560,11 @@ data class MapEntry ( | ||
| 1552 | 1560 | val mapEntry: Long |
| 1553 | 1561 | ) |
| 1554 | 1562 | |
| 1563 | +data class MarshalJSON ( | |
| 1564 | + @get:JsonProperty("MarshalJSON", required=true)@field:JsonProperty("MarshalJSON", required=true) | |
| 1565 | + val marshalJSON: Long | |
| 1566 | +) | |
| 1567 | + | |
| 1555 | 1568 | data class MetadataPropertyHandling ( |
| 1556 | 1569 | @get:JsonProperty("metadata_property_handling", required=true)@field:JsonProperty("metadata_property_handling", required=true) |
| 1557 | 1570 | val metadataPropertyHandling: Long |
| @@ -1602,11 +1615,6 @@ data class No ( | ||
| 1602 | 1615 | val no: Long |
| 1603 | 1616 | ) |
| 1604 | 1617 | |
| 1605 | -data class Noexcept ( | |
| 1606 | - @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 1607 | - val noexcept: Long | |
| 1608 | -) | |
| 1609 | - | |
| 1610 | 1618 | data class If ( |
| 1611 | 1619 | @get:JsonProperty("if", required=true)@field:JsonProperty("if", required=true) |
| 1612 | 1620 | val ifIf: Long |
| @@ -1634,6 +1642,9 @@ data class Obj4 ( | ||
| 1634 | 1642 | @get:JsonProperty(required=true)@field:JsonProperty(required=true) |
| 1635 | 1643 | val noSuchMethod: NoSuchMethod, |
| 1636 | 1644 | |
| 1645 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 1646 | + val noexcept: Noexcept, | |
| 1647 | + | |
| 1637 | 1648 | @get:JsonProperty(required=true)@field:JsonProperty(required=true) |
| 1638 | 1649 | val nonatomic: Nonatomic, |
| 1639 | 1650 | |
| @@ -1818,10 +1829,7 @@ data class Obj4 ( | ||
| 1818 | 1829 | val sealed: Sealed, |
| 1819 | 1830 | |
| 1820 | 1831 | @get:JsonProperty("SEL", required=true)@field:JsonProperty("SEL", required=true) |
| 1821 | - val sel: Sel, | |
| 1822 | - | |
| 1823 | - @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 1824 | - val select: Select | |
| 1832 | + val sel: Sel | |
| 1825 | 1833 | ) |
| 1826 | 1834 | |
| 1827 | 1835 | data class NoSuchMethod ( |
| @@ -1829,6 +1837,11 @@ data class NoSuchMethod ( | ||
| 1829 | 1837 | val noSuchMethod: Long |
| 1830 | 1838 | ) |
| 1831 | 1839 | |
| 1840 | +data class Noexcept ( | |
| 1841 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 1842 | + val noexcept: Long | |
| 1843 | +) | |
| 1844 | + | |
| 1832 | 1845 | data class Nonatomic ( |
| 1833 | 1846 | @get:JsonProperty(required=true)@field:JsonProperty(required=true) |
| 1834 | 1847 | val nonatomic: Long |
| @@ -2139,11 +2152,6 @@ data class Sel ( | ||
| 2139 | 2152 | val sel: Long |
| 2140 | 2153 | ) |
| 2141 | 2154 | |
| 2142 | -data class Select ( | |
| 2143 | - @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 2144 | - val select: Long | |
| 2145 | -) | |
| 2146 | - | |
| 2147 | 2155 | data class Obj5 ( |
| 2148 | 2156 | @get:JsonProperty(required=true)@field:JsonProperty(required=true) |
| 2149 | 2157 | val dummy: Long, |
| @@ -2184,6 +2192,9 @@ data class Obj5 ( | ||
| 2184 | 2192 | @get:JsonProperty("true", required=true)@field:JsonProperty("true", required=true) |
| 2185 | 2193 | val purpleTrue: TrueClass, |
| 2186 | 2194 | |
| 2195 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 2196 | + val select: Select, | |
| 2197 | + | |
| 2187 | 2198 | @get:JsonProperty("Self", required=true)@field:JsonProperty("Self", required=true) |
| 2188 | 2199 | val self: Self, |
| 2189 | 2200 | |
| @@ -2286,6 +2297,9 @@ data class Obj5 ( | ||
| 2286 | 2297 | @get:JsonProperty("TimeZone", required=true)@field:JsonProperty("TimeZone", required=true) |
| 2287 | 2298 | val timeZone: TimeZone, |
| 2288 | 2299 | |
| 2300 | + @get:JsonProperty("to_dict", required=true)@field:JsonProperty("to_dict", required=true) | |
| 2301 | + val toDict: ToDict, | |
| 2302 | + | |
| 2289 | 2303 | @get:JsonProperty("to_json", required=true)@field:JsonProperty("to_json", required=true) |
| 2290 | 2304 | val toJSON: ToJSON, |
| 2291 | 2305 | |
| @@ -2325,20 +2339,17 @@ data class Obj5 ( | ||
| 2325 | 2339 | @get:JsonProperty(required=true)@field:JsonProperty(required=true) |
| 2326 | 2340 | val union: Union, |
| 2327 | 2341 | |
| 2342 | + @get:JsonProperty("UnmarshalJSON", required=true)@field:JsonProperty("UnmarshalJSON", required=true) | |
| 2343 | + val unmarshalJSON: UnmarshalJSON, | |
| 2344 | + | |
| 2328 | 2345 | @get:JsonProperty(required=true)@field:JsonProperty(required=true) |
| 2329 | 2346 | val unowned: Unowned, |
| 2330 | 2347 | |
| 2331 | 2348 | @get:JsonProperty(required=true)@field:JsonProperty(required=true) |
| 2332 | 2349 | val unsafe: Unsafe, |
| 2333 | 2350 | |
| 2334 | - @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 2335 | - val unsigned: Unsigned, | |
| 2336 | - | |
| 2337 | 2351 | @get:JsonProperty("UseSerializers", required=true)@field:JsonProperty("UseSerializers", required=true) |
| 2338 | - val useSerializers: UseSerializers, | |
| 2339 | - | |
| 2340 | - @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 2341 | - val ushort: Ushort | |
| 2352 | + val useSerializers: UseSerializers | |
| 2342 | 2353 | ) |
| 2343 | 2354 | |
| 2344 | 2355 | data class KSerializer ( |
| @@ -2401,6 +2412,11 @@ data class TrueClass ( | ||
| 2401 | 2412 | val trueTrue: Long |
| 2402 | 2413 | ) |
| 2403 | 2414 | |
| 2415 | +data class Select ( | |
| 2416 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 2417 | + val select: Long | |
| 2418 | +) | |
| 2419 | + | |
| 2404 | 2420 | data class Self ( |
| 2405 | 2421 | @get:JsonProperty("Self", required=true)@field:JsonProperty("Self", required=true) |
| 2406 | 2422 | val self: Long |
| @@ -2571,6 +2587,11 @@ data class TimeZone ( | ||
| 2571 | 2587 | val timeZone: Long |
| 2572 | 2588 | ) |
| 2573 | 2589 | |
| 2590 | +data class ToDict ( | |
| 2591 | + @get:JsonProperty("to_dict", required=true)@field:JsonProperty("to_dict", required=true) | |
| 2592 | + val toDict: Long | |
| 2593 | +) | |
| 2594 | + | |
| 2574 | 2595 | data class ToJSON ( |
| 2575 | 2596 | @get:JsonProperty("to_json", required=true)@field:JsonProperty("to_json", required=true) |
| 2576 | 2597 | val toJSON: Long |
| @@ -2636,6 +2657,11 @@ data class Union ( | ||
| 2636 | 2657 | val union: Long |
| 2637 | 2658 | ) |
| 2638 | 2659 | |
| 2660 | +data class UnmarshalJSON ( | |
| 2661 | + @get:JsonProperty("UnmarshalJSON", required=true)@field:JsonProperty("UnmarshalJSON", required=true) | |
| 2662 | + val unmarshalJSON: Long | |
| 2663 | +) | |
| 2664 | + | |
| 2639 | 2665 | data class Unowned ( |
| 2640 | 2666 | @get:JsonProperty(required=true)@field:JsonProperty(required=true) |
| 2641 | 2667 | val unowned: Long |
| @@ -2646,21 +2672,11 @@ data class Unsafe ( | ||
| 2646 | 2672 | val unsafe: Long |
| 2647 | 2673 | ) |
| 2648 | 2674 | |
| 2649 | -data class Unsigned ( | |
| 2650 | - @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 2651 | - val unsigned: Long | |
| 2652 | -) | |
| 2653 | - | |
| 2654 | 2675 | data class UseSerializers ( |
| 2655 | 2676 | @get:JsonProperty("UseSerializers", required=true)@field:JsonProperty("UseSerializers", required=true) |
| 2656 | 2677 | val useSerializers: Long |
| 2657 | 2678 | ) |
| 2658 | 2679 | |
| 2659 | -data class Ushort ( | |
| 2660 | - @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 2661 | - val ushort: Long | |
| 2662 | -) | |
| 2663 | - | |
| 2664 | 2680 | data class Obj6 ( |
| 2665 | 2681 | @get:JsonProperty(required=true)@field:JsonProperty(required=true) |
| 2666 | 2682 | val dummy: Long, |
| @@ -2671,6 +2687,12 @@ data class Obj6 ( | ||
| 2671 | 2687 | @get:JsonProperty("while", required=true)@field:JsonProperty("while", required=true) |
| 2672 | 2688 | val obj6While: While, |
| 2673 | 2689 | |
| 2690 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 2691 | + val unsigned: Unsigned, | |
| 2692 | + | |
| 2693 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 2694 | + val ushort: Ushort, | |
| 2695 | + | |
| 2674 | 2696 | @get:JsonProperty(required=true)@field:JsonProperty(required=true) |
| 2675 | 2697 | val using: Using, |
| 2676 | 2698 | |
| @@ -2730,6 +2752,16 @@ data class While ( | ||
| 2730 | 2752 | val whileWhile: Long |
| 2731 | 2753 | ) |
| 2732 | 2754 | |
| 2755 | +data class Unsigned ( | |
| 2756 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 2757 | + val unsigned: Long | |
| 2758 | +) | |
| 2759 | + | |
| 2760 | +data class Ushort ( | |
| 2761 | + @get:JsonProperty(required=true)@field:JsonProperty(required=true) | |
| 2762 | + val ushort: Long | |
| 2763 | +) | |
| 2764 | + | |
| 2733 | 2765 | data class Using ( |
| 2734 | 2766 | @get:JsonProperty(required=true)@field:JsonProperty(required=true) |
| 2735 | 2767 | val using: Long |
Mkotlindefault / TopLevel.kt+61 −30
| @@ -542,6 +542,9 @@ data class Obj2 ( | ||
| 542 | 542 | val friend: Friend, |
| 543 | 543 | val from: From, |
| 544 | 544 | |
| 545 | + @Json(name = "from_dict") | |
| 546 | + val fromDict: FromDict, | |
| 547 | + | |
| 545 | 548 | @Json(name = "from_json") |
| 546 | 549 | val fromJSON: FromJSON, |
| 547 | 550 | |
| @@ -550,7 +553,6 @@ data class Obj2 ( | ||
| 550 | 553 | val get: Get, |
| 551 | 554 | val global: Global, |
| 552 | 555 | val go: Go, |
| 553 | - val goto: Goto, | |
| 554 | 556 | |
| 555 | 557 | @Json(name = "do") |
| 556 | 558 | val obj2Do: Do, |
| @@ -804,6 +806,11 @@ data class From ( | ||
| 804 | 806 | val from: Long |
| 805 | 807 | ) |
| 806 | 808 | |
| 809 | +data class FromDict ( | |
| 810 | + @Json(name = "from_dict") | |
| 811 | + val fromDict: Long | |
| 812 | +) | |
| 813 | + | |
| 807 | 814 | data class FromJSON ( |
| 808 | 815 | @Json(name = "from_json") |
| 809 | 816 | val fromJSON: Long |
| @@ -829,10 +836,6 @@ data class Go ( | ||
| 829 | 836 | val go: Long |
| 830 | 837 | ) |
| 831 | 838 | |
| 832 | -data class Goto ( | |
| 833 | - val goto: Long | |
| 834 | -) | |
| 835 | - | |
| 836 | 839 | data class Do ( |
| 837 | 840 | @Json(name = "do") |
| 838 | 841 | val doDo: Long |
| @@ -860,6 +863,7 @@ data class FalseClass ( | ||
| 860 | 863 | |
| 861 | 864 | data class Obj3 ( |
| 862 | 865 | val dummy: Long, |
| 866 | + val goto: Goto, | |
| 863 | 867 | val guard: Guard, |
| 864 | 868 | val hasOwnProperty: HasOwnProperty, |
| 865 | 869 | val hashCode: HashCode, |
| @@ -957,6 +961,9 @@ data class Obj3 ( | ||
| 957 | 961 | @Json(name = "MapEntry") |
| 958 | 962 | val mapEntry: MapEntry, |
| 959 | 963 | |
| 964 | + @Json(name = "MarshalJSON") | |
| 965 | + val marshalJSON: MarshalJSON, | |
| 966 | + | |
| 960 | 967 | @Json(name = "metadata_property_handling") |
| 961 | 968 | val metadataPropertyHandling: MetadataPropertyHandling, |
| 962 | 969 | |
| @@ -972,8 +979,6 @@ data class Obj3 ( | ||
| 972 | 979 | @Json(name = "NO") |
| 973 | 980 | val no: No, |
| 974 | 981 | |
| 975 | - val noexcept: Noexcept, | |
| 976 | - | |
| 977 | 982 | @Json(name = "if") |
| 978 | 983 | val obj3If: If, |
| 979 | 984 | |
| @@ -987,6 +992,10 @@ data class Obj3 ( | ||
| 987 | 992 | val obj3Is: Is |
| 988 | 993 | ) |
| 989 | 994 | |
| 995 | +data class Goto ( | |
| 996 | + val goto: Long | |
| 997 | +) | |
| 998 | + | |
| 990 | 999 | data class Guard ( |
| 991 | 1000 | val guard: Long |
| 992 | 1001 | ) |
| @@ -1204,6 +1213,11 @@ data class MapEntry ( | ||
| 1204 | 1213 | val mapEntry: Long |
| 1205 | 1214 | ) |
| 1206 | 1215 | |
| 1216 | +data class MarshalJSON ( | |
| 1217 | + @Json(name = "MarshalJSON") | |
| 1218 | + val marshalJSON: Long | |
| 1219 | +) | |
| 1220 | + | |
| 1207 | 1221 | data class MetadataPropertyHandling ( |
| 1208 | 1222 | @Json(name = "metadata_property_handling") |
| 1209 | 1223 | val metadataPropertyHandling: Long |
| @@ -1246,10 +1260,6 @@ data class No ( | ||
| 1246 | 1260 | val no: Long |
| 1247 | 1261 | ) |
| 1248 | 1262 | |
| 1249 | -data class Noexcept ( | |
| 1250 | - val noexcept: Long | |
| 1251 | -) | |
| 1252 | - | |
| 1253 | 1263 | data class If ( |
| 1254 | 1264 | @Json(name = "if") |
| 1255 | 1265 | val ifIf: Long |
| @@ -1273,6 +1283,7 @@ data class Is ( | ||
| 1273 | 1283 | data class Obj4 ( |
| 1274 | 1284 | val dummy: Long, |
| 1275 | 1285 | val noSuchMethod: NoSuchMethod, |
| 1286 | + val noexcept: Noexcept, | |
| 1276 | 1287 | val nonatomic: Nonatomic, |
| 1277 | 1288 | |
| 1278 | 1289 | @Json(name = "None") |
| @@ -1377,15 +1388,17 @@ data class Obj4 ( | ||
| 1377 | 1388 | val sealed: Sealed, |
| 1378 | 1389 | |
| 1379 | 1390 | @Json(name = "SEL") |
| 1380 | - val sel: Sel, | |
| 1381 | - | |
| 1382 | - val select: Select | |
| 1391 | + val sel: Sel | |
| 1383 | 1392 | ) |
| 1384 | 1393 | |
| 1385 | 1394 | data class NoSuchMethod ( |
| 1386 | 1395 | val noSuchMethod: Long |
| 1387 | 1396 | ) |
| 1388 | 1397 | |
| 1398 | +data class Noexcept ( | |
| 1399 | + val noexcept: Long | |
| 1400 | +) | |
| 1401 | + | |
| 1389 | 1402 | data class Nonatomic ( |
| 1390 | 1403 | val nonatomic: Long |
| 1391 | 1404 | ) |
| @@ -1650,10 +1663,6 @@ data class Sel ( | ||
| 1650 | 1663 | val sel: Long |
| 1651 | 1664 | ) |
| 1652 | 1665 | |
| 1653 | -data class Select ( | |
| 1654 | - val select: Long | |
| 1655 | -) | |
| 1656 | - | |
| 1657 | 1666 | data class Obj5 ( |
| 1658 | 1667 | val dummy: Long, |
| 1659 | 1668 | |
| @@ -1693,6 +1702,8 @@ data class Obj5 ( | ||
| 1693 | 1702 | @Json(name = "true") |
| 1694 | 1703 | val purpleTrue: TrueClass, |
| 1695 | 1704 | |
| 1705 | + val select: Select, | |
| 1706 | + | |
| 1696 | 1707 | @Json(name = "Self") |
| 1697 | 1708 | val self: Self, |
| 1698 | 1709 | |
| @@ -1765,6 +1776,9 @@ data class Obj5 ( | ||
| 1765 | 1776 | @Json(name = "TimeZone") |
| 1766 | 1777 | val timeZone: TimeZone, |
| 1767 | 1778 | |
| 1779 | + @Json(name = "to_dict") | |
| 1780 | + val toDict: ToDict, | |
| 1781 | + | |
| 1768 | 1782 | @Json(name = "to_json") |
| 1769 | 1783 | val toJSON: ToJSON, |
| 1770 | 1784 | |
| @@ -1786,14 +1800,15 @@ data class Obj5 ( | ||
| 1786 | 1800 | val unchecked: Unchecked, |
| 1787 | 1801 | val undefined: Undefined, |
| 1788 | 1802 | val union: Union, |
| 1803 | + | |
| 1804 | + @Json(name = "UnmarshalJSON") | |
| 1805 | + val unmarshalJSON: UnmarshalJSON, | |
| 1806 | + | |
| 1789 | 1807 | val unowned: Unowned, |
| 1790 | 1808 | val unsafe: Unsafe, |
| 1791 | - val unsigned: Unsigned, | |
| 1792 | 1809 | |
| 1793 | 1810 | @Json(name = "UseSerializers") |
| 1794 | - val useSerializers: UseSerializers, | |
| 1795 | - | |
| 1796 | - val ushort: Ushort | |
| 1811 | + val useSerializers: UseSerializers | |
| 1797 | 1812 | ) |
| 1798 | 1813 | |
| 1799 | 1814 | data class KSerializer ( |
| @@ -1854,6 +1869,10 @@ data class TrueClass ( | ||
| 1854 | 1869 | val trueTrue: Long |
| 1855 | 1870 | ) |
| 1856 | 1871 | |
| 1872 | +data class Select ( | |
| 1873 | + val select: Long | |
| 1874 | +) | |
| 1875 | + | |
| 1857 | 1876 | data class Self ( |
| 1858 | 1877 | @Json(name = "Self") |
| 1859 | 1878 | val self: Long |
| @@ -2006,6 +2025,11 @@ data class TimeZone ( | ||
| 2006 | 2025 | val timeZone: Long |
| 2007 | 2026 | ) |
| 2008 | 2027 | |
| 2028 | +data class ToDict ( | |
| 2029 | + @Json(name = "to_dict") | |
| 2030 | + val toDict: Long | |
| 2031 | +) | |
| 2032 | + | |
| 2009 | 2033 | data class ToJSON ( |
| 2010 | 2034 | @Json(name = "to_json") |
| 2011 | 2035 | val toJSON: Long |
| @@ -2061,6 +2085,11 @@ data class Union ( | ||
| 2061 | 2085 | val union: Long |
| 2062 | 2086 | ) |
| 2063 | 2087 | |
| 2088 | +data class UnmarshalJSON ( | |
| 2089 | + @Json(name = "UnmarshalJSON") | |
| 2090 | + val unmarshalJSON: Long | |
| 2091 | +) | |
| 2092 | + | |
| 2064 | 2093 | data class Unowned ( |
| 2065 | 2094 | val unowned: Long |
| 2066 | 2095 | ) |
| @@ -2069,19 +2098,11 @@ data class Unsafe ( | ||
| 2069 | 2098 | val unsafe: Long |
| 2070 | 2099 | ) |
| 2071 | 2100 | |
| 2072 | -data class Unsigned ( | |
| 2073 | - val unsigned: Long | |
| 2074 | -) | |
| 2075 | - | |
| 2076 | 2101 | data class UseSerializers ( |
| 2077 | 2102 | @Json(name = "UseSerializers") |
| 2078 | 2103 | val useSerializers: Long |
| 2079 | 2104 | ) |
| 2080 | 2105 | |
| 2081 | -data class Ushort ( | |
| 2082 | - val ushort: Long | |
| 2083 | -) | |
| 2084 | - | |
| 2085 | 2106 | data class Obj6 ( |
| 2086 | 2107 | val dummy: Long, |
| 2087 | 2108 | |
| @@ -2091,6 +2112,8 @@ data class Obj6 ( | ||
| 2091 | 2112 | @Json(name = "while") |
| 2092 | 2113 | val obj6While: While, |
| 2093 | 2114 | |
| 2115 | + val unsigned: Unsigned, | |
| 2116 | + val ushort: Ushort, | |
| 2094 | 2117 | val using: Using, |
| 2095 | 2118 | |
| 2096 | 2119 | @Json(name = "Utf8JsonReader") |
| @@ -2134,6 +2157,14 @@ data class While ( | ||
| 2134 | 2157 | val whileWhile: Long |
| 2135 | 2158 | ) |
| 2136 | 2159 | |
| 2160 | +data class Unsigned ( | |
| 2161 | + val unsigned: Long | |
| 2162 | +) | |
| 2163 | + | |
| 2164 | +data class Ushort ( | |
| 2165 | + val ushort: Long | |
| 2166 | +) | |
| 2167 | + | |
| 2137 | 2168 | data class Using ( |
| 2138 | 2169 | val using: Long |
| 2139 | 2170 | ) |
Mkotlinxdefault / TopLevel.kt+70 −35
| @@ -597,6 +597,9 @@ data class Obj2 ( | ||
| 597 | 597 | val friend: Friend, |
| 598 | 598 | val from: From, |
| 599 | 599 | |
| 600 | + @SerialName("from_dict") | |
| 601 | + val fromDict: FromDict, | |
| 602 | + | |
| 600 | 603 | @SerialName("from_json") |
| 601 | 604 | val fromJSON: FromJSON, |
| 602 | 605 | |
| @@ -605,7 +608,6 @@ data class Obj2 ( | ||
| 605 | 608 | val get: Get, |
| 606 | 609 | val global: Global, |
| 607 | 610 | val go: Go, |
| 608 | - val goto: Goto, | |
| 609 | 611 | |
| 610 | 612 | @SerialName("do") |
| 611 | 613 | val obj2Do: Do, |
| @@ -904,6 +906,12 @@ data class From ( | ||
| 904 | 906 | val from: Long |
| 905 | 907 | ) |
| 906 | 908 | |
| 909 | +@Serializable | |
| 910 | +data class FromDict ( | |
| 911 | + @SerialName("from_dict") | |
| 912 | + val fromDict: Long | |
| 913 | +) | |
| 914 | + | |
| 907 | 915 | @Serializable |
| 908 | 916 | data class FromJSON ( |
| 909 | 917 | @SerialName("from_json") |
| @@ -935,11 +943,6 @@ data class Go ( | ||
| 935 | 943 | val go: Long |
| 936 | 944 | ) |
| 937 | 945 | |
| 938 | -@Serializable | |
| 939 | -data class Goto ( | |
| 940 | - val goto: Long | |
| 941 | -) | |
| 942 | - | |
| 943 | 946 | @Serializable |
| 944 | 947 | data class Do ( |
| 945 | 948 | @SerialName("do") |
| @@ -973,6 +976,7 @@ data class FalseClass ( | ||
| 973 | 976 | @Serializable |
| 974 | 977 | data class Obj3 ( |
| 975 | 978 | val dummy: Long, |
| 979 | + val goto: Goto, | |
| 976 | 980 | val guard: Guard, |
| 977 | 981 | val hasOwnProperty: HasOwnProperty, |
| 978 | 982 | val hashCode: HashCode, |
| @@ -1070,6 +1074,9 @@ data class Obj3 ( | ||
| 1070 | 1074 | @SerialName("MapEntry") |
| 1071 | 1075 | val mapEntry: MapEntry, |
| 1072 | 1076 | |
| 1077 | + @SerialName("MarshalJSON") | |
| 1078 | + val marshalJSON: MarshalJSON, | |
| 1079 | + | |
| 1073 | 1080 | @SerialName("metadata_property_handling") |
| 1074 | 1081 | val metadataPropertyHandling: MetadataPropertyHandling, |
| 1075 | 1082 | |
| @@ -1085,8 +1092,6 @@ data class Obj3 ( | ||
| 1085 | 1092 | @SerialName("NO") |
| 1086 | 1093 | val no: No, |
| 1087 | 1094 | |
| 1088 | - val noexcept: Noexcept, | |
| 1089 | - | |
| 1090 | 1095 | @SerialName("if") |
| 1091 | 1096 | val obj3If: If, |
| 1092 | 1097 | |
| @@ -1100,6 +1105,11 @@ data class Obj3 ( | ||
| 1100 | 1105 | val obj3Is: Is |
| 1101 | 1106 | ) |
| 1102 | 1107 | |
| 1108 | +@Serializable | |
| 1109 | +data class Goto ( | |
| 1110 | + val goto: Long | |
| 1111 | +) | |
| 1112 | + | |
| 1103 | 1113 | @Serializable |
| 1104 | 1114 | data class Guard ( |
| 1105 | 1115 | val guard: Long |
| @@ -1366,6 +1376,12 @@ data class MapEntry ( | ||
| 1366 | 1376 | val mapEntry: Long |
| 1367 | 1377 | ) |
| 1368 | 1378 | |
| 1379 | +@Serializable | |
| 1380 | +data class MarshalJSON ( | |
| 1381 | + @SerialName("MarshalJSON") | |
| 1382 | + val marshalJSON: Long | |
| 1383 | +) | |
| 1384 | + | |
| 1369 | 1385 | @Serializable |
| 1370 | 1386 | data class MetadataPropertyHandling ( |
| 1371 | 1387 | @SerialName("metadata_property_handling") |
| @@ -1418,11 +1434,6 @@ data class No ( | ||
| 1418 | 1434 | val no: Long |
| 1419 | 1435 | ) |
| 1420 | 1436 | |
| 1421 | -@Serializable | |
| 1422 | -data class Noexcept ( | |
| 1423 | - val noexcept: Long | |
| 1424 | -) | |
| 1425 | - | |
| 1426 | 1437 | @Serializable |
| 1427 | 1438 | data class If ( |
| 1428 | 1439 | @SerialName("if") |
| @@ -1451,6 +1462,7 @@ data class Is ( | ||
| 1451 | 1462 | data class Obj4 ( |
| 1452 | 1463 | val dummy: Long, |
| 1453 | 1464 | val noSuchMethod: NoSuchMethod, |
| 1465 | + val noexcept: Noexcept, | |
| 1454 | 1466 | val nonatomic: Nonatomic, |
| 1455 | 1467 | |
| 1456 | 1468 | @SerialName("None") |
| @@ -1555,9 +1567,7 @@ data class Obj4 ( | ||
| 1555 | 1567 | val sealed: Sealed, |
| 1556 | 1568 | |
| 1557 | 1569 | @SerialName("SEL") |
| 1558 | - val sel: Sel, | |
| 1559 | - | |
| 1560 | - val select: Select | |
| 1570 | + val sel: Sel | |
| 1561 | 1571 | ) |
| 1562 | 1572 | |
| 1563 | 1573 | @Serializable |
| @@ -1565,6 +1575,11 @@ data class NoSuchMethod ( | ||
| 1565 | 1575 | val noSuchMethod: Long |
| 1566 | 1576 | ) |
| 1567 | 1577 | |
| 1578 | +@Serializable | |
| 1579 | +data class Noexcept ( | |
| 1580 | + val noexcept: Long | |
| 1581 | +) | |
| 1582 | + | |
| 1568 | 1583 | @Serializable |
| 1569 | 1584 | data class Nonatomic ( |
| 1570 | 1585 | val nonatomic: Long |
| @@ -1891,11 +1906,6 @@ data class Sel ( | ||
| 1891 | 1906 | val sel: Long |
| 1892 | 1907 | ) |
| 1893 | 1908 | |
| 1894 | -@Serializable | |
| 1895 | -data class Select ( | |
| 1896 | - val select: Long | |
| 1897 | -) | |
| 1898 | - | |
| 1899 | 1909 | @Serializable |
| 1900 | 1910 | data class Obj5 ( |
| 1901 | 1911 | val dummy: Long, |
| @@ -1936,6 +1946,8 @@ data class Obj5 ( | ||
| 1936 | 1946 | @SerialName("true") |
| 1937 | 1947 | val purpleTrue: TrueClass, |
| 1938 | 1948 | |
| 1949 | + val select: Select, | |
| 1950 | + | |
| 1939 | 1951 | @SerialName("Self") |
| 1940 | 1952 | val self: Self, |
| 1941 | 1953 | |
| @@ -2008,6 +2020,9 @@ data class Obj5 ( | ||
| 2008 | 2020 | @SerialName("TimeZone") |
| 2009 | 2021 | val timeZone: TimeZone, |
| 2010 | 2022 | |
| 2023 | + @SerialName("to_dict") | |
| 2024 | + val toDict: ToDict, | |
| 2025 | + | |
| 2011 | 2026 | @SerialName("to_json") |
| 2012 | 2027 | val toJSON: ToJSON, |
| 2013 | 2028 | |
| @@ -2029,14 +2044,15 @@ data class Obj5 ( | ||
| 2029 | 2044 | val unchecked: Unchecked, |
| 2030 | 2045 | val undefined: Undefined, |
| 2031 | 2046 | val union: Union, |
| 2047 | + | |
| 2048 | + @SerialName("UnmarshalJSON") | |
| 2049 | + val unmarshalJSON: UnmarshalJSON, | |
| 2050 | + | |
| 2032 | 2051 | val unowned: Unowned, |
| 2033 | 2052 | val unsafe: Unsafe, |
| 2034 | - val unsigned: Unsigned, | |
| 2035 | 2053 | |
| 2036 | 2054 | @SerialName("UseSerializers") |
| 2037 | - val useSerializers: UseSerializersClass, | |
| 2038 | - | |
| 2039 | - val ushort: Ushort | |
| 2055 | + val useSerializers: UseSerializersClass | |
| 2040 | 2056 | ) |
| 2041 | 2057 | |
| 2042 | 2058 | @Serializable |
| @@ -2109,6 +2125,11 @@ data class TrueClass ( | ||
| 2109 | 2125 | val trueTrue: Long |
| 2110 | 2126 | ) |
| 2111 | 2127 | |
| 2128 | +@Serializable | |
| 2129 | +data class Select ( | |
| 2130 | + val select: Long | |
| 2131 | +) | |
| 2132 | + | |
| 2112 | 2133 | @Serializable |
| 2113 | 2134 | data class Self ( |
| 2114 | 2135 | @SerialName("Self") |
| @@ -2295,6 +2316,12 @@ data class TimeZone ( | ||
| 2295 | 2316 | val timeZone: Long |
| 2296 | 2317 | ) |
| 2297 | 2318 | |
| 2319 | +@Serializable | |
| 2320 | +data class ToDict ( | |
| 2321 | + @SerialName("to_dict") | |
| 2322 | + val toDict: Long | |
| 2323 | +) | |
| 2324 | + | |
| 2298 | 2325 | @Serializable |
| 2299 | 2326 | data class ToJSON ( |
| 2300 | 2327 | @SerialName("to_json") |
| @@ -2363,6 +2390,12 @@ data class Union ( | ||
| 2363 | 2390 | val union: Long |
| 2364 | 2391 | ) |
| 2365 | 2392 | |
| 2393 | +@Serializable | |
| 2394 | +data class UnmarshalJSON ( | |
| 2395 | + @SerialName("UnmarshalJSON") | |
| 2396 | + val unmarshalJSON: Long | |
| 2397 | +) | |
| 2398 | + | |
| 2366 | 2399 | @Serializable |
| 2367 | 2400 | data class Unowned ( |
| 2368 | 2401 | val unowned: Long |
| @@ -2373,22 +2406,12 @@ data class Unsafe ( | ||
| 2373 | 2406 | val unsafe: Long |
| 2374 | 2407 | ) |
| 2375 | 2408 | |
| 2376 | -@Serializable | |
| 2377 | -data class Unsigned ( | |
| 2378 | - val unsigned: Long | |
| 2379 | -) | |
| 2380 | - | |
| 2381 | 2409 | @Serializable |
| 2382 | 2410 | data class UseSerializersClass ( |
| 2383 | 2411 | @SerialName("UseSerializers") |
| 2384 | 2412 | val useSerializers: Long |
| 2385 | 2413 | ) |
| 2386 | 2414 | |
| 2387 | -@Serializable | |
| 2388 | -data class Ushort ( | |
| 2389 | - val ushort: Long | |
| 2390 | -) | |
| 2391 | - | |
| 2392 | 2415 | @Serializable |
| 2393 | 2416 | data class Obj6 ( |
| 2394 | 2417 | val dummy: Long, |
| @@ -2399,6 +2422,8 @@ data class Obj6 ( | ||
| 2399 | 2422 | @SerialName("while") |
| 2400 | 2423 | val obj6While: While, |
| 2401 | 2424 | |
| 2425 | + val unsigned: Unsigned, | |
| 2426 | + val ushort: Ushort, | |
| 2402 | 2427 | val using: Using, |
| 2403 | 2428 | |
| 2404 | 2429 | @SerialName("Utf8JsonReader") |
| @@ -2444,6 +2469,16 @@ data class While ( | ||
| 2444 | 2469 | val whileWhile: Long |
| 2445 | 2470 | ) |
| 2446 | 2471 | |
| 2472 | +@Serializable | |
| 2473 | +data class Unsigned ( | |
| 2474 | + val unsigned: Long | |
| 2475 | +) | |
| 2476 | + | |
| 2477 | +@Serializable | |
| 2478 | +data class Ushort ( | |
| 2479 | + val ushort: Long | |
| 2480 | +) | |
| 2481 | + | |
| 2447 | 2482 | @Serializable |
| 2448 | 2483 | data class Using ( |
| 2449 | 2484 | val using: Long |
Mobjective-cdefault / QTTopLevel.h+52 −28
| @@ -120,6 +120,7 @@ | ||
| 120 | 120 | @class QTFormatException; |
| 121 | 121 | @class QTFriend; |
| 122 | 122 | @class QTFrom; |
| 123 | +@class QTFromDict; | |
| 123 | 124 | @class QTFromJSON; |
| 124 | 125 | @class QTFunc; |
| 125 | 126 | @class QTFunction; |
| @@ -135,7 +136,6 @@ | ||
| 135 | 136 | @class QTFalse; |
| 136 | 137 | @class QTFloat; |
| 137 | 138 | @class QTFor; |
| 138 | -@class QTGoto; | |
| 139 | 139 | @class QTFalseClass; |
| 140 | 140 | @class QTObj3; |
| 141 | 141 | @class QTGuard; |
| @@ -185,6 +185,7 @@ | ||
| 185 | 185 | @class QTLock; |
| 186 | 186 | @class QTMap; |
| 187 | 187 | @class QTMapEntry; |
| 188 | +@class QTMarshalJSON; | |
| 188 | 189 | @class QTMetadataPropertyHandling; |
| 189 | 190 | @class QTModule; |
| 190 | 191 | @class QTMutable; |
| @@ -193,7 +194,7 @@ | ||
| 193 | 194 | @class QTNative; |
| 194 | 195 | @class QTNewtonsoft; |
| 195 | 196 | @class QTNo; |
| 196 | -@class QTNoexcept; | |
| 197 | +@class QTGoto; | |
| 197 | 198 | @class QTIf; |
| 198 | 199 | @class QTInline; |
| 199 | 200 | @class QTInt; |
| @@ -204,6 +205,7 @@ | ||
| 204 | 205 | @class QTNew; |
| 205 | 206 | @class QTObj4; |
| 206 | 207 | @class QTNoSuchMethod; |
| 208 | +@class QTNoexcept; | |
| 207 | 209 | @class QTNone; |
| 208 | 210 | @class QTNonlocal; |
| 209 | 211 | @class QTNonmutating; |
| @@ -266,7 +268,6 @@ | ||
| 266 | 268 | @class QTSbyte; |
| 267 | 269 | @class QTSealed; |
| 268 | 270 | @class QTSel; |
| 269 | -@class QTSelect; | |
| 270 | 271 | @class QTObj5; |
| 271 | 272 | @class QTKSerializer; |
| 272 | 273 | @class QTSelfClass; |
| @@ -281,8 +282,8 @@ | ||
| 281 | 282 | @class QTTypedef; |
| 282 | 283 | @class QTTypeof; |
| 283 | 284 | @class QTUnion; |
| 284 | -@class QTUnsigned; | |
| 285 | 285 | @class QTPrimitiveKind; |
| 286 | +@class QTSelect; | |
| 286 | 287 | @class QTSelf; |
| 287 | 288 | @class QTSendable; |
| 288 | 289 | @class QTSerialDescriptor; |
| @@ -315,6 +316,7 @@ | ||
| 315 | 316 | @class QTTimeOnly; |
| 316 | 317 | @class QTTimeOnlyConverter; |
| 317 | 318 | @class QTTimeZone; |
| 319 | +@class QTToDict; | |
| 318 | 320 | @class QTToJSON; |
| 319 | 321 | @class QTToString; |
| 320 | 322 | @class QTTopLevelClass; |
| @@ -328,14 +330,16 @@ | ||
| 328 | 330 | @class QTUlong; |
| 329 | 331 | @class QTUnchecked; |
| 330 | 332 | @class QTUndefined; |
| 333 | +@class QTUnmarshalJSON; | |
| 331 | 334 | @class QTUnowned; |
| 332 | 335 | @class QTUnsafe; |
| 333 | 336 | @class QTUseSerializers; |
| 334 | -@class QTUshort; | |
| 335 | 337 | @class QTObj6; |
| 338 | +@class QTUnsigned; | |
| 336 | 339 | @class QTVoid; |
| 337 | 340 | @class QTVolatile; |
| 338 | 341 | @class QTWhile; |
| 342 | +@class QTUshort; | |
| 339 | 343 | @class QTUsing; |
| 340 | 344 | @class QTUtf8JSONReader; |
| 341 | 345 | @class QTUtf8JSONWriter; |
| @@ -760,6 +764,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 760 | 764 | @property (nonatomic, strong) QTFormatException *formatException; |
| 761 | 765 | @property (nonatomic, strong) QTFriend *friend; |
| 762 | 766 | @property (nonatomic, strong) QTFrom *from; |
| 767 | +@property (nonatomic, strong) QTFromDict *fromDict; | |
| 763 | 768 | @property (nonatomic, strong) QTFromJSON *fromJSON; |
| 764 | 769 | @property (nonatomic, strong) QTFunc *func; |
| 765 | 770 | @property (nonatomic, strong) QTFunction *function; |
| @@ -775,7 +780,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 775 | 780 | @property (nonatomic, strong) QTFalse *obj2False; |
| 776 | 781 | @property (nonatomic, strong) QTFloat *obj2Float; |
| 777 | 782 | @property (nonatomic, strong) QTFor *obj2For; |
| 778 | -@property (nonatomic, strong) QTGoto *obj2Goto; | |
| 779 | 783 | @property (nonatomic, strong) QTFalseClass *theFalse; |
| 780 | 784 | @end |
| 781 | 785 | |
| @@ -967,6 +971,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 967 | 971 | @property (nonatomic, assign) NSInteger from; |
| 968 | 972 | @end |
| 969 | 973 | |
| 974 | +@interface QTFromDict : NSObject | |
| 975 | +@property (nonatomic, assign) NSInteger fromDict; | |
| 976 | +@end | |
| 977 | + | |
| 970 | 978 | @interface QTFromJSON : NSObject |
| 971 | 979 | @property (nonatomic, assign) NSInteger fromJSON; |
| 972 | 980 | @end |
| @@ -1027,10 +1035,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 1027 | 1035 | @property (nonatomic, assign) NSInteger forFor; |
| 1028 | 1036 | @end |
| 1029 | 1037 | |
| 1030 | -@interface QTGoto : NSObject | |
| 1031 | -@property (nonatomic, assign) NSInteger gotoGoto; | |
| 1032 | -@end | |
| 1033 | - | |
| 1034 | 1038 | @interface QTFalseClass : NSObject |
| 1035 | 1039 | @property (nonatomic, assign) NSInteger falseFalse; |
| 1036 | 1040 | @end |
| @@ -1084,6 +1088,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 1084 | 1088 | @property (nonatomic, strong) QTLock *lock; |
| 1085 | 1089 | @property (nonatomic, strong) QTMap *map; |
| 1086 | 1090 | @property (nonatomic, strong) QTMapEntry *mapEntry; |
| 1091 | +@property (nonatomic, strong) QTMarshalJSON *marshalJSON; | |
| 1087 | 1092 | @property (nonatomic, strong) QTMetadataPropertyHandling *metadataPropertyHandling; |
| 1088 | 1093 | @property (nonatomic, strong) QTModule *module; |
| 1089 | 1094 | @property (nonatomic, strong) QTMutable *mutable; |
| @@ -1092,7 +1097,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 1092 | 1097 | @property (nonatomic, strong) QTNative *native; |
| 1093 | 1098 | @property (nonatomic, strong) QTNewtonsoft *newtonsoft; |
| 1094 | 1099 | @property (nonatomic, strong) QTNo *no; |
| 1095 | -@property (nonatomic, strong) QTNoexcept *noexcept; | |
| 1100 | +@property (nonatomic, strong) QTGoto *obj3Goto; | |
| 1096 | 1101 | @property (nonatomic, strong) QTIf *obj3If; |
| 1097 | 1102 | @property (nonatomic, strong) QTInline *obj3Inline; |
| 1098 | 1103 | @property (nonatomic, strong) QTInt *obj3Int; |
| @@ -1291,6 +1296,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 1291 | 1296 | @property (nonatomic, assign) NSInteger mapEntry; |
| 1292 | 1297 | @end |
| 1293 | 1298 | |
| 1299 | +@interface QTMarshalJSON : NSObject | |
| 1300 | +@property (nonatomic, assign) NSInteger marshalJSON; | |
| 1301 | +@end | |
| 1302 | + | |
| 1294 | 1303 | @interface QTMetadataPropertyHandling : NSObject |
| 1295 | 1304 | @property (nonatomic, assign) NSInteger metadataPropertyHandling; |
| 1296 | 1305 | @end |
| @@ -1323,8 +1332,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 1323 | 1332 | @property (nonatomic, assign) NSInteger no; |
| 1324 | 1333 | @end |
| 1325 | 1334 | |
| 1326 | -@interface QTNoexcept : NSObject | |
| 1327 | -@property (nonatomic, assign) NSInteger noexcept; | |
| 1335 | +@interface QTGoto : NSObject | |
| 1336 | +@property (nonatomic, assign) NSInteger gotoGoto; | |
| 1328 | 1337 | @end |
| 1329 | 1338 | |
| 1330 | 1339 | @interface QTIf : NSObject |
| @@ -1362,6 +1371,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 1362 | 1371 | @interface QTObj4 : NSObject |
| 1363 | 1372 | @property (nonatomic, assign) NSInteger dummy; |
| 1364 | 1373 | @property (nonatomic, strong) QTNoSuchMethod *noSuchMethod; |
| 1374 | +@property (nonatomic, strong) QTNoexcept *noexcept; | |
| 1365 | 1375 | @property (nonatomic, strong) QTNone *none; |
| 1366 | 1376 | @property (nonatomic, strong) QTNonlocal *nonlocal; |
| 1367 | 1377 | @property (nonatomic, strong) QTNonmutating *nonmutating; |
| @@ -1424,13 +1434,16 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 1424 | 1434 | @property (nonatomic, strong) QTSbyte *sbyte; |
| 1425 | 1435 | @property (nonatomic, strong) QTSealed *sealed; |
| 1426 | 1436 | @property (nonatomic, strong) QTSel *sel; |
| 1427 | -@property (nonatomic, strong) QTSelect *select; | |
| 1428 | 1437 | @end |
| 1429 | 1438 | |
| 1430 | 1439 | @interface QTNoSuchMethod : NSObject |
| 1431 | 1440 | @property (nonatomic, assign) NSInteger noSuchMethod; |
| 1432 | 1441 | @end |
| 1433 | 1442 | |
| 1443 | +@interface QTNoexcept : NSObject | |
| 1444 | +@property (nonatomic, assign) NSInteger noexcept; | |
| 1445 | +@end | |
| 1446 | + | |
| 1434 | 1447 | @interface QTNone : NSObject |
| 1435 | 1448 | @property (nonatomic, assign) NSInteger none; |
| 1436 | 1449 | @end |
| @@ -1679,10 +1692,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 1679 | 1692 | @property (nonatomic, assign) NSInteger sel; |
| 1680 | 1693 | @end |
| 1681 | 1694 | |
| 1682 | -@interface QTSelect : NSObject | |
| 1683 | -@property (nonatomic, assign) NSInteger select; | |
| 1684 | -@end | |
| 1685 | - | |
| 1686 | 1695 | @interface QTObj5 : NSObject |
| 1687 | 1696 | @property (nonatomic, assign) NSInteger dummy; |
| 1688 | 1697 | @property (nonatomic, strong) QTKSerializer *kSerializer; |
| @@ -1698,8 +1707,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 1698 | 1707 | @property (nonatomic, strong) QTTypedef *obj5Typedef; |
| 1699 | 1708 | @property (nonatomic, strong) QTTypeof *obj5Typeof; |
| 1700 | 1709 | @property (nonatomic, strong) QTUnion *obj5Union; |
| 1701 | -@property (nonatomic, strong) QTUnsigned *obj5Unsigned; | |
| 1702 | 1710 | @property (nonatomic, strong) QTPrimitiveKind *primitiveKind; |
| 1711 | +@property (nonatomic, strong) QTSelect *select; | |
| 1703 | 1712 | @property (nonatomic, strong) QTSelf *self; |
| 1704 | 1713 | @property (nonatomic, strong) QTSendable *sendable; |
| 1705 | 1714 | @property (nonatomic, strong) QTSerialDescriptor *serialDescriptor; |
| @@ -1732,6 +1741,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 1732 | 1741 | @property (nonatomic, strong) QTTimeOnly *timeOnly; |
| 1733 | 1742 | @property (nonatomic, strong) QTTimeOnlyConverter *timeOnlyConverter; |
| 1734 | 1743 | @property (nonatomic, strong) QTTimeZone *timeZone; |
| 1744 | +@property (nonatomic, strong) QTToDict *toDict; | |
| 1735 | 1745 | @property (nonatomic, strong) QTToJSON *toJSON; |
| 1736 | 1746 | @property (nonatomic, strong) QTToString *toString; |
| 1737 | 1747 | @property (nonatomic, strong) QTTopLevelClass *topLevel; |
| @@ -1745,10 +1755,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 1745 | 1755 | @property (nonatomic, strong) QTUlong *ulong; |
| 1746 | 1756 | @property (nonatomic, strong) QTUnchecked *unchecked; |
| 1747 | 1757 | @property (nonatomic, strong) QTUndefined *undefined; |
| 1758 | +@property (nonatomic, strong) QTUnmarshalJSON *unmarshalJSON; | |
| 1748 | 1759 | @property (nonatomic, strong) QTUnowned *unowned; |
| 1749 | 1760 | @property (nonatomic, strong) QTUnsafe *unsafe; |
| 1750 | 1761 | @property (nonatomic, strong) QTUseSerializers *useSerializers; |
| 1751 | -@property (nonatomic, strong) QTUshort *ushort; | |
| 1752 | 1762 | @end |
| 1753 | 1763 | |
| 1754 | 1764 | @interface QTKSerializer : NSObject |
| @@ -1803,14 +1813,14 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 1803 | 1813 | @property (nonatomic, assign) NSInteger unionUnion; |
| 1804 | 1814 | @end |
| 1805 | 1815 | |
| 1806 | -@interface QTUnsigned : NSObject | |
| 1807 | -@property (nonatomic, assign) NSInteger unsignedUnsigned; | |
| 1808 | -@end | |
| 1809 | - | |
| 1810 | 1816 | @interface QTPrimitiveKind : NSObject |
| 1811 | 1817 | @property (nonatomic, assign) NSInteger primitiveKind; |
| 1812 | 1818 | @end |
| 1813 | 1819 | |
| 1820 | +@interface QTSelect : NSObject | |
| 1821 | +@property (nonatomic, assign) NSInteger select; | |
| 1822 | +@end | |
| 1823 | + | |
| 1814 | 1824 | @interface QTSelf : NSObject |
| 1815 | 1825 | @property (nonatomic, assign) NSInteger self; |
| 1816 | 1826 | @end |
| @@ -1939,6 +1949,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 1939 | 1949 | @property (nonatomic, assign) NSInteger timeZone; |
| 1940 | 1950 | @end |
| 1941 | 1951 | |
| 1952 | +@interface QTToDict : NSObject | |
| 1953 | +@property (nonatomic, assign) NSInteger toDict; | |
| 1954 | +@end | |
| 1955 | + | |
| 1942 | 1956 | @interface QTToJSON : NSObject |
| 1943 | 1957 | @property (nonatomic, assign) NSInteger toJSON; |
| 1944 | 1958 | @end |
| @@ -1991,6 +2005,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 1991 | 2005 | @property (nonatomic, assign) NSInteger undefined; |
| 1992 | 2006 | @end |
| 1993 | 2007 | |
| 2008 | +@interface QTUnmarshalJSON : NSObject | |
| 2009 | +@property (nonatomic, assign) NSInteger unmarshalJSON; | |
| 2010 | +@end | |
| 2011 | + | |
| 1994 | 2012 | @interface QTUnowned : NSObject |
| 1995 | 2013 | @property (nonatomic, assign) NSInteger unowned; |
| 1996 | 2014 | @end |
| @@ -2003,15 +2021,13 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 2003 | 2021 | @property (nonatomic, assign) NSInteger useSerializers; |
| 2004 | 2022 | @end |
| 2005 | 2023 | |
| 2006 | -@interface QTUshort : NSObject | |
| 2007 | -@property (nonatomic, assign) NSInteger ushort; | |
| 2008 | -@end | |
| 2009 | - | |
| 2010 | 2024 | @interface QTObj6 : NSObject |
| 2011 | 2025 | @property (nonatomic, assign) NSInteger dummy; |
| 2026 | +@property (nonatomic, strong) QTUnsigned *obj6Unsigned; | |
| 2012 | 2027 | @property (nonatomic, strong) QTVoid *obj6Void; |
| 2013 | 2028 | @property (nonatomic, strong) QTVolatile *obj6Volatile; |
| 2014 | 2029 | @property (nonatomic, strong) QTWhile *obj6While; |
| 2030 | +@property (nonatomic, strong) QTUshort *ushort; | |
| 2015 | 2031 | @property (nonatomic, strong) QTUsing *using; |
| 2016 | 2032 | @property (nonatomic, strong) QTUtf8JSONReader *utf8JSONReader; |
| 2017 | 2033 | @property (nonatomic, strong) QTUtf8JSONWriter *utf8JSONWriter; |
| @@ -2029,6 +2045,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 2029 | 2045 | @property (nonatomic, strong) QTYield *yield; |
| 2030 | 2046 | @end |
| 2031 | 2047 | |
| 2048 | +@interface QTUnsigned : NSObject | |
| 2049 | +@property (nonatomic, assign) NSInteger unsignedUnsigned; | |
| 2050 | +@end | |
| 2051 | + | |
| 2032 | 2052 | @interface QTVoid : NSObject |
| 2033 | 2053 | @property (nonatomic, assign) NSInteger voidVoid; |
| 2034 | 2054 | @end |
| @@ -2041,6 +2061,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 2041 | 2061 | @property (nonatomic, assign) NSInteger whileWhile; |
| 2042 | 2062 | @end |
| 2043 | 2063 | |
| 2064 | +@interface QTUshort : NSObject | |
| 2065 | +@property (nonatomic, assign) NSInteger ushort; | |
| 2066 | +@end | |
| 2067 | + | |
| 2044 | 2068 | @interface QTUsing : NSObject |
| 2045 | 2069 | @property (nonatomic, assign) NSInteger using; |
| 2046 | 2070 | @end |
Mobjective-cdefault / QTTopLevel.m+481 −233
| @@ -578,6 +578,11 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 578 | 578 | - (NSDictionary *)JSONDictionary; |
| 579 | 579 | @end |
| 580 | 580 | |
| 581 | +@interface QTFromDict (JSONConversion) | |
| 582 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict; | |
| 583 | +- (NSDictionary *)JSONDictionary; | |
| 584 | +@end | |
| 585 | + | |
| 581 | 586 | @interface QTFromJSON (JSONConversion) |
| 582 | 587 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict; |
| 583 | 588 | - (NSDictionary *)JSONDictionary; |
| @@ -653,11 +658,6 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 653 | 658 | - (NSDictionary *)JSONDictionary; |
| 654 | 659 | @end |
| 655 | 660 | |
| 656 | -@interface QTGoto (JSONConversion) | |
| 657 | -+ (instancetype)fromJSONDictionary:(NSDictionary *)dict; | |
| 658 | -- (NSDictionary *)JSONDictionary; | |
| 659 | -@end | |
| 660 | - | |
| 661 | 661 | @interface QTFalseClass (JSONConversion) |
| 662 | 662 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict; |
| 663 | 663 | - (NSDictionary *)JSONDictionary; |
| @@ -903,6 +903,11 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 903 | 903 | - (NSDictionary *)JSONDictionary; |
| 904 | 904 | @end |
| 905 | 905 | |
| 906 | +@interface QTMarshalJSON (JSONConversion) | |
| 907 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict; | |
| 908 | +- (NSDictionary *)JSONDictionary; | |
| 909 | +@end | |
| 910 | + | |
| 906 | 911 | @interface QTMetadataPropertyHandling (JSONConversion) |
| 907 | 912 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict; |
| 908 | 913 | - (NSDictionary *)JSONDictionary; |
| @@ -943,7 +948,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 943 | 948 | - (NSDictionary *)JSONDictionary; |
| 944 | 949 | @end |
| 945 | 950 | |
| 946 | -@interface QTNoexcept (JSONConversion) | |
| 951 | +@interface QTGoto (JSONConversion) | |
| 947 | 952 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict; |
| 948 | 953 | - (NSDictionary *)JSONDictionary; |
| 949 | 954 | @end |
| @@ -998,6 +1003,11 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 998 | 1003 | - (NSDictionary *)JSONDictionary; |
| 999 | 1004 | @end |
| 1000 | 1005 | |
| 1006 | +@interface QTNoexcept (JSONConversion) | |
| 1007 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict; | |
| 1008 | +- (NSDictionary *)JSONDictionary; | |
| 1009 | +@end | |
| 1010 | + | |
| 1001 | 1011 | @interface QTNone (JSONConversion) |
| 1002 | 1012 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict; |
| 1003 | 1013 | - (NSDictionary *)JSONDictionary; |
| @@ -1308,11 +1318,6 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 1308 | 1318 | - (NSDictionary *)JSONDictionary; |
| 1309 | 1319 | @end |
| 1310 | 1320 | |
| 1311 | -@interface QTSelect (JSONConversion) | |
| 1312 | -+ (instancetype)fromJSONDictionary:(NSDictionary *)dict; | |
| 1313 | -- (NSDictionary *)JSONDictionary; | |
| 1314 | -@end | |
| 1315 | - | |
| 1316 | 1321 | @interface QTObj5 (JSONConversion) |
| 1317 | 1322 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict; |
| 1318 | 1323 | - (NSDictionary *)JSONDictionary; |
| @@ -1383,12 +1388,12 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 1383 | 1388 | - (NSDictionary *)JSONDictionary; |
| 1384 | 1389 | @end |
| 1385 | 1390 | |
| 1386 | -@interface QTUnsigned (JSONConversion) | |
| 1391 | +@interface QTPrimitiveKind (JSONConversion) | |
| 1387 | 1392 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict; |
| 1388 | 1393 | - (NSDictionary *)JSONDictionary; |
| 1389 | 1394 | @end |
| 1390 | 1395 | |
| 1391 | -@interface QTPrimitiveKind (JSONConversion) | |
| 1396 | +@interface QTSelect (JSONConversion) | |
| 1392 | 1397 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict; |
| 1393 | 1398 | - (NSDictionary *)JSONDictionary; |
| 1394 | 1399 | @end |
| @@ -1553,6 +1558,11 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 1553 | 1558 | - (NSDictionary *)JSONDictionary; |
| 1554 | 1559 | @end |
| 1555 | 1560 | |
| 1561 | +@interface QTToDict (JSONConversion) | |
| 1562 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict; | |
| 1563 | +- (NSDictionary *)JSONDictionary; | |
| 1564 | +@end | |
| 1565 | + | |
| 1556 | 1566 | @interface QTToJSON (JSONConversion) |
| 1557 | 1567 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict; |
| 1558 | 1568 | - (NSDictionary *)JSONDictionary; |
| @@ -1618,6 +1628,11 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 1618 | 1628 | - (NSDictionary *)JSONDictionary; |
| 1619 | 1629 | @end |
| 1620 | 1630 | |
| 1631 | +@interface QTUnmarshalJSON (JSONConversion) | |
| 1632 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict; | |
| 1633 | +- (NSDictionary *)JSONDictionary; | |
| 1634 | +@end | |
| 1635 | + | |
| 1621 | 1636 | @interface QTUnowned (JSONConversion) |
| 1622 | 1637 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict; |
| 1623 | 1638 | - (NSDictionary *)JSONDictionary; |
| @@ -1633,12 +1648,12 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 1633 | 1648 | - (NSDictionary *)JSONDictionary; |
| 1634 | 1649 | @end |
| 1635 | 1650 | |
| 1636 | -@interface QTUshort (JSONConversion) | |
| 1651 | +@interface QTObj6 (JSONConversion) | |
| 1637 | 1652 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict; |
| 1638 | 1653 | - (NSDictionary *)JSONDictionary; |
| 1639 | 1654 | @end |
| 1640 | 1655 | |
| 1641 | -@interface QTObj6 (JSONConversion) | |
| 1656 | +@interface QTUnsigned (JSONConversion) | |
| 1642 | 1657 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict; |
| 1643 | 1658 | - (NSDictionary *)JSONDictionary; |
| 1644 | 1659 | @end |
| @@ -1658,6 +1673,11 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 1658 | 1673 | - (NSDictionary *)JSONDictionary; |
| 1659 | 1674 | @end |
| 1660 | 1675 | |
| 1676 | +@interface QTUshort (JSONConversion) | |
| 1677 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict; | |
| 1678 | +- (NSDictionary *)JSONDictionary; | |
| 1679 | +@end | |
| 1680 | + | |
| 1661 | 1681 | @interface QTUsing (JSONConversion) |
| 1662 | 1682 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict; |
| 1663 | 1683 | - (NSDictionary *)JSONDictionary; |
| @@ -5331,6 +5351,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 5331 | 5351 | @"FormatException": @"formatException", |
| 5332 | 5352 | @"friend": @"friend", |
| 5333 | 5353 | @"from": @"from", |
| 5354 | + @"from_dict": @"fromDict", | |
| 5334 | 5355 | @"from_json": @"fromJSON", |
| 5335 | 5356 | @"func": @"func", |
| 5336 | 5357 | @"function": @"function", |
| @@ -5346,7 +5367,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 5346 | 5367 | @"False": @"obj2False", |
| 5347 | 5368 | @"float": @"obj2Float", |
| 5348 | 5369 | @"for": @"obj2For", |
| 5349 | - @"goto": @"obj2Goto", | |
| 5350 | 5370 | @"false": @"theFalse", |
| 5351 | 5371 | }; |
| 5352 | 5372 | } |
| @@ -5408,6 +5428,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 5408 | 5428 | if (![dict[@"FormatException"] isKindOfClass:NSDictionary.class]) return nil; |
| 5409 | 5429 | if (![dict[@"friend"] isKindOfClass:NSDictionary.class]) return nil; |
| 5410 | 5430 | if (![dict[@"from"] isKindOfClass:NSDictionary.class]) return nil; |
| 5431 | + if (![dict[@"from_dict"] isKindOfClass:NSDictionary.class]) return nil; | |
| 5411 | 5432 | if (![dict[@"from_json"] isKindOfClass:NSDictionary.class]) return nil; |
| 5412 | 5433 | if (![dict[@"func"] isKindOfClass:NSDictionary.class]) return nil; |
| 5413 | 5434 | if (![dict[@"function"] isKindOfClass:NSDictionary.class]) return nil; |
| @@ -5423,7 +5444,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 5423 | 5444 | if (![dict[@"False"] isKindOfClass:NSDictionary.class]) return nil; |
| 5424 | 5445 | if (![dict[@"float"] isKindOfClass:NSDictionary.class]) return nil; |
| 5425 | 5446 | if (![dict[@"for"] isKindOfClass:NSDictionary.class]) return nil; |
| 5426 | - if (![dict[@"goto"] isKindOfClass:NSDictionary.class]) return nil; | |
| 5427 | 5447 | if (![dict[@"false"] isKindOfClass:NSDictionary.class]) return nil; |
| 5428 | 5448 | [self setValuesForKeysWithDictionary:dict]; |
| 5429 | 5449 | _dateFormatter = [QTDateFormatter fromJSONDictionary:(id)_dateFormatter]; |
| @@ -5520,6 +5540,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 5520 | 5540 | if (!_friend && dict[@"friend"] && ![dict[@"friend"] isKindOfClass:NSNull.class]) return nil; |
| 5521 | 5541 | _from = [QTFrom fromJSONDictionary:(id)_from]; |
| 5522 | 5542 | if (!_from && dict[@"from"] && ![dict[@"from"] isKindOfClass:NSNull.class]) return nil; |
| 5543 | + _fromDict = [QTFromDict fromJSONDictionary:(id)_fromDict]; | |
| 5544 | + if (!_fromDict && dict[@"from_dict"] && ![dict[@"from_dict"] isKindOfClass:NSNull.class]) return nil; | |
| 5523 | 5545 | _fromJSON = [QTFromJSON fromJSONDictionary:(id)_fromJSON]; |
| 5524 | 5546 | if (!_fromJSON && dict[@"from_json"] && ![dict[@"from_json"] isKindOfClass:NSNull.class]) return nil; |
| 5525 | 5547 | _func = [QTFunc fromJSONDictionary:(id)_func]; |
| @@ -5550,8 +5572,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 5550 | 5572 | if (!_obj2Float && dict[@"float"] && ![dict[@"float"] isKindOfClass:NSNull.class]) return nil; |
| 5551 | 5573 | _obj2For = [QTFor fromJSONDictionary:(id)_obj2For]; |
| 5552 | 5574 | if (!_obj2For && dict[@"for"] && ![dict[@"for"] isKindOfClass:NSNull.class]) return nil; |
| 5553 | - _obj2Goto = [QTGoto fromJSONDictionary:(id)_obj2Goto]; | |
| 5554 | - if (!_obj2Goto && dict[@"goto"] && ![dict[@"goto"] isKindOfClass:NSNull.class]) return nil; | |
| 5555 | 5575 | _theFalse = [QTFalseClass fromJSONDictionary:(id)_theFalse]; |
| 5556 | 5576 | if (!_theFalse && dict[@"false"] && ![dict[@"false"] isKindOfClass:NSNull.class]) return nil; |
| 5557 | 5577 | } |
| @@ -5630,6 +5650,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 5630 | 5650 | @"FormatException": [_formatException JSONDictionary], |
| 5631 | 5651 | @"friend": [_friend JSONDictionary], |
| 5632 | 5652 | @"from": [_from JSONDictionary], |
| 5653 | + @"from_dict": [_fromDict JSONDictionary], | |
| 5633 | 5654 | @"from_json": [_fromJSON JSONDictionary], |
| 5634 | 5655 | @"func": [_func JSONDictionary], |
| 5635 | 5656 | @"function": [_function JSONDictionary], |
| @@ -5645,7 +5666,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 5645 | 5666 | @"False": [_obj2False JSONDictionary], |
| 5646 | 5667 | @"float": [_obj2Float JSONDictionary], |
| 5647 | 5668 | @"for": [_obj2For JSONDictionary], |
| 5648 | - @"goto": [_obj2Goto JSONDictionary], | |
| 5649 | 5669 | @"false": [_theFalse JSONDictionary], |
| 5650 | 5670 | }]; |
| 5651 | 5671 | |
| @@ -7781,6 +7801,58 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 7781 | 7801 | } |
| 7782 | 7802 | @end |
| 7783 | 7803 | |
| 7804 | +@implementation QTFromDict | |
| 7805 | ++ (NSDictionary<NSString *, NSString *> *)properties | |
| 7806 | +{ | |
| 7807 | + static NSDictionary<NSString *, NSString *> *properties; | |
| 7808 | + return properties = properties ? properties : @{ | |
| 7809 | + @"from_dict": @"fromDict", | |
| 7810 | + }; | |
| 7811 | +} | |
| 7812 | + | |
| 7813 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict | |
| 7814 | +{ | |
| 7815 | + return [dict isKindOfClass:NSDictionary.class] ? [[QTFromDict alloc] initWithJSONDictionary:dict] : nil; | |
| 7816 | +} | |
| 7817 | + | |
| 7818 | +- (instancetype)initWithJSONDictionary:(NSDictionary *)dict | |
| 7819 | +{ | |
| 7820 | + if (self = [super init]) { | |
| 7821 | + if (![dict[@"from_dict"] isKindOfClass:NSNumber.class]) return nil; | |
| 7822 | + if ([dict[@"from_dict"] doubleValue] != [dict[@"from_dict"] longLongValue]) return nil; | |
| 7823 | + [self setValuesForKeysWithDictionary:dict]; | |
| 7824 | + } | |
| 7825 | + return self; | |
| 7826 | +} | |
| 7827 | + | |
| 7828 | +- (void)setValue:(nullable id)value forKey:(NSString *)key | |
| 7829 | +{ | |
| 7830 | + id resolved = QTFromDict.properties[key]; | |
| 7831 | + if (resolved) [super setValue:value forKey:resolved]; | |
| 7832 | +} | |
| 7833 | + | |
| 7834 | +- (void)setNilValueForKey:(NSString *)key | |
| 7835 | +{ | |
| 7836 | + id resolved = QTFromDict.properties[key]; | |
| 7837 | + if (resolved) [super setValue:@(0) forKey:resolved]; | |
| 7838 | +} | |
| 7839 | + | |
| 7840 | +- (NSDictionary *)JSONDictionary | |
| 7841 | +{ | |
| 7842 | + id dict = [[self dictionaryWithValuesForKeys:QTFromDict.properties.allValues] mutableCopy]; | |
| 7843 | + | |
| 7844 | + for (id jsonName in QTFromDict.properties) { | |
| 7845 | + id propertyName = QTFromDict.properties[jsonName]; | |
| 7846 | + if (![jsonName isEqualToString:propertyName]) { | |
| 7847 | + dict[jsonName] = dict[propertyName]; | |
| 7848 | + [dict removeObjectForKey:propertyName]; | |
| 7849 | + } | |
| 7850 | + } | |
| 7851 | + | |
| 7852 | + return dict; | |
| 7853 | +} | |
| 7854 | +@end | |
| 7855 | + | |
| 7784 | 7856 | @implementation QTFromJSON |
| 7785 | 7857 | + (NSDictionary<NSString *, NSString *> *)properties |
| 7786 | 7858 | { |
| @@ -8511,58 +8583,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 8511 | 8583 | } |
| 8512 | 8584 | @end |
| 8513 | 8585 | |
| 8514 | -@implementation QTGoto | |
| 8515 | -+ (NSDictionary<NSString *, NSString *> *)properties | |
| 8516 | -{ | |
| 8517 | - static NSDictionary<NSString *, NSString *> *properties; | |
| 8518 | - return properties = properties ? properties : @{ | |
| 8519 | - @"goto": @"gotoGoto", | |
| 8520 | - }; | |
| 8521 | -} | |
| 8522 | - | |
| 8523 | -+ (instancetype)fromJSONDictionary:(NSDictionary *)dict | |
| 8524 | -{ | |
| 8525 | - return [dict isKindOfClass:NSDictionary.class] ? [[QTGoto alloc] initWithJSONDictionary:dict] : nil; | |
| 8526 | -} | |
| 8527 | - | |
| 8528 | -- (instancetype)initWithJSONDictionary:(NSDictionary *)dict | |
| 8529 | -{ | |
| 8530 | - if (self = [super init]) { | |
| 8531 | - if (![dict[@"goto"] isKindOfClass:NSNumber.class]) return nil; | |
| 8532 | - if ([dict[@"goto"] doubleValue] != [dict[@"goto"] longLongValue]) return nil; | |
| 8533 | - [self setValuesForKeysWithDictionary:dict]; | |
| 8534 | - } | |
| 8535 | - return self; | |
| 8536 | -} | |
| 8537 | - | |
| 8538 | -- (void)setValue:(nullable id)value forKey:(NSString *)key | |
| 8539 | -{ | |
| 8540 | - id resolved = QTGoto.properties[key]; | |
| 8541 | - if (resolved) [super setValue:value forKey:resolved]; | |
| 8542 | -} | |
| 8543 | - | |
| 8544 | -- (void)setNilValueForKey:(NSString *)key | |
| 8545 | -{ | |
| 8546 | - id resolved = QTGoto.properties[key]; | |
| 8547 | - if (resolved) [super setValue:@(0) forKey:resolved]; | |
| 8548 | -} | |
| 8549 | - | |
| 8550 | -- (NSDictionary *)JSONDictionary | |
| 8551 | -{ | |
| 8552 | - id dict = [[self dictionaryWithValuesForKeys:QTGoto.properties.allValues] mutableCopy]; | |
| 8553 | - | |
| 8554 | - for (id jsonName in QTGoto.properties) { | |
| 8555 | - id propertyName = QTGoto.properties[jsonName]; | |
| 8556 | - if (![jsonName isEqualToString:propertyName]) { | |
| 8557 | - dict[jsonName] = dict[propertyName]; | |
| 8558 | - [dict removeObjectForKey:propertyName]; | |
| 8559 | - } | |
| 8560 | - } | |
| 8561 | - | |
| 8562 | - return dict; | |
| 8563 | -} | |
| 8564 | -@end | |
| 8565 | - | |
| 8566 | 8586 | @implementation QTFalseClass |
| 8567 | 8587 | + (NSDictionary<NSString *, NSString *> *)properties |
| 8568 | 8588 | { |
| @@ -8668,6 +8688,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 8668 | 8688 | @"lock": @"lock", |
| 8669 | 8689 | @"map": @"map", |
| 8670 | 8690 | @"MapEntry": @"mapEntry", |
| 8691 | + @"MarshalJSON": @"marshalJSON", | |
| 8671 | 8692 | @"metadata_property_handling": @"metadataPropertyHandling", |
| 8672 | 8693 | @"module": @"module", |
| 8673 | 8694 | @"mutable": @"mutable", |
| @@ -8676,7 +8697,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 8676 | 8697 | @"native": @"native", |
| 8677 | 8698 | @"newtonsoft": @"newtonsoft", |
| 8678 | 8699 | @"NO": @"no", |
| 8679 | - @"noexcept": @"noexcept", | |
| 8700 | + @"goto": @"obj3Goto", | |
| 8680 | 8701 | @"if": @"obj3If", |
| 8681 | 8702 | @"inline": @"obj3Inline", |
| 8682 | 8703 | @"int": @"obj3Int", |
| @@ -8745,6 +8766,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 8745 | 8766 | if (![dict[@"lock"] isKindOfClass:NSDictionary.class]) return nil; |
| 8746 | 8767 | if (![dict[@"map"] isKindOfClass:NSDictionary.class]) return nil; |
| 8747 | 8768 | if (![dict[@"MapEntry"] isKindOfClass:NSDictionary.class]) return nil; |
| 8769 | + if (![dict[@"MarshalJSON"] isKindOfClass:NSDictionary.class]) return nil; | |
| 8748 | 8770 | if (![dict[@"metadata_property_handling"] isKindOfClass:NSDictionary.class]) return nil; |
| 8749 | 8771 | if (![dict[@"module"] isKindOfClass:NSDictionary.class]) return nil; |
| 8750 | 8772 | if (![dict[@"mutable"] isKindOfClass:NSDictionary.class]) return nil; |
| @@ -8753,7 +8775,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 8753 | 8775 | if (![dict[@"native"] isKindOfClass:NSDictionary.class]) return nil; |
| 8754 | 8776 | if (![dict[@"newtonsoft"] isKindOfClass:NSDictionary.class]) return nil; |
| 8755 | 8777 | if (![dict[@"NO"] isKindOfClass:NSDictionary.class]) return nil; |
| 8756 | - if (![dict[@"noexcept"] isKindOfClass:NSDictionary.class]) return nil; | |
| 8778 | + if (![dict[@"goto"] isKindOfClass:NSDictionary.class]) return nil; | |
| 8757 | 8779 | if (![dict[@"if"] isKindOfClass:NSDictionary.class]) return nil; |
| 8758 | 8780 | if (![dict[@"inline"] isKindOfClass:NSDictionary.class]) return nil; |
| 8759 | 8781 | if (![dict[@"int"] isKindOfClass:NSDictionary.class]) return nil; |
| @@ -8857,6 +8879,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 8857 | 8879 | if (!_map && dict[@"map"] && ![dict[@"map"] isKindOfClass:NSNull.class]) return nil; |
| 8858 | 8880 | _mapEntry = [QTMapEntry fromJSONDictionary:(id)_mapEntry]; |
| 8859 | 8881 | if (!_mapEntry && dict[@"MapEntry"] && ![dict[@"MapEntry"] isKindOfClass:NSNull.class]) return nil; |
| 8882 | + _marshalJSON = [QTMarshalJSON fromJSONDictionary:(id)_marshalJSON]; | |
| 8883 | + if (!_marshalJSON && dict[@"MarshalJSON"] && ![dict[@"MarshalJSON"] isKindOfClass:NSNull.class]) return nil; | |
| 8860 | 8884 | _metadataPropertyHandling = [QTMetadataPropertyHandling fromJSONDictionary:(id)_metadataPropertyHandling]; |
| 8861 | 8885 | if (!_metadataPropertyHandling && dict[@"metadata_property_handling"] && ![dict[@"metadata_property_handling"] isKindOfClass:NSNull.class]) return nil; |
| 8862 | 8886 | _module = [QTModule fromJSONDictionary:(id)_module]; |
| @@ -8873,8 +8897,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 8873 | 8897 | if (!_newtonsoft && dict[@"newtonsoft"] && ![dict[@"newtonsoft"] isKindOfClass:NSNull.class]) return nil; |
| 8874 | 8898 | _no = [QTNo fromJSONDictionary:(id)_no]; |
| 8875 | 8899 | if (!_no && dict[@"NO"] && ![dict[@"NO"] isKindOfClass:NSNull.class]) return nil; |
| 8876 | - _noexcept = [QTNoexcept fromJSONDictionary:(id)_noexcept]; | |
| 8877 | - if (!_noexcept && dict[@"noexcept"] && ![dict[@"noexcept"] isKindOfClass:NSNull.class]) return nil; | |
| 8900 | + _obj3Goto = [QTGoto fromJSONDictionary:(id)_obj3Goto]; | |
| 8901 | + if (!_obj3Goto && dict[@"goto"] && ![dict[@"goto"] isKindOfClass:NSNull.class]) return nil; | |
| 8878 | 8902 | _obj3If = [QTIf fromJSONDictionary:(id)_obj3If]; |
| 8879 | 8903 | if (!_obj3If && dict[@"if"] && ![dict[@"if"] isKindOfClass:NSNull.class]) return nil; |
| 8880 | 8904 | _obj3Inline = [QTInline fromJSONDictionary:(id)_obj3Inline]; |
| @@ -8967,6 +8991,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 8967 | 8991 | @"lock": [_lock JSONDictionary], |
| 8968 | 8992 | @"map": [_map JSONDictionary], |
| 8969 | 8993 | @"MapEntry": [_mapEntry JSONDictionary], |
| 8994 | + @"MarshalJSON": [_marshalJSON JSONDictionary], | |
| 8970 | 8995 | @"metadata_property_handling": [_metadataPropertyHandling JSONDictionary], |
| 8971 | 8996 | @"module": [_module JSONDictionary], |
| 8972 | 8997 | @"mutable": [_mutable JSONDictionary], |
| @@ -8975,7 +9000,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 8975 | 9000 | @"native": [_native JSONDictionary], |
| 8976 | 9001 | @"newtonsoft": [_newtonsoft JSONDictionary], |
| 8977 | 9002 | @"NO": [_no JSONDictionary], |
| 8978 | - @"noexcept": [_noexcept JSONDictionary], | |
| 9003 | + @"goto": [_obj3Goto JSONDictionary], | |
| 8979 | 9004 | @"if": [_obj3If JSONDictionary], |
| 8980 | 9005 | @"inline": [_obj3Inline JSONDictionary], |
| 8981 | 9006 | @"int": [_obj3Int JSONDictionary], |
| @@ -11183,6 +11208,58 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 11183 | 11208 | } |
| 11184 | 11209 | @end |
| 11185 | 11210 | |
| 11211 | +@implementation QTMarshalJSON | |
| 11212 | ++ (NSDictionary<NSString *, NSString *> *)properties | |
| 11213 | +{ | |
| 11214 | + static NSDictionary<NSString *, NSString *> *properties; | |
| 11215 | + return properties = properties ? properties : @{ | |
| 11216 | + @"MarshalJSON": @"marshalJSON", | |
| 11217 | + }; | |
| 11218 | +} | |
| 11219 | + | |
| 11220 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict | |
| 11221 | +{ | |
| 11222 | + return [dict isKindOfClass:NSDictionary.class] ? [[QTMarshalJSON alloc] initWithJSONDictionary:dict] : nil; | |
| 11223 | +} | |
| 11224 | + | |
| 11225 | +- (instancetype)initWithJSONDictionary:(NSDictionary *)dict | |
| 11226 | +{ | |
| 11227 | + if (self = [super init]) { | |
| 11228 | + if (![dict[@"MarshalJSON"] isKindOfClass:NSNumber.class]) return nil; | |
| 11229 | + if ([dict[@"MarshalJSON"] doubleValue] != [dict[@"MarshalJSON"] longLongValue]) return nil; | |
| 11230 | + [self setValuesForKeysWithDictionary:dict]; | |
| 11231 | + } | |
| 11232 | + return self; | |
| 11233 | +} | |
| 11234 | + | |
| 11235 | +- (void)setValue:(nullable id)value forKey:(NSString *)key | |
| 11236 | +{ | |
| 11237 | + id resolved = QTMarshalJSON.properties[key]; | |
| 11238 | + if (resolved) [super setValue:value forKey:resolved]; | |
| 11239 | +} | |
| 11240 | + | |
| 11241 | +- (void)setNilValueForKey:(NSString *)key | |
| 11242 | +{ | |
| 11243 | + id resolved = QTMarshalJSON.properties[key]; | |
| 11244 | + if (resolved) [super setValue:@(0) forKey:resolved]; | |
| 11245 | +} | |
| 11246 | + | |
| 11247 | +- (NSDictionary *)JSONDictionary | |
| 11248 | +{ | |
| 11249 | + id dict = [[self dictionaryWithValuesForKeys:QTMarshalJSON.properties.allValues] mutableCopy]; | |
| 11250 | + | |
| 11251 | + for (id jsonName in QTMarshalJSON.properties) { | |
| 11252 | + id propertyName = QTMarshalJSON.properties[jsonName]; | |
| 11253 | + if (![jsonName isEqualToString:propertyName]) { | |
| 11254 | + dict[jsonName] = dict[propertyName]; | |
| 11255 | + [dict removeObjectForKey:propertyName]; | |
| 11256 | + } | |
| 11257 | + } | |
| 11258 | + | |
| 11259 | + return dict; | |
| 11260 | +} | |
| 11261 | +@end | |
| 11262 | + | |
| 11186 | 11263 | @implementation QTMetadataPropertyHandling |
| 11187 | 11264 | + (NSDictionary<NSString *, NSString *> *)properties |
| 11188 | 11265 | { |
| @@ -11539,25 +11616,25 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 11539 | 11616 | } |
| 11540 | 11617 | @end |
| 11541 | 11618 | |
| 11542 | -@implementation QTNoexcept | |
| 11619 | +@implementation QTGoto | |
| 11543 | 11620 | + (NSDictionary<NSString *, NSString *> *)properties |
| 11544 | 11621 | { |
| 11545 | 11622 | static NSDictionary<NSString *, NSString *> *properties; |
| 11546 | 11623 | return properties = properties ? properties : @{ |
| 11547 | - @"noexcept": @"noexcept", | |
| 11624 | + @"goto": @"gotoGoto", | |
| 11548 | 11625 | }; |
| 11549 | 11626 | } |
| 11550 | 11627 | |
| 11551 | 11628 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict |
| 11552 | 11629 | { |
| 11553 | - return [dict isKindOfClass:NSDictionary.class] ? [[QTNoexcept alloc] initWithJSONDictionary:dict] : nil; | |
| 11630 | + return [dict isKindOfClass:NSDictionary.class] ? [[QTGoto alloc] initWithJSONDictionary:dict] : nil; | |
| 11554 | 11631 | } |
| 11555 | 11632 | |
| 11556 | 11633 | - (instancetype)initWithJSONDictionary:(NSDictionary *)dict |
| 11557 | 11634 | { |
| 11558 | 11635 | if (self = [super init]) { |
| 11559 | - if (![dict[@"noexcept"] isKindOfClass:NSNumber.class]) return nil; | |
| 11560 | - if ([dict[@"noexcept"] doubleValue] != [dict[@"noexcept"] longLongValue]) return nil; | |
| 11636 | + if (![dict[@"goto"] isKindOfClass:NSNumber.class]) return nil; | |
| 11637 | + if ([dict[@"goto"] doubleValue] != [dict[@"goto"] longLongValue]) return nil; | |
| 11561 | 11638 | [self setValuesForKeysWithDictionary:dict]; |
| 11562 | 11639 | } |
| 11563 | 11640 | return self; |
| @@ -11565,19 +11642,29 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 11565 | 11642 | |
| 11566 | 11643 | - (void)setValue:(nullable id)value forKey:(NSString *)key |
| 11567 | 11644 | { |
| 11568 | - id resolved = QTNoexcept.properties[key]; | |
| 11645 | + id resolved = QTGoto.properties[key]; | |
| 11569 | 11646 | if (resolved) [super setValue:value forKey:resolved]; |
| 11570 | 11647 | } |
| 11571 | 11648 | |
| 11572 | 11649 | - (void)setNilValueForKey:(NSString *)key |
| 11573 | 11650 | { |
| 11574 | - id resolved = QTNoexcept.properties[key]; | |
| 11651 | + id resolved = QTGoto.properties[key]; | |
| 11575 | 11652 | if (resolved) [super setValue:@(0) forKey:resolved]; |
| 11576 | 11653 | } |
| 11577 | 11654 | |
| 11578 | 11655 | - (NSDictionary *)JSONDictionary |
| 11579 | 11656 | { |
| 11580 | - return [self dictionaryWithValuesForKeys:QTNoexcept.properties.allValues]; | |
| 11657 | + id dict = [[self dictionaryWithValuesForKeys:QTGoto.properties.allValues] mutableCopy]; | |
| 11658 | + | |
| 11659 | + for (id jsonName in QTGoto.properties) { | |
| 11660 | + id propertyName = QTGoto.properties[jsonName]; | |
| 11661 | + if (![jsonName isEqualToString:propertyName]) { | |
| 11662 | + dict[jsonName] = dict[propertyName]; | |
| 11663 | + [dict removeObjectForKey:propertyName]; | |
| 11664 | + } | |
| 11665 | + } | |
| 11666 | + | |
| 11667 | + return dict; | |
| 11581 | 11668 | } |
| 11582 | 11669 | @end |
| 11583 | 11670 | |
| @@ -12004,6 +12091,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 12004 | 12091 | return properties = properties ? properties : @{ |
| 12005 | 12092 | @"dummy": @"dummy", |
| 12006 | 12093 | @"noSuchMethod": @"noSuchMethod", |
| 12094 | + @"noexcept": @"noexcept", | |
| 12007 | 12095 | @"None": @"none", |
| 12008 | 12096 | @"nonlocal": @"nonlocal", |
| 12009 | 12097 | @"nonmutating": @"nonmutating", |
| @@ -12066,7 +12154,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 12066 | 12154 | @"sbyte": @"sbyte", |
| 12067 | 12155 | @"sealed": @"sealed", |
| 12068 | 12156 | @"SEL": @"sel", |
| 12069 | - @"select": @"select", | |
| 12070 | 12157 | }; |
| 12071 | 12158 | } |
| 12072 | 12159 | |
| @@ -12081,6 +12168,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 12081 | 12168 | if (![dict[@"dummy"] isKindOfClass:NSNumber.class]) return nil; |
| 12082 | 12169 | if ([dict[@"dummy"] doubleValue] != [dict[@"dummy"] longLongValue]) return nil; |
| 12083 | 12170 | if (![dict[@"noSuchMethod"] isKindOfClass:NSDictionary.class]) return nil; |
| 12171 | + if (![dict[@"noexcept"] isKindOfClass:NSDictionary.class]) return nil; | |
| 12084 | 12172 | if (![dict[@"None"] isKindOfClass:NSDictionary.class]) return nil; |
| 12085 | 12173 | if (![dict[@"nonlocal"] isKindOfClass:NSDictionary.class]) return nil; |
| 12086 | 12174 | if (![dict[@"nonmutating"] isKindOfClass:NSDictionary.class]) return nil; |
| @@ -12143,10 +12231,11 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 12143 | 12231 | if (![dict[@"sbyte"] isKindOfClass:NSDictionary.class]) return nil; |
| 12144 | 12232 | if (![dict[@"sealed"] isKindOfClass:NSDictionary.class]) return nil; |
| 12145 | 12233 | if (![dict[@"SEL"] isKindOfClass:NSDictionary.class]) return nil; |
| 12146 | - if (![dict[@"select"] isKindOfClass:NSDictionary.class]) return nil; | |
| 12147 | 12234 | [self setValuesForKeysWithDictionary:dict]; |
| 12148 | 12235 | _noSuchMethod = [QTNoSuchMethod fromJSONDictionary:(id)_noSuchMethod]; |
| 12149 | 12236 | if (!_noSuchMethod && dict[@"noSuchMethod"] && ![dict[@"noSuchMethod"] isKindOfClass:NSNull.class]) return nil; |
| 12237 | + _noexcept = [QTNoexcept fromJSONDictionary:(id)_noexcept]; | |
| 12238 | + if (!_noexcept && dict[@"noexcept"] && ![dict[@"noexcept"] isKindOfClass:NSNull.class]) return nil; | |
| 12150 | 12239 | _none = [QTNone fromJSONDictionary:(id)_none]; |
| 12151 | 12240 | if (!_none && dict[@"None"] && ![dict[@"None"] isKindOfClass:NSNull.class]) return nil; |
| 12152 | 12241 | _nonlocal = [QTNonlocal fromJSONDictionary:(id)_nonlocal]; |
| @@ -12271,8 +12360,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 12271 | 12360 | if (!_sealed && dict[@"sealed"] && ![dict[@"sealed"] isKindOfClass:NSNull.class]) return nil; |
| 12272 | 12361 | _sel = [QTSel fromJSONDictionary:(id)_sel]; |
| 12273 | 12362 | if (!_sel && dict[@"SEL"] && ![dict[@"SEL"] isKindOfClass:NSNull.class]) return nil; |
| 12274 | - _select = [QTSelect fromJSONDictionary:(id)_select]; | |
| 12275 | - if (!_select && dict[@"select"] && ![dict[@"select"] isKindOfClass:NSNull.class]) return nil; | |
| 12276 | 12363 | } |
| 12277 | 12364 | return self; |
| 12278 | 12365 | } |
| @@ -12303,6 +12390,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 12303 | 12390 | |
| 12304 | 12391 | [dict addEntriesFromDictionary:@{ |
| 12305 | 12392 | @"noSuchMethod": [_noSuchMethod JSONDictionary], |
| 12393 | + @"noexcept": [_noexcept JSONDictionary], | |
| 12306 | 12394 | @"None": [_none JSONDictionary], |
| 12307 | 12395 | @"nonlocal": [_nonlocal JSONDictionary], |
| 12308 | 12396 | @"nonmutating": [_nonmutating JSONDictionary], |
| @@ -12365,7 +12453,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 12365 | 12453 | @"sbyte": [_sbyte JSONDictionary], |
| 12366 | 12454 | @"sealed": [_sealed JSONDictionary], |
| 12367 | 12455 | @"SEL": [_sel JSONDictionary], |
| 12368 | - @"select": [_select JSONDictionary], | |
| 12369 | 12456 | }]; |
| 12370 | 12457 | |
| 12371 | 12458 | return dict; |
| @@ -12414,25 +12501,25 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 12414 | 12501 | } |
| 12415 | 12502 | @end |
| 12416 | 12503 | |
| 12417 | -@implementation QTNone | |
| 12504 | +@implementation QTNoexcept | |
| 12418 | 12505 | + (NSDictionary<NSString *, NSString *> *)properties |
| 12419 | 12506 | { |
| 12420 | 12507 | static NSDictionary<NSString *, NSString *> *properties; |
| 12421 | 12508 | return properties = properties ? properties : @{ |
| 12422 | - @"None": @"none", | |
| 12509 | + @"noexcept": @"noexcept", | |
| 12423 | 12510 | }; |
| 12424 | 12511 | } |
| 12425 | 12512 | |
| 12426 | 12513 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict |
| 12427 | 12514 | { |
| 12428 | - return [dict isKindOfClass:NSDictionary.class] ? [[QTNone alloc] initWithJSONDictionary:dict] : nil; | |
| 12515 | + return [dict isKindOfClass:NSDictionary.class] ? [[QTNoexcept alloc] initWithJSONDictionary:dict] : nil; | |
| 12429 | 12516 | } |
| 12430 | 12517 | |
| 12431 | 12518 | - (instancetype)initWithJSONDictionary:(NSDictionary *)dict |
| 12432 | 12519 | { |
| 12433 | 12520 | if (self = [super init]) { |
| 12434 | - if (![dict[@"None"] isKindOfClass:NSNumber.class]) return nil; | |
| 12435 | - if ([dict[@"None"] doubleValue] != [dict[@"None"] longLongValue]) return nil; | |
| 12521 | + if (![dict[@"noexcept"] isKindOfClass:NSNumber.class]) return nil; | |
| 12522 | + if ([dict[@"noexcept"] doubleValue] != [dict[@"noexcept"] longLongValue]) return nil; | |
| 12436 | 12523 | [self setValuesForKeysWithDictionary:dict]; |
| 12437 | 12524 | } |
| 12438 | 12525 | return self; |
| @@ -12440,44 +12527,86 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 12440 | 12527 | |
| 12441 | 12528 | - (void)setValue:(nullable id)value forKey:(NSString *)key |
| 12442 | 12529 | { |
| 12443 | - id resolved = QTNone.properties[key]; | |
| 12530 | + id resolved = QTNoexcept.properties[key]; | |
| 12444 | 12531 | if (resolved) [super setValue:value forKey:resolved]; |
| 12445 | 12532 | } |
| 12446 | 12533 | |
| 12447 | 12534 | - (void)setNilValueForKey:(NSString *)key |
| 12448 | 12535 | { |
| 12449 | - id resolved = QTNone.properties[key]; | |
| 12536 | + id resolved = QTNoexcept.properties[key]; | |
| 12450 | 12537 | if (resolved) [super setValue:@(0) forKey:resolved]; |
| 12451 | 12538 | } |
| 12452 | 12539 | |
| 12453 | 12540 | - (NSDictionary *)JSONDictionary |
| 12454 | 12541 | { |
| 12455 | - id dict = [[self dictionaryWithValuesForKeys:QTNone.properties.allValues] mutableCopy]; | |
| 12456 | - | |
| 12457 | - for (id jsonName in QTNone.properties) { | |
| 12458 | - id propertyName = QTNone.properties[jsonName]; | |
| 12459 | - if (![jsonName isEqualToString:propertyName]) { | |
| 12460 | - dict[jsonName] = dict[propertyName]; | |
| 12461 | - [dict removeObjectForKey:propertyName]; | |
| 12462 | - } | |
| 12463 | - } | |
| 12464 | - | |
| 12465 | - return dict; | |
| 12542 | + return [self dictionaryWithValuesForKeys:QTNoexcept.properties.allValues]; | |
| 12466 | 12543 | } |
| 12467 | 12544 | @end |
| 12468 | 12545 | |
| 12469 | -@implementation QTNonlocal | |
| 12546 | +@implementation QTNone | |
| 12470 | 12547 | + (NSDictionary<NSString *, NSString *> *)properties |
| 12471 | 12548 | { |
| 12472 | 12549 | static NSDictionary<NSString *, NSString *> *properties; |
| 12473 | 12550 | return properties = properties ? properties : @{ |
| 12474 | - @"nonlocal": @"nonlocal", | |
| 12551 | + @"None": @"none", | |
| 12475 | 12552 | }; |
| 12476 | 12553 | } |
| 12477 | 12554 | |
| 12478 | 12555 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict |
| 12479 | 12556 | { |
| 12480 | - return [dict isKindOfClass:NSDictionary.class] ? [[QTNonlocal alloc] initWithJSONDictionary:dict] : nil; | |
| 12557 | + return [dict isKindOfClass:NSDictionary.class] ? [[QTNone alloc] initWithJSONDictionary:dict] : nil; | |
| 12558 | +} | |
| 12559 | + | |
| 12560 | +- (instancetype)initWithJSONDictionary:(NSDictionary *)dict | |
| 12561 | +{ | |
| 12562 | + if (self = [super init]) { | |
| 12563 | + if (![dict[@"None"] isKindOfClass:NSNumber.class]) return nil; | |
| 12564 | + if ([dict[@"None"] doubleValue] != [dict[@"None"] longLongValue]) return nil; | |
| 12565 | + [self setValuesForKeysWithDictionary:dict]; | |
| 12566 | + } | |
| 12567 | + return self; | |
| 12568 | +} | |
| 12569 | + | |
| 12570 | +- (void)setValue:(nullable id)value forKey:(NSString *)key | |
| 12571 | +{ | |
| 12572 | + id resolved = QTNone.properties[key]; | |
| 12573 | + if (resolved) [super setValue:value forKey:resolved]; | |
| 12574 | +} | |
| 12575 | + | |
| 12576 | +- (void)setNilValueForKey:(NSString *)key | |
| 12577 | +{ | |
| 12578 | + id resolved = QTNone.properties[key]; | |
| 12579 | + if (resolved) [super setValue:@(0) forKey:resolved]; | |
| 12580 | +} | |
| 12581 | + | |
| 12582 | +- (NSDictionary *)JSONDictionary | |
| 12583 | +{ | |
| 12584 | + id dict = [[self dictionaryWithValuesForKeys:QTNone.properties.allValues] mutableCopy]; | |
| 12585 | + | |
| 12586 | + for (id jsonName in QTNone.properties) { | |
| 12587 | + id propertyName = QTNone.properties[jsonName]; | |
| 12588 | + if (![jsonName isEqualToString:propertyName]) { | |
| 12589 | + dict[jsonName] = dict[propertyName]; | |
| 12590 | + [dict removeObjectForKey:propertyName]; | |
| 12591 | + } | |
| 12592 | + } | |
| 12593 | + | |
| 12594 | + return dict; | |
| 12595 | +} | |
| 12596 | +@end | |
| 12597 | + | |
| 12598 | +@implementation QTNonlocal | |
| 12599 | ++ (NSDictionary<NSString *, NSString *> *)properties | |
| 12600 | +{ | |
| 12601 | + static NSDictionary<NSString *, NSString *> *properties; | |
| 12602 | + return properties = properties ? properties : @{ | |
| 12603 | + @"nonlocal": @"nonlocal", | |
| 12604 | + }; | |
| 12605 | +} | |
| 12606 | + | |
| 12607 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict | |
| 12608 | +{ | |
| 12609 | + return [dict isKindOfClass:NSDictionary.class] ? [[QTNonlocal alloc] initWithJSONDictionary:dict] : nil; | |
| 12481 | 12610 | } |
| 12482 | 12611 | |
| 12483 | 12612 | - (instancetype)initWithJSONDictionary:(NSDictionary *)dict |
| @@ -15188,48 +15317,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 15188 | 15317 | } |
| 15189 | 15318 | @end |
| 15190 | 15319 | |
| 15191 | -@implementation QTSelect | |
| 15192 | -+ (NSDictionary<NSString *, NSString *> *)properties | |
| 15193 | -{ | |
| 15194 | - static NSDictionary<NSString *, NSString *> *properties; | |
| 15195 | - return properties = properties ? properties : @{ | |
| 15196 | - @"select": @"select", | |
| 15197 | - }; | |
| 15198 | -} | |
| 15199 | - | |
| 15200 | -+ (instancetype)fromJSONDictionary:(NSDictionary *)dict | |
| 15201 | -{ | |
| 15202 | - return [dict isKindOfClass:NSDictionary.class] ? [[QTSelect alloc] initWithJSONDictionary:dict] : nil; | |
| 15203 | -} | |
| 15204 | - | |
| 15205 | -- (instancetype)initWithJSONDictionary:(NSDictionary *)dict | |
| 15206 | -{ | |
| 15207 | - if (self = [super init]) { | |
| 15208 | - if (![dict[@"select"] isKindOfClass:NSNumber.class]) return nil; | |
| 15209 | - if ([dict[@"select"] doubleValue] != [dict[@"select"] longLongValue]) return nil; | |
| 15210 | - [self setValuesForKeysWithDictionary:dict]; | |
| 15211 | - } | |
| 15212 | - return self; | |
| 15213 | -} | |
| 15214 | - | |
| 15215 | -- (void)setValue:(nullable id)value forKey:(NSString *)key | |
| 15216 | -{ | |
| 15217 | - id resolved = QTSelect.properties[key]; | |
| 15218 | - if (resolved) [super setValue:value forKey:resolved]; | |
| 15219 | -} | |
| 15220 | - | |
| 15221 | -- (void)setNilValueForKey:(NSString *)key | |
| 15222 | -{ | |
| 15223 | - id resolved = QTSelect.properties[key]; | |
| 15224 | - if (resolved) [super setValue:@(0) forKey:resolved]; | |
| 15225 | -} | |
| 15226 | - | |
| 15227 | -- (NSDictionary *)JSONDictionary | |
| 15228 | -{ | |
| 15229 | - return [self dictionaryWithValuesForKeys:QTSelect.properties.allValues]; | |
| 15230 | -} | |
| 15231 | -@end | |
| 15232 | - | |
| 15233 | 15320 | @implementation QTObj5 |
| 15234 | 15321 | + (NSDictionary<NSString *, NSString *> *)properties |
| 15235 | 15322 | { |
| @@ -15249,8 +15336,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 15249 | 15336 | @"typedef": @"obj5Typedef", |
| 15250 | 15337 | @"typeof": @"obj5Typeof", |
| 15251 | 15338 | @"union": @"obj5Union", |
| 15252 | - @"unsigned": @"obj5Unsigned", | |
| 15253 | 15339 | @"PrimitiveKind": @"primitiveKind", |
| 15340 | + @"select": @"select", | |
| 15254 | 15341 | @"Self": @"self", |
| 15255 | 15342 | @"Sendable": @"sendable", |
| 15256 | 15343 | @"SerialDescriptor": @"serialDescriptor", |
| @@ -15283,6 +15370,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 15283 | 15370 | @"TimeOnly": @"timeOnly", |
| 15284 | 15371 | @"TimeOnlyConverter": @"timeOnlyConverter", |
| 15285 | 15372 | @"TimeZone": @"timeZone", |
| 15373 | + @"to_dict": @"toDict", | |
| 15286 | 15374 | @"to_json": @"toJSON", |
| 15287 | 15375 | @"toString": @"toString", |
| 15288 | 15376 | @"top_level": @"topLevel", |
| @@ -15296,10 +15384,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 15296 | 15384 | @"ulong": @"ulong", |
| 15297 | 15385 | @"unchecked": @"unchecked", |
| 15298 | 15386 | @"undefined": @"undefined", |
| 15387 | + @"UnmarshalJSON": @"unmarshalJSON", | |
| 15299 | 15388 | @"unowned": @"unowned", |
| 15300 | 15389 | @"unsafe": @"unsafe", |
| 15301 | 15390 | @"UseSerializers": @"useSerializers", |
| 15302 | - @"ushort": @"ushort", | |
| 15303 | 15391 | }; |
| 15304 | 15392 | } |
| 15305 | 15393 | |
| @@ -15326,8 +15414,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 15326 | 15414 | if (![dict[@"typedef"] isKindOfClass:NSDictionary.class]) return nil; |
| 15327 | 15415 | if (![dict[@"typeof"] isKindOfClass:NSDictionary.class]) return nil; |
| 15328 | 15416 | if (![dict[@"union"] isKindOfClass:NSDictionary.class]) return nil; |
| 15329 | - if (![dict[@"unsigned"] isKindOfClass:NSDictionary.class]) return nil; | |
| 15330 | 15417 | if (![dict[@"PrimitiveKind"] isKindOfClass:NSDictionary.class]) return nil; |
| 15418 | + if (![dict[@"select"] isKindOfClass:NSDictionary.class]) return nil; | |
| 15331 | 15419 | if (![dict[@"Self"] isKindOfClass:NSDictionary.class]) return nil; |
| 15332 | 15420 | if (![dict[@"Sendable"] isKindOfClass:NSDictionary.class]) return nil; |
| 15333 | 15421 | if (![dict[@"SerialDescriptor"] isKindOfClass:NSDictionary.class]) return nil; |
| @@ -15360,6 +15448,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 15360 | 15448 | if (![dict[@"TimeOnly"] isKindOfClass:NSDictionary.class]) return nil; |
| 15361 | 15449 | if (![dict[@"TimeOnlyConverter"] isKindOfClass:NSDictionary.class]) return nil; |
| 15362 | 15450 | if (![dict[@"TimeZone"] isKindOfClass:NSDictionary.class]) return nil; |
| 15451 | + if (![dict[@"to_dict"] isKindOfClass:NSDictionary.class]) return nil; | |
| 15363 | 15452 | if (![dict[@"to_json"] isKindOfClass:NSDictionary.class]) return nil; |
| 15364 | 15453 | if (![dict[@"toString"] isKindOfClass:NSDictionary.class]) return nil; |
| 15365 | 15454 | if (![dict[@"top_level"] isKindOfClass:NSDictionary.class]) return nil; |
| @@ -15373,10 +15462,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 15373 | 15462 | if (![dict[@"ulong"] isKindOfClass:NSDictionary.class]) return nil; |
| 15374 | 15463 | if (![dict[@"unchecked"] isKindOfClass:NSDictionary.class]) return nil; |
| 15375 | 15464 | if (![dict[@"undefined"] isKindOfClass:NSDictionary.class]) return nil; |
| 15465 | + if (![dict[@"UnmarshalJSON"] isKindOfClass:NSDictionary.class]) return nil; | |
| 15376 | 15466 | if (![dict[@"unowned"] isKindOfClass:NSDictionary.class]) return nil; |
| 15377 | 15467 | if (![dict[@"unsafe"] isKindOfClass:NSDictionary.class]) return nil; |
| 15378 | 15468 | if (![dict[@"UseSerializers"] isKindOfClass:NSDictionary.class]) return nil; |
| 15379 | - if (![dict[@"ushort"] isKindOfClass:NSDictionary.class]) return nil; | |
| 15380 | 15469 | [self setValuesForKeysWithDictionary:dict]; |
| 15381 | 15470 | _kSerializer = [QTKSerializer fromJSONDictionary:(id)_kSerializer]; |
| 15382 | 15471 | if (!_kSerializer && dict[@"KSerializer"] && ![dict[@"KSerializer"] isKindOfClass:NSNull.class]) return nil; |
| @@ -15404,10 +15493,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 15404 | 15493 | if (!_obj5Typeof && dict[@"typeof"] && ![dict[@"typeof"] isKindOfClass:NSNull.class]) return nil; |
| 15405 | 15494 | _obj5Union = [QTUnion fromJSONDictionary:(id)_obj5Union]; |
| 15406 | 15495 | if (!_obj5Union && dict[@"union"] && ![dict[@"union"] isKindOfClass:NSNull.class]) return nil; |
| 15407 | - _obj5Unsigned = [QTUnsigned fromJSONDictionary:(id)_obj5Unsigned]; | |
| 15408 | - if (!_obj5Unsigned && dict[@"unsigned"] && ![dict[@"unsigned"] isKindOfClass:NSNull.class]) return nil; | |
| 15409 | 15496 | _primitiveKind = [QTPrimitiveKind fromJSONDictionary:(id)_primitiveKind]; |
| 15410 | 15497 | if (!_primitiveKind && dict[@"PrimitiveKind"] && ![dict[@"PrimitiveKind"] isKindOfClass:NSNull.class]) return nil; |
| 15498 | + _select = [QTSelect fromJSONDictionary:(id)_select]; | |
| 15499 | + if (!_select && dict[@"select"] && ![dict[@"select"] isKindOfClass:NSNull.class]) return nil; | |
| 15411 | 15500 | _self = [QTSelf fromJSONDictionary:(id)_self]; |
| 15412 | 15501 | if (!_self && dict[@"Self"] && ![dict[@"Self"] isKindOfClass:NSNull.class]) return nil; |
| 15413 | 15502 | _sendable = [QTSendable fromJSONDictionary:(id)_sendable]; |
| @@ -15472,6 +15561,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 15472 | 15561 | if (!_timeOnlyConverter && dict[@"TimeOnlyConverter"] && ![dict[@"TimeOnlyConverter"] isKindOfClass:NSNull.class]) return nil; |
| 15473 | 15562 | _timeZone = [QTTimeZone fromJSONDictionary:(id)_timeZone]; |
| 15474 | 15563 | if (!_timeZone && dict[@"TimeZone"] && ![dict[@"TimeZone"] isKindOfClass:NSNull.class]) return nil; |
| 15564 | + _toDict = [QTToDict fromJSONDictionary:(id)_toDict]; | |
| 15565 | + if (!_toDict && dict[@"to_dict"] && ![dict[@"to_dict"] isKindOfClass:NSNull.class]) return nil; | |
| 15475 | 15566 | _toJSON = [QTToJSON fromJSONDictionary:(id)_toJSON]; |
| 15476 | 15567 | if (!_toJSON && dict[@"to_json"] && ![dict[@"to_json"] isKindOfClass:NSNull.class]) return nil; |
| 15477 | 15568 | _toString = [QTToString fromJSONDictionary:(id)_toString]; |
| @@ -15498,14 +15589,14 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 15498 | 15589 | if (!_unchecked && dict[@"unchecked"] && ![dict[@"unchecked"] isKindOfClass:NSNull.class]) return nil; |
| 15499 | 15590 | _undefined = [QTUndefined fromJSONDictionary:(id)_undefined]; |
| 15500 | 15591 | if (!_undefined && dict[@"undefined"] && ![dict[@"undefined"] isKindOfClass:NSNull.class]) return nil; |
| 15592 | + _unmarshalJSON = [QTUnmarshalJSON fromJSONDictionary:(id)_unmarshalJSON]; | |
| 15593 | + if (!_unmarshalJSON && dict[@"UnmarshalJSON"] && ![dict[@"UnmarshalJSON"] isKindOfClass:NSNull.class]) return nil; | |
| 15501 | 15594 | _unowned = [QTUnowned fromJSONDictionary:(id)_unowned]; |
| 15502 | 15595 | if (!_unowned && dict[@"unowned"] && ![dict[@"unowned"] isKindOfClass:NSNull.class]) return nil; |
| 15503 | 15596 | _unsafe = [QTUnsafe fromJSONDictionary:(id)_unsafe]; |
| 15504 | 15597 | if (!_unsafe && dict[@"unsafe"] && ![dict[@"unsafe"] isKindOfClass:NSNull.class]) return nil; |
| 15505 | 15598 | _useSerializers = [QTUseSerializers fromJSONDictionary:(id)_useSerializers]; |
| 15506 | 15599 | if (!_useSerializers && dict[@"UseSerializers"] && ![dict[@"UseSerializers"] isKindOfClass:NSNull.class]) return nil; |
| 15507 | - _ushort = [QTUshort fromJSONDictionary:(id)_ushort]; | |
| 15508 | - if (!_ushort && dict[@"ushort"] && ![dict[@"ushort"] isKindOfClass:NSNull.class]) return nil; | |
| 15509 | 15600 | } |
| 15510 | 15601 | return self; |
| 15511 | 15602 | } |
| @@ -15548,8 +15639,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 15548 | 15639 | @"typedef": [_obj5Typedef JSONDictionary], |
| 15549 | 15640 | @"typeof": [_obj5Typeof JSONDictionary], |
| 15550 | 15641 | @"union": [_obj5Union JSONDictionary], |
| 15551 | - @"unsigned": [_obj5Unsigned JSONDictionary], | |
| 15552 | 15642 | @"PrimitiveKind": [_primitiveKind JSONDictionary], |
| 15643 | + @"select": [_select JSONDictionary], | |
| 15553 | 15644 | @"Self": [_self JSONDictionary], |
| 15554 | 15645 | @"Sendable": [_sendable JSONDictionary], |
| 15555 | 15646 | @"SerialDescriptor": [_serialDescriptor JSONDictionary], |
| @@ -15582,6 +15673,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 15582 | 15673 | @"TimeOnly": [_timeOnly JSONDictionary], |
| 15583 | 15674 | @"TimeOnlyConverter": [_timeOnlyConverter JSONDictionary], |
| 15584 | 15675 | @"TimeZone": [_timeZone JSONDictionary], |
| 15676 | + @"to_dict": [_toDict JSONDictionary], | |
| 15585 | 15677 | @"to_json": [_toJSON JSONDictionary], |
| 15586 | 15678 | @"toString": [_toString JSONDictionary], |
| 15587 | 15679 | @"top_level": [_topLevel JSONDictionary], |
| @@ -15595,10 +15687,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 15595 | 15687 | @"ulong": [_ulong JSONDictionary], |
| 15596 | 15688 | @"unchecked": [_unchecked JSONDictionary], |
| 15597 | 15689 | @"undefined": [_undefined JSONDictionary], |
| 15690 | + @"UnmarshalJSON": [_unmarshalJSON JSONDictionary], | |
| 15598 | 15691 | @"unowned": [_unowned JSONDictionary], |
| 15599 | 15692 | @"unsafe": [_unsafe JSONDictionary], |
| 15600 | 15693 | @"UseSerializers": [_useSerializers JSONDictionary], |
| 15601 | - @"ushort": [_ushort JSONDictionary], | |
| 15602 | 15694 | }]; |
| 15603 | 15695 | |
| 15604 | 15696 | return dict; |
| @@ -16261,25 +16353,25 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 16261 | 16353 | } |
| 16262 | 16354 | @end |
| 16263 | 16355 | |
| 16264 | -@implementation QTUnsigned | |
| 16356 | +@implementation QTPrimitiveKind | |
| 16265 | 16357 | + (NSDictionary<NSString *, NSString *> *)properties |
| 16266 | 16358 | { |
| 16267 | 16359 | static NSDictionary<NSString *, NSString *> *properties; |
| 16268 | 16360 | return properties = properties ? properties : @{ |
| 16269 | - @"unsigned": @"unsignedUnsigned", | |
| 16361 | + @"PrimitiveKind": @"primitiveKind", | |
| 16270 | 16362 | }; |
| 16271 | 16363 | } |
| 16272 | 16364 | |
| 16273 | 16365 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict |
| 16274 | 16366 | { |
| 16275 | - return [dict isKindOfClass:NSDictionary.class] ? [[QTUnsigned alloc] initWithJSONDictionary:dict] : nil; | |
| 16367 | + return [dict isKindOfClass:NSDictionary.class] ? [[QTPrimitiveKind alloc] initWithJSONDictionary:dict] : nil; | |
| 16276 | 16368 | } |
| 16277 | 16369 | |
| 16278 | 16370 | - (instancetype)initWithJSONDictionary:(NSDictionary *)dict |
| 16279 | 16371 | { |
| 16280 | 16372 | if (self = [super init]) { |
| 16281 | - if (![dict[@"unsigned"] isKindOfClass:NSNumber.class]) return nil; | |
| 16282 | - if ([dict[@"unsigned"] doubleValue] != [dict[@"unsigned"] longLongValue]) return nil; | |
| 16373 | + if (![dict[@"PrimitiveKind"] isKindOfClass:NSNumber.class]) return nil; | |
| 16374 | + if ([dict[@"PrimitiveKind"] doubleValue] != [dict[@"PrimitiveKind"] longLongValue]) return nil; | |
| 16283 | 16375 | [self setValuesForKeysWithDictionary:dict]; |
| 16284 | 16376 | } |
| 16285 | 16377 | return self; |
| @@ -16287,22 +16379,22 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 16287 | 16379 | |
| 16288 | 16380 | - (void)setValue:(nullable id)value forKey:(NSString *)key |
| 16289 | 16381 | { |
| 16290 | - id resolved = QTUnsigned.properties[key]; | |
| 16382 | + id resolved = QTPrimitiveKind.properties[key]; | |
| 16291 | 16383 | if (resolved) [super setValue:value forKey:resolved]; |
| 16292 | 16384 | } |
| 16293 | 16385 | |
| 16294 | 16386 | - (void)setNilValueForKey:(NSString *)key |
| 16295 | 16387 | { |
| 16296 | - id resolved = QTUnsigned.properties[key]; | |
| 16388 | + id resolved = QTPrimitiveKind.properties[key]; | |
| 16297 | 16389 | if (resolved) [super setValue:@(0) forKey:resolved]; |
| 16298 | 16390 | } |
| 16299 | 16391 | |
| 16300 | 16392 | - (NSDictionary *)JSONDictionary |
| 16301 | 16393 | { |
| 16302 | - id dict = [[self dictionaryWithValuesForKeys:QTUnsigned.properties.allValues] mutableCopy]; | |
| 16394 | + id dict = [[self dictionaryWithValuesForKeys:QTPrimitiveKind.properties.allValues] mutableCopy]; | |
| 16303 | 16395 | |
| 16304 | - for (id jsonName in QTUnsigned.properties) { | |
| 16305 | - id propertyName = QTUnsigned.properties[jsonName]; | |
| 16396 | + for (id jsonName in QTPrimitiveKind.properties) { | |
| 16397 | + id propertyName = QTPrimitiveKind.properties[jsonName]; | |
| 16306 | 16398 | if (![jsonName isEqualToString:propertyName]) { |
| 16307 | 16399 | dict[jsonName] = dict[propertyName]; |
| 16308 | 16400 | [dict removeObjectForKey:propertyName]; |
| @@ -16313,25 +16405,25 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 16313 | 16405 | } |
| 16314 | 16406 | @end |
| 16315 | 16407 | |
| 16316 | -@implementation QTPrimitiveKind | |
| 16408 | +@implementation QTSelect | |
| 16317 | 16409 | + (NSDictionary<NSString *, NSString *> *)properties |
| 16318 | 16410 | { |
| 16319 | 16411 | static NSDictionary<NSString *, NSString *> *properties; |
| 16320 | 16412 | return properties = properties ? properties : @{ |
| 16321 | - @"PrimitiveKind": @"primitiveKind", | |
| 16413 | + @"select": @"select", | |
| 16322 | 16414 | }; |
| 16323 | 16415 | } |
| 16324 | 16416 | |
| 16325 | 16417 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict |
| 16326 | 16418 | { |
| 16327 | - return [dict isKindOfClass:NSDictionary.class] ? [[QTPrimitiveKind alloc] initWithJSONDictionary:dict] : nil; | |
| 16419 | + return [dict isKindOfClass:NSDictionary.class] ? [[QTSelect alloc] initWithJSONDictionary:dict] : nil; | |
| 16328 | 16420 | } |
| 16329 | 16421 | |
| 16330 | 16422 | - (instancetype)initWithJSONDictionary:(NSDictionary *)dict |
| 16331 | 16423 | { |
| 16332 | 16424 | if (self = [super init]) { |
| 16333 | - if (![dict[@"PrimitiveKind"] isKindOfClass:NSNumber.class]) return nil; | |
| 16334 | - if ([dict[@"PrimitiveKind"] doubleValue] != [dict[@"PrimitiveKind"] longLongValue]) return nil; | |
| 16425 | + if (![dict[@"select"] isKindOfClass:NSNumber.class]) return nil; | |
| 16426 | + if ([dict[@"select"] doubleValue] != [dict[@"select"] longLongValue]) return nil; | |
| 16335 | 16427 | [self setValuesForKeysWithDictionary:dict]; |
| 16336 | 16428 | } |
| 16337 | 16429 | return self; |
| @@ -16339,29 +16431,19 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 16339 | 16431 | |
| 16340 | 16432 | - (void)setValue:(nullable id)value forKey:(NSString *)key |
| 16341 | 16433 | { |
| 16342 | - id resolved = QTPrimitiveKind.properties[key]; | |
| 16434 | + id resolved = QTSelect.properties[key]; | |
| 16343 | 16435 | if (resolved) [super setValue:value forKey:resolved]; |
| 16344 | 16436 | } |
| 16345 | 16437 | |
| 16346 | 16438 | - (void)setNilValueForKey:(NSString *)key |
| 16347 | 16439 | { |
| 16348 | - id resolved = QTPrimitiveKind.properties[key]; | |
| 16440 | + id resolved = QTSelect.properties[key]; | |
| 16349 | 16441 | if (resolved) [super setValue:@(0) forKey:resolved]; |
| 16350 | 16442 | } |
| 16351 | 16443 | |
| 16352 | 16444 | - (NSDictionary *)JSONDictionary |
| 16353 | 16445 | { |
| 16354 | - id dict = [[self dictionaryWithValuesForKeys:QTPrimitiveKind.properties.allValues] mutableCopy]; | |
| 16355 | - | |
| 16356 | - for (id jsonName in QTPrimitiveKind.properties) { | |
| 16357 | - id propertyName = QTPrimitiveKind.properties[jsonName]; | |
| 16358 | - if (![jsonName isEqualToString:propertyName]) { | |
| 16359 | - dict[jsonName] = dict[propertyName]; | |
| 16360 | - [dict removeObjectForKey:propertyName]; | |
| 16361 | - } | |
| 16362 | - } | |
| 16363 | - | |
| 16364 | - return dict; | |
| 16446 | + return [self dictionaryWithValuesForKeys:QTSelect.properties.allValues]; | |
| 16365 | 16447 | } |
| 16366 | 16448 | @end |
| 16367 | 16449 | |
| @@ -17879,6 +17961,58 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 17879 | 17961 | } |
| 17880 | 17962 | @end |
| 17881 | 17963 | |
| 17964 | +@implementation QTToDict | |
| 17965 | ++ (NSDictionary<NSString *, NSString *> *)properties | |
| 17966 | +{ | |
| 17967 | + static NSDictionary<NSString *, NSString *> *properties; | |
| 17968 | + return properties = properties ? properties : @{ | |
| 17969 | + @"to_dict": @"toDict", | |
| 17970 | + }; | |
| 17971 | +} | |
| 17972 | + | |
| 17973 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict | |
| 17974 | +{ | |
| 17975 | + return [dict isKindOfClass:NSDictionary.class] ? [[QTToDict alloc] initWithJSONDictionary:dict] : nil; | |
| 17976 | +} | |
| 17977 | + | |
| 17978 | +- (instancetype)initWithJSONDictionary:(NSDictionary *)dict | |
| 17979 | +{ | |
| 17980 | + if (self = [super init]) { | |
| 17981 | + if (![dict[@"to_dict"] isKindOfClass:NSNumber.class]) return nil; | |
| 17982 | + if ([dict[@"to_dict"] doubleValue] != [dict[@"to_dict"] longLongValue]) return nil; | |
| 17983 | + [self setValuesForKeysWithDictionary:dict]; | |
| 17984 | + } | |
| 17985 | + return self; | |
| 17986 | +} | |
| 17987 | + | |
| 17988 | +- (void)setValue:(nullable id)value forKey:(NSString *)key | |
| 17989 | +{ | |
| 17990 | + id resolved = QTToDict.properties[key]; | |
| 17991 | + if (resolved) [super setValue:value forKey:resolved]; | |
| 17992 | +} | |
| 17993 | + | |
| 17994 | +- (void)setNilValueForKey:(NSString *)key | |
| 17995 | +{ | |
| 17996 | + id resolved = QTToDict.properties[key]; | |
| 17997 | + if (resolved) [super setValue:@(0) forKey:resolved]; | |
| 17998 | +} | |
| 17999 | + | |
| 18000 | +- (NSDictionary *)JSONDictionary | |
| 18001 | +{ | |
| 18002 | + id dict = [[self dictionaryWithValuesForKeys:QTToDict.properties.allValues] mutableCopy]; | |
| 18003 | + | |
| 18004 | + for (id jsonName in QTToDict.properties) { | |
| 18005 | + id propertyName = QTToDict.properties[jsonName]; | |
| 18006 | + if (![jsonName isEqualToString:propertyName]) { | |
| 18007 | + dict[jsonName] = dict[propertyName]; | |
| 18008 | + [dict removeObjectForKey:propertyName]; | |
| 18009 | + } | |
| 18010 | + } | |
| 18011 | + | |
| 18012 | + return dict; | |
| 18013 | +} | |
| 18014 | +@end | |
| 18015 | + | |
| 17882 | 18016 | @implementation QTToJSON |
| 17883 | 18017 | + (NSDictionary<NSString *, NSString *> *)properties |
| 17884 | 18018 | { |
| @@ -18455,25 +18589,25 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 18455 | 18589 | } |
| 18456 | 18590 | @end |
| 18457 | 18591 | |
| 18458 | -@implementation QTUnowned | |
| 18592 | +@implementation QTUnmarshalJSON | |
| 18459 | 18593 | + (NSDictionary<NSString *, NSString *> *)properties |
| 18460 | 18594 | { |
| 18461 | 18595 | static NSDictionary<NSString *, NSString *> *properties; |
| 18462 | 18596 | return properties = properties ? properties : @{ |
| 18463 | - @"unowned": @"unowned", | |
| 18597 | + @"UnmarshalJSON": @"unmarshalJSON", | |
| 18464 | 18598 | }; |
| 18465 | 18599 | } |
| 18466 | 18600 | |
| 18467 | 18601 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict |
| 18468 | 18602 | { |
| 18469 | - return [dict isKindOfClass:NSDictionary.class] ? [[QTUnowned alloc] initWithJSONDictionary:dict] : nil; | |
| 18603 | + return [dict isKindOfClass:NSDictionary.class] ? [[QTUnmarshalJSON alloc] initWithJSONDictionary:dict] : nil; | |
| 18470 | 18604 | } |
| 18471 | 18605 | |
| 18472 | 18606 | - (instancetype)initWithJSONDictionary:(NSDictionary *)dict |
| 18473 | 18607 | { |
| 18474 | 18608 | if (self = [super init]) { |
| 18475 | - if (![dict[@"unowned"] isKindOfClass:NSNumber.class]) return nil; | |
| 18476 | - if ([dict[@"unowned"] doubleValue] != [dict[@"unowned"] longLongValue]) return nil; | |
| 18609 | + if (![dict[@"UnmarshalJSON"] isKindOfClass:NSNumber.class]) return nil; | |
| 18610 | + if ([dict[@"UnmarshalJSON"] doubleValue] != [dict[@"UnmarshalJSON"] longLongValue]) return nil; | |
| 18477 | 18611 | [self setValuesForKeysWithDictionary:dict]; |
| 18478 | 18612 | } |
| 18479 | 18613 | return self; |
| @@ -18481,41 +18615,51 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 18481 | 18615 | |
| 18482 | 18616 | - (void)setValue:(nullable id)value forKey:(NSString *)key |
| 18483 | 18617 | { |
| 18484 | - id resolved = QTUnowned.properties[key]; | |
| 18618 | + id resolved = QTUnmarshalJSON.properties[key]; | |
| 18485 | 18619 | if (resolved) [super setValue:value forKey:resolved]; |
| 18486 | 18620 | } |
| 18487 | 18621 | |
| 18488 | 18622 | - (void)setNilValueForKey:(NSString *)key |
| 18489 | 18623 | { |
| 18490 | - id resolved = QTUnowned.properties[key]; | |
| 18624 | + id resolved = QTUnmarshalJSON.properties[key]; | |
| 18491 | 18625 | if (resolved) [super setValue:@(0) forKey:resolved]; |
| 18492 | 18626 | } |
| 18493 | 18627 | |
| 18494 | 18628 | - (NSDictionary *)JSONDictionary |
| 18495 | 18629 | { |
| 18496 | - return [self dictionaryWithValuesForKeys:QTUnowned.properties.allValues]; | |
| 18630 | + id dict = [[self dictionaryWithValuesForKeys:QTUnmarshalJSON.properties.allValues] mutableCopy]; | |
| 18631 | + | |
| 18632 | + for (id jsonName in QTUnmarshalJSON.properties) { | |
| 18633 | + id propertyName = QTUnmarshalJSON.properties[jsonName]; | |
| 18634 | + if (![jsonName isEqualToString:propertyName]) { | |
| 18635 | + dict[jsonName] = dict[propertyName]; | |
| 18636 | + [dict removeObjectForKey:propertyName]; | |
| 18637 | + } | |
| 18638 | + } | |
| 18639 | + | |
| 18640 | + return dict; | |
| 18497 | 18641 | } |
| 18498 | 18642 | @end |
| 18499 | 18643 | |
| 18500 | -@implementation QTUnsafe | |
| 18644 | +@implementation QTUnowned | |
| 18501 | 18645 | + (NSDictionary<NSString *, NSString *> *)properties |
| 18502 | 18646 | { |
| 18503 | 18647 | static NSDictionary<NSString *, NSString *> *properties; |
| 18504 | 18648 | return properties = properties ? properties : @{ |
| 18505 | - @"unsafe": @"unsafe", | |
| 18649 | + @"unowned": @"unowned", | |
| 18506 | 18650 | }; |
| 18507 | 18651 | } |
| 18508 | 18652 | |
| 18509 | 18653 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict |
| 18510 | 18654 | { |
| 18511 | - return [dict isKindOfClass:NSDictionary.class] ? [[QTUnsafe alloc] initWithJSONDictionary:dict] : nil; | |
| 18655 | + return [dict isKindOfClass:NSDictionary.class] ? [[QTUnowned alloc] initWithJSONDictionary:dict] : nil; | |
| 18512 | 18656 | } |
| 18513 | 18657 | |
| 18514 | 18658 | - (instancetype)initWithJSONDictionary:(NSDictionary *)dict |
| 18515 | 18659 | { |
| 18516 | 18660 | if (self = [super init]) { |
| 18517 | - if (![dict[@"unsafe"] isKindOfClass:NSNumber.class]) return nil; | |
| 18518 | - if ([dict[@"unsafe"] doubleValue] != [dict[@"unsafe"] longLongValue]) return nil; | |
| 18661 | + if (![dict[@"unowned"] isKindOfClass:NSNumber.class]) return nil; | |
| 18662 | + if ([dict[@"unowned"] doubleValue] != [dict[@"unowned"] longLongValue]) return nil; | |
| 18519 | 18663 | [self setValuesForKeysWithDictionary:dict]; |
| 18520 | 18664 | } |
| 18521 | 18665 | return self; |
| @@ -18523,41 +18667,41 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 18523 | 18667 | |
| 18524 | 18668 | - (void)setValue:(nullable id)value forKey:(NSString *)key |
| 18525 | 18669 | { |
| 18526 | - id resolved = QTUnsafe.properties[key]; | |
| 18670 | + id resolved = QTUnowned.properties[key]; | |
| 18527 | 18671 | if (resolved) [super setValue:value forKey:resolved]; |
| 18528 | 18672 | } |
| 18529 | 18673 | |
| 18530 | 18674 | - (void)setNilValueForKey:(NSString *)key |
| 18531 | 18675 | { |
| 18532 | - id resolved = QTUnsafe.properties[key]; | |
| 18676 | + id resolved = QTUnowned.properties[key]; | |
| 18533 | 18677 | if (resolved) [super setValue:@(0) forKey:resolved]; |
| 18534 | 18678 | } |
| 18535 | 18679 | |
| 18536 | 18680 | - (NSDictionary *)JSONDictionary |
| 18537 | 18681 | { |
| 18538 | - return [self dictionaryWithValuesForKeys:QTUnsafe.properties.allValues]; | |
| 18682 | + return [self dictionaryWithValuesForKeys:QTUnowned.properties.allValues]; | |
| 18539 | 18683 | } |
| 18540 | 18684 | @end |
| 18541 | 18685 | |
| 18542 | -@implementation QTUseSerializers | |
| 18686 | +@implementation QTUnsafe | |
| 18543 | 18687 | + (NSDictionary<NSString *, NSString *> *)properties |
| 18544 | 18688 | { |
| 18545 | 18689 | static NSDictionary<NSString *, NSString *> *properties; |
| 18546 | 18690 | return properties = properties ? properties : @{ |
| 18547 | - @"UseSerializers": @"useSerializers", | |
| 18691 | + @"unsafe": @"unsafe", | |
| 18548 | 18692 | }; |
| 18549 | 18693 | } |
| 18550 | 18694 | |
| 18551 | 18695 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict |
| 18552 | 18696 | { |
| 18553 | - return [dict isKindOfClass:NSDictionary.class] ? [[QTUseSerializers alloc] initWithJSONDictionary:dict] : nil; | |
| 18697 | + return [dict isKindOfClass:NSDictionary.class] ? [[QTUnsafe alloc] initWithJSONDictionary:dict] : nil; | |
| 18554 | 18698 | } |
| 18555 | 18699 | |
| 18556 | 18700 | - (instancetype)initWithJSONDictionary:(NSDictionary *)dict |
| 18557 | 18701 | { |
| 18558 | 18702 | if (self = [super init]) { |
| 18559 | - if (![dict[@"UseSerializers"] isKindOfClass:NSNumber.class]) return nil; | |
| 18560 | - if ([dict[@"UseSerializers"] doubleValue] != [dict[@"UseSerializers"] longLongValue]) return nil; | |
| 18703 | + if (![dict[@"unsafe"] isKindOfClass:NSNumber.class]) return nil; | |
| 18704 | + if ([dict[@"unsafe"] doubleValue] != [dict[@"unsafe"] longLongValue]) return nil; | |
| 18561 | 18705 | [self setValuesForKeysWithDictionary:dict]; |
| 18562 | 18706 | } |
| 18563 | 18707 | return self; |
| @@ -18565,51 +18709,41 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 18565 | 18709 | |
| 18566 | 18710 | - (void)setValue:(nullable id)value forKey:(NSString *)key |
| 18567 | 18711 | { |
| 18568 | - id resolved = QTUseSerializers.properties[key]; | |
| 18712 | + id resolved = QTUnsafe.properties[key]; | |
| 18569 | 18713 | if (resolved) [super setValue:value forKey:resolved]; |
| 18570 | 18714 | } |
| 18571 | 18715 | |
| 18572 | 18716 | - (void)setNilValueForKey:(NSString *)key |
| 18573 | 18717 | { |
| 18574 | - id resolved = QTUseSerializers.properties[key]; | |
| 18718 | + id resolved = QTUnsafe.properties[key]; | |
| 18575 | 18719 | if (resolved) [super setValue:@(0) forKey:resolved]; |
| 18576 | 18720 | } |
| 18577 | 18721 | |
| 18578 | 18722 | - (NSDictionary *)JSONDictionary |
| 18579 | 18723 | { |
| 18580 | - id dict = [[self dictionaryWithValuesForKeys:QTUseSerializers.properties.allValues] mutableCopy]; | |
| 18581 | - | |
| 18582 | - for (id jsonName in QTUseSerializers.properties) { | |
| 18583 | - id propertyName = QTUseSerializers.properties[jsonName]; | |
| 18584 | - if (![jsonName isEqualToString:propertyName]) { | |
| 18585 | - dict[jsonName] = dict[propertyName]; | |
| 18586 | - [dict removeObjectForKey:propertyName]; | |
| 18587 | - } | |
| 18588 | - } | |
| 18589 | - | |
| 18590 | - return dict; | |
| 18724 | + return [self dictionaryWithValuesForKeys:QTUnsafe.properties.allValues]; | |
| 18591 | 18725 | } |
| 18592 | 18726 | @end |
| 18593 | 18727 | |
| 18594 | -@implementation QTUshort | |
| 18728 | +@implementation QTUseSerializers | |
| 18595 | 18729 | + (NSDictionary<NSString *, NSString *> *)properties |
| 18596 | 18730 | { |
| 18597 | 18731 | static NSDictionary<NSString *, NSString *> *properties; |
| 18598 | 18732 | return properties = properties ? properties : @{ |
| 18599 | - @"ushort": @"ushort", | |
| 18733 | + @"UseSerializers": @"useSerializers", | |
| 18600 | 18734 | }; |
| 18601 | 18735 | } |
| 18602 | 18736 | |
| 18603 | 18737 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict |
| 18604 | 18738 | { |
| 18605 | - return [dict isKindOfClass:NSDictionary.class] ? [[QTUshort alloc] initWithJSONDictionary:dict] : nil; | |
| 18739 | + return [dict isKindOfClass:NSDictionary.class] ? [[QTUseSerializers alloc] initWithJSONDictionary:dict] : nil; | |
| 18606 | 18740 | } |
| 18607 | 18741 | |
| 18608 | 18742 | - (instancetype)initWithJSONDictionary:(NSDictionary *)dict |
| 18609 | 18743 | { |
| 18610 | 18744 | if (self = [super init]) { |
| 18611 | - if (![dict[@"ushort"] isKindOfClass:NSNumber.class]) return nil; | |
| 18612 | - if ([dict[@"ushort"] doubleValue] != [dict[@"ushort"] longLongValue]) return nil; | |
| 18745 | + if (![dict[@"UseSerializers"] isKindOfClass:NSNumber.class]) return nil; | |
| 18746 | + if ([dict[@"UseSerializers"] doubleValue] != [dict[@"UseSerializers"] longLongValue]) return nil; | |
| 18613 | 18747 | [self setValuesForKeysWithDictionary:dict]; |
| 18614 | 18748 | } |
| 18615 | 18749 | return self; |
| @@ -18617,19 +18751,29 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 18617 | 18751 | |
| 18618 | 18752 | - (void)setValue:(nullable id)value forKey:(NSString *)key |
| 18619 | 18753 | { |
| 18620 | - id resolved = QTUshort.properties[key]; | |
| 18754 | + id resolved = QTUseSerializers.properties[key]; | |
| 18621 | 18755 | if (resolved) [super setValue:value forKey:resolved]; |
| 18622 | 18756 | } |
| 18623 | 18757 | |
| 18624 | 18758 | - (void)setNilValueForKey:(NSString *)key |
| 18625 | 18759 | { |
| 18626 | - id resolved = QTUshort.properties[key]; | |
| 18760 | + id resolved = QTUseSerializers.properties[key]; | |
| 18627 | 18761 | if (resolved) [super setValue:@(0) forKey:resolved]; |
| 18628 | 18762 | } |
| 18629 | 18763 | |
| 18630 | 18764 | - (NSDictionary *)JSONDictionary |
| 18631 | 18765 | { |
| 18632 | - return [self dictionaryWithValuesForKeys:QTUshort.properties.allValues]; | |
| 18766 | + id dict = [[self dictionaryWithValuesForKeys:QTUseSerializers.properties.allValues] mutableCopy]; | |
| 18767 | + | |
| 18768 | + for (id jsonName in QTUseSerializers.properties) { | |
| 18769 | + id propertyName = QTUseSerializers.properties[jsonName]; | |
| 18770 | + if (![jsonName isEqualToString:propertyName]) { | |
| 18771 | + dict[jsonName] = dict[propertyName]; | |
| 18772 | + [dict removeObjectForKey:propertyName]; | |
| 18773 | + } | |
| 18774 | + } | |
| 18775 | + | |
| 18776 | + return dict; | |
| 18633 | 18777 | } |
| 18634 | 18778 | @end |
| 18635 | 18779 | |
| @@ -18639,9 +18783,11 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 18639 | 18783 | static NSDictionary<NSString *, NSString *> *properties; |
| 18640 | 18784 | return properties = properties ? properties : @{ |
| 18641 | 18785 | @"dummy": @"dummy", |
| 18786 | + @"unsigned": @"obj6Unsigned", | |
| 18642 | 18787 | @"void": @"obj6Void", |
| 18643 | 18788 | @"volatile": @"obj6Volatile", |
| 18644 | 18789 | @"while": @"obj6While", |
| 18790 | + @"ushort": @"ushort", | |
| 18645 | 18791 | @"using": @"using", |
| 18646 | 18792 | @"Utf8JsonReader": @"utf8JSONReader", |
| 18647 | 18793 | @"Utf8JsonWriter": @"utf8JSONWriter", |
| @@ -18670,9 +18816,11 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 18670 | 18816 | if (self = [super init]) { |
| 18671 | 18817 | if (![dict[@"dummy"] isKindOfClass:NSNumber.class]) return nil; |
| 18672 | 18818 | if ([dict[@"dummy"] doubleValue] != [dict[@"dummy"] longLongValue]) return nil; |
| 18819 | + if (![dict[@"unsigned"] isKindOfClass:NSDictionary.class]) return nil; | |
| 18673 | 18820 | if (![dict[@"void"] isKindOfClass:NSDictionary.class]) return nil; |
| 18674 | 18821 | if (![dict[@"volatile"] isKindOfClass:NSDictionary.class]) return nil; |
| 18675 | 18822 | if (![dict[@"while"] isKindOfClass:NSDictionary.class]) return nil; |
| 18823 | + if (![dict[@"ushort"] isKindOfClass:NSDictionary.class]) return nil; | |
| 18676 | 18824 | if (![dict[@"using"] isKindOfClass:NSDictionary.class]) return nil; |
| 18677 | 18825 | if (![dict[@"Utf8JsonReader"] isKindOfClass:NSDictionary.class]) return nil; |
| 18678 | 18826 | if (![dict[@"Utf8JsonWriter"] isKindOfClass:NSDictionary.class]) return nil; |
| @@ -18689,12 +18837,16 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 18689 | 18837 | if (![dict[@"YES"] isKindOfClass:NSDictionary.class]) return nil; |
| 18690 | 18838 | if (![dict[@"yield"] isKindOfClass:NSDictionary.class]) return nil; |
| 18691 | 18839 | [self setValuesForKeysWithDictionary:dict]; |
| 18840 | + _obj6Unsigned = [QTUnsigned fromJSONDictionary:(id)_obj6Unsigned]; | |
| 18841 | + if (!_obj6Unsigned && dict[@"unsigned"] && ![dict[@"unsigned"] isKindOfClass:NSNull.class]) return nil; | |
| 18692 | 18842 | _obj6Void = [QTVoid fromJSONDictionary:(id)_obj6Void]; |
| 18693 | 18843 | if (!_obj6Void && dict[@"void"] && ![dict[@"void"] isKindOfClass:NSNull.class]) return nil; |
| 18694 | 18844 | _obj6Volatile = [QTVolatile fromJSONDictionary:(id)_obj6Volatile]; |
| 18695 | 18845 | if (!_obj6Volatile && dict[@"volatile"] && ![dict[@"volatile"] isKindOfClass:NSNull.class]) return nil; |
| 18696 | 18846 | _obj6While = [QTWhile fromJSONDictionary:(id)_obj6While]; |
| 18697 | 18847 | if (!_obj6While && dict[@"while"] && ![dict[@"while"] isKindOfClass:NSNull.class]) return nil; |
| 18848 | + _ushort = [QTUshort fromJSONDictionary:(id)_ushort]; | |
| 18849 | + if (!_ushort && dict[@"ushort"] && ![dict[@"ushort"] isKindOfClass:NSNull.class]) return nil; | |
| 18698 | 18850 | _using = [QTUsing fromJSONDictionary:(id)_using]; |
| 18699 | 18851 | if (!_using && dict[@"using"] && ![dict[@"using"] isKindOfClass:NSNull.class]) return nil; |
| 18700 | 18852 | _utf8JSONReader = [QTUtf8JSONReader fromJSONDictionary:(id)_utf8JSONReader]; |
| @@ -18754,9 +18906,11 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 18754 | 18906 | } |
| 18755 | 18907 | |
| 18756 | 18908 | [dict addEntriesFromDictionary:@{ |
| 18909 | + @"unsigned": [_obj6Unsigned JSONDictionary], | |
| 18757 | 18910 | @"void": [_obj6Void JSONDictionary], |
| 18758 | 18911 | @"volatile": [_obj6Volatile JSONDictionary], |
| 18759 | 18912 | @"while": [_obj6While JSONDictionary], |
| 18913 | + @"ushort": [_ushort JSONDictionary], | |
| 18760 | 18914 | @"using": [_using JSONDictionary], |
| 18761 | 18915 | @"Utf8JsonReader": [_utf8JSONReader JSONDictionary], |
| 18762 | 18916 | @"Utf8JsonWriter": [_utf8JSONWriter JSONDictionary], |
| @@ -18778,6 +18932,58 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 18778 | 18932 | } |
| 18779 | 18933 | @end |
| 18780 | 18934 | |
| 18935 | +@implementation QTUnsigned | |
| 18936 | ++ (NSDictionary<NSString *, NSString *> *)properties | |
| 18937 | +{ | |
| 18938 | + static NSDictionary<NSString *, NSString *> *properties; | |
| 18939 | + return properties = properties ? properties : @{ | |
| 18940 | + @"unsigned": @"unsignedUnsigned", | |
| 18941 | + }; | |
| 18942 | +} | |
| 18943 | + | |
| 18944 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict | |
| 18945 | +{ | |
| 18946 | + return [dict isKindOfClass:NSDictionary.class] ? [[QTUnsigned alloc] initWithJSONDictionary:dict] : nil; | |
| 18947 | +} | |
| 18948 | + | |
| 18949 | +- (instancetype)initWithJSONDictionary:(NSDictionary *)dict | |
| 18950 | +{ | |
| 18951 | + if (self = [super init]) { | |
| 18952 | + if (![dict[@"unsigned"] isKindOfClass:NSNumber.class]) return nil; | |
| 18953 | + if ([dict[@"unsigned"] doubleValue] != [dict[@"unsigned"] longLongValue]) return nil; | |
| 18954 | + [self setValuesForKeysWithDictionary:dict]; | |
| 18955 | + } | |
| 18956 | + return self; | |
| 18957 | +} | |
| 18958 | + | |
| 18959 | +- (void)setValue:(nullable id)value forKey:(NSString *)key | |
| 18960 | +{ | |
| 18961 | + id resolved = QTUnsigned.properties[key]; | |
| 18962 | + if (resolved) [super setValue:value forKey:resolved]; | |
| 18963 | +} | |
| 18964 | + | |
| 18965 | +- (void)setNilValueForKey:(NSString *)key | |
| 18966 | +{ | |
| 18967 | + id resolved = QTUnsigned.properties[key]; | |
| 18968 | + if (resolved) [super setValue:@(0) forKey:resolved]; | |
| 18969 | +} | |
| 18970 | + | |
| 18971 | +- (NSDictionary *)JSONDictionary | |
| 18972 | +{ | |
| 18973 | + id dict = [[self dictionaryWithValuesForKeys:QTUnsigned.properties.allValues] mutableCopy]; | |
| 18974 | + | |
| 18975 | + for (id jsonName in QTUnsigned.properties) { | |
| 18976 | + id propertyName = QTUnsigned.properties[jsonName]; | |
| 18977 | + if (![jsonName isEqualToString:propertyName]) { | |
| 18978 | + dict[jsonName] = dict[propertyName]; | |
| 18979 | + [dict removeObjectForKey:propertyName]; | |
| 18980 | + } | |
| 18981 | + } | |
| 18982 | + | |
| 18983 | + return dict; | |
| 18984 | +} | |
| 18985 | +@end | |
| 18986 | + | |
| 18781 | 18987 | @implementation QTVoid |
| 18782 | 18988 | + (NSDictionary<NSString *, NSString *> *)properties |
| 18783 | 18989 | { |
| @@ -18934,6 +19140,48 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 18934 | 19140 | } |
| 18935 | 19141 | @end |
| 18936 | 19142 | |
| 19143 | +@implementation QTUshort | |
| 19144 | ++ (NSDictionary<NSString *, NSString *> *)properties | |
| 19145 | +{ | |
| 19146 | + static NSDictionary<NSString *, NSString *> *properties; | |
| 19147 | + return properties = properties ? properties : @{ | |
| 19148 | + @"ushort": @"ushort", | |
| 19149 | + }; | |
| 19150 | +} | |
| 19151 | + | |
| 19152 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict | |
| 19153 | +{ | |
| 19154 | + return [dict isKindOfClass:NSDictionary.class] ? [[QTUshort alloc] initWithJSONDictionary:dict] : nil; | |
| 19155 | +} | |
| 19156 | + | |
| 19157 | +- (instancetype)initWithJSONDictionary:(NSDictionary *)dict | |
| 19158 | +{ | |
| 19159 | + if (self = [super init]) { | |
| 19160 | + if (![dict[@"ushort"] isKindOfClass:NSNumber.class]) return nil; | |
| 19161 | + if ([dict[@"ushort"] doubleValue] != [dict[@"ushort"] longLongValue]) return nil; | |
| 19162 | + [self setValuesForKeysWithDictionary:dict]; | |
| 19163 | + } | |
| 19164 | + return self; | |
| 19165 | +} | |
| 19166 | + | |
| 19167 | +- (void)setValue:(nullable id)value forKey:(NSString *)key | |
| 19168 | +{ | |
| 19169 | + id resolved = QTUshort.properties[key]; | |
| 19170 | + if (resolved) [super setValue:value forKey:resolved]; | |
| 19171 | +} | |
| 19172 | + | |
| 19173 | +- (void)setNilValueForKey:(NSString *)key | |
| 19174 | +{ | |
| 19175 | + id resolved = QTUshort.properties[key]; | |
| 19176 | + if (resolved) [super setValue:@(0) forKey:resolved]; | |
| 19177 | +} | |
| 19178 | + | |
| 19179 | +- (NSDictionary *)JSONDictionary | |
| 19180 | +{ | |
| 19181 | + return [self dictionaryWithValuesForKeys:QTUshort.properties.allValues]; | |
| 19182 | +} | |
| 19183 | +@end | |
| 19184 | + | |
| 18937 | 19185 | @implementation QTUsing |
| 18938 | 19186 | + (NSDictionary<NSString *, NSString *> *)properties |
| 18939 | 19187 | { |
Mphpdefault / TopLevel.php+1,632 −996
| @@ -10787,13 +10787,13 @@ class Obj2 { | ||
| 10787 | 10787 | private FormatException $formatException; // json:FormatException Required |
| 10788 | 10788 | private Friend $friend; // json:friend Required |
| 10789 | 10789 | private From $from; // json:from Required |
| 10790 | + private FromDict $fromDict; // json:from_dict Required | |
| 10790 | 10791 | private FromJSON $fromJSON; // json:from_json Required |
| 10791 | 10792 | private Func $func; // json:func Required |
| 10792 | 10793 | private FunctionClass $function; // json:function Required |
| 10793 | 10794 | private Get $get; // json:get Required |
| 10794 | 10795 | private GlobalClass $global; // json:global Required |
| 10795 | 10796 | private Go $go; // json:go Required |
| 10796 | - private GotoClass $goto; // json:goto Required | |
| 10797 | 10797 | private Obj2False $obj2False; // json:false Required |
| 10798 | 10798 | |
| 10799 | 10799 | /** |
| @@ -10854,16 +10854,16 @@ class Obj2 { | ||
| 10854 | 10854 | * @param FormatException $formatException |
| 10855 | 10855 | * @param Friend $friend |
| 10856 | 10856 | * @param From $from |
| 10857 | + * @param FromDict $fromDict | |
| 10857 | 10858 | * @param FromJSON $fromJSON |
| 10858 | 10859 | * @param Func $func |
| 10859 | 10860 | * @param FunctionClass $function |
| 10860 | 10861 | * @param Get $get |
| 10861 | 10862 | * @param GlobalClass $global |
| 10862 | 10863 | * @param Go $go |
| 10863 | - * @param GotoClass $goto | |
| 10864 | 10864 | * @param Obj2False $obj2False |
| 10865 | 10865 | */ |
| 10866 | - public function __construct(DateFormatter $dateFormatter, DateOnly $dateOnly, DateOnlyConverter $dateOnlyConverter, DateParseHandling $dateParseHandling, DateTimeClass $dateTime, DateTimeStyles $dateTimeStyles, Debugger $debugger, Decimal $decimal, DeclareClass $declare, Decltype $decltype, DecodeString $decodeString, Decoder $decoder, DecodingError $decodingError, Def $def, DefaultClass $default, Defer $defer, Deinit $deinit, Del $del, Delegate $delegate, Delete $delete, Dict $dict, Dictionary $dictionary, DidSet $didSet, DoClass $do, Double $double, int $dummy, Dynamic $dynamic, DynamicCast $dynamicCast, Elif $elif, ElseClass $else, EncodeQuickType $encodeQuickType, Encoder $encoder, EnumClass $enum, EnumValues $enumValues, EqualityContract $equalityContract, Equatable $equatable, Event $event, Except $except, ExceptionClass $exception, Explicit $explicit, Export $export, Exposing $exposing, ExtendsClass $extends, Extension $extension, Extern $extern, Fallthrough $fallthrough, FalseClass $false, Fileprivate $fileprivate, FinalClass $final, FinallyClass $finally, Fixed $fixed, FloatClass $float, ForClass $for, ForeachClass $foreach, FormatException $formatException, Friend $friend, From $from, FromJSON $fromJSON, Func $func, FunctionClass $function, Get $get, GlobalClass $global, Go $go, GotoClass $goto, Obj2False $obj2False) { | |
| 10866 | + public function __construct(DateFormatter $dateFormatter, DateOnly $dateOnly, DateOnlyConverter $dateOnlyConverter, DateParseHandling $dateParseHandling, DateTimeClass $dateTime, DateTimeStyles $dateTimeStyles, Debugger $debugger, Decimal $decimal, DeclareClass $declare, Decltype $decltype, DecodeString $decodeString, Decoder $decoder, DecodingError $decodingError, Def $def, DefaultClass $default, Defer $defer, Deinit $deinit, Del $del, Delegate $delegate, Delete $delete, Dict $dict, Dictionary $dictionary, DidSet $didSet, DoClass $do, Double $double, int $dummy, Dynamic $dynamic, DynamicCast $dynamicCast, Elif $elif, ElseClass $else, EncodeQuickType $encodeQuickType, Encoder $encoder, EnumClass $enum, EnumValues $enumValues, EqualityContract $equalityContract, Equatable $equatable, Event $event, Except $except, ExceptionClass $exception, Explicit $explicit, Export $export, Exposing $exposing, ExtendsClass $extends, Extension $extension, Extern $extern, Fallthrough $fallthrough, FalseClass $false, Fileprivate $fileprivate, FinalClass $final, FinallyClass $finally, Fixed $fixed, FloatClass $float, ForClass $for, ForeachClass $foreach, FormatException $formatException, Friend $friend, From $from, FromDict $fromDict, FromJSON $fromJSON, Func $func, FunctionClass $function, Get $get, GlobalClass $global, Go $go, Obj2False $obj2False) { | |
| 10867 | 10867 | $this->dateFormatter = $dateFormatter; |
| 10868 | 10868 | $this->dateOnly = $dateOnly; |
| 10869 | 10869 | $this->dateOnlyConverter = $dateOnlyConverter; |
| @@ -10921,13 +10921,13 @@ class Obj2 { | ||
| 10921 | 10921 | $this->formatException = $formatException; |
| 10922 | 10922 | $this->friend = $friend; |
| 10923 | 10923 | $this->from = $from; |
| 10924 | + $this->fromDict = $fromDict; | |
| 10924 | 10925 | $this->fromJSON = $fromJSON; |
| 10925 | 10926 | $this->func = $func; |
| 10926 | 10927 | $this->function = $function; |
| 10927 | 10928 | $this->get = $get; |
| 10928 | 10929 | $this->global = $global; |
| 10929 | 10930 | $this->go = $go; |
| 10930 | - $this->goto = $goto; | |
| 10931 | 10931 | $this->obj2False = $obj2False; |
| 10932 | 10932 | } |
| 10933 | 10933 | |
| @@ -11896,7 +11896,7 @@ class Obj2 { | ||
| 11896 | 11896 | * @throws Exception |
| 11897 | 11897 | * @return Dict |
| 11898 | 11898 | */ |
| 11899 | - public static function fromDict(stdClass $value): Dict { | |
| 11899 | + public static function purpleFromDict(stdClass $value): Dict { | |
| 11900 | 11900 | return Dict::from($value); /*class*/ |
| 11901 | 11901 | } |
| 11902 | 11902 | |
| @@ -13666,6 +13666,54 @@ class Obj2 { | ||
| 13666 | 13666 | return From::sample(); /*87:from*/ |
| 13667 | 13667 | } |
| 13668 | 13668 | |
| 13669 | + /** | |
| 13670 | + * @param stdClass $value | |
| 13671 | + * @throws Exception | |
| 13672 | + * @return FromDict | |
| 13673 | + */ | |
| 13674 | + public static function fromFromDict(stdClass $value): FromDict { | |
| 13675 | + return FromDict::from($value); /*class*/ | |
| 13676 | + } | |
| 13677 | + | |
| 13678 | + /** | |
| 13679 | + * @throws Exception | |
| 13680 | + * @return stdClass | |
| 13681 | + */ | |
| 13682 | + public function toFromDict(): stdClass { | |
| 13683 | + if (Obj2::validateFromDict($this->fromDict)) { | |
| 13684 | + return $this->fromDict->to(); /*class*/ | |
| 13685 | + } | |
| 13686 | + throw new Exception('never get to this Obj2::fromDict'); | |
| 13687 | + } | |
| 13688 | + | |
| 13689 | + /** | |
| 13690 | + * @param FromDict | |
| 13691 | + * @return bool | |
| 13692 | + * @throws Exception | |
| 13693 | + */ | |
| 13694 | + public static function validateFromDict(FromDict $value): bool { | |
| 13695 | + $value->validate(); | |
| 13696 | + return true; | |
| 13697 | + } | |
| 13698 | + | |
| 13699 | + /** | |
| 13700 | + * @throws Exception | |
| 13701 | + * @return FromDict | |
| 13702 | + */ | |
| 13703 | + public function getFromDict(): FromDict { | |
| 13704 | + if (Obj2::validateFromDict($this->fromDict)) { | |
| 13705 | + return $this->fromDict; | |
| 13706 | + } | |
| 13707 | + throw new Exception('never get to getFromDict Obj2::fromDict'); | |
| 13708 | + } | |
| 13709 | + | |
| 13710 | + /** | |
| 13711 | + * @return FromDict | |
| 13712 | + */ | |
| 13713 | + public static function sampleFromDict(): FromDict { | |
| 13714 | + return FromDict::sample(); /*88:fromDict*/ | |
| 13715 | + } | |
| 13716 | + | |
| 13669 | 13717 | /** |
| 13670 | 13718 | * @param stdClass $value |
| 13671 | 13719 | * @throws Exception |
| @@ -13711,7 +13759,7 @@ class Obj2 { | ||
| 13711 | 13759 | * @return FromJSON |
| 13712 | 13760 | */ |
| 13713 | 13761 | public static function sampleFromJSON(): FromJSON { |
| 13714 | - return FromJSON::sample(); /*88:fromJSON*/ | |
| 13762 | + return FromJSON::sample(); /*89:fromJSON*/ | |
| 13715 | 13763 | } |
| 13716 | 13764 | |
| 13717 | 13765 | /** |
| @@ -13759,7 +13807,7 @@ class Obj2 { | ||
| 13759 | 13807 | * @return Func |
| 13760 | 13808 | */ |
| 13761 | 13809 | public static function sampleFunc(): Func { |
| 13762 | - return Func::sample(); /*89:func*/ | |
| 13810 | + return Func::sample(); /*90:func*/ | |
| 13763 | 13811 | } |
| 13764 | 13812 | |
| 13765 | 13813 | /** |
| @@ -13807,7 +13855,7 @@ class Obj2 { | ||
| 13807 | 13855 | * @return FunctionClass |
| 13808 | 13856 | */ |
| 13809 | 13857 | public static function sampleFunction(): FunctionClass { |
| 13810 | - return FunctionClass::sample(); /*90:function*/ | |
| 13858 | + return FunctionClass::sample(); /*91:function*/ | |
| 13811 | 13859 | } |
| 13812 | 13860 | |
| 13813 | 13861 | /** |
| @@ -13855,7 +13903,7 @@ class Obj2 { | ||
| 13855 | 13903 | * @return Get |
| 13856 | 13904 | */ |
| 13857 | 13905 | public static function sampleGet(): Get { |
| 13858 | - return Get::sample(); /*91:get*/ | |
| 13906 | + return Get::sample(); /*92:get*/ | |
| 13859 | 13907 | } |
| 13860 | 13908 | |
| 13861 | 13909 | /** |
| @@ -13903,7 +13951,7 @@ class Obj2 { | ||
| 13903 | 13951 | * @return GlobalClass |
| 13904 | 13952 | */ |
| 13905 | 13953 | public static function sampleGlobal(): GlobalClass { |
| 13906 | - return GlobalClass::sample(); /*92:global*/ | |
| 13954 | + return GlobalClass::sample(); /*93:global*/ | |
| 13907 | 13955 | } |
| 13908 | 13956 | |
| 13909 | 13957 | /** |
| @@ -13951,55 +13999,7 @@ class Obj2 { | ||
| 13951 | 13999 | * @return Go |
| 13952 | 14000 | */ |
| 13953 | 14001 | public static function sampleGo(): Go { |
| 13954 | - return Go::sample(); /*93:go*/ | |
| 13955 | - } | |
| 13956 | - | |
| 13957 | - /** | |
| 13958 | - * @param stdClass $value | |
| 13959 | - * @throws Exception | |
| 13960 | - * @return GotoClass | |
| 13961 | - */ | |
| 13962 | - public static function fromGoto(stdClass $value): GotoClass { | |
| 13963 | - return GotoClass::from($value); /*class*/ | |
| 13964 | - } | |
| 13965 | - | |
| 13966 | - /** | |
| 13967 | - * @throws Exception | |
| 13968 | - * @return stdClass | |
| 13969 | - */ | |
| 13970 | - public function toGoto(): stdClass { | |
| 13971 | - if (Obj2::validateGoto($this->goto)) { | |
| 13972 | - return $this->goto->to(); /*class*/ | |
| 13973 | - } | |
| 13974 | - throw new Exception('never get to this Obj2::goto'); | |
| 13975 | - } | |
| 13976 | - | |
| 13977 | - /** | |
| 13978 | - * @param GotoClass | |
| 13979 | - * @return bool | |
| 13980 | - * @throws Exception | |
| 13981 | - */ | |
| 13982 | - public static function validateGoto(GotoClass $value): bool { | |
| 13983 | - $value->validate(); | |
| 13984 | - return true; | |
| 13985 | - } | |
| 13986 | - | |
| 13987 | - /** | |
| 13988 | - * @throws Exception | |
| 13989 | - * @return GotoClass | |
| 13990 | - */ | |
| 13991 | - public function getGoto(): GotoClass { | |
| 13992 | - if (Obj2::validateGoto($this->goto)) { | |
| 13993 | - return $this->goto; | |
| 13994 | - } | |
| 13995 | - throw new Exception('never get to getGoto Obj2::goto'); | |
| 13996 | - } | |
| 13997 | - | |
| 13998 | - /** | |
| 13999 | - * @return GotoClass | |
| 14000 | - */ | |
| 14001 | - public static function sampleGoto(): GotoClass { | |
| 14002 | - return GotoClass::sample(); /*94:goto*/ | |
| 14002 | + return Go::sample(); /*94:go*/ | |
| 14003 | 14003 | } |
| 14004 | 14004 | |
| 14005 | 14005 | /** |
| @@ -14112,13 +14112,13 @@ class Obj2 { | ||
| 14112 | 14112 | || Obj2::validateFormatException($this->formatException) |
| 14113 | 14113 | || Obj2::validateFriend($this->friend) |
| 14114 | 14114 | || Obj2::validateFrom($this->from) |
| 14115 | + || Obj2::validateFromDict($this->fromDict) | |
| 14115 | 14116 | || Obj2::validateFromJSON($this->fromJSON) |
| 14116 | 14117 | || Obj2::validateFunc($this->func) |
| 14117 | 14118 | || Obj2::validateFunction($this->function) |
| 14118 | 14119 | || Obj2::validateGet($this->get) |
| 14119 | 14120 | || Obj2::validateGlobal($this->global) |
| 14120 | 14121 | || Obj2::validateGo($this->go) |
| 14121 | - || Obj2::validateGoto($this->goto) | |
| 14122 | 14122 | || Obj2::validateObj2False($this->obj2False); |
| 14123 | 14123 | } |
| 14124 | 14124 | |
| @@ -14185,13 +14185,13 @@ class Obj2 { | ||
| 14185 | 14185 | $out->{'FormatException'} = $this->toFormatException(); |
| 14186 | 14186 | $out->{'friend'} = $this->toFriend(); |
| 14187 | 14187 | $out->{'from'} = $this->toFrom(); |
| 14188 | + $out->{'from_dict'} = $this->toFromDict(); | |
| 14188 | 14189 | $out->{'from_json'} = $this->toFromJSON(); |
| 14189 | 14190 | $out->{'func'} = $this->toFunc(); |
| 14190 | 14191 | $out->{'function'} = $this->toFunction(); |
| 14191 | 14192 | $out->{'get'} = $this->toGet(); |
| 14192 | 14193 | $out->{'global'} = $this->toGlobal(); |
| 14193 | 14194 | $out->{'go'} = $this->toGo(); |
| 14194 | - $out->{'goto'} = $this->toGoto(); | |
| 14195 | 14195 | $out->{'false'} = $this->toObj2False(); |
| 14196 | 14196 | return $out; |
| 14197 | 14197 | } |
| @@ -14373,6 +14373,9 @@ class Obj2 { | ||
| 14373 | 14373 | if (!property_exists($obj, 'from')) { |
| 14374 | 14374 | throw new Exception("Missing required property"); |
| 14375 | 14375 | } |
| 14376 | + if (!property_exists($obj, 'from_dict')) { | |
| 14377 | + throw new Exception("Missing required property"); | |
| 14378 | + } | |
| 14376 | 14379 | if (!property_exists($obj, 'from_json')) { |
| 14377 | 14380 | throw new Exception("Missing required property"); |
| 14378 | 14381 | } |
| @@ -14391,9 +14394,6 @@ class Obj2 { | ||
| 14391 | 14394 | if (!property_exists($obj, 'go')) { |
| 14392 | 14395 | throw new Exception("Missing required property"); |
| 14393 | 14396 | } |
| 14394 | - if (!property_exists($obj, 'goto')) { | |
| 14395 | - throw new Exception("Missing required property"); | |
| 14396 | - } | |
| 14397 | 14397 | if (!property_exists($obj, 'false')) { |
| 14398 | 14398 | throw new Exception("Missing required property"); |
| 14399 | 14399 | } |
| @@ -14418,7 +14418,7 @@ class Obj2 { | ||
| 14418 | 14418 | ,Obj2::fromDel($obj->{'del'}) |
| 14419 | 14419 | ,Obj2::fromDelegate($obj->{'delegate'}) |
| 14420 | 14420 | ,Obj2::fromDelete($obj->{'delete'}) |
| 14421 | - ,Obj2::fromDict($obj->{'dict'}) | |
| 14421 | + ,Obj2::purpleFromDict($obj->{'dict'}) | |
| 14422 | 14422 | ,Obj2::fromDictionary($obj->{'dictionary'}) |
| 14423 | 14423 | ,Obj2::fromDidSet($obj->{'didSet'}) |
| 14424 | 14424 | ,Obj2::fromDo($obj->{'do'}) |
| @@ -14455,13 +14455,13 @@ class Obj2 { | ||
| 14455 | 14455 | ,Obj2::fromFormatException($obj->{'FormatException'}) |
| 14456 | 14456 | ,Obj2::fromFriend($obj->{'friend'}) |
| 14457 | 14457 | ,Obj2::fromFrom($obj->{'from'}) |
| 14458 | + ,Obj2::fromFromDict($obj->{'from_dict'}) | |
| 14458 | 14459 | ,Obj2::fromFromJSON($obj->{'from_json'}) |
| 14459 | 14460 | ,Obj2::fromFunc($obj->{'func'}) |
| 14460 | 14461 | ,Obj2::fromFunction($obj->{'function'}) |
| 14461 | 14462 | ,Obj2::fromGet($obj->{'get'}) |
| 14462 | 14463 | ,Obj2::fromGlobal($obj->{'global'}) |
| 14463 | 14464 | ,Obj2::fromGo($obj->{'go'}) |
| 14464 | - ,Obj2::fromGoto($obj->{'goto'}) | |
| 14465 | 14465 | ,Obj2::fromObj2False($obj->{'false'}) |
| 14466 | 14466 | ); |
| 14467 | 14467 | } |
| @@ -14528,13 +14528,13 @@ class Obj2 { | ||
| 14528 | 14528 | ,Obj2::sampleFormatException() |
| 14529 | 14529 | ,Obj2::sampleFriend() |
| 14530 | 14530 | ,Obj2::sampleFrom() |
| 14531 | + ,Obj2::sampleFromDict() | |
| 14531 | 14532 | ,Obj2::sampleFromJSON() |
| 14532 | 14533 | ,Obj2::sampleFunc() |
| 14533 | 14534 | ,Obj2::sampleFunction() |
| 14534 | 14535 | ,Obj2::sampleGet() |
| 14535 | 14536 | ,Obj2::sampleGlobal() |
| 14536 | 14537 | ,Obj2::sampleGo() |
| 14537 | - ,Obj2::sampleGoto() | |
| 14538 | 14538 | ,Obj2::sampleObj2False() |
| 14539 | 14539 | ); |
| 14540 | 14540 | } |
| @@ -20264,6 +20264,107 @@ class From { | ||
| 20264 | 20264 | } |
| 20265 | 20265 | } |
| 20266 | 20266 | |
| 20267 | +// This is an autogenerated file:FromDict | |
| 20268 | + | |
| 20269 | +class FromDict { | |
| 20270 | + private int $fromDict; // json:from_dict Required | |
| 20271 | + | |
| 20272 | + /** | |
| 20273 | + * @param int $fromDict | |
| 20274 | + */ | |
| 20275 | + public function __construct(int $fromDict) { | |
| 20276 | + $this->fromDict = $fromDict; | |
| 20277 | + } | |
| 20278 | + | |
| 20279 | + /** | |
| 20280 | + * @param int $value | |
| 20281 | + * @throws Exception | |
| 20282 | + * @return int | |
| 20283 | + */ | |
| 20284 | + public static function fromFromDict(int $value): int { | |
| 20285 | + return $value; /*int*/ | |
| 20286 | + } | |
| 20287 | + | |
| 20288 | + /** | |
| 20289 | + * @throws Exception | |
| 20290 | + * @return int | |
| 20291 | + */ | |
| 20292 | + public function toFromDict(): int { | |
| 20293 | + if (FromDict::validateFromDict($this->fromDict)) { | |
| 20294 | + return $this->fromDict; /*int*/ | |
| 20295 | + } | |
| 20296 | + throw new Exception('never get to this FromDict::fromDict'); | |
| 20297 | + } | |
| 20298 | + | |
| 20299 | + /** | |
| 20300 | + * @param int | |
| 20301 | + * @return bool | |
| 20302 | + * @throws Exception | |
| 20303 | + */ | |
| 20304 | + public static function validateFromDict(int $value): bool { | |
| 20305 | + return true; | |
| 20306 | + } | |
| 20307 | + | |
| 20308 | + /** | |
| 20309 | + * @throws Exception | |
| 20310 | + * @return int | |
| 20311 | + */ | |
| 20312 | + public function getFromDict(): int { | |
| 20313 | + if (FromDict::validateFromDict($this->fromDict)) { | |
| 20314 | + return $this->fromDict; | |
| 20315 | + } | |
| 20316 | + throw new Exception('never get to getFromDict FromDict::fromDict'); | |
| 20317 | + } | |
| 20318 | + | |
| 20319 | + /** | |
| 20320 | + * @return int | |
| 20321 | + */ | |
| 20322 | + public static function sampleFromDict(): int { | |
| 20323 | + return 31; /*31:fromDict*/ | |
| 20324 | + } | |
| 20325 | + | |
| 20326 | + /** | |
| 20327 | + * @throws Exception | |
| 20328 | + * @return bool | |
| 20329 | + */ | |
| 20330 | + public function validate(): bool { | |
| 20331 | + return FromDict::validateFromDict($this->fromDict); | |
| 20332 | + } | |
| 20333 | + | |
| 20334 | + /** | |
| 20335 | + * @return stdClass | |
| 20336 | + * @throws Exception | |
| 20337 | + */ | |
| 20338 | + public function to(): stdClass { | |
| 20339 | + $out = new stdClass(); | |
| 20340 | + $out->{'from_dict'} = $this->toFromDict(); | |
| 20341 | + return $out; | |
| 20342 | + } | |
| 20343 | + | |
| 20344 | + /** | |
| 20345 | + * @param stdClass $obj | |
| 20346 | + * @return FromDict | |
| 20347 | + * @throws Exception | |
| 20348 | + */ | |
| 20349 | + public static function from(stdClass $obj): FromDict { | |
| 20350 | + if (!property_exists($obj, 'from_dict')) { | |
| 20351 | + throw new Exception("Missing required property"); | |
| 20352 | + } | |
| 20353 | + return new FromDict( | |
| 20354 | + FromDict::fromFromDict($obj->{'from_dict'}) | |
| 20355 | + ); | |
| 20356 | + } | |
| 20357 | + | |
| 20358 | + /** | |
| 20359 | + * @return FromDict | |
| 20360 | + */ | |
| 20361 | + public static function sample(): FromDict { | |
| 20362 | + return new FromDict( | |
| 20363 | + FromDict::sampleFromDict() | |
| 20364 | + ); | |
| 20365 | + } | |
| 20366 | +} | |
| 20367 | + | |
| 20267 | 20368 | // This is an autogenerated file:FromJSON |
| 20268 | 20369 | |
| 20269 | 20370 | class FromJSON { |
| @@ -20870,107 +20971,6 @@ class Go { | ||
| 20870 | 20971 | } |
| 20871 | 20972 | } |
| 20872 | 20973 | |
| 20873 | -// This is an autogenerated file:GotoClass | |
| 20874 | - | |
| 20875 | -class GotoClass { | |
| 20876 | - private int $goto; // json:goto Required | |
| 20877 | - | |
| 20878 | - /** | |
| 20879 | - * @param int $goto | |
| 20880 | - */ | |
| 20881 | - public function __construct(int $goto) { | |
| 20882 | - $this->goto = $goto; | |
| 20883 | - } | |
| 20884 | - | |
| 20885 | - /** | |
| 20886 | - * @param int $value | |
| 20887 | - * @throws Exception | |
| 20888 | - * @return int | |
| 20889 | - */ | |
| 20890 | - public static function fromGoto(int $value): int { | |
| 20891 | - return $value; /*int*/ | |
| 20892 | - } | |
| 20893 | - | |
| 20894 | - /** | |
| 20895 | - * @throws Exception | |
| 20896 | - * @return int | |
| 20897 | - */ | |
| 20898 | - public function toGoto(): int { | |
| 20899 | - if (GotoClass::validateGoto($this->goto)) { | |
| 20900 | - return $this->goto; /*int*/ | |
| 20901 | - } | |
| 20902 | - throw new Exception('never get to this GotoClass::goto'); | |
| 20903 | - } | |
| 20904 | - | |
| 20905 | - /** | |
| 20906 | - * @param int | |
| 20907 | - * @return bool | |
| 20908 | - * @throws Exception | |
| 20909 | - */ | |
| 20910 | - public static function validateGoto(int $value): bool { | |
| 20911 | - return true; | |
| 20912 | - } | |
| 20913 | - | |
| 20914 | - /** | |
| 20915 | - * @throws Exception | |
| 20916 | - * @return int | |
| 20917 | - */ | |
| 20918 | - public function getGoto(): int { | |
| 20919 | - if (GotoClass::validateGoto($this->goto)) { | |
| 20920 | - return $this->goto; | |
| 20921 | - } | |
| 20922 | - throw new Exception('never get to getGoto GotoClass::goto'); | |
| 20923 | - } | |
| 20924 | - | |
| 20925 | - /** | |
| 20926 | - * @return int | |
| 20927 | - */ | |
| 20928 | - public static function sampleGoto(): int { | |
| 20929 | - return 31; /*31:goto*/ | |
| 20930 | - } | |
| 20931 | - | |
| 20932 | - /** | |
| 20933 | - * @throws Exception | |
| 20934 | - * @return bool | |
| 20935 | - */ | |
| 20936 | - public function validate(): bool { | |
| 20937 | - return GotoClass::validateGoto($this->goto); | |
| 20938 | - } | |
| 20939 | - | |
| 20940 | - /** | |
| 20941 | - * @return stdClass | |
| 20942 | - * @throws Exception | |
| 20943 | - */ | |
| 20944 | - public function to(): stdClass { | |
| 20945 | - $out = new stdClass(); | |
| 20946 | - $out->{'goto'} = $this->toGoto(); | |
| 20947 | - return $out; | |
| 20948 | - } | |
| 20949 | - | |
| 20950 | - /** | |
| 20951 | - * @param stdClass $obj | |
| 20952 | - * @return GotoClass | |
| 20953 | - * @throws Exception | |
| 20954 | - */ | |
| 20955 | - public static function from(stdClass $obj): GotoClass { | |
| 20956 | - if (!property_exists($obj, 'goto')) { | |
| 20957 | - throw new Exception("Missing required property"); | |
| 20958 | - } | |
| 20959 | - return new GotoClass( | |
| 20960 | - GotoClass::fromGoto($obj->{'goto'}) | |
| 20961 | - ); | |
| 20962 | - } | |
| 20963 | - | |
| 20964 | - /** | |
| 20965 | - * @return GotoClass | |
| 20966 | - */ | |
| 20967 | - public static function sample(): GotoClass { | |
| 20968 | - return new GotoClass( | |
| 20969 | - GotoClass::sampleGoto() | |
| 20970 | - ); | |
| 20971 | - } | |
| 20972 | -} | |
| 20973 | - | |
| 20974 | 20974 | // This is an autogenerated file:Obj2False |
| 20975 | 20975 | |
| 20976 | 20976 | class Obj2False { |
| @@ -21076,6 +21076,7 @@ class Obj2False { | ||
| 21076 | 21076 | |
| 21077 | 21077 | class Obj3 { |
| 21078 | 21078 | private int $dummy; // json:dummy Required |
| 21079 | + private GotoClass $goto; // json:goto Required | |
| 21079 | 21080 | private Guard $guard; // json:guard Required |
| 21080 | 21081 | private HasOwnProperty $hasOwnProperty; // json:hasOwnProperty Required |
| 21081 | 21082 | private HashCode $hashCode; // json:hashCode Required |
| @@ -21129,6 +21130,7 @@ class Obj3 { | ||
| 21129 | 21130 | private Long $long; // json:long Required |
| 21130 | 21131 | private Map $map; // json:map Required |
| 21131 | 21132 | private MapEntry $mapEntry; // json:MapEntry Required |
| 21133 | + private MarshalJSON $marshalJSON; // json:MarshalJSON Required | |
| 21132 | 21134 | private MetadataPropertyHandling $metadataPropertyHandling; // json:metadata_property_handling Required |
| 21133 | 21135 | private Module $module; // json:module Required |
| 21134 | 21136 | private Mutable $mutable; // json:mutable Required |
| @@ -21139,10 +21141,10 @@ class Obj3 { | ||
| 21139 | 21141 | private Newtonsoft $newtonsoft; // json:newtonsoft Required |
| 21140 | 21142 | private Nil $nil; // json:nil Required |
| 21141 | 21143 | private No $no; // json:NO Required |
| 21142 | - private Noexcept $noexcept; // json:noexcept Required | |
| 21143 | 21144 | |
| 21144 | 21145 | /** |
| 21145 | 21146 | * @param int $dummy |
| 21147 | + * @param GotoClass $goto | |
| 21146 | 21148 | * @param Guard $guard |
| 21147 | 21149 | * @param HasOwnProperty $hasOwnProperty |
| 21148 | 21150 | * @param HashCode $hashCode |
| @@ -21196,6 +21198,7 @@ class Obj3 { | ||
| 21196 | 21198 | * @param Long $long |
| 21197 | 21199 | * @param Map $map |
| 21198 | 21200 | * @param MapEntry $mapEntry |
| 21201 | + * @param MarshalJSON $marshalJSON | |
| 21199 | 21202 | * @param MetadataPropertyHandling $metadataPropertyHandling |
| 21200 | 21203 | * @param Module $module |
| 21201 | 21204 | * @param Mutable $mutable |
| @@ -21206,10 +21209,10 @@ class Obj3 { | ||
| 21206 | 21209 | * @param Newtonsoft $newtonsoft |
| 21207 | 21210 | * @param Nil $nil |
| 21208 | 21211 | * @param No $no |
| 21209 | - * @param Noexcept $noexcept | |
| 21210 | 21212 | */ |
| 21211 | - public function __construct(int $dummy, Guard $guard, HasOwnProperty $hasOwnProperty, HashCode $hashCode, Hashable $hashable, Hasher $hasher, ID $id, IfClass $if, Imp $imp, ImplementsClass $implements, Implicit $implicit, Import $import, In $in, Indirect $indirect, Infix $infix, Init $init, Inline $inline, Inout $inout, InstanceofClass $instanceof, IntClass $int, InterfaceClass $interface, Internal $internal, Is $is, ISODateTimeOffsetConverter $isoDateTimeOffsetConverter, IterableClass $iterable, Jdec $jdec, Jenc $jenc, Jpipe $jpipe, JSON $json, JSONAny $jsonAny, JSONCodingKey $jsonCodingKey, JSONConverter $jsonConverter, JSONDecoder $jsonDecoder, JSONEncoder $jsonEncoder, JSONExceptionClass $jsonException, JSONGenerator $jsonGenerator, JSONNode $jsonNode, JSONNull $jsonNull, JSONParser $jsonParser, JSONReader $jsonReader, JSONSerializer $jsonSerializer, JSONToken $jsonToken, JSONTokenType $jsonTokenType, JSONWriter $jsonWriter, Lambda $lambda, Lazy $lazy, Left $left, Let $let, ListClass $list, LocaleClass $locale, Lock $lock, Long $long, Map $map, MapEntry $mapEntry, MetadataPropertyHandling $metadataPropertyHandling, Module $module, Mutable $mutable, Mutating $mutating, NamespaceClass $namespace, Native $native, NewClass $new, Newtonsoft $newtonsoft, Nil $nil, No $no, Noexcept $noexcept) { | |
| 21213 | + public function __construct(int $dummy, GotoClass $goto, Guard $guard, HasOwnProperty $hasOwnProperty, HashCode $hashCode, Hashable $hashable, Hasher $hasher, ID $id, IfClass $if, Imp $imp, ImplementsClass $implements, Implicit $implicit, Import $import, In $in, Indirect $indirect, Infix $infix, Init $init, Inline $inline, Inout $inout, InstanceofClass $instanceof, IntClass $int, InterfaceClass $interface, Internal $internal, Is $is, ISODateTimeOffsetConverter $isoDateTimeOffsetConverter, IterableClass $iterable, Jdec $jdec, Jenc $jenc, Jpipe $jpipe, JSON $json, JSONAny $jsonAny, JSONCodingKey $jsonCodingKey, JSONConverter $jsonConverter, JSONDecoder $jsonDecoder, JSONEncoder $jsonEncoder, JSONExceptionClass $jsonException, JSONGenerator $jsonGenerator, JSONNode $jsonNode, JSONNull $jsonNull, JSONParser $jsonParser, JSONReader $jsonReader, JSONSerializer $jsonSerializer, JSONToken $jsonToken, JSONTokenType $jsonTokenType, JSONWriter $jsonWriter, Lambda $lambda, Lazy $lazy, Left $left, Let $let, ListClass $list, LocaleClass $locale, Lock $lock, Long $long, Map $map, MapEntry $mapEntry, MarshalJSON $marshalJSON, MetadataPropertyHandling $metadataPropertyHandling, Module $module, Mutable $mutable, Mutating $mutating, NamespaceClass $namespace, Native $native, NewClass $new, Newtonsoft $newtonsoft, Nil $nil, No $no) { | |
| 21212 | 21214 | $this->dummy = $dummy; |
| 21215 | + $this->goto = $goto; | |
| 21213 | 21216 | $this->guard = $guard; |
| 21214 | 21217 | $this->hasOwnProperty = $hasOwnProperty; |
| 21215 | 21218 | $this->hashCode = $hashCode; |
| @@ -21263,6 +21266,7 @@ class Obj3 { | ||
| 21263 | 21266 | $this->long = $long; |
| 21264 | 21267 | $this->map = $map; |
| 21265 | 21268 | $this->mapEntry = $mapEntry; |
| 21269 | + $this->marshalJSON = $marshalJSON; | |
| 21266 | 21270 | $this->metadataPropertyHandling = $metadataPropertyHandling; |
| 21267 | 21271 | $this->module = $module; |
| 21268 | 21272 | $this->mutable = $mutable; |
| @@ -21273,7 +21277,6 @@ class Obj3 { | ||
| 21273 | 21277 | $this->newtonsoft = $newtonsoft; |
| 21274 | 21278 | $this->nil = $nil; |
| 21275 | 21279 | $this->no = $no; |
| 21276 | - $this->noexcept = $noexcept; | |
| 21277 | 21280 | } |
| 21278 | 21281 | |
| 21279 | 21282 | /** |
| @@ -21323,6 +21326,54 @@ class Obj3 { | ||
| 21323 | 21326 | return 31; /*31:dummy*/ |
| 21324 | 21327 | } |
| 21325 | 21328 | |
| 21329 | + /** | |
| 21330 | + * @param stdClass $value | |
| 21331 | + * @throws Exception | |
| 21332 | + * @return GotoClass | |
| 21333 | + */ | |
| 21334 | + public static function fromGoto(stdClass $value): GotoClass { | |
| 21335 | + return GotoClass::from($value); /*class*/ | |
| 21336 | + } | |
| 21337 | + | |
| 21338 | + /** | |
| 21339 | + * @throws Exception | |
| 21340 | + * @return stdClass | |
| 21341 | + */ | |
| 21342 | + public function toGoto(): stdClass { | |
| 21343 | + if (Obj3::validateGoto($this->goto)) { | |
| 21344 | + return $this->goto->to(); /*class*/ | |
| 21345 | + } | |
| 21346 | + throw new Exception('never get to this Obj3::goto'); | |
| 21347 | + } | |
| 21348 | + | |
| 21349 | + /** | |
| 21350 | + * @param GotoClass | |
| 21351 | + * @return bool | |
| 21352 | + * @throws Exception | |
| 21353 | + */ | |
| 21354 | + public static function validateGoto(GotoClass $value): bool { | |
| 21355 | + $value->validate(); | |
| 21356 | + return true; | |
| 21357 | + } | |
| 21358 | + | |
| 21359 | + /** | |
| 21360 | + * @throws Exception | |
| 21361 | + * @return GotoClass | |
| 21362 | + */ | |
| 21363 | + public function getGoto(): GotoClass { | |
| 21364 | + if (Obj3::validateGoto($this->goto)) { | |
| 21365 | + return $this->goto; | |
| 21366 | + } | |
| 21367 | + throw new Exception('never get to getGoto Obj3::goto'); | |
| 21368 | + } | |
| 21369 | + | |
| 21370 | + /** | |
| 21371 | + * @return GotoClass | |
| 21372 | + */ | |
| 21373 | + public static function sampleGoto(): GotoClass { | |
| 21374 | + return GotoClass::sample(); /*32:goto*/ | |
| 21375 | + } | |
| 21376 | + | |
| 21326 | 21377 | /** |
| 21327 | 21378 | * @param stdClass $value |
| 21328 | 21379 | * @throws Exception |
| @@ -21368,7 +21419,7 @@ class Obj3 { | ||
| 21368 | 21419 | * @return Guard |
| 21369 | 21420 | */ |
| 21370 | 21421 | public static function sampleGuard(): Guard { |
| 21371 | - return Guard::sample(); /*32:guard*/ | |
| 21422 | + return Guard::sample(); /*33:guard*/ | |
| 21372 | 21423 | } |
| 21373 | 21424 | |
| 21374 | 21425 | /** |
| @@ -21416,7 +21467,7 @@ class Obj3 { | ||
| 21416 | 21467 | * @return HasOwnProperty |
| 21417 | 21468 | */ |
| 21418 | 21469 | public static function sampleHasOwnProperty(): HasOwnProperty { |
| 21419 | - return HasOwnProperty::sample(); /*33:hasOwnProperty*/ | |
| 21470 | + return HasOwnProperty::sample(); /*34:hasOwnProperty*/ | |
| 21420 | 21471 | } |
| 21421 | 21472 | |
| 21422 | 21473 | /** |
| @@ -21464,7 +21515,7 @@ class Obj3 { | ||
| 21464 | 21515 | * @return HashCode |
| 21465 | 21516 | */ |
| 21466 | 21517 | public static function sampleHashCode(): HashCode { |
| 21467 | - return HashCode::sample(); /*34:hashCode*/ | |
| 21518 | + return HashCode::sample(); /*35:hashCode*/ | |
| 21468 | 21519 | } |
| 21469 | 21520 | |
| 21470 | 21521 | /** |
| @@ -21512,7 +21563,7 @@ class Obj3 { | ||
| 21512 | 21563 | * @return Hashable |
| 21513 | 21564 | */ |
| 21514 | 21565 | public static function sampleHashable(): Hashable { |
| 21515 | - return Hashable::sample(); /*35:hashable*/ | |
| 21566 | + return Hashable::sample(); /*36:hashable*/ | |
| 21516 | 21567 | } |
| 21517 | 21568 | |
| 21518 | 21569 | /** |
| @@ -21560,7 +21611,7 @@ class Obj3 { | ||
| 21560 | 21611 | * @return Hasher |
| 21561 | 21612 | */ |
| 21562 | 21613 | public static function sampleHasher(): Hasher { |
| 21563 | - return Hasher::sample(); /*36:hasher*/ | |
| 21614 | + return Hasher::sample(); /*37:hasher*/ | |
| 21564 | 21615 | } |
| 21565 | 21616 | |
| 21566 | 21617 | /** |
| @@ -21608,7 +21659,7 @@ class Obj3 { | ||
| 21608 | 21659 | * @return ID |
| 21609 | 21660 | */ |
| 21610 | 21661 | public static function sampleID(): ID { |
| 21611 | - return ID::sample(); /*37:id*/ | |
| 21662 | + return ID::sample(); /*38:id*/ | |
| 21612 | 21663 | } |
| 21613 | 21664 | |
| 21614 | 21665 | /** |
| @@ -21656,7 +21707,7 @@ class Obj3 { | ||
| 21656 | 21707 | * @return IfClass |
| 21657 | 21708 | */ |
| 21658 | 21709 | public static function sampleIf(): IfClass { |
| 21659 | - return IfClass::sample(); /*38:if*/ | |
| 21710 | + return IfClass::sample(); /*39:if*/ | |
| 21660 | 21711 | } |
| 21661 | 21712 | |
| 21662 | 21713 | /** |
| @@ -21704,7 +21755,7 @@ class Obj3 { | ||
| 21704 | 21755 | * @return Imp |
| 21705 | 21756 | */ |
| 21706 | 21757 | public static function sampleImp(): Imp { |
| 21707 | - return Imp::sample(); /*39:imp*/ | |
| 21758 | + return Imp::sample(); /*40:imp*/ | |
| 21708 | 21759 | } |
| 21709 | 21760 | |
| 21710 | 21761 | /** |
| @@ -21752,7 +21803,7 @@ class Obj3 { | ||
| 21752 | 21803 | * @return ImplementsClass |
| 21753 | 21804 | */ |
| 21754 | 21805 | public static function sampleImplements(): ImplementsClass { |
| 21755 | - return ImplementsClass::sample(); /*40:implements*/ | |
| 21806 | + return ImplementsClass::sample(); /*41:implements*/ | |
| 21756 | 21807 | } |
| 21757 | 21808 | |
| 21758 | 21809 | /** |
| @@ -21800,7 +21851,7 @@ class Obj3 { | ||
| 21800 | 21851 | * @return Implicit |
| 21801 | 21852 | */ |
| 21802 | 21853 | public static function sampleImplicit(): Implicit { |
| 21803 | - return Implicit::sample(); /*41:implicit*/ | |
| 21854 | + return Implicit::sample(); /*42:implicit*/ | |
| 21804 | 21855 | } |
| 21805 | 21856 | |
| 21806 | 21857 | /** |
| @@ -21848,7 +21899,7 @@ class Obj3 { | ||
| 21848 | 21899 | * @return Import |
| 21849 | 21900 | */ |
| 21850 | 21901 | public static function sampleImport(): Import { |
| 21851 | - return Import::sample(); /*42:import*/ | |
| 21902 | + return Import::sample(); /*43:import*/ | |
| 21852 | 21903 | } |
| 21853 | 21904 | |
| 21854 | 21905 | /** |
| @@ -21896,7 +21947,7 @@ class Obj3 { | ||
| 21896 | 21947 | * @return In |
| 21897 | 21948 | */ |
| 21898 | 21949 | public static function sampleIn(): In { |
| 21899 | - return In::sample(); /*43:in*/ | |
| 21950 | + return In::sample(); /*44:in*/ | |
| 21900 | 21951 | } |
| 21901 | 21952 | |
| 21902 | 21953 | /** |
| @@ -21944,7 +21995,7 @@ class Obj3 { | ||
| 21944 | 21995 | * @return Indirect |
| 21945 | 21996 | */ |
| 21946 | 21997 | public static function sampleIndirect(): Indirect { |
| 21947 | - return Indirect::sample(); /*44:indirect*/ | |
| 21998 | + return Indirect::sample(); /*45:indirect*/ | |
| 21948 | 21999 | } |
| 21949 | 22000 | |
| 21950 | 22001 | /** |
| @@ -21992,7 +22043,7 @@ class Obj3 { | ||
| 21992 | 22043 | * @return Infix |
| 21993 | 22044 | */ |
| 21994 | 22045 | public static function sampleInfix(): Infix { |
| 21995 | - return Infix::sample(); /*45:infix*/ | |
| 22046 | + return Infix::sample(); /*46:infix*/ | |
| 21996 | 22047 | } |
| 21997 | 22048 | |
| 21998 | 22049 | /** |
| @@ -22040,7 +22091,7 @@ class Obj3 { | ||
| 22040 | 22091 | * @return Init |
| 22041 | 22092 | */ |
| 22042 | 22093 | public static function sampleInit(): Init { |
| 22043 | - return Init::sample(); /*46:init*/ | |
| 22094 | + return Init::sample(); /*47:init*/ | |
| 22044 | 22095 | } |
| 22045 | 22096 | |
| 22046 | 22097 | /** |
| @@ -22088,7 +22139,7 @@ class Obj3 { | ||
| 22088 | 22139 | * @return Inline |
| 22089 | 22140 | */ |
| 22090 | 22141 | public static function sampleInline(): Inline { |
| 22091 | - return Inline::sample(); /*47:inline*/ | |
| 22142 | + return Inline::sample(); /*48:inline*/ | |
| 22092 | 22143 | } |
| 22093 | 22144 | |
| 22094 | 22145 | /** |
| @@ -22136,7 +22187,7 @@ class Obj3 { | ||
| 22136 | 22187 | * @return Inout |
| 22137 | 22188 | */ |
| 22138 | 22189 | public static function sampleInout(): Inout { |
| 22139 | - return Inout::sample(); /*48:inout*/ | |
| 22190 | + return Inout::sample(); /*49:inout*/ | |
| 22140 | 22191 | } |
| 22141 | 22192 | |
| 22142 | 22193 | /** |
| @@ -22184,7 +22235,7 @@ class Obj3 { | ||
| 22184 | 22235 | * @return InstanceofClass |
| 22185 | 22236 | */ |
| 22186 | 22237 | public static function sampleInstanceof(): InstanceofClass { |
| 22187 | - return InstanceofClass::sample(); /*49:instanceof*/ | |
| 22238 | + return InstanceofClass::sample(); /*50:instanceof*/ | |
| 22188 | 22239 | } |
| 22189 | 22240 | |
| 22190 | 22241 | /** |
| @@ -22232,7 +22283,7 @@ class Obj3 { | ||
| 22232 | 22283 | * @return IntClass |
| 22233 | 22284 | */ |
| 22234 | 22285 | public static function sampleInt(): IntClass { |
| 22235 | - return IntClass::sample(); /*50:int*/ | |
| 22286 | + return IntClass::sample(); /*51:int*/ | |
| 22236 | 22287 | } |
| 22237 | 22288 | |
| 22238 | 22289 | /** |
| @@ -22280,7 +22331,7 @@ class Obj3 { | ||
| 22280 | 22331 | * @return InterfaceClass |
| 22281 | 22332 | */ |
| 22282 | 22333 | public static function sampleInterface(): InterfaceClass { |
| 22283 | - return InterfaceClass::sample(); /*51:interface*/ | |
| 22334 | + return InterfaceClass::sample(); /*52:interface*/ | |
| 22284 | 22335 | } |
| 22285 | 22336 | |
| 22286 | 22337 | /** |
| @@ -22328,7 +22379,7 @@ class Obj3 { | ||
| 22328 | 22379 | * @return Internal |
| 22329 | 22380 | */ |
| 22330 | 22381 | public static function sampleInternal(): Internal { |
| 22331 | - return Internal::sample(); /*52:internal*/ | |
| 22382 | + return Internal::sample(); /*53:internal*/ | |
| 22332 | 22383 | } |
| 22333 | 22384 | |
| 22334 | 22385 | /** |
| @@ -22376,7 +22427,7 @@ class Obj3 { | ||
| 22376 | 22427 | * @return Is |
| 22377 | 22428 | */ |
| 22378 | 22429 | public static function sampleIs(): Is { |
| 22379 | - return Is::sample(); /*53:is*/ | |
| 22430 | + return Is::sample(); /*54:is*/ | |
| 22380 | 22431 | } |
| 22381 | 22432 | |
| 22382 | 22433 | /** |
| @@ -22424,7 +22475,7 @@ class Obj3 { | ||
| 22424 | 22475 | * @return ISODateTimeOffsetConverter |
| 22425 | 22476 | */ |
| 22426 | 22477 | public static function sampleISODateTimeOffsetConverter(): ISODateTimeOffsetConverter { |
| 22427 | - return ISODateTimeOffsetConverter::sample(); /*54:isoDateTimeOffsetConverter*/ | |
| 22478 | + return ISODateTimeOffsetConverter::sample(); /*55:isoDateTimeOffsetConverter*/ | |
| 22428 | 22479 | } |
| 22429 | 22480 | |
| 22430 | 22481 | /** |
| @@ -22472,7 +22523,7 @@ class Obj3 { | ||
| 22472 | 22523 | * @return IterableClass |
| 22473 | 22524 | */ |
| 22474 | 22525 | public static function sampleIterable(): IterableClass { |
| 22475 | - return IterableClass::sample(); /*55:iterable*/ | |
| 22526 | + return IterableClass::sample(); /*56:iterable*/ | |
| 22476 | 22527 | } |
| 22477 | 22528 | |
| 22478 | 22529 | /** |
| @@ -22520,7 +22571,7 @@ class Obj3 { | ||
| 22520 | 22571 | * @return Jdec |
| 22521 | 22572 | */ |
| 22522 | 22573 | public static function sampleJdec(): Jdec { |
| 22523 | - return Jdec::sample(); /*56:jdec*/ | |
| 22574 | + return Jdec::sample(); /*57:jdec*/ | |
| 22524 | 22575 | } |
| 22525 | 22576 | |
| 22526 | 22577 | /** |
| @@ -22568,7 +22619,7 @@ class Obj3 { | ||
| 22568 | 22619 | * @return Jenc |
| 22569 | 22620 | */ |
| 22570 | 22621 | public static function sampleJenc(): Jenc { |
| 22571 | - return Jenc::sample(); /*57:jenc*/ | |
| 22622 | + return Jenc::sample(); /*58:jenc*/ | |
| 22572 | 22623 | } |
| 22573 | 22624 | |
| 22574 | 22625 | /** |
| @@ -22616,7 +22667,7 @@ class Obj3 { | ||
| 22616 | 22667 | * @return Jpipe |
| 22617 | 22668 | */ |
| 22618 | 22669 | public static function sampleJpipe(): Jpipe { |
| 22619 | - return Jpipe::sample(); /*58:jpipe*/ | |
| 22670 | + return Jpipe::sample(); /*59:jpipe*/ | |
| 22620 | 22671 | } |
| 22621 | 22672 | |
| 22622 | 22673 | /** |
| @@ -22664,7 +22715,7 @@ class Obj3 { | ||
| 22664 | 22715 | * @return JSON |
| 22665 | 22716 | */ |
| 22666 | 22717 | public static function sampleJSON(): JSON { |
| 22667 | - return JSON::sample(); /*59:json*/ | |
| 22718 | + return JSON::sample(); /*60:json*/ | |
| 22668 | 22719 | } |
| 22669 | 22720 | |
| 22670 | 22721 | /** |
| @@ -22712,7 +22763,7 @@ class Obj3 { | ||
| 22712 | 22763 | * @return JSONAny |
| 22713 | 22764 | */ |
| 22714 | 22765 | public static function sampleJSONAny(): JSONAny { |
| 22715 | - return JSONAny::sample(); /*60:jsonAny*/ | |
| 22766 | + return JSONAny::sample(); /*61:jsonAny*/ | |
| 22716 | 22767 | } |
| 22717 | 22768 | |
| 22718 | 22769 | /** |
| @@ -22760,7 +22811,7 @@ class Obj3 { | ||
| 22760 | 22811 | * @return JSONCodingKey |
| 22761 | 22812 | */ |
| 22762 | 22813 | public static function sampleJSONCodingKey(): JSONCodingKey { |
| 22763 | - return JSONCodingKey::sample(); /*61:jsonCodingKey*/ | |
| 22814 | + return JSONCodingKey::sample(); /*62:jsonCodingKey*/ | |
| 22764 | 22815 | } |
| 22765 | 22816 | |
| 22766 | 22817 | /** |
| @@ -22808,7 +22859,7 @@ class Obj3 { | ||
| 22808 | 22859 | * @return JSONConverter |
| 22809 | 22860 | */ |
| 22810 | 22861 | public static function sampleJSONConverter(): JSONConverter { |
| 22811 | - return JSONConverter::sample(); /*62:jsonConverter*/ | |
| 22862 | + return JSONConverter::sample(); /*63:jsonConverter*/ | |
| 22812 | 22863 | } |
| 22813 | 22864 | |
| 22814 | 22865 | /** |
| @@ -22856,7 +22907,7 @@ class Obj3 { | ||
| 22856 | 22907 | * @return JSONDecoder |
| 22857 | 22908 | */ |
| 22858 | 22909 | public static function sampleJSONDecoder(): JSONDecoder { |
| 22859 | - return JSONDecoder::sample(); /*63:jsonDecoder*/ | |
| 22910 | + return JSONDecoder::sample(); /*64:jsonDecoder*/ | |
| 22860 | 22911 | } |
| 22861 | 22912 | |
| 22862 | 22913 | /** |
| @@ -22904,7 +22955,7 @@ class Obj3 { | ||
| 22904 | 22955 | * @return JSONEncoder |
| 22905 | 22956 | */ |
| 22906 | 22957 | public static function sampleJSONEncoder(): JSONEncoder { |
| 22907 | - return JSONEncoder::sample(); /*64:jsonEncoder*/ | |
| 22958 | + return JSONEncoder::sample(); /*65:jsonEncoder*/ | |
| 22908 | 22959 | } |
| 22909 | 22960 | |
| 22910 | 22961 | /** |
| @@ -22952,7 +23003,7 @@ class Obj3 { | ||
| 22952 | 23003 | * @return JSONExceptionClass |
| 22953 | 23004 | */ |
| 22954 | 23005 | public static function sampleJSONException(): JSONExceptionClass { |
| 22955 | - return JSONExceptionClass::sample(); /*65:jsonException*/ | |
| 23006 | + return JSONExceptionClass::sample(); /*66:jsonException*/ | |
| 22956 | 23007 | } |
| 22957 | 23008 | |
| 22958 | 23009 | /** |
| @@ -23000,7 +23051,7 @@ class Obj3 { | ||
| 23000 | 23051 | * @return JSONGenerator |
| 23001 | 23052 | */ |
| 23002 | 23053 | public static function sampleJSONGenerator(): JSONGenerator { |
| 23003 | - return JSONGenerator::sample(); /*66:jsonGenerator*/ | |
| 23054 | + return JSONGenerator::sample(); /*67:jsonGenerator*/ | |
| 23004 | 23055 | } |
| 23005 | 23056 | |
| 23006 | 23057 | /** |
| @@ -23048,7 +23099,7 @@ class Obj3 { | ||
| 23048 | 23099 | * @return JSONNode |
| 23049 | 23100 | */ |
| 23050 | 23101 | public static function sampleJSONNode(): JSONNode { |
| 23051 | - return JSONNode::sample(); /*67:jsonNode*/ | |
| 23102 | + return JSONNode::sample(); /*68:jsonNode*/ | |
| 23052 | 23103 | } |
| 23053 | 23104 | |
| 23054 | 23105 | /** |
| @@ -23096,7 +23147,7 @@ class Obj3 { | ||
| 23096 | 23147 | * @return JSONNull |
| 23097 | 23148 | */ |
| 23098 | 23149 | public static function sampleJSONNull(): JSONNull { |
| 23099 | - return JSONNull::sample(); /*68:jsonNull*/ | |
| 23150 | + return JSONNull::sample(); /*69:jsonNull*/ | |
| 23100 | 23151 | } |
| 23101 | 23152 | |
| 23102 | 23153 | /** |
| @@ -23144,7 +23195,7 @@ class Obj3 { | ||
| 23144 | 23195 | * @return JSONParser |
| 23145 | 23196 | */ |
| 23146 | 23197 | public static function sampleJSONParser(): JSONParser { |
| 23147 | - return JSONParser::sample(); /*69:jsonParser*/ | |
| 23198 | + return JSONParser::sample(); /*70:jsonParser*/ | |
| 23148 | 23199 | } |
| 23149 | 23200 | |
| 23150 | 23201 | /** |
| @@ -23192,7 +23243,7 @@ class Obj3 { | ||
| 23192 | 23243 | * @return JSONReader |
| 23193 | 23244 | */ |
| 23194 | 23245 | public static function sampleJSONReader(): JSONReader { |
| 23195 | - return JSONReader::sample(); /*70:jsonReader*/ | |
| 23246 | + return JSONReader::sample(); /*71:jsonReader*/ | |
| 23196 | 23247 | } |
| 23197 | 23248 | |
| 23198 | 23249 | /** |
| @@ -23240,7 +23291,7 @@ class Obj3 { | ||
| 23240 | 23291 | * @return JSONSerializer |
| 23241 | 23292 | */ |
| 23242 | 23293 | public static function sampleJSONSerializer(): JSONSerializer { |
| 23243 | - return JSONSerializer::sample(); /*71:jsonSerializer*/ | |
| 23294 | + return JSONSerializer::sample(); /*72:jsonSerializer*/ | |
| 23244 | 23295 | } |
| 23245 | 23296 | |
| 23246 | 23297 | /** |
| @@ -23288,7 +23339,7 @@ class Obj3 { | ||
| 23288 | 23339 | * @return JSONToken |
| 23289 | 23340 | */ |
| 23290 | 23341 | public static function sampleJSONToken(): JSONToken { |
| 23291 | - return JSONToken::sample(); /*72:jsonToken*/ | |
| 23342 | + return JSONToken::sample(); /*73:jsonToken*/ | |
| 23292 | 23343 | } |
| 23293 | 23344 | |
| 23294 | 23345 | /** |
| @@ -23336,7 +23387,7 @@ class Obj3 { | ||
| 23336 | 23387 | * @return JSONTokenType |
| 23337 | 23388 | */ |
| 23338 | 23389 | public static function sampleJSONTokenType(): JSONTokenType { |
| 23339 | - return JSONTokenType::sample(); /*73:jsonTokenType*/ | |
| 23390 | + return JSONTokenType::sample(); /*74:jsonTokenType*/ | |
| 23340 | 23391 | } |
| 23341 | 23392 | |
| 23342 | 23393 | /** |
| @@ -23384,7 +23435,7 @@ class Obj3 { | ||
| 23384 | 23435 | * @return JSONWriter |
| 23385 | 23436 | */ |
| 23386 | 23437 | public static function sampleJSONWriter(): JSONWriter { |
| 23387 | - return JSONWriter::sample(); /*74:jsonWriter*/ | |
| 23438 | + return JSONWriter::sample(); /*75:jsonWriter*/ | |
| 23388 | 23439 | } |
| 23389 | 23440 | |
| 23390 | 23441 | /** |
| @@ -23432,7 +23483,7 @@ class Obj3 { | ||
| 23432 | 23483 | * @return Lambda |
| 23433 | 23484 | */ |
| 23434 | 23485 | public static function sampleLambda(): Lambda { |
| 23435 | - return Lambda::sample(); /*75:lambda*/ | |
| 23486 | + return Lambda::sample(); /*76:lambda*/ | |
| 23436 | 23487 | } |
| 23437 | 23488 | |
| 23438 | 23489 | /** |
| @@ -23480,7 +23531,7 @@ class Obj3 { | ||
| 23480 | 23531 | * @return Lazy |
| 23481 | 23532 | */ |
| 23482 | 23533 | public static function sampleLazy(): Lazy { |
| 23483 | - return Lazy::sample(); /*76:lazy*/ | |
| 23534 | + return Lazy::sample(); /*77:lazy*/ | |
| 23484 | 23535 | } |
| 23485 | 23536 | |
| 23486 | 23537 | /** |
| @@ -23528,7 +23579,7 @@ class Obj3 { | ||
| 23528 | 23579 | * @return Left |
| 23529 | 23580 | */ |
| 23530 | 23581 | public static function sampleLeft(): Left { |
| 23531 | - return Left::sample(); /*77:left*/ | |
| 23582 | + return Left::sample(); /*78:left*/ | |
| 23532 | 23583 | } |
| 23533 | 23584 | |
| 23534 | 23585 | /** |
| @@ -23576,7 +23627,7 @@ class Obj3 { | ||
| 23576 | 23627 | * @return Let |
| 23577 | 23628 | */ |
| 23578 | 23629 | public static function sampleLet(): Let { |
| 23579 | - return Let::sample(); /*78:let*/ | |
| 23630 | + return Let::sample(); /*79:let*/ | |
| 23580 | 23631 | } |
| 23581 | 23632 | |
| 23582 | 23633 | /** |
| @@ -23624,7 +23675,7 @@ class Obj3 { | ||
| 23624 | 23675 | * @return ListClass |
| 23625 | 23676 | */ |
| 23626 | 23677 | public static function sampleList(): ListClass { |
| 23627 | - return ListClass::sample(); /*79:list*/ | |
| 23678 | + return ListClass::sample(); /*80:list*/ | |
| 23628 | 23679 | } |
| 23629 | 23680 | |
| 23630 | 23681 | /** |
| @@ -23672,7 +23723,7 @@ class Obj3 { | ||
| 23672 | 23723 | * @return LocaleClass |
| 23673 | 23724 | */ |
| 23674 | 23725 | public static function sampleLocale(): LocaleClass { |
| 23675 | - return LocaleClass::sample(); /*80:locale*/ | |
| 23726 | + return LocaleClass::sample(); /*81:locale*/ | |
| 23676 | 23727 | } |
| 23677 | 23728 | |
| 23678 | 23729 | /** |
| @@ -23720,7 +23771,7 @@ class Obj3 { | ||
| 23720 | 23771 | * @return Lock |
| 23721 | 23772 | */ |
| 23722 | 23773 | public static function sampleLock(): Lock { |
| 23723 | - return Lock::sample(); /*81:lock*/ | |
| 23774 | + return Lock::sample(); /*82:lock*/ | |
| 23724 | 23775 | } |
| 23725 | 23776 | |
| 23726 | 23777 | /** |
| @@ -23768,7 +23819,7 @@ class Obj3 { | ||
| 23768 | 23819 | * @return Long |
| 23769 | 23820 | */ |
| 23770 | 23821 | public static function sampleLong(): Long { |
| 23771 | - return Long::sample(); /*82:long*/ | |
| 23822 | + return Long::sample(); /*83:long*/ | |
| 23772 | 23823 | } |
| 23773 | 23824 | |
| 23774 | 23825 | /** |
| @@ -23816,7 +23867,7 @@ class Obj3 { | ||
| 23816 | 23867 | * @return Map |
| 23817 | 23868 | */ |
| 23818 | 23869 | public static function sampleMap(): Map { |
| 23819 | - return Map::sample(); /*83:map*/ | |
| 23870 | + return Map::sample(); /*84:map*/ | |
| 23820 | 23871 | } |
| 23821 | 23872 | |
| 23822 | 23873 | /** |
| @@ -23864,7 +23915,55 @@ class Obj3 { | ||
| 23864 | 23915 | * @return MapEntry |
| 23865 | 23916 | */ |
| 23866 | 23917 | public static function sampleMapEntry(): MapEntry { |
| 23867 | - return MapEntry::sample(); /*84:mapEntry*/ | |
| 23918 | + return MapEntry::sample(); /*85:mapEntry*/ | |
| 23919 | + } | |
| 23920 | + | |
| 23921 | + /** | |
| 23922 | + * @param stdClass $value | |
| 23923 | + * @throws Exception | |
| 23924 | + * @return MarshalJSON | |
| 23925 | + */ | |
| 23926 | + public static function fromMarshalJSON(stdClass $value): MarshalJSON { | |
| 23927 | + return MarshalJSON::from($value); /*class*/ | |
| 23928 | + } | |
| 23929 | + | |
| 23930 | + /** | |
| 23931 | + * @throws Exception | |
| 23932 | + * @return stdClass | |
| 23933 | + */ | |
| 23934 | + public function toMarshalJSON(): stdClass { | |
| 23935 | + if (Obj3::validateMarshalJSON($this->marshalJSON)) { | |
| 23936 | + return $this->marshalJSON->to(); /*class*/ | |
| 23937 | + } | |
| 23938 | + throw new Exception('never get to this Obj3::marshalJSON'); | |
| 23939 | + } | |
| 23940 | + | |
| 23941 | + /** | |
| 23942 | + * @param MarshalJSON | |
| 23943 | + * @return bool | |
| 23944 | + * @throws Exception | |
| 23945 | + */ | |
| 23946 | + public static function validateMarshalJSON(MarshalJSON $value): bool { | |
| 23947 | + $value->validate(); | |
| 23948 | + return true; | |
| 23949 | + } | |
| 23950 | + | |
| 23951 | + /** | |
| 23952 | + * @throws Exception | |
| 23953 | + * @return MarshalJSON | |
| 23954 | + */ | |
| 23955 | + public function getMarshalJSON(): MarshalJSON { | |
| 23956 | + if (Obj3::validateMarshalJSON($this->marshalJSON)) { | |
| 23957 | + return $this->marshalJSON; | |
| 23958 | + } | |
| 23959 | + throw new Exception('never get to getMarshalJSON Obj3::marshalJSON'); | |
| 23960 | + } | |
| 23961 | + | |
| 23962 | + /** | |
| 23963 | + * @return MarshalJSON | |
| 23964 | + */ | |
| 23965 | + public static function sampleMarshalJSON(): MarshalJSON { | |
| 23966 | + return MarshalJSON::sample(); /*86:marshalJSON*/ | |
| 23868 | 23967 | } |
| 23869 | 23968 | |
| 23870 | 23969 | /** |
| @@ -23912,7 +24011,7 @@ class Obj3 { | ||
| 23912 | 24011 | * @return MetadataPropertyHandling |
| 23913 | 24012 | */ |
| 23914 | 24013 | public static function sampleMetadataPropertyHandling(): MetadataPropertyHandling { |
| 23915 | - return MetadataPropertyHandling::sample(); /*85:metadataPropertyHandling*/ | |
| 24014 | + return MetadataPropertyHandling::sample(); /*87:metadataPropertyHandling*/ | |
| 23916 | 24015 | } |
| 23917 | 24016 | |
| 23918 | 24017 | /** |
| @@ -23960,7 +24059,7 @@ class Obj3 { | ||
| 23960 | 24059 | * @return Module |
| 23961 | 24060 | */ |
| 23962 | 24061 | public static function sampleModule(): Module { |
| 23963 | - return Module::sample(); /*86:module*/ | |
| 24062 | + return Module::sample(); /*88:module*/ | |
| 23964 | 24063 | } |
| 23965 | 24064 | |
| 23966 | 24065 | /** |
| @@ -24008,7 +24107,7 @@ class Obj3 { | ||
| 24008 | 24107 | * @return Mutable |
| 24009 | 24108 | */ |
| 24010 | 24109 | public static function sampleMutable(): Mutable { |
| 24011 | - return Mutable::sample(); /*87:mutable*/ | |
| 24110 | + return Mutable::sample(); /*89:mutable*/ | |
| 24012 | 24111 | } |
| 24013 | 24112 | |
| 24014 | 24113 | /** |
| @@ -24056,7 +24155,7 @@ class Obj3 { | ||
| 24056 | 24155 | * @return Mutating |
| 24057 | 24156 | */ |
| 24058 | 24157 | public static function sampleMutating(): Mutating { |
| 24059 | - return Mutating::sample(); /*88:mutating*/ | |
| 24158 | + return Mutating::sample(); /*90:mutating*/ | |
| 24060 | 24159 | } |
| 24061 | 24160 | |
| 24062 | 24161 | /** |
| @@ -24104,7 +24203,7 @@ class Obj3 { | ||
| 24104 | 24203 | * @return NamespaceClass |
| 24105 | 24204 | */ |
| 24106 | 24205 | public static function sampleNamespace(): NamespaceClass { |
| 24107 | - return NamespaceClass::sample(); /*89:namespace*/ | |
| 24206 | + return NamespaceClass::sample(); /*91:namespace*/ | |
| 24108 | 24207 | } |
| 24109 | 24208 | |
| 24110 | 24209 | /** |
| @@ -24152,7 +24251,7 @@ class Obj3 { | ||
| 24152 | 24251 | * @return Native |
| 24153 | 24252 | */ |
| 24154 | 24253 | public static function sampleNative(): Native { |
| 24155 | - return Native::sample(); /*90:native*/ | |
| 24254 | + return Native::sample(); /*92:native*/ | |
| 24156 | 24255 | } |
| 24157 | 24256 | |
| 24158 | 24257 | /** |
| @@ -24200,7 +24299,7 @@ class Obj3 { | ||
| 24200 | 24299 | * @return NewClass |
| 24201 | 24300 | */ |
| 24202 | 24301 | public static function sampleNew(): NewClass { |
| 24203 | - return NewClass::sample(); /*91:new*/ | |
| 24302 | + return NewClass::sample(); /*93:new*/ | |
| 24204 | 24303 | } |
| 24205 | 24304 | |
| 24206 | 24305 | /** |
| @@ -24248,7 +24347,7 @@ class Obj3 { | ||
| 24248 | 24347 | * @return Newtonsoft |
| 24249 | 24348 | */ |
| 24250 | 24349 | public static function sampleNewtonsoft(): Newtonsoft { |
| 24251 | - return Newtonsoft::sample(); /*92:newtonsoft*/ | |
| 24350 | + return Newtonsoft::sample(); /*94:newtonsoft*/ | |
| 24252 | 24351 | } |
| 24253 | 24352 | |
| 24254 | 24353 | /** |
| @@ -24296,7 +24395,7 @@ class Obj3 { | ||
| 24296 | 24395 | * @return Nil |
| 24297 | 24396 | */ |
| 24298 | 24397 | public static function sampleNil(): Nil { |
| 24299 | - return Nil::sample(); /*93:nil*/ | |
| 24398 | + return Nil::sample(); /*95:nil*/ | |
| 24300 | 24399 | } |
| 24301 | 24400 | |
| 24302 | 24401 | /** |
| @@ -24344,55 +24443,7 @@ class Obj3 { | ||
| 24344 | 24443 | * @return No |
| 24345 | 24444 | */ |
| 24346 | 24445 | public static function sampleNo(): No { |
| 24347 | - return No::sample(); /*94:no*/ | |
| 24348 | - } | |
| 24349 | - | |
| 24350 | - /** | |
| 24351 | - * @param stdClass $value | |
| 24352 | - * @throws Exception | |
| 24353 | - * @return Noexcept | |
| 24354 | - */ | |
| 24355 | - public static function fromNoexcept(stdClass $value): Noexcept { | |
| 24356 | - return Noexcept::from($value); /*class*/ | |
| 24357 | - } | |
| 24358 | - | |
| 24359 | - /** | |
| 24360 | - * @throws Exception | |
| 24361 | - * @return stdClass | |
| 24362 | - */ | |
| 24363 | - public function toNoexcept(): stdClass { | |
| 24364 | - if (Obj3::validateNoexcept($this->noexcept)) { | |
| 24365 | - return $this->noexcept->to(); /*class*/ | |
| 24366 | - } | |
| 24367 | - throw new Exception('never get to this Obj3::noexcept'); | |
| 24368 | - } | |
| 24369 | - | |
| 24370 | - /** | |
| 24371 | - * @param Noexcept | |
| 24372 | - * @return bool | |
| 24373 | - * @throws Exception | |
| 24374 | - */ | |
| 24375 | - public static function validateNoexcept(Noexcept $value): bool { | |
| 24376 | - $value->validate(); | |
| 24377 | - return true; | |
| 24378 | - } | |
| 24379 | - | |
| 24380 | - /** | |
| 24381 | - * @throws Exception | |
| 24382 | - * @return Noexcept | |
| 24383 | - */ | |
| 24384 | - public function getNoexcept(): Noexcept { | |
| 24385 | - if (Obj3::validateNoexcept($this->noexcept)) { | |
| 24386 | - return $this->noexcept; | |
| 24387 | - } | |
| 24388 | - throw new Exception('never get to getNoexcept Obj3::noexcept'); | |
| 24389 | - } | |
| 24390 | - | |
| 24391 | - /** | |
| 24392 | - * @return Noexcept | |
| 24393 | - */ | |
| 24394 | - public static function sampleNoexcept(): Noexcept { | |
| 24395 | - return Noexcept::sample(); /*95:noexcept*/ | |
| 24446 | + return No::sample(); /*96:no*/ | |
| 24396 | 24447 | } |
| 24397 | 24448 | |
| 24398 | 24449 | /** |
| @@ -24401,6 +24452,7 @@ class Obj3 { | ||
| 24401 | 24452 | */ |
| 24402 | 24453 | public function validate(): bool { |
| 24403 | 24454 | return Obj3::validateDummy($this->dummy) |
| 24455 | + || Obj3::validateGoto($this->goto) | |
| 24404 | 24456 | || Obj3::validateGuard($this->guard) |
| 24405 | 24457 | || Obj3::validateHasOwnProperty($this->hasOwnProperty) |
| 24406 | 24458 | || Obj3::validateHashCode($this->hashCode) |
| @@ -24454,6 +24506,7 @@ class Obj3 { | ||
| 24454 | 24506 | || Obj3::validateLong($this->long) |
| 24455 | 24507 | || Obj3::validateMap($this->map) |
| 24456 | 24508 | || Obj3::validateMapEntry($this->mapEntry) |
| 24509 | + || Obj3::validateMarshalJSON($this->marshalJSON) | |
| 24457 | 24510 | || Obj3::validateMetadataPropertyHandling($this->metadataPropertyHandling) |
| 24458 | 24511 | || Obj3::validateModule($this->module) |
| 24459 | 24512 | || Obj3::validateMutable($this->mutable) |
| @@ -24463,8 +24516,7 @@ class Obj3 { | ||
| 24463 | 24516 | || Obj3::validateNew($this->new) |
| 24464 | 24517 | || Obj3::validateNewtonsoft($this->newtonsoft) |
| 24465 | 24518 | || Obj3::validateNil($this->nil) |
| 24466 | - || Obj3::validateNo($this->no) | |
| 24467 | - || Obj3::validateNoexcept($this->noexcept); | |
| 24519 | + || Obj3::validateNo($this->no); | |
| 24468 | 24520 | } |
| 24469 | 24521 | |
| 24470 | 24522 | /** |
| @@ -24474,6 +24526,7 @@ class Obj3 { | ||
| 24474 | 24526 | public function to(): stdClass { |
| 24475 | 24527 | $out = new stdClass(); |
| 24476 | 24528 | $out->{'dummy'} = $this->toDummy(); |
| 24529 | + $out->{'goto'} = $this->toGoto(); | |
| 24477 | 24530 | $out->{'guard'} = $this->toGuard(); |
| 24478 | 24531 | $out->{'hasOwnProperty'} = $this->toHasOwnProperty(); |
| 24479 | 24532 | $out->{'hashCode'} = $this->toHashCode(); |
| @@ -24527,6 +24580,7 @@ class Obj3 { | ||
| 24527 | 24580 | $out->{'long'} = $this->toLong(); |
| 24528 | 24581 | $out->{'map'} = $this->toMap(); |
| 24529 | 24582 | $out->{'MapEntry'} = $this->toMapEntry(); |
| 24583 | + $out->{'MarshalJSON'} = $this->toMarshalJSON(); | |
| 24530 | 24584 | $out->{'metadata_property_handling'} = $this->toMetadataPropertyHandling(); |
| 24531 | 24585 | $out->{'module'} = $this->toModule(); |
| 24532 | 24586 | $out->{'mutable'} = $this->toMutable(); |
| @@ -24537,7 +24591,6 @@ class Obj3 { | ||
| 24537 | 24591 | $out->{'newtonsoft'} = $this->toNewtonsoft(); |
| 24538 | 24592 | $out->{'nil'} = $this->toNil(); |
| 24539 | 24593 | $out->{'NO'} = $this->toNo(); |
| 24540 | - $out->{'noexcept'} = $this->toNoexcept(); | |
| 24541 | 24594 | return $out; |
| 24542 | 24595 | } |
| 24543 | 24596 | |
| @@ -24550,6 +24603,9 @@ class Obj3 { | ||
| 24550 | 24603 | if (!property_exists($obj, 'dummy')) { |
| 24551 | 24604 | throw new Exception("Missing required property"); |
| 24552 | 24605 | } |
| 24606 | + if (!property_exists($obj, 'goto')) { | |
| 24607 | + throw new Exception("Missing required property"); | |
| 24608 | + } | |
| 24553 | 24609 | if (!property_exists($obj, 'guard')) { |
| 24554 | 24610 | throw new Exception("Missing required property"); |
| 24555 | 24611 | } |
| @@ -24709,6 +24765,9 @@ class Obj3 { | ||
| 24709 | 24765 | if (!property_exists($obj, 'MapEntry')) { |
| 24710 | 24766 | throw new Exception("Missing required property"); |
| 24711 | 24767 | } |
| 24768 | + if (!property_exists($obj, 'MarshalJSON')) { | |
| 24769 | + throw new Exception("Missing required property"); | |
| 24770 | + } | |
| 24712 | 24771 | if (!property_exists($obj, 'metadata_property_handling')) { |
| 24713 | 24772 | throw new Exception("Missing required property"); |
| 24714 | 24773 | } |
| @@ -24739,11 +24798,9 @@ class Obj3 { | ||
| 24739 | 24798 | if (!property_exists($obj, 'NO')) { |
| 24740 | 24799 | throw new Exception("Missing required property"); |
| 24741 | 24800 | } |
| 24742 | - if (!property_exists($obj, 'noexcept')) { | |
| 24743 | - throw new Exception("Missing required property"); | |
| 24744 | - } | |
| 24745 | 24801 | return new Obj3( |
| 24746 | 24802 | Obj3::fromDummy($obj->{'dummy'}) |
| 24803 | + ,Obj3::fromGoto($obj->{'goto'}) | |
| 24747 | 24804 | ,Obj3::fromGuard($obj->{'guard'}) |
| 24748 | 24805 | ,Obj3::fromHasOwnProperty($obj->{'hasOwnProperty'}) |
| 24749 | 24806 | ,Obj3::fromHashCode($obj->{'hashCode'}) |
| @@ -24797,6 +24854,7 @@ class Obj3 { | ||
| 24797 | 24854 | ,Obj3::fromLong($obj->{'long'}) |
| 24798 | 24855 | ,Obj3::fromMap($obj->{'map'}) |
| 24799 | 24856 | ,Obj3::fromMapEntry($obj->{'MapEntry'}) |
| 24857 | + ,Obj3::fromMarshalJSON($obj->{'MarshalJSON'}) | |
| 24800 | 24858 | ,Obj3::fromMetadataPropertyHandling($obj->{'metadata_property_handling'}) |
| 24801 | 24859 | ,Obj3::fromModule($obj->{'module'}) |
| 24802 | 24860 | ,Obj3::fromMutable($obj->{'mutable'}) |
| @@ -24807,7 +24865,6 @@ class Obj3 { | ||
| 24807 | 24865 | ,Obj3::fromNewtonsoft($obj->{'newtonsoft'}) |
| 24808 | 24866 | ,Obj3::fromNil($obj->{'nil'}) |
| 24809 | 24867 | ,Obj3::fromNo($obj->{'NO'}) |
| 24810 | - ,Obj3::fromNoexcept($obj->{'noexcept'}) | |
| 24811 | 24868 | ); |
| 24812 | 24869 | } |
| 24813 | 24870 | |
| @@ -24817,6 +24874,7 @@ class Obj3 { | ||
| 24817 | 24874 | public static function sample(): Obj3 { |
| 24818 | 24875 | return new Obj3( |
| 24819 | 24876 | Obj3::sampleDummy() |
| 24877 | + ,Obj3::sampleGoto() | |
| 24820 | 24878 | ,Obj3::sampleGuard() |
| 24821 | 24879 | ,Obj3::sampleHasOwnProperty() |
| 24822 | 24880 | ,Obj3::sampleHashCode() |
| @@ -24870,6 +24928,7 @@ class Obj3 { | ||
| 24870 | 24928 | ,Obj3::sampleLong() |
| 24871 | 24929 | ,Obj3::sampleMap() |
| 24872 | 24930 | ,Obj3::sampleMapEntry() |
| 24931 | + ,Obj3::sampleMarshalJSON() | |
| 24873 | 24932 | ,Obj3::sampleMetadataPropertyHandling() |
| 24874 | 24933 | ,Obj3::sampleModule() |
| 24875 | 24934 | ,Obj3::sampleMutable() |
| @@ -24880,7 +24939,107 @@ class Obj3 { | ||
| 24880 | 24939 | ,Obj3::sampleNewtonsoft() |
| 24881 | 24940 | ,Obj3::sampleNil() |
| 24882 | 24941 | ,Obj3::sampleNo() |
| 24883 | - ,Obj3::sampleNoexcept() | |
| 24942 | + ); | |
| 24943 | + } | |
| 24944 | +} | |
| 24945 | + | |
| 24946 | +// This is an autogenerated file:GotoClass | |
| 24947 | + | |
| 24948 | +class GotoClass { | |
| 24949 | + private int $goto; // json:goto Required | |
| 24950 | + | |
| 24951 | + /** | |
| 24952 | + * @param int $goto | |
| 24953 | + */ | |
| 24954 | + public function __construct(int $goto) { | |
| 24955 | + $this->goto = $goto; | |
| 24956 | + } | |
| 24957 | + | |
| 24958 | + /** | |
| 24959 | + * @param int $value | |
| 24960 | + * @throws Exception | |
| 24961 | + * @return int | |
| 24962 | + */ | |
| 24963 | + public static function fromGoto(int $value): int { | |
| 24964 | + return $value; /*int*/ | |
| 24965 | + } | |
| 24966 | + | |
| 24967 | + /** | |
| 24968 | + * @throws Exception | |
| 24969 | + * @return int | |
| 24970 | + */ | |
| 24971 | + public function toGoto(): int { | |
| 24972 | + if (GotoClass::validateGoto($this->goto)) { | |
| 24973 | + return $this->goto; /*int*/ | |
| 24974 | + } | |
| 24975 | + throw new Exception('never get to this GotoClass::goto'); | |
| 24976 | + } | |
| 24977 | + | |
| 24978 | + /** | |
| 24979 | + * @param int | |
| 24980 | + * @return bool | |
| 24981 | + * @throws Exception | |
| 24982 | + */ | |
| 24983 | + public static function validateGoto(int $value): bool { | |
| 24984 | + return true; | |
| 24985 | + } | |
| 24986 | + | |
| 24987 | + /** | |
| 24988 | + * @throws Exception | |
| 24989 | + * @return int | |
| 24990 | + */ | |
| 24991 | + public function getGoto(): int { | |
| 24992 | + if (GotoClass::validateGoto($this->goto)) { | |
| 24993 | + return $this->goto; | |
| 24994 | + } | |
| 24995 | + throw new Exception('never get to getGoto GotoClass::goto'); | |
| 24996 | + } | |
| 24997 | + | |
| 24998 | + /** | |
| 24999 | + * @return int | |
| 25000 | + */ | |
| 25001 | + public static function sampleGoto(): int { | |
| 25002 | + return 31; /*31:goto*/ | |
| 25003 | + } | |
| 25004 | + | |
| 25005 | + /** | |
| 25006 | + * @throws Exception | |
| 25007 | + * @return bool | |
| 25008 | + */ | |
| 25009 | + public function validate(): bool { | |
| 25010 | + return GotoClass::validateGoto($this->goto); | |
| 25011 | + } | |
| 25012 | + | |
| 25013 | + /** | |
| 25014 | + * @return stdClass | |
| 25015 | + * @throws Exception | |
| 25016 | + */ | |
| 25017 | + public function to(): stdClass { | |
| 25018 | + $out = new stdClass(); | |
| 25019 | + $out->{'goto'} = $this->toGoto(); | |
| 25020 | + return $out; | |
| 25021 | + } | |
| 25022 | + | |
| 25023 | + /** | |
| 25024 | + * @param stdClass $obj | |
| 25025 | + * @return GotoClass | |
| 25026 | + * @throws Exception | |
| 25027 | + */ | |
| 25028 | + public static function from(stdClass $obj): GotoClass { | |
| 25029 | + if (!property_exists($obj, 'goto')) { | |
| 25030 | + throw new Exception("Missing required property"); | |
| 25031 | + } | |
| 25032 | + return new GotoClass( | |
| 25033 | + GotoClass::fromGoto($obj->{'goto'}) | |
| 25034 | + ); | |
| 25035 | + } | |
| 25036 | + | |
| 25037 | + /** | |
| 25038 | + * @return GotoClass | |
| 25039 | + */ | |
| 25040 | + public static function sample(): GotoClass { | |
| 25041 | + return new GotoClass( | |
| 25042 | + GotoClass::sampleGoto() | |
| 24884 | 25043 | ); |
| 24885 | 25044 | } |
| 24886 | 25045 | } |
| @@ -30241,6 +30400,107 @@ class MapEntry { | ||
| 30241 | 30400 | } |
| 30242 | 30401 | } |
| 30243 | 30402 | |
| 30403 | +// This is an autogenerated file:MarshalJSON | |
| 30404 | + | |
| 30405 | +class MarshalJSON { | |
| 30406 | + private int $marshalJSON; // json:MarshalJSON Required | |
| 30407 | + | |
| 30408 | + /** | |
| 30409 | + * @param int $marshalJSON | |
| 30410 | + */ | |
| 30411 | + public function __construct(int $marshalJSON) { | |
| 30412 | + $this->marshalJSON = $marshalJSON; | |
| 30413 | + } | |
| 30414 | + | |
| 30415 | + /** | |
| 30416 | + * @param int $value | |
| 30417 | + * @throws Exception | |
| 30418 | + * @return int | |
| 30419 | + */ | |
| 30420 | + public static function fromMarshalJSON(int $value): int { | |
| 30421 | + return $value; /*int*/ | |
| 30422 | + } | |
| 30423 | + | |
| 30424 | + /** | |
| 30425 | + * @throws Exception | |
| 30426 | + * @return int | |
| 30427 | + */ | |
| 30428 | + public function toMarshalJSON(): int { | |
| 30429 | + if (MarshalJSON::validateMarshalJSON($this->marshalJSON)) { | |
| 30430 | + return $this->marshalJSON; /*int*/ | |
| 30431 | + } | |
| 30432 | + throw new Exception('never get to this MarshalJSON::marshalJSON'); | |
| 30433 | + } | |
| 30434 | + | |
| 30435 | + /** | |
| 30436 | + * @param int | |
| 30437 | + * @return bool | |
| 30438 | + * @throws Exception | |
| 30439 | + */ | |
| 30440 | + public static function validateMarshalJSON(int $value): bool { | |
| 30441 | + return true; | |
| 30442 | + } | |
| 30443 | + | |
| 30444 | + /** | |
| 30445 | + * @throws Exception | |
| 30446 | + * @return int | |
| 30447 | + */ | |
| 30448 | + public function getMarshalJSON(): int { | |
| 30449 | + if (MarshalJSON::validateMarshalJSON($this->marshalJSON)) { | |
| 30450 | + return $this->marshalJSON; | |
| 30451 | + } | |
| 30452 | + throw new Exception('never get to getMarshalJSON MarshalJSON::marshalJSON'); | |
| 30453 | + } | |
| 30454 | + | |
| 30455 | + /** | |
| 30456 | + * @return int | |
| 30457 | + */ | |
| 30458 | + public static function sampleMarshalJSON(): int { | |
| 30459 | + return 31; /*31:marshalJSON*/ | |
| 30460 | + } | |
| 30461 | + | |
| 30462 | + /** | |
| 30463 | + * @throws Exception | |
| 30464 | + * @return bool | |
| 30465 | + */ | |
| 30466 | + public function validate(): bool { | |
| 30467 | + return MarshalJSON::validateMarshalJSON($this->marshalJSON); | |
| 30468 | + } | |
| 30469 | + | |
| 30470 | + /** | |
| 30471 | + * @return stdClass | |
| 30472 | + * @throws Exception | |
| 30473 | + */ | |
| 30474 | + public function to(): stdClass { | |
| 30475 | + $out = new stdClass(); | |
| 30476 | + $out->{'MarshalJSON'} = $this->toMarshalJSON(); | |
| 30477 | + return $out; | |
| 30478 | + } | |
| 30479 | + | |
| 30480 | + /** | |
| 30481 | + * @param stdClass $obj | |
| 30482 | + * @return MarshalJSON | |
| 30483 | + * @throws Exception | |
| 30484 | + */ | |
| 30485 | + public static function from(stdClass $obj): MarshalJSON { | |
| 30486 | + if (!property_exists($obj, 'MarshalJSON')) { | |
| 30487 | + throw new Exception("Missing required property"); | |
| 30488 | + } | |
| 30489 | + return new MarshalJSON( | |
| 30490 | + MarshalJSON::fromMarshalJSON($obj->{'MarshalJSON'}) | |
| 30491 | + ); | |
| 30492 | + } | |
| 30493 | + | |
| 30494 | + /** | |
| 30495 | + * @return MarshalJSON | |
| 30496 | + */ | |
| 30497 | + public static function sample(): MarshalJSON { | |
| 30498 | + return new MarshalJSON( | |
| 30499 | + MarshalJSON::sampleMarshalJSON() | |
| 30500 | + ); | |
| 30501 | + } | |
| 30502 | +} | |
| 30503 | + | |
| 30244 | 30504 | // This is an autogenerated file:MetadataPropertyHandling |
| 30245 | 30505 | |
| 30246 | 30506 | class MetadataPropertyHandling { |
| @@ -31251,112 +31511,12 @@ class No { | ||
| 31251 | 31511 | } |
| 31252 | 31512 | } |
| 31253 | 31513 | |
| 31254 | -// This is an autogenerated file:Noexcept | |
| 31255 | - | |
| 31256 | -class Noexcept { | |
| 31257 | - private int $noexcept; // json:noexcept Required | |
| 31258 | - | |
| 31259 | - /** | |
| 31260 | - * @param int $noexcept | |
| 31261 | - */ | |
| 31262 | - public function __construct(int $noexcept) { | |
| 31263 | - $this->noexcept = $noexcept; | |
| 31264 | - } | |
| 31265 | - | |
| 31266 | - /** | |
| 31267 | - * @param int $value | |
| 31268 | - * @throws Exception | |
| 31269 | - * @return int | |
| 31270 | - */ | |
| 31271 | - public static function fromNoexcept(int $value): int { | |
| 31272 | - return $value; /*int*/ | |
| 31273 | - } | |
| 31274 | - | |
| 31275 | - /** | |
| 31276 | - * @throws Exception | |
| 31277 | - * @return int | |
| 31278 | - */ | |
| 31279 | - public function toNoexcept(): int { | |
| 31280 | - if (Noexcept::validateNoexcept($this->noexcept)) { | |
| 31281 | - return $this->noexcept; /*int*/ | |
| 31282 | - } | |
| 31283 | - throw new Exception('never get to this Noexcept::noexcept'); | |
| 31284 | - } | |
| 31285 | - | |
| 31286 | - /** | |
| 31287 | - * @param int | |
| 31288 | - * @return bool | |
| 31289 | - * @throws Exception | |
| 31290 | - */ | |
| 31291 | - public static function validateNoexcept(int $value): bool { | |
| 31292 | - return true; | |
| 31293 | - } | |
| 31294 | - | |
| 31295 | - /** | |
| 31296 | - * @throws Exception | |
| 31297 | - * @return int | |
| 31298 | - */ | |
| 31299 | - public function getNoexcept(): int { | |
| 31300 | - if (Noexcept::validateNoexcept($this->noexcept)) { | |
| 31301 | - return $this->noexcept; | |
| 31302 | - } | |
| 31303 | - throw new Exception('never get to getNoexcept Noexcept::noexcept'); | |
| 31304 | - } | |
| 31305 | - | |
| 31306 | - /** | |
| 31307 | - * @return int | |
| 31308 | - */ | |
| 31309 | - public static function sampleNoexcept(): int { | |
| 31310 | - return 31; /*31:noexcept*/ | |
| 31311 | - } | |
| 31312 | - | |
| 31313 | - /** | |
| 31314 | - * @throws Exception | |
| 31315 | - * @return bool | |
| 31316 | - */ | |
| 31317 | - public function validate(): bool { | |
| 31318 | - return Noexcept::validateNoexcept($this->noexcept); | |
| 31319 | - } | |
| 31320 | - | |
| 31321 | - /** | |
| 31322 | - * @return stdClass | |
| 31323 | - * @throws Exception | |
| 31324 | - */ | |
| 31325 | - public function to(): stdClass { | |
| 31326 | - $out = new stdClass(); | |
| 31327 | - $out->{'noexcept'} = $this->toNoexcept(); | |
| 31328 | - return $out; | |
| 31329 | - } | |
| 31330 | - | |
| 31331 | - /** | |
| 31332 | - * @param stdClass $obj | |
| 31333 | - * @return Noexcept | |
| 31334 | - * @throws Exception | |
| 31335 | - */ | |
| 31336 | - public static function from(stdClass $obj): Noexcept { | |
| 31337 | - if (!property_exists($obj, 'noexcept')) { | |
| 31338 | - throw new Exception("Missing required property"); | |
| 31339 | - } | |
| 31340 | - return new Noexcept( | |
| 31341 | - Noexcept::fromNoexcept($obj->{'noexcept'}) | |
| 31342 | - ); | |
| 31343 | - } | |
| 31344 | - | |
| 31345 | - /** | |
| 31346 | - * @return Noexcept | |
| 31347 | - */ | |
| 31348 | - public static function sample(): Noexcept { | |
| 31349 | - return new Noexcept( | |
| 31350 | - Noexcept::sampleNoexcept() | |
| 31351 | - ); | |
| 31352 | - } | |
| 31353 | -} | |
| 31354 | - | |
| 31355 | 31514 | // This is an autogenerated file:Obj4 |
| 31356 | 31515 | |
| 31357 | 31516 | class Obj4 { |
| 31358 | 31517 | private int $dummy; // json:dummy Required |
| 31359 | 31518 | private NoSuchMethod $noSuchMethod; // json:noSuchMethod Required |
| 31519 | + private Noexcept $noexcept; // json:noexcept Required | |
| 31360 | 31520 | private Nonatomic $nonatomic; // json:nonatomic Required |
| 31361 | 31521 | private None $none; // json:None Required |
| 31362 | 31522 | private Nonlocal $nonlocal; // json:nonlocal Required |
| @@ -31419,11 +31579,11 @@ class Obj4 { | ||
| 31419 | 31579 | private Sbyte $sbyte; // json:sbyte Required |
| 31420 | 31580 | private Sealed $sealed; // json:sealed Required |
| 31421 | 31581 | private Sel $sel; // json:SEL Required |
| 31422 | - private Select $select; // json:select Required | |
| 31423 | 31582 | |
| 31424 | 31583 | /** |
| 31425 | 31584 | * @param int $dummy |
| 31426 | 31585 | * @param NoSuchMethod $noSuchMethod |
| 31586 | + * @param Noexcept $noexcept | |
| 31427 | 31587 | * @param Nonatomic $nonatomic |
| 31428 | 31588 | * @param None $none |
| 31429 | 31589 | * @param Nonlocal $nonlocal |
| @@ -31486,11 +31646,11 @@ class Obj4 { | ||
| 31486 | 31646 | * @param Sbyte $sbyte |
| 31487 | 31647 | * @param Sealed $sealed |
| 31488 | 31648 | * @param Sel $sel |
| 31489 | - * @param Select $select | |
| 31490 | 31649 | */ |
| 31491 | - public function __construct(int $dummy, NoSuchMethod $noSuchMethod, Nonatomic $nonatomic, None $none, Nonlocal $nonlocal, Nonmutating $nonmutating, Not $not, NotEq $notEq, NSError $nsError, NSObject $nsObject, NSString $nsString, NULLClass $null, Nullptr $nullptr, Number $number, NoneClass $obj4None, Obj4Null $obj4Null, ProtocolClass $obj4Protocol, ObjectClass $object, ObjectMapper $objectMapper, Of $of, Oneway $oneway, Open $open, Operator $operator, Optional $optional, OrClass $or, OrEq $orEq, Out $out, OverrideClass $override, Package $package, Params $params, Pass $pass, Port $port, Postfix $postfix, Precedence $precedence, Prefix $prefix, PrintClass $print, PrintMembers $printMembers, Printf $printf, PrivateClass $private, ProtectedClass $protected, Protocol $protocol, PublicClass $public, Quicktype $quicktype, Raise $raise, Range $range, ReadonlyClass $readonly, Ref $ref, RegExp $regExp, Register $register, ReinterpretCast $reinterpretCast, Repeat $repeat, RequireClass $require, Required $required, Requires $requires, Restrict $restrict, Retain $retain, Rethrows $rethrows, ReturnClass $return, Right $right, RuntimeType $runtimeType, S $s, Sbyte $sbyte, Sealed $sealed, Sel $sel, Select $select) { | |
| 31650 | + public function __construct(int $dummy, NoSuchMethod $noSuchMethod, Noexcept $noexcept, Nonatomic $nonatomic, None $none, Nonlocal $nonlocal, Nonmutating $nonmutating, Not $not, NotEq $notEq, NSError $nsError, NSObject $nsObject, NSString $nsString, NULLClass $null, Nullptr $nullptr, Number $number, NoneClass $obj4None, Obj4Null $obj4Null, ProtocolClass $obj4Protocol, ObjectClass $object, ObjectMapper $objectMapper, Of $of, Oneway $oneway, Open $open, Operator $operator, Optional $optional, OrClass $or, OrEq $orEq, Out $out, OverrideClass $override, Package $package, Params $params, Pass $pass, Port $port, Postfix $postfix, Precedence $precedence, Prefix $prefix, PrintClass $print, PrintMembers $printMembers, Printf $printf, PrivateClass $private, ProtectedClass $protected, Protocol $protocol, PublicClass $public, Quicktype $quicktype, Raise $raise, Range $range, ReadonlyClass $readonly, Ref $ref, RegExp $regExp, Register $register, ReinterpretCast $reinterpretCast, Repeat $repeat, RequireClass $require, Required $required, Requires $requires, Restrict $restrict, Retain $retain, Rethrows $rethrows, ReturnClass $return, Right $right, RuntimeType $runtimeType, S $s, Sbyte $sbyte, Sealed $sealed, Sel $sel) { | |
| 31492 | 31651 | $this->dummy = $dummy; |
| 31493 | 31652 | $this->noSuchMethod = $noSuchMethod; |
| 31653 | + $this->noexcept = $noexcept; | |
| 31494 | 31654 | $this->nonatomic = $nonatomic; |
| 31495 | 31655 | $this->none = $none; |
| 31496 | 31656 | $this->nonlocal = $nonlocal; |
| @@ -31553,7 +31713,6 @@ class Obj4 { | ||
| 31553 | 31713 | $this->sbyte = $sbyte; |
| 31554 | 31714 | $this->sealed = $sealed; |
| 31555 | 31715 | $this->sel = $sel; |
| 31556 | - $this->select = $select; | |
| 31557 | 31716 | } |
| 31558 | 31717 | |
| 31559 | 31718 | /** |
| @@ -31651,6 +31810,54 @@ class Obj4 { | ||
| 31651 | 31810 | return NoSuchMethod::sample(); /*32:noSuchMethod*/ |
| 31652 | 31811 | } |
| 31653 | 31812 | |
| 31813 | + /** | |
| 31814 | + * @param stdClass $value | |
| 31815 | + * @throws Exception | |
| 31816 | + * @return Noexcept | |
| 31817 | + */ | |
| 31818 | + public static function fromNoexcept(stdClass $value): Noexcept { | |
| 31819 | + return Noexcept::from($value); /*class*/ | |
| 31820 | + } | |
| 31821 | + | |
| 31822 | + /** | |
| 31823 | + * @throws Exception | |
| 31824 | + * @return stdClass | |
| 31825 | + */ | |
| 31826 | + public function toNoexcept(): stdClass { | |
| 31827 | + if (Obj4::validateNoexcept($this->noexcept)) { | |
| 31828 | + return $this->noexcept->to(); /*class*/ | |
| 31829 | + } | |
| 31830 | + throw new Exception('never get to this Obj4::noexcept'); | |
| 31831 | + } | |
| 31832 | + | |
| 31833 | + /** | |
| 31834 | + * @param Noexcept | |
| 31835 | + * @return bool | |
| 31836 | + * @throws Exception | |
| 31837 | + */ | |
| 31838 | + public static function validateNoexcept(Noexcept $value): bool { | |
| 31839 | + $value->validate(); | |
| 31840 | + return true; | |
| 31841 | + } | |
| 31842 | + | |
| 31843 | + /** | |
| 31844 | + * @throws Exception | |
| 31845 | + * @return Noexcept | |
| 31846 | + */ | |
| 31847 | + public function getNoexcept(): Noexcept { | |
| 31848 | + if (Obj4::validateNoexcept($this->noexcept)) { | |
| 31849 | + return $this->noexcept; | |
| 31850 | + } | |
| 31851 | + throw new Exception('never get to getNoexcept Obj4::noexcept'); | |
| 31852 | + } | |
| 31853 | + | |
| 31854 | + /** | |
| 31855 | + * @return Noexcept | |
| 31856 | + */ | |
| 31857 | + public static function sampleNoexcept(): Noexcept { | |
| 31858 | + return Noexcept::sample(); /*33:noexcept*/ | |
| 31859 | + } | |
| 31860 | + | |
| 31654 | 31861 | /** |
| 31655 | 31862 | * @param stdClass $value |
| 31656 | 31863 | * @throws Exception |
| @@ -31696,7 +31903,7 @@ class Obj4 { | ||
| 31696 | 31903 | * @return Nonatomic |
| 31697 | 31904 | */ |
| 31698 | 31905 | public static function sampleNonatomic(): Nonatomic { |
| 31699 | - return Nonatomic::sample(); /*33:nonatomic*/ | |
| 31906 | + return Nonatomic::sample(); /*34:nonatomic*/ | |
| 31700 | 31907 | } |
| 31701 | 31908 | |
| 31702 | 31909 | /** |
| @@ -31744,7 +31951,7 @@ class Obj4 { | ||
| 31744 | 31951 | * @return None |
| 31745 | 31952 | */ |
| 31746 | 31953 | public static function sampleNone(): None { |
| 31747 | - return None::sample(); /*34:none*/ | |
| 31954 | + return None::sample(); /*35:none*/ | |
| 31748 | 31955 | } |
| 31749 | 31956 | |
| 31750 | 31957 | /** |
| @@ -31792,7 +31999,7 @@ class Obj4 { | ||
| 31792 | 31999 | * @return Nonlocal |
| 31793 | 32000 | */ |
| 31794 | 32001 | public static function sampleNonlocal(): Nonlocal { |
| 31795 | - return Nonlocal::sample(); /*35:nonlocal*/ | |
| 32002 | + return Nonlocal::sample(); /*36:nonlocal*/ | |
| 31796 | 32003 | } |
| 31797 | 32004 | |
| 31798 | 32005 | /** |
| @@ -31840,7 +32047,7 @@ class Obj4 { | ||
| 31840 | 32047 | * @return Nonmutating |
| 31841 | 32048 | */ |
| 31842 | 32049 | public static function sampleNonmutating(): Nonmutating { |
| 31843 | - return Nonmutating::sample(); /*36:nonmutating*/ | |
| 32050 | + return Nonmutating::sample(); /*37:nonmutating*/ | |
| 31844 | 32051 | } |
| 31845 | 32052 | |
| 31846 | 32053 | /** |
| @@ -31888,7 +32095,7 @@ class Obj4 { | ||
| 31888 | 32095 | * @return Not |
| 31889 | 32096 | */ |
| 31890 | 32097 | public static function sampleNot(): Not { |
| 31891 | - return Not::sample(); /*37:not*/ | |
| 32098 | + return Not::sample(); /*38:not*/ | |
| 31892 | 32099 | } |
| 31893 | 32100 | |
| 31894 | 32101 | /** |
| @@ -31936,7 +32143,7 @@ class Obj4 { | ||
| 31936 | 32143 | * @return NotEq |
| 31937 | 32144 | */ |
| 31938 | 32145 | public static function sampleNotEq(): NotEq { |
| 31939 | - return NotEq::sample(); /*38:notEq*/ | |
| 32146 | + return NotEq::sample(); /*39:notEq*/ | |
| 31940 | 32147 | } |
| 31941 | 32148 | |
| 31942 | 32149 | /** |
| @@ -31984,7 +32191,7 @@ class Obj4 { | ||
| 31984 | 32191 | * @return NSError |
| 31985 | 32192 | */ |
| 31986 | 32193 | public static function sampleNSError(): NSError { |
| 31987 | - return NSError::sample(); /*39:nsError*/ | |
| 32194 | + return NSError::sample(); /*40:nsError*/ | |
| 31988 | 32195 | } |
| 31989 | 32196 | |
| 31990 | 32197 | /** |
| @@ -32032,7 +32239,7 @@ class Obj4 { | ||
| 32032 | 32239 | * @return NSObject |
| 32033 | 32240 | */ |
| 32034 | 32241 | public static function sampleNSObject(): NSObject { |
| 32035 | - return NSObject::sample(); /*40:nsObject*/ | |
| 32242 | + return NSObject::sample(); /*41:nsObject*/ | |
| 32036 | 32243 | } |
| 32037 | 32244 | |
| 32038 | 32245 | /** |
| @@ -32080,7 +32287,7 @@ class Obj4 { | ||
| 32080 | 32287 | * @return NSString |
| 32081 | 32288 | */ |
| 32082 | 32289 | public static function sampleNSString(): NSString { |
| 32083 | - return NSString::sample(); /*41:nsString*/ | |
| 32290 | + return NSString::sample(); /*42:nsString*/ | |
| 32084 | 32291 | } |
| 32085 | 32292 | |
| 32086 | 32293 | /** |
| @@ -32128,7 +32335,7 @@ class Obj4 { | ||
| 32128 | 32335 | * @return NULLClass |
| 32129 | 32336 | */ |
| 32130 | 32337 | public static function sampleNull(): NULLClass { |
| 32131 | - return NULLClass::sample(); /*42:null*/ | |
| 32338 | + return NULLClass::sample(); /*43:null*/ | |
| 32132 | 32339 | } |
| 32133 | 32340 | |
| 32134 | 32341 | /** |
| @@ -32176,7 +32383,7 @@ class Obj4 { | ||
| 32176 | 32383 | * @return Nullptr |
| 32177 | 32384 | */ |
| 32178 | 32385 | public static function sampleNullptr(): Nullptr { |
| 32179 | - return Nullptr::sample(); /*43:nullptr*/ | |
| 32386 | + return Nullptr::sample(); /*44:nullptr*/ | |
| 32180 | 32387 | } |
| 32181 | 32388 | |
| 32182 | 32389 | /** |
| @@ -32224,7 +32431,7 @@ class Obj4 { | ||
| 32224 | 32431 | * @return Number |
| 32225 | 32432 | */ |
| 32226 | 32433 | public static function sampleNumber(): Number { |
| 32227 | - return Number::sample(); /*44:number*/ | |
| 32434 | + return Number::sample(); /*45:number*/ | |
| 32228 | 32435 | } |
| 32229 | 32436 | |
| 32230 | 32437 | /** |
| @@ -32272,7 +32479,7 @@ class Obj4 { | ||
| 32272 | 32479 | * @return NoneClass |
| 32273 | 32480 | */ |
| 32274 | 32481 | public static function sampleObj4None(): NoneClass { |
| 32275 | - return NoneClass::sample(); /*45:obj4None*/ | |
| 32482 | + return NoneClass::sample(); /*46:obj4None*/ | |
| 32276 | 32483 | } |
| 32277 | 32484 | |
| 32278 | 32485 | /** |
| @@ -32320,7 +32527,7 @@ class Obj4 { | ||
| 32320 | 32527 | * @return Obj4Null |
| 32321 | 32528 | */ |
| 32322 | 32529 | public static function sampleObj4Null(): Obj4Null { |
| 32323 | - return Obj4Null::sample(); /*46:obj4Null*/ | |
| 32530 | + return Obj4Null::sample(); /*47:obj4Null*/ | |
| 32324 | 32531 | } |
| 32325 | 32532 | |
| 32326 | 32533 | /** |
| @@ -32368,7 +32575,7 @@ class Obj4 { | ||
| 32368 | 32575 | * @return ProtocolClass |
| 32369 | 32576 | */ |
| 32370 | 32577 | public static function sampleObj4Protocol(): ProtocolClass { |
| 32371 | - return ProtocolClass::sample(); /*47:obj4Protocol*/ | |
| 32578 | + return ProtocolClass::sample(); /*48:obj4Protocol*/ | |
| 32372 | 32579 | } |
| 32373 | 32580 | |
| 32374 | 32581 | /** |
| @@ -32416,7 +32623,7 @@ class Obj4 { | ||
| 32416 | 32623 | * @return ObjectClass |
| 32417 | 32624 | */ |
| 32418 | 32625 | public static function sampleObject(): ObjectClass { |
| 32419 | - return ObjectClass::sample(); /*48:object*/ | |
| 32626 | + return ObjectClass::sample(); /*49:object*/ | |
| 32420 | 32627 | } |
| 32421 | 32628 | |
| 32422 | 32629 | /** |
| @@ -32464,7 +32671,7 @@ class Obj4 { | ||
| 32464 | 32671 | * @return ObjectMapper |
| 32465 | 32672 | */ |
| 32466 | 32673 | public static function sampleObjectMapper(): ObjectMapper { |
| 32467 | - return ObjectMapper::sample(); /*49:objectMapper*/ | |
| 32674 | + return ObjectMapper::sample(); /*50:objectMapper*/ | |
| 32468 | 32675 | } |
| 32469 | 32676 | |
| 32470 | 32677 | /** |
| @@ -32512,7 +32719,7 @@ class Obj4 { | ||
| 32512 | 32719 | * @return Of |
| 32513 | 32720 | */ |
| 32514 | 32721 | public static function sampleOf(): Of { |
| 32515 | - return Of::sample(); /*50:of*/ | |
| 32722 | + return Of::sample(); /*51:of*/ | |
| 32516 | 32723 | } |
| 32517 | 32724 | |
| 32518 | 32725 | /** |
| @@ -32560,7 +32767,7 @@ class Obj4 { | ||
| 32560 | 32767 | * @return Oneway |
| 32561 | 32768 | */ |
| 32562 | 32769 | public static function sampleOneway(): Oneway { |
| 32563 | - return Oneway::sample(); /*51:oneway*/ | |
| 32770 | + return Oneway::sample(); /*52:oneway*/ | |
| 32564 | 32771 | } |
| 32565 | 32772 | |
| 32566 | 32773 | /** |
| @@ -32608,7 +32815,7 @@ class Obj4 { | ||
| 32608 | 32815 | * @return Open |
| 32609 | 32816 | */ |
| 32610 | 32817 | public static function sampleOpen(): Open { |
| 32611 | - return Open::sample(); /*52:open*/ | |
| 32818 | + return Open::sample(); /*53:open*/ | |
| 32612 | 32819 | } |
| 32613 | 32820 | |
| 32614 | 32821 | /** |
| @@ -32656,7 +32863,7 @@ class Obj4 { | ||
| 32656 | 32863 | * @return Operator |
| 32657 | 32864 | */ |
| 32658 | 32865 | public static function sampleOperator(): Operator { |
| 32659 | - return Operator::sample(); /*53:operator*/ | |
| 32866 | + return Operator::sample(); /*54:operator*/ | |
| 32660 | 32867 | } |
| 32661 | 32868 | |
| 32662 | 32869 | /** |
| @@ -32704,7 +32911,7 @@ class Obj4 { | ||
| 32704 | 32911 | * @return Optional |
| 32705 | 32912 | */ |
| 32706 | 32913 | public static function sampleOptional(): Optional { |
| 32707 | - return Optional::sample(); /*54:optional*/ | |
| 32914 | + return Optional::sample(); /*55:optional*/ | |
| 32708 | 32915 | } |
| 32709 | 32916 | |
| 32710 | 32917 | /** |
| @@ -32752,7 +32959,7 @@ class Obj4 { | ||
| 32752 | 32959 | * @return OrClass |
| 32753 | 32960 | */ |
| 32754 | 32961 | public static function sampleOr(): OrClass { |
| 32755 | - return OrClass::sample(); /*55:or*/ | |
| 32962 | + return OrClass::sample(); /*56:or*/ | |
| 32756 | 32963 | } |
| 32757 | 32964 | |
| 32758 | 32965 | /** |
| @@ -32800,7 +33007,7 @@ class Obj4 { | ||
| 32800 | 33007 | * @return OrEq |
| 32801 | 33008 | */ |
| 32802 | 33009 | public static function sampleOrEq(): OrEq { |
| 32803 | - return OrEq::sample(); /*56:orEq*/ | |
| 33010 | + return OrEq::sample(); /*57:orEq*/ | |
| 32804 | 33011 | } |
| 32805 | 33012 | |
| 32806 | 33013 | /** |
| @@ -32848,7 +33055,7 @@ class Obj4 { | ||
| 32848 | 33055 | * @return Out |
| 32849 | 33056 | */ |
| 32850 | 33057 | public static function sampleOut(): Out { |
| 32851 | - return Out::sample(); /*57:out*/ | |
| 33058 | + return Out::sample(); /*58:out*/ | |
| 32852 | 33059 | } |
| 32853 | 33060 | |
| 32854 | 33061 | /** |
| @@ -32896,7 +33103,7 @@ class Obj4 { | ||
| 32896 | 33103 | * @return OverrideClass |
| 32897 | 33104 | */ |
| 32898 | 33105 | public static function sampleOverride(): OverrideClass { |
| 32899 | - return OverrideClass::sample(); /*58:override*/ | |
| 33106 | + return OverrideClass::sample(); /*59:override*/ | |
| 32900 | 33107 | } |
| 32901 | 33108 | |
| 32902 | 33109 | /** |
| @@ -32944,7 +33151,7 @@ class Obj4 { | ||
| 32944 | 33151 | * @return Package |
| 32945 | 33152 | */ |
| 32946 | 33153 | public static function samplePackage(): Package { |
| 32947 | - return Package::sample(); /*59:package*/ | |
| 33154 | + return Package::sample(); /*60:package*/ | |
| 32948 | 33155 | } |
| 32949 | 33156 | |
| 32950 | 33157 | /** |
| @@ -32992,7 +33199,7 @@ class Obj4 { | ||
| 32992 | 33199 | * @return Params |
| 32993 | 33200 | */ |
| 32994 | 33201 | public static function sampleParams(): Params { |
| 32995 | - return Params::sample(); /*60:params*/ | |
| 33202 | + return Params::sample(); /*61:params*/ | |
| 32996 | 33203 | } |
| 32997 | 33204 | |
| 32998 | 33205 | /** |
| @@ -33040,7 +33247,7 @@ class Obj4 { | ||
| 33040 | 33247 | * @return Pass |
| 33041 | 33248 | */ |
| 33042 | 33249 | public static function samplePass(): Pass { |
| 33043 | - return Pass::sample(); /*61:pass*/ | |
| 33250 | + return Pass::sample(); /*62:pass*/ | |
| 33044 | 33251 | } |
| 33045 | 33252 | |
| 33046 | 33253 | /** |
| @@ -33088,7 +33295,7 @@ class Obj4 { | ||
| 33088 | 33295 | * @return Port |
| 33089 | 33296 | */ |
| 33090 | 33297 | public static function samplePort(): Port { |
| 33091 | - return Port::sample(); /*62:port*/ | |
| 33298 | + return Port::sample(); /*63:port*/ | |
| 33092 | 33299 | } |
| 33093 | 33300 | |
| 33094 | 33301 | /** |
| @@ -33136,7 +33343,7 @@ class Obj4 { | ||
| 33136 | 33343 | * @return Postfix |
| 33137 | 33344 | */ |
| 33138 | 33345 | public static function samplePostfix(): Postfix { |
| 33139 | - return Postfix::sample(); /*63:postfix*/ | |
| 33346 | + return Postfix::sample(); /*64:postfix*/ | |
| 33140 | 33347 | } |
| 33141 | 33348 | |
| 33142 | 33349 | /** |
| @@ -33184,7 +33391,7 @@ class Obj4 { | ||
| 33184 | 33391 | * @return Precedence |
| 33185 | 33392 | */ |
| 33186 | 33393 | public static function samplePrecedence(): Precedence { |
| 33187 | - return Precedence::sample(); /*64:precedence*/ | |
| 33394 | + return Precedence::sample(); /*65:precedence*/ | |
| 33188 | 33395 | } |
| 33189 | 33396 | |
| 33190 | 33397 | /** |
| @@ -33232,7 +33439,7 @@ class Obj4 { | ||
| 33232 | 33439 | * @return Prefix |
| 33233 | 33440 | */ |
| 33234 | 33441 | public static function samplePrefix(): Prefix { |
| 33235 | - return Prefix::sample(); /*65:prefix*/ | |
| 33442 | + return Prefix::sample(); /*66:prefix*/ | |
| 33236 | 33443 | } |
| 33237 | 33444 | |
| 33238 | 33445 | /** |
| @@ -33280,7 +33487,7 @@ class Obj4 { | ||
| 33280 | 33487 | * @return PrintClass |
| 33281 | 33488 | */ |
| 33282 | 33489 | public static function samplePrint(): PrintClass { |
| 33283 | - return PrintClass::sample(); /*66:print*/ | |
| 33490 | + return PrintClass::sample(); /*67:print*/ | |
| 33284 | 33491 | } |
| 33285 | 33492 | |
| 33286 | 33493 | /** |
| @@ -33328,7 +33535,7 @@ class Obj4 { | ||
| 33328 | 33535 | * @return PrintMembers |
| 33329 | 33536 | */ |
| 33330 | 33537 | public static function samplePrintMembers(): PrintMembers { |
| 33331 | - return PrintMembers::sample(); /*67:printMembers*/ | |
| 33538 | + return PrintMembers::sample(); /*68:printMembers*/ | |
| 33332 | 33539 | } |
| 33333 | 33540 | |
| 33334 | 33541 | /** |
| @@ -33376,7 +33583,7 @@ class Obj4 { | ||
| 33376 | 33583 | * @return Printf |
| 33377 | 33584 | */ |
| 33378 | 33585 | public static function samplePrintf(): Printf { |
| 33379 | - return Printf::sample(); /*68:printf*/ | |
| 33586 | + return Printf::sample(); /*69:printf*/ | |
| 33380 | 33587 | } |
| 33381 | 33588 | |
| 33382 | 33589 | /** |
| @@ -33424,7 +33631,7 @@ class Obj4 { | ||
| 33424 | 33631 | * @return PrivateClass |
| 33425 | 33632 | */ |
| 33426 | 33633 | public static function samplePrivate(): PrivateClass { |
| 33427 | - return PrivateClass::sample(); /*69:private*/ | |
| 33634 | + return PrivateClass::sample(); /*70:private*/ | |
| 33428 | 33635 | } |
| 33429 | 33636 | |
| 33430 | 33637 | /** |
| @@ -33472,7 +33679,7 @@ class Obj4 { | ||
| 33472 | 33679 | * @return ProtectedClass |
| 33473 | 33680 | */ |
| 33474 | 33681 | public static function sampleProtected(): ProtectedClass { |
| 33475 | - return ProtectedClass::sample(); /*70:protected*/ | |
| 33682 | + return ProtectedClass::sample(); /*71:protected*/ | |
| 33476 | 33683 | } |
| 33477 | 33684 | |
| 33478 | 33685 | /** |
| @@ -33520,7 +33727,7 @@ class Obj4 { | ||
| 33520 | 33727 | * @return Protocol |
| 33521 | 33728 | */ |
| 33522 | 33729 | public static function sampleProtocol(): Protocol { |
| 33523 | - return Protocol::sample(); /*71:protocol*/ | |
| 33730 | + return Protocol::sample(); /*72:protocol*/ | |
| 33524 | 33731 | } |
| 33525 | 33732 | |
| 33526 | 33733 | /** |
| @@ -33568,7 +33775,7 @@ class Obj4 { | ||
| 33568 | 33775 | * @return PublicClass |
| 33569 | 33776 | */ |
| 33570 | 33777 | public static function samplePublic(): PublicClass { |
| 33571 | - return PublicClass::sample(); /*72:public*/ | |
| 33778 | + return PublicClass::sample(); /*73:public*/ | |
| 33572 | 33779 | } |
| 33573 | 33780 | |
| 33574 | 33781 | /** |
| @@ -33616,7 +33823,7 @@ class Obj4 { | ||
| 33616 | 33823 | * @return Quicktype |
| 33617 | 33824 | */ |
| 33618 | 33825 | public static function sampleQuicktype(): Quicktype { |
| 33619 | - return Quicktype::sample(); /*73:quicktype*/ | |
| 33826 | + return Quicktype::sample(); /*74:quicktype*/ | |
| 33620 | 33827 | } |
| 33621 | 33828 | |
| 33622 | 33829 | /** |
| @@ -33664,7 +33871,7 @@ class Obj4 { | ||
| 33664 | 33871 | * @return Raise |
| 33665 | 33872 | */ |
| 33666 | 33873 | public static function sampleRaise(): Raise { |
| 33667 | - return Raise::sample(); /*74:raise*/ | |
| 33874 | + return Raise::sample(); /*75:raise*/ | |
| 33668 | 33875 | } |
| 33669 | 33876 | |
| 33670 | 33877 | /** |
| @@ -33712,7 +33919,7 @@ class Obj4 { | ||
| 33712 | 33919 | * @return Range |
| 33713 | 33920 | */ |
| 33714 | 33921 | public static function sampleRange(): Range { |
| 33715 | - return Range::sample(); /*75:range*/ | |
| 33922 | + return Range::sample(); /*76:range*/ | |
| 33716 | 33923 | } |
| 33717 | 33924 | |
| 33718 | 33925 | /** |
| @@ -33760,7 +33967,7 @@ class Obj4 { | ||
| 33760 | 33967 | * @return ReadonlyClass |
| 33761 | 33968 | */ |
| 33762 | 33969 | public static function sampleReadonly(): ReadonlyClass { |
| 33763 | - return ReadonlyClass::sample(); /*76:readonly*/ | |
| 33970 | + return ReadonlyClass::sample(); /*77:readonly*/ | |
| 33764 | 33971 | } |
| 33765 | 33972 | |
| 33766 | 33973 | /** |
| @@ -33808,7 +34015,7 @@ class Obj4 { | ||
| 33808 | 34015 | * @return Ref |
| 33809 | 34016 | */ |
| 33810 | 34017 | public static function sampleRef(): Ref { |
| 33811 | - return Ref::sample(); /*77:ref*/ | |
| 34018 | + return Ref::sample(); /*78:ref*/ | |
| 33812 | 34019 | } |
| 33813 | 34020 | |
| 33814 | 34021 | /** |
| @@ -33856,7 +34063,7 @@ class Obj4 { | ||
| 33856 | 34063 | * @return RegExp |
| 33857 | 34064 | */ |
| 33858 | 34065 | public static function sampleRegExp(): RegExp { |
| 33859 | - return RegExp::sample(); /*78:regExp*/ | |
| 34066 | + return RegExp::sample(); /*79:regExp*/ | |
| 33860 | 34067 | } |
| 33861 | 34068 | |
| 33862 | 34069 | /** |
| @@ -33904,7 +34111,7 @@ class Obj4 { | ||
| 33904 | 34111 | * @return Register |
| 33905 | 34112 | */ |
| 33906 | 34113 | public static function sampleRegister(): Register { |
| 33907 | - return Register::sample(); /*79:register*/ | |
| 34114 | + return Register::sample(); /*80:register*/ | |
| 33908 | 34115 | } |
| 33909 | 34116 | |
| 33910 | 34117 | /** |
| @@ -33952,7 +34159,7 @@ class Obj4 { | ||
| 33952 | 34159 | * @return ReinterpretCast |
| 33953 | 34160 | */ |
| 33954 | 34161 | public static function sampleReinterpretCast(): ReinterpretCast { |
| 33955 | - return ReinterpretCast::sample(); /*80:reinterpretCast*/ | |
| 34162 | + return ReinterpretCast::sample(); /*81:reinterpretCast*/ | |
| 33956 | 34163 | } |
| 33957 | 34164 | |
| 33958 | 34165 | /** |
| @@ -34000,7 +34207,7 @@ class Obj4 { | ||
| 34000 | 34207 | * @return Repeat |
| 34001 | 34208 | */ |
| 34002 | 34209 | public static function sampleRepeat(): Repeat { |
| 34003 | - return Repeat::sample(); /*81:repeat*/ | |
| 34210 | + return Repeat::sample(); /*82:repeat*/ | |
| 34004 | 34211 | } |
| 34005 | 34212 | |
| 34006 | 34213 | /** |
| @@ -34048,7 +34255,7 @@ class Obj4 { | ||
| 34048 | 34255 | * @return RequireClass |
| 34049 | 34256 | */ |
| 34050 | 34257 | public static function sampleRequire(): RequireClass { |
| 34051 | - return RequireClass::sample(); /*82:require*/ | |
| 34258 | + return RequireClass::sample(); /*83:require*/ | |
| 34052 | 34259 | } |
| 34053 | 34260 | |
| 34054 | 34261 | /** |
| @@ -34096,7 +34303,7 @@ class Obj4 { | ||
| 34096 | 34303 | * @return Required |
| 34097 | 34304 | */ |
| 34098 | 34305 | public static function sampleRequired(): Required { |
| 34099 | - return Required::sample(); /*83:required*/ | |
| 34306 | + return Required::sample(); /*84:required*/ | |
| 34100 | 34307 | } |
| 34101 | 34308 | |
| 34102 | 34309 | /** |
| @@ -34144,7 +34351,7 @@ class Obj4 { | ||
| 34144 | 34351 | * @return Requires |
| 34145 | 34352 | */ |
| 34146 | 34353 | public static function sampleRequires(): Requires { |
| 34147 | - return Requires::sample(); /*84:requires*/ | |
| 34354 | + return Requires::sample(); /*85:requires*/ | |
| 34148 | 34355 | } |
| 34149 | 34356 | |
| 34150 | 34357 | /** |
| @@ -34192,7 +34399,7 @@ class Obj4 { | ||
| 34192 | 34399 | * @return Restrict |
| 34193 | 34400 | */ |
| 34194 | 34401 | public static function sampleRestrict(): Restrict { |
| 34195 | - return Restrict::sample(); /*85:restrict*/ | |
| 34402 | + return Restrict::sample(); /*86:restrict*/ | |
| 34196 | 34403 | } |
| 34197 | 34404 | |
| 34198 | 34405 | /** |
| @@ -34240,7 +34447,7 @@ class Obj4 { | ||
| 34240 | 34447 | * @return Retain |
| 34241 | 34448 | */ |
| 34242 | 34449 | public static function sampleRetain(): Retain { |
| 34243 | - return Retain::sample(); /*86:retain*/ | |
| 34450 | + return Retain::sample(); /*87:retain*/ | |
| 34244 | 34451 | } |
| 34245 | 34452 | |
| 34246 | 34453 | /** |
| @@ -34288,7 +34495,7 @@ class Obj4 { | ||
| 34288 | 34495 | * @return Rethrows |
| 34289 | 34496 | */ |
| 34290 | 34497 | public static function sampleRethrows(): Rethrows { |
| 34291 | - return Rethrows::sample(); /*87:rethrows*/ | |
| 34498 | + return Rethrows::sample(); /*88:rethrows*/ | |
| 34292 | 34499 | } |
| 34293 | 34500 | |
| 34294 | 34501 | /** |
| @@ -34336,7 +34543,7 @@ class Obj4 { | ||
| 34336 | 34543 | * @return ReturnClass |
| 34337 | 34544 | */ |
| 34338 | 34545 | public static function sampleReturn(): ReturnClass { |
| 34339 | - return ReturnClass::sample(); /*88:return*/ | |
| 34546 | + return ReturnClass::sample(); /*89:return*/ | |
| 34340 | 34547 | } |
| 34341 | 34548 | |
| 34342 | 34549 | /** |
| @@ -34384,7 +34591,7 @@ class Obj4 { | ||
| 34384 | 34591 | * @return Right |
| 34385 | 34592 | */ |
| 34386 | 34593 | public static function sampleRight(): Right { |
| 34387 | - return Right::sample(); /*89:right*/ | |
| 34594 | + return Right::sample(); /*90:right*/ | |
| 34388 | 34595 | } |
| 34389 | 34596 | |
| 34390 | 34597 | /** |
| @@ -34432,7 +34639,7 @@ class Obj4 { | ||
| 34432 | 34639 | * @return RuntimeType |
| 34433 | 34640 | */ |
| 34434 | 34641 | public static function sampleRuntimeType(): RuntimeType { |
| 34435 | - return RuntimeType::sample(); /*90:runtimeType*/ | |
| 34642 | + return RuntimeType::sample(); /*91:runtimeType*/ | |
| 34436 | 34643 | } |
| 34437 | 34644 | |
| 34438 | 34645 | /** |
| @@ -34480,7 +34687,7 @@ class Obj4 { | ||
| 34480 | 34687 | * @return S |
| 34481 | 34688 | */ |
| 34482 | 34689 | public static function sampleS(): S { |
| 34483 | - return S::sample(); /*91:s*/ | |
| 34690 | + return S::sample(); /*92:s*/ | |
| 34484 | 34691 | } |
| 34485 | 34692 | |
| 34486 | 34693 | /** |
| @@ -34528,7 +34735,7 @@ class Obj4 { | ||
| 34528 | 34735 | * @return Sbyte |
| 34529 | 34736 | */ |
| 34530 | 34737 | public static function sampleSbyte(): Sbyte { |
| 34531 | - return Sbyte::sample(); /*92:sbyte*/ | |
| 34738 | + return Sbyte::sample(); /*93:sbyte*/ | |
| 34532 | 34739 | } |
| 34533 | 34740 | |
| 34534 | 34741 | /** |
| @@ -34576,7 +34783,7 @@ class Obj4 { | ||
| 34576 | 34783 | * @return Sealed |
| 34577 | 34784 | */ |
| 34578 | 34785 | public static function sampleSealed(): Sealed { |
| 34579 | - return Sealed::sample(); /*93:sealed*/ | |
| 34786 | + return Sealed::sample(); /*94:sealed*/ | |
| 34580 | 34787 | } |
| 34581 | 34788 | |
| 34582 | 34789 | /** |
| @@ -34624,55 +34831,7 @@ class Obj4 { | ||
| 34624 | 34831 | * @return Sel |
| 34625 | 34832 | */ |
| 34626 | 34833 | public static function sampleSel(): Sel { |
| 34627 | - return Sel::sample(); /*94:sel*/ | |
| 34628 | - } | |
| 34629 | - | |
| 34630 | - /** | |
| 34631 | - * @param stdClass $value | |
| 34632 | - * @throws Exception | |
| 34633 | - * @return Select | |
| 34634 | - */ | |
| 34635 | - public static function fromSelect(stdClass $value): Select { | |
| 34636 | - return Select::from($value); /*class*/ | |
| 34637 | - } | |
| 34638 | - | |
| 34639 | - /** | |
| 34640 | - * @throws Exception | |
| 34641 | - * @return stdClass | |
| 34642 | - */ | |
| 34643 | - public function toSelect(): stdClass { | |
| 34644 | - if (Obj4::validateSelect($this->select)) { | |
| 34645 | - return $this->select->to(); /*class*/ | |
| 34646 | - } | |
| 34647 | - throw new Exception('never get to this Obj4::select'); | |
| 34648 | - } | |
| 34649 | - | |
| 34650 | - /** | |
| 34651 | - * @param Select | |
| 34652 | - * @return bool | |
| 34653 | - * @throws Exception | |
| 34654 | - */ | |
| 34655 | - public static function validateSelect(Select $value): bool { | |
| 34656 | - $value->validate(); | |
| 34657 | - return true; | |
| 34658 | - } | |
| 34659 | - | |
| 34660 | - /** | |
| 34661 | - * @throws Exception | |
| 34662 | - * @return Select | |
| 34663 | - */ | |
| 34664 | - public function getSelect(): Select { | |
| 34665 | - if (Obj4::validateSelect($this->select)) { | |
| 34666 | - return $this->select; | |
| 34667 | - } | |
| 34668 | - throw new Exception('never get to getSelect Obj4::select'); | |
| 34669 | - } | |
| 34670 | - | |
| 34671 | - /** | |
| 34672 | - * @return Select | |
| 34673 | - */ | |
| 34674 | - public static function sampleSelect(): Select { | |
| 34675 | - return Select::sample(); /*95:select*/ | |
| 34834 | + return Sel::sample(); /*95:sel*/ | |
| 34676 | 34835 | } |
| 34677 | 34836 | |
| 34678 | 34837 | /** |
| @@ -34682,6 +34841,7 @@ class Obj4 { | ||
| 34682 | 34841 | public function validate(): bool { |
| 34683 | 34842 | return Obj4::validateDummy($this->dummy) |
| 34684 | 34843 | || Obj4::validateNoSuchMethod($this->noSuchMethod) |
| 34844 | + || Obj4::validateNoexcept($this->noexcept) | |
| 34685 | 34845 | || Obj4::validateNonatomic($this->nonatomic) |
| 34686 | 34846 | || Obj4::validateNone($this->none) |
| 34687 | 34847 | || Obj4::validateNonlocal($this->nonlocal) |
| @@ -34743,8 +34903,7 @@ class Obj4 { | ||
| 34743 | 34903 | || Obj4::validateS($this->s) |
| 34744 | 34904 | || Obj4::validateSbyte($this->sbyte) |
| 34745 | 34905 | || Obj4::validateSealed($this->sealed) |
| 34746 | - || Obj4::validateSel($this->sel) | |
| 34747 | - || Obj4::validateSelect($this->select); | |
| 34906 | + || Obj4::validateSel($this->sel); | |
| 34748 | 34907 | } |
| 34749 | 34908 | |
| 34750 | 34909 | /** |
| @@ -34755,6 +34914,7 @@ class Obj4 { | ||
| 34755 | 34914 | $out = new stdClass(); |
| 34756 | 34915 | $out->{'dummy'} = $this->toDummy(); |
| 34757 | 34916 | $out->{'noSuchMethod'} = $this->toNoSuchMethod(); |
| 34917 | + $out->{'noexcept'} = $this->toNoexcept(); | |
| 34758 | 34918 | $out->{'nonatomic'} = $this->toNonatomic(); |
| 34759 | 34919 | $out->{'None'} = $this->toNone(); |
| 34760 | 34920 | $out->{'nonlocal'} = $this->toNonlocal(); |
| @@ -34817,7 +34977,6 @@ class Obj4 { | ||
| 34817 | 34977 | $out->{'sbyte'} = $this->toSbyte(); |
| 34818 | 34978 | $out->{'sealed'} = $this->toSealed(); |
| 34819 | 34979 | $out->{'SEL'} = $this->toSel(); |
| 34820 | - $out->{'select'} = $this->toSelect(); | |
| 34821 | 34980 | return $out; |
| 34822 | 34981 | } |
| 34823 | 34982 | |
| @@ -34833,6 +34992,9 @@ class Obj4 { | ||
| 34833 | 34992 | if (!property_exists($obj, 'noSuchMethod')) { |
| 34834 | 34993 | throw new Exception("Missing required property"); |
| 34835 | 34994 | } |
| 34995 | + if (!property_exists($obj, 'noexcept')) { | |
| 34996 | + throw new Exception("Missing required property"); | |
| 34997 | + } | |
| 34836 | 34998 | if (!property_exists($obj, 'nonatomic')) { |
| 34837 | 34999 | throw new Exception("Missing required property"); |
| 34838 | 35000 | } |
| @@ -35019,12 +35181,10 @@ class Obj4 { | ||
| 35019 | 35181 | if (!property_exists($obj, 'SEL')) { |
| 35020 | 35182 | throw new Exception("Missing required property"); |
| 35021 | 35183 | } |
| 35022 | - if (!property_exists($obj, 'select')) { | |
| 35023 | - throw new Exception("Missing required property"); | |
| 35024 | - } | |
| 35025 | 35184 | return new Obj4( |
| 35026 | 35185 | Obj4::fromDummy($obj->{'dummy'}) |
| 35027 | 35186 | ,Obj4::fromNoSuchMethod($obj->{'noSuchMethod'}) |
| 35187 | + ,Obj4::fromNoexcept($obj->{'noexcept'}) | |
| 35028 | 35188 | ,Obj4::fromNonatomic($obj->{'nonatomic'}) |
| 35029 | 35189 | ,Obj4::fromNone($obj->{'None'}) |
| 35030 | 35190 | ,Obj4::fromNonlocal($obj->{'nonlocal'}) |
| @@ -35087,7 +35247,6 @@ class Obj4 { | ||
| 35087 | 35247 | ,Obj4::fromSbyte($obj->{'sbyte'}) |
| 35088 | 35248 | ,Obj4::fromSealed($obj->{'sealed'}) |
| 35089 | 35249 | ,Obj4::fromSel($obj->{'SEL'}) |
| 35090 | - ,Obj4::fromSelect($obj->{'select'}) | |
| 35091 | 35250 | ); |
| 35092 | 35251 | } |
| 35093 | 35252 | |
| @@ -35098,6 +35257,7 @@ class Obj4 { | ||
| 35098 | 35257 | return new Obj4( |
| 35099 | 35258 | Obj4::sampleDummy() |
| 35100 | 35259 | ,Obj4::sampleNoSuchMethod() |
| 35260 | + ,Obj4::sampleNoexcept() | |
| 35101 | 35261 | ,Obj4::sampleNonatomic() |
| 35102 | 35262 | ,Obj4::sampleNone() |
| 35103 | 35263 | ,Obj4::sampleNonlocal() |
| @@ -35160,7 +35320,6 @@ class Obj4 { | ||
| 35160 | 35320 | ,Obj4::sampleSbyte() |
| 35161 | 35321 | ,Obj4::sampleSealed() |
| 35162 | 35322 | ,Obj4::sampleSel() |
| 35163 | - ,Obj4::sampleSelect() | |
| 35164 | 35323 | ); |
| 35165 | 35324 | } |
| 35166 | 35325 | } |
| @@ -35266,6 +35425,107 @@ class NoSuchMethod { | ||
| 35266 | 35425 | } |
| 35267 | 35426 | } |
| 35268 | 35427 | |
| 35428 | +// This is an autogenerated file:Noexcept | |
| 35429 | + | |
| 35430 | +class Noexcept { | |
| 35431 | + private int $noexcept; // json:noexcept Required | |
| 35432 | + | |
| 35433 | + /** | |
| 35434 | + * @param int $noexcept | |
| 35435 | + */ | |
| 35436 | + public function __construct(int $noexcept) { | |
| 35437 | + $this->noexcept = $noexcept; | |
| 35438 | + } | |
| 35439 | + | |
| 35440 | + /** | |
| 35441 | + * @param int $value | |
| 35442 | + * @throws Exception | |
| 35443 | + * @return int | |
| 35444 | + */ | |
| 35445 | + public static function fromNoexcept(int $value): int { | |
| 35446 | + return $value; /*int*/ | |
| 35447 | + } | |
| 35448 | + | |
| 35449 | + /** | |
| 35450 | + * @throws Exception | |
| 35451 | + * @return int | |
| 35452 | + */ | |
| 35453 | + public function toNoexcept(): int { | |
| 35454 | + if (Noexcept::validateNoexcept($this->noexcept)) { | |
| 35455 | + return $this->noexcept; /*int*/ | |
| 35456 | + } | |
| 35457 | + throw new Exception('never get to this Noexcept::noexcept'); | |
| 35458 | + } | |
| 35459 | + | |
| 35460 | + /** | |
| 35461 | + * @param int | |
| 35462 | + * @return bool | |
| 35463 | + * @throws Exception | |
| 35464 | + */ | |
| 35465 | + public static function validateNoexcept(int $value): bool { | |
| 35466 | + return true; | |
| 35467 | + } | |
| 35468 | + | |
| 35469 | + /** | |
| 35470 | + * @throws Exception | |
| 35471 | + * @return int | |
| 35472 | + */ | |
| 35473 | + public function getNoexcept(): int { | |
| 35474 | + if (Noexcept::validateNoexcept($this->noexcept)) { | |
| 35475 | + return $this->noexcept; | |
| 35476 | + } | |
| 35477 | + throw new Exception('never get to getNoexcept Noexcept::noexcept'); | |
| 35478 | + } | |
| 35479 | + | |
| 35480 | + /** | |
| 35481 | + * @return int | |
| 35482 | + */ | |
| 35483 | + public static function sampleNoexcept(): int { | |
| 35484 | + return 31; /*31:noexcept*/ | |
| 35485 | + } | |
| 35486 | + | |
| 35487 | + /** | |
| 35488 | + * @throws Exception | |
| 35489 | + * @return bool | |
| 35490 | + */ | |
| 35491 | + public function validate(): bool { | |
| 35492 | + return Noexcept::validateNoexcept($this->noexcept); | |
| 35493 | + } | |
| 35494 | + | |
| 35495 | + /** | |
| 35496 | + * @return stdClass | |
| 35497 | + * @throws Exception | |
| 35498 | + */ | |
| 35499 | + public function to(): stdClass { | |
| 35500 | + $out = new stdClass(); | |
| 35501 | + $out->{'noexcept'} = $this->toNoexcept(); | |
| 35502 | + return $out; | |
| 35503 | + } | |
| 35504 | + | |
| 35505 | + /** | |
| 35506 | + * @param stdClass $obj | |
| 35507 | + * @return Noexcept | |
| 35508 | + * @throws Exception | |
| 35509 | + */ | |
| 35510 | + public static function from(stdClass $obj): Noexcept { | |
| 35511 | + if (!property_exists($obj, 'noexcept')) { | |
| 35512 | + throw new Exception("Missing required property"); | |
| 35513 | + } | |
| 35514 | + return new Noexcept( | |
| 35515 | + Noexcept::fromNoexcept($obj->{'noexcept'}) | |
| 35516 | + ); | |
| 35517 | + } | |
| 35518 | + | |
| 35519 | + /** | |
| 35520 | + * @return Noexcept | |
| 35521 | + */ | |
| 35522 | + public static function sample(): Noexcept { | |
| 35523 | + return new Noexcept( | |
| 35524 | + Noexcept::sampleNoexcept() | |
| 35525 | + ); | |
| 35526 | + } | |
| 35527 | +} | |
| 35528 | + | |
| 35269 | 35529 | // This is an autogenerated file:Nonatomic |
| 35270 | 35530 | |
| 35271 | 35531 | class Nonatomic { |
| @@ -41531,107 +41791,6 @@ class Sel { | ||
| 41531 | 41791 | } |
| 41532 | 41792 | } |
| 41533 | 41793 | |
| 41534 | -// This is an autogenerated file:Select | |
| 41535 | - | |
| 41536 | -class Select { | |
| 41537 | - private int $select; // json:select Required | |
| 41538 | - | |
| 41539 | - /** | |
| 41540 | - * @param int $select | |
| 41541 | - */ | |
| 41542 | - public function __construct(int $select) { | |
| 41543 | - $this->select = $select; | |
| 41544 | - } | |
| 41545 | - | |
| 41546 | - /** | |
| 41547 | - * @param int $value | |
| 41548 | - * @throws Exception | |
| 41549 | - * @return int | |
| 41550 | - */ | |
| 41551 | - public static function fromSelect(int $value): int { | |
| 41552 | - return $value; /*int*/ | |
| 41553 | - } | |
| 41554 | - | |
| 41555 | - /** | |
| 41556 | - * @throws Exception | |
| 41557 | - * @return int | |
| 41558 | - */ | |
| 41559 | - public function toSelect(): int { | |
| 41560 | - if (Select::validateSelect($this->select)) { | |
| 41561 | - return $this->select; /*int*/ | |
| 41562 | - } | |
| 41563 | - throw new Exception('never get to this Select::select'); | |
| 41564 | - } | |
| 41565 | - | |
| 41566 | - /** | |
| 41567 | - * @param int | |
| 41568 | - * @return bool | |
| 41569 | - * @throws Exception | |
| 41570 | - */ | |
| 41571 | - public static function validateSelect(int $value): bool { | |
| 41572 | - return true; | |
| 41573 | - } | |
| 41574 | - | |
| 41575 | - /** | |
| 41576 | - * @throws Exception | |
| 41577 | - * @return int | |
| 41578 | - */ | |
| 41579 | - public function getSelect(): int { | |
| 41580 | - if (Select::validateSelect($this->select)) { | |
| 41581 | - return $this->select; | |
| 41582 | - } | |
| 41583 | - throw new Exception('never get to getSelect Select::select'); | |
| 41584 | - } | |
| 41585 | - | |
| 41586 | - /** | |
| 41587 | - * @return int | |
| 41588 | - */ | |
| 41589 | - public static function sampleSelect(): int { | |
| 41590 | - return 31; /*31:select*/ | |
| 41591 | - } | |
| 41592 | - | |
| 41593 | - /** | |
| 41594 | - * @throws Exception | |
| 41595 | - * @return bool | |
| 41596 | - */ | |
| 41597 | - public function validate(): bool { | |
| 41598 | - return Select::validateSelect($this->select); | |
| 41599 | - } | |
| 41600 | - | |
| 41601 | - /** | |
| 41602 | - * @return stdClass | |
| 41603 | - * @throws Exception | |
| 41604 | - */ | |
| 41605 | - public function to(): stdClass { | |
| 41606 | - $out = new stdClass(); | |
| 41607 | - $out->{'select'} = $this->toSelect(); | |
| 41608 | - return $out; | |
| 41609 | - } | |
| 41610 | - | |
| 41611 | - /** | |
| 41612 | - * @param stdClass $obj | |
| 41613 | - * @return Select | |
| 41614 | - * @throws Exception | |
| 41615 | - */ | |
| 41616 | - public static function from(stdClass $obj): Select { | |
| 41617 | - if (!property_exists($obj, 'select')) { | |
| 41618 | - throw new Exception("Missing required property"); | |
| 41619 | - } | |
| 41620 | - return new Select( | |
| 41621 | - Select::fromSelect($obj->{'select'}) | |
| 41622 | - ); | |
| 41623 | - } | |
| 41624 | - | |
| 41625 | - /** | |
| 41626 | - * @return Select | |
| 41627 | - */ | |
| 41628 | - public static function sample(): Select { | |
| 41629 | - return new Select( | |
| 41630 | - Select::sampleSelect() | |
| 41631 | - ); | |
| 41632 | - } | |
| 41633 | -} | |
| 41634 | - | |
| 41635 | 41794 | // This is an autogenerated file:Obj5 |
| 41636 | 41795 | |
| 41637 | 41796 | class Obj5 { |
| @@ -41642,6 +41801,7 @@ class Obj5 { | ||
| 41642 | 41801 | private Obj5True $obj5True; // json:true Required |
| 41643 | 41802 | private TypeClass $obj5Type; // json:type Required |
| 41644 | 41803 | private PrimitiveKind $primitiveKind; // json:PrimitiveKind Required |
| 41804 | + private Select $select; // json:select Required | |
| 41645 | 41805 | private SelfClass $self; // json:Self Required |
| 41646 | 41806 | private Sendable $sendable; // json:Sendable Required |
| 41647 | 41807 | private SerialDescriptor $serialDescriptor; // json:SerialDescriptor Required |
| @@ -41678,6 +41838,7 @@ class Obj5 { | ||
| 41678 | 41838 | private TimeOnly $timeOnly; // json:TimeOnly Required |
| 41679 | 41839 | private TimeOnlyConverter $timeOnlyConverter; // json:TimeOnlyConverter Required |
| 41680 | 41840 | private TimeZone $timeZone; // json:TimeZone Required |
| 41841 | + private ToDict $toDict; // json:to_dict Required | |
| 41681 | 41842 | private ToJSON $toJSON; // json:to_json Required |
| 41682 | 41843 | private ToString $toString; // json:toString Required |
| 41683 | 41844 | private TopLevelClass $topLevel; // json:top_level Required |
| @@ -41695,11 +41856,10 @@ class Obj5 { | ||
| 41695 | 41856 | private Unchecked $unchecked; // json:unchecked Required |
| 41696 | 41857 | private Undefined $undefined; // json:undefined Required |
| 41697 | 41858 | private Union $union; // json:union Required |
| 41859 | + private UnmarshalJSON $unmarshalJSON; // json:UnmarshalJSON Required | |
| 41698 | 41860 | private Unowned $unowned; // json:unowned Required |
| 41699 | 41861 | private Unsafe $unsafe; // json:unsafe Required |
| 41700 | - private Unsigned $unsigned; // json:unsigned Required | |
| 41701 | 41862 | private UseSerializers $useSerializers; // json:UseSerializers Required |
| 41702 | - private Ushort $ushort; // json:ushort Required | |
| 41703 | 41863 | |
| 41704 | 41864 | /** |
| 41705 | 41865 | * @param int $dummy |
| @@ -41709,6 +41869,7 @@ class Obj5 { | ||
| 41709 | 41869 | * @param Obj5True $obj5True |
| 41710 | 41870 | * @param TypeClass $obj5Type |
| 41711 | 41871 | * @param PrimitiveKind $primitiveKind |
| 41872 | + * @param Select $select | |
| 41712 | 41873 | * @param SelfClass $self |
| 41713 | 41874 | * @param Sendable $sendable |
| 41714 | 41875 | * @param SerialDescriptor $serialDescriptor |
| @@ -41745,6 +41906,7 @@ class Obj5 { | ||
| 41745 | 41906 | * @param TimeOnly $timeOnly |
| 41746 | 41907 | * @param TimeOnlyConverter $timeOnlyConverter |
| 41747 | 41908 | * @param TimeZone $timeZone |
| 41909 | + * @param ToDict $toDict | |
| 41748 | 41910 | * @param ToJSON $toJSON |
| 41749 | 41911 | * @param ToString $toString |
| 41750 | 41912 | * @param TopLevelClass $topLevel |
| @@ -41762,13 +41924,12 @@ class Obj5 { | ||
| 41762 | 41924 | * @param Unchecked $unchecked |
| 41763 | 41925 | * @param Undefined $undefined |
| 41764 | 41926 | * @param Union $union |
| 41927 | + * @param UnmarshalJSON $unmarshalJSON | |
| 41765 | 41928 | * @param Unowned $unowned |
| 41766 | 41929 | * @param Unsafe $unsafe |
| 41767 | - * @param Unsigned $unsigned | |
| 41768 | 41930 | * @param UseSerializers $useSerializers |
| 41769 | - * @param Ushort $ushort | |
| 41770 | 41931 | */ |
| 41771 | - public function __construct(int $dummy, KSerializer $kSerializer, Obj5Self $obj5Self, This $obj5This, Obj5True $obj5True, TypeClass $obj5Type, PrimitiveKind $primitiveKind, SelfClass $self, Sendable $sendable, SerialDescriptor $serialDescriptor, SerialName $serialName, SerializableClass $serializable, Serialize $serialize, SerializerProvider $serializerProvider, Set $set, Short $short, Signed $signed, SimpleModule $simpleModule, Sizeof $sizeof, Stackalloc $stackalloc, Standards $standards, StaticClass $static, StaticAssert $staticAssert, StaticCast $staticCast, StdDeserializer $stdDeserializer, StdSerializer $stdSerializer, Strictfp $strictfp, StringClass $string, Struct $struct, Subscript $subscript, Super $super, SwitchClass $switch, Symbol $symbol, Synchronized $synchronized, System $system, Template $template, Then $then, ThreadLocal $threadLocal, ThrowClass $throw, Throws $throws, TimeOnly $timeOnly, TimeOnlyConverter $timeOnlyConverter, TimeZone $timeZone, ToJSON $toJSON, ToString $toString, TopLevelClass $topLevel, Transient $transient, TrueClass $true, TryClass $try, Type $type, Typealias $typealias, Typedef $typedef, Typeid $typeid, Typename $typename, Typeof $typeof, Uint $uint, Ulong $ulong, Unchecked $unchecked, Undefined $undefined, Union $union, Unowned $unowned, Unsafe $unsafe, Unsigned $unsigned, UseSerializers $useSerializers, Ushort $ushort) { | |
| 41932 | + public function __construct(int $dummy, KSerializer $kSerializer, Obj5Self $obj5Self, This $obj5This, Obj5True $obj5True, TypeClass $obj5Type, PrimitiveKind $primitiveKind, Select $select, SelfClass $self, Sendable $sendable, SerialDescriptor $serialDescriptor, SerialName $serialName, SerializableClass $serializable, Serialize $serialize, SerializerProvider $serializerProvider, Set $set, Short $short, Signed $signed, SimpleModule $simpleModule, Sizeof $sizeof, Stackalloc $stackalloc, Standards $standards, StaticClass $static, StaticAssert $staticAssert, StaticCast $staticCast, StdDeserializer $stdDeserializer, StdSerializer $stdSerializer, Strictfp $strictfp, StringClass $string, Struct $struct, Subscript $subscript, Super $super, SwitchClass $switch, Symbol $symbol, Synchronized $synchronized, System $system, Template $template, Then $then, ThreadLocal $threadLocal, ThrowClass $throw, Throws $throws, TimeOnly $timeOnly, TimeOnlyConverter $timeOnlyConverter, TimeZone $timeZone, ToDict $toDict, ToJSON $toJSON, ToString $toString, TopLevelClass $topLevel, Transient $transient, TrueClass $true, TryClass $try, Type $type, Typealias $typealias, Typedef $typedef, Typeid $typeid, Typename $typename, Typeof $typeof, Uint $uint, Ulong $ulong, Unchecked $unchecked, Undefined $undefined, Union $union, UnmarshalJSON $unmarshalJSON, Unowned $unowned, Unsafe $unsafe, UseSerializers $useSerializers) { | |
| 41772 | 41933 | $this->dummy = $dummy; |
| 41773 | 41934 | $this->kSerializer = $kSerializer; |
| 41774 | 41935 | $this->obj5Self = $obj5Self; |
| @@ -41776,6 +41937,7 @@ class Obj5 { | ||
| 41776 | 41937 | $this->obj5True = $obj5True; |
| 41777 | 41938 | $this->obj5Type = $obj5Type; |
| 41778 | 41939 | $this->primitiveKind = $primitiveKind; |
| 41940 | + $this->select = $select; | |
| 41779 | 41941 | $this->self = $self; |
| 41780 | 41942 | $this->sendable = $sendable; |
| 41781 | 41943 | $this->serialDescriptor = $serialDescriptor; |
| @@ -41812,6 +41974,7 @@ class Obj5 { | ||
| 41812 | 41974 | $this->timeOnly = $timeOnly; |
| 41813 | 41975 | $this->timeOnlyConverter = $timeOnlyConverter; |
| 41814 | 41976 | $this->timeZone = $timeZone; |
| 41977 | + $this->toDict = $toDict; | |
| 41815 | 41978 | $this->toJSON = $toJSON; |
| 41816 | 41979 | $this->toString = $toString; |
| 41817 | 41980 | $this->topLevel = $topLevel; |
| @@ -41829,11 +41992,10 @@ class Obj5 { | ||
| 41829 | 41992 | $this->unchecked = $unchecked; |
| 41830 | 41993 | $this->undefined = $undefined; |
| 41831 | 41994 | $this->union = $union; |
| 41995 | + $this->unmarshalJSON = $unmarshalJSON; | |
| 41832 | 41996 | $this->unowned = $unowned; |
| 41833 | 41997 | $this->unsafe = $unsafe; |
| 41834 | - $this->unsigned = $unsigned; | |
| 41835 | 41998 | $this->useSerializers = $useSerializers; |
| 41836 | - $this->ushort = $ushort; | |
| 41837 | 41999 | } |
| 41838 | 42000 | |
| 41839 | 42001 | /** |
| @@ -42171,6 +42333,54 @@ class Obj5 { | ||
| 42171 | 42333 | return PrimitiveKind::sample(); /*37:primitiveKind*/ |
| 42172 | 42334 | } |
| 42173 | 42335 | |
| 42336 | + /** | |
| 42337 | + * @param stdClass $value | |
| 42338 | + * @throws Exception | |
| 42339 | + * @return Select | |
| 42340 | + */ | |
| 42341 | + public static function fromSelect(stdClass $value): Select { | |
| 42342 | + return Select::from($value); /*class*/ | |
| 42343 | + } | |
| 42344 | + | |
| 42345 | + /** | |
| 42346 | + * @throws Exception | |
| 42347 | + * @return stdClass | |
| 42348 | + */ | |
| 42349 | + public function toSelect(): stdClass { | |
| 42350 | + if (Obj5::validateSelect($this->select)) { | |
| 42351 | + return $this->select->to(); /*class*/ | |
| 42352 | + } | |
| 42353 | + throw new Exception('never get to this Obj5::select'); | |
| 42354 | + } | |
| 42355 | + | |
| 42356 | + /** | |
| 42357 | + * @param Select | |
| 42358 | + * @return bool | |
| 42359 | + * @throws Exception | |
| 42360 | + */ | |
| 42361 | + public static function validateSelect(Select $value): bool { | |
| 42362 | + $value->validate(); | |
| 42363 | + return true; | |
| 42364 | + } | |
| 42365 | + | |
| 42366 | + /** | |
| 42367 | + * @throws Exception | |
| 42368 | + * @return Select | |
| 42369 | + */ | |
| 42370 | + public function getSelect(): Select { | |
| 42371 | + if (Obj5::validateSelect($this->select)) { | |
| 42372 | + return $this->select; | |
| 42373 | + } | |
| 42374 | + throw new Exception('never get to getSelect Obj5::select'); | |
| 42375 | + } | |
| 42376 | + | |
| 42377 | + /** | |
| 42378 | + * @return Select | |
| 42379 | + */ | |
| 42380 | + public static function sampleSelect(): Select { | |
| 42381 | + return Select::sample(); /*38:select*/ | |
| 42382 | + } | |
| 42383 | + | |
| 42174 | 42384 | /** |
| 42175 | 42385 | * @param stdClass $value |
| 42176 | 42386 | * @throws Exception |
| @@ -42216,7 +42426,7 @@ class Obj5 { | ||
| 42216 | 42426 | * @return SelfClass |
| 42217 | 42427 | */ |
| 42218 | 42428 | public static function sampleSelf(): SelfClass { |
| 42219 | - return SelfClass::sample(); /*38:self*/ | |
| 42429 | + return SelfClass::sample(); /*39:self*/ | |
| 42220 | 42430 | } |
| 42221 | 42431 | |
| 42222 | 42432 | /** |
| @@ -42264,7 +42474,7 @@ class Obj5 { | ||
| 42264 | 42474 | * @return Sendable |
| 42265 | 42475 | */ |
| 42266 | 42476 | public static function sampleSendable(): Sendable { |
| 42267 | - return Sendable::sample(); /*39:sendable*/ | |
| 42477 | + return Sendable::sample(); /*40:sendable*/ | |
| 42268 | 42478 | } |
| 42269 | 42479 | |
| 42270 | 42480 | /** |
| @@ -42312,7 +42522,7 @@ class Obj5 { | ||
| 42312 | 42522 | * @return SerialDescriptor |
| 42313 | 42523 | */ |
| 42314 | 42524 | public static function sampleSerialDescriptor(): SerialDescriptor { |
| 42315 | - return SerialDescriptor::sample(); /*40:serialDescriptor*/ | |
| 42525 | + return SerialDescriptor::sample(); /*41:serialDescriptor*/ | |
| 42316 | 42526 | } |
| 42317 | 42527 | |
| 42318 | 42528 | /** |
| @@ -42360,7 +42570,7 @@ class Obj5 { | ||
| 42360 | 42570 | * @return SerialName |
| 42361 | 42571 | */ |
| 42362 | 42572 | public static function sampleSerialName(): SerialName { |
| 42363 | - return SerialName::sample(); /*41:serialName*/ | |
| 42573 | + return SerialName::sample(); /*42:serialName*/ | |
| 42364 | 42574 | } |
| 42365 | 42575 | |
| 42366 | 42576 | /** |
| @@ -42408,7 +42618,7 @@ class Obj5 { | ||
| 42408 | 42618 | * @return SerializableClass |
| 42409 | 42619 | */ |
| 42410 | 42620 | public static function sampleSerializable(): SerializableClass { |
| 42411 | - return SerializableClass::sample(); /*42:serializable*/ | |
| 42621 | + return SerializableClass::sample(); /*43:serializable*/ | |
| 42412 | 42622 | } |
| 42413 | 42623 | |
| 42414 | 42624 | /** |
| @@ -42456,7 +42666,7 @@ class Obj5 { | ||
| 42456 | 42666 | * @return Serialize |
| 42457 | 42667 | */ |
| 42458 | 42668 | public static function sampleSerialize(): Serialize { |
| 42459 | - return Serialize::sample(); /*43:serialize*/ | |
| 42669 | + return Serialize::sample(); /*44:serialize*/ | |
| 42460 | 42670 | } |
| 42461 | 42671 | |
| 42462 | 42672 | /** |
| @@ -42504,7 +42714,7 @@ class Obj5 { | ||
| 42504 | 42714 | * @return SerializerProvider |
| 42505 | 42715 | */ |
| 42506 | 42716 | public static function sampleSerializerProvider(): SerializerProvider { |
| 42507 | - return SerializerProvider::sample(); /*44:serializerProvider*/ | |
| 42717 | + return SerializerProvider::sample(); /*45:serializerProvider*/ | |
| 42508 | 42718 | } |
| 42509 | 42719 | |
| 42510 | 42720 | /** |
| @@ -42552,7 +42762,7 @@ class Obj5 { | ||
| 42552 | 42762 | * @return Set |
| 42553 | 42763 | */ |
| 42554 | 42764 | public static function sampleSet(): Set { |
| 42555 | - return Set::sample(); /*45:set*/ | |
| 42765 | + return Set::sample(); /*46:set*/ | |
| 42556 | 42766 | } |
| 42557 | 42767 | |
| 42558 | 42768 | /** |
| @@ -42600,7 +42810,7 @@ class Obj5 { | ||
| 42600 | 42810 | * @return Short |
| 42601 | 42811 | */ |
| 42602 | 42812 | public static function sampleShort(): Short { |
| 42603 | - return Short::sample(); /*46:short*/ | |
| 42813 | + return Short::sample(); /*47:short*/ | |
| 42604 | 42814 | } |
| 42605 | 42815 | |
| 42606 | 42816 | /** |
| @@ -42648,7 +42858,7 @@ class Obj5 { | ||
| 42648 | 42858 | * @return Signed |
| 42649 | 42859 | */ |
| 42650 | 42860 | public static function sampleSigned(): Signed { |
| 42651 | - return Signed::sample(); /*47:signed*/ | |
| 42861 | + return Signed::sample(); /*48:signed*/ | |
| 42652 | 42862 | } |
| 42653 | 42863 | |
| 42654 | 42864 | /** |
| @@ -42696,7 +42906,7 @@ class Obj5 { | ||
| 42696 | 42906 | * @return SimpleModule |
| 42697 | 42907 | */ |
| 42698 | 42908 | public static function sampleSimpleModule(): SimpleModule { |
| 42699 | - return SimpleModule::sample(); /*48:simpleModule*/ | |
| 42909 | + return SimpleModule::sample(); /*49:simpleModule*/ | |
| 42700 | 42910 | } |
| 42701 | 42911 | |
| 42702 | 42912 | /** |
| @@ -42744,7 +42954,7 @@ class Obj5 { | ||
| 42744 | 42954 | * @return Sizeof |
| 42745 | 42955 | */ |
| 42746 | 42956 | public static function sampleSizeof(): Sizeof { |
| 42747 | - return Sizeof::sample(); /*49:sizeof*/ | |
| 42957 | + return Sizeof::sample(); /*50:sizeof*/ | |
| 42748 | 42958 | } |
| 42749 | 42959 | |
| 42750 | 42960 | /** |
| @@ -42792,7 +43002,7 @@ class Obj5 { | ||
| 42792 | 43002 | * @return Stackalloc |
| 42793 | 43003 | */ |
| 42794 | 43004 | public static function sampleStackalloc(): Stackalloc { |
| 42795 | - return Stackalloc::sample(); /*50:stackalloc*/ | |
| 43005 | + return Stackalloc::sample(); /*51:stackalloc*/ | |
| 42796 | 43006 | } |
| 42797 | 43007 | |
| 42798 | 43008 | /** |
| @@ -42840,7 +43050,7 @@ class Obj5 { | ||
| 42840 | 43050 | * @return Standards |
| 42841 | 43051 | */ |
| 42842 | 43052 | public static function sampleStandards(): Standards { |
| 42843 | - return Standards::sample(); /*51:standards*/ | |
| 43053 | + return Standards::sample(); /*52:standards*/ | |
| 42844 | 43054 | } |
| 42845 | 43055 | |
| 42846 | 43056 | /** |
| @@ -42888,7 +43098,7 @@ class Obj5 { | ||
| 42888 | 43098 | * @return StaticClass |
| 42889 | 43099 | */ |
| 42890 | 43100 | public static function sampleStatic(): StaticClass { |
| 42891 | - return StaticClass::sample(); /*52:static*/ | |
| 43101 | + return StaticClass::sample(); /*53:static*/ | |
| 42892 | 43102 | } |
| 42893 | 43103 | |
| 42894 | 43104 | /** |
| @@ -42936,7 +43146,7 @@ class Obj5 { | ||
| 42936 | 43146 | * @return StaticAssert |
| 42937 | 43147 | */ |
| 42938 | 43148 | public static function sampleStaticAssert(): StaticAssert { |
| 42939 | - return StaticAssert::sample(); /*53:staticAssert*/ | |
| 43149 | + return StaticAssert::sample(); /*54:staticAssert*/ | |
| 42940 | 43150 | } |
| 42941 | 43151 | |
| 42942 | 43152 | /** |
| @@ -42984,7 +43194,7 @@ class Obj5 { | ||
| 42984 | 43194 | * @return StaticCast |
| 42985 | 43195 | */ |
| 42986 | 43196 | public static function sampleStaticCast(): StaticCast { |
| 42987 | - return StaticCast::sample(); /*54:staticCast*/ | |
| 43197 | + return StaticCast::sample(); /*55:staticCast*/ | |
| 42988 | 43198 | } |
| 42989 | 43199 | |
| 42990 | 43200 | /** |
| @@ -43032,7 +43242,7 @@ class Obj5 { | ||
| 43032 | 43242 | * @return StdDeserializer |
| 43033 | 43243 | */ |
| 43034 | 43244 | public static function sampleStdDeserializer(): StdDeserializer { |
| 43035 | - return StdDeserializer::sample(); /*55:stdDeserializer*/ | |
| 43245 | + return StdDeserializer::sample(); /*56:stdDeserializer*/ | |
| 43036 | 43246 | } |
| 43037 | 43247 | |
| 43038 | 43248 | /** |
| @@ -43080,7 +43290,7 @@ class Obj5 { | ||
| 43080 | 43290 | * @return StdSerializer |
| 43081 | 43291 | */ |
| 43082 | 43292 | public static function sampleStdSerializer(): StdSerializer { |
| 43083 | - return StdSerializer::sample(); /*56:stdSerializer*/ | |
| 43293 | + return StdSerializer::sample(); /*57:stdSerializer*/ | |
| 43084 | 43294 | } |
| 43085 | 43295 | |
| 43086 | 43296 | /** |
| @@ -43128,7 +43338,7 @@ class Obj5 { | ||
| 43128 | 43338 | * @return Strictfp |
| 43129 | 43339 | */ |
| 43130 | 43340 | public static function sampleStrictfp(): Strictfp { |
| 43131 | - return Strictfp::sample(); /*57:strictfp*/ | |
| 43341 | + return Strictfp::sample(); /*58:strictfp*/ | |
| 43132 | 43342 | } |
| 43133 | 43343 | |
| 43134 | 43344 | /** |
| @@ -43176,7 +43386,7 @@ class Obj5 { | ||
| 43176 | 43386 | * @return StringClass |
| 43177 | 43387 | */ |
| 43178 | 43388 | public static function sampleString(): StringClass { |
| 43179 | - return StringClass::sample(); /*58:string*/ | |
| 43389 | + return StringClass::sample(); /*59:string*/ | |
| 43180 | 43390 | } |
| 43181 | 43391 | |
| 43182 | 43392 | /** |
| @@ -43224,7 +43434,7 @@ class Obj5 { | ||
| 43224 | 43434 | * @return Struct |
| 43225 | 43435 | */ |
| 43226 | 43436 | public static function sampleStruct(): Struct { |
| 43227 | - return Struct::sample(); /*59:struct*/ | |
| 43437 | + return Struct::sample(); /*60:struct*/ | |
| 43228 | 43438 | } |
| 43229 | 43439 | |
| 43230 | 43440 | /** |
| @@ -43272,7 +43482,7 @@ class Obj5 { | ||
| 43272 | 43482 | * @return Subscript |
| 43273 | 43483 | */ |
| 43274 | 43484 | public static function sampleSubscript(): Subscript { |
| 43275 | - return Subscript::sample(); /*60:subscript*/ | |
| 43485 | + return Subscript::sample(); /*61:subscript*/ | |
| 43276 | 43486 | } |
| 43277 | 43487 | |
| 43278 | 43488 | /** |
| @@ -43320,7 +43530,7 @@ class Obj5 { | ||
| 43320 | 43530 | * @return Super |
| 43321 | 43531 | */ |
| 43322 | 43532 | public static function sampleSuper(): Super { |
| 43323 | - return Super::sample(); /*61:super*/ | |
| 43533 | + return Super::sample(); /*62:super*/ | |
| 43324 | 43534 | } |
| 43325 | 43535 | |
| 43326 | 43536 | /** |
| @@ -43368,7 +43578,7 @@ class Obj5 { | ||
| 43368 | 43578 | * @return SwitchClass |
| 43369 | 43579 | */ |
| 43370 | 43580 | public static function sampleSwitch(): SwitchClass { |
| 43371 | - return SwitchClass::sample(); /*62:switch*/ | |
| 43581 | + return SwitchClass::sample(); /*63:switch*/ | |
| 43372 | 43582 | } |
| 43373 | 43583 | |
| 43374 | 43584 | /** |
| @@ -43416,7 +43626,7 @@ class Obj5 { | ||
| 43416 | 43626 | * @return Symbol |
| 43417 | 43627 | */ |
| 43418 | 43628 | public static function sampleSymbol(): Symbol { |
| 43419 | - return Symbol::sample(); /*63:symbol*/ | |
| 43629 | + return Symbol::sample(); /*64:symbol*/ | |
| 43420 | 43630 | } |
| 43421 | 43631 | |
| 43422 | 43632 | /** |
| @@ -43464,7 +43674,7 @@ class Obj5 { | ||
| 43464 | 43674 | * @return Synchronized |
| 43465 | 43675 | */ |
| 43466 | 43676 | public static function sampleSynchronized(): Synchronized { |
| 43467 | - return Synchronized::sample(); /*64:synchronized*/ | |
| 43677 | + return Synchronized::sample(); /*65:synchronized*/ | |
| 43468 | 43678 | } |
| 43469 | 43679 | |
| 43470 | 43680 | /** |
| @@ -43512,7 +43722,7 @@ class Obj5 { | ||
| 43512 | 43722 | * @return System |
| 43513 | 43723 | */ |
| 43514 | 43724 | public static function sampleSystem(): System { |
| 43515 | - return System::sample(); /*65:system*/ | |
| 43725 | + return System::sample(); /*66:system*/ | |
| 43516 | 43726 | } |
| 43517 | 43727 | |
| 43518 | 43728 | /** |
| @@ -43560,7 +43770,7 @@ class Obj5 { | ||
| 43560 | 43770 | * @return Template |
| 43561 | 43771 | */ |
| 43562 | 43772 | public static function sampleTemplate(): Template { |
| 43563 | - return Template::sample(); /*66:template*/ | |
| 43773 | + return Template::sample(); /*67:template*/ | |
| 43564 | 43774 | } |
| 43565 | 43775 | |
| 43566 | 43776 | /** |
| @@ -43608,7 +43818,7 @@ class Obj5 { | ||
| 43608 | 43818 | * @return Then |
| 43609 | 43819 | */ |
| 43610 | 43820 | public static function sampleThen(): Then { |
| 43611 | - return Then::sample(); /*67:then*/ | |
| 43821 | + return Then::sample(); /*68:then*/ | |
| 43612 | 43822 | } |
| 43613 | 43823 | |
| 43614 | 43824 | /** |
| @@ -43656,7 +43866,7 @@ class Obj5 { | ||
| 43656 | 43866 | * @return ThreadLocal |
| 43657 | 43867 | */ |
| 43658 | 43868 | public static function sampleThreadLocal(): ThreadLocal { |
| 43659 | - return ThreadLocal::sample(); /*68:threadLocal*/ | |
| 43869 | + return ThreadLocal::sample(); /*69:threadLocal*/ | |
| 43660 | 43870 | } |
| 43661 | 43871 | |
| 43662 | 43872 | /** |
| @@ -43704,7 +43914,7 @@ class Obj5 { | ||
| 43704 | 43914 | * @return ThrowClass |
| 43705 | 43915 | */ |
| 43706 | 43916 | public static function sampleThrow(): ThrowClass { |
| 43707 | - return ThrowClass::sample(); /*69:throw*/ | |
| 43917 | + return ThrowClass::sample(); /*70:throw*/ | |
| 43708 | 43918 | } |
| 43709 | 43919 | |
| 43710 | 43920 | /** |
| @@ -43752,7 +43962,7 @@ class Obj5 { | ||
| 43752 | 43962 | * @return Throws |
| 43753 | 43963 | */ |
| 43754 | 43964 | public static function sampleThrows(): Throws { |
| 43755 | - return Throws::sample(); /*70:throws*/ | |
| 43965 | + return Throws::sample(); /*71:throws*/ | |
| 43756 | 43966 | } |
| 43757 | 43967 | |
| 43758 | 43968 | /** |
| @@ -43800,7 +44010,7 @@ class Obj5 { | ||
| 43800 | 44010 | * @return TimeOnly |
| 43801 | 44011 | */ |
| 43802 | 44012 | public static function sampleTimeOnly(): TimeOnly { |
| 43803 | - return TimeOnly::sample(); /*71:timeOnly*/ | |
| 44013 | + return TimeOnly::sample(); /*72:timeOnly*/ | |
| 43804 | 44014 | } |
| 43805 | 44015 | |
| 43806 | 44016 | /** |
| @@ -43848,7 +44058,7 @@ class Obj5 { | ||
| 43848 | 44058 | * @return TimeOnlyConverter |
| 43849 | 44059 | */ |
| 43850 | 44060 | public static function sampleTimeOnlyConverter(): TimeOnlyConverter { |
| 43851 | - return TimeOnlyConverter::sample(); /*72:timeOnlyConverter*/ | |
| 44061 | + return TimeOnlyConverter::sample(); /*73:timeOnlyConverter*/ | |
| 43852 | 44062 | } |
| 43853 | 44063 | |
| 43854 | 44064 | /** |
| @@ -43896,7 +44106,55 @@ class Obj5 { | ||
| 43896 | 44106 | * @return TimeZone |
| 43897 | 44107 | */ |
| 43898 | 44108 | public static function sampleTimeZone(): TimeZone { |
| 43899 | - return TimeZone::sample(); /*73:timeZone*/ | |
| 44109 | + return TimeZone::sample(); /*74:timeZone*/ | |
| 44110 | + } | |
| 44111 | + | |
| 44112 | + /** | |
| 44113 | + * @param stdClass $value | |
| 44114 | + * @throws Exception | |
| 44115 | + * @return ToDict | |
| 44116 | + */ | |
| 44117 | + public static function fromToDict(stdClass $value): ToDict { | |
| 44118 | + return ToDict::from($value); /*class*/ | |
| 44119 | + } | |
| 44120 | + | |
| 44121 | + /** | |
| 44122 | + * @throws Exception | |
| 44123 | + * @return stdClass | |
| 44124 | + */ | |
| 44125 | + public function toToDict(): stdClass { | |
| 44126 | + if (Obj5::validateToDict($this->toDict)) { | |
| 44127 | + return $this->toDict->to(); /*class*/ | |
| 44128 | + } | |
| 44129 | + throw new Exception('never get to this Obj5::toDict'); | |
| 44130 | + } | |
| 44131 | + | |
| 44132 | + /** | |
| 44133 | + * @param ToDict | |
| 44134 | + * @return bool | |
| 44135 | + * @throws Exception | |
| 44136 | + */ | |
| 44137 | + public static function validateToDict(ToDict $value): bool { | |
| 44138 | + $value->validate(); | |
| 44139 | + return true; | |
| 44140 | + } | |
| 44141 | + | |
| 44142 | + /** | |
| 44143 | + * @throws Exception | |
| 44144 | + * @return ToDict | |
| 44145 | + */ | |
| 44146 | + public function getToDict(): ToDict { | |
| 44147 | + if (Obj5::validateToDict($this->toDict)) { | |
| 44148 | + return $this->toDict; | |
| 44149 | + } | |
| 44150 | + throw new Exception('never get to getToDict Obj5::toDict'); | |
| 44151 | + } | |
| 44152 | + | |
| 44153 | + /** | |
| 44154 | + * @return ToDict | |
| 44155 | + */ | |
| 44156 | + public static function sampleToDict(): ToDict { | |
| 44157 | + return ToDict::sample(); /*75:toDict*/ | |
| 43900 | 44158 | } |
| 43901 | 44159 | |
| 43902 | 44160 | /** |
| @@ -43944,7 +44202,7 @@ class Obj5 { | ||
| 43944 | 44202 | * @return ToJSON |
| 43945 | 44203 | */ |
| 43946 | 44204 | public static function sampleToJSON(): ToJSON { |
| 43947 | - return ToJSON::sample(); /*74:toJSON*/ | |
| 44205 | + return ToJSON::sample(); /*76:toJSON*/ | |
| 43948 | 44206 | } |
| 43949 | 44207 | |
| 43950 | 44208 | /** |
| @@ -43992,7 +44250,7 @@ class Obj5 { | ||
| 43992 | 44250 | * @return ToString |
| 43993 | 44251 | */ |
| 43994 | 44252 | public static function sampleToString(): ToString { |
| 43995 | - return ToString::sample(); /*75:toString*/ | |
| 44253 | + return ToString::sample(); /*77:toString*/ | |
| 43996 | 44254 | } |
| 43997 | 44255 | |
| 43998 | 44256 | /** |
| @@ -44040,7 +44298,7 @@ class Obj5 { | ||
| 44040 | 44298 | * @return TopLevelClass |
| 44041 | 44299 | */ |
| 44042 | 44300 | public static function sampleTopLevel(): TopLevelClass { |
| 44043 | - return TopLevelClass::sample(); /*76:topLevel*/ | |
| 44301 | + return TopLevelClass::sample(); /*78:topLevel*/ | |
| 44044 | 44302 | } |
| 44045 | 44303 | |
| 44046 | 44304 | /** |
| @@ -44088,7 +44346,7 @@ class Obj5 { | ||
| 44088 | 44346 | * @return Transient |
| 44089 | 44347 | */ |
| 44090 | 44348 | public static function sampleTransient(): Transient { |
| 44091 | - return Transient::sample(); /*77:transient*/ | |
| 44349 | + return Transient::sample(); /*79:transient*/ | |
| 44092 | 44350 | } |
| 44093 | 44351 | |
| 44094 | 44352 | /** |
| @@ -44136,7 +44394,7 @@ class Obj5 { | ||
| 44136 | 44394 | * @return TrueClass |
| 44137 | 44395 | */ |
| 44138 | 44396 | public static function sampleTrue(): TrueClass { |
| 44139 | - return TrueClass::sample(); /*78:true*/ | |
| 44397 | + return TrueClass::sample(); /*80:true*/ | |
| 44140 | 44398 | } |
| 44141 | 44399 | |
| 44142 | 44400 | /** |
| @@ -44184,7 +44442,7 @@ class Obj5 { | ||
| 44184 | 44442 | * @return TryClass |
| 44185 | 44443 | */ |
| 44186 | 44444 | public static function sampleTry(): TryClass { |
| 44187 | - return TryClass::sample(); /*79:try*/ | |
| 44445 | + return TryClass::sample(); /*81:try*/ | |
| 44188 | 44446 | } |
| 44189 | 44447 | |
| 44190 | 44448 | /** |
| @@ -44232,7 +44490,7 @@ class Obj5 { | ||
| 44232 | 44490 | * @return Type |
| 44233 | 44491 | */ |
| 44234 | 44492 | public static function sampleType(): Type { |
| 44235 | - return Type::sample(); /*80:type*/ | |
| 44493 | + return Type::sample(); /*82:type*/ | |
| 44236 | 44494 | } |
| 44237 | 44495 | |
| 44238 | 44496 | /** |
| @@ -44280,7 +44538,7 @@ class Obj5 { | ||
| 44280 | 44538 | * @return Typealias |
| 44281 | 44539 | */ |
| 44282 | 44540 | public static function sampleTypealias(): Typealias { |
| 44283 | - return Typealias::sample(); /*81:typealias*/ | |
| 44541 | + return Typealias::sample(); /*83:typealias*/ | |
| 44284 | 44542 | } |
| 44285 | 44543 | |
| 44286 | 44544 | /** |
| @@ -44328,7 +44586,7 @@ class Obj5 { | ||
| 44328 | 44586 | * @return Typedef |
| 44329 | 44587 | */ |
| 44330 | 44588 | public static function sampleTypedef(): Typedef { |
| 44331 | - return Typedef::sample(); /*82:typedef*/ | |
| 44589 | + return Typedef::sample(); /*84:typedef*/ | |
| 44332 | 44590 | } |
| 44333 | 44591 | |
| 44334 | 44592 | /** |
| @@ -44376,7 +44634,7 @@ class Obj5 { | ||
| 44376 | 44634 | * @return Typeid |
| 44377 | 44635 | */ |
| 44378 | 44636 | public static function sampleTypeid(): Typeid { |
| 44379 | - return Typeid::sample(); /*83:typeid*/ | |
| 44637 | + return Typeid::sample(); /*85:typeid*/ | |
| 44380 | 44638 | } |
| 44381 | 44639 | |
| 44382 | 44640 | /** |
| @@ -44424,7 +44682,7 @@ class Obj5 { | ||
| 44424 | 44682 | * @return Typename |
| 44425 | 44683 | */ |
| 44426 | 44684 | public static function sampleTypename(): Typename { |
| 44427 | - return Typename::sample(); /*84:typename*/ | |
| 44685 | + return Typename::sample(); /*86:typename*/ | |
| 44428 | 44686 | } |
| 44429 | 44687 | |
| 44430 | 44688 | /** |
| @@ -44472,7 +44730,7 @@ class Obj5 { | ||
| 44472 | 44730 | * @return Typeof |
| 44473 | 44731 | */ |
| 44474 | 44732 | public static function sampleTypeof(): Typeof { |
| 44475 | - return Typeof::sample(); /*85:typeof*/ | |
| 44733 | + return Typeof::sample(); /*87:typeof*/ | |
| 44476 | 44734 | } |
| 44477 | 44735 | |
| 44478 | 44736 | /** |
| @@ -44520,7 +44778,7 @@ class Obj5 { | ||
| 44520 | 44778 | * @return Uint |
| 44521 | 44779 | */ |
| 44522 | 44780 | public static function sampleUint(): Uint { |
| 44523 | - return Uint::sample(); /*86:uint*/ | |
| 44781 | + return Uint::sample(); /*88:uint*/ | |
| 44524 | 44782 | } |
| 44525 | 44783 | |
| 44526 | 44784 | /** |
| @@ -44568,7 +44826,7 @@ class Obj5 { | ||
| 44568 | 44826 | * @return Ulong |
| 44569 | 44827 | */ |
| 44570 | 44828 | public static function sampleUlong(): Ulong { |
| 44571 | - return Ulong::sample(); /*87:ulong*/ | |
| 44829 | + return Ulong::sample(); /*89:ulong*/ | |
| 44572 | 44830 | } |
| 44573 | 44831 | |
| 44574 | 44832 | /** |
| @@ -44616,7 +44874,7 @@ class Obj5 { | ||
| 44616 | 44874 | * @return Unchecked |
| 44617 | 44875 | */ |
| 44618 | 44876 | public static function sampleUnchecked(): Unchecked { |
| 44619 | - return Unchecked::sample(); /*88:unchecked*/ | |
| 44877 | + return Unchecked::sample(); /*90:unchecked*/ | |
| 44620 | 44878 | } |
| 44621 | 44879 | |
| 44622 | 44880 | /** |
| @@ -44664,7 +44922,7 @@ class Obj5 { | ||
| 44664 | 44922 | * @return Undefined |
| 44665 | 44923 | */ |
| 44666 | 44924 | public static function sampleUndefined(): Undefined { |
| 44667 | - return Undefined::sample(); /*89:undefined*/ | |
| 44925 | + return Undefined::sample(); /*91:undefined*/ | |
| 44668 | 44926 | } |
| 44669 | 44927 | |
| 44670 | 44928 | /** |
| @@ -44712,7 +44970,55 @@ class Obj5 { | ||
| 44712 | 44970 | * @return Union |
| 44713 | 44971 | */ |
| 44714 | 44972 | public static function sampleUnion(): Union { |
| 44715 | - return Union::sample(); /*90:union*/ | |
| 44973 | + return Union::sample(); /*92:union*/ | |
| 44974 | + } | |
| 44975 | + | |
| 44976 | + /** | |
| 44977 | + * @param stdClass $value | |
| 44978 | + * @throws Exception | |
| 44979 | + * @return UnmarshalJSON | |
| 44980 | + */ | |
| 44981 | + public static function fromUnmarshalJSON(stdClass $value): UnmarshalJSON { | |
| 44982 | + return UnmarshalJSON::from($value); /*class*/ | |
| 44983 | + } | |
| 44984 | + | |
| 44985 | + /** | |
| 44986 | + * @throws Exception | |
| 44987 | + * @return stdClass | |
| 44988 | + */ | |
| 44989 | + public function toUnmarshalJSON(): stdClass { | |
| 44990 | + if (Obj5::validateUnmarshalJSON($this->unmarshalJSON)) { | |
| 44991 | + return $this->unmarshalJSON->to(); /*class*/ | |
| 44992 | + } | |
| 44993 | + throw new Exception('never get to this Obj5::unmarshalJSON'); | |
| 44994 | + } | |
| 44995 | + | |
| 44996 | + /** | |
| 44997 | + * @param UnmarshalJSON | |
| 44998 | + * @return bool | |
| 44999 | + * @throws Exception | |
| 45000 | + */ | |
| 45001 | + public static function validateUnmarshalJSON(UnmarshalJSON $value): bool { | |
| 45002 | + $value->validate(); | |
| 45003 | + return true; | |
| 45004 | + } | |
| 45005 | + | |
| 45006 | + /** | |
| 45007 | + * @throws Exception | |
| 45008 | + * @return UnmarshalJSON | |
| 45009 | + */ | |
| 45010 | + public function getUnmarshalJSON(): UnmarshalJSON { | |
| 45011 | + if (Obj5::validateUnmarshalJSON($this->unmarshalJSON)) { | |
| 45012 | + return $this->unmarshalJSON; | |
| 45013 | + } | |
| 45014 | + throw new Exception('never get to getUnmarshalJSON Obj5::unmarshalJSON'); | |
| 45015 | + } | |
| 45016 | + | |
| 45017 | + /** | |
| 45018 | + * @return UnmarshalJSON | |
| 45019 | + */ | |
| 45020 | + public static function sampleUnmarshalJSON(): UnmarshalJSON { | |
| 45021 | + return UnmarshalJSON::sample(); /*93:unmarshalJSON*/ | |
| 44716 | 45022 | } |
| 44717 | 45023 | |
| 44718 | 45024 | /** |
| @@ -44760,7 +45066,7 @@ class Obj5 { | ||
| 44760 | 45066 | * @return Unowned |
| 44761 | 45067 | */ |
| 44762 | 45068 | public static function sampleUnowned(): Unowned { |
| 44763 | - return Unowned::sample(); /*91:unowned*/ | |
| 45069 | + return Unowned::sample(); /*94:unowned*/ | |
| 44764 | 45070 | } |
| 44765 | 45071 | |
| 44766 | 45072 | /** |
| @@ -44808,55 +45114,7 @@ class Obj5 { | ||
| 44808 | 45114 | * @return Unsafe |
| 44809 | 45115 | */ |
| 44810 | 45116 | public static function sampleUnsafe(): Unsafe { |
| 44811 | - return Unsafe::sample(); /*92:unsafe*/ | |
| 44812 | - } | |
| 44813 | - | |
| 44814 | - /** | |
| 44815 | - * @param stdClass $value | |
| 44816 | - * @throws Exception | |
| 44817 | - * @return Unsigned | |
| 44818 | - */ | |
| 44819 | - public static function fromUnsigned(stdClass $value): Unsigned { | |
| 44820 | - return Unsigned::from($value); /*class*/ | |
| 44821 | - } | |
| 44822 | - | |
| 44823 | - /** | |
| 44824 | - * @throws Exception | |
| 44825 | - * @return stdClass | |
| 44826 | - */ | |
| 44827 | - public function toUnsigned(): stdClass { | |
| 44828 | - if (Obj5::validateUnsigned($this->unsigned)) { | |
| 44829 | - return $this->unsigned->to(); /*class*/ | |
| 44830 | - } | |
| 44831 | - throw new Exception('never get to this Obj5::unsigned'); | |
| 44832 | - } | |
| 44833 | - | |
| 44834 | - /** | |
| 44835 | - * @param Unsigned | |
| 44836 | - * @return bool | |
| 44837 | - * @throws Exception | |
| 44838 | - */ | |
| 44839 | - public static function validateUnsigned(Unsigned $value): bool { | |
| 44840 | - $value->validate(); | |
| 44841 | - return true; | |
| 44842 | - } | |
| 44843 | - | |
| 44844 | - /** | |
| 44845 | - * @throws Exception | |
| 44846 | - * @return Unsigned | |
| 44847 | - */ | |
| 44848 | - public function getUnsigned(): Unsigned { | |
| 44849 | - if (Obj5::validateUnsigned($this->unsigned)) { | |
| 44850 | - return $this->unsigned; | |
| 44851 | - } | |
| 44852 | - throw new Exception('never get to getUnsigned Obj5::unsigned'); | |
| 44853 | - } | |
| 44854 | - | |
| 44855 | - /** | |
| 44856 | - * @return Unsigned | |
| 44857 | - */ | |
| 44858 | - public static function sampleUnsigned(): Unsigned { | |
| 44859 | - return Unsigned::sample(); /*93:unsigned*/ | |
| 45117 | + return Unsafe::sample(); /*95:unsafe*/ | |
| 44860 | 45118 | } |
| 44861 | 45119 | |
| 44862 | 45120 | /** |
| @@ -44904,55 +45162,7 @@ class Obj5 { | ||
| 44904 | 45162 | * @return UseSerializers |
| 44905 | 45163 | */ |
| 44906 | 45164 | public static function sampleUseSerializers(): UseSerializers { |
| 44907 | - return UseSerializers::sample(); /*94:useSerializers*/ | |
| 44908 | - } | |
| 44909 | - | |
| 44910 | - /** | |
| 44911 | - * @param stdClass $value | |
| 44912 | - * @throws Exception | |
| 44913 | - * @return Ushort | |
| 44914 | - */ | |
| 44915 | - public static function fromUshort(stdClass $value): Ushort { | |
| 44916 | - return Ushort::from($value); /*class*/ | |
| 44917 | - } | |
| 44918 | - | |
| 44919 | - /** | |
| 44920 | - * @throws Exception | |
| 44921 | - * @return stdClass | |
| 44922 | - */ | |
| 44923 | - public function toUshort(): stdClass { | |
| 44924 | - if (Obj5::validateUshort($this->ushort)) { | |
| 44925 | - return $this->ushort->to(); /*class*/ | |
| 44926 | - } | |
| 44927 | - throw new Exception('never get to this Obj5::ushort'); | |
| 44928 | - } | |
| 44929 | - | |
| 44930 | - /** | |
| 44931 | - * @param Ushort | |
| 44932 | - * @return bool | |
| 44933 | - * @throws Exception | |
| 44934 | - */ | |
| 44935 | - public static function validateUshort(Ushort $value): bool { | |
| 44936 | - $value->validate(); | |
| 44937 | - return true; | |
| 44938 | - } | |
| 44939 | - | |
| 44940 | - /** | |
| 44941 | - * @throws Exception | |
| 44942 | - * @return Ushort | |
| 44943 | - */ | |
| 44944 | - public function getUshort(): Ushort { | |
| 44945 | - if (Obj5::validateUshort($this->ushort)) { | |
| 44946 | - return $this->ushort; | |
| 44947 | - } | |
| 44948 | - throw new Exception('never get to getUshort Obj5::ushort'); | |
| 44949 | - } | |
| 44950 | - | |
| 44951 | - /** | |
| 44952 | - * @return Ushort | |
| 44953 | - */ | |
| 44954 | - public static function sampleUshort(): Ushort { | |
| 44955 | - return Ushort::sample(); /*95:ushort*/ | |
| 45165 | + return UseSerializers::sample(); /*96:useSerializers*/ | |
| 44956 | 45166 | } |
| 44957 | 45167 | |
| 44958 | 45168 | /** |
| @@ -44967,6 +45177,7 @@ class Obj5 { | ||
| 44967 | 45177 | || Obj5::validateObj5True($this->obj5True) |
| 44968 | 45178 | || Obj5::validateObj5Type($this->obj5Type) |
| 44969 | 45179 | || Obj5::validatePrimitiveKind($this->primitiveKind) |
| 45180 | + || Obj5::validateSelect($this->select) | |
| 44970 | 45181 | || Obj5::validateSelf($this->self) |
| 44971 | 45182 | || Obj5::validateSendable($this->sendable) |
| 44972 | 45183 | || Obj5::validateSerialDescriptor($this->serialDescriptor) |
| @@ -45003,6 +45214,7 @@ class Obj5 { | ||
| 45003 | 45214 | || Obj5::validateTimeOnly($this->timeOnly) |
| 45004 | 45215 | || Obj5::validateTimeOnlyConverter($this->timeOnlyConverter) |
| 45005 | 45216 | || Obj5::validateTimeZone($this->timeZone) |
| 45217 | + || Obj5::validateToDict($this->toDict) | |
| 45006 | 45218 | || Obj5::validateToJSON($this->toJSON) |
| 45007 | 45219 | || Obj5::validateToString($this->toString) |
| 45008 | 45220 | || Obj5::validateTopLevel($this->topLevel) |
| @@ -45020,11 +45232,10 @@ class Obj5 { | ||
| 45020 | 45232 | || Obj5::validateUnchecked($this->unchecked) |
| 45021 | 45233 | || Obj5::validateUndefined($this->undefined) |
| 45022 | 45234 | || Obj5::validateUnion($this->union) |
| 45235 | + || Obj5::validateUnmarshalJSON($this->unmarshalJSON) | |
| 45023 | 45236 | || Obj5::validateUnowned($this->unowned) |
| 45024 | 45237 | || Obj5::validateUnsafe($this->unsafe) |
| 45025 | - || Obj5::validateUnsigned($this->unsigned) | |
| 45026 | - || Obj5::validateUseSerializers($this->useSerializers) | |
| 45027 | - || Obj5::validateUshort($this->ushort); | |
| 45238 | + || Obj5::validateUseSerializers($this->useSerializers); | |
| 45028 | 45239 | } |
| 45029 | 45240 | |
| 45030 | 45241 | /** |
| @@ -45040,6 +45251,7 @@ class Obj5 { | ||
| 45040 | 45251 | $out->{'true'} = $this->toObj5True(); |
| 45041 | 45252 | $out->{'type'} = $this->toObj5Type(); |
| 45042 | 45253 | $out->{'PrimitiveKind'} = $this->toPrimitiveKind(); |
| 45254 | + $out->{'select'} = $this->toSelect(); | |
| 45043 | 45255 | $out->{'Self'} = $this->toSelf(); |
| 45044 | 45256 | $out->{'Sendable'} = $this->toSendable(); |
| 45045 | 45257 | $out->{'SerialDescriptor'} = $this->toSerialDescriptor(); |
| @@ -45076,6 +45288,7 @@ class Obj5 { | ||
| 45076 | 45288 | $out->{'TimeOnly'} = $this->toTimeOnly(); |
| 45077 | 45289 | $out->{'TimeOnlyConverter'} = $this->toTimeOnlyConverter(); |
| 45078 | 45290 | $out->{'TimeZone'} = $this->toTimeZone(); |
| 45291 | + $out->{'to_dict'} = $this->toToDict(); | |
| 45079 | 45292 | $out->{'to_json'} = $this->toToJSON(); |
| 45080 | 45293 | $out->{'toString'} = $this->toToString(); |
| 45081 | 45294 | $out->{'top_level'} = $this->toTopLevel(); |
| @@ -45093,11 +45306,10 @@ class Obj5 { | ||
| 45093 | 45306 | $out->{'unchecked'} = $this->toUnchecked(); |
| 45094 | 45307 | $out->{'undefined'} = $this->toUndefined(); |
| 45095 | 45308 | $out->{'union'} = $this->toUnion(); |
| 45309 | + $out->{'UnmarshalJSON'} = $this->toUnmarshalJSON(); | |
| 45096 | 45310 | $out->{'unowned'} = $this->toUnowned(); |
| 45097 | 45311 | $out->{'unsafe'} = $this->toUnsafe(); |
| 45098 | - $out->{'unsigned'} = $this->toUnsigned(); | |
| 45099 | 45312 | $out->{'UseSerializers'} = $this->toUseSerializers(); |
| 45100 | - $out->{'ushort'} = $this->toUshort(); | |
| 45101 | 45313 | return $out; |
| 45102 | 45314 | } |
| 45103 | 45315 | |
| @@ -45128,6 +45340,9 @@ class Obj5 { | ||
| 45128 | 45340 | if (!property_exists($obj, 'PrimitiveKind')) { |
| 45129 | 45341 | throw new Exception("Missing required property"); |
| 45130 | 45342 | } |
| 45343 | + if (!property_exists($obj, 'select')) { | |
| 45344 | + throw new Exception("Missing required property"); | |
| 45345 | + } | |
| 45131 | 45346 | if (!property_exists($obj, 'Self')) { |
| 45132 | 45347 | throw new Exception("Missing required property"); |
| 45133 | 45348 | } |
| @@ -45236,6 +45451,9 @@ class Obj5 { | ||
| 45236 | 45451 | if (!property_exists($obj, 'TimeZone')) { |
| 45237 | 45452 | throw new Exception("Missing required property"); |
| 45238 | 45453 | } |
| 45454 | + if (!property_exists($obj, 'to_dict')) { | |
| 45455 | + throw new Exception("Missing required property"); | |
| 45456 | + } | |
| 45239 | 45457 | if (!property_exists($obj, 'to_json')) { |
| 45240 | 45458 | throw new Exception("Missing required property"); |
| 45241 | 45459 | } |
| @@ -45287,21 +45505,18 @@ class Obj5 { | ||
| 45287 | 45505 | if (!property_exists($obj, 'union')) { |
| 45288 | 45506 | throw new Exception("Missing required property"); |
| 45289 | 45507 | } |
| 45290 | - if (!property_exists($obj, 'unowned')) { | |
| 45508 | + if (!property_exists($obj, 'UnmarshalJSON')) { | |
| 45291 | 45509 | throw new Exception("Missing required property"); |
| 45292 | 45510 | } |
| 45293 | - if (!property_exists($obj, 'unsafe')) { | |
| 45511 | + if (!property_exists($obj, 'unowned')) { | |
| 45294 | 45512 | throw new Exception("Missing required property"); |
| 45295 | 45513 | } |
| 45296 | - if (!property_exists($obj, 'unsigned')) { | |
| 45514 | + if (!property_exists($obj, 'unsafe')) { | |
| 45297 | 45515 | throw new Exception("Missing required property"); |
| 45298 | 45516 | } |
| 45299 | 45517 | if (!property_exists($obj, 'UseSerializers')) { |
| 45300 | 45518 | throw new Exception("Missing required property"); |
| 45301 | 45519 | } |
| 45302 | - if (!property_exists($obj, 'ushort')) { | |
| 45303 | - throw new Exception("Missing required property"); | |
| 45304 | - } | |
| 45305 | 45520 | return new Obj5( |
| 45306 | 45521 | Obj5::fromDummy($obj->{'dummy'}) |
| 45307 | 45522 | ,Obj5::fromKSerializer($obj->{'KSerializer'}) |
| @@ -45310,6 +45525,7 @@ class Obj5 { | ||
| 45310 | 45525 | ,Obj5::fromObj5True($obj->{'true'}) |
| 45311 | 45526 | ,Obj5::fromObj5Type($obj->{'type'}) |
| 45312 | 45527 | ,Obj5::fromPrimitiveKind($obj->{'PrimitiveKind'}) |
| 45528 | + ,Obj5::fromSelect($obj->{'select'}) | |
| 45313 | 45529 | ,Obj5::fromSelf($obj->{'Self'}) |
| 45314 | 45530 | ,Obj5::fromSendable($obj->{'Sendable'}) |
| 45315 | 45531 | ,Obj5::fromSerialDescriptor($obj->{'SerialDescriptor'}) |
| @@ -45346,6 +45562,7 @@ class Obj5 { | ||
| 45346 | 45562 | ,Obj5::fromTimeOnly($obj->{'TimeOnly'}) |
| 45347 | 45563 | ,Obj5::fromTimeOnlyConverter($obj->{'TimeOnlyConverter'}) |
| 45348 | 45564 | ,Obj5::fromTimeZone($obj->{'TimeZone'}) |
| 45565 | + ,Obj5::fromToDict($obj->{'to_dict'}) | |
| 45349 | 45566 | ,Obj5::fromToJSON($obj->{'to_json'}) |
| 45350 | 45567 | ,Obj5::fromToString($obj->{'toString'}) |
| 45351 | 45568 | ,Obj5::fromTopLevel($obj->{'top_level'}) |
| @@ -45363,11 +45580,10 @@ class Obj5 { | ||
| 45363 | 45580 | ,Obj5::fromUnchecked($obj->{'unchecked'}) |
| 45364 | 45581 | ,Obj5::fromUndefined($obj->{'undefined'}) |
| 45365 | 45582 | ,Obj5::fromUnion($obj->{'union'}) |
| 45583 | + ,Obj5::fromUnmarshalJSON($obj->{'UnmarshalJSON'}) | |
| 45366 | 45584 | ,Obj5::fromUnowned($obj->{'unowned'}) |
| 45367 | 45585 | ,Obj5::fromUnsafe($obj->{'unsafe'}) |
| 45368 | - ,Obj5::fromUnsigned($obj->{'unsigned'}) | |
| 45369 | 45586 | ,Obj5::fromUseSerializers($obj->{'UseSerializers'}) |
| 45370 | - ,Obj5::fromUshort($obj->{'ushort'}) | |
| 45371 | 45587 | ); |
| 45372 | 45588 | } |
| 45373 | 45589 | |
| @@ -45383,6 +45599,7 @@ class Obj5 { | ||
| 45383 | 45599 | ,Obj5::sampleObj5True() |
| 45384 | 45600 | ,Obj5::sampleObj5Type() |
| 45385 | 45601 | ,Obj5::samplePrimitiveKind() |
| 45602 | + ,Obj5::sampleSelect() | |
| 45386 | 45603 | ,Obj5::sampleSelf() |
| 45387 | 45604 | ,Obj5::sampleSendable() |
| 45388 | 45605 | ,Obj5::sampleSerialDescriptor() |
| @@ -45419,6 +45636,7 @@ class Obj5 { | ||
| 45419 | 45636 | ,Obj5::sampleTimeOnly() |
| 45420 | 45637 | ,Obj5::sampleTimeOnlyConverter() |
| 45421 | 45638 | ,Obj5::sampleTimeZone() |
| 45639 | + ,Obj5::sampleToDict() | |
| 45422 | 45640 | ,Obj5::sampleToJSON() |
| 45423 | 45641 | ,Obj5::sampleToString() |
| 45424 | 45642 | ,Obj5::sampleTopLevel() |
| @@ -45436,11 +45654,10 @@ class Obj5 { | ||
| 45436 | 45654 | ,Obj5::sampleUnchecked() |
| 45437 | 45655 | ,Obj5::sampleUndefined() |
| 45438 | 45656 | ,Obj5::sampleUnion() |
| 45657 | + ,Obj5::sampleUnmarshalJSON() | |
| 45439 | 45658 | ,Obj5::sampleUnowned() |
| 45440 | 45659 | ,Obj5::sampleUnsafe() |
| 45441 | - ,Obj5::sampleUnsigned() | |
| 45442 | 45660 | ,Obj5::sampleUseSerializers() |
| 45443 | - ,Obj5::sampleUshort() | |
| 45444 | 45661 | ); |
| 45445 | 45662 | } |
| 45446 | 45663 | } |
| @@ -46051,6 +46268,107 @@ class PrimitiveKind { | ||
| 46051 | 46268 | } |
| 46052 | 46269 | } |
| 46053 | 46270 | |
| 46271 | +// This is an autogenerated file:Select | |
| 46272 | + | |
| 46273 | +class Select { | |
| 46274 | + private int $select; // json:select Required | |
| 46275 | + | |
| 46276 | + /** | |
| 46277 | + * @param int $select | |
| 46278 | + */ | |
| 46279 | + public function __construct(int $select) { | |
| 46280 | + $this->select = $select; | |
| 46281 | + } | |
| 46282 | + | |
| 46283 | + /** | |
| 46284 | + * @param int $value | |
| 46285 | + * @throws Exception | |
| 46286 | + * @return int | |
| 46287 | + */ | |
| 46288 | + public static function fromSelect(int $value): int { | |
| 46289 | + return $value; /*int*/ | |
| 46290 | + } | |
| 46291 | + | |
| 46292 | + /** | |
| 46293 | + * @throws Exception | |
| 46294 | + * @return int | |
| 46295 | + */ | |
| 46296 | + public function toSelect(): int { | |
| 46297 | + if (Select::validateSelect($this->select)) { | |
| 46298 | + return $this->select; /*int*/ | |
| 46299 | + } | |
| 46300 | + throw new Exception('never get to this Select::select'); | |
| 46301 | + } | |
| 46302 | + | |
| 46303 | + /** | |
| 46304 | + * @param int | |
| 46305 | + * @return bool | |
| 46306 | + * @throws Exception | |
| 46307 | + */ | |
| 46308 | + public static function validateSelect(int $value): bool { | |
| 46309 | + return true; | |
| 46310 | + } | |
| 46311 | + | |
| 46312 | + /** | |
| 46313 | + * @throws Exception | |
| 46314 | + * @return int | |
| 46315 | + */ | |
| 46316 | + public function getSelect(): int { | |
| 46317 | + if (Select::validateSelect($this->select)) { | |
| 46318 | + return $this->select; | |
| 46319 | + } | |
| 46320 | + throw new Exception('never get to getSelect Select::select'); | |
| 46321 | + } | |
| 46322 | + | |
| 46323 | + /** | |
| 46324 | + * @return int | |
| 46325 | + */ | |
| 46326 | + public static function sampleSelect(): int { | |
| 46327 | + return 31; /*31:select*/ | |
| 46328 | + } | |
| 46329 | + | |
| 46330 | + /** | |
| 46331 | + * @throws Exception | |
| 46332 | + * @return bool | |
| 46333 | + */ | |
| 46334 | + public function validate(): bool { | |
| 46335 | + return Select::validateSelect($this->select); | |
| 46336 | + } | |
| 46337 | + | |
| 46338 | + /** | |
| 46339 | + * @return stdClass | |
| 46340 | + * @throws Exception | |
| 46341 | + */ | |
| 46342 | + public function to(): stdClass { | |
| 46343 | + $out = new stdClass(); | |
| 46344 | + $out->{'select'} = $this->toSelect(); | |
| 46345 | + return $out; | |
| 46346 | + } | |
| 46347 | + | |
| 46348 | + /** | |
| 46349 | + * @param stdClass $obj | |
| 46350 | + * @return Select | |
| 46351 | + * @throws Exception | |
| 46352 | + */ | |
| 46353 | + public static function from(stdClass $obj): Select { | |
| 46354 | + if (!property_exists($obj, 'select')) { | |
| 46355 | + throw new Exception("Missing required property"); | |
| 46356 | + } | |
| 46357 | + return new Select( | |
| 46358 | + Select::fromSelect($obj->{'select'}) | |
| 46359 | + ); | |
| 46360 | + } | |
| 46361 | + | |
| 46362 | + /** | |
| 46363 | + * @return Select | |
| 46364 | + */ | |
| 46365 | + public static function sample(): Select { | |
| 46366 | + return new Select( | |
| 46367 | + Select::sampleSelect() | |
| 46368 | + ); | |
| 46369 | + } | |
| 46370 | +} | |
| 46371 | + | |
| 46054 | 46372 | // This is an autogenerated file:SelfClass |
| 46055 | 46373 | |
| 46056 | 46374 | class SelfClass { |
| @@ -49687,6 +50005,107 @@ class TimeZone { | ||
| 49687 | 50005 | } |
| 49688 | 50006 | } |
| 49689 | 50007 | |
| 50008 | +// This is an autogenerated file:ToDict | |
| 50009 | + | |
| 50010 | +class ToDict { | |
| 50011 | + private int $toDict; // json:to_dict Required | |
| 50012 | + | |
| 50013 | + /** | |
| 50014 | + * @param int $toDict | |
| 50015 | + */ | |
| 50016 | + public function __construct(int $toDict) { | |
| 50017 | + $this->toDict = $toDict; | |
| 50018 | + } | |
| 50019 | + | |
| 50020 | + /** | |
| 50021 | + * @param int $value | |
| 50022 | + * @throws Exception | |
| 50023 | + * @return int | |
| 50024 | + */ | |
| 50025 | + public static function fromToDict(int $value): int { | |
| 50026 | + return $value; /*int*/ | |
| 50027 | + } | |
| 50028 | + | |
| 50029 | + /** | |
| 50030 | + * @throws Exception | |
| 50031 | + * @return int | |
| 50032 | + */ | |
| 50033 | + public function toToDict(): int { | |
| 50034 | + if (ToDict::validateToDict($this->toDict)) { | |
| 50035 | + return $this->toDict; /*int*/ | |
| 50036 | + } | |
| 50037 | + throw new Exception('never get to this ToDict::toDict'); | |
| 50038 | + } | |
| 50039 | + | |
| 50040 | + /** | |
| 50041 | + * @param int | |
| 50042 | + * @return bool | |
| 50043 | + * @throws Exception | |
| 50044 | + */ | |
| 50045 | + public static function validateToDict(int $value): bool { | |
| 50046 | + return true; | |
| 50047 | + } | |
| 50048 | + | |
| 50049 | + /** | |
| 50050 | + * @throws Exception | |
| 50051 | + * @return int | |
| 50052 | + */ | |
| 50053 | + public function getToDict(): int { | |
| 50054 | + if (ToDict::validateToDict($this->toDict)) { | |
| 50055 | + return $this->toDict; | |
| 50056 | + } | |
| 50057 | + throw new Exception('never get to getToDict ToDict::toDict'); | |
| 50058 | + } | |
| 50059 | + | |
| 50060 | + /** | |
| 50061 | + * @return int | |
| 50062 | + */ | |
| 50063 | + public static function sampleToDict(): int { | |
| 50064 | + return 31; /*31:toDict*/ | |
| 50065 | + } | |
| 50066 | + | |
| 50067 | + /** | |
| 50068 | + * @throws Exception | |
| 50069 | + * @return bool | |
| 50070 | + */ | |
| 50071 | + public function validate(): bool { | |
| 50072 | + return ToDict::validateToDict($this->toDict); | |
| 50073 | + } | |
| 50074 | + | |
| 50075 | + /** | |
| 50076 | + * @return stdClass | |
| 50077 | + * @throws Exception | |
| 50078 | + */ | |
| 50079 | + public function to(): stdClass { | |
| 50080 | + $out = new stdClass(); | |
| 50081 | + $out->{'to_dict'} = $this->toToDict(); | |
| 50082 | + return $out; | |
| 50083 | + } | |
| 50084 | + | |
| 50085 | + /** | |
| 50086 | + * @param stdClass $obj | |
| 50087 | + * @return ToDict | |
| 50088 | + * @throws Exception | |
| 50089 | + */ | |
| 50090 | + public static function from(stdClass $obj): ToDict { | |
| 50091 | + if (!property_exists($obj, 'to_dict')) { | |
| 50092 | + throw new Exception("Missing required property"); | |
| 50093 | + } | |
| 50094 | + return new ToDict( | |
| 50095 | + ToDict::fromToDict($obj->{'to_dict'}) | |
| 50096 | + ); | |
| 50097 | + } | |
| 50098 | + | |
| 50099 | + /** | |
| 50100 | + * @return ToDict | |
| 50101 | + */ | |
| 50102 | + public static function sample(): ToDict { | |
| 50103 | + return new ToDict( | |
| 50104 | + ToDict::sampleToDict() | |
| 50105 | + ); | |
| 50106 | + } | |
| 50107 | +} | |
| 50108 | + | |
| 49690 | 50109 | // This is an autogenerated file:ToJSON |
| 49691 | 50110 | |
| 49692 | 50111 | class ToJSON { |
| @@ -51404,16 +51823,16 @@ class Union { | ||
| 51404 | 51823 | } |
| 51405 | 51824 | } |
| 51406 | 51825 | |
| 51407 | -// This is an autogenerated file:Unowned | |
| 51826 | +// This is an autogenerated file:UnmarshalJSON | |
| 51408 | 51827 | |
| 51409 | -class Unowned { | |
| 51410 | - private int $unowned; // json:unowned Required | |
| 51828 | +class UnmarshalJSON { | |
| 51829 | + private int $unmarshalJSON; // json:UnmarshalJSON Required | |
| 51411 | 51830 | |
| 51412 | 51831 | /** |
| 51413 | - * @param int $unowned | |
| 51832 | + * @param int $unmarshalJSON | |
| 51414 | 51833 | */ |
| 51415 | - public function __construct(int $unowned) { | |
| 51416 | - $this->unowned = $unowned; | |
| 51834 | + public function __construct(int $unmarshalJSON) { | |
| 51835 | + $this->unmarshalJSON = $unmarshalJSON; | |
| 51417 | 51836 | } |
| 51418 | 51837 | |
| 51419 | 51838 | /** |
| @@ -51421,7 +51840,7 @@ class Unowned { | ||
| 51421 | 51840 | * @throws Exception |
| 51422 | 51841 | * @return int |
| 51423 | 51842 | */ |
| 51424 | - public static function fromUnowned(int $value): int { | |
| 51843 | + public static function fromUnmarshalJSON(int $value): int { | |
| 51425 | 51844 | return $value; /*int*/ |
| 51426 | 51845 | } |
| 51427 | 51846 | |
| @@ -51429,11 +51848,11 @@ class Unowned { | ||
| 51429 | 51848 | * @throws Exception |
| 51430 | 51849 | * @return int |
| 51431 | 51850 | */ |
| 51432 | - public function toUnowned(): int { | |
| 51433 | - if (Unowned::validateUnowned($this->unowned)) { | |
| 51434 | - return $this->unowned; /*int*/ | |
| 51851 | + public function toUnmarshalJSON(): int { | |
| 51852 | + if (UnmarshalJSON::validateUnmarshalJSON($this->unmarshalJSON)) { | |
| 51853 | + return $this->unmarshalJSON; /*int*/ | |
| 51435 | 51854 | } |
| 51436 | - throw new Exception('never get to this Unowned::unowned'); | |
| 51855 | + throw new Exception('never get to this UnmarshalJSON::unmarshalJSON'); | |
| 51437 | 51856 | } |
| 51438 | 51857 | |
| 51439 | 51858 | /** |
| @@ -51441,7 +51860,7 @@ class Unowned { | ||
| 51441 | 51860 | * @return bool |
| 51442 | 51861 | * @throws Exception |
| 51443 | 51862 | */ |
| 51444 | - public static function validateUnowned(int $value): bool { | |
| 51863 | + public static function validateUnmarshalJSON(int $value): bool { | |
| 51445 | 51864 | return true; |
| 51446 | 51865 | } |
| 51447 | 51866 | |
| @@ -51449,18 +51868,18 @@ class Unowned { | ||
| 51449 | 51868 | * @throws Exception |
| 51450 | 51869 | * @return int |
| 51451 | 51870 | */ |
| 51452 | - public function getUnowned(): int { | |
| 51453 | - if (Unowned::validateUnowned($this->unowned)) { | |
| 51454 | - return $this->unowned; | |
| 51871 | + public function getUnmarshalJSON(): int { | |
| 51872 | + if (UnmarshalJSON::validateUnmarshalJSON($this->unmarshalJSON)) { | |
| 51873 | + return $this->unmarshalJSON; | |
| 51455 | 51874 | } |
| 51456 | - throw new Exception('never get to getUnowned Unowned::unowned'); | |
| 51875 | + throw new Exception('never get to getUnmarshalJSON UnmarshalJSON::unmarshalJSON'); | |
| 51457 | 51876 | } |
| 51458 | 51877 | |
| 51459 | 51878 | /** |
| 51460 | 51879 | * @return int |
| 51461 | 51880 | */ |
| 51462 | - public static function sampleUnowned(): int { | |
| 51463 | - return 31; /*31:unowned*/ | |
| 51881 | + public static function sampleUnmarshalJSON(): int { | |
| 51882 | + return 31; /*31:unmarshalJSON*/ | |
| 51464 | 51883 | } |
| 51465 | 51884 | |
| 51466 | 51885 | /** |
| @@ -51468,7 +51887,7 @@ class Unowned { | ||
| 51468 | 51887 | * @return bool |
| 51469 | 51888 | */ |
| 51470 | 51889 | public function validate(): bool { |
| 51471 | - return Unowned::validateUnowned($this->unowned); | |
| 51890 | + return UnmarshalJSON::validateUnmarshalJSON($this->unmarshalJSON); | |
| 51472 | 51891 | } |
| 51473 | 51892 | |
| 51474 | 51893 | /** |
| @@ -51477,44 +51896,44 @@ class Unowned { | ||
| 51477 | 51896 | */ |
| 51478 | 51897 | public function to(): stdClass { |
| 51479 | 51898 | $out = new stdClass(); |
| 51480 | - $out->{'unowned'} = $this->toUnowned(); | |
| 51899 | + $out->{'UnmarshalJSON'} = $this->toUnmarshalJSON(); | |
| 51481 | 51900 | return $out; |
| 51482 | 51901 | } |
| 51483 | 51902 | |
| 51484 | 51903 | /** |
| 51485 | 51904 | * @param stdClass $obj |
| 51486 | - * @return Unowned | |
| 51905 | + * @return UnmarshalJSON | |
| 51487 | 51906 | * @throws Exception |
| 51488 | 51907 | */ |
| 51489 | - public static function from(stdClass $obj): Unowned { | |
| 51490 | - if (!property_exists($obj, 'unowned')) { | |
| 51908 | + public static function from(stdClass $obj): UnmarshalJSON { | |
| 51909 | + if (!property_exists($obj, 'UnmarshalJSON')) { | |
| 51491 | 51910 | throw new Exception("Missing required property"); |
| 51492 | 51911 | } |
| 51493 | - return new Unowned( | |
| 51494 | - Unowned::fromUnowned($obj->{'unowned'}) | |
| 51912 | + return new UnmarshalJSON( | |
| 51913 | + UnmarshalJSON::fromUnmarshalJSON($obj->{'UnmarshalJSON'}) | |
| 51495 | 51914 | ); |
| 51496 | 51915 | } |
| 51497 | 51916 | |
| 51498 | 51917 | /** |
| 51499 | - * @return Unowned | |
| 51918 | + * @return UnmarshalJSON | |
| 51500 | 51919 | */ |
| 51501 | - public static function sample(): Unowned { | |
| 51502 | - return new Unowned( | |
| 51503 | - Unowned::sampleUnowned() | |
| 51920 | + public static function sample(): UnmarshalJSON { | |
| 51921 | + return new UnmarshalJSON( | |
| 51922 | + UnmarshalJSON::sampleUnmarshalJSON() | |
| 51504 | 51923 | ); |
| 51505 | 51924 | } |
| 51506 | 51925 | } |
| 51507 | 51926 | |
| 51508 | -// This is an autogenerated file:Unsafe | |
| 51927 | +// This is an autogenerated file:Unowned | |
| 51509 | 51928 | |
| 51510 | -class Unsafe { | |
| 51511 | - private int $unsafe; // json:unsafe Required | |
| 51929 | +class Unowned { | |
| 51930 | + private int $unowned; // json:unowned Required | |
| 51512 | 51931 | |
| 51513 | 51932 | /** |
| 51514 | - * @param int $unsafe | |
| 51933 | + * @param int $unowned | |
| 51515 | 51934 | */ |
| 51516 | - public function __construct(int $unsafe) { | |
| 51517 | - $this->unsafe = $unsafe; | |
| 51935 | + public function __construct(int $unowned) { | |
| 51936 | + $this->unowned = $unowned; | |
| 51518 | 51937 | } |
| 51519 | 51938 | |
| 51520 | 51939 | /** |
| @@ -51522,7 +51941,7 @@ class Unsafe { | ||
| 51522 | 51941 | * @throws Exception |
| 51523 | 51942 | * @return int |
| 51524 | 51943 | */ |
| 51525 | - public static function fromUnsafe(int $value): int { | |
| 51944 | + public static function fromUnowned(int $value): int { | |
| 51526 | 51945 | return $value; /*int*/ |
| 51527 | 51946 | } |
| 51528 | 51947 | |
| @@ -51530,11 +51949,11 @@ class Unsafe { | ||
| 51530 | 51949 | * @throws Exception |
| 51531 | 51950 | * @return int |
| 51532 | 51951 | */ |
| 51533 | - public function toUnsafe(): int { | |
| 51534 | - if (Unsafe::validateUnsafe($this->unsafe)) { | |
| 51535 | - return $this->unsafe; /*int*/ | |
| 51952 | + public function toUnowned(): int { | |
| 51953 | + if (Unowned::validateUnowned($this->unowned)) { | |
| 51954 | + return $this->unowned; /*int*/ | |
| 51536 | 51955 | } |
| 51537 | - throw new Exception('never get to this Unsafe::unsafe'); | |
| 51956 | + throw new Exception('never get to this Unowned::unowned'); | |
| 51538 | 51957 | } |
| 51539 | 51958 | |
| 51540 | 51959 | /** |
| @@ -51542,7 +51961,7 @@ class Unsafe { | ||
| 51542 | 51961 | * @return bool |
| 51543 | 51962 | * @throws Exception |
| 51544 | 51963 | */ |
| 51545 | - public static function validateUnsafe(int $value): bool { | |
| 51964 | + public static function validateUnowned(int $value): bool { | |
| 51546 | 51965 | return true; |
| 51547 | 51966 | } |
| 51548 | 51967 | |
| @@ -51550,18 +51969,18 @@ class Unsafe { | ||
| 51550 | 51969 | * @throws Exception |
| 51551 | 51970 | * @return int |
| 51552 | 51971 | */ |
| 51553 | - public function getUnsafe(): int { | |
| 51554 | - if (Unsafe::validateUnsafe($this->unsafe)) { | |
| 51555 | - return $this->unsafe; | |
| 51972 | + public function getUnowned(): int { | |
| 51973 | + if (Unowned::validateUnowned($this->unowned)) { | |
| 51974 | + return $this->unowned; | |
| 51556 | 51975 | } |
| 51557 | - throw new Exception('never get to getUnsafe Unsafe::unsafe'); | |
| 51976 | + throw new Exception('never get to getUnowned Unowned::unowned'); | |
| 51558 | 51977 | } |
| 51559 | 51978 | |
| 51560 | 51979 | /** |
| 51561 | 51980 | * @return int |
| 51562 | 51981 | */ |
| 51563 | - public static function sampleUnsafe(): int { | |
| 51564 | - return 31; /*31:unsafe*/ | |
| 51982 | + public static function sampleUnowned(): int { | |
| 51983 | + return 31; /*31:unowned*/ | |
| 51565 | 51984 | } |
| 51566 | 51985 | |
| 51567 | 51986 | /** |
| @@ -51569,7 +51988,7 @@ class Unsafe { | ||
| 51569 | 51988 | * @return bool |
| 51570 | 51989 | */ |
| 51571 | 51990 | public function validate(): bool { |
| 51572 | - return Unsafe::validateUnsafe($this->unsafe); | |
| 51991 | + return Unowned::validateUnowned($this->unowned); | |
| 51573 | 51992 | } |
| 51574 | 51993 | |
| 51575 | 51994 | /** |
| @@ -51578,44 +51997,44 @@ class Unsafe { | ||
| 51578 | 51997 | */ |
| 51579 | 51998 | public function to(): stdClass { |
| 51580 | 51999 | $out = new stdClass(); |
| 51581 | - $out->{'unsafe'} = $this->toUnsafe(); | |
| 52000 | + $out->{'unowned'} = $this->toUnowned(); | |
| 51582 | 52001 | return $out; |
| 51583 | 52002 | } |
| 51584 | 52003 | |
| 51585 | 52004 | /** |
| 51586 | 52005 | * @param stdClass $obj |
| 51587 | - * @return Unsafe | |
| 52006 | + * @return Unowned | |
| 51588 | 52007 | * @throws Exception |
| 51589 | 52008 | */ |
| 51590 | - public static function from(stdClass $obj): Unsafe { | |
| 51591 | - if (!property_exists($obj, 'unsafe')) { | |
| 52009 | + public static function from(stdClass $obj): Unowned { | |
| 52010 | + if (!property_exists($obj, 'unowned')) { | |
| 51592 | 52011 | throw new Exception("Missing required property"); |
| 51593 | 52012 | } |
| 51594 | - return new Unsafe( | |
| 51595 | - Unsafe::fromUnsafe($obj->{'unsafe'}) | |
| 52013 | + return new Unowned( | |
| 52014 | + Unowned::fromUnowned($obj->{'unowned'}) | |
| 51596 | 52015 | ); |
| 51597 | 52016 | } |
| 51598 | 52017 | |
| 51599 | 52018 | /** |
| 51600 | - * @return Unsafe | |
| 52019 | + * @return Unowned | |
| 51601 | 52020 | */ |
| 51602 | - public static function sample(): Unsafe { | |
| 51603 | - return new Unsafe( | |
| 51604 | - Unsafe::sampleUnsafe() | |
| 52021 | + public static function sample(): Unowned { | |
| 52022 | + return new Unowned( | |
| 52023 | + Unowned::sampleUnowned() | |
| 51605 | 52024 | ); |
| 51606 | 52025 | } |
| 51607 | 52026 | } |
| 51608 | 52027 | |
| 51609 | -// This is an autogenerated file:Unsigned | |
| 52028 | +// This is an autogenerated file:Unsafe | |
| 51610 | 52029 | |
| 51611 | -class Unsigned { | |
| 51612 | - private int $unsigned; // json:unsigned Required | |
| 52030 | +class Unsafe { | |
| 52031 | + private int $unsafe; // json:unsafe Required | |
| 51613 | 52032 | |
| 51614 | 52033 | /** |
| 51615 | - * @param int $unsigned | |
| 52034 | + * @param int $unsafe | |
| 51616 | 52035 | */ |
| 51617 | - public function __construct(int $unsigned) { | |
| 51618 | - $this->unsigned = $unsigned; | |
| 52036 | + public function __construct(int $unsafe) { | |
| 52037 | + $this->unsafe = $unsafe; | |
| 51619 | 52038 | } |
| 51620 | 52039 | |
| 51621 | 52040 | /** |
| @@ -51623,7 +52042,7 @@ class Unsigned { | ||
| 51623 | 52042 | * @throws Exception |
| 51624 | 52043 | * @return int |
| 51625 | 52044 | */ |
| 51626 | - public static function fromUnsigned(int $value): int { | |
| 52045 | + public static function fromUnsafe(int $value): int { | |
| 51627 | 52046 | return $value; /*int*/ |
| 51628 | 52047 | } |
| 51629 | 52048 | |
| @@ -51631,11 +52050,11 @@ class Unsigned { | ||
| 51631 | 52050 | * @throws Exception |
| 51632 | 52051 | * @return int |
| 51633 | 52052 | */ |
| 51634 | - public function toUnsigned(): int { | |
| 51635 | - if (Unsigned::validateUnsigned($this->unsigned)) { | |
| 51636 | - return $this->unsigned; /*int*/ | |
| 52053 | + public function toUnsafe(): int { | |
| 52054 | + if (Unsafe::validateUnsafe($this->unsafe)) { | |
| 52055 | + return $this->unsafe; /*int*/ | |
| 51637 | 52056 | } |
| 51638 | - throw new Exception('never get to this Unsigned::unsigned'); | |
| 52057 | + throw new Exception('never get to this Unsafe::unsafe'); | |
| 51639 | 52058 | } |
| 51640 | 52059 | |
| 51641 | 52060 | /** |
| @@ -51643,7 +52062,7 @@ class Unsigned { | ||
| 51643 | 52062 | * @return bool |
| 51644 | 52063 | * @throws Exception |
| 51645 | 52064 | */ |
| 51646 | - public static function validateUnsigned(int $value): bool { | |
| 52065 | + public static function validateUnsafe(int $value): bool { | |
| 51647 | 52066 | return true; |
| 51648 | 52067 | } |
| 51649 | 52068 | |
| @@ -51651,18 +52070,18 @@ class Unsigned { | ||
| 51651 | 52070 | * @throws Exception |
| 51652 | 52071 | * @return int |
| 51653 | 52072 | */ |
| 51654 | - public function getUnsigned(): int { | |
| 51655 | - if (Unsigned::validateUnsigned($this->unsigned)) { | |
| 51656 | - return $this->unsigned; | |
| 52073 | + public function getUnsafe(): int { | |
| 52074 | + if (Unsafe::validateUnsafe($this->unsafe)) { | |
| 52075 | + return $this->unsafe; | |
| 51657 | 52076 | } |
| 51658 | - throw new Exception('never get to getUnsigned Unsigned::unsigned'); | |
| 52077 | + throw new Exception('never get to getUnsafe Unsafe::unsafe'); | |
| 51659 | 52078 | } |
| 51660 | 52079 | |
| 51661 | 52080 | /** |
| 51662 | 52081 | * @return int |
| 51663 | 52082 | */ |
| 51664 | - public static function sampleUnsigned(): int { | |
| 51665 | - return 31; /*31:unsigned*/ | |
| 52083 | + public static function sampleUnsafe(): int { | |
| 52084 | + return 31; /*31:unsafe*/ | |
| 51666 | 52085 | } |
| 51667 | 52086 | |
| 51668 | 52087 | /** |
| @@ -51670,7 +52089,7 @@ class Unsigned { | ||
| 51670 | 52089 | * @return bool |
| 51671 | 52090 | */ |
| 51672 | 52091 | public function validate(): bool { |
| 51673 | - return Unsigned::validateUnsigned($this->unsigned); | |
| 52092 | + return Unsafe::validateUnsafe($this->unsafe); | |
| 51674 | 52093 | } |
| 51675 | 52094 | |
| 51676 | 52095 | /** |
| @@ -51679,30 +52098,30 @@ class Unsigned { | ||
| 51679 | 52098 | */ |
| 51680 | 52099 | public function to(): stdClass { |
| 51681 | 52100 | $out = new stdClass(); |
| 51682 | - $out->{'unsigned'} = $this->toUnsigned(); | |
| 52101 | + $out->{'unsafe'} = $this->toUnsafe(); | |
| 51683 | 52102 | return $out; |
| 51684 | 52103 | } |
| 51685 | 52104 | |
| 51686 | 52105 | /** |
| 51687 | 52106 | * @param stdClass $obj |
| 51688 | - * @return Unsigned | |
| 52107 | + * @return Unsafe | |
| 51689 | 52108 | * @throws Exception |
| 51690 | 52109 | */ |
| 51691 | - public static function from(stdClass $obj): Unsigned { | |
| 51692 | - if (!property_exists($obj, 'unsigned')) { | |
| 52110 | + public static function from(stdClass $obj): Unsafe { | |
| 52111 | + if (!property_exists($obj, 'unsafe')) { | |
| 51693 | 52112 | throw new Exception("Missing required property"); |
| 51694 | 52113 | } |
| 51695 | - return new Unsigned( | |
| 51696 | - Unsigned::fromUnsigned($obj->{'unsigned'}) | |
| 52114 | + return new Unsafe( | |
| 52115 | + Unsafe::fromUnsafe($obj->{'unsafe'}) | |
| 51697 | 52116 | ); |
| 51698 | 52117 | } |
| 51699 | 52118 | |
| 51700 | 52119 | /** |
| 51701 | - * @return Unsigned | |
| 52120 | + * @return Unsafe | |
| 51702 | 52121 | */ |
| 51703 | - public static function sample(): Unsigned { | |
| 51704 | - return new Unsigned( | |
| 51705 | - Unsigned::sampleUnsigned() | |
| 52122 | + public static function sample(): Unsafe { | |
| 52123 | + return new Unsafe( | |
| 52124 | + Unsafe::sampleUnsafe() | |
| 51706 | 52125 | ); |
| 51707 | 52126 | } |
| 51708 | 52127 | } |
| @@ -51808,111 +52227,12 @@ class UseSerializers { | ||
| 51808 | 52227 | } |
| 51809 | 52228 | } |
| 51810 | 52229 | |
| 51811 | -// This is an autogenerated file:Ushort | |
| 51812 | - | |
| 51813 | -class Ushort { | |
| 51814 | - private int $ushort; // json:ushort Required | |
| 51815 | - | |
| 51816 | - /** | |
| 51817 | - * @param int $ushort | |
| 51818 | - */ | |
| 51819 | - public function __construct(int $ushort) { | |
| 51820 | - $this->ushort = $ushort; | |
| 51821 | - } | |
| 51822 | - | |
| 51823 | - /** | |
| 51824 | - * @param int $value | |
| 51825 | - * @throws Exception | |
| 51826 | - * @return int | |
| 51827 | - */ | |
| 51828 | - public static function fromUshort(int $value): int { | |
| 51829 | - return $value; /*int*/ | |
| 51830 | - } | |
| 51831 | - | |
| 51832 | - /** | |
| 51833 | - * @throws Exception | |
| 51834 | - * @return int | |
| 51835 | - */ | |
| 51836 | - public function toUshort(): int { | |
| 51837 | - if (Ushort::validateUshort($this->ushort)) { | |
| 51838 | - return $this->ushort; /*int*/ | |
| 51839 | - } | |
| 51840 | - throw new Exception('never get to this Ushort::ushort'); | |
| 51841 | - } | |
| 51842 | - | |
| 51843 | - /** | |
| 51844 | - * @param int | |
| 51845 | - * @return bool | |
| 51846 | - * @throws Exception | |
| 51847 | - */ | |
| 51848 | - public static function validateUshort(int $value): bool { | |
| 51849 | - return true; | |
| 51850 | - } | |
| 51851 | - | |
| 51852 | - /** | |
| 51853 | - * @throws Exception | |
| 51854 | - * @return int | |
| 51855 | - */ | |
| 51856 | - public function getUshort(): int { | |
| 51857 | - if (Ushort::validateUshort($this->ushort)) { | |
| 51858 | - return $this->ushort; | |
| 51859 | - } | |
| 51860 | - throw new Exception('never get to getUshort Ushort::ushort'); | |
| 51861 | - } | |
| 51862 | - | |
| 51863 | - /** | |
| 51864 | - * @return int | |
| 51865 | - */ | |
| 51866 | - public static function sampleUshort(): int { | |
| 51867 | - return 31; /*31:ushort*/ | |
| 51868 | - } | |
| 51869 | - | |
| 51870 | - /** | |
| 51871 | - * @throws Exception | |
| 51872 | - * @return bool | |
| 51873 | - */ | |
| 51874 | - public function validate(): bool { | |
| 51875 | - return Ushort::validateUshort($this->ushort); | |
| 51876 | - } | |
| 51877 | - | |
| 51878 | - /** | |
| 51879 | - * @return stdClass | |
| 51880 | - * @throws Exception | |
| 51881 | - */ | |
| 51882 | - public function to(): stdClass { | |
| 51883 | - $out = new stdClass(); | |
| 51884 | - $out->{'ushort'} = $this->toUshort(); | |
| 51885 | - return $out; | |
| 51886 | - } | |
| 51887 | - | |
| 51888 | - /** | |
| 51889 | - * @param stdClass $obj | |
| 51890 | - * @return Ushort | |
| 51891 | - * @throws Exception | |
| 51892 | - */ | |
| 51893 | - public static function from(stdClass $obj): Ushort { | |
| 51894 | - if (!property_exists($obj, 'ushort')) { | |
| 51895 | - throw new Exception("Missing required property"); | |
| 51896 | - } | |
| 51897 | - return new Ushort( | |
| 51898 | - Ushort::fromUshort($obj->{'ushort'}) | |
| 51899 | - ); | |
| 51900 | - } | |
| 51901 | - | |
| 51902 | - /** | |
| 51903 | - * @return Ushort | |
| 51904 | - */ | |
| 51905 | - public static function sample(): Ushort { | |
| 51906 | - return new Ushort( | |
| 51907 | - Ushort::sampleUshort() | |
| 51908 | - ); | |
| 51909 | - } | |
| 51910 | -} | |
| 51911 | - | |
| 51912 | 52230 | // This is an autogenerated file:Obj6 |
| 51913 | 52231 | |
| 51914 | 52232 | class Obj6 { |
| 51915 | 52233 | private int $dummy; // json:dummy Required |
| 52234 | + private Unsigned $unsigned; // json:unsigned Required | |
| 52235 | + private Ushort $ushort; // json:ushort Required | |
| 51916 | 52236 | private Using $using; // json:using Required |
| 51917 | 52237 | private Utf8JSONReader $utf8JSONReader; // json:Utf8JsonReader Required |
| 51918 | 52238 | private Utf8JSONWriter $utf8JSONWriter; // json:Utf8JsonWriter Required |
| @@ -51934,6 +52254,8 @@ class Obj6 { | ||
| 51934 | 52254 | |
| 51935 | 52255 | /** |
| 51936 | 52256 | * @param int $dummy |
| 52257 | + * @param Unsigned $unsigned | |
| 52258 | + * @param Ushort $ushort | |
| 51937 | 52259 | * @param Using $using |
| 51938 | 52260 | * @param Utf8JSONReader $utf8JSONReader |
| 51939 | 52261 | * @param Utf8JSONWriter $utf8JSONWriter |
| @@ -51953,8 +52275,10 @@ class Obj6 { | ||
| 51953 | 52275 | * @param Yes $yes |
| 51954 | 52276 | * @param YieldClass $yield |
| 51955 | 52277 | */ |
| 51956 | - public function __construct(int $dummy, Using $using, Utf8JSONReader $utf8JSONReader, Utf8JSONWriter $utf8JSONWriter, UUID $uuid, VarClass $var, Virtual $virtual, VoidClass $void, Volatile $volatile, WcharT $wcharT, Weak $weak, Where $where, WhileClass $while, WillSet $willSet, With $with, XorClass $xor, XorEq $xorEq, Yes $yes, YieldClass $yield) { | |
| 52278 | + public function __construct(int $dummy, Unsigned $unsigned, Ushort $ushort, Using $using, Utf8JSONReader $utf8JSONReader, Utf8JSONWriter $utf8JSONWriter, UUID $uuid, VarClass $var, Virtual $virtual, VoidClass $void, Volatile $volatile, WcharT $wcharT, Weak $weak, Where $where, WhileClass $while, WillSet $willSet, With $with, XorClass $xor, XorEq $xorEq, Yes $yes, YieldClass $yield) { | |
| 51957 | 52279 | $this->dummy = $dummy; |
| 52280 | + $this->unsigned = $unsigned; | |
| 52281 | + $this->ushort = $ushort; | |
| 51958 | 52282 | $this->using = $using; |
| 51959 | 52283 | $this->utf8JSONReader = $utf8JSONReader; |
| 51960 | 52284 | $this->utf8JSONWriter = $utf8JSONWriter; |
| @@ -52022,6 +52346,102 @@ class Obj6 { | ||
| 52022 | 52346 | return 31; /*31:dummy*/ |
| 52023 | 52347 | } |
| 52024 | 52348 | |
| 52349 | + /** | |
| 52350 | + * @param stdClass $value | |
| 52351 | + * @throws Exception | |
| 52352 | + * @return Unsigned | |
| 52353 | + */ | |
| 52354 | + public static function fromUnsigned(stdClass $value): Unsigned { | |
| 52355 | + return Unsigned::from($value); /*class*/ | |
| 52356 | + } | |
| 52357 | + | |
| 52358 | + /** | |
| 52359 | + * @throws Exception | |
| 52360 | + * @return stdClass | |
| 52361 | + */ | |
| 52362 | + public function toUnsigned(): stdClass { | |
| 52363 | + if (Obj6::validateUnsigned($this->unsigned)) { | |
| 52364 | + return $this->unsigned->to(); /*class*/ | |
| 52365 | + } | |
| 52366 | + throw new Exception('never get to this Obj6::unsigned'); | |
| 52367 | + } | |
| 52368 | + | |
| 52369 | + /** | |
| 52370 | + * @param Unsigned | |
| 52371 | + * @return bool | |
| 52372 | + * @throws Exception | |
| 52373 | + */ | |
| 52374 | + public static function validateUnsigned(Unsigned $value): bool { | |
| 52375 | + $value->validate(); | |
| 52376 | + return true; | |
| 52377 | + } | |
| 52378 | + | |
| 52379 | + /** | |
| 52380 | + * @throws Exception | |
| 52381 | + * @return Unsigned | |
| 52382 | + */ | |
| 52383 | + public function getUnsigned(): Unsigned { | |
| 52384 | + if (Obj6::validateUnsigned($this->unsigned)) { | |
| 52385 | + return $this->unsigned; | |
| 52386 | + } | |
| 52387 | + throw new Exception('never get to getUnsigned Obj6::unsigned'); | |
| 52388 | + } | |
| 52389 | + | |
| 52390 | + /** | |
| 52391 | + * @return Unsigned | |
| 52392 | + */ | |
| 52393 | + public static function sampleUnsigned(): Unsigned { | |
| 52394 | + return Unsigned::sample(); /*32:unsigned*/ | |
| 52395 | + } | |
| 52396 | + | |
| 52397 | + /** | |
| 52398 | + * @param stdClass $value | |
| 52399 | + * @throws Exception | |
| 52400 | + * @return Ushort | |
| 52401 | + */ | |
| 52402 | + public static function fromUshort(stdClass $value): Ushort { | |
| 52403 | + return Ushort::from($value); /*class*/ | |
| 52404 | + } | |
| 52405 | + | |
| 52406 | + /** | |
| 52407 | + * @throws Exception | |
| 52408 | + * @return stdClass | |
| 52409 | + */ | |
| 52410 | + public function toUshort(): stdClass { | |
| 52411 | + if (Obj6::validateUshort($this->ushort)) { | |
| 52412 | + return $this->ushort->to(); /*class*/ | |
| 52413 | + } | |
| 52414 | + throw new Exception('never get to this Obj6::ushort'); | |
| 52415 | + } | |
| 52416 | + | |
| 52417 | + /** | |
| 52418 | + * @param Ushort | |
| 52419 | + * @return bool | |
| 52420 | + * @throws Exception | |
| 52421 | + */ | |
| 52422 | + public static function validateUshort(Ushort $value): bool { | |
| 52423 | + $value->validate(); | |
| 52424 | + return true; | |
| 52425 | + } | |
| 52426 | + | |
| 52427 | + /** | |
| 52428 | + * @throws Exception | |
| 52429 | + * @return Ushort | |
| 52430 | + */ | |
| 52431 | + public function getUshort(): Ushort { | |
| 52432 | + if (Obj6::validateUshort($this->ushort)) { | |
| 52433 | + return $this->ushort; | |
| 52434 | + } | |
| 52435 | + throw new Exception('never get to getUshort Obj6::ushort'); | |
| 52436 | + } | |
| 52437 | + | |
| 52438 | + /** | |
| 52439 | + * @return Ushort | |
| 52440 | + */ | |
| 52441 | + public static function sampleUshort(): Ushort { | |
| 52442 | + return Ushort::sample(); /*33:ushort*/ | |
| 52443 | + } | |
| 52444 | + | |
| 52025 | 52445 | /** |
| 52026 | 52446 | * @param stdClass $value |
| 52027 | 52447 | * @throws Exception |
| @@ -52067,7 +52487,7 @@ class Obj6 { | ||
| 52067 | 52487 | * @return Using |
| 52068 | 52488 | */ |
| 52069 | 52489 | public static function sampleUsing(): Using { |
| 52070 | - return Using::sample(); /*32:using*/ | |
| 52490 | + return Using::sample(); /*34:using*/ | |
| 52071 | 52491 | } |
| 52072 | 52492 | |
| 52073 | 52493 | /** |
| @@ -52115,7 +52535,7 @@ class Obj6 { | ||
| 52115 | 52535 | * @return Utf8JSONReader |
| 52116 | 52536 | */ |
| 52117 | 52537 | public static function sampleUtf8JSONReader(): Utf8JSONReader { |
| 52118 | - return Utf8JSONReader::sample(); /*33:utf8JSONReader*/ | |
| 52538 | + return Utf8JSONReader::sample(); /*35:utf8JSONReader*/ | |
| 52119 | 52539 | } |
| 52120 | 52540 | |
| 52121 | 52541 | /** |
| @@ -52163,7 +52583,7 @@ class Obj6 { | ||
| 52163 | 52583 | * @return Utf8JSONWriter |
| 52164 | 52584 | */ |
| 52165 | 52585 | public static function sampleUtf8JSONWriter(): Utf8JSONWriter { |
| 52166 | - return Utf8JSONWriter::sample(); /*34:utf8JSONWriter*/ | |
| 52586 | + return Utf8JSONWriter::sample(); /*36:utf8JSONWriter*/ | |
| 52167 | 52587 | } |
| 52168 | 52588 | |
| 52169 | 52589 | /** |
| @@ -52211,7 +52631,7 @@ class Obj6 { | ||
| 52211 | 52631 | * @return UUID |
| 52212 | 52632 | */ |
| 52213 | 52633 | public static function sampleUUID(): UUID { |
| 52214 | - return UUID::sample(); /*35:uuid*/ | |
| 52634 | + return UUID::sample(); /*37:uuid*/ | |
| 52215 | 52635 | } |
| 52216 | 52636 | |
| 52217 | 52637 | /** |
| @@ -52259,7 +52679,7 @@ class Obj6 { | ||
| 52259 | 52679 | * @return VarClass |
| 52260 | 52680 | */ |
| 52261 | 52681 | public static function sampleVar(): VarClass { |
| 52262 | - return VarClass::sample(); /*36:var*/ | |
| 52682 | + return VarClass::sample(); /*38:var*/ | |
| 52263 | 52683 | } |
| 52264 | 52684 | |
| 52265 | 52685 | /** |
| @@ -52307,7 +52727,7 @@ class Obj6 { | ||
| 52307 | 52727 | * @return Virtual |
| 52308 | 52728 | */ |
| 52309 | 52729 | public static function sampleVirtual(): Virtual { |
| 52310 | - return Virtual::sample(); /*37:virtual*/ | |
| 52730 | + return Virtual::sample(); /*39:virtual*/ | |
| 52311 | 52731 | } |
| 52312 | 52732 | |
| 52313 | 52733 | /** |
| @@ -52355,7 +52775,7 @@ class Obj6 { | ||
| 52355 | 52775 | * @return VoidClass |
| 52356 | 52776 | */ |
| 52357 | 52777 | public static function sampleVoid(): VoidClass { |
| 52358 | - return VoidClass::sample(); /*38:void*/ | |
| 52778 | + return VoidClass::sample(); /*40:void*/ | |
| 52359 | 52779 | } |
| 52360 | 52780 | |
| 52361 | 52781 | /** |
| @@ -52403,7 +52823,7 @@ class Obj6 { | ||
| 52403 | 52823 | * @return Volatile |
| 52404 | 52824 | */ |
| 52405 | 52825 | public static function sampleVolatile(): Volatile { |
| 52406 | - return Volatile::sample(); /*39:volatile*/ | |
| 52826 | + return Volatile::sample(); /*41:volatile*/ | |
| 52407 | 52827 | } |
| 52408 | 52828 | |
| 52409 | 52829 | /** |
| @@ -52451,7 +52871,7 @@ class Obj6 { | ||
| 52451 | 52871 | * @return WcharT |
| 52452 | 52872 | */ |
| 52453 | 52873 | public static function sampleWcharT(): WcharT { |
| 52454 | - return WcharT::sample(); /*40:wcharT*/ | |
| 52874 | + return WcharT::sample(); /*42:wcharT*/ | |
| 52455 | 52875 | } |
| 52456 | 52876 | |
| 52457 | 52877 | /** |
| @@ -52499,7 +52919,7 @@ class Obj6 { | ||
| 52499 | 52919 | * @return Weak |
| 52500 | 52920 | */ |
| 52501 | 52921 | public static function sampleWeak(): Weak { |
| 52502 | - return Weak::sample(); /*41:weak*/ | |
| 52922 | + return Weak::sample(); /*43:weak*/ | |
| 52503 | 52923 | } |
| 52504 | 52924 | |
| 52505 | 52925 | /** |
| @@ -52547,7 +52967,7 @@ class Obj6 { | ||
| 52547 | 52967 | * @return Where |
| 52548 | 52968 | */ |
| 52549 | 52969 | public static function sampleWhere(): Where { |
| 52550 | - return Where::sample(); /*42:where*/ | |
| 52970 | + return Where::sample(); /*44:where*/ | |
| 52551 | 52971 | } |
| 52552 | 52972 | |
| 52553 | 52973 | /** |
| @@ -52595,7 +53015,7 @@ class Obj6 { | ||
| 52595 | 53015 | * @return WhileClass |
| 52596 | 53016 | */ |
| 52597 | 53017 | public static function sampleWhile(): WhileClass { |
| 52598 | - return WhileClass::sample(); /*43:while*/ | |
| 53018 | + return WhileClass::sample(); /*45:while*/ | |
| 52599 | 53019 | } |
| 52600 | 53020 | |
| 52601 | 53021 | /** |
| @@ -52643,7 +53063,7 @@ class Obj6 { | ||
| 52643 | 53063 | * @return WillSet |
| 52644 | 53064 | */ |
| 52645 | 53065 | public static function sampleWillSet(): WillSet { |
| 52646 | - return WillSet::sample(); /*44:willSet*/ | |
| 53066 | + return WillSet::sample(); /*46:willSet*/ | |
| 52647 | 53067 | } |
| 52648 | 53068 | |
| 52649 | 53069 | /** |
| @@ -52691,7 +53111,7 @@ class Obj6 { | ||
| 52691 | 53111 | * @return With |
| 52692 | 53112 | */ |
| 52693 | 53113 | public static function sampleWith(): With { |
| 52694 | - return With::sample(); /*45:with*/ | |
| 53114 | + return With::sample(); /*47:with*/ | |
| 52695 | 53115 | } |
| 52696 | 53116 | |
| 52697 | 53117 | /** |
| @@ -52739,7 +53159,7 @@ class Obj6 { | ||
| 52739 | 53159 | * @return XorClass |
| 52740 | 53160 | */ |
| 52741 | 53161 | public static function sampleXor(): XorClass { |
| 52742 | - return XorClass::sample(); /*46:xor*/ | |
| 53162 | + return XorClass::sample(); /*48:xor*/ | |
| 52743 | 53163 | } |
| 52744 | 53164 | |
| 52745 | 53165 | /** |
| @@ -52787,7 +53207,7 @@ class Obj6 { | ||
| 52787 | 53207 | * @return XorEq |
| 52788 | 53208 | */ |
| 52789 | 53209 | public static function sampleXorEq(): XorEq { |
| 52790 | - return XorEq::sample(); /*47:xorEq*/ | |
| 53210 | + return XorEq::sample(); /*49:xorEq*/ | |
| 52791 | 53211 | } |
| 52792 | 53212 | |
| 52793 | 53213 | /** |
| @@ -52835,7 +53255,7 @@ class Obj6 { | ||
| 52835 | 53255 | * @return Yes |
| 52836 | 53256 | */ |
| 52837 | 53257 | public static function sampleYes(): Yes { |
| 52838 | - return Yes::sample(); /*48:yes*/ | |
| 53258 | + return Yes::sample(); /*50:yes*/ | |
| 52839 | 53259 | } |
| 52840 | 53260 | |
| 52841 | 53261 | /** |
| @@ -52883,7 +53303,7 @@ class Obj6 { | ||
| 52883 | 53303 | * @return YieldClass |
| 52884 | 53304 | */ |
| 52885 | 53305 | public static function sampleYield(): YieldClass { |
| 52886 | - return YieldClass::sample(); /*49:yield*/ | |
| 53306 | + return YieldClass::sample(); /*51:yield*/ | |
| 52887 | 53307 | } |
| 52888 | 53308 | |
| 52889 | 53309 | /** |
| @@ -52892,6 +53312,8 @@ class Obj6 { | ||
| 52892 | 53312 | */ |
| 52893 | 53313 | public function validate(): bool { |
| 52894 | 53314 | return Obj6::validateDummy($this->dummy) |
| 53315 | + || Obj6::validateUnsigned($this->unsigned) | |
| 53316 | + || Obj6::validateUshort($this->ushort) | |
| 52895 | 53317 | || Obj6::validateUsing($this->using) |
| 52896 | 53318 | || Obj6::validateUtf8JSONReader($this->utf8JSONReader) |
| 52897 | 53319 | || Obj6::validateUtf8JSONWriter($this->utf8JSONWriter) |
| @@ -52919,6 +53341,8 @@ class Obj6 { | ||
| 52919 | 53341 | public function to(): stdClass { |
| 52920 | 53342 | $out = new stdClass(); |
| 52921 | 53343 | $out->{'dummy'} = $this->toDummy(); |
| 53344 | + $out->{'unsigned'} = $this->toUnsigned(); | |
| 53345 | + $out->{'ushort'} = $this->toUshort(); | |
| 52922 | 53346 | $out->{'using'} = $this->toUsing(); |
| 52923 | 53347 | $out->{'Utf8JsonReader'} = $this->toUtf8JSONReader(); |
| 52924 | 53348 | $out->{'Utf8JsonWriter'} = $this->toUtf8JSONWriter(); |
| @@ -52949,6 +53373,12 @@ class Obj6 { | ||
| 52949 | 53373 | if (!property_exists($obj, 'dummy')) { |
| 52950 | 53374 | throw new Exception("Missing required property"); |
| 52951 | 53375 | } |
| 53376 | + if (!property_exists($obj, 'unsigned')) { | |
| 53377 | + throw new Exception("Missing required property"); | |
| 53378 | + } | |
| 53379 | + if (!property_exists($obj, 'ushort')) { | |
| 53380 | + throw new Exception("Missing required property"); | |
| 53381 | + } | |
| 52952 | 53382 | if (!property_exists($obj, 'using')) { |
| 52953 | 53383 | throw new Exception("Missing required property"); |
| 52954 | 53384 | } |
| @@ -53005,6 +53435,8 @@ class Obj6 { | ||
| 53005 | 53435 | } |
| 53006 | 53436 | return new Obj6( |
| 53007 | 53437 | Obj6::fromDummy($obj->{'dummy'}) |
| 53438 | + ,Obj6::fromUnsigned($obj->{'unsigned'}) | |
| 53439 | + ,Obj6::fromUshort($obj->{'ushort'}) | |
| 53008 | 53440 | ,Obj6::fromUsing($obj->{'using'}) |
| 53009 | 53441 | ,Obj6::fromUtf8JSONReader($obj->{'Utf8JsonReader'}) |
| 53010 | 53442 | ,Obj6::fromUtf8JSONWriter($obj->{'Utf8JsonWriter'}) |
| @@ -53032,6 +53464,8 @@ class Obj6 { | ||
| 53032 | 53464 | public static function sample(): Obj6 { |
| 53033 | 53465 | return new Obj6( |
| 53034 | 53466 | Obj6::sampleDummy() |
| 53467 | + ,Obj6::sampleUnsigned() | |
| 53468 | + ,Obj6::sampleUshort() | |
| 53035 | 53469 | ,Obj6::sampleUsing() |
| 53036 | 53470 | ,Obj6::sampleUtf8JSONReader() |
| 53037 | 53471 | ,Obj6::sampleUtf8JSONWriter() |
| @@ -53054,6 +53488,208 @@ class Obj6 { | ||
| 53054 | 53488 | } |
| 53055 | 53489 | } |
| 53056 | 53490 | |
| 53491 | +// This is an autogenerated file:Unsigned | |
| 53492 | + | |
| 53493 | +class Unsigned { | |
| 53494 | + private int $unsigned; // json:unsigned Required | |
| 53495 | + | |
| 53496 | + /** | |
| 53497 | + * @param int $unsigned | |
| 53498 | + */ | |
| 53499 | + public function __construct(int $unsigned) { | |
| 53500 | + $this->unsigned = $unsigned; | |
| 53501 | + } | |
| 53502 | + | |
| 53503 | + /** | |
| 53504 | + * @param int $value | |
| 53505 | + * @throws Exception | |
| 53506 | + * @return int | |
| 53507 | + */ | |
| 53508 | + public static function fromUnsigned(int $value): int { | |
| 53509 | + return $value; /*int*/ | |
| 53510 | + } | |
| 53511 | + | |
| 53512 | + /** | |
| 53513 | + * @throws Exception | |
| 53514 | + * @return int | |
| 53515 | + */ | |
| 53516 | + public function toUnsigned(): int { | |
| 53517 | + if (Unsigned::validateUnsigned($this->unsigned)) { | |
| 53518 | + return $this->unsigned; /*int*/ | |
| 53519 | + } | |
| 53520 | + throw new Exception('never get to this Unsigned::unsigned'); | |
| 53521 | + } | |
| 53522 | + | |
| 53523 | + /** | |
| 53524 | + * @param int | |
| 53525 | + * @return bool | |
| 53526 | + * @throws Exception | |
| 53527 | + */ | |
| 53528 | + public static function validateUnsigned(int $value): bool { | |
| 53529 | + return true; | |
| 53530 | + } | |
| 53531 | + | |
| 53532 | + /** | |
| 53533 | + * @throws Exception | |
| 53534 | + * @return int | |
| 53535 | + */ | |
| 53536 | + public function getUnsigned(): int { | |
| 53537 | + if (Unsigned::validateUnsigned($this->unsigned)) { | |
| 53538 | + return $this->unsigned; | |
| 53539 | + } | |
| 53540 | + throw new Exception('never get to getUnsigned Unsigned::unsigned'); | |
| 53541 | + } | |
| 53542 | + | |
| 53543 | + /** | |
| 53544 | + * @return int | |
| 53545 | + */ | |
| 53546 | + public static function sampleUnsigned(): int { | |
| 53547 | + return 31; /*31:unsigned*/ | |
| 53548 | + } | |
| 53549 | + | |
| 53550 | + /** | |
| 53551 | + * @throws Exception | |
| 53552 | + * @return bool | |
| 53553 | + */ | |
| 53554 | + public function validate(): bool { | |
| 53555 | + return Unsigned::validateUnsigned($this->unsigned); | |
| 53556 | + } | |
| 53557 | + | |
| 53558 | + /** | |
| 53559 | + * @return stdClass | |
| 53560 | + * @throws Exception | |
| 53561 | + */ | |
| 53562 | + public function to(): stdClass { | |
| 53563 | + $out = new stdClass(); | |
| 53564 | + $out->{'unsigned'} = $this->toUnsigned(); | |
| 53565 | + return $out; | |
| 53566 | + } | |
| 53567 | + | |
| 53568 | + /** | |
| 53569 | + * @param stdClass $obj | |
| 53570 | + * @return Unsigned | |
| 53571 | + * @throws Exception | |
| 53572 | + */ | |
| 53573 | + public static function from(stdClass $obj): Unsigned { | |
| 53574 | + if (!property_exists($obj, 'unsigned')) { | |
| 53575 | + throw new Exception("Missing required property"); | |
| 53576 | + } | |
| 53577 | + return new Unsigned( | |
| 53578 | + Unsigned::fromUnsigned($obj->{'unsigned'}) | |
| 53579 | + ); | |
| 53580 | + } | |
| 53581 | + | |
| 53582 | + /** | |
| 53583 | + * @return Unsigned | |
| 53584 | + */ | |
| 53585 | + public static function sample(): Unsigned { | |
| 53586 | + return new Unsigned( | |
| 53587 | + Unsigned::sampleUnsigned() | |
| 53588 | + ); | |
| 53589 | + } | |
| 53590 | +} | |
| 53591 | + | |
| 53592 | +// This is an autogenerated file:Ushort | |
| 53593 | + | |
| 53594 | +class Ushort { | |
| 53595 | + private int $ushort; // json:ushort Required | |
| 53596 | + | |
| 53597 | + /** | |
| 53598 | + * @param int $ushort | |
| 53599 | + */ | |
| 53600 | + public function __construct(int $ushort) { | |
| 53601 | + $this->ushort = $ushort; | |
| 53602 | + } | |
| 53603 | + | |
| 53604 | + /** | |
| 53605 | + * @param int $value | |
| 53606 | + * @throws Exception | |
| 53607 | + * @return int | |
| 53608 | + */ | |
| 53609 | + public static function fromUshort(int $value): int { | |
| 53610 | + return $value; /*int*/ | |
| 53611 | + } | |
| 53612 | + | |
| 53613 | + /** | |
| 53614 | + * @throws Exception | |
| 53615 | + * @return int | |
| 53616 | + */ | |
| 53617 | + public function toUshort(): int { | |
| 53618 | + if (Ushort::validateUshort($this->ushort)) { | |
| 53619 | + return $this->ushort; /*int*/ | |
| 53620 | + } | |
| 53621 | + throw new Exception('never get to this Ushort::ushort'); | |
| 53622 | + } | |
| 53623 | + | |
| 53624 | + /** | |
| 53625 | + * @param int | |
| 53626 | + * @return bool | |
| 53627 | + * @throws Exception | |
| 53628 | + */ | |
| 53629 | + public static function validateUshort(int $value): bool { | |
| 53630 | + return true; | |
| 53631 | + } | |
| 53632 | + | |
| 53633 | + /** | |
| 53634 | + * @throws Exception | |
| 53635 | + * @return int | |
| 53636 | + */ | |
| 53637 | + public function getUshort(): int { | |
| 53638 | + if (Ushort::validateUshort($this->ushort)) { | |
| 53639 | + return $this->ushort; | |
| 53640 | + } | |
| 53641 | + throw new Exception('never get to getUshort Ushort::ushort'); | |
| 53642 | + } | |
| 53643 | + | |
| 53644 | + /** | |
| 53645 | + * @return int | |
| 53646 | + */ | |
| 53647 | + public static function sampleUshort(): int { | |
| 53648 | + return 31; /*31:ushort*/ | |
| 53649 | + } | |
| 53650 | + | |
| 53651 | + /** | |
| 53652 | + * @throws Exception | |
| 53653 | + * @return bool | |
| 53654 | + */ | |
| 53655 | + public function validate(): bool { | |
| 53656 | + return Ushort::validateUshort($this->ushort); | |
| 53657 | + } | |
| 53658 | + | |
| 53659 | + /** | |
| 53660 | + * @return stdClass | |
| 53661 | + * @throws Exception | |
| 53662 | + */ | |
| 53663 | + public function to(): stdClass { | |
| 53664 | + $out = new stdClass(); | |
| 53665 | + $out->{'ushort'} = $this->toUshort(); | |
| 53666 | + return $out; | |
| 53667 | + } | |
| 53668 | + | |
| 53669 | + /** | |
| 53670 | + * @param stdClass $obj | |
| 53671 | + * @return Ushort | |
| 53672 | + * @throws Exception | |
| 53673 | + */ | |
| 53674 | + public static function from(stdClass $obj): Ushort { | |
| 53675 | + if (!property_exists($obj, 'ushort')) { | |
| 53676 | + throw new Exception("Missing required property"); | |
| 53677 | + } | |
| 53678 | + return new Ushort( | |
| 53679 | + Ushort::fromUshort($obj->{'ushort'}) | |
| 53680 | + ); | |
| 53681 | + } | |
| 53682 | + | |
| 53683 | + /** | |
| 53684 | + * @return Ushort | |
| 53685 | + */ | |
| 53686 | + public static function sample(): Ushort { | |
| 53687 | + return new Ushort( | |
| 53688 | + Ushort::sampleUshort() | |
| 53689 | + ); | |
| 53690 | + } | |
| 53691 | +} | |
| 53692 | + | |
| 53057 | 53693 | // This is an autogenerated file:Using |
| 53058 | 53694 | |
| 53059 | 53695 | class Using { |
Mpikedefault / TopLevel.pmod+225 −125
| @@ -1727,11 +1727,11 @@ class Obj2 { | ||
| 1727 | 1727 | FormatException format_exception; // json: "FormatException" |
| 1728 | 1728 | Friend friend; // json: "friend" |
| 1729 | 1729 | From from; // json: "from" |
| 1730 | + FromDict from_dict; // json: "from_dict" | |
| 1730 | 1731 | FromJson from_json; // json: "from_json" |
| 1731 | 1732 | Func func; // json: "func" |
| 1732 | 1733 | Get get; // json: "get" |
| 1733 | 1734 | Go go; // json: "go" |
| 1734 | - Goto goto; // json: "goto" | |
| 1735 | 1735 | Default obj2_default; // json: "default" |
| 1736 | 1736 | Do obj2_do; // json: "do" |
| 1737 | 1737 | Else obj2_else; // json: "else" |
| @@ -1795,11 +1795,11 @@ class Obj2 { | ||
| 1795 | 1795 | "FormatException" : format_exception, |
| 1796 | 1796 | "friend" : friend, |
| 1797 | 1797 | "from" : from, |
| 1798 | + "from_dict" : from_dict, | |
| 1798 | 1799 | "from_json" : from_json, |
| 1799 | 1800 | "func" : func, |
| 1800 | 1801 | "get" : get, |
| 1801 | 1802 | "go" : go, |
| 1802 | - "goto" : goto, | |
| 1803 | 1803 | "default" : obj2_default, |
| 1804 | 1804 | "do" : obj2_do, |
| 1805 | 1805 | "else" : obj2_else, |
| @@ -1917,6 +1917,8 @@ Obj2 Obj2_from_JSON(mixed json) { | ||
| 1917 | 1917 | retval.friend = json["friend"]; |
| 1918 | 1918 | if (!mappingp(json["from"])) error("Expected object"); |
| 1919 | 1919 | retval.from = json["from"]; |
| 1920 | + if (!mappingp(json["from_dict"])) error("Expected object"); | |
| 1921 | + retval.from_dict = json["from_dict"]; | |
| 1920 | 1922 | if (!mappingp(json["from_json"])) error("Expected object"); |
| 1921 | 1923 | retval.from_json = json["from_json"]; |
| 1922 | 1924 | if (!mappingp(json["func"])) error("Expected object"); |
| @@ -1925,8 +1927,6 @@ Obj2 Obj2_from_JSON(mixed json) { | ||
| 1925 | 1927 | retval.get = json["get"]; |
| 1926 | 1928 | if (!mappingp(json["go"])) error("Expected object"); |
| 1927 | 1929 | retval.go = json["go"]; |
| 1928 | - if (!mappingp(json["goto"])) error("Expected object"); | |
| 1929 | - retval.goto = json["goto"]; | |
| 1930 | 1930 | if (!mappingp(json["default"])) error("Expected object"); |
| 1931 | 1931 | retval.obj2_default = json["default"]; |
| 1932 | 1932 | if (!mappingp(json["do"])) error("Expected object"); |
| @@ -2949,6 +2949,27 @@ From From_from_JSON(mixed json) { | ||
| 2949 | 2949 | return retval; |
| 2950 | 2950 | } |
| 2951 | 2951 | |
| 2952 | +class FromDict { | |
| 2953 | + int from_dict; // json: "from_dict" | |
| 2954 | + | |
| 2955 | + string encode_json() { | |
| 2956 | + mapping(string:mixed) json = ([ | |
| 2957 | + "from_dict" : from_dict, | |
| 2958 | + ]); | |
| 2959 | + | |
| 2960 | + return Standards.JSON.encode(json); | |
| 2961 | + } | |
| 2962 | +} | |
| 2963 | + | |
| 2964 | +FromDict FromDict_from_JSON(mixed json) { | |
| 2965 | + FromDict retval = FromDict(); | |
| 2966 | + | |
| 2967 | + if (!intp(json["from_dict"])) error("Expected integer"); | |
| 2968 | + retval.from_dict = json["from_dict"]; | |
| 2969 | + | |
| 2970 | + return retval; | |
| 2971 | +} | |
| 2972 | + | |
| 2952 | 2973 | class FromJson { |
| 2953 | 2974 | int from_json; // json: "from_json" |
| 2954 | 2975 | |
| @@ -3033,27 +3054,6 @@ Go Go_from_JSON(mixed json) { | ||
| 3033 | 3054 | return retval; |
| 3034 | 3055 | } |
| 3035 | 3056 | |
| 3036 | -class Goto { | |
| 3037 | - int goto; // json: "goto" | |
| 3038 | - | |
| 3039 | - string encode_json() { | |
| 3040 | - mapping(string:mixed) json = ([ | |
| 3041 | - "goto" : goto, | |
| 3042 | - ]); | |
| 3043 | - | |
| 3044 | - return Standards.JSON.encode(json); | |
| 3045 | - } | |
| 3046 | -} | |
| 3047 | - | |
| 3048 | -Goto Goto_from_JSON(mixed json) { | |
| 3049 | - Goto retval = Goto(); | |
| 3050 | - | |
| 3051 | - if (!intp(json["goto"])) error("Expected integer"); | |
| 3052 | - retval.goto = json["goto"]; | |
| 3053 | - | |
| 3054 | - return retval; | |
| 3055 | -} | |
| 3056 | - | |
| 3057 | 3057 | class Default { |
| 3058 | 3058 | int default_default; // json: "default" |
| 3059 | 3059 | |
| @@ -3308,6 +3308,7 @@ Global Global_from_JSON(mixed json) { | ||
| 3308 | 3308 | |
| 3309 | 3309 | class Obj3 { |
| 3310 | 3310 | int dummy; // json: "dummy" |
| 3311 | + Goto goto; // json: "goto" | |
| 3311 | 3312 | Guard guard; // json: "guard" |
| 3312 | 3313 | HasOwnProperty has_own_property; // json: "hasOwnProperty" |
| 3313 | 3314 | HashCode hash_code; // json: "hashCode" |
| @@ -3356,6 +3357,7 @@ class Obj3 { | ||
| 3356 | 3357 | Long long; // json: "long" |
| 3357 | 3358 | Map map; // json: "map" |
| 3358 | 3359 | MapEntry map_entry; // json: "MapEntry" |
| 3360 | + MarshalJson marshal_json; // json: "MarshalJSON" | |
| 3359 | 3361 | MetadataPropertyHandling metadata_property_handling; // json: "metadata_property_handling" |
| 3360 | 3362 | Module module; // json: "module" |
| 3361 | 3363 | Mutable mutable; // json: "mutable" |
| @@ -3366,7 +3368,6 @@ class Obj3 { | ||
| 3366 | 3368 | Newtonsoft newtonsoft; // json: "newtonsoft" |
| 3367 | 3369 | Nil nil; // json: "nil" |
| 3368 | 3370 | No no; // json: "NO" |
| 3369 | - Noexcept noexcept; // json: "noexcept" | |
| 3370 | 3371 | If obj3_if; // json: "if" |
| 3371 | 3372 | Import obj3_import; // json: "import" |
| 3372 | 3373 | Inline obj3_inline; // json: "inline" |
| @@ -3376,6 +3377,7 @@ class Obj3 { | ||
| 3376 | 3377 | string encode_json() { |
| 3377 | 3378 | mapping(string:mixed) json = ([ |
| 3378 | 3379 | "dummy" : dummy, |
| 3380 | + "goto" : goto, | |
| 3379 | 3381 | "guard" : guard, |
| 3380 | 3382 | "hasOwnProperty" : has_own_property, |
| 3381 | 3383 | "hashCode" : hash_code, |
| @@ -3424,6 +3426,7 @@ class Obj3 { | ||
| 3424 | 3426 | "long" : long, |
| 3425 | 3427 | "map" : map, |
| 3426 | 3428 | "MapEntry" : map_entry, |
| 3429 | + "MarshalJSON" : marshal_json, | |
| 3427 | 3430 | "metadata_property_handling" : metadata_property_handling, |
| 3428 | 3431 | "module" : module, |
| 3429 | 3432 | "mutable" : mutable, |
| @@ -3434,7 +3437,6 @@ class Obj3 { | ||
| 3434 | 3437 | "newtonsoft" : newtonsoft, |
| 3435 | 3438 | "nil" : nil, |
| 3436 | 3439 | "NO" : no, |
| 3437 | - "noexcept" : noexcept, | |
| 3438 | 3440 | "if" : obj3_if, |
| 3439 | 3441 | "import" : obj3_import, |
| 3440 | 3442 | "inline" : obj3_inline, |
| @@ -3451,6 +3453,8 @@ Obj3 Obj3_from_JSON(mixed json) { | ||
| 3451 | 3453 | |
| 3452 | 3454 | if (!intp(json["dummy"])) error("Expected integer"); |
| 3453 | 3455 | retval.dummy = json["dummy"]; |
| 3456 | + if (!mappingp(json["goto"])) error("Expected object"); | |
| 3457 | + retval.goto = json["goto"]; | |
| 3454 | 3458 | if (!mappingp(json["guard"])) error("Expected object"); |
| 3455 | 3459 | retval.guard = json["guard"]; |
| 3456 | 3460 | if (!mappingp(json["hasOwnProperty"])) error("Expected object"); |
| @@ -3547,6 +3551,8 @@ Obj3 Obj3_from_JSON(mixed json) { | ||
| 3547 | 3551 | retval.map = json["map"]; |
| 3548 | 3552 | if (!mappingp(json["MapEntry"])) error("Expected object"); |
| 3549 | 3553 | retval.map_entry = json["MapEntry"]; |
| 3554 | + if (!mappingp(json["MarshalJSON"])) error("Expected object"); | |
| 3555 | + retval.marshal_json = json["MarshalJSON"]; | |
| 3550 | 3556 | if (!mappingp(json["metadata_property_handling"])) error("Expected object"); |
| 3551 | 3557 | retval.metadata_property_handling = json["metadata_property_handling"]; |
| 3552 | 3558 | if (!mappingp(json["module"])) error("Expected object"); |
| @@ -3567,8 +3573,6 @@ Obj3 Obj3_from_JSON(mixed json) { | ||
| 3567 | 3573 | retval.nil = json["nil"]; |
| 3568 | 3574 | if (!mappingp(json["NO"])) error("Expected object"); |
| 3569 | 3575 | retval.no = json["NO"]; |
| 3570 | - if (!mappingp(json["noexcept"])) error("Expected object"); | |
| 3571 | - retval.noexcept = json["noexcept"]; | |
| 3572 | 3576 | if (!mappingp(json["if"])) error("Expected object"); |
| 3573 | 3577 | retval.obj3_if = json["if"]; |
| 3574 | 3578 | if (!mappingp(json["import"])) error("Expected object"); |
| @@ -3583,6 +3587,27 @@ Obj3 Obj3_from_JSON(mixed json) { | ||
| 3583 | 3587 | return retval; |
| 3584 | 3588 | } |
| 3585 | 3589 | |
| 3590 | +class Goto { | |
| 3591 | + int goto; // json: "goto" | |
| 3592 | + | |
| 3593 | + string encode_json() { | |
| 3594 | + mapping(string:mixed) json = ([ | |
| 3595 | + "goto" : goto, | |
| 3596 | + ]); | |
| 3597 | + | |
| 3598 | + return Standards.JSON.encode(json); | |
| 3599 | + } | |
| 3600 | +} | |
| 3601 | + | |
| 3602 | +Goto Goto_from_JSON(mixed json) { | |
| 3603 | + Goto retval = Goto(); | |
| 3604 | + | |
| 3605 | + if (!intp(json["goto"])) error("Expected integer"); | |
| 3606 | + retval.goto = json["goto"]; | |
| 3607 | + | |
| 3608 | + return retval; | |
| 3609 | +} | |
| 3610 | + | |
| 3586 | 3611 | class Guard { |
| 3587 | 3612 | int guard; // json: "guard" |
| 3588 | 3613 | |
| @@ -4590,6 +4615,27 @@ MapEntry MapEntry_from_JSON(mixed json) { | ||
| 4590 | 4615 | return retval; |
| 4591 | 4616 | } |
| 4592 | 4617 | |
| 4618 | +class MarshalJson { | |
| 4619 | + int marshal_json; // json: "MarshalJSON" | |
| 4620 | + | |
| 4621 | + string encode_json() { | |
| 4622 | + mapping(string:mixed) json = ([ | |
| 4623 | + "MarshalJSON" : marshal_json, | |
| 4624 | + ]); | |
| 4625 | + | |
| 4626 | + return Standards.JSON.encode(json); | |
| 4627 | + } | |
| 4628 | +} | |
| 4629 | + | |
| 4630 | +MarshalJson MarshalJson_from_JSON(mixed json) { | |
| 4631 | + MarshalJson retval = MarshalJson(); | |
| 4632 | + | |
| 4633 | + if (!intp(json["MarshalJSON"])) error("Expected integer"); | |
| 4634 | + retval.marshal_json = json["MarshalJSON"]; | |
| 4635 | + | |
| 4636 | + return retval; | |
| 4637 | +} | |
| 4638 | + | |
| 4593 | 4639 | class MetadataPropertyHandling { |
| 4594 | 4640 | int metadata_property_handling; // json: "metadata_property_handling" |
| 4595 | 4641 | |
| @@ -4800,27 +4846,6 @@ No No_from_JSON(mixed json) { | ||
| 4800 | 4846 | return retval; |
| 4801 | 4847 | } |
| 4802 | 4848 | |
| 4803 | -class Noexcept { | |
| 4804 | - int noexcept; // json: "noexcept" | |
| 4805 | - | |
| 4806 | - string encode_json() { | |
| 4807 | - mapping(string:mixed) json = ([ | |
| 4808 | - "noexcept" : noexcept, | |
| 4809 | - ]); | |
| 4810 | - | |
| 4811 | - return Standards.JSON.encode(json); | |
| 4812 | - } | |
| 4813 | -} | |
| 4814 | - | |
| 4815 | -Noexcept Noexcept_from_JSON(mixed json) { | |
| 4816 | - Noexcept retval = Noexcept(); | |
| 4817 | - | |
| 4818 | - if (!intp(json["noexcept"])) error("Expected integer"); | |
| 4819 | - retval.noexcept = json["noexcept"]; | |
| 4820 | - | |
| 4821 | - return retval; | |
| 4822 | -} | |
| 4823 | - | |
| 4824 | 4849 | class If { |
| 4825 | 4850 | int if_if; // json: "if" |
| 4826 | 4851 | |
| @@ -4929,6 +4954,7 @@ Lambda Lambda_from_JSON(mixed json) { | ||
| 4929 | 4954 | class Obj4 { |
| 4930 | 4955 | int dummy; // json: "dummy" |
| 4931 | 4956 | NoSuchMethod no_such_method; // json: "noSuchMethod" |
| 4957 | + Noexcept noexcept; // json: "noexcept" | |
| 4932 | 4958 | Nonatomic nonatomic; // json: "nonatomic" |
| 4933 | 4959 | None none; // json: "None" |
| 4934 | 4960 | Nonlocal nonlocal; // json: "nonlocal" |
| @@ -4991,12 +5017,12 @@ class Obj4 { | ||
| 4991 | 5017 | Sbyte sbyte; // json: "sbyte" |
| 4992 | 5018 | Sealed sealed; // json: "sealed" |
| 4993 | 5019 | Sel sel; // json: "SEL" |
| 4994 | - Select select; // json: "select" | |
| 4995 | 5020 | |
| 4996 | 5021 | string encode_json() { |
| 4997 | 5022 | mapping(string:mixed) json = ([ |
| 4998 | 5023 | "dummy" : dummy, |
| 4999 | 5024 | "noSuchMethod" : no_such_method, |
| 5025 | + "noexcept" : noexcept, | |
| 5000 | 5026 | "nonatomic" : nonatomic, |
| 5001 | 5027 | "None" : none, |
| 5002 | 5028 | "nonlocal" : nonlocal, |
| @@ -5059,7 +5085,6 @@ class Obj4 { | ||
| 5059 | 5085 | "sbyte" : sbyte, |
| 5060 | 5086 | "sealed" : sealed, |
| 5061 | 5087 | "SEL" : sel, |
| 5062 | - "select" : select, | |
| 5063 | 5088 | ]); |
| 5064 | 5089 | |
| 5065 | 5090 | return Standards.JSON.encode(json); |
| @@ -5073,6 +5098,8 @@ Obj4 Obj4_from_JSON(mixed json) { | ||
| 5073 | 5098 | retval.dummy = json["dummy"]; |
| 5074 | 5099 | if (!mappingp(json["noSuchMethod"])) error("Expected object"); |
| 5075 | 5100 | retval.no_such_method = json["noSuchMethod"]; |
| 5101 | + if (!mappingp(json["noexcept"])) error("Expected object"); | |
| 5102 | + retval.noexcept = json["noexcept"]; | |
| 5076 | 5103 | if (!mappingp(json["nonatomic"])) error("Expected object"); |
| 5077 | 5104 | retval.nonatomic = json["nonatomic"]; |
| 5078 | 5105 | if (!mappingp(json["None"])) error("Expected object"); |
| @@ -5197,8 +5224,6 @@ Obj4 Obj4_from_JSON(mixed json) { | ||
| 5197 | 5224 | retval.sealed = json["sealed"]; |
| 5198 | 5225 | if (!mappingp(json["SEL"])) error("Expected object"); |
| 5199 | 5226 | retval.sel = json["SEL"]; |
| 5200 | - if (!mappingp(json["select"])) error("Expected object"); | |
| 5201 | - retval.select = json["select"]; | |
| 5202 | 5227 | |
| 5203 | 5228 | return retval; |
| 5204 | 5229 | } |
| @@ -5224,6 +5249,27 @@ NoSuchMethod NoSuchMethod_from_JSON(mixed json) { | ||
| 5224 | 5249 | return retval; |
| 5225 | 5250 | } |
| 5226 | 5251 | |
| 5252 | +class Noexcept { | |
| 5253 | + int noexcept; // json: "noexcept" | |
| 5254 | + | |
| 5255 | + string encode_json() { | |
| 5256 | + mapping(string:mixed) json = ([ | |
| 5257 | + "noexcept" : noexcept, | |
| 5258 | + ]); | |
| 5259 | + | |
| 5260 | + return Standards.JSON.encode(json); | |
| 5261 | + } | |
| 5262 | +} | |
| 5263 | + | |
| 5264 | +Noexcept Noexcept_from_JSON(mixed json) { | |
| 5265 | + Noexcept retval = Noexcept(); | |
| 5266 | + | |
| 5267 | + if (!intp(json["noexcept"])) error("Expected integer"); | |
| 5268 | + retval.noexcept = json["noexcept"]; | |
| 5269 | + | |
| 5270 | + return retval; | |
| 5271 | +} | |
| 5272 | + | |
| 5227 | 5273 | class Nonatomic { |
| 5228 | 5274 | int nonatomic; // json: "nonatomic" |
| 5229 | 5275 | |
| @@ -6525,27 +6571,6 @@ Sel Sel_from_JSON(mixed json) { | ||
| 6525 | 6571 | return retval; |
| 6526 | 6572 | } |
| 6527 | 6573 | |
| 6528 | -class Select { | |
| 6529 | - int select; // json: "select" | |
| 6530 | - | |
| 6531 | - string encode_json() { | |
| 6532 | - mapping(string:mixed) json = ([ | |
| 6533 | - "select" : select, | |
| 6534 | - ]); | |
| 6535 | - | |
| 6536 | - return Standards.JSON.encode(json); | |
| 6537 | - } | |
| 6538 | -} | |
| 6539 | - | |
| 6540 | -Select Select_from_JSON(mixed json) { | |
| 6541 | - Select retval = Select(); | |
| 6542 | - | |
| 6543 | - if (!intp(json["select"])) error("Expected integer"); | |
| 6544 | - retval.select = json["select"]; | |
| 6545 | - | |
| 6546 | - return retval; | |
| 6547 | -} | |
| 6548 | - | |
| 6549 | 6574 | class Obj5 { |
| 6550 | 6575 | int dummy; // json: "dummy" |
| 6551 | 6576 | KSerializer k_serializer; // json: "KSerializer" |
| @@ -6558,6 +6583,7 @@ class Obj5 { | ||
| 6558 | 6583 | Typedef obj5_typedef; // json: "typedef" |
| 6559 | 6584 | Typeof obj5_typeof; // json: "typeof" |
| 6560 | 6585 | PrimitiveKind primitive_kind; // json: "PrimitiveKind" |
| 6586 | + Select select; // json: "select" | |
| 6561 | 6587 | Self self; // json: "Self" |
| 6562 | 6588 | Sendable sendable; // json: "Sendable" |
| 6563 | 6589 | SerialDescriptor serial_descriptor; // json: "SerialDescriptor" |
| @@ -6592,6 +6618,7 @@ class Obj5 { | ||
| 6592 | 6618 | TimeOnly time_only; // json: "TimeOnly" |
| 6593 | 6619 | TimeOnlyConverter time_only_converter; // json: "TimeOnlyConverter" |
| 6594 | 6620 | TimeZone time_zone; // json: "TimeZone" |
| 6621 | + ToDict to_dict; // json: "to_dict" | |
| 6595 | 6622 | ToJson to_json; // json: "to_json" |
| 6596 | 6623 | ToString to_string; // json: "toString" |
| 6597 | 6624 | TopLevelClass top_level; // json: "top_level" |
| @@ -6607,11 +6634,10 @@ class Obj5 { | ||
| 6607 | 6634 | Unchecked unchecked; // json: "unchecked" |
| 6608 | 6635 | Undefined undefined; // json: "undefined" |
| 6609 | 6636 | Union union; // json: "union" |
| 6637 | + UnmarshalJson unmarshal_json; // json: "UnmarshalJSON" | |
| 6610 | 6638 | Unowned unowned; // json: "unowned" |
| 6611 | 6639 | Unsafe unsafe; // json: "unsafe" |
| 6612 | - Unsigned unsigned; // json: "unsigned" | |
| 6613 | 6640 | UseSerializers use_serializers; // json: "UseSerializers" |
| 6614 | - Ushort ushort; // json: "ushort" | |
| 6615 | 6641 | |
| 6616 | 6642 | string encode_json() { |
| 6617 | 6643 | mapping(string:mixed) json = ([ |
| @@ -6626,6 +6652,7 @@ class Obj5 { | ||
| 6626 | 6652 | "typedef" : obj5_typedef, |
| 6627 | 6653 | "typeof" : obj5_typeof, |
| 6628 | 6654 | "PrimitiveKind" : primitive_kind, |
| 6655 | + "select" : select, | |
| 6629 | 6656 | "Self" : self, |
| 6630 | 6657 | "Sendable" : sendable, |
| 6631 | 6658 | "SerialDescriptor" : serial_descriptor, |
| @@ -6660,6 +6687,7 @@ class Obj5 { | ||
| 6660 | 6687 | "TimeOnly" : time_only, |
| 6661 | 6688 | "TimeOnlyConverter" : time_only_converter, |
| 6662 | 6689 | "TimeZone" : time_zone, |
| 6690 | + "to_dict" : to_dict, | |
| 6663 | 6691 | "to_json" : to_json, |
| 6664 | 6692 | "toString" : to_string, |
| 6665 | 6693 | "top_level" : top_level, |
| @@ -6675,11 +6703,10 @@ class Obj5 { | ||
| 6675 | 6703 | "unchecked" : unchecked, |
| 6676 | 6704 | "undefined" : undefined, |
| 6677 | 6705 | "union" : union, |
| 6706 | + "UnmarshalJSON" : unmarshal_json, | |
| 6678 | 6707 | "unowned" : unowned, |
| 6679 | 6708 | "unsafe" : unsafe, |
| 6680 | - "unsigned" : unsigned, | |
| 6681 | 6709 | "UseSerializers" : use_serializers, |
| 6682 | - "ushort" : ushort, | |
| 6683 | 6710 | ]); |
| 6684 | 6711 | |
| 6685 | 6712 | return Standards.JSON.encode(json); |
| @@ -6711,6 +6738,8 @@ Obj5 Obj5_from_JSON(mixed json) { | ||
| 6711 | 6738 | retval.obj5_typeof = json["typeof"]; |
| 6712 | 6739 | if (!mappingp(json["PrimitiveKind"])) error("Expected object"); |
| 6713 | 6740 | retval.primitive_kind = json["PrimitiveKind"]; |
| 6741 | + if (!mappingp(json["select"])) error("Expected object"); | |
| 6742 | + retval.select = json["select"]; | |
| 6714 | 6743 | if (!mappingp(json["Self"])) error("Expected object"); |
| 6715 | 6744 | retval.self = json["Self"]; |
| 6716 | 6745 | if (!mappingp(json["Sendable"])) error("Expected object"); |
| @@ -6779,6 +6808,8 @@ Obj5 Obj5_from_JSON(mixed json) { | ||
| 6779 | 6808 | retval.time_only_converter = json["TimeOnlyConverter"]; |
| 6780 | 6809 | if (!mappingp(json["TimeZone"])) error("Expected object"); |
| 6781 | 6810 | retval.time_zone = json["TimeZone"]; |
| 6811 | + if (!mappingp(json["to_dict"])) error("Expected object"); | |
| 6812 | + retval.to_dict = json["to_dict"]; | |
| 6782 | 6813 | if (!mappingp(json["to_json"])) error("Expected object"); |
| 6783 | 6814 | retval.to_json = json["to_json"]; |
| 6784 | 6815 | if (!mappingp(json["toString"])) error("Expected object"); |
| @@ -6809,16 +6840,14 @@ Obj5 Obj5_from_JSON(mixed json) { | ||
| 6809 | 6840 | retval.undefined = json["undefined"]; |
| 6810 | 6841 | if (!mappingp(json["union"])) error("Expected object"); |
| 6811 | 6842 | retval.union = json["union"]; |
| 6843 | + if (!mappingp(json["UnmarshalJSON"])) error("Expected object"); | |
| 6844 | + retval.unmarshal_json = json["UnmarshalJSON"]; | |
| 6812 | 6845 | if (!mappingp(json["unowned"])) error("Expected object"); |
| 6813 | 6846 | retval.unowned = json["unowned"]; |
| 6814 | 6847 | if (!mappingp(json["unsafe"])) error("Expected object"); |
| 6815 | 6848 | retval.unsafe = json["unsafe"]; |
| 6816 | - if (!mappingp(json["unsigned"])) error("Expected object"); | |
| 6817 | - retval.unsigned = json["unsigned"]; | |
| 6818 | 6849 | if (!mappingp(json["UseSerializers"])) error("Expected object"); |
| 6819 | 6850 | retval.use_serializers = json["UseSerializers"]; |
| 6820 | - if (!mappingp(json["ushort"])) error("Expected object"); | |
| 6821 | - retval.ushort = json["ushort"]; | |
| 6822 | 6851 | |
| 6823 | 6852 | return retval; |
| 6824 | 6853 | } |
| @@ -7033,6 +7062,27 @@ PrimitiveKind PrimitiveKind_from_JSON(mixed json) { | ||
| 7033 | 7062 | return retval; |
| 7034 | 7063 | } |
| 7035 | 7064 | |
| 7065 | +class Select { | |
| 7066 | + int select; // json: "select" | |
| 7067 | + | |
| 7068 | + string encode_json() { | |
| 7069 | + mapping(string:mixed) json = ([ | |
| 7070 | + "select" : select, | |
| 7071 | + ]); | |
| 7072 | + | |
| 7073 | + return Standards.JSON.encode(json); | |
| 7074 | + } | |
| 7075 | +} | |
| 7076 | + | |
| 7077 | +Select Select_from_JSON(mixed json) { | |
| 7078 | + Select retval = Select(); | |
| 7079 | + | |
| 7080 | + if (!intp(json["select"])) error("Expected integer"); | |
| 7081 | + retval.select = json["select"]; | |
| 7082 | + | |
| 7083 | + return retval; | |
| 7084 | +} | |
| 7085 | + | |
| 7036 | 7086 | class Self { |
| 7037 | 7087 | int self; // json: "Self" |
| 7038 | 7088 | |
| @@ -7747,6 +7797,27 @@ TimeZone TimeZone_from_JSON(mixed json) { | ||
| 7747 | 7797 | return retval; |
| 7748 | 7798 | } |
| 7749 | 7799 | |
| 7800 | +class ToDict { | |
| 7801 | + int to_dict; // json: "to_dict" | |
| 7802 | + | |
| 7803 | + string encode_json() { | |
| 7804 | + mapping(string:mixed) json = ([ | |
| 7805 | + "to_dict" : to_dict, | |
| 7806 | + ]); | |
| 7807 | + | |
| 7808 | + return Standards.JSON.encode(json); | |
| 7809 | + } | |
| 7810 | +} | |
| 7811 | + | |
| 7812 | +ToDict ToDict_from_JSON(mixed json) { | |
| 7813 | + ToDict retval = ToDict(); | |
| 7814 | + | |
| 7815 | + if (!intp(json["to_dict"])) error("Expected integer"); | |
| 7816 | + retval.to_dict = json["to_dict"]; | |
| 7817 | + | |
| 7818 | + return retval; | |
| 7819 | +} | |
| 7820 | + | |
| 7750 | 7821 | class ToJson { |
| 7751 | 7822 | int to_json; // json: "to_json" |
| 7752 | 7823 | |
| @@ -8062,65 +8133,65 @@ Union Union_from_JSON(mixed json) { | ||
| 8062 | 8133 | return retval; |
| 8063 | 8134 | } |
| 8064 | 8135 | |
| 8065 | -class Unowned { | |
| 8066 | - int unowned; // json: "unowned" | |
| 8136 | +class UnmarshalJson { | |
| 8137 | + int unmarshal_json; // json: "UnmarshalJSON" | |
| 8067 | 8138 | |
| 8068 | 8139 | string encode_json() { |
| 8069 | 8140 | mapping(string:mixed) json = ([ |
| 8070 | - "unowned" : unowned, | |
| 8141 | + "UnmarshalJSON" : unmarshal_json, | |
| 8071 | 8142 | ]); |
| 8072 | 8143 | |
| 8073 | 8144 | return Standards.JSON.encode(json); |
| 8074 | 8145 | } |
| 8075 | 8146 | } |
| 8076 | 8147 | |
| 8077 | -Unowned Unowned_from_JSON(mixed json) { | |
| 8078 | - Unowned retval = Unowned(); | |
| 8148 | +UnmarshalJson UnmarshalJson_from_JSON(mixed json) { | |
| 8149 | + UnmarshalJson retval = UnmarshalJson(); | |
| 8079 | 8150 | |
| 8080 | - if (!intp(json["unowned"])) error("Expected integer"); | |
| 8081 | - retval.unowned = json["unowned"]; | |
| 8151 | + if (!intp(json["UnmarshalJSON"])) error("Expected integer"); | |
| 8152 | + retval.unmarshal_json = json["UnmarshalJSON"]; | |
| 8082 | 8153 | |
| 8083 | 8154 | return retval; |
| 8084 | 8155 | } |
| 8085 | 8156 | |
| 8086 | -class Unsafe { | |
| 8087 | - int unsafe; // json: "unsafe" | |
| 8157 | +class Unowned { | |
| 8158 | + int unowned; // json: "unowned" | |
| 8088 | 8159 | |
| 8089 | 8160 | string encode_json() { |
| 8090 | 8161 | mapping(string:mixed) json = ([ |
| 8091 | - "unsafe" : unsafe, | |
| 8162 | + "unowned" : unowned, | |
| 8092 | 8163 | ]); |
| 8093 | 8164 | |
| 8094 | 8165 | return Standards.JSON.encode(json); |
| 8095 | 8166 | } |
| 8096 | 8167 | } |
| 8097 | 8168 | |
| 8098 | -Unsafe Unsafe_from_JSON(mixed json) { | |
| 8099 | - Unsafe retval = Unsafe(); | |
| 8169 | +Unowned Unowned_from_JSON(mixed json) { | |
| 8170 | + Unowned retval = Unowned(); | |
| 8100 | 8171 | |
| 8101 | - if (!intp(json["unsafe"])) error("Expected integer"); | |
| 8102 | - retval.unsafe = json["unsafe"]; | |
| 8172 | + if (!intp(json["unowned"])) error("Expected integer"); | |
| 8173 | + retval.unowned = json["unowned"]; | |
| 8103 | 8174 | |
| 8104 | 8175 | return retval; |
| 8105 | 8176 | } |
| 8106 | 8177 | |
| 8107 | -class Unsigned { | |
| 8108 | - int unsigned; // json: "unsigned" | |
| 8178 | +class Unsafe { | |
| 8179 | + int unsafe; // json: "unsafe" | |
| 8109 | 8180 | |
| 8110 | 8181 | string encode_json() { |
| 8111 | 8182 | mapping(string:mixed) json = ([ |
| 8112 | - "unsigned" : unsigned, | |
| 8183 | + "unsafe" : unsafe, | |
| 8113 | 8184 | ]); |
| 8114 | 8185 | |
| 8115 | 8186 | return Standards.JSON.encode(json); |
| 8116 | 8187 | } |
| 8117 | 8188 | } |
| 8118 | 8189 | |
| 8119 | -Unsigned Unsigned_from_JSON(mixed json) { | |
| 8120 | - Unsigned retval = Unsigned(); | |
| 8190 | +Unsafe Unsafe_from_JSON(mixed json) { | |
| 8191 | + Unsafe retval = Unsafe(); | |
| 8121 | 8192 | |
| 8122 | - if (!intp(json["unsigned"])) error("Expected integer"); | |
| 8123 | - retval.unsigned = json["unsigned"]; | |
| 8193 | + if (!intp(json["unsafe"])) error("Expected integer"); | |
| 8194 | + retval.unsafe = json["unsafe"]; | |
| 8124 | 8195 | |
| 8125 | 8196 | return retval; |
| 8126 | 8197 | } |
| @@ -8146,31 +8217,12 @@ UseSerializers UseSerializers_from_JSON(mixed json) { | ||
| 8146 | 8217 | return retval; |
| 8147 | 8218 | } |
| 8148 | 8219 | |
| 8149 | -class Ushort { | |
| 8150 | - int ushort; // json: "ushort" | |
| 8151 | - | |
| 8152 | - string encode_json() { | |
| 8153 | - mapping(string:mixed) json = ([ | |
| 8154 | - "ushort" : ushort, | |
| 8155 | - ]); | |
| 8156 | - | |
| 8157 | - return Standards.JSON.encode(json); | |
| 8158 | - } | |
| 8159 | -} | |
| 8160 | - | |
| 8161 | -Ushort Ushort_from_JSON(mixed json) { | |
| 8162 | - Ushort retval = Ushort(); | |
| 8163 | - | |
| 8164 | - if (!intp(json["ushort"])) error("Expected integer"); | |
| 8165 | - retval.ushort = json["ushort"]; | |
| 8166 | - | |
| 8167 | - return retval; | |
| 8168 | -} | |
| 8169 | - | |
| 8170 | 8220 | class Obj6 { |
| 8171 | 8221 | int dummy; // json: "dummy" |
| 8172 | 8222 | Void obj6_void; // json: "void" |
| 8173 | 8223 | While obj6_while; // json: "while" |
| 8224 | + Unsigned unsigned; // json: "unsigned" | |
| 8225 | + Ushort ushort; // json: "ushort" | |
| 8174 | 8226 | Using using; // json: "using" |
| 8175 | 8227 | Utf8JsonReader utf8_json_reader; // json: "Utf8JsonReader" |
| 8176 | 8228 | Utf8JsonWriter utf8_json_writer; // json: "Utf8JsonWriter" |
| @@ -8193,6 +8245,8 @@ class Obj6 { | ||
| 8193 | 8245 | "dummy" : dummy, |
| 8194 | 8246 | "void" : obj6_void, |
| 8195 | 8247 | "while" : obj6_while, |
| 8248 | + "unsigned" : unsigned, | |
| 8249 | + "ushort" : ushort, | |
| 8196 | 8250 | "using" : using, |
| 8197 | 8251 | "Utf8JsonReader" : utf8_json_reader, |
| 8198 | 8252 | "Utf8JsonWriter" : utf8_json_writer, |
| @@ -8224,6 +8278,10 @@ Obj6 Obj6_from_JSON(mixed json) { | ||
| 8224 | 8278 | retval.obj6_void = json["void"]; |
| 8225 | 8279 | if (!mappingp(json["while"])) error("Expected object"); |
| 8226 | 8280 | retval.obj6_while = json["while"]; |
| 8281 | + if (!mappingp(json["unsigned"])) error("Expected object"); | |
| 8282 | + retval.unsigned = json["unsigned"]; | |
| 8283 | + if (!mappingp(json["ushort"])) error("Expected object"); | |
| 8284 | + retval.ushort = json["ushort"]; | |
| 8227 | 8285 | if (!mappingp(json["using"])) error("Expected object"); |
| 8228 | 8286 | retval.using = json["using"]; |
| 8229 | 8287 | if (!mappingp(json["Utf8JsonReader"])) error("Expected object"); |
| @@ -8302,6 +8360,48 @@ While While_from_JSON(mixed json) { | ||
| 8302 | 8360 | return retval; |
| 8303 | 8361 | } |
| 8304 | 8362 | |
| 8363 | +class Unsigned { | |
| 8364 | + int unsigned; // json: "unsigned" | |
| 8365 | + | |
| 8366 | + string encode_json() { | |
| 8367 | + mapping(string:mixed) json = ([ | |
| 8368 | + "unsigned" : unsigned, | |
| 8369 | + ]); | |
| 8370 | + | |
| 8371 | + return Standards.JSON.encode(json); | |
| 8372 | + } | |
| 8373 | +} | |
| 8374 | + | |
| 8375 | +Unsigned Unsigned_from_JSON(mixed json) { | |
| 8376 | + Unsigned retval = Unsigned(); | |
| 8377 | + | |
| 8378 | + if (!intp(json["unsigned"])) error("Expected integer"); | |
| 8379 | + retval.unsigned = json["unsigned"]; | |
| 8380 | + | |
| 8381 | + return retval; | |
| 8382 | +} | |
| 8383 | + | |
| 8384 | +class Ushort { | |
| 8385 | + int ushort; // json: "ushort" | |
| 8386 | + | |
| 8387 | + string encode_json() { | |
| 8388 | + mapping(string:mixed) json = ([ | |
| 8389 | + "ushort" : ushort, | |
| 8390 | + ]); | |
| 8391 | + | |
| 8392 | + return Standards.JSON.encode(json); | |
| 8393 | + } | |
| 8394 | +} | |
| 8395 | + | |
| 8396 | +Ushort Ushort_from_JSON(mixed json) { | |
| 8397 | + Ushort retval = Ushort(); | |
| 8398 | + | |
| 8399 | + if (!intp(json["ushort"])) error("Expected integer"); | |
| 8400 | + retval.ushort = json["ushort"]; | |
| 8401 | + | |
| 8402 | + return retval; | |
| 8403 | +} | |
| 8404 | + | |
| 8305 | 8405 | class Using { |
| 8306 | 8406 | int using; // json: "using" |
Mpythondefault / quicktype.py+176 −100
| @@ -2092,22 +2092,6 @@ class Go: | ||
| 2092 | 2092 | return result |
| 2093 | 2093 | |
| 2094 | 2094 | |
| 2095 | -@dataclass | |
| 2096 | -class Goto: | |
| 2097 | - goto: int | |
| 2098 | - | |
| 2099 | - @staticmethod | |
| 2100 | - def from_dict(obj: Any) -> 'Goto': | |
| 2101 | - assert isinstance(obj, dict) | |
| 2102 | - goto = from_int(obj["goto"]) | |
| 2103 | - return Goto(goto) | |
| 2104 | - | |
| 2105 | - def to_dict(self) -> dict: | |
| 2106 | - result: dict = {} | |
| 2107 | - result["goto"] = from_int(self.goto) | |
| 2108 | - return result | |
| 2109 | - | |
| 2110 | - | |
| 2111 | 2095 | @dataclass |
| 2112 | 2096 | class Def: |
| 2113 | 2097 | def_def: int |
| @@ -2284,6 +2268,22 @@ class From: | ||
| 2284 | 2268 | return result |
| 2285 | 2269 | |
| 2286 | 2270 | |
| 2271 | +@dataclass | |
| 2272 | +class FromDict: | |
| 2273 | + from_dict_from_dict: int | |
| 2274 | + | |
| 2275 | + @staticmethod | |
| 2276 | + def from_dict(obj: Any) -> 'FromDict': | |
| 2277 | + assert isinstance(obj, dict) | |
| 2278 | + from_dict_from_dict = from_int(obj["from_dict"]) | |
| 2279 | + return FromDict(from_dict_from_dict) | |
| 2280 | + | |
| 2281 | + def to_dict(self) -> dict: | |
| 2282 | + result: dict = {} | |
| 2283 | + result["from_dict"] = from_int(self.from_dict_from_dict) | |
| 2284 | + return result | |
| 2285 | + | |
| 2286 | + | |
| 2287 | 2287 | @dataclass |
| 2288 | 2288 | class Global: |
| 2289 | 2289 | global_global: int |
| @@ -2360,13 +2360,13 @@ class Obj2: | ||
| 2360 | 2360 | foreach: Foreach |
| 2361 | 2361 | friend: Friend |
| 2362 | 2362 | obj2_from: From |
| 2363 | + obj2_from_dict: FromDict | |
| 2363 | 2364 | from_json: FromJSON |
| 2364 | 2365 | func: Func |
| 2365 | 2366 | function: Function |
| 2366 | 2367 | get: Get |
| 2367 | 2368 | obj2_global: Global |
| 2368 | 2369 | go: Go |
| 2369 | - goto: Goto | |
| 2370 | 2370 | |
| 2371 | 2371 | @staticmethod |
| 2372 | 2372 | def from_dict(obj: Any) -> 'Obj2': |
| @@ -2429,14 +2429,14 @@ class Obj2: | ||
| 2429 | 2429 | foreach = Foreach.from_dict(obj["foreach"]) |
| 2430 | 2430 | friend = Friend.from_dict(obj["friend"]) |
| 2431 | 2431 | obj2_from = From.from_dict(obj["from"]) |
| 2432 | + obj2_from_dict = FromDict.from_dict(obj["from_dict"]) | |
| 2432 | 2433 | from_json = FromJSON.from_dict(obj["from_json"]) |
| 2433 | 2434 | func = Func.from_dict(obj["func"]) |
| 2434 | 2435 | function = Function.from_dict(obj["function"]) |
| 2435 | 2436 | get = Get.from_dict(obj["get"]) |
| 2436 | 2437 | obj2_global = Global.from_dict(obj["global"]) |
| 2437 | 2438 | go = Go.from_dict(obj["go"]) |
| 2438 | - goto = Goto.from_dict(obj["goto"]) | |
| 2439 | - return Obj2(date_formatter, date_only, date_only_converter, date_time, date_time_styles, decoder, decoding_error, encoder, enum_values, equatable, false, format_exception, date_parse_handling, debugger, decimal, declare, decltype, decode_string, obj2_def, default, defer, deinit, obj2_del, delegate, delete, obj2_dict, dictionary, did_set, do, double, dummy, dynamic, dynamic_cast, obj2_elif, obj2_else, encode_quick_type, enum, equality_contract, event, obj2_except, exception, explicit, export, exposing, extends, extension, extern, fallthrough, obj2_false, fileprivate, final, obj2_finally, fixed, obj2_float, obj2_for, foreach, friend, obj2_from, from_json, func, function, get, obj2_global, go, goto) | |
| 2439 | + return Obj2(date_formatter, date_only, date_only_converter, date_time, date_time_styles, decoder, decoding_error, encoder, enum_values, equatable, false, format_exception, date_parse_handling, debugger, decimal, declare, decltype, decode_string, obj2_def, default, defer, deinit, obj2_del, delegate, delete, obj2_dict, dictionary, did_set, do, double, dummy, dynamic, dynamic_cast, obj2_elif, obj2_else, encode_quick_type, enum, equality_contract, event, obj2_except, exception, explicit, export, exposing, extends, extension, extern, fallthrough, obj2_false, fileprivate, final, obj2_finally, fixed, obj2_float, obj2_for, foreach, friend, obj2_from, obj2_from_dict, from_json, func, function, get, obj2_global, go) | |
| 2440 | 2440 | |
| 2441 | 2441 | def to_dict(self) -> dict: |
| 2442 | 2442 | result: dict = {} |
| @@ -2498,13 +2498,29 @@ class Obj2: | ||
| 2498 | 2498 | result["foreach"] = to_class(Foreach, self.foreach) |
| 2499 | 2499 | result["friend"] = to_class(Friend, self.friend) |
| 2500 | 2500 | result["from"] = to_class(From, self.obj2_from) |
| 2501 | + result["from_dict"] = to_class(FromDict, self.obj2_from_dict) | |
| 2501 | 2502 | result["from_json"] = to_class(FromJSON, self.from_json) |
| 2502 | 2503 | result["func"] = to_class(Func, self.func) |
| 2503 | 2504 | result["function"] = to_class(Function, self.function) |
| 2504 | 2505 | result["get"] = to_class(Get, self.get) |
| 2505 | 2506 | result["global"] = to_class(Global, self.obj2_global) |
| 2506 | 2507 | result["go"] = to_class(Go, self.go) |
| 2507 | - result["goto"] = to_class(Goto, self.goto) | |
| 2508 | + return result | |
| 2509 | + | |
| 2510 | + | |
| 2511 | +@dataclass | |
| 2512 | +class Goto: | |
| 2513 | + goto: int | |
| 2514 | + | |
| 2515 | + @staticmethod | |
| 2516 | + def from_dict(obj: Any) -> 'Goto': | |
| 2517 | + assert isinstance(obj, dict) | |
| 2518 | + goto = from_int(obj["goto"]) | |
| 2519 | + return Goto(goto) | |
| 2520 | + | |
| 2521 | + def to_dict(self) -> dict: | |
| 2522 | + result: dict = {} | |
| 2523 | + result["goto"] = from_int(self.goto) | |
| 2508 | 2524 | return result |
| 2509 | 2525 | |
| 2510 | 2526 | |
| @@ -3260,6 +3276,22 @@ class MapEntry: | ||
| 3260 | 3276 | return result |
| 3261 | 3277 | |
| 3262 | 3278 | |
| 3279 | +@dataclass | |
| 3280 | +class MarshalJSON: | |
| 3281 | + marshal_json: int | |
| 3282 | + | |
| 3283 | + @staticmethod | |
| 3284 | + def from_dict(obj: Any) -> 'MarshalJSON': | |
| 3285 | + assert isinstance(obj, dict) | |
| 3286 | + marshal_json = from_int(obj["MarshalJSON"]) | |
| 3287 | + return MarshalJSON(marshal_json) | |
| 3288 | + | |
| 3289 | + def to_dict(self) -> dict: | |
| 3290 | + result: dict = {} | |
| 3291 | + result["MarshalJSON"] = from_int(self.marshal_json) | |
| 3292 | + return result | |
| 3293 | + | |
| 3294 | + | |
| 3263 | 3295 | @dataclass |
| 3264 | 3296 | class MetadataPropertyHandling: |
| 3265 | 3297 | metadata_property_handling: int |
| @@ -3420,22 +3452,6 @@ class No: | ||
| 3420 | 3452 | return result |
| 3421 | 3453 | |
| 3422 | 3454 | |
| 3423 | -@dataclass | |
| 3424 | -class Noexcept: | |
| 3425 | - noexcept: int | |
| 3426 | - | |
| 3427 | - @staticmethod | |
| 3428 | - def from_dict(obj: Any) -> 'Noexcept': | |
| 3429 | - assert isinstance(obj, dict) | |
| 3430 | - noexcept = from_int(obj["noexcept"]) | |
| 3431 | - return Noexcept(noexcept) | |
| 3432 | - | |
| 3433 | - def to_dict(self) -> dict: | |
| 3434 | - result: dict = {} | |
| 3435 | - result["noexcept"] = from_int(self.noexcept) | |
| 3436 | - return result | |
| 3437 | - | |
| 3438 | - | |
| 3439 | 3455 | @dataclass |
| 3440 | 3456 | class If: |
| 3441 | 3457 | if_if: int |
| @@ -3551,8 +3567,10 @@ class Obj3: | ||
| 3551 | 3567 | json_token_type: JSONTokenType |
| 3552 | 3568 | locale: Locale |
| 3553 | 3569 | map_entry: MapEntry |
| 3570 | + marshal_json: MarshalJSON | |
| 3554 | 3571 | no: No |
| 3555 | 3572 | dummy: int |
| 3573 | + goto: Goto | |
| 3556 | 3574 | guard: Guard |
| 3557 | 3575 | has_own_property: HasOwnProperty |
| 3558 | 3576 | hash_code: HashCode |
| @@ -3598,7 +3616,6 @@ class Obj3: | ||
| 3598 | 3616 | new: New |
| 3599 | 3617 | newtonsoft: Newtonsoft |
| 3600 | 3618 | nil: Nil |
| 3601 | - noexcept: Noexcept | |
| 3602 | 3619 | |
| 3603 | 3620 | @staticmethod |
| 3604 | 3621 | def from_dict(obj: Any) -> 'Obj3': |
| @@ -3620,8 +3637,10 @@ class Obj3: | ||
| 3620 | 3637 | json_token_type = JSONTokenType.from_dict(obj["JsonTokenType"]) |
| 3621 | 3638 | locale = Locale.from_dict(obj["Locale"]) |
| 3622 | 3639 | map_entry = MapEntry.from_dict(obj["MapEntry"]) |
| 3640 | + marshal_json = MarshalJSON.from_dict(obj["MarshalJSON"]) | |
| 3623 | 3641 | no = No.from_dict(obj["NO"]) |
| 3624 | 3642 | dummy = from_int(obj["dummy"]) |
| 3643 | + goto = Goto.from_dict(obj["goto"]) | |
| 3625 | 3644 | guard = Guard.from_dict(obj["guard"]) |
| 3626 | 3645 | has_own_property = HasOwnProperty.from_dict(obj["hasOwnProperty"]) |
| 3627 | 3646 | hash_code = HashCode.from_dict(obj["hashCode"]) |
| @@ -3667,8 +3686,7 @@ class Obj3: | ||
| 3667 | 3686 | new = New.from_dict(obj["new"]) |
| 3668 | 3687 | newtonsoft = Newtonsoft.from_dict(obj["newtonsoft"]) |
| 3669 | 3688 | nil = Nil.from_dict(obj["nil"]) |
| 3670 | - noexcept = Noexcept.from_dict(obj["noexcept"]) | |
| 3671 | - return Obj3(hashable, hasher, imp, iso_date_time_offset_converter, json_any, json_coding_key, json_decoder, json_encoder, json_null, json_exception, json_generator, json_node, json_parser, json_reader, json_token_type, locale, map_entry, no, dummy, guard, has_own_property, hash_code, id, obj3_if, implements, implicit, obj3_import, obj3_in, indirect, infix, init, inline, inout, instanceof, obj3_int, interface, internal, obj3_is, iterable, jdec, jenc, jpipe, json, json_converter, json_serializer, json_token, json_writer, obj3_lambda, lazy, left, let, list, lock, long, map, metadata_property_handling, module, mutable, mutating, namespace, native, new, newtonsoft, nil, noexcept) | |
| 3689 | + return Obj3(hashable, hasher, imp, iso_date_time_offset_converter, json_any, json_coding_key, json_decoder, json_encoder, json_null, json_exception, json_generator, json_node, json_parser, json_reader, json_token_type, locale, map_entry, marshal_json, no, dummy, goto, guard, has_own_property, hash_code, id, obj3_if, implements, implicit, obj3_import, obj3_in, indirect, infix, init, inline, inout, instanceof, obj3_int, interface, internal, obj3_is, iterable, jdec, jenc, jpipe, json, json_converter, json_serializer, json_token, json_writer, obj3_lambda, lazy, left, let, list, lock, long, map, metadata_property_handling, module, mutable, mutating, namespace, native, new, newtonsoft, nil) | |
| 3672 | 3690 | |
| 3673 | 3691 | def to_dict(self) -> dict: |
| 3674 | 3692 | result: dict = {} |
| @@ -3689,8 +3707,10 @@ class Obj3: | ||
| 3689 | 3707 | result["JsonTokenType"] = to_class(JSONTokenType, self.json_token_type) |
| 3690 | 3708 | result["Locale"] = to_class(Locale, self.locale) |
| 3691 | 3709 | result["MapEntry"] = to_class(MapEntry, self.map_entry) |
| 3710 | + result["MarshalJSON"] = to_class(MarshalJSON, self.marshal_json) | |
| 3692 | 3711 | result["NO"] = to_class(No, self.no) |
| 3693 | 3712 | result["dummy"] = from_int(self.dummy) |
| 3713 | + result["goto"] = to_class(Goto, self.goto) | |
| 3694 | 3714 | result["guard"] = to_class(Guard, self.guard) |
| 3695 | 3715 | result["hasOwnProperty"] = to_class(HasOwnProperty, self.has_own_property) |
| 3696 | 3716 | result["hashCode"] = to_class(HashCode, self.hash_code) |
| @@ -3736,7 +3756,6 @@ class Obj3: | ||
| 3736 | 3756 | result["new"] = to_class(New, self.new) |
| 3737 | 3757 | result["newtonsoft"] = to_class(Newtonsoft, self.newtonsoft) |
| 3738 | 3758 | result["nil"] = to_class(Nil, self.nil) |
| 3739 | - result["noexcept"] = to_class(Noexcept, self.noexcept) | |
| 3740 | 3759 | return result |
| 3741 | 3760 | |
| 3742 | 3761 | |
| @@ -3756,6 +3775,22 @@ class NoSuchMethod: | ||
| 3756 | 3775 | return result |
| 3757 | 3776 | |
| 3758 | 3777 | |
| 3778 | +@dataclass | |
| 3779 | +class Noexcept: | |
| 3780 | + noexcept: int | |
| 3781 | + | |
| 3782 | + @staticmethod | |
| 3783 | + def from_dict(obj: Any) -> 'Noexcept': | |
| 3784 | + assert isinstance(obj, dict) | |
| 3785 | + noexcept = from_int(obj["noexcept"]) | |
| 3786 | + return Noexcept(noexcept) | |
| 3787 | + | |
| 3788 | + def to_dict(self) -> dict: | |
| 3789 | + result: dict = {} | |
| 3790 | + result["noexcept"] = from_int(self.noexcept) | |
| 3791 | + return result | |
| 3792 | + | |
| 3793 | + | |
| 3759 | 3794 | @dataclass |
| 3760 | 3795 | class Nonatomic: |
| 3761 | 3796 | nonatomic: int |
| @@ -4748,22 +4783,6 @@ class Sel: | ||
| 4748 | 4783 | return result |
| 4749 | 4784 | |
| 4750 | 4785 | |
| 4751 | -@dataclass | |
| 4752 | -class Select: | |
| 4753 | - select: int | |
| 4754 | - | |
| 4755 | - @staticmethod | |
| 4756 | - def from_dict(obj: Any) -> 'Select': | |
| 4757 | - assert isinstance(obj, dict) | |
| 4758 | - select = from_int(obj["select"]) | |
| 4759 | - return Select(select) | |
| 4760 | - | |
| 4761 | - def to_dict(self) -> dict: | |
| 4762 | - result: dict = {} | |
| 4763 | - result["select"] = from_int(self.select) | |
| 4764 | - return result | |
| 4765 | - | |
| 4766 | - | |
| 4767 | 4786 | @dataclass |
| 4768 | 4787 | class Obj4: |
| 4769 | 4788 | ns_error: NSError |
| @@ -4777,6 +4796,7 @@ class Obj4: | ||
| 4777 | 4796 | sel: Sel |
| 4778 | 4797 | dummy: int |
| 4779 | 4798 | no_such_method: NoSuchMethod |
| 4799 | + noexcept: Noexcept | |
| 4780 | 4800 | nonatomic: Nonatomic |
| 4781 | 4801 | obj4_none: Obj4None |
| 4782 | 4802 | obj4_nonlocal: Nonlocal |
| @@ -4830,7 +4850,6 @@ class Obj4: | ||
| 4830 | 4850 | s: S |
| 4831 | 4851 | sbyte: Sbyte |
| 4832 | 4852 | sealed: Sealed |
| 4833 | - select: Select | |
| 4834 | 4853 | |
| 4835 | 4854 | @staticmethod |
| 4836 | 4855 | def from_dict(obj: Any) -> 'Obj4': |
| @@ -4846,6 +4865,7 @@ class Obj4: | ||
| 4846 | 4865 | sel = Sel.from_dict(obj["SEL"]) |
| 4847 | 4866 | dummy = from_int(obj["dummy"]) |
| 4848 | 4867 | no_such_method = NoSuchMethod.from_dict(obj["noSuchMethod"]) |
| 4868 | + noexcept = Noexcept.from_dict(obj["noexcept"]) | |
| 4849 | 4869 | nonatomic = Nonatomic.from_dict(obj["nonatomic"]) |
| 4850 | 4870 | obj4_none = Obj4None.from_dict(obj["none"]) |
| 4851 | 4871 | obj4_nonlocal = Nonlocal.from_dict(obj["nonlocal"]) |
| @@ -4899,8 +4919,7 @@ class Obj4: | ||
| 4899 | 4919 | s = S.from_dict(obj["s"]) |
| 4900 | 4920 | sbyte = Sbyte.from_dict(obj["sbyte"]) |
| 4901 | 4921 | sealed = Sealed.from_dict(obj["sealed"]) |
| 4902 | - select = Select.from_dict(obj["select"]) | |
| 4903 | - return Obj4(ns_error, ns_object, ns_string, null, none, object_mapper, protocol, reg_exp, sel, dummy, no_such_method, nonatomic, obj4_none, obj4_nonlocal, nonmutating, obj4_not, not_eq, obj4_null, nullptr, number, object, of, oneway, open, operator, optional, obj4_or, or_eq, out, override, package, params, obj4_pass, port, postfix, precedence, prefix, obj4_print, print_members, printf, private, protected, obj4_protocol, public, quicktype, obj4_raise, range, readonly, ref, register, reinterpret_cast, repeat, require, required, requires, restrict, retain, rethrows, obj4_return, right, runtime_type, s, sbyte, sealed, select) | |
| 4922 | + return Obj4(ns_error, ns_object, ns_string, null, none, object_mapper, protocol, reg_exp, sel, dummy, no_such_method, noexcept, nonatomic, obj4_none, obj4_nonlocal, nonmutating, obj4_not, not_eq, obj4_null, nullptr, number, object, of, oneway, open, operator, optional, obj4_or, or_eq, out, override, package, params, obj4_pass, port, postfix, precedence, prefix, obj4_print, print_members, printf, private, protected, obj4_protocol, public, quicktype, obj4_raise, range, readonly, ref, register, reinterpret_cast, repeat, require, required, requires, restrict, retain, rethrows, obj4_return, right, runtime_type, s, sbyte, sealed) | |
| 4904 | 4923 | |
| 4905 | 4924 | def to_dict(self) -> dict: |
| 4906 | 4925 | result: dict = {} |
| @@ -4915,6 +4934,7 @@ class Obj4: | ||
| 4915 | 4934 | result["SEL"] = to_class(Sel, self.sel) |
| 4916 | 4935 | result["dummy"] = from_int(self.dummy) |
| 4917 | 4936 | result["noSuchMethod"] = to_class(NoSuchMethod, self.no_such_method) |
| 4937 | + result["noexcept"] = to_class(Noexcept, self.noexcept) | |
| 4918 | 4938 | result["nonatomic"] = to_class(Nonatomic, self.nonatomic) |
| 4919 | 4939 | result["none"] = to_class(Obj4None, self.obj4_none) |
| 4920 | 4940 | result["nonlocal"] = to_class(Nonlocal, self.obj4_nonlocal) |
| @@ -4968,7 +4988,6 @@ class Obj4: | ||
| 4968 | 4988 | result["s"] = to_class(S, self.s) |
| 4969 | 4989 | result["sbyte"] = to_class(Sbyte, self.sbyte) |
| 4970 | 4990 | result["sealed"] = to_class(Sealed, self.sealed) |
| 4971 | - result["select"] = to_class(Select, self.select) | |
| 4972 | 4991 | return result |
| 4973 | 4992 | |
| 4974 | 4993 | |
| @@ -5004,6 +5023,22 @@ class Self: | ||
| 5004 | 5023 | return result |
| 5005 | 5024 | |
| 5006 | 5025 | |
| 5026 | +@dataclass | |
| 5027 | +class ToDict: | |
| 5028 | + to_dict_to_dict: int | |
| 5029 | + | |
| 5030 | + @staticmethod | |
| 5031 | + def from_dict(obj: Any) -> 'ToDict': | |
| 5032 | + assert isinstance(obj, dict) | |
| 5033 | + to_dict_to_dict = from_int(obj["to_dict"]) | |
| 5034 | + return ToDict(to_dict_to_dict) | |
| 5035 | + | |
| 5036 | + def to_dict(self) -> dict: | |
| 5037 | + result: dict = {} | |
| 5038 | + result["to_dict"] = from_int(self.to_dict_to_dict) | |
| 5039 | + return result | |
| 5040 | + | |
| 5041 | + | |
| 5007 | 5042 | @dataclass |
| 5008 | 5043 | class Obj5True: |
| 5009 | 5044 | true: int |
| @@ -5084,6 +5119,22 @@ class SelfClass: | ||
| 5084 | 5119 | return result |
| 5085 | 5120 | |
| 5086 | 5121 | |
| 5122 | +@dataclass | |
| 5123 | +class Select: | |
| 5124 | + select: int | |
| 5125 | + | |
| 5126 | + @staticmethod | |
| 5127 | + def from_dict(obj: Any) -> 'Select': | |
| 5128 | + assert isinstance(obj, dict) | |
| 5129 | + select = from_int(obj["select"]) | |
| 5130 | + return Select(select) | |
| 5131 | + | |
| 5132 | + def to_dict(self) -> dict: | |
| 5133 | + result: dict = {} | |
| 5134 | + result["select"] = from_int(self.select) | |
| 5135 | + return result | |
| 5136 | + | |
| 5137 | + | |
| 5087 | 5138 | @dataclass |
| 5088 | 5139 | class Sendable: |
| 5089 | 5140 | sendable: int |
| @@ -5916,6 +5967,22 @@ class UnionClass: | ||
| 5916 | 5967 | return result |
| 5917 | 5968 | |
| 5918 | 5969 | |
| 5970 | +@dataclass | |
| 5971 | +class UnmarshalJSON: | |
| 5972 | + unmarshal_json: int | |
| 5973 | + | |
| 5974 | + @staticmethod | |
| 5975 | + def from_dict(obj: Any) -> 'UnmarshalJSON': | |
| 5976 | + assert isinstance(obj, dict) | |
| 5977 | + unmarshal_json = from_int(obj["UnmarshalJSON"]) | |
| 5978 | + return UnmarshalJSON(unmarshal_json) | |
| 5979 | + | |
| 5980 | + def to_dict(self) -> dict: | |
| 5981 | + result: dict = {} | |
| 5982 | + result["UnmarshalJSON"] = from_int(self.unmarshal_json) | |
| 5983 | + return result | |
| 5984 | + | |
| 5985 | + | |
| 5919 | 5986 | @dataclass |
| 5920 | 5987 | class Unowned: |
| 5921 | 5988 | unowned: int |
| @@ -5948,22 +6015,6 @@ class Unsafe: | ||
| 5948 | 6015 | return result |
| 5949 | 6016 | |
| 5950 | 6017 | |
| 5951 | -@dataclass | |
| 5952 | -class Unsigned: | |
| 5953 | - unsigned: int | |
| 5954 | - | |
| 5955 | - @staticmethod | |
| 5956 | - def from_dict(obj: Any) -> 'Unsigned': | |
| 5957 | - assert isinstance(obj, dict) | |
| 5958 | - unsigned = from_int(obj["unsigned"]) | |
| 5959 | - return Unsigned(unsigned) | |
| 5960 | - | |
| 5961 | - def to_dict(self) -> dict: | |
| 5962 | - result: dict = {} | |
| 5963 | - result["unsigned"] = from_int(self.unsigned) | |
| 5964 | - return result | |
| 5965 | - | |
| 5966 | - | |
| 5967 | 6018 | @dataclass |
| 5968 | 6019 | class UseSerializers: |
| 5969 | 6020 | use_serializers: int |
| @@ -5980,22 +6031,6 @@ class UseSerializers: | ||
| 5980 | 6031 | return result |
| 5981 | 6032 | |
| 5982 | 6033 | |
| 5983 | -@dataclass | |
| 5984 | -class Ushort: | |
| 5985 | - ushort: int | |
| 5986 | - | |
| 5987 | - @staticmethod | |
| 5988 | - def from_dict(obj: Any) -> 'Ushort': | |
| 5989 | - assert isinstance(obj, dict) | |
| 5990 | - ushort = from_int(obj["ushort"]) | |
| 5991 | - return Ushort(ushort) | |
| 5992 | - | |
| 5993 | - def to_dict(self) -> dict: | |
| 5994 | - result: dict = {} | |
| 5995 | - result["ushort"] = from_int(self.ushort) | |
| 5996 | - return result | |
| 5997 | - | |
| 5998 | - | |
| 5999 | 6034 | @dataclass |
| 6000 | 6035 | class Obj5: |
| 6001 | 6036 | k_serializer: KSerializer |
| @@ -6015,8 +6050,10 @@ class Obj5: | ||
| 6015 | 6050 | time_zone: TimeZone |
| 6016 | 6051 | true: TrueClass |
| 6017 | 6052 | type: TypeClass |
| 6053 | + unmarshal_json: UnmarshalJSON | |
| 6018 | 6054 | use_serializers: UseSerializers |
| 6019 | 6055 | dummy: int |
| 6056 | + select: Select | |
| 6020 | 6057 | purple_self: SelfClass |
| 6021 | 6058 | serialize: Serialize |
| 6022 | 6059 | set: Set |
| @@ -6043,6 +6080,7 @@ class Obj5: | ||
| 6043 | 6080 | throw: Throw |
| 6044 | 6081 | throws: Throws |
| 6045 | 6082 | to_string: ToString |
| 6083 | + obj5_to_dict: ToDict | |
| 6046 | 6084 | to_json: ToJSON |
| 6047 | 6085 | top_level: TopLevelClass |
| 6048 | 6086 | transient: Transient |
| @@ -6061,8 +6099,6 @@ class Obj5: | ||
| 6061 | 6099 | union: UnionClass |
| 6062 | 6100 | unowned: Unowned |
| 6063 | 6101 | unsafe: Unsafe |
| 6064 | - unsigned: Unsigned | |
| 6065 | - ushort: Ushort | |
| 6066 | 6102 | |
| 6067 | 6103 | @staticmethod |
| 6068 | 6104 | def from_dict(obj: Any) -> 'Obj5': |
| @@ -6084,8 +6120,10 @@ class Obj5: | ||
| 6084 | 6120 | time_zone = TimeZone.from_dict(obj["TimeZone"]) |
| 6085 | 6121 | true = TrueClass.from_dict(obj["True"]) |
| 6086 | 6122 | type = TypeClass.from_dict(obj["Type"]) |
| 6123 | + unmarshal_json = UnmarshalJSON.from_dict(obj["UnmarshalJSON"]) | |
| 6087 | 6124 | use_serializers = UseSerializers.from_dict(obj["UseSerializers"]) |
| 6088 | 6125 | dummy = from_int(obj["dummy"]) |
| 6126 | + select = Select.from_dict(obj["select"]) | |
| 6089 | 6127 | purple_self = SelfClass.from_dict(obj["self"]) |
| 6090 | 6128 | serialize = Serialize.from_dict(obj["serialize"]) |
| 6091 | 6129 | set = Set.from_dict(obj["set"]) |
| @@ -6112,6 +6150,7 @@ class Obj5: | ||
| 6112 | 6150 | throw = Throw.from_dict(obj["throw"]) |
| 6113 | 6151 | throws = Throws.from_dict(obj["throws"]) |
| 6114 | 6152 | to_string = ToString.from_dict(obj["toString"]) |
| 6153 | + obj5_to_dict = ToDict.from_dict(obj["to_dict"]) | |
| 6115 | 6154 | to_json = ToJSON.from_dict(obj["to_json"]) |
| 6116 | 6155 | top_level = TopLevelClass.from_dict(obj["top_level"]) |
| 6117 | 6156 | transient = Transient.from_dict(obj["transient"]) |
| @@ -6130,9 +6169,7 @@ class Obj5: | ||
| 6130 | 6169 | union = UnionClass.from_dict(obj["union"]) |
| 6131 | 6170 | unowned = Unowned.from_dict(obj["unowned"]) |
| 6132 | 6171 | unsafe = Unsafe.from_dict(obj["unsafe"]) |
| 6133 | - unsigned = Unsigned.from_dict(obj["unsigned"]) | |
| 6134 | - ushort = Ushort.from_dict(obj["ushort"]) | |
| 6135 | - return Obj5(k_serializer, primitive_kind, obj5_self, sendable, serial_descriptor, serial_name, serializable, serializer_provider, simple_module, standards, std_deserializer, std_serializer, time_only, time_only_converter, time_zone, true, type, use_serializers, dummy, purple_self, serialize, set, short, signed, sizeof, stackalloc, static, static_assert, static_cast, strictfp, string, struct, subscript, super, switch, symbol, synchronized, system, template, then, this, thread_local, throw, throws, to_string, to_json, top_level, transient, obj5_true, obj5_try, obj5_type, typealias, typedef, typeid, typename, typeof, uint, ulong, unchecked, undefined, union, unowned, unsafe, unsigned, ushort) | |
| 6172 | + return Obj5(k_serializer, primitive_kind, obj5_self, sendable, serial_descriptor, serial_name, serializable, serializer_provider, simple_module, standards, std_deserializer, std_serializer, time_only, time_only_converter, time_zone, true, type, unmarshal_json, use_serializers, dummy, select, purple_self, serialize, set, short, signed, sizeof, stackalloc, static, static_assert, static_cast, strictfp, string, struct, subscript, super, switch, symbol, synchronized, system, template, then, this, thread_local, throw, throws, to_string, obj5_to_dict, to_json, top_level, transient, obj5_true, obj5_try, obj5_type, typealias, typedef, typeid, typename, typeof, uint, ulong, unchecked, undefined, union, unowned, unsafe) | |
| 6136 | 6173 | |
| 6137 | 6174 | def to_dict(self) -> dict: |
| 6138 | 6175 | result: dict = {} |
| @@ -6153,8 +6190,10 @@ class Obj5: | ||
| 6153 | 6190 | result["TimeZone"] = to_class(TimeZone, self.time_zone) |
| 6154 | 6191 | result["True"] = to_class(TrueClass, self.true) |
| 6155 | 6192 | result["Type"] = to_class(TypeClass, self.type) |
| 6193 | + result["UnmarshalJSON"] = to_class(UnmarshalJSON, self.unmarshal_json) | |
| 6156 | 6194 | result["UseSerializers"] = to_class(UseSerializers, self.use_serializers) |
| 6157 | 6195 | result["dummy"] = from_int(self.dummy) |
| 6196 | + result["select"] = to_class(Select, self.select) | |
| 6158 | 6197 | result["self"] = to_class(SelfClass, self.purple_self) |
| 6159 | 6198 | result["serialize"] = to_class(Serialize, self.serialize) |
| 6160 | 6199 | result["set"] = to_class(Set, self.set) |
| @@ -6181,6 +6220,7 @@ class Obj5: | ||
| 6181 | 6220 | result["throw"] = to_class(Throw, self.throw) |
| 6182 | 6221 | result["throws"] = to_class(Throws, self.throws) |
| 6183 | 6222 | result["toString"] = to_class(ToString, self.to_string) |
| 6223 | + result["to_dict"] = to_class(ToDict, self.obj5_to_dict) | |
| 6184 | 6224 | result["to_json"] = to_class(ToJSON, self.to_json) |
| 6185 | 6225 | result["top_level"] = to_class(TopLevelClass, self.top_level) |
| 6186 | 6226 | result["transient"] = to_class(Transient, self.transient) |
| @@ -6199,8 +6239,6 @@ class Obj5: | ||
| 6199 | 6239 | result["union"] = to_class(UnionClass, self.union) |
| 6200 | 6240 | result["unowned"] = to_class(Unowned, self.unowned) |
| 6201 | 6241 | result["unsafe"] = to_class(Unsafe, self.unsafe) |
| 6202 | - result["unsigned"] = to_class(Unsigned, self.unsigned) | |
| 6203 | - result["ushort"] = to_class(Ushort, self.ushort) | |
| 6204 | 6242 | return result |
| 6205 | 6243 | |
| 6206 | 6244 | |
| @@ -6252,6 +6290,38 @@ class Yield: | ||
| 6252 | 6290 | return result |
| 6253 | 6291 | |
| 6254 | 6292 | |
| 6293 | +@dataclass | |
| 6294 | +class Unsigned: | |
| 6295 | + unsigned: int | |
| 6296 | + | |
| 6297 | + @staticmethod | |
| 6298 | + def from_dict(obj: Any) -> 'Unsigned': | |
| 6299 | + assert isinstance(obj, dict) | |
| 6300 | + unsigned = from_int(obj["unsigned"]) | |
| 6301 | + return Unsigned(unsigned) | |
| 6302 | + | |
| 6303 | + def to_dict(self) -> dict: | |
| 6304 | + result: dict = {} | |
| 6305 | + result["unsigned"] = from_int(self.unsigned) | |
| 6306 | + return result | |
| 6307 | + | |
| 6308 | + | |
| 6309 | +@dataclass | |
| 6310 | +class Ushort: | |
| 6311 | + ushort: int | |
| 6312 | + | |
| 6313 | + @staticmethod | |
| 6314 | + def from_dict(obj: Any) -> 'Ushort': | |
| 6315 | + assert isinstance(obj, dict) | |
| 6316 | + ushort = from_int(obj["ushort"]) | |
| 6317 | + return Ushort(ushort) | |
| 6318 | + | |
| 6319 | + def to_dict(self) -> dict: | |
| 6320 | + result: dict = {} | |
| 6321 | + result["ushort"] = from_int(self.ushort) | |
| 6322 | + return result | |
| 6323 | + | |
| 6324 | + | |
| 6255 | 6325 | @dataclass |
| 6256 | 6326 | class Using: |
| 6257 | 6327 | using: int |
| @@ -6499,6 +6569,8 @@ class Obj6: | ||
| 6499 | 6569 | utf8_json_writer: Utf8JSONWriter |
| 6500 | 6570 | yes: Yes |
| 6501 | 6571 | dummy: int |
| 6572 | + unsigned: Unsigned | |
| 6573 | + ushort: Ushort | |
| 6502 | 6574 | using: Using |
| 6503 | 6575 | var: Var |
| 6504 | 6576 | virtual: Virtual |
| @@ -6522,6 +6594,8 @@ class Obj6: | ||
| 6522 | 6594 | utf8_json_writer = Utf8JSONWriter.from_dict(obj["Utf8JsonWriter"]) |
| 6523 | 6595 | yes = Yes.from_dict(obj["YES"]) |
| 6524 | 6596 | dummy = from_int(obj["dummy"]) |
| 6597 | + unsigned = Unsigned.from_dict(obj["unsigned"]) | |
| 6598 | + ushort = Ushort.from_dict(obj["ushort"]) | |
| 6525 | 6599 | using = Using.from_dict(obj["using"]) |
| 6526 | 6600 | var = Var.from_dict(obj["var"]) |
| 6527 | 6601 | virtual = Virtual.from_dict(obj["virtual"]) |
| @@ -6536,7 +6610,7 @@ class Obj6: | ||
| 6536 | 6610 | xor = Xor.from_dict(obj["xor"]) |
| 6537 | 6611 | xor_eq = XorEq.from_dict(obj["xor_eq"]) |
| 6538 | 6612 | obj6_yield = Yield.from_dict(obj["yield"]) |
| 6539 | - return Obj6(uuid, utf8_json_reader, utf8_json_writer, yes, dummy, using, var, virtual, void, volatile, wchar_t, weak, where, obj6_while, will_set, obj6_with, xor, xor_eq, obj6_yield) | |
| 6613 | + return Obj6(uuid, utf8_json_reader, utf8_json_writer, yes, dummy, unsigned, ushort, using, var, virtual, void, volatile, wchar_t, weak, where, obj6_while, will_set, obj6_with, xor, xor_eq, obj6_yield) | |
| 6540 | 6614 | |
| 6541 | 6615 | def to_dict(self) -> dict: |
| 6542 | 6616 | result: dict = {} |
| @@ -6545,6 +6619,8 @@ class Obj6: | ||
| 6545 | 6619 | result["Utf8JsonWriter"] = to_class(Utf8JSONWriter, self.utf8_json_writer) |
| 6546 | 6620 | result["YES"] = to_class(Yes, self.yes) |
| 6547 | 6621 | result["dummy"] = from_int(self.dummy) |
| 6622 | + result["unsigned"] = to_class(Unsigned, self.unsigned) | |
| 6623 | + result["ushort"] = to_class(Ushort, self.ushort) | |
| 6548 | 6624 | result["using"] = to_class(Using, self.using) |
| 6549 | 6625 | result["var"] = to_class(Var, self.var) |
| 6550 | 6626 | result["virtual"] = to_class(Virtual, self.virtual) |
Mrubydefault / TopLevel.rb+239 −127
| @@ -3094,6 +3094,31 @@ class From < Dry::Struct | ||
| 3094 | 3094 | end |
| 3095 | 3095 | end |
| 3096 | 3096 | |
| 3097 | +class FromDict < Dry::Struct | |
| 3098 | + attribute :from_dict, Types::Integer | |
| 3099 | + | |
| 3100 | + def self.from_dynamic!(d) | |
| 3101 | + d = Types::Hash[d] | |
| 3102 | + new( | |
| 3103 | + from_dict: d.fetch("from_dict"), | |
| 3104 | + ) | |
| 3105 | + end | |
| 3106 | + | |
| 3107 | + def self.from_json!(json) | |
| 3108 | + from_dynamic!(JSON.parse(json)) | |
| 3109 | + end | |
| 3110 | + | |
| 3111 | + def to_dynamic | |
| 3112 | + { | |
| 3113 | + "from_dict" => from_dict, | |
| 3114 | + } | |
| 3115 | + end | |
| 3116 | + | |
| 3117 | + def to_json(options = nil) | |
| 3118 | + JSON.generate(to_dynamic, options) | |
| 3119 | + end | |
| 3120 | +end | |
| 3121 | + | |
| 3097 | 3122 | class FromJSON < Dry::Struct |
| 3098 | 3123 | attribute :from_json, Types::Integer |
| 3099 | 3124 | |
| @@ -3244,31 +3269,6 @@ class Go < Dry::Struct | ||
| 3244 | 3269 | end |
| 3245 | 3270 | end |
| 3246 | 3271 | |
| 3247 | -class Goto < Dry::Struct | |
| 3248 | - attribute :goto, Types::Integer | |
| 3249 | - | |
| 3250 | - def self.from_dynamic!(d) | |
| 3251 | - d = Types::Hash[d] | |
| 3252 | - new( | |
| 3253 | - goto: d.fetch("goto"), | |
| 3254 | - ) | |
| 3255 | - end | |
| 3256 | - | |
| 3257 | - def self.from_json!(json) | |
| 3258 | - from_dynamic!(JSON.parse(json)) | |
| 3259 | - end | |
| 3260 | - | |
| 3261 | - def to_dynamic | |
| 3262 | - { | |
| 3263 | - "goto" => goto, | |
| 3264 | - } | |
| 3265 | - end | |
| 3266 | - | |
| 3267 | - def to_json(options = nil) | |
| 3268 | - JSON.generate(to_dynamic, options) | |
| 3269 | - end | |
| 3270 | -end | |
| 3271 | - | |
| 3272 | 3272 | class Def < Dry::Struct |
| 3273 | 3273 | attribute :def_def, Types::Integer |
| 3274 | 3274 | |
| @@ -3496,13 +3496,13 @@ class Obj2 < Dry::Struct | ||
| 3496 | 3496 | attribute :format_exception, FormatException |
| 3497 | 3497 | attribute :friend, Friend |
| 3498 | 3498 | attribute :from, From |
| 3499 | + attribute :from_dict, FromDict | |
| 3499 | 3500 | attribute :from_json, FromJSON |
| 3500 | 3501 | attribute :func, Func |
| 3501 | 3502 | attribute :function, Function |
| 3502 | 3503 | attribute :get, Get |
| 3503 | 3504 | attribute :global, Global |
| 3504 | 3505 | attribute :go, Go |
| 3505 | - attribute :goto, Goto | |
| 3506 | 3506 | attribute :obj2_def, Def |
| 3507 | 3507 | attribute :obj2_default, Default |
| 3508 | 3508 | attribute :obj2_do, Do |
| @@ -3565,13 +3565,13 @@ class Obj2 < Dry::Struct | ||
| 3565 | 3565 | format_exception: FormatException.from_dynamic!(d.fetch("FormatException")), |
| 3566 | 3566 | friend: Friend.from_dynamic!(d.fetch("friend")), |
| 3567 | 3567 | from: From.from_dynamic!(d.fetch("from")), |
| 3568 | + from_dict: FromDict.from_dynamic!(d.fetch("from_dict")), | |
| 3568 | 3569 | from_json: FromJSON.from_dynamic!(d.fetch("from_json")), |
| 3569 | 3570 | func: Func.from_dynamic!(d.fetch("func")), |
| 3570 | 3571 | function: Function.from_dynamic!(d.fetch("function")), |
| 3571 | 3572 | get: Get.from_dynamic!(d.fetch("get")), |
| 3572 | 3573 | global: Global.from_dynamic!(d.fetch("global")), |
| 3573 | 3574 | go: Go.from_dynamic!(d.fetch("go")), |
| 3574 | - goto: Goto.from_dynamic!(d.fetch("goto")), | |
| 3575 | 3575 | obj2_def: Def.from_dynamic!(d.fetch("def")), |
| 3576 | 3576 | obj2_default: Default.from_dynamic!(d.fetch("default")), |
| 3577 | 3577 | obj2_do: Do.from_dynamic!(d.fetch("do")), |
| @@ -3639,13 +3639,13 @@ class Obj2 < Dry::Struct | ||
| 3639 | 3639 | "FormatException" => format_exception.to_dynamic, |
| 3640 | 3640 | "friend" => friend.to_dynamic, |
| 3641 | 3641 | "from" => from.to_dynamic, |
| 3642 | + "from_dict" => from_dict.to_dynamic, | |
| 3642 | 3643 | "from_json" => from_json.to_dynamic, |
| 3643 | 3644 | "func" => func.to_dynamic, |
| 3644 | 3645 | "function" => function.to_dynamic, |
| 3645 | 3646 | "get" => get.to_dynamic, |
| 3646 | 3647 | "global" => global.to_dynamic, |
| 3647 | 3648 | "go" => go.to_dynamic, |
| 3648 | - "goto" => goto.to_dynamic, | |
| 3649 | 3649 | "def" => obj2_def.to_dynamic, |
| 3650 | 3650 | "default" => obj2_default.to_dynamic, |
| 3651 | 3651 | "do" => obj2_do.to_dynamic, |
| @@ -3661,6 +3661,31 @@ class Obj2 < Dry::Struct | ||
| 3661 | 3661 | end |
| 3662 | 3662 | end |
| 3663 | 3663 | |
| 3664 | +class Goto < Dry::Struct | |
| 3665 | + attribute :goto, Types::Integer | |
| 3666 | + | |
| 3667 | + def self.from_dynamic!(d) | |
| 3668 | + d = Types::Hash[d] | |
| 3669 | + new( | |
| 3670 | + goto: d.fetch("goto"), | |
| 3671 | + ) | |
| 3672 | + end | |
| 3673 | + | |
| 3674 | + def self.from_json!(json) | |
| 3675 | + from_dynamic!(JSON.parse(json)) | |
| 3676 | + end | |
| 3677 | + | |
| 3678 | + def to_dynamic | |
| 3679 | + { | |
| 3680 | + "goto" => goto, | |
| 3681 | + } | |
| 3682 | + end | |
| 3683 | + | |
| 3684 | + def to_json(options = nil) | |
| 3685 | + JSON.generate(to_dynamic, options) | |
| 3686 | + end | |
| 3687 | +end | |
| 3688 | + | |
| 3664 | 3689 | class Guard < Dry::Struct |
| 3665 | 3690 | attribute :guard, Types::Integer |
| 3666 | 3691 | |
| @@ -4911,6 +4936,31 @@ class MapEntry < Dry::Struct | ||
| 4911 | 4936 | end |
| 4912 | 4937 | end |
| 4913 | 4938 | |
| 4939 | +class MarshalJSON < Dry::Struct | |
| 4940 | + attribute :marshal_json, Types::Integer | |
| 4941 | + | |
| 4942 | + def self.from_dynamic!(d) | |
| 4943 | + d = Types::Hash[d] | |
| 4944 | + new( | |
| 4945 | + marshal_json: d.fetch("MarshalJSON"), | |
| 4946 | + ) | |
| 4947 | + end | |
| 4948 | + | |
| 4949 | + def self.from_json!(json) | |
| 4950 | + from_dynamic!(JSON.parse(json)) | |
| 4951 | + end | |
| 4952 | + | |
| 4953 | + def to_dynamic | |
| 4954 | + { | |
| 4955 | + "MarshalJSON" => marshal_json, | |
| 4956 | + } | |
| 4957 | + end | |
| 4958 | + | |
| 4959 | + def to_json(options = nil) | |
| 4960 | + JSON.generate(to_dynamic, options) | |
| 4961 | + end | |
| 4962 | +end | |
| 4963 | + | |
| 4914 | 4964 | class MetadataPropertyHandling < Dry::Struct |
| 4915 | 4965 | attribute :metadata_property_handling, Types::Integer |
| 4916 | 4966 | |
| @@ -5086,31 +5136,6 @@ class No < Dry::Struct | ||
| 5086 | 5136 | end |
| 5087 | 5137 | end |
| 5088 | 5138 | |
| 5089 | -class Noexcept < Dry::Struct | |
| 5090 | - attribute :noexcept, Types::Integer | |
| 5091 | - | |
| 5092 | - def self.from_dynamic!(d) | |
| 5093 | - d = Types::Hash[d] | |
| 5094 | - new( | |
| 5095 | - noexcept: d.fetch("noexcept"), | |
| 5096 | - ) | |
| 5097 | - end | |
| 5098 | - | |
| 5099 | - def self.from_json!(json) | |
| 5100 | - from_dynamic!(JSON.parse(json)) | |
| 5101 | - end | |
| 5102 | - | |
| 5103 | - def to_dynamic | |
| 5104 | - { | |
| 5105 | - "noexcept" => noexcept, | |
| 5106 | - } | |
| 5107 | - end | |
| 5108 | - | |
| 5109 | - def to_json(options = nil) | |
| 5110 | - JSON.generate(to_dynamic, options) | |
| 5111 | - end | |
| 5112 | -end | |
| 5113 | - | |
| 5114 | 5139 | class If < Dry::Struct |
| 5115 | 5140 | attribute :if_if, Types::Integer |
| 5116 | 5141 | |
| @@ -5263,6 +5288,7 @@ end | ||
| 5263 | 5288 | |
| 5264 | 5289 | class Obj3 < Dry::Struct |
| 5265 | 5290 | attribute :dummy, Types::Integer |
| 5291 | + attribute :goto, Goto | |
| 5266 | 5292 | attribute :guard, Guard |
| 5267 | 5293 | attribute :has_own_property, HasOwnProperty |
| 5268 | 5294 | attribute :hash_code, HashCode |
| @@ -5313,6 +5339,7 @@ class Obj3 < Dry::Struct | ||
| 5313 | 5339 | attribute :long, Long |
| 5314 | 5340 | attribute :map, Map |
| 5315 | 5341 | attribute :map_entry, MapEntry |
| 5342 | + attribute :marshal_json, MarshalJSON | |
| 5316 | 5343 | attribute :metadata_property_handling, MetadataPropertyHandling |
| 5317 | 5344 | attribute :mutable, Mutable |
| 5318 | 5345 | attribute :mutating, Mutating |
| @@ -5320,7 +5347,6 @@ class Obj3 < Dry::Struct | ||
| 5320 | 5347 | attribute :native, Native |
| 5321 | 5348 | attribute :newtonsoft, Newtonsoft |
| 5322 | 5349 | attribute :no, No |
| 5323 | - attribute :noexcept, Noexcept | |
| 5324 | 5350 | attribute :obj3_if, If |
| 5325 | 5351 | attribute :obj3_in, In |
| 5326 | 5352 | attribute :obj3_lambda, Lambda |
| @@ -5332,6 +5358,7 @@ class Obj3 < Dry::Struct | ||
| 5332 | 5358 | d = Types::Hash[d] |
| 5333 | 5359 | new( |
| 5334 | 5360 | dummy: d.fetch("dummy"), |
| 5361 | + goto: Goto.from_dynamic!(d.fetch("goto")), | |
| 5335 | 5362 | guard: Guard.from_dynamic!(d.fetch("guard")), |
| 5336 | 5363 | has_own_property: HasOwnProperty.from_dynamic!(d.fetch("hasOwnProperty")), |
| 5337 | 5364 | hash_code: HashCode.from_dynamic!(d.fetch("hashCode")), |
| @@ -5382,6 +5409,7 @@ class Obj3 < Dry::Struct | ||
| 5382 | 5409 | long: Long.from_dynamic!(d.fetch("long")), |
| 5383 | 5410 | map: Map.from_dynamic!(d.fetch("map")), |
| 5384 | 5411 | map_entry: MapEntry.from_dynamic!(d.fetch("MapEntry")), |
| 5412 | + marshal_json: MarshalJSON.from_dynamic!(d.fetch("MarshalJSON")), | |
| 5385 | 5413 | metadata_property_handling: MetadataPropertyHandling.from_dynamic!(d.fetch("metadata_property_handling")), |
| 5386 | 5414 | mutable: Mutable.from_dynamic!(d.fetch("mutable")), |
| 5387 | 5415 | mutating: Mutating.from_dynamic!(d.fetch("mutating")), |
| @@ -5389,7 +5417,6 @@ class Obj3 < Dry::Struct | ||
| 5389 | 5417 | native: Native.from_dynamic!(d.fetch("native")), |
| 5390 | 5418 | newtonsoft: Newtonsoft.from_dynamic!(d.fetch("newtonsoft")), |
| 5391 | 5419 | no: No.from_dynamic!(d.fetch("NO")), |
| 5392 | - noexcept: Noexcept.from_dynamic!(d.fetch("noexcept")), | |
| 5393 | 5420 | obj3_if: If.from_dynamic!(d.fetch("if")), |
| 5394 | 5421 | obj3_in: In.from_dynamic!(d.fetch("in")), |
| 5395 | 5422 | obj3_lambda: Lambda.from_dynamic!(d.fetch("lambda")), |
| @@ -5406,6 +5433,7 @@ class Obj3 < Dry::Struct | ||
| 5406 | 5433 | def to_dynamic |
| 5407 | 5434 | { |
| 5408 | 5435 | "dummy" => dummy, |
| 5436 | + "goto" => goto.to_dynamic, | |
| 5409 | 5437 | "guard" => guard.to_dynamic, |
| 5410 | 5438 | "hasOwnProperty" => has_own_property.to_dynamic, |
| 5411 | 5439 | "hashCode" => hash_code.to_dynamic, |
| @@ -5456,6 +5484,7 @@ class Obj3 < Dry::Struct | ||
| 5456 | 5484 | "long" => long.to_dynamic, |
| 5457 | 5485 | "map" => map.to_dynamic, |
| 5458 | 5486 | "MapEntry" => map_entry.to_dynamic, |
| 5487 | + "MarshalJSON" => marshal_json.to_dynamic, | |
| 5459 | 5488 | "metadata_property_handling" => metadata_property_handling.to_dynamic, |
| 5460 | 5489 | "mutable" => mutable.to_dynamic, |
| 5461 | 5490 | "mutating" => mutating.to_dynamic, |
| @@ -5463,7 +5492,6 @@ class Obj3 < Dry::Struct | ||
| 5463 | 5492 | "native" => native.to_dynamic, |
| 5464 | 5493 | "newtonsoft" => newtonsoft.to_dynamic, |
| 5465 | 5494 | "NO" => no.to_dynamic, |
| 5466 | - "noexcept" => noexcept.to_dynamic, | |
| 5467 | 5495 | "if" => obj3_if.to_dynamic, |
| 5468 | 5496 | "in" => obj3_in.to_dynamic, |
| 5469 | 5497 | "lambda" => obj3_lambda.to_dynamic, |
| @@ -5503,6 +5531,31 @@ class NoSuchMethod < Dry::Struct | ||
| 5503 | 5531 | end |
| 5504 | 5532 | end |
| 5505 | 5533 | |
| 5534 | +class Noexcept < Dry::Struct | |
| 5535 | + attribute :noexcept, Types::Integer | |
| 5536 | + | |
| 5537 | + def self.from_dynamic!(d) | |
| 5538 | + d = Types::Hash[d] | |
| 5539 | + new( | |
| 5540 | + noexcept: d.fetch("noexcept"), | |
| 5541 | + ) | |
| 5542 | + end | |
| 5543 | + | |
| 5544 | + def self.from_json!(json) | |
| 5545 | + from_dynamic!(JSON.parse(json)) | |
| 5546 | + end | |
| 5547 | + | |
| 5548 | + def to_dynamic | |
| 5549 | + { | |
| 5550 | + "noexcept" => noexcept, | |
| 5551 | + } | |
| 5552 | + end | |
| 5553 | + | |
| 5554 | + def to_json(options = nil) | |
| 5555 | + JSON.generate(to_dynamic, options) | |
| 5556 | + end | |
| 5557 | +end | |
| 5558 | + | |
| 5506 | 5559 | class Nonatomic < Dry::Struct |
| 5507 | 5560 | attribute :nonatomic, Types::Integer |
| 5508 | 5561 | |
| @@ -6078,31 +6131,6 @@ class Return < Dry::Struct | ||
| 6078 | 6131 | end |
| 6079 | 6132 | end |
| 6080 | 6133 | |
| 6081 | -class Select < Dry::Struct | |
| 6082 | - attribute :select_select, Types::Integer | |
| 6083 | - | |
| 6084 | - def self.from_dynamic!(d) | |
| 6085 | - d = Types::Hash[d] | |
| 6086 | - new( | |
| 6087 | - select_select: d.fetch("select"), | |
| 6088 | - ) | |
| 6089 | - end | |
| 6090 | - | |
| 6091 | - def self.from_json!(json) | |
| 6092 | - from_dynamic!(JSON.parse(json)) | |
| 6093 | - end | |
| 6094 | - | |
| 6095 | - def to_dynamic | |
| 6096 | - { | |
| 6097 | - "select" => select_select, | |
| 6098 | - } | |
| 6099 | - end | |
| 6100 | - | |
| 6101 | - def to_json(options = nil) | |
| 6102 | - JSON.generate(to_dynamic, options) | |
| 6103 | - end | |
| 6104 | -end | |
| 6105 | - | |
| 6106 | 6134 | class ObjectClass < Dry::Struct |
| 6107 | 6135 | attribute :object, Types::Integer |
| 6108 | 6136 | |
| @@ -7081,6 +7109,7 @@ end | ||
| 7081 | 7109 | class Obj4 < Dry::Struct |
| 7082 | 7110 | attribute :dummy, Types::Integer |
| 7083 | 7111 | attribute :no_such_method, NoSuchMethod |
| 7112 | + attribute :noexcept, Noexcept | |
| 7084 | 7113 | attribute :nonatomic, Nonatomic |
| 7085 | 7114 | attribute :none, None |
| 7086 | 7115 | attribute :nonlocal, Nonlocal |
| @@ -7104,7 +7133,6 @@ class Obj4 < Dry::Struct | ||
| 7104 | 7133 | attribute :obj4_raise, Raise |
| 7105 | 7134 | attribute :obj4_require, Require |
| 7106 | 7135 | attribute :obj4_return, Return |
| 7107 | - attribute :obj4_select, Select | |
| 7108 | 7136 | attribute :object, ObjectClass |
| 7109 | 7137 | attribute :object_mapper, ObjectMapper |
| 7110 | 7138 | attribute :of, Of |
| @@ -7150,6 +7178,7 @@ class Obj4 < Dry::Struct | ||
| 7150 | 7178 | new( |
| 7151 | 7179 | dummy: d.fetch("dummy"), |
| 7152 | 7180 | no_such_method: NoSuchMethod.from_dynamic!(d.fetch("noSuchMethod")), |
| 7181 | + noexcept: Noexcept.from_dynamic!(d.fetch("noexcept")), | |
| 7153 | 7182 | nonatomic: Nonatomic.from_dynamic!(d.fetch("nonatomic")), |
| 7154 | 7183 | none: None.from_dynamic!(d.fetch("None")), |
| 7155 | 7184 | nonlocal: Nonlocal.from_dynamic!(d.fetch("nonlocal")), |
| @@ -7173,7 +7202,6 @@ class Obj4 < Dry::Struct | ||
| 7173 | 7202 | obj4_raise: Raise.from_dynamic!(d.fetch("raise")), |
| 7174 | 7203 | obj4_require: Require.from_dynamic!(d.fetch("require")), |
| 7175 | 7204 | obj4_return: Return.from_dynamic!(d.fetch("return")), |
| 7176 | - obj4_select: Select.from_dynamic!(d.fetch("select")), | |
| 7177 | 7205 | object: ObjectClass.from_dynamic!(d.fetch("object")), |
| 7178 | 7206 | object_mapper: ObjectMapper.from_dynamic!(d.fetch("ObjectMapper")), |
| 7179 | 7207 | of: Of.from_dynamic!(d.fetch("of")), |
| @@ -7224,6 +7252,7 @@ class Obj4 < Dry::Struct | ||
| 7224 | 7252 | { |
| 7225 | 7253 | "dummy" => dummy, |
| 7226 | 7254 | "noSuchMethod" => no_such_method.to_dynamic, |
| 7255 | + "noexcept" => noexcept.to_dynamic, | |
| 7227 | 7256 | "nonatomic" => nonatomic.to_dynamic, |
| 7228 | 7257 | "None" => none.to_dynamic, |
| 7229 | 7258 | "nonlocal" => nonlocal.to_dynamic, |
| @@ -7247,7 +7276,6 @@ class Obj4 < Dry::Struct | ||
| 7247 | 7276 | "raise" => obj4_raise.to_dynamic, |
| 7248 | 7277 | "require" => obj4_require.to_dynamic, |
| 7249 | 7278 | "return" => obj4_return.to_dynamic, |
| 7250 | - "select" => obj4_select.to_dynamic, | |
| 7251 | 7279 | "object" => object.to_dynamic, |
| 7252 | 7280 | "ObjectMapper" => object_mapper.to_dynamic, |
| 7253 | 7281 | "of" => of.to_dynamic, |
| @@ -7320,6 +7348,31 @@ class KSerializer < Dry::Struct | ||
| 7320 | 7348 | end |
| 7321 | 7349 | end |
| 7322 | 7350 | |
| 7351 | +class Select < Dry::Struct | |
| 7352 | + attribute :select_select, Types::Integer | |
| 7353 | + | |
| 7354 | + def self.from_dynamic!(d) | |
| 7355 | + d = Types::Hash[d] | |
| 7356 | + new( | |
| 7357 | + select_select: d.fetch("select"), | |
| 7358 | + ) | |
| 7359 | + end | |
| 7360 | + | |
| 7361 | + def self.from_json!(json) | |
| 7362 | + from_dynamic!(JSON.parse(json)) | |
| 7363 | + end | |
| 7364 | + | |
| 7365 | + def to_dynamic | |
| 7366 | + { | |
| 7367 | + "select" => select_select, | |
| 7368 | + } | |
| 7369 | + end | |
| 7370 | + | |
| 7371 | + def to_json(options = nil) | |
| 7372 | + JSON.generate(to_dynamic, options) | |
| 7373 | + end | |
| 7374 | +end | |
| 7375 | + | |
| 7323 | 7376 | class SelfClass < Dry::Struct |
| 7324 | 7377 | attribute :self_self, Types::Integer |
| 7325 | 7378 | |
| @@ -8395,6 +8448,31 @@ class TimeZone < Dry::Struct | ||
| 8395 | 8448 | end |
| 8396 | 8449 | end |
| 8397 | 8450 | |
| 8451 | +class ToDict < Dry::Struct | |
| 8452 | + attribute :to_dict, Types::Integer | |
| 8453 | + | |
| 8454 | + def self.from_dynamic!(d) | |
| 8455 | + d = Types::Hash[d] | |
| 8456 | + new( | |
| 8457 | + to_dict: d.fetch("to_dict"), | |
| 8458 | + ) | |
| 8459 | + end | |
| 8460 | + | |
| 8461 | + def self.from_json!(json) | |
| 8462 | + from_dynamic!(JSON.parse(json)) | |
| 8463 | + end | |
| 8464 | + | |
| 8465 | + def to_dynamic | |
| 8466 | + { | |
| 8467 | + "to_dict" => to_dict, | |
| 8468 | + } | |
| 8469 | + end | |
| 8470 | + | |
| 8471 | + def to_json(options = nil) | |
| 8472 | + JSON.generate(to_dynamic, options) | |
| 8473 | + end | |
| 8474 | +end | |
| 8475 | + | |
| 8398 | 8476 | class ToString < Dry::Struct |
| 8399 | 8477 | attribute :to_string, Types::Integer |
| 8400 | 8478 | |
| @@ -8770,13 +8848,13 @@ class Union < Dry::Struct | ||
| 8770 | 8848 | end |
| 8771 | 8849 | end |
| 8772 | 8850 | |
| 8773 | -class Unowned < Dry::Struct | |
| 8774 | - attribute :unowned, Types::Integer | |
| 8851 | +class UnmarshalJSON < Dry::Struct | |
| 8852 | + attribute :unmarshal_json, Types::Integer | |
| 8775 | 8853 | |
| 8776 | 8854 | def self.from_dynamic!(d) |
| 8777 | 8855 | d = Types::Hash[d] |
| 8778 | 8856 | new( |
| 8779 | - unowned: d.fetch("unowned"), | |
| 8857 | + unmarshal_json: d.fetch("UnmarshalJSON"), | |
| 8780 | 8858 | ) |
| 8781 | 8859 | end |
| 8782 | 8860 | |
| @@ -8786,7 +8864,7 @@ class Unowned < Dry::Struct | ||
| 8786 | 8864 | |
| 8787 | 8865 | def to_dynamic |
| 8788 | 8866 | { |
| 8789 | - "unowned" => unowned, | |
| 8867 | + "UnmarshalJSON" => unmarshal_json, | |
| 8790 | 8868 | } |
| 8791 | 8869 | end |
| 8792 | 8870 | |
| @@ -8795,13 +8873,13 @@ class Unowned < Dry::Struct | ||
| 8795 | 8873 | end |
| 8796 | 8874 | end |
| 8797 | 8875 | |
| 8798 | -class Unsafe < Dry::Struct | |
| 8799 | - attribute :unsafe, Types::Integer | |
| 8876 | +class Unowned < Dry::Struct | |
| 8877 | + attribute :unowned, Types::Integer | |
| 8800 | 8878 | |
| 8801 | 8879 | def self.from_dynamic!(d) |
| 8802 | 8880 | d = Types::Hash[d] |
| 8803 | 8881 | new( |
| 8804 | - unsafe: d.fetch("unsafe"), | |
| 8882 | + unowned: d.fetch("unowned"), | |
| 8805 | 8883 | ) |
| 8806 | 8884 | end |
| 8807 | 8885 | |
| @@ -8811,7 +8889,7 @@ class Unsafe < Dry::Struct | ||
| 8811 | 8889 | |
| 8812 | 8890 | def to_dynamic |
| 8813 | 8891 | { |
| 8814 | - "unsafe" => unsafe, | |
| 8892 | + "unowned" => unowned, | |
| 8815 | 8893 | } |
| 8816 | 8894 | end |
| 8817 | 8895 | |
| @@ -8820,13 +8898,13 @@ class Unsafe < Dry::Struct | ||
| 8820 | 8898 | end |
| 8821 | 8899 | end |
| 8822 | 8900 | |
| 8823 | -class Unsigned < Dry::Struct | |
| 8824 | - attribute :unsigned, Types::Integer | |
| 8901 | +class Unsafe < Dry::Struct | |
| 8902 | + attribute :unsafe, Types::Integer | |
| 8825 | 8903 | |
| 8826 | 8904 | def self.from_dynamic!(d) |
| 8827 | 8905 | d = Types::Hash[d] |
| 8828 | 8906 | new( |
| 8829 | - unsigned: d.fetch("unsigned"), | |
| 8907 | + unsafe: d.fetch("unsafe"), | |
| 8830 | 8908 | ) |
| 8831 | 8909 | end |
| 8832 | 8910 | |
| @@ -8836,7 +8914,7 @@ class Unsigned < Dry::Struct | ||
| 8836 | 8914 | |
| 8837 | 8915 | def to_dynamic |
| 8838 | 8916 | { |
| 8839 | - "unsigned" => unsigned, | |
| 8917 | + "unsafe" => unsafe, | |
| 8840 | 8918 | } |
| 8841 | 8919 | end |
| 8842 | 8920 | |
| @@ -8870,34 +8948,10 @@ class UseSerializers < Dry::Struct | ||
| 8870 | 8948 | end |
| 8871 | 8949 | end |
| 8872 | 8950 | |
| 8873 | -class Ushort < Dry::Struct | |
| 8874 | - attribute :ushort, Types::Integer | |
| 8875 | - | |
| 8876 | - def self.from_dynamic!(d) | |
| 8877 | - d = Types::Hash[d] | |
| 8878 | - new( | |
| 8879 | - ushort: d.fetch("ushort"), | |
| 8880 | - ) | |
| 8881 | - end | |
| 8882 | - | |
| 8883 | - def self.from_json!(json) | |
| 8884 | - from_dynamic!(JSON.parse(json)) | |
| 8885 | - end | |
| 8886 | - | |
| 8887 | - def to_dynamic | |
| 8888 | - { | |
| 8889 | - "ushort" => ushort, | |
| 8890 | - } | |
| 8891 | - end | |
| 8892 | - | |
| 8893 | - def to_json(options = nil) | |
| 8894 | - JSON.generate(to_dynamic, options) | |
| 8895 | - end | |
| 8896 | -end | |
| 8897 | - | |
| 8898 | 8951 | class Obj5 < Dry::Struct |
| 8899 | 8952 | attribute :dummy, Types::Integer |
| 8900 | 8953 | attribute :k_serializer, KSerializer |
| 8954 | + attribute :obj5_select, Select | |
| 8901 | 8955 | attribute :obj5_self, SelfClass |
| 8902 | 8956 | attribute :obj5_super, Super |
| 8903 | 8957 | attribute :obj5_system, System |
| @@ -8941,6 +8995,7 @@ class Obj5 < Dry::Struct | ||
| 8941 | 8995 | attribute :time_only, TimeOnly |
| 8942 | 8996 | attribute :time_only_converter, TimeOnlyConverter |
| 8943 | 8997 | attribute :time_zone, TimeZone |
| 8998 | + attribute :to_dict, ToDict | |
| 8944 | 8999 | attribute :to_string, ToString |
| 8945 | 9000 | attribute :top_level, TopLevelClass |
| 8946 | 9001 | attribute :transient, Transient |
| @@ -8956,17 +9011,17 @@ class Obj5 < Dry::Struct | ||
| 8956 | 9011 | attribute :unchecked, Unchecked |
| 8957 | 9012 | attribute :undefined, UndefinedClass |
| 8958 | 9013 | attribute :union, Union |
| 9014 | + attribute :unmarshal_json, UnmarshalJSON | |
| 8959 | 9015 | attribute :unowned, Unowned |
| 8960 | 9016 | attribute :unsafe, Unsafe |
| 8961 | - attribute :unsigned, Unsigned | |
| 8962 | 9017 | attribute :use_serializers, UseSerializers |
| 8963 | - attribute :ushort, Ushort | |
| 8964 | 9018 | |
| 8965 | 9019 | def self.from_dynamic!(d) |
| 8966 | 9020 | d = Types::Hash[d] |
| 8967 | 9021 | new( |
| 8968 | 9022 | dummy: d.fetch("dummy"), |
| 8969 | 9023 | k_serializer: KSerializer.from_dynamic!(d.fetch("KSerializer")), |
| 9024 | + obj5_select: Select.from_dynamic!(d.fetch("select")), | |
| 8970 | 9025 | obj5_self: SelfClass.from_dynamic!(d.fetch("Self")), |
| 8971 | 9026 | obj5_super: Super.from_dynamic!(d.fetch("super")), |
| 8972 | 9027 | obj5_system: System.from_dynamic!(d.fetch("system")), |
| @@ -9010,6 +9065,7 @@ class Obj5 < Dry::Struct | ||
| 9010 | 9065 | time_only: TimeOnly.from_dynamic!(d.fetch("TimeOnly")), |
| 9011 | 9066 | time_only_converter: TimeOnlyConverter.from_dynamic!(d.fetch("TimeOnlyConverter")), |
| 9012 | 9067 | time_zone: TimeZone.from_dynamic!(d.fetch("TimeZone")), |
| 9068 | + to_dict: ToDict.from_dynamic!(d.fetch("to_dict")), | |
| 9013 | 9069 | to_string: ToString.from_dynamic!(d.fetch("toString")), |
| 9014 | 9070 | top_level: TopLevelClass.from_dynamic!(d.fetch("top_level")), |
| 9015 | 9071 | transient: Transient.from_dynamic!(d.fetch("transient")), |
| @@ -9025,11 +9081,10 @@ class Obj5 < Dry::Struct | ||
| 9025 | 9081 | unchecked: Unchecked.from_dynamic!(d.fetch("unchecked")), |
| 9026 | 9082 | undefined: UndefinedClass.from_dynamic!(d.fetch("undefined")), |
| 9027 | 9083 | union: Union.from_dynamic!(d.fetch("union")), |
| 9084 | + unmarshal_json: UnmarshalJSON.from_dynamic!(d.fetch("UnmarshalJSON")), | |
| 9028 | 9085 | unowned: Unowned.from_dynamic!(d.fetch("unowned")), |
| 9029 | 9086 | unsafe: Unsafe.from_dynamic!(d.fetch("unsafe")), |
| 9030 | - unsigned: Unsigned.from_dynamic!(d.fetch("unsigned")), | |
| 9031 | 9087 | use_serializers: UseSerializers.from_dynamic!(d.fetch("UseSerializers")), |
| 9032 | - ushort: Ushort.from_dynamic!(d.fetch("ushort")), | |
| 9033 | 9088 | ) |
| 9034 | 9089 | end |
| 9035 | 9090 | |
| @@ -9041,6 +9096,7 @@ class Obj5 < Dry::Struct | ||
| 9041 | 9096 | { |
| 9042 | 9097 | "dummy" => dummy, |
| 9043 | 9098 | "KSerializer" => k_serializer.to_dynamic, |
| 9099 | + "select" => obj5_select.to_dynamic, | |
| 9044 | 9100 | "Self" => obj5_self.to_dynamic, |
| 9045 | 9101 | "super" => obj5_super.to_dynamic, |
| 9046 | 9102 | "system" => obj5_system.to_dynamic, |
| @@ -9084,6 +9140,7 @@ class Obj5 < Dry::Struct | ||
| 9084 | 9140 | "TimeOnly" => time_only.to_dynamic, |
| 9085 | 9141 | "TimeOnlyConverter" => time_only_converter.to_dynamic, |
| 9086 | 9142 | "TimeZone" => time_zone.to_dynamic, |
| 9143 | + "to_dict" => to_dict.to_dynamic, | |
| 9087 | 9144 | "toString" => to_string.to_dynamic, |
| 9088 | 9145 | "top_level" => top_level.to_dynamic, |
| 9089 | 9146 | "transient" => transient.to_dynamic, |
| @@ -9099,11 +9156,10 @@ class Obj5 < Dry::Struct | ||
| 9099 | 9156 | "unchecked" => unchecked.to_dynamic, |
| 9100 | 9157 | "undefined" => undefined.to_dynamic, |
| 9101 | 9158 | "union" => union.to_dynamic, |
| 9159 | + "UnmarshalJSON" => unmarshal_json.to_dynamic, | |
| 9102 | 9160 | "unowned" => unowned.to_dynamic, |
| 9103 | 9161 | "unsafe" => unsafe.to_dynamic, |
| 9104 | - "unsigned" => unsigned.to_dynamic, | |
| 9105 | 9162 | "UseSerializers" => use_serializers.to_dynamic, |
| 9106 | - "ushort" => ushort.to_dynamic, | |
| 9107 | 9163 | } |
| 9108 | 9164 | end |
| 9109 | 9165 | |
| @@ -9187,6 +9243,56 @@ class Yield < Dry::Struct | ||
| 9187 | 9243 | end |
| 9188 | 9244 | end |
| 9189 | 9245 | |
| 9246 | +class Unsigned < Dry::Struct | |
| 9247 | + attribute :unsigned, Types::Integer | |
| 9248 | + | |
| 9249 | + def self.from_dynamic!(d) | |
| 9250 | + d = Types::Hash[d] | |
| 9251 | + new( | |
| 9252 | + unsigned: d.fetch("unsigned"), | |
| 9253 | + ) | |
| 9254 | + end | |
| 9255 | + | |
| 9256 | + def self.from_json!(json) | |
| 9257 | + from_dynamic!(JSON.parse(json)) | |
| 9258 | + end | |
| 9259 | + | |
| 9260 | + def to_dynamic | |
| 9261 | + { | |
| 9262 | + "unsigned" => unsigned, | |
| 9263 | + } | |
| 9264 | + end | |
| 9265 | + | |
| 9266 | + def to_json(options = nil) | |
| 9267 | + JSON.generate(to_dynamic, options) | |
| 9268 | + end | |
| 9269 | +end | |
| 9270 | + | |
| 9271 | +class Ushort < Dry::Struct | |
| 9272 | + attribute :ushort, Types::Integer | |
| 9273 | + | |
| 9274 | + def self.from_dynamic!(d) | |
| 9275 | + d = Types::Hash[d] | |
| 9276 | + new( | |
| 9277 | + ushort: d.fetch("ushort"), | |
| 9278 | + ) | |
| 9279 | + end | |
| 9280 | + | |
| 9281 | + def self.from_json!(json) | |
| 9282 | + from_dynamic!(JSON.parse(json)) | |
| 9283 | + end | |
| 9284 | + | |
| 9285 | + def to_dynamic | |
| 9286 | + { | |
| 9287 | + "ushort" => ushort, | |
| 9288 | + } | |
| 9289 | + end | |
| 9290 | + | |
| 9291 | + def to_json(options = nil) | |
| 9292 | + JSON.generate(to_dynamic, options) | |
| 9293 | + end | |
| 9294 | +end | |
| 9295 | + | |
| 9190 | 9296 | class Using < Dry::Struct |
| 9191 | 9297 | attribute :using, Types::Integer |
| 9192 | 9298 | |
| @@ -9567,6 +9673,8 @@ class Obj6 < Dry::Struct | ||
| 9567 | 9673 | attribute :obj6_while, While |
| 9568 | 9674 | attribute :obj6_with, With |
| 9569 | 9675 | attribute :obj6_yield, Yield |
| 9676 | + attribute :unsigned, Unsigned | |
| 9677 | + attribute :ushort, Ushort | |
| 9570 | 9678 | attribute :using, Using |
| 9571 | 9679 | attribute :utf8_json_reader, Utf8JSONReader |
| 9572 | 9680 | attribute :utf8_json_writer, Utf8JSONWriter |
| @@ -9590,6 +9698,8 @@ class Obj6 < Dry::Struct | ||
| 9590 | 9698 | obj6_while: While.from_dynamic!(d.fetch("while")), |
| 9591 | 9699 | obj6_with: With.from_dynamic!(d.fetch("with")), |
| 9592 | 9700 | obj6_yield: Yield.from_dynamic!(d.fetch("yield")), |
| 9701 | + unsigned: Unsigned.from_dynamic!(d.fetch("unsigned")), | |
| 9702 | + ushort: Ushort.from_dynamic!(d.fetch("ushort")), | |
| 9593 | 9703 | using: Using.from_dynamic!(d.fetch("using")), |
| 9594 | 9704 | utf8_json_reader: Utf8JSONReader.from_dynamic!(d.fetch("Utf8JsonReader")), |
| 9595 | 9705 | utf8_json_writer: Utf8JSONWriter.from_dynamic!(d.fetch("Utf8JsonWriter")), |
| @@ -9618,6 +9728,8 @@ class Obj6 < Dry::Struct | ||
| 9618 | 9728 | "while" => obj6_while.to_dynamic, |
| 9619 | 9729 | "with" => obj6_with.to_dynamic, |
| 9620 | 9730 | "yield" => obj6_yield.to_dynamic, |
| 9731 | + "unsigned" => unsigned.to_dynamic, | |
| 9732 | + "ushort" => ushort.to_dynamic, | |
| 9621 | 9733 | "using" => using.to_dynamic, |
| 9622 | 9734 | "Utf8JsonReader" => utf8_json_reader.to_dynamic, |
| 9623 | 9735 | "Utf8JsonWriter" => utf8_json_writer.to_dynamic, |
Mrustdefault / module_under_test.rs+68 −34
| @@ -639,6 +639,8 @@ pub struct Obj2 { | ||
| 639 | 639 | |
| 640 | 640 | pub from: From, |
| 641 | 641 | |
| 642 | + pub from_dict: FromDict, | |
| 643 | + | |
| 642 | 644 | pub from_json: FromJson, |
| 643 | 645 | |
| 644 | 646 | pub func: Func, |
| @@ -651,8 +653,6 @@ pub struct Obj2 { | ||
| 651 | 653 | |
| 652 | 654 | pub go: Go, |
| 653 | 655 | |
| 654 | - pub goto: Goto, | |
| 655 | - | |
| 656 | 656 | #[serde(rename = "default")] |
| 657 | 657 | pub obj2_default: Default, |
| 658 | 658 | |
| @@ -942,6 +942,11 @@ pub struct From { | ||
| 942 | 942 | pub from: i64, |
| 943 | 943 | } |
| 944 | 944 | |
| 945 | +#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 946 | +pub struct FromDict { | |
| 947 | + pub from_dict: i64, | |
| 948 | +} | |
| 949 | + | |
| 945 | 950 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 946 | 951 | pub struct FromJson { |
| 947 | 952 | pub from_json: i64, |
| @@ -972,11 +977,6 @@ pub struct Go { | ||
| 972 | 977 | pub go: i64, |
| 973 | 978 | } |
| 974 | 979 | |
| 975 | -#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 976 | -pub struct Goto { | |
| 977 | - pub goto: i64, | |
| 978 | -} | |
| 979 | - | |
| 980 | 980 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 981 | 981 | pub struct Default { |
| 982 | 982 | #[serde(rename = "default")] |
| @@ -1036,6 +1036,8 @@ pub struct FalseClass { | ||
| 1036 | 1036 | pub struct Obj3 { |
| 1037 | 1037 | pub dummy: i64, |
| 1038 | 1038 | |
| 1039 | + pub goto: Goto, | |
| 1040 | + | |
| 1039 | 1041 | pub guard: Guard, |
| 1040 | 1042 | |
| 1041 | 1043 | #[serde(rename = "hasOwnProperty")] |
| @@ -1155,6 +1157,9 @@ pub struct Obj3 { | ||
| 1155 | 1157 | #[serde(rename = "MapEntry")] |
| 1156 | 1158 | pub map_entry: MapEntry, |
| 1157 | 1159 | |
| 1160 | + #[serde(rename = "MarshalJSON")] | |
| 1161 | + pub marshal_json: MarshalJson, | |
| 1162 | + | |
| 1158 | 1163 | pub metadata_property_handling: MetadataPropertyHandling, |
| 1159 | 1164 | |
| 1160 | 1165 | pub module: Module, |
| @@ -1176,8 +1181,6 @@ pub struct Obj3 { | ||
| 1176 | 1181 | #[serde(rename = "NO")] |
| 1177 | 1182 | pub no: No, |
| 1178 | 1183 | |
| 1179 | - pub noexcept: Noexcept, | |
| 1180 | - | |
| 1181 | 1184 | #[serde(rename = "if")] |
| 1182 | 1185 | pub obj3_if: If, |
| 1183 | 1186 | |
| @@ -1188,6 +1191,11 @@ pub struct Obj3 { | ||
| 1188 | 1191 | pub obj3_let: Let, |
| 1189 | 1192 | } |
| 1190 | 1193 | |
| 1194 | +#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 1195 | +pub struct Goto { | |
| 1196 | + pub goto: i64, | |
| 1197 | +} | |
| 1198 | + | |
| 1191 | 1199 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 1192 | 1200 | pub struct Guard { |
| 1193 | 1201 | pub guard: i64, |
| @@ -1462,6 +1470,13 @@ pub struct MapEntry { | ||
| 1462 | 1470 | pub map_entry: i64, |
| 1463 | 1471 | } |
| 1464 | 1472 | |
| 1473 | +#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 1474 | +#[serde(rename_all = "PascalCase")] | |
| 1475 | +pub struct MarshalJson { | |
| 1476 | + #[serde(rename = "MarshalJSON")] | |
| 1477 | + pub marshal_json: i64, | |
| 1478 | +} | |
| 1479 | + | |
| 1465 | 1480 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 1466 | 1481 | pub struct MetadataPropertyHandling { |
| 1467 | 1482 | pub metadata_property_handling: i64, |
| @@ -1513,11 +1528,6 @@ pub struct No { | ||
| 1513 | 1528 | pub no: i64, |
| 1514 | 1529 | } |
| 1515 | 1530 | |
| 1516 | -#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 1517 | -pub struct Noexcept { | |
| 1518 | - pub noexcept: i64, | |
| 1519 | -} | |
| 1520 | - | |
| 1521 | 1531 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 1522 | 1532 | pub struct If { |
| 1523 | 1533 | #[serde(rename = "if")] |
| @@ -1543,6 +1553,8 @@ pub struct Obj4 { | ||
| 1543 | 1553 | #[serde(rename = "noSuchMethod")] |
| 1544 | 1554 | pub no_such_method: NoSuchMethod, |
| 1545 | 1555 | |
| 1556 | + pub noexcept: Noexcept, | |
| 1557 | + | |
| 1546 | 1558 | pub nonatomic: Nonatomic, |
| 1547 | 1559 | |
| 1548 | 1560 | #[serde(rename = "None")] |
| @@ -1683,8 +1695,6 @@ pub struct Obj4 { | ||
| 1683 | 1695 | |
| 1684 | 1696 | #[serde(rename = "SEL")] |
| 1685 | 1697 | pub sel: Sel, |
| 1686 | - | |
| 1687 | - pub select: Select, | |
| 1688 | 1698 | } |
| 1689 | 1699 | |
| 1690 | 1700 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| @@ -1693,6 +1703,11 @@ pub struct NoSuchMethod { | ||
| 1693 | 1703 | pub no_such_method: i64, |
| 1694 | 1704 | } |
| 1695 | 1705 | |
| 1706 | +#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 1707 | +pub struct Noexcept { | |
| 1708 | + pub noexcept: i64, | |
| 1709 | +} | |
| 1710 | + | |
| 1696 | 1711 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 1697 | 1712 | pub struct Nonatomic { |
| 1698 | 1713 | pub nonatomic: i64, |
| @@ -2020,11 +2035,6 @@ pub struct Sel { | ||
| 2020 | 2035 | pub sel: i64, |
| 2021 | 2036 | } |
| 2022 | 2037 | |
| 2023 | -#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 2024 | -pub struct Select { | |
| 2025 | - pub select: i64, | |
| 2026 | -} | |
| 2027 | - | |
| 2028 | 2038 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 2029 | 2039 | pub struct Obj5 { |
| 2030 | 2040 | pub dummy: i64, |
| @@ -2074,6 +2084,8 @@ pub struct Obj5 { | ||
| 2074 | 2084 | #[serde(rename = "type")] |
| 2075 | 2085 | pub purple_type: TypeClass, |
| 2076 | 2086 | |
| 2087 | + pub select: Select, | |
| 2088 | + | |
| 2077 | 2089 | #[serde(rename = "Sendable")] |
| 2078 | 2090 | pub sendable: Sendable, |
| 2079 | 2091 | |
| @@ -2150,6 +2162,8 @@ pub struct Obj5 { | ||
| 2150 | 2162 | #[serde(rename = "TimeZone")] |
| 2151 | 2163 | pub time_zone: TimeZone, |
| 2152 | 2164 | |
| 2165 | + pub to_dict: ToDict, | |
| 2166 | + | |
| 2153 | 2167 | pub to_json: ToJson, |
| 2154 | 2168 | |
| 2155 | 2169 | #[serde(rename = "toString")] |
| @@ -2177,14 +2191,13 @@ pub struct Obj5 { | ||
| 2177 | 2191 | |
| 2178 | 2192 | pub undefined: Undefined, |
| 2179 | 2193 | |
| 2180 | - pub unowned: Unowned, | |
| 2194 | + #[serde(rename = "UnmarshalJSON")] | |
| 2195 | + pub unmarshal_json: UnmarshalJson, | |
| 2181 | 2196 | |
| 2182 | - pub unsigned: Unsigned, | |
| 2197 | + pub unowned: Unowned, | |
| 2183 | 2198 | |
| 2184 | 2199 | #[serde(rename = "UseSerializers")] |
| 2185 | 2200 | pub use_serializers: UseSerializers, |
| 2186 | - | |
| 2187 | - pub ushort: Ushort, | |
| 2188 | 2201 | } |
| 2189 | 2202 | |
| 2190 | 2203 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| @@ -2280,6 +2293,11 @@ pub struct TypeClass { | ||
| 2280 | 2293 | pub type_type: i64, |
| 2281 | 2294 | } |
| 2282 | 2295 | |
| 2296 | +#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 2297 | +pub struct Select { | |
| 2298 | + pub select: i64, | |
| 2299 | +} | |
| 2300 | + | |
| 2283 | 2301 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 2284 | 2302 | #[serde(rename_all = "PascalCase")] |
| 2285 | 2303 | pub struct Sendable { |
| @@ -2452,6 +2470,11 @@ pub struct TimeZone { | ||
| 2452 | 2470 | pub time_zone: i64, |
| 2453 | 2471 | } |
| 2454 | 2472 | |
| 2473 | +#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 2474 | +pub struct ToDict { | |
| 2475 | + pub to_dict: i64, | |
| 2476 | +} | |
| 2477 | + | |
| 2455 | 2478 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 2456 | 2479 | pub struct ToJson { |
| 2457 | 2480 | pub to_json: i64, |
| @@ -2519,13 +2542,15 @@ pub struct Undefined { | ||
| 2519 | 2542 | } |
| 2520 | 2543 | |
| 2521 | 2544 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 2522 | -pub struct Unowned { | |
| 2523 | - pub unowned: i64, | |
| 2545 | +#[serde(rename_all = "PascalCase")] | |
| 2546 | +pub struct UnmarshalJson { | |
| 2547 | + #[serde(rename = "UnmarshalJSON")] | |
| 2548 | + pub unmarshal_json: i64, | |
| 2524 | 2549 | } |
| 2525 | 2550 | |
| 2526 | 2551 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 2527 | -pub struct Unsigned { | |
| 2528 | - pub unsigned: i64, | |
| 2552 | +pub struct Unowned { | |
| 2553 | + pub unowned: i64, | |
| 2529 | 2554 | } |
| 2530 | 2555 | |
| 2531 | 2556 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| @@ -2534,11 +2559,6 @@ pub struct UseSerializers { | ||
| 2534 | 2559 | pub use_serializers: i64, |
| 2535 | 2560 | } |
| 2536 | 2561 | |
| 2537 | -#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 2538 | -pub struct Ushort { | |
| 2539 | - pub ushort: i64, | |
| 2540 | -} | |
| 2541 | - | |
| 2542 | 2562 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 2543 | 2563 | pub struct Obj6 { |
| 2544 | 2564 | pub dummy: i64, |
| @@ -2555,6 +2575,10 @@ pub struct Obj6 { | ||
| 2555 | 2575 | #[serde(rename = "yield")] |
| 2556 | 2576 | pub obj6_yield: Yield, |
| 2557 | 2577 | |
| 2578 | + pub unsigned: Unsigned, | |
| 2579 | + | |
| 2580 | + pub ushort: Ushort, | |
| 2581 | + | |
| 2558 | 2582 | pub using: Using, |
| 2559 | 2583 | |
| 2560 | 2584 | #[serde(rename = "Utf8JsonReader")] |
| @@ -2613,6 +2637,16 @@ pub struct Yield { | ||
| 2613 | 2637 | pub yield_yield: i64, |
| 2614 | 2638 | } |
| 2615 | 2639 | |
| 2640 | +#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 2641 | +pub struct Unsigned { | |
| 2642 | + pub unsigned: i64, | |
| 2643 | +} | |
| 2644 | + | |
| 2645 | +#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 2646 | +pub struct Ushort { | |
| 2647 | + pub ushort: i64, | |
| 2648 | +} | |
| 2649 | + | |
| 2616 | 2650 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 2617 | 2651 | pub struct Using { |
| 2618 | 2652 | pub using: i64, |
Mscala3-upickledefault / TopLevel.scala+47 −27
| @@ -464,13 +464,13 @@ case class Obj2 ( | ||
| 464 | 464 | val FormatException : FormatException, |
| 465 | 465 | val friend : Friend, |
| 466 | 466 | val from : From, |
| 467 | + val from_dict : FromDict, | |
| 467 | 468 | val from_json : FromJSON, |
| 468 | 469 | val func : Func, |
| 469 | 470 | val function : Function, |
| 470 | 471 | val get : Get, |
| 471 | 472 | val global : Global, |
| 472 | 473 | val go : Go, |
| 473 | - val goto : Goto, | |
| 474 | 474 | val `def` : Def, |
| 475 | 475 | val `do` : Do, |
| 476 | 476 | val `else` : Else, |
| @@ -684,6 +684,10 @@ case class From ( | ||
| 684 | 684 | val from : Long |
| 685 | 685 | ) derives OptionPickler.ReadWriter |
| 686 | 686 | |
| 687 | +case class FromDict ( | |
| 688 | + val from_dict : Long | |
| 689 | +) derives OptionPickler.ReadWriter | |
| 690 | + | |
| 687 | 691 | case class FromJSON ( |
| 688 | 692 | val from_json : Long |
| 689 | 693 | ) derives OptionPickler.ReadWriter |
| @@ -708,10 +712,6 @@ case class Go ( | ||
| 708 | 712 | val go : Long |
| 709 | 713 | ) derives OptionPickler.ReadWriter |
| 710 | 714 | |
| 711 | -case class Goto ( | |
| 712 | - val goto : Long | |
| 713 | -) derives OptionPickler.ReadWriter | |
| 714 | - | |
| 715 | 715 | case class Def ( |
| 716 | 716 | val `def` : Long |
| 717 | 717 | ) derives OptionPickler.ReadWriter |
| @@ -758,6 +758,7 @@ case class FalseClass ( | ||
| 758 | 758 | |
| 759 | 759 | case class Obj3 ( |
| 760 | 760 | val dummy : Long, |
| 761 | + val goto : Goto, | |
| 761 | 762 | val guard : Guard, |
| 762 | 763 | val hasOwnProperty : HasOwnProperty, |
| 763 | 764 | @upickle.implicits.key("hashCode") |
| @@ -808,6 +809,7 @@ case class Obj3 ( | ||
| 808 | 809 | val long : LongClass, |
| 809 | 810 | val map : MapClass, |
| 810 | 811 | val MapEntry : MapEntry, |
| 812 | + val MarshalJSON : MarshalJSON, | |
| 811 | 813 | val metadata_property_handling : MetadataPropertyHandling, |
| 812 | 814 | val module : Module, |
| 813 | 815 | val mutable : Mutable, |
| @@ -817,7 +819,6 @@ case class Obj3 ( | ||
| 817 | 819 | val newtonsoft : Newtonsoft, |
| 818 | 820 | val nil : Nil, |
| 819 | 821 | val NO : No, |
| 820 | - val noexcept : Noexcept, | |
| 821 | 822 | val `if` : If, |
| 822 | 823 | val `implicit` : Implicit, |
| 823 | 824 | val `import` : Import, |
| @@ -825,6 +826,10 @@ case class Obj3 ( | ||
| 825 | 826 | val `new` : New |
| 826 | 827 | ) derives OptionPickler.ReadWriter |
| 827 | 828 | |
| 829 | +case class Goto ( | |
| 830 | + val goto : Long | |
| 831 | +) derives OptionPickler.ReadWriter | |
| 832 | + | |
| 828 | 833 | case class Guard ( |
| 829 | 834 | val guard : Long |
| 830 | 835 | ) derives OptionPickler.ReadWriter |
| @@ -1022,6 +1027,10 @@ case class MapEntry ( | ||
| 1022 | 1027 | val MapEntry : Long |
| 1023 | 1028 | ) derives OptionPickler.ReadWriter |
| 1024 | 1029 | |
| 1030 | +case class MarshalJSON ( | |
| 1031 | + val MarshalJSON : Long | |
| 1032 | +) derives OptionPickler.ReadWriter | |
| 1033 | + | |
| 1025 | 1034 | case class MetadataPropertyHandling ( |
| 1026 | 1035 | val metadata_property_handling : Long |
| 1027 | 1036 | ) derives OptionPickler.ReadWriter |
| @@ -1058,10 +1067,6 @@ case class No ( | ||
| 1058 | 1067 | val NO : Long |
| 1059 | 1068 | ) derives OptionPickler.ReadWriter |
| 1060 | 1069 | |
| 1061 | -case class Noexcept ( | |
| 1062 | - val noexcept : Long | |
| 1063 | -) derives OptionPickler.ReadWriter | |
| 1064 | - | |
| 1065 | 1070 | case class If ( |
| 1066 | 1071 | val `if` : Long |
| 1067 | 1072 | ) derives OptionPickler.ReadWriter |
| @@ -1085,6 +1090,7 @@ case class New ( | ||
| 1085 | 1090 | case class Obj4 ( |
| 1086 | 1091 | val dummy : Long, |
| 1087 | 1092 | val noSuchMethod : NoSuchMethod, |
| 1093 | + val noexcept : Noexcept, | |
| 1088 | 1094 | val nonatomic : Nonatomic, |
| 1089 | 1095 | val None : NoneClass, |
| 1090 | 1096 | val nonlocal : Nonlocal, |
| @@ -1146,14 +1152,17 @@ case class Obj4 ( | ||
| 1146 | 1152 | val runtimeType : RuntimeType, |
| 1147 | 1153 | val s : S, |
| 1148 | 1154 | val sbyte : Sbyte, |
| 1149 | - val SEL : Sel, | |
| 1150 | - val select : Select | |
| 1155 | + val SEL : Sel | |
| 1151 | 1156 | ) derives OptionPickler.ReadWriter |
| 1152 | 1157 | |
| 1153 | 1158 | case class NoSuchMethod ( |
| 1154 | 1159 | val noSuchMethod : Long |
| 1155 | 1160 | ) derives OptionPickler.ReadWriter |
| 1156 | 1161 | |
| 1162 | +case class Noexcept ( | |
| 1163 | + val noexcept : Long | |
| 1164 | +) derives OptionPickler.ReadWriter | |
| 1165 | + | |
| 1157 | 1166 | case class Nonatomic ( |
| 1158 | 1167 | val nonatomic : Long |
| 1159 | 1168 | ) derives OptionPickler.ReadWriter |
| @@ -1402,10 +1411,6 @@ case class Sel ( | ||
| 1402 | 1411 | val SEL : Long |
| 1403 | 1412 | ) derives OptionPickler.ReadWriter |
| 1404 | 1413 | |
| 1405 | -case class Select ( | |
| 1406 | - val select : Long | |
| 1407 | -) derives OptionPickler.ReadWriter | |
| 1408 | - | |
| 1409 | 1414 | case class Obj5 ( |
| 1410 | 1415 | val dummy : Long, |
| 1411 | 1416 | val KSerializer : KSerializer, |
| @@ -1420,6 +1425,7 @@ case class Obj5 ( | ||
| 1420 | 1425 | val PrimitiveKind : PrimitiveKind, |
| 1421 | 1426 | val `true` : TrueClass, |
| 1422 | 1427 | val `type` : TypeClass, |
| 1428 | + val select : Select, | |
| 1423 | 1429 | val Self : Self, |
| 1424 | 1430 | val Sendable : Sendable, |
| 1425 | 1431 | val SerialDescriptor : SerialDescriptor, |
| @@ -1454,6 +1460,7 @@ case class Obj5 ( | ||
| 1454 | 1460 | val TimeOnly : TimeOnly, |
| 1455 | 1461 | val TimeOnlyConverter : TimeOnlyConverter, |
| 1456 | 1462 | val TimeZone : TimeZone, |
| 1463 | + val to_dict : ToDict, | |
| 1457 | 1464 | val to_json : ToJSON, |
| 1458 | 1465 | @upickle.implicits.key("toString") |
| 1459 | 1466 | val toStringValue : ToString, |
| @@ -1469,11 +1476,10 @@ case class Obj5 ( | ||
| 1469 | 1476 | val unchecked : Unchecked, |
| 1470 | 1477 | val undefined : Undefined, |
| 1471 | 1478 | val union : Union, |
| 1479 | + val UnmarshalJSON : UnmarshalJSON, | |
| 1472 | 1480 | val unowned : Unowned, |
| 1473 | 1481 | val unsafe : Unsafe, |
| 1474 | - val unsigned : Unsigned, | |
| 1475 | - val UseSerializers : UseSerializers, | |
| 1476 | - val ushort : Ushort | |
| 1482 | + val UseSerializers : UseSerializers | |
| 1477 | 1483 | ) derives OptionPickler.ReadWriter |
| 1478 | 1484 | |
| 1479 | 1485 | case class KSerializer ( |
| @@ -1524,6 +1530,10 @@ case class TypeClass ( | ||
| 1524 | 1530 | val `type` : Long |
| 1525 | 1531 | ) derives OptionPickler.ReadWriter |
| 1526 | 1532 | |
| 1533 | +case class Select ( | |
| 1534 | + val select : Long | |
| 1535 | +) derives OptionPickler.ReadWriter | |
| 1536 | + | |
| 1527 | 1537 | case class Self ( |
| 1528 | 1538 | val Self : Long |
| 1529 | 1539 | ) derives OptionPickler.ReadWriter |
| @@ -1657,6 +1667,10 @@ case class TimeZone ( | ||
| 1657 | 1667 | val TimeZone : Long |
| 1658 | 1668 | ) derives OptionPickler.ReadWriter |
| 1659 | 1669 | |
| 1670 | +case class ToDict ( | |
| 1671 | + val to_dict : Long | |
| 1672 | +) derives OptionPickler.ReadWriter | |
| 1673 | + | |
| 1660 | 1674 | case class ToJSON ( |
| 1661 | 1675 | val to_json : Long |
| 1662 | 1676 | ) derives OptionPickler.ReadWriter |
| @@ -1714,6 +1728,10 @@ case class Union ( | ||
| 1714 | 1728 | val union : Long |
| 1715 | 1729 | ) derives OptionPickler.ReadWriter |
| 1716 | 1730 | |
| 1731 | +case class UnmarshalJSON ( | |
| 1732 | + val UnmarshalJSON : Long | |
| 1733 | +) derives OptionPickler.ReadWriter | |
| 1734 | + | |
| 1717 | 1735 | case class Unowned ( |
| 1718 | 1736 | val unowned : Long |
| 1719 | 1737 | ) derives OptionPickler.ReadWriter |
| @@ -1722,24 +1740,18 @@ case class Unsafe ( | ||
| 1722 | 1740 | val unsafe : Long |
| 1723 | 1741 | ) derives OptionPickler.ReadWriter |
| 1724 | 1742 | |
| 1725 | -case class Unsigned ( | |
| 1726 | - val unsigned : Long | |
| 1727 | -) derives OptionPickler.ReadWriter | |
| 1728 | - | |
| 1729 | 1743 | case class UseSerializers ( |
| 1730 | 1744 | val UseSerializers : Long |
| 1731 | 1745 | ) derives OptionPickler.ReadWriter |
| 1732 | 1746 | |
| 1733 | -case class Ushort ( | |
| 1734 | - val ushort : Long | |
| 1735 | -) derives OptionPickler.ReadWriter | |
| 1736 | - | |
| 1737 | 1747 | case class Obj6 ( |
| 1738 | 1748 | val dummy : Long, |
| 1739 | 1749 | val `var` : Var, |
| 1740 | 1750 | val `while` : While, |
| 1741 | 1751 | val `with` : With, |
| 1742 | 1752 | val `yield` : Yield, |
| 1753 | + val unsigned : Unsigned, | |
| 1754 | + val ushort : Ushort, | |
| 1743 | 1755 | val using : Using, |
| 1744 | 1756 | val Utf8JsonReader : Utf8JSONReader, |
| 1745 | 1757 | val Utf8JsonWriter : Utf8JSONWriter, |
| @@ -1772,6 +1784,14 @@ case class Yield ( | ||
| 1772 | 1784 | val `yield` : Long |
| 1773 | 1785 | ) derives OptionPickler.ReadWriter |
| 1774 | 1786 | |
| 1787 | +case class Unsigned ( | |
| 1788 | + val unsigned : Long | |
| 1789 | +) derives OptionPickler.ReadWriter | |
| 1790 | + | |
| 1791 | +case class Ushort ( | |
| 1792 | + val ushort : Long | |
| 1793 | +) derives OptionPickler.ReadWriter | |
| 1794 | + | |
| 1775 | 1795 | case class Using ( |
| 1776 | 1796 | val using : Long |
| 1777 | 1797 | ) derives OptionPickler.ReadWriter |
Mscala3default / TopLevel.scala+47 −27
| @@ -417,13 +417,13 @@ case class Obj2 ( | ||
| 417 | 417 | val FormatException : FormatException, |
| 418 | 418 | val friend : Friend, |
| 419 | 419 | val from : From, |
| 420 | + val from_dict : FromDict, | |
| 420 | 421 | val from_json : FromJSON, |
| 421 | 422 | val func : Func, |
| 422 | 423 | val function : Function, |
| 423 | 424 | val get : Get, |
| 424 | 425 | val global : Global, |
| 425 | 426 | val go : Go, |
| 426 | - val goto : Goto, | |
| 427 | 427 | val `def` : Def, |
| 428 | 428 | val `do` : Do, |
| 429 | 429 | val `else` : Else, |
| @@ -635,6 +635,10 @@ case class From ( | ||
| 635 | 635 | val from : Long |
| 636 | 636 | ) derives Encoder.AsObject, Decoder |
| 637 | 637 | |
| 638 | +case class FromDict ( | |
| 639 | + val from_dict : Long | |
| 640 | +) derives Encoder.AsObject, Decoder | |
| 641 | + | |
| 638 | 642 | case class FromJSON ( |
| 639 | 643 | val from_json : Long |
| 640 | 644 | ) derives Encoder.AsObject, Decoder |
| @@ -659,10 +663,6 @@ case class Go ( | ||
| 659 | 663 | val go : Long |
| 660 | 664 | ) derives Encoder.AsObject, Decoder |
| 661 | 665 | |
| 662 | -case class Goto ( | |
| 663 | - val goto : Long | |
| 664 | -) derives Encoder.AsObject, Decoder | |
| 665 | - | |
| 666 | 666 | case class Def ( |
| 667 | 667 | val `def` : Long |
| 668 | 668 | ) derives Encoder.AsObject, Decoder |
| @@ -709,6 +709,7 @@ case class FalseClass ( | ||
| 709 | 709 | |
| 710 | 710 | case class Obj3 ( |
| 711 | 711 | val dummy : Long, |
| 712 | + val goto : Goto, | |
| 712 | 713 | val guard : Guard, |
| 713 | 714 | val hasOwnProperty : HasOwnProperty, |
| 714 | 715 | val hashCodeValue : HashCode, |
| @@ -758,6 +759,7 @@ case class Obj3 ( | ||
| 758 | 759 | val long : LongClass, |
| 759 | 760 | val map : MapClass, |
| 760 | 761 | val MapEntry : MapEntry, |
| 762 | + val MarshalJSON : MarshalJSON, | |
| 761 | 763 | val metadata_property_handling : MetadataPropertyHandling, |
| 762 | 764 | val module : Module, |
| 763 | 765 | val mutable : Mutable, |
| @@ -767,7 +769,6 @@ case class Obj3 ( | ||
| 767 | 769 | val newtonsoft : Newtonsoft, |
| 768 | 770 | val nil : Nil, |
| 769 | 771 | val NO : No, |
| 770 | - val noexcept : Noexcept, | |
| 771 | 772 | val `if` : If, |
| 772 | 773 | val `implicit` : Implicit, |
| 773 | 774 | val `import` : Import, |
| @@ -784,6 +785,10 @@ object Obj3: | ||
| 784 | 785 | ) |
| 785 | 786 | given io.circe.Codec.AsObject[Obj3] = io.circe.derivation.ConfiguredCodec.derived |
| 786 | 787 | |
| 788 | +case class Goto ( | |
| 789 | + val goto : Long | |
| 790 | +) derives Encoder.AsObject, Decoder | |
| 791 | + | |
| 787 | 792 | case class Guard ( |
| 788 | 793 | val guard : Long |
| 789 | 794 | ) derives Encoder.AsObject, Decoder |
| @@ -989,6 +994,10 @@ case class MapEntry ( | ||
| 989 | 994 | val MapEntry : Long |
| 990 | 995 | ) derives Encoder.AsObject, Decoder |
| 991 | 996 | |
| 997 | +case class MarshalJSON ( | |
| 998 | + val MarshalJSON : Long | |
| 999 | +) derives Encoder.AsObject, Decoder | |
| 1000 | + | |
| 992 | 1001 | case class MetadataPropertyHandling ( |
| 993 | 1002 | val metadata_property_handling : Long |
| 994 | 1003 | ) derives Encoder.AsObject, Decoder |
| @@ -1025,10 +1034,6 @@ case class No ( | ||
| 1025 | 1034 | val NO : Long |
| 1026 | 1035 | ) derives Encoder.AsObject, Decoder |
| 1027 | 1036 | |
| 1028 | -case class Noexcept ( | |
| 1029 | - val noexcept : Long | |
| 1030 | -) derives Encoder.AsObject, Decoder | |
| 1031 | - | |
| 1032 | 1037 | case class If ( |
| 1033 | 1038 | val `if` : Long |
| 1034 | 1039 | ) derives Encoder.AsObject, Decoder |
| @@ -1052,6 +1057,7 @@ case class New ( | ||
| 1052 | 1057 | case class Obj4 ( |
| 1053 | 1058 | val dummy : Long, |
| 1054 | 1059 | val noSuchMethod : NoSuchMethod, |
| 1060 | + val noexcept : Noexcept, | |
| 1055 | 1061 | val nonatomic : Nonatomic, |
| 1056 | 1062 | val None : NoneClass, |
| 1057 | 1063 | val nonlocal : Nonlocal, |
| @@ -1113,14 +1119,17 @@ case class Obj4 ( | ||
| 1113 | 1119 | val runtimeType : RuntimeType, |
| 1114 | 1120 | val s : S, |
| 1115 | 1121 | val sbyte : Sbyte, |
| 1116 | - val SEL : Sel, | |
| 1117 | - val select : Select | |
| 1122 | + val SEL : Sel | |
| 1118 | 1123 | ) derives Encoder.AsObject, Decoder |
| 1119 | 1124 | |
| 1120 | 1125 | case class NoSuchMethod ( |
| 1121 | 1126 | val noSuchMethod : Long |
| 1122 | 1127 | ) derives Encoder.AsObject, Decoder |
| 1123 | 1128 | |
| 1129 | +case class Noexcept ( | |
| 1130 | + val noexcept : Long | |
| 1131 | +) derives Encoder.AsObject, Decoder | |
| 1132 | + | |
| 1124 | 1133 | case class Nonatomic ( |
| 1125 | 1134 | val nonatomic : Long |
| 1126 | 1135 | ) derives Encoder.AsObject, Decoder |
| @@ -1369,10 +1378,6 @@ case class Sel ( | ||
| 1369 | 1378 | val SEL : Long |
| 1370 | 1379 | ) derives Encoder.AsObject, Decoder |
| 1371 | 1380 | |
| 1372 | -case class Select ( | |
| 1373 | - val select : Long | |
| 1374 | -) derives Encoder.AsObject, Decoder | |
| 1375 | - | |
| 1376 | 1381 | case class Obj5 ( |
| 1377 | 1382 | val dummy : Long, |
| 1378 | 1383 | val KSerializer : KSerializer, |
| @@ -1387,6 +1392,7 @@ case class Obj5 ( | ||
| 1387 | 1392 | val PrimitiveKind : PrimitiveKind, |
| 1388 | 1393 | val `true` : TrueClass, |
| 1389 | 1394 | val `type` : TypeClass, |
| 1395 | + val select : Select, | |
| 1390 | 1396 | val Self : Self, |
| 1391 | 1397 | val Sendable : Sendable, |
| 1392 | 1398 | val SerialDescriptor : SerialDescriptor, |
| @@ -1420,6 +1426,7 @@ case class Obj5 ( | ||
| 1420 | 1426 | val TimeOnly : TimeOnly, |
| 1421 | 1427 | val TimeOnlyConverter : TimeOnlyConverter, |
| 1422 | 1428 | val TimeZone : TimeZone, |
| 1429 | + val to_dict : ToDict, | |
| 1423 | 1430 | val to_json : ToJSON, |
| 1424 | 1431 | val toStringValue : ToString, |
| 1425 | 1432 | val top_level : TopLevelClass, |
| @@ -1434,11 +1441,10 @@ case class Obj5 ( | ||
| 1434 | 1441 | val unchecked : Unchecked, |
| 1435 | 1442 | val undefined : Undefined, |
| 1436 | 1443 | val union : Union, |
| 1444 | + val UnmarshalJSON : UnmarshalJSON, | |
| 1437 | 1445 | val unowned : Unowned, |
| 1438 | 1446 | val unsafe : Unsafe, |
| 1439 | - val unsigned : Unsigned, | |
| 1440 | - val UseSerializers : UseSerializers, | |
| 1441 | - val ushort : Ushort | |
| 1447 | + val UseSerializers : UseSerializers | |
| 1442 | 1448 | ) |
| 1443 | 1449 | |
| 1444 | 1450 | object Obj5: |
| @@ -1499,6 +1505,10 @@ case class TypeClass ( | ||
| 1499 | 1505 | val `type` : Long |
| 1500 | 1506 | ) derives Encoder.AsObject, Decoder |
| 1501 | 1507 | |
| 1508 | +case class Select ( | |
| 1509 | + val select : Long | |
| 1510 | +) derives Encoder.AsObject, Decoder | |
| 1511 | + | |
| 1502 | 1512 | case class Self ( |
| 1503 | 1513 | val Self : Long |
| 1504 | 1514 | ) derives Encoder.AsObject, Decoder |
| @@ -1640,6 +1650,10 @@ case class TimeZone ( | ||
| 1640 | 1650 | val TimeZone : Long |
| 1641 | 1651 | ) derives Encoder.AsObject, Decoder |
| 1642 | 1652 | |
| 1653 | +case class ToDict ( | |
| 1654 | + val to_dict : Long | |
| 1655 | +) derives Encoder.AsObject, Decoder | |
| 1656 | + | |
| 1643 | 1657 | case class ToJSON ( |
| 1644 | 1658 | val to_json : Long |
| 1645 | 1659 | ) derives Encoder.AsObject, Decoder |
| @@ -1705,6 +1719,10 @@ case class Union ( | ||
| 1705 | 1719 | val union : Long |
| 1706 | 1720 | ) derives Encoder.AsObject, Decoder |
| 1707 | 1721 | |
| 1722 | +case class UnmarshalJSON ( | |
| 1723 | + val UnmarshalJSON : Long | |
| 1724 | +) derives Encoder.AsObject, Decoder | |
| 1725 | + | |
| 1708 | 1726 | case class Unowned ( |
| 1709 | 1727 | val unowned : Long |
| 1710 | 1728 | ) derives Encoder.AsObject, Decoder |
| @@ -1713,24 +1731,18 @@ case class Unsafe ( | ||
| 1713 | 1731 | val unsafe : Long |
| 1714 | 1732 | ) derives Encoder.AsObject, Decoder |
| 1715 | 1733 | |
| 1716 | -case class Unsigned ( | |
| 1717 | - val unsigned : Long | |
| 1718 | -) derives Encoder.AsObject, Decoder | |
| 1719 | - | |
| 1720 | 1734 | case class UseSerializers ( |
| 1721 | 1735 | val UseSerializers : Long |
| 1722 | 1736 | ) derives Encoder.AsObject, Decoder |
| 1723 | 1737 | |
| 1724 | -case class Ushort ( | |
| 1725 | - val ushort : Long | |
| 1726 | -) derives Encoder.AsObject, Decoder | |
| 1727 | - | |
| 1728 | 1738 | case class Obj6 ( |
| 1729 | 1739 | val dummy : Long, |
| 1730 | 1740 | val `var` : Var, |
| 1731 | 1741 | val `while` : While, |
| 1732 | 1742 | val `with` : With, |
| 1733 | 1743 | val `yield` : Yield, |
| 1744 | + val unsigned : Unsigned, | |
| 1745 | + val ushort : Ushort, | |
| 1734 | 1746 | val using : Using, |
| 1735 | 1747 | val Utf8JsonReader : Utf8JSONReader, |
| 1736 | 1748 | val Utf8JsonWriter : Utf8JSONWriter, |
| @@ -1763,6 +1775,14 @@ case class Yield ( | ||
| 1763 | 1775 | val `yield` : Long |
| 1764 | 1776 | ) derives Encoder.AsObject, Decoder |
| 1765 | 1777 | |
| 1778 | +case class Unsigned ( | |
| 1779 | + val unsigned : Long | |
| 1780 | +) derives Encoder.AsObject, Decoder | |
| 1781 | + | |
| 1782 | +case class Ushort ( | |
| 1783 | + val ushort : Long | |
| 1784 | +) derives Encoder.AsObject, Decoder | |
| 1785 | + | |
| 1766 | 1786 | case class Using ( |
| 1767 | 1787 | val using : Long |
| 1768 | 1788 | ) derives Encoder.AsObject, Decoder |
Mswiftdefault / quicktype.swift+434 −242
| @@ -3234,11 +3234,11 @@ struct Obj2: Codable { | ||
| 3234 | 3234 | let formatException: FormatException |
| 3235 | 3235 | let friend: Friend |
| 3236 | 3236 | let from: From |
| 3237 | + let fromDict: FromDict | |
| 3237 | 3238 | let fromJSON: FromJSON |
| 3238 | 3239 | let function: Function |
| 3239 | 3240 | let global: Global |
| 3240 | 3241 | let go: Go |
| 3241 | - let goto: Goto | |
| 3242 | 3242 | let obj2Default: Default |
| 3243 | 3243 | let obj2Defer: Defer |
| 3244 | 3244 | let obj2Deinit: Deinit |
| @@ -3301,11 +3301,11 @@ struct Obj2: Codable { | ||
| 3301 | 3301 | case formatException = "FormatException" |
| 3302 | 3302 | case friend = "friend" |
| 3303 | 3303 | case from = "from" |
| 3304 | + case fromDict = "from_dict" | |
| 3304 | 3305 | case fromJSON = "from_json" |
| 3305 | 3306 | case function = "function" |
| 3306 | 3307 | case global = "global" |
| 3307 | 3308 | case go = "go" |
| 3308 | - case goto = "goto" | |
| 3309 | 3309 | case obj2Default = "default" |
| 3310 | 3310 | case obj2Defer = "defer" |
| 3311 | 3311 | case obj2Deinit = "deinit" |
| @@ -3388,11 +3388,11 @@ extension Obj2 { | ||
| 3388 | 3388 | formatException: FormatException? = nil, |
| 3389 | 3389 | friend: Friend? = nil, |
| 3390 | 3390 | from: From? = nil, |
| 3391 | + fromDict: FromDict? = nil, | |
| 3391 | 3392 | fromJSON: FromJSON? = nil, |
| 3392 | 3393 | function: Function? = nil, |
| 3393 | 3394 | global: Global? = nil, |
| 3394 | 3395 | go: Go? = nil, |
| 3395 | - goto: Goto? = nil, | |
| 3396 | 3396 | obj2Default: Default? = nil, |
| 3397 | 3397 | obj2Defer: Defer? = nil, |
| 3398 | 3398 | obj2Deinit: Deinit? = nil, |
| @@ -3455,11 +3455,11 @@ extension Obj2 { | ||
| 3455 | 3455 | formatException: formatException ?? self.formatException, |
| 3456 | 3456 | friend: friend ?? self.friend, |
| 3457 | 3457 | from: from ?? self.from, |
| 3458 | + fromDict: fromDict ?? self.fromDict, | |
| 3458 | 3459 | fromJSON: fromJSON ?? self.fromJSON, |
| 3459 | 3460 | function: function ?? self.function, |
| 3460 | 3461 | global: global ?? self.global, |
| 3461 | 3462 | go: go ?? self.go, |
| 3462 | - goto: goto ?? self.goto, | |
| 3463 | 3463 | obj2Default: obj2Default ?? self.obj2Default, |
| 3464 | 3464 | obj2Defer: obj2Defer ?? self.obj2Defer, |
| 3465 | 3465 | obj2Deinit: obj2Deinit ?? self.obj2Deinit, |
| @@ -5342,6 +5342,50 @@ extension From { | ||
| 5342 | 5342 | } |
| 5343 | 5343 | } |
| 5344 | 5344 | |
| 5345 | +// MARK: - FromDict | |
| 5346 | +struct FromDict: Codable { | |
| 5347 | + let fromDict: Int | |
| 5348 | + | |
| 5349 | + enum CodingKeys: String, CodingKey { | |
| 5350 | + case fromDict = "from_dict" | |
| 5351 | + } | |
| 5352 | +} | |
| 5353 | + | |
| 5354 | +// MARK: FromDict convenience initializers and mutators | |
| 5355 | + | |
| 5356 | +extension FromDict { | |
| 5357 | + init(data: Data) throws { | |
| 5358 | + self = try newJSONDecoder().decode(FromDict.self, from: data) | |
| 5359 | + } | |
| 5360 | + | |
| 5361 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 5362 | + guard let data = json.data(using: encoding) else { | |
| 5363 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 5364 | + } | |
| 5365 | + try self.init(data: data) | |
| 5366 | + } | |
| 5367 | + | |
| 5368 | + init(fromURL url: URL) throws { | |
| 5369 | + try self.init(data: try Data(contentsOf: url)) | |
| 5370 | + } | |
| 5371 | + | |
| 5372 | + func with( | |
| 5373 | + fromDict: Int? = nil | |
| 5374 | + ) -> FromDict { | |
| 5375 | + return FromDict( | |
| 5376 | + fromDict: fromDict ?? self.fromDict | |
| 5377 | + ) | |
| 5378 | + } | |
| 5379 | + | |
| 5380 | + func jsonData() throws -> Data { | |
| 5381 | + return try newJSONEncoder().encode(self) | |
| 5382 | + } | |
| 5383 | + | |
| 5384 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 5385 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 5386 | + } | |
| 5387 | +} | |
| 5388 | + | |
| 5345 | 5389 | // MARK: - FromJSON |
| 5346 | 5390 | struct FromJSON: Codable { |
| 5347 | 5391 | let fromJSON: Int |
| @@ -5518,50 +5562,6 @@ extension Go { | ||
| 5518 | 5562 | } |
| 5519 | 5563 | } |
| 5520 | 5564 | |
| 5521 | -// MARK: - Goto | |
| 5522 | -struct Goto: Codable { | |
| 5523 | - let goto: Int | |
| 5524 | - | |
| 5525 | - enum CodingKeys: String, CodingKey { | |
| 5526 | - case goto = "goto" | |
| 5527 | - } | |
| 5528 | -} | |
| 5529 | - | |
| 5530 | -// MARK: Goto convenience initializers and mutators | |
| 5531 | - | |
| 5532 | -extension Goto { | |
| 5533 | - init(data: Data) throws { | |
| 5534 | - self = try newJSONDecoder().decode(Goto.self, from: data) | |
| 5535 | - } | |
| 5536 | - | |
| 5537 | - init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 5538 | - guard let data = json.data(using: encoding) else { | |
| 5539 | - throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 5540 | - } | |
| 5541 | - try self.init(data: data) | |
| 5542 | - } | |
| 5543 | - | |
| 5544 | - init(fromURL url: URL) throws { | |
| 5545 | - try self.init(data: try Data(contentsOf: url)) | |
| 5546 | - } | |
| 5547 | - | |
| 5548 | - func with( | |
| 5549 | - goto: Int? = nil | |
| 5550 | - ) -> Goto { | |
| 5551 | - return Goto( | |
| 5552 | - goto: goto ?? self.goto | |
| 5553 | - ) | |
| 5554 | - } | |
| 5555 | - | |
| 5556 | - func jsonData() throws -> Data { | |
| 5557 | - return try newJSONEncoder().encode(self) | |
| 5558 | - } | |
| 5559 | - | |
| 5560 | - func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 5561 | - return String(data: try self.jsonData(), encoding: encoding) | |
| 5562 | - } | |
| 5563 | -} | |
| 5564 | - | |
| 5565 | 5565 | // MARK: - Default |
| 5566 | 5566 | struct Default: Codable { |
| 5567 | 5567 | let defaultDefault: Int |
| @@ -6313,6 +6313,7 @@ extension FalseClass { | ||
| 6313 | 6313 | // MARK: - Obj3 |
| 6314 | 6314 | struct Obj3: Codable { |
| 6315 | 6315 | let dummy: Int |
| 6316 | + let goto: Goto | |
| 6316 | 6317 | let hasOwnProperty: HasOwnProperty |
| 6317 | 6318 | let hashCode: HashCode |
| 6318 | 6319 | let hashable: HashableClass |
| @@ -6352,6 +6353,7 @@ struct Obj3: Codable { | ||
| 6352 | 6353 | let long: Long |
| 6353 | 6354 | let map: Map |
| 6354 | 6355 | let mapEntry: MapEntry |
| 6356 | + let marshalJSON: MarshalJSON | |
| 6355 | 6357 | let metadataPropertyHandling: MetadataPropertyHandling |
| 6356 | 6358 | let module: Module |
| 6357 | 6359 | let mutable: Mutable |
| @@ -6360,7 +6362,6 @@ struct Obj3: Codable { | ||
| 6360 | 6362 | let new: New |
| 6361 | 6363 | let newtonsoft: Newtonsoft |
| 6362 | 6364 | let no: No |
| 6363 | - let noexcept: Noexcept | |
| 6364 | 6365 | let obj3Guard: Guard |
| 6365 | 6366 | let obj3If: If |
| 6366 | 6367 | let obj3Import: Import |
| @@ -6380,6 +6381,7 @@ struct Obj3: Codable { | ||
| 6380 | 6381 | |
| 6381 | 6382 | enum CodingKeys: String, CodingKey { |
| 6382 | 6383 | case dummy = "dummy" |
| 6384 | + case goto = "goto" | |
| 6383 | 6385 | case hasOwnProperty = "hasOwnProperty" |
| 6384 | 6386 | case hashCode = "hashCode" |
| 6385 | 6387 | case hashable = "Hashable" |
| @@ -6419,6 +6421,7 @@ struct Obj3: Codable { | ||
| 6419 | 6421 | case long = "long" |
| 6420 | 6422 | case map = "map" |
| 6421 | 6423 | case mapEntry = "MapEntry" |
| 6424 | + case marshalJSON = "MarshalJSON" | |
| 6422 | 6425 | case metadataPropertyHandling = "metadata_property_handling" |
| 6423 | 6426 | case module = "module" |
| 6424 | 6427 | case mutable = "mutable" |
| @@ -6427,7 +6430,6 @@ struct Obj3: Codable { | ||
| 6427 | 6430 | case new = "new" |
| 6428 | 6431 | case newtonsoft = "newtonsoft" |
| 6429 | 6432 | case no = "NO" |
| 6430 | - case noexcept = "noexcept" | |
| 6431 | 6433 | case obj3Guard = "guard" |
| 6432 | 6434 | case obj3If = "if" |
| 6433 | 6435 | case obj3Import = "import" |
| @@ -6467,6 +6469,7 @@ extension Obj3 { | ||
| 6467 | 6469 | |
| 6468 | 6470 | func with( |
| 6469 | 6471 | dummy: Int? = nil, |
| 6472 | + goto: Goto? = nil, | |
| 6470 | 6473 | hasOwnProperty: HasOwnProperty? = nil, |
| 6471 | 6474 | hashCode: HashCode? = nil, |
| 6472 | 6475 | hashable: HashableClass? = nil, |
| @@ -6506,6 +6509,7 @@ extension Obj3 { | ||
| 6506 | 6509 | long: Long? = nil, |
| 6507 | 6510 | map: Map? = nil, |
| 6508 | 6511 | mapEntry: MapEntry? = nil, |
| 6512 | + marshalJSON: MarshalJSON? = nil, | |
| 6509 | 6513 | metadataPropertyHandling: MetadataPropertyHandling? = nil, |
| 6510 | 6514 | module: Module? = nil, |
| 6511 | 6515 | mutable: Mutable? = nil, |
| @@ -6514,7 +6518,6 @@ extension Obj3 { | ||
| 6514 | 6518 | new: New? = nil, |
| 6515 | 6519 | newtonsoft: Newtonsoft? = nil, |
| 6516 | 6520 | no: No? = nil, |
| 6517 | - noexcept: Noexcept? = nil, | |
| 6518 | 6521 | obj3Guard: Guard? = nil, |
| 6519 | 6522 | obj3If: If? = nil, |
| 6520 | 6523 | obj3Import: Import? = nil, |
| @@ -6534,6 +6537,7 @@ extension Obj3 { | ||
| 6534 | 6537 | ) -> Obj3 { |
| 6535 | 6538 | return Obj3( |
| 6536 | 6539 | dummy: dummy ?? self.dummy, |
| 6540 | + goto: goto ?? self.goto, | |
| 6537 | 6541 | hasOwnProperty: hasOwnProperty ?? self.hasOwnProperty, |
| 6538 | 6542 | hashCode: hashCode ?? self.hashCode, |
| 6539 | 6543 | hashable: hashable ?? self.hashable, |
| @@ -6573,6 +6577,7 @@ extension Obj3 { | ||
| 6573 | 6577 | long: long ?? self.long, |
| 6574 | 6578 | map: map ?? self.map, |
| 6575 | 6579 | mapEntry: mapEntry ?? self.mapEntry, |
| 6580 | + marshalJSON: marshalJSON ?? self.marshalJSON, | |
| 6576 | 6581 | metadataPropertyHandling: metadataPropertyHandling ?? self.metadataPropertyHandling, |
| 6577 | 6582 | module: module ?? self.module, |
| 6578 | 6583 | mutable: mutable ?? self.mutable, |
| @@ -6581,7 +6586,6 @@ extension Obj3 { | ||
| 6581 | 6586 | new: new ?? self.new, |
| 6582 | 6587 | newtonsoft: newtonsoft ?? self.newtonsoft, |
| 6583 | 6588 | no: no ?? self.no, |
| 6584 | - noexcept: noexcept ?? self.noexcept, | |
| 6585 | 6589 | obj3Guard: obj3Guard ?? self.obj3Guard, |
| 6586 | 6590 | obj3If: obj3If ?? self.obj3If, |
| 6587 | 6591 | obj3Import: obj3Import ?? self.obj3Import, |
| @@ -6610,6 +6614,50 @@ extension Obj3 { | ||
| 6610 | 6614 | } |
| 6611 | 6615 | } |
| 6612 | 6616 | |
| 6617 | +// MARK: - Goto | |
| 6618 | +struct Goto: Codable { | |
| 6619 | + let goto: Int | |
| 6620 | + | |
| 6621 | + enum CodingKeys: String, CodingKey { | |
| 6622 | + case goto = "goto" | |
| 6623 | + } | |
| 6624 | +} | |
| 6625 | + | |
| 6626 | +// MARK: Goto convenience initializers and mutators | |
| 6627 | + | |
| 6628 | +extension Goto { | |
| 6629 | + init(data: Data) throws { | |
| 6630 | + self = try newJSONDecoder().decode(Goto.self, from: data) | |
| 6631 | + } | |
| 6632 | + | |
| 6633 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 6634 | + guard let data = json.data(using: encoding) else { | |
| 6635 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 6636 | + } | |
| 6637 | + try self.init(data: data) | |
| 6638 | + } | |
| 6639 | + | |
| 6640 | + init(fromURL url: URL) throws { | |
| 6641 | + try self.init(data: try Data(contentsOf: url)) | |
| 6642 | + } | |
| 6643 | + | |
| 6644 | + func with( | |
| 6645 | + goto: Int? = nil | |
| 6646 | + ) -> Goto { | |
| 6647 | + return Goto( | |
| 6648 | + goto: goto ?? self.goto | |
| 6649 | + ) | |
| 6650 | + } | |
| 6651 | + | |
| 6652 | + func jsonData() throws -> Data { | |
| 6653 | + return try newJSONEncoder().encode(self) | |
| 6654 | + } | |
| 6655 | + | |
| 6656 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 6657 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 6658 | + } | |
| 6659 | +} | |
| 6660 | + | |
| 6613 | 6661 | // MARK: - HasOwnProperty |
| 6614 | 6662 | struct HasOwnProperty: Codable { |
| 6615 | 6663 | let hasOwnProperty: Int |
| @@ -8326,6 +8374,50 @@ extension MapEntry { | ||
| 8326 | 8374 | } |
| 8327 | 8375 | } |
| 8328 | 8376 | |
| 8377 | +// MARK: - MarshalJSON | |
| 8378 | +struct MarshalJSON: Codable { | |
| 8379 | + let marshalJSON: Int | |
| 8380 | + | |
| 8381 | + enum CodingKeys: String, CodingKey { | |
| 8382 | + case marshalJSON = "MarshalJSON" | |
| 8383 | + } | |
| 8384 | +} | |
| 8385 | + | |
| 8386 | +// MARK: MarshalJSON convenience initializers and mutators | |
| 8387 | + | |
| 8388 | +extension MarshalJSON { | |
| 8389 | + init(data: Data) throws { | |
| 8390 | + self = try newJSONDecoder().decode(MarshalJSON.self, from: data) | |
| 8391 | + } | |
| 8392 | + | |
| 8393 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 8394 | + guard let data = json.data(using: encoding) else { | |
| 8395 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 8396 | + } | |
| 8397 | + try self.init(data: data) | |
| 8398 | + } | |
| 8399 | + | |
| 8400 | + init(fromURL url: URL) throws { | |
| 8401 | + try self.init(data: try Data(contentsOf: url)) | |
| 8402 | + } | |
| 8403 | + | |
| 8404 | + func with( | |
| 8405 | + marshalJSON: Int? = nil | |
| 8406 | + ) -> MarshalJSON { | |
| 8407 | + return MarshalJSON( | |
| 8408 | + marshalJSON: marshalJSON ?? self.marshalJSON | |
| 8409 | + ) | |
| 8410 | + } | |
| 8411 | + | |
| 8412 | + func jsonData() throws -> Data { | |
| 8413 | + return try newJSONEncoder().encode(self) | |
| 8414 | + } | |
| 8415 | + | |
| 8416 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 8417 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 8418 | + } | |
| 8419 | +} | |
| 8420 | + | |
| 8329 | 8421 | // MARK: - MetadataPropertyHandling |
| 8330 | 8422 | struct MetadataPropertyHandling: Codable { |
| 8331 | 8423 | let metadataPropertyHandling: Int |
| @@ -8678,50 +8770,6 @@ extension No { | ||
| 8678 | 8770 | } |
| 8679 | 8771 | } |
| 8680 | 8772 | |
| 8681 | -// MARK: - Noexcept | |
| 8682 | -struct Noexcept: Codable { | |
| 8683 | - let noexcept: Int | |
| 8684 | - | |
| 8685 | - enum CodingKeys: String, CodingKey { | |
| 8686 | - case noexcept = "noexcept" | |
| 8687 | - } | |
| 8688 | -} | |
| 8689 | - | |
| 8690 | -// MARK: Noexcept convenience initializers and mutators | |
| 8691 | - | |
| 8692 | -extension Noexcept { | |
| 8693 | - init(data: Data) throws { | |
| 8694 | - self = try newJSONDecoder().decode(Noexcept.self, from: data) | |
| 8695 | - } | |
| 8696 | - | |
| 8697 | - init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 8698 | - guard let data = json.data(using: encoding) else { | |
| 8699 | - throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 8700 | - } | |
| 8701 | - try self.init(data: data) | |
| 8702 | - } | |
| 8703 | - | |
| 8704 | - init(fromURL url: URL) throws { | |
| 8705 | - try self.init(data: try Data(contentsOf: url)) | |
| 8706 | - } | |
| 8707 | - | |
| 8708 | - func with( | |
| 8709 | - noexcept: Int? = nil | |
| 8710 | - ) -> Noexcept { | |
| 8711 | - return Noexcept( | |
| 8712 | - noexcept: noexcept ?? self.noexcept | |
| 8713 | - ) | |
| 8714 | - } | |
| 8715 | - | |
| 8716 | - func jsonData() throws -> Data { | |
| 8717 | - return try newJSONEncoder().encode(self) | |
| 8718 | - } | |
| 8719 | - | |
| 8720 | - func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 8721 | - return String(data: try self.jsonData(), encoding: encoding) | |
| 8722 | - } | |
| 8723 | -} | |
| 8724 | - | |
| 8725 | 8773 | // MARK: - Guard |
| 8726 | 8774 | struct Guard: Codable { |
| 8727 | 8775 | let guardGuard: Int |
| @@ -9430,6 +9478,7 @@ extension Nil { | ||
| 9430 | 9478 | struct Obj4: Codable { |
| 9431 | 9479 | let dummy: Int |
| 9432 | 9480 | let noSuchMethod: NoSuchMethod |
| 9481 | + let noexcept: Noexcept | |
| 9433 | 9482 | let nonatomic: Nonatomic |
| 9434 | 9483 | let none: None |
| 9435 | 9484 | let nonlocal: Nonlocal |
| @@ -9492,11 +9541,11 @@ struct Obj4: Codable { | ||
| 9492 | 9541 | let sbyte: Sbyte |
| 9493 | 9542 | let sealed: Sealed |
| 9494 | 9543 | let sel: Sel |
| 9495 | - let select: Select | |
| 9496 | 9544 | |
| 9497 | 9545 | enum CodingKeys: String, CodingKey { |
| 9498 | 9546 | case dummy = "dummy" |
| 9499 | 9547 | case noSuchMethod = "noSuchMethod" |
| 9548 | + case noexcept = "noexcept" | |
| 9500 | 9549 | case nonatomic = "nonatomic" |
| 9501 | 9550 | case none = "None" |
| 9502 | 9551 | case nonlocal = "nonlocal" |
| @@ -9559,7 +9608,6 @@ struct Obj4: Codable { | ||
| 9559 | 9608 | case sbyte = "sbyte" |
| 9560 | 9609 | case sealed = "sealed" |
| 9561 | 9610 | case sel = "SEL" |
| 9562 | - case select = "select" | |
| 9563 | 9611 | } |
| 9564 | 9612 | } |
| 9565 | 9613 | |
| @@ -9584,6 +9632,7 @@ extension Obj4 { | ||
| 9584 | 9632 | func with( |
| 9585 | 9633 | dummy: Int? = nil, |
| 9586 | 9634 | noSuchMethod: NoSuchMethod? = nil, |
| 9635 | + noexcept: Noexcept? = nil, | |
| 9587 | 9636 | nonatomic: Nonatomic? = nil, |
| 9588 | 9637 | none: None? = nil, |
| 9589 | 9638 | nonlocal: Nonlocal? = nil, |
| @@ -9645,12 +9694,12 @@ extension Obj4 { | ||
| 9645 | 9694 | s: S? = nil, |
| 9646 | 9695 | sbyte: Sbyte? = nil, |
| 9647 | 9696 | sealed: Sealed? = nil, |
| 9648 | - sel: Sel? = nil, | |
| 9649 | - select: Select? = nil | |
| 9697 | + sel: Sel? = nil | |
| 9650 | 9698 | ) -> Obj4 { |
| 9651 | 9699 | return Obj4( |
| 9652 | 9700 | dummy: dummy ?? self.dummy, |
| 9653 | 9701 | noSuchMethod: noSuchMethod ?? self.noSuchMethod, |
| 9702 | + noexcept: noexcept ?? self.noexcept, | |
| 9654 | 9703 | nonatomic: nonatomic ?? self.nonatomic, |
| 9655 | 9704 | none: none ?? self.none, |
| 9656 | 9705 | nonlocal: nonlocal ?? self.nonlocal, |
| @@ -9712,8 +9761,7 @@ extension Obj4 { | ||
| 9712 | 9761 | s: s ?? self.s, |
| 9713 | 9762 | sbyte: sbyte ?? self.sbyte, |
| 9714 | 9763 | sealed: sealed ?? self.sealed, |
| 9715 | - sel: sel ?? self.sel, | |
| 9716 | - select: select ?? self.select | |
| 9764 | + sel: sel ?? self.sel | |
| 9717 | 9765 | ) |
| 9718 | 9766 | } |
| 9719 | 9767 | |
| @@ -9770,20 +9818,20 @@ extension NoSuchMethod { | ||
| 9770 | 9818 | } |
| 9771 | 9819 | } |
| 9772 | 9820 | |
| 9773 | -// MARK: - Nonatomic | |
| 9774 | -struct Nonatomic: Codable { | |
| 9775 | - let nonatomic: Int | |
| 9821 | +// MARK: - Noexcept | |
| 9822 | +struct Noexcept: Codable { | |
| 9823 | + let noexcept: Int | |
| 9776 | 9824 | |
| 9777 | 9825 | enum CodingKeys: String, CodingKey { |
| 9778 | - case nonatomic = "nonatomic" | |
| 9826 | + case noexcept = "noexcept" | |
| 9779 | 9827 | } |
| 9780 | 9828 | } |
| 9781 | 9829 | |
| 9782 | -// MARK: Nonatomic convenience initializers and mutators | |
| 9830 | +// MARK: Noexcept convenience initializers and mutators | |
| 9783 | 9831 | |
| 9784 | -extension Nonatomic { | |
| 9832 | +extension Noexcept { | |
| 9785 | 9833 | init(data: Data) throws { |
| 9786 | - self = try newJSONDecoder().decode(Nonatomic.self, from: data) | |
| 9834 | + self = try newJSONDecoder().decode(Noexcept.self, from: data) | |
| 9787 | 9835 | } |
| 9788 | 9836 | |
| 9789 | 9837 | init(_ json: String, using encoding: String.Encoding = .utf8) throws { |
| @@ -9798,10 +9846,10 @@ extension Nonatomic { | ||
| 9798 | 9846 | } |
| 9799 | 9847 | |
| 9800 | 9848 | func with( |
| 9801 | - nonatomic: Int? = nil | |
| 9802 | - ) -> Nonatomic { | |
| 9803 | - return Nonatomic( | |
| 9804 | - nonatomic: nonatomic ?? self.nonatomic | |
| 9849 | + noexcept: Int? = nil | |
| 9850 | + ) -> Noexcept { | |
| 9851 | + return Noexcept( | |
| 9852 | + noexcept: noexcept ?? self.noexcept | |
| 9805 | 9853 | ) |
| 9806 | 9854 | } |
| 9807 | 9855 | |
| @@ -9814,20 +9862,20 @@ extension Nonatomic { | ||
| 9814 | 9862 | } |
| 9815 | 9863 | } |
| 9816 | 9864 | |
| 9817 | -// MARK: - None | |
| 9818 | -struct None: Codable { | |
| 9819 | - let none: Int | |
| 9865 | +// MARK: - Nonatomic | |
| 9866 | +struct Nonatomic: Codable { | |
| 9867 | + let nonatomic: Int | |
| 9820 | 9868 | |
| 9821 | 9869 | enum CodingKeys: String, CodingKey { |
| 9822 | - case none = "None" | |
| 9870 | + case nonatomic = "nonatomic" | |
| 9823 | 9871 | } |
| 9824 | 9872 | } |
| 9825 | 9873 | |
| 9826 | -// MARK: None convenience initializers and mutators | |
| 9874 | +// MARK: Nonatomic convenience initializers and mutators | |
| 9827 | 9875 | |
| 9828 | -extension None { | |
| 9876 | +extension Nonatomic { | |
| 9829 | 9877 | init(data: Data) throws { |
| 9830 | - self = try newJSONDecoder().decode(None.self, from: data) | |
| 9878 | + self = try newJSONDecoder().decode(Nonatomic.self, from: data) | |
| 9831 | 9879 | } |
| 9832 | 9880 | |
| 9833 | 9881 | init(_ json: String, using encoding: String.Encoding = .utf8) throws { |
| @@ -9842,8 +9890,52 @@ extension None { | ||
| 9842 | 9890 | } |
| 9843 | 9891 | |
| 9844 | 9892 | func with( |
| 9845 | - none: Int? = nil | |
| 9846 | - ) -> None { | |
| 9893 | + nonatomic: Int? = nil | |
| 9894 | + ) -> Nonatomic { | |
| 9895 | + return Nonatomic( | |
| 9896 | + nonatomic: nonatomic ?? self.nonatomic | |
| 9897 | + ) | |
| 9898 | + } | |
| 9899 | + | |
| 9900 | + func jsonData() throws -> Data { | |
| 9901 | + return try newJSONEncoder().encode(self) | |
| 9902 | + } | |
| 9903 | + | |
| 9904 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 9905 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 9906 | + } | |
| 9907 | +} | |
| 9908 | + | |
| 9909 | +// MARK: - None | |
| 9910 | +struct None: Codable { | |
| 9911 | + let none: Int | |
| 9912 | + | |
| 9913 | + enum CodingKeys: String, CodingKey { | |
| 9914 | + case none = "None" | |
| 9915 | + } | |
| 9916 | +} | |
| 9917 | + | |
| 9918 | +// MARK: None convenience initializers and mutators | |
| 9919 | + | |
| 9920 | +extension None { | |
| 9921 | + init(data: Data) throws { | |
| 9922 | + self = try newJSONDecoder().decode(None.self, from: data) | |
| 9923 | + } | |
| 9924 | + | |
| 9925 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 9926 | + guard let data = json.data(using: encoding) else { | |
| 9927 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 9928 | + } | |
| 9929 | + try self.init(data: data) | |
| 9930 | + } | |
| 9931 | + | |
| 9932 | + init(fromURL url: URL) throws { | |
| 9933 | + try self.init(data: try Data(contentsOf: url)) | |
| 9934 | + } | |
| 9935 | + | |
| 9936 | + func with( | |
| 9937 | + none: Int? = nil | |
| 9938 | + ) -> None { | |
| 9847 | 9939 | return None( |
| 9848 | 9940 | none: none ?? self.none |
| 9849 | 9941 | ) |
| @@ -12498,50 +12590,6 @@ extension Sel { | ||
| 12498 | 12590 | } |
| 12499 | 12591 | } |
| 12500 | 12592 | |
| 12501 | -// MARK: - Select | |
| 12502 | -struct Select: Codable { | |
| 12503 | - let select: Int | |
| 12504 | - | |
| 12505 | - enum CodingKeys: String, CodingKey { | |
| 12506 | - case select = "select" | |
| 12507 | - } | |
| 12508 | -} | |
| 12509 | - | |
| 12510 | -// MARK: Select convenience initializers and mutators | |
| 12511 | - | |
| 12512 | -extension Select { | |
| 12513 | - init(data: Data) throws { | |
| 12514 | - self = try newJSONDecoder().decode(Select.self, from: data) | |
| 12515 | - } | |
| 12516 | - | |
| 12517 | - init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 12518 | - guard let data = json.data(using: encoding) else { | |
| 12519 | - throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 12520 | - } | |
| 12521 | - try self.init(data: data) | |
| 12522 | - } | |
| 12523 | - | |
| 12524 | - init(fromURL url: URL) throws { | |
| 12525 | - try self.init(data: try Data(contentsOf: url)) | |
| 12526 | - } | |
| 12527 | - | |
| 12528 | - func with( | |
| 12529 | - select: Int? = nil | |
| 12530 | - ) -> Select { | |
| 12531 | - return Select( | |
| 12532 | - select: select ?? self.select | |
| 12533 | - ) | |
| 12534 | - } | |
| 12535 | - | |
| 12536 | - func jsonData() throws -> Data { | |
| 12537 | - return try newJSONEncoder().encode(self) | |
| 12538 | - } | |
| 12539 | - | |
| 12540 | - func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 12541 | - return String(data: try self.jsonData(), encoding: encoding) | |
| 12542 | - } | |
| 12543 | -} | |
| 12544 | - | |
| 12545 | 12593 | // MARK: - Obj5 |
| 12546 | 12594 | struct Obj5: Codable { |
| 12547 | 12595 | let dummy: Int |
| @@ -12563,6 +12611,7 @@ struct Obj5: Codable { | ||
| 12563 | 12611 | let primitiveKind: PrimitiveKind |
| 12564 | 12612 | let purpleSelf: Obj5Self |
| 12565 | 12613 | let purpleTrue: TrueClass |
| 12614 | + let select: Select | |
| 12566 | 12615 | let sendable: Sendable |
| 12567 | 12616 | let serialDescriptor: SerialDescriptor |
| 12568 | 12617 | let serialName: SerialName |
| @@ -12591,6 +12640,7 @@ struct Obj5: Codable { | ||
| 12591 | 12640 | let timeOnly: TimeOnly |
| 12592 | 12641 | let timeOnlyConverter: TimeOnlyConverter |
| 12593 | 12642 | let timeZone: TimeZoneClass |
| 12643 | + let toDict: ToDict | |
| 12594 | 12644 | let toJSON: ToJSON |
| 12595 | 12645 | let toString: ToString |
| 12596 | 12646 | let topLevel: TopLevelClass |
| @@ -12605,10 +12655,9 @@ struct Obj5: Codable { | ||
| 12605 | 12655 | let unchecked: Unchecked |
| 12606 | 12656 | let undefined: Undefined |
| 12607 | 12657 | let union: Union |
| 12658 | + let unmarshalJSON: UnmarshalJSON | |
| 12608 | 12659 | let unsafe: Unsafe |
| 12609 | - let unsigned: Unsigned | |
| 12610 | 12660 | let useSerializers: UseSerializers |
| 12611 | - let ushort: Ushort | |
| 12612 | 12661 | |
| 12613 | 12662 | enum CodingKeys: String, CodingKey { |
| 12614 | 12663 | case dummy = "dummy" |
| @@ -12630,6 +12679,7 @@ struct Obj5: Codable { | ||
| 12630 | 12679 | case primitiveKind = "PrimitiveKind" |
| 12631 | 12680 | case purpleSelf = "self" |
| 12632 | 12681 | case purpleTrue = "true" |
| 12682 | + case select = "select" | |
| 12633 | 12683 | case sendable = "Sendable" |
| 12634 | 12684 | case serialDescriptor = "SerialDescriptor" |
| 12635 | 12685 | case serialName = "SerialName" |
| @@ -12658,6 +12708,7 @@ struct Obj5: Codable { | ||
| 12658 | 12708 | case timeOnly = "TimeOnly" |
| 12659 | 12709 | case timeOnlyConverter = "TimeOnlyConverter" |
| 12660 | 12710 | case timeZone = "TimeZone" |
| 12711 | + case toDict = "to_dict" | |
| 12661 | 12712 | case toJSON = "to_json" |
| 12662 | 12713 | case toString = "toString" |
| 12663 | 12714 | case topLevel = "top_level" |
| @@ -12672,10 +12723,9 @@ struct Obj5: Codable { | ||
| 12672 | 12723 | case unchecked = "unchecked" |
| 12673 | 12724 | case undefined = "undefined" |
| 12674 | 12725 | case union = "union" |
| 12726 | + case unmarshalJSON = "UnmarshalJSON" | |
| 12675 | 12727 | case unsafe = "unsafe" |
| 12676 | - case unsigned = "unsigned" | |
| 12677 | 12728 | case useSerializers = "UseSerializers" |
| 12678 | - case ushort = "ushort" | |
| 12679 | 12729 | } |
| 12680 | 12730 | } |
| 12681 | 12731 | |
| @@ -12717,6 +12767,7 @@ extension Obj5 { | ||
| 12717 | 12767 | primitiveKind: PrimitiveKind? = nil, |
| 12718 | 12768 | purpleSelf: Obj5Self? = nil, |
| 12719 | 12769 | purpleTrue: TrueClass? = nil, |
| 12770 | + select: Select? = nil, | |
| 12720 | 12771 | sendable: Sendable? = nil, |
| 12721 | 12772 | serialDescriptor: SerialDescriptor? = nil, |
| 12722 | 12773 | serialName: SerialName? = nil, |
| @@ -12745,6 +12796,7 @@ extension Obj5 { | ||
| 12745 | 12796 | timeOnly: TimeOnly? = nil, |
| 12746 | 12797 | timeOnlyConverter: TimeOnlyConverter? = nil, |
| 12747 | 12798 | timeZone: TimeZoneClass? = nil, |
| 12799 | + toDict: ToDict? = nil, | |
| 12748 | 12800 | toJSON: ToJSON? = nil, |
| 12749 | 12801 | toString: ToString? = nil, |
| 12750 | 12802 | topLevel: TopLevelClass? = nil, |
| @@ -12759,10 +12811,9 @@ extension Obj5 { | ||
| 12759 | 12811 | unchecked: Unchecked? = nil, |
| 12760 | 12812 | undefined: Undefined? = nil, |
| 12761 | 12813 | union: Union? = nil, |
| 12814 | + unmarshalJSON: UnmarshalJSON? = nil, | |
| 12762 | 12815 | unsafe: Unsafe? = nil, |
| 12763 | - unsigned: Unsigned? = nil, | |
| 12764 | - useSerializers: UseSerializers? = nil, | |
| 12765 | - ushort: Ushort? = nil | |
| 12816 | + useSerializers: UseSerializers? = nil | |
| 12766 | 12817 | ) -> Obj5 { |
| 12767 | 12818 | return Obj5( |
| 12768 | 12819 | dummy: dummy ?? self.dummy, |
| @@ -12784,6 +12835,7 @@ extension Obj5 { | ||
| 12784 | 12835 | primitiveKind: primitiveKind ?? self.primitiveKind, |
| 12785 | 12836 | purpleSelf: purpleSelf ?? self.purpleSelf, |
| 12786 | 12837 | purpleTrue: purpleTrue ?? self.purpleTrue, |
| 12838 | + select: select ?? self.select, | |
| 12787 | 12839 | sendable: sendable ?? self.sendable, |
| 12788 | 12840 | serialDescriptor: serialDescriptor ?? self.serialDescriptor, |
| 12789 | 12841 | serialName: serialName ?? self.serialName, |
| @@ -12812,6 +12864,7 @@ extension Obj5 { | ||
| 12812 | 12864 | timeOnly: timeOnly ?? self.timeOnly, |
| 12813 | 12865 | timeOnlyConverter: timeOnlyConverter ?? self.timeOnlyConverter, |
| 12814 | 12866 | timeZone: timeZone ?? self.timeZone, |
| 12867 | + toDict: toDict ?? self.toDict, | |
| 12815 | 12868 | toJSON: toJSON ?? self.toJSON, |
| 12816 | 12869 | toString: toString ?? self.toString, |
| 12817 | 12870 | topLevel: topLevel ?? self.topLevel, |
| @@ -12826,10 +12879,9 @@ extension Obj5 { | ||
| 12826 | 12879 | unchecked: unchecked ?? self.unchecked, |
| 12827 | 12880 | undefined: undefined ?? self.undefined, |
| 12828 | 12881 | union: union ?? self.union, |
| 12882 | + unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON, | |
| 12829 | 12883 | unsafe: unsafe ?? self.unsafe, |
| 12830 | - unsigned: unsigned ?? self.unsigned, | |
| 12831 | - useSerializers: useSerializers ?? self.useSerializers, | |
| 12832 | - ushort: ushort ?? self.ushort | |
| 12884 | + useSerializers: useSerializers ?? self.useSerializers | |
| 12833 | 12885 | ) |
| 12834 | 12886 | } |
| 12835 | 12887 | |
| @@ -13634,6 +13686,50 @@ extension TrueClass { | ||
| 13634 | 13686 | } |
| 13635 | 13687 | } |
| 13636 | 13688 | |
| 13689 | +// MARK: - Select | |
| 13690 | +struct Select: Codable { | |
| 13691 | + let select: Int | |
| 13692 | + | |
| 13693 | + enum CodingKeys: String, CodingKey { | |
| 13694 | + case select = "select" | |
| 13695 | + } | |
| 13696 | +} | |
| 13697 | + | |
| 13698 | +// MARK: Select convenience initializers and mutators | |
| 13699 | + | |
| 13700 | +extension Select { | |
| 13701 | + init(data: Data) throws { | |
| 13702 | + self = try newJSONDecoder().decode(Select.self, from: data) | |
| 13703 | + } | |
| 13704 | + | |
| 13705 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 13706 | + guard let data = json.data(using: encoding) else { | |
| 13707 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 13708 | + } | |
| 13709 | + try self.init(data: data) | |
| 13710 | + } | |
| 13711 | + | |
| 13712 | + init(fromURL url: URL) throws { | |
| 13713 | + try self.init(data: try Data(contentsOf: url)) | |
| 13714 | + } | |
| 13715 | + | |
| 13716 | + func with( | |
| 13717 | + select: Int? = nil | |
| 13718 | + ) -> Select { | |
| 13719 | + return Select( | |
| 13720 | + select: select ?? self.select | |
| 13721 | + ) | |
| 13722 | + } | |
| 13723 | + | |
| 13724 | + func jsonData() throws -> Data { | |
| 13725 | + return try newJSONEncoder().encode(self) | |
| 13726 | + } | |
| 13727 | + | |
| 13728 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 13729 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 13730 | + } | |
| 13731 | +} | |
| 13732 | + | |
| 13637 | 13733 | // MARK: - Sendable |
| 13638 | 13734 | struct Sendable: Codable { |
| 13639 | 13735 | let sendable: Int |
| @@ -14866,6 +14962,50 @@ extension TimeZoneClass { | ||
| 14866 | 14962 | } |
| 14867 | 14963 | } |
| 14868 | 14964 | |
| 14965 | +// MARK: - ToDict | |
| 14966 | +struct ToDict: Codable { | |
| 14967 | + let toDict: Int | |
| 14968 | + | |
| 14969 | + enum CodingKeys: String, CodingKey { | |
| 14970 | + case toDict = "to_dict" | |
| 14971 | + } | |
| 14972 | +} | |
| 14973 | + | |
| 14974 | +// MARK: ToDict convenience initializers and mutators | |
| 14975 | + | |
| 14976 | +extension ToDict { | |
| 14977 | + init(data: Data) throws { | |
| 14978 | + self = try newJSONDecoder().decode(ToDict.self, from: data) | |
| 14979 | + } | |
| 14980 | + | |
| 14981 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 14982 | + guard let data = json.data(using: encoding) else { | |
| 14983 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 14984 | + } | |
| 14985 | + try self.init(data: data) | |
| 14986 | + } | |
| 14987 | + | |
| 14988 | + init(fromURL url: URL) throws { | |
| 14989 | + try self.init(data: try Data(contentsOf: url)) | |
| 14990 | + } | |
| 14991 | + | |
| 14992 | + func with( | |
| 14993 | + toDict: Int? = nil | |
| 14994 | + ) -> ToDict { | |
| 14995 | + return ToDict( | |
| 14996 | + toDict: toDict ?? self.toDict | |
| 14997 | + ) | |
| 14998 | + } | |
| 14999 | + | |
| 15000 | + func jsonData() throws -> Data { | |
| 15001 | + return try newJSONEncoder().encode(self) | |
| 15002 | + } | |
| 15003 | + | |
| 15004 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 15005 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 15006 | + } | |
| 15007 | +} | |
| 15008 | + | |
| 14869 | 15009 | // MARK: - ToJSON |
| 14870 | 15010 | struct ToJSON: Codable { |
| 14871 | 15011 | let toJSON: Int |
| @@ -15482,20 +15622,20 @@ extension Union { | ||
| 15482 | 15622 | } |
| 15483 | 15623 | } |
| 15484 | 15624 | |
| 15485 | -// MARK: - Unsafe | |
| 15486 | -struct Unsafe: Codable { | |
| 15487 | - let unsafe: Int | |
| 15625 | +// MARK: - UnmarshalJSON | |
| 15626 | +struct UnmarshalJSON: Codable { | |
| 15627 | + let unmarshalJSON: Int | |
| 15488 | 15628 | |
| 15489 | 15629 | enum CodingKeys: String, CodingKey { |
| 15490 | - case unsafe = "unsafe" | |
| 15630 | + case unmarshalJSON = "UnmarshalJSON" | |
| 15491 | 15631 | } |
| 15492 | 15632 | } |
| 15493 | 15633 | |
| 15494 | -// MARK: Unsafe convenience initializers and mutators | |
| 15634 | +// MARK: UnmarshalJSON convenience initializers and mutators | |
| 15495 | 15635 | |
| 15496 | -extension Unsafe { | |
| 15636 | +extension UnmarshalJSON { | |
| 15497 | 15637 | init(data: Data) throws { |
| 15498 | - self = try newJSONDecoder().decode(Unsafe.self, from: data) | |
| 15638 | + self = try newJSONDecoder().decode(UnmarshalJSON.self, from: data) | |
| 15499 | 15639 | } |
| 15500 | 15640 | |
| 15501 | 15641 | init(_ json: String, using encoding: String.Encoding = .utf8) throws { |
| @@ -15510,10 +15650,10 @@ extension Unsafe { | ||
| 15510 | 15650 | } |
| 15511 | 15651 | |
| 15512 | 15652 | func with( |
| 15513 | - unsafe: Int? = nil | |
| 15514 | - ) -> Unsafe { | |
| 15515 | - return Unsafe( | |
| 15516 | - unsafe: unsafe ?? self.unsafe | |
| 15653 | + unmarshalJSON: Int? = nil | |
| 15654 | + ) -> UnmarshalJSON { | |
| 15655 | + return UnmarshalJSON( | |
| 15656 | + unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON | |
| 15517 | 15657 | ) |
| 15518 | 15658 | } |
| 15519 | 15659 | |
| @@ -15526,20 +15666,20 @@ extension Unsafe { | ||
| 15526 | 15666 | } |
| 15527 | 15667 | } |
| 15528 | 15668 | |
| 15529 | -// MARK: - Unsigned | |
| 15530 | -struct Unsigned: Codable { | |
| 15531 | - let unsigned: Int | |
| 15669 | +// MARK: - Unsafe | |
| 15670 | +struct Unsafe: Codable { | |
| 15671 | + let unsafe: Int | |
| 15532 | 15672 | |
| 15533 | 15673 | enum CodingKeys: String, CodingKey { |
| 15534 | - case unsigned = "unsigned" | |
| 15674 | + case unsafe = "unsafe" | |
| 15535 | 15675 | } |
| 15536 | 15676 | } |
| 15537 | 15677 | |
| 15538 | -// MARK: Unsigned convenience initializers and mutators | |
| 15678 | +// MARK: Unsafe convenience initializers and mutators | |
| 15539 | 15679 | |
| 15540 | -extension Unsigned { | |
| 15680 | +extension Unsafe { | |
| 15541 | 15681 | init(data: Data) throws { |
| 15542 | - self = try newJSONDecoder().decode(Unsigned.self, from: data) | |
| 15682 | + self = try newJSONDecoder().decode(Unsafe.self, from: data) | |
| 15543 | 15683 | } |
| 15544 | 15684 | |
| 15545 | 15685 | init(_ json: String, using encoding: String.Encoding = .utf8) throws { |
| @@ -15554,10 +15694,10 @@ extension Unsigned { | ||
| 15554 | 15694 | } |
| 15555 | 15695 | |
| 15556 | 15696 | func with( |
| 15557 | - unsigned: Int? = nil | |
| 15558 | - ) -> Unsigned { | |
| 15559 | - return Unsigned( | |
| 15560 | - unsigned: unsigned ?? self.unsigned | |
| 15697 | + unsafe: Int? = nil | |
| 15698 | + ) -> Unsafe { | |
| 15699 | + return Unsafe( | |
| 15700 | + unsafe: unsafe ?? self.unsafe | |
| 15561 | 15701 | ) |
| 15562 | 15702 | } |
| 15563 | 15703 | |
| @@ -15614,50 +15754,6 @@ extension UseSerializers { | ||
| 15614 | 15754 | } |
| 15615 | 15755 | } |
| 15616 | 15756 | |
| 15617 | -// MARK: - Ushort | |
| 15618 | -struct Ushort: Codable { | |
| 15619 | - let ushort: Int | |
| 15620 | - | |
| 15621 | - enum CodingKeys: String, CodingKey { | |
| 15622 | - case ushort = "ushort" | |
| 15623 | - } | |
| 15624 | -} | |
| 15625 | - | |
| 15626 | -// MARK: Ushort convenience initializers and mutators | |
| 15627 | - | |
| 15628 | -extension Ushort { | |
| 15629 | - init(data: Data) throws { | |
| 15630 | - self = try newJSONDecoder().decode(Ushort.self, from: data) | |
| 15631 | - } | |
| 15632 | - | |
| 15633 | - init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 15634 | - guard let data = json.data(using: encoding) else { | |
| 15635 | - throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 15636 | - } | |
| 15637 | - try self.init(data: data) | |
| 15638 | - } | |
| 15639 | - | |
| 15640 | - init(fromURL url: URL) throws { | |
| 15641 | - try self.init(data: try Data(contentsOf: url)) | |
| 15642 | - } | |
| 15643 | - | |
| 15644 | - func with( | |
| 15645 | - ushort: Int? = nil | |
| 15646 | - ) -> Ushort { | |
| 15647 | - return Ushort( | |
| 15648 | - ushort: ushort ?? self.ushort | |
| 15649 | - ) | |
| 15650 | - } | |
| 15651 | - | |
| 15652 | - func jsonData() throws -> Data { | |
| 15653 | - return try newJSONEncoder().encode(self) | |
| 15654 | - } | |
| 15655 | - | |
| 15656 | - func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 15657 | - return String(data: try self.jsonData(), encoding: encoding) | |
| 15658 | - } | |
| 15659 | -} | |
| 15660 | - | |
| 15661 | 15757 | // MARK: - Obj6 |
| 15662 | 15758 | struct Obj6: Codable { |
| 15663 | 15759 | let dummy: Int |
| @@ -15666,6 +15762,8 @@ struct Obj6: Codable { | ||
| 15666 | 15762 | let obj6Where: Where |
| 15667 | 15763 | let obj6While: While |
| 15668 | 15764 | let obj6WillSet: WillSet |
| 15765 | + let unsigned: Unsigned | |
| 15766 | + let ushort: Ushort | |
| 15669 | 15767 | let using: Using |
| 15670 | 15768 | let utf8JSONReader: Utf8JSONReader |
| 15671 | 15769 | let utf8JSONWriter: Utf8JSONWriter |
| @@ -15687,6 +15785,8 @@ struct Obj6: Codable { | ||
| 15687 | 15785 | case obj6Where = "where" |
| 15688 | 15786 | case obj6While = "while" |
| 15689 | 15787 | case obj6WillSet = "willSet" |
| 15788 | + case unsigned = "unsigned" | |
| 15789 | + case ushort = "ushort" | |
| 15690 | 15790 | case using = "using" |
| 15691 | 15791 | case utf8JSONReader = "Utf8JsonReader" |
| 15692 | 15792 | case utf8JSONWriter = "Utf8JsonWriter" |
| @@ -15728,6 +15828,8 @@ extension Obj6 { | ||
| 15728 | 15828 | obj6Where: Where? = nil, |
| 15729 | 15829 | obj6While: While? = nil, |
| 15730 | 15830 | obj6WillSet: WillSet? = nil, |
| 15831 | + unsigned: Unsigned? = nil, | |
| 15832 | + ushort: Ushort? = nil, | |
| 15731 | 15833 | using: Using? = nil, |
| 15732 | 15834 | utf8JSONReader: Utf8JSONReader? = nil, |
| 15733 | 15835 | utf8JSONWriter: Utf8JSONWriter? = nil, |
| @@ -15749,6 +15851,8 @@ extension Obj6 { | ||
| 15749 | 15851 | obj6Where: obj6Where ?? self.obj6Where, |
| 15750 | 15852 | obj6While: obj6While ?? self.obj6While, |
| 15751 | 15853 | obj6WillSet: obj6WillSet ?? self.obj6WillSet, |
| 15854 | + unsigned: unsigned ?? self.unsigned, | |
| 15855 | + ushort: ushort ?? self.ushort, | |
| 15752 | 15856 | using: using ?? self.using, |
| 15753 | 15857 | utf8JSONReader: utf8JSONReader ?? self.utf8JSONReader, |
| 15754 | 15858 | utf8JSONWriter: utf8JSONWriter ?? self.utf8JSONWriter, |
| @@ -15994,6 +16098,94 @@ extension WillSet { | ||
| 15994 | 16098 | } |
| 15995 | 16099 | } |
| 15996 | 16100 | |
| 16101 | +// MARK: - Unsigned | |
| 16102 | +struct Unsigned: Codable { | |
| 16103 | + let unsigned: Int | |
| 16104 | + | |
| 16105 | + enum CodingKeys: String, CodingKey { | |
| 16106 | + case unsigned = "unsigned" | |
| 16107 | + } | |
| 16108 | +} | |
| 16109 | + | |
| 16110 | +// MARK: Unsigned convenience initializers and mutators | |
| 16111 | + | |
| 16112 | +extension Unsigned { | |
| 16113 | + init(data: Data) throws { | |
| 16114 | + self = try newJSONDecoder().decode(Unsigned.self, from: data) | |
| 16115 | + } | |
| 16116 | + | |
| 16117 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 16118 | + guard let data = json.data(using: encoding) else { | |
| 16119 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 16120 | + } | |
| 16121 | + try self.init(data: data) | |
| 16122 | + } | |
| 16123 | + | |
| 16124 | + init(fromURL url: URL) throws { | |
| 16125 | + try self.init(data: try Data(contentsOf: url)) | |
| 16126 | + } | |
| 16127 | + | |
| 16128 | + func with( | |
| 16129 | + unsigned: Int? = nil | |
| 16130 | + ) -> Unsigned { | |
| 16131 | + return Unsigned( | |
| 16132 | + unsigned: unsigned ?? self.unsigned | |
| 16133 | + ) | |
| 16134 | + } | |
| 16135 | + | |
| 16136 | + func jsonData() throws -> Data { | |
| 16137 | + return try newJSONEncoder().encode(self) | |
| 16138 | + } | |
| 16139 | + | |
| 16140 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 16141 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 16142 | + } | |
| 16143 | +} | |
| 16144 | + | |
| 16145 | +// MARK: - Ushort | |
| 16146 | +struct Ushort: Codable { | |
| 16147 | + let ushort: Int | |
| 16148 | + | |
| 16149 | + enum CodingKeys: String, CodingKey { | |
| 16150 | + case ushort = "ushort" | |
| 16151 | + } | |
| 16152 | +} | |
| 16153 | + | |
| 16154 | +// MARK: Ushort convenience initializers and mutators | |
| 16155 | + | |
| 16156 | +extension Ushort { | |
| 16157 | + init(data: Data) throws { | |
| 16158 | + self = try newJSONDecoder().decode(Ushort.self, from: data) | |
| 16159 | + } | |
| 16160 | + | |
| 16161 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 16162 | + guard let data = json.data(using: encoding) else { | |
| 16163 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 16164 | + } | |
| 16165 | + try self.init(data: data) | |
| 16166 | + } | |
| 16167 | + | |
| 16168 | + init(fromURL url: URL) throws { | |
| 16169 | + try self.init(data: try Data(contentsOf: url)) | |
| 16170 | + } | |
| 16171 | + | |
| 16172 | + func with( | |
| 16173 | + ushort: Int? = nil | |
| 16174 | + ) -> Ushort { | |
| 16175 | + return Ushort( | |
| 16176 | + ushort: ushort ?? self.ushort | |
| 16177 | + ) | |
| 16178 | + } | |
| 16179 | + | |
| 16180 | + func jsonData() throws -> Data { | |
| 16181 | + return try newJSONEncoder().encode(self) | |
| 16182 | + } | |
| 16183 | + | |
| 16184 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 16185 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 16186 | + } | |
| 16187 | +} | |
| 16188 | + | |
| 15997 | 16189 | // MARK: - Using |
| 15998 | 16190 | struct Using: Codable { |
| 15999 | 16191 | let using: Int |
Mswiftobjective-c-support-true__struct-or-class-class--f14372afa3e4 / quicktype.swift+486 −270
| @@ -3634,11 +3634,11 @@ extension ClassClass { | ||
| 3634 | 3634 | let formatException: FormatException |
| 3635 | 3635 | let friend: Friend |
| 3636 | 3636 | let from: From |
| 3637 | + let fromDict: FromDict | |
| 3637 | 3638 | let fromJSON: FromJSON |
| 3638 | 3639 | let function: Function |
| 3639 | 3640 | let global: Global |
| 3640 | 3641 | let go: Go |
| 3641 | - let goto: Goto | |
| 3642 | 3642 | let obj2Default: Default |
| 3643 | 3643 | let obj2Defer: Defer |
| 3644 | 3644 | let obj2Deinit: Deinit |
| @@ -3701,11 +3701,11 @@ extension ClassClass { | ||
| 3701 | 3701 | case formatException = "FormatException" |
| 3702 | 3702 | case friend = "friend" |
| 3703 | 3703 | case from = "from" |
| 3704 | + case fromDict = "from_dict" | |
| 3704 | 3705 | case fromJSON = "from_json" |
| 3705 | 3706 | case function = "function" |
| 3706 | 3707 | case global = "global" |
| 3707 | 3708 | case go = "go" |
| 3708 | - case goto = "goto" | |
| 3709 | 3709 | case obj2Default = "default" |
| 3710 | 3710 | case obj2Defer = "defer" |
| 3711 | 3711 | case obj2Deinit = "deinit" |
| @@ -3725,7 +3725,7 @@ extension ClassClass { | ||
| 3725 | 3725 | case purpleFalse = "false" |
| 3726 | 3726 | } |
| 3727 | 3727 | |
| 3728 | - init(dateFormatter: DateFormatterClass, dateOnly: DateOnly, dateOnlyConverter: DateOnlyConverter, dateParseHandling: DateParseHandling, dateTime: DateTime, dateTimeStyles: DateTimeStyles, debugger: Debugger, decimal: Decimal, declare: Declare, decltype: Decltype, decodeString: DecodeString, decoder: DecoderClass, decodingError: DecodingErrorClass, def: Def, del: Del, delegate: Delegate, delete: Delete, dict: Dict, dictionary: Dictionary, double: DoubleClass, dummy: Int, dynamicCast: DynamicCast, elif: Elif, encodeQuickType: EncodeQuickType, encoder: EncoderClass, enumValues: EnumValues, equalityContract: EqualityContract, equatable: Equatable, event: Event, except: Except, exception: Exception, explicit: Explicit, export: Export, exposing: Exposing, extends: Extends, extern: Extern, finally: Finally, fixed: Fixed, float: Float, foreach: Foreach, formatException: FormatException, friend: Friend, from: From, fromJSON: FromJSON, function: Function, global: Global, go: Go, goto: Goto, obj2Default: Default, obj2Defer: Defer, obj2Deinit: Deinit, obj2DidSet: DidSet, obj2Do: Do, obj2Dynamic: Dynamic, obj2Else: Else, obj2Enum: Enum, obj2Extension: Extension, obj2Fallthrough: Fallthrough, obj2False: False, obj2Fileprivate: Fileprivate, obj2Final: Final, obj2For: For, obj2Func: Func, obj2Get: Get, purpleFalse: FalseClass) { | |
| 3728 | + init(dateFormatter: DateFormatterClass, dateOnly: DateOnly, dateOnlyConverter: DateOnlyConverter, dateParseHandling: DateParseHandling, dateTime: DateTime, dateTimeStyles: DateTimeStyles, debugger: Debugger, decimal: Decimal, declare: Declare, decltype: Decltype, decodeString: DecodeString, decoder: DecoderClass, decodingError: DecodingErrorClass, def: Def, del: Del, delegate: Delegate, delete: Delete, dict: Dict, dictionary: Dictionary, double: DoubleClass, dummy: Int, dynamicCast: DynamicCast, elif: Elif, encodeQuickType: EncodeQuickType, encoder: EncoderClass, enumValues: EnumValues, equalityContract: EqualityContract, equatable: Equatable, event: Event, except: Except, exception: Exception, explicit: Explicit, export: Export, exposing: Exposing, extends: Extends, extern: Extern, finally: Finally, fixed: Fixed, float: Float, foreach: Foreach, formatException: FormatException, friend: Friend, from: From, fromDict: FromDict, fromJSON: FromJSON, function: Function, global: Global, go: Go, obj2Default: Default, obj2Defer: Defer, obj2Deinit: Deinit, obj2DidSet: DidSet, obj2Do: Do, obj2Dynamic: Dynamic, obj2Else: Else, obj2Enum: Enum, obj2Extension: Extension, obj2Fallthrough: Fallthrough, obj2False: False, obj2Fileprivate: Fileprivate, obj2Final: Final, obj2For: For, obj2Func: Func, obj2Get: Get, purpleFalse: FalseClass) { | |
| 3729 | 3729 | self.dateFormatter = dateFormatter |
| 3730 | 3730 | self.dateOnly = dateOnly |
| 3731 | 3731 | self.dateOnlyConverter = dateOnlyConverter |
| @@ -3769,11 +3769,11 @@ extension ClassClass { | ||
| 3769 | 3769 | self.formatException = formatException |
| 3770 | 3770 | self.friend = friend |
| 3771 | 3771 | self.from = from |
| 3772 | + self.fromDict = fromDict | |
| 3772 | 3773 | self.fromJSON = fromJSON |
| 3773 | 3774 | self.function = function |
| 3774 | 3775 | self.global = global |
| 3775 | 3776 | self.go = go |
| 3776 | - self.goto = goto | |
| 3777 | 3777 | self.obj2Default = obj2Default |
| 3778 | 3778 | self.obj2Defer = obj2Defer |
| 3779 | 3779 | self.obj2Deinit = obj2Deinit |
| @@ -3799,7 +3799,7 @@ extension ClassClass { | ||
| 3799 | 3799 | extension Obj2 { |
| 3800 | 3800 | convenience init(data: Data) throws { |
| 3801 | 3801 | let me = try newJSONDecoder().decode(Obj2.self, from: data) |
| 3802 | - self.init(dateFormatter: me.dateFormatter, dateOnly: me.dateOnly, dateOnlyConverter: me.dateOnlyConverter, dateParseHandling: me.dateParseHandling, dateTime: me.dateTime, dateTimeStyles: me.dateTimeStyles, debugger: me.debugger, decimal: me.decimal, declare: me.declare, decltype: me.decltype, decodeString: me.decodeString, decoder: me.decoder, decodingError: me.decodingError, def: me.def, del: me.del, delegate: me.delegate, delete: me.delete, dict: me.dict, dictionary: me.dictionary, double: me.double, dummy: me.dummy, dynamicCast: me.dynamicCast, elif: me.elif, encodeQuickType: me.encodeQuickType, encoder: me.encoder, enumValues: me.enumValues, equalityContract: me.equalityContract, equatable: me.equatable, event: me.event, except: me.except, exception: me.exception, explicit: me.explicit, export: me.export, exposing: me.exposing, extends: me.extends, extern: me.extern, finally: me.finally, fixed: me.fixed, float: me.float, foreach: me.foreach, formatException: me.formatException, friend: me.friend, from: me.from, fromJSON: me.fromJSON, function: me.function, global: me.global, go: me.go, goto: me.goto, obj2Default: me.obj2Default, obj2Defer: me.obj2Defer, obj2Deinit: me.obj2Deinit, obj2DidSet: me.obj2DidSet, obj2Do: me.obj2Do, obj2Dynamic: me.obj2Dynamic, obj2Else: me.obj2Else, obj2Enum: me.obj2Enum, obj2Extension: me.obj2Extension, obj2Fallthrough: me.obj2Fallthrough, obj2False: me.obj2False, obj2Fileprivate: me.obj2Fileprivate, obj2Final: me.obj2Final, obj2For: me.obj2For, obj2Func: me.obj2Func, obj2Get: me.obj2Get, purpleFalse: me.purpleFalse) | |
| 3802 | + self.init(dateFormatter: me.dateFormatter, dateOnly: me.dateOnly, dateOnlyConverter: me.dateOnlyConverter, dateParseHandling: me.dateParseHandling, dateTime: me.dateTime, dateTimeStyles: me.dateTimeStyles, debugger: me.debugger, decimal: me.decimal, declare: me.declare, decltype: me.decltype, decodeString: me.decodeString, decoder: me.decoder, decodingError: me.decodingError, def: me.def, del: me.del, delegate: me.delegate, delete: me.delete, dict: me.dict, dictionary: me.dictionary, double: me.double, dummy: me.dummy, dynamicCast: me.dynamicCast, elif: me.elif, encodeQuickType: me.encodeQuickType, encoder: me.encoder, enumValues: me.enumValues, equalityContract: me.equalityContract, equatable: me.equatable, event: me.event, except: me.except, exception: me.exception, explicit: me.explicit, export: me.export, exposing: me.exposing, extends: me.extends, extern: me.extern, finally: me.finally, fixed: me.fixed, float: me.float, foreach: me.foreach, formatException: me.formatException, friend: me.friend, from: me.from, fromDict: me.fromDict, fromJSON: me.fromJSON, function: me.function, global: me.global, go: me.go, obj2Default: me.obj2Default, obj2Defer: me.obj2Defer, obj2Deinit: me.obj2Deinit, obj2DidSet: me.obj2DidSet, obj2Do: me.obj2Do, obj2Dynamic: me.obj2Dynamic, obj2Else: me.obj2Else, obj2Enum: me.obj2Enum, obj2Extension: me.obj2Extension, obj2Fallthrough: me.obj2Fallthrough, obj2False: me.obj2False, obj2Fileprivate: me.obj2Fileprivate, obj2Final: me.obj2Final, obj2For: me.obj2For, obj2Func: me.obj2Func, obj2Get: me.obj2Get, purpleFalse: me.purpleFalse) | |
| 3803 | 3803 | } |
| 3804 | 3804 | |
| 3805 | 3805 | convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws { |
| @@ -3857,11 +3857,11 @@ extension Obj2 { | ||
| 3857 | 3857 | formatException: FormatException? = nil, |
| 3858 | 3858 | friend: Friend? = nil, |
| 3859 | 3859 | from: From? = nil, |
| 3860 | + fromDict: FromDict? = nil, | |
| 3860 | 3861 | fromJSON: FromJSON? = nil, |
| 3861 | 3862 | function: Function? = nil, |
| 3862 | 3863 | global: Global? = nil, |
| 3863 | 3864 | go: Go? = nil, |
| 3864 | - goto: Goto? = nil, | |
| 3865 | 3865 | obj2Default: Default? = nil, |
| 3866 | 3866 | obj2Defer: Defer? = nil, |
| 3867 | 3867 | obj2Deinit: Deinit? = nil, |
| @@ -3924,11 +3924,11 @@ extension Obj2 { | ||
| 3924 | 3924 | formatException: formatException ?? self.formatException, |
| 3925 | 3925 | friend: friend ?? self.friend, |
| 3926 | 3926 | from: from ?? self.from, |
| 3927 | + fromDict: fromDict ?? self.fromDict, | |
| 3927 | 3928 | fromJSON: fromJSON ?? self.fromJSON, |
| 3928 | 3929 | function: function ?? self.function, |
| 3929 | 3930 | global: global ?? self.global, |
| 3930 | 3931 | go: go ?? self.go, |
| 3931 | - goto: goto ?? self.goto, | |
| 3932 | 3932 | obj2Default: obj2Default ?? self.obj2Default, |
| 3933 | 3933 | obj2Defer: obj2Defer ?? self.obj2Defer, |
| 3934 | 3934 | obj2Deinit: obj2Deinit ?? self.obj2Deinit, |
| @@ -6021,6 +6021,55 @@ extension From { | ||
| 6021 | 6021 | } |
| 6022 | 6022 | } |
| 6023 | 6023 | |
| 6024 | +// MARK: - FromDict | |
| 6025 | +@objcMembers class FromDict: NSObject, Codable { | |
| 6026 | + let fromDict: Int | |
| 6027 | + | |
| 6028 | + enum CodingKeys: String, CodingKey { | |
| 6029 | + case fromDict = "from_dict" | |
| 6030 | + } | |
| 6031 | + | |
| 6032 | + init(fromDict: Int) { | |
| 6033 | + self.fromDict = fromDict | |
| 6034 | + } | |
| 6035 | +} | |
| 6036 | + | |
| 6037 | +// MARK: FromDict convenience initializers and mutators | |
| 6038 | + | |
| 6039 | +extension FromDict { | |
| 6040 | + convenience init(data: Data) throws { | |
| 6041 | + let me = try newJSONDecoder().decode(FromDict.self, from: data) | |
| 6042 | + self.init(fromDict: me.fromDict) | |
| 6043 | + } | |
| 6044 | + | |
| 6045 | + convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 6046 | + guard let data = json.data(using: encoding) else { | |
| 6047 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 6048 | + } | |
| 6049 | + try self.init(data: data) | |
| 6050 | + } | |
| 6051 | + | |
| 6052 | + convenience init(fromURL url: URL) throws { | |
| 6053 | + try self.init(data: try Data(contentsOf: url)) | |
| 6054 | + } | |
| 6055 | + | |
| 6056 | + func with( | |
| 6057 | + fromDict: Int? = nil | |
| 6058 | + ) -> FromDict { | |
| 6059 | + return FromDict( | |
| 6060 | + fromDict: fromDict ?? self.fromDict | |
| 6061 | + ) | |
| 6062 | + } | |
| 6063 | + | |
| 6064 | + func jsonData() throws -> Data { | |
| 6065 | + return try newJSONEncoder().encode(self) | |
| 6066 | + } | |
| 6067 | + | |
| 6068 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 6069 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 6070 | + } | |
| 6071 | +} | |
| 6072 | + | |
| 6024 | 6073 | // MARK: - FromJSON |
| 6025 | 6074 | @objcMembers class FromJSON: NSObject, Codable { |
| 6026 | 6075 | let fromJSON: Int |
| @@ -6217,55 +6266,6 @@ extension Go { | ||
| 6217 | 6266 | } |
| 6218 | 6267 | } |
| 6219 | 6268 | |
| 6220 | -// MARK: - Goto | |
| 6221 | -@objcMembers class Goto: NSObject, Codable { | |
| 6222 | - let goto: Int | |
| 6223 | - | |
| 6224 | - enum CodingKeys: String, CodingKey { | |
| 6225 | - case goto = "goto" | |
| 6226 | - } | |
| 6227 | - | |
| 6228 | - init(goto: Int) { | |
| 6229 | - self.goto = goto | |
| 6230 | - } | |
| 6231 | -} | |
| 6232 | - | |
| 6233 | -// MARK: Goto convenience initializers and mutators | |
| 6234 | - | |
| 6235 | -extension Goto { | |
| 6236 | - convenience init(data: Data) throws { | |
| 6237 | - let me = try newJSONDecoder().decode(Goto.self, from: data) | |
| 6238 | - self.init(goto: me.goto) | |
| 6239 | - } | |
| 6240 | - | |
| 6241 | - convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 6242 | - guard let data = json.data(using: encoding) else { | |
| 6243 | - throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 6244 | - } | |
| 6245 | - try self.init(data: data) | |
| 6246 | - } | |
| 6247 | - | |
| 6248 | - convenience init(fromURL url: URL) throws { | |
| 6249 | - try self.init(data: try Data(contentsOf: url)) | |
| 6250 | - } | |
| 6251 | - | |
| 6252 | - func with( | |
| 6253 | - goto: Int? = nil | |
| 6254 | - ) -> Goto { | |
| 6255 | - return Goto( | |
| 6256 | - goto: goto ?? self.goto | |
| 6257 | - ) | |
| 6258 | - } | |
| 6259 | - | |
| 6260 | - func jsonData() throws -> Data { | |
| 6261 | - return try newJSONEncoder().encode(self) | |
| 6262 | - } | |
| 6263 | - | |
| 6264 | - func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 6265 | - return String(data: try self.jsonData(), encoding: encoding) | |
| 6266 | - } | |
| 6267 | -} | |
| 6268 | - | |
| 6269 | 6269 | // MARK: - Default |
| 6270 | 6270 | @objcMembers class Default: NSObject, Codable { |
| 6271 | 6271 | let defaultDefault: Int |
| @@ -7102,6 +7102,7 @@ extension FalseClass { | ||
| 7102 | 7102 | // MARK: - Obj3 |
| 7103 | 7103 | @objcMembers class Obj3: NSObject, Codable { |
| 7104 | 7104 | let dummy: Int |
| 7105 | + let goto: Goto | |
| 7105 | 7106 | let hasOwnProperty: HasOwnProperty |
| 7106 | 7107 | let hashCode: HashCode |
| 7107 | 7108 | let hashable: HashableClass |
| @@ -7141,6 +7142,7 @@ extension FalseClass { | ||
| 7141 | 7142 | let long: Long |
| 7142 | 7143 | let map: Map |
| 7143 | 7144 | let mapEntry: MapEntry |
| 7145 | + let marshalJSON: MarshalJSON | |
| 7144 | 7146 | let metadataPropertyHandling: MetadataPropertyHandling |
| 7145 | 7147 | let module: Module |
| 7146 | 7148 | let mutable: Mutable |
| @@ -7149,7 +7151,6 @@ extension FalseClass { | ||
| 7149 | 7151 | let new: New |
| 7150 | 7152 | let newtonsoft: Newtonsoft |
| 7151 | 7153 | let no: No |
| 7152 | - let noexcept: Noexcept | |
| 7153 | 7154 | let obj3Guard: Guard |
| 7154 | 7155 | let obj3If: If |
| 7155 | 7156 | let obj3Import: Import |
| @@ -7169,6 +7170,7 @@ extension FalseClass { | ||
| 7169 | 7170 | |
| 7170 | 7171 | enum CodingKeys: String, CodingKey { |
| 7171 | 7172 | case dummy = "dummy" |
| 7173 | + case goto = "goto" | |
| 7172 | 7174 | case hasOwnProperty = "hasOwnProperty" |
| 7173 | 7175 | case hashCode = "hashCode" |
| 7174 | 7176 | case hashable = "Hashable" |
| @@ -7208,6 +7210,7 @@ extension FalseClass { | ||
| 7208 | 7210 | case long = "long" |
| 7209 | 7211 | case map = "map" |
| 7210 | 7212 | case mapEntry = "MapEntry" |
| 7213 | + case marshalJSON = "MarshalJSON" | |
| 7211 | 7214 | case metadataPropertyHandling = "metadata_property_handling" |
| 7212 | 7215 | case module = "module" |
| 7213 | 7216 | case mutable = "mutable" |
| @@ -7216,7 +7219,6 @@ extension FalseClass { | ||
| 7216 | 7219 | case new = "new" |
| 7217 | 7220 | case newtonsoft = "newtonsoft" |
| 7218 | 7221 | case no = "NO" |
| 7219 | - case noexcept = "noexcept" | |
| 7220 | 7222 | case obj3Guard = "guard" |
| 7221 | 7223 | case obj3If = "if" |
| 7222 | 7224 | case obj3Import = "import" |
| @@ -7235,8 +7237,9 @@ extension FalseClass { | ||
| 7235 | 7237 | case obj3Nil = "nil" |
| 7236 | 7238 | } |
| 7237 | 7239 | |
| 7238 | - init(dummy: Int, hasOwnProperty: HasOwnProperty, hashCode: HashCode, hashable: HashableClass, hasher: HasherClass, id: ID, imp: Imp, implements: Implements, implicit: Implicit, inline: Inline, instanceof: Instanceof, int: IntClass, interface: Interface, isoDateTimeOffsetConverter: ISODateTimeOffsetConverter, iterable: Iterable, jdec: Jdec, jenc: Jenc, jpipe: Jpipe, jsonAny: JSONAnyClass, jsonCodingKey: JSONCodingKeyClass, jsonConverter: JSONConverter, jsonDecoder: JSONDecoderClass, jsonEncoder: JSONEncoderClass, jsonException: JSONException, jsonGenerator: JSONGenerator, jsonNode: JSONNode, jsonNull: JSONNullClass, jsonParser: JSONParser, jsonReader: JSONReader, jsonSerializer: JSONSerializer, jsonToken: JSONToken, jsonTokenType: JSONTokenType, jsonWriter: JSONWriter, lambda: Lambda, list: List, locale: LocaleClass, lock: Lock, long: Long, map: Map, mapEntry: MapEntry, metadataPropertyHandling: MetadataPropertyHandling, module: Module, mutable: Mutable, namespace: Namespace, native: Native, new: New, newtonsoft: Newtonsoft, no: No, noexcept: Noexcept, obj3Guard: Guard, obj3If: If, obj3Import: Import, obj3In: In, obj3Indirect: Indirect, obj3Infix: Infix, obj3Init: Init, obj3Inout: Inout, obj3Internal: Internal, obj3Is: Is, obj3JSON: JSON, obj3Lazy: Lazy, obj3Left: Left, obj3Let: Let, obj3Mutating: Mutating, obj3Nil: Nil) { | |
| 7240 | + init(dummy: Int, goto: Goto, hasOwnProperty: HasOwnProperty, hashCode: HashCode, hashable: HashableClass, hasher: HasherClass, id: ID, imp: Imp, implements: Implements, implicit: Implicit, inline: Inline, instanceof: Instanceof, int: IntClass, interface: Interface, isoDateTimeOffsetConverter: ISODateTimeOffsetConverter, iterable: Iterable, jdec: Jdec, jenc: Jenc, jpipe: Jpipe, jsonAny: JSONAnyClass, jsonCodingKey: JSONCodingKeyClass, jsonConverter: JSONConverter, jsonDecoder: JSONDecoderClass, jsonEncoder: JSONEncoderClass, jsonException: JSONException, jsonGenerator: JSONGenerator, jsonNode: JSONNode, jsonNull: JSONNullClass, jsonParser: JSONParser, jsonReader: JSONReader, jsonSerializer: JSONSerializer, jsonToken: JSONToken, jsonTokenType: JSONTokenType, jsonWriter: JSONWriter, lambda: Lambda, list: List, locale: LocaleClass, lock: Lock, long: Long, map: Map, mapEntry: MapEntry, marshalJSON: MarshalJSON, metadataPropertyHandling: MetadataPropertyHandling, module: Module, mutable: Mutable, namespace: Namespace, native: Native, new: New, newtonsoft: Newtonsoft, no: No, obj3Guard: Guard, obj3If: If, obj3Import: Import, obj3In: In, obj3Indirect: Indirect, obj3Infix: Infix, obj3Init: Init, obj3Inout: Inout, obj3Internal: Internal, obj3Is: Is, obj3JSON: JSON, obj3Lazy: Lazy, obj3Left: Left, obj3Let: Let, obj3Mutating: Mutating, obj3Nil: Nil) { | |
| 7239 | 7241 | self.dummy = dummy |
| 7242 | + self.goto = goto | |
| 7240 | 7243 | self.hasOwnProperty = hasOwnProperty |
| 7241 | 7244 | self.hashCode = hashCode |
| 7242 | 7245 | self.hashable = hashable |
| @@ -7276,6 +7279,7 @@ extension FalseClass { | ||
| 7276 | 7279 | self.long = long |
| 7277 | 7280 | self.map = map |
| 7278 | 7281 | self.mapEntry = mapEntry |
| 7282 | + self.marshalJSON = marshalJSON | |
| 7279 | 7283 | self.metadataPropertyHandling = metadataPropertyHandling |
| 7280 | 7284 | self.module = module |
| 7281 | 7285 | self.mutable = mutable |
| @@ -7284,7 +7288,6 @@ extension FalseClass { | ||
| 7284 | 7288 | self.new = new |
| 7285 | 7289 | self.newtonsoft = newtonsoft |
| 7286 | 7290 | self.no = no |
| 7287 | - self.noexcept = noexcept | |
| 7288 | 7291 | self.obj3Guard = obj3Guard |
| 7289 | 7292 | self.obj3If = obj3If |
| 7290 | 7293 | self.obj3Import = obj3Import |
| @@ -7309,7 +7312,7 @@ extension FalseClass { | ||
| 7309 | 7312 | extension Obj3 { |
| 7310 | 7313 | convenience init(data: Data) throws { |
| 7311 | 7314 | let me = try newJSONDecoder().decode(Obj3.self, from: data) |
| 7312 | - self.init(dummy: me.dummy, hasOwnProperty: me.hasOwnProperty, hashCode: me.hashCode, hashable: me.hashable, hasher: me.hasher, id: me.id, imp: me.imp, implements: me.implements, implicit: me.implicit, inline: me.inline, instanceof: me.instanceof, int: me.int, interface: me.interface, isoDateTimeOffsetConverter: me.isoDateTimeOffsetConverter, iterable: me.iterable, jdec: me.jdec, jenc: me.jenc, jpipe: me.jpipe, jsonAny: me.jsonAny, jsonCodingKey: me.jsonCodingKey, jsonConverter: me.jsonConverter, jsonDecoder: me.jsonDecoder, jsonEncoder: me.jsonEncoder, jsonException: me.jsonException, jsonGenerator: me.jsonGenerator, jsonNode: me.jsonNode, jsonNull: me.jsonNull, jsonParser: me.jsonParser, jsonReader: me.jsonReader, jsonSerializer: me.jsonSerializer, jsonToken: me.jsonToken, jsonTokenType: me.jsonTokenType, jsonWriter: me.jsonWriter, lambda: me.lambda, list: me.list, locale: me.locale, lock: me.lock, long: me.long, map: me.map, mapEntry: me.mapEntry, metadataPropertyHandling: me.metadataPropertyHandling, module: me.module, mutable: me.mutable, namespace: me.namespace, native: me.native, new: me.new, newtonsoft: me.newtonsoft, no: me.no, noexcept: me.noexcept, obj3Guard: me.obj3Guard, obj3If: me.obj3If, obj3Import: me.obj3Import, obj3In: me.obj3In, obj3Indirect: me.obj3Indirect, obj3Infix: me.obj3Infix, obj3Init: me.obj3Init, obj3Inout: me.obj3Inout, obj3Internal: me.obj3Internal, obj3Is: me.obj3Is, obj3JSON: me.obj3JSON, obj3Lazy: me.obj3Lazy, obj3Left: me.obj3Left, obj3Let: me.obj3Let, obj3Mutating: me.obj3Mutating, obj3Nil: me.obj3Nil) | |
| 7315 | + self.init(dummy: me.dummy, goto: me.goto, hasOwnProperty: me.hasOwnProperty, hashCode: me.hashCode, hashable: me.hashable, hasher: me.hasher, id: me.id, imp: me.imp, implements: me.implements, implicit: me.implicit, inline: me.inline, instanceof: me.instanceof, int: me.int, interface: me.interface, isoDateTimeOffsetConverter: me.isoDateTimeOffsetConverter, iterable: me.iterable, jdec: me.jdec, jenc: me.jenc, jpipe: me.jpipe, jsonAny: me.jsonAny, jsonCodingKey: me.jsonCodingKey, jsonConverter: me.jsonConverter, jsonDecoder: me.jsonDecoder, jsonEncoder: me.jsonEncoder, jsonException: me.jsonException, jsonGenerator: me.jsonGenerator, jsonNode: me.jsonNode, jsonNull: me.jsonNull, jsonParser: me.jsonParser, jsonReader: me.jsonReader, jsonSerializer: me.jsonSerializer, jsonToken: me.jsonToken, jsonTokenType: me.jsonTokenType, jsonWriter: me.jsonWriter, lambda: me.lambda, list: me.list, locale: me.locale, lock: me.lock, long: me.long, map: me.map, mapEntry: me.mapEntry, marshalJSON: me.marshalJSON, metadataPropertyHandling: me.metadataPropertyHandling, module: me.module, mutable: me.mutable, namespace: me.namespace, native: me.native, new: me.new, newtonsoft: me.newtonsoft, no: me.no, obj3Guard: me.obj3Guard, obj3If: me.obj3If, obj3Import: me.obj3Import, obj3In: me.obj3In, obj3Indirect: me.obj3Indirect, obj3Infix: me.obj3Infix, obj3Init: me.obj3Init, obj3Inout: me.obj3Inout, obj3Internal: me.obj3Internal, obj3Is: me.obj3Is, obj3JSON: me.obj3JSON, obj3Lazy: me.obj3Lazy, obj3Left: me.obj3Left, obj3Let: me.obj3Let, obj3Mutating: me.obj3Mutating, obj3Nil: me.obj3Nil) | |
| 7313 | 7316 | } |
| 7314 | 7317 | |
| 7315 | 7318 | convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws { |
| @@ -7325,6 +7328,7 @@ extension Obj3 { | ||
| 7325 | 7328 | |
| 7326 | 7329 | func with( |
| 7327 | 7330 | dummy: Int? = nil, |
| 7331 | + goto: Goto? = nil, | |
| 7328 | 7332 | hasOwnProperty: HasOwnProperty? = nil, |
| 7329 | 7333 | hashCode: HashCode? = nil, |
| 7330 | 7334 | hashable: HashableClass? = nil, |
| @@ -7364,6 +7368,7 @@ extension Obj3 { | ||
| 7364 | 7368 | long: Long? = nil, |
| 7365 | 7369 | map: Map? = nil, |
| 7366 | 7370 | mapEntry: MapEntry? = nil, |
| 7371 | + marshalJSON: MarshalJSON? = nil, | |
| 7367 | 7372 | metadataPropertyHandling: MetadataPropertyHandling? = nil, |
| 7368 | 7373 | module: Module? = nil, |
| 7369 | 7374 | mutable: Mutable? = nil, |
| @@ -7372,7 +7377,6 @@ extension Obj3 { | ||
| 7372 | 7377 | new: New? = nil, |
| 7373 | 7378 | newtonsoft: Newtonsoft? = nil, |
| 7374 | 7379 | no: No? = nil, |
| 7375 | - noexcept: Noexcept? = nil, | |
| 7376 | 7380 | obj3Guard: Guard? = nil, |
| 7377 | 7381 | obj3If: If? = nil, |
| 7378 | 7382 | obj3Import: Import? = nil, |
| @@ -7392,6 +7396,7 @@ extension Obj3 { | ||
| 7392 | 7396 | ) -> Obj3 { |
| 7393 | 7397 | return Obj3( |
| 7394 | 7398 | dummy: dummy ?? self.dummy, |
| 7399 | + goto: goto ?? self.goto, | |
| 7395 | 7400 | hasOwnProperty: hasOwnProperty ?? self.hasOwnProperty, |
| 7396 | 7401 | hashCode: hashCode ?? self.hashCode, |
| 7397 | 7402 | hashable: hashable ?? self.hashable, |
| @@ -7431,6 +7436,7 @@ extension Obj3 { | ||
| 7431 | 7436 | long: long ?? self.long, |
| 7432 | 7437 | map: map ?? self.map, |
| 7433 | 7438 | mapEntry: mapEntry ?? self.mapEntry, |
| 7439 | + marshalJSON: marshalJSON ?? self.marshalJSON, | |
| 7434 | 7440 | metadataPropertyHandling: metadataPropertyHandling ?? self.metadataPropertyHandling, |
| 7435 | 7441 | module: module ?? self.module, |
| 7436 | 7442 | mutable: mutable ?? self.mutable, |
| @@ -7439,7 +7445,6 @@ extension Obj3 { | ||
| 7439 | 7445 | new: new ?? self.new, |
| 7440 | 7446 | newtonsoft: newtonsoft ?? self.newtonsoft, |
| 7441 | 7447 | no: no ?? self.no, |
| 7442 | - noexcept: noexcept ?? self.noexcept, | |
| 7443 | 7448 | obj3Guard: obj3Guard ?? self.obj3Guard, |
| 7444 | 7449 | obj3If: obj3If ?? self.obj3If, |
| 7445 | 7450 | obj3Import: obj3Import ?? self.obj3Import, |
| @@ -7468,6 +7473,55 @@ extension Obj3 { | ||
| 7468 | 7473 | } |
| 7469 | 7474 | } |
| 7470 | 7475 | |
| 7476 | +// MARK: - Goto | |
| 7477 | +@objcMembers class Goto: NSObject, Codable { | |
| 7478 | + let goto: Int | |
| 7479 | + | |
| 7480 | + enum CodingKeys: String, CodingKey { | |
| 7481 | + case goto = "goto" | |
| 7482 | + } | |
| 7483 | + | |
| 7484 | + init(goto: Int) { | |
| 7485 | + self.goto = goto | |
| 7486 | + } | |
| 7487 | +} | |
| 7488 | + | |
| 7489 | +// MARK: Goto convenience initializers and mutators | |
| 7490 | + | |
| 7491 | +extension Goto { | |
| 7492 | + convenience init(data: Data) throws { | |
| 7493 | + let me = try newJSONDecoder().decode(Goto.self, from: data) | |
| 7494 | + self.init(goto: me.goto) | |
| 7495 | + } | |
| 7496 | + | |
| 7497 | + convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 7498 | + guard let data = json.data(using: encoding) else { | |
| 7499 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 7500 | + } | |
| 7501 | + try self.init(data: data) | |
| 7502 | + } | |
| 7503 | + | |
| 7504 | + convenience init(fromURL url: URL) throws { | |
| 7505 | + try self.init(data: try Data(contentsOf: url)) | |
| 7506 | + } | |
| 7507 | + | |
| 7508 | + func with( | |
| 7509 | + goto: Int? = nil | |
| 7510 | + ) -> Goto { | |
| 7511 | + return Goto( | |
| 7512 | + goto: goto ?? self.goto | |
| 7513 | + ) | |
| 7514 | + } | |
| 7515 | + | |
| 7516 | + func jsonData() throws -> Data { | |
| 7517 | + return try newJSONEncoder().encode(self) | |
| 7518 | + } | |
| 7519 | + | |
| 7520 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 7521 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 7522 | + } | |
| 7523 | +} | |
| 7524 | + | |
| 7471 | 7525 | // MARK: - HasOwnProperty |
| 7472 | 7526 | @objcMembers class HasOwnProperty: NSObject, Codable { |
| 7473 | 7527 | let hasOwnProperty: Int |
| @@ -9379,6 +9433,55 @@ extension MapEntry { | ||
| 9379 | 9433 | } |
| 9380 | 9434 | } |
| 9381 | 9435 | |
| 9436 | +// MARK: - MarshalJSON | |
| 9437 | +@objcMembers class MarshalJSON: NSObject, Codable { | |
| 9438 | + let marshalJSON: Int | |
| 9439 | + | |
| 9440 | + enum CodingKeys: String, CodingKey { | |
| 9441 | + case marshalJSON = "MarshalJSON" | |
| 9442 | + } | |
| 9443 | + | |
| 9444 | + init(marshalJSON: Int) { | |
| 9445 | + self.marshalJSON = marshalJSON | |
| 9446 | + } | |
| 9447 | +} | |
| 9448 | + | |
| 9449 | +// MARK: MarshalJSON convenience initializers and mutators | |
| 9450 | + | |
| 9451 | +extension MarshalJSON { | |
| 9452 | + convenience init(data: Data) throws { | |
| 9453 | + let me = try newJSONDecoder().decode(MarshalJSON.self, from: data) | |
| 9454 | + self.init(marshalJSON: me.marshalJSON) | |
| 9455 | + } | |
| 9456 | + | |
| 9457 | + convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 9458 | + guard let data = json.data(using: encoding) else { | |
| 9459 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 9460 | + } | |
| 9461 | + try self.init(data: data) | |
| 9462 | + } | |
| 9463 | + | |
| 9464 | + convenience init(fromURL url: URL) throws { | |
| 9465 | + try self.init(data: try Data(contentsOf: url)) | |
| 9466 | + } | |
| 9467 | + | |
| 9468 | + func with( | |
| 9469 | + marshalJSON: Int? = nil | |
| 9470 | + ) -> MarshalJSON { | |
| 9471 | + return MarshalJSON( | |
| 9472 | + marshalJSON: marshalJSON ?? self.marshalJSON | |
| 9473 | + ) | |
| 9474 | + } | |
| 9475 | + | |
| 9476 | + func jsonData() throws -> Data { | |
| 9477 | + return try newJSONEncoder().encode(self) | |
| 9478 | + } | |
| 9479 | + | |
| 9480 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 9481 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 9482 | + } | |
| 9483 | +} | |
| 9484 | + | |
| 9382 | 9485 | // MARK: - MetadataPropertyHandling |
| 9383 | 9486 | @objcMembers class MetadataPropertyHandling: NSObject, Codable { |
| 9384 | 9487 | let metadataPropertyHandling: Int |
| @@ -9771,55 +9874,6 @@ extension No { | ||
| 9771 | 9874 | } |
| 9772 | 9875 | } |
| 9773 | 9876 | |
| 9774 | -// MARK: - Noexcept | |
| 9775 | -@objcMembers class Noexcept: NSObject, Codable { | |
| 9776 | - let noexcept: Int | |
| 9777 | - | |
| 9778 | - enum CodingKeys: String, CodingKey { | |
| 9779 | - case noexcept = "noexcept" | |
| 9780 | - } | |
| 9781 | - | |
| 9782 | - init(noexcept: Int) { | |
| 9783 | - self.noexcept = noexcept | |
| 9784 | - } | |
| 9785 | -} | |
| 9786 | - | |
| 9787 | -// MARK: Noexcept convenience initializers and mutators | |
| 9788 | - | |
| 9789 | -extension Noexcept { | |
| 9790 | - convenience init(data: Data) throws { | |
| 9791 | - let me = try newJSONDecoder().decode(Noexcept.self, from: data) | |
| 9792 | - self.init(noexcept: me.noexcept) | |
| 9793 | - } | |
| 9794 | - | |
| 9795 | - convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 9796 | - guard let data = json.data(using: encoding) else { | |
| 9797 | - throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 9798 | - } | |
| 9799 | - try self.init(data: data) | |
| 9800 | - } | |
| 9801 | - | |
| 9802 | - convenience init(fromURL url: URL) throws { | |
| 9803 | - try self.init(data: try Data(contentsOf: url)) | |
| 9804 | - } | |
| 9805 | - | |
| 9806 | - func with( | |
| 9807 | - noexcept: Int? = nil | |
| 9808 | - ) -> Noexcept { | |
| 9809 | - return Noexcept( | |
| 9810 | - noexcept: noexcept ?? self.noexcept | |
| 9811 | - ) | |
| 9812 | - } | |
| 9813 | - | |
| 9814 | - func jsonData() throws -> Data { | |
| 9815 | - return try newJSONEncoder().encode(self) | |
| 9816 | - } | |
| 9817 | - | |
| 9818 | - func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 9819 | - return String(data: try self.jsonData(), encoding: encoding) | |
| 9820 | - } | |
| 9821 | -} | |
| 9822 | - | |
| 9823 | 9877 | // MARK: - Guard |
| 9824 | 9878 | @objcMembers class Guard: NSObject, Codable { |
| 9825 | 9879 | let guardGuard: Int |
| @@ -10608,6 +10662,7 @@ extension Nil { | ||
| 10608 | 10662 | @objcMembers class Obj4: NSObject, Codable { |
| 10609 | 10663 | let dummy: Int |
| 10610 | 10664 | let noSuchMethod: NoSuchMethod |
| 10665 | + let noexcept: Noexcept | |
| 10611 | 10666 | let nonatomic: Nonatomic |
| 10612 | 10667 | let none: None |
| 10613 | 10668 | let nonlocal: Nonlocal |
| @@ -10670,11 +10725,11 @@ extension Nil { | ||
| 10670 | 10725 | let sbyte: Sbyte |
| 10671 | 10726 | let sealed: Sealed |
| 10672 | 10727 | let sel: Sel |
| 10673 | - let select: Select | |
| 10674 | 10728 | |
| 10675 | 10729 | enum CodingKeys: String, CodingKey { |
| 10676 | 10730 | case dummy = "dummy" |
| 10677 | 10731 | case noSuchMethod = "noSuchMethod" |
| 10732 | + case noexcept = "noexcept" | |
| 10678 | 10733 | case nonatomic = "nonatomic" |
| 10679 | 10734 | case none = "None" |
| 10680 | 10735 | case nonlocal = "nonlocal" |
| @@ -10737,12 +10792,12 @@ extension Nil { | ||
| 10737 | 10792 | case sbyte = "sbyte" |
| 10738 | 10793 | case sealed = "sealed" |
| 10739 | 10794 | case sel = "SEL" |
| 10740 | - case select = "select" | |
| 10741 | 10795 | } |
| 10742 | 10796 | |
| 10743 | - init(dummy: Int, noSuchMethod: NoSuchMethod, nonatomic: Nonatomic, none: None, nonlocal: Nonlocal, not: Not, notEq: NotEq, nsError: NSErrorClass, nsObject: NSObjectClass, nsString: NSString, null: Null, nullptr: Nullptr, number: Number, obj4None: NoneClass, obj4Nonmutating: Nonmutating, obj4Null: NullClass, obj4Open: Open, obj4Operator: Operator, obj4Optional: Optional, obj4Override: Override, obj4Postfix: Postfix, obj4Precedence: Precedence, obj4Prefix: Prefix, obj4Private: Private, obj4Protocol: ProtocolClass, obj4Public: Public, obj4Repeat: Repeat, obj4Required: Required, obj4Retain: Retain, obj4Rethrows: Rethrows, obj4Return: Return, obj4Right: Right, object: Object, objectMapper: ObjectMapper, of: Of, oneway: Oneway, or: Or, orEq: OrEq, out: Out, package: Package, params: Params, pass: Pass, port: Port, print: Print, printMembers: PrintMembers, printf: Printf, protected: Protected, purpleProtocol: Obj4Protocol, quicktype: Quicktype, raise: Raise, range: Range, readonly: Readonly, ref: Ref, regExp: RegExp, register: Register, reinterpretCast: ReinterpretCast, require: Require, requires: Requires, restrict: Restrict, runtimeType: RuntimeType, s: S, sbyte: Sbyte, sealed: Sealed, sel: Sel, select: Select) { | |
| 10797 | + init(dummy: Int, noSuchMethod: NoSuchMethod, noexcept: Noexcept, nonatomic: Nonatomic, none: None, nonlocal: Nonlocal, not: Not, notEq: NotEq, nsError: NSErrorClass, nsObject: NSObjectClass, nsString: NSString, null: Null, nullptr: Nullptr, number: Number, obj4None: NoneClass, obj4Nonmutating: Nonmutating, obj4Null: NullClass, obj4Open: Open, obj4Operator: Operator, obj4Optional: Optional, obj4Override: Override, obj4Postfix: Postfix, obj4Precedence: Precedence, obj4Prefix: Prefix, obj4Private: Private, obj4Protocol: ProtocolClass, obj4Public: Public, obj4Repeat: Repeat, obj4Required: Required, obj4Retain: Retain, obj4Rethrows: Rethrows, obj4Return: Return, obj4Right: Right, object: Object, objectMapper: ObjectMapper, of: Of, oneway: Oneway, or: Or, orEq: OrEq, out: Out, package: Package, params: Params, pass: Pass, port: Port, print: Print, printMembers: PrintMembers, printf: Printf, protected: Protected, purpleProtocol: Obj4Protocol, quicktype: Quicktype, raise: Raise, range: Range, readonly: Readonly, ref: Ref, regExp: RegExp, register: Register, reinterpretCast: ReinterpretCast, require: Require, requires: Requires, restrict: Restrict, runtimeType: RuntimeType, s: S, sbyte: Sbyte, sealed: Sealed, sel: Sel) { | |
| 10744 | 10798 | self.dummy = dummy |
| 10745 | 10799 | self.noSuchMethod = noSuchMethod |
| 10800 | + self.noexcept = noexcept | |
| 10746 | 10801 | self.nonatomic = nonatomic |
| 10747 | 10802 | self.none = none |
| 10748 | 10803 | self.nonlocal = nonlocal |
| @@ -10805,7 +10860,6 @@ extension Nil { | ||
| 10805 | 10860 | self.sbyte = sbyte |
| 10806 | 10861 | self.sealed = sealed |
| 10807 | 10862 | self.sel = sel |
| 10808 | - self.select = select | |
| 10809 | 10863 | } |
| 10810 | 10864 | } |
| 10811 | 10865 | |
| @@ -10814,7 +10868,7 @@ extension Nil { | ||
| 10814 | 10868 | extension Obj4 { |
| 10815 | 10869 | convenience init(data: Data) throws { |
| 10816 | 10870 | let me = try newJSONDecoder().decode(Obj4.self, from: data) |
| 10817 | - self.init(dummy: me.dummy, noSuchMethod: me.noSuchMethod, nonatomic: me.nonatomic, none: me.none, nonlocal: me.nonlocal, not: me.not, notEq: me.notEq, nsError: me.nsError, nsObject: me.nsObject, nsString: me.nsString, null: me.null, nullptr: me.nullptr, number: me.number, obj4None: me.obj4None, obj4Nonmutating: me.obj4Nonmutating, obj4Null: me.obj4Null, obj4Open: me.obj4Open, obj4Operator: me.obj4Operator, obj4Optional: me.obj4Optional, obj4Override: me.obj4Override, obj4Postfix: me.obj4Postfix, obj4Precedence: me.obj4Precedence, obj4Prefix: me.obj4Prefix, obj4Private: me.obj4Private, obj4Protocol: me.obj4Protocol, obj4Public: me.obj4Public, obj4Repeat: me.obj4Repeat, obj4Required: me.obj4Required, obj4Retain: me.obj4Retain, obj4Rethrows: me.obj4Rethrows, obj4Return: me.obj4Return, obj4Right: me.obj4Right, object: me.object, objectMapper: me.objectMapper, of: me.of, oneway: me.oneway, or: me.or, orEq: me.orEq, out: me.out, package: me.package, params: me.params, pass: me.pass, port: me.port, print: me.print, printMembers: me.printMembers, printf: me.printf, protected: me.protected, purpleProtocol: me.purpleProtocol, quicktype: me.quicktype, raise: me.raise, range: me.range, readonly: me.readonly, ref: me.ref, regExp: me.regExp, register: me.register, reinterpretCast: me.reinterpretCast, require: me.require, requires: me.requires, restrict: me.restrict, runtimeType: me.runtimeType, s: me.s, sbyte: me.sbyte, sealed: me.sealed, sel: me.sel, select: me.select) | |
| 10871 | + self.init(dummy: me.dummy, noSuchMethod: me.noSuchMethod, noexcept: me.noexcept, nonatomic: me.nonatomic, none: me.none, nonlocal: me.nonlocal, not: me.not, notEq: me.notEq, nsError: me.nsError, nsObject: me.nsObject, nsString: me.nsString, null: me.null, nullptr: me.nullptr, number: me.number, obj4None: me.obj4None, obj4Nonmutating: me.obj4Nonmutating, obj4Null: me.obj4Null, obj4Open: me.obj4Open, obj4Operator: me.obj4Operator, obj4Optional: me.obj4Optional, obj4Override: me.obj4Override, obj4Postfix: me.obj4Postfix, obj4Precedence: me.obj4Precedence, obj4Prefix: me.obj4Prefix, obj4Private: me.obj4Private, obj4Protocol: me.obj4Protocol, obj4Public: me.obj4Public, obj4Repeat: me.obj4Repeat, obj4Required: me.obj4Required, obj4Retain: me.obj4Retain, obj4Rethrows: me.obj4Rethrows, obj4Return: me.obj4Return, obj4Right: me.obj4Right, object: me.object, objectMapper: me.objectMapper, of: me.of, oneway: me.oneway, or: me.or, orEq: me.orEq, out: me.out, package: me.package, params: me.params, pass: me.pass, port: me.port, print: me.print, printMembers: me.printMembers, printf: me.printf, protected: me.protected, purpleProtocol: me.purpleProtocol, quicktype: me.quicktype, raise: me.raise, range: me.range, readonly: me.readonly, ref: me.ref, regExp: me.regExp, register: me.register, reinterpretCast: me.reinterpretCast, require: me.require, requires: me.requires, restrict: me.restrict, runtimeType: me.runtimeType, s: me.s, sbyte: me.sbyte, sealed: me.sealed, sel: me.sel) | |
| 10818 | 10872 | } |
| 10819 | 10873 | |
| 10820 | 10874 | convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws { |
| @@ -10831,6 +10885,7 @@ extension Obj4 { | ||
| 10831 | 10885 | func with( |
| 10832 | 10886 | dummy: Int? = nil, |
| 10833 | 10887 | noSuchMethod: NoSuchMethod? = nil, |
| 10888 | + noexcept: Noexcept? = nil, | |
| 10834 | 10889 | nonatomic: Nonatomic? = nil, |
| 10835 | 10890 | none: None? = nil, |
| 10836 | 10891 | nonlocal: Nonlocal? = nil, |
| @@ -10892,12 +10947,12 @@ extension Obj4 { | ||
| 10892 | 10947 | s: S? = nil, |
| 10893 | 10948 | sbyte: Sbyte? = nil, |
| 10894 | 10949 | sealed: Sealed? = nil, |
| 10895 | - sel: Sel? = nil, | |
| 10896 | - select: Select? = nil | |
| 10950 | + sel: Sel? = nil | |
| 10897 | 10951 | ) -> Obj4 { |
| 10898 | 10952 | return Obj4( |
| 10899 | 10953 | dummy: dummy ?? self.dummy, |
| 10900 | 10954 | noSuchMethod: noSuchMethod ?? self.noSuchMethod, |
| 10955 | + noexcept: noexcept ?? self.noexcept, | |
| 10901 | 10956 | nonatomic: nonatomic ?? self.nonatomic, |
| 10902 | 10957 | none: none ?? self.none, |
| 10903 | 10958 | nonlocal: nonlocal ?? self.nonlocal, |
| @@ -10959,8 +11014,7 @@ extension Obj4 { | ||
| 10959 | 11014 | s: s ?? self.s, |
| 10960 | 11015 | sbyte: sbyte ?? self.sbyte, |
| 10961 | 11016 | sealed: sealed ?? self.sealed, |
| 10962 | - sel: sel ?? self.sel, | |
| 10963 | - select: select ?? self.select | |
| 11017 | + sel: sel ?? self.sel | |
| 10964 | 11018 | ) |
| 10965 | 11019 | } |
| 10966 | 11020 | |
| @@ -11022,20 +11076,69 @@ extension NoSuchMethod { | ||
| 11022 | 11076 | } |
| 11023 | 11077 | } |
| 11024 | 11078 | |
| 11025 | -// MARK: - Nonatomic | |
| 11026 | -@objcMembers class Nonatomic: NSObject, Codable { | |
| 11027 | - let nonatomic: Int | |
| 11079 | +// MARK: - Noexcept | |
| 11080 | +@objcMembers class Noexcept: NSObject, Codable { | |
| 11081 | + let noexcept: Int | |
| 11028 | 11082 | |
| 11029 | 11083 | enum CodingKeys: String, CodingKey { |
| 11030 | - case nonatomic = "nonatomic" | |
| 11084 | + case noexcept = "noexcept" | |
| 11031 | 11085 | } |
| 11032 | 11086 | |
| 11033 | - init(nonatomic: Int) { | |
| 11034 | - self.nonatomic = nonatomic | |
| 11087 | + init(noexcept: Int) { | |
| 11088 | + self.noexcept = noexcept | |
| 11035 | 11089 | } |
| 11036 | 11090 | } |
| 11037 | 11091 | |
| 11038 | -// MARK: Nonatomic convenience initializers and mutators | |
| 11092 | +// MARK: Noexcept convenience initializers and mutators | |
| 11093 | + | |
| 11094 | +extension Noexcept { | |
| 11095 | + convenience init(data: Data) throws { | |
| 11096 | + let me = try newJSONDecoder().decode(Noexcept.self, from: data) | |
| 11097 | + self.init(noexcept: me.noexcept) | |
| 11098 | + } | |
| 11099 | + | |
| 11100 | + convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 11101 | + guard let data = json.data(using: encoding) else { | |
| 11102 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 11103 | + } | |
| 11104 | + try self.init(data: data) | |
| 11105 | + } | |
| 11106 | + | |
| 11107 | + convenience init(fromURL url: URL) throws { | |
| 11108 | + try self.init(data: try Data(contentsOf: url)) | |
| 11109 | + } | |
| 11110 | + | |
| 11111 | + func with( | |
| 11112 | + noexcept: Int? = nil | |
| 11113 | + ) -> Noexcept { | |
| 11114 | + return Noexcept( | |
| 11115 | + noexcept: noexcept ?? self.noexcept | |
| 11116 | + ) | |
| 11117 | + } | |
| 11118 | + | |
| 11119 | + func jsonData() throws -> Data { | |
| 11120 | + return try newJSONEncoder().encode(self) | |
| 11121 | + } | |
| 11122 | + | |
| 11123 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 11124 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 11125 | + } | |
| 11126 | +} | |
| 11127 | + | |
| 11128 | +// MARK: - Nonatomic | |
| 11129 | +@objcMembers class Nonatomic: NSObject, Codable { | |
| 11130 | + let nonatomic: Int | |
| 11131 | + | |
| 11132 | + enum CodingKeys: String, CodingKey { | |
| 11133 | + case nonatomic = "nonatomic" | |
| 11134 | + } | |
| 11135 | + | |
| 11136 | + init(nonatomic: Int) { | |
| 11137 | + self.nonatomic = nonatomic | |
| 11138 | + } | |
| 11139 | +} | |
| 11140 | + | |
| 11141 | +// MARK: Nonatomic convenience initializers and mutators | |
| 11039 | 11142 | |
| 11040 | 11143 | extension Nonatomic { |
| 11041 | 11144 | convenience init(data: Data) throws { |
| @@ -14060,55 +14163,6 @@ extension Sel { | ||
| 14060 | 14163 | } |
| 14061 | 14164 | } |
| 14062 | 14165 | |
| 14063 | -// MARK: - Select | |
| 14064 | -@objcMembers class Select: NSObject, Codable { | |
| 14065 | - let select: Int | |
| 14066 | - | |
| 14067 | - enum CodingKeys: String, CodingKey { | |
| 14068 | - case select = "select" | |
| 14069 | - } | |
| 14070 | - | |
| 14071 | - init(select: Int) { | |
| 14072 | - self.select = select | |
| 14073 | - } | |
| 14074 | -} | |
| 14075 | - | |
| 14076 | -// MARK: Select convenience initializers and mutators | |
| 14077 | - | |
| 14078 | -extension Select { | |
| 14079 | - convenience init(data: Data) throws { | |
| 14080 | - let me = try newJSONDecoder().decode(Select.self, from: data) | |
| 14081 | - self.init(select: me.select) | |
| 14082 | - } | |
| 14083 | - | |
| 14084 | - convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 14085 | - guard let data = json.data(using: encoding) else { | |
| 14086 | - throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 14087 | - } | |
| 14088 | - try self.init(data: data) | |
| 14089 | - } | |
| 14090 | - | |
| 14091 | - convenience init(fromURL url: URL) throws { | |
| 14092 | - try self.init(data: try Data(contentsOf: url)) | |
| 14093 | - } | |
| 14094 | - | |
| 14095 | - func with( | |
| 14096 | - select: Int? = nil | |
| 14097 | - ) -> Select { | |
| 14098 | - return Select( | |
| 14099 | - select: select ?? self.select | |
| 14100 | - ) | |
| 14101 | - } | |
| 14102 | - | |
| 14103 | - func jsonData() throws -> Data { | |
| 14104 | - return try newJSONEncoder().encode(self) | |
| 14105 | - } | |
| 14106 | - | |
| 14107 | - func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 14108 | - return String(data: try self.jsonData(), encoding: encoding) | |
| 14109 | - } | |
| 14110 | -} | |
| 14111 | - | |
| 14112 | 14166 | // MARK: - Obj5 |
| 14113 | 14167 | @objcMembers class Obj5: NSObject, Codable { |
| 14114 | 14168 | let dummy: Int |
| @@ -14130,6 +14184,7 @@ extension Select { | ||
| 14130 | 14184 | let primitiveKind: PrimitiveKind |
| 14131 | 14185 | let purpleSelf: Obj5Self |
| 14132 | 14186 | let purpleTrue: TrueClass |
| 14187 | + let select: Select | |
| 14133 | 14188 | let sendable: Sendable |
| 14134 | 14189 | let serialDescriptor: SerialDescriptor |
| 14135 | 14190 | let serialName: SerialName |
| @@ -14158,6 +14213,7 @@ extension Select { | ||
| 14158 | 14213 | let timeOnly: TimeOnly |
| 14159 | 14214 | let timeOnlyConverter: TimeOnlyConverter |
| 14160 | 14215 | let timeZone: TimeZoneClass |
| 14216 | + let toDict: ToDict | |
| 14161 | 14217 | let toJSON: ToJSON |
| 14162 | 14218 | let toString: ToString |
| 14163 | 14219 | let topLevel: TopLevelClass |
| @@ -14172,10 +14228,9 @@ extension Select { | ||
| 14172 | 14228 | let unchecked: Unchecked |
| 14173 | 14229 | let undefined: Undefined |
| 14174 | 14230 | let union: Union |
| 14231 | + let unmarshalJSON: UnmarshalJSON | |
| 14175 | 14232 | let unsafe: Unsafe |
| 14176 | - let unsigned: Unsigned | |
| 14177 | 14233 | let useSerializers: UseSerializers |
| 14178 | - let ushort: Ushort | |
| 14179 | 14234 | |
| 14180 | 14235 | enum CodingKeys: String, CodingKey { |
| 14181 | 14236 | case dummy = "dummy" |
| @@ -14197,6 +14252,7 @@ extension Select { | ||
| 14197 | 14252 | case primitiveKind = "PrimitiveKind" |
| 14198 | 14253 | case purpleSelf = "self" |
| 14199 | 14254 | case purpleTrue = "true" |
| 14255 | + case select = "select" | |
| 14200 | 14256 | case sendable = "Sendable" |
| 14201 | 14257 | case serialDescriptor = "SerialDescriptor" |
| 14202 | 14258 | case serialName = "SerialName" |
| @@ -14225,6 +14281,7 @@ extension Select { | ||
| 14225 | 14281 | case timeOnly = "TimeOnly" |
| 14226 | 14282 | case timeOnlyConverter = "TimeOnlyConverter" |
| 14227 | 14283 | case timeZone = "TimeZone" |
| 14284 | + case toDict = "to_dict" | |
| 14228 | 14285 | case toJSON = "to_json" |
| 14229 | 14286 | case toString = "toString" |
| 14230 | 14287 | case topLevel = "top_level" |
| @@ -14239,13 +14296,12 @@ extension Select { | ||
| 14239 | 14296 | case unchecked = "unchecked" |
| 14240 | 14297 | case undefined = "undefined" |
| 14241 | 14298 | case union = "union" |
| 14299 | + case unmarshalJSON = "UnmarshalJSON" | |
| 14242 | 14300 | case unsafe = "unsafe" |
| 14243 | - case unsigned = "unsigned" | |
| 14244 | 14301 | case useSerializers = "UseSerializers" |
| 14245 | - case ushort = "ushort" | |
| 14246 | 14302 | } |
| 14247 | 14303 | |
| 14248 | - init(dummy: Int, kSerializer: KSerializer, obj5Self: SelfClass, obj5Set: Set, obj5Static: Static, obj5Struct: Struct, obj5Subscript: Subscript, obj5Super: Super, obj5Switch: Switch, obj5Throw: Throw, obj5Throws: Throws, obj5True: True, obj5Try: Try, obj5Type: Obj5Type, obj5Typealias: Typealias, obj5Unowned: Unowned, primitiveKind: PrimitiveKind, purpleSelf: Obj5Self, purpleTrue: TrueClass, sendable: Sendable, serialDescriptor: SerialDescriptor, serialName: SerialName, serializable: Serializable, serialize: Serialize, serializerProvider: SerializerProvider, short: Short, signed: Signed, simpleModule: SimpleModule, sizeof: Sizeof, stackalloc: Stackalloc, standards: Standards, staticAssert: StaticAssert, staticCast: StaticCast, stdDeserializer: StdDeserializer, stdSerializer: StdSerializer, strictfp: Strictfp, string: StringClass, symbol: Symbol, synchronized: Synchronized, system: System, template: Template, then: Then, this: This, threadLocal: ThreadLocal, timeOnly: TimeOnly, timeOnlyConverter: TimeOnlyConverter, timeZone: TimeZoneClass, toJSON: ToJSON, toString: ToString, topLevel: TopLevelClass, transient: Transient, type: TypeClass, typedef: Typedef, typeid: Typeid, typename: Typename, typeof: Typeof, uint: Uint, ulong: Ulong, unchecked: Unchecked, undefined: Undefined, union: Union, unsafe: Unsafe, unsigned: Unsigned, useSerializers: UseSerializers, ushort: Ushort) { | |
| 14304 | + init(dummy: Int, kSerializer: KSerializer, obj5Self: SelfClass, obj5Set: Set, obj5Static: Static, obj5Struct: Struct, obj5Subscript: Subscript, obj5Super: Super, obj5Switch: Switch, obj5Throw: Throw, obj5Throws: Throws, obj5True: True, obj5Try: Try, obj5Type: Obj5Type, obj5Typealias: Typealias, obj5Unowned: Unowned, primitiveKind: PrimitiveKind, purpleSelf: Obj5Self, purpleTrue: TrueClass, select: Select, sendable: Sendable, serialDescriptor: SerialDescriptor, serialName: SerialName, serializable: Serializable, serialize: Serialize, serializerProvider: SerializerProvider, short: Short, signed: Signed, simpleModule: SimpleModule, sizeof: Sizeof, stackalloc: Stackalloc, standards: Standards, staticAssert: StaticAssert, staticCast: StaticCast, stdDeserializer: StdDeserializer, stdSerializer: StdSerializer, strictfp: Strictfp, string: StringClass, symbol: Symbol, synchronized: Synchronized, system: System, template: Template, then: Then, this: This, threadLocal: ThreadLocal, timeOnly: TimeOnly, timeOnlyConverter: TimeOnlyConverter, timeZone: TimeZoneClass, toDict: ToDict, toJSON: ToJSON, toString: ToString, topLevel: TopLevelClass, transient: Transient, type: TypeClass, typedef: Typedef, typeid: Typeid, typename: Typename, typeof: Typeof, uint: Uint, ulong: Ulong, unchecked: Unchecked, undefined: Undefined, union: Union, unmarshalJSON: UnmarshalJSON, unsafe: Unsafe, useSerializers: UseSerializers) { | |
| 14249 | 14305 | self.dummy = dummy |
| 14250 | 14306 | self.kSerializer = kSerializer |
| 14251 | 14307 | self.obj5Self = obj5Self |
| @@ -14265,6 +14321,7 @@ extension Select { | ||
| 14265 | 14321 | self.primitiveKind = primitiveKind |
| 14266 | 14322 | self.purpleSelf = purpleSelf |
| 14267 | 14323 | self.purpleTrue = purpleTrue |
| 14324 | + self.select = select | |
| 14268 | 14325 | self.sendable = sendable |
| 14269 | 14326 | self.serialDescriptor = serialDescriptor |
| 14270 | 14327 | self.serialName = serialName |
| @@ -14293,6 +14350,7 @@ extension Select { | ||
| 14293 | 14350 | self.timeOnly = timeOnly |
| 14294 | 14351 | self.timeOnlyConverter = timeOnlyConverter |
| 14295 | 14352 | self.timeZone = timeZone |
| 14353 | + self.toDict = toDict | |
| 14296 | 14354 | self.toJSON = toJSON |
| 14297 | 14355 | self.toString = toString |
| 14298 | 14356 | self.topLevel = topLevel |
| @@ -14307,10 +14365,9 @@ extension Select { | ||
| 14307 | 14365 | self.unchecked = unchecked |
| 14308 | 14366 | self.undefined = undefined |
| 14309 | 14367 | self.union = union |
| 14368 | + self.unmarshalJSON = unmarshalJSON | |
| 14310 | 14369 | self.unsafe = unsafe |
| 14311 | - self.unsigned = unsigned | |
| 14312 | 14370 | self.useSerializers = useSerializers |
| 14313 | - self.ushort = ushort | |
| 14314 | 14371 | } |
| 14315 | 14372 | } |
| 14316 | 14373 | |
| @@ -14319,7 +14376,7 @@ extension Select { | ||
| 14319 | 14376 | extension Obj5 { |
| 14320 | 14377 | convenience init(data: Data) throws { |
| 14321 | 14378 | let me = try newJSONDecoder().decode(Obj5.self, from: data) |
| 14322 | - self.init(dummy: me.dummy, kSerializer: me.kSerializer, obj5Self: me.obj5Self, obj5Set: me.obj5Set, obj5Static: me.obj5Static, obj5Struct: me.obj5Struct, obj5Subscript: me.obj5Subscript, obj5Super: me.obj5Super, obj5Switch: me.obj5Switch, obj5Throw: me.obj5Throw, obj5Throws: me.obj5Throws, obj5True: me.obj5True, obj5Try: me.obj5Try, obj5Type: me.obj5Type, obj5Typealias: me.obj5Typealias, obj5Unowned: me.obj5Unowned, primitiveKind: me.primitiveKind, purpleSelf: me.purpleSelf, purpleTrue: me.purpleTrue, sendable: me.sendable, serialDescriptor: me.serialDescriptor, serialName: me.serialName, serializable: me.serializable, serialize: me.serialize, serializerProvider: me.serializerProvider, short: me.short, signed: me.signed, simpleModule: me.simpleModule, sizeof: me.sizeof, stackalloc: me.stackalloc, standards: me.standards, staticAssert: me.staticAssert, staticCast: me.staticCast, stdDeserializer: me.stdDeserializer, stdSerializer: me.stdSerializer, strictfp: me.strictfp, string: me.string, symbol: me.symbol, synchronized: me.synchronized, system: me.system, template: me.template, then: me.then, this: me.this, threadLocal: me.threadLocal, timeOnly: me.timeOnly, timeOnlyConverter: me.timeOnlyConverter, timeZone: me.timeZone, toJSON: me.toJSON, toString: me.toString, topLevel: me.topLevel, transient: me.transient, type: me.type, typedef: me.typedef, typeid: me.typeid, typename: me.typename, typeof: me.typeof, uint: me.uint, ulong: me.ulong, unchecked: me.unchecked, undefined: me.undefined, union: me.union, unsafe: me.unsafe, unsigned: me.unsigned, useSerializers: me.useSerializers, ushort: me.ushort) | |
| 14379 | + self.init(dummy: me.dummy, kSerializer: me.kSerializer, obj5Self: me.obj5Self, obj5Set: me.obj5Set, obj5Static: me.obj5Static, obj5Struct: me.obj5Struct, obj5Subscript: me.obj5Subscript, obj5Super: me.obj5Super, obj5Switch: me.obj5Switch, obj5Throw: me.obj5Throw, obj5Throws: me.obj5Throws, obj5True: me.obj5True, obj5Try: me.obj5Try, obj5Type: me.obj5Type, obj5Typealias: me.obj5Typealias, obj5Unowned: me.obj5Unowned, primitiveKind: me.primitiveKind, purpleSelf: me.purpleSelf, purpleTrue: me.purpleTrue, select: me.select, sendable: me.sendable, serialDescriptor: me.serialDescriptor, serialName: me.serialName, serializable: me.serializable, serialize: me.serialize, serializerProvider: me.serializerProvider, short: me.short, signed: me.signed, simpleModule: me.simpleModule, sizeof: me.sizeof, stackalloc: me.stackalloc, standards: me.standards, staticAssert: me.staticAssert, staticCast: me.staticCast, stdDeserializer: me.stdDeserializer, stdSerializer: me.stdSerializer, strictfp: me.strictfp, string: me.string, symbol: me.symbol, synchronized: me.synchronized, system: me.system, template: me.template, then: me.then, this: me.this, threadLocal: me.threadLocal, timeOnly: me.timeOnly, timeOnlyConverter: me.timeOnlyConverter, timeZone: me.timeZone, toDict: me.toDict, toJSON: me.toJSON, toString: me.toString, topLevel: me.topLevel, transient: me.transient, type: me.type, typedef: me.typedef, typeid: me.typeid, typename: me.typename, typeof: me.typeof, uint: me.uint, ulong: me.ulong, unchecked: me.unchecked, undefined: me.undefined, union: me.union, unmarshalJSON: me.unmarshalJSON, unsafe: me.unsafe, useSerializers: me.useSerializers) | |
| 14323 | 14380 | } |
| 14324 | 14381 | |
| 14325 | 14382 | convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws { |
| @@ -14353,6 +14410,7 @@ extension Obj5 { | ||
| 14353 | 14410 | primitiveKind: PrimitiveKind? = nil, |
| 14354 | 14411 | purpleSelf: Obj5Self? = nil, |
| 14355 | 14412 | purpleTrue: TrueClass? = nil, |
| 14413 | + select: Select? = nil, | |
| 14356 | 14414 | sendable: Sendable? = nil, |
| 14357 | 14415 | serialDescriptor: SerialDescriptor? = nil, |
| 14358 | 14416 | serialName: SerialName? = nil, |
| @@ -14381,6 +14439,7 @@ extension Obj5 { | ||
| 14381 | 14439 | timeOnly: TimeOnly? = nil, |
| 14382 | 14440 | timeOnlyConverter: TimeOnlyConverter? = nil, |
| 14383 | 14441 | timeZone: TimeZoneClass? = nil, |
| 14442 | + toDict: ToDict? = nil, | |
| 14384 | 14443 | toJSON: ToJSON? = nil, |
| 14385 | 14444 | toString: ToString? = nil, |
| 14386 | 14445 | topLevel: TopLevelClass? = nil, |
| @@ -14395,10 +14454,9 @@ extension Obj5 { | ||
| 14395 | 14454 | unchecked: Unchecked? = nil, |
| 14396 | 14455 | undefined: Undefined? = nil, |
| 14397 | 14456 | union: Union? = nil, |
| 14457 | + unmarshalJSON: UnmarshalJSON? = nil, | |
| 14398 | 14458 | unsafe: Unsafe? = nil, |
| 14399 | - unsigned: Unsigned? = nil, | |
| 14400 | - useSerializers: UseSerializers? = nil, | |
| 14401 | - ushort: Ushort? = nil | |
| 14459 | + useSerializers: UseSerializers? = nil | |
| 14402 | 14460 | ) -> Obj5 { |
| 14403 | 14461 | return Obj5( |
| 14404 | 14462 | dummy: dummy ?? self.dummy, |
| @@ -14420,6 +14478,7 @@ extension Obj5 { | ||
| 14420 | 14478 | primitiveKind: primitiveKind ?? self.primitiveKind, |
| 14421 | 14479 | purpleSelf: purpleSelf ?? self.purpleSelf, |
| 14422 | 14480 | purpleTrue: purpleTrue ?? self.purpleTrue, |
| 14481 | + select: select ?? self.select, | |
| 14423 | 14482 | sendable: sendable ?? self.sendable, |
| 14424 | 14483 | serialDescriptor: serialDescriptor ?? self.serialDescriptor, |
| 14425 | 14484 | serialName: serialName ?? self.serialName, |
| @@ -14448,6 +14507,7 @@ extension Obj5 { | ||
| 14448 | 14507 | timeOnly: timeOnly ?? self.timeOnly, |
| 14449 | 14508 | timeOnlyConverter: timeOnlyConverter ?? self.timeOnlyConverter, |
| 14450 | 14509 | timeZone: timeZone ?? self.timeZone, |
| 14510 | + toDict: toDict ?? self.toDict, | |
| 14451 | 14511 | toJSON: toJSON ?? self.toJSON, |
| 14452 | 14512 | toString: toString ?? self.toString, |
| 14453 | 14513 | topLevel: topLevel ?? self.topLevel, |
| @@ -14462,10 +14522,9 @@ extension Obj5 { | ||
| 14462 | 14522 | unchecked: unchecked ?? self.unchecked, |
| 14463 | 14523 | undefined: undefined ?? self.undefined, |
| 14464 | 14524 | union: union ?? self.union, |
| 14525 | + unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON, | |
| 14465 | 14526 | unsafe: unsafe ?? self.unsafe, |
| 14466 | - unsigned: unsigned ?? self.unsigned, | |
| 14467 | - useSerializers: useSerializers ?? self.useSerializers, | |
| 14468 | - ushort: ushort ?? self.ushort | |
| 14527 | + useSerializers: useSerializers ?? self.useSerializers | |
| 14469 | 14528 | ) |
| 14470 | 14529 | } |
| 14471 | 14530 | |
| @@ -15360,6 +15419,55 @@ extension TrueClass { | ||
| 15360 | 15419 | } |
| 15361 | 15420 | } |
| 15362 | 15421 | |
| 15422 | +// MARK: - Select | |
| 15423 | +@objcMembers class Select: NSObject, Codable { | |
| 15424 | + let select: Int | |
| 15425 | + | |
| 15426 | + enum CodingKeys: String, CodingKey { | |
| 15427 | + case select = "select" | |
| 15428 | + } | |
| 15429 | + | |
| 15430 | + init(select: Int) { | |
| 15431 | + self.select = select | |
| 15432 | + } | |
| 15433 | +} | |
| 15434 | + | |
| 15435 | +// MARK: Select convenience initializers and mutators | |
| 15436 | + | |
| 15437 | +extension Select { | |
| 15438 | + convenience init(data: Data) throws { | |
| 15439 | + let me = try newJSONDecoder().decode(Select.self, from: data) | |
| 15440 | + self.init(select: me.select) | |
| 15441 | + } | |
| 15442 | + | |
| 15443 | + convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 15444 | + guard let data = json.data(using: encoding) else { | |
| 15445 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 15446 | + } | |
| 15447 | + try self.init(data: data) | |
| 15448 | + } | |
| 15449 | + | |
| 15450 | + convenience init(fromURL url: URL) throws { | |
| 15451 | + try self.init(data: try Data(contentsOf: url)) | |
| 15452 | + } | |
| 15453 | + | |
| 15454 | + func with( | |
| 15455 | + select: Int? = nil | |
| 15456 | + ) -> Select { | |
| 15457 | + return Select( | |
| 15458 | + select: select ?? self.select | |
| 15459 | + ) | |
| 15460 | + } | |
| 15461 | + | |
| 15462 | + func jsonData() throws -> Data { | |
| 15463 | + return try newJSONEncoder().encode(self) | |
| 15464 | + } | |
| 15465 | + | |
| 15466 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 15467 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 15468 | + } | |
| 15469 | +} | |
| 15470 | + | |
| 15363 | 15471 | // MARK: - Sendable |
| 15364 | 15472 | @objcMembers class Sendable: NSObject, Codable { |
| 15365 | 15473 | let sendable: Int |
| @@ -16732,6 +16840,55 @@ extension TimeZoneClass { | ||
| 16732 | 16840 | } |
| 16733 | 16841 | } |
| 16734 | 16842 | |
| 16843 | +// MARK: - ToDict | |
| 16844 | +@objcMembers class ToDict: NSObject, Codable { | |
| 16845 | + let toDict: Int | |
| 16846 | + | |
| 16847 | + enum CodingKeys: String, CodingKey { | |
| 16848 | + case toDict = "to_dict" | |
| 16849 | + } | |
| 16850 | + | |
| 16851 | + init(toDict: Int) { | |
| 16852 | + self.toDict = toDict | |
| 16853 | + } | |
| 16854 | +} | |
| 16855 | + | |
| 16856 | +// MARK: ToDict convenience initializers and mutators | |
| 16857 | + | |
| 16858 | +extension ToDict { | |
| 16859 | + convenience init(data: Data) throws { | |
| 16860 | + let me = try newJSONDecoder().decode(ToDict.self, from: data) | |
| 16861 | + self.init(toDict: me.toDict) | |
| 16862 | + } | |
| 16863 | + | |
| 16864 | + convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 16865 | + guard let data = json.data(using: encoding) else { | |
| 16866 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 16867 | + } | |
| 16868 | + try self.init(data: data) | |
| 16869 | + } | |
| 16870 | + | |
| 16871 | + convenience init(fromURL url: URL) throws { | |
| 16872 | + try self.init(data: try Data(contentsOf: url)) | |
| 16873 | + } | |
| 16874 | + | |
| 16875 | + func with( | |
| 16876 | + toDict: Int? = nil | |
| 16877 | + ) -> ToDict { | |
| 16878 | + return ToDict( | |
| 16879 | + toDict: toDict ?? self.toDict | |
| 16880 | + ) | |
| 16881 | + } | |
| 16882 | + | |
| 16883 | + func jsonData() throws -> Data { | |
| 16884 | + return try newJSONEncoder().encode(self) | |
| 16885 | + } | |
| 16886 | + | |
| 16887 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 16888 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 16889 | + } | |
| 16890 | +} | |
| 16891 | + | |
| 16735 | 16892 | // MARK: - ToJSON |
| 16736 | 16893 | @objcMembers class ToJSON: NSObject, Codable { |
| 16737 | 16894 | let toJSON: Int |
| @@ -17418,25 +17575,25 @@ extension Union { | ||
| 17418 | 17575 | } |
| 17419 | 17576 | } |
| 17420 | 17577 | |
| 17421 | -// MARK: - Unsafe | |
| 17422 | -@objcMembers class Unsafe: NSObject, Codable { | |
| 17423 | - let unsafe: Int | |
| 17578 | +// MARK: - UnmarshalJSON | |
| 17579 | +@objcMembers class UnmarshalJSON: NSObject, Codable { | |
| 17580 | + let unmarshalJSON: Int | |
| 17424 | 17581 | |
| 17425 | 17582 | enum CodingKeys: String, CodingKey { |
| 17426 | - case unsafe = "unsafe" | |
| 17583 | + case unmarshalJSON = "UnmarshalJSON" | |
| 17427 | 17584 | } |
| 17428 | 17585 | |
| 17429 | - init(unsafe: Int) { | |
| 17430 | - self.unsafe = unsafe | |
| 17586 | + init(unmarshalJSON: Int) { | |
| 17587 | + self.unmarshalJSON = unmarshalJSON | |
| 17431 | 17588 | } |
| 17432 | 17589 | } |
| 17433 | 17590 | |
| 17434 | -// MARK: Unsafe convenience initializers and mutators | |
| 17591 | +// MARK: UnmarshalJSON convenience initializers and mutators | |
| 17435 | 17592 | |
| 17436 | -extension Unsafe { | |
| 17593 | +extension UnmarshalJSON { | |
| 17437 | 17594 | convenience init(data: Data) throws { |
| 17438 | - let me = try newJSONDecoder().decode(Unsafe.self, from: data) | |
| 17439 | - self.init(unsafe: me.unsafe) | |
| 17595 | + let me = try newJSONDecoder().decode(UnmarshalJSON.self, from: data) | |
| 17596 | + self.init(unmarshalJSON: me.unmarshalJSON) | |
| 17440 | 17597 | } |
| 17441 | 17598 | |
| 17442 | 17599 | convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws { |
| @@ -17451,10 +17608,10 @@ extension Unsafe { | ||
| 17451 | 17608 | } |
| 17452 | 17609 | |
| 17453 | 17610 | func with( |
| 17454 | - unsafe: Int? = nil | |
| 17455 | - ) -> Unsafe { | |
| 17456 | - return Unsafe( | |
| 17457 | - unsafe: unsafe ?? self.unsafe | |
| 17611 | + unmarshalJSON: Int? = nil | |
| 17612 | + ) -> UnmarshalJSON { | |
| 17613 | + return UnmarshalJSON( | |
| 17614 | + unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON | |
| 17458 | 17615 | ) |
| 17459 | 17616 | } |
| 17460 | 17617 | |
| @@ -17467,25 +17624,25 @@ extension Unsafe { | ||
| 17467 | 17624 | } |
| 17468 | 17625 | } |
| 17469 | 17626 | |
| 17470 | -// MARK: - Unsigned | |
| 17471 | -@objcMembers class Unsigned: NSObject, Codable { | |
| 17472 | - let unsigned: Int | |
| 17627 | +// MARK: - Unsafe | |
| 17628 | +@objcMembers class Unsafe: NSObject, Codable { | |
| 17629 | + let unsafe: Int | |
| 17473 | 17630 | |
| 17474 | 17631 | enum CodingKeys: String, CodingKey { |
| 17475 | - case unsigned = "unsigned" | |
| 17632 | + case unsafe = "unsafe" | |
| 17476 | 17633 | } |
| 17477 | 17634 | |
| 17478 | - init(unsigned: Int) { | |
| 17479 | - self.unsigned = unsigned | |
| 17635 | + init(unsafe: Int) { | |
| 17636 | + self.unsafe = unsafe | |
| 17480 | 17637 | } |
| 17481 | 17638 | } |
| 17482 | 17639 | |
| 17483 | -// MARK: Unsigned convenience initializers and mutators | |
| 17640 | +// MARK: Unsafe convenience initializers and mutators | |
| 17484 | 17641 | |
| 17485 | -extension Unsigned { | |
| 17642 | +extension Unsafe { | |
| 17486 | 17643 | convenience init(data: Data) throws { |
| 17487 | - let me = try newJSONDecoder().decode(Unsigned.self, from: data) | |
| 17488 | - self.init(unsigned: me.unsigned) | |
| 17644 | + let me = try newJSONDecoder().decode(Unsafe.self, from: data) | |
| 17645 | + self.init(unsafe: me.unsafe) | |
| 17489 | 17646 | } |
| 17490 | 17647 | |
| 17491 | 17648 | convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws { |
| @@ -17500,10 +17657,10 @@ extension Unsigned { | ||
| 17500 | 17657 | } |
| 17501 | 17658 | |
| 17502 | 17659 | func with( |
| 17503 | - unsigned: Int? = nil | |
| 17504 | - ) -> Unsigned { | |
| 17505 | - return Unsigned( | |
| 17506 | - unsigned: unsigned ?? self.unsigned | |
| 17660 | + unsafe: Int? = nil | |
| 17661 | + ) -> Unsafe { | |
| 17662 | + return Unsafe( | |
| 17663 | + unsafe: unsafe ?? self.unsafe | |
| 17507 | 17664 | ) |
| 17508 | 17665 | } |
| 17509 | 17666 | |
| @@ -17565,55 +17722,6 @@ extension UseSerializers { | ||
| 17565 | 17722 | } |
| 17566 | 17723 | } |
| 17567 | 17724 | |
| 17568 | -// MARK: - Ushort | |
| 17569 | -@objcMembers class Ushort: NSObject, Codable { | |
| 17570 | - let ushort: Int | |
| 17571 | - | |
| 17572 | - enum CodingKeys: String, CodingKey { | |
| 17573 | - case ushort = "ushort" | |
| 17574 | - } | |
| 17575 | - | |
| 17576 | - init(ushort: Int) { | |
| 17577 | - self.ushort = ushort | |
| 17578 | - } | |
| 17579 | -} | |
| 17580 | - | |
| 17581 | -// MARK: Ushort convenience initializers and mutators | |
| 17582 | - | |
| 17583 | -extension Ushort { | |
| 17584 | - convenience init(data: Data) throws { | |
| 17585 | - let me = try newJSONDecoder().decode(Ushort.self, from: data) | |
| 17586 | - self.init(ushort: me.ushort) | |
| 17587 | - } | |
| 17588 | - | |
| 17589 | - convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 17590 | - guard let data = json.data(using: encoding) else { | |
| 17591 | - throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 17592 | - } | |
| 17593 | - try self.init(data: data) | |
| 17594 | - } | |
| 17595 | - | |
| 17596 | - convenience init(fromURL url: URL) throws { | |
| 17597 | - try self.init(data: try Data(contentsOf: url)) | |
| 17598 | - } | |
| 17599 | - | |
| 17600 | - func with( | |
| 17601 | - ushort: Int? = nil | |
| 17602 | - ) -> Ushort { | |
| 17603 | - return Ushort( | |
| 17604 | - ushort: ushort ?? self.ushort | |
| 17605 | - ) | |
| 17606 | - } | |
| 17607 | - | |
| 17608 | - func jsonData() throws -> Data { | |
| 17609 | - return try newJSONEncoder().encode(self) | |
| 17610 | - } | |
| 17611 | - | |
| 17612 | - func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 17613 | - return String(data: try self.jsonData(), encoding: encoding) | |
| 17614 | - } | |
| 17615 | -} | |
| 17616 | - | |
| 17617 | 17725 | // MARK: - Obj6 |
| 17618 | 17726 | @objcMembers class Obj6: NSObject, Codable { |
| 17619 | 17727 | let dummy: Int |
| @@ -17622,6 +17730,8 @@ extension Ushort { | ||
| 17622 | 17730 | let obj6Where: Where |
| 17623 | 17731 | let obj6While: While |
| 17624 | 17732 | let obj6WillSet: WillSet |
| 17733 | + let unsigned: Unsigned | |
| 17734 | + let ushort: Ushort | |
| 17625 | 17735 | let using: Using |
| 17626 | 17736 | let utf8JSONReader: Utf8JSONReader |
| 17627 | 17737 | let utf8JSONWriter: Utf8JSONWriter |
| @@ -17643,6 +17753,8 @@ extension Ushort { | ||
| 17643 | 17753 | case obj6Where = "where" |
| 17644 | 17754 | case obj6While = "while" |
| 17645 | 17755 | case obj6WillSet = "willSet" |
| 17756 | + case unsigned = "unsigned" | |
| 17757 | + case ushort = "ushort" | |
| 17646 | 17758 | case using = "using" |
| 17647 | 17759 | case utf8JSONReader = "Utf8JsonReader" |
| 17648 | 17760 | case utf8JSONWriter = "Utf8JsonWriter" |
| @@ -17658,13 +17770,15 @@ extension Ushort { | ||
| 17658 | 17770 | case yield = "yield" |
| 17659 | 17771 | } |
| 17660 | 17772 | |
| 17661 | - init(dummy: Int, obj6Var: Var, obj6Weak: Weak, obj6Where: Where, obj6While: While, obj6WillSet: WillSet, using: Using, utf8JSONReader: Utf8JSONReader, utf8JSONWriter: Utf8JSONWriter, uuid: UUIDClass, virtual: Virtual, void: Void, volatile: Volatile, wcharT: WcharT, with: With, xor: Xor, xorEq: XorEq, yes: Yes, yield: Yield) { | |
| 17773 | + init(dummy: Int, obj6Var: Var, obj6Weak: Weak, obj6Where: Where, obj6While: While, obj6WillSet: WillSet, unsigned: Unsigned, ushort: Ushort, using: Using, utf8JSONReader: Utf8JSONReader, utf8JSONWriter: Utf8JSONWriter, uuid: UUIDClass, virtual: Virtual, void: Void, volatile: Volatile, wcharT: WcharT, with: With, xor: Xor, xorEq: XorEq, yes: Yes, yield: Yield) { | |
| 17662 | 17774 | self.dummy = dummy |
| 17663 | 17775 | self.obj6Var = obj6Var |
| 17664 | 17776 | self.obj6Weak = obj6Weak |
| 17665 | 17777 | self.obj6Where = obj6Where |
| 17666 | 17778 | self.obj6While = obj6While |
| 17667 | 17779 | self.obj6WillSet = obj6WillSet |
| 17780 | + self.unsigned = unsigned | |
| 17781 | + self.ushort = ushort | |
| 17668 | 17782 | self.using = using |
| 17669 | 17783 | self.utf8JSONReader = utf8JSONReader |
| 17670 | 17784 | self.utf8JSONWriter = utf8JSONWriter |
| @@ -17686,7 +17800,7 @@ extension Ushort { | ||
| 17686 | 17800 | extension Obj6 { |
| 17687 | 17801 | convenience init(data: Data) throws { |
| 17688 | 17802 | let me = try newJSONDecoder().decode(Obj6.self, from: data) |
| 17689 | - self.init(dummy: me.dummy, obj6Var: me.obj6Var, obj6Weak: me.obj6Weak, obj6Where: me.obj6Where, obj6While: me.obj6While, obj6WillSet: me.obj6WillSet, using: me.using, utf8JSONReader: me.utf8JSONReader, utf8JSONWriter: me.utf8JSONWriter, uuid: me.uuid, virtual: me.virtual, void: me.void, volatile: me.volatile, wcharT: me.wcharT, with: me.with, xor: me.xor, xorEq: me.xorEq, yes: me.yes, yield: me.yield) | |
| 17803 | + self.init(dummy: me.dummy, obj6Var: me.obj6Var, obj6Weak: me.obj6Weak, obj6Where: me.obj6Where, obj6While: me.obj6While, obj6WillSet: me.obj6WillSet, unsigned: me.unsigned, ushort: me.ushort, using: me.using, utf8JSONReader: me.utf8JSONReader, utf8JSONWriter: me.utf8JSONWriter, uuid: me.uuid, virtual: me.virtual, void: me.void, volatile: me.volatile, wcharT: me.wcharT, with: me.with, xor: me.xor, xorEq: me.xorEq, yes: me.yes, yield: me.yield) | |
| 17690 | 17804 | } |
| 17691 | 17805 | |
| 17692 | 17806 | convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws { |
| @@ -17707,6 +17821,8 @@ extension Obj6 { | ||
| 17707 | 17821 | obj6Where: Where? = nil, |
| 17708 | 17822 | obj6While: While? = nil, |
| 17709 | 17823 | obj6WillSet: WillSet? = nil, |
| 17824 | + unsigned: Unsigned? = nil, | |
| 17825 | + ushort: Ushort? = nil, | |
| 17710 | 17826 | using: Using? = nil, |
| 17711 | 17827 | utf8JSONReader: Utf8JSONReader? = nil, |
| 17712 | 17828 | utf8JSONWriter: Utf8JSONWriter? = nil, |
| @@ -17728,6 +17844,8 @@ extension Obj6 { | ||
| 17728 | 17844 | obj6Where: obj6Where ?? self.obj6Where, |
| 17729 | 17845 | obj6While: obj6While ?? self.obj6While, |
| 17730 | 17846 | obj6WillSet: obj6WillSet ?? self.obj6WillSet, |
| 17847 | + unsigned: unsigned ?? self.unsigned, | |
| 17848 | + ushort: ushort ?? self.ushort, | |
| 17731 | 17849 | using: using ?? self.using, |
| 17732 | 17850 | utf8JSONReader: utf8JSONReader ?? self.utf8JSONReader, |
| 17733 | 17851 | utf8JSONWriter: utf8JSONWriter ?? self.utf8JSONWriter, |
| @@ -17998,6 +18116,104 @@ extension WillSet { | ||
| 17998 | 18116 | } |
| 17999 | 18117 | } |
| 18000 | 18118 | |
| 18119 | +// MARK: - Unsigned | |
| 18120 | +@objcMembers class Unsigned: NSObject, Codable { | |
| 18121 | + let unsigned: Int | |
| 18122 | + | |
| 18123 | + enum CodingKeys: String, CodingKey { | |
| 18124 | + case unsigned = "unsigned" | |
| 18125 | + } | |
| 18126 | + | |
| 18127 | + init(unsigned: Int) { | |
| 18128 | + self.unsigned = unsigned | |
| 18129 | + } | |
| 18130 | +} | |
| 18131 | + | |
| 18132 | +// MARK: Unsigned convenience initializers and mutators | |
| 18133 | + | |
| 18134 | +extension Unsigned { | |
| 18135 | + convenience init(data: Data) throws { | |
| 18136 | + let me = try newJSONDecoder().decode(Unsigned.self, from: data) | |
| 18137 | + self.init(unsigned: me.unsigned) | |
| 18138 | + } | |
| 18139 | + | |
| 18140 | + convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 18141 | + guard let data = json.data(using: encoding) else { | |
| 18142 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 18143 | + } | |
| 18144 | + try self.init(data: data) | |
| 18145 | + } | |
| 18146 | + | |
| 18147 | + convenience init(fromURL url: URL) throws { | |
| 18148 | + try self.init(data: try Data(contentsOf: url)) | |
| 18149 | + } | |
| 18150 | + | |
| 18151 | + func with( | |
| 18152 | + unsigned: Int? = nil | |
| 18153 | + ) -> Unsigned { | |
| 18154 | + return Unsigned( | |
| 18155 | + unsigned: unsigned ?? self.unsigned | |
| 18156 | + ) | |
| 18157 | + } | |
| 18158 | + | |
| 18159 | + func jsonData() throws -> Data { | |
| 18160 | + return try newJSONEncoder().encode(self) | |
| 18161 | + } | |
| 18162 | + | |
| 18163 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 18164 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 18165 | + } | |
| 18166 | +} | |
| 18167 | + | |
| 18168 | +// MARK: - Ushort | |
| 18169 | +@objcMembers class Ushort: NSObject, Codable { | |
| 18170 | + let ushort: Int | |
| 18171 | + | |
| 18172 | + enum CodingKeys: String, CodingKey { | |
| 18173 | + case ushort = "ushort" | |
| 18174 | + } | |
| 18175 | + | |
| 18176 | + init(ushort: Int) { | |
| 18177 | + self.ushort = ushort | |
| 18178 | + } | |
| 18179 | +} | |
| 18180 | + | |
| 18181 | +// MARK: Ushort convenience initializers and mutators | |
| 18182 | + | |
| 18183 | +extension Ushort { | |
| 18184 | + convenience init(data: Data) throws { | |
| 18185 | + let me = try newJSONDecoder().decode(Ushort.self, from: data) | |
| 18186 | + self.init(ushort: me.ushort) | |
| 18187 | + } | |
| 18188 | + | |
| 18189 | + convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 18190 | + guard let data = json.data(using: encoding) else { | |
| 18191 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 18192 | + } | |
| 18193 | + try self.init(data: data) | |
| 18194 | + } | |
| 18195 | + | |
| 18196 | + convenience init(fromURL url: URL) throws { | |
| 18197 | + try self.init(data: try Data(contentsOf: url)) | |
| 18198 | + } | |
| 18199 | + | |
| 18200 | + func with( | |
| 18201 | + ushort: Int? = nil | |
| 18202 | + ) -> Ushort { | |
| 18203 | + return Ushort( | |
| 18204 | + ushort: ushort ?? self.ushort | |
| 18205 | + ) | |
| 18206 | + } | |
| 18207 | + | |
| 18208 | + func jsonData() throws -> Data { | |
| 18209 | + return try newJSONEncoder().encode(self) | |
| 18210 | + } | |
| 18211 | + | |
| 18212 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 18213 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 18214 | + } | |
| 18215 | +} | |
| 18216 | + | |
| 18001 | 18217 | // MARK: - Using |
| 18002 | 18218 | @objcMembers class Using: NSObject, Codable { |
| 18003 | 18219 | let using: Int |
Mswiftprotocol-equatable--bd9068f466c1 / quicktype.swift+466 −250
| @@ -3636,11 +3636,11 @@ struct Obj2: Codable, Equatable { | ||
| 3636 | 3636 | let formatException: FormatException |
| 3637 | 3637 | let friend: Friend |
| 3638 | 3638 | let from: From |
| 3639 | + let fromDict: FromDict | |
| 3639 | 3640 | let fromJSON: FromJSON |
| 3640 | 3641 | let function: Function |
| 3641 | 3642 | let global: Global |
| 3642 | 3643 | let go: Go |
| 3643 | - let goto: Goto | |
| 3644 | 3644 | let obj2Default: Default |
| 3645 | 3645 | let obj2Defer: Defer |
| 3646 | 3646 | let obj2Deinit: Deinit |
| @@ -3703,11 +3703,11 @@ struct Obj2: Codable, Equatable { | ||
| 3703 | 3703 | case formatException = "FormatException" |
| 3704 | 3704 | case friend = "friend" |
| 3705 | 3705 | case from = "from" |
| 3706 | + case fromDict = "from_dict" | |
| 3706 | 3707 | case fromJSON = "from_json" |
| 3707 | 3708 | case function = "function" |
| 3708 | 3709 | case global = "global" |
| 3709 | 3710 | case go = "go" |
| 3710 | - case goto = "goto" | |
| 3711 | 3711 | case obj2Default = "default" |
| 3712 | 3712 | case obj2Defer = "defer" |
| 3713 | 3713 | case obj2Deinit = "deinit" |
| @@ -3790,11 +3790,11 @@ extension Obj2 { | ||
| 3790 | 3790 | formatException: FormatException? = nil, |
| 3791 | 3791 | friend: Friend? = nil, |
| 3792 | 3792 | from: From? = nil, |
| 3793 | + fromDict: FromDict? = nil, | |
| 3793 | 3794 | fromJSON: FromJSON? = nil, |
| 3794 | 3795 | function: Function? = nil, |
| 3795 | 3796 | global: Global? = nil, |
| 3796 | 3797 | go: Go? = nil, |
| 3797 | - goto: Goto? = nil, | |
| 3798 | 3798 | obj2Default: Default? = nil, |
| 3799 | 3799 | obj2Defer: Defer? = nil, |
| 3800 | 3800 | obj2Deinit: Deinit? = nil, |
| @@ -3857,11 +3857,11 @@ extension Obj2 { | ||
| 3857 | 3857 | formatException: formatException ?? self.formatException, |
| 3858 | 3858 | friend: friend ?? self.friend, |
| 3859 | 3859 | from: from ?? self.from, |
| 3860 | + fromDict: fromDict ?? self.fromDict, | |
| 3860 | 3861 | fromJSON: fromJSON ?? self.fromJSON, |
| 3861 | 3862 | function: function ?? self.function, |
| 3862 | 3863 | global: global ?? self.global, |
| 3863 | 3864 | go: go ?? self.go, |
| 3864 | - goto: goto ?? self.goto, | |
| 3865 | 3865 | obj2Default: obj2Default ?? self.obj2Default, |
| 3866 | 3866 | obj2Defer: obj2Defer ?? self.obj2Defer, |
| 3867 | 3867 | obj2Deinit: obj2Deinit ?? self.obj2Deinit, |
| @@ -6002,6 +6002,56 @@ extension From { | ||
| 6002 | 6002 | // for types that require the use of JSONAny, nor will the implementation of Hashable be |
| 6003 | 6003 | // synthesized for types that have collections (such as arrays or dictionaries). |
| 6004 | 6004 | |
| 6005 | +// MARK: - FromDict | |
| 6006 | +struct FromDict: Codable, Equatable { | |
| 6007 | + let fromDict: Int | |
| 6008 | + | |
| 6009 | + enum CodingKeys: String, CodingKey { | |
| 6010 | + case fromDict = "from_dict" | |
| 6011 | + } | |
| 6012 | +} | |
| 6013 | + | |
| 6014 | +// MARK: FromDict convenience initializers and mutators | |
| 6015 | + | |
| 6016 | +extension FromDict { | |
| 6017 | + init(data: Data) throws { | |
| 6018 | + self = try newJSONDecoder().decode(FromDict.self, from: data) | |
| 6019 | + } | |
| 6020 | + | |
| 6021 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 6022 | + guard let data = json.data(using: encoding) else { | |
| 6023 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 6024 | + } | |
| 6025 | + try self.init(data: data) | |
| 6026 | + } | |
| 6027 | + | |
| 6028 | + init(fromURL url: URL) throws { | |
| 6029 | + try self.init(data: try Data(contentsOf: url)) | |
| 6030 | + } | |
| 6031 | + | |
| 6032 | + func with( | |
| 6033 | + fromDict: Int? = nil | |
| 6034 | + ) -> FromDict { | |
| 6035 | + return FromDict( | |
| 6036 | + fromDict: fromDict ?? self.fromDict | |
| 6037 | + ) | |
| 6038 | + } | |
| 6039 | + | |
| 6040 | + func jsonData() throws -> Data { | |
| 6041 | + return try newJSONEncoder().encode(self) | |
| 6042 | + } | |
| 6043 | + | |
| 6044 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 6045 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 6046 | + } | |
| 6047 | +} | |
| 6048 | + | |
| 6049 | +// | |
| 6050 | +// Hashable or Equatable: | |
| 6051 | +// The compiler will not be able to synthesize the implementation of Hashable or Equatable | |
| 6052 | +// for types that require the use of JSONAny, nor will the implementation of Hashable be | |
| 6053 | +// synthesized for types that have collections (such as arrays or dictionaries). | |
| 6054 | + | |
| 6005 | 6055 | // MARK: - FromJSON |
| 6006 | 6056 | struct FromJSON: Codable, Equatable { |
| 6007 | 6057 | let fromJSON: Int |
| @@ -6202,56 +6252,6 @@ extension Go { | ||
| 6202 | 6252 | // for types that require the use of JSONAny, nor will the implementation of Hashable be |
| 6203 | 6253 | // synthesized for types that have collections (such as arrays or dictionaries). |
| 6204 | 6254 | |
| 6205 | -// MARK: - Goto | |
| 6206 | -struct Goto: Codable, Equatable { | |
| 6207 | - let goto: Int | |
| 6208 | - | |
| 6209 | - enum CodingKeys: String, CodingKey { | |
| 6210 | - case goto = "goto" | |
| 6211 | - } | |
| 6212 | -} | |
| 6213 | - | |
| 6214 | -// MARK: Goto convenience initializers and mutators | |
| 6215 | - | |
| 6216 | -extension Goto { | |
| 6217 | - init(data: Data) throws { | |
| 6218 | - self = try newJSONDecoder().decode(Goto.self, from: data) | |
| 6219 | - } | |
| 6220 | - | |
| 6221 | - init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 6222 | - guard let data = json.data(using: encoding) else { | |
| 6223 | - throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 6224 | - } | |
| 6225 | - try self.init(data: data) | |
| 6226 | - } | |
| 6227 | - | |
| 6228 | - init(fromURL url: URL) throws { | |
| 6229 | - try self.init(data: try Data(contentsOf: url)) | |
| 6230 | - } | |
| 6231 | - | |
| 6232 | - func with( | |
| 6233 | - goto: Int? = nil | |
| 6234 | - ) -> Goto { | |
| 6235 | - return Goto( | |
| 6236 | - goto: goto ?? self.goto | |
| 6237 | - ) | |
| 6238 | - } | |
| 6239 | - | |
| 6240 | - func jsonData() throws -> Data { | |
| 6241 | - return try newJSONEncoder().encode(self) | |
| 6242 | - } | |
| 6243 | - | |
| 6244 | - func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 6245 | - return String(data: try self.jsonData(), encoding: encoding) | |
| 6246 | - } | |
| 6247 | -} | |
| 6248 | - | |
| 6249 | -// | |
| 6250 | -// Hashable or Equatable: | |
| 6251 | -// The compiler will not be able to synthesize the implementation of Hashable or Equatable | |
| 6252 | -// for types that require the use of JSONAny, nor will the implementation of Hashable be | |
| 6253 | -// synthesized for types that have collections (such as arrays or dictionaries). | |
| 6254 | - | |
| 6255 | 6255 | // MARK: - Default |
| 6256 | 6256 | struct Default: Codable, Equatable { |
| 6257 | 6257 | let defaultDefault: Int |
| @@ -7105,6 +7105,7 @@ extension FalseClass { | ||
| 7105 | 7105 | // MARK: - Obj3 |
| 7106 | 7106 | struct Obj3: Codable, Equatable { |
| 7107 | 7107 | let dummy: Int |
| 7108 | + let goto: Goto | |
| 7108 | 7109 | let hasOwnProperty: HasOwnProperty |
| 7109 | 7110 | let hashCode: HashCode |
| 7110 | 7111 | let hashable: HashableClass |
| @@ -7144,6 +7145,7 @@ struct Obj3: Codable, Equatable { | ||
| 7144 | 7145 | let long: Long |
| 7145 | 7146 | let map: Map |
| 7146 | 7147 | let mapEntry: MapEntry |
| 7148 | + let marshalJSON: MarshalJSON | |
| 7147 | 7149 | let metadataPropertyHandling: MetadataPropertyHandling |
| 7148 | 7150 | let module: Module |
| 7149 | 7151 | let mutable: Mutable |
| @@ -7152,7 +7154,6 @@ struct Obj3: Codable, Equatable { | ||
| 7152 | 7154 | let new: New |
| 7153 | 7155 | let newtonsoft: Newtonsoft |
| 7154 | 7156 | let no: No |
| 7155 | - let noexcept: Noexcept | |
| 7156 | 7157 | let obj3Guard: Guard |
| 7157 | 7158 | let obj3If: If |
| 7158 | 7159 | let obj3Import: Import |
| @@ -7172,6 +7173,7 @@ struct Obj3: Codable, Equatable { | ||
| 7172 | 7173 | |
| 7173 | 7174 | enum CodingKeys: String, CodingKey { |
| 7174 | 7175 | case dummy = "dummy" |
| 7176 | + case goto = "goto" | |
| 7175 | 7177 | case hasOwnProperty = "hasOwnProperty" |
| 7176 | 7178 | case hashCode = "hashCode" |
| 7177 | 7179 | case hashable = "Hashable" |
| @@ -7211,6 +7213,7 @@ struct Obj3: Codable, Equatable { | ||
| 7211 | 7213 | case long = "long" |
| 7212 | 7214 | case map = "map" |
| 7213 | 7215 | case mapEntry = "MapEntry" |
| 7216 | + case marshalJSON = "MarshalJSON" | |
| 7214 | 7217 | case metadataPropertyHandling = "metadata_property_handling" |
| 7215 | 7218 | case module = "module" |
| 7216 | 7219 | case mutable = "mutable" |
| @@ -7219,7 +7222,6 @@ struct Obj3: Codable, Equatable { | ||
| 7219 | 7222 | case new = "new" |
| 7220 | 7223 | case newtonsoft = "newtonsoft" |
| 7221 | 7224 | case no = "NO" |
| 7222 | - case noexcept = "noexcept" | |
| 7223 | 7225 | case obj3Guard = "guard" |
| 7224 | 7226 | case obj3If = "if" |
| 7225 | 7227 | case obj3Import = "import" |
| @@ -7259,6 +7261,7 @@ extension Obj3 { | ||
| 7259 | 7261 | |
| 7260 | 7262 | func with( |
| 7261 | 7263 | dummy: Int? = nil, |
| 7264 | + goto: Goto? = nil, | |
| 7262 | 7265 | hasOwnProperty: HasOwnProperty? = nil, |
| 7263 | 7266 | hashCode: HashCode? = nil, |
| 7264 | 7267 | hashable: HashableClass? = nil, |
| @@ -7298,6 +7301,7 @@ extension Obj3 { | ||
| 7298 | 7301 | long: Long? = nil, |
| 7299 | 7302 | map: Map? = nil, |
| 7300 | 7303 | mapEntry: MapEntry? = nil, |
| 7304 | + marshalJSON: MarshalJSON? = nil, | |
| 7301 | 7305 | metadataPropertyHandling: MetadataPropertyHandling? = nil, |
| 7302 | 7306 | module: Module? = nil, |
| 7303 | 7307 | mutable: Mutable? = nil, |
| @@ -7306,7 +7310,6 @@ extension Obj3 { | ||
| 7306 | 7310 | new: New? = nil, |
| 7307 | 7311 | newtonsoft: Newtonsoft? = nil, |
| 7308 | 7312 | no: No? = nil, |
| 7309 | - noexcept: Noexcept? = nil, | |
| 7310 | 7313 | obj3Guard: Guard? = nil, |
| 7311 | 7314 | obj3If: If? = nil, |
| 7312 | 7315 | obj3Import: Import? = nil, |
| @@ -7326,6 +7329,7 @@ extension Obj3 { | ||
| 7326 | 7329 | ) -> Obj3 { |
| 7327 | 7330 | return Obj3( |
| 7328 | 7331 | dummy: dummy ?? self.dummy, |
| 7332 | + goto: goto ?? self.goto, | |
| 7329 | 7333 | hasOwnProperty: hasOwnProperty ?? self.hasOwnProperty, |
| 7330 | 7334 | hashCode: hashCode ?? self.hashCode, |
| 7331 | 7335 | hashable: hashable ?? self.hashable, |
| @@ -7365,6 +7369,7 @@ extension Obj3 { | ||
| 7365 | 7369 | long: long ?? self.long, |
| 7366 | 7370 | map: map ?? self.map, |
| 7367 | 7371 | mapEntry: mapEntry ?? self.mapEntry, |
| 7372 | + marshalJSON: marshalJSON ?? self.marshalJSON, | |
| 7368 | 7373 | metadataPropertyHandling: metadataPropertyHandling ?? self.metadataPropertyHandling, |
| 7369 | 7374 | module: module ?? self.module, |
| 7370 | 7375 | mutable: mutable ?? self.mutable, |
| @@ -7373,7 +7378,6 @@ extension Obj3 { | ||
| 7373 | 7378 | new: new ?? self.new, |
| 7374 | 7379 | newtonsoft: newtonsoft ?? self.newtonsoft, |
| 7375 | 7380 | no: no ?? self.no, |
| 7376 | - noexcept: noexcept ?? self.noexcept, | |
| 7377 | 7381 | obj3Guard: obj3Guard ?? self.obj3Guard, |
| 7378 | 7382 | obj3If: obj3If ?? self.obj3If, |
| 7379 | 7383 | obj3Import: obj3Import ?? self.obj3Import, |
| @@ -7408,6 +7412,56 @@ extension Obj3 { | ||
| 7408 | 7412 | // for types that require the use of JSONAny, nor will the implementation of Hashable be |
| 7409 | 7413 | // synthesized for types that have collections (such as arrays or dictionaries). |
| 7410 | 7414 | |
| 7415 | +// MARK: - Goto | |
| 7416 | +struct Goto: Codable, Equatable { | |
| 7417 | + let goto: Int | |
| 7418 | + | |
| 7419 | + enum CodingKeys: String, CodingKey { | |
| 7420 | + case goto = "goto" | |
| 7421 | + } | |
| 7422 | +} | |
| 7423 | + | |
| 7424 | +// MARK: Goto convenience initializers and mutators | |
| 7425 | + | |
| 7426 | +extension Goto { | |
| 7427 | + init(data: Data) throws { | |
| 7428 | + self = try newJSONDecoder().decode(Goto.self, from: data) | |
| 7429 | + } | |
| 7430 | + | |
| 7431 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 7432 | + guard let data = json.data(using: encoding) else { | |
| 7433 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 7434 | + } | |
| 7435 | + try self.init(data: data) | |
| 7436 | + } | |
| 7437 | + | |
| 7438 | + init(fromURL url: URL) throws { | |
| 7439 | + try self.init(data: try Data(contentsOf: url)) | |
| 7440 | + } | |
| 7441 | + | |
| 7442 | + func with( | |
| 7443 | + goto: Int? = nil | |
| 7444 | + ) -> Goto { | |
| 7445 | + return Goto( | |
| 7446 | + goto: goto ?? self.goto | |
| 7447 | + ) | |
| 7448 | + } | |
| 7449 | + | |
| 7450 | + func jsonData() throws -> Data { | |
| 7451 | + return try newJSONEncoder().encode(self) | |
| 7452 | + } | |
| 7453 | + | |
| 7454 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 7455 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 7456 | + } | |
| 7457 | +} | |
| 7458 | + | |
| 7459 | +// | |
| 7460 | +// Hashable or Equatable: | |
| 7461 | +// The compiler will not be able to synthesize the implementation of Hashable or Equatable | |
| 7462 | +// for types that require the use of JSONAny, nor will the implementation of Hashable be | |
| 7463 | +// synthesized for types that have collections (such as arrays or dictionaries). | |
| 7464 | + | |
| 7411 | 7465 | // MARK: - HasOwnProperty |
| 7412 | 7466 | struct HasOwnProperty: Codable, Equatable { |
| 7413 | 7467 | let hasOwnProperty: Int |
| @@ -9358,6 +9412,56 @@ extension MapEntry { | ||
| 9358 | 9412 | // for types that require the use of JSONAny, nor will the implementation of Hashable be |
| 9359 | 9413 | // synthesized for types that have collections (such as arrays or dictionaries). |
| 9360 | 9414 | |
| 9415 | +// MARK: - MarshalJSON | |
| 9416 | +struct MarshalJSON: Codable, Equatable { | |
| 9417 | + let marshalJSON: Int | |
| 9418 | + | |
| 9419 | + enum CodingKeys: String, CodingKey { | |
| 9420 | + case marshalJSON = "MarshalJSON" | |
| 9421 | + } | |
| 9422 | +} | |
| 9423 | + | |
| 9424 | +// MARK: MarshalJSON convenience initializers and mutators | |
| 9425 | + | |
| 9426 | +extension MarshalJSON { | |
| 9427 | + init(data: Data) throws { | |
| 9428 | + self = try newJSONDecoder().decode(MarshalJSON.self, from: data) | |
| 9429 | + } | |
| 9430 | + | |
| 9431 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 9432 | + guard let data = json.data(using: encoding) else { | |
| 9433 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 9434 | + } | |
| 9435 | + try self.init(data: data) | |
| 9436 | + } | |
| 9437 | + | |
| 9438 | + init(fromURL url: URL) throws { | |
| 9439 | + try self.init(data: try Data(contentsOf: url)) | |
| 9440 | + } | |
| 9441 | + | |
| 9442 | + func with( | |
| 9443 | + marshalJSON: Int? = nil | |
| 9444 | + ) -> MarshalJSON { | |
| 9445 | + return MarshalJSON( | |
| 9446 | + marshalJSON: marshalJSON ?? self.marshalJSON | |
| 9447 | + ) | |
| 9448 | + } | |
| 9449 | + | |
| 9450 | + func jsonData() throws -> Data { | |
| 9451 | + return try newJSONEncoder().encode(self) | |
| 9452 | + } | |
| 9453 | + | |
| 9454 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 9455 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 9456 | + } | |
| 9457 | +} | |
| 9458 | + | |
| 9459 | +// | |
| 9460 | +// Hashable or Equatable: | |
| 9461 | +// The compiler will not be able to synthesize the implementation of Hashable or Equatable | |
| 9462 | +// for types that require the use of JSONAny, nor will the implementation of Hashable be | |
| 9463 | +// synthesized for types that have collections (such as arrays or dictionaries). | |
| 9464 | + | |
| 9361 | 9465 | // MARK: - MetadataPropertyHandling |
| 9362 | 9466 | struct MetadataPropertyHandling: Codable, Equatable { |
| 9363 | 9467 | let metadataPropertyHandling: Int |
| @@ -9758,56 +9862,6 @@ extension No { | ||
| 9758 | 9862 | // for types that require the use of JSONAny, nor will the implementation of Hashable be |
| 9759 | 9863 | // synthesized for types that have collections (such as arrays or dictionaries). |
| 9760 | 9864 | |
| 9761 | -// MARK: - Noexcept | |
| 9762 | -struct Noexcept: Codable, Equatable { | |
| 9763 | - let noexcept: Int | |
| 9764 | - | |
| 9765 | - enum CodingKeys: String, CodingKey { | |
| 9766 | - case noexcept = "noexcept" | |
| 9767 | - } | |
| 9768 | -} | |
| 9769 | - | |
| 9770 | -// MARK: Noexcept convenience initializers and mutators | |
| 9771 | - | |
| 9772 | -extension Noexcept { | |
| 9773 | - init(data: Data) throws { | |
| 9774 | - self = try newJSONDecoder().decode(Noexcept.self, from: data) | |
| 9775 | - } | |
| 9776 | - | |
| 9777 | - init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 9778 | - guard let data = json.data(using: encoding) else { | |
| 9779 | - throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 9780 | - } | |
| 9781 | - try self.init(data: data) | |
| 9782 | - } | |
| 9783 | - | |
| 9784 | - init(fromURL url: URL) throws { | |
| 9785 | - try self.init(data: try Data(contentsOf: url)) | |
| 9786 | - } | |
| 9787 | - | |
| 9788 | - func with( | |
| 9789 | - noexcept: Int? = nil | |
| 9790 | - ) -> Noexcept { | |
| 9791 | - return Noexcept( | |
| 9792 | - noexcept: noexcept ?? self.noexcept | |
| 9793 | - ) | |
| 9794 | - } | |
| 9795 | - | |
| 9796 | - func jsonData() throws -> Data { | |
| 9797 | - return try newJSONEncoder().encode(self) | |
| 9798 | - } | |
| 9799 | - | |
| 9800 | - func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 9801 | - return String(data: try self.jsonData(), encoding: encoding) | |
| 9802 | - } | |
| 9803 | -} | |
| 9804 | - | |
| 9805 | -// | |
| 9806 | -// Hashable or Equatable: | |
| 9807 | -// The compiler will not be able to synthesize the implementation of Hashable or Equatable | |
| 9808 | -// for types that require the use of JSONAny, nor will the implementation of Hashable be | |
| 9809 | -// synthesized for types that have collections (such as arrays or dictionaries). | |
| 9810 | - | |
| 9811 | 9865 | // MARK: - Guard |
| 9812 | 9866 | struct Guard: Codable, Equatable { |
| 9813 | 9867 | let guardGuard: Int |
| @@ -10612,6 +10666,7 @@ extension Nil { | ||
| 10612 | 10666 | struct Obj4: Codable, Equatable { |
| 10613 | 10667 | let dummy: Int |
| 10614 | 10668 | let noSuchMethod: NoSuchMethod |
| 10669 | + let noexcept: Noexcept | |
| 10615 | 10670 | let nonatomic: Nonatomic |
| 10616 | 10671 | let none: None |
| 10617 | 10672 | let nonlocal: Nonlocal |
| @@ -10674,11 +10729,11 @@ struct Obj4: Codable, Equatable { | ||
| 10674 | 10729 | let sbyte: Sbyte |
| 10675 | 10730 | let sealed: Sealed |
| 10676 | 10731 | let sel: Sel |
| 10677 | - let select: Select | |
| 10678 | 10732 | |
| 10679 | 10733 | enum CodingKeys: String, CodingKey { |
| 10680 | 10734 | case dummy = "dummy" |
| 10681 | 10735 | case noSuchMethod = "noSuchMethod" |
| 10736 | + case noexcept = "noexcept" | |
| 10682 | 10737 | case nonatomic = "nonatomic" |
| 10683 | 10738 | case none = "None" |
| 10684 | 10739 | case nonlocal = "nonlocal" |
| @@ -10741,7 +10796,6 @@ struct Obj4: Codable, Equatable { | ||
| 10741 | 10796 | case sbyte = "sbyte" |
| 10742 | 10797 | case sealed = "sealed" |
| 10743 | 10798 | case sel = "SEL" |
| 10744 | - case select = "select" | |
| 10745 | 10799 | } |
| 10746 | 10800 | } |
| 10747 | 10801 | |
| @@ -10766,6 +10820,7 @@ extension Obj4 { | ||
| 10766 | 10820 | func with( |
| 10767 | 10821 | dummy: Int? = nil, |
| 10768 | 10822 | noSuchMethod: NoSuchMethod? = nil, |
| 10823 | + noexcept: Noexcept? = nil, | |
| 10769 | 10824 | nonatomic: Nonatomic? = nil, |
| 10770 | 10825 | none: None? = nil, |
| 10771 | 10826 | nonlocal: Nonlocal? = nil, |
| @@ -10827,12 +10882,12 @@ extension Obj4 { | ||
| 10827 | 10882 | s: S? = nil, |
| 10828 | 10883 | sbyte: Sbyte? = nil, |
| 10829 | 10884 | sealed: Sealed? = nil, |
| 10830 | - sel: Sel? = nil, | |
| 10831 | - select: Select? = nil | |
| 10885 | + sel: Sel? = nil | |
| 10832 | 10886 | ) -> Obj4 { |
| 10833 | 10887 | return Obj4( |
| 10834 | 10888 | dummy: dummy ?? self.dummy, |
| 10835 | 10889 | noSuchMethod: noSuchMethod ?? self.noSuchMethod, |
| 10890 | + noexcept: noexcept ?? self.noexcept, | |
| 10836 | 10891 | nonatomic: nonatomic ?? self.nonatomic, |
| 10837 | 10892 | none: none ?? self.none, |
| 10838 | 10893 | nonlocal: nonlocal ?? self.nonlocal, |
| @@ -10894,8 +10949,7 @@ extension Obj4 { | ||
| 10894 | 10949 | s: s ?? self.s, |
| 10895 | 10950 | sbyte: sbyte ?? self.sbyte, |
| 10896 | 10951 | sealed: sealed ?? self.sealed, |
| 10897 | - sel: sel ?? self.sel, | |
| 10898 | - select: select ?? self.select | |
| 10952 | + sel: sel ?? self.sel | |
| 10899 | 10953 | ) |
| 10900 | 10954 | } |
| 10901 | 10955 | |
| @@ -10964,12 +11018,62 @@ extension NoSuchMethod { | ||
| 10964 | 11018 | // for types that require the use of JSONAny, nor will the implementation of Hashable be |
| 10965 | 11019 | // synthesized for types that have collections (such as arrays or dictionaries). |
| 10966 | 11020 | |
| 10967 | -// MARK: - Nonatomic | |
| 10968 | -struct Nonatomic: Codable, Equatable { | |
| 10969 | - let nonatomic: Int | |
| 11021 | +// MARK: - Noexcept | |
| 11022 | +struct Noexcept: Codable, Equatable { | |
| 11023 | + let noexcept: Int | |
| 10970 | 11024 | |
| 10971 | 11025 | enum CodingKeys: String, CodingKey { |
| 10972 | - case nonatomic = "nonatomic" | |
| 11026 | + case noexcept = "noexcept" | |
| 11027 | + } | |
| 11028 | +} | |
| 11029 | + | |
| 11030 | +// MARK: Noexcept convenience initializers and mutators | |
| 11031 | + | |
| 11032 | +extension Noexcept { | |
| 11033 | + init(data: Data) throws { | |
| 11034 | + self = try newJSONDecoder().decode(Noexcept.self, from: data) | |
| 11035 | + } | |
| 11036 | + | |
| 11037 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 11038 | + guard let data = json.data(using: encoding) else { | |
| 11039 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 11040 | + } | |
| 11041 | + try self.init(data: data) | |
| 11042 | + } | |
| 11043 | + | |
| 11044 | + init(fromURL url: URL) throws { | |
| 11045 | + try self.init(data: try Data(contentsOf: url)) | |
| 11046 | + } | |
| 11047 | + | |
| 11048 | + func with( | |
| 11049 | + noexcept: Int? = nil | |
| 11050 | + ) -> Noexcept { | |
| 11051 | + return Noexcept( | |
| 11052 | + noexcept: noexcept ?? self.noexcept | |
| 11053 | + ) | |
| 11054 | + } | |
| 11055 | + | |
| 11056 | + func jsonData() throws -> Data { | |
| 11057 | + return try newJSONEncoder().encode(self) | |
| 11058 | + } | |
| 11059 | + | |
| 11060 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 11061 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 11062 | + } | |
| 11063 | +} | |
| 11064 | + | |
| 11065 | +// | |
| 11066 | +// Hashable or Equatable: | |
| 11067 | +// The compiler will not be able to synthesize the implementation of Hashable or Equatable | |
| 11068 | +// for types that require the use of JSONAny, nor will the implementation of Hashable be | |
| 11069 | +// synthesized for types that have collections (such as arrays or dictionaries). | |
| 11070 | + | |
| 11071 | +// MARK: - Nonatomic | |
| 11072 | +struct Nonatomic: Codable, Equatable { | |
| 11073 | + let nonatomic: Int | |
| 11074 | + | |
| 11075 | + enum CodingKeys: String, CodingKey { | |
| 11076 | + case nonatomic = "nonatomic" | |
| 10973 | 11077 | } |
| 10974 | 11078 | } |
| 10975 | 11079 | |
| @@ -14064,56 +14168,6 @@ extension Sel { | ||
| 14064 | 14168 | // for types that require the use of JSONAny, nor will the implementation of Hashable be |
| 14065 | 14169 | // synthesized for types that have collections (such as arrays or dictionaries). |
| 14066 | 14170 | |
| 14067 | -// MARK: - Select | |
| 14068 | -struct Select: Codable, Equatable { | |
| 14069 | - let select: Int | |
| 14070 | - | |
| 14071 | - enum CodingKeys: String, CodingKey { | |
| 14072 | - case select = "select" | |
| 14073 | - } | |
| 14074 | -} | |
| 14075 | - | |
| 14076 | -// MARK: Select convenience initializers and mutators | |
| 14077 | - | |
| 14078 | -extension Select { | |
| 14079 | - init(data: Data) throws { | |
| 14080 | - self = try newJSONDecoder().decode(Select.self, from: data) | |
| 14081 | - } | |
| 14082 | - | |
| 14083 | - init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 14084 | - guard let data = json.data(using: encoding) else { | |
| 14085 | - throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 14086 | - } | |
| 14087 | - try self.init(data: data) | |
| 14088 | - } | |
| 14089 | - | |
| 14090 | - init(fromURL url: URL) throws { | |
| 14091 | - try self.init(data: try Data(contentsOf: url)) | |
| 14092 | - } | |
| 14093 | - | |
| 14094 | - func with( | |
| 14095 | - select: Int? = nil | |
| 14096 | - ) -> Select { | |
| 14097 | - return Select( | |
| 14098 | - select: select ?? self.select | |
| 14099 | - ) | |
| 14100 | - } | |
| 14101 | - | |
| 14102 | - func jsonData() throws -> Data { | |
| 14103 | - return try newJSONEncoder().encode(self) | |
| 14104 | - } | |
| 14105 | - | |
| 14106 | - func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 14107 | - return String(data: try self.jsonData(), encoding: encoding) | |
| 14108 | - } | |
| 14109 | -} | |
| 14110 | - | |
| 14111 | -// | |
| 14112 | -// Hashable or Equatable: | |
| 14113 | -// The compiler will not be able to synthesize the implementation of Hashable or Equatable | |
| 14114 | -// for types that require the use of JSONAny, nor will the implementation of Hashable be | |
| 14115 | -// synthesized for types that have collections (such as arrays or dictionaries). | |
| 14116 | - | |
| 14117 | 14171 | // MARK: - Obj5 |
| 14118 | 14172 | struct Obj5: Codable, Equatable { |
| 14119 | 14173 | let dummy: Int |
| @@ -14135,6 +14189,7 @@ struct Obj5: Codable, Equatable { | ||
| 14135 | 14189 | let primitiveKind: PrimitiveKind |
| 14136 | 14190 | let purpleSelf: Obj5Self |
| 14137 | 14191 | let purpleTrue: TrueClass |
| 14192 | + let select: Select | |
| 14138 | 14193 | let sendable: Sendable |
| 14139 | 14194 | let serialDescriptor: SerialDescriptor |
| 14140 | 14195 | let serialName: SerialName |
| @@ -14163,6 +14218,7 @@ struct Obj5: Codable, Equatable { | ||
| 14163 | 14218 | let timeOnly: TimeOnly |
| 14164 | 14219 | let timeOnlyConverter: TimeOnlyConverter |
| 14165 | 14220 | let timeZone: TimeZoneClass |
| 14221 | + let toDict: ToDict | |
| 14166 | 14222 | let toJSON: ToJSON |
| 14167 | 14223 | let toString: ToString |
| 14168 | 14224 | let topLevel: TopLevelClass |
| @@ -14177,10 +14233,9 @@ struct Obj5: Codable, Equatable { | ||
| 14177 | 14233 | let unchecked: Unchecked |
| 14178 | 14234 | let undefined: Undefined |
| 14179 | 14235 | let union: Union |
| 14236 | + let unmarshalJSON: UnmarshalJSON | |
| 14180 | 14237 | let unsafe: Unsafe |
| 14181 | - let unsigned: Unsigned | |
| 14182 | 14238 | let useSerializers: UseSerializers |
| 14183 | - let ushort: Ushort | |
| 14184 | 14239 | |
| 14185 | 14240 | enum CodingKeys: String, CodingKey { |
| 14186 | 14241 | case dummy = "dummy" |
| @@ -14202,6 +14257,7 @@ struct Obj5: Codable, Equatable { | ||
| 14202 | 14257 | case primitiveKind = "PrimitiveKind" |
| 14203 | 14258 | case purpleSelf = "self" |
| 14204 | 14259 | case purpleTrue = "true" |
| 14260 | + case select = "select" | |
| 14205 | 14261 | case sendable = "Sendable" |
| 14206 | 14262 | case serialDescriptor = "SerialDescriptor" |
| 14207 | 14263 | case serialName = "SerialName" |
| @@ -14230,6 +14286,7 @@ struct Obj5: Codable, Equatable { | ||
| 14230 | 14286 | case timeOnly = "TimeOnly" |
| 14231 | 14287 | case timeOnlyConverter = "TimeOnlyConverter" |
| 14232 | 14288 | case timeZone = "TimeZone" |
| 14289 | + case toDict = "to_dict" | |
| 14233 | 14290 | case toJSON = "to_json" |
| 14234 | 14291 | case toString = "toString" |
| 14235 | 14292 | case topLevel = "top_level" |
| @@ -14244,10 +14301,9 @@ struct Obj5: Codable, Equatable { | ||
| 14244 | 14301 | case unchecked = "unchecked" |
| 14245 | 14302 | case undefined = "undefined" |
| 14246 | 14303 | case union = "union" |
| 14304 | + case unmarshalJSON = "UnmarshalJSON" | |
| 14247 | 14305 | case unsafe = "unsafe" |
| 14248 | - case unsigned = "unsigned" | |
| 14249 | 14306 | case useSerializers = "UseSerializers" |
| 14250 | - case ushort = "ushort" | |
| 14251 | 14307 | } |
| 14252 | 14308 | } |
| 14253 | 14309 | |
| @@ -14289,6 +14345,7 @@ extension Obj5 { | ||
| 14289 | 14345 | primitiveKind: PrimitiveKind? = nil, |
| 14290 | 14346 | purpleSelf: Obj5Self? = nil, |
| 14291 | 14347 | purpleTrue: TrueClass? = nil, |
| 14348 | + select: Select? = nil, | |
| 14292 | 14349 | sendable: Sendable? = nil, |
| 14293 | 14350 | serialDescriptor: SerialDescriptor? = nil, |
| 14294 | 14351 | serialName: SerialName? = nil, |
| @@ -14317,6 +14374,7 @@ extension Obj5 { | ||
| 14317 | 14374 | timeOnly: TimeOnly? = nil, |
| 14318 | 14375 | timeOnlyConverter: TimeOnlyConverter? = nil, |
| 14319 | 14376 | timeZone: TimeZoneClass? = nil, |
| 14377 | + toDict: ToDict? = nil, | |
| 14320 | 14378 | toJSON: ToJSON? = nil, |
| 14321 | 14379 | toString: ToString? = nil, |
| 14322 | 14380 | topLevel: TopLevelClass? = nil, |
| @@ -14331,10 +14389,9 @@ extension Obj5 { | ||
| 14331 | 14389 | unchecked: Unchecked? = nil, |
| 14332 | 14390 | undefined: Undefined? = nil, |
| 14333 | 14391 | union: Union? = nil, |
| 14392 | + unmarshalJSON: UnmarshalJSON? = nil, | |
| 14334 | 14393 | unsafe: Unsafe? = nil, |
| 14335 | - unsigned: Unsigned? = nil, | |
| 14336 | - useSerializers: UseSerializers? = nil, | |
| 14337 | - ushort: Ushort? = nil | |
| 14394 | + useSerializers: UseSerializers? = nil | |
| 14338 | 14395 | ) -> Obj5 { |
| 14339 | 14396 | return Obj5( |
| 14340 | 14397 | dummy: dummy ?? self.dummy, |
| @@ -14356,6 +14413,7 @@ extension Obj5 { | ||
| 14356 | 14413 | primitiveKind: primitiveKind ?? self.primitiveKind, |
| 14357 | 14414 | purpleSelf: purpleSelf ?? self.purpleSelf, |
| 14358 | 14415 | purpleTrue: purpleTrue ?? self.purpleTrue, |
| 14416 | + select: select ?? self.select, | |
| 14359 | 14417 | sendable: sendable ?? self.sendable, |
| 14360 | 14418 | serialDescriptor: serialDescriptor ?? self.serialDescriptor, |
| 14361 | 14419 | serialName: serialName ?? self.serialName, |
| @@ -14384,6 +14442,7 @@ extension Obj5 { | ||
| 14384 | 14442 | timeOnly: timeOnly ?? self.timeOnly, |
| 14385 | 14443 | timeOnlyConverter: timeOnlyConverter ?? self.timeOnlyConverter, |
| 14386 | 14444 | timeZone: timeZone ?? self.timeZone, |
| 14445 | + toDict: toDict ?? self.toDict, | |
| 14387 | 14446 | toJSON: toJSON ?? self.toJSON, |
| 14388 | 14447 | toString: toString ?? self.toString, |
| 14389 | 14448 | topLevel: topLevel ?? self.topLevel, |
| @@ -14398,10 +14457,9 @@ extension Obj5 { | ||
| 14398 | 14457 | unchecked: unchecked ?? self.unchecked, |
| 14399 | 14458 | undefined: undefined ?? self.undefined, |
| 14400 | 14459 | union: union ?? self.union, |
| 14460 | + unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON, | |
| 14401 | 14461 | unsafe: unsafe ?? self.unsafe, |
| 14402 | - unsigned: unsigned ?? self.unsigned, | |
| 14403 | - useSerializers: useSerializers ?? self.useSerializers, | |
| 14404 | - ushort: ushort ?? self.ushort | |
| 14462 | + useSerializers: useSerializers ?? self.useSerializers | |
| 14405 | 14463 | ) |
| 14406 | 14464 | } |
| 14407 | 14465 | |
| @@ -15320,6 +15378,56 @@ extension TrueClass { | ||
| 15320 | 15378 | // for types that require the use of JSONAny, nor will the implementation of Hashable be |
| 15321 | 15379 | // synthesized for types that have collections (such as arrays or dictionaries). |
| 15322 | 15380 | |
| 15381 | +// MARK: - Select | |
| 15382 | +struct Select: Codable, Equatable { | |
| 15383 | + let select: Int | |
| 15384 | + | |
| 15385 | + enum CodingKeys: String, CodingKey { | |
| 15386 | + case select = "select" | |
| 15387 | + } | |
| 15388 | +} | |
| 15389 | + | |
| 15390 | +// MARK: Select convenience initializers and mutators | |
| 15391 | + | |
| 15392 | +extension Select { | |
| 15393 | + init(data: Data) throws { | |
| 15394 | + self = try newJSONDecoder().decode(Select.self, from: data) | |
| 15395 | + } | |
| 15396 | + | |
| 15397 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 15398 | + guard let data = json.data(using: encoding) else { | |
| 15399 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 15400 | + } | |
| 15401 | + try self.init(data: data) | |
| 15402 | + } | |
| 15403 | + | |
| 15404 | + init(fromURL url: URL) throws { | |
| 15405 | + try self.init(data: try Data(contentsOf: url)) | |
| 15406 | + } | |
| 15407 | + | |
| 15408 | + func with( | |
| 15409 | + select: Int? = nil | |
| 15410 | + ) -> Select { | |
| 15411 | + return Select( | |
| 15412 | + select: select ?? self.select | |
| 15413 | + ) | |
| 15414 | + } | |
| 15415 | + | |
| 15416 | + func jsonData() throws -> Data { | |
| 15417 | + return try newJSONEncoder().encode(self) | |
| 15418 | + } | |
| 15419 | + | |
| 15420 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 15421 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 15422 | + } | |
| 15423 | +} | |
| 15424 | + | |
| 15425 | +// | |
| 15426 | +// Hashable or Equatable: | |
| 15427 | +// The compiler will not be able to synthesize the implementation of Hashable or Equatable | |
| 15428 | +// for types that require the use of JSONAny, nor will the implementation of Hashable be | |
| 15429 | +// synthesized for types that have collections (such as arrays or dictionaries). | |
| 15430 | + | |
| 15323 | 15431 | // MARK: - Sendable |
| 15324 | 15432 | struct Sendable: Codable, Equatable { |
| 15325 | 15433 | let sendable: Int |
| @@ -16720,6 +16828,56 @@ extension TimeZoneClass { | ||
| 16720 | 16828 | // for types that require the use of JSONAny, nor will the implementation of Hashable be |
| 16721 | 16829 | // synthesized for types that have collections (such as arrays or dictionaries). |
| 16722 | 16830 | |
| 16831 | +// MARK: - ToDict | |
| 16832 | +struct ToDict: Codable, Equatable { | |
| 16833 | + let toDict: Int | |
| 16834 | + | |
| 16835 | + enum CodingKeys: String, CodingKey { | |
| 16836 | + case toDict = "to_dict" | |
| 16837 | + } | |
| 16838 | +} | |
| 16839 | + | |
| 16840 | +// MARK: ToDict convenience initializers and mutators | |
| 16841 | + | |
| 16842 | +extension ToDict { | |
| 16843 | + init(data: Data) throws { | |
| 16844 | + self = try newJSONDecoder().decode(ToDict.self, from: data) | |
| 16845 | + } | |
| 16846 | + | |
| 16847 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 16848 | + guard let data = json.data(using: encoding) else { | |
| 16849 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 16850 | + } | |
| 16851 | + try self.init(data: data) | |
| 16852 | + } | |
| 16853 | + | |
| 16854 | + init(fromURL url: URL) throws { | |
| 16855 | + try self.init(data: try Data(contentsOf: url)) | |
| 16856 | + } | |
| 16857 | + | |
| 16858 | + func with( | |
| 16859 | + toDict: Int? = nil | |
| 16860 | + ) -> ToDict { | |
| 16861 | + return ToDict( | |
| 16862 | + toDict: toDict ?? self.toDict | |
| 16863 | + ) | |
| 16864 | + } | |
| 16865 | + | |
| 16866 | + func jsonData() throws -> Data { | |
| 16867 | + return try newJSONEncoder().encode(self) | |
| 16868 | + } | |
| 16869 | + | |
| 16870 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 16871 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 16872 | + } | |
| 16873 | +} | |
| 16874 | + | |
| 16875 | +// | |
| 16876 | +// Hashable or Equatable: | |
| 16877 | +// The compiler will not be able to synthesize the implementation of Hashable or Equatable | |
| 16878 | +// for types that require the use of JSONAny, nor will the implementation of Hashable be | |
| 16879 | +// synthesized for types that have collections (such as arrays or dictionaries). | |
| 16880 | + | |
| 16723 | 16881 | // MARK: - ToJSON |
| 16724 | 16882 | struct ToJSON: Codable, Equatable { |
| 16725 | 16883 | let toJSON: Int |
| @@ -17420,20 +17578,20 @@ extension Union { | ||
| 17420 | 17578 | // for types that require the use of JSONAny, nor will the implementation of Hashable be |
| 17421 | 17579 | // synthesized for types that have collections (such as arrays or dictionaries). |
| 17422 | 17580 | |
| 17423 | -// MARK: - Unsafe | |
| 17424 | -struct Unsafe: Codable, Equatable { | |
| 17425 | - let unsafe: Int | |
| 17581 | +// MARK: - UnmarshalJSON | |
| 17582 | +struct UnmarshalJSON: Codable, Equatable { | |
| 17583 | + let unmarshalJSON: Int | |
| 17426 | 17584 | |
| 17427 | 17585 | enum CodingKeys: String, CodingKey { |
| 17428 | - case unsafe = "unsafe" | |
| 17586 | + case unmarshalJSON = "UnmarshalJSON" | |
| 17429 | 17587 | } |
| 17430 | 17588 | } |
| 17431 | 17589 | |
| 17432 | -// MARK: Unsafe convenience initializers and mutators | |
| 17590 | +// MARK: UnmarshalJSON convenience initializers and mutators | |
| 17433 | 17591 | |
| 17434 | -extension Unsafe { | |
| 17592 | +extension UnmarshalJSON { | |
| 17435 | 17593 | init(data: Data) throws { |
| 17436 | - self = try newJSONDecoder().decode(Unsafe.self, from: data) | |
| 17594 | + self = try newJSONDecoder().decode(UnmarshalJSON.self, from: data) | |
| 17437 | 17595 | } |
| 17438 | 17596 | |
| 17439 | 17597 | init(_ json: String, using encoding: String.Encoding = .utf8) throws { |
| @@ -17448,10 +17606,10 @@ extension Unsafe { | ||
| 17448 | 17606 | } |
| 17449 | 17607 | |
| 17450 | 17608 | func with( |
| 17451 | - unsafe: Int? = nil | |
| 17452 | - ) -> Unsafe { | |
| 17453 | - return Unsafe( | |
| 17454 | - unsafe: unsafe ?? self.unsafe | |
| 17609 | + unmarshalJSON: Int? = nil | |
| 17610 | + ) -> UnmarshalJSON { | |
| 17611 | + return UnmarshalJSON( | |
| 17612 | + unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON | |
| 17455 | 17613 | ) |
| 17456 | 17614 | } |
| 17457 | 17615 | |
| @@ -17470,20 +17628,20 @@ extension Unsafe { | ||
| 17470 | 17628 | // for types that require the use of JSONAny, nor will the implementation of Hashable be |
| 17471 | 17629 | // synthesized for types that have collections (such as arrays or dictionaries). |
| 17472 | 17630 | |
| 17473 | -// MARK: - Unsigned | |
| 17474 | -struct Unsigned: Codable, Equatable { | |
| 17475 | - let unsigned: Int | |
| 17631 | +// MARK: - Unsafe | |
| 17632 | +struct Unsafe: Codable, Equatable { | |
| 17633 | + let unsafe: Int | |
| 17476 | 17634 | |
| 17477 | 17635 | enum CodingKeys: String, CodingKey { |
| 17478 | - case unsigned = "unsigned" | |
| 17636 | + case unsafe = "unsafe" | |
| 17479 | 17637 | } |
| 17480 | 17638 | } |
| 17481 | 17639 | |
| 17482 | -// MARK: Unsigned convenience initializers and mutators | |
| 17640 | +// MARK: Unsafe convenience initializers and mutators | |
| 17483 | 17641 | |
| 17484 | -extension Unsigned { | |
| 17642 | +extension Unsafe { | |
| 17485 | 17643 | init(data: Data) throws { |
| 17486 | - self = try newJSONDecoder().decode(Unsigned.self, from: data) | |
| 17644 | + self = try newJSONDecoder().decode(Unsafe.self, from: data) | |
| 17487 | 17645 | } |
| 17488 | 17646 | |
| 17489 | 17647 | init(_ json: String, using encoding: String.Encoding = .utf8) throws { |
| @@ -17498,10 +17656,10 @@ extension Unsigned { | ||
| 17498 | 17656 | } |
| 17499 | 17657 | |
| 17500 | 17658 | func with( |
| 17501 | - unsigned: Int? = nil | |
| 17502 | - ) -> Unsigned { | |
| 17503 | - return Unsigned( | |
| 17504 | - unsigned: unsigned ?? self.unsigned | |
| 17659 | + unsafe: Int? = nil | |
| 17660 | + ) -> Unsafe { | |
| 17661 | + return Unsafe( | |
| 17662 | + unsafe: unsafe ?? self.unsafe | |
| 17505 | 17663 | ) |
| 17506 | 17664 | } |
| 17507 | 17665 | |
| @@ -17570,56 +17728,6 @@ extension UseSerializers { | ||
| 17570 | 17728 | // for types that require the use of JSONAny, nor will the implementation of Hashable be |
| 17571 | 17729 | // synthesized for types that have collections (such as arrays or dictionaries). |
| 17572 | 17730 | |
| 17573 | -// MARK: - Ushort | |
| 17574 | -struct Ushort: Codable, Equatable { | |
| 17575 | - let ushort: Int | |
| 17576 | - | |
| 17577 | - enum CodingKeys: String, CodingKey { | |
| 17578 | - case ushort = "ushort" | |
| 17579 | - } | |
| 17580 | -} | |
| 17581 | - | |
| 17582 | -// MARK: Ushort convenience initializers and mutators | |
| 17583 | - | |
| 17584 | -extension Ushort { | |
| 17585 | - init(data: Data) throws { | |
| 17586 | - self = try newJSONDecoder().decode(Ushort.self, from: data) | |
| 17587 | - } | |
| 17588 | - | |
| 17589 | - init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 17590 | - guard let data = json.data(using: encoding) else { | |
| 17591 | - throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 17592 | - } | |
| 17593 | - try self.init(data: data) | |
| 17594 | - } | |
| 17595 | - | |
| 17596 | - init(fromURL url: URL) throws { | |
| 17597 | - try self.init(data: try Data(contentsOf: url)) | |
| 17598 | - } | |
| 17599 | - | |
| 17600 | - func with( | |
| 17601 | - ushort: Int? = nil | |
| 17602 | - ) -> Ushort { | |
| 17603 | - return Ushort( | |
| 17604 | - ushort: ushort ?? self.ushort | |
| 17605 | - ) | |
| 17606 | - } | |
| 17607 | - | |
| 17608 | - func jsonData() throws -> Data { | |
| 17609 | - return try newJSONEncoder().encode(self) | |
| 17610 | - } | |
| 17611 | - | |
| 17612 | - func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 17613 | - return String(data: try self.jsonData(), encoding: encoding) | |
| 17614 | - } | |
| 17615 | -} | |
| 17616 | - | |
| 17617 | -// | |
| 17618 | -// Hashable or Equatable: | |
| 17619 | -// The compiler will not be able to synthesize the implementation of Hashable or Equatable | |
| 17620 | -// for types that require the use of JSONAny, nor will the implementation of Hashable be | |
| 17621 | -// synthesized for types that have collections (such as arrays or dictionaries). | |
| 17622 | - | |
| 17623 | 17731 | // MARK: - Obj6 |
| 17624 | 17732 | struct Obj6: Codable, Equatable { |
| 17625 | 17733 | let dummy: Int |
| @@ -17628,6 +17736,8 @@ struct Obj6: Codable, Equatable { | ||
| 17628 | 17736 | let obj6Where: Where |
| 17629 | 17737 | let obj6While: While |
| 17630 | 17738 | let obj6WillSet: WillSet |
| 17739 | + let unsigned: Unsigned | |
| 17740 | + let ushort: Ushort | |
| 17631 | 17741 | let using: Using |
| 17632 | 17742 | let utf8JSONReader: Utf8JSONReader |
| 17633 | 17743 | let utf8JSONWriter: Utf8JSONWriter |
| @@ -17649,6 +17759,8 @@ struct Obj6: Codable, Equatable { | ||
| 17649 | 17759 | case obj6Where = "where" |
| 17650 | 17760 | case obj6While = "while" |
| 17651 | 17761 | case obj6WillSet = "willSet" |
| 17762 | + case unsigned = "unsigned" | |
| 17763 | + case ushort = "ushort" | |
| 17652 | 17764 | case using = "using" |
| 17653 | 17765 | case utf8JSONReader = "Utf8JsonReader" |
| 17654 | 17766 | case utf8JSONWriter = "Utf8JsonWriter" |
| @@ -17690,6 +17802,8 @@ extension Obj6 { | ||
| 17690 | 17802 | obj6Where: Where? = nil, |
| 17691 | 17803 | obj6While: While? = nil, |
| 17692 | 17804 | obj6WillSet: WillSet? = nil, |
| 17805 | + unsigned: Unsigned? = nil, | |
| 17806 | + ushort: Ushort? = nil, | |
| 17693 | 17807 | using: Using? = nil, |
| 17694 | 17808 | utf8JSONReader: Utf8JSONReader? = nil, |
| 17695 | 17809 | utf8JSONWriter: Utf8JSONWriter? = nil, |
| @@ -17711,6 +17825,8 @@ extension Obj6 { | ||
| 17711 | 17825 | obj6Where: obj6Where ?? self.obj6Where, |
| 17712 | 17826 | obj6While: obj6While ?? self.obj6While, |
| 17713 | 17827 | obj6WillSet: obj6WillSet ?? self.obj6WillSet, |
| 17828 | + unsigned: unsigned ?? self.unsigned, | |
| 17829 | + ushort: ushort ?? self.ushort, | |
| 17714 | 17830 | using: using ?? self.using, |
| 17715 | 17831 | utf8JSONReader: utf8JSONReader ?? self.utf8JSONReader, |
| 17716 | 17832 | utf8JSONWriter: utf8JSONWriter ?? self.utf8JSONWriter, |
| @@ -17992,6 +18108,106 @@ extension WillSet { | ||
| 17992 | 18108 | // for types that require the use of JSONAny, nor will the implementation of Hashable be |
| 17993 | 18109 | // synthesized for types that have collections (such as arrays or dictionaries). |
| 17994 | 18110 | |
| 18111 | +// MARK: - Unsigned | |
| 18112 | +struct Unsigned: Codable, Equatable { | |
| 18113 | + let unsigned: Int | |
| 18114 | + | |
| 18115 | + enum CodingKeys: String, CodingKey { | |
| 18116 | + case unsigned = "unsigned" | |
| 18117 | + } | |
| 18118 | +} | |
| 18119 | + | |
| 18120 | +// MARK: Unsigned convenience initializers and mutators | |
| 18121 | + | |
| 18122 | +extension Unsigned { | |
| 18123 | + init(data: Data) throws { | |
| 18124 | + self = try newJSONDecoder().decode(Unsigned.self, from: data) | |
| 18125 | + } | |
| 18126 | + | |
| 18127 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 18128 | + guard let data = json.data(using: encoding) else { | |
| 18129 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 18130 | + } | |
| 18131 | + try self.init(data: data) | |
| 18132 | + } | |
| 18133 | + | |
| 18134 | + init(fromURL url: URL) throws { | |
| 18135 | + try self.init(data: try Data(contentsOf: url)) | |
| 18136 | + } | |
| 18137 | + | |
| 18138 | + func with( | |
| 18139 | + unsigned: Int? = nil | |
| 18140 | + ) -> Unsigned { | |
| 18141 | + return Unsigned( | |
| 18142 | + unsigned: unsigned ?? self.unsigned | |
| 18143 | + ) | |
| 18144 | + } | |
| 18145 | + | |
| 18146 | + func jsonData() throws -> Data { | |
| 18147 | + return try newJSONEncoder().encode(self) | |
| 18148 | + } | |
| 18149 | + | |
| 18150 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 18151 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 18152 | + } | |
| 18153 | +} | |
| 18154 | + | |
| 18155 | +// | |
| 18156 | +// Hashable or Equatable: | |
| 18157 | +// The compiler will not be able to synthesize the implementation of Hashable or Equatable | |
| 18158 | +// for types that require the use of JSONAny, nor will the implementation of Hashable be | |
| 18159 | +// synthesized for types that have collections (such as arrays or dictionaries). | |
| 18160 | + | |
| 18161 | +// MARK: - Ushort | |
| 18162 | +struct Ushort: Codable, Equatable { | |
| 18163 | + let ushort: Int | |
| 18164 | + | |
| 18165 | + enum CodingKeys: String, CodingKey { | |
| 18166 | + case ushort = "ushort" | |
| 18167 | + } | |
| 18168 | +} | |
| 18169 | + | |
| 18170 | +// MARK: Ushort convenience initializers and mutators | |
| 18171 | + | |
| 18172 | +extension Ushort { | |
| 18173 | + init(data: Data) throws { | |
| 18174 | + self = try newJSONDecoder().decode(Ushort.self, from: data) | |
| 18175 | + } | |
| 18176 | + | |
| 18177 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 18178 | + guard let data = json.data(using: encoding) else { | |
| 18179 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 18180 | + } | |
| 18181 | + try self.init(data: data) | |
| 18182 | + } | |
| 18183 | + | |
| 18184 | + init(fromURL url: URL) throws { | |
| 18185 | + try self.init(data: try Data(contentsOf: url)) | |
| 18186 | + } | |
| 18187 | + | |
| 18188 | + func with( | |
| 18189 | + ushort: Int? = nil | |
| 18190 | + ) -> Ushort { | |
| 18191 | + return Ushort( | |
| 18192 | + ushort: ushort ?? self.ushort | |
| 18193 | + ) | |
| 18194 | + } | |
| 18195 | + | |
| 18196 | + func jsonData() throws -> Data { | |
| 18197 | + return try newJSONEncoder().encode(self) | |
| 18198 | + } | |
| 18199 | + | |
| 18200 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 18201 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 18202 | + } | |
| 18203 | +} | |
| 18204 | + | |
| 18205 | +// | |
| 18206 | +// Hashable or Equatable: | |
| 18207 | +// The compiler will not be able to synthesize the implementation of Hashable or Equatable | |
| 18208 | +// for types that require the use of JSONAny, nor will the implementation of Hashable be | |
| 18209 | +// synthesized for types that have collections (such as arrays or dictionaries). | |
| 18210 | + | |
| 17995 | 18211 | // MARK: - Using |
| 17996 | 18212 | struct Using: Codable, Equatable { |
| 17997 | 18213 | let using: Int |
Mswiftsendable-true--1c3982c78639 / quicktype.swift+434 −242
| @@ -3234,11 +3234,11 @@ struct Obj2: Codable, Sendable { | ||
| 3234 | 3234 | let formatException: FormatException |
| 3235 | 3235 | let friend: Friend |
| 3236 | 3236 | let from: From |
| 3237 | + let fromDict: FromDict | |
| 3237 | 3238 | let fromJSON: FromJSON |
| 3238 | 3239 | let function: Function |
| 3239 | 3240 | let global: Global |
| 3240 | 3241 | let go: Go |
| 3241 | - let goto: Goto | |
| 3242 | 3242 | let obj2Default: Default |
| 3243 | 3243 | let obj2Defer: Defer |
| 3244 | 3244 | let obj2Deinit: Deinit |
| @@ -3301,11 +3301,11 @@ struct Obj2: Codable, Sendable { | ||
| 3301 | 3301 | case formatException = "FormatException" |
| 3302 | 3302 | case friend = "friend" |
| 3303 | 3303 | case from = "from" |
| 3304 | + case fromDict = "from_dict" | |
| 3304 | 3305 | case fromJSON = "from_json" |
| 3305 | 3306 | case function = "function" |
| 3306 | 3307 | case global = "global" |
| 3307 | 3308 | case go = "go" |
| 3308 | - case goto = "goto" | |
| 3309 | 3309 | case obj2Default = "default" |
| 3310 | 3310 | case obj2Defer = "defer" |
| 3311 | 3311 | case obj2Deinit = "deinit" |
| @@ -3388,11 +3388,11 @@ extension Obj2 { | ||
| 3388 | 3388 | formatException: FormatException? = nil, |
| 3389 | 3389 | friend: Friend? = nil, |
| 3390 | 3390 | from: From? = nil, |
| 3391 | + fromDict: FromDict? = nil, | |
| 3391 | 3392 | fromJSON: FromJSON? = nil, |
| 3392 | 3393 | function: Function? = nil, |
| 3393 | 3394 | global: Global? = nil, |
| 3394 | 3395 | go: Go? = nil, |
| 3395 | - goto: Goto? = nil, | |
| 3396 | 3396 | obj2Default: Default? = nil, |
| 3397 | 3397 | obj2Defer: Defer? = nil, |
| 3398 | 3398 | obj2Deinit: Deinit? = nil, |
| @@ -3455,11 +3455,11 @@ extension Obj2 { | ||
| 3455 | 3455 | formatException: formatException ?? self.formatException, |
| 3456 | 3456 | friend: friend ?? self.friend, |
| 3457 | 3457 | from: from ?? self.from, |
| 3458 | + fromDict: fromDict ?? self.fromDict, | |
| 3458 | 3459 | fromJSON: fromJSON ?? self.fromJSON, |
| 3459 | 3460 | function: function ?? self.function, |
| 3460 | 3461 | global: global ?? self.global, |
| 3461 | 3462 | go: go ?? self.go, |
| 3462 | - goto: goto ?? self.goto, | |
| 3463 | 3463 | obj2Default: obj2Default ?? self.obj2Default, |
| 3464 | 3464 | obj2Defer: obj2Defer ?? self.obj2Defer, |
| 3465 | 3465 | obj2Deinit: obj2Deinit ?? self.obj2Deinit, |
| @@ -5342,6 +5342,50 @@ extension From { | ||
| 5342 | 5342 | } |
| 5343 | 5343 | } |
| 5344 | 5344 | |
| 5345 | +// MARK: - FromDict | |
| 5346 | +struct FromDict: Codable, Sendable { | |
| 5347 | + let fromDict: Int | |
| 5348 | + | |
| 5349 | + enum CodingKeys: String, CodingKey { | |
| 5350 | + case fromDict = "from_dict" | |
| 5351 | + } | |
| 5352 | +} | |
| 5353 | + | |
| 5354 | +// MARK: FromDict convenience initializers and mutators | |
| 5355 | + | |
| 5356 | +extension FromDict { | |
| 5357 | + init(data: Data) throws { | |
| 5358 | + self = try newJSONDecoder().decode(FromDict.self, from: data) | |
| 5359 | + } | |
| 5360 | + | |
| 5361 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 5362 | + guard let data = json.data(using: encoding) else { | |
| 5363 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 5364 | + } | |
| 5365 | + try self.init(data: data) | |
| 5366 | + } | |
| 5367 | + | |
| 5368 | + init(fromURL url: URL) throws { | |
| 5369 | + try self.init(data: try Data(contentsOf: url)) | |
| 5370 | + } | |
| 5371 | + | |
| 5372 | + func with( | |
| 5373 | + fromDict: Int? = nil | |
| 5374 | + ) -> FromDict { | |
| 5375 | + return FromDict( | |
| 5376 | + fromDict: fromDict ?? self.fromDict | |
| 5377 | + ) | |
| 5378 | + } | |
| 5379 | + | |
| 5380 | + func jsonData() throws -> Data { | |
| 5381 | + return try newJSONEncoder().encode(self) | |
| 5382 | + } | |
| 5383 | + | |
| 5384 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 5385 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 5386 | + } | |
| 5387 | +} | |
| 5388 | + | |
| 5345 | 5389 | // MARK: - FromJSON |
| 5346 | 5390 | struct FromJSON: Codable, Sendable { |
| 5347 | 5391 | let fromJSON: Int |
| @@ -5518,50 +5562,6 @@ extension Go { | ||
| 5518 | 5562 | } |
| 5519 | 5563 | } |
| 5520 | 5564 | |
| 5521 | -// MARK: - Goto | |
| 5522 | -struct Goto: Codable, Sendable { | |
| 5523 | - let goto: Int | |
| 5524 | - | |
| 5525 | - enum CodingKeys: String, CodingKey { | |
| 5526 | - case goto = "goto" | |
| 5527 | - } | |
| 5528 | -} | |
| 5529 | - | |
| 5530 | -// MARK: Goto convenience initializers and mutators | |
| 5531 | - | |
| 5532 | -extension Goto { | |
| 5533 | - init(data: Data) throws { | |
| 5534 | - self = try newJSONDecoder().decode(Goto.self, from: data) | |
| 5535 | - } | |
| 5536 | - | |
| 5537 | - init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 5538 | - guard let data = json.data(using: encoding) else { | |
| 5539 | - throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 5540 | - } | |
| 5541 | - try self.init(data: data) | |
| 5542 | - } | |
| 5543 | - | |
| 5544 | - init(fromURL url: URL) throws { | |
| 5545 | - try self.init(data: try Data(contentsOf: url)) | |
| 5546 | - } | |
| 5547 | - | |
| 5548 | - func with( | |
| 5549 | - goto: Int? = nil | |
| 5550 | - ) -> Goto { | |
| 5551 | - return Goto( | |
| 5552 | - goto: goto ?? self.goto | |
| 5553 | - ) | |
| 5554 | - } | |
| 5555 | - | |
| 5556 | - func jsonData() throws -> Data { | |
| 5557 | - return try newJSONEncoder().encode(self) | |
| 5558 | - } | |
| 5559 | - | |
| 5560 | - func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 5561 | - return String(data: try self.jsonData(), encoding: encoding) | |
| 5562 | - } | |
| 5563 | -} | |
| 5564 | - | |
| 5565 | 5565 | // MARK: - Default |
| 5566 | 5566 | struct Default: Codable, Sendable { |
| 5567 | 5567 | let defaultDefault: Int |
| @@ -6313,6 +6313,7 @@ extension FalseClass { | ||
| 6313 | 6313 | // MARK: - Obj3 |
| 6314 | 6314 | struct Obj3: Codable, Sendable { |
| 6315 | 6315 | let dummy: Int |
| 6316 | + let goto: Goto | |
| 6316 | 6317 | let hasOwnProperty: HasOwnProperty |
| 6317 | 6318 | let hashCode: HashCode |
| 6318 | 6319 | let hashable: HashableClass |
| @@ -6352,6 +6353,7 @@ struct Obj3: Codable, Sendable { | ||
| 6352 | 6353 | let long: Long |
| 6353 | 6354 | let map: Map |
| 6354 | 6355 | let mapEntry: MapEntry |
| 6356 | + let marshalJSON: MarshalJSON | |
| 6355 | 6357 | let metadataPropertyHandling: MetadataPropertyHandling |
| 6356 | 6358 | let module: Module |
| 6357 | 6359 | let mutable: Mutable |
| @@ -6360,7 +6362,6 @@ struct Obj3: Codable, Sendable { | ||
| 6360 | 6362 | let new: New |
| 6361 | 6363 | let newtonsoft: Newtonsoft |
| 6362 | 6364 | let no: No |
| 6363 | - let noexcept: Noexcept | |
| 6364 | 6365 | let obj3Guard: Guard |
| 6365 | 6366 | let obj3If: If |
| 6366 | 6367 | let obj3Import: Import |
| @@ -6380,6 +6381,7 @@ struct Obj3: Codable, Sendable { | ||
| 6380 | 6381 | |
| 6381 | 6382 | enum CodingKeys: String, CodingKey { |
| 6382 | 6383 | case dummy = "dummy" |
| 6384 | + case goto = "goto" | |
| 6383 | 6385 | case hasOwnProperty = "hasOwnProperty" |
| 6384 | 6386 | case hashCode = "hashCode" |
| 6385 | 6387 | case hashable = "Hashable" |
| @@ -6419,6 +6421,7 @@ struct Obj3: Codable, Sendable { | ||
| 6419 | 6421 | case long = "long" |
| 6420 | 6422 | case map = "map" |
| 6421 | 6423 | case mapEntry = "MapEntry" |
| 6424 | + case marshalJSON = "MarshalJSON" | |
| 6422 | 6425 | case metadataPropertyHandling = "metadata_property_handling" |
| 6423 | 6426 | case module = "module" |
| 6424 | 6427 | case mutable = "mutable" |
| @@ -6427,7 +6430,6 @@ struct Obj3: Codable, Sendable { | ||
| 6427 | 6430 | case new = "new" |
| 6428 | 6431 | case newtonsoft = "newtonsoft" |
| 6429 | 6432 | case no = "NO" |
| 6430 | - case noexcept = "noexcept" | |
| 6431 | 6433 | case obj3Guard = "guard" |
| 6432 | 6434 | case obj3If = "if" |
| 6433 | 6435 | case obj3Import = "import" |
| @@ -6467,6 +6469,7 @@ extension Obj3 { | ||
| 6467 | 6469 | |
| 6468 | 6470 | func with( |
| 6469 | 6471 | dummy: Int? = nil, |
| 6472 | + goto: Goto? = nil, | |
| 6470 | 6473 | hasOwnProperty: HasOwnProperty? = nil, |
| 6471 | 6474 | hashCode: HashCode? = nil, |
| 6472 | 6475 | hashable: HashableClass? = nil, |
| @@ -6506,6 +6509,7 @@ extension Obj3 { | ||
| 6506 | 6509 | long: Long? = nil, |
| 6507 | 6510 | map: Map? = nil, |
| 6508 | 6511 | mapEntry: MapEntry? = nil, |
| 6512 | + marshalJSON: MarshalJSON? = nil, | |
| 6509 | 6513 | metadataPropertyHandling: MetadataPropertyHandling? = nil, |
| 6510 | 6514 | module: Module? = nil, |
| 6511 | 6515 | mutable: Mutable? = nil, |
| @@ -6514,7 +6518,6 @@ extension Obj3 { | ||
| 6514 | 6518 | new: New? = nil, |
| 6515 | 6519 | newtonsoft: Newtonsoft? = nil, |
| 6516 | 6520 | no: No? = nil, |
| 6517 | - noexcept: Noexcept? = nil, | |
| 6518 | 6521 | obj3Guard: Guard? = nil, |
| 6519 | 6522 | obj3If: If? = nil, |
| 6520 | 6523 | obj3Import: Import? = nil, |
| @@ -6534,6 +6537,7 @@ extension Obj3 { | ||
| 6534 | 6537 | ) -> Obj3 { |
| 6535 | 6538 | return Obj3( |
| 6536 | 6539 | dummy: dummy ?? self.dummy, |
| 6540 | + goto: goto ?? self.goto, | |
| 6537 | 6541 | hasOwnProperty: hasOwnProperty ?? self.hasOwnProperty, |
| 6538 | 6542 | hashCode: hashCode ?? self.hashCode, |
| 6539 | 6543 | hashable: hashable ?? self.hashable, |
| @@ -6573,6 +6577,7 @@ extension Obj3 { | ||
| 6573 | 6577 | long: long ?? self.long, |
| 6574 | 6578 | map: map ?? self.map, |
| 6575 | 6579 | mapEntry: mapEntry ?? self.mapEntry, |
| 6580 | + marshalJSON: marshalJSON ?? self.marshalJSON, | |
| 6576 | 6581 | metadataPropertyHandling: metadataPropertyHandling ?? self.metadataPropertyHandling, |
| 6577 | 6582 | module: module ?? self.module, |
| 6578 | 6583 | mutable: mutable ?? self.mutable, |
| @@ -6581,7 +6586,6 @@ extension Obj3 { | ||
| 6581 | 6586 | new: new ?? self.new, |
| 6582 | 6587 | newtonsoft: newtonsoft ?? self.newtonsoft, |
| 6583 | 6588 | no: no ?? self.no, |
| 6584 | - noexcept: noexcept ?? self.noexcept, | |
| 6585 | 6589 | obj3Guard: obj3Guard ?? self.obj3Guard, |
| 6586 | 6590 | obj3If: obj3If ?? self.obj3If, |
| 6587 | 6591 | obj3Import: obj3Import ?? self.obj3Import, |
| @@ -6610,6 +6614,50 @@ extension Obj3 { | ||
| 6610 | 6614 | } |
| 6611 | 6615 | } |
| 6612 | 6616 | |
| 6617 | +// MARK: - Goto | |
| 6618 | +struct Goto: Codable, Sendable { | |
| 6619 | + let goto: Int | |
| 6620 | + | |
| 6621 | + enum CodingKeys: String, CodingKey { | |
| 6622 | + case goto = "goto" | |
| 6623 | + } | |
| 6624 | +} | |
| 6625 | + | |
| 6626 | +// MARK: Goto convenience initializers and mutators | |
| 6627 | + | |
| 6628 | +extension Goto { | |
| 6629 | + init(data: Data) throws { | |
| 6630 | + self = try newJSONDecoder().decode(Goto.self, from: data) | |
| 6631 | + } | |
| 6632 | + | |
| 6633 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 6634 | + guard let data = json.data(using: encoding) else { | |
| 6635 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 6636 | + } | |
| 6637 | + try self.init(data: data) | |
| 6638 | + } | |
| 6639 | + | |
| 6640 | + init(fromURL url: URL) throws { | |
| 6641 | + try self.init(data: try Data(contentsOf: url)) | |
| 6642 | + } | |
| 6643 | + | |
| 6644 | + func with( | |
| 6645 | + goto: Int? = nil | |
| 6646 | + ) -> Goto { | |
| 6647 | + return Goto( | |
| 6648 | + goto: goto ?? self.goto | |
| 6649 | + ) | |
| 6650 | + } | |
| 6651 | + | |
| 6652 | + func jsonData() throws -> Data { | |
| 6653 | + return try newJSONEncoder().encode(self) | |
| 6654 | + } | |
| 6655 | + | |
| 6656 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 6657 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 6658 | + } | |
| 6659 | +} | |
| 6660 | + | |
| 6613 | 6661 | // MARK: - HasOwnProperty |
| 6614 | 6662 | struct HasOwnProperty: Codable, Sendable { |
| 6615 | 6663 | let hasOwnProperty: Int |
| @@ -8326,6 +8374,50 @@ extension MapEntry { | ||
| 8326 | 8374 | } |
| 8327 | 8375 | } |
| 8328 | 8376 | |
| 8377 | +// MARK: - MarshalJSON | |
| 8378 | +struct MarshalJSON: Codable, Sendable { | |
| 8379 | + let marshalJSON: Int | |
| 8380 | + | |
| 8381 | + enum CodingKeys: String, CodingKey { | |
| 8382 | + case marshalJSON = "MarshalJSON" | |
| 8383 | + } | |
| 8384 | +} | |
| 8385 | + | |
| 8386 | +// MARK: MarshalJSON convenience initializers and mutators | |
| 8387 | + | |
| 8388 | +extension MarshalJSON { | |
| 8389 | + init(data: Data) throws { | |
| 8390 | + self = try newJSONDecoder().decode(MarshalJSON.self, from: data) | |
| 8391 | + } | |
| 8392 | + | |
| 8393 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 8394 | + guard let data = json.data(using: encoding) else { | |
| 8395 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 8396 | + } | |
| 8397 | + try self.init(data: data) | |
| 8398 | + } | |
| 8399 | + | |
| 8400 | + init(fromURL url: URL) throws { | |
| 8401 | + try self.init(data: try Data(contentsOf: url)) | |
| 8402 | + } | |
| 8403 | + | |
| 8404 | + func with( | |
| 8405 | + marshalJSON: Int? = nil | |
| 8406 | + ) -> MarshalJSON { | |
| 8407 | + return MarshalJSON( | |
| 8408 | + marshalJSON: marshalJSON ?? self.marshalJSON | |
| 8409 | + ) | |
| 8410 | + } | |
| 8411 | + | |
| 8412 | + func jsonData() throws -> Data { | |
| 8413 | + return try newJSONEncoder().encode(self) | |
| 8414 | + } | |
| 8415 | + | |
| 8416 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 8417 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 8418 | + } | |
| 8419 | +} | |
| 8420 | + | |
| 8329 | 8421 | // MARK: - MetadataPropertyHandling |
| 8330 | 8422 | struct MetadataPropertyHandling: Codable, Sendable { |
| 8331 | 8423 | let metadataPropertyHandling: Int |
| @@ -8678,50 +8770,6 @@ extension No { | ||
| 8678 | 8770 | } |
| 8679 | 8771 | } |
| 8680 | 8772 | |
| 8681 | -// MARK: - Noexcept | |
| 8682 | -struct Noexcept: Codable, Sendable { | |
| 8683 | - let noexcept: Int | |
| 8684 | - | |
| 8685 | - enum CodingKeys: String, CodingKey { | |
| 8686 | - case noexcept = "noexcept" | |
| 8687 | - } | |
| 8688 | -} | |
| 8689 | - | |
| 8690 | -// MARK: Noexcept convenience initializers and mutators | |
| 8691 | - | |
| 8692 | -extension Noexcept { | |
| 8693 | - init(data: Data) throws { | |
| 8694 | - self = try newJSONDecoder().decode(Noexcept.self, from: data) | |
| 8695 | - } | |
| 8696 | - | |
| 8697 | - init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 8698 | - guard let data = json.data(using: encoding) else { | |
| 8699 | - throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 8700 | - } | |
| 8701 | - try self.init(data: data) | |
| 8702 | - } | |
| 8703 | - | |
| 8704 | - init(fromURL url: URL) throws { | |
| 8705 | - try self.init(data: try Data(contentsOf: url)) | |
| 8706 | - } | |
| 8707 | - | |
| 8708 | - func with( | |
| 8709 | - noexcept: Int? = nil | |
| 8710 | - ) -> Noexcept { | |
| 8711 | - return Noexcept( | |
| 8712 | - noexcept: noexcept ?? self.noexcept | |
| 8713 | - ) | |
| 8714 | - } | |
| 8715 | - | |
| 8716 | - func jsonData() throws -> Data { | |
| 8717 | - return try newJSONEncoder().encode(self) | |
| 8718 | - } | |
| 8719 | - | |
| 8720 | - func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 8721 | - return String(data: try self.jsonData(), encoding: encoding) | |
| 8722 | - } | |
| 8723 | -} | |
| 8724 | - | |
| 8725 | 8773 | // MARK: - Guard |
| 8726 | 8774 | struct Guard: Codable, Sendable { |
| 8727 | 8775 | let guardGuard: Int |
| @@ -9430,6 +9478,7 @@ extension Nil { | ||
| 9430 | 9478 | struct Obj4: Codable, Sendable { |
| 9431 | 9479 | let dummy: Int |
| 9432 | 9480 | let noSuchMethod: NoSuchMethod |
| 9481 | + let noexcept: Noexcept | |
| 9433 | 9482 | let nonatomic: Nonatomic |
| 9434 | 9483 | let none: None |
| 9435 | 9484 | let nonlocal: Nonlocal |
| @@ -9492,11 +9541,11 @@ struct Obj4: Codable, Sendable { | ||
| 9492 | 9541 | let sbyte: Sbyte |
| 9493 | 9542 | let sealed: Sealed |
| 9494 | 9543 | let sel: Sel |
| 9495 | - let select: Select | |
| 9496 | 9544 | |
| 9497 | 9545 | enum CodingKeys: String, CodingKey { |
| 9498 | 9546 | case dummy = "dummy" |
| 9499 | 9547 | case noSuchMethod = "noSuchMethod" |
| 9548 | + case noexcept = "noexcept" | |
| 9500 | 9549 | case nonatomic = "nonatomic" |
| 9501 | 9550 | case none = "None" |
| 9502 | 9551 | case nonlocal = "nonlocal" |
| @@ -9559,7 +9608,6 @@ struct Obj4: Codable, Sendable { | ||
| 9559 | 9608 | case sbyte = "sbyte" |
| 9560 | 9609 | case sealed = "sealed" |
| 9561 | 9610 | case sel = "SEL" |
| 9562 | - case select = "select" | |
| 9563 | 9611 | } |
| 9564 | 9612 | } |
| 9565 | 9613 | |
| @@ -9584,6 +9632,7 @@ extension Obj4 { | ||
| 9584 | 9632 | func with( |
| 9585 | 9633 | dummy: Int? = nil, |
| 9586 | 9634 | noSuchMethod: NoSuchMethod? = nil, |
| 9635 | + noexcept: Noexcept? = nil, | |
| 9587 | 9636 | nonatomic: Nonatomic? = nil, |
| 9588 | 9637 | none: None? = nil, |
| 9589 | 9638 | nonlocal: Nonlocal? = nil, |
| @@ -9645,12 +9694,12 @@ extension Obj4 { | ||
| 9645 | 9694 | s: S? = nil, |
| 9646 | 9695 | sbyte: Sbyte? = nil, |
| 9647 | 9696 | sealed: Sealed? = nil, |
| 9648 | - sel: Sel? = nil, | |
| 9649 | - select: Select? = nil | |
| 9697 | + sel: Sel? = nil | |
| 9650 | 9698 | ) -> Obj4 { |
| 9651 | 9699 | return Obj4( |
| 9652 | 9700 | dummy: dummy ?? self.dummy, |
| 9653 | 9701 | noSuchMethod: noSuchMethod ?? self.noSuchMethod, |
| 9702 | + noexcept: noexcept ?? self.noexcept, | |
| 9654 | 9703 | nonatomic: nonatomic ?? self.nonatomic, |
| 9655 | 9704 | none: none ?? self.none, |
| 9656 | 9705 | nonlocal: nonlocal ?? self.nonlocal, |
| @@ -9712,8 +9761,7 @@ extension Obj4 { | ||
| 9712 | 9761 | s: s ?? self.s, |
| 9713 | 9762 | sbyte: sbyte ?? self.sbyte, |
| 9714 | 9763 | sealed: sealed ?? self.sealed, |
| 9715 | - sel: sel ?? self.sel, | |
| 9716 | - select: select ?? self.select | |
| 9764 | + sel: sel ?? self.sel | |
| 9717 | 9765 | ) |
| 9718 | 9766 | } |
| 9719 | 9767 | |
| @@ -9770,20 +9818,20 @@ extension NoSuchMethod { | ||
| 9770 | 9818 | } |
| 9771 | 9819 | } |
| 9772 | 9820 | |
| 9773 | -// MARK: - Nonatomic | |
| 9774 | -struct Nonatomic: Codable, Sendable { | |
| 9775 | - let nonatomic: Int | |
| 9821 | +// MARK: - Noexcept | |
| 9822 | +struct Noexcept: Codable, Sendable { | |
| 9823 | + let noexcept: Int | |
| 9776 | 9824 | |
| 9777 | 9825 | enum CodingKeys: String, CodingKey { |
| 9778 | - case nonatomic = "nonatomic" | |
| 9826 | + case noexcept = "noexcept" | |
| 9779 | 9827 | } |
| 9780 | 9828 | } |
| 9781 | 9829 | |
| 9782 | -// MARK: Nonatomic convenience initializers and mutators | |
| 9830 | +// MARK: Noexcept convenience initializers and mutators | |
| 9783 | 9831 | |
| 9784 | -extension Nonatomic { | |
| 9832 | +extension Noexcept { | |
| 9785 | 9833 | init(data: Data) throws { |
| 9786 | - self = try newJSONDecoder().decode(Nonatomic.self, from: data) | |
| 9834 | + self = try newJSONDecoder().decode(Noexcept.self, from: data) | |
| 9787 | 9835 | } |
| 9788 | 9836 | |
| 9789 | 9837 | init(_ json: String, using encoding: String.Encoding = .utf8) throws { |
| @@ -9798,10 +9846,10 @@ extension Nonatomic { | ||
| 9798 | 9846 | } |
| 9799 | 9847 | |
| 9800 | 9848 | func with( |
| 9801 | - nonatomic: Int? = nil | |
| 9802 | - ) -> Nonatomic { | |
| 9803 | - return Nonatomic( | |
| 9804 | - nonatomic: nonatomic ?? self.nonatomic | |
| 9849 | + noexcept: Int? = nil | |
| 9850 | + ) -> Noexcept { | |
| 9851 | + return Noexcept( | |
| 9852 | + noexcept: noexcept ?? self.noexcept | |
| 9805 | 9853 | ) |
| 9806 | 9854 | } |
| 9807 | 9855 | |
| @@ -9814,20 +9862,20 @@ extension Nonatomic { | ||
| 9814 | 9862 | } |
| 9815 | 9863 | } |
| 9816 | 9864 | |
| 9817 | -// MARK: - None | |
| 9818 | -struct None: Codable, Sendable { | |
| 9819 | - let none: Int | |
| 9865 | +// MARK: - Nonatomic | |
| 9866 | +struct Nonatomic: Codable, Sendable { | |
| 9867 | + let nonatomic: Int | |
| 9820 | 9868 | |
| 9821 | 9869 | enum CodingKeys: String, CodingKey { |
| 9822 | - case none = "None" | |
| 9870 | + case nonatomic = "nonatomic" | |
| 9823 | 9871 | } |
| 9824 | 9872 | } |
| 9825 | 9873 | |
| 9826 | -// MARK: None convenience initializers and mutators | |
| 9874 | +// MARK: Nonatomic convenience initializers and mutators | |
| 9827 | 9875 | |
| 9828 | -extension None { | |
| 9876 | +extension Nonatomic { | |
| 9829 | 9877 | init(data: Data) throws { |
| 9830 | - self = try newJSONDecoder().decode(None.self, from: data) | |
| 9878 | + self = try newJSONDecoder().decode(Nonatomic.self, from: data) | |
| 9831 | 9879 | } |
| 9832 | 9880 | |
| 9833 | 9881 | init(_ json: String, using encoding: String.Encoding = .utf8) throws { |
| @@ -9842,8 +9890,52 @@ extension None { | ||
| 9842 | 9890 | } |
| 9843 | 9891 | |
| 9844 | 9892 | func with( |
| 9845 | - none: Int? = nil | |
| 9846 | - ) -> None { | |
| 9893 | + nonatomic: Int? = nil | |
| 9894 | + ) -> Nonatomic { | |
| 9895 | + return Nonatomic( | |
| 9896 | + nonatomic: nonatomic ?? self.nonatomic | |
| 9897 | + ) | |
| 9898 | + } | |
| 9899 | + | |
| 9900 | + func jsonData() throws -> Data { | |
| 9901 | + return try newJSONEncoder().encode(self) | |
| 9902 | + } | |
| 9903 | + | |
| 9904 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 9905 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 9906 | + } | |
| 9907 | +} | |
| 9908 | + | |
| 9909 | +// MARK: - None | |
| 9910 | +struct None: Codable, Sendable { | |
| 9911 | + let none: Int | |
| 9912 | + | |
| 9913 | + enum CodingKeys: String, CodingKey { | |
| 9914 | + case none = "None" | |
| 9915 | + } | |
| 9916 | +} | |
| 9917 | + | |
| 9918 | +// MARK: None convenience initializers and mutators | |
| 9919 | + | |
| 9920 | +extension None { | |
| 9921 | + init(data: Data) throws { | |
| 9922 | + self = try newJSONDecoder().decode(None.self, from: data) | |
| 9923 | + } | |
| 9924 | + | |
| 9925 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 9926 | + guard let data = json.data(using: encoding) else { | |
| 9927 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 9928 | + } | |
| 9929 | + try self.init(data: data) | |
| 9930 | + } | |
| 9931 | + | |
| 9932 | + init(fromURL url: URL) throws { | |
| 9933 | + try self.init(data: try Data(contentsOf: url)) | |
| 9934 | + } | |
| 9935 | + | |
| 9936 | + func with( | |
| 9937 | + none: Int? = nil | |
| 9938 | + ) -> None { | |
| 9847 | 9939 | return None( |
| 9848 | 9940 | none: none ?? self.none |
| 9849 | 9941 | ) |
| @@ -12498,50 +12590,6 @@ extension Sel { | ||
| 12498 | 12590 | } |
| 12499 | 12591 | } |
| 12500 | 12592 | |
| 12501 | -// MARK: - Select | |
| 12502 | -struct Select: Codable, Sendable { | |
| 12503 | - let select: Int | |
| 12504 | - | |
| 12505 | - enum CodingKeys: String, CodingKey { | |
| 12506 | - case select = "select" | |
| 12507 | - } | |
| 12508 | -} | |
| 12509 | - | |
| 12510 | -// MARK: Select convenience initializers and mutators | |
| 12511 | - | |
| 12512 | -extension Select { | |
| 12513 | - init(data: Data) throws { | |
| 12514 | - self = try newJSONDecoder().decode(Select.self, from: data) | |
| 12515 | - } | |
| 12516 | - | |
| 12517 | - init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 12518 | - guard let data = json.data(using: encoding) else { | |
| 12519 | - throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 12520 | - } | |
| 12521 | - try self.init(data: data) | |
| 12522 | - } | |
| 12523 | - | |
| 12524 | - init(fromURL url: URL) throws { | |
| 12525 | - try self.init(data: try Data(contentsOf: url)) | |
| 12526 | - } | |
| 12527 | - | |
| 12528 | - func with( | |
| 12529 | - select: Int? = nil | |
| 12530 | - ) -> Select { | |
| 12531 | - return Select( | |
| 12532 | - select: select ?? self.select | |
| 12533 | - ) | |
| 12534 | - } | |
| 12535 | - | |
| 12536 | - func jsonData() throws -> Data { | |
| 12537 | - return try newJSONEncoder().encode(self) | |
| 12538 | - } | |
| 12539 | - | |
| 12540 | - func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 12541 | - return String(data: try self.jsonData(), encoding: encoding) | |
| 12542 | - } | |
| 12543 | -} | |
| 12544 | - | |
| 12545 | 12593 | // MARK: - Obj5 |
| 12546 | 12594 | struct Obj5: Codable, Sendable { |
| 12547 | 12595 | let dummy: Int |
| @@ -12563,6 +12611,7 @@ struct Obj5: Codable, Sendable { | ||
| 12563 | 12611 | let primitiveKind: PrimitiveKind |
| 12564 | 12612 | let purpleSelf: Obj5Self |
| 12565 | 12613 | let purpleTrue: TrueClass |
| 12614 | + let select: Select | |
| 12566 | 12615 | let sendable: SendableClass |
| 12567 | 12616 | let serialDescriptor: SerialDescriptor |
| 12568 | 12617 | let serialName: SerialName |
| @@ -12591,6 +12640,7 @@ struct Obj5: Codable, Sendable { | ||
| 12591 | 12640 | let timeOnly: TimeOnly |
| 12592 | 12641 | let timeOnlyConverter: TimeOnlyConverter |
| 12593 | 12642 | let timeZone: TimeZoneClass |
| 12643 | + let toDict: ToDict | |
| 12594 | 12644 | let toJSON: ToJSON |
| 12595 | 12645 | let toString: ToString |
| 12596 | 12646 | let topLevel: TopLevelClass |
| @@ -12605,10 +12655,9 @@ struct Obj5: Codable, Sendable { | ||
| 12605 | 12655 | let unchecked: Unchecked |
| 12606 | 12656 | let undefined: Undefined |
| 12607 | 12657 | let union: Union |
| 12658 | + let unmarshalJSON: UnmarshalJSON | |
| 12608 | 12659 | let unsafe: Unsafe |
| 12609 | - let unsigned: Unsigned | |
| 12610 | 12660 | let useSerializers: UseSerializers |
| 12611 | - let ushort: Ushort | |
| 12612 | 12661 | |
| 12613 | 12662 | enum CodingKeys: String, CodingKey { |
| 12614 | 12663 | case dummy = "dummy" |
| @@ -12630,6 +12679,7 @@ struct Obj5: Codable, Sendable { | ||
| 12630 | 12679 | case primitiveKind = "PrimitiveKind" |
| 12631 | 12680 | case purpleSelf = "self" |
| 12632 | 12681 | case purpleTrue = "true" |
| 12682 | + case select = "select" | |
| 12633 | 12683 | case sendable = "Sendable" |
| 12634 | 12684 | case serialDescriptor = "SerialDescriptor" |
| 12635 | 12685 | case serialName = "SerialName" |
| @@ -12658,6 +12708,7 @@ struct Obj5: Codable, Sendable { | ||
| 12658 | 12708 | case timeOnly = "TimeOnly" |
| 12659 | 12709 | case timeOnlyConverter = "TimeOnlyConverter" |
| 12660 | 12710 | case timeZone = "TimeZone" |
| 12711 | + case toDict = "to_dict" | |
| 12661 | 12712 | case toJSON = "to_json" |
| 12662 | 12713 | case toString = "toString" |
| 12663 | 12714 | case topLevel = "top_level" |
| @@ -12672,10 +12723,9 @@ struct Obj5: Codable, Sendable { | ||
| 12672 | 12723 | case unchecked = "unchecked" |
| 12673 | 12724 | case undefined = "undefined" |
| 12674 | 12725 | case union = "union" |
| 12726 | + case unmarshalJSON = "UnmarshalJSON" | |
| 12675 | 12727 | case unsafe = "unsafe" |
| 12676 | - case unsigned = "unsigned" | |
| 12677 | 12728 | case useSerializers = "UseSerializers" |
| 12678 | - case ushort = "ushort" | |
| 12679 | 12729 | } |
| 12680 | 12730 | } |
| 12681 | 12731 | |
| @@ -12717,6 +12767,7 @@ extension Obj5 { | ||
| 12717 | 12767 | primitiveKind: PrimitiveKind? = nil, |
| 12718 | 12768 | purpleSelf: Obj5Self? = nil, |
| 12719 | 12769 | purpleTrue: TrueClass? = nil, |
| 12770 | + select: Select? = nil, | |
| 12720 | 12771 | sendable: SendableClass? = nil, |
| 12721 | 12772 | serialDescriptor: SerialDescriptor? = nil, |
| 12722 | 12773 | serialName: SerialName? = nil, |
| @@ -12745,6 +12796,7 @@ extension Obj5 { | ||
| 12745 | 12796 | timeOnly: TimeOnly? = nil, |
| 12746 | 12797 | timeOnlyConverter: TimeOnlyConverter? = nil, |
| 12747 | 12798 | timeZone: TimeZoneClass? = nil, |
| 12799 | + toDict: ToDict? = nil, | |
| 12748 | 12800 | toJSON: ToJSON? = nil, |
| 12749 | 12801 | toString: ToString? = nil, |
| 12750 | 12802 | topLevel: TopLevelClass? = nil, |
| @@ -12759,10 +12811,9 @@ extension Obj5 { | ||
| 12759 | 12811 | unchecked: Unchecked? = nil, |
| 12760 | 12812 | undefined: Undefined? = nil, |
| 12761 | 12813 | union: Union? = nil, |
| 12814 | + unmarshalJSON: UnmarshalJSON? = nil, | |
| 12762 | 12815 | unsafe: Unsafe? = nil, |
| 12763 | - unsigned: Unsigned? = nil, | |
| 12764 | - useSerializers: UseSerializers? = nil, | |
| 12765 | - ushort: Ushort? = nil | |
| 12816 | + useSerializers: UseSerializers? = nil | |
| 12766 | 12817 | ) -> Obj5 { |
| 12767 | 12818 | return Obj5( |
| 12768 | 12819 | dummy: dummy ?? self.dummy, |
| @@ -12784,6 +12835,7 @@ extension Obj5 { | ||
| 12784 | 12835 | primitiveKind: primitiveKind ?? self.primitiveKind, |
| 12785 | 12836 | purpleSelf: purpleSelf ?? self.purpleSelf, |
| 12786 | 12837 | purpleTrue: purpleTrue ?? self.purpleTrue, |
| 12838 | + select: select ?? self.select, | |
| 12787 | 12839 | sendable: sendable ?? self.sendable, |
| 12788 | 12840 | serialDescriptor: serialDescriptor ?? self.serialDescriptor, |
| 12789 | 12841 | serialName: serialName ?? self.serialName, |
| @@ -12812,6 +12864,7 @@ extension Obj5 { | ||
| 12812 | 12864 | timeOnly: timeOnly ?? self.timeOnly, |
| 12813 | 12865 | timeOnlyConverter: timeOnlyConverter ?? self.timeOnlyConverter, |
| 12814 | 12866 | timeZone: timeZone ?? self.timeZone, |
| 12867 | + toDict: toDict ?? self.toDict, | |
| 12815 | 12868 | toJSON: toJSON ?? self.toJSON, |
| 12816 | 12869 | toString: toString ?? self.toString, |
| 12817 | 12870 | topLevel: topLevel ?? self.topLevel, |
| @@ -12826,10 +12879,9 @@ extension Obj5 { | ||
| 12826 | 12879 | unchecked: unchecked ?? self.unchecked, |
| 12827 | 12880 | undefined: undefined ?? self.undefined, |
| 12828 | 12881 | union: union ?? self.union, |
| 12882 | + unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON, | |
| 12829 | 12883 | unsafe: unsafe ?? self.unsafe, |
| 12830 | - unsigned: unsigned ?? self.unsigned, | |
| 12831 | - useSerializers: useSerializers ?? self.useSerializers, | |
| 12832 | - ushort: ushort ?? self.ushort | |
| 12884 | + useSerializers: useSerializers ?? self.useSerializers | |
| 12833 | 12885 | ) |
| 12834 | 12886 | } |
| 12835 | 12887 | |
| @@ -13634,6 +13686,50 @@ extension TrueClass { | ||
| 13634 | 13686 | } |
| 13635 | 13687 | } |
| 13636 | 13688 | |
| 13689 | +// MARK: - Select | |
| 13690 | +struct Select: Codable, Sendable { | |
| 13691 | + let select: Int | |
| 13692 | + | |
| 13693 | + enum CodingKeys: String, CodingKey { | |
| 13694 | + case select = "select" | |
| 13695 | + } | |
| 13696 | +} | |
| 13697 | + | |
| 13698 | +// MARK: Select convenience initializers and mutators | |
| 13699 | + | |
| 13700 | +extension Select { | |
| 13701 | + init(data: Data) throws { | |
| 13702 | + self = try newJSONDecoder().decode(Select.self, from: data) | |
| 13703 | + } | |
| 13704 | + | |
| 13705 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 13706 | + guard let data = json.data(using: encoding) else { | |
| 13707 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 13708 | + } | |
| 13709 | + try self.init(data: data) | |
| 13710 | + } | |
| 13711 | + | |
| 13712 | + init(fromURL url: URL) throws { | |
| 13713 | + try self.init(data: try Data(contentsOf: url)) | |
| 13714 | + } | |
| 13715 | + | |
| 13716 | + func with( | |
| 13717 | + select: Int? = nil | |
| 13718 | + ) -> Select { | |
| 13719 | + return Select( | |
| 13720 | + select: select ?? self.select | |
| 13721 | + ) | |
| 13722 | + } | |
| 13723 | + | |
| 13724 | + func jsonData() throws -> Data { | |
| 13725 | + return try newJSONEncoder().encode(self) | |
| 13726 | + } | |
| 13727 | + | |
| 13728 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 13729 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 13730 | + } | |
| 13731 | +} | |
| 13732 | + | |
| 13637 | 13733 | // MARK: - SendableClass |
| 13638 | 13734 | struct SendableClass: Codable, Sendable { |
| 13639 | 13735 | let sendable: Int |
| @@ -14866,6 +14962,50 @@ extension TimeZoneClass { | ||
| 14866 | 14962 | } |
| 14867 | 14963 | } |
| 14868 | 14964 | |
| 14965 | +// MARK: - ToDict | |
| 14966 | +struct ToDict: Codable, Sendable { | |
| 14967 | + let toDict: Int | |
| 14968 | + | |
| 14969 | + enum CodingKeys: String, CodingKey { | |
| 14970 | + case toDict = "to_dict" | |
| 14971 | + } | |
| 14972 | +} | |
| 14973 | + | |
| 14974 | +// MARK: ToDict convenience initializers and mutators | |
| 14975 | + | |
| 14976 | +extension ToDict { | |
| 14977 | + init(data: Data) throws { | |
| 14978 | + self = try newJSONDecoder().decode(ToDict.self, from: data) | |
| 14979 | + } | |
| 14980 | + | |
| 14981 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 14982 | + guard let data = json.data(using: encoding) else { | |
| 14983 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 14984 | + } | |
| 14985 | + try self.init(data: data) | |
| 14986 | + } | |
| 14987 | + | |
| 14988 | + init(fromURL url: URL) throws { | |
| 14989 | + try self.init(data: try Data(contentsOf: url)) | |
| 14990 | + } | |
| 14991 | + | |
| 14992 | + func with( | |
| 14993 | + toDict: Int? = nil | |
| 14994 | + ) -> ToDict { | |
| 14995 | + return ToDict( | |
| 14996 | + toDict: toDict ?? self.toDict | |
| 14997 | + ) | |
| 14998 | + } | |
| 14999 | + | |
| 15000 | + func jsonData() throws -> Data { | |
| 15001 | + return try newJSONEncoder().encode(self) | |
| 15002 | + } | |
| 15003 | + | |
| 15004 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 15005 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 15006 | + } | |
| 15007 | +} | |
| 15008 | + | |
| 14869 | 15009 | // MARK: - ToJSON |
| 14870 | 15010 | struct ToJSON: Codable, Sendable { |
| 14871 | 15011 | let toJSON: Int |
| @@ -15482,20 +15622,20 @@ extension Union { | ||
| 15482 | 15622 | } |
| 15483 | 15623 | } |
| 15484 | 15624 | |
| 15485 | -// MARK: - Unsafe | |
| 15486 | -struct Unsafe: Codable, Sendable { | |
| 15487 | - let unsafe: Int | |
| 15625 | +// MARK: - UnmarshalJSON | |
| 15626 | +struct UnmarshalJSON: Codable, Sendable { | |
| 15627 | + let unmarshalJSON: Int | |
| 15488 | 15628 | |
| 15489 | 15629 | enum CodingKeys: String, CodingKey { |
| 15490 | - case unsafe = "unsafe" | |
| 15630 | + case unmarshalJSON = "UnmarshalJSON" | |
| 15491 | 15631 | } |
| 15492 | 15632 | } |
| 15493 | 15633 | |
| 15494 | -// MARK: Unsafe convenience initializers and mutators | |
| 15634 | +// MARK: UnmarshalJSON convenience initializers and mutators | |
| 15495 | 15635 | |
| 15496 | -extension Unsafe { | |
| 15636 | +extension UnmarshalJSON { | |
| 15497 | 15637 | init(data: Data) throws { |
| 15498 | - self = try newJSONDecoder().decode(Unsafe.self, from: data) | |
| 15638 | + self = try newJSONDecoder().decode(UnmarshalJSON.self, from: data) | |
| 15499 | 15639 | } |
| 15500 | 15640 | |
| 15501 | 15641 | init(_ json: String, using encoding: String.Encoding = .utf8) throws { |
| @@ -15510,10 +15650,10 @@ extension Unsafe { | ||
| 15510 | 15650 | } |
| 15511 | 15651 | |
| 15512 | 15652 | func with( |
| 15513 | - unsafe: Int? = nil | |
| 15514 | - ) -> Unsafe { | |
| 15515 | - return Unsafe( | |
| 15516 | - unsafe: unsafe ?? self.unsafe | |
| 15653 | + unmarshalJSON: Int? = nil | |
| 15654 | + ) -> UnmarshalJSON { | |
| 15655 | + return UnmarshalJSON( | |
| 15656 | + unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON | |
| 15517 | 15657 | ) |
| 15518 | 15658 | } |
| 15519 | 15659 | |
| @@ -15526,20 +15666,20 @@ extension Unsafe { | ||
| 15526 | 15666 | } |
| 15527 | 15667 | } |
| 15528 | 15668 | |
| 15529 | -// MARK: - Unsigned | |
| 15530 | -struct Unsigned: Codable, Sendable { | |
| 15531 | - let unsigned: Int | |
| 15669 | +// MARK: - Unsafe | |
| 15670 | +struct Unsafe: Codable, Sendable { | |
| 15671 | + let unsafe: Int | |
| 15532 | 15672 | |
| 15533 | 15673 | enum CodingKeys: String, CodingKey { |
| 15534 | - case unsigned = "unsigned" | |
| 15674 | + case unsafe = "unsafe" | |
| 15535 | 15675 | } |
| 15536 | 15676 | } |
| 15537 | 15677 | |
| 15538 | -// MARK: Unsigned convenience initializers and mutators | |
| 15678 | +// MARK: Unsafe convenience initializers and mutators | |
| 15539 | 15679 | |
| 15540 | -extension Unsigned { | |
| 15680 | +extension Unsafe { | |
| 15541 | 15681 | init(data: Data) throws { |
| 15542 | - self = try newJSONDecoder().decode(Unsigned.self, from: data) | |
| 15682 | + self = try newJSONDecoder().decode(Unsafe.self, from: data) | |
| 15543 | 15683 | } |
| 15544 | 15684 | |
| 15545 | 15685 | init(_ json: String, using encoding: String.Encoding = .utf8) throws { |
| @@ -15554,10 +15694,10 @@ extension Unsigned { | ||
| 15554 | 15694 | } |
| 15555 | 15695 | |
| 15556 | 15696 | func with( |
| 15557 | - unsigned: Int? = nil | |
| 15558 | - ) -> Unsigned { | |
| 15559 | - return Unsigned( | |
| 15560 | - unsigned: unsigned ?? self.unsigned | |
| 15697 | + unsafe: Int? = nil | |
| 15698 | + ) -> Unsafe { | |
| 15699 | + return Unsafe( | |
| 15700 | + unsafe: unsafe ?? self.unsafe | |
| 15561 | 15701 | ) |
| 15562 | 15702 | } |
| 15563 | 15703 | |
| @@ -15614,50 +15754,6 @@ extension UseSerializers { | ||
| 15614 | 15754 | } |
| 15615 | 15755 | } |
| 15616 | 15756 | |
| 15617 | -// MARK: - Ushort | |
| 15618 | -struct Ushort: Codable, Sendable { | |
| 15619 | - let ushort: Int | |
| 15620 | - | |
| 15621 | - enum CodingKeys: String, CodingKey { | |
| 15622 | - case ushort = "ushort" | |
| 15623 | - } | |
| 15624 | -} | |
| 15625 | - | |
| 15626 | -// MARK: Ushort convenience initializers and mutators | |
| 15627 | - | |
| 15628 | -extension Ushort { | |
| 15629 | - init(data: Data) throws { | |
| 15630 | - self = try newJSONDecoder().decode(Ushort.self, from: data) | |
| 15631 | - } | |
| 15632 | - | |
| 15633 | - init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 15634 | - guard let data = json.data(using: encoding) else { | |
| 15635 | - throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 15636 | - } | |
| 15637 | - try self.init(data: data) | |
| 15638 | - } | |
| 15639 | - | |
| 15640 | - init(fromURL url: URL) throws { | |
| 15641 | - try self.init(data: try Data(contentsOf: url)) | |
| 15642 | - } | |
| 15643 | - | |
| 15644 | - func with( | |
| 15645 | - ushort: Int? = nil | |
| 15646 | - ) -> Ushort { | |
| 15647 | - return Ushort( | |
| 15648 | - ushort: ushort ?? self.ushort | |
| 15649 | - ) | |
| 15650 | - } | |
| 15651 | - | |
| 15652 | - func jsonData() throws -> Data { | |
| 15653 | - return try newJSONEncoder().encode(self) | |
| 15654 | - } | |
| 15655 | - | |
| 15656 | - func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 15657 | - return String(data: try self.jsonData(), encoding: encoding) | |
| 15658 | - } | |
| 15659 | -} | |
| 15660 | - | |
| 15661 | 15757 | // MARK: - Obj6 |
| 15662 | 15758 | struct Obj6: Codable, Sendable { |
| 15663 | 15759 | let dummy: Int |
| @@ -15666,6 +15762,8 @@ struct Obj6: Codable, Sendable { | ||
| 15666 | 15762 | let obj6Where: Where |
| 15667 | 15763 | let obj6While: While |
| 15668 | 15764 | let obj6WillSet: WillSet |
| 15765 | + let unsigned: Unsigned | |
| 15766 | + let ushort: Ushort | |
| 15669 | 15767 | let using: Using |
| 15670 | 15768 | let utf8JSONReader: Utf8JSONReader |
| 15671 | 15769 | let utf8JSONWriter: Utf8JSONWriter |
| @@ -15687,6 +15785,8 @@ struct Obj6: Codable, Sendable { | ||
| 15687 | 15785 | case obj6Where = "where" |
| 15688 | 15786 | case obj6While = "while" |
| 15689 | 15787 | case obj6WillSet = "willSet" |
| 15788 | + case unsigned = "unsigned" | |
| 15789 | + case ushort = "ushort" | |
| 15690 | 15790 | case using = "using" |
| 15691 | 15791 | case utf8JSONReader = "Utf8JsonReader" |
| 15692 | 15792 | case utf8JSONWriter = "Utf8JsonWriter" |
| @@ -15728,6 +15828,8 @@ extension Obj6 { | ||
| 15728 | 15828 | obj6Where: Where? = nil, |
| 15729 | 15829 | obj6While: While? = nil, |
| 15730 | 15830 | obj6WillSet: WillSet? = nil, |
| 15831 | + unsigned: Unsigned? = nil, | |
| 15832 | + ushort: Ushort? = nil, | |
| 15731 | 15833 | using: Using? = nil, |
| 15732 | 15834 | utf8JSONReader: Utf8JSONReader? = nil, |
| 15733 | 15835 | utf8JSONWriter: Utf8JSONWriter? = nil, |
| @@ -15749,6 +15851,8 @@ extension Obj6 { | ||
| 15749 | 15851 | obj6Where: obj6Where ?? self.obj6Where, |
| 15750 | 15852 | obj6While: obj6While ?? self.obj6While, |
| 15751 | 15853 | obj6WillSet: obj6WillSet ?? self.obj6WillSet, |
| 15854 | + unsigned: unsigned ?? self.unsigned, | |
| 15855 | + ushort: ushort ?? self.ushort, | |
| 15752 | 15856 | using: using ?? self.using, |
| 15753 | 15857 | utf8JSONReader: utf8JSONReader ?? self.utf8JSONReader, |
| 15754 | 15858 | utf8JSONWriter: utf8JSONWriter ?? self.utf8JSONWriter, |
| @@ -15994,6 +16098,94 @@ extension WillSet { | ||
| 15994 | 16098 | } |
| 15995 | 16099 | } |
| 15996 | 16100 | |
| 16101 | +// MARK: - Unsigned | |
| 16102 | +struct Unsigned: Codable, Sendable { | |
| 16103 | + let unsigned: Int | |
| 16104 | + | |
| 16105 | + enum CodingKeys: String, CodingKey { | |
| 16106 | + case unsigned = "unsigned" | |
| 16107 | + } | |
| 16108 | +} | |
| 16109 | + | |
| 16110 | +// MARK: Unsigned convenience initializers and mutators | |
| 16111 | + | |
| 16112 | +extension Unsigned { | |
| 16113 | + init(data: Data) throws { | |
| 16114 | + self = try newJSONDecoder().decode(Unsigned.self, from: data) | |
| 16115 | + } | |
| 16116 | + | |
| 16117 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 16118 | + guard let data = json.data(using: encoding) else { | |
| 16119 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 16120 | + } | |
| 16121 | + try self.init(data: data) | |
| 16122 | + } | |
| 16123 | + | |
| 16124 | + init(fromURL url: URL) throws { | |
| 16125 | + try self.init(data: try Data(contentsOf: url)) | |
| 16126 | + } | |
| 16127 | + | |
| 16128 | + func with( | |
| 16129 | + unsigned: Int? = nil | |
| 16130 | + ) -> Unsigned { | |
| 16131 | + return Unsigned( | |
| 16132 | + unsigned: unsigned ?? self.unsigned | |
| 16133 | + ) | |
| 16134 | + } | |
| 16135 | + | |
| 16136 | + func jsonData() throws -> Data { | |
| 16137 | + return try newJSONEncoder().encode(self) | |
| 16138 | + } | |
| 16139 | + | |
| 16140 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 16141 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 16142 | + } | |
| 16143 | +} | |
| 16144 | + | |
| 16145 | +// MARK: - Ushort | |
| 16146 | +struct Ushort: Codable, Sendable { | |
| 16147 | + let ushort: Int | |
| 16148 | + | |
| 16149 | + enum CodingKeys: String, CodingKey { | |
| 16150 | + case ushort = "ushort" | |
| 16151 | + } | |
| 16152 | +} | |
| 16153 | + | |
| 16154 | +// MARK: Ushort convenience initializers and mutators | |
| 16155 | + | |
| 16156 | +extension Ushort { | |
| 16157 | + init(data: Data) throws { | |
| 16158 | + self = try newJSONDecoder().decode(Ushort.self, from: data) | |
| 16159 | + } | |
| 16160 | + | |
| 16161 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 16162 | + guard let data = json.data(using: encoding) else { | |
| 16163 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 16164 | + } | |
| 16165 | + try self.init(data: data) | |
| 16166 | + } | |
| 16167 | + | |
| 16168 | + init(fromURL url: URL) throws { | |
| 16169 | + try self.init(data: try Data(contentsOf: url)) | |
| 16170 | + } | |
| 16171 | + | |
| 16172 | + func with( | |
| 16173 | + ushort: Int? = nil | |
| 16174 | + ) -> Ushort { | |
| 16175 | + return Ushort( | |
| 16176 | + ushort: ushort ?? self.ushort | |
| 16177 | + ) | |
| 16178 | + } | |
| 16179 | + | |
| 16180 | + func jsonData() throws -> Data { | |
| 16181 | + return try newJSONEncoder().encode(self) | |
| 16182 | + } | |
| 16183 | + | |
| 16184 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 16185 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 16186 | + } | |
| 16187 | +} | |
| 16188 | + | |
| 15997 | 16189 | // MARK: - Using |
| 15998 | 16190 | struct Using: Codable, Sendable { |
| 15999 | 16191 | let using: Int |
Mtypescript-effect-schemadefault / TopLevel.ts+45 −25
| @@ -79,8 +79,18 @@ export class Using extends S.Class<Using>("Using")({ | ||
| 79 | 79 | "using": S.Int, |
| 80 | 80 | }) {} |
| 81 | 81 | |
| 82 | +export class Ushort extends S.Class<Ushort>("Ushort")({ | |
| 83 | + "ushort": S.Int, | |
| 84 | +}) {} | |
| 85 | + | |
| 86 | +export class Unsigned extends S.Class<Unsigned>("Unsigned")({ | |
| 87 | + "unsigned": S.Int, | |
| 88 | +}) {} | |
| 89 | + | |
| 82 | 90 | export class Obj6 extends S.Class<Obj6>("Obj6")({ |
| 83 | 91 | "dummy": S.Int, |
| 92 | + "unsigned": Unsigned, | |
| 93 | + "ushort": Ushort, | |
| 84 | 94 | "using": Using, |
| 85 | 95 | "Utf8JsonReader": Utf8JsonReader, |
| 86 | 96 | "Utf8JsonWriter": Utf8JsonWriter, |
| @@ -101,18 +111,10 @@ export class Obj6 extends S.Class<Obj6>("Obj6")({ | ||
| 101 | 111 | "yield": Yield, |
| 102 | 112 | }) {} |
| 103 | 113 | |
| 104 | -export class Ushort extends S.Class<Ushort>("Ushort")({ | |
| 105 | - "ushort": S.Int, | |
| 106 | -}) {} | |
| 107 | - | |
| 108 | 114 | export class UseSerializers extends S.Class<UseSerializers>("UseSerializers")({ |
| 109 | 115 | "UseSerializers": S.Int, |
| 110 | 116 | }) {} |
| 111 | 117 | |
| 112 | -export class Unsigned extends S.Class<Unsigned>("Unsigned")({ | |
| 113 | - "unsigned": S.Int, | |
| 114 | -}) {} | |
| 115 | - | |
| 116 | 118 | export class Unsafe extends S.Class<Unsafe>("Unsafe")({ |
| 117 | 119 | "unsafe": S.Int, |
| 118 | 120 | }) {} |
| @@ -121,6 +123,10 @@ export class Unowned extends S.Class<Unowned>("Unowned")({ | ||
| 121 | 123 | "unowned": S.Int, |
| 122 | 124 | }) {} |
| 123 | 125 | |
| 126 | +export class UnmarshalJson extends S.Class<UnmarshalJson>("UnmarshalJson")({ | |
| 127 | + "UnmarshalJSON": S.Int, | |
| 128 | +}) {} | |
| 129 | + | |
| 124 | 130 | export class Union extends S.Class<Union>("Union")({ |
| 125 | 131 | "union": S.Int, |
| 126 | 132 | }) {} |
| @@ -190,6 +196,10 @@ export class ToJson extends S.Class<ToJson>("ToJson")({ | ||
| 190 | 196 | "to_json": S.Int, |
| 191 | 197 | }) {} |
| 192 | 198 | |
| 199 | +export class ToDict extends S.Class<ToDict>("ToDict")({ | |
| 200 | + "to_dict": S.Int, | |
| 201 | +}) {} | |
| 202 | + | |
| 193 | 203 | export class TimeZone extends S.Class<TimeZone>("TimeZone")({ |
| 194 | 204 | "TimeZone": S.Int, |
| 195 | 205 | }) {} |
| @@ -338,6 +348,10 @@ export class Self extends S.Class<Self>("Self")({ | ||
| 338 | 348 | "Self": S.Int, |
| 339 | 349 | }) {} |
| 340 | 350 | |
| 351 | +export class Select extends S.Class<Select>("Select")({ | |
| 352 | + "select": S.Int, | |
| 353 | +}) {} | |
| 354 | + | |
| 341 | 355 | export class PrimitiveKind extends S.Class<PrimitiveKind>("PrimitiveKind")({ |
| 342 | 356 | "PrimitiveKind": S.Int, |
| 343 | 357 | }) {} |
| @@ -365,6 +379,7 @@ export class Obj5 extends S.Class<Obj5>("Obj5")({ | ||
| 365 | 379 | "true": TrueClass, |
| 366 | 380 | "type": TypeClass, |
| 367 | 381 | "PrimitiveKind": PrimitiveKind, |
| 382 | + "select": Select, | |
| 368 | 383 | "Self": Self, |
| 369 | 384 | "Sendable": Sendable, |
| 370 | 385 | "SerialDescriptor": SerialDescriptor, |
| @@ -402,6 +417,7 @@ export class Obj5 extends S.Class<Obj5>("Obj5")({ | ||
| 402 | 417 | "TimeOnly": TimeOnly, |
| 403 | 418 | "TimeOnlyConverter": TimeOnlyConverter, |
| 404 | 419 | "TimeZone": TimeZone, |
| 420 | + "to_dict": ToDict, | |
| 405 | 421 | "to_json": ToJson, |
| 406 | 422 | "toString": ToString, |
| 407 | 423 | "top_level": TopLevelClass, |
| @@ -419,18 +435,13 @@ export class Obj5 extends S.Class<Obj5>("Obj5")({ | ||
| 419 | 435 | "unchecked": Unchecked, |
| 420 | 436 | "undefined": Undefined, |
| 421 | 437 | "union": Union, |
| 438 | + "UnmarshalJSON": UnmarshalJson, | |
| 422 | 439 | "unowned": Unowned, |
| 423 | 440 | "unsafe": Unsafe, |
| 424 | - "unsigned": Unsigned, | |
| 425 | 441 | "UseSerializers": UseSerializers, |
| 426 | - "ushort": Ushort, | |
| 427 | 442 | }) {} |
| 428 | 443 | Object.defineProperty(Obj5.prototype, "toString", { writable: true }); |
| 429 | 444 | |
| 430 | -export class Select extends S.Class<Select>("Select")({ | |
| 431 | - "select": S.Int, | |
| 432 | -}) {} | |
| 433 | - | |
| 434 | 445 | export class Sel extends S.Class<Sel>("Sel")({ |
| 435 | 446 | "SEL": S.Int, |
| 436 | 447 | }) {} |
| @@ -679,6 +690,10 @@ export class Nonatomic extends S.Class<Nonatomic>("Nonatomic")({ | ||
| 679 | 690 | "nonatomic": S.Int, |
| 680 | 691 | }) {} |
| 681 | 692 | |
| 693 | +export class Noexcept extends S.Class<Noexcept>("Noexcept")({ | |
| 694 | + "noexcept": S.Int, | |
| 695 | +}) {} | |
| 696 | + | |
| 682 | 697 | export class NoSuchMethod extends S.Class<NoSuchMethod>("NoSuchMethod")({ |
| 683 | 698 | "noSuchMethod": S.Int, |
| 684 | 699 | }) {} |
| @@ -686,6 +701,7 @@ export class NoSuchMethod extends S.Class<NoSuchMethod>("NoSuchMethod")({ | ||
| 686 | 701 | export class Obj4 extends S.Class<Obj4>("Obj4")({ |
| 687 | 702 | "dummy": S.Int, |
| 688 | 703 | "noSuchMethod": NoSuchMethod, |
| 704 | + "noexcept": Noexcept, | |
| 689 | 705 | "nonatomic": Nonatomic, |
| 690 | 706 | "None": None, |
| 691 | 707 | "nonlocal": Nonlocal, |
| @@ -748,11 +764,6 @@ export class Obj4 extends S.Class<Obj4>("Obj4")({ | ||
| 748 | 764 | "sbyte": Sbyte, |
| 749 | 765 | "sealed": Sealed, |
| 750 | 766 | "SEL": Sel, |
| 751 | - "select": Select, | |
| 752 | -}) {} | |
| 753 | - | |
| 754 | -export class Noexcept extends S.Class<Noexcept>("Noexcept")({ | |
| 755 | - "noexcept": S.Int, | |
| 756 | 767 | }) {} |
| 757 | 768 | |
| 758 | 769 | export class No extends S.Class<No>("No")({ |
| @@ -795,6 +806,10 @@ export class MetadataPropertyHandling extends S.Class<MetadataPropertyHandling>( | ||
| 795 | 806 | "metadata_property_handling": S.Int, |
| 796 | 807 | }) {} |
| 797 | 808 | |
| 809 | +export class MarshalJson extends S.Class<MarshalJson>("MarshalJson")({ | |
| 810 | + "MarshalJSON": S.Int, | |
| 811 | +}) {} | |
| 812 | + | |
| 798 | 813 | export class MapEntry extends S.Class<MapEntry>("MapEntry")({ |
| 799 | 814 | "MapEntry": S.Int, |
| 800 | 815 | }) {} |
| @@ -1007,8 +1022,13 @@ export class Guard extends S.Class<Guard>("Guard")({ | ||
| 1007 | 1022 | "guard": S.Int, |
| 1008 | 1023 | }) {} |
| 1009 | 1024 | |
| 1025 | +export class Goto extends S.Class<Goto>("Goto")({ | |
| 1026 | + "goto": S.Int, | |
| 1027 | +}) {} | |
| 1028 | + | |
| 1010 | 1029 | export class Obj3 extends S.Class<Obj3>("Obj3")({ |
| 1011 | 1030 | "dummy": S.Int, |
| 1031 | + "goto": Goto, | |
| 1012 | 1032 | "guard": Guard, |
| 1013 | 1033 | "hasOwnProperty": HasOwnProperty, |
| 1014 | 1034 | "hashCode": HashCode, |
| @@ -1062,6 +1082,7 @@ export class Obj3 extends S.Class<Obj3>("Obj3")({ | ||
| 1062 | 1082 | "long": Long, |
| 1063 | 1083 | "map": Map, |
| 1064 | 1084 | "MapEntry": MapEntry, |
| 1085 | + "MarshalJSON": MarshalJson, | |
| 1065 | 1086 | "metadata_property_handling": MetadataPropertyHandling, |
| 1066 | 1087 | "module": Module, |
| 1067 | 1088 | "mutable": Mutable, |
| @@ -1072,17 +1093,12 @@ export class Obj3 extends S.Class<Obj3>("Obj3")({ | ||
| 1072 | 1093 | "newtonsoft": Newtonsoft, |
| 1073 | 1094 | "nil": Nil, |
| 1074 | 1095 | "NO": No, |
| 1075 | - "noexcept": Noexcept, | |
| 1076 | 1096 | }) {} |
| 1077 | 1097 | |
| 1078 | 1098 | export class FalseClass extends S.Class<FalseClass>("FalseClass")({ |
| 1079 | 1099 | "false": S.Int, |
| 1080 | 1100 | }) {} |
| 1081 | 1101 | |
| 1082 | -export class Goto extends S.Class<Goto>("Goto")({ | |
| 1083 | - "goto": S.Int, | |
| 1084 | -}) {} | |
| 1085 | - | |
| 1086 | 1102 | export class Go extends S.Class<Go>("Go")({ |
| 1087 | 1103 | "go": S.Int, |
| 1088 | 1104 | }) {} |
| @@ -1107,6 +1123,10 @@ export class FromJson extends S.Class<FromJson>("FromJson")({ | ||
| 1107 | 1123 | "from_json": S.Int, |
| 1108 | 1124 | }) {} |
| 1109 | 1125 | |
| 1126 | +export class FromDict extends S.Class<FromDict>("FromDict")({ | |
| 1127 | + "from_dict": S.Int, | |
| 1128 | +}) {} | |
| 1129 | + | |
| 1110 | 1130 | export class From extends S.Class<From>("From")({ |
| 1111 | 1131 | "from": S.Int, |
| 1112 | 1132 | }) {} |
| @@ -1389,13 +1409,13 @@ export class Obj2 extends S.Class<Obj2>("Obj2")({ | ||
| 1389 | 1409 | "FormatException": FormatException, |
| 1390 | 1410 | "friend": Friend, |
| 1391 | 1411 | "from": From, |
| 1412 | + "from_dict": FromDict, | |
| 1392 | 1413 | "from_json": FromJson, |
| 1393 | 1414 | "func": Func, |
| 1394 | 1415 | "function": Function, |
| 1395 | 1416 | "get": Get, |
| 1396 | 1417 | "global": Global, |
| 1397 | 1418 | "go": Go, |
| 1398 | - "goto": Goto, | |
| 1399 | 1419 | "false": FalseClass, |
| 1400 | 1420 | }) {} |
Mtypescript-zoddefault / TopLevel.ts+49 −25
| @@ -607,6 +607,11 @@ export const FromSchema = z.object({ | ||
| 607 | 607 | }); |
| 608 | 608 | export type From = z.infer<typeof FromSchema>; |
| 609 | 609 | |
| 610 | +export const FromDictSchema = z.object({ | |
| 611 | + "from_dict": z.number().int(), | |
| 612 | +}); | |
| 613 | +export type FromDict = z.infer<typeof FromDictSchema>; | |
| 614 | + | |
| 610 | 615 | export const FromJsonSchema = z.object({ |
| 611 | 616 | "from_json": z.number().int(), |
| 612 | 617 | }); |
| @@ -637,16 +642,16 @@ export const GoSchema = z.object({ | ||
| 637 | 642 | }); |
| 638 | 643 | export type Go = z.infer<typeof GoSchema>; |
| 639 | 644 | |
| 640 | -export const GotoSchema = z.object({ | |
| 641 | - "goto": z.number().int(), | |
| 642 | -}); | |
| 643 | -export type Goto = z.infer<typeof GotoSchema>; | |
| 644 | - | |
| 645 | 645 | export const FalseClassSchema = z.object({ |
| 646 | 646 | "false": z.number().int(), |
| 647 | 647 | }); |
| 648 | 648 | export type FalseClass = z.infer<typeof FalseClassSchema>; |
| 649 | 649 | |
| 650 | +export const GotoSchema = z.object({ | |
| 651 | + "goto": z.number().int(), | |
| 652 | +}); | |
| 653 | +export type Goto = z.infer<typeof GotoSchema>; | |
| 654 | + | |
| 650 | 655 | export const GuardSchema = z.object({ |
| 651 | 656 | "guard": z.number().int(), |
| 652 | 657 | }); |
| @@ -912,6 +917,11 @@ export const MapEntrySchema = z.object({ | ||
| 912 | 917 | }); |
| 913 | 918 | export type MapEntry = z.infer<typeof MapEntrySchema>; |
| 914 | 919 | |
| 920 | +export const MarshalJsonSchema = z.object({ | |
| 921 | + "MarshalJSON": z.number().int(), | |
| 922 | +}); | |
| 923 | +export type MarshalJson = z.infer<typeof MarshalJsonSchema>; | |
| 924 | + | |
| 915 | 925 | export const MetadataPropertyHandlingSchema = z.object({ |
| 916 | 926 | "metadata_property_handling": z.number().int(), |
| 917 | 927 | }); |
| @@ -962,16 +972,16 @@ export const NoSchema = z.object({ | ||
| 962 | 972 | }); |
| 963 | 973 | export type No = z.infer<typeof NoSchema>; |
| 964 | 974 | |
| 965 | -export const NoexceptSchema = z.object({ | |
| 966 | - "noexcept": z.number().int(), | |
| 967 | -}); | |
| 968 | -export type Noexcept = z.infer<typeof NoexceptSchema>; | |
| 969 | - | |
| 970 | 975 | export const NoSuchMethodSchema = z.object({ |
| 971 | 976 | "noSuchMethod": z.number().int(), |
| 972 | 977 | }); |
| 973 | 978 | export type NoSuchMethod = z.infer<typeof NoSuchMethodSchema>; |
| 974 | 979 | |
| 980 | +export const NoexceptSchema = z.object({ | |
| 981 | + "noexcept": z.number().int(), | |
| 982 | +}); | |
| 983 | +export type Noexcept = z.infer<typeof NoexceptSchema>; | |
| 984 | + | |
| 975 | 985 | export const NonatomicSchema = z.object({ |
| 976 | 986 | "nonatomic": z.number().int(), |
| 977 | 987 | }); |
| @@ -1282,11 +1292,6 @@ export const SelSchema = z.object({ | ||
| 1282 | 1292 | }); |
| 1283 | 1293 | export type Sel = z.infer<typeof SelSchema>; |
| 1284 | 1294 | |
| 1285 | -export const SelectSchema = z.object({ | |
| 1286 | - "select": z.number().int(), | |
| 1287 | -}); | |
| 1288 | -export type Select = z.infer<typeof SelectSchema>; | |
| 1289 | - | |
| 1290 | 1295 | export const KSerializerSchema = z.object({ |
| 1291 | 1296 | "KSerializer": z.number().int(), |
| 1292 | 1297 | }); |
| @@ -1312,6 +1317,11 @@ export const PrimitiveKindSchema = z.object({ | ||
| 1312 | 1317 | }); |
| 1313 | 1318 | export type PrimitiveKind = z.infer<typeof PrimitiveKindSchema>; |
| 1314 | 1319 | |
| 1320 | +export const SelectSchema = z.object({ | |
| 1321 | + "select": z.number().int(), | |
| 1322 | +}); | |
| 1323 | +export type Select = z.infer<typeof SelectSchema>; | |
| 1324 | + | |
| 1315 | 1325 | export const SelfSchema = z.object({ |
| 1316 | 1326 | "Self": z.number().int(), |
| 1317 | 1327 | }); |
| @@ -1497,6 +1507,11 @@ export const TimeZoneSchema = z.object({ | ||
| 1497 | 1507 | }); |
| 1498 | 1508 | export type TimeZone = z.infer<typeof TimeZoneSchema>; |
| 1499 | 1509 | |
| 1510 | +export const ToDictSchema = z.object({ | |
| 1511 | + "to_dict": z.number().int(), | |
| 1512 | +}); | |
| 1513 | +export type ToDict = z.infer<typeof ToDictSchema>; | |
| 1514 | + | |
| 1500 | 1515 | export const ToJsonSchema = z.object({ |
| 1501 | 1516 | "to_json": z.number().int(), |
| 1502 | 1517 | }); |
| @@ -1582,6 +1597,11 @@ export const UnionSchema = z.object({ | ||
| 1582 | 1597 | }); |
| 1583 | 1598 | export type Union = z.infer<typeof UnionSchema>; |
| 1584 | 1599 | |
| 1600 | +export const UnmarshalJsonSchema = z.object({ | |
| 1601 | + "UnmarshalJSON": z.number().int(), | |
| 1602 | +}); | |
| 1603 | +export type UnmarshalJson = z.infer<typeof UnmarshalJsonSchema>; | |
| 1604 | + | |
| 1585 | 1605 | export const UnownedSchema = z.object({ |
| 1586 | 1606 | "unowned": z.number().int(), |
| 1587 | 1607 | }); |
| @@ -1592,16 +1612,16 @@ export const UnsafeSchema = z.object({ | ||
| 1592 | 1612 | }); |
| 1593 | 1613 | export type Unsafe = z.infer<typeof UnsafeSchema>; |
| 1594 | 1614 | |
| 1595 | -export const UnsignedSchema = z.object({ | |
| 1596 | - "unsigned": z.number().int(), | |
| 1597 | -}); | |
| 1598 | -export type Unsigned = z.infer<typeof UnsignedSchema>; | |
| 1599 | - | |
| 1600 | 1615 | export const UseSerializersSchema = z.object({ |
| 1601 | 1616 | "UseSerializers": z.number().int(), |
| 1602 | 1617 | }); |
| 1603 | 1618 | export type UseSerializers = z.infer<typeof UseSerializersSchema>; |
| 1604 | 1619 | |
| 1620 | +export const UnsignedSchema = z.object({ | |
| 1621 | + "unsigned": z.number().int(), | |
| 1622 | +}); | |
| 1623 | +export type Unsigned = z.infer<typeof UnsignedSchema>; | |
| 1624 | + | |
| 1605 | 1625 | export const UshortSchema = z.object({ |
| 1606 | 1626 | "ushort": z.number().int(), |
| 1607 | 1627 | }); |
| @@ -1824,19 +1844,20 @@ export const Obj2Schema = z.object({ | ||
| 1824 | 1844 | "FormatException": FormatExceptionSchema, |
| 1825 | 1845 | "friend": FriendSchema, |
| 1826 | 1846 | "from": FromSchema, |
| 1847 | + "from_dict": FromDictSchema, | |
| 1827 | 1848 | "from_json": FromJsonSchema, |
| 1828 | 1849 | "func": FuncSchema, |
| 1829 | 1850 | "function": FunctionSchema, |
| 1830 | 1851 | "get": GetSchema, |
| 1831 | 1852 | "global": GlobalSchema, |
| 1832 | 1853 | "go": GoSchema, |
| 1833 | - "goto": GotoSchema, | |
| 1834 | 1854 | "false": FalseClassSchema, |
| 1835 | 1855 | }); |
| 1836 | 1856 | export type Obj2 = z.infer<typeof Obj2Schema>; |
| 1837 | 1857 | |
| 1838 | 1858 | export const Obj3Schema = z.object({ |
| 1839 | 1859 | "dummy": z.number().int(), |
| 1860 | + "goto": GotoSchema, | |
| 1840 | 1861 | "guard": GuardSchema, |
| 1841 | 1862 | "hasOwnProperty": HasOwnPropertySchema, |
| 1842 | 1863 | "hashCode": HashCodeSchema, |
| @@ -1890,6 +1911,7 @@ export const Obj3Schema = z.object({ | ||
| 1890 | 1911 | "long": LongSchema, |
| 1891 | 1912 | "map": MapSchema, |
| 1892 | 1913 | "MapEntry": MapEntrySchema, |
| 1914 | + "MarshalJSON": MarshalJsonSchema, | |
| 1893 | 1915 | "metadata_property_handling": MetadataPropertyHandlingSchema, |
| 1894 | 1916 | "module": ModuleSchema, |
| 1895 | 1917 | "mutable": MutableSchema, |
| @@ -1900,13 +1922,13 @@ export const Obj3Schema = z.object({ | ||
| 1900 | 1922 | "newtonsoft": NewtonsoftSchema, |
| 1901 | 1923 | "nil": NilSchema, |
| 1902 | 1924 | "NO": NoSchema, |
| 1903 | - "noexcept": NoexceptSchema, | |
| 1904 | 1925 | }); |
| 1905 | 1926 | export type Obj3 = z.infer<typeof Obj3Schema>; |
| 1906 | 1927 | |
| 1907 | 1928 | export const Obj4Schema = z.object({ |
| 1908 | 1929 | "dummy": z.number().int(), |
| 1909 | 1930 | "noSuchMethod": NoSuchMethodSchema, |
| 1931 | + "noexcept": NoexceptSchema, | |
| 1910 | 1932 | "nonatomic": NonatomicSchema, |
| 1911 | 1933 | "None": NoneSchema, |
| 1912 | 1934 | "nonlocal": NonlocalSchema, |
| @@ -1969,7 +1991,6 @@ export const Obj4Schema = z.object({ | ||
| 1969 | 1991 | "sbyte": SbyteSchema, |
| 1970 | 1992 | "sealed": SealedSchema, |
| 1971 | 1993 | "SEL": SelSchema, |
| 1972 | - "select": SelectSchema, | |
| 1973 | 1994 | }); |
| 1974 | 1995 | export type Obj4 = z.infer<typeof Obj4Schema>; |
| 1975 | 1996 | |
| @@ -1980,6 +2001,7 @@ export const Obj5Schema = z.object({ | ||
| 1980 | 2001 | "true": TrueClassSchema, |
| 1981 | 2002 | "type": TypeClassSchema, |
| 1982 | 2003 | "PrimitiveKind": PrimitiveKindSchema, |
| 2004 | + "select": SelectSchema, | |
| 1983 | 2005 | "Self": SelfSchema, |
| 1984 | 2006 | "Sendable": SendableSchema, |
| 1985 | 2007 | "SerialDescriptor": SerialDescriptorSchema, |
| @@ -2017,6 +2039,7 @@ export const Obj5Schema = z.object({ | ||
| 2017 | 2039 | "TimeOnly": TimeOnlySchema, |
| 2018 | 2040 | "TimeOnlyConverter": TimeOnlyConverterSchema, |
| 2019 | 2041 | "TimeZone": TimeZoneSchema, |
| 2042 | + "to_dict": ToDictSchema, | |
| 2020 | 2043 | "to_json": ToJsonSchema, |
| 2021 | 2044 | "toString": ToStringSchema, |
| 2022 | 2045 | "top_level": TopLevelClassSchema, |
| @@ -2034,16 +2057,17 @@ export const Obj5Schema = z.object({ | ||
| 2034 | 2057 | "unchecked": UncheckedSchema, |
| 2035 | 2058 | "undefined": UndefinedSchema, |
| 2036 | 2059 | "union": UnionSchema, |
| 2060 | + "UnmarshalJSON": UnmarshalJsonSchema, | |
| 2037 | 2061 | "unowned": UnownedSchema, |
| 2038 | 2062 | "unsafe": UnsafeSchema, |
| 2039 | - "unsigned": UnsignedSchema, | |
| 2040 | 2063 | "UseSerializers": UseSerializersSchema, |
| 2041 | - "ushort": UshortSchema, | |
| 2042 | 2064 | }); |
| 2043 | 2065 | export type Obj5 = z.infer<typeof Obj5Schema>; |
| 2044 | 2066 | |
| 2045 | 2067 | export const Obj6Schema = z.object({ |
| 2046 | 2068 | "dummy": z.number().int(), |
| 2069 | + "unsigned": UnsignedSchema, | |
| 2070 | + "ushort": UshortSchema, | |
| 2047 | 2071 | "using": UsingSchema, |
| 2048 | 2072 | "Utf8JsonReader": Utf8JsonReaderSchema, |
| 2049 | 2073 | "Utf8JsonWriter": Utf8JsonWriterSchema, |
Mtypescriptdefault / TopLevel.ts+83 −47
| @@ -400,13 +400,13 @@ export interface Obj2 { | ||
| 400 | 400 | foreach: Foreach; |
| 401 | 401 | friend: Friend; |
| 402 | 402 | from: From; |
| 403 | + from_dict: FromDict; | |
| 403 | 404 | from_json: FromJSON; |
| 404 | 405 | func: Func; |
| 405 | 406 | function: Function; |
| 406 | 407 | get: Get; |
| 407 | 408 | global: Global; |
| 408 | 409 | go: Go; |
| 409 | - goto: Goto; | |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | export interface DateFormatter { |
| @@ -639,6 +639,10 @@ export interface From { | ||
| 639 | 639 | from: number; |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | +export interface FromDict { | |
| 643 | + from_dict: number; | |
| 644 | +} | |
| 645 | + | |
| 642 | 646 | export interface FromJSON { |
| 643 | 647 | from_json: number; |
| 644 | 648 | } |
| @@ -663,10 +667,6 @@ export interface Go { | ||
| 663 | 667 | go: number; |
| 664 | 668 | } |
| 665 | 669 | |
| 666 | -export interface Goto { | |
| 667 | - goto: number; | |
| 668 | -} | |
| 669 | - | |
| 670 | 670 | export interface Obj3 { |
| 671 | 671 | Hashable: Hashable; |
| 672 | 672 | Hasher: Hasher; |
| @@ -685,8 +685,10 @@ export interface Obj3 { | ||
| 685 | 685 | JsonTokenType: JSONTokenType; |
| 686 | 686 | Locale: Locale; |
| 687 | 687 | MapEntry: MapEntry; |
| 688 | + MarshalJSON: MarshalJSON; | |
| 688 | 689 | NO: No; |
| 689 | 690 | dummy: number; |
| 691 | + goto: Goto; | |
| 690 | 692 | guard: Guard; |
| 691 | 693 | hasOwnProperty: HasOwnProperty; |
| 692 | 694 | hashCode: HashCode; |
| @@ -732,7 +734,6 @@ export interface Obj3 { | ||
| 732 | 734 | new: New; |
| 733 | 735 | newtonsoft: Newtonsoft; |
| 734 | 736 | nil: Nil; |
| 735 | - noexcept: Noexcept; | |
| 736 | 737 | } |
| 737 | 738 | |
| 738 | 739 | export interface Hashable { |
| @@ -803,10 +804,18 @@ export interface MapEntry { | ||
| 803 | 804 | MapEntry: number; |
| 804 | 805 | } |
| 805 | 806 | |
| 807 | +export interface MarshalJSON { | |
| 808 | + MarshalJSON: number; | |
| 809 | +} | |
| 810 | + | |
| 806 | 811 | export interface No { |
| 807 | 812 | NO: number; |
| 808 | 813 | } |
| 809 | 814 | |
| 815 | +export interface Goto { | |
| 816 | + goto: number; | |
| 817 | +} | |
| 818 | + | |
| 810 | 819 | export interface Guard { |
| 811 | 820 | guard: number; |
| 812 | 821 | } |
| @@ -987,10 +996,6 @@ export interface Nil { | ||
| 987 | 996 | nil: number; |
| 988 | 997 | } |
| 989 | 998 | |
| 990 | -export interface Noexcept { | |
| 991 | - noexcept: number; | |
| 992 | -} | |
| 993 | - | |
| 994 | 999 | export interface Obj4 { |
| 995 | 1000 | NSError: NSError; |
| 996 | 1001 | NSObject: NSObject; |
| @@ -1003,6 +1008,7 @@ export interface Obj4 { | ||
| 1003 | 1008 | SEL: Sel; |
| 1004 | 1009 | dummy: number; |
| 1005 | 1010 | noSuchMethod: NoSuchMethod; |
| 1011 | + noexcept: Noexcept; | |
| 1006 | 1012 | nonatomic: Nonatomic; |
| 1007 | 1013 | none: NoneClass; |
| 1008 | 1014 | nonlocal: Nonlocal; |
| @@ -1056,7 +1062,6 @@ export interface Obj4 { | ||
| 1056 | 1062 | s: S; |
| 1057 | 1063 | sbyte: Sbyte; |
| 1058 | 1064 | sealed: Sealed; |
| 1059 | - select: Select; | |
| 1060 | 1065 | } |
| 1061 | 1066 | |
| 1062 | 1067 | export interface NSError { |
| @@ -1099,6 +1104,10 @@ export interface NoSuchMethod { | ||
| 1099 | 1104 | noSuchMethod: number; |
| 1100 | 1105 | } |
| 1101 | 1106 | |
| 1107 | +export interface Noexcept { | |
| 1108 | + noexcept: number; | |
| 1109 | +} | |
| 1110 | + | |
| 1102 | 1111 | export interface Nonatomic { |
| 1103 | 1112 | nonatomic: number; |
| 1104 | 1113 | } |
| @@ -1311,10 +1320,6 @@ export interface Sealed { | ||
| 1311 | 1320 | sealed: number; |
| 1312 | 1321 | } |
| 1313 | 1322 | |
| 1314 | -export interface Select { | |
| 1315 | - select: number; | |
| 1316 | -} | |
| 1317 | - | |
| 1318 | 1323 | export interface Obj5 { |
| 1319 | 1324 | KSerializer: KSerializer; |
| 1320 | 1325 | PrimitiveKind: PrimitiveKind; |
| @@ -1333,8 +1338,10 @@ export interface Obj5 { | ||
| 1333 | 1338 | TimeZone: TimeZone; |
| 1334 | 1339 | True: True; |
| 1335 | 1340 | Type: Type; |
| 1341 | + UnmarshalJSON: UnmarshalJSON; | |
| 1336 | 1342 | UseSerializers: UseSerializers; |
| 1337 | 1343 | dummy: number; |
| 1344 | + select: Select; | |
| 1338 | 1345 | self: SelfClass; |
| 1339 | 1346 | serialize: Serialize; |
| 1340 | 1347 | set: Set; |
| @@ -1361,6 +1368,7 @@ export interface Obj5 { | ||
| 1361 | 1368 | throw: Throw; |
| 1362 | 1369 | throws: Throws; |
| 1363 | 1370 | toString: ToString; |
| 1371 | + to_dict: ToDict; | |
| 1364 | 1372 | to_json: ToJSON; |
| 1365 | 1373 | top_level: TopLevelClass; |
| 1366 | 1374 | transient: Transient; |
| @@ -1379,8 +1387,6 @@ export interface Obj5 { | ||
| 1379 | 1387 | union: Union; |
| 1380 | 1388 | unowned: Unowned; |
| 1381 | 1389 | unsafe: Unsafe; |
| 1382 | - unsigned: Unsigned; | |
| 1383 | - ushort: Ushort; | |
| 1384 | 1390 | } |
| 1385 | 1391 | |
| 1386 | 1392 | export interface KSerializer { |
| @@ -1451,10 +1457,18 @@ export interface Type { | ||
| 1451 | 1457 | Type: number; |
| 1452 | 1458 | } |
| 1453 | 1459 | |
| 1460 | +export interface UnmarshalJSON { | |
| 1461 | + UnmarshalJSON: number; | |
| 1462 | +} | |
| 1463 | + | |
| 1454 | 1464 | export interface UseSerializers { |
| 1455 | 1465 | UseSerializers: number; |
| 1456 | 1466 | } |
| 1457 | 1467 | |
| 1468 | +export interface Select { | |
| 1469 | + select: number; | |
| 1470 | +} | |
| 1471 | + | |
| 1458 | 1472 | export interface SelfClass { |
| 1459 | 1473 | self: number; |
| 1460 | 1474 | } |
| @@ -1559,6 +1573,10 @@ export interface ToString { | ||
| 1559 | 1573 | toString: number; |
| 1560 | 1574 | } |
| 1561 | 1575 | |
| 1576 | +export interface ToDict { | |
| 1577 | + to_dict: number; | |
| 1578 | +} | |
| 1579 | + | |
| 1562 | 1580 | export interface ToJSON { |
| 1563 | 1581 | to_json: number; |
| 1564 | 1582 | } |
| @@ -1631,20 +1649,14 @@ export interface Unsafe { | ||
| 1631 | 1649 | unsafe: number; |
| 1632 | 1650 | } |
| 1633 | 1651 | |
| 1634 | -export interface Unsigned { | |
| 1635 | - unsigned: number; | |
| 1636 | -} | |
| 1637 | - | |
| 1638 | -export interface Ushort { | |
| 1639 | - ushort: number; | |
| 1640 | -} | |
| 1641 | - | |
| 1642 | 1652 | export interface Obj6 { |
| 1643 | 1653 | UUID: UUID; |
| 1644 | 1654 | Utf8JsonReader: Utf8JSONReader; |
| 1645 | 1655 | Utf8JsonWriter: Utf8JSONWriter; |
| 1646 | 1656 | YES: Yes; |
| 1647 | 1657 | dummy: number; |
| 1658 | + unsigned: Unsigned; | |
| 1659 | + ushort: Ushort; | |
| 1648 | 1660 | using: Using; |
| 1649 | 1661 | var: Var; |
| 1650 | 1662 | virtual: Virtual; |
| @@ -1677,6 +1689,14 @@ export interface Yes { | ||
| 1677 | 1689 | YES: number; |
| 1678 | 1690 | } |
| 1679 | 1691 | |
| 1692 | +export interface Unsigned { | |
| 1693 | + unsigned: number; | |
| 1694 | +} | |
| 1695 | + | |
| 1696 | +export interface Ushort { | |
| 1697 | + ushort: number; | |
| 1698 | +} | |
| 1699 | + | |
| 1680 | 1700 | export interface Using { |
| 1681 | 1701 | using: number; |
| 1682 | 1702 | } |
| @@ -1829,7 +1849,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 1829 | 1849 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 1830 | 1850 | return invalidValue(l(ref || "object"), val, key, parent); |
| 1831 | 1851 | } |
| 1832 | - const result: any = {}; | |
| 1852 | + const result: any = Object.create(null); | |
| 1833 | 1853 | Object.getOwnPropertyNames(props).forEach(key => { |
| 1834 | 1854 | const prop = props[key]; |
| 1835 | 1855 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -1840,7 +1860,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 1840 | 1860 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 1841 | 1861 | } |
| 1842 | 1862 | }); |
| 1843 | - return result; | |
| 1863 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 1844 | 1864 | } |
| 1845 | 1865 | |
| 1846 | 1866 | if (typ === "any") return val; |
| @@ -2248,13 +2268,13 @@ const typeMap: any = { | ||
| 2248 | 2268 | { json: "foreach", js: "foreach", typ: r("Foreach") }, |
| 2249 | 2269 | { json: "friend", js: "friend", typ: r("Friend") }, |
| 2250 | 2270 | { json: "from", js: "from", typ: r("From") }, |
| 2271 | + { json: "from_dict", js: "from_dict", typ: r("FromDict") }, | |
| 2251 | 2272 | { json: "from_json", js: "from_json", typ: r("FromJSON") }, |
| 2252 | 2273 | { json: "func", js: "func", typ: r("Func") }, |
| 2253 | 2274 | { json: "function", js: "function", typ: r("Function") }, |
| 2254 | 2275 | { json: "get", js: "get", typ: r("Get") }, |
| 2255 | 2276 | { json: "global", js: "global", typ: r("Global") }, |
| 2256 | 2277 | { json: "go", js: "go", typ: r("Go") }, |
| 2257 | - { json: "goto", js: "goto", typ: r("Goto") }, | |
| 2258 | 2278 | ], false), |
| 2259 | 2279 | "DateFormatter": o([ |
| 2260 | 2280 | { json: "DateFormatter", js: "DateFormatter", typ: i(0) }, |
| @@ -2427,6 +2447,9 @@ const typeMap: any = { | ||
| 2427 | 2447 | "From": o([ |
| 2428 | 2448 | { json: "from", js: "from", typ: i(0) }, |
| 2429 | 2449 | ], false), |
| 2450 | + "FromDict": o([ | |
| 2451 | + { json: "from_dict", js: "from_dict", typ: i(0) }, | |
| 2452 | + ], false), | |
| 2430 | 2453 | "FromJSON": o([ |
| 2431 | 2454 | { json: "from_json", js: "from_json", typ: i(0) }, |
| 2432 | 2455 | ], false), |
| @@ -2445,9 +2468,6 @@ const typeMap: any = { | ||
| 2445 | 2468 | "Go": o([ |
| 2446 | 2469 | { json: "go", js: "go", typ: i(0) }, |
| 2447 | 2470 | ], false), |
| 2448 | - "Goto": o([ | |
| 2449 | - { json: "goto", js: "goto", typ: i(0) }, | |
| 2450 | - ], false), | |
| 2451 | 2471 | "Obj3": o([ |
| 2452 | 2472 | { json: "Hashable", js: "Hashable", typ: r("Hashable") }, |
| 2453 | 2473 | { json: "Hasher", js: "Hasher", typ: r("Hasher") }, |
| @@ -2466,8 +2486,10 @@ const typeMap: any = { | ||
| 2466 | 2486 | { json: "JsonTokenType", js: "JsonTokenType", typ: r("JSONTokenType") }, |
| 2467 | 2487 | { json: "Locale", js: "Locale", typ: r("Locale") }, |
| 2468 | 2488 | { json: "MapEntry", js: "MapEntry", typ: r("MapEntry") }, |
| 2489 | + { json: "MarshalJSON", js: "MarshalJSON", typ: r("MarshalJSON") }, | |
| 2469 | 2490 | { json: "NO", js: "NO", typ: r("No") }, |
| 2470 | 2491 | { json: "dummy", js: "dummy", typ: i(0) }, |
| 2492 | + { json: "goto", js: "goto", typ: r("Goto") }, | |
| 2471 | 2493 | { json: "guard", js: "guard", typ: r("Guard") }, |
| 2472 | 2494 | { json: "hasOwnProperty", js: "hasOwnProperty", typ: r("HasOwnProperty") }, |
| 2473 | 2495 | { json: "hashCode", js: "hashCode", typ: r("HashCode") }, |
| @@ -2513,7 +2535,6 @@ const typeMap: any = { | ||
| 2513 | 2535 | { json: "new", js: "new", typ: r("New") }, |
| 2514 | 2536 | { json: "newtonsoft", js: "newtonsoft", typ: r("Newtonsoft") }, |
| 2515 | 2537 | { json: "nil", js: "nil", typ: r("Nil") }, |
| 2516 | - { json: "noexcept", js: "noexcept", typ: r("Noexcept") }, | |
| 2517 | 2538 | ], false), |
| 2518 | 2539 | "Hashable": o([ |
| 2519 | 2540 | { json: "Hashable", js: "Hashable", typ: i(0) }, |
| @@ -2566,9 +2587,15 @@ const typeMap: any = { | ||
| 2566 | 2587 | "MapEntry": o([ |
| 2567 | 2588 | { json: "MapEntry", js: "MapEntry", typ: i(0) }, |
| 2568 | 2589 | ], false), |
| 2590 | + "MarshalJSON": o([ | |
| 2591 | + { json: "MarshalJSON", js: "MarshalJSON", typ: i(0) }, | |
| 2592 | + ], false), | |
| 2569 | 2593 | "No": o([ |
| 2570 | 2594 | { json: "NO", js: "NO", typ: i(0) }, |
| 2571 | 2595 | ], false), |
| 2596 | + "Goto": o([ | |
| 2597 | + { json: "goto", js: "goto", typ: i(0) }, | |
| 2598 | + ], false), | |
| 2572 | 2599 | "Guard": o([ |
| 2573 | 2600 | { json: "guard", js: "guard", typ: i(0) }, |
| 2574 | 2601 | ], false), |
| @@ -2704,9 +2731,6 @@ const typeMap: any = { | ||
| 2704 | 2731 | "Nil": o([ |
| 2705 | 2732 | { json: "nil", js: "nil", typ: i(0) }, |
| 2706 | 2733 | ], false), |
| 2707 | - "Noexcept": o([ | |
| 2708 | - { json: "noexcept", js: "noexcept", typ: i(0) }, | |
| 2709 | - ], false), | |
| 2710 | 2734 | "Obj4": o([ |
| 2711 | 2735 | { json: "NSError", js: "NSError", typ: r("NSError") }, |
| 2712 | 2736 | { json: "NSObject", js: "NSObject", typ: r("NSObject") }, |
| @@ -2719,6 +2743,7 @@ const typeMap: any = { | ||
| 2719 | 2743 | { json: "SEL", js: "SEL", typ: r("Sel") }, |
| 2720 | 2744 | { json: "dummy", js: "dummy", typ: i(0) }, |
| 2721 | 2745 | { json: "noSuchMethod", js: "noSuchMethod", typ: r("NoSuchMethod") }, |
| 2746 | + { json: "noexcept", js: "noexcept", typ: r("Noexcept") }, | |
| 2722 | 2747 | { json: "nonatomic", js: "nonatomic", typ: r("Nonatomic") }, |
| 2723 | 2748 | { json: "none", js: "none", typ: r("NoneClass") }, |
| 2724 | 2749 | { json: "nonlocal", js: "nonlocal", typ: r("Nonlocal") }, |
| @@ -2772,7 +2797,6 @@ const typeMap: any = { | ||
| 2772 | 2797 | { json: "s", js: "s", typ: r("S") }, |
| 2773 | 2798 | { json: "sbyte", js: "sbyte", typ: r("Sbyte") }, |
| 2774 | 2799 | { json: "sealed", js: "sealed", typ: r("Sealed") }, |
| 2775 | - { json: "select", js: "select", typ: r("Select") }, | |
| 2776 | 2800 | ], false), |
| 2777 | 2801 | "NSError": o([ |
| 2778 | 2802 | { json: "NSError", js: "NSError", typ: i(0) }, |
| @@ -2804,6 +2828,9 @@ const typeMap: any = { | ||
| 2804 | 2828 | "NoSuchMethod": o([ |
| 2805 | 2829 | { json: "noSuchMethod", js: "noSuchMethod", typ: i(0) }, |
| 2806 | 2830 | ], false), |
| 2831 | + "Noexcept": o([ | |
| 2832 | + { json: "noexcept", js: "noexcept", typ: i(0) }, | |
| 2833 | + ], false), | |
| 2807 | 2834 | "Nonatomic": o([ |
| 2808 | 2835 | { json: "nonatomic", js: "nonatomic", typ: i(0) }, |
| 2809 | 2836 | ], false), |
| @@ -2963,9 +2990,6 @@ const typeMap: any = { | ||
| 2963 | 2990 | "Sealed": o([ |
| 2964 | 2991 | { json: "sealed", js: "sealed", typ: i(0) }, |
| 2965 | 2992 | ], false), |
| 2966 | - "Select": o([ | |
| 2967 | - { json: "select", js: "select", typ: i(0) }, | |
| 2968 | - ], false), | |
| 2969 | 2993 | "Obj5": o([ |
| 2970 | 2994 | { json: "KSerializer", js: "KSerializer", typ: r("KSerializer") }, |
| 2971 | 2995 | { json: "PrimitiveKind", js: "PrimitiveKind", typ: r("PrimitiveKind") }, |
| @@ -2984,8 +3008,10 @@ const typeMap: any = { | ||
| 2984 | 3008 | { json: "TimeZone", js: "TimeZone", typ: r("TimeZone") }, |
| 2985 | 3009 | { json: "True", js: "True", typ: r("True") }, |
| 2986 | 3010 | { json: "Type", js: "Type", typ: r("Type") }, |
| 3011 | + { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: r("UnmarshalJSON") }, | |
| 2987 | 3012 | { json: "UseSerializers", js: "UseSerializers", typ: r("UseSerializers") }, |
| 2988 | 3013 | { json: "dummy", js: "dummy", typ: i(0) }, |
| 3014 | + { json: "select", js: "select", typ: r("Select") }, | |
| 2989 | 3015 | { json: "self", js: "self", typ: r("SelfClass") }, |
| 2990 | 3016 | { json: "serialize", js: "serialize", typ: r("Serialize") }, |
| 2991 | 3017 | { json: "set", js: "set", typ: r("Set") }, |
| @@ -3012,6 +3038,7 @@ const typeMap: any = { | ||
| 3012 | 3038 | { json: "throw", js: "throw", typ: r("Throw") }, |
| 3013 | 3039 | { json: "throws", js: "throws", typ: r("Throws") }, |
| 3014 | 3040 | { json: "toString", js: "toString", typ: r("ToString") }, |
| 3041 | + { json: "to_dict", js: "to_dict", typ: r("ToDict") }, | |
| 3015 | 3042 | { json: "to_json", js: "to_json", typ: r("ToJSON") }, |
| 3016 | 3043 | { json: "top_level", js: "top_level", typ: r("TopLevelClass") }, |
| 3017 | 3044 | { json: "transient", js: "transient", typ: r("Transient") }, |
| @@ -3030,8 +3057,6 @@ const typeMap: any = { | ||
| 3030 | 3057 | { json: "union", js: "union", typ: r("Union") }, |
| 3031 | 3058 | { json: "unowned", js: "unowned", typ: r("Unowned") }, |
| 3032 | 3059 | { json: "unsafe", js: "unsafe", typ: r("Unsafe") }, |
| 3033 | - { json: "unsigned", js: "unsigned", typ: r("Unsigned") }, | |
| 3034 | - { json: "ushort", js: "ushort", typ: r("Ushort") }, | |
| 3035 | 3060 | ], false), |
| 3036 | 3061 | "KSerializer": o([ |
| 3037 | 3062 | { json: "KSerializer", js: "KSerializer", typ: i(0) }, |
| @@ -3084,9 +3109,15 @@ const typeMap: any = { | ||
| 3084 | 3109 | "Type": o([ |
| 3085 | 3110 | { json: "Type", js: "Type", typ: i(0) }, |
| 3086 | 3111 | ], false), |
| 3112 | + "UnmarshalJSON": o([ | |
| 3113 | + { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: i(0) }, | |
| 3114 | + ], false), | |
| 3087 | 3115 | "UseSerializers": o([ |
| 3088 | 3116 | { json: "UseSerializers", js: "UseSerializers", typ: i(0) }, |
| 3089 | 3117 | ], false), |
| 3118 | + "Select": o([ | |
| 3119 | + { json: "select", js: "select", typ: i(0) }, | |
| 3120 | + ], false), | |
| 3090 | 3121 | "SelfClass": o([ |
| 3091 | 3122 | { json: "self", js: "self", typ: i(0) }, |
| 3092 | 3123 | ], false), |
| @@ -3165,6 +3196,9 @@ const typeMap: any = { | ||
| 3165 | 3196 | "ToString": o([ |
| 3166 | 3197 | { json: "toString", js: "toString", typ: i(0) }, |
| 3167 | 3198 | ], false), |
| 3199 | + "ToDict": o([ | |
| 3200 | + { json: "to_dict", js: "to_dict", typ: i(0) }, | |
| 3201 | + ], false), | |
| 3168 | 3202 | "ToJSON": o([ |
| 3169 | 3203 | { json: "to_json", js: "to_json", typ: i(0) }, |
| 3170 | 3204 | ], false), |
| @@ -3219,18 +3253,14 @@ const typeMap: any = { | ||
| 3219 | 3253 | "Unsafe": o([ |
| 3220 | 3254 | { json: "unsafe", js: "unsafe", typ: i(0) }, |
| 3221 | 3255 | ], false), |
| 3222 | - "Unsigned": o([ | |
| 3223 | - { json: "unsigned", js: "unsigned", typ: i(0) }, | |
| 3224 | - ], false), | |
| 3225 | - "Ushort": o([ | |
| 3226 | - { json: "ushort", js: "ushort", typ: i(0) }, | |
| 3227 | - ], false), | |
| 3228 | 3256 | "Obj6": o([ |
| 3229 | 3257 | { json: "UUID", js: "UUID", typ: r("UUID") }, |
| 3230 | 3258 | { json: "Utf8JsonReader", js: "Utf8JsonReader", typ: r("Utf8JSONReader") }, |
| 3231 | 3259 | { json: "Utf8JsonWriter", js: "Utf8JsonWriter", typ: r("Utf8JSONWriter") }, |
| 3232 | 3260 | { json: "YES", js: "YES", typ: r("Yes") }, |
| 3233 | 3261 | { json: "dummy", js: "dummy", typ: i(0) }, |
| 3262 | + { json: "unsigned", js: "unsigned", typ: r("Unsigned") }, | |
| 3263 | + { json: "ushort", js: "ushort", typ: r("Ushort") }, | |
| 3234 | 3264 | { json: "using", js: "using", typ: r("Using") }, |
| 3235 | 3265 | { json: "var", js: "var", typ: r("Var") }, |
| 3236 | 3266 | { json: "virtual", js: "virtual", typ: r("Virtual") }, |
| @@ -3258,6 +3288,12 @@ const typeMap: any = { | ||
| 3258 | 3288 | "Yes": o([ |
| 3259 | 3289 | { json: "YES", js: "YES", typ: i(0) }, |
| 3260 | 3290 | ], false), |
| 3291 | + "Unsigned": o([ | |
| 3292 | + { json: "unsigned", js: "unsigned", typ: i(0) }, | |
| 3293 | + ], false), | |
| 3294 | + "Ushort": o([ | |
| 3295 | + { json: "ushort", js: "ushort", typ: i(0) }, | |
| 3296 | + ], false), | |
| 3261 | 3297 | "Using": o([ |
| 3262 | 3298 | { json: "using", js: "using", typ: i(0) }, |
| 3263 | 3299 | ], false), |
Mtypescriptprefer-types-true--df33e18681f9 / TopLevel.ts+83 −47
| @@ -400,13 +400,13 @@ export type Obj2 = { | ||
| 400 | 400 | foreach: Foreach; |
| 401 | 401 | friend: Friend; |
| 402 | 402 | from: From; |
| 403 | + from_dict: FromDict; | |
| 403 | 404 | from_json: FromJSON; |
| 404 | 405 | func: Func; |
| 405 | 406 | function: Function; |
| 406 | 407 | get: Get; |
| 407 | 408 | global: Global; |
| 408 | 409 | go: Go; |
| 409 | - goto: Goto; | |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | export type DateFormatter = { |
| @@ -639,6 +639,10 @@ export type From = { | ||
| 639 | 639 | from: number; |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | +export type FromDict = { | |
| 643 | + from_dict: number; | |
| 644 | +} | |
| 645 | + | |
| 642 | 646 | export type FromJSON = { |
| 643 | 647 | from_json: number; |
| 644 | 648 | } |
| @@ -663,10 +667,6 @@ export type Go = { | ||
| 663 | 667 | go: number; |
| 664 | 668 | } |
| 665 | 669 | |
| 666 | -export type Goto = { | |
| 667 | - goto: number; | |
| 668 | -} | |
| 669 | - | |
| 670 | 670 | export type Obj3 = { |
| 671 | 671 | Hashable: Hashable; |
| 672 | 672 | Hasher: Hasher; |
| @@ -685,8 +685,10 @@ export type Obj3 = { | ||
| 685 | 685 | JsonTokenType: JSONTokenType; |
| 686 | 686 | Locale: Locale; |
| 687 | 687 | MapEntry: MapEntry; |
| 688 | + MarshalJSON: MarshalJSON; | |
| 688 | 689 | NO: No; |
| 689 | 690 | dummy: number; |
| 691 | + goto: Goto; | |
| 690 | 692 | guard: Guard; |
| 691 | 693 | hasOwnProperty: HasOwnProperty; |
| 692 | 694 | hashCode: HashCode; |
| @@ -732,7 +734,6 @@ export type Obj3 = { | ||
| 732 | 734 | new: New; |
| 733 | 735 | newtonsoft: Newtonsoft; |
| 734 | 736 | nil: Nil; |
| 735 | - noexcept: Noexcept; | |
| 736 | 737 | } |
| 737 | 738 | |
| 738 | 739 | export type Hashable = { |
| @@ -803,10 +804,18 @@ export type MapEntry = { | ||
| 803 | 804 | MapEntry: number; |
| 804 | 805 | } |
| 805 | 806 | |
| 807 | +export type MarshalJSON = { | |
| 808 | + MarshalJSON: number; | |
| 809 | +} | |
| 810 | + | |
| 806 | 811 | export type No = { |
| 807 | 812 | NO: number; |
| 808 | 813 | } |
| 809 | 814 | |
| 815 | +export type Goto = { | |
| 816 | + goto: number; | |
| 817 | +} | |
| 818 | + | |
| 810 | 819 | export type Guard = { |
| 811 | 820 | guard: number; |
| 812 | 821 | } |
| @@ -987,10 +996,6 @@ export type Nil = { | ||
| 987 | 996 | nil: number; |
| 988 | 997 | } |
| 989 | 998 | |
| 990 | -export type Noexcept = { | |
| 991 | - noexcept: number; | |
| 992 | -} | |
| 993 | - | |
| 994 | 999 | export type Obj4 = { |
| 995 | 1000 | NSError: NSError; |
| 996 | 1001 | NSObject: NSObject; |
| @@ -1003,6 +1008,7 @@ export type Obj4 = { | ||
| 1003 | 1008 | SEL: Sel; |
| 1004 | 1009 | dummy: number; |
| 1005 | 1010 | noSuchMethod: NoSuchMethod; |
| 1011 | + noexcept: Noexcept; | |
| 1006 | 1012 | nonatomic: Nonatomic; |
| 1007 | 1013 | none: NoneClass; |
| 1008 | 1014 | nonlocal: Nonlocal; |
| @@ -1056,7 +1062,6 @@ export type Obj4 = { | ||
| 1056 | 1062 | s: S; |
| 1057 | 1063 | sbyte: Sbyte; |
| 1058 | 1064 | sealed: Sealed; |
| 1059 | - select: Select; | |
| 1060 | 1065 | } |
| 1061 | 1066 | |
| 1062 | 1067 | export type NSError = { |
| @@ -1099,6 +1104,10 @@ export type NoSuchMethod = { | ||
| 1099 | 1104 | noSuchMethod: number; |
| 1100 | 1105 | } |
| 1101 | 1106 | |
| 1107 | +export type Noexcept = { | |
| 1108 | + noexcept: number; | |
| 1109 | +} | |
| 1110 | + | |
| 1102 | 1111 | export type Nonatomic = { |
| 1103 | 1112 | nonatomic: number; |
| 1104 | 1113 | } |
| @@ -1311,10 +1320,6 @@ export type Sealed = { | ||
| 1311 | 1320 | sealed: number; |
| 1312 | 1321 | } |
| 1313 | 1322 | |
| 1314 | -export type Select = { | |
| 1315 | - select: number; | |
| 1316 | -} | |
| 1317 | - | |
| 1318 | 1323 | export type Obj5 = { |
| 1319 | 1324 | KSerializer: KSerializer; |
| 1320 | 1325 | PrimitiveKind: PrimitiveKind; |
| @@ -1333,8 +1338,10 @@ export type Obj5 = { | ||
| 1333 | 1338 | TimeZone: TimeZone; |
| 1334 | 1339 | True: True; |
| 1335 | 1340 | Type: Type; |
| 1341 | + UnmarshalJSON: UnmarshalJSON; | |
| 1336 | 1342 | UseSerializers: UseSerializers; |
| 1337 | 1343 | dummy: number; |
| 1344 | + select: Select; | |
| 1338 | 1345 | self: SelfClass; |
| 1339 | 1346 | serialize: Serialize; |
| 1340 | 1347 | set: Set; |
| @@ -1361,6 +1368,7 @@ export type Obj5 = { | ||
| 1361 | 1368 | throw: Throw; |
| 1362 | 1369 | throws: Throws; |
| 1363 | 1370 | toString: ToString; |
| 1371 | + to_dict: ToDict; | |
| 1364 | 1372 | to_json: ToJSON; |
| 1365 | 1373 | top_level: TopLevelClass; |
| 1366 | 1374 | transient: Transient; |
| @@ -1379,8 +1387,6 @@ export type Obj5 = { | ||
| 1379 | 1387 | union: Union; |
| 1380 | 1388 | unowned: Unowned; |
| 1381 | 1389 | unsafe: Unsafe; |
| 1382 | - unsigned: Unsigned; | |
| 1383 | - ushort: Ushort; | |
| 1384 | 1390 | } |
| 1385 | 1391 | |
| 1386 | 1392 | export type KSerializer = { |
| @@ -1451,10 +1457,18 @@ export type Type = { | ||
| 1451 | 1457 | Type: number; |
| 1452 | 1458 | } |
| 1453 | 1459 | |
| 1460 | +export type UnmarshalJSON = { | |
| 1461 | + UnmarshalJSON: number; | |
| 1462 | +} | |
| 1463 | + | |
| 1454 | 1464 | export type UseSerializers = { |
| 1455 | 1465 | UseSerializers: number; |
| 1456 | 1466 | } |
| 1457 | 1467 | |
| 1468 | +export type Select = { | |
| 1469 | + select: number; | |
| 1470 | +} | |
| 1471 | + | |
| 1458 | 1472 | export type SelfClass = { |
| 1459 | 1473 | self: number; |
| 1460 | 1474 | } |
| @@ -1559,6 +1573,10 @@ export type ToString = { | ||
| 1559 | 1573 | toString: number; |
| 1560 | 1574 | } |
| 1561 | 1575 | |
| 1576 | +export type ToDict = { | |
| 1577 | + to_dict: number; | |
| 1578 | +} | |
| 1579 | + | |
| 1562 | 1580 | export type ToJSON = { |
| 1563 | 1581 | to_json: number; |
| 1564 | 1582 | } |
| @@ -1631,20 +1649,14 @@ export type Unsafe = { | ||
| 1631 | 1649 | unsafe: number; |
| 1632 | 1650 | } |
| 1633 | 1651 | |
| 1634 | -export type Unsigned = { | |
| 1635 | - unsigned: number; | |
| 1636 | -} | |
| 1637 | - | |
| 1638 | -export type Ushort = { | |
| 1639 | - ushort: number; | |
| 1640 | -} | |
| 1641 | - | |
| 1642 | 1652 | export type Obj6 = { |
| 1643 | 1653 | UUID: UUID; |
| 1644 | 1654 | Utf8JsonReader: Utf8JSONReader; |
| 1645 | 1655 | Utf8JsonWriter: Utf8JSONWriter; |
| 1646 | 1656 | YES: Yes; |
| 1647 | 1657 | dummy: number; |
| 1658 | + unsigned: Unsigned; | |
| 1659 | + ushort: Ushort; | |
| 1648 | 1660 | using: Using; |
| 1649 | 1661 | var: Var; |
| 1650 | 1662 | virtual: Virtual; |
| @@ -1677,6 +1689,14 @@ export type Yes = { | ||
| 1677 | 1689 | YES: number; |
| 1678 | 1690 | } |
| 1679 | 1691 | |
| 1692 | +export type Unsigned = { | |
| 1693 | + unsigned: number; | |
| 1694 | +} | |
| 1695 | + | |
| 1696 | +export type Ushort = { | |
| 1697 | + ushort: number; | |
| 1698 | +} | |
| 1699 | + | |
| 1680 | 1700 | export type Using = { |
| 1681 | 1701 | using: number; |
| 1682 | 1702 | } |
| @@ -1829,7 +1849,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 1829 | 1849 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 1830 | 1850 | return invalidValue(l(ref || "object"), val, key, parent); |
| 1831 | 1851 | } |
| 1832 | - const result: any = {}; | |
| 1852 | + const result: any = Object.create(null); | |
| 1833 | 1853 | Object.getOwnPropertyNames(props).forEach(key => { |
| 1834 | 1854 | const prop = props[key]; |
| 1835 | 1855 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -1840,7 +1860,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 1840 | 1860 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 1841 | 1861 | } |
| 1842 | 1862 | }); |
| 1843 | - return result; | |
| 1863 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 1844 | 1864 | } |
| 1845 | 1865 | |
| 1846 | 1866 | if (typ === "any") return val; |
| @@ -2248,13 +2268,13 @@ const typeMap: any = { | ||
| 2248 | 2268 | { json: "foreach", js: "foreach", typ: r("Foreach") }, |
| 2249 | 2269 | { json: "friend", js: "friend", typ: r("Friend") }, |
| 2250 | 2270 | { json: "from", js: "from", typ: r("From") }, |
| 2271 | + { json: "from_dict", js: "from_dict", typ: r("FromDict") }, | |
| 2251 | 2272 | { json: "from_json", js: "from_json", typ: r("FromJSON") }, |
| 2252 | 2273 | { json: "func", js: "func", typ: r("Func") }, |
| 2253 | 2274 | { json: "function", js: "function", typ: r("Function") }, |
| 2254 | 2275 | { json: "get", js: "get", typ: r("Get") }, |
| 2255 | 2276 | { json: "global", js: "global", typ: r("Global") }, |
| 2256 | 2277 | { json: "go", js: "go", typ: r("Go") }, |
| 2257 | - { json: "goto", js: "goto", typ: r("Goto") }, | |
| 2258 | 2278 | ], false), |
| 2259 | 2279 | "DateFormatter": o([ |
| 2260 | 2280 | { json: "DateFormatter", js: "DateFormatter", typ: i(0) }, |
| @@ -2427,6 +2447,9 @@ const typeMap: any = { | ||
| 2427 | 2447 | "From": o([ |
| 2428 | 2448 | { json: "from", js: "from", typ: i(0) }, |
| 2429 | 2449 | ], false), |
| 2450 | + "FromDict": o([ | |
| 2451 | + { json: "from_dict", js: "from_dict", typ: i(0) }, | |
| 2452 | + ], false), | |
| 2430 | 2453 | "FromJSON": o([ |
| 2431 | 2454 | { json: "from_json", js: "from_json", typ: i(0) }, |
| 2432 | 2455 | ], false), |
| @@ -2445,9 +2468,6 @@ const typeMap: any = { | ||
| 2445 | 2468 | "Go": o([ |
| 2446 | 2469 | { json: "go", js: "go", typ: i(0) }, |
| 2447 | 2470 | ], false), |
| 2448 | - "Goto": o([ | |
| 2449 | - { json: "goto", js: "goto", typ: i(0) }, | |
| 2450 | - ], false), | |
| 2451 | 2471 | "Obj3": o([ |
| 2452 | 2472 | { json: "Hashable", js: "Hashable", typ: r("Hashable") }, |
| 2453 | 2473 | { json: "Hasher", js: "Hasher", typ: r("Hasher") }, |
| @@ -2466,8 +2486,10 @@ const typeMap: any = { | ||
| 2466 | 2486 | { json: "JsonTokenType", js: "JsonTokenType", typ: r("JSONTokenType") }, |
| 2467 | 2487 | { json: "Locale", js: "Locale", typ: r("Locale") }, |
| 2468 | 2488 | { json: "MapEntry", js: "MapEntry", typ: r("MapEntry") }, |
| 2489 | + { json: "MarshalJSON", js: "MarshalJSON", typ: r("MarshalJSON") }, | |
| 2469 | 2490 | { json: "NO", js: "NO", typ: r("No") }, |
| 2470 | 2491 | { json: "dummy", js: "dummy", typ: i(0) }, |
| 2492 | + { json: "goto", js: "goto", typ: r("Goto") }, | |
| 2471 | 2493 | { json: "guard", js: "guard", typ: r("Guard") }, |
| 2472 | 2494 | { json: "hasOwnProperty", js: "hasOwnProperty", typ: r("HasOwnProperty") }, |
| 2473 | 2495 | { json: "hashCode", js: "hashCode", typ: r("HashCode") }, |
| @@ -2513,7 +2535,6 @@ const typeMap: any = { | ||
| 2513 | 2535 | { json: "new", js: "new", typ: r("New") }, |
| 2514 | 2536 | { json: "newtonsoft", js: "newtonsoft", typ: r("Newtonsoft") }, |
| 2515 | 2537 | { json: "nil", js: "nil", typ: r("Nil") }, |
| 2516 | - { json: "noexcept", js: "noexcept", typ: r("Noexcept") }, | |
| 2517 | 2538 | ], false), |
| 2518 | 2539 | "Hashable": o([ |
| 2519 | 2540 | { json: "Hashable", js: "Hashable", typ: i(0) }, |
| @@ -2566,9 +2587,15 @@ const typeMap: any = { | ||
| 2566 | 2587 | "MapEntry": o([ |
| 2567 | 2588 | { json: "MapEntry", js: "MapEntry", typ: i(0) }, |
| 2568 | 2589 | ], false), |
| 2590 | + "MarshalJSON": o([ | |
| 2591 | + { json: "MarshalJSON", js: "MarshalJSON", typ: i(0) }, | |
| 2592 | + ], false), | |
| 2569 | 2593 | "No": o([ |
| 2570 | 2594 | { json: "NO", js: "NO", typ: i(0) }, |
| 2571 | 2595 | ], false), |
| 2596 | + "Goto": o([ | |
| 2597 | + { json: "goto", js: "goto", typ: i(0) }, | |
| 2598 | + ], false), | |
| 2572 | 2599 | "Guard": o([ |
| 2573 | 2600 | { json: "guard", js: "guard", typ: i(0) }, |
| 2574 | 2601 | ], false), |
| @@ -2704,9 +2731,6 @@ const typeMap: any = { | ||
| 2704 | 2731 | "Nil": o([ |
| 2705 | 2732 | { json: "nil", js: "nil", typ: i(0) }, |
| 2706 | 2733 | ], false), |
| 2707 | - "Noexcept": o([ | |
| 2708 | - { json: "noexcept", js: "noexcept", typ: i(0) }, | |
| 2709 | - ], false), | |
| 2710 | 2734 | "Obj4": o([ |
| 2711 | 2735 | { json: "NSError", js: "NSError", typ: r("NSError") }, |
| 2712 | 2736 | { json: "NSObject", js: "NSObject", typ: r("NSObject") }, |
| @@ -2719,6 +2743,7 @@ const typeMap: any = { | ||
| 2719 | 2743 | { json: "SEL", js: "SEL", typ: r("Sel") }, |
| 2720 | 2744 | { json: "dummy", js: "dummy", typ: i(0) }, |
| 2721 | 2745 | { json: "noSuchMethod", js: "noSuchMethod", typ: r("NoSuchMethod") }, |
| 2746 | + { json: "noexcept", js: "noexcept", typ: r("Noexcept") }, | |
| 2722 | 2747 | { json: "nonatomic", js: "nonatomic", typ: r("Nonatomic") }, |
| 2723 | 2748 | { json: "none", js: "none", typ: r("NoneClass") }, |
| 2724 | 2749 | { json: "nonlocal", js: "nonlocal", typ: r("Nonlocal") }, |
| @@ -2772,7 +2797,6 @@ const typeMap: any = { | ||
| 2772 | 2797 | { json: "s", js: "s", typ: r("S") }, |
| 2773 | 2798 | { json: "sbyte", js: "sbyte", typ: r("Sbyte") }, |
| 2774 | 2799 | { json: "sealed", js: "sealed", typ: r("Sealed") }, |
| 2775 | - { json: "select", js: "select", typ: r("Select") }, | |
| 2776 | 2800 | ], false), |
| 2777 | 2801 | "NSError": o([ |
| 2778 | 2802 | { json: "NSError", js: "NSError", typ: i(0) }, |
| @@ -2804,6 +2828,9 @@ const typeMap: any = { | ||
| 2804 | 2828 | "NoSuchMethod": o([ |
| 2805 | 2829 | { json: "noSuchMethod", js: "noSuchMethod", typ: i(0) }, |
| 2806 | 2830 | ], false), |
| 2831 | + "Noexcept": o([ | |
| 2832 | + { json: "noexcept", js: "noexcept", typ: i(0) }, | |
| 2833 | + ], false), | |
| 2807 | 2834 | "Nonatomic": o([ |
| 2808 | 2835 | { json: "nonatomic", js: "nonatomic", typ: i(0) }, |
| 2809 | 2836 | ], false), |
| @@ -2963,9 +2990,6 @@ const typeMap: any = { | ||
| 2963 | 2990 | "Sealed": o([ |
| 2964 | 2991 | { json: "sealed", js: "sealed", typ: i(0) }, |
| 2965 | 2992 | ], false), |
| 2966 | - "Select": o([ | |
| 2967 | - { json: "select", js: "select", typ: i(0) }, | |
| 2968 | - ], false), | |
| 2969 | 2993 | "Obj5": o([ |
| 2970 | 2994 | { json: "KSerializer", js: "KSerializer", typ: r("KSerializer") }, |
| 2971 | 2995 | { json: "PrimitiveKind", js: "PrimitiveKind", typ: r("PrimitiveKind") }, |
| @@ -2984,8 +3008,10 @@ const typeMap: any = { | ||
| 2984 | 3008 | { json: "TimeZone", js: "TimeZone", typ: r("TimeZone") }, |
| 2985 | 3009 | { json: "True", js: "True", typ: r("True") }, |
| 2986 | 3010 | { json: "Type", js: "Type", typ: r("Type") }, |
| 3011 | + { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: r("UnmarshalJSON") }, | |
| 2987 | 3012 | { json: "UseSerializers", js: "UseSerializers", typ: r("UseSerializers") }, |
| 2988 | 3013 | { json: "dummy", js: "dummy", typ: i(0) }, |
| 3014 | + { json: "select", js: "select", typ: r("Select") }, | |
| 2989 | 3015 | { json: "self", js: "self", typ: r("SelfClass") }, |
| 2990 | 3016 | { json: "serialize", js: "serialize", typ: r("Serialize") }, |
| 2991 | 3017 | { json: "set", js: "set", typ: r("Set") }, |
| @@ -3012,6 +3038,7 @@ const typeMap: any = { | ||
| 3012 | 3038 | { json: "throw", js: "throw", typ: r("Throw") }, |
| 3013 | 3039 | { json: "throws", js: "throws", typ: r("Throws") }, |
| 3014 | 3040 | { json: "toString", js: "toString", typ: r("ToString") }, |
| 3041 | + { json: "to_dict", js: "to_dict", typ: r("ToDict") }, | |
| 3015 | 3042 | { json: "to_json", js: "to_json", typ: r("ToJSON") }, |
| 3016 | 3043 | { json: "top_level", js: "top_level", typ: r("TopLevelClass") }, |
| 3017 | 3044 | { json: "transient", js: "transient", typ: r("Transient") }, |
| @@ -3030,8 +3057,6 @@ const typeMap: any = { | ||
| 3030 | 3057 | { json: "union", js: "union", typ: r("Union") }, |
| 3031 | 3058 | { json: "unowned", js: "unowned", typ: r("Unowned") }, |
| 3032 | 3059 | { json: "unsafe", js: "unsafe", typ: r("Unsafe") }, |
| 3033 | - { json: "unsigned", js: "unsigned", typ: r("Unsigned") }, | |
| 3034 | - { json: "ushort", js: "ushort", typ: r("Ushort") }, | |
| 3035 | 3060 | ], false), |
| 3036 | 3061 | "KSerializer": o([ |
| 3037 | 3062 | { json: "KSerializer", js: "KSerializer", typ: i(0) }, |
| @@ -3084,9 +3109,15 @@ const typeMap: any = { | ||
| 3084 | 3109 | "Type": o([ |
| 3085 | 3110 | { json: "Type", js: "Type", typ: i(0) }, |
| 3086 | 3111 | ], false), |
| 3112 | + "UnmarshalJSON": o([ | |
| 3113 | + { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: i(0) }, | |
| 3114 | + ], false), | |
| 3087 | 3115 | "UseSerializers": o([ |
| 3088 | 3116 | { json: "UseSerializers", js: "UseSerializers", typ: i(0) }, |
| 3089 | 3117 | ], false), |
| 3118 | + "Select": o([ | |
| 3119 | + { json: "select", js: "select", typ: i(0) }, | |
| 3120 | + ], false), | |
| 3090 | 3121 | "SelfClass": o([ |
| 3091 | 3122 | { json: "self", js: "self", typ: i(0) }, |
| 3092 | 3123 | ], false), |
| @@ -3165,6 +3196,9 @@ const typeMap: any = { | ||
| 3165 | 3196 | "ToString": o([ |
| 3166 | 3197 | { json: "toString", js: "toString", typ: i(0) }, |
| 3167 | 3198 | ], false), |
| 3199 | + "ToDict": o([ | |
| 3200 | + { json: "to_dict", js: "to_dict", typ: i(0) }, | |
| 3201 | + ], false), | |
| 3168 | 3202 | "ToJSON": o([ |
| 3169 | 3203 | { json: "to_json", js: "to_json", typ: i(0) }, |
| 3170 | 3204 | ], false), |
| @@ -3219,18 +3253,14 @@ const typeMap: any = { | ||
| 3219 | 3253 | "Unsafe": o([ |
| 3220 | 3254 | { json: "unsafe", js: "unsafe", typ: i(0) }, |
| 3221 | 3255 | ], false), |
| 3222 | - "Unsigned": o([ | |
| 3223 | - { json: "unsigned", js: "unsigned", typ: i(0) }, | |
| 3224 | - ], false), | |
| 3225 | - "Ushort": o([ | |
| 3226 | - { json: "ushort", js: "ushort", typ: i(0) }, | |
| 3227 | - ], false), | |
| 3228 | 3256 | "Obj6": o([ |
| 3229 | 3257 | { json: "UUID", js: "UUID", typ: r("UUID") }, |
| 3230 | 3258 | { json: "Utf8JsonReader", js: "Utf8JsonReader", typ: r("Utf8JSONReader") }, |
| 3231 | 3259 | { json: "Utf8JsonWriter", js: "Utf8JsonWriter", typ: r("Utf8JSONWriter") }, |
| 3232 | 3260 | { json: "YES", js: "YES", typ: r("Yes") }, |
| 3233 | 3261 | { json: "dummy", js: "dummy", typ: i(0) }, |
| 3262 | + { json: "unsigned", js: "unsigned", typ: r("Unsigned") }, | |
| 3263 | + { json: "ushort", js: "ushort", typ: r("Ushort") }, | |
| 3234 | 3264 | { json: "using", js: "using", typ: r("Using") }, |
| 3235 | 3265 | { json: "var", js: "var", typ: r("Var") }, |
| 3236 | 3266 | { json: "virtual", js: "virtual", typ: r("Virtual") }, |
| @@ -3258,6 +3288,12 @@ const typeMap: any = { | ||
| 3258 | 3288 | "Yes": o([ |
| 3259 | 3289 | { json: "YES", js: "YES", typ: i(0) }, |
| 3260 | 3290 | ], false), |
| 3291 | + "Unsigned": o([ | |
| 3292 | + { json: "unsigned", js: "unsigned", typ: i(0) }, | |
| 3293 | + ], false), | |
| 3294 | + "Ushort": o([ | |
| 3295 | + { json: "ushort", js: "ushort", typ: i(0) }, | |
| 3296 | + ], false), | |
| 3261 | 3297 | "Using": o([ |
| 3262 | 3298 | { json: "using", js: "using", typ: i(0) }, |
| 3263 | 3299 | ], false), |
Test case
3 generated files · +6 −6test/inputs/json/priority/kotlin-enum-class-case-collision.json
Mflowdefault / TopLevel.js+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/list.json
Mflowdefault / TopLevel.js+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/name-style.json
Mflowdefault / TopLevel.js+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Test case
4 generated files · +26 −18test/inputs/json/priority/nbl-stats.json
Melmdefault / QuickType.elm+20 −12
| @@ -436,9 +436,9 @@ encodeQuickType x = | ||
| 436 | 436 | , ("periodLengthREGULAR", Jenc.int x.periodLengthREGULAR) |
| 437 | 437 | , ("periodType", encodePerType x.periodType) |
| 438 | 438 | , ("periodsMax", Jenc.int x.periodsMax) |
| 439 | - , ("scorers", Jenc.dict identity (Jenc.list encodeScorer) x.scorers) | |
| 439 | + , ("scorers", makeDictEncoder identity (Jenc.list encodeScorer) x.scorers) | |
| 440 | 440 | , ("timeline", Jenc.list identity x.timeline) |
| 441 | - , ("tm", Jenc.dict identity encodeTm x.tm) | |
| 441 | + , ("tm", makeDictEncoder identity encodeTm x.tm) | |
| 442 | 442 | , ("totalTimeAdded", Jenc.int x.totalTimeAdded) |
| 443 | 443 | , ("totallds", encodeTotallds x.totallds) |
| 444 | 444 | ] |
| @@ -878,7 +878,7 @@ encodeTm x = | ||
| 878 | 878 | , ("p2_score", Jenc.int x.p2Score) |
| 879 | 879 | , ("p3_score", Jenc.int x.p3Score) |
| 880 | 880 | , ("p4_score", Jenc.int x.p4Score) |
| 881 | - , ("pl", Jenc.dict identity encodePl x.pl) | |
| 881 | + , ("pl", makeDictEncoder identity encodePl x.pl) | |
| 882 | 882 | , ("score", Jenc.int x.score) |
| 883 | 883 | , ("scoring", Jenc.list encodeScorer x.scoring) |
| 884 | 884 | , ("shortName", Jenc.string x.shortName) |
| @@ -945,11 +945,11 @@ lds = | ||
| 945 | 945 | encodeLds : Lds -> Jenc.Value |
| 946 | 946 | encodeLds x = |
| 947 | 947 | Jenc.object |
| 948 | - [ ("sAssists", Jenc.dict identity encodeScorer x.sAssists) | |
| 948 | + [ ("sAssists", makeDictEncoder identity encodeScorer x.sAssists) | |
| 949 | 949 | , ("sBlocks", encodeSBlocks x.sBlocks) |
| 950 | - , ("sPoints", Jenc.dict identity encodeScorer x.sPoints) | |
| 951 | - , ("sReboundsTotal", Jenc.dict identity encodeScorer x.sReboundsTotal) | |
| 952 | - , ("sSteals", Jenc.dict identity encodeScorer x.sSteals) | |
| 950 | + , ("sPoints", makeDictEncoder identity encodeScorer x.sPoints) | |
| 951 | + , ("sReboundsTotal", makeDictEncoder identity encodeScorer x.sReboundsTotal) | |
| 952 | + , ("sSteals", makeDictEncoder identity encodeScorer x.sSteals) | |
| 953 | 953 | ] |
| 954 | 954 | |
| 955 | 955 | sBlocks : Jdec.Decoder SBlocks |
| @@ -1163,15 +1163,23 @@ totallds = | ||
| 1163 | 1163 | encodeTotallds : Totallds -> Jenc.Value |
| 1164 | 1164 | encodeTotallds x = |
| 1165 | 1165 | Jenc.object |
| 1166 | - [ ("sAssists", Jenc.dict identity encodeScorer x.sAssists) | |
| 1167 | - , ("sBlocks", Jenc.dict identity encodeScorer x.sBlocks) | |
| 1168 | - , ("sPoints", Jenc.dict identity encodeScorer x.sPoints) | |
| 1169 | - , ("sReboundsTotal", Jenc.dict identity encodeScorer x.sReboundsTotal) | |
| 1170 | - , ("sSteals", Jenc.dict identity encodeScorer x.sSteals) | |
| 1166 | + [ ("sAssists", makeDictEncoder identity encodeScorer x.sAssists) | |
| 1167 | + , ("sBlocks", makeDictEncoder identity encodeScorer x.sBlocks) | |
| 1168 | + , ("sPoints", makeDictEncoder identity encodeScorer x.sPoints) | |
| 1169 | + , ("sReboundsTotal", makeDictEncoder identity encodeScorer x.sReboundsTotal) | |
| 1170 | + , ("sSteals", makeDictEncoder identity encodeScorer x.sSteals) | |
| 1171 | 1171 | ] |
| 1172 | 1172 | |
| 1173 | 1173 | --- encoder helpers |
| 1174 | 1174 | |
| 1175 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 1176 | +makeDictEncoder f m r = | |
| 1177 | + r | |
| 1178 | + |> Dict.toList | |
| 1179 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 1180 | + |> String.join "," | |
| 1181 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 1182 | + | |
| 1175 | 1183 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 1176 | 1184 | makeNullableEncoder f m = |
| 1177 | 1185 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -439,7 +439,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 439 | 439 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 440 | 440 | return invalidValue(l(ref || "object"), val, key, parent); |
| 441 | 441 | } |
| 442 | - const result: any = {}; | |
| 442 | + const result: any = Object.create(null); | |
| 443 | 443 | Object.getOwnPropertyNames(props).forEach(key => { |
| 444 | 444 | const prop = props[key]; |
| 445 | 445 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -450,7 +450,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 450 | 450 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 451 | 451 | } |
| 452 | 452 | }); |
| 453 | - return result; | |
| 453 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -384,7 +384,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 384 | 384 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 385 | 385 | return invalidValue(l(ref || "object"), val, key, parent); |
| 386 | 386 | } |
| 387 | - const result: any = {}; | |
| 387 | + const result: any = Object.create(null); | |
| 388 | 388 | Object.getOwnPropertyNames(props).forEach(key => { |
| 389 | 389 | const prop = props[key]; |
| 390 | 390 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -395,7 +395,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 395 | 395 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 396 | 396 | } |
| 397 | 397 | }); |
| 398 | - return result; | |
| 398 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | if (typ === "any") return val; |
Test case
5 generated files · +18 −10test/inputs/json/priority/nested-objects.json
Melmdefault / QuickType.elm+10 −2
| @@ -47,12 +47,20 @@ quickType = | ||
| 47 | 47 | encodeQuickType : QuickType -> Jenc.Value |
| 48 | 48 | encodeQuickType x = |
| 49 | 49 | Jenc.object |
| 50 | - [ ("a", Jenc.dict identity Jenc.int x.a) | |
| 51 | - , ("b", Jenc.dict identity Jenc.int x.b) | |
| 50 | + [ ("a", makeDictEncoder identity Jenc.int x.a) | |
| 51 | + , ("b", makeDictEncoder identity Jenc.int x.b) | |
| 52 | 52 | ] |
| 53 | 53 | |
| 54 | 54 | --- encoder helpers |
| 55 | 55 | |
| 56 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 57 | +makeDictEncoder f m r = | |
| 58 | + r | |
| 59 | + |> Dict.toList | |
| 60 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 61 | + |> String.join "," | |
| 62 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 63 | + | |
| 56 | 64 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 57 | 65 | makeNullableEncoder f m = |
| 58 | 66 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Mjavascriptconverters-all-objects--3a443babd1cb / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/no-classes.json
Mflowdefault / TopLevel.js+2 −2
| @@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 105 | 105 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 106 | 106 | return invalidValue(l(ref || "object"), val, key, parent); |
| 107 | 107 | } |
| 108 | - const result: any = {}; | |
| 108 | + const result: any = Object.create(null); | |
| 109 | 109 | Object.getOwnPropertyNames(props).forEach(key => { |
| 110 | 110 | const prop = props[key]; |
| 111 | 111 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 117 | 117 | } |
| 118 | 118 | }); |
| 119 | - return result; | |
| 119 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 105 | 105 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 106 | 106 | return invalidValue(l(ref || "object"), val, key, parent); |
| 107 | 107 | } |
| 108 | - const result: any = {}; | |
| 108 | + const result: any = Object.create(null); | |
| 109 | 109 | Object.getOwnPropertyNames(props).forEach(key => { |
| 110 | 110 | const prop = props[key]; |
| 111 | 111 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 117 | 117 | } |
| 118 | 118 | }); |
| 119 | - return result; | |
| 119 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/nst-test-suite.json
Mflowdefault / TopLevel.js+2 −2
| @@ -247,7 +247,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 247 | 247 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 248 | 248 | return invalidValue(l(ref || "object"), val, key, parent); |
| 249 | 249 | } |
| 250 | - const result: any = {}; | |
| 250 | + const result: any = Object.create(null); | |
| 251 | 251 | Object.getOwnPropertyNames(props).forEach(key => { |
| 252 | 252 | const prop = props[key]; |
| 253 | 253 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -258,7 +258,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 258 | 258 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 259 | 259 | } |
| 260 | 260 | }); |
| 261 | - return result; | |
| 261 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -244,7 +244,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 244 | 244 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 245 | 245 | return invalidValue(l(ref || "object"), val, key, parent); |
| 246 | 246 | } |
| 247 | - const result: any = {}; | |
| 247 | + const result: any = Object.create(null); | |
| 248 | 248 | Object.getOwnPropertyNames(props).forEach(key => { |
| 249 | 249 | const prop = props[key]; |
| 250 | 250 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -255,7 +255,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 255 | 255 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 256 | 256 | } |
| 257 | 257 | }); |
| 258 | - return result; | |
| 258 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | if (typ === "any") return val; |
Test case
6 generated files · +428 −7test/inputs/json/priority/number-map.json
Melmdefault / QuickType.elm+9 −1
| @@ -45,11 +45,19 @@ quickType = | ||
| 45 | 45 | encodeQuickType : QuickType -> Jenc.Value |
| 46 | 46 | encodeQuickType x = |
| 47 | 47 | Jenc.object |
| 48 | - [ ("foo", Jenc.dict identity Jenc.float x.foo) | |
| 48 | + [ ("foo", makeDictEncoder identity Jenc.float x.foo) | |
| 49 | 49 | ] |
| 50 | 50 | |
| 51 | 51 | --- encoder helpers |
| 52 | 52 | |
| 53 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 54 | +makeDictEncoder f m r = | |
| 55 | + r | |
| 56 | + |> Dict.toList | |
| 57 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 58 | + |> String.join "," | |
| 59 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 60 | + | |
| 53 | 61 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 54 | 62 | makeNullableEncoder f m = |
| 55 | 63 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 107 | 107 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 108 | 108 | return invalidValue(l(ref || "object"), val, key, parent); |
| 109 | 109 | } |
| 110 | - const result: any = {}; | |
| 110 | + const result: any = Object.create(null); | |
| 111 | 111 | Object.getOwnPropertyNames(props).forEach(key => { |
| 112 | 112 | const prop = props[key]; |
| 113 | 113 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 118 | 118 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 119 | 119 | } |
| 120 | 120 | }); |
| 121 | - return result; | |
| 121 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | if (typ === "any") return val; |
Aflowreadonly-true--24da4fc107df / TopLevel.js+209 −0
| @@ -0,0 +1,209 @@ | ||
| 1 | +// @flow | |
| 2 | + | |
| 3 | +// To parse this data: | |
| 4 | +// | |
| 5 | +// const Convert = require("./TopLevel"); | |
| 6 | +// | |
| 7 | +// const topLevel = Convert.toTopLevel(json); | |
| 8 | +// | |
| 9 | +// These functions will throw an error if the JSON doesn't | |
| 10 | +// match the expected interface, even if the JSON is valid. | |
| 11 | + | |
| 12 | +export type TopLevel = { | |
| 13 | + +foo: { +[key: string]: number }; | |
| 14 | +}; | |
| 15 | + | |
| 16 | +// Converts JSON strings to/from your types | |
| 17 | +// and asserts the results of JSON.parse at runtime | |
| 18 | +function toTopLevel(json: string): TopLevel { | |
| 19 | + return cast(JSON.parse(json), r("TopLevel")); | |
| 20 | +} | |
| 21 | + | |
| 22 | +function topLevelToJson(value: TopLevel): string { | |
| 23 | + return JSON.stringify(uncast(value, r("TopLevel")), null, 2); | |
| 24 | +} | |
| 25 | + | |
| 26 | +function invalidValue(typ: any, val: any, key: any, parent: any = '') { | |
| 27 | + const prettyTyp = prettyTypeName(typ); | |
| 28 | + const parentText = parent ? ` on ${parent}` : ''; | |
| 29 | + const keyText = key ? ` for key "${key}"` : ''; | |
| 30 | + throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); | |
| 31 | +} | |
| 32 | + | |
| 33 | +function prettyTypeName(typ: any): string { | |
| 34 | + if (Array.isArray(typ)) { | |
| 35 | + if (typ.length === 2 && typ[0] === undefined) { | |
| 36 | + return `an optional ${prettyTypeName(typ[1])}`; | |
| 37 | + } else { | |
| 38 | + return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; | |
| 39 | + } | |
| 40 | + } else if (typeof typ === "object" && typ.literal !== undefined) { | |
| 41 | + return typ.literal; | |
| 42 | + } else { | |
| 43 | + return typeof typ; | |
| 44 | + } | |
| 45 | +} | |
| 46 | + | |
| 47 | +function jsonToJSProps(typ: any): any { | |
| 48 | + if (typ.jsonToJS === undefined) { | |
| 49 | + const map: any = {}; | |
| 50 | + typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); | |
| 51 | + typ.jsonToJS = map; | |
| 52 | + } | |
| 53 | + return typ.jsonToJS; | |
| 54 | +} | |
| 55 | + | |
| 56 | +function jsToJSONProps(typ: any): any { | |
| 57 | + if (typ.jsToJSON === undefined) { | |
| 58 | + const map: any = {}; | |
| 59 | + typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); | |
| 60 | + typ.jsToJSON = map; | |
| 61 | + } | |
| 62 | + return typ.jsToJSON; | |
| 63 | +} | |
| 64 | + | |
| 65 | +function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { | |
| 66 | + function transformPrimitive(typ: string, val: any): any { | |
| 67 | + if (typeof typ === typeof val) return val; | |
| 68 | + return invalidValue(typ, val, key, parent); | |
| 69 | + } | |
| 70 | + | |
| 71 | + function transformUnion(typs: any[], val: any): any { | |
| 72 | + // val must validate against one typ in typs | |
| 73 | + const l = typs.length; | |
| 74 | + for (let i = 0; i < l; i++) { | |
| 75 | + const typ = typs[i]; | |
| 76 | + try { | |
| 77 | + return transform(val, typ, getProps); | |
| 78 | + } catch (_) {} | |
| 79 | + } | |
| 80 | + return invalidValue(typs, val, key, parent); | |
| 81 | + } | |
| 82 | + | |
| 83 | + function transformEnum(cases: string[], val: any): any { | |
| 84 | + if (cases.indexOf(val) !== -1) return val; | |
| 85 | + return invalidValue(cases.map(a => { return l(a); }), val, key, parent); | |
| 86 | + } | |
| 87 | + | |
| 88 | + function transformArray(typ: any, val: any): any { | |
| 89 | + // val must be an array with no invalid elements | |
| 90 | + if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); | |
| 91 | + | |
| 92 | + return val.map(el => transform(el, typ, getProps)); | |
| 93 | + } | |
| 94 | + | |
| 95 | + function transformDate(val: any): any { | |
| 96 | + if (val === null) { | |
| 97 | + return null; | |
| 98 | + } | |
| 99 | + const d = new Date(val); | |
| 100 | + if (isNaN(d.valueOf())) { | |
| 101 | + return invalidValue(l("Date"), val, key, parent); | |
| 102 | + } | |
| 103 | + return d; | |
| 104 | + } | |
| 105 | + | |
| 106 | + function transformObject(props: { [k: string]: any }, additional: any, val: any): any { | |
| 107 | + if (val === null || typeof val !== "object" || Array.isArray(val)) { | |
| 108 | + return invalidValue(l(ref || "object"), val, key, parent); | |
| 109 | + } | |
| 110 | + const result: any = Object.create(null); | |
| 111 | + Object.getOwnPropertyNames(props).forEach(key => { | |
| 112 | + const prop = props[key]; | |
| 113 | + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; | |
| 114 | + result[prop.key] = transform(v, prop.typ, getProps, key, ref); | |
| 115 | + }); | |
| 116 | + Object.getOwnPropertyNames(val).forEach(key => { | |
| 117 | + if (!Object.prototype.hasOwnProperty.call(props, key)) { | |
| 118 | + result[key] = transform(val[key], additional, getProps, key, ref); | |
| 119 | + } | |
| 120 | + }); | |
| 121 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 122 | + } | |
| 123 | + | |
| 124 | + if (typ === "any") return val; | |
| 125 | + if (typ === null) { | |
| 126 | + if (val === null) return val; | |
| 127 | + return invalidValue(typ, val, key, parent); | |
| 128 | + } | |
| 129 | + if (typ === false) return invalidValue(typ, val, key, parent); | |
| 130 | + let ref: any = undefined; | |
| 131 | + while (typeof typ === "object" && typ.ref !== undefined) { | |
| 132 | + ref = typ.ref; | |
| 133 | + typ = typeMap[typ.ref]; | |
| 134 | + } | |
| 135 | + if (Array.isArray(typ)) return transformEnum(typ, val); | |
| 136 | + if (typeof typ === "object") { | |
| 137 | + return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) | |
| 138 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) | |
| 141 | + : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) | |
| 142 | + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) | |
| 143 | + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) | |
| 144 | + : invalidValue(typ, val, key, parent); | |
| 145 | + } | |
| 146 | + // Numbers can be parsed by Date but shouldn't be. | |
| 147 | + if (typ === Date && (typeof val === "string" || val instanceof Date)) return transformDate(val); | |
| 148 | + return transformPrimitive(typ, val); | |
| 149 | +} | |
| 150 | + | |
| 151 | +function cast<T>(val: any, typ: any): T { | |
| 152 | + return transform(val, typ, jsonToJSProps); | |
| 153 | +} | |
| 154 | + | |
| 155 | +function uncast<T>(val: T, typ: any): any { | |
| 156 | + return transform(val, typ, jsToJSONProps); | |
| 157 | +} | |
| 158 | + | |
| 159 | +function l(typ: any) { | |
| 160 | + return { literal: typ }; | |
| 161 | +} | |
| 162 | + | |
| 163 | +function a(typ: any) { | |
| 164 | + return { arrayItems: typ }; | |
| 165 | +} | |
| 166 | + | |
| 167 | +function i(typ: any) { | |
| 168 | + return { integer: typ }; | |
| 169 | +} | |
| 170 | + | |
| 171 | +function p(pattern: any) { | |
| 172 | + return { pattern }; | |
| 173 | +} | |
| 174 | + | |
| 175 | +function s(typ: any, min: any, max: any) { | |
| 176 | + return { string: typ, min, max }; | |
| 177 | +} | |
| 178 | + | |
| 179 | +function n(typ: any, min: any, max: any) { | |
| 180 | + return { number: typ, min, max }; | |
| 181 | +} | |
| 182 | + | |
| 183 | +function u(...typs: any[]) { | |
| 184 | + return { unionMembers: typs }; | |
| 185 | +} | |
| 186 | + | |
| 187 | +function o(props: any[], additional: any) { | |
| 188 | + return { props, additional }; | |
| 189 | +} | |
| 190 | + | |
| 191 | +function m(additional: any) { | |
| 192 | + const props: any[] = []; | |
| 193 | + return { props, additional }; | |
| 194 | +} | |
| 195 | + | |
| 196 | +function r(name: string) { | |
| 197 | + return { ref: name }; | |
| 198 | +} | |
| 199 | + | |
| 200 | +const typeMap: any = { | |
| 201 | + "TopLevel": o([ | |
| 202 | + { json: "foo", js: "foo", typ: m(3.14) }, | |
| 203 | + ], false), | |
| 204 | +}; | |
| 205 | + | |
| 206 | +module.exports = { | |
| 207 | + "topLevelToJson": topLevelToJson, | |
| 208 | + "toTopLevel": toTopLevel, | |
| 209 | +}; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 107 | 107 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 108 | 108 | return invalidValue(l(ref || "object"), val, key, parent); |
| 109 | 109 | } |
| 110 | - const result: any = {}; | |
| 110 | + const result: any = Object.create(null); | |
| 111 | 111 | Object.getOwnPropertyNames(props).forEach(key => { |
| 112 | 112 | const prop = props[key]; |
| 113 | 113 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 118 | 118 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 119 | 119 | } |
| 120 | 120 | }); |
| 121 | - return result; | |
| 121 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | if (typ === "any") return val; |
Atypescriptreadonly-true--24da4fc107df / TopLevel.ts+204 −0
| @@ -0,0 +1,204 @@ | ||
| 1 | +// To parse this data: | |
| 2 | +// | |
| 3 | +// import { Convert, TopLevel } from "./TopLevel"; | |
| 4 | +// | |
| 5 | +// const topLevel = Convert.toTopLevel(json); | |
| 6 | +// | |
| 7 | +// These functions will throw an error if the JSON doesn't | |
| 8 | +// match the expected interface, even if the JSON is valid. | |
| 9 | + | |
| 10 | +export interface TopLevel { | |
| 11 | + readonly foo: { readonly [key: string]: number }; | |
| 12 | +} | |
| 13 | + | |
| 14 | +// Converts JSON strings to/from your types | |
| 15 | +// and asserts the results of JSON.parse at runtime | |
| 16 | +export class Convert { | |
| 17 | + public static toTopLevel(json: string): TopLevel { | |
| 18 | + return cast(JSON.parse(json), r("TopLevel")); | |
| 19 | + } | |
| 20 | + | |
| 21 | + public static topLevelToJson(value: TopLevel): string { | |
| 22 | + return JSON.stringify(uncast(value, r("TopLevel")), null, 2); | |
| 23 | + } | |
| 24 | +} | |
| 25 | + | |
| 26 | +function invalidValue(typ: any, val: any, key: any, parent: any = ''): never { | |
| 27 | + const prettyTyp = prettyTypeName(typ); | |
| 28 | + const parentText = parent ? ` on ${parent}` : ''; | |
| 29 | + const keyText = key ? ` for key "${key}"` : ''; | |
| 30 | + throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); | |
| 31 | +} | |
| 32 | + | |
| 33 | +function prettyTypeName(typ: any): string { | |
| 34 | + if (Array.isArray(typ)) { | |
| 35 | + if (typ.length === 2 && typ[0] === undefined) { | |
| 36 | + return `an optional ${prettyTypeName(typ[1])}`; | |
| 37 | + } else { | |
| 38 | + return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; | |
| 39 | + } | |
| 40 | + } else if (typeof typ === "object" && typ.literal !== undefined) { | |
| 41 | + return typ.literal; | |
| 42 | + } else { | |
| 43 | + return typeof typ; | |
| 44 | + } | |
| 45 | +} | |
| 46 | + | |
| 47 | +function jsonToJSProps(typ: any): any { | |
| 48 | + if (typ.jsonToJS === undefined) { | |
| 49 | + const map: any = {}; | |
| 50 | + typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); | |
| 51 | + typ.jsonToJS = map; | |
| 52 | + } | |
| 53 | + return typ.jsonToJS; | |
| 54 | +} | |
| 55 | + | |
| 56 | +function jsToJSONProps(typ: any): any { | |
| 57 | + if (typ.jsToJSON === undefined) { | |
| 58 | + const map: any = {}; | |
| 59 | + typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); | |
| 60 | + typ.jsToJSON = map; | |
| 61 | + } | |
| 62 | + return typ.jsToJSON; | |
| 63 | +} | |
| 64 | + | |
| 65 | +function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { | |
| 66 | + function transformPrimitive(typ: string, val: any): any { | |
| 67 | + if (typeof typ === typeof val) return val; | |
| 68 | + return invalidValue(typ, val, key, parent); | |
| 69 | + } | |
| 70 | + | |
| 71 | + function transformUnion(typs: any[], val: any): any { | |
| 72 | + // val must validate against one typ in typs | |
| 73 | + const l = typs.length; | |
| 74 | + for (let i = 0; i < l; i++) { | |
| 75 | + const typ = typs[i]; | |
| 76 | + try { | |
| 77 | + return transform(val, typ, getProps); | |
| 78 | + } catch (_) {} | |
| 79 | + } | |
| 80 | + return invalidValue(typs, val, key, parent); | |
| 81 | + } | |
| 82 | + | |
| 83 | + function transformEnum(cases: string[], val: any): any { | |
| 84 | + if (cases.indexOf(val) !== -1) return val; | |
| 85 | + return invalidValue(cases.map(a => { return l(a); }), val, key, parent); | |
| 86 | + } | |
| 87 | + | |
| 88 | + function transformArray(typ: any, val: any): any { | |
| 89 | + // val must be an array with no invalid elements | |
| 90 | + if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); | |
| 91 | + | |
| 92 | + return val.map(el => transform(el, typ, getProps)); | |
| 93 | + } | |
| 94 | + | |
| 95 | + function transformDate(val: any): any { | |
| 96 | + if (val === null) { | |
| 97 | + return null; | |
| 98 | + } | |
| 99 | + const d = new Date(val); | |
| 100 | + if (isNaN(d.valueOf())) { | |
| 101 | + return invalidValue(l("Date"), val, key, parent); | |
| 102 | + } | |
| 103 | + return d; | |
| 104 | + } | |
| 105 | + | |
| 106 | + function transformObject(props: { [k: string]: any }, additional: any, val: any): any { | |
| 107 | + if (val === null || typeof val !== "object" || Array.isArray(val)) { | |
| 108 | + return invalidValue(l(ref || "object"), val, key, parent); | |
| 109 | + } | |
| 110 | + const result: any = Object.create(null); | |
| 111 | + Object.getOwnPropertyNames(props).forEach(key => { | |
| 112 | + const prop = props[key]; | |
| 113 | + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; | |
| 114 | + result[prop.key] = transform(v, prop.typ, getProps, key, ref); | |
| 115 | + }); | |
| 116 | + Object.getOwnPropertyNames(val).forEach(key => { | |
| 117 | + if (!Object.prototype.hasOwnProperty.call(props, key)) { | |
| 118 | + result[key] = transform(val[key], additional, getProps, key, ref); | |
| 119 | + } | |
| 120 | + }); | |
| 121 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 122 | + } | |
| 123 | + | |
| 124 | + if (typ === "any") return val; | |
| 125 | + if (typ === null) { | |
| 126 | + if (val === null) return val; | |
| 127 | + return invalidValue(typ, val, key, parent); | |
| 128 | + } | |
| 129 | + if (typ === false) return invalidValue(typ, val, key, parent); | |
| 130 | + let ref: any = undefined; | |
| 131 | + while (typeof typ === "object" && typ.ref !== undefined) { | |
| 132 | + ref = typ.ref; | |
| 133 | + typ = typeMap[typ.ref]; | |
| 134 | + } | |
| 135 | + if (Array.isArray(typ)) return transformEnum(typ, val); | |
| 136 | + if (typeof typ === "object") { | |
| 137 | + return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) | |
| 138 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) | |
| 141 | + : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) | |
| 142 | + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) | |
| 143 | + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) | |
| 144 | + : invalidValue(typ, val, key, parent); | |
| 145 | + } | |
| 146 | + // Numbers can be parsed by Date but shouldn't be. | |
| 147 | + if (typ === Date && (typeof val === "string" || val instanceof Date)) return transformDate(val); | |
| 148 | + return transformPrimitive(typ, val); | |
| 149 | +} | |
| 150 | + | |
| 151 | +function cast<T>(val: any, typ: any): T { | |
| 152 | + return transform(val, typ, jsonToJSProps); | |
| 153 | +} | |
| 154 | + | |
| 155 | +function uncast<T>(val: T, typ: any): any { | |
| 156 | + return transform(val, typ, jsToJSONProps); | |
| 157 | +} | |
| 158 | + | |
| 159 | +function l(typ: any) { | |
| 160 | + return { literal: typ }; | |
| 161 | +} | |
| 162 | + | |
| 163 | +function a(typ: any) { | |
| 164 | + return { arrayItems: typ }; | |
| 165 | +} | |
| 166 | + | |
| 167 | +function i(typ: any) { | |
| 168 | + return { integer: typ }; | |
| 169 | +} | |
| 170 | + | |
| 171 | +function p(pattern: any) { | |
| 172 | + return { pattern }; | |
| 173 | +} | |
| 174 | + | |
| 175 | +function s(typ: any, min: any, max: any) { | |
| 176 | + return { string: typ, min, max }; | |
| 177 | +} | |
| 178 | + | |
| 179 | +function n(typ: any, min: any, max: any) { | |
| 180 | + return { number: typ, min, max }; | |
| 181 | +} | |
| 182 | + | |
| 183 | +function u(...typs: any[]) { | |
| 184 | + return { unionMembers: typs }; | |
| 185 | +} | |
| 186 | + | |
| 187 | +function o(props: any[], additional: any) { | |
| 188 | + return { props, additional }; | |
| 189 | +} | |
| 190 | + | |
| 191 | +function m(additional: any) { | |
| 192 | + const props: any[] = []; | |
| 193 | + return { props, additional }; | |
| 194 | +} | |
| 195 | + | |
| 196 | +function r(name: string) { | |
| 197 | + return { ref: name }; | |
| 198 | +} | |
| 199 | + | |
| 200 | +const typeMap: any = { | |
| 201 | + "TopLevel": o([ | |
| 202 | + { json: "foo", js: "foo", typ: m(3.14) }, | |
| 203 | + ], false), | |
| 204 | +}; |
Test case
3 generated files · +6 −6test/inputs/json/priority/omit-empty.json
Mflowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/optional-union.json
Mflowdefault / TopLevel.js+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/php-mixed-union.json
Mflowdefault / TopLevel.js+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/php-validation.json
Mflowdefault / TopLevel.js+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/recursive.json
Mflowdefault / TopLevel.js+2 −2
| @@ -226,7 +226,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 226 | 226 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 227 | 227 | return invalidValue(l(ref || "object"), val, key, parent); |
| 228 | 228 | } |
| 229 | - const result: any = {}; | |
| 229 | + const result: any = Object.create(null); | |
| 230 | 230 | Object.getOwnPropertyNames(props).forEach(key => { |
| 231 | 231 | const prop = props[key]; |
| 232 | 232 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -237,7 +237,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 237 | 237 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 238 | 238 | } |
| 239 | 239 | }); |
| 240 | - return result; | |
| 240 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -226,7 +226,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 226 | 226 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 227 | 227 | return invalidValue(l(ref || "object"), val, key, parent); |
| 228 | 228 | } |
| 229 | - const result: any = {}; | |
| 229 | + const result: any = Object.create(null); | |
| 230 | 230 | Object.getOwnPropertyNames(props).forEach(key => { |
| 231 | 231 | const prop = props[key]; |
| 232 | 232 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -237,7 +237,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 237 | 237 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 238 | 238 | } |
| 239 | 239 | }); |
| 240 | - return result; | |
| 240 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/simple-identifiers.json
Mflowdefault / TopLevel.js+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/union-constructor-clash.json
Mflowdefault / TopLevel.js+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/unions.json
Mflowdefault / TopLevel.js+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/url.json
Mflowdefault / TopLevel.js+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/priority/uuids.json
Mflowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/samples/bitcoin-block.json
Mflowdefault / TopLevel.js+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/samples/copy-with-property.json
Mflowdefault / TopLevel.js+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/samples/getting-started.json
Mflowdefault / TopLevel.js+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/samples/github-events.json
Mflowdefault / TopLevel.js+2 −2
| @@ -395,7 +395,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 395 | 395 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 396 | 396 | return invalidValue(l(ref || "object"), val, key, parent); |
| 397 | 397 | } |
| 398 | - const result: any = {}; | |
| 398 | + const result: any = Object.create(null); | |
| 399 | 399 | Object.getOwnPropertyNames(props).forEach(key => { |
| 400 | 400 | const prop = props[key]; |
| 401 | 401 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -406,7 +406,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 406 | 406 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 407 | 407 | } |
| 408 | 408 | }); |
| 409 | - return result; | |
| 409 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -393,7 +393,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 393 | 393 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 394 | 394 | return invalidValue(l(ref || "object"), val, key, parent); |
| 395 | 395 | } |
| 396 | - const result: any = {}; | |
| 396 | + const result: any = Object.create(null); | |
| 397 | 397 | Object.getOwnPropertyNames(props).forEach(key => { |
| 398 | 398 | const prop = props[key]; |
| 399 | 399 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -404,7 +404,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 404 | 404 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 405 | 405 | } |
| 406 | 406 | }); |
| 407 | - return result; | |
| 407 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | if (typ === "any") return val; |
Test case
4 generated files · +16 −8test/inputs/json/samples/kitchen-sink.json
Melmdefault / QuickType.elm+10 −2
| @@ -105,10 +105,10 @@ encodeQuickType x = | ||
| 105 | 105 | , ("differentThings", Jenc.list encodeDifferentThingElement x.differentThings) |
| 106 | 106 | , ("doubleValue", Jenc.float x.doubleValue) |
| 107 | 107 | , ("intValue", Jenc.int x.intValue) |
| 108 | - , ("mapValue", Jenc.dict identity (makeNullableEncoder Jenc.int) x.mapValue) | |
| 108 | + , ("mapValue", makeDictEncoder identity (makeNullableEncoder Jenc.int) x.mapValue) | |
| 109 | 109 | , ("name with spaces", always Jenc.null x.nameWithSpaces) |
| 110 | 110 | , ("nullValue", always Jenc.null x.nullValue) |
| 111 | - , ("nullableMapValue", Jenc.dict identity (makeNullableEncoder Jenc.int) x.nullableMapValue) | |
| 111 | + , ("nullableMapValue", makeDictEncoder identity (makeNullableEncoder Jenc.int) x.nullableMapValue) | |
| 112 | 112 | , ("people", Jenc.list encodePersonElement x.people) |
| 113 | 113 | , ("person", encodePurplePerson x.person) |
| 114 | 114 | , ("stringValue", Jenc.string x.stringValue) |
| @@ -183,6 +183,14 @@ encodePurplePerson x = | ||
| 183 | 183 | |
| 184 | 184 | --- encoder helpers |
| 185 | 185 | |
| 186 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 187 | +makeDictEncoder f m r = | |
| 188 | + r | |
| 189 | + |> Dict.toList | |
| 190 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 191 | + |> String.join "," | |
| 192 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 193 | + | |
| 186 | 194 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 187 | 195 | makeNullableEncoder f m = |
| 188 | 196 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 140 | 140 | return invalidValue(l(ref || "object"), val, key, parent); |
| 141 | 141 | } |
| 142 | - const result: any = {}; | |
| 142 | + const result: any = Object.create(null); | |
| 143 | 143 | Object.getOwnPropertyNames(props).forEach(key => { |
| 144 | 144 | const prop = props[key]; |
| 145 | 145 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -150,7 +150,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 150 | 150 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 151 | 151 | } |
| 152 | 152 | }); |
| 153 | - return result; | |
| 153 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 140 | 140 | return invalidValue(l(ref || "object"), val, key, parent); |
| 141 | 141 | } |
| 142 | - const result: any = {}; | |
| 142 | + const result: any = Object.create(null); | |
| 143 | 143 | Object.getOwnPropertyNames(props).forEach(key => { |
| 144 | 144 | const prop = props[key]; |
| 145 | 145 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -150,7 +150,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 150 | 150 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 151 | 151 | } |
| 152 | 152 | }); |
| 153 | - return result; | |
| 153 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/samples/null-safe.json
Mflowdefault / TopLevel.js+2 −2
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 121 | 121 | return invalidValue(l(ref || "object"), val, key, parent); |
| 122 | 122 | } |
| 123 | - const result: any = {}; | |
| 123 | + const result: any = Object.create(null); | |
| 124 | 124 | Object.getOwnPropertyNames(props).forEach(key => { |
| 125 | 125 | const prop = props[key]; |
| 126 | 126 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 131 | 131 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 132 | 132 | } |
| 133 | 133 | }); |
| 134 | - return result; | |
| 134 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 121 | 121 | return invalidValue(l(ref || "object"), val, key, parent); |
| 122 | 122 | } |
| 123 | - const result: any = {}; | |
| 123 | + const result: any = Object.create(null); | |
| 124 | 124 | Object.getOwnPropertyNames(props).forEach(key => { |
| 125 | 125 | const prop = props[key]; |
| 126 | 126 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 131 | 131 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 132 | 132 | } |
| 133 | 133 | }); |
| 134 | - return result; | |
| 134 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/samples/objc-control-characters.json
Mflowdefault / TopLevel.js+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Test case
4 generated files · +8 −8test/inputs/json/samples/pokedex.json
Mflowdefault / TopLevel.js+2 −2
| @@ -159,7 +159,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 159 | 159 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 160 | 160 | return invalidValue(l(ref || "object"), val, key, parent); |
| 161 | 161 | } |
| 162 | - const result: any = {}; | |
| 162 | + const result: any = Object.create(null); | |
| 163 | 163 | Object.getOwnPropertyNames(props).forEach(key => { |
| 164 | 164 | const prop = props[key]; |
| 165 | 165 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -170,7 +170,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 170 | 170 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 171 | 171 | } |
| 172 | 172 | }); |
| 173 | - return result; | |
| 173 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 137 | 137 | return invalidValue(l(ref || "object"), val, key, parent); |
| 138 | 138 | } |
| 139 | - const result: any = {}; | |
| 139 | + const result: any = Object.create(null); | |
| 140 | 140 | Object.getOwnPropertyNames(props).forEach(key => { |
| 141 | 141 | const prop = props[key]; |
| 142 | 142 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 148 | 148 | } |
| 149 | 149 | }); |
| 150 | - return result; | |
| 150 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | if (typ === "any") return val; |
Mtypescriptprefer-types-true--df33e18681f9 / TopLevel.ts+2 −2
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 137 | 137 | return invalidValue(l(ref || "object"), val, key, parent); |
| 138 | 138 | } |
| 139 | - const result: any = {}; | |
| 139 | + const result: any = Object.create(null); | |
| 140 | 140 | Object.getOwnPropertyNames(props).forEach(key => { |
| 141 | 141 | const prop = props[key]; |
| 142 | 142 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 148 | 148 | } |
| 149 | 149 | }); |
| 150 | - return result; | |
| 150 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/samples/reddit.json
Mflowdefault / TopLevel.js+2 −2
| @@ -248,7 +248,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 248 | 248 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 249 | 249 | return invalidValue(l(ref || "object"), val, key, parent); |
| 250 | 250 | } |
| 251 | - const result: any = {}; | |
| 251 | + const result: any = Object.create(null); | |
| 252 | 252 | Object.getOwnPropertyNames(props).forEach(key => { |
| 253 | 253 | const prop = props[key]; |
| 254 | 254 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -259,7 +259,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 259 | 259 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 260 | 260 | } |
| 261 | 261 | }); |
| 262 | - return result; | |
| 262 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 233 | 233 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 234 | 234 | return invalidValue(l(ref || "object"), val, key, parent); |
| 235 | 235 | } |
| 236 | - const result: any = {}; | |
| 236 | + const result: any = Object.create(null); | |
| 237 | 237 | Object.getOwnPropertyNames(props).forEach(key => { |
| 238 | 238 | const prop = props[key]; |
| 239 | 239 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -244,7 +244,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 244 | 244 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 245 | 245 | } |
| 246 | 246 | }); |
| 247 | - return result; | |
| 247 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | if (typ === "any") return val; |
Test case
4 generated files · +219 −6test/inputs/json/samples/simple-object.json
Mflowdefault / TopLevel.js+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Aflowreadonly-true--24da4fc107df / TopLevel.js+213 −0
| @@ -0,0 +1,213 @@ | ||
| 1 | +// @flow | |
| 2 | + | |
| 3 | +// To parse this data: | |
| 4 | +// | |
| 5 | +// const Convert = require("./TopLevel"); | |
| 6 | +// | |
| 7 | +// const topLevel = Convert.toTopLevel(json); | |
| 8 | +// | |
| 9 | +// These functions will throw an error if the JSON doesn't | |
| 10 | +// match the expected interface, even if the JSON is valid. | |
| 11 | + | |
| 12 | +export type TopLevel = { | |
| 13 | + +date: number; | |
| 14 | + +title: string; | |
| 15 | + +validity: boolean; | |
| 16 | +}; | |
| 17 | + | |
| 18 | +// Converts JSON strings to/from your types | |
| 19 | +// and asserts the results of JSON.parse at runtime | |
| 20 | +function toTopLevel(json: string): TopLevel { | |
| 21 | + return cast(JSON.parse(json), r("TopLevel")); | |
| 22 | +} | |
| 23 | + | |
| 24 | +function topLevelToJson(value: TopLevel): string { | |
| 25 | + return JSON.stringify(uncast(value, r("TopLevel")), null, 2); | |
| 26 | +} | |
| 27 | + | |
| 28 | +function invalidValue(typ: any, val: any, key: any, parent: any = '') { | |
| 29 | + const prettyTyp = prettyTypeName(typ); | |
| 30 | + const parentText = parent ? ` on ${parent}` : ''; | |
| 31 | + const keyText = key ? ` for key "${key}"` : ''; | |
| 32 | + throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); | |
| 33 | +} | |
| 34 | + | |
| 35 | +function prettyTypeName(typ: any): string { | |
| 36 | + if (Array.isArray(typ)) { | |
| 37 | + if (typ.length === 2 && typ[0] === undefined) { | |
| 38 | + return `an optional ${prettyTypeName(typ[1])}`; | |
| 39 | + } else { | |
| 40 | + return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; | |
| 41 | + } | |
| 42 | + } else if (typeof typ === "object" && typ.literal !== undefined) { | |
| 43 | + return typ.literal; | |
| 44 | + } else { | |
| 45 | + return typeof typ; | |
| 46 | + } | |
| 47 | +} | |
| 48 | + | |
| 49 | +function jsonToJSProps(typ: any): any { | |
| 50 | + if (typ.jsonToJS === undefined) { | |
| 51 | + const map: any = {}; | |
| 52 | + typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); | |
| 53 | + typ.jsonToJS = map; | |
| 54 | + } | |
| 55 | + return typ.jsonToJS; | |
| 56 | +} | |
| 57 | + | |
| 58 | +function jsToJSONProps(typ: any): any { | |
| 59 | + if (typ.jsToJSON === undefined) { | |
| 60 | + const map: any = {}; | |
| 61 | + typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); | |
| 62 | + typ.jsToJSON = map; | |
| 63 | + } | |
| 64 | + return typ.jsToJSON; | |
| 65 | +} | |
| 66 | + | |
| 67 | +function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { | |
| 68 | + function transformPrimitive(typ: string, val: any): any { | |
| 69 | + if (typeof typ === typeof val) return val; | |
| 70 | + return invalidValue(typ, val, key, parent); | |
| 71 | + } | |
| 72 | + | |
| 73 | + function transformUnion(typs: any[], val: any): any { | |
| 74 | + // val must validate against one typ in typs | |
| 75 | + const l = typs.length; | |
| 76 | + for (let i = 0; i < l; i++) { | |
| 77 | + const typ = typs[i]; | |
| 78 | + try { | |
| 79 | + return transform(val, typ, getProps); | |
| 80 | + } catch (_) {} | |
| 81 | + } | |
| 82 | + return invalidValue(typs, val, key, parent); | |
| 83 | + } | |
| 84 | + | |
| 85 | + function transformEnum(cases: string[], val: any): any { | |
| 86 | + if (cases.indexOf(val) !== -1) return val; | |
| 87 | + return invalidValue(cases.map(a => { return l(a); }), val, key, parent); | |
| 88 | + } | |
| 89 | + | |
| 90 | + function transformArray(typ: any, val: any): any { | |
| 91 | + // val must be an array with no invalid elements | |
| 92 | + if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); | |
| 93 | + | |
| 94 | + return val.map(el => transform(el, typ, getProps)); | |
| 95 | + } | |
| 96 | + | |
| 97 | + function transformDate(val: any): any { | |
| 98 | + if (val === null) { | |
| 99 | + return null; | |
| 100 | + } | |
| 101 | + const d = new Date(val); | |
| 102 | + if (isNaN(d.valueOf())) { | |
| 103 | + return invalidValue(l("Date"), val, key, parent); | |
| 104 | + } | |
| 105 | + return d; | |
| 106 | + } | |
| 107 | + | |
| 108 | + function transformObject(props: { [k: string]: any }, additional: any, val: any): any { | |
| 109 | + if (val === null || typeof val !== "object" || Array.isArray(val)) { | |
| 110 | + return invalidValue(l(ref || "object"), val, key, parent); | |
| 111 | + } | |
| 112 | + const result: any = Object.create(null); | |
| 113 | + Object.getOwnPropertyNames(props).forEach(key => { | |
| 114 | + const prop = props[key]; | |
| 115 | + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; | |
| 116 | + result[prop.key] = transform(v, prop.typ, getProps, key, ref); | |
| 117 | + }); | |
| 118 | + Object.getOwnPropertyNames(val).forEach(key => { | |
| 119 | + if (!Object.prototype.hasOwnProperty.call(props, key)) { | |
| 120 | + result[key] = transform(val[key], additional, getProps, key, ref); | |
| 121 | + } | |
| 122 | + }); | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | + } | |
| 125 | + | |
| 126 | + if (typ === "any") return val; | |
| 127 | + if (typ === null) { | |
| 128 | + if (val === null) return val; | |
| 129 | + return invalidValue(typ, val, key, parent); | |
| 130 | + } | |
| 131 | + if (typ === false) return invalidValue(typ, val, key, parent); | |
| 132 | + let ref: any = undefined; | |
| 133 | + while (typeof typ === "object" && typ.ref !== undefined) { | |
| 134 | + ref = typ.ref; | |
| 135 | + typ = typeMap[typ.ref]; | |
| 136 | + } | |
| 137 | + if (Array.isArray(typ)) return transformEnum(typ, val); | |
| 138 | + if (typeof typ === "object") { | |
| 139 | + return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) | |
| 143 | + : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) | |
| 144 | + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) | |
| 145 | + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) | |
| 146 | + : invalidValue(typ, val, key, parent); | |
| 147 | + } | |
| 148 | + // Numbers can be parsed by Date but shouldn't be. | |
| 149 | + if (typ === Date && (typeof val === "string" || val instanceof Date)) return transformDate(val); | |
| 150 | + return transformPrimitive(typ, val); | |
| 151 | +} | |
| 152 | + | |
| 153 | +function cast<T>(val: any, typ: any): T { | |
| 154 | + return transform(val, typ, jsonToJSProps); | |
| 155 | +} | |
| 156 | + | |
| 157 | +function uncast<T>(val: T, typ: any): any { | |
| 158 | + return transform(val, typ, jsToJSONProps); | |
| 159 | +} | |
| 160 | + | |
| 161 | +function l(typ: any) { | |
| 162 | + return { literal: typ }; | |
| 163 | +} | |
| 164 | + | |
| 165 | +function a(typ: any) { | |
| 166 | + return { arrayItems: typ }; | |
| 167 | +} | |
| 168 | + | |
| 169 | +function i(typ: any) { | |
| 170 | + return { integer: typ }; | |
| 171 | +} | |
| 172 | + | |
| 173 | +function p(pattern: any) { | |
| 174 | + return { pattern }; | |
| 175 | +} | |
| 176 | + | |
| 177 | +function s(typ: any, min: any, max: any) { | |
| 178 | + return { string: typ, min, max }; | |
| 179 | +} | |
| 180 | + | |
| 181 | +function n(typ: any, min: any, max: any) { | |
| 182 | + return { number: typ, min, max }; | |
| 183 | +} | |
| 184 | + | |
| 185 | +function u(...typs: any[]) { | |
| 186 | + return { unionMembers: typs }; | |
| 187 | +} | |
| 188 | + | |
| 189 | +function o(props: any[], additional: any) { | |
| 190 | + return { props, additional }; | |
| 191 | +} | |
| 192 | + | |
| 193 | +function m(additional: any) { | |
| 194 | + const props: any[] = []; | |
| 195 | + return { props, additional }; | |
| 196 | +} | |
| 197 | + | |
| 198 | +function r(name: string) { | |
| 199 | + return { ref: name }; | |
| 200 | +} | |
| 201 | + | |
| 202 | +const typeMap: any = { | |
| 203 | + "TopLevel": o([ | |
| 204 | + { json: "date", js: "date", typ: i(0) }, | |
| 205 | + { json: "title", js: "title", typ: "" }, | |
| 206 | + { json: "validity", js: "validity", typ: true }, | |
| 207 | + ], false), | |
| 208 | +}; | |
| 209 | + | |
| 210 | +module.exports = { | |
| 211 | + "topLevelToJson": topLevelToJson, | |
| 212 | + "toTopLevel": toTopLevel, | |
| 213 | +}; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/samples/spotify-album.json
Mflowdefault / TopLevel.js+2 −2
| @@ -177,7 +177,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 177 | 177 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 178 | 178 | return invalidValue(l(ref || "object"), val, key, parent); |
| 179 | 179 | } |
| 180 | - const result: any = {}; | |
| 180 | + const result: any = Object.create(null); | |
| 181 | 181 | Object.getOwnPropertyNames(props).forEach(key => { |
| 182 | 182 | const prop = props[key]; |
| 183 | 183 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -188,7 +188,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 188 | 188 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 189 | 189 | } |
| 190 | 190 | }); |
| 191 | - return result; | |
| 191 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -177,7 +177,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 177 | 177 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 178 | 178 | return invalidValue(l(ref || "object"), val, key, parent); |
| 179 | 179 | } |
| 180 | - const result: any = {}; | |
| 180 | + const result: any = Object.create(null); | |
| 181 | 181 | Object.getOwnPropertyNames(props).forEach(key => { |
| 182 | 182 | const prop = props[key]; |
| 183 | 183 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -188,7 +188,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 188 | 188 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 189 | 189 | } |
| 190 | 190 | }); |
| 191 | - return result; | |
| 191 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/json/samples/us-avg-temperatures.json
Melmdefault / QuickType.elm+9 −1
| @@ -61,7 +61,7 @@ quickType = | ||
| 61 | 61 | encodeQuickType : QuickType -> Jenc.Value |
| 62 | 62 | encodeQuickType x = |
| 63 | 63 | Jenc.object |
| 64 | - [ ("data", Jenc.dict identity encodeDatum x.data) | |
| 64 | + [ ("data", makeDictEncoder identity encodeDatum x.data) | |
| 65 | 65 | , ("description", encodeDescription x.description) |
| 66 | 66 | ] |
| 67 | 67 | |
| @@ -97,6 +97,14 @@ encodeDescription x = | ||
| 97 | 97 | |
| 98 | 98 | --- encoder helpers |
| 99 | 99 | |
| 100 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 101 | +makeDictEncoder f m r = | |
| 102 | + r | |
| 103 | + |> Dict.toList | |
| 104 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 105 | + |> String.join "," | |
| 106 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 107 | + | |
| 100 | 108 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 101 | 109 | makeNullableEncoder f m = |
| 102 | 110 | case m of |
Mflowdefault / TopLevel.js+2 −2
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 121 | 121 | return invalidValue(l(ref || "object"), val, key, parent); |
| 122 | 122 | } |
| 123 | - const result: any = {}; | |
| 123 | + const result: any = Object.create(null); | |
| 124 | 124 | Object.getOwnPropertyNames(props).forEach(key => { |
| 125 | 125 | const prop = props[key]; |
| 126 | 126 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 131 | 131 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 132 | 132 | } |
| 133 | 133 | }); |
| 134 | - return result; | |
| 134 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 121 | 121 | return invalidValue(l(ref || "object"), val, key, parent); |
| 122 | 122 | } |
| 123 | - const result: any = {}; | |
| 123 | + const result: any = Object.create(null); | |
| 124 | 124 | Object.getOwnPropertyNames(props).forEach(key => { |
| 125 | 125 | const prop = props[key]; |
| 126 | 126 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 131 | 131 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 132 | 132 | } |
| 133 | 133 | }); |
| 134 | - return result; | |
| 134 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/json/samples/us-senators.json
Mflowdefault / TopLevel.js+2 −2
| @@ -212,7 +212,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 212 | 212 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 213 | 213 | return invalidValue(l(ref || "object"), val, key, parent); |
| 214 | 214 | } |
| 215 | - const result: any = {}; | |
| 215 | + const result: any = Object.create(null); | |
| 216 | 216 | Object.getOwnPropertyNames(props).forEach(key => { |
| 217 | 217 | const prop = props[key]; |
| 218 | 218 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -223,7 +223,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 223 | 223 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 224 | 224 | } |
| 225 | 225 | }); |
| 226 | - return result; | |
| 226 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | if (typ === "any") return val; |
Mjavascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mtypescriptdefault / TopLevel.ts+2 −2
| @@ -189,7 +189,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 189 | 189 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 190 | 190 | return invalidValue(l(ref || "object"), val, key, parent); |
| 191 | 191 | } |
| 192 | - const result: any = {}; | |
| 192 | + const result: any = Object.create(null); | |
| 193 | 193 | Object.getOwnPropertyNames(props).forEach(key => { |
| 194 | 194 | const prop = props[key]; |
| 195 | 195 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -200,7 +200,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 200 | 200 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 201 | 201 | } |
| 202 | 202 | }); |
| 203 | - return result; | |
| 203 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/accessors.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/all-of-additional-properties-false.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 120 | 120 | return invalidValue(l(ref || "object"), val, key, parent); |
| 121 | 121 | } |
| 122 | - const result: any = {}; | |
| 122 | + const result: any = Object.create(null); | |
| 123 | 123 | Object.getOwnPropertyNames(props).forEach(key => { |
| 124 | 124 | const prop = props[key]; |
| 125 | 125 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 130 | 130 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 131 | 131 | } |
| 132 | 132 | }); |
| 133 | - return result; | |
| 133 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/schema/any.schema
Mschema-elmdefault / QuickType.elm+9 −1
| @@ -48,11 +48,19 @@ encodeQuickType : QuickType -> Jenc.Value | ||
| 48 | 48 | encodeQuickType x = |
| 49 | 49 | Jenc.object |
| 50 | 50 | [ ("foo", identity x.foo) |
| 51 | - , ("values", Jenc.dict identity identity x.values) | |
| 51 | + , ("values", makeDictEncoder identity identity x.values) | |
| 52 | 52 | ] |
| 53 | 53 | |
| 54 | 54 | --- encoder helpers |
| 55 | 55 | |
| 56 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 57 | +makeDictEncoder f m r = | |
| 58 | + r | |
| 59 | + |> Dict.toList | |
| 60 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 61 | + |> String.join "," | |
| 62 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 63 | + | |
| 56 | 64 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 57 | 65 | makeNullableEncoder f m = |
| 58 | 66 | case m of |
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/bool-string.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 117 | 117 | return invalidValue(l(ref || "object"), val, key, parent); |
| 118 | 118 | } |
| 119 | - const result: any = {}; | |
| 119 | + const result: any = Object.create(null); | |
| 120 | 120 | Object.getOwnPropertyNames(props).forEach(key => { |
| 121 | 121 | const prop = props[key]; |
| 122 | 122 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - return result; | |
| 130 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 117 | 117 | return invalidValue(l(ref || "object"), val, key, parent); |
| 118 | 118 | } |
| 119 | - const result: any = {}; | |
| 119 | + const result: any = Object.create(null); | |
| 120 | 120 | Object.getOwnPropertyNames(props).forEach(key => { |
| 121 | 121 | const prop = props[key]; |
| 122 | 122 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - return result; | |
| 130 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/boolean-subschema.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/camelCase.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/schema/class-map-union.schema
Mschema-elmdefault / QuickType.elm+9 −1
| @@ -57,7 +57,7 @@ quickType = | ||
| 57 | 57 | encodeQuickType : QuickType -> Jenc.Value |
| 58 | 58 | encodeQuickType x = |
| 59 | 59 | Jenc.object |
| 60 | - [ ("union", makeNullableEncoder (Jenc.dict identity encodeUnionValue) x.union) | |
| 60 | + [ ("union", makeNullableEncoder (makeDictEncoder identity encodeUnionValue) x.union) | |
| 61 | 61 | ] |
| 62 | 62 | |
| 63 | 63 | unionValue : Jdec.Decoder UnionValue |
| @@ -89,6 +89,14 @@ encodeUnionClass x = | ||
| 89 | 89 | |
| 90 | 90 | --- encoder helpers |
| 91 | 91 | |
| 92 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 93 | +makeDictEncoder f m r = | |
| 94 | + r | |
| 95 | + |> Dict.toList | |
| 96 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 97 | + |> String.join "," | |
| 98 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 99 | + | |
| 92 | 100 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 93 | 101 | makeNullableEncoder f m = |
| 94 | 102 | case m of |
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 125 | 125 | return invalidValue(l(ref || "object"), val, key, parent); |
| 126 | 126 | } |
| 127 | - const result: any = {}; | |
| 127 | + const result: any = Object.create(null); | |
| 128 | 128 | Object.getOwnPropertyNames(props).forEach(key => { |
| 129 | 129 | const prop = props[key]; |
| 130 | 130 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 136 | 136 | } |
| 137 | 137 | }); |
| 138 | - return result; | |
| 138 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 125 | 125 | return invalidValue(l(ref || "object"), val, key, parent); |
| 126 | 126 | } |
| 127 | - const result: any = {}; | |
| 127 | + const result: any = Object.create(null); | |
| 128 | 128 | Object.getOwnPropertyNames(props).forEach(key => { |
| 129 | 129 | const prop = props[key]; |
| 130 | 130 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 136 | 136 | } |
| 137 | 137 | }); |
| 138 | - return result; | |
| 138 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | if (typ === "any") return val; |
Test case
6 generated files · +444 −7test/inputs/schema/class-with-additional.schema
Mschema-elmdefault / QuickType.elm+9 −1
| @@ -50,7 +50,7 @@ quickType = | ||
| 50 | 50 | encodeQuickType : QuickType -> Jenc.Value |
| 51 | 51 | encodeQuickType x = |
| 52 | 52 | Jenc.object |
| 53 | - [ ("map", makeNullableEncoder (Jenc.dict identity encodeMap) x.map) | |
| 53 | + [ ("map", makeNullableEncoder (makeDictEncoder identity encodeMap) x.map) | |
| 54 | 54 | ] |
| 55 | 55 | |
| 56 | 56 | map : Jdec.Decoder Map |
| @@ -67,6 +67,14 @@ encodeMap x = case x of | ||
| 67 | 67 | |
| 68 | 68 | --- encoder helpers |
| 69 | 69 | |
| 70 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 71 | +makeDictEncoder f m r = | |
| 72 | + r | |
| 73 | + |> Dict.toList | |
| 74 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 75 | + |> String.join "," | |
| 76 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 77 | + | |
| 70 | 78 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 71 | 79 | makeNullableEncoder f m = |
| 72 | 80 | case m of |
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Aschema-flowreadonly-true--24da4fc107df / TopLevel.js+217 −0
| @@ -0,0 +1,217 @@ | ||
| 1 | +// @flow | |
| 2 | + | |
| 3 | +// To parse this data: | |
| 4 | +// | |
| 5 | +// const Convert = require("./TopLevel"); | |
| 6 | +// | |
| 7 | +// const topLevel = Convert.toTopLevel(json); | |
| 8 | +// | |
| 9 | +// These functions will throw an error if the JSON doesn't | |
| 10 | +// match the expected interface, even if the JSON is valid. | |
| 11 | + | |
| 12 | +export type TopLevel = { | |
| 13 | + +map?: Map; | |
| 14 | +}; | |
| 15 | + | |
| 16 | +export type Map = { | |
| 17 | + +foo?: number; | |
| 18 | + +[property: string]: boolean | number | void; | |
| 19 | +}; | |
| 20 | + | |
| 21 | +// Converts JSON strings to/from your types | |
| 22 | +// and asserts the results of JSON.parse at runtime | |
| 23 | +function toTopLevel(json: string): TopLevel { | |
| 24 | + return cast(JSON.parse(json), r("TopLevel")); | |
| 25 | +} | |
| 26 | + | |
| 27 | +function topLevelToJson(value: TopLevel): string { | |
| 28 | + return JSON.stringify(uncast(value, r("TopLevel")), null, 2); | |
| 29 | +} | |
| 30 | + | |
| 31 | +function invalidValue(typ: any, val: any, key: any, parent: any = '') { | |
| 32 | + const prettyTyp = prettyTypeName(typ); | |
| 33 | + const parentText = parent ? ` on ${parent}` : ''; | |
| 34 | + const keyText = key ? ` for key "${key}"` : ''; | |
| 35 | + throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); | |
| 36 | +} | |
| 37 | + | |
| 38 | +function prettyTypeName(typ: any): string { | |
| 39 | + if (Array.isArray(typ)) { | |
| 40 | + if (typ.length === 2 && typ[0] === undefined) { | |
| 41 | + return `an optional ${prettyTypeName(typ[1])}`; | |
| 42 | + } else { | |
| 43 | + return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; | |
| 44 | + } | |
| 45 | + } else if (typeof typ === "object" && typ.literal !== undefined) { | |
| 46 | + return typ.literal; | |
| 47 | + } else { | |
| 48 | + return typeof typ; | |
| 49 | + } | |
| 50 | +} | |
| 51 | + | |
| 52 | +function jsonToJSProps(typ: any): any { | |
| 53 | + if (typ.jsonToJS === undefined) { | |
| 54 | + const map: any = {}; | |
| 55 | + typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); | |
| 56 | + typ.jsonToJS = map; | |
| 57 | + } | |
| 58 | + return typ.jsonToJS; | |
| 59 | +} | |
| 60 | + | |
| 61 | +function jsToJSONProps(typ: any): any { | |
| 62 | + if (typ.jsToJSON === undefined) { | |
| 63 | + const map: any = {}; | |
| 64 | + typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); | |
| 65 | + typ.jsToJSON = map; | |
| 66 | + } | |
| 67 | + return typ.jsToJSON; | |
| 68 | +} | |
| 69 | + | |
| 70 | +function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { | |
| 71 | + function transformPrimitive(typ: string, val: any): any { | |
| 72 | + if (typeof typ === typeof val) return val; | |
| 73 | + return invalidValue(typ, val, key, parent); | |
| 74 | + } | |
| 75 | + | |
| 76 | + function transformUnion(typs: any[], val: any): any { | |
| 77 | + // val must validate against one typ in typs | |
| 78 | + const l = typs.length; | |
| 79 | + for (let i = 0; i < l; i++) { | |
| 80 | + const typ = typs[i]; | |
| 81 | + try { | |
| 82 | + return transform(val, typ, getProps); | |
| 83 | + } catch (_) {} | |
| 84 | + } | |
| 85 | + return invalidValue(typs, val, key, parent); | |
| 86 | + } | |
| 87 | + | |
| 88 | + function transformEnum(cases: string[], val: any): any { | |
| 89 | + if (cases.indexOf(val) !== -1) return val; | |
| 90 | + return invalidValue(cases.map(a => { return l(a); }), val, key, parent); | |
| 91 | + } | |
| 92 | + | |
| 93 | + function transformArray(typ: any, val: any): any { | |
| 94 | + // val must be an array with no invalid elements | |
| 95 | + if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); | |
| 96 | + | |
| 97 | + return val.map(el => transform(el, typ, getProps)); | |
| 98 | + } | |
| 99 | + | |
| 100 | + function transformDate(val: any): any { | |
| 101 | + if (val === null) { | |
| 102 | + return null; | |
| 103 | + } | |
| 104 | + const d = new Date(val); | |
| 105 | + if (isNaN(d.valueOf())) { | |
| 106 | + return invalidValue(l("Date"), val, key, parent); | |
| 107 | + } | |
| 108 | + return d; | |
| 109 | + } | |
| 110 | + | |
| 111 | + function transformObject(props: { [k: string]: any }, additional: any, val: any): any { | |
| 112 | + if (val === null || typeof val !== "object" || Array.isArray(val)) { | |
| 113 | + return invalidValue(l(ref || "object"), val, key, parent); | |
| 114 | + } | |
| 115 | + const result: any = Object.create(null); | |
| 116 | + Object.getOwnPropertyNames(props).forEach(key => { | |
| 117 | + const prop = props[key]; | |
| 118 | + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; | |
| 119 | + result[prop.key] = transform(v, prop.typ, getProps, key, ref); | |
| 120 | + }); | |
| 121 | + Object.getOwnPropertyNames(val).forEach(key => { | |
| 122 | + if (!Object.prototype.hasOwnProperty.call(props, key)) { | |
| 123 | + result[key] = transform(val[key], additional, getProps, key, ref); | |
| 124 | + } | |
| 125 | + }); | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | + } | |
| 128 | + | |
| 129 | + if (typ === "any") return val; | |
| 130 | + if (typ === null) { | |
| 131 | + if (val === null) return val; | |
| 132 | + return invalidValue(typ, val, key, parent); | |
| 133 | + } | |
| 134 | + if (typ === false) return invalidValue(typ, val, key, parent); | |
| 135 | + let ref: any = undefined; | |
| 136 | + while (typeof typ === "object" && typ.ref !== undefined) { | |
| 137 | + ref = typ.ref; | |
| 138 | + typ = typeMap[typ.ref]; | |
| 139 | + } | |
| 140 | + if (Array.isArray(typ)) return transformEnum(typ, val); | |
| 141 | + if (typeof typ === "object") { | |
| 142 | + return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) | |
| 146 | + : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) | |
| 147 | + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) | |
| 148 | + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) | |
| 149 | + : invalidValue(typ, val, key, parent); | |
| 150 | + } | |
| 151 | + // Numbers can be parsed by Date but shouldn't be. | |
| 152 | + if (typ === Date && (typeof val === "string" || val instanceof Date)) return transformDate(val); | |
| 153 | + return transformPrimitive(typ, val); | |
| 154 | +} | |
| 155 | + | |
| 156 | +function cast<T>(val: any, typ: any): T { | |
| 157 | + return transform(val, typ, jsonToJSProps); | |
| 158 | +} | |
| 159 | + | |
| 160 | +function uncast<T>(val: T, typ: any): any { | |
| 161 | + return transform(val, typ, jsToJSONProps); | |
| 162 | +} | |
| 163 | + | |
| 164 | +function l(typ: any) { | |
| 165 | + return { literal: typ }; | |
| 166 | +} | |
| 167 | + | |
| 168 | +function a(typ: any) { | |
| 169 | + return { arrayItems: typ }; | |
| 170 | +} | |
| 171 | + | |
| 172 | +function i(typ: any) { | |
| 173 | + return { integer: typ }; | |
| 174 | +} | |
| 175 | + | |
| 176 | +function p(pattern: any) { | |
| 177 | + return { pattern }; | |
| 178 | +} | |
| 179 | + | |
| 180 | +function s(typ: any, min: any, max: any) { | |
| 181 | + return { string: typ, min, max }; | |
| 182 | +} | |
| 183 | + | |
| 184 | +function n(typ: any, min: any, max: any) { | |
| 185 | + return { number: typ, min, max }; | |
| 186 | +} | |
| 187 | + | |
| 188 | +function u(...typs: any[]) { | |
| 189 | + return { unionMembers: typs }; | |
| 190 | +} | |
| 191 | + | |
| 192 | +function o(props: any[], additional: any) { | |
| 193 | + return { props, additional }; | |
| 194 | +} | |
| 195 | + | |
| 196 | +function m(additional: any) { | |
| 197 | + const props: any[] = []; | |
| 198 | + return { props, additional }; | |
| 199 | +} | |
| 200 | + | |
| 201 | +function r(name: string) { | |
| 202 | + return { ref: name }; | |
| 203 | +} | |
| 204 | + | |
| 205 | +const typeMap: any = { | |
| 206 | + "TopLevel": o([ | |
| 207 | + { json: "map", js: "map", typ: u(undefined, r("Map")) }, | |
| 208 | + ], false), | |
| 209 | + "Map": o([ | |
| 210 | + { json: "foo", js: "foo", typ: u(undefined, 3.14) }, | |
| 211 | + ], true), | |
| 212 | +}; | |
| 213 | + | |
| 214 | +module.exports = { | |
| 215 | + "topLevelToJson": topLevelToJson, | |
| 216 | + "toTopLevel": toTopLevel, | |
| 217 | +}; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Aschema-typescriptreadonly-true--24da4fc107df / TopLevel.ts+212 −0
| @@ -0,0 +1,212 @@ | ||
| 1 | +// To parse this data: | |
| 2 | +// | |
| 3 | +// import { Convert, TopLevel } from "./TopLevel"; | |
| 4 | +// | |
| 5 | +// const topLevel = Convert.toTopLevel(json); | |
| 6 | +// | |
| 7 | +// These functions will throw an error if the JSON doesn't | |
| 8 | +// match the expected interface, even if the JSON is valid. | |
| 9 | + | |
| 10 | +export interface TopLevel { | |
| 11 | + readonly map?: Map; | |
| 12 | +} | |
| 13 | + | |
| 14 | +export interface Map { | |
| 15 | + readonly foo?: number; | |
| 16 | + readonly [property: string]: boolean | number | undefined; | |
| 17 | +} | |
| 18 | + | |
| 19 | +// Converts JSON strings to/from your types | |
| 20 | +// and asserts the results of JSON.parse at runtime | |
| 21 | +export class Convert { | |
| 22 | + public static toTopLevel(json: string): TopLevel { | |
| 23 | + return cast(JSON.parse(json), r("TopLevel")); | |
| 24 | + } | |
| 25 | + | |
| 26 | + public static topLevelToJson(value: TopLevel): string { | |
| 27 | + return JSON.stringify(uncast(value, r("TopLevel")), null, 2); | |
| 28 | + } | |
| 29 | +} | |
| 30 | + | |
| 31 | +function invalidValue(typ: any, val: any, key: any, parent: any = ''): never { | |
| 32 | + const prettyTyp = prettyTypeName(typ); | |
| 33 | + const parentText = parent ? ` on ${parent}` : ''; | |
| 34 | + const keyText = key ? ` for key "${key}"` : ''; | |
| 35 | + throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); | |
| 36 | +} | |
| 37 | + | |
| 38 | +function prettyTypeName(typ: any): string { | |
| 39 | + if (Array.isArray(typ)) { | |
| 40 | + if (typ.length === 2 && typ[0] === undefined) { | |
| 41 | + return `an optional ${prettyTypeName(typ[1])}`; | |
| 42 | + } else { | |
| 43 | + return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; | |
| 44 | + } | |
| 45 | + } else if (typeof typ === "object" && typ.literal !== undefined) { | |
| 46 | + return typ.literal; | |
| 47 | + } else { | |
| 48 | + return typeof typ; | |
| 49 | + } | |
| 50 | +} | |
| 51 | + | |
| 52 | +function jsonToJSProps(typ: any): any { | |
| 53 | + if (typ.jsonToJS === undefined) { | |
| 54 | + const map: any = {}; | |
| 55 | + typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); | |
| 56 | + typ.jsonToJS = map; | |
| 57 | + } | |
| 58 | + return typ.jsonToJS; | |
| 59 | +} | |
| 60 | + | |
| 61 | +function jsToJSONProps(typ: any): any { | |
| 62 | + if (typ.jsToJSON === undefined) { | |
| 63 | + const map: any = {}; | |
| 64 | + typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); | |
| 65 | + typ.jsToJSON = map; | |
| 66 | + } | |
| 67 | + return typ.jsToJSON; | |
| 68 | +} | |
| 69 | + | |
| 70 | +function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { | |
| 71 | + function transformPrimitive(typ: string, val: any): any { | |
| 72 | + if (typeof typ === typeof val) return val; | |
| 73 | + return invalidValue(typ, val, key, parent); | |
| 74 | + } | |
| 75 | + | |
| 76 | + function transformUnion(typs: any[], val: any): any { | |
| 77 | + // val must validate against one typ in typs | |
| 78 | + const l = typs.length; | |
| 79 | + for (let i = 0; i < l; i++) { | |
| 80 | + const typ = typs[i]; | |
| 81 | + try { | |
| 82 | + return transform(val, typ, getProps); | |
| 83 | + } catch (_) {} | |
| 84 | + } | |
| 85 | + return invalidValue(typs, val, key, parent); | |
| 86 | + } | |
| 87 | + | |
| 88 | + function transformEnum(cases: string[], val: any): any { | |
| 89 | + if (cases.indexOf(val) !== -1) return val; | |
| 90 | + return invalidValue(cases.map(a => { return l(a); }), val, key, parent); | |
| 91 | + } | |
| 92 | + | |
| 93 | + function transformArray(typ: any, val: any): any { | |
| 94 | + // val must be an array with no invalid elements | |
| 95 | + if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); | |
| 96 | + | |
| 97 | + return val.map(el => transform(el, typ, getProps)); | |
| 98 | + } | |
| 99 | + | |
| 100 | + function transformDate(val: any): any { | |
| 101 | + if (val === null) { | |
| 102 | + return null; | |
| 103 | + } | |
| 104 | + const d = new Date(val); | |
| 105 | + if (isNaN(d.valueOf())) { | |
| 106 | + return invalidValue(l("Date"), val, key, parent); | |
| 107 | + } | |
| 108 | + return d; | |
| 109 | + } | |
| 110 | + | |
| 111 | + function transformObject(props: { [k: string]: any }, additional: any, val: any): any { | |
| 112 | + if (val === null || typeof val !== "object" || Array.isArray(val)) { | |
| 113 | + return invalidValue(l(ref || "object"), val, key, parent); | |
| 114 | + } | |
| 115 | + const result: any = Object.create(null); | |
| 116 | + Object.getOwnPropertyNames(props).forEach(key => { | |
| 117 | + const prop = props[key]; | |
| 118 | + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; | |
| 119 | + result[prop.key] = transform(v, prop.typ, getProps, key, ref); | |
| 120 | + }); | |
| 121 | + Object.getOwnPropertyNames(val).forEach(key => { | |
| 122 | + if (!Object.prototype.hasOwnProperty.call(props, key)) { | |
| 123 | + result[key] = transform(val[key], additional, getProps, key, ref); | |
| 124 | + } | |
| 125 | + }); | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | + } | |
| 128 | + | |
| 129 | + if (typ === "any") return val; | |
| 130 | + if (typ === null) { | |
| 131 | + if (val === null) return val; | |
| 132 | + return invalidValue(typ, val, key, parent); | |
| 133 | + } | |
| 134 | + if (typ === false) return invalidValue(typ, val, key, parent); | |
| 135 | + let ref: any = undefined; | |
| 136 | + while (typeof typ === "object" && typ.ref !== undefined) { | |
| 137 | + ref = typ.ref; | |
| 138 | + typ = typeMap[typ.ref]; | |
| 139 | + } | |
| 140 | + if (Array.isArray(typ)) return transformEnum(typ, val); | |
| 141 | + if (typeof typ === "object") { | |
| 142 | + return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) | |
| 146 | + : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) | |
| 147 | + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) | |
| 148 | + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) | |
| 149 | + : invalidValue(typ, val, key, parent); | |
| 150 | + } | |
| 151 | + // Numbers can be parsed by Date but shouldn't be. | |
| 152 | + if (typ === Date && (typeof val === "string" || val instanceof Date)) return transformDate(val); | |
| 153 | + return transformPrimitive(typ, val); | |
| 154 | +} | |
| 155 | + | |
| 156 | +function cast<T>(val: any, typ: any): T { | |
| 157 | + return transform(val, typ, jsonToJSProps); | |
| 158 | +} | |
| 159 | + | |
| 160 | +function uncast<T>(val: T, typ: any): any { | |
| 161 | + return transform(val, typ, jsToJSONProps); | |
| 162 | +} | |
| 163 | + | |
| 164 | +function l(typ: any) { | |
| 165 | + return { literal: typ }; | |
| 166 | +} | |
| 167 | + | |
| 168 | +function a(typ: any) { | |
| 169 | + return { arrayItems: typ }; | |
| 170 | +} | |
| 171 | + | |
| 172 | +function i(typ: any) { | |
| 173 | + return { integer: typ }; | |
| 174 | +} | |
| 175 | + | |
| 176 | +function p(pattern: any) { | |
| 177 | + return { pattern }; | |
| 178 | +} | |
| 179 | + | |
| 180 | +function s(typ: any, min: any, max: any) { | |
| 181 | + return { string: typ, min, max }; | |
| 182 | +} | |
| 183 | + | |
| 184 | +function n(typ: any, min: any, max: any) { | |
| 185 | + return { number: typ, min, max }; | |
| 186 | +} | |
| 187 | + | |
| 188 | +function u(...typs: any[]) { | |
| 189 | + return { unionMembers: typs }; | |
| 190 | +} | |
| 191 | + | |
| 192 | +function o(props: any[], additional: any) { | |
| 193 | + return { props, additional }; | |
| 194 | +} | |
| 195 | + | |
| 196 | +function m(additional: any) { | |
| 197 | + const props: any[] = []; | |
| 198 | + return { props, additional }; | |
| 199 | +} | |
| 200 | + | |
| 201 | +function r(name: string) { | |
| 202 | + return { ref: name }; | |
| 203 | +} | |
| 204 | + | |
| 205 | +const typeMap: any = { | |
| 206 | + "TopLevel": o([ | |
| 207 | + { json: "map", js: "map", typ: u(undefined, r("Map")) }, | |
| 208 | + ], false), | |
| 209 | + "Map": o([ | |
| 210 | + { json: "foo", js: "foo", typ: u(undefined, 3.14) }, | |
| 211 | + ], true), | |
| 212 | +}; |
Test case
4 generated files · +8 −8test/inputs/schema/comment-injection-enum-nested-comment.schema
Mcomment-injection-typescriptdefault / TopLevel.ts+2 −2
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 122 | 122 | return invalidValue(l(ref || "object"), val, key, parent); |
| 123 | 123 | } |
| 124 | - const result: any = {}; | |
| 124 | + const result: any = Object.create(null); | |
| 125 | 125 | Object.getOwnPropertyNames(props).forEach(key => { |
| 126 | 126 | const prop = props[key]; |
| 127 | 127 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 132 | 132 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 133 | 133 | } |
| 134 | 134 | }); |
| 135 | - return result; | |
| 135 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | if (typ === "any") return val; |
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 123 | 123 | return invalidValue(l(ref || "object"), val, key, parent); |
| 124 | 124 | } |
| 125 | - const result: any = {}; | |
| 125 | + const result: any = Object.create(null); | |
| 126 | 126 | Object.getOwnPropertyNames(props).forEach(key => { |
| 127 | 127 | const prop = props[key]; |
| 128 | 128 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 134 | 134 | } |
| 135 | 135 | }); |
| 136 | - return result; | |
| 136 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 122 | 122 | return invalidValue(l(ref || "object"), val, key, parent); |
| 123 | 123 | } |
| 124 | - const result: any = {}; | |
| 124 | + const result: any = Object.create(null); | |
| 125 | 125 | Object.getOwnPropertyNames(props).forEach(key => { |
| 126 | 126 | const prop = props[key]; |
| 127 | 127 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 132 | 132 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 133 | 133 | } |
| 134 | 134 | }); |
| 135 | - return result; | |
| 135 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | if (typ === "any") return val; |
Test case
4 generated files · +8 −8test/inputs/schema/comment-injection-enum.schema
Mcomment-injection-typescriptdefault / TopLevel.ts+2 −2
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 128 | 128 | return invalidValue(l(ref || "object"), val, key, parent); |
| 129 | 129 | } |
| 130 | - const result: any = {}; | |
| 130 | + const result: any = Object.create(null); | |
| 131 | 131 | Object.getOwnPropertyNames(props).forEach(key => { |
| 132 | 132 | const prop = props[key]; |
| 133 | 133 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 139 | 139 | } |
| 140 | 140 | }); |
| 141 | - return result; | |
| 141 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | if (typ === "any") return val; |
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 129 | 129 | return invalidValue(l(ref || "object"), val, key, parent); |
| 130 | 130 | } |
| 131 | - const result: any = {}; | |
| 131 | + const result: any = Object.create(null); | |
| 132 | 132 | Object.getOwnPropertyNames(props).forEach(key => { |
| 133 | 133 | const prop = props[key]; |
| 134 | 134 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 140 | 140 | } |
| 141 | 141 | }); |
| 142 | - return result; | |
| 142 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 128 | 128 | return invalidValue(l(ref || "object"), val, key, parent); |
| 129 | 129 | } |
| 130 | - const result: any = {}; | |
| 130 | + const result: any = Object.create(null); | |
| 131 | 131 | Object.getOwnPropertyNames(props).forEach(key => { |
| 132 | 132 | const prop = props[key]; |
| 133 | 133 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 139 | 139 | } |
| 140 | 140 | }); |
| 141 | - return result; | |
| 141 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | if (typ === "any") return val; |
Test case
4 generated files · +8 −8test/inputs/schema/comment-injection-nested-comment.schema
Mcomment-injection-typescriptdefault / TopLevel.ts+2 −2
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 120 | 120 | return invalidValue(l(ref || "object"), val, key, parent); |
| 121 | 121 | } |
| 122 | - const result: any = {}; | |
| 122 | + const result: any = Object.create(null); | |
| 123 | 123 | Object.getOwnPropertyNames(props).forEach(key => { |
| 124 | 124 | const prop = props[key]; |
| 125 | 125 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 130 | 130 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 131 | 131 | } |
| 132 | 132 | }); |
| 133 | - return result; | |
| 133 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | if (typ === "any") return val; |
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 120 | 120 | return invalidValue(l(ref || "object"), val, key, parent); |
| 121 | 121 | } |
| 122 | - const result: any = {}; | |
| 122 | + const result: any = Object.create(null); | |
| 123 | 123 | Object.getOwnPropertyNames(props).forEach(key => { |
| 124 | 124 | const prop = props[key]; |
| 125 | 125 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 130 | 130 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 131 | 131 | } |
| 132 | 132 | }); |
| 133 | - return result; | |
| 133 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 120 | 120 | return invalidValue(l(ref || "object"), val, key, parent); |
| 121 | 121 | } |
| 122 | - const result: any = {}; | |
| 122 | + const result: any = Object.create(null); | |
| 123 | 123 | Object.getOwnPropertyNames(props).forEach(key => { |
| 124 | 124 | const prop = props[key]; |
| 125 | 125 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 130 | 130 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 131 | 131 | } |
| 132 | 132 | }); |
| 133 | - return result; | |
| 133 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | if (typ === "any") return val; |
Test case
4 generated files · +8 −8test/inputs/schema/comment-injection.schema
Mcomment-injection-typescriptdefault / TopLevel.ts+2 −2
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 148 | 148 | return invalidValue(l(ref || "object"), val, key, parent); |
| 149 | 149 | } |
| 150 | - const result: any = {}; | |
| 150 | + const result: any = Object.create(null); | |
| 151 | 151 | Object.getOwnPropertyNames(props).forEach(key => { |
| 152 | 152 | const prop = props[key]; |
| 153 | 153 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 158 | 158 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 159 | 159 | } |
| 160 | 160 | }); |
| 161 | - return result; | |
| 161 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | if (typ === "any") return val; |
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 148 | 148 | return invalidValue(l(ref || "object"), val, key, parent); |
| 149 | 149 | } |
| 150 | - const result: any = {}; | |
| 150 | + const result: any = Object.create(null); | |
| 151 | 151 | Object.getOwnPropertyNames(props).forEach(key => { |
| 152 | 152 | const prop = props[key]; |
| 153 | 153 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 158 | 158 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 159 | 159 | } |
| 160 | 160 | }); |
| 161 | - return result; | |
| 161 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 148 | 148 | return invalidValue(l(ref || "object"), val, key, parent); |
| 149 | 149 | } |
| 150 | - const result: any = {}; | |
| 150 | + const result: any = Object.create(null); | |
| 151 | 151 | Object.getOwnPropertyNames(props).forEach(key => { |
| 152 | 152 | const prop = props[key]; |
| 153 | 153 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 158 | 158 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 159 | 159 | } |
| 160 | 160 | }); |
| 161 | - return result; | |
| 161 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/const-non-string.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/constructor.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/cut-enum.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/date-time-or-string.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/date-time.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/default-value.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/description-with-double-quotes.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/description.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 146 | 146 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 147 | 147 | return invalidValue(l(ref || "object"), val, key, parent); |
| 148 | 148 | } |
| 149 | - const result: any = {}; | |
| 149 | + const result: any = Object.create(null); | |
| 150 | 150 | Object.getOwnPropertyNames(props).forEach(key => { |
| 151 | 151 | const prop = props[key]; |
| 152 | 152 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -157,7 +157,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 157 | 157 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 158 | 158 | } |
| 159 | 159 | }); |
| 160 | - return result; | |
| 160 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 145 | 145 | return invalidValue(l(ref || "object"), val, key, parent); |
| 146 | 146 | } |
| 147 | - const result: any = {}; | |
| 147 | + const result: any = Object.create(null); | |
| 148 | 148 | Object.getOwnPropertyNames(props).forEach(key => { |
| 149 | 149 | const prop = props[key]; |
| 150 | 150 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -155,7 +155,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 155 | 155 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 156 | 156 | } |
| 157 | 157 | }); |
| 158 | - return result; | |
| 158 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | if (typ === "any") return val; |
Test case
4 generated files · +16 −8test/inputs/schema/direct-union.schema
Mschema-elmdefault / QuickType.elm+10 −2
| @@ -61,7 +61,7 @@ quickType = | ||
| 61 | 61 | encodeQuickType : QuickType -> Jenc.Value |
| 62 | 62 | encodeQuickType x = |
| 63 | 63 | Jenc.object |
| 64 | - [ ("stuff", Jenc.dict identity encodeThing x.stuff) | |
| 64 | + [ ("stuff", makeDictEncoder identity encodeThing x.stuff) | |
| 65 | 65 | ] |
| 66 | 66 | |
| 67 | 67 | thing : Jdec.Decoder Thing |
| @@ -97,10 +97,18 @@ encodeAnything x = case x of | ||
| 97 | 97 | NullInAnything -> Jenc.null |
| 98 | 98 | StringInAnything y -> Jenc.string y |
| 99 | 99 | DoubleInAnything y -> Jenc.float y |
| 100 | - AnythingMapInAnything y -> Jenc.dict identity identity y | |
| 100 | + AnythingMapInAnything y -> makeDictEncoder identity identity y | |
| 101 | 101 | |
| 102 | 102 | --- encoder helpers |
| 103 | 103 | |
| 104 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 105 | +makeDictEncoder f m r = | |
| 106 | + r | |
| 107 | + |> Dict.toList | |
| 108 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 109 | + |> String.join "," | |
| 110 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 111 | + | |
| 104 | 112 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 105 | 113 | makeNullableEncoder f m = |
| 106 | 114 | case m of |
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/schema/empty-object.schema
Mschema-elmdefault / QuickType.elm+9 −1
| @@ -36,10 +36,18 @@ quickType : Jdec.Decoder QuickType | ||
| 36 | 36 | quickType = Jdec.dict Jdec.value |
| 37 | 37 | |
| 38 | 38 | quickTypeToString : QuickType -> String |
| 39 | -quickTypeToString r = Jenc.encode 0 (Jenc.dict identity identity r) | |
| 39 | +quickTypeToString r = Jenc.encode 0 (makeDictEncoder identity identity r) | |
| 40 | 40 | |
| 41 | 41 | --- encoder helpers |
| 42 | 42 | |
| 43 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 44 | +makeDictEncoder f m r = | |
| 45 | + r | |
| 46 | + |> Dict.toList | |
| 47 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 48 | + |> String.join "," | |
| 49 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 50 | + | |
| 43 | 51 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 44 | 52 | makeNullableEncoder f m = |
| 45 | 53 | case m of |
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 105 | 105 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 106 | 106 | return invalidValue(l(ref || "object"), val, key, parent); |
| 107 | 107 | } |
| 108 | - const result: any = {}; | |
| 108 | + const result: any = Object.create(null); | |
| 109 | 109 | Object.getOwnPropertyNames(props).forEach(key => { |
| 110 | 110 | const prop = props[key]; |
| 111 | 111 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 117 | 117 | } |
| 118 | 118 | }); |
| 119 | - return result; | |
| 119 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 105 | 105 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 106 | 106 | return invalidValue(l(ref || "object"), val, key, parent); |
| 107 | 107 | } |
| 108 | - const result: any = {}; | |
| 108 | + const result: any = Object.create(null); | |
| 109 | 109 | Object.getOwnPropertyNames(props).forEach(key => { |
| 110 | 110 | const prop = props[key]; |
| 111 | 111 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 117 | 117 | } |
| 118 | 118 | }); |
| 119 | - return result; | |
| 119 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/enum-large.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 137 | 137 | return invalidValue(l(ref || "object"), val, key, parent); |
| 138 | 138 | } |
| 139 | - const result: any = {}; | |
| 139 | + const result: any = Object.create(null); | |
| 140 | 140 | Object.getOwnPropertyNames(props).forEach(key => { |
| 141 | 141 | const prop = props[key]; |
| 142 | 142 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 148 | 148 | } |
| 149 | 149 | }); |
| 150 | - return result; | |
| 150 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/enum-with-null.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/enum-with-values.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/enum.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -129,7 +129,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 129 | 129 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 130 | 130 | return invalidValue(l(ref || "object"), val, key, parent); |
| 131 | 131 | } |
| 132 | - const result: any = {}; | |
| 132 | + const result: any = Object.create(null); | |
| 133 | 133 | Object.getOwnPropertyNames(props).forEach(key => { |
| 134 | 134 | const prop = props[key]; |
| 135 | 135 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 141 | 141 | } |
| 142 | 142 | }); |
| 143 | - return result; | |
| 143 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 121 | 121 | return invalidValue(l(ref || "object"), val, key, parent); |
| 122 | 122 | } |
| 123 | - const result: any = {}; | |
| 123 | + const result: any = Object.create(null); | |
| 124 | 124 | Object.getOwnPropertyNames(props).forEach(key => { |
| 125 | 125 | const prop = props[key]; |
| 126 | 126 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -131,7 +131,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 131 | 131 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 132 | 132 | } |
| 133 | 133 | }); |
| 134 | - return result; | |
| 134 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/fractional-bounds.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/schema/go-schema-pattern-properties.schema
Mschema-elmdefault / QuickType.elm+9 −1
| @@ -45,11 +45,19 @@ quickType = | ||
| 45 | 45 | encodeQuickType : QuickType -> Jenc.Value |
| 46 | 46 | encodeQuickType x = |
| 47 | 47 | Jenc.object |
| 48 | - [ ("map", Jenc.dict identity Jenc.int x.map) | |
| 48 | + [ ("map", makeDictEncoder identity Jenc.int x.map) | |
| 49 | 49 | ] |
| 50 | 50 | |
| 51 | 51 | --- encoder helpers |
| 52 | 52 | |
| 53 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 54 | +makeDictEncoder f m r = | |
| 55 | + r | |
| 56 | + |> Dict.toList | |
| 57 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 58 | + |> String.join "," | |
| 59 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 60 | + | |
| 53 | 61 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 54 | 62 | makeNullableEncoder f m = |
| 55 | 63 | case m of |
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/haskell-enum-forbidden.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/id-no-address.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/id-root.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/ie-suffix-singularization.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/implicit-all-of.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/implicit-class-array-union.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/implicit-one-of.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/integer-before-number.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/integer-float-union.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/integer-string.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 117 | 117 | return invalidValue(l(ref || "object"), val, key, parent); |
| 118 | 118 | } |
| 119 | - const result: any = {}; | |
| 119 | + const result: any = Object.create(null); | |
| 120 | 120 | Object.getOwnPropertyNames(props).forEach(key => { |
| 121 | 121 | const prop = props[key]; |
| 122 | 122 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - return result; | |
| 130 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 117 | 117 | return invalidValue(l(ref || "object"), val, key, parent); |
| 118 | 118 | } |
| 119 | - const result: any = {}; | |
| 119 | + const result: any = Object.create(null); | |
| 120 | 120 | Object.getOwnPropertyNames(props).forEach(key => { |
| 121 | 121 | const prop = props[key]; |
| 122 | 122 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - return result; | |
| 130 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/integer-type.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 117 | 117 | return invalidValue(l(ref || "object"), val, key, parent); |
| 118 | 118 | } |
| 119 | - const result: any = {}; | |
| 119 | + const result: any = Object.create(null); | |
| 120 | 120 | Object.getOwnPropertyNames(props).forEach(key => { |
| 121 | 121 | const prop = props[key]; |
| 122 | 122 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - return result; | |
| 130 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 117 | 117 | return invalidValue(l(ref || "object"), val, key, parent); |
| 118 | 118 | } |
| 119 | - const result: any = {}; | |
| 119 | + const result: any = Object.create(null); | |
| 120 | 120 | Object.getOwnPropertyNames(props).forEach(key => { |
| 121 | 121 | const prop = props[key]; |
| 122 | 122 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 127 | 127 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - return result; | |
| 130 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/intersection-nested.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 107 | 107 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 108 | 108 | return invalidValue(l(ref || "object"), val, key, parent); |
| 109 | 109 | } |
| 110 | - const result: any = {}; | |
| 110 | + const result: any = Object.create(null); | |
| 111 | 111 | Object.getOwnPropertyNames(props).forEach(key => { |
| 112 | 112 | const prop = props[key]; |
| 113 | 113 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 118 | 118 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 119 | 119 | } |
| 120 | 120 | }); |
| 121 | - return result; | |
| 121 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 107 | 107 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 108 | 108 | return invalidValue(l(ref || "object"), val, key, parent); |
| 109 | 109 | } |
| 110 | - const result: any = {}; | |
| 110 | + const result: any = Object.create(null); | |
| 111 | 111 | Object.getOwnPropertyNames(props).forEach(key => { |
| 112 | 112 | const prop = props[key]; |
| 113 | 113 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 118 | 118 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 119 | 119 | } |
| 120 | 120 | }); |
| 121 | - return result; | |
| 121 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/intersection.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/issue2680-top-level-array.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 105 | 105 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 106 | 106 | return invalidValue(l(ref || "object"), val, key, parent); |
| 107 | 107 | } |
| 108 | - const result: any = {}; | |
| 108 | + const result: any = Object.create(null); | |
| 109 | 109 | Object.getOwnPropertyNames(props).forEach(key => { |
| 110 | 110 | const prop = props[key]; |
| 111 | 111 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 117 | 117 | } |
| 118 | 118 | }); |
| 119 | - return result; | |
| 119 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 105 | 105 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 106 | 106 | return invalidValue(l(ref || "object"), val, key, parent); |
| 107 | 107 | } |
| 108 | - const result: any = {}; | |
| 108 | + const result: any = Object.create(null); | |
| 109 | 109 | Object.getOwnPropertyNames(props).forEach(key => { |
| 110 | 110 | const prop = props[key]; |
| 111 | 111 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 117 | 117 | } |
| 118 | 118 | }); |
| 119 | - return result; | |
| 119 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | if (typ === "any") return val; |
Test case
34 generated files · +290 −18test/inputs/schema/keyword-enum.schema
Mschema-cjsondefault / TopLevel.c+8 −0
| @@ -129,6 +129,7 @@ enum Enum cJSON_GetEnumValue(const cJSON * j) { | ||
| 129 | 129 | else if (!strcmp(cJSON_GetStringValue(j), "FormatException")) x = ENUM_FORMAT_EXCEPTION; |
| 130 | 130 | else if (!strcmp(cJSON_GetStringValue(j), "friend")) x = ENUM_FRIEND; |
| 131 | 131 | else if (!strcmp(cJSON_GetStringValue(j), "from")) x = ENUM_FROM; |
| 132 | + else if (!strcmp(cJSON_GetStringValue(j), "from_dict")) x = ENUM_FROM_DICT; | |
| 132 | 133 | else if (!strcmp(cJSON_GetStringValue(j), "from_json")) x = ENUM_FROM_JSON; |
| 133 | 134 | else if (!strcmp(cJSON_GetStringValue(j), "func")) x = ENUM_FUNC; |
| 134 | 135 | else if (!strcmp(cJSON_GetStringValue(j), "function")) x = ENUM_FUNCTION; |
| @@ -188,6 +189,7 @@ enum Enum cJSON_GetEnumValue(const cJSON * j) { | ||
| 188 | 189 | else if (!strcmp(cJSON_GetStringValue(j), "lock")) x = ENUM_LOCK; |
| 189 | 190 | else if (!strcmp(cJSON_GetStringValue(j), "long")) x = ENUM_LONG; |
| 190 | 191 | else if (!strcmp(cJSON_GetStringValue(j), "map")) x = ENUM_MAP; |
| 192 | + else if (!strcmp(cJSON_GetStringValue(j), "MarshalJSON")) x = ENUM_MARSHAL_JSON; | |
| 191 | 193 | else if (!strcmp(cJSON_GetStringValue(j), "MapEntry")) x = ENUM_MAP_ENTRY; |
| 192 | 194 | else if (!strcmp(cJSON_GetStringValue(j), "metadata_property_handling")) x = ENUM_METADATA_PROPERTY_HANDLING; |
| 193 | 195 | else if (!strcmp(cJSON_GetStringValue(j), "module")) x = ENUM_MODULE; |
| @@ -307,6 +309,7 @@ enum Enum cJSON_GetEnumValue(const cJSON * j) { | ||
| 307 | 309 | else if (!strcmp(cJSON_GetStringValue(j), "to_json")) x = ENUM_TO_JSON; |
| 308 | 310 | else if (!strcmp(cJSON_GetStringValue(j), "top_level")) x = ENUM_TOP_LEVEL; |
| 309 | 311 | else if (!strcmp(cJSON_GetStringValue(j), "toString")) x = ENUM_TO_STRING; |
| 312 | + else if (!strcmp(cJSON_GetStringValue(j), "to_dict")) x = ENUM_TO_DICT; | |
| 310 | 313 | else if (!strcmp(cJSON_GetStringValue(j), "transient")) x = ENUM_TRANSIENT; |
| 311 | 314 | else if (!strcmp(cJSON_GetStringValue(j), "True")) x = ENUM_TRUE; |
| 312 | 315 | else if (!strcmp(cJSON_GetStringValue(j), "true")) x = ENUM_ENUM_TRUE; |
| @@ -323,6 +326,7 @@ enum Enum cJSON_GetEnumValue(const cJSON * j) { | ||
| 323 | 326 | else if (!strcmp(cJSON_GetStringValue(j), "unchecked")) x = ENUM_UNCHECKED; |
| 324 | 327 | else if (!strcmp(cJSON_GetStringValue(j), "undefined")) x = ENUM_UNDEFINED; |
| 325 | 328 | else if (!strcmp(cJSON_GetStringValue(j), "union")) x = ENUM_UNION; |
| 329 | + else if (!strcmp(cJSON_GetStringValue(j), "UnmarshalJSON")) x = ENUM_UNMARSHAL_JSON; | |
| 326 | 330 | else if (!strcmp(cJSON_GetStringValue(j), "UseSerializers")) x = ENUM_USE_SERIALIZERS; |
| 327 | 331 | else if (!strcmp(cJSON_GetStringValue(j), "unowned")) x = ENUM_UNOWNED; |
| 328 | 332 | else if (!strcmp(cJSON_GetStringValue(j), "unsafe")) x = ENUM_UNSAFE; |
| @@ -475,6 +479,7 @@ cJSON * cJSON_CreateEnum(const enum Enum x) { | ||
| 475 | 479 | case ENUM_FORMAT_EXCEPTION: j = cJSON_CreateString("FormatException"); break; |
| 476 | 480 | case ENUM_FRIEND: j = cJSON_CreateString("friend"); break; |
| 477 | 481 | case ENUM_FROM: j = cJSON_CreateString("from"); break; |
| 482 | + case ENUM_FROM_DICT: j = cJSON_CreateString("from_dict"); break; | |
| 478 | 483 | case ENUM_FROM_JSON: j = cJSON_CreateString("from_json"); break; |
| 479 | 484 | case ENUM_FUNC: j = cJSON_CreateString("func"); break; |
| 480 | 485 | case ENUM_FUNCTION: j = cJSON_CreateString("function"); break; |
| @@ -534,6 +539,7 @@ cJSON * cJSON_CreateEnum(const enum Enum x) { | ||
| 534 | 539 | case ENUM_LOCK: j = cJSON_CreateString("lock"); break; |
| 535 | 540 | case ENUM_LONG: j = cJSON_CreateString("long"); break; |
| 536 | 541 | case ENUM_MAP: j = cJSON_CreateString("map"); break; |
| 542 | + case ENUM_MARSHAL_JSON: j = cJSON_CreateString("MarshalJSON"); break; | |
| 537 | 543 | case ENUM_MAP_ENTRY: j = cJSON_CreateString("MapEntry"); break; |
| 538 | 544 | case ENUM_METADATA_PROPERTY_HANDLING: j = cJSON_CreateString("metadata_property_handling"); break; |
| 539 | 545 | case ENUM_MODULE: j = cJSON_CreateString("module"); break; |
| @@ -653,6 +659,7 @@ cJSON * cJSON_CreateEnum(const enum Enum x) { | ||
| 653 | 659 | case ENUM_TO_JSON: j = cJSON_CreateString("to_json"); break; |
| 654 | 660 | case ENUM_TOP_LEVEL: j = cJSON_CreateString("top_level"); break; |
| 655 | 661 | case ENUM_TO_STRING: j = cJSON_CreateString("toString"); break; |
| 662 | + case ENUM_TO_DICT: j = cJSON_CreateString("to_dict"); break; | |
| 656 | 663 | case ENUM_TRANSIENT: j = cJSON_CreateString("transient"); break; |
| 657 | 664 | case ENUM_TRUE: j = cJSON_CreateString("True"); break; |
| 658 | 665 | case ENUM_ENUM_TRUE: j = cJSON_CreateString("true"); break; |
| @@ -669,6 +676,7 @@ cJSON * cJSON_CreateEnum(const enum Enum x) { | ||
| 669 | 676 | case ENUM_UNCHECKED: j = cJSON_CreateString("unchecked"); break; |
| 670 | 677 | case ENUM_UNDEFINED: j = cJSON_CreateString("undefined"); break; |
| 671 | 678 | case ENUM_UNION: j = cJSON_CreateString("union"); break; |
| 679 | + case ENUM_UNMARSHAL_JSON: j = cJSON_CreateString("UnmarshalJSON"); break; | |
| 672 | 680 | case ENUM_USE_SERIALIZERS: j = cJSON_CreateString("UseSerializers"); break; |
| 673 | 681 | case ENUM_UNOWNED: j = cJSON_CreateString("unowned"); break; |
| 674 | 682 | case ENUM_UNSAFE: j = cJSON_CreateString("unsafe"); break; |
Mschema-cjsondefault / TopLevel.h+4 −0
| @@ -170,6 +170,7 @@ enum Enum { | ||
| 170 | 170 | ENUM_FORMAT_EXCEPTION, |
| 171 | 171 | ENUM_FRIEND, |
| 172 | 172 | ENUM_FROM, |
| 173 | + ENUM_FROM_DICT, | |
| 173 | 174 | ENUM_FROM_JSON, |
| 174 | 175 | ENUM_FUNC, |
| 175 | 176 | ENUM_FUNCTION, |
| @@ -229,6 +230,7 @@ enum Enum { | ||
| 229 | 230 | ENUM_LOCK, |
| 230 | 231 | ENUM_LONG, |
| 231 | 232 | ENUM_MAP, |
| 233 | + ENUM_MARSHAL_JSON, | |
| 232 | 234 | ENUM_MAP_ENTRY, |
| 233 | 235 | ENUM_METADATA_PROPERTY_HANDLING, |
| 234 | 236 | ENUM_MODULE, |
| @@ -348,6 +350,7 @@ enum Enum { | ||
| 348 | 350 | ENUM_TO_JSON, |
| 349 | 351 | ENUM_TOP_LEVEL, |
| 350 | 352 | ENUM_TO_STRING, |
| 353 | + ENUM_TO_DICT, | |
| 351 | 354 | ENUM_TRANSIENT, |
| 352 | 355 | ENUM_TRUE, |
| 353 | 356 | ENUM_ENUM_TRUE, |
| @@ -364,6 +367,7 @@ enum Enum { | ||
| 364 | 367 | ENUM_UNCHECKED, |
| 365 | 368 | ENUM_UNDEFINED, |
| 366 | 369 | ENUM_UNION, |
| 370 | + ENUM_UNMARSHAL_JSON, | |
| 367 | 371 | ENUM_USE_SERIALIZERS, |
| 368 | 372 | ENUM_UNOWNED, |
| 369 | 373 | ENUM_UNSAFE, |
Mschema-cplusplusdefault / quicktype.hpp+9 −1
| @@ -89,7 +89,7 @@ namespace quicktype { | ||
| 89 | 89 | } |
| 90 | 90 | #endif |
| 91 | 91 | |
| 92 | - enum class Enum : int { EMPTY, BOOL, COMPLEX, IMAGINERY, ABSTRACT, ALIGNAS, ALIGNOF, AND, AND_EQ, ANY, ENUM_ANY, ARRAY, AS, ASM, ASSERT, ASSOCIATEDTYPE, ASSOCIATIVITY, ASYNC, ATOMIC, ATOMIC_CANCEL, ATOMIC_COMMIT, ATOMIC_NOEXCEPT, AUTO, AWAIT, BASE, BITAND, BITOR, ENUM_BOOL, PURPLE_BOOL, BOOLEAN, BREAK, BYCOPY, BYREF, BYTE, CALENDAR, CASE, CATCH, CHAN, CHAR, CHAR16_T, CHAR32_T, CHECKED, CLASS, ENUM_CLASS, CLONE, CO_AWAIT, CO_RETURN, CO_YIELD, CODABLE, CODING_KEY, CODING_KEYS, COMPL, CONCEPT, CONSOLE, CONST, CONST_CAST, CONSTEXPR, CONSTRUCTOR, CONTINUE, CONVENIENCE, CONVERT, CONVERTER, CULTURE_INFO, DATE, DATE_PARSE_HANDLING, DATE_FORMATTER, DATE_ONLY, DATE_ONLY_CONVERTER, DATE_TIME, DATE_TIME_STYLES, DEBUGGER, DECIMAL, DECLARE, DECLTYPE, DECODE_STRING, DECODER, DECODING_ERROR, DEF, DEFAULT, DEFER, DEINIT, DEL, DELEGATE, DELETE, DICT, DICTIONARY, DID_SET, DO, DOUBLE, DYNAMIC, DYNAMIC_CAST, ELIF, ELSE, ENCODE_QUICK_TYPE, ENCODER, ENUM, ENUM_VALUES, EQUATABLE, EQUALITY_CONTRACT, EVENT, EXCEPT, EXCEPTION, EXPLICIT, EXPORT, EXPOSING, EXTENDS, EXTENSION, EXTERN, FALLTHROUGH, FALSE, ENUM_FALSE, FILEPRIVATE, FINAL, FINALLY, FIXED, FLOAT, FOR, FOREACH, FORMAT_EXCEPTION, FRIEND, FROM, FROM_JSON, FUNC, FUNCTION, GET, GLOBAL, GO, GOTO, GUARD, HASHABLE, HASH_CODE, HASHER, HAS_OWN_PROPERTY, ID, IF, IMP, IMPLEMENTS, IMPLICIT, IMPORT, IN, INDIRECT, INFIX, INIT, INLINE, INOUT, INSTANCEOF, INT, INTERFACE, INTERNAL, ISO_DATE_TIME_OFFSET_CONVERTER, ITERABLE, IS, JDEC, JENC, JPIPE, JSON, JSON_CONVERTER, JSON_SERIALIZER, JSON_TOKEN, JSON_WRITER, JSON_ANY, JSON_CODING_KEY, JSON_DECODER, JSON_ENCODER, JSON_EXCEPTION, JSON_GENERATOR, JSON_NODE, JSON_NULL, JSON_PARSER, JSON_READER, JSON_TOKEN_TYPE, LAMBDA, LAZY, LEFT, LET, LIST, LOCALE, LOCK, LONG, MAP, MAP_ENTRY, METADATA_PROPERTY_HANDLING, MODULE, MUTABLE, MUTATING, NAMESPACE, NATIVE, NEW, NEWTONSOFT, NIL, NO, NOEXCEPT, NONATOMIC, NONE, ENUM_NONE, NONLOCAL, NONMUTATING, NS_OBJECT, NO_SUCH_METHOD, NOT, NOT_EQ, NS_ERROR, NS_STRING, ENUM_NULL, PURPLE_NULL, NULLPTR, NUMBER, OBJECT, OBJECT_MAPPER, OF, ONEWAY, OPEN, OPERATOR, OPTIONAL, OR, OR_EQ, OUT, OVERRIDE, PACKAGE, PARAMS, PASS, PORT, POSTFIX, PRECEDENCE, PREFIX, PRINT, PRINTF, PRINT_MEMBERS, PRIVATE, PROTECTED, PROTOCOL, ENUM_PROTOCOL, PUBLIC, QUICKTYPE, RAISE, RANGE, READONLY, REF, REG_EXP, REGISTER, REINTERPRET_CAST, REPEAT, REQUIRE, REQUIRED, REQUIRES, RESTRICT, RETAIN, RETHROWS, RETURN, RIGHT, RUNTIME_TYPE, S, SBYTE, SEALED, SEL, SELECT, SELF, SERIALIZABLE, ENUM_SELF, SENDABLE, SERIALIZE, SERIAL_NAME, K_SERIALIZER, PRIMITIVE_KIND, SERIAL_DESCRIPTOR, SERIALIZER_PROVIDER, SET, SHORT, SIGNED, SIMPLE_MODULE, SIZEOF, STACKALLOC, STANDARDS, STATIC, STATIC_ASSERT, STATIC_CAST, STD_DESERIALIZER, STD_SERIALIZER, STRICTFP, STRING, STRUCT, SUBSCRIPT, SUPER, SWITCH, SYMBOL, SYNCHRONIZED, SYSTEM, TEMPLATE, THEN, THIS, THREAD_LOCAL, THROW, THROWS, TIME_ONLY, TIME_ONLY_CONVERTER, TIME_ZONE, TO_JSON, TOP_LEVEL, TO_STRING, TRANSIENT, TRUE, ENUM_TRUE, TRY, TYPE, ENUM_TYPE, TYPEALIAS, TYPEDEF, TYPEID, TYPENAME, TYPEOF, UINT, ULONG, UNCHECKED, UNDEFINED, UNION, USE_SERIALIZERS, UNOWNED, UNSAFE, UNSIGNED, USHORT, USING, UTF8_JSON_READER, UTF8_JSON_WRITER, UUID, VAR, VIRTUAL, VOID, VOLATILE, WCHAR_T, WEAK, WHERE, WHILE, WILL_SET, WITH, XOR, XOR_EQ, YES, YIELD, DUMMY }; | |
| 92 | + enum class Enum : int { EMPTY, BOOL, COMPLEX, IMAGINERY, ABSTRACT, ALIGNAS, ALIGNOF, AND, AND_EQ, ANY, ENUM_ANY, ARRAY, AS, ASM, ASSERT, ASSOCIATEDTYPE, ASSOCIATIVITY, ASYNC, ATOMIC, ATOMIC_CANCEL, ATOMIC_COMMIT, ATOMIC_NOEXCEPT, AUTO, AWAIT, BASE, BITAND, BITOR, ENUM_BOOL, PURPLE_BOOL, BOOLEAN, BREAK, BYCOPY, BYREF, BYTE, CALENDAR, CASE, CATCH, CHAN, CHAR, CHAR16_T, CHAR32_T, CHECKED, CLASS, ENUM_CLASS, CLONE, CO_AWAIT, CO_RETURN, CO_YIELD, CODABLE, CODING_KEY, CODING_KEYS, COMPL, CONCEPT, CONSOLE, CONST, CONST_CAST, CONSTEXPR, CONSTRUCTOR, CONTINUE, CONVENIENCE, CONVERT, CONVERTER, CULTURE_INFO, DATE, DATE_PARSE_HANDLING, DATE_FORMATTER, DATE_ONLY, DATE_ONLY_CONVERTER, DATE_TIME, DATE_TIME_STYLES, DEBUGGER, DECIMAL, DECLARE, DECLTYPE, DECODE_STRING, DECODER, DECODING_ERROR, DEF, DEFAULT, DEFER, DEINIT, DEL, DELEGATE, DELETE, DICT, DICTIONARY, DID_SET, DO, DOUBLE, DYNAMIC, DYNAMIC_CAST, ELIF, ELSE, ENCODE_QUICK_TYPE, ENCODER, ENUM, ENUM_VALUES, EQUATABLE, EQUALITY_CONTRACT, EVENT, EXCEPT, EXCEPTION, EXPLICIT, EXPORT, EXPOSING, EXTENDS, EXTENSION, EXTERN, FALLTHROUGH, FALSE, ENUM_FALSE, FILEPRIVATE, FINAL, FINALLY, FIXED, FLOAT, FOR, FOREACH, FORMAT_EXCEPTION, FRIEND, FROM, FROM_DICT, FROM_JSON, FUNC, FUNCTION, GET, GLOBAL, GO, GOTO, GUARD, HASHABLE, HASH_CODE, HASHER, HAS_OWN_PROPERTY, ID, IF, IMP, IMPLEMENTS, IMPLICIT, IMPORT, IN, INDIRECT, INFIX, INIT, INLINE, INOUT, INSTANCEOF, INT, INTERFACE, INTERNAL, ISO_DATE_TIME_OFFSET_CONVERTER, ITERABLE, IS, JDEC, JENC, JPIPE, JSON, JSON_CONVERTER, JSON_SERIALIZER, JSON_TOKEN, JSON_WRITER, JSON_ANY, JSON_CODING_KEY, JSON_DECODER, JSON_ENCODER, JSON_EXCEPTION, JSON_GENERATOR, JSON_NODE, JSON_NULL, JSON_PARSER, JSON_READER, JSON_TOKEN_TYPE, LAMBDA, LAZY, LEFT, LET, LIST, LOCALE, LOCK, LONG, MAP, MARSHAL_JSON, MAP_ENTRY, METADATA_PROPERTY_HANDLING, MODULE, MUTABLE, MUTATING, NAMESPACE, NATIVE, NEW, NEWTONSOFT, NIL, NO, NOEXCEPT, NONATOMIC, NONE, ENUM_NONE, NONLOCAL, NONMUTATING, NS_OBJECT, NO_SUCH_METHOD, NOT, NOT_EQ, NS_ERROR, NS_STRING, ENUM_NULL, PURPLE_NULL, NULLPTR, NUMBER, OBJECT, OBJECT_MAPPER, OF, ONEWAY, OPEN, OPERATOR, OPTIONAL, OR, OR_EQ, OUT, OVERRIDE, PACKAGE, PARAMS, PASS, PORT, POSTFIX, PRECEDENCE, PREFIX, PRINT, PRINTF, PRINT_MEMBERS, PRIVATE, PROTECTED, PROTOCOL, ENUM_PROTOCOL, PUBLIC, QUICKTYPE, RAISE, RANGE, READONLY, REF, REG_EXP, REGISTER, REINTERPRET_CAST, REPEAT, REQUIRE, REQUIRED, REQUIRES, RESTRICT, RETAIN, RETHROWS, RETURN, RIGHT, RUNTIME_TYPE, S, SBYTE, SEALED, SEL, SELECT, SELF, SERIALIZABLE, ENUM_SELF, SENDABLE, SERIALIZE, SERIAL_NAME, K_SERIALIZER, PRIMITIVE_KIND, SERIAL_DESCRIPTOR, SERIALIZER_PROVIDER, SET, SHORT, SIGNED, SIMPLE_MODULE, SIZEOF, STACKALLOC, STANDARDS, STATIC, STATIC_ASSERT, STATIC_CAST, STD_DESERIALIZER, STD_SERIALIZER, STRICTFP, STRING, STRUCT, SUBSCRIPT, SUPER, SWITCH, SYMBOL, SYNCHRONIZED, SYSTEM, TEMPLATE, THEN, THIS, THREAD_LOCAL, THROW, THROWS, TIME_ONLY, TIME_ONLY_CONVERTER, TIME_ZONE, TO_JSON, TOP_LEVEL, TO_STRING, TO_DICT, TRANSIENT, TRUE, ENUM_TRUE, TRY, TYPE, ENUM_TYPE, TYPEALIAS, TYPEDEF, TYPEID, TYPENAME, TYPEOF, UINT, ULONG, UNCHECKED, UNDEFINED, UNION, UNMARSHAL_JSON, USE_SERIALIZERS, UNOWNED, UNSAFE, UNSIGNED, USHORT, USING, UTF8_JSON_READER, UTF8_JSON_WRITER, UUID, VAR, VIRTUAL, VOID, VOLATILE, WCHAR_T, WEAK, WHERE, WHILE, WILL_SET, WITH, XOR, XOR_EQ, YES, YIELD, DUMMY }; | |
| 93 | 93 | |
| 94 | 94 | class TopLevel { |
| 95 | 95 | public: |
| @@ -247,6 +247,7 @@ namespace quicktype { | ||
| 247 | 247 | {"FormatException", Enum::FORMAT_EXCEPTION}, |
| 248 | 248 | {"friend", Enum::FRIEND}, |
| 249 | 249 | {"from", Enum::FROM}, |
| 250 | + {"from_dict", Enum::FROM_DICT}, | |
| 250 | 251 | {"from_json", Enum::FROM_JSON}, |
| 251 | 252 | {"func", Enum::FUNC}, |
| 252 | 253 | {"function", Enum::FUNCTION}, |
| @@ -306,6 +307,7 @@ namespace quicktype { | ||
| 306 | 307 | {"lock", Enum::LOCK}, |
| 307 | 308 | {"long", Enum::LONG}, |
| 308 | 309 | {"map", Enum::MAP}, |
| 310 | + {"MarshalJSON", Enum::MARSHAL_JSON}, | |
| 309 | 311 | {"MapEntry", Enum::MAP_ENTRY}, |
| 310 | 312 | {"metadata_property_handling", Enum::METADATA_PROPERTY_HANDLING}, |
| 311 | 313 | {"module", Enum::MODULE}, |
| @@ -425,6 +427,7 @@ namespace quicktype { | ||
| 425 | 427 | {"to_json", Enum::TO_JSON}, |
| 426 | 428 | {"top_level", Enum::TOP_LEVEL}, |
| 427 | 429 | {"toString", Enum::TO_STRING}, |
| 430 | + {"to_dict", Enum::TO_DICT}, | |
| 428 | 431 | {"transient", Enum::TRANSIENT}, |
| 429 | 432 | {"True", Enum::TRUE}, |
| 430 | 433 | {"true", Enum::ENUM_TRUE}, |
| @@ -441,6 +444,7 @@ namespace quicktype { | ||
| 441 | 444 | {"unchecked", Enum::UNCHECKED}, |
| 442 | 445 | {"undefined", Enum::UNDEFINED}, |
| 443 | 446 | {"union", Enum::UNION}, |
| 447 | + {"UnmarshalJSON", Enum::UNMARSHAL_JSON}, | |
| 444 | 448 | {"UseSerializers", Enum::USE_SERIALIZERS}, |
| 445 | 449 | {"unowned", Enum::UNOWNED}, |
| 446 | 450 | {"unsafe", Enum::UNSAFE}, |
| @@ -596,6 +600,7 @@ namespace quicktype { | ||
| 596 | 600 | case Enum::FORMAT_EXCEPTION: j = "FormatException"; break; |
| 597 | 601 | case Enum::FRIEND: j = "friend"; break; |
| 598 | 602 | case Enum::FROM: j = "from"; break; |
| 603 | + case Enum::FROM_DICT: j = "from_dict"; break; | |
| 599 | 604 | case Enum::FROM_JSON: j = "from_json"; break; |
| 600 | 605 | case Enum::FUNC: j = "func"; break; |
| 601 | 606 | case Enum::FUNCTION: j = "function"; break; |
| @@ -655,6 +660,7 @@ namespace quicktype { | ||
| 655 | 660 | case Enum::LOCK: j = "lock"; break; |
| 656 | 661 | case Enum::LONG: j = "long"; break; |
| 657 | 662 | case Enum::MAP: j = "map"; break; |
| 663 | + case Enum::MARSHAL_JSON: j = "MarshalJSON"; break; | |
| 658 | 664 | case Enum::MAP_ENTRY: j = "MapEntry"; break; |
| 659 | 665 | case Enum::METADATA_PROPERTY_HANDLING: j = "metadata_property_handling"; break; |
| 660 | 666 | case Enum::MODULE: j = "module"; break; |
| @@ -774,6 +780,7 @@ namespace quicktype { | ||
| 774 | 780 | case Enum::TO_JSON: j = "to_json"; break; |
| 775 | 781 | case Enum::TOP_LEVEL: j = "top_level"; break; |
| 776 | 782 | case Enum::TO_STRING: j = "toString"; break; |
| 783 | + case Enum::TO_DICT: j = "to_dict"; break; | |
| 777 | 784 | case Enum::TRANSIENT: j = "transient"; break; |
| 778 | 785 | case Enum::TRUE: j = "True"; break; |
| 779 | 786 | case Enum::ENUM_TRUE: j = "true"; break; |
| @@ -790,6 +797,7 @@ namespace quicktype { | ||
| 790 | 797 | case Enum::UNCHECKED: j = "unchecked"; break; |
| 791 | 798 | case Enum::UNDEFINED: j = "undefined"; break; |
| 792 | 799 | case Enum::UNION: j = "union"; break; |
| 800 | + case Enum::UNMARSHAL_JSON: j = "UnmarshalJSON"; break; | |
| 793 | 801 | case Enum::USE_SERIALIZERS: j = "UseSerializers"; break; |
| 794 | 802 | case Enum::UNOWNED: j = "unowned"; break; |
| 795 | 803 | case Enum::UNSAFE: j = "unsafe"; break; |
Mschema-csharp-recordsdefault / QuickType.cs+21 −1
| @@ -29,7 +29,7 @@ namespace QuickType | ||
| 29 | 29 | public Enum? Enum { get; set; } |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - public enum Enum { Empty, Bool, Complex, Imaginery, Abstract, Alignas, Alignof, And, AndEq, Any, EnumAny, Array, As, Asm, Assert, Associatedtype, Associativity, Async, Atomic, AtomicCancel, AtomicCommit, AtomicNoexcept, Auto, Await, Base, Bitand, Bitor, EnumBool, PurpleBool, Boolean, Break, Bycopy, Byref, Byte, Calendar, Case, Catch, Chan, Char, Char16T, Char32T, Checked, Class, EnumClass, Clone, CoAwait, CoReturn, CoYield, Codable, CodingKey, CodingKeys, Compl, Concept, Console, Const, ConstCast, Constexpr, Constructor, Continue, Convenience, Convert, Converter, CultureInfo, Date, DateParseHandling, DateFormatter, DateOnly, DateOnlyConverter, DateTime, DateTimeStyles, Debugger, Decimal, Declare, Decltype, DecodeString, Decoder, DecodingError, Def, Default, Defer, Deinit, Del, Delegate, Delete, Dict, Dictionary, DidSet, Do, Double, Dynamic, DynamicCast, Elif, Else, EncodeQuickType, Encoder, Enum, EnumValues, Equatable, EqualityContract, Event, Except, Exception, Explicit, Export, Exposing, Extends, Extension, Extern, Fallthrough, False, EnumFalse, Fileprivate, Final, Finally, Fixed, Float, For, Foreach, FormatException, Friend, From, FromJson, Func, Function, Get, Global, Go, Goto, Guard, Hashable, HashCode, Hasher, HasOwnProperty, Id, If, Imp, Implements, Implicit, Import, In, Indirect, Infix, Init, Inline, Inout, Instanceof, Int, Interface, Internal, IsoDateTimeOffsetConverter, Iterable, Is, Jdec, Jenc, Jpipe, Json, JsonConverter, JsonSerializer, JsonToken, JsonWriter, JsonAny, JsonCodingKey, JsonDecoder, JsonEncoder, JsonException, JsonGenerator, JsonNode, JsonNull, JsonParser, JsonReader, JsonTokenType, Lambda, Lazy, Left, Let, List, Locale, Lock, Long, Map, MapEntry, MetadataPropertyHandling, Module, Mutable, Mutating, Namespace, Native, New, Newtonsoft, Nil, No, Noexcept, Nonatomic, None, EnumNone, Nonlocal, Nonmutating, NsObject, NoSuchMethod, Not, NotEq, NsError, NsString, Null, EnumNull, Nullptr, Number, Object, ObjectMapper, Of, Oneway, Open, Operator, Optional, Or, OrEq, Out, Override, Package, Params, Pass, Port, Postfix, Precedence, Prefix, Print, Printf, PrintMembers, Private, Protected, Protocol, EnumProtocol, Public, Quicktype, Raise, Range, Readonly, Ref, RegExp, Register, ReinterpretCast, Repeat, Require, Required, Requires, Restrict, Retain, Rethrows, Return, Right, RuntimeType, S, Sbyte, Sealed, Sel, Select, Self, Serializable, EnumSelf, Sendable, Serialize, SerialName, KSerializer, PrimitiveKind, SerialDescriptor, SerializerProvider, Set, Short, Signed, SimpleModule, Sizeof, Stackalloc, Standards, Static, StaticAssert, StaticCast, StdDeserializer, StdSerializer, Strictfp, String, Struct, Subscript, Super, Switch, Symbol, Synchronized, System, Template, Then, This, ThreadLocal, Throw, Throws, TimeOnly, TimeOnlyConverter, TimeZone, ToJson, TopLevel, ToString, Transient, True, EnumTrue, Try, Type, EnumType, Typealias, Typedef, Typeid, Typename, Typeof, Uint, Ulong, Unchecked, Undefined, Union, UseSerializers, Unowned, Unsafe, Unsigned, Ushort, Using, Utf8JsonReader, Utf8JsonWriter, Uuid, Var, Virtual, Void, Volatile, WcharT, Weak, Where, While, WillSet, With, Xor, XorEq, Yes, Yield, Dummy }; | |
| 32 | + public enum Enum { Empty, Bool, Complex, Imaginery, Abstract, Alignas, Alignof, And, AndEq, Any, EnumAny, Array, As, Asm, Assert, Associatedtype, Associativity, Async, Atomic, AtomicCancel, AtomicCommit, AtomicNoexcept, Auto, Await, Base, Bitand, Bitor, EnumBool, PurpleBool, Boolean, Break, Bycopy, Byref, Byte, Calendar, Case, Catch, Chan, Char, Char16T, Char32T, Checked, Class, EnumClass, Clone, CoAwait, CoReturn, CoYield, Codable, CodingKey, CodingKeys, Compl, Concept, Console, Const, ConstCast, Constexpr, Constructor, Continue, Convenience, Convert, Converter, CultureInfo, Date, DateParseHandling, DateFormatter, DateOnly, DateOnlyConverter, DateTime, DateTimeStyles, Debugger, Decimal, Declare, Decltype, DecodeString, Decoder, DecodingError, Def, Default, Defer, Deinit, Del, Delegate, Delete, Dict, Dictionary, DidSet, Do, Double, Dynamic, DynamicCast, Elif, Else, EncodeQuickType, Encoder, Enum, EnumValues, Equatable, EqualityContract, Event, Except, Exception, Explicit, Export, Exposing, Extends, Extension, Extern, Fallthrough, False, EnumFalse, Fileprivate, Final, Finally, Fixed, Float, For, Foreach, FormatException, Friend, From, FromDict, FromJson, Func, Function, Get, Global, Go, Goto, Guard, Hashable, HashCode, Hasher, HasOwnProperty, Id, If, Imp, Implements, Implicit, Import, In, Indirect, Infix, Init, Inline, Inout, Instanceof, Int, Interface, Internal, IsoDateTimeOffsetConverter, Iterable, Is, Jdec, Jenc, Jpipe, Json, JsonConverter, JsonSerializer, JsonToken, JsonWriter, JsonAny, JsonCodingKey, JsonDecoder, JsonEncoder, JsonException, JsonGenerator, JsonNode, JsonNull, JsonParser, JsonReader, JsonTokenType, Lambda, Lazy, Left, Let, List, Locale, Lock, Long, Map, MarshalJson, MapEntry, MetadataPropertyHandling, Module, Mutable, Mutating, Namespace, Native, New, Newtonsoft, Nil, No, Noexcept, Nonatomic, None, EnumNone, Nonlocal, Nonmutating, NsObject, NoSuchMethod, Not, NotEq, NsError, NsString, Null, EnumNull, Nullptr, Number, Object, ObjectMapper, Of, Oneway, Open, Operator, Optional, Or, OrEq, Out, Override, Package, Params, Pass, Port, Postfix, Precedence, Prefix, Print, Printf, PrintMembers, Private, Protected, Protocol, EnumProtocol, Public, Quicktype, Raise, Range, Readonly, Ref, RegExp, Register, ReinterpretCast, Repeat, Require, Required, Requires, Restrict, Retain, Rethrows, Return, Right, RuntimeType, S, Sbyte, Sealed, Sel, Select, Self, Serializable, EnumSelf, Sendable, Serialize, SerialName, KSerializer, PrimitiveKind, SerialDescriptor, SerializerProvider, Set, Short, Signed, SimpleModule, Sizeof, Stackalloc, Standards, Static, StaticAssert, StaticCast, StdDeserializer, StdSerializer, Strictfp, String, Struct, Subscript, Super, Switch, Symbol, Synchronized, System, Template, Then, This, ThreadLocal, Throw, Throws, TimeOnly, TimeOnlyConverter, TimeZone, ToJson, TopLevel, ToString, ToDict, Transient, True, EnumTrue, Try, Type, EnumType, Typealias, Typedef, Typeid, Typename, Typeof, Uint, Ulong, Unchecked, Undefined, Union, UnmarshalJson, UseSerializers, Unowned, Unsafe, Unsigned, Ushort, Using, Utf8JsonReader, Utf8JsonWriter, Uuid, Var, Virtual, Void, Volatile, WcharT, Weak, Where, While, WillSet, With, Xor, XorEq, Yes, Yield, Dummy }; | |
| 33 | 33 | |
| 34 | 34 | public partial record TopLevel |
| 35 | 35 | { |
| @@ -307,6 +307,8 @@ namespace QuickType | ||
| 307 | 307 | return Enum.Friend; |
| 308 | 308 | case "from": |
| 309 | 309 | return Enum.From; |
| 310 | + case "from_dict": | |
| 311 | + return Enum.FromDict; | |
| 310 | 312 | case "from_json": |
| 311 | 313 | return Enum.FromJson; |
| 312 | 314 | case "func": |
| @@ -425,6 +427,8 @@ namespace QuickType | ||
| 425 | 427 | return Enum.Long; |
| 426 | 428 | case "map": |
| 427 | 429 | return Enum.Map; |
| 430 | + case "MarshalJSON": | |
| 431 | + return Enum.MarshalJson; | |
| 428 | 432 | case "MapEntry": |
| 429 | 433 | return Enum.MapEntry; |
| 430 | 434 | case "metadata_property_handling": |
| @@ -663,6 +667,8 @@ namespace QuickType | ||
| 663 | 667 | return Enum.TopLevel; |
| 664 | 668 | case "toString": |
| 665 | 669 | return Enum.ToString; |
| 670 | + case "to_dict": | |
| 671 | + return Enum.ToDict; | |
| 666 | 672 | case "transient": |
| 667 | 673 | return Enum.Transient; |
| 668 | 674 | case "True": |
| @@ -695,6 +701,8 @@ namespace QuickType | ||
| 695 | 701 | return Enum.Undefined; |
| 696 | 702 | case "union": |
| 697 | 703 | return Enum.Union; |
| 704 | + case "UnmarshalJSON": | |
| 705 | + return Enum.UnmarshalJson; | |
| 698 | 706 | case "UseSerializers": |
| 699 | 707 | return Enum.UseSerializers; |
| 700 | 708 | case "unowned": |
| @@ -1120,6 +1128,9 @@ namespace QuickType | ||
| 1120 | 1128 | case Enum.From: |
| 1121 | 1129 | serializer.Serialize(writer, "from"); |
| 1122 | 1130 | return; |
| 1131 | + case Enum.FromDict: | |
| 1132 | + serializer.Serialize(writer, "from_dict"); | |
| 1133 | + return; | |
| 1123 | 1134 | case Enum.FromJson: |
| 1124 | 1135 | serializer.Serialize(writer, "from_json"); |
| 1125 | 1136 | return; |
| @@ -1297,6 +1308,9 @@ namespace QuickType | ||
| 1297 | 1308 | case Enum.Map: |
| 1298 | 1309 | serializer.Serialize(writer, "map"); |
| 1299 | 1310 | return; |
| 1311 | + case Enum.MarshalJson: | |
| 1312 | + serializer.Serialize(writer, "MarshalJSON"); | |
| 1313 | + return; | |
| 1300 | 1314 | case Enum.MapEntry: |
| 1301 | 1315 | serializer.Serialize(writer, "MapEntry"); |
| 1302 | 1316 | return; |
| @@ -1654,6 +1668,9 @@ namespace QuickType | ||
| 1654 | 1668 | case Enum.ToString: |
| 1655 | 1669 | serializer.Serialize(writer, "toString"); |
| 1656 | 1670 | return; |
| 1671 | + case Enum.ToDict: | |
| 1672 | + serializer.Serialize(writer, "to_dict"); | |
| 1673 | + return; | |
| 1657 | 1674 | case Enum.Transient: |
| 1658 | 1675 | serializer.Serialize(writer, "transient"); |
| 1659 | 1676 | return; |
| @@ -1702,6 +1719,9 @@ namespace QuickType | ||
| 1702 | 1719 | case Enum.Union: |
| 1703 | 1720 | serializer.Serialize(writer, "union"); |
| 1704 | 1721 | return; |
| 1722 | + case Enum.UnmarshalJson: | |
| 1723 | + serializer.Serialize(writer, "UnmarshalJSON"); | |
| 1724 | + return; | |
| 1705 | 1725 | case Enum.UseSerializers: |
| 1706 | 1726 | serializer.Serialize(writer, "UseSerializers"); |
| 1707 | 1727 | return; |
Mschema-csharp-SystemTextJsondefault / QuickType.cs+21 −1
| @@ -27,7 +27,7 @@ namespace QuickType | ||
| 27 | 27 | public Enum? Enum { get; set; } |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - public enum Enum { Empty, Bool, Complex, Imaginery, Abstract, Alignas, Alignof, And, AndEq, Any, EnumAny, Array, As, Asm, Assert, Associatedtype, Associativity, Async, Atomic, AtomicCancel, AtomicCommit, AtomicNoexcept, Auto, Await, Base, Bitand, Bitor, EnumBool, PurpleBool, Boolean, Break, Bycopy, Byref, Byte, Calendar, Case, Catch, Chan, Char, Char16T, Char32T, Checked, Class, EnumClass, Clone, CoAwait, CoReturn, CoYield, Codable, CodingKey, CodingKeys, Compl, Concept, Console, Const, ConstCast, Constexpr, Constructor, Continue, Convenience, Convert, Converter, CultureInfo, Date, DateParseHandling, DateFormatter, DateOnly, DateOnlyConverter, DateTime, DateTimeStyles, Debugger, Decimal, Declare, Decltype, DecodeString, Decoder, DecodingError, Def, Default, Defer, Deinit, Del, Delegate, Delete, Dict, Dictionary, DidSet, Do, Double, Dynamic, DynamicCast, Elif, Else, EncodeQuickType, Encoder, Enum, EnumValues, Equatable, EqualityContract, Event, Except, Exception, Explicit, Export, Exposing, Extends, Extension, Extern, Fallthrough, False, EnumFalse, Fileprivate, Final, Finally, Fixed, Float, For, Foreach, FormatException, Friend, From, FromJson, Func, Function, Get, Global, Go, Goto, Guard, Hashable, HashCode, Hasher, HasOwnProperty, Id, If, Imp, Implements, Implicit, Import, In, Indirect, Infix, Init, Inline, Inout, Instanceof, Int, Interface, Internal, IsoDateTimeOffsetConverter, Iterable, Is, Jdec, Jenc, Jpipe, Json, JsonConverter, JsonSerializer, JsonToken, JsonWriter, JsonAny, JsonCodingKey, JsonDecoder, JsonEncoder, JsonException, JsonGenerator, JsonNode, JsonNull, JsonParser, JsonReader, JsonTokenType, Lambda, Lazy, Left, Let, List, Locale, Lock, Long, Map, MapEntry, MetadataPropertyHandling, Module, Mutable, Mutating, Namespace, Native, New, Newtonsoft, Nil, No, Noexcept, Nonatomic, None, EnumNone, Nonlocal, Nonmutating, NsObject, NoSuchMethod, Not, NotEq, NsError, NsString, Null, EnumNull, Nullptr, Number, Object, ObjectMapper, Of, Oneway, Open, Operator, Optional, Or, OrEq, Out, Override, Package, Params, Pass, Port, Postfix, Precedence, Prefix, Print, Printf, PrintMembers, Private, Protected, Protocol, EnumProtocol, Public, Quicktype, Raise, Range, Readonly, Ref, RegExp, Register, ReinterpretCast, Repeat, Require, Required, Requires, Restrict, Retain, Rethrows, Return, Right, RuntimeType, S, Sbyte, Sealed, Sel, Select, Self, Serializable, EnumSelf, Sendable, Serialize, SerialName, KSerializer, PrimitiveKind, SerialDescriptor, SerializerProvider, Set, Short, Signed, SimpleModule, Sizeof, Stackalloc, Standards, Static, StaticAssert, StaticCast, StdDeserializer, StdSerializer, Strictfp, String, Struct, Subscript, Super, Switch, Symbol, Synchronized, System, Template, Then, This, ThreadLocal, Throw, Throws, TimeOnly, TimeOnlyConverter, TimeZone, ToJson, TopLevel, ToString, Transient, True, EnumTrue, Try, Type, EnumType, Typealias, Typedef, Typeid, Typename, Typeof, Uint, Ulong, Unchecked, Undefined, Union, UseSerializers, Unowned, Unsafe, Unsigned, Ushort, Using, Utf8JsonReader, Utf8JsonWriter, Uuid, Var, Virtual, Void, Volatile, WcharT, Weak, Where, While, WillSet, With, Xor, XorEq, Yes, Yield, Dummy }; | |
| 30 | + public enum Enum { Empty, Bool, Complex, Imaginery, Abstract, Alignas, Alignof, And, AndEq, Any, EnumAny, Array, As, Asm, Assert, Associatedtype, Associativity, Async, Atomic, AtomicCancel, AtomicCommit, AtomicNoexcept, Auto, Await, Base, Bitand, Bitor, EnumBool, PurpleBool, Boolean, Break, Bycopy, Byref, Byte, Calendar, Case, Catch, Chan, Char, Char16T, Char32T, Checked, Class, EnumClass, Clone, CoAwait, CoReturn, CoYield, Codable, CodingKey, CodingKeys, Compl, Concept, Console, Const, ConstCast, Constexpr, Constructor, Continue, Convenience, Convert, Converter, CultureInfo, Date, DateParseHandling, DateFormatter, DateOnly, DateOnlyConverter, DateTime, DateTimeStyles, Debugger, Decimal, Declare, Decltype, DecodeString, Decoder, DecodingError, Def, Default, Defer, Deinit, Del, Delegate, Delete, Dict, Dictionary, DidSet, Do, Double, Dynamic, DynamicCast, Elif, Else, EncodeQuickType, Encoder, Enum, EnumValues, Equatable, EqualityContract, Event, Except, Exception, Explicit, Export, Exposing, Extends, Extension, Extern, Fallthrough, False, EnumFalse, Fileprivate, Final, Finally, Fixed, Float, For, Foreach, FormatException, Friend, From, FromDict, FromJson, Func, Function, Get, Global, Go, Goto, Guard, Hashable, HashCode, Hasher, HasOwnProperty, Id, If, Imp, Implements, Implicit, Import, In, Indirect, Infix, Init, Inline, Inout, Instanceof, Int, Interface, Internal, IsoDateTimeOffsetConverter, Iterable, Is, Jdec, Jenc, Jpipe, Json, JsonConverter, JsonSerializer, JsonToken, JsonWriter, JsonAny, JsonCodingKey, JsonDecoder, JsonEncoder, JsonException, JsonGenerator, JsonNode, JsonNull, JsonParser, JsonReader, JsonTokenType, Lambda, Lazy, Left, Let, List, Locale, Lock, Long, Map, MarshalJson, MapEntry, MetadataPropertyHandling, Module, Mutable, Mutating, Namespace, Native, New, Newtonsoft, Nil, No, Noexcept, Nonatomic, None, EnumNone, Nonlocal, Nonmutating, NsObject, NoSuchMethod, Not, NotEq, NsError, NsString, Null, EnumNull, Nullptr, Number, Object, ObjectMapper, Of, Oneway, Open, Operator, Optional, Or, OrEq, Out, Override, Package, Params, Pass, Port, Postfix, Precedence, Prefix, Print, Printf, PrintMembers, Private, Protected, Protocol, EnumProtocol, Public, Quicktype, Raise, Range, Readonly, Ref, RegExp, Register, ReinterpretCast, Repeat, Require, Required, Requires, Restrict, Retain, Rethrows, Return, Right, RuntimeType, S, Sbyte, Sealed, Sel, Select, Self, Serializable, EnumSelf, Sendable, Serialize, SerialName, KSerializer, PrimitiveKind, SerialDescriptor, SerializerProvider, Set, Short, Signed, SimpleModule, Sizeof, Stackalloc, Standards, Static, StaticAssert, StaticCast, StdDeserializer, StdSerializer, Strictfp, String, Struct, Subscript, Super, Switch, Symbol, Synchronized, System, Template, Then, This, ThreadLocal, Throw, Throws, TimeOnly, TimeOnlyConverter, TimeZone, ToJson, TopLevel, ToString, ToDict, Transient, True, EnumTrue, Try, Type, EnumType, Typealias, Typedef, Typeid, Typename, Typeof, Uint, Ulong, Unchecked, Undefined, Union, UnmarshalJson, UseSerializers, Unowned, Unsafe, Unsigned, Ushort, Using, Utf8JsonReader, Utf8JsonWriter, Uuid, Var, Virtual, Void, Volatile, WcharT, Weak, Where, While, WillSet, With, Xor, XorEq, Yes, Yield, Dummy }; | |
| 31 | 31 | |
| 32 | 32 | public partial class TopLevel |
| 33 | 33 | { |
| @@ -304,6 +304,8 @@ namespace QuickType | ||
| 304 | 304 | return Enum.Friend; |
| 305 | 305 | case "from": |
| 306 | 306 | return Enum.From; |
| 307 | + case "from_dict": | |
| 308 | + return Enum.FromDict; | |
| 307 | 309 | case "from_json": |
| 308 | 310 | return Enum.FromJson; |
| 309 | 311 | case "func": |
| @@ -422,6 +424,8 @@ namespace QuickType | ||
| 422 | 424 | return Enum.Long; |
| 423 | 425 | case "map": |
| 424 | 426 | return Enum.Map; |
| 427 | + case "MarshalJSON": | |
| 428 | + return Enum.MarshalJson; | |
| 425 | 429 | case "MapEntry": |
| 426 | 430 | return Enum.MapEntry; |
| 427 | 431 | case "metadata_property_handling": |
| @@ -660,6 +664,8 @@ namespace QuickType | ||
| 660 | 664 | return Enum.TopLevel; |
| 661 | 665 | case "toString": |
| 662 | 666 | return Enum.ToString; |
| 667 | + case "to_dict": | |
| 668 | + return Enum.ToDict; | |
| 663 | 669 | case "transient": |
| 664 | 670 | return Enum.Transient; |
| 665 | 671 | case "True": |
| @@ -692,6 +698,8 @@ namespace QuickType | ||
| 692 | 698 | return Enum.Undefined; |
| 693 | 699 | case "union": |
| 694 | 700 | return Enum.Union; |
| 701 | + case "UnmarshalJSON": | |
| 702 | + return Enum.UnmarshalJson; | |
| 695 | 703 | case "UseSerializers": |
| 696 | 704 | return Enum.UseSerializers; |
| 697 | 705 | case "unowned": |
| @@ -1111,6 +1119,9 @@ namespace QuickType | ||
| 1111 | 1119 | case Enum.From: |
| 1112 | 1120 | JsonSerializer.Serialize(writer, "from", options); |
| 1113 | 1121 | return; |
| 1122 | + case Enum.FromDict: | |
| 1123 | + JsonSerializer.Serialize(writer, "from_dict", options); | |
| 1124 | + return; | |
| 1114 | 1125 | case Enum.FromJson: |
| 1115 | 1126 | JsonSerializer.Serialize(writer, "from_json", options); |
| 1116 | 1127 | return; |
| @@ -1288,6 +1299,9 @@ namespace QuickType | ||
| 1288 | 1299 | case Enum.Map: |
| 1289 | 1300 | JsonSerializer.Serialize(writer, "map", options); |
| 1290 | 1301 | return; |
| 1302 | + case Enum.MarshalJson: | |
| 1303 | + JsonSerializer.Serialize(writer, "MarshalJSON", options); | |
| 1304 | + return; | |
| 1291 | 1305 | case Enum.MapEntry: |
| 1292 | 1306 | JsonSerializer.Serialize(writer, "MapEntry", options); |
| 1293 | 1307 | return; |
| @@ -1645,6 +1659,9 @@ namespace QuickType | ||
| 1645 | 1659 | case Enum.ToString: |
| 1646 | 1660 | JsonSerializer.Serialize(writer, "toString", options); |
| 1647 | 1661 | return; |
| 1662 | + case Enum.ToDict: | |
| 1663 | + JsonSerializer.Serialize(writer, "to_dict", options); | |
| 1664 | + return; | |
| 1648 | 1665 | case Enum.Transient: |
| 1649 | 1666 | JsonSerializer.Serialize(writer, "transient", options); |
| 1650 | 1667 | return; |
| @@ -1693,6 +1710,9 @@ namespace QuickType | ||
| 1693 | 1710 | case Enum.Union: |
| 1694 | 1711 | JsonSerializer.Serialize(writer, "union", options); |
| 1695 | 1712 | return; |
| 1713 | + case Enum.UnmarshalJson: | |
| 1714 | + JsonSerializer.Serialize(writer, "UnmarshalJSON", options); | |
| 1715 | + return; | |
| 1696 | 1716 | case Enum.UseSerializers: |
| 1697 | 1717 | JsonSerializer.Serialize(writer, "UseSerializers", options); |
| 1698 | 1718 | return; |
Mschema-csharpdefault / QuickType.cs+21 −1
| @@ -29,7 +29,7 @@ namespace QuickType | ||
| 29 | 29 | public Enum? Enum { get; set; } |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - public enum Enum { Empty, Bool, Complex, Imaginery, Abstract, Alignas, Alignof, And, AndEq, Any, EnumAny, Array, As, Asm, Assert, Associatedtype, Associativity, Async, Atomic, AtomicCancel, AtomicCommit, AtomicNoexcept, Auto, Await, Base, Bitand, Bitor, EnumBool, PurpleBool, Boolean, Break, Bycopy, Byref, Byte, Calendar, Case, Catch, Chan, Char, Char16T, Char32T, Checked, Class, EnumClass, Clone, CoAwait, CoReturn, CoYield, Codable, CodingKey, CodingKeys, Compl, Concept, Console, Const, ConstCast, Constexpr, Constructor, Continue, Convenience, Convert, Converter, CultureInfo, Date, DateParseHandling, DateFormatter, DateOnly, DateOnlyConverter, DateTime, DateTimeStyles, Debugger, Decimal, Declare, Decltype, DecodeString, Decoder, DecodingError, Def, Default, Defer, Deinit, Del, Delegate, Delete, Dict, Dictionary, DidSet, Do, Double, Dynamic, DynamicCast, Elif, Else, EncodeQuickType, Encoder, Enum, EnumValues, Equatable, EqualityContract, Event, Except, Exception, Explicit, Export, Exposing, Extends, Extension, Extern, Fallthrough, False, EnumFalse, Fileprivate, Final, Finally, Fixed, Float, For, Foreach, FormatException, Friend, From, FromJson, Func, Function, Get, Global, Go, Goto, Guard, Hashable, HashCode, Hasher, HasOwnProperty, Id, If, Imp, Implements, Implicit, Import, In, Indirect, Infix, Init, Inline, Inout, Instanceof, Int, Interface, Internal, IsoDateTimeOffsetConverter, Iterable, Is, Jdec, Jenc, Jpipe, Json, JsonConverter, JsonSerializer, JsonToken, JsonWriter, JsonAny, JsonCodingKey, JsonDecoder, JsonEncoder, JsonException, JsonGenerator, JsonNode, JsonNull, JsonParser, JsonReader, JsonTokenType, Lambda, Lazy, Left, Let, List, Locale, Lock, Long, Map, MapEntry, MetadataPropertyHandling, Module, Mutable, Mutating, Namespace, Native, New, Newtonsoft, Nil, No, Noexcept, Nonatomic, None, EnumNone, Nonlocal, Nonmutating, NsObject, NoSuchMethod, Not, NotEq, NsError, NsString, Null, EnumNull, Nullptr, Number, Object, ObjectMapper, Of, Oneway, Open, Operator, Optional, Or, OrEq, Out, Override, Package, Params, Pass, Port, Postfix, Precedence, Prefix, Print, Printf, PrintMembers, Private, Protected, Protocol, EnumProtocol, Public, Quicktype, Raise, Range, Readonly, Ref, RegExp, Register, ReinterpretCast, Repeat, Require, Required, Requires, Restrict, Retain, Rethrows, Return, Right, RuntimeType, S, Sbyte, Sealed, Sel, Select, Self, Serializable, EnumSelf, Sendable, Serialize, SerialName, KSerializer, PrimitiveKind, SerialDescriptor, SerializerProvider, Set, Short, Signed, SimpleModule, Sizeof, Stackalloc, Standards, Static, StaticAssert, StaticCast, StdDeserializer, StdSerializer, Strictfp, String, Struct, Subscript, Super, Switch, Symbol, Synchronized, System, Template, Then, This, ThreadLocal, Throw, Throws, TimeOnly, TimeOnlyConverter, TimeZone, ToJson, TopLevel, ToString, Transient, True, EnumTrue, Try, Type, EnumType, Typealias, Typedef, Typeid, Typename, Typeof, Uint, Ulong, Unchecked, Undefined, Union, UseSerializers, Unowned, Unsafe, Unsigned, Ushort, Using, Utf8JsonReader, Utf8JsonWriter, Uuid, Var, Virtual, Void, Volatile, WcharT, Weak, Where, While, WillSet, With, Xor, XorEq, Yes, Yield, Dummy }; | |
| 32 | + public enum Enum { Empty, Bool, Complex, Imaginery, Abstract, Alignas, Alignof, And, AndEq, Any, EnumAny, Array, As, Asm, Assert, Associatedtype, Associativity, Async, Atomic, AtomicCancel, AtomicCommit, AtomicNoexcept, Auto, Await, Base, Bitand, Bitor, EnumBool, PurpleBool, Boolean, Break, Bycopy, Byref, Byte, Calendar, Case, Catch, Chan, Char, Char16T, Char32T, Checked, Class, EnumClass, Clone, CoAwait, CoReturn, CoYield, Codable, CodingKey, CodingKeys, Compl, Concept, Console, Const, ConstCast, Constexpr, Constructor, Continue, Convenience, Convert, Converter, CultureInfo, Date, DateParseHandling, DateFormatter, DateOnly, DateOnlyConverter, DateTime, DateTimeStyles, Debugger, Decimal, Declare, Decltype, DecodeString, Decoder, DecodingError, Def, Default, Defer, Deinit, Del, Delegate, Delete, Dict, Dictionary, DidSet, Do, Double, Dynamic, DynamicCast, Elif, Else, EncodeQuickType, Encoder, Enum, EnumValues, Equatable, EqualityContract, Event, Except, Exception, Explicit, Export, Exposing, Extends, Extension, Extern, Fallthrough, False, EnumFalse, Fileprivate, Final, Finally, Fixed, Float, For, Foreach, FormatException, Friend, From, FromDict, FromJson, Func, Function, Get, Global, Go, Goto, Guard, Hashable, HashCode, Hasher, HasOwnProperty, Id, If, Imp, Implements, Implicit, Import, In, Indirect, Infix, Init, Inline, Inout, Instanceof, Int, Interface, Internal, IsoDateTimeOffsetConverter, Iterable, Is, Jdec, Jenc, Jpipe, Json, JsonConverter, JsonSerializer, JsonToken, JsonWriter, JsonAny, JsonCodingKey, JsonDecoder, JsonEncoder, JsonException, JsonGenerator, JsonNode, JsonNull, JsonParser, JsonReader, JsonTokenType, Lambda, Lazy, Left, Let, List, Locale, Lock, Long, Map, MarshalJson, MapEntry, MetadataPropertyHandling, Module, Mutable, Mutating, Namespace, Native, New, Newtonsoft, Nil, No, Noexcept, Nonatomic, None, EnumNone, Nonlocal, Nonmutating, NsObject, NoSuchMethod, Not, NotEq, NsError, NsString, Null, EnumNull, Nullptr, Number, Object, ObjectMapper, Of, Oneway, Open, Operator, Optional, Or, OrEq, Out, Override, Package, Params, Pass, Port, Postfix, Precedence, Prefix, Print, Printf, PrintMembers, Private, Protected, Protocol, EnumProtocol, Public, Quicktype, Raise, Range, Readonly, Ref, RegExp, Register, ReinterpretCast, Repeat, Require, Required, Requires, Restrict, Retain, Rethrows, Return, Right, RuntimeType, S, Sbyte, Sealed, Sel, Select, Self, Serializable, EnumSelf, Sendable, Serialize, SerialName, KSerializer, PrimitiveKind, SerialDescriptor, SerializerProvider, Set, Short, Signed, SimpleModule, Sizeof, Stackalloc, Standards, Static, StaticAssert, StaticCast, StdDeserializer, StdSerializer, Strictfp, String, Struct, Subscript, Super, Switch, Symbol, Synchronized, System, Template, Then, This, ThreadLocal, Throw, Throws, TimeOnly, TimeOnlyConverter, TimeZone, ToJson, TopLevel, ToString, ToDict, Transient, True, EnumTrue, Try, Type, EnumType, Typealias, Typedef, Typeid, Typename, Typeof, Uint, Ulong, Unchecked, Undefined, Union, UnmarshalJson, UseSerializers, Unowned, Unsafe, Unsigned, Ushort, Using, Utf8JsonReader, Utf8JsonWriter, Uuid, Var, Virtual, Void, Volatile, WcharT, Weak, Where, While, WillSet, With, Xor, XorEq, Yes, Yield, Dummy }; | |
| 33 | 33 | |
| 34 | 34 | public partial class TopLevel |
| 35 | 35 | { |
| @@ -307,6 +307,8 @@ namespace QuickType | ||
| 307 | 307 | return Enum.Friend; |
| 308 | 308 | case "from": |
| 309 | 309 | return Enum.From; |
| 310 | + case "from_dict": | |
| 311 | + return Enum.FromDict; | |
| 310 | 312 | case "from_json": |
| 311 | 313 | return Enum.FromJson; |
| 312 | 314 | case "func": |
| @@ -425,6 +427,8 @@ namespace QuickType | ||
| 425 | 427 | return Enum.Long; |
| 426 | 428 | case "map": |
| 427 | 429 | return Enum.Map; |
| 430 | + case "MarshalJSON": | |
| 431 | + return Enum.MarshalJson; | |
| 428 | 432 | case "MapEntry": |
| 429 | 433 | return Enum.MapEntry; |
| 430 | 434 | case "metadata_property_handling": |
| @@ -663,6 +667,8 @@ namespace QuickType | ||
| 663 | 667 | return Enum.TopLevel; |
| 664 | 668 | case "toString": |
| 665 | 669 | return Enum.ToString; |
| 670 | + case "to_dict": | |
| 671 | + return Enum.ToDict; | |
| 666 | 672 | case "transient": |
| 667 | 673 | return Enum.Transient; |
| 668 | 674 | case "True": |
| @@ -695,6 +701,8 @@ namespace QuickType | ||
| 695 | 701 | return Enum.Undefined; |
| 696 | 702 | case "union": |
| 697 | 703 | return Enum.Union; |
| 704 | + case "UnmarshalJSON": | |
| 705 | + return Enum.UnmarshalJson; | |
| 698 | 706 | case "UseSerializers": |
| 699 | 707 | return Enum.UseSerializers; |
| 700 | 708 | case "unowned": |
| @@ -1120,6 +1128,9 @@ namespace QuickType | ||
| 1120 | 1128 | case Enum.From: |
| 1121 | 1129 | serializer.Serialize(writer, "from"); |
| 1122 | 1130 | return; |
| 1131 | + case Enum.FromDict: | |
| 1132 | + serializer.Serialize(writer, "from_dict"); | |
| 1133 | + return; | |
| 1123 | 1134 | case Enum.FromJson: |
| 1124 | 1135 | serializer.Serialize(writer, "from_json"); |
| 1125 | 1136 | return; |
| @@ -1297,6 +1308,9 @@ namespace QuickType | ||
| 1297 | 1308 | case Enum.Map: |
| 1298 | 1309 | serializer.Serialize(writer, "map"); |
| 1299 | 1310 | return; |
| 1311 | + case Enum.MarshalJson: | |
| 1312 | + serializer.Serialize(writer, "MarshalJSON"); | |
| 1313 | + return; | |
| 1300 | 1314 | case Enum.MapEntry: |
| 1301 | 1315 | serializer.Serialize(writer, "MapEntry"); |
| 1302 | 1316 | return; |
| @@ -1654,6 +1668,9 @@ namespace QuickType | ||
| 1654 | 1668 | case Enum.ToString: |
| 1655 | 1669 | serializer.Serialize(writer, "toString"); |
| 1656 | 1670 | return; |
| 1671 | + case Enum.ToDict: | |
| 1672 | + serializer.Serialize(writer, "to_dict"); | |
| 1673 | + return; | |
| 1657 | 1674 | case Enum.Transient: |
| 1658 | 1675 | serializer.Serialize(writer, "transient"); |
| 1659 | 1676 | return; |
| @@ -1702,6 +1719,9 @@ namespace QuickType | ||
| 1702 | 1719 | case Enum.Union: |
| 1703 | 1720 | serializer.Serialize(writer, "union"); |
| 1704 | 1721 | return; |
| 1722 | + case Enum.UnmarshalJson: | |
| 1723 | + serializer.Serialize(writer, "UnmarshalJSON"); | |
| 1724 | + return; | |
| 1705 | 1725 | case Enum.UseSerializers: |
| 1706 | 1726 | serializer.Serialize(writer, "UseSerializers"); |
| 1707 | 1727 | return; |
Mschema-dartdefault / TopLevel.dart+8 −0
| @@ -146,6 +146,7 @@ enum Enum { | ||
| 146 | 146 | FORMAT_EXCEPTION, |
| 147 | 147 | FRIEND, |
| 148 | 148 | FROM, |
| 149 | + FROM_DICT, | |
| 149 | 150 | FROM_JSON, |
| 150 | 151 | FUNC, |
| 151 | 152 | FUNCTION, |
| @@ -205,6 +206,7 @@ enum Enum { | ||
| 205 | 206 | LOCK, |
| 206 | 207 | LONG, |
| 207 | 208 | MAP, |
| 209 | + MARSHAL_JSON, | |
| 208 | 210 | MAP_ENTRY, |
| 209 | 211 | METADATA_PROPERTY_HANDLING, |
| 210 | 212 | MODULE, |
| @@ -324,6 +326,7 @@ enum Enum { | ||
| 324 | 326 | TO_JSON, |
| 325 | 327 | TOP_LEVEL, |
| 326 | 328 | TO_STRING, |
| 329 | + TO_DICT, | |
| 327 | 330 | TRANSIENT, |
| 328 | 331 | TRUE, |
| 329 | 332 | ENUM_TRUE, |
| @@ -340,6 +343,7 @@ enum Enum { | ||
| 340 | 343 | UNCHECKED, |
| 341 | 344 | UNDEFINED, |
| 342 | 345 | UNION, |
| 346 | + UNMARSHAL_JSON, | |
| 343 | 347 | USE_SERIALIZERS, |
| 344 | 348 | UNOWNED, |
| 345 | 349 | UNSAFE, |
| @@ -488,6 +492,7 @@ final enumValues = EnumValues({ | ||
| 488 | 492 | "FormatException": Enum.FORMAT_EXCEPTION, |
| 489 | 493 | "friend": Enum.FRIEND, |
| 490 | 494 | "from": Enum.FROM, |
| 495 | + "from_dict": Enum.FROM_DICT, | |
| 491 | 496 | "from_json": Enum.FROM_JSON, |
| 492 | 497 | "func": Enum.FUNC, |
| 493 | 498 | "function": Enum.FUNCTION, |
| @@ -547,6 +552,7 @@ final enumValues = EnumValues({ | ||
| 547 | 552 | "lock": Enum.LOCK, |
| 548 | 553 | "long": Enum.LONG, |
| 549 | 554 | "map": Enum.MAP, |
| 555 | + "MarshalJSON": Enum.MARSHAL_JSON, | |
| 550 | 556 | "MapEntry": Enum.MAP_ENTRY, |
| 551 | 557 | "metadata_property_handling": Enum.METADATA_PROPERTY_HANDLING, |
| 552 | 558 | "module": Enum.MODULE, |
| @@ -666,6 +672,7 @@ final enumValues = EnumValues({ | ||
| 666 | 672 | "to_json": Enum.TO_JSON, |
| 667 | 673 | "top_level": Enum.TOP_LEVEL, |
| 668 | 674 | "toString": Enum.TO_STRING, |
| 675 | + "to_dict": Enum.TO_DICT, | |
| 669 | 676 | "transient": Enum.TRANSIENT, |
| 670 | 677 | "True": Enum.TRUE, |
| 671 | 678 | "true": Enum.ENUM_TRUE, |
| @@ -682,6 +689,7 @@ final enumValues = EnumValues({ | ||
| 682 | 689 | "unchecked": Enum.UNCHECKED, |
| 683 | 690 | "undefined": Enum.UNDEFINED, |
| 684 | 691 | "union": Enum.UNION, |
| 692 | + "UnmarshalJSON": Enum.UNMARSHAL_JSON, | |
| 685 | 693 | "UseSerializers": Enum.USE_SERIALIZERS, |
| 686 | 694 | "unowned": Enum.UNOWNED, |
| 687 | 695 | "unsafe": Enum.UNSAFE, |
Mschema-elixirdefault / QuickType.ex+4 −0
| @@ -128,6 +128,7 @@ defmodule EnumEnum do | ||
| 128 | 128 | :FormatException, |
| 129 | 129 | :friend, |
| 130 | 130 | :from, |
| 131 | + :from_dict, | |
| 131 | 132 | :from_json, |
| 132 | 133 | :func, |
| 133 | 134 | :function, |
| @@ -187,6 +188,7 @@ defmodule EnumEnum do | ||
| 187 | 188 | :lock, |
| 188 | 189 | :long, |
| 189 | 190 | :map, |
| 191 | + :MarshalJSON, | |
| 190 | 192 | :MapEntry, |
| 191 | 193 | :metadata_property_handling, |
| 192 | 194 | :module, |
| @@ -306,6 +308,7 @@ defmodule EnumEnum do | ||
| 306 | 308 | :to_json, |
| 307 | 309 | :top_level, |
| 308 | 310 | :toString, |
| 311 | + :to_dict, | |
| 309 | 312 | :transient, |
| 310 | 313 | :True, |
| 311 | 314 | :true, |
| @@ -322,6 +325,7 @@ defmodule EnumEnum do | ||
| 322 | 325 | :unchecked, |
| 323 | 326 | :undefined, |
| 324 | 327 | :union, |
| 328 | + :UnmarshalJSON, | |
| 325 | 329 | :UseSerializers, |
| 326 | 330 | :unowned, |
| 327 | 331 | :unsafe, |
Mschema-elmdefault / QuickType.elm+12 −0
| @@ -149,6 +149,7 @@ type EnumEnum | ||
| 149 | 149 | | FormatException |
| 150 | 150 | | Friend |
| 151 | 151 | | From |
| 152 | + | FromDict | |
| 152 | 153 | | FromJSON |
| 153 | 154 | | Func |
| 154 | 155 | | Function |
| @@ -208,6 +209,7 @@ type EnumEnum | ||
| 208 | 209 | | Lock |
| 209 | 210 | | Long |
| 210 | 211 | | Map |
| 212 | + | MarshalJSON | |
| 211 | 213 | | MapEntry |
| 212 | 214 | | MetadataPropertyHandling |
| 213 | 215 | | Module |
| @@ -327,6 +329,7 @@ type EnumEnum | ||
| 327 | 329 | | ToJSON |
| 328 | 330 | | TopLevel |
| 329 | 331 | | ToString |
| 332 | + | ToDict | |
| 330 | 333 | | Transient |
| 331 | 334 | | EnumTrue |
| 332 | 335 | | PurpleTrue |
| @@ -343,6 +346,7 @@ type EnumEnum | ||
| 343 | 346 | | Unchecked |
| 344 | 347 | | Undefined |
| 345 | 348 | | Union |
| 349 | + | UnmarshalJSON | |
| 346 | 350 | | UseSerializers |
| 347 | 351 | | Unowned |
| 348 | 352 | | Unsafe |
| @@ -516,6 +520,7 @@ enumEnum = | ||
| 516 | 520 | "FormatException" -> Jdec.succeed FormatException |
| 517 | 521 | "friend" -> Jdec.succeed Friend |
| 518 | 522 | "from" -> Jdec.succeed From |
| 523 | + "from_dict" -> Jdec.succeed FromDict | |
| 519 | 524 | "from_json" -> Jdec.succeed FromJSON |
| 520 | 525 | "func" -> Jdec.succeed Func |
| 521 | 526 | "function" -> Jdec.succeed Function |
| @@ -575,6 +580,7 @@ enumEnum = | ||
| 575 | 580 | "lock" -> Jdec.succeed Lock |
| 576 | 581 | "long" -> Jdec.succeed Long |
| 577 | 582 | "map" -> Jdec.succeed Map |
| 583 | + "MarshalJSON" -> Jdec.succeed MarshalJSON | |
| 578 | 584 | "MapEntry" -> Jdec.succeed MapEntry |
| 579 | 585 | "metadata_property_handling" -> Jdec.succeed MetadataPropertyHandling |
| 580 | 586 | "module" -> Jdec.succeed Module |
| @@ -694,6 +700,7 @@ enumEnum = | ||
| 694 | 700 | "to_json" -> Jdec.succeed ToJSON |
| 695 | 701 | "top_level" -> Jdec.succeed TopLevel |
| 696 | 702 | "toString" -> Jdec.succeed ToString |
| 703 | + "to_dict" -> Jdec.succeed ToDict | |
| 697 | 704 | "transient" -> Jdec.succeed Transient |
| 698 | 705 | "True" -> Jdec.succeed EnumTrue |
| 699 | 706 | "true" -> Jdec.succeed PurpleTrue |
| @@ -710,6 +717,7 @@ enumEnum = | ||
| 710 | 717 | "unchecked" -> Jdec.succeed Unchecked |
| 711 | 718 | "undefined" -> Jdec.succeed Undefined |
| 712 | 719 | "union" -> Jdec.succeed Union |
| 720 | + "UnmarshalJSON" -> Jdec.succeed UnmarshalJSON | |
| 713 | 721 | "UseSerializers" -> Jdec.succeed UseSerializers |
| 714 | 722 | "unowned" -> Jdec.succeed Unowned |
| 715 | 723 | "unsafe" -> Jdec.succeed Unsafe |
| @@ -860,6 +868,7 @@ encodeEnumEnum x = case x of | ||
| 860 | 868 | FormatException -> Jenc.string "FormatException" |
| 861 | 869 | Friend -> Jenc.string "friend" |
| 862 | 870 | From -> Jenc.string "from" |
| 871 | + FromDict -> Jenc.string "from_dict" | |
| 863 | 872 | FromJSON -> Jenc.string "from_json" |
| 864 | 873 | Func -> Jenc.string "func" |
| 865 | 874 | Function -> Jenc.string "function" |
| @@ -919,6 +928,7 @@ encodeEnumEnum x = case x of | ||
| 919 | 928 | Lock -> Jenc.string "lock" |
| 920 | 929 | Long -> Jenc.string "long" |
| 921 | 930 | Map -> Jenc.string "map" |
| 931 | + MarshalJSON -> Jenc.string "MarshalJSON" | |
| 922 | 932 | MapEntry -> Jenc.string "MapEntry" |
| 923 | 933 | MetadataPropertyHandling -> Jenc.string "metadata_property_handling" |
| 924 | 934 | Module -> Jenc.string "module" |
| @@ -1038,6 +1048,7 @@ encodeEnumEnum x = case x of | ||
| 1038 | 1048 | ToJSON -> Jenc.string "to_json" |
| 1039 | 1049 | TopLevel -> Jenc.string "top_level" |
| 1040 | 1050 | ToString -> Jenc.string "toString" |
| 1051 | + ToDict -> Jenc.string "to_dict" | |
| 1041 | 1052 | Transient -> Jenc.string "transient" |
| 1042 | 1053 | EnumTrue -> Jenc.string "True" |
| 1043 | 1054 | PurpleTrue -> Jenc.string "true" |
| @@ -1054,6 +1065,7 @@ encodeEnumEnum x = case x of | ||
| 1054 | 1065 | Unchecked -> Jenc.string "unchecked" |
| 1055 | 1066 | Undefined -> Jenc.string "undefined" |
| 1056 | 1067 | Union -> Jenc.string "union" |
| 1068 | + UnmarshalJSON -> Jenc.string "UnmarshalJSON" | |
| 1057 | 1069 | UseSerializers -> Jenc.string "UseSerializers" |
| 1058 | 1070 | Unowned -> Jenc.string "unowned" |
| 1059 | 1071 | Unsafe -> Jenc.string "unsafe" |
Mschema-flowdefault / TopLevel.js+10 −2
| @@ -136,6 +136,7 @@ export type Enum = | ||
| 136 | 136 | | "FormatException" |
| 137 | 137 | | "friend" |
| 138 | 138 | | "from" |
| 139 | + | "from_dict" | |
| 139 | 140 | | "from_json" |
| 140 | 141 | | "func" |
| 141 | 142 | | "function" |
| @@ -195,6 +196,7 @@ export type Enum = | ||
| 195 | 196 | | "lock" |
| 196 | 197 | | "long" |
| 197 | 198 | | "map" |
| 199 | + | "MarshalJSON" | |
| 198 | 200 | | "MapEntry" |
| 199 | 201 | | "metadata_property_handling" |
| 200 | 202 | | "module" |
| @@ -314,6 +316,7 @@ export type Enum = | ||
| 314 | 316 | | "to_json" |
| 315 | 317 | | "top_level" |
| 316 | 318 | | "toString" |
| 319 | + | "to_dict" | |
| 317 | 320 | | "transient" |
| 318 | 321 | | "True" |
| 319 | 322 | | "true" |
| @@ -330,6 +333,7 @@ export type Enum = | ||
| 330 | 333 | | "unchecked" |
| 331 | 334 | | "undefined" |
| 332 | 335 | | "union" |
| 336 | + | "UnmarshalJSON" | |
| 333 | 337 | | "UseSerializers" |
| 334 | 338 | | "unowned" |
| 335 | 339 | | "unsafe" |
| @@ -449,7 +453,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 449 | 453 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 450 | 454 | return invalidValue(l(ref || "object"), val, key, parent); |
| 451 | 455 | } |
| 452 | - const result: any = {}; | |
| 456 | + const result: any = Object.create(null); | |
| 453 | 457 | Object.getOwnPropertyNames(props).forEach(key => { |
| 454 | 458 | const prop = props[key]; |
| 455 | 459 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -460,7 +464,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 460 | 464 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 461 | 465 | } |
| 462 | 466 | }); |
| 463 | - return result; | |
| 467 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 464 | 468 | } |
| 465 | 469 | |
| 466 | 470 | if (typ === "any") return val; |
| @@ -665,6 +669,7 @@ const typeMap: any = { | ||
| 665 | 669 | "FormatException", |
| 666 | 670 | "friend", |
| 667 | 671 | "from", |
| 672 | + "from_dict", | |
| 668 | 673 | "from_json", |
| 669 | 674 | "func", |
| 670 | 675 | "function", |
| @@ -724,6 +729,7 @@ const typeMap: any = { | ||
| 724 | 729 | "lock", |
| 725 | 730 | "long", |
| 726 | 731 | "map", |
| 732 | + "MarshalJSON", | |
| 727 | 733 | "MapEntry", |
| 728 | 734 | "metadata_property_handling", |
| 729 | 735 | "module", |
| @@ -843,6 +849,7 @@ const typeMap: any = { | ||
| 843 | 849 | "to_json", |
| 844 | 850 | "top_level", |
| 845 | 851 | "toString", |
| 852 | + "to_dict", | |
| 846 | 853 | "transient", |
| 847 | 854 | "True", |
| 848 | 855 | "true", |
| @@ -859,6 +866,7 @@ const typeMap: any = { | ||
| 859 | 866 | "unchecked", |
| 860 | 867 | "undefined", |
| 861 | 868 | "union", |
| 869 | + "UnmarshalJSON", | |
| 862 | 870 | "UseSerializers", |
| 863 | 871 | "unowned", |
| 864 | 872 | "unsafe", |
Mschema-golangdefault / quicktype.go+5 −1
| @@ -146,6 +146,7 @@ const ( | ||
| 146 | 146 | FormatException EnumEnum = "FormatException" |
| 147 | 147 | Friend EnumEnum = "friend" |
| 148 | 148 | From EnumEnum = "from" |
| 149 | + FromDict EnumEnum = "from_dict" | |
| 149 | 150 | FromJSON EnumEnum = "from_json" |
| 150 | 151 | Func EnumEnum = "func" |
| 151 | 152 | Function EnumEnum = "function" |
| @@ -205,6 +206,7 @@ const ( | ||
| 205 | 206 | Lock EnumEnum = "lock" |
| 206 | 207 | Long EnumEnum = "long" |
| 207 | 208 | Map EnumEnum = "map" |
| 209 | + MarshalJSON EnumEnum = "MarshalJSON" | |
| 208 | 210 | MapEntry EnumEnum = "MapEntry" |
| 209 | 211 | MetadataPropertyHandling EnumEnum = "metadata_property_handling" |
| 210 | 212 | Module EnumEnum = "module" |
| @@ -324,6 +326,7 @@ const ( | ||
| 324 | 326 | ToJSON EnumEnum = "to_json" |
| 325 | 327 | EnumTopLevel EnumEnum = "top_level" |
| 326 | 328 | ToString EnumEnum = "toString" |
| 329 | + ToDict EnumEnum = "to_dict" | |
| 327 | 330 | Transient EnumEnum = "transient" |
| 328 | 331 | True EnumEnum = "True" |
| 329 | 332 | EnumTrue EnumEnum = "true" |
| @@ -340,6 +343,7 @@ const ( | ||
| 340 | 343 | Unchecked EnumEnum = "unchecked" |
| 341 | 344 | Undefined EnumEnum = "undefined" |
| 342 | 345 | Union EnumEnum = "union" |
| 346 | + UnmarshalJSON EnumEnum = "UnmarshalJSON" | |
| 343 | 347 | UseSerializers EnumEnum = "UseSerializers" |
| 344 | 348 | Unowned EnumEnum = "unowned" |
| 345 | 349 | Unsafe EnumEnum = "unsafe" |
| @@ -373,7 +377,7 @@ func (x *EnumEnum) UnmarshalJSON(data []byte) error { | ||
| 373 | 377 | var value string |
| 374 | 378 | if err := json.Unmarshal(data, &value); err != nil { return err } |
| 375 | 379 | switch EnumEnum(value) { |
| 376 | - case Empty, Bool, Complex, Imaginery, Abstract, Alignas, Alignof, And, AndEq, Any, EnumAny, Array, As, ASM, Assert, Associatedtype, Associativity, Async, Atomic, AtomicCancel, AtomicCommit, AtomicNoexcept, Auto, Await, Base, Bitand, Bitor, EnumBOOL, EnumBool, Boolean, Break, Bycopy, Byref, Byte, Calendar, Case, Catch, Chan, Char, Char16T, Char32T, Checked, Class, EnumClass, Clone, CoAwait, CoReturn, CoYield, Codable, CodingKey, CodingKeys, Compl, Concept, Console, Const, ConstCast, Constexpr, Constructor, Continue, Convenience, Convert, Converter, CultureInfo, Date, DateParseHandling, DateFormatter, DateOnly, DateOnlyConverter, DateTime, DateTimeStyles, Debugger, Decimal, Declare, Decltype, DecodeString, Decoder, DecodingError, Def, Default, Defer, Deinit, Del, Delegate, Delete, Dict, Dictionary, DidSet, Do, Double, Dynamic, DynamicCast, Elif, Else, EncodeQuickType, Encoder, Enum, EnumValues, Equatable, EqualityContract, Event, Except, Exception, Explicit, Export, Exposing, Extends, Extension, Extern, Fallthrough, False, EnumFalse, Fileprivate, Final, Finally, Fixed, Float, For, Foreach, FormatException, Friend, From, FromJSON, Func, Function, Get, Global, Go, Goto, Guard, Hashable, HashCode, Hasher, HasOwnProperty, ID, If, Imp, Implements, Implicit, Import, In, Indirect, Infix, Init, Inline, Inout, Instanceof, Int, Interface, Internal, ISODateTimeOffsetConverter, Iterable, Is, Jdec, Jenc, Jpipe, JSON, JSONConverter, JSONSerializer, JSONToken, JSONWriter, JSONAny, JSONCodingKey, JSONDecoder, JSONEncoder, JSONException, JSONGenerator, JSONNode, JSONNull, JSONParser, JSONReader, JSONTokenType, Lambda, Lazy, Left, Let, List, Locale, Lock, Long, Map, MapEntry, MetadataPropertyHandling, Module, Mutable, Mutating, Namespace, Native, New, Newtonsoft, Nil, No, Noexcept, Nonatomic, None, EnumNone, Nonlocal, Nonmutating, NSObject, NoSuchMethod, Not, NotEq, NSError, NSString, Null, EnumNull, Nullptr, Number, Object, ObjectMapper, Of, Oneway, Open, Operator, Optional, Or, OrEq, Out, Override, Package, Params, Pass, Port, Postfix, Precedence, Prefix, Print, Printf, PrintMembers, Private, Protected, Protocol, EnumProtocol, Public, Quicktype, Raise, Range, Readonly, Ref, RegExp, Register, ReinterpretCast, Repeat, Require, Required, Requires, Restrict, Retain, Rethrows, Return, Right, RuntimeType, S, Sbyte, Sealed, Sel, Select, Self, Serializable, EnumSelf, Sendable, Serialize, SerialName, KSerializer, PrimitiveKind, SerialDescriptor, SerializerProvider, Set, Short, Signed, SimpleModule, Sizeof, Stackalloc, Standards, Static, StaticAssert, StaticCast, StdDeserializer, StdSerializer, Strictfp, String, Struct, Subscript, Super, Switch, Symbol, Synchronized, System, Template, Then, This, ThreadLocal, Throw, Throws, TimeOnly, TimeOnlyConverter, TimeZone, ToJSON, EnumTopLevel, ToString, Transient, True, EnumTrue, Try, Type, EnumType, Typealias, Typedef, Typeid, Typename, Typeof, Uint, Ulong, Unchecked, Undefined, Union, UseSerializers, Unowned, Unsafe, Unsigned, Ushort, Using, Utf8JSONReader, Utf8JSONWriter, UUID, Var, Virtual, Void, Volatile, WcharT, Weak, Where, While, WillSet, With, Xor, XorEq, Yes, Yield, Dummy: *x = EnumEnum(value); return nil | |
| 380 | + case Empty, Bool, Complex, Imaginery, Abstract, Alignas, Alignof, And, AndEq, Any, EnumAny, Array, As, ASM, Assert, Associatedtype, Associativity, Async, Atomic, AtomicCancel, AtomicCommit, AtomicNoexcept, Auto, Await, Base, Bitand, Bitor, EnumBOOL, EnumBool, Boolean, Break, Bycopy, Byref, Byte, Calendar, Case, Catch, Chan, Char, Char16T, Char32T, Checked, Class, EnumClass, Clone, CoAwait, CoReturn, CoYield, Codable, CodingKey, CodingKeys, Compl, Concept, Console, Const, ConstCast, Constexpr, Constructor, Continue, Convenience, Convert, Converter, CultureInfo, Date, DateParseHandling, DateFormatter, DateOnly, DateOnlyConverter, DateTime, DateTimeStyles, Debugger, Decimal, Declare, Decltype, DecodeString, Decoder, DecodingError, Def, Default, Defer, Deinit, Del, Delegate, Delete, Dict, Dictionary, DidSet, Do, Double, Dynamic, DynamicCast, Elif, Else, EncodeQuickType, Encoder, Enum, EnumValues, Equatable, EqualityContract, Event, Except, Exception, Explicit, Export, Exposing, Extends, Extension, Extern, Fallthrough, False, EnumFalse, Fileprivate, Final, Finally, Fixed, Float, For, Foreach, FormatException, Friend, From, FromDict, FromJSON, Func, Function, Get, Global, Go, Goto, Guard, Hashable, HashCode, Hasher, HasOwnProperty, ID, If, Imp, Implements, Implicit, Import, In, Indirect, Infix, Init, Inline, Inout, Instanceof, Int, Interface, Internal, ISODateTimeOffsetConverter, Iterable, Is, Jdec, Jenc, Jpipe, JSON, JSONConverter, JSONSerializer, JSONToken, JSONWriter, JSONAny, JSONCodingKey, JSONDecoder, JSONEncoder, JSONException, JSONGenerator, JSONNode, JSONNull, JSONParser, JSONReader, JSONTokenType, Lambda, Lazy, Left, Let, List, Locale, Lock, Long, Map, MarshalJSON, MapEntry, MetadataPropertyHandling, Module, Mutable, Mutating, Namespace, Native, New, Newtonsoft, Nil, No, Noexcept, Nonatomic, None, EnumNone, Nonlocal, Nonmutating, NSObject, NoSuchMethod, Not, NotEq, NSError, NSString, Null, EnumNull, Nullptr, Number, Object, ObjectMapper, Of, Oneway, Open, Operator, Optional, Or, OrEq, Out, Override, Package, Params, Pass, Port, Postfix, Precedence, Prefix, Print, Printf, PrintMembers, Private, Protected, Protocol, EnumProtocol, Public, Quicktype, Raise, Range, Readonly, Ref, RegExp, Register, ReinterpretCast, Repeat, Require, Required, Requires, Restrict, Retain, Rethrows, Return, Right, RuntimeType, S, Sbyte, Sealed, Sel, Select, Self, Serializable, EnumSelf, Sendable, Serialize, SerialName, KSerializer, PrimitiveKind, SerialDescriptor, SerializerProvider, Set, Short, Signed, SimpleModule, Sizeof, Stackalloc, Standards, Static, StaticAssert, StaticCast, StdDeserializer, StdSerializer, Strictfp, String, Struct, Subscript, Super, Switch, Symbol, Synchronized, System, Template, Then, This, ThreadLocal, Throw, Throws, TimeOnly, TimeOnlyConverter, TimeZone, ToJSON, EnumTopLevel, ToString, ToDict, Transient, True, EnumTrue, Try, Type, EnumType, Typealias, Typedef, Typeid, Typename, Typeof, Uint, Ulong, Unchecked, Undefined, Union, UnmarshalJSON, UseSerializers, Unowned, Unsafe, Unsigned, Ushort, Using, Utf8JSONReader, Utf8JSONWriter, UUID, Var, Virtual, Void, Volatile, WcharT, Weak, Where, While, WillSet, With, Xor, XorEq, Yes, Yield, Dummy: *x = EnumEnum(value); return nil | |
| 377 | 381 | } |
| 378 | 382 | return invalidEnumEnum(value) |
| 379 | 383 | } |
Mschema-haskelldefault / QuickType.hs+12 −0
| @@ -139,6 +139,7 @@ data EnumEnum | ||
| 139 | 139 | | FormatExceptionEnumEnum |
| 140 | 140 | | FriendEnumEnum |
| 141 | 141 | | FromEnumEnum |
| 142 | + | FromDictEnumEnum | |
| 142 | 143 | | FromJSONEnumEnum |
| 143 | 144 | | FuncEnumEnum |
| 144 | 145 | | FunctionEnumEnum |
| @@ -198,6 +199,7 @@ data EnumEnum | ||
| 198 | 199 | | LockEnumEnum |
| 199 | 200 | | LongEnumEnum |
| 200 | 201 | | MapEnumEnum |
| 202 | + | MarshalJSONEnumEnum | |
| 201 | 203 | | MapEntryEnumEnum |
| 202 | 204 | | MetadataPropertyHandlingEnumEnum |
| 203 | 205 | | ModuleEnumEnum |
| @@ -317,6 +319,7 @@ data EnumEnum | ||
| 317 | 319 | | ToJSONEnumEnum |
| 318 | 320 | | TopLevelEnumEnum |
| 319 | 321 | | ToStringEnumEnum |
| 322 | + | ToDictEnumEnum | |
| 320 | 323 | | TransientEnumEnum |
| 321 | 324 | | TrueEnumEnum |
| 322 | 325 | | PurpleTrueEnumEnum |
| @@ -333,6 +336,7 @@ data EnumEnum | ||
| 333 | 336 | | UncheckedEnumEnum |
| 334 | 337 | | UndefinedEnumEnum |
| 335 | 338 | | UnionEnumEnum |
| 339 | + | UnmarshalJSONEnumEnum | |
| 336 | 340 | | UseSerializersEnumEnum |
| 337 | 341 | | UnownedEnumEnum |
| 338 | 342 | | UnsafeEnumEnum |
| @@ -494,6 +498,7 @@ instance ToJSON EnumEnum where | ||
| 494 | 498 | toJSON FormatExceptionEnumEnum = "FormatException" |
| 495 | 499 | toJSON FriendEnumEnum = "friend" |
| 496 | 500 | toJSON FromEnumEnum = "from" |
| 501 | + toJSON FromDictEnumEnum = "from_dict" | |
| 497 | 502 | toJSON FromJSONEnumEnum = "from_json" |
| 498 | 503 | toJSON FuncEnumEnum = "func" |
| 499 | 504 | toJSON FunctionEnumEnum = "function" |
| @@ -553,6 +558,7 @@ instance ToJSON EnumEnum where | ||
| 553 | 558 | toJSON LockEnumEnum = "lock" |
| 554 | 559 | toJSON LongEnumEnum = "long" |
| 555 | 560 | toJSON MapEnumEnum = "map" |
| 561 | + toJSON MarshalJSONEnumEnum = "MarshalJSON" | |
| 556 | 562 | toJSON MapEntryEnumEnum = "MapEntry" |
| 557 | 563 | toJSON MetadataPropertyHandlingEnumEnum = "metadata_property_handling" |
| 558 | 564 | toJSON ModuleEnumEnum = "module" |
| @@ -672,6 +678,7 @@ instance ToJSON EnumEnum where | ||
| 672 | 678 | toJSON ToJSONEnumEnum = "to_json" |
| 673 | 679 | toJSON TopLevelEnumEnum = "top_level" |
| 674 | 680 | toJSON ToStringEnumEnum = "toString" |
| 681 | + toJSON ToDictEnumEnum = "to_dict" | |
| 675 | 682 | toJSON TransientEnumEnum = "transient" |
| 676 | 683 | toJSON TrueEnumEnum = "True" |
| 677 | 684 | toJSON PurpleTrueEnumEnum = "true" |
| @@ -688,6 +695,7 @@ instance ToJSON EnumEnum where | ||
| 688 | 695 | toJSON UncheckedEnumEnum = "unchecked" |
| 689 | 696 | toJSON UndefinedEnumEnum = "undefined" |
| 690 | 697 | toJSON UnionEnumEnum = "union" |
| 698 | + toJSON UnmarshalJSONEnumEnum = "UnmarshalJSON" | |
| 691 | 699 | toJSON UseSerializersEnumEnum = "UseSerializers" |
| 692 | 700 | toJSON UnownedEnumEnum = "unowned" |
| 693 | 701 | toJSON UnsafeEnumEnum = "unsafe" |
| @@ -837,6 +845,7 @@ instance FromJSON EnumEnum where | ||
| 837 | 845 | parseText "FormatException" = return FormatExceptionEnumEnum |
| 838 | 846 | parseText "friend" = return FriendEnumEnum |
| 839 | 847 | parseText "from" = return FromEnumEnum |
| 848 | + parseText "from_dict" = return FromDictEnumEnum | |
| 840 | 849 | parseText "from_json" = return FromJSONEnumEnum |
| 841 | 850 | parseText "func" = return FuncEnumEnum |
| 842 | 851 | parseText "function" = return FunctionEnumEnum |
| @@ -896,6 +905,7 @@ instance FromJSON EnumEnum where | ||
| 896 | 905 | parseText "lock" = return LockEnumEnum |
| 897 | 906 | parseText "long" = return LongEnumEnum |
| 898 | 907 | parseText "map" = return MapEnumEnum |
| 908 | + parseText "MarshalJSON" = return MarshalJSONEnumEnum | |
| 899 | 909 | parseText "MapEntry" = return MapEntryEnumEnum |
| 900 | 910 | parseText "metadata_property_handling" = return MetadataPropertyHandlingEnumEnum |
| 901 | 911 | parseText "module" = return ModuleEnumEnum |
| @@ -1015,6 +1025,7 @@ instance FromJSON EnumEnum where | ||
| 1015 | 1025 | parseText "to_json" = return ToJSONEnumEnum |
| 1016 | 1026 | parseText "top_level" = return TopLevelEnumEnum |
| 1017 | 1027 | parseText "toString" = return ToStringEnumEnum |
| 1028 | + parseText "to_dict" = return ToDictEnumEnum | |
| 1018 | 1029 | parseText "transient" = return TransientEnumEnum |
| 1019 | 1030 | parseText "True" = return TrueEnumEnum |
| 1020 | 1031 | parseText "true" = return PurpleTrueEnumEnum |
| @@ -1031,6 +1042,7 @@ instance FromJSON EnumEnum where | ||
| 1031 | 1042 | parseText "unchecked" = return UncheckedEnumEnum |
| 1032 | 1043 | parseText "undefined" = return UndefinedEnumEnum |
| 1033 | 1044 | parseText "union" = return UnionEnumEnum |
| 1045 | + parseText "UnmarshalJSON" = return UnmarshalJSONEnumEnum | |
| 1034 | 1046 | parseText "UseSerializers" = return UseSerializersEnumEnum |
| 1035 | 1047 | parseText "unowned" = return UnownedEnumEnum |
| 1036 | 1048 | parseText "unsafe" = return UnsafeEnumEnum |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / Enum.java+9 −1
| @@ -4,7 +4,7 @@ import java.io.IOException; | ||
| 4 | 4 | import com.fasterxml.jackson.annotation.*; |
| 5 | 5 | |
| 6 | 6 | public enum Enum { |
| 7 | - EMPTY, BOOL, COMPLEX, IMAGINERY, ABSTRACT, ALIGNAS, ALIGNOF, AND, AND_EQ, ANY, ENUM_ANY, ARRAY, AS, ASM, ASSERT, ASSOCIATEDTYPE, ASSOCIATIVITY, ASYNC, ATOMIC, ATOMIC_CANCEL, ATOMIC_COMMIT, ATOMIC_NOEXCEPT, AUTO, AWAIT, BASE, BITAND, BITOR, ENUM_BOOL, PURPLE_BOOL, BOOLEAN, BREAK, BYCOPY, BYREF, BYTE, CALENDAR, CASE, CATCH, CHAN, CHAR, CHAR16_T, CHAR32_T, CHECKED, CLASS, ENUM_CLASS, CLONE, CO_AWAIT, CO_RETURN, CO_YIELD, CODABLE, CODING_KEY, CODING_KEYS, COMPL, CONCEPT, CONSOLE, CONST, CONST_CAST, CONSTEXPR, CONSTRUCTOR, CONTINUE, CONVENIENCE, CONVERT, CONVERTER, CULTURE_INFO, DATE, DATE_PARSE_HANDLING, DATE_FORMATTER, DATE_ONLY, DATE_ONLY_CONVERTER, DATE_TIME, DATE_TIME_STYLES, DEBUGGER, DECIMAL, DECLARE, DECLTYPE, DECODE_STRING, DECODER, DECODING_ERROR, DEF, DEFAULT, DEFER, DEINIT, DEL, DELEGATE, DELETE, DICT, DICTIONARY, DID_SET, DO, DOUBLE, DYNAMIC, DYNAMIC_CAST, ELIF, ELSE, ENCODE_QUICK_TYPE, ENCODER, ENUM, ENUM_VALUES, EQUATABLE, EQUALITY_CONTRACT, EVENT, EXCEPT, EXCEPTION, EXPLICIT, EXPORT, EXPOSING, EXTENDS, EXTENSION, EXTERN, FALLTHROUGH, FALSE, ENUM_FALSE, FILEPRIVATE, FINAL, FINALLY, FIXED, FLOAT, FOR, FOREACH, FORMAT_EXCEPTION, FRIEND, FROM, FROM_JSON, FUNC, FUNCTION, GET, GLOBAL, GO, GOTO, GUARD, HASHABLE, HASH_CODE, HASHER, HAS_OWN_PROPERTY, ID, IF, IMP, IMPLEMENTS, IMPLICIT, IMPORT, IN, INDIRECT, INFIX, INIT, INLINE, INOUT, INSTANCEOF, INT, INTERFACE, INTERNAL, ISO_DATE_TIME_OFFSET_CONVERTER, ITERABLE, IS, JDEC, JENC, JPIPE, JSON, JSON_CONVERTER, JSON_SERIALIZER, JSON_TOKEN, JSON_WRITER, JSON_ANY, JSON_CODING_KEY, JSON_DECODER, JSON_ENCODER, JSON_EXCEPTION, JSON_GENERATOR, JSON_NODE, JSON_NULL, JSON_PARSER, JSON_READER, JSON_TOKEN_TYPE, LAMBDA, LAZY, LEFT, LET, LIST, LOCALE, LOCK, LONG, MAP, MAP_ENTRY, METADATA_PROPERTY_HANDLING, MODULE, MUTABLE, MUTATING, NAMESPACE, NATIVE, NEW, NEWTONSOFT, NIL, NO, NOEXCEPT, NONATOMIC, NONE, ENUM_NONE, NONLOCAL, NONMUTATING, NS_OBJECT, NO_SUCH_METHOD, NOT, NOT_EQ, NS_ERROR, NS_STRING, NULL, ENUM_NULL, NULLPTR, NUMBER, OBJECT, OBJECT_MAPPER, OF, ONEWAY, OPEN, OPERATOR, OPTIONAL, OR, OR_EQ, OUT, OVERRIDE, PACKAGE, PARAMS, PASS, PORT, POSTFIX, PRECEDENCE, PREFIX, PRINT, PRINTF, PRINT_MEMBERS, PRIVATE, PROTECTED, PROTOCOL, ENUM_PROTOCOL, PUBLIC, QUICKTYPE, RAISE, RANGE, READONLY, REF, REG_EXP, REGISTER, REINTERPRET_CAST, REPEAT, REQUIRE, REQUIRED, REQUIRES, RESTRICT, RETAIN, RETHROWS, RETURN, RIGHT, RUNTIME_TYPE, S, SBYTE, SEALED, SEL, SELECT, SELF, SERIALIZABLE, ENUM_SELF, SENDABLE, SERIALIZE, SERIAL_NAME, K_SERIALIZER, PRIMITIVE_KIND, SERIAL_DESCRIPTOR, SERIALIZER_PROVIDER, SET, SHORT, SIGNED, SIMPLE_MODULE, SIZEOF, STACKALLOC, STANDARDS, STATIC, STATIC_ASSERT, STATIC_CAST, STD_DESERIALIZER, STD_SERIALIZER, STRICTFP, STRING, STRUCT, SUBSCRIPT, SUPER, SWITCH, SYMBOL, SYNCHRONIZED, SYSTEM, TEMPLATE, THEN, THIS, THREAD_LOCAL, THROW, THROWS, TIME_ONLY, TIME_ONLY_CONVERTER, TIME_ZONE, TO_JSON, TOP_LEVEL, TO_STRING, TRANSIENT, TRUE, ENUM_TRUE, TRY, TYPE, ENUM_TYPE, TYPEALIAS, TYPEDEF, TYPEID, TYPENAME, TYPEOF, UINT, ULONG, UNCHECKED, UNDEFINED, UNION, USE_SERIALIZERS, UNOWNED, UNSAFE, UNSIGNED, USHORT, USING, UTF8_JSON_READER, UTF8_JSON_WRITER, UUID, VAR, VIRTUAL, VOID, VOLATILE, WCHAR_T, WEAK, WHERE, WHILE, WILL_SET, WITH, XOR, XOR_EQ, YES, YIELD, DUMMY; | |
| 7 | + EMPTY, BOOL, COMPLEX, IMAGINERY, ABSTRACT, ALIGNAS, ALIGNOF, AND, AND_EQ, ANY, ENUM_ANY, ARRAY, AS, ASM, ASSERT, ASSOCIATEDTYPE, ASSOCIATIVITY, ASYNC, ATOMIC, ATOMIC_CANCEL, ATOMIC_COMMIT, ATOMIC_NOEXCEPT, AUTO, AWAIT, BASE, BITAND, BITOR, ENUM_BOOL, PURPLE_BOOL, BOOLEAN, BREAK, BYCOPY, BYREF, BYTE, CALENDAR, CASE, CATCH, CHAN, CHAR, CHAR16_T, CHAR32_T, CHECKED, CLASS, ENUM_CLASS, CLONE, CO_AWAIT, CO_RETURN, CO_YIELD, CODABLE, CODING_KEY, CODING_KEYS, COMPL, CONCEPT, CONSOLE, CONST, CONST_CAST, CONSTEXPR, CONSTRUCTOR, CONTINUE, CONVENIENCE, CONVERT, CONVERTER, CULTURE_INFO, DATE, DATE_PARSE_HANDLING, DATE_FORMATTER, DATE_ONLY, DATE_ONLY_CONVERTER, DATE_TIME, DATE_TIME_STYLES, DEBUGGER, DECIMAL, DECLARE, DECLTYPE, DECODE_STRING, DECODER, DECODING_ERROR, DEF, DEFAULT, DEFER, DEINIT, DEL, DELEGATE, DELETE, DICT, DICTIONARY, DID_SET, DO, DOUBLE, DYNAMIC, DYNAMIC_CAST, ELIF, ELSE, ENCODE_QUICK_TYPE, ENCODER, ENUM, ENUM_VALUES, EQUATABLE, EQUALITY_CONTRACT, EVENT, EXCEPT, EXCEPTION, EXPLICIT, EXPORT, EXPOSING, EXTENDS, EXTENSION, EXTERN, FALLTHROUGH, FALSE, ENUM_FALSE, FILEPRIVATE, FINAL, FINALLY, FIXED, FLOAT, FOR, FOREACH, FORMAT_EXCEPTION, FRIEND, FROM, FROM_DICT, FROM_JSON, FUNC, FUNCTION, GET, GLOBAL, GO, GOTO, GUARD, HASHABLE, HASH_CODE, HASHER, HAS_OWN_PROPERTY, ID, IF, IMP, IMPLEMENTS, IMPLICIT, IMPORT, IN, INDIRECT, INFIX, INIT, INLINE, INOUT, INSTANCEOF, INT, INTERFACE, INTERNAL, ISO_DATE_TIME_OFFSET_CONVERTER, ITERABLE, IS, JDEC, JENC, JPIPE, JSON, JSON_CONVERTER, JSON_SERIALIZER, JSON_TOKEN, JSON_WRITER, JSON_ANY, JSON_CODING_KEY, JSON_DECODER, JSON_ENCODER, JSON_EXCEPTION, JSON_GENERATOR, JSON_NODE, JSON_NULL, JSON_PARSER, JSON_READER, JSON_TOKEN_TYPE, LAMBDA, LAZY, LEFT, LET, LIST, LOCALE, LOCK, LONG, MAP, MARSHAL_JSON, MAP_ENTRY, METADATA_PROPERTY_HANDLING, MODULE, MUTABLE, MUTATING, NAMESPACE, NATIVE, NEW, NEWTONSOFT, NIL, NO, NOEXCEPT, NONATOMIC, NONE, ENUM_NONE, NONLOCAL, NONMUTATING, NS_OBJECT, NO_SUCH_METHOD, NOT, NOT_EQ, NS_ERROR, NS_STRING, NULL, ENUM_NULL, NULLPTR, NUMBER, OBJECT, OBJECT_MAPPER, OF, ONEWAY, OPEN, OPERATOR, OPTIONAL, OR, OR_EQ, OUT, OVERRIDE, PACKAGE, PARAMS, PASS, PORT, POSTFIX, PRECEDENCE, PREFIX, PRINT, PRINTF, PRINT_MEMBERS, PRIVATE, PROTECTED, PROTOCOL, ENUM_PROTOCOL, PUBLIC, QUICKTYPE, RAISE, RANGE, READONLY, REF, REG_EXP, REGISTER, REINTERPRET_CAST, REPEAT, REQUIRE, REQUIRED, REQUIRES, RESTRICT, RETAIN, RETHROWS, RETURN, RIGHT, RUNTIME_TYPE, S, SBYTE, SEALED, SEL, SELECT, SELF, SERIALIZABLE, ENUM_SELF, SENDABLE, SERIALIZE, SERIAL_NAME, K_SERIALIZER, PRIMITIVE_KIND, SERIAL_DESCRIPTOR, SERIALIZER_PROVIDER, SET, SHORT, SIGNED, SIMPLE_MODULE, SIZEOF, STACKALLOC, STANDARDS, STATIC, STATIC_ASSERT, STATIC_CAST, STD_DESERIALIZER, STD_SERIALIZER, STRICTFP, STRING, STRUCT, SUBSCRIPT, SUPER, SWITCH, SYMBOL, SYNCHRONIZED, SYSTEM, TEMPLATE, THEN, THIS, THREAD_LOCAL, THROW, THROWS, TIME_ONLY, TIME_ONLY_CONVERTER, TIME_ZONE, TO_JSON, TOP_LEVEL, TO_STRING, TO_DICT, TRANSIENT, TRUE, ENUM_TRUE, TRY, TYPE, ENUM_TYPE, TYPEALIAS, TYPEDEF, TYPEID, TYPENAME, TYPEOF, UINT, ULONG, UNCHECKED, UNDEFINED, UNION, UNMARSHAL_JSON, USE_SERIALIZERS, UNOWNED, UNSAFE, UNSIGNED, USHORT, USING, UTF8_JSON_READER, UTF8_JSON_WRITER, UUID, VAR, VIRTUAL, VOID, VOLATILE, WCHAR_T, WEAK, WHERE, WHILE, WILL_SET, WITH, XOR, XOR_EQ, YES, YIELD, DUMMY; | |
| 8 | 8 | |
| 9 | 9 | @JsonValue |
| 10 | 10 | public String toValue() { |
| @@ -130,6 +130,7 @@ public enum Enum { | ||
| 130 | 130 | case FORMAT_EXCEPTION: return "FormatException"; |
| 131 | 131 | case FRIEND: return "friend"; |
| 132 | 132 | case FROM: return "from"; |
| 133 | + case FROM_DICT: return "from_dict"; | |
| 133 | 134 | case FROM_JSON: return "from_json"; |
| 134 | 135 | case FUNC: return "func"; |
| 135 | 136 | case FUNCTION: return "function"; |
| @@ -189,6 +190,7 @@ public enum Enum { | ||
| 189 | 190 | case LOCK: return "lock"; |
| 190 | 191 | case LONG: return "long"; |
| 191 | 192 | case MAP: return "map"; |
| 193 | + case MARSHAL_JSON: return "MarshalJSON"; | |
| 192 | 194 | case MAP_ENTRY: return "MapEntry"; |
| 193 | 195 | case METADATA_PROPERTY_HANDLING: return "metadata_property_handling"; |
| 194 | 196 | case MODULE: return "module"; |
| @@ -308,6 +310,7 @@ public enum Enum { | ||
| 308 | 310 | case TO_JSON: return "to_json"; |
| 309 | 311 | case TOP_LEVEL: return "top_level"; |
| 310 | 312 | case TO_STRING: return "toString"; |
| 313 | + case TO_DICT: return "to_dict"; | |
| 311 | 314 | case TRANSIENT: return "transient"; |
| 312 | 315 | case TRUE: return "True"; |
| 313 | 316 | case ENUM_TRUE: return "true"; |
| @@ -324,6 +327,7 @@ public enum Enum { | ||
| 324 | 327 | case UNCHECKED: return "unchecked"; |
| 325 | 328 | case UNDEFINED: return "undefined"; |
| 326 | 329 | case UNION: return "union"; |
| 330 | + case UNMARSHAL_JSON: return "UnmarshalJSON"; | |
| 327 | 331 | case USE_SERIALIZERS: return "UseSerializers"; |
| 328 | 332 | case UNOWNED: return "unowned"; |
| 329 | 333 | case UNSAFE: return "unsafe"; |
| @@ -475,6 +479,7 @@ public enum Enum { | ||
| 475 | 479 | if (value.equals("FormatException")) return FORMAT_EXCEPTION; |
| 476 | 480 | if (value.equals("friend")) return FRIEND; |
| 477 | 481 | if (value.equals("from")) return FROM; |
| 482 | + if (value.equals("from_dict")) return FROM_DICT; | |
| 478 | 483 | if (value.equals("from_json")) return FROM_JSON; |
| 479 | 484 | if (value.equals("func")) return FUNC; |
| 480 | 485 | if (value.equals("function")) return FUNCTION; |
| @@ -534,6 +539,7 @@ public enum Enum { | ||
| 534 | 539 | if (value.equals("lock")) return LOCK; |
| 535 | 540 | if (value.equals("long")) return LONG; |
| 536 | 541 | if (value.equals("map")) return MAP; |
| 542 | + if (value.equals("MarshalJSON")) return MARSHAL_JSON; | |
| 537 | 543 | if (value.equals("MapEntry")) return MAP_ENTRY; |
| 538 | 544 | if (value.equals("metadata_property_handling")) return METADATA_PROPERTY_HANDLING; |
| 539 | 545 | if (value.equals("module")) return MODULE; |
| @@ -653,6 +659,7 @@ public enum Enum { | ||
| 653 | 659 | if (value.equals("to_json")) return TO_JSON; |
| 654 | 660 | if (value.equals("top_level")) return TOP_LEVEL; |
| 655 | 661 | if (value.equals("toString")) return TO_STRING; |
| 662 | + if (value.equals("to_dict")) return TO_DICT; | |
| 656 | 663 | if (value.equals("transient")) return TRANSIENT; |
| 657 | 664 | if (value.equals("True")) return TRUE; |
| 658 | 665 | if (value.equals("true")) return ENUM_TRUE; |
| @@ -669,6 +676,7 @@ public enum Enum { | ||
| 669 | 676 | if (value.equals("unchecked")) return UNCHECKED; |
| 670 | 677 | if (value.equals("undefined")) return UNDEFINED; |
| 671 | 678 | if (value.equals("union")) return UNION; |
| 679 | + if (value.equals("UnmarshalJSON")) return UNMARSHAL_JSON; | |
| 672 | 680 | if (value.equals("UseSerializers")) return USE_SERIALIZERS; |
| 673 | 681 | if (value.equals("unowned")) return UNOWNED; |
| 674 | 682 | if (value.equals("unsafe")) return UNSAFE; |
Mschema-java-lombokdefault / src / main / java / io / quicktype / Enum.java+9 −1
| @@ -4,7 +4,7 @@ import java.io.IOException; | ||
| 4 | 4 | import com.fasterxml.jackson.annotation.*; |
| 5 | 5 | |
| 6 | 6 | public enum Enum { |
| 7 | - EMPTY, BOOL, COMPLEX, IMAGINERY, ABSTRACT, ALIGNAS, ALIGNOF, AND, AND_EQ, ANY, ENUM_ANY, ARRAY, AS, ASM, ASSERT, ASSOCIATEDTYPE, ASSOCIATIVITY, ASYNC, ATOMIC, ATOMIC_CANCEL, ATOMIC_COMMIT, ATOMIC_NOEXCEPT, AUTO, AWAIT, BASE, BITAND, BITOR, ENUM_BOOL, PURPLE_BOOL, BOOLEAN, BREAK, BYCOPY, BYREF, BYTE, CALENDAR, CASE, CATCH, CHAN, CHAR, CHAR16_T, CHAR32_T, CHECKED, CLASS, ENUM_CLASS, CLONE, CO_AWAIT, CO_RETURN, CO_YIELD, CODABLE, CODING_KEY, CODING_KEYS, COMPL, CONCEPT, CONSOLE, CONST, CONST_CAST, CONSTEXPR, CONSTRUCTOR, CONTINUE, CONVENIENCE, CONVERT, CONVERTER, CULTURE_INFO, DATE, DATE_PARSE_HANDLING, DATE_FORMATTER, DATE_ONLY, DATE_ONLY_CONVERTER, DATE_TIME, DATE_TIME_STYLES, DEBUGGER, DECIMAL, DECLARE, DECLTYPE, DECODE_STRING, DECODER, DECODING_ERROR, DEF, DEFAULT, DEFER, DEINIT, DEL, DELEGATE, DELETE, DICT, DICTIONARY, DID_SET, DO, DOUBLE, DYNAMIC, DYNAMIC_CAST, ELIF, ELSE, ENCODE_QUICK_TYPE, ENCODER, ENUM, ENUM_VALUES, EQUATABLE, EQUALITY_CONTRACT, EVENT, EXCEPT, EXCEPTION, EXPLICIT, EXPORT, EXPOSING, EXTENDS, EXTENSION, EXTERN, FALLTHROUGH, FALSE, ENUM_FALSE, FILEPRIVATE, FINAL, FINALLY, FIXED, FLOAT, FOR, FOREACH, FORMAT_EXCEPTION, FRIEND, FROM, FROM_JSON, FUNC, FUNCTION, GET, GLOBAL, GO, GOTO, GUARD, HASHABLE, HASH_CODE, HASHER, HAS_OWN_PROPERTY, ID, IF, IMP, IMPLEMENTS, IMPLICIT, IMPORT, IN, INDIRECT, INFIX, INIT, INLINE, INOUT, INSTANCEOF, INT, INTERFACE, INTERNAL, ISO_DATE_TIME_OFFSET_CONVERTER, ITERABLE, IS, JDEC, JENC, JPIPE, JSON, JSON_CONVERTER, JSON_SERIALIZER, JSON_TOKEN, JSON_WRITER, JSON_ANY, JSON_CODING_KEY, JSON_DECODER, JSON_ENCODER, JSON_EXCEPTION, JSON_GENERATOR, JSON_NODE, JSON_NULL, JSON_PARSER, JSON_READER, JSON_TOKEN_TYPE, LAMBDA, LAZY, LEFT, LET, LIST, LOCALE, LOCK, LONG, MAP, MAP_ENTRY, METADATA_PROPERTY_HANDLING, MODULE, MUTABLE, MUTATING, NAMESPACE, NATIVE, NEW, NEWTONSOFT, NIL, NO, NOEXCEPT, NONATOMIC, NONE, ENUM_NONE, NONLOCAL, NONMUTATING, NS_OBJECT, NO_SUCH_METHOD, NOT, NOT_EQ, NS_ERROR, NS_STRING, NULL, ENUM_NULL, NULLPTR, NUMBER, OBJECT, OBJECT_MAPPER, OF, ONEWAY, OPEN, OPERATOR, OPTIONAL, OR, OR_EQ, OUT, OVERRIDE, PACKAGE, PARAMS, PASS, PORT, POSTFIX, PRECEDENCE, PREFIX, PRINT, PRINTF, PRINT_MEMBERS, PRIVATE, PROTECTED, PROTOCOL, ENUM_PROTOCOL, PUBLIC, QUICKTYPE, RAISE, RANGE, READONLY, REF, REG_EXP, REGISTER, REINTERPRET_CAST, REPEAT, REQUIRE, REQUIRED, REQUIRES, RESTRICT, RETAIN, RETHROWS, RETURN, RIGHT, RUNTIME_TYPE, S, SBYTE, SEALED, SEL, SELECT, SELF, SERIALIZABLE, ENUM_SELF, SENDABLE, SERIALIZE, SERIAL_NAME, K_SERIALIZER, PRIMITIVE_KIND, SERIAL_DESCRIPTOR, SERIALIZER_PROVIDER, SET, SHORT, SIGNED, SIMPLE_MODULE, SIZEOF, STACKALLOC, STANDARDS, STATIC, STATIC_ASSERT, STATIC_CAST, STD_DESERIALIZER, STD_SERIALIZER, STRICTFP, STRING, STRUCT, SUBSCRIPT, SUPER, SWITCH, SYMBOL, SYNCHRONIZED, SYSTEM, TEMPLATE, THEN, THIS, THREAD_LOCAL, THROW, THROWS, TIME_ONLY, TIME_ONLY_CONVERTER, TIME_ZONE, TO_JSON, TOP_LEVEL, TO_STRING, TRANSIENT, TRUE, ENUM_TRUE, TRY, TYPE, ENUM_TYPE, TYPEALIAS, TYPEDEF, TYPEID, TYPENAME, TYPEOF, UINT, ULONG, UNCHECKED, UNDEFINED, UNION, USE_SERIALIZERS, UNOWNED, UNSAFE, UNSIGNED, USHORT, USING, UTF8_JSON_READER, UTF8_JSON_WRITER, UUID, VAR, VIRTUAL, VOID, VOLATILE, WCHAR_T, WEAK, WHERE, WHILE, WILL_SET, WITH, XOR, XOR_EQ, YES, YIELD, DUMMY; | |
| 7 | + EMPTY, BOOL, COMPLEX, IMAGINERY, ABSTRACT, ALIGNAS, ALIGNOF, AND, AND_EQ, ANY, ENUM_ANY, ARRAY, AS, ASM, ASSERT, ASSOCIATEDTYPE, ASSOCIATIVITY, ASYNC, ATOMIC, ATOMIC_CANCEL, ATOMIC_COMMIT, ATOMIC_NOEXCEPT, AUTO, AWAIT, BASE, BITAND, BITOR, ENUM_BOOL, PURPLE_BOOL, BOOLEAN, BREAK, BYCOPY, BYREF, BYTE, CALENDAR, CASE, CATCH, CHAN, CHAR, CHAR16_T, CHAR32_T, CHECKED, CLASS, ENUM_CLASS, CLONE, CO_AWAIT, CO_RETURN, CO_YIELD, CODABLE, CODING_KEY, CODING_KEYS, COMPL, CONCEPT, CONSOLE, CONST, CONST_CAST, CONSTEXPR, CONSTRUCTOR, CONTINUE, CONVENIENCE, CONVERT, CONVERTER, CULTURE_INFO, DATE, DATE_PARSE_HANDLING, DATE_FORMATTER, DATE_ONLY, DATE_ONLY_CONVERTER, DATE_TIME, DATE_TIME_STYLES, DEBUGGER, DECIMAL, DECLARE, DECLTYPE, DECODE_STRING, DECODER, DECODING_ERROR, DEF, DEFAULT, DEFER, DEINIT, DEL, DELEGATE, DELETE, DICT, DICTIONARY, DID_SET, DO, DOUBLE, DYNAMIC, DYNAMIC_CAST, ELIF, ELSE, ENCODE_QUICK_TYPE, ENCODER, ENUM, ENUM_VALUES, EQUATABLE, EQUALITY_CONTRACT, EVENT, EXCEPT, EXCEPTION, EXPLICIT, EXPORT, EXPOSING, EXTENDS, EXTENSION, EXTERN, FALLTHROUGH, FALSE, ENUM_FALSE, FILEPRIVATE, FINAL, FINALLY, FIXED, FLOAT, FOR, FOREACH, FORMAT_EXCEPTION, FRIEND, FROM, FROM_DICT, FROM_JSON, FUNC, FUNCTION, GET, GLOBAL, GO, GOTO, GUARD, HASHABLE, HASH_CODE, HASHER, HAS_OWN_PROPERTY, ID, IF, IMP, IMPLEMENTS, IMPLICIT, IMPORT, IN, INDIRECT, INFIX, INIT, INLINE, INOUT, INSTANCEOF, INT, INTERFACE, INTERNAL, ISO_DATE_TIME_OFFSET_CONVERTER, ITERABLE, IS, JDEC, JENC, JPIPE, JSON, JSON_CONVERTER, JSON_SERIALIZER, JSON_TOKEN, JSON_WRITER, JSON_ANY, JSON_CODING_KEY, JSON_DECODER, JSON_ENCODER, JSON_EXCEPTION, JSON_GENERATOR, JSON_NODE, JSON_NULL, JSON_PARSER, JSON_READER, JSON_TOKEN_TYPE, LAMBDA, LAZY, LEFT, LET, LIST, LOCALE, LOCK, LONG, MAP, MARSHAL_JSON, MAP_ENTRY, METADATA_PROPERTY_HANDLING, MODULE, MUTABLE, MUTATING, NAMESPACE, NATIVE, NEW, NEWTONSOFT, NIL, NO, NOEXCEPT, NONATOMIC, NONE, ENUM_NONE, NONLOCAL, NONMUTATING, NS_OBJECT, NO_SUCH_METHOD, NOT, NOT_EQ, NS_ERROR, NS_STRING, NULL, ENUM_NULL, NULLPTR, NUMBER, OBJECT, OBJECT_MAPPER, OF, ONEWAY, OPEN, OPERATOR, OPTIONAL, OR, OR_EQ, OUT, OVERRIDE, PACKAGE, PARAMS, PASS, PORT, POSTFIX, PRECEDENCE, PREFIX, PRINT, PRINTF, PRINT_MEMBERS, PRIVATE, PROTECTED, PROTOCOL, ENUM_PROTOCOL, PUBLIC, QUICKTYPE, RAISE, RANGE, READONLY, REF, REG_EXP, REGISTER, REINTERPRET_CAST, REPEAT, REQUIRE, REQUIRED, REQUIRES, RESTRICT, RETAIN, RETHROWS, RETURN, RIGHT, RUNTIME_TYPE, S, SBYTE, SEALED, SEL, SELECT, SELF, SERIALIZABLE, ENUM_SELF, SENDABLE, SERIALIZE, SERIAL_NAME, K_SERIALIZER, PRIMITIVE_KIND, SERIAL_DESCRIPTOR, SERIALIZER_PROVIDER, SET, SHORT, SIGNED, SIMPLE_MODULE, SIZEOF, STACKALLOC, STANDARDS, STATIC, STATIC_ASSERT, STATIC_CAST, STD_DESERIALIZER, STD_SERIALIZER, STRICTFP, STRING, STRUCT, SUBSCRIPT, SUPER, SWITCH, SYMBOL, SYNCHRONIZED, SYSTEM, TEMPLATE, THEN, THIS, THREAD_LOCAL, THROW, THROWS, TIME_ONLY, TIME_ONLY_CONVERTER, TIME_ZONE, TO_JSON, TOP_LEVEL, TO_STRING, TO_DICT, TRANSIENT, TRUE, ENUM_TRUE, TRY, TYPE, ENUM_TYPE, TYPEALIAS, TYPEDEF, TYPEID, TYPENAME, TYPEOF, UINT, ULONG, UNCHECKED, UNDEFINED, UNION, UNMARSHAL_JSON, USE_SERIALIZERS, UNOWNED, UNSAFE, UNSIGNED, USHORT, USING, UTF8_JSON_READER, UTF8_JSON_WRITER, UUID, VAR, VIRTUAL, VOID, VOLATILE, WCHAR_T, WEAK, WHERE, WHILE, WILL_SET, WITH, XOR, XOR_EQ, YES, YIELD, DUMMY; | |
| 8 | 8 | |
| 9 | 9 | @JsonValue |
| 10 | 10 | public String toValue() { |
| @@ -130,6 +130,7 @@ public enum Enum { | ||
| 130 | 130 | case FORMAT_EXCEPTION: return "FormatException"; |
| 131 | 131 | case FRIEND: return "friend"; |
| 132 | 132 | case FROM: return "from"; |
| 133 | + case FROM_DICT: return "from_dict"; | |
| 133 | 134 | case FROM_JSON: return "from_json"; |
| 134 | 135 | case FUNC: return "func"; |
| 135 | 136 | case FUNCTION: return "function"; |
| @@ -189,6 +190,7 @@ public enum Enum { | ||
| 189 | 190 | case LOCK: return "lock"; |
| 190 | 191 | case LONG: return "long"; |
| 191 | 192 | case MAP: return "map"; |
| 193 | + case MARSHAL_JSON: return "MarshalJSON"; | |
| 192 | 194 | case MAP_ENTRY: return "MapEntry"; |
| 193 | 195 | case METADATA_PROPERTY_HANDLING: return "metadata_property_handling"; |
| 194 | 196 | case MODULE: return "module"; |
| @@ -308,6 +310,7 @@ public enum Enum { | ||
| 308 | 310 | case TO_JSON: return "to_json"; |
| 309 | 311 | case TOP_LEVEL: return "top_level"; |
| 310 | 312 | case TO_STRING: return "toString"; |
| 313 | + case TO_DICT: return "to_dict"; | |
| 311 | 314 | case TRANSIENT: return "transient"; |
| 312 | 315 | case TRUE: return "True"; |
| 313 | 316 | case ENUM_TRUE: return "true"; |
| @@ -324,6 +327,7 @@ public enum Enum { | ||
| 324 | 327 | case UNCHECKED: return "unchecked"; |
| 325 | 328 | case UNDEFINED: return "undefined"; |
| 326 | 329 | case UNION: return "union"; |
| 330 | + case UNMARSHAL_JSON: return "UnmarshalJSON"; | |
| 327 | 331 | case USE_SERIALIZERS: return "UseSerializers"; |
| 328 | 332 | case UNOWNED: return "unowned"; |
| 329 | 333 | case UNSAFE: return "unsafe"; |
| @@ -475,6 +479,7 @@ public enum Enum { | ||
| 475 | 479 | if (value.equals("FormatException")) return FORMAT_EXCEPTION; |
| 476 | 480 | if (value.equals("friend")) return FRIEND; |
| 477 | 481 | if (value.equals("from")) return FROM; |
| 482 | + if (value.equals("from_dict")) return FROM_DICT; | |
| 478 | 483 | if (value.equals("from_json")) return FROM_JSON; |
| 479 | 484 | if (value.equals("func")) return FUNC; |
| 480 | 485 | if (value.equals("function")) return FUNCTION; |
| @@ -534,6 +539,7 @@ public enum Enum { | ||
| 534 | 539 | if (value.equals("lock")) return LOCK; |
| 535 | 540 | if (value.equals("long")) return LONG; |
| 536 | 541 | if (value.equals("map")) return MAP; |
| 542 | + if (value.equals("MarshalJSON")) return MARSHAL_JSON; | |
| 537 | 543 | if (value.equals("MapEntry")) return MAP_ENTRY; |
| 538 | 544 | if (value.equals("metadata_property_handling")) return METADATA_PROPERTY_HANDLING; |
| 539 | 545 | if (value.equals("module")) return MODULE; |
| @@ -653,6 +659,7 @@ public enum Enum { | ||
| 653 | 659 | if (value.equals("to_json")) return TO_JSON; |
| 654 | 660 | if (value.equals("top_level")) return TOP_LEVEL; |
| 655 | 661 | if (value.equals("toString")) return TO_STRING; |
| 662 | + if (value.equals("to_dict")) return TO_DICT; | |
| 656 | 663 | if (value.equals("transient")) return TRANSIENT; |
| 657 | 664 | if (value.equals("True")) return TRUE; |
| 658 | 665 | if (value.equals("true")) return ENUM_TRUE; |
| @@ -669,6 +676,7 @@ public enum Enum { | ||
| 669 | 676 | if (value.equals("unchecked")) return UNCHECKED; |
| 670 | 677 | if (value.equals("undefined")) return UNDEFINED; |
| 671 | 678 | if (value.equals("union")) return UNION; |
| 679 | + if (value.equals("UnmarshalJSON")) return UNMARSHAL_JSON; | |
| 672 | 680 | if (value.equals("UseSerializers")) return USE_SERIALIZERS; |
| 673 | 681 | if (value.equals("unowned")) return UNOWNED; |
| 674 | 682 | if (value.equals("unsafe")) return UNSAFE; |
Mschema-javadefault / src / main / java / io / quicktype / Enum.java+9 −1
| @@ -4,7 +4,7 @@ import java.io.IOException; | ||
| 4 | 4 | import com.fasterxml.jackson.annotation.*; |
| 5 | 5 | |
| 6 | 6 | public enum Enum { |
| 7 | - EMPTY, BOOL, COMPLEX, IMAGINERY, ABSTRACT, ALIGNAS, ALIGNOF, AND, AND_EQ, ANY, ENUM_ANY, ARRAY, AS, ASM, ASSERT, ASSOCIATEDTYPE, ASSOCIATIVITY, ASYNC, ATOMIC, ATOMIC_CANCEL, ATOMIC_COMMIT, ATOMIC_NOEXCEPT, AUTO, AWAIT, BASE, BITAND, BITOR, ENUM_BOOL, PURPLE_BOOL, BOOLEAN, BREAK, BYCOPY, BYREF, BYTE, CALENDAR, CASE, CATCH, CHAN, CHAR, CHAR16_T, CHAR32_T, CHECKED, CLASS, ENUM_CLASS, CLONE, CO_AWAIT, CO_RETURN, CO_YIELD, CODABLE, CODING_KEY, CODING_KEYS, COMPL, CONCEPT, CONSOLE, CONST, CONST_CAST, CONSTEXPR, CONSTRUCTOR, CONTINUE, CONVENIENCE, CONVERT, CONVERTER, CULTURE_INFO, DATE, DATE_PARSE_HANDLING, DATE_FORMATTER, DATE_ONLY, DATE_ONLY_CONVERTER, DATE_TIME, DATE_TIME_STYLES, DEBUGGER, DECIMAL, DECLARE, DECLTYPE, DECODE_STRING, DECODER, DECODING_ERROR, DEF, DEFAULT, DEFER, DEINIT, DEL, DELEGATE, DELETE, DICT, DICTIONARY, DID_SET, DO, DOUBLE, DYNAMIC, DYNAMIC_CAST, ELIF, ELSE, ENCODE_QUICK_TYPE, ENCODER, ENUM, ENUM_VALUES, EQUATABLE, EQUALITY_CONTRACT, EVENT, EXCEPT, EXCEPTION, EXPLICIT, EXPORT, EXPOSING, EXTENDS, EXTENSION, EXTERN, FALLTHROUGH, FALSE, ENUM_FALSE, FILEPRIVATE, FINAL, FINALLY, FIXED, FLOAT, FOR, FOREACH, FORMAT_EXCEPTION, FRIEND, FROM, FROM_JSON, FUNC, FUNCTION, GET, GLOBAL, GO, GOTO, GUARD, HASHABLE, HASH_CODE, HASHER, HAS_OWN_PROPERTY, ID, IF, IMP, IMPLEMENTS, IMPLICIT, IMPORT, IN, INDIRECT, INFIX, INIT, INLINE, INOUT, INSTANCEOF, INT, INTERFACE, INTERNAL, ISO_DATE_TIME_OFFSET_CONVERTER, ITERABLE, IS, JDEC, JENC, JPIPE, JSON, JSON_CONVERTER, JSON_SERIALIZER, JSON_TOKEN, JSON_WRITER, JSON_ANY, JSON_CODING_KEY, JSON_DECODER, JSON_ENCODER, JSON_EXCEPTION, JSON_GENERATOR, JSON_NODE, JSON_NULL, JSON_PARSER, JSON_READER, JSON_TOKEN_TYPE, LAMBDA, LAZY, LEFT, LET, LIST, LOCALE, LOCK, LONG, MAP, MAP_ENTRY, METADATA_PROPERTY_HANDLING, MODULE, MUTABLE, MUTATING, NAMESPACE, NATIVE, NEW, NEWTONSOFT, NIL, NO, NOEXCEPT, NONATOMIC, NONE, ENUM_NONE, NONLOCAL, NONMUTATING, NS_OBJECT, NO_SUCH_METHOD, NOT, NOT_EQ, NS_ERROR, NS_STRING, NULL, ENUM_NULL, NULLPTR, NUMBER, OBJECT, OBJECT_MAPPER, OF, ONEWAY, OPEN, OPERATOR, OPTIONAL, OR, OR_EQ, OUT, OVERRIDE, PACKAGE, PARAMS, PASS, PORT, POSTFIX, PRECEDENCE, PREFIX, PRINT, PRINTF, PRINT_MEMBERS, PRIVATE, PROTECTED, PROTOCOL, ENUM_PROTOCOL, PUBLIC, QUICKTYPE, RAISE, RANGE, READONLY, REF, REG_EXP, REGISTER, REINTERPRET_CAST, REPEAT, REQUIRE, REQUIRED, REQUIRES, RESTRICT, RETAIN, RETHROWS, RETURN, RIGHT, RUNTIME_TYPE, S, SBYTE, SEALED, SEL, SELECT, SELF, SERIALIZABLE, ENUM_SELF, SENDABLE, SERIALIZE, SERIAL_NAME, K_SERIALIZER, PRIMITIVE_KIND, SERIAL_DESCRIPTOR, SERIALIZER_PROVIDER, SET, SHORT, SIGNED, SIMPLE_MODULE, SIZEOF, STACKALLOC, STANDARDS, STATIC, STATIC_ASSERT, STATIC_CAST, STD_DESERIALIZER, STD_SERIALIZER, STRICTFP, STRING, STRUCT, SUBSCRIPT, SUPER, SWITCH, SYMBOL, SYNCHRONIZED, SYSTEM, TEMPLATE, THEN, THIS, THREAD_LOCAL, THROW, THROWS, TIME_ONLY, TIME_ONLY_CONVERTER, TIME_ZONE, TO_JSON, TOP_LEVEL, TO_STRING, TRANSIENT, TRUE, ENUM_TRUE, TRY, TYPE, ENUM_TYPE, TYPEALIAS, TYPEDEF, TYPEID, TYPENAME, TYPEOF, UINT, ULONG, UNCHECKED, UNDEFINED, UNION, USE_SERIALIZERS, UNOWNED, UNSAFE, UNSIGNED, USHORT, USING, UTF8_JSON_READER, UTF8_JSON_WRITER, UUID, VAR, VIRTUAL, VOID, VOLATILE, WCHAR_T, WEAK, WHERE, WHILE, WILL_SET, WITH, XOR, XOR_EQ, YES, YIELD, DUMMY; | |
| 7 | + EMPTY, BOOL, COMPLEX, IMAGINERY, ABSTRACT, ALIGNAS, ALIGNOF, AND, AND_EQ, ANY, ENUM_ANY, ARRAY, AS, ASM, ASSERT, ASSOCIATEDTYPE, ASSOCIATIVITY, ASYNC, ATOMIC, ATOMIC_CANCEL, ATOMIC_COMMIT, ATOMIC_NOEXCEPT, AUTO, AWAIT, BASE, BITAND, BITOR, ENUM_BOOL, PURPLE_BOOL, BOOLEAN, BREAK, BYCOPY, BYREF, BYTE, CALENDAR, CASE, CATCH, CHAN, CHAR, CHAR16_T, CHAR32_T, CHECKED, CLASS, ENUM_CLASS, CLONE, CO_AWAIT, CO_RETURN, CO_YIELD, CODABLE, CODING_KEY, CODING_KEYS, COMPL, CONCEPT, CONSOLE, CONST, CONST_CAST, CONSTEXPR, CONSTRUCTOR, CONTINUE, CONVENIENCE, CONVERT, CONVERTER, CULTURE_INFO, DATE, DATE_PARSE_HANDLING, DATE_FORMATTER, DATE_ONLY, DATE_ONLY_CONVERTER, DATE_TIME, DATE_TIME_STYLES, DEBUGGER, DECIMAL, DECLARE, DECLTYPE, DECODE_STRING, DECODER, DECODING_ERROR, DEF, DEFAULT, DEFER, DEINIT, DEL, DELEGATE, DELETE, DICT, DICTIONARY, DID_SET, DO, DOUBLE, DYNAMIC, DYNAMIC_CAST, ELIF, ELSE, ENCODE_QUICK_TYPE, ENCODER, ENUM, ENUM_VALUES, EQUATABLE, EQUALITY_CONTRACT, EVENT, EXCEPT, EXCEPTION, EXPLICIT, EXPORT, EXPOSING, EXTENDS, EXTENSION, EXTERN, FALLTHROUGH, FALSE, ENUM_FALSE, FILEPRIVATE, FINAL, FINALLY, FIXED, FLOAT, FOR, FOREACH, FORMAT_EXCEPTION, FRIEND, FROM, FROM_DICT, FROM_JSON, FUNC, FUNCTION, GET, GLOBAL, GO, GOTO, GUARD, HASHABLE, HASH_CODE, HASHER, HAS_OWN_PROPERTY, ID, IF, IMP, IMPLEMENTS, IMPLICIT, IMPORT, IN, INDIRECT, INFIX, INIT, INLINE, INOUT, INSTANCEOF, INT, INTERFACE, INTERNAL, ISO_DATE_TIME_OFFSET_CONVERTER, ITERABLE, IS, JDEC, JENC, JPIPE, JSON, JSON_CONVERTER, JSON_SERIALIZER, JSON_TOKEN, JSON_WRITER, JSON_ANY, JSON_CODING_KEY, JSON_DECODER, JSON_ENCODER, JSON_EXCEPTION, JSON_GENERATOR, JSON_NODE, JSON_NULL, JSON_PARSER, JSON_READER, JSON_TOKEN_TYPE, LAMBDA, LAZY, LEFT, LET, LIST, LOCALE, LOCK, LONG, MAP, MARSHAL_JSON, MAP_ENTRY, METADATA_PROPERTY_HANDLING, MODULE, MUTABLE, MUTATING, NAMESPACE, NATIVE, NEW, NEWTONSOFT, NIL, NO, NOEXCEPT, NONATOMIC, NONE, ENUM_NONE, NONLOCAL, NONMUTATING, NS_OBJECT, NO_SUCH_METHOD, NOT, NOT_EQ, NS_ERROR, NS_STRING, NULL, ENUM_NULL, NULLPTR, NUMBER, OBJECT, OBJECT_MAPPER, OF, ONEWAY, OPEN, OPERATOR, OPTIONAL, OR, OR_EQ, OUT, OVERRIDE, PACKAGE, PARAMS, PASS, PORT, POSTFIX, PRECEDENCE, PREFIX, PRINT, PRINTF, PRINT_MEMBERS, PRIVATE, PROTECTED, PROTOCOL, ENUM_PROTOCOL, PUBLIC, QUICKTYPE, RAISE, RANGE, READONLY, REF, REG_EXP, REGISTER, REINTERPRET_CAST, REPEAT, REQUIRE, REQUIRED, REQUIRES, RESTRICT, RETAIN, RETHROWS, RETURN, RIGHT, RUNTIME_TYPE, S, SBYTE, SEALED, SEL, SELECT, SELF, SERIALIZABLE, ENUM_SELF, SENDABLE, SERIALIZE, SERIAL_NAME, K_SERIALIZER, PRIMITIVE_KIND, SERIAL_DESCRIPTOR, SERIALIZER_PROVIDER, SET, SHORT, SIGNED, SIMPLE_MODULE, SIZEOF, STACKALLOC, STANDARDS, STATIC, STATIC_ASSERT, STATIC_CAST, STD_DESERIALIZER, STD_SERIALIZER, STRICTFP, STRING, STRUCT, SUBSCRIPT, SUPER, SWITCH, SYMBOL, SYNCHRONIZED, SYSTEM, TEMPLATE, THEN, THIS, THREAD_LOCAL, THROW, THROWS, TIME_ONLY, TIME_ONLY_CONVERTER, TIME_ZONE, TO_JSON, TOP_LEVEL, TO_STRING, TO_DICT, TRANSIENT, TRUE, ENUM_TRUE, TRY, TYPE, ENUM_TYPE, TYPEALIAS, TYPEDEF, TYPEID, TYPENAME, TYPEOF, UINT, ULONG, UNCHECKED, UNDEFINED, UNION, UNMARSHAL_JSON, USE_SERIALIZERS, UNOWNED, UNSAFE, UNSIGNED, USHORT, USING, UTF8_JSON_READER, UTF8_JSON_WRITER, UUID, VAR, VIRTUAL, VOID, VOLATILE, WCHAR_T, WEAK, WHERE, WHILE, WILL_SET, WITH, XOR, XOR_EQ, YES, YIELD, DUMMY; | |
| 8 | 8 | |
| 9 | 9 | @JsonValue |
| 10 | 10 | public String toValue() { |
| @@ -130,6 +130,7 @@ public enum Enum { | ||
| 130 | 130 | case FORMAT_EXCEPTION: return "FormatException"; |
| 131 | 131 | case FRIEND: return "friend"; |
| 132 | 132 | case FROM: return "from"; |
| 133 | + case FROM_DICT: return "from_dict"; | |
| 133 | 134 | case FROM_JSON: return "from_json"; |
| 134 | 135 | case FUNC: return "func"; |
| 135 | 136 | case FUNCTION: return "function"; |
| @@ -189,6 +190,7 @@ public enum Enum { | ||
| 189 | 190 | case LOCK: return "lock"; |
| 190 | 191 | case LONG: return "long"; |
| 191 | 192 | case MAP: return "map"; |
| 193 | + case MARSHAL_JSON: return "MarshalJSON"; | |
| 192 | 194 | case MAP_ENTRY: return "MapEntry"; |
| 193 | 195 | case METADATA_PROPERTY_HANDLING: return "metadata_property_handling"; |
| 194 | 196 | case MODULE: return "module"; |
| @@ -308,6 +310,7 @@ public enum Enum { | ||
| 308 | 310 | case TO_JSON: return "to_json"; |
| 309 | 311 | case TOP_LEVEL: return "top_level"; |
| 310 | 312 | case TO_STRING: return "toString"; |
| 313 | + case TO_DICT: return "to_dict"; | |
| 311 | 314 | case TRANSIENT: return "transient"; |
| 312 | 315 | case TRUE: return "True"; |
| 313 | 316 | case ENUM_TRUE: return "true"; |
| @@ -324,6 +327,7 @@ public enum Enum { | ||
| 324 | 327 | case UNCHECKED: return "unchecked"; |
| 325 | 328 | case UNDEFINED: return "undefined"; |
| 326 | 329 | case UNION: return "union"; |
| 330 | + case UNMARSHAL_JSON: return "UnmarshalJSON"; | |
| 327 | 331 | case USE_SERIALIZERS: return "UseSerializers"; |
| 328 | 332 | case UNOWNED: return "unowned"; |
| 329 | 333 | case UNSAFE: return "unsafe"; |
| @@ -475,6 +479,7 @@ public enum Enum { | ||
| 475 | 479 | if (value.equals("FormatException")) return FORMAT_EXCEPTION; |
| 476 | 480 | if (value.equals("friend")) return FRIEND; |
| 477 | 481 | if (value.equals("from")) return FROM; |
| 482 | + if (value.equals("from_dict")) return FROM_DICT; | |
| 478 | 483 | if (value.equals("from_json")) return FROM_JSON; |
| 479 | 484 | if (value.equals("func")) return FUNC; |
| 480 | 485 | if (value.equals("function")) return FUNCTION; |
| @@ -534,6 +539,7 @@ public enum Enum { | ||
| 534 | 539 | if (value.equals("lock")) return LOCK; |
| 535 | 540 | if (value.equals("long")) return LONG; |
| 536 | 541 | if (value.equals("map")) return MAP; |
| 542 | + if (value.equals("MarshalJSON")) return MARSHAL_JSON; | |
| 537 | 543 | if (value.equals("MapEntry")) return MAP_ENTRY; |
| 538 | 544 | if (value.equals("metadata_property_handling")) return METADATA_PROPERTY_HANDLING; |
| 539 | 545 | if (value.equals("module")) return MODULE; |
| @@ -653,6 +659,7 @@ public enum Enum { | ||
| 653 | 659 | if (value.equals("to_json")) return TO_JSON; |
| 654 | 660 | if (value.equals("top_level")) return TOP_LEVEL; |
| 655 | 661 | if (value.equals("toString")) return TO_STRING; |
| 662 | + if (value.equals("to_dict")) return TO_DICT; | |
| 656 | 663 | if (value.equals("transient")) return TRANSIENT; |
| 657 | 664 | if (value.equals("True")) return TRUE; |
| 658 | 665 | if (value.equals("true")) return ENUM_TRUE; |
| @@ -669,6 +676,7 @@ public enum Enum { | ||
| 669 | 676 | if (value.equals("unchecked")) return UNCHECKED; |
| 670 | 677 | if (value.equals("undefined")) return UNDEFINED; |
| 671 | 678 | if (value.equals("union")) return UNION; |
| 679 | + if (value.equals("UnmarshalJSON")) return UNMARSHAL_JSON; | |
| 672 | 680 | if (value.equals("UseSerializers")) return USE_SERIALIZERS; |
| 673 | 681 | if (value.equals("unowned")) return UNOWNED; |
| 674 | 682 | if (value.equals("unsafe")) return UNSAFE; |
Mschema-javascript-prop-typesdefault / toplevel.js+1 −1
| @@ -13,7 +13,7 @@ | ||
| 13 | 13 | import PropTypes from "prop-types"; |
| 14 | 14 | |
| 15 | 15 | let _TopLevel; |
| 16 | -const _Enum = PropTypes.oneOf(['_', '_Bool', '_Complex', '_Imaginery', 'abstract', 'alignas', 'alignof', 'and', 'and_eq', 'any', 'Any', 'array', 'as', 'asm', 'assert', 'associatedtype', 'associativity', 'async', 'atomic', 'atomic_cancel', 'atomic_commit', 'atomic_noexcept', 'auto', 'await', 'base', 'bitand', 'bitor', 'BOOL', 'bool', 'boolean', 'break', 'bycopy', 'byref', 'byte', 'Calendar', 'case', 'catch', 'chan', 'char', 'char16_t', 'char32_t', 'checked', 'class', 'Class', 'clone', 'co_await', 'co_return', 'co_yield', 'Codable', 'CodingKey', 'CodingKeys', 'compl', 'concept', 'console', 'const', 'const_cast', 'constexpr', 'constructor', 'continue', 'convenience', 'convert', 'converter', 'CultureInfo', 'date', 'date_parse_handling', 'DateFormatter', 'DateOnly', 'DateOnlyConverter', 'DateTime', 'DateTimeStyles', 'debugger', 'decimal', 'declare', 'decltype', 'decode_string', 'Decoder', 'DecodingError', 'def', 'default', 'defer', 'deinit', 'del', 'delegate', 'delete', 'dict', 'dictionary', 'didSet', 'do', 'double', 'dynamic', 'dynamic_cast', 'elif', 'else', 'encode_quick_type', 'Encoder', 'enum', 'EnumValues', 'Equatable', 'equalityContract', 'event', 'except', 'exception', 'explicit', 'export', 'exposing', 'extends', 'extension', 'extern', 'fallthrough', 'false', 'False', 'fileprivate', 'final', 'finally', 'fixed', 'float', 'for', 'foreach', 'FormatException', 'friend', 'from', 'from_json', 'func', 'function', 'get', 'global', 'go', 'goto', 'guard', 'Hashable', 'hashCode', 'Hasher', 'hasOwnProperty', 'id', 'if', 'IMP', 'implements', 'implicit', 'import', 'in', 'indirect', 'infix', 'init', 'inline', 'inout', 'instanceof', 'int', 'interface', 'internal', 'IsoDateTimeOffsetConverter', 'iterable', 'is', 'jdec', 'jenc', 'jpipe', 'json', 'json_converter', 'json_serializer', 'json_token', 'json_writer', 'JSONAny', 'JSONCodingKey', 'JSONDecoder', 'JSONEncoder', 'JsonException', 'JsonGenerator', 'JsonNode', 'JSONNull', 'JsonParser', 'JsonReader', 'JsonTokenType', 'lambda', 'lazy', 'left', 'let', 'list', 'Locale', 'lock', 'long', 'map', 'MapEntry', 'metadata_property_handling', 'module', 'mutable', 'mutating', 'namespace', 'native', 'new', 'newtonsoft', 'nil', 'NO', 'noexcept', 'nonatomic', 'none', 'None', 'nonlocal', 'nonmutating', 'NSObject', 'noSuchMethod', 'not', 'not_eq', 'NSError', 'NSString', 'NULL', 'null', 'nullptr', 'number', 'object', 'ObjectMapper', 'of', 'oneway', 'open', 'operator', 'optional', 'or', 'or_eq', 'out', 'override', 'package', 'params', 'pass', 'port', 'postfix', 'precedence', 'prefix', 'print', 'printf', 'printMembers', 'private', 'protected', 'Protocol', 'protocol', 'public', 'quicktype', 'raise', 'range', 'readonly', 'ref', 'RegExp', 'register', 'reinterpret_cast', 'repeat', 'require', 'required', 'requires', 'restrict', 'retain', 'rethrows', 'return', 'right', 'runtimeType', 's', 'sbyte', 'sealed', 'SEL', 'select', 'Self', 'Serializable', 'self', 'Sendable', 'serialize', 'SerialName', 'KSerializer', 'PrimitiveKind', 'SerialDescriptor', 'SerializerProvider', 'set', 'short', 'signed', 'SimpleModule', 'sizeof', 'stackalloc', 'Standards', 'static', 'static_assert', 'static_cast', 'StdDeserializer', 'StdSerializer', 'strictfp', 'string', 'struct', 'subscript', 'super', 'switch', 'symbol', 'synchronized', 'system', 'template', 'then', 'this', 'thread_local', 'throw', 'throws', 'TimeOnly', 'TimeOnlyConverter', 'TimeZone', 'to_json', 'top_level', 'toString', 'transient', 'True', 'true', 'try', 'Type', 'type', 'typealias', 'typedef', 'typeid', 'typename', 'typeof', 'uint', 'ulong', 'unchecked', 'undefined', 'union', 'UseSerializers', 'unowned', 'unsafe', 'unsigned', 'ushort', 'using', 'Utf8JsonReader', 'Utf8JsonWriter', 'UUID', 'var', 'virtual', 'void', 'volatile', 'wchar_t', 'weak', 'where', 'while', 'willSet', 'with', 'xor', 'xor_eq', 'YES', 'yield', 'dummy']); | |
| 16 | +const _Enum = PropTypes.oneOf(['_', '_Bool', '_Complex', '_Imaginery', 'abstract', 'alignas', 'alignof', 'and', 'and_eq', 'any', 'Any', 'array', 'as', 'asm', 'assert', 'associatedtype', 'associativity', 'async', 'atomic', 'atomic_cancel', 'atomic_commit', 'atomic_noexcept', 'auto', 'await', 'base', 'bitand', 'bitor', 'BOOL', 'bool', 'boolean', 'break', 'bycopy', 'byref', 'byte', 'Calendar', 'case', 'catch', 'chan', 'char', 'char16_t', 'char32_t', 'checked', 'class', 'Class', 'clone', 'co_await', 'co_return', 'co_yield', 'Codable', 'CodingKey', 'CodingKeys', 'compl', 'concept', 'console', 'const', 'const_cast', 'constexpr', 'constructor', 'continue', 'convenience', 'convert', 'converter', 'CultureInfo', 'date', 'date_parse_handling', 'DateFormatter', 'DateOnly', 'DateOnlyConverter', 'DateTime', 'DateTimeStyles', 'debugger', 'decimal', 'declare', 'decltype', 'decode_string', 'Decoder', 'DecodingError', 'def', 'default', 'defer', 'deinit', 'del', 'delegate', 'delete', 'dict', 'dictionary', 'didSet', 'do', 'double', 'dynamic', 'dynamic_cast', 'elif', 'else', 'encode_quick_type', 'Encoder', 'enum', 'EnumValues', 'Equatable', 'equalityContract', 'event', 'except', 'exception', 'explicit', 'export', 'exposing', 'extends', 'extension', 'extern', 'fallthrough', 'false', 'False', 'fileprivate', 'final', 'finally', 'fixed', 'float', 'for', 'foreach', 'FormatException', 'friend', 'from', 'from_dict', 'from_json', 'func', 'function', 'get', 'global', 'go', 'goto', 'guard', 'Hashable', 'hashCode', 'Hasher', 'hasOwnProperty', 'id', 'if', 'IMP', 'implements', 'implicit', 'import', 'in', 'indirect', 'infix', 'init', 'inline', 'inout', 'instanceof', 'int', 'interface', 'internal', 'IsoDateTimeOffsetConverter', 'iterable', 'is', 'jdec', 'jenc', 'jpipe', 'json', 'json_converter', 'json_serializer', 'json_token', 'json_writer', 'JSONAny', 'JSONCodingKey', 'JSONDecoder', 'JSONEncoder', 'JsonException', 'JsonGenerator', 'JsonNode', 'JSONNull', 'JsonParser', 'JsonReader', 'JsonTokenType', 'lambda', 'lazy', 'left', 'let', 'list', 'Locale', 'lock', 'long', 'map', 'MarshalJSON', 'MapEntry', 'metadata_property_handling', 'module', 'mutable', 'mutating', 'namespace', 'native', 'new', 'newtonsoft', 'nil', 'NO', 'noexcept', 'nonatomic', 'none', 'None', 'nonlocal', 'nonmutating', 'NSObject', 'noSuchMethod', 'not', 'not_eq', 'NSError', 'NSString', 'NULL', 'null', 'nullptr', 'number', 'object', 'ObjectMapper', 'of', 'oneway', 'open', 'operator', 'optional', 'or', 'or_eq', 'out', 'override', 'package', 'params', 'pass', 'port', 'postfix', 'precedence', 'prefix', 'print', 'printf', 'printMembers', 'private', 'protected', 'Protocol', 'protocol', 'public', 'quicktype', 'raise', 'range', 'readonly', 'ref', 'RegExp', 'register', 'reinterpret_cast', 'repeat', 'require', 'required', 'requires', 'restrict', 'retain', 'rethrows', 'return', 'right', 'runtimeType', 's', 'sbyte', 'sealed', 'SEL', 'select', 'Self', 'Serializable', 'self', 'Sendable', 'serialize', 'SerialName', 'KSerializer', 'PrimitiveKind', 'SerialDescriptor', 'SerializerProvider', 'set', 'short', 'signed', 'SimpleModule', 'sizeof', 'stackalloc', 'Standards', 'static', 'static_assert', 'static_cast', 'StdDeserializer', 'StdSerializer', 'strictfp', 'string', 'struct', 'subscript', 'super', 'switch', 'symbol', 'synchronized', 'system', 'template', 'then', 'this', 'thread_local', 'throw', 'throws', 'TimeOnly', 'TimeOnlyConverter', 'TimeZone', 'to_json', 'top_level', 'toString', 'to_dict', 'transient', 'True', 'true', 'try', 'Type', 'type', 'typealias', 'typedef', 'typeid', 'typename', 'typeof', 'uint', 'ulong', 'unchecked', 'undefined', 'union', 'UnmarshalJSON', 'UseSerializers', 'unowned', 'unsafe', 'unsigned', 'ushort', 'using', 'Utf8JsonReader', 'Utf8JsonWriter', 'UUID', 'var', 'virtual', 'void', 'volatile', 'wchar_t', 'weak', 'where', 'while', 'willSet', 'with', 'xor', 'xor_eq', 'YES', 'yield', 'dummy']); | |
| 17 | 17 | _TopLevel = PropTypes.shape({ |
| 18 | 18 | "enum": PropTypes.oneOfType([_Enum, PropTypes.oneOf([null])]), |
| 19 | 19 | }); |
Mschema-javascriptdefault / TopLevel.js+6 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
| @@ -317,6 +317,7 @@ const typeMap = { | ||
| 317 | 317 | "FormatException", |
| 318 | 318 | "friend", |
| 319 | 319 | "from", |
| 320 | + "from_dict", | |
| 320 | 321 | "from_json", |
| 321 | 322 | "func", |
| 322 | 323 | "function", |
| @@ -376,6 +377,7 @@ const typeMap = { | ||
| 376 | 377 | "lock", |
| 377 | 378 | "long", |
| 378 | 379 | "map", |
| 380 | + "MarshalJSON", | |
| 379 | 381 | "MapEntry", |
| 380 | 382 | "metadata_property_handling", |
| 381 | 383 | "module", |
| @@ -495,6 +497,7 @@ const typeMap = { | ||
| 495 | 497 | "to_json", |
| 496 | 498 | "top_level", |
| 497 | 499 | "toString", |
| 500 | + "to_dict", | |
| 498 | 501 | "transient", |
| 499 | 502 | "True", |
| 500 | 503 | "true", |
| @@ -511,6 +514,7 @@ const typeMap = { | ||
| 511 | 514 | "unchecked", |
| 512 | 515 | "undefined", |
| 513 | 516 | "union", |
| 517 | + "UnmarshalJSON", | |
| 514 | 518 | "UseSerializers", |
| 515 | 519 | "unowned", |
| 516 | 520 | "unsafe", |
Mschema-kotlin-jacksondefault / TopLevel.kt+8 −0
| @@ -162,6 +162,7 @@ enum class EnumEnum(val value: String) { | ||
| 162 | 162 | FormatException("FormatException"), |
| 163 | 163 | Friend("friend"), |
| 164 | 164 | From("from"), |
| 165 | + FromDict("from_dict"), | |
| 165 | 166 | FromJSON("from_json"), |
| 166 | 167 | Func("func"), |
| 167 | 168 | Function("function"), |
| @@ -221,6 +222,7 @@ enum class EnumEnum(val value: String) { | ||
| 221 | 222 | Lock("lock"), |
| 222 | 223 | EnumLong("long"), |
| 223 | 224 | EnumMap("map"), |
| 225 | + MarshalJSON("MarshalJSON"), | |
| 224 | 226 | MapEntry("MapEntry"), |
| 225 | 227 | MetadataPropertyHandling("metadata_property_handling"), |
| 226 | 228 | Module("module"), |
| @@ -340,6 +342,7 @@ enum class EnumEnum(val value: String) { | ||
| 340 | 342 | ToJSON("to_json"), |
| 341 | 343 | TopLevel("top_level"), |
| 342 | 344 | ToString("toString"), |
| 345 | + ToDict("to_dict"), | |
| 343 | 346 | Transient("transient"), |
| 344 | 347 | True("True"), |
| 345 | 348 | EnumTrue("true"), |
| @@ -356,6 +359,7 @@ enum class EnumEnum(val value: String) { | ||
| 356 | 359 | Unchecked("unchecked"), |
| 357 | 360 | Undefined("undefined"), |
| 358 | 361 | Union("union"), |
| 362 | + UnmarshalJSON("UnmarshalJSON"), | |
| 359 | 363 | UseSerializers("UseSerializers"), |
| 360 | 364 | Unowned("unowned"), |
| 361 | 365 | Unsafe("unsafe"), |
| @@ -504,6 +508,7 @@ enum class EnumEnum(val value: String) { | ||
| 504 | 508 | "FormatException" -> FormatException |
| 505 | 509 | "friend" -> Friend |
| 506 | 510 | "from" -> From |
| 511 | + "from_dict" -> FromDict | |
| 507 | 512 | "from_json" -> FromJSON |
| 508 | 513 | "func" -> Func |
| 509 | 514 | "function" -> Function |
| @@ -563,6 +568,7 @@ enum class EnumEnum(val value: String) { | ||
| 563 | 568 | "lock" -> Lock |
| 564 | 569 | "long" -> EnumLong |
| 565 | 570 | "map" -> EnumMap |
| 571 | + "MarshalJSON" -> MarshalJSON | |
| 566 | 572 | "MapEntry" -> MapEntry |
| 567 | 573 | "metadata_property_handling" -> MetadataPropertyHandling |
| 568 | 574 | "module" -> Module |
| @@ -682,6 +688,7 @@ enum class EnumEnum(val value: String) { | ||
| 682 | 688 | "to_json" -> ToJSON |
| 683 | 689 | "top_level" -> TopLevel |
| 684 | 690 | "toString" -> ToString |
| 691 | + "to_dict" -> ToDict | |
| 685 | 692 | "transient" -> Transient |
| 686 | 693 | "True" -> True |
| 687 | 694 | "true" -> EnumTrue |
| @@ -698,6 +705,7 @@ enum class EnumEnum(val value: String) { | ||
| 698 | 705 | "unchecked" -> Unchecked |
| 699 | 706 | "undefined" -> Undefined |
| 700 | 707 | "union" -> Union |
| 708 | + "UnmarshalJSON" -> UnmarshalJSON | |
| 701 | 709 | "UseSerializers" -> UseSerializers |
| 702 | 710 | "unowned" -> Unowned |
| 703 | 711 | "unsafe" -> Unsafe |
Mschema-kotlindefault / TopLevel.kt+8 −0
| @@ -149,6 +149,7 @@ enum class EnumEnum(val value: String) { | ||
| 149 | 149 | FormatException("FormatException"), |
| 150 | 150 | Friend("friend"), |
| 151 | 151 | From("from"), |
| 152 | + FromDict("from_dict"), | |
| 152 | 153 | FromJSON("from_json"), |
| 153 | 154 | Func("func"), |
| 154 | 155 | Function("function"), |
| @@ -208,6 +209,7 @@ enum class EnumEnum(val value: String) { | ||
| 208 | 209 | Lock("lock"), |
| 209 | 210 | EnumLong("long"), |
| 210 | 211 | EnumMap("map"), |
| 212 | + MarshalJSON("MarshalJSON"), | |
| 211 | 213 | MapEntry("MapEntry"), |
| 212 | 214 | MetadataPropertyHandling("metadata_property_handling"), |
| 213 | 215 | Module("module"), |
| @@ -327,6 +329,7 @@ enum class EnumEnum(val value: String) { | ||
| 327 | 329 | ToJSON("to_json"), |
| 328 | 330 | TopLevel("top_level"), |
| 329 | 331 | ToString("toString"), |
| 332 | + ToDict("to_dict"), | |
| 330 | 333 | Transient("transient"), |
| 331 | 334 | True("True"), |
| 332 | 335 | EnumTrue("true"), |
| @@ -343,6 +346,7 @@ enum class EnumEnum(val value: String) { | ||
| 343 | 346 | Unchecked("unchecked"), |
| 344 | 347 | Undefined("undefined"), |
| 345 | 348 | Union("union"), |
| 349 | + UnmarshalJSON("UnmarshalJSON"), | |
| 346 | 350 | UseSerializers("UseSerializers"), |
| 347 | 351 | Unowned("unowned"), |
| 348 | 352 | Unsafe("unsafe"), |
| @@ -491,6 +495,7 @@ enum class EnumEnum(val value: String) { | ||
| 491 | 495 | "FormatException" -> FormatException |
| 492 | 496 | "friend" -> Friend |
| 493 | 497 | "from" -> From |
| 498 | + "from_dict" -> FromDict | |
| 494 | 499 | "from_json" -> FromJSON |
| 495 | 500 | "func" -> Func |
| 496 | 501 | "function" -> Function |
| @@ -550,6 +555,7 @@ enum class EnumEnum(val value: String) { | ||
| 550 | 555 | "lock" -> Lock |
| 551 | 556 | "long" -> EnumLong |
| 552 | 557 | "map" -> EnumMap |
| 558 | + "MarshalJSON" -> MarshalJSON | |
| 553 | 559 | "MapEntry" -> MapEntry |
| 554 | 560 | "metadata_property_handling" -> MetadataPropertyHandling |
| 555 | 561 | "module" -> Module |
| @@ -669,6 +675,7 @@ enum class EnumEnum(val value: String) { | ||
| 669 | 675 | "to_json" -> ToJSON |
| 670 | 676 | "top_level" -> TopLevel |
| 671 | 677 | "toString" -> ToString |
| 678 | + "to_dict" -> ToDict | |
| 672 | 679 | "transient" -> Transient |
| 673 | 680 | "True" -> True |
| 674 | 681 | "true" -> EnumTrue |
| @@ -685,6 +692,7 @@ enum class EnumEnum(val value: String) { | ||
| 685 | 692 | "unchecked" -> Unchecked |
| 686 | 693 | "undefined" -> Undefined |
| 687 | 694 | "union" -> Union |
| 695 | + "UnmarshalJSON" -> UnmarshalJSON | |
| 688 | 696 | "UseSerializers" -> UseSerializers |
| 689 | 697 | "unowned" -> Unowned |
| 690 | 698 | "unsafe" -> Unsafe |
Mschema-kotlinxdefault / TopLevel.kt+4 −0
| @@ -138,6 +138,7 @@ enum class EnumEnum(val value: String) { | ||
| 138 | 138 | @SerialName("FormatException") FormatException("FormatException"), |
| 139 | 139 | @SerialName("friend") Friend("friend"), |
| 140 | 140 | @SerialName("from") From("from"), |
| 141 | + @SerialName("from_dict") FromDict("from_dict"), | |
| 141 | 142 | @SerialName("from_json") FromJSON("from_json"), |
| 142 | 143 | @SerialName("func") Func("func"), |
| 143 | 144 | @SerialName("function") Function("function"), |
| @@ -197,6 +198,7 @@ enum class EnumEnum(val value: String) { | ||
| 197 | 198 | @SerialName("lock") Lock("lock"), |
| 198 | 199 | @SerialName("long") EnumLong("long"), |
| 199 | 200 | @SerialName("map") EnumMap("map"), |
| 201 | + @SerialName("MarshalJSON") MarshalJSON("MarshalJSON"), | |
| 200 | 202 | @SerialName("MapEntry") MapEntry("MapEntry"), |
| 201 | 203 | @SerialName("metadata_property_handling") MetadataPropertyHandling("metadata_property_handling"), |
| 202 | 204 | @SerialName("module") Module("module"), |
| @@ -316,6 +318,7 @@ enum class EnumEnum(val value: String) { | ||
| 316 | 318 | @SerialName("to_json") ToJSON("to_json"), |
| 317 | 319 | @SerialName("top_level") TopLevel("top_level"), |
| 318 | 320 | @SerialName("toString") ToString("toString"), |
| 321 | + @SerialName("to_dict") ToDict("to_dict"), | |
| 319 | 322 | @SerialName("transient") Transient("transient"), |
| 320 | 323 | @SerialName("True") True("True"), |
| 321 | 324 | @SerialName("true") EnumTrue("true"), |
| @@ -332,6 +335,7 @@ enum class EnumEnum(val value: String) { | ||
| 332 | 335 | @SerialName("unchecked") Unchecked("unchecked"), |
| 333 | 336 | @SerialName("undefined") Undefined("undefined"), |
| 334 | 337 | @SerialName("union") Union("union"), |
| 338 | + @SerialName("UnmarshalJSON") UnmarshalJSON("UnmarshalJSON"), | |
| 335 | 339 | @SerialName("UseSerializers") EnumUseSerializers("UseSerializers"), |
| 336 | 340 | @SerialName("unowned") Unowned("unowned"), |
| 337 | 341 | @SerialName("unsafe") Unsafe("unsafe"), |
Mschema-objective-cdefault / QTTopLevel.h+4 −0
| @@ -136,6 +136,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 136 | 136 | + (QTEnum *)formatException; |
| 137 | 137 | + (QTEnum *)friend; |
| 138 | 138 | + (QTEnum *)from; |
| 139 | ++ (QTEnum *)fromDict; | |
| 139 | 140 | + (QTEnum *)fromJSON; |
| 140 | 141 | + (QTEnum *)func; |
| 141 | 142 | + (QTEnum *)function; |
| @@ -195,6 +196,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 195 | 196 | + (QTEnum *)lock; |
| 196 | 197 | + (QTEnum *)enumLong; |
| 197 | 198 | + (QTEnum *)map; |
| 199 | ++ (QTEnum *)marshalJSON; | |
| 198 | 200 | + (QTEnum *)mapEntry; |
| 199 | 201 | + (QTEnum *)metadataPropertyHandling; |
| 200 | 202 | + (QTEnum *)module; |
| @@ -314,6 +316,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 314 | 316 | + (QTEnum *)toJSON; |
| 315 | 317 | + (QTEnum *)topLevel; |
| 316 | 318 | + (QTEnum *)toString; |
| 319 | ++ (QTEnum *)toDict; | |
| 317 | 320 | + (QTEnum *)transient; |
| 318 | 321 | + (QTEnum *)enumTrue; |
| 319 | 322 | + (QTEnum *)true1; |
| @@ -330,6 +333,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 330 | 333 | + (QTEnum *)unchecked; |
| 331 | 334 | + (QTEnum *)undefined; |
| 332 | 335 | + (QTEnum *)enumUnion; |
| 336 | ++ (QTEnum *)unmarshalJSON; | |
| 333 | 337 | + (QTEnum *)useSerializers; |
| 334 | 338 | + (QTEnum *)unowned; |
| 335 | 339 | + (QTEnum *)unsafe; |
Mschema-objective-cdefault / QTTopLevel.m+8 −0
| @@ -139,6 +139,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 139 | 139 | @"FormatException": [[QTEnum alloc] initWithValue:@"FormatException"], |
| 140 | 140 | @"friend": [[QTEnum alloc] initWithValue:@"friend"], |
| 141 | 141 | @"from": [[QTEnum alloc] initWithValue:@"from"], |
| 142 | + @"from_dict": [[QTEnum alloc] initWithValue:@"from_dict"], | |
| 142 | 143 | @"from_json": [[QTEnum alloc] initWithValue:@"from_json"], |
| 143 | 144 | @"func": [[QTEnum alloc] initWithValue:@"func"], |
| 144 | 145 | @"function": [[QTEnum alloc] initWithValue:@"function"], |
| @@ -198,6 +199,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 198 | 199 | @"lock": [[QTEnum alloc] initWithValue:@"lock"], |
| 199 | 200 | @"long": [[QTEnum alloc] initWithValue:@"long"], |
| 200 | 201 | @"map": [[QTEnum alloc] initWithValue:@"map"], |
| 202 | + @"MarshalJSON": [[QTEnum alloc] initWithValue:@"MarshalJSON"], | |
| 201 | 203 | @"MapEntry": [[QTEnum alloc] initWithValue:@"MapEntry"], |
| 202 | 204 | @"metadata_property_handling": [[QTEnum alloc] initWithValue:@"metadata_property_handling"], |
| 203 | 205 | @"module": [[QTEnum alloc] initWithValue:@"module"], |
| @@ -317,6 +319,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 317 | 319 | @"to_json": [[QTEnum alloc] initWithValue:@"to_json"], |
| 318 | 320 | @"top_level": [[QTEnum alloc] initWithValue:@"top_level"], |
| 319 | 321 | @"toString": [[QTEnum alloc] initWithValue:@"toString"], |
| 322 | + @"to_dict": [[QTEnum alloc] initWithValue:@"to_dict"], | |
| 320 | 323 | @"transient": [[QTEnum alloc] initWithValue:@"transient"], |
| 321 | 324 | @"True": [[QTEnum alloc] initWithValue:@"True"], |
| 322 | 325 | @"true": [[QTEnum alloc] initWithValue:@"true"], |
| @@ -333,6 +336,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 333 | 336 | @"unchecked": [[QTEnum alloc] initWithValue:@"unchecked"], |
| 334 | 337 | @"undefined": [[QTEnum alloc] initWithValue:@"undefined"], |
| 335 | 338 | @"union": [[QTEnum alloc] initWithValue:@"union"], |
| 339 | + @"UnmarshalJSON": [[QTEnum alloc] initWithValue:@"UnmarshalJSON"], | |
| 336 | 340 | @"UseSerializers": [[QTEnum alloc] initWithValue:@"UseSerializers"], |
| 337 | 341 | @"unowned": [[QTEnum alloc] initWithValue:@"unowned"], |
| 338 | 342 | @"unsafe": [[QTEnum alloc] initWithValue:@"unsafe"], |
| @@ -481,6 +485,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 481 | 485 | + (QTEnum *)formatException { return QTEnum.values[@"FormatException"]; } |
| 482 | 486 | + (QTEnum *)friend { return QTEnum.values[@"friend"]; } |
| 483 | 487 | + (QTEnum *)from { return QTEnum.values[@"from"]; } |
| 488 | ++ (QTEnum *)fromDict { return QTEnum.values[@"from_dict"]; } | |
| 484 | 489 | + (QTEnum *)fromJSON { return QTEnum.values[@"from_json"]; } |
| 485 | 490 | + (QTEnum *)func { return QTEnum.values[@"func"]; } |
| 486 | 491 | + (QTEnum *)function { return QTEnum.values[@"function"]; } |
| @@ -540,6 +545,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 540 | 545 | + (QTEnum *)lock { return QTEnum.values[@"lock"]; } |
| 541 | 546 | + (QTEnum *)enumLong { return QTEnum.values[@"long"]; } |
| 542 | 547 | + (QTEnum *)map { return QTEnum.values[@"map"]; } |
| 548 | ++ (QTEnum *)marshalJSON { return QTEnum.values[@"MarshalJSON"]; } | |
| 543 | 549 | + (QTEnum *)mapEntry { return QTEnum.values[@"MapEntry"]; } |
| 544 | 550 | + (QTEnum *)metadataPropertyHandling { return QTEnum.values[@"metadata_property_handling"]; } |
| 545 | 551 | + (QTEnum *)module { return QTEnum.values[@"module"]; } |
| @@ -659,6 +665,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 659 | 665 | + (QTEnum *)toJSON { return QTEnum.values[@"to_json"]; } |
| 660 | 666 | + (QTEnum *)topLevel { return QTEnum.values[@"top_level"]; } |
| 661 | 667 | + (QTEnum *)toString { return QTEnum.values[@"toString"]; } |
| 668 | ++ (QTEnum *)toDict { return QTEnum.values[@"to_dict"]; } | |
| 662 | 669 | + (QTEnum *)transient { return QTEnum.values[@"transient"]; } |
| 663 | 670 | + (QTEnum *)enumTrue { return QTEnum.values[@"True"]; } |
| 664 | 671 | + (QTEnum *)true1 { return QTEnum.values[@"true"]; } |
| @@ -675,6 +682,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 675 | 682 | + (QTEnum *)unchecked { return QTEnum.values[@"unchecked"]; } |
| 676 | 683 | + (QTEnum *)undefined { return QTEnum.values[@"undefined"]; } |
| 677 | 684 | + (QTEnum *)enumUnion { return QTEnum.values[@"union"]; } |
| 685 | ++ (QTEnum *)unmarshalJSON { return QTEnum.values[@"UnmarshalJSON"]; } | |
| 678 | 686 | + (QTEnum *)useSerializers { return QTEnum.values[@"UseSerializers"]; } |
| 679 | 687 | + (QTEnum *)unowned { return QTEnum.values[@"unowned"]; } |
| 680 | 688 | + (QTEnum *)unsafe { return QTEnum.values[@"unsafe"]; } |
Mschema-phpdefault / TopLevel.php+16 −0
| @@ -234,6 +234,7 @@ class EnumEnum { | ||
| 234 | 234 | public static EnumEnum $FORMAT_EXCEPTION; |
| 235 | 235 | public static EnumEnum $FRIEND; |
| 236 | 236 | public static EnumEnum $FROM; |
| 237 | + public static EnumEnum $FROM_DICT; | |
| 237 | 238 | public static EnumEnum $FROM_JSON; |
| 238 | 239 | public static EnumEnum $FUNC; |
| 239 | 240 | public static EnumEnum $FUNCTION; |
| @@ -293,6 +294,7 @@ class EnumEnum { | ||
| 293 | 294 | public static EnumEnum $LOCK; |
| 294 | 295 | public static EnumEnum $LONG; |
| 295 | 296 | public static EnumEnum $MAP; |
| 297 | + public static EnumEnum $MARSHAL_JSON; | |
| 296 | 298 | public static EnumEnum $MAP_ENTRY; |
| 297 | 299 | public static EnumEnum $METADATA_PROPERTY_HANDLING; |
| 298 | 300 | public static EnumEnum $MODULE; |
| @@ -412,6 +414,7 @@ class EnumEnum { | ||
| 412 | 414 | public static EnumEnum $TO_JSON; |
| 413 | 415 | public static EnumEnum $TOP_LEVEL; |
| 414 | 416 | public static EnumEnum $TO_STRING; |
| 417 | + public static EnumEnum $TO_DICT; | |
| 415 | 418 | public static EnumEnum $TRANSIENT; |
| 416 | 419 | public static EnumEnum $TRUE; |
| 417 | 420 | public static EnumEnum $ENUM_TRUE; |
| @@ -428,6 +431,7 @@ class EnumEnum { | ||
| 428 | 431 | public static EnumEnum $UNCHECKED; |
| 429 | 432 | public static EnumEnum $UNDEFINED; |
| 430 | 433 | public static EnumEnum $UNION; |
| 434 | + public static EnumEnum $UNMARSHAL_JSON; | |
| 431 | 435 | public static EnumEnum $USE_SERIALIZERS; |
| 432 | 436 | public static EnumEnum $UNOWNED; |
| 433 | 437 | public static EnumEnum $UNSAFE; |
| @@ -574,6 +578,7 @@ class EnumEnum { | ||
| 574 | 578 | EnumEnum::$FORMAT_EXCEPTION = new EnumEnum('FormatException'); |
| 575 | 579 | EnumEnum::$FRIEND = new EnumEnum('friend'); |
| 576 | 580 | EnumEnum::$FROM = new EnumEnum('from'); |
| 581 | + EnumEnum::$FROM_DICT = new EnumEnum('from_dict'); | |
| 577 | 582 | EnumEnum::$FROM_JSON = new EnumEnum('from_json'); |
| 578 | 583 | EnumEnum::$FUNC = new EnumEnum('func'); |
| 579 | 584 | EnumEnum::$FUNCTION = new EnumEnum('function'); |
| @@ -633,6 +638,7 @@ class EnumEnum { | ||
| 633 | 638 | EnumEnum::$LOCK = new EnumEnum('lock'); |
| 634 | 639 | EnumEnum::$LONG = new EnumEnum('long'); |
| 635 | 640 | EnumEnum::$MAP = new EnumEnum('map'); |
| 641 | + EnumEnum::$MARSHAL_JSON = new EnumEnum('MarshalJSON'); | |
| 636 | 642 | EnumEnum::$MAP_ENTRY = new EnumEnum('MapEntry'); |
| 637 | 643 | EnumEnum::$METADATA_PROPERTY_HANDLING = new EnumEnum('metadata_property_handling'); |
| 638 | 644 | EnumEnum::$MODULE = new EnumEnum('module'); |
| @@ -752,6 +758,7 @@ class EnumEnum { | ||
| 752 | 758 | EnumEnum::$TO_JSON = new EnumEnum('to_json'); |
| 753 | 759 | EnumEnum::$TOP_LEVEL = new EnumEnum('top_level'); |
| 754 | 760 | EnumEnum::$TO_STRING = new EnumEnum('toString'); |
| 761 | + EnumEnum::$TO_DICT = new EnumEnum('to_dict'); | |
| 755 | 762 | EnumEnum::$TRANSIENT = new EnumEnum('transient'); |
| 756 | 763 | EnumEnum::$TRUE = new EnumEnum('True'); |
| 757 | 764 | EnumEnum::$ENUM_TRUE = new EnumEnum('true'); |
| @@ -768,6 +775,7 @@ class EnumEnum { | ||
| 768 | 775 | EnumEnum::$UNCHECKED = new EnumEnum('unchecked'); |
| 769 | 776 | EnumEnum::$UNDEFINED = new EnumEnum('undefined'); |
| 770 | 777 | EnumEnum::$UNION = new EnumEnum('union'); |
| 778 | + EnumEnum::$UNMARSHAL_JSON = new EnumEnum('UnmarshalJSON'); | |
| 771 | 779 | EnumEnum::$USE_SERIALIZERS = new EnumEnum('UseSerializers'); |
| 772 | 780 | EnumEnum::$UNOWNED = new EnumEnum('unowned'); |
| 773 | 781 | EnumEnum::$UNSAFE = new EnumEnum('unsafe'); |
| @@ -926,6 +934,7 @@ class EnumEnum { | ||
| 926 | 934 | case EnumEnum::$FORMAT_EXCEPTION->enum: return 'FormatException'; |
| 927 | 935 | case EnumEnum::$FRIEND->enum: return 'friend'; |
| 928 | 936 | case EnumEnum::$FROM->enum: return 'from'; |
| 937 | + case EnumEnum::$FROM_DICT->enum: return 'from_dict'; | |
| 929 | 938 | case EnumEnum::$FROM_JSON->enum: return 'from_json'; |
| 930 | 939 | case EnumEnum::$FUNC->enum: return 'func'; |
| 931 | 940 | case EnumEnum::$FUNCTION->enum: return 'function'; |
| @@ -985,6 +994,7 @@ class EnumEnum { | ||
| 985 | 994 | case EnumEnum::$LOCK->enum: return 'lock'; |
| 986 | 995 | case EnumEnum::$LONG->enum: return 'long'; |
| 987 | 996 | case EnumEnum::$MAP->enum: return 'map'; |
| 997 | + case EnumEnum::$MARSHAL_JSON->enum: return 'MarshalJSON'; | |
| 988 | 998 | case EnumEnum::$MAP_ENTRY->enum: return 'MapEntry'; |
| 989 | 999 | case EnumEnum::$METADATA_PROPERTY_HANDLING->enum: return 'metadata_property_handling'; |
| 990 | 1000 | case EnumEnum::$MODULE->enum: return 'module'; |
| @@ -1104,6 +1114,7 @@ class EnumEnum { | ||
| 1104 | 1114 | case EnumEnum::$TO_JSON->enum: return 'to_json'; |
| 1105 | 1115 | case EnumEnum::$TOP_LEVEL->enum: return 'top_level'; |
| 1106 | 1116 | case EnumEnum::$TO_STRING->enum: return 'toString'; |
| 1117 | + case EnumEnum::$TO_DICT->enum: return 'to_dict'; | |
| 1107 | 1118 | case EnumEnum::$TRANSIENT->enum: return 'transient'; |
| 1108 | 1119 | case EnumEnum::$TRUE->enum: return 'True'; |
| 1109 | 1120 | case EnumEnum::$ENUM_TRUE->enum: return 'true'; |
| @@ -1120,6 +1131,7 @@ class EnumEnum { | ||
| 1120 | 1131 | case EnumEnum::$UNCHECKED->enum: return 'unchecked'; |
| 1121 | 1132 | case EnumEnum::$UNDEFINED->enum: return 'undefined'; |
| 1122 | 1133 | case EnumEnum::$UNION->enum: return 'union'; |
| 1134 | + case EnumEnum::$UNMARSHAL_JSON->enum: return 'UnmarshalJSON'; | |
| 1123 | 1135 | case EnumEnum::$USE_SERIALIZERS->enum: return 'UseSerializers'; |
| 1124 | 1136 | case EnumEnum::$UNOWNED->enum: return 'unowned'; |
| 1125 | 1137 | case EnumEnum::$UNSAFE->enum: return 'unsafe'; |
| @@ -1276,6 +1288,7 @@ class EnumEnum { | ||
| 1276 | 1288 | case 'FormatException': return EnumEnum::$FORMAT_EXCEPTION; |
| 1277 | 1289 | case 'friend': return EnumEnum::$FRIEND; |
| 1278 | 1290 | case 'from': return EnumEnum::$FROM; |
| 1291 | + case 'from_dict': return EnumEnum::$FROM_DICT; | |
| 1279 | 1292 | case 'from_json': return EnumEnum::$FROM_JSON; |
| 1280 | 1293 | case 'func': return EnumEnum::$FUNC; |
| 1281 | 1294 | case 'function': return EnumEnum::$FUNCTION; |
| @@ -1335,6 +1348,7 @@ class EnumEnum { | ||
| 1335 | 1348 | case 'lock': return EnumEnum::$LOCK; |
| 1336 | 1349 | case 'long': return EnumEnum::$LONG; |
| 1337 | 1350 | case 'map': return EnumEnum::$MAP; |
| 1351 | + case 'MarshalJSON': return EnumEnum::$MARSHAL_JSON; | |
| 1338 | 1352 | case 'MapEntry': return EnumEnum::$MAP_ENTRY; |
| 1339 | 1353 | case 'metadata_property_handling': return EnumEnum::$METADATA_PROPERTY_HANDLING; |
| 1340 | 1354 | case 'module': return EnumEnum::$MODULE; |
| @@ -1454,6 +1468,7 @@ class EnumEnum { | ||
| 1454 | 1468 | case 'to_json': return EnumEnum::$TO_JSON; |
| 1455 | 1469 | case 'top_level': return EnumEnum::$TOP_LEVEL; |
| 1456 | 1470 | case 'toString': return EnumEnum::$TO_STRING; |
| 1471 | + case 'to_dict': return EnumEnum::$TO_DICT; | |
| 1457 | 1472 | case 'transient': return EnumEnum::$TRANSIENT; |
| 1458 | 1473 | case 'True': return EnumEnum::$TRUE; |
| 1459 | 1474 | case 'true': return EnumEnum::$ENUM_TRUE; |
| @@ -1470,6 +1485,7 @@ class EnumEnum { | ||
| 1470 | 1485 | case 'unchecked': return EnumEnum::$UNCHECKED; |
| 1471 | 1486 | case 'undefined': return EnumEnum::$UNDEFINED; |
| 1472 | 1487 | case 'union': return EnumEnum::$UNION; |
| 1488 | + case 'UnmarshalJSON': return EnumEnum::$UNMARSHAL_JSON; | |
| 1473 | 1489 | case 'UseSerializers': return EnumEnum::$USE_SERIALIZERS; |
| 1474 | 1490 | case 'unowned': return EnumEnum::$UNOWNED; |
| 1475 | 1491 | case 'unsafe': return EnumEnum::$UNSAFE; |
Mschema-pikedefault / TopLevel.pmod+5 −1
| @@ -154,6 +154,7 @@ enum Enum { | ||
| 154 | 154 | FORMAT_EXCEPTION = "FormatException", // json: "FormatException" |
| 155 | 155 | FRIEND = "friend", // json: "friend" |
| 156 | 156 | FROM = "from", // json: "from" |
| 157 | + FROM_DICT = "from_dict", // json: "from_dict" | |
| 157 | 158 | FROM_JSON = "from_json", // json: "from_json" |
| 158 | 159 | FUNC = "func", // json: "func" |
| 159 | 160 | FUNCTION = "function", // json: "function" |
| @@ -213,6 +214,7 @@ enum Enum { | ||
| 213 | 214 | LOCK = "lock", // json: "lock" |
| 214 | 215 | LONG = "long", // json: "long" |
| 215 | 216 | MAP = "map", // json: "map" |
| 217 | + MARSHAL_JSON = "MarshalJSON", // json: "MarshalJSON" | |
| 216 | 218 | MAP_ENTRY = "MapEntry", // json: "MapEntry" |
| 217 | 219 | METADATA_PROPERTY_HANDLING = "metadata_property_handling", // json: "metadata_property_handling" |
| 218 | 220 | MODULE = "module", // json: "module" |
| @@ -332,6 +334,7 @@ enum Enum { | ||
| 332 | 334 | TO_JSON = "to_json", // json: "to_json" |
| 333 | 335 | TOP_LEVEL = "top_level", // json: "top_level" |
| 334 | 336 | TO_STRING = "toString", // json: "toString" |
| 337 | + TO_DICT = "to_dict", // json: "to_dict" | |
| 335 | 338 | TRANSIENT = "transient", // json: "transient" |
| 336 | 339 | TRUE = "True", // json: "True" |
| 337 | 340 | ENUM_TRUE = "true", // json: "true" |
| @@ -348,6 +351,7 @@ enum Enum { | ||
| 348 | 351 | UNCHECKED = "unchecked", // json: "unchecked" |
| 349 | 352 | UNDEFINED = "undefined", // json: "undefined" |
| 350 | 353 | UNION = "union", // json: "union" |
| 354 | + UNMARSHAL_JSON = "UnmarshalJSON", // json: "UnmarshalJSON" | |
| 351 | 355 | USE_SERIALIZERS = "UseSerializers", // json: "UseSerializers" |
| 352 | 356 | UNOWNED = "unowned", // json: "unowned" |
| 353 | 357 | UNSAFE = "unsafe", // json: "unsafe" |
| @@ -375,5 +379,5 @@ enum Enum { | ||
| 375 | 379 | } |
| 376 | 380 | |
| 377 | 381 | Enum Enum_from_JSON(mixed json) { |
| 378 | - if(!zero_type(json)&&json != "_"&&json != "_Bool"&&json != "_Complex"&&json != "_Imaginery"&&json != "abstract"&&json != "alignas"&&json != "alignof"&&json != "and"&&json != "and_eq"&&json != "any"&&json != "Any"&&json != "array"&&json != "as"&&json != "asm"&&json != "assert"&&json != "associatedtype"&&json != "associativity"&&json != "async"&&json != "atomic"&&json != "atomic_cancel"&&json != "atomic_commit"&&json != "atomic_noexcept"&&json != "auto"&&json != "await"&&json != "base"&&json != "bitand"&&json != "bitor"&&json != "BOOL"&&json != "bool"&&json != "boolean"&&json != "break"&&json != "bycopy"&&json != "byref"&&json != "byte"&&json != "Calendar"&&json != "case"&&json != "catch"&&json != "chan"&&json != "char"&&json != "char16_t"&&json != "char32_t"&&json != "checked"&&json != "class"&&json != "Class"&&json != "clone"&&json != "co_await"&&json != "co_return"&&json != "co_yield"&&json != "Codable"&&json != "CodingKey"&&json != "CodingKeys"&&json != "compl"&&json != "concept"&&json != "console"&&json != "const"&&json != "const_cast"&&json != "constexpr"&&json != "constructor"&&json != "continue"&&json != "convenience"&&json != "convert"&&json != "converter"&&json != "CultureInfo"&&json != "date"&&json != "date_parse_handling"&&json != "DateFormatter"&&json != "DateOnly"&&json != "DateOnlyConverter"&&json != "DateTime"&&json != "DateTimeStyles"&&json != "debugger"&&json != "decimal"&&json != "declare"&&json != "decltype"&&json != "decode_string"&&json != "Decoder"&&json != "DecodingError"&&json != "def"&&json != "default"&&json != "defer"&&json != "deinit"&&json != "del"&&json != "delegate"&&json != "delete"&&json != "dict"&&json != "dictionary"&&json != "didSet"&&json != "do"&&json != "double"&&json != "dynamic"&&json != "dynamic_cast"&&json != "elif"&&json != "else"&&json != "encode_quick_type"&&json != "Encoder"&&json != "enum"&&json != "EnumValues"&&json != "Equatable"&&json != "equalityContract"&&json != "event"&&json != "except"&&json != "exception"&&json != "explicit"&&json != "export"&&json != "exposing"&&json != "extends"&&json != "extension"&&json != "extern"&&json != "fallthrough"&&json != "false"&&json != "False"&&json != "fileprivate"&&json != "final"&&json != "finally"&&json != "fixed"&&json != "float"&&json != "for"&&json != "foreach"&&json != "FormatException"&&json != "friend"&&json != "from"&&json != "from_json"&&json != "func"&&json != "function"&&json != "get"&&json != "global"&&json != "go"&&json != "goto"&&json != "guard"&&json != "Hashable"&&json != "hashCode"&&json != "Hasher"&&json != "hasOwnProperty"&&json != "id"&&json != "if"&&json != "IMP"&&json != "implements"&&json != "implicit"&&json != "import"&&json != "in"&&json != "indirect"&&json != "infix"&&json != "init"&&json != "inline"&&json != "inout"&&json != "instanceof"&&json != "int"&&json != "interface"&&json != "internal"&&json != "IsoDateTimeOffsetConverter"&&json != "iterable"&&json != "is"&&json != "jdec"&&json != "jenc"&&json != "jpipe"&&json != "json"&&json != "json_converter"&&json != "json_serializer"&&json != "json_token"&&json != "json_writer"&&json != "JSONAny"&&json != "JSONCodingKey"&&json != "JSONDecoder"&&json != "JSONEncoder"&&json != "JsonException"&&json != "JsonGenerator"&&json != "JsonNode"&&json != "JSONNull"&&json != "JsonParser"&&json != "JsonReader"&&json != "JsonTokenType"&&json != "lambda"&&json != "lazy"&&json != "left"&&json != "let"&&json != "list"&&json != "Locale"&&json != "lock"&&json != "long"&&json != "map"&&json != "MapEntry"&&json != "metadata_property_handling"&&json != "module"&&json != "mutable"&&json != "mutating"&&json != "namespace"&&json != "native"&&json != "new"&&json != "newtonsoft"&&json != "nil"&&json != "NO"&&json != "noexcept"&&json != "nonatomic"&&json != "none"&&json != "None"&&json != "nonlocal"&&json != "nonmutating"&&json != "NSObject"&&json != "noSuchMethod"&&json != "not"&&json != "not_eq"&&json != "NSError"&&json != "NSString"&&json != "NULL"&&json != "null"&&json != "nullptr"&&json != "number"&&json != "object"&&json != "ObjectMapper"&&json != "of"&&json != "oneway"&&json != "open"&&json != "operator"&&json != "optional"&&json != "or"&&json != "or_eq"&&json != "out"&&json != "override"&&json != "package"&&json != "params"&&json != "pass"&&json != "port"&&json != "postfix"&&json != "precedence"&&json != "prefix"&&json != "print"&&json != "printf"&&json != "printMembers"&&json != "private"&&json != "protected"&&json != "Protocol"&&json != "protocol"&&json != "public"&&json != "quicktype"&&json != "raise"&&json != "range"&&json != "readonly"&&json != "ref"&&json != "RegExp"&&json != "register"&&json != "reinterpret_cast"&&json != "repeat"&&json != "require"&&json != "required"&&json != "requires"&&json != "restrict"&&json != "retain"&&json != "rethrows"&&json != "return"&&json != "right"&&json != "runtimeType"&&json != "s"&&json != "sbyte"&&json != "sealed"&&json != "SEL"&&json != "select"&&json != "Self"&&json != "Serializable"&&json != "self"&&json != "Sendable"&&json != "serialize"&&json != "SerialName"&&json != "KSerializer"&&json != "PrimitiveKind"&&json != "SerialDescriptor"&&json != "SerializerProvider"&&json != "set"&&json != "short"&&json != "signed"&&json != "SimpleModule"&&json != "sizeof"&&json != "stackalloc"&&json != "Standards"&&json != "static"&&json != "static_assert"&&json != "static_cast"&&json != "StdDeserializer"&&json != "StdSerializer"&&json != "strictfp"&&json != "string"&&json != "struct"&&json != "subscript"&&json != "super"&&json != "switch"&&json != "symbol"&&json != "synchronized"&&json != "system"&&json != "template"&&json != "then"&&json != "this"&&json != "thread_local"&&json != "throw"&&json != "throws"&&json != "TimeOnly"&&json != "TimeOnlyConverter"&&json != "TimeZone"&&json != "to_json"&&json != "top_level"&&json != "toString"&&json != "transient"&&json != "True"&&json != "true"&&json != "try"&&json != "Type"&&json != "type"&&json != "typealias"&&json != "typedef"&&json != "typeid"&&json != "typename"&&json != "typeof"&&json != "uint"&&json != "ulong"&&json != "unchecked"&&json != "undefined"&&json != "union"&&json != "UseSerializers"&&json != "unowned"&&json != "unsafe"&&json != "unsigned"&&json != "ushort"&&json != "using"&&json != "Utf8JsonReader"&&json != "Utf8JsonWriter"&&json != "UUID"&&json != "var"&&json != "virtual"&&json != "void"&&json != "volatile"&&json != "wchar_t"&&json != "weak"&&json != "where"&&json != "while"&&json != "willSet"&&json != "with"&&json != "xor"&&json != "xor_eq"&&json != "YES"&&json != "yield"&&json != "dummy")error("enum");return json; | |
| 382 | + if(!zero_type(json)&&json != "_"&&json != "_Bool"&&json != "_Complex"&&json != "_Imaginery"&&json != "abstract"&&json != "alignas"&&json != "alignof"&&json != "and"&&json != "and_eq"&&json != "any"&&json != "Any"&&json != "array"&&json != "as"&&json != "asm"&&json != "assert"&&json != "associatedtype"&&json != "associativity"&&json != "async"&&json != "atomic"&&json != "atomic_cancel"&&json != "atomic_commit"&&json != "atomic_noexcept"&&json != "auto"&&json != "await"&&json != "base"&&json != "bitand"&&json != "bitor"&&json != "BOOL"&&json != "bool"&&json != "boolean"&&json != "break"&&json != "bycopy"&&json != "byref"&&json != "byte"&&json != "Calendar"&&json != "case"&&json != "catch"&&json != "chan"&&json != "char"&&json != "char16_t"&&json != "char32_t"&&json != "checked"&&json != "class"&&json != "Class"&&json != "clone"&&json != "co_await"&&json != "co_return"&&json != "co_yield"&&json != "Codable"&&json != "CodingKey"&&json != "CodingKeys"&&json != "compl"&&json != "concept"&&json != "console"&&json != "const"&&json != "const_cast"&&json != "constexpr"&&json != "constructor"&&json != "continue"&&json != "convenience"&&json != "convert"&&json != "converter"&&json != "CultureInfo"&&json != "date"&&json != "date_parse_handling"&&json != "DateFormatter"&&json != "DateOnly"&&json != "DateOnlyConverter"&&json != "DateTime"&&json != "DateTimeStyles"&&json != "debugger"&&json != "decimal"&&json != "declare"&&json != "decltype"&&json != "decode_string"&&json != "Decoder"&&json != "DecodingError"&&json != "def"&&json != "default"&&json != "defer"&&json != "deinit"&&json != "del"&&json != "delegate"&&json != "delete"&&json != "dict"&&json != "dictionary"&&json != "didSet"&&json != "do"&&json != "double"&&json != "dynamic"&&json != "dynamic_cast"&&json != "elif"&&json != "else"&&json != "encode_quick_type"&&json != "Encoder"&&json != "enum"&&json != "EnumValues"&&json != "Equatable"&&json != "equalityContract"&&json != "event"&&json != "except"&&json != "exception"&&json != "explicit"&&json != "export"&&json != "exposing"&&json != "extends"&&json != "extension"&&json != "extern"&&json != "fallthrough"&&json != "false"&&json != "False"&&json != "fileprivate"&&json != "final"&&json != "finally"&&json != "fixed"&&json != "float"&&json != "for"&&json != "foreach"&&json != "FormatException"&&json != "friend"&&json != "from"&&json != "from_dict"&&json != "from_json"&&json != "func"&&json != "function"&&json != "get"&&json != "global"&&json != "go"&&json != "goto"&&json != "guard"&&json != "Hashable"&&json != "hashCode"&&json != "Hasher"&&json != "hasOwnProperty"&&json != "id"&&json != "if"&&json != "IMP"&&json != "implements"&&json != "implicit"&&json != "import"&&json != "in"&&json != "indirect"&&json != "infix"&&json != "init"&&json != "inline"&&json != "inout"&&json != "instanceof"&&json != "int"&&json != "interface"&&json != "internal"&&json != "IsoDateTimeOffsetConverter"&&json != "iterable"&&json != "is"&&json != "jdec"&&json != "jenc"&&json != "jpipe"&&json != "json"&&json != "json_converter"&&json != "json_serializer"&&json != "json_token"&&json != "json_writer"&&json != "JSONAny"&&json != "JSONCodingKey"&&json != "JSONDecoder"&&json != "JSONEncoder"&&json != "JsonException"&&json != "JsonGenerator"&&json != "JsonNode"&&json != "JSONNull"&&json != "JsonParser"&&json != "JsonReader"&&json != "JsonTokenType"&&json != "lambda"&&json != "lazy"&&json != "left"&&json != "let"&&json != "list"&&json != "Locale"&&json != "lock"&&json != "long"&&json != "map"&&json != "MarshalJSON"&&json != "MapEntry"&&json != "metadata_property_handling"&&json != "module"&&json != "mutable"&&json != "mutating"&&json != "namespace"&&json != "native"&&json != "new"&&json != "newtonsoft"&&json != "nil"&&json != "NO"&&json != "noexcept"&&json != "nonatomic"&&json != "none"&&json != "None"&&json != "nonlocal"&&json != "nonmutating"&&json != "NSObject"&&json != "noSuchMethod"&&json != "not"&&json != "not_eq"&&json != "NSError"&&json != "NSString"&&json != "NULL"&&json != "null"&&json != "nullptr"&&json != "number"&&json != "object"&&json != "ObjectMapper"&&json != "of"&&json != "oneway"&&json != "open"&&json != "operator"&&json != "optional"&&json != "or"&&json != "or_eq"&&json != "out"&&json != "override"&&json != "package"&&json != "params"&&json != "pass"&&json != "port"&&json != "postfix"&&json != "precedence"&&json != "prefix"&&json != "print"&&json != "printf"&&json != "printMembers"&&json != "private"&&json != "protected"&&json != "Protocol"&&json != "protocol"&&json != "public"&&json != "quicktype"&&json != "raise"&&json != "range"&&json != "readonly"&&json != "ref"&&json != "RegExp"&&json != "register"&&json != "reinterpret_cast"&&json != "repeat"&&json != "require"&&json != "required"&&json != "requires"&&json != "restrict"&&json != "retain"&&json != "rethrows"&&json != "return"&&json != "right"&&json != "runtimeType"&&json != "s"&&json != "sbyte"&&json != "sealed"&&json != "SEL"&&json != "select"&&json != "Self"&&json != "Serializable"&&json != "self"&&json != "Sendable"&&json != "serialize"&&json != "SerialName"&&json != "KSerializer"&&json != "PrimitiveKind"&&json != "SerialDescriptor"&&json != "SerializerProvider"&&json != "set"&&json != "short"&&json != "signed"&&json != "SimpleModule"&&json != "sizeof"&&json != "stackalloc"&&json != "Standards"&&json != "static"&&json != "static_assert"&&json != "static_cast"&&json != "StdDeserializer"&&json != "StdSerializer"&&json != "strictfp"&&json != "string"&&json != "struct"&&json != "subscript"&&json != "super"&&json != "switch"&&json != "symbol"&&json != "synchronized"&&json != "system"&&json != "template"&&json != "then"&&json != "this"&&json != "thread_local"&&json != "throw"&&json != "throws"&&json != "TimeOnly"&&json != "TimeOnlyConverter"&&json != "TimeZone"&&json != "to_json"&&json != "top_level"&&json != "toString"&&json != "to_dict"&&json != "transient"&&json != "True"&&json != "true"&&json != "try"&&json != "Type"&&json != "type"&&json != "typealias"&&json != "typedef"&&json != "typeid"&&json != "typename"&&json != "typeof"&&json != "uint"&&json != "ulong"&&json != "unchecked"&&json != "undefined"&&json != "union"&&json != "UnmarshalJSON"&&json != "UseSerializers"&&json != "unowned"&&json != "unsafe"&&json != "unsigned"&&json != "ushort"&&json != "using"&&json != "Utf8JsonReader"&&json != "Utf8JsonWriter"&&json != "UUID"&&json != "var"&&json != "virtual"&&json != "void"&&json != "volatile"&&json != "wchar_t"&&json != "weak"&&json != "where"&&json != "while"&&json != "willSet"&&json != "with"&&json != "xor"&&json != "xor_eq"&&json != "YES"&&json != "yield"&&json != "dummy")error("enum");return json; | |
| 379 | 383 | } |
Mschema-pythondefault / quicktype.py+4 −0
| @@ -153,6 +153,7 @@ class EnumEnum(Enum): | ||
| 153 | 153 | FORMAT_EXCEPTION = "FormatException" |
| 154 | 154 | FRIEND = "friend" |
| 155 | 155 | FROM = "from" |
| 156 | + FROM_DICT = "from_dict" | |
| 156 | 157 | FROM_JSON = "from_json" |
| 157 | 158 | FUNC = "func" |
| 158 | 159 | FUNCTION = "function" |
| @@ -212,6 +213,7 @@ class EnumEnum(Enum): | ||
| 212 | 213 | LOCK = "lock" |
| 213 | 214 | LONG = "long" |
| 214 | 215 | MAP = "map" |
| 216 | + MARSHAL_JSON = "MarshalJSON" | |
| 215 | 217 | MAP_ENTRY = "MapEntry" |
| 216 | 218 | METADATA_PROPERTY_HANDLING = "metadata_property_handling" |
| 217 | 219 | MODULE = "module" |
| @@ -331,6 +333,7 @@ class EnumEnum(Enum): | ||
| 331 | 333 | TO_JSON = "to_json" |
| 332 | 334 | TOP_LEVEL = "top_level" |
| 333 | 335 | TO_STRING = "toString" |
| 336 | + TO_DICT = "to_dict" | |
| 334 | 337 | TRANSIENT = "transient" |
| 335 | 338 | TRUE = "True" |
| 336 | 339 | ENUM_TRUE = "true" |
| @@ -347,6 +350,7 @@ class EnumEnum(Enum): | ||
| 347 | 350 | UNCHECKED = "unchecked" |
| 348 | 351 | UNDEFINED = "undefined" |
| 349 | 352 | UNION = "union" |
| 353 | + UNMARSHAL_JSON = "UnmarshalJSON" | |
| 350 | 354 | USE_SERIALIZERS = "UseSerializers" |
| 351 | 355 | UNOWNED = "unowned" |
| 352 | 356 | UNSAFE = "unsafe" |
Mschema-rubydefault / TopLevel.rb+5 −1
| @@ -17,7 +17,7 @@ module Types | ||
| 17 | 17 | |
| 18 | 18 | Hash = Strict::Hash |
| 19 | 19 | String = Strict::String |
| 20 | - Enum = Strict::String.enum("_", "_Bool", "_Complex", "_Imaginery", "abstract", "alignas", "alignof", "and", "and_eq", "any", "Any", "array", "as", "asm", "assert", "associatedtype", "associativity", "async", "atomic", "atomic_cancel", "atomic_commit", "atomic_noexcept", "auto", "await", "base", "bitand", "bitor", "BOOL", "bool", "boolean", "break", "bycopy", "byref", "byte", "Calendar", "case", "catch", "chan", "char", "char16_t", "char32_t", "checked", "class", "Class", "clone", "co_await", "co_return", "co_yield", "Codable", "CodingKey", "CodingKeys", "compl", "concept", "console", "const", "const_cast", "constexpr", "constructor", "continue", "convenience", "convert", "converter", "CultureInfo", "date", "date_parse_handling", "DateFormatter", "DateOnly", "DateOnlyConverter", "DateTime", "DateTimeStyles", "debugger", "decimal", "declare", "decltype", "decode_string", "Decoder", "DecodingError", "def", "default", "defer", "deinit", "del", "delegate", "delete", "dict", "dictionary", "didSet", "do", "double", "dynamic", "dynamic_cast", "elif", "else", "encode_quick_type", "Encoder", "enum", "EnumValues", "Equatable", "equalityContract", "event", "except", "exception", "explicit", "export", "exposing", "extends", "extension", "extern", "fallthrough", "false", "False", "fileprivate", "final", "finally", "fixed", "float", "for", "foreach", "FormatException", "friend", "from", "from_json", "func", "function", "get", "global", "go", "goto", "guard", "Hashable", "hashCode", "Hasher", "hasOwnProperty", "id", "if", "IMP", "implements", "implicit", "import", "in", "indirect", "infix", "init", "inline", "inout", "instanceof", "int", "interface", "internal", "IsoDateTimeOffsetConverter", "iterable", "is", "jdec", "jenc", "jpipe", "json", "json_converter", "json_serializer", "json_token", "json_writer", "JSONAny", "JSONCodingKey", "JSONDecoder", "JSONEncoder", "JsonException", "JsonGenerator", "JsonNode", "JSONNull", "JsonParser", "JsonReader", "JsonTokenType", "lambda", "lazy", "left", "let", "list", "Locale", "lock", "long", "map", "MapEntry", "metadata_property_handling", "module", "mutable", "mutating", "namespace", "native", "new", "newtonsoft", "nil", "NO", "noexcept", "nonatomic", "none", "None", "nonlocal", "nonmutating", "NSObject", "noSuchMethod", "not", "not_eq", "NSError", "NSString", "NULL", "null", "nullptr", "number", "object", "ObjectMapper", "of", "oneway", "open", "operator", "optional", "or", "or_eq", "out", "override", "package", "params", "pass", "port", "postfix", "precedence", "prefix", "print", "printf", "printMembers", "private", "protected", "Protocol", "protocol", "public", "quicktype", "raise", "range", "readonly", "ref", "RegExp", "register", "reinterpret_cast", "repeat", "require", "required", "requires", "restrict", "retain", "rethrows", "return", "right", "runtimeType", "s", "sbyte", "sealed", "SEL", "select", "Self", "Serializable", "self", "Sendable", "serialize", "SerialName", "KSerializer", "PrimitiveKind", "SerialDescriptor", "SerializerProvider", "set", "short", "signed", "SimpleModule", "sizeof", "stackalloc", "Standards", "static", "static_assert", "static_cast", "StdDeserializer", "StdSerializer", "strictfp", "string", "struct", "subscript", "super", "switch", "symbol", "synchronized", "system", "template", "then", "this", "thread_local", "throw", "throws", "TimeOnly", "TimeOnlyConverter", "TimeZone", "to_json", "top_level", "toString", "transient", "True", "true", "try", "Type", "type", "typealias", "typedef", "typeid", "typename", "typeof", "uint", "ulong", "unchecked", "undefined", "union", "UseSerializers", "unowned", "unsafe", "unsigned", "ushort", "using", "Utf8JsonReader", "Utf8JsonWriter", "UUID", "var", "virtual", "void", "volatile", "wchar_t", "weak", "where", "while", "willSet", "with", "xor", "xor_eq", "YES", "yield", "dummy") | |
| 20 | + Enum = Strict::String.enum("_", "_Bool", "_Complex", "_Imaginery", "abstract", "alignas", "alignof", "and", "and_eq", "any", "Any", "array", "as", "asm", "assert", "associatedtype", "associativity", "async", "atomic", "atomic_cancel", "atomic_commit", "atomic_noexcept", "auto", "await", "base", "bitand", "bitor", "BOOL", "bool", "boolean", "break", "bycopy", "byref", "byte", "Calendar", "case", "catch", "chan", "char", "char16_t", "char32_t", "checked", "class", "Class", "clone", "co_await", "co_return", "co_yield", "Codable", "CodingKey", "CodingKeys", "compl", "concept", "console", "const", "const_cast", "constexpr", "constructor", "continue", "convenience", "convert", "converter", "CultureInfo", "date", "date_parse_handling", "DateFormatter", "DateOnly", "DateOnlyConverter", "DateTime", "DateTimeStyles", "debugger", "decimal", "declare", "decltype", "decode_string", "Decoder", "DecodingError", "def", "default", "defer", "deinit", "del", "delegate", "delete", "dict", "dictionary", "didSet", "do", "double", "dynamic", "dynamic_cast", "elif", "else", "encode_quick_type", "Encoder", "enum", "EnumValues", "Equatable", "equalityContract", "event", "except", "exception", "explicit", "export", "exposing", "extends", "extension", "extern", "fallthrough", "false", "False", "fileprivate", "final", "finally", "fixed", "float", "for", "foreach", "FormatException", "friend", "from", "from_dict", "from_json", "func", "function", "get", "global", "go", "goto", "guard", "Hashable", "hashCode", "Hasher", "hasOwnProperty", "id", "if", "IMP", "implements", "implicit", "import", "in", "indirect", "infix", "init", "inline", "inout", "instanceof", "int", "interface", "internal", "IsoDateTimeOffsetConverter", "iterable", "is", "jdec", "jenc", "jpipe", "json", "json_converter", "json_serializer", "json_token", "json_writer", "JSONAny", "JSONCodingKey", "JSONDecoder", "JSONEncoder", "JsonException", "JsonGenerator", "JsonNode", "JSONNull", "JsonParser", "JsonReader", "JsonTokenType", "lambda", "lazy", "left", "let", "list", "Locale", "lock", "long", "map", "MarshalJSON", "MapEntry", "metadata_property_handling", "module", "mutable", "mutating", "namespace", "native", "new", "newtonsoft", "nil", "NO", "noexcept", "nonatomic", "none", "None", "nonlocal", "nonmutating", "NSObject", "noSuchMethod", "not", "not_eq", "NSError", "NSString", "NULL", "null", "nullptr", "number", "object", "ObjectMapper", "of", "oneway", "open", "operator", "optional", "or", "or_eq", "out", "override", "package", "params", "pass", "port", "postfix", "precedence", "prefix", "print", "printf", "printMembers", "private", "protected", "Protocol", "protocol", "public", "quicktype", "raise", "range", "readonly", "ref", "RegExp", "register", "reinterpret_cast", "repeat", "require", "required", "requires", "restrict", "retain", "rethrows", "return", "right", "runtimeType", "s", "sbyte", "sealed", "SEL", "select", "Self", "Serializable", "self", "Sendable", "serialize", "SerialName", "KSerializer", "PrimitiveKind", "SerialDescriptor", "SerializerProvider", "set", "short", "signed", "SimpleModule", "sizeof", "stackalloc", "Standards", "static", "static_assert", "static_cast", "StdDeserializer", "StdSerializer", "strictfp", "string", "struct", "subscript", "super", "switch", "symbol", "synchronized", "system", "template", "then", "this", "thread_local", "throw", "throws", "TimeOnly", "TimeOnlyConverter", "TimeZone", "to_json", "top_level", "toString", "to_dict", "transient", "True", "true", "try", "Type", "type", "typealias", "typedef", "typeid", "typename", "typeof", "uint", "ulong", "unchecked", "undefined", "union", "UnmarshalJSON", "UseSerializers", "unowned", "unsafe", "unsigned", "ushort", "using", "Utf8JsonReader", "Utf8JsonWriter", "UUID", "var", "virtual", "void", "volatile", "wchar_t", "weak", "where", "while", "willSet", "with", "xor", "xor_eq", "YES", "yield", "dummy") | |
| 21 | 21 | end |
| 22 | 22 | |
| 23 | 23 | module Enum |
| @@ -142,6 +142,7 @@ module Enum | ||
| 142 | 142 | FormatException = "FormatException" |
| 143 | 143 | Friend = "friend" |
| 144 | 144 | From = "from" |
| 145 | + FromDict = "from_dict" | |
| 145 | 146 | FromJSON = "from_json" |
| 146 | 147 | Func = "func" |
| 147 | 148 | Function = "function" |
| @@ -201,6 +202,7 @@ module Enum | ||
| 201 | 202 | Lock = "lock" |
| 202 | 203 | Long = "long" |
| 203 | 204 | Map = "map" |
| 205 | + MarshalJSON = "MarshalJSON" | |
| 204 | 206 | MapEntry = "MapEntry" |
| 205 | 207 | MetadataPropertyHandling = "metadata_property_handling" |
| 206 | 208 | Module = "module" |
| @@ -320,6 +322,7 @@ module Enum | ||
| 320 | 322 | ToJSON = "to_json" |
| 321 | 323 | TopLevel = "top_level" |
| 322 | 324 | ToString = "toString" |
| 325 | + ToDict = "to_dict" | |
| 323 | 326 | Transient = "transient" |
| 324 | 327 | True = "True" |
| 325 | 328 | EnumTrue = "true" |
| @@ -336,6 +339,7 @@ module Enum | ||
| 336 | 339 | Unchecked = "unchecked" |
| 337 | 340 | Undefined = "undefined" |
| 338 | 341 | Union = "union" |
| 342 | + UnmarshalJSON = "UnmarshalJSON" | |
| 339 | 343 | UseSerializers = "UseSerializers" |
| 340 | 344 | Unowned = "unowned" |
| 341 | 345 | Unsafe = "unsafe" |
Mschema-rustdefault / module_under_test.rs+12 −0
| @@ -305,6 +305,9 @@ pub enum Enum { | ||
| 305 | 305 | |
| 306 | 306 | From, |
| 307 | 307 | |
| 308 | + #[serde(rename = "from_dict")] | |
| 309 | + FromDict, | |
| 310 | + | |
| 308 | 311 | #[serde(rename = "from_json")] |
| 309 | 312 | FromJson, |
| 310 | 313 | |
| @@ -446,6 +449,9 @@ pub enum Enum { | ||
| 446 | 449 | |
| 447 | 450 | Map, |
| 448 | 451 | |
| 452 | + #[serde(rename = "MarshalJSON")] | |
| 453 | + MarshalJson, | |
| 454 | + | |
| 449 | 455 | #[serde(rename = "MapEntry")] |
| 450 | 456 | MapEntry, |
| 451 | 457 | |
| @@ -729,6 +735,9 @@ pub enum Enum { | ||
| 729 | 735 | #[serde(rename = "toString")] |
| 730 | 736 | ToString, |
| 731 | 737 | |
| 738 | + #[serde(rename = "to_dict")] | |
| 739 | + ToDict, | |
| 740 | + | |
| 732 | 741 | Transient, |
| 733 | 742 | |
| 734 | 743 | #[serde(rename = "True")] |
| @@ -765,6 +774,9 @@ pub enum Enum { | ||
| 765 | 774 | |
| 766 | 775 | Union, |
| 767 | 776 | |
| 777 | + #[serde(rename = "UnmarshalJSON")] | |
| 778 | + UnmarshalJson, | |
| 779 | + | |
| 768 | 780 | #[serde(rename = "UseSerializers")] |
| 769 | 781 | UseSerializers, |
Mschema-scala3-upickledefault / TopLevel.scala+12 −0
| @@ -204,6 +204,7 @@ enum EnumEnum : | ||
| 204 | 204 | case FormatException |
| 205 | 205 | case Friend |
| 206 | 206 | case From |
| 207 | + case FromDict | |
| 207 | 208 | case FromJSON |
| 208 | 209 | case Func |
| 209 | 210 | case Function |
| @@ -263,6 +264,7 @@ enum EnumEnum : | ||
| 263 | 264 | case Lock |
| 264 | 265 | case EnumLong |
| 265 | 266 | case EnumMap |
| 267 | + case MarshalJSON | |
| 266 | 268 | case MapEntry |
| 267 | 269 | case MetadataPropertyHandling |
| 268 | 270 | case Module |
| @@ -382,6 +384,7 @@ enum EnumEnum : | ||
| 382 | 384 | case ToJSON |
| 383 | 385 | case TopLevel |
| 384 | 386 | case ToString |
| 387 | + case ToDict | |
| 385 | 388 | case Transient |
| 386 | 389 | case True |
| 387 | 390 | case EnumTrue |
| @@ -398,6 +401,7 @@ enum EnumEnum : | ||
| 398 | 401 | case Unchecked |
| 399 | 402 | case Undefined |
| 400 | 403 | case Union |
| 404 | + case UnmarshalJSON | |
| 401 | 405 | case UseSerializers |
| 402 | 406 | case Unowned |
| 403 | 407 | case Unsafe |
| @@ -546,6 +550,7 @@ given OptionPickler.ReadWriter[EnumEnum] = OptionPickler.readwriter[String].bima | ||
| 546 | 550 | case EnumEnum.FormatException => "FormatException" |
| 547 | 551 | case EnumEnum.Friend => "friend" |
| 548 | 552 | case EnumEnum.From => "from" |
| 553 | + case EnumEnum.FromDict => "from_dict" | |
| 549 | 554 | case EnumEnum.FromJSON => "from_json" |
| 550 | 555 | case EnumEnum.Func => "func" |
| 551 | 556 | case EnumEnum.Function => "function" |
| @@ -605,6 +610,7 @@ given OptionPickler.ReadWriter[EnumEnum] = OptionPickler.readwriter[String].bima | ||
| 605 | 610 | case EnumEnum.Lock => "lock" |
| 606 | 611 | case EnumEnum.EnumLong => "long" |
| 607 | 612 | case EnumEnum.EnumMap => "map" |
| 613 | + case EnumEnum.MarshalJSON => "MarshalJSON" | |
| 608 | 614 | case EnumEnum.MapEntry => "MapEntry" |
| 609 | 615 | case EnumEnum.MetadataPropertyHandling => "metadata_property_handling" |
| 610 | 616 | case EnumEnum.Module => "module" |
| @@ -724,6 +730,7 @@ given OptionPickler.ReadWriter[EnumEnum] = OptionPickler.readwriter[String].bima | ||
| 724 | 730 | case EnumEnum.ToJSON => "to_json" |
| 725 | 731 | case EnumEnum.TopLevel => "top_level" |
| 726 | 732 | case EnumEnum.ToString => "toString" |
| 733 | + case EnumEnum.ToDict => "to_dict" | |
| 727 | 734 | case EnumEnum.Transient => "transient" |
| 728 | 735 | case EnumEnum.True => "True" |
| 729 | 736 | case EnumEnum.EnumTrue => "true" |
| @@ -740,6 +747,7 @@ given OptionPickler.ReadWriter[EnumEnum] = OptionPickler.readwriter[String].bima | ||
| 740 | 747 | case EnumEnum.Unchecked => "unchecked" |
| 741 | 748 | case EnumEnum.Undefined => "undefined" |
| 742 | 749 | case EnumEnum.Union => "union" |
| 750 | + case EnumEnum.UnmarshalJSON => "UnmarshalJSON" | |
| 743 | 751 | case EnumEnum.UseSerializers => "UseSerializers" |
| 744 | 752 | case EnumEnum.Unowned => "unowned" |
| 745 | 753 | case EnumEnum.Unsafe => "unsafe" |
| @@ -887,6 +895,7 @@ given OptionPickler.ReadWriter[EnumEnum] = OptionPickler.readwriter[String].bima | ||
| 887 | 895 | case "FormatException" => EnumEnum.FormatException |
| 888 | 896 | case "friend" => EnumEnum.Friend |
| 889 | 897 | case "from" => EnumEnum.From |
| 898 | + case "from_dict" => EnumEnum.FromDict | |
| 890 | 899 | case "from_json" => EnumEnum.FromJSON |
| 891 | 900 | case "func" => EnumEnum.Func |
| 892 | 901 | case "function" => EnumEnum.Function |
| @@ -946,6 +955,7 @@ given OptionPickler.ReadWriter[EnumEnum] = OptionPickler.readwriter[String].bima | ||
| 946 | 955 | case "lock" => EnumEnum.Lock |
| 947 | 956 | case "long" => EnumEnum.EnumLong |
| 948 | 957 | case "map" => EnumEnum.EnumMap |
| 958 | + case "MarshalJSON" => EnumEnum.MarshalJSON | |
| 949 | 959 | case "MapEntry" => EnumEnum.MapEntry |
| 950 | 960 | case "metadata_property_handling" => EnumEnum.MetadataPropertyHandling |
| 951 | 961 | case "module" => EnumEnum.Module |
| @@ -1065,6 +1075,7 @@ given OptionPickler.ReadWriter[EnumEnum] = OptionPickler.readwriter[String].bima | ||
| 1065 | 1075 | case "to_json" => EnumEnum.ToJSON |
| 1066 | 1076 | case "top_level" => EnumEnum.TopLevel |
| 1067 | 1077 | case "toString" => EnumEnum.ToString |
| 1078 | + case "to_dict" => EnumEnum.ToDict | |
| 1068 | 1079 | case "transient" => EnumEnum.Transient |
| 1069 | 1080 | case "True" => EnumEnum.True |
| 1070 | 1081 | case "true" => EnumEnum.EnumTrue |
| @@ -1081,6 +1092,7 @@ given OptionPickler.ReadWriter[EnumEnum] = OptionPickler.readwriter[String].bima | ||
| 1081 | 1092 | case "unchecked" => EnumEnum.Unchecked |
| 1082 | 1093 | case "undefined" => EnumEnum.Undefined |
| 1083 | 1094 | case "union" => EnumEnum.Union |
| 1095 | + case "UnmarshalJSON" => EnumEnum.UnmarshalJSON | |
| 1084 | 1096 | case "UseSerializers" => EnumEnum.UseSerializers |
| 1085 | 1097 | case "unowned" => EnumEnum.Unowned |
| 1086 | 1098 | case "unsafe" => EnumEnum.Unsafe |
Mschema-scala3default / TopLevel.scala+12 −0
| @@ -133,6 +133,7 @@ enum EnumEnum : | ||
| 133 | 133 | case FormatException |
| 134 | 134 | case Friend |
| 135 | 135 | case From |
| 136 | + case FromDict | |
| 136 | 137 | case FromJSON |
| 137 | 138 | case Func |
| 138 | 139 | case Function |
| @@ -192,6 +193,7 @@ enum EnumEnum : | ||
| 192 | 193 | case Lock |
| 193 | 194 | case EnumLong |
| 194 | 195 | case EnumMap |
| 196 | + case MarshalJSON | |
| 195 | 197 | case MapEntry |
| 196 | 198 | case MetadataPropertyHandling |
| 197 | 199 | case Module |
| @@ -311,6 +313,7 @@ enum EnumEnum : | ||
| 311 | 313 | case ToJSON |
| 312 | 314 | case TopLevel |
| 313 | 315 | case ToString |
| 316 | + case ToDict | |
| 314 | 317 | case Transient |
| 315 | 318 | case True |
| 316 | 319 | case EnumTrue |
| @@ -327,6 +330,7 @@ enum EnumEnum : | ||
| 327 | 330 | case Unchecked |
| 328 | 331 | case Undefined |
| 329 | 332 | case Union |
| 333 | + case UnmarshalJSON | |
| 330 | 334 | case UseSerializers |
| 331 | 335 | case Unowned |
| 332 | 336 | case Unsafe |
| @@ -474,6 +478,7 @@ given Decoder[EnumEnum] = Decoder.decodeString.emap { | ||
| 474 | 478 | case "FormatException" => scala.Right(EnumEnum.FormatException) |
| 475 | 479 | case "friend" => scala.Right(EnumEnum.Friend) |
| 476 | 480 | case "from" => scala.Right(EnumEnum.From) |
| 481 | + case "from_dict" => scala.Right(EnumEnum.FromDict) | |
| 477 | 482 | case "from_json" => scala.Right(EnumEnum.FromJSON) |
| 478 | 483 | case "func" => scala.Right(EnumEnum.Func) |
| 479 | 484 | case "function" => scala.Right(EnumEnum.Function) |
| @@ -533,6 +538,7 @@ given Decoder[EnumEnum] = Decoder.decodeString.emap { | ||
| 533 | 538 | case "lock" => scala.Right(EnumEnum.Lock) |
| 534 | 539 | case "long" => scala.Right(EnumEnum.EnumLong) |
| 535 | 540 | case "map" => scala.Right(EnumEnum.EnumMap) |
| 541 | + case "MarshalJSON" => scala.Right(EnumEnum.MarshalJSON) | |
| 536 | 542 | case "MapEntry" => scala.Right(EnumEnum.MapEntry) |
| 537 | 543 | case "metadata_property_handling" => scala.Right(EnumEnum.MetadataPropertyHandling) |
| 538 | 544 | case "module" => scala.Right(EnumEnum.Module) |
| @@ -652,6 +658,7 @@ given Decoder[EnumEnum] = Decoder.decodeString.emap { | ||
| 652 | 658 | case "to_json" => scala.Right(EnumEnum.ToJSON) |
| 653 | 659 | case "top_level" => scala.Right(EnumEnum.TopLevel) |
| 654 | 660 | case "toString" => scala.Right(EnumEnum.ToString) |
| 661 | + case "to_dict" => scala.Right(EnumEnum.ToDict) | |
| 655 | 662 | case "transient" => scala.Right(EnumEnum.Transient) |
| 656 | 663 | case "True" => scala.Right(EnumEnum.True) |
| 657 | 664 | case "true" => scala.Right(EnumEnum.EnumTrue) |
| @@ -668,6 +675,7 @@ given Decoder[EnumEnum] = Decoder.decodeString.emap { | ||
| 668 | 675 | case "unchecked" => scala.Right(EnumEnum.Unchecked) |
| 669 | 676 | case "undefined" => scala.Right(EnumEnum.Undefined) |
| 670 | 677 | case "union" => scala.Right(EnumEnum.Union) |
| 678 | + case "UnmarshalJSON" => scala.Right(EnumEnum.UnmarshalJSON) | |
| 671 | 679 | case "UseSerializers" => scala.Right(EnumEnum.UseSerializers) |
| 672 | 680 | case "unowned" => scala.Right(EnumEnum.Unowned) |
| 673 | 681 | case "unsafe" => scala.Right(EnumEnum.Unsafe) |
| @@ -816,6 +824,7 @@ given Encoder[EnumEnum] = Encoder.encodeString.contramap { | ||
| 816 | 824 | case EnumEnum.FormatException => "FormatException" |
| 817 | 825 | case EnumEnum.Friend => "friend" |
| 818 | 826 | case EnumEnum.From => "from" |
| 827 | + case EnumEnum.FromDict => "from_dict" | |
| 819 | 828 | case EnumEnum.FromJSON => "from_json" |
| 820 | 829 | case EnumEnum.Func => "func" |
| 821 | 830 | case EnumEnum.Function => "function" |
| @@ -875,6 +884,7 @@ given Encoder[EnumEnum] = Encoder.encodeString.contramap { | ||
| 875 | 884 | case EnumEnum.Lock => "lock" |
| 876 | 885 | case EnumEnum.EnumLong => "long" |
| 877 | 886 | case EnumEnum.EnumMap => "map" |
| 887 | + case EnumEnum.MarshalJSON => "MarshalJSON" | |
| 878 | 888 | case EnumEnum.MapEntry => "MapEntry" |
| 879 | 889 | case EnumEnum.MetadataPropertyHandling => "metadata_property_handling" |
| 880 | 890 | case EnumEnum.Module => "module" |
| @@ -994,6 +1004,7 @@ given Encoder[EnumEnum] = Encoder.encodeString.contramap { | ||
| 994 | 1004 | case EnumEnum.ToJSON => "to_json" |
| 995 | 1005 | case EnumEnum.TopLevel => "top_level" |
| 996 | 1006 | case EnumEnum.ToString => "toString" |
| 1007 | + case EnumEnum.ToDict => "to_dict" | |
| 997 | 1008 | case EnumEnum.Transient => "transient" |
| 998 | 1009 | case EnumEnum.True => "True" |
| 999 | 1010 | case EnumEnum.EnumTrue => "true" |
| @@ -1010,6 +1021,7 @@ given Encoder[EnumEnum] = Encoder.encodeString.contramap { | ||
| 1010 | 1021 | case EnumEnum.Unchecked => "unchecked" |
| 1011 | 1022 | case EnumEnum.Undefined => "undefined" |
| 1012 | 1023 | case EnumEnum.Union => "union" |
| 1024 | + case EnumEnum.UnmarshalJSON => "UnmarshalJSON" | |
| 1013 | 1025 | case EnumEnum.UseSerializers => "UseSerializers" |
| 1014 | 1026 | case EnumEnum.Unowned => "unowned" |
| 1015 | 1027 | case EnumEnum.Unsafe => "unsafe" |
Mschema-schemadefault / TopLevel.schema+4 −0
| @@ -137,6 +137,7 @@ | ||
| 137 | 137 | "FormatException", |
| 138 | 138 | "friend", |
| 139 | 139 | "from", |
| 140 | + "from_dict", | |
| 140 | 141 | "from_json", |
| 141 | 142 | "func", |
| 142 | 143 | "function", |
| @@ -196,6 +197,7 @@ | ||
| 196 | 197 | "lock", |
| 197 | 198 | "long", |
| 198 | 199 | "map", |
| 200 | + "MarshalJSON", | |
| 199 | 201 | "MapEntry", |
| 200 | 202 | "metadata_property_handling", |
| 201 | 203 | "module", |
| @@ -315,6 +317,7 @@ | ||
| 315 | 317 | "to_json", |
| 316 | 318 | "top_level", |
| 317 | 319 | "toString", |
| 320 | + "to_dict", | |
| 318 | 321 | "transient", |
| 319 | 322 | "True", |
| 320 | 323 | "true", |
| @@ -331,6 +334,7 @@ | ||
| 331 | 334 | "unchecked", |
| 332 | 335 | "undefined", |
| 333 | 336 | "union", |
| 337 | + "UnmarshalJSON", | |
| 334 | 338 | "UseSerializers", |
| 335 | 339 | "unowned", |
| 336 | 340 | "unsafe", |
Mschema-swiftdefault / quicktype.swift+4 −0
| @@ -171,6 +171,7 @@ enum Enum: String, Codable { | ||
| 171 | 171 | case formatException = "FormatException" |
| 172 | 172 | case friend = "friend" |
| 173 | 173 | case from = "from" |
| 174 | + case fromDict = "from_dict" | |
| 174 | 175 | case fromJSON = "from_json" |
| 175 | 176 | case enumFunc = "func" |
| 176 | 177 | case function = "function" |
| @@ -230,6 +231,7 @@ enum Enum: String, Codable { | ||
| 230 | 231 | case lock = "lock" |
| 231 | 232 | case long = "long" |
| 232 | 233 | case map = "map" |
| 234 | + case marshalJSON = "MarshalJSON" | |
| 233 | 235 | case mapEntry = "MapEntry" |
| 234 | 236 | case metadataPropertyHandling = "metadata_property_handling" |
| 235 | 237 | case module = "module" |
| @@ -349,6 +351,7 @@ enum Enum: String, Codable { | ||
| 349 | 351 | case toJSON = "to_json" |
| 350 | 352 | case topLevel = "top_level" |
| 351 | 353 | case toString = "toString" |
| 354 | + case toDict = "to_dict" | |
| 352 | 355 | case transient = "transient" |
| 353 | 356 | case enumTrue = "True" |
| 354 | 357 | case purpleTrue = "true" |
| @@ -365,6 +368,7 @@ enum Enum: String, Codable { | ||
| 365 | 368 | case unchecked = "unchecked" |
| 366 | 369 | case undefined = "undefined" |
| 367 | 370 | case union = "union" |
| 371 | + case unmarshalJSON = "UnmarshalJSON" | |
| 368 | 372 | case useSerializers = "UseSerializers" |
| 369 | 373 | case enumUnowned = "unowned" |
| 370 | 374 | case unsafe = "unsafe" |
Mschema-typescript-effect-schemadefault / TopLevel.ts+4 −0
| @@ -123,6 +123,7 @@ export const Enum = S.Literal( | ||
| 123 | 123 | "FormatException", |
| 124 | 124 | "friend", |
| 125 | 125 | "from", |
| 126 | + "from_dict", | |
| 126 | 127 | "from_json", |
| 127 | 128 | "func", |
| 128 | 129 | "function", |
| @@ -182,6 +183,7 @@ export const Enum = S.Literal( | ||
| 182 | 183 | "lock", |
| 183 | 184 | "long", |
| 184 | 185 | "map", |
| 186 | + "MarshalJSON", | |
| 185 | 187 | "MapEntry", |
| 186 | 188 | "metadata_property_handling", |
| 187 | 189 | "module", |
| @@ -301,6 +303,7 @@ export const Enum = S.Literal( | ||
| 301 | 303 | "to_json", |
| 302 | 304 | "top_level", |
| 303 | 305 | "toString", |
| 306 | + "to_dict", | |
| 304 | 307 | "transient", |
| 305 | 308 | "True", |
| 306 | 309 | "true", |
| @@ -317,6 +320,7 @@ export const Enum = S.Literal( | ||
| 317 | 320 | "unchecked", |
| 318 | 321 | "undefined", |
| 319 | 322 | "union", |
| 323 | + "UnmarshalJSON", | |
| 320 | 324 | "UseSerializers", |
| 321 | 325 | "unowned", |
| 322 | 326 | "unsafe", |
Mschema-typescript-zoddefault / TopLevel.ts+4 −0
| @@ -123,6 +123,7 @@ export const EnumSchema = z.enum([ | ||
| 123 | 123 | "FormatException", |
| 124 | 124 | "friend", |
| 125 | 125 | "from", |
| 126 | + "from_dict", | |
| 126 | 127 | "from_json", |
| 127 | 128 | "func", |
| 128 | 129 | "function", |
| @@ -182,6 +183,7 @@ export const EnumSchema = z.enum([ | ||
| 182 | 183 | "lock", |
| 183 | 184 | "long", |
| 184 | 185 | "map", |
| 186 | + "MarshalJSON", | |
| 185 | 187 | "MapEntry", |
| 186 | 188 | "metadata_property_handling", |
| 187 | 189 | "module", |
| @@ -301,6 +303,7 @@ export const EnumSchema = z.enum([ | ||
| 301 | 303 | "to_json", |
| 302 | 304 | "top_level", |
| 303 | 305 | "toString", |
| 306 | + "to_dict", | |
| 304 | 307 | "transient", |
| 305 | 308 | "True", |
| 306 | 309 | "true", |
| @@ -317,6 +320,7 @@ export const EnumSchema = z.enum([ | ||
| 317 | 320 | "unchecked", |
| 318 | 321 | "undefined", |
| 319 | 322 | "union", |
| 323 | + "UnmarshalJSON", | |
| 320 | 324 | "UseSerializers", |
| 321 | 325 | "unowned", |
| 322 | 326 | "unsafe", |
Mschema-typescriptdefault / TopLevel.ts+7 −3
| @@ -12,7 +12,7 @@ export interface TopLevel { | ||
| 12 | 12 | [property: string]: unknown; |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | -export type Enum = "_" | "_Bool" | "_Complex" | "_Imaginery" | "abstract" | "alignas" | "alignof" | "and" | "and_eq" | "any" | "Any" | "array" | "as" | "asm" | "assert" | "associatedtype" | "associativity" | "async" | "atomic" | "atomic_cancel" | "atomic_commit" | "atomic_noexcept" | "auto" | "await" | "base" | "bitand" | "bitor" | "BOOL" | "bool" | "boolean" | "break" | "bycopy" | "byref" | "byte" | "Calendar" | "case" | "catch" | "chan" | "char" | "char16_t" | "char32_t" | "checked" | "class" | "Class" | "clone" | "co_await" | "co_return" | "co_yield" | "Codable" | "CodingKey" | "CodingKeys" | "compl" | "concept" | "console" | "const" | "const_cast" | "constexpr" | "constructor" | "continue" | "convenience" | "convert" | "converter" | "CultureInfo" | "date" | "date_parse_handling" | "DateFormatter" | "DateOnly" | "DateOnlyConverter" | "DateTime" | "DateTimeStyles" | "debugger" | "decimal" | "declare" | "decltype" | "decode_string" | "Decoder" | "DecodingError" | "def" | "default" | "defer" | "deinit" | "del" | "delegate" | "delete" | "dict" | "dictionary" | "didSet" | "do" | "double" | "dynamic" | "dynamic_cast" | "elif" | "else" | "encode_quick_type" | "Encoder" | "enum" | "EnumValues" | "Equatable" | "equalityContract" | "event" | "except" | "exception" | "explicit" | "export" | "exposing" | "extends" | "extension" | "extern" | "fallthrough" | "false" | "False" | "fileprivate" | "final" | "finally" | "fixed" | "float" | "for" | "foreach" | "FormatException" | "friend" | "from" | "from_json" | "func" | "function" | "get" | "global" | "go" | "goto" | "guard" | "Hashable" | "hashCode" | "Hasher" | "hasOwnProperty" | "id" | "if" | "IMP" | "implements" | "implicit" | "import" | "in" | "indirect" | "infix" | "init" | "inline" | "inout" | "instanceof" | "int" | "interface" | "internal" | "IsoDateTimeOffsetConverter" | "iterable" | "is" | "jdec" | "jenc" | "jpipe" | "json" | "json_converter" | "json_serializer" | "json_token" | "json_writer" | "JSONAny" | "JSONCodingKey" | "JSONDecoder" | "JSONEncoder" | "JsonException" | "JsonGenerator" | "JsonNode" | "JSONNull" | "JsonParser" | "JsonReader" | "JsonTokenType" | "lambda" | "lazy" | "left" | "let" | "list" | "Locale" | "lock" | "long" | "map" | "MapEntry" | "metadata_property_handling" | "module" | "mutable" | "mutating" | "namespace" | "native" | "new" | "newtonsoft" | "nil" | "NO" | "noexcept" | "nonatomic" | "none" | "None" | "nonlocal" | "nonmutating" | "NSObject" | "noSuchMethod" | "not" | "not_eq" | "NSError" | "NSString" | "NULL" | "null" | "nullptr" | "number" | "object" | "ObjectMapper" | "of" | "oneway" | "open" | "operator" | "optional" | "or" | "or_eq" | "out" | "override" | "package" | "params" | "pass" | "port" | "postfix" | "precedence" | "prefix" | "print" | "printf" | "printMembers" | "private" | "protected" | "Protocol" | "protocol" | "public" | "quicktype" | "raise" | "range" | "readonly" | "ref" | "RegExp" | "register" | "reinterpret_cast" | "repeat" | "require" | "required" | "requires" | "restrict" | "retain" | "rethrows" | "return" | "right" | "runtimeType" | "s" | "sbyte" | "sealed" | "SEL" | "select" | "Self" | "Serializable" | "self" | "Sendable" | "serialize" | "SerialName" | "KSerializer" | "PrimitiveKind" | "SerialDescriptor" | "SerializerProvider" | "set" | "short" | "signed" | "SimpleModule" | "sizeof" | "stackalloc" | "Standards" | "static" | "static_assert" | "static_cast" | "StdDeserializer" | "StdSerializer" | "strictfp" | "string" | "struct" | "subscript" | "super" | "switch" | "symbol" | "synchronized" | "system" | "template" | "then" | "this" | "thread_local" | "throw" | "throws" | "TimeOnly" | "TimeOnlyConverter" | "TimeZone" | "to_json" | "top_level" | "toString" | "transient" | "True" | "true" | "try" | "Type" | "type" | "typealias" | "typedef" | "typeid" | "typename" | "typeof" | "uint" | "ulong" | "unchecked" | "undefined" | "union" | "UseSerializers" | "unowned" | "unsafe" | "unsigned" | "ushort" | "using" | "Utf8JsonReader" | "Utf8JsonWriter" | "UUID" | "var" | "virtual" | "void" | "volatile" | "wchar_t" | "weak" | "where" | "while" | "willSet" | "with" | "xor" | "xor_eq" | "YES" | "yield" | "dummy"; | |
| 15 | +export type Enum = "_" | "_Bool" | "_Complex" | "_Imaginery" | "abstract" | "alignas" | "alignof" | "and" | "and_eq" | "any" | "Any" | "array" | "as" | "asm" | "assert" | "associatedtype" | "associativity" | "async" | "atomic" | "atomic_cancel" | "atomic_commit" | "atomic_noexcept" | "auto" | "await" | "base" | "bitand" | "bitor" | "BOOL" | "bool" | "boolean" | "break" | "bycopy" | "byref" | "byte" | "Calendar" | "case" | "catch" | "chan" | "char" | "char16_t" | "char32_t" | "checked" | "class" | "Class" | "clone" | "co_await" | "co_return" | "co_yield" | "Codable" | "CodingKey" | "CodingKeys" | "compl" | "concept" | "console" | "const" | "const_cast" | "constexpr" | "constructor" | "continue" | "convenience" | "convert" | "converter" | "CultureInfo" | "date" | "date_parse_handling" | "DateFormatter" | "DateOnly" | "DateOnlyConverter" | "DateTime" | "DateTimeStyles" | "debugger" | "decimal" | "declare" | "decltype" | "decode_string" | "Decoder" | "DecodingError" | "def" | "default" | "defer" | "deinit" | "del" | "delegate" | "delete" | "dict" | "dictionary" | "didSet" | "do" | "double" | "dynamic" | "dynamic_cast" | "elif" | "else" | "encode_quick_type" | "Encoder" | "enum" | "EnumValues" | "Equatable" | "equalityContract" | "event" | "except" | "exception" | "explicit" | "export" | "exposing" | "extends" | "extension" | "extern" | "fallthrough" | "false" | "False" | "fileprivate" | "final" | "finally" | "fixed" | "float" | "for" | "foreach" | "FormatException" | "friend" | "from" | "from_dict" | "from_json" | "func" | "function" | "get" | "global" | "go" | "goto" | "guard" | "Hashable" | "hashCode" | "Hasher" | "hasOwnProperty" | "id" | "if" | "IMP" | "implements" | "implicit" | "import" | "in" | "indirect" | "infix" | "init" | "inline" | "inout" | "instanceof" | "int" | "interface" | "internal" | "IsoDateTimeOffsetConverter" | "iterable" | "is" | "jdec" | "jenc" | "jpipe" | "json" | "json_converter" | "json_serializer" | "json_token" | "json_writer" | "JSONAny" | "JSONCodingKey" | "JSONDecoder" | "JSONEncoder" | "JsonException" | "JsonGenerator" | "JsonNode" | "JSONNull" | "JsonParser" | "JsonReader" | "JsonTokenType" | "lambda" | "lazy" | "left" | "let" | "list" | "Locale" | "lock" | "long" | "map" | "MarshalJSON" | "MapEntry" | "metadata_property_handling" | "module" | "mutable" | "mutating" | "namespace" | "native" | "new" | "newtonsoft" | "nil" | "NO" | "noexcept" | "nonatomic" | "none" | "None" | "nonlocal" | "nonmutating" | "NSObject" | "noSuchMethod" | "not" | "not_eq" | "NSError" | "NSString" | "NULL" | "null" | "nullptr" | "number" | "object" | "ObjectMapper" | "of" | "oneway" | "open" | "operator" | "optional" | "or" | "or_eq" | "out" | "override" | "package" | "params" | "pass" | "port" | "postfix" | "precedence" | "prefix" | "print" | "printf" | "printMembers" | "private" | "protected" | "Protocol" | "protocol" | "public" | "quicktype" | "raise" | "range" | "readonly" | "ref" | "RegExp" | "register" | "reinterpret_cast" | "repeat" | "require" | "required" | "requires" | "restrict" | "retain" | "rethrows" | "return" | "right" | "runtimeType" | "s" | "sbyte" | "sealed" | "SEL" | "select" | "Self" | "Serializable" | "self" | "Sendable" | "serialize" | "SerialName" | "KSerializer" | "PrimitiveKind" | "SerialDescriptor" | "SerializerProvider" | "set" | "short" | "signed" | "SimpleModule" | "sizeof" | "stackalloc" | "Standards" | "static" | "static_assert" | "static_cast" | "StdDeserializer" | "StdSerializer" | "strictfp" | "string" | "struct" | "subscript" | "super" | "switch" | "symbol" | "synchronized" | "system" | "template" | "then" | "this" | "thread_local" | "throw" | "throws" | "TimeOnly" | "TimeOnlyConverter" | "TimeZone" | "to_json" | "top_level" | "toString" | "to_dict" | "transient" | "True" | "true" | "try" | "Type" | "type" | "typealias" | "typedef" | "typeid" | "typename" | "typeof" | "uint" | "ulong" | "unchecked" | "undefined" | "union" | "UnmarshalJSON" | "UseSerializers" | "unowned" | "unsafe" | "unsigned" | "ushort" | "using" | "Utf8JsonReader" | "Utf8JsonWriter" | "UUID" | "var" | "virtual" | "void" | "volatile" | "wchar_t" | "weak" | "where" | "while" | "willSet" | "with" | "xor" | "xor_eq" | "YES" | "yield" | "dummy"; | |
| 16 | 16 | |
| 17 | 17 | // Converts JSON strings to/from your types |
| 18 | 18 | // and asserts the results of JSON.parse at runtime |
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
| @@ -326,6 +326,7 @@ const typeMap: any = { | ||
| 326 | 326 | "FormatException", |
| 327 | 327 | "friend", |
| 328 | 328 | "from", |
| 329 | + "from_dict", | |
| 329 | 330 | "from_json", |
| 330 | 331 | "func", |
| 331 | 332 | "function", |
| @@ -385,6 +386,7 @@ const typeMap: any = { | ||
| 385 | 386 | "lock", |
| 386 | 387 | "long", |
| 387 | 388 | "map", |
| 389 | + "MarshalJSON", | |
| 388 | 390 | "MapEntry", |
| 389 | 391 | "metadata_property_handling", |
| 390 | 392 | "module", |
| @@ -504,6 +506,7 @@ const typeMap: any = { | ||
| 504 | 506 | "to_json", |
| 505 | 507 | "top_level", |
| 506 | 508 | "toString", |
| 509 | + "to_dict", | |
| 507 | 510 | "transient", |
| 508 | 511 | "True", |
| 509 | 512 | "true", |
| @@ -520,6 +523,7 @@ const typeMap: any = { | ||
| 520 | 523 | "unchecked", |
| 521 | 524 | "undefined", |
| 522 | 525 | "union", |
| 526 | + "UnmarshalJSON", | |
| 523 | 527 | "UseSerializers", |
| 524 | 528 | "unowned", |
| 525 | 529 | "unsafe", |
Test case
55 generated files · +4,943 −231test/inputs/schema/keyword-unions.schema
Mschema-cjsondefault / TopLevel.c+416 −0
| @@ -3173,6 +3173,50 @@ void cJSON_DeleteUnionFrom(struct UnionFrom * x) { | ||
| 3173 | 3173 | } |
| 3174 | 3174 | } |
| 3175 | 3175 | |
| 3176 | +struct UnionFromDict * cJSON_GetUnionFromDictValue(const cJSON * j) { | |
| 3177 | + struct UnionFromDict * x = cJSON_malloc(sizeof(struct UnionFromDict)); | |
| 3178 | + if (NULL != x) { | |
| 3179 | + memset(x, 0, sizeof(struct UnionFromDict)); | |
| 3180 | + if (cJSON_IsNumber(j)) { | |
| 3181 | + x->type = cJSON_Number; | |
| 3182 | + x->value.number = cJSON_GetNumberValue(j); | |
| 3183 | + } | |
| 3184 | + else if (cJSON_IsObject(j)) { | |
| 3185 | + x->type = cJSON_Object; | |
| 3186 | + x->value.from_dict = cJSON_GetFromDictValue(j); | |
| 3187 | + if (NULL == x->value.from_dict) x->type = 0; | |
| 3188 | + } | |
| 3189 | + if (0 == x->type) { cJSON_free(x); return NULL; } | |
| 3190 | + } | |
| 3191 | + return x; | |
| 3192 | +} | |
| 3193 | +struct UnionFromDict * cJSON_ParseUnionFromDict(const char * s) { cJSON * j = cJSON_Parse(s); struct UnionFromDict * x = j ? cJSON_GetUnionFromDictValue(j) : NULL; cJSON_Delete(j); return x; } | |
| 3194 | +char * cJSON_PrintUnionFromDict(const struct UnionFromDict * x) { cJSON * j = cJSON_CreateUnionFromDict(x); char * s = j ? cJSON_Print(j) : NULL; cJSON_Delete(j); return s; } | |
| 3195 | + | |
| 3196 | +cJSON * cJSON_CreateUnionFromDict(const struct UnionFromDict * x) { | |
| 3197 | + cJSON * j = NULL; | |
| 3198 | + if (NULL != x) { | |
| 3199 | + if (cJSON_Number == x->type) { | |
| 3200 | + j = cJSON_CreateNumber(x->value.number); | |
| 3201 | + } | |
| 3202 | + else if (cJSON_Object == x->type) { | |
| 3203 | + j = cJSON_CreateFromDict(x->value.from_dict); | |
| 3204 | + } | |
| 3205 | + } | |
| 3206 | + return j; | |
| 3207 | +} | |
| 3208 | + | |
| 3209 | +void cJSON_DeleteUnionFromDict(struct UnionFromDict * x) { | |
| 3210 | + if (NULL != x) { | |
| 3211 | + if (cJSON_Number == x->type) { | |
| 3212 | + } | |
| 3213 | + else if (cJSON_Object == x->type) { | |
| 3214 | + cJSON_DeleteFromDict(x->value.from_dict); | |
| 3215 | + } | |
| 3216 | + cJSON_free(x); | |
| 3217 | + } | |
| 3218 | +} | |
| 3219 | + | |
| 3176 | 3220 | struct UnionFromJson * cJSON_GetUnionFromJsonValue(const cJSON * j) { |
| 3177 | 3221 | struct UnionFromJson * x = cJSON_malloc(sizeof(struct UnionFromJson)); |
| 3178 | 3222 | if (NULL != x) { |
| @@ -5637,6 +5681,50 @@ void cJSON_DeleteUnionMapEntry(struct UnionMapEntry * x) { | ||
| 5637 | 5681 | } |
| 5638 | 5682 | } |
| 5639 | 5683 | |
| 5684 | +struct UnionMarshalJson * cJSON_GetUnionMarshalJsonValue(const cJSON * j) { | |
| 5685 | + struct UnionMarshalJson * x = cJSON_malloc(sizeof(struct UnionMarshalJson)); | |
| 5686 | + if (NULL != x) { | |
| 5687 | + memset(x, 0, sizeof(struct UnionMarshalJson)); | |
| 5688 | + if (cJSON_IsNumber(j)) { | |
| 5689 | + x->type = cJSON_Number; | |
| 5690 | + x->value.number = cJSON_GetNumberValue(j); | |
| 5691 | + } | |
| 5692 | + else if (cJSON_IsObject(j)) { | |
| 5693 | + x->type = cJSON_Object; | |
| 5694 | + x->value.marshal_json = cJSON_GetMarshalJsonValue(j); | |
| 5695 | + if (NULL == x->value.marshal_json) x->type = 0; | |
| 5696 | + } | |
| 5697 | + if (0 == x->type) { cJSON_free(x); return NULL; } | |
| 5698 | + } | |
| 5699 | + return x; | |
| 5700 | +} | |
| 5701 | +struct UnionMarshalJson * cJSON_ParseUnionMarshalJson(const char * s) { cJSON * j = cJSON_Parse(s); struct UnionMarshalJson * x = j ? cJSON_GetUnionMarshalJsonValue(j) : NULL; cJSON_Delete(j); return x; } | |
| 5702 | +char * cJSON_PrintUnionMarshalJson(const struct UnionMarshalJson * x) { cJSON * j = cJSON_CreateUnionMarshalJson(x); char * s = j ? cJSON_Print(j) : NULL; cJSON_Delete(j); return s; } | |
| 5703 | + | |
| 5704 | +cJSON * cJSON_CreateUnionMarshalJson(const struct UnionMarshalJson * x) { | |
| 5705 | + cJSON * j = NULL; | |
| 5706 | + if (NULL != x) { | |
| 5707 | + if (cJSON_Number == x->type) { | |
| 5708 | + j = cJSON_CreateNumber(x->value.number); | |
| 5709 | + } | |
| 5710 | + else if (cJSON_Object == x->type) { | |
| 5711 | + j = cJSON_CreateMarshalJson(x->value.marshal_json); | |
| 5712 | + } | |
| 5713 | + } | |
| 5714 | + return j; | |
| 5715 | +} | |
| 5716 | + | |
| 5717 | +void cJSON_DeleteUnionMarshalJson(struct UnionMarshalJson * x) { | |
| 5718 | + if (NULL != x) { | |
| 5719 | + if (cJSON_Number == x->type) { | |
| 5720 | + } | |
| 5721 | + else if (cJSON_Object == x->type) { | |
| 5722 | + cJSON_DeleteMarshalJson(x->value.marshal_json); | |
| 5723 | + } | |
| 5724 | + cJSON_free(x); | |
| 5725 | + } | |
| 5726 | +} | |
| 5727 | + | |
| 5640 | 5728 | struct UnionMetadataPropertyHandling * cJSON_GetUnionMetadataPropertyHandlingValue(const cJSON * j) { |
| 5641 | 5729 | struct UnionMetadataPropertyHandling * x = cJSON_malloc(sizeof(struct UnionMetadataPropertyHandling)); |
| 5642 | 5730 | if (NULL != x) { |
| @@ -9201,6 +9289,50 @@ void cJSON_DeleteUnionTimeZone(struct UnionTimeZone * x) { | ||
| 9201 | 9289 | } |
| 9202 | 9290 | } |
| 9203 | 9291 | |
| 9292 | +struct UnionToDict * cJSON_GetUnionToDictValue(const cJSON * j) { | |
| 9293 | + struct UnionToDict * x = cJSON_malloc(sizeof(struct UnionToDict)); | |
| 9294 | + if (NULL != x) { | |
| 9295 | + memset(x, 0, sizeof(struct UnionToDict)); | |
| 9296 | + if (cJSON_IsNumber(j)) { | |
| 9297 | + x->type = cJSON_Number; | |
| 9298 | + x->value.number = cJSON_GetNumberValue(j); | |
| 9299 | + } | |
| 9300 | + else if (cJSON_IsObject(j)) { | |
| 9301 | + x->type = cJSON_Object; | |
| 9302 | + x->value.to_dict = cJSON_GetToDictValue(j); | |
| 9303 | + if (NULL == x->value.to_dict) x->type = 0; | |
| 9304 | + } | |
| 9305 | + if (0 == x->type) { cJSON_free(x); return NULL; } | |
| 9306 | + } | |
| 9307 | + return x; | |
| 9308 | +} | |
| 9309 | +struct UnionToDict * cJSON_ParseUnionToDict(const char * s) { cJSON * j = cJSON_Parse(s); struct UnionToDict * x = j ? cJSON_GetUnionToDictValue(j) : NULL; cJSON_Delete(j); return x; } | |
| 9310 | +char * cJSON_PrintUnionToDict(const struct UnionToDict * x) { cJSON * j = cJSON_CreateUnionToDict(x); char * s = j ? cJSON_Print(j) : NULL; cJSON_Delete(j); return s; } | |
| 9311 | + | |
| 9312 | +cJSON * cJSON_CreateUnionToDict(const struct UnionToDict * x) { | |
| 9313 | + cJSON * j = NULL; | |
| 9314 | + if (NULL != x) { | |
| 9315 | + if (cJSON_Number == x->type) { | |
| 9316 | + j = cJSON_CreateNumber(x->value.number); | |
| 9317 | + } | |
| 9318 | + else if (cJSON_Object == x->type) { | |
| 9319 | + j = cJSON_CreateToDict(x->value.to_dict); | |
| 9320 | + } | |
| 9321 | + } | |
| 9322 | + return j; | |
| 9323 | +} | |
| 9324 | + | |
| 9325 | +void cJSON_DeleteUnionToDict(struct UnionToDict * x) { | |
| 9326 | + if (NULL != x) { | |
| 9327 | + if (cJSON_Number == x->type) { | |
| 9328 | + } | |
| 9329 | + else if (cJSON_Object == x->type) { | |
| 9330 | + cJSON_DeleteToDict(x->value.to_dict); | |
| 9331 | + } | |
| 9332 | + cJSON_free(x); | |
| 9333 | + } | |
| 9334 | +} | |
| 9335 | + | |
| 9204 | 9336 | struct UnionToJson * cJSON_GetUnionToJsonValue(const cJSON * j) { |
| 9205 | 9337 | struct UnionToJson * x = cJSON_malloc(sizeof(struct UnionToJson)); |
| 9206 | 9338 | if (NULL != x) { |
| @@ -14261,6 +14393,50 @@ void cJSON_DeleteUnionUndefined(struct UnionUndefined * x) { | ||
| 14261 | 14393 | } |
| 14262 | 14394 | } |
| 14263 | 14395 | |
| 14396 | +struct UnionUnmarshalJson * cJSON_GetUnionUnmarshalJsonValue(const cJSON * j) { | |
| 14397 | + struct UnionUnmarshalJson * x = cJSON_malloc(sizeof(struct UnionUnmarshalJson)); | |
| 14398 | + if (NULL != x) { | |
| 14399 | + memset(x, 0, sizeof(struct UnionUnmarshalJson)); | |
| 14400 | + if (cJSON_IsNumber(j)) { | |
| 14401 | + x->type = cJSON_Number; | |
| 14402 | + x->value.number = cJSON_GetNumberValue(j); | |
| 14403 | + } | |
| 14404 | + else if (cJSON_IsObject(j)) { | |
| 14405 | + x->type = cJSON_Object; | |
| 14406 | + x->value.unmarshal_json = cJSON_GetUnmarshalJsonValue(j); | |
| 14407 | + if (NULL == x->value.unmarshal_json) x->type = 0; | |
| 14408 | + } | |
| 14409 | + if (0 == x->type) { cJSON_free(x); return NULL; } | |
| 14410 | + } | |
| 14411 | + return x; | |
| 14412 | +} | |
| 14413 | +struct UnionUnmarshalJson * cJSON_ParseUnionUnmarshalJson(const char * s) { cJSON * j = cJSON_Parse(s); struct UnionUnmarshalJson * x = j ? cJSON_GetUnionUnmarshalJsonValue(j) : NULL; cJSON_Delete(j); return x; } | |
| 14414 | +char * cJSON_PrintUnionUnmarshalJson(const struct UnionUnmarshalJson * x) { cJSON * j = cJSON_CreateUnionUnmarshalJson(x); char * s = j ? cJSON_Print(j) : NULL; cJSON_Delete(j); return s; } | |
| 14415 | + | |
| 14416 | +cJSON * cJSON_CreateUnionUnmarshalJson(const struct UnionUnmarshalJson * x) { | |
| 14417 | + cJSON * j = NULL; | |
| 14418 | + if (NULL != x) { | |
| 14419 | + if (cJSON_Number == x->type) { | |
| 14420 | + j = cJSON_CreateNumber(x->value.number); | |
| 14421 | + } | |
| 14422 | + else if (cJSON_Object == x->type) { | |
| 14423 | + j = cJSON_CreateUnmarshalJson(x->value.unmarshal_json); | |
| 14424 | + } | |
| 14425 | + } | |
| 14426 | + return j; | |
| 14427 | +} | |
| 14428 | + | |
| 14429 | +void cJSON_DeleteUnionUnmarshalJson(struct UnionUnmarshalJson * x) { | |
| 14430 | + if (NULL != x) { | |
| 14431 | + if (cJSON_Number == x->type) { | |
| 14432 | + } | |
| 14433 | + else if (cJSON_Object == x->type) { | |
| 14434 | + cJSON_DeleteUnmarshalJson(x->value.unmarshal_json); | |
| 14435 | + } | |
| 14436 | + cJSON_free(x); | |
| 14437 | + } | |
| 14438 | +} | |
| 14439 | + | |
| 14264 | 14440 | struct UnionUnowned * cJSON_GetUnionUnownedValue(const cJSON * j) { |
| 14265 | 14441 | struct UnionUnowned * x = cJSON_malloc(sizeof(struct UnionUnowned)); |
| 14266 | 14442 | if (NULL != x) { |
| @@ -18405,6 +18581,55 @@ void cJSON_DeleteFrom(struct From * x) { | ||
| 18405 | 18581 | } |
| 18406 | 18582 | } |
| 18407 | 18583 | |
| 18584 | +struct FromDict * cJSON_ParseFromDict(const char * s) { | |
| 18585 | + struct FromDict * x = NULL; | |
| 18586 | + if (NULL != s) { | |
| 18587 | + cJSON * j = cJSON_Parse(s); | |
| 18588 | + if (NULL != j) { | |
| 18589 | + x = cJSON_GetFromDictValue(j); | |
| 18590 | + cJSON_Delete(j); | |
| 18591 | + } | |
| 18592 | + } | |
| 18593 | + return x; | |
| 18594 | +} | |
| 18595 | + | |
| 18596 | +struct FromDict * cJSON_GetFromDictValue(const cJSON * j) { | |
| 18597 | + struct FromDict * x = NULL; | |
| 18598 | + if (NULL != j) { | |
| 18599 | + if (NULL != (x = cJSON_malloc(sizeof(struct FromDict)))) { | |
| 18600 | + memset(x, 0, sizeof(struct FromDict)); | |
| 18601 | + } | |
| 18602 | + } | |
| 18603 | + return x; | |
| 18604 | +} | |
| 18605 | + | |
| 18606 | +cJSON * cJSON_CreateFromDict(const struct FromDict * x) { | |
| 18607 | + cJSON * j = NULL; | |
| 18608 | + if (NULL != x) { | |
| 18609 | + if (NULL != (j = cJSON_CreateObject())) { | |
| 18610 | + } | |
| 18611 | + } | |
| 18612 | + return j; | |
| 18613 | +} | |
| 18614 | + | |
| 18615 | +char * cJSON_PrintFromDict(const struct FromDict * x) { | |
| 18616 | + char * s = NULL; | |
| 18617 | + if (NULL != x) { | |
| 18618 | + cJSON * j = cJSON_CreateFromDict(x); | |
| 18619 | + if (NULL != j) { | |
| 18620 | + s = cJSON_Print(j); | |
| 18621 | + cJSON_Delete(j); | |
| 18622 | + } | |
| 18623 | + } | |
| 18624 | + return s; | |
| 18625 | +} | |
| 18626 | + | |
| 18627 | +void cJSON_DeleteFromDict(struct FromDict * x) { | |
| 18628 | + if (NULL != x) { | |
| 18629 | + cJSON_free(x); | |
| 18630 | + } | |
| 18631 | +} | |
| 18632 | + | |
| 18408 | 18633 | struct FromJson * cJSON_ParseFromJson(const char * s) { |
| 18409 | 18634 | struct FromJson * x = NULL; |
| 18410 | 18635 | if (NULL != s) { |
| @@ -21149,6 +21374,55 @@ void cJSON_DeleteMapEntry(struct MapEntry * x) { | ||
| 21149 | 21374 | } |
| 21150 | 21375 | } |
| 21151 | 21376 | |
| 21377 | +struct MarshalJson * cJSON_ParseMarshalJson(const char * s) { | |
| 21378 | + struct MarshalJson * x = NULL; | |
| 21379 | + if (NULL != s) { | |
| 21380 | + cJSON * j = cJSON_Parse(s); | |
| 21381 | + if (NULL != j) { | |
| 21382 | + x = cJSON_GetMarshalJsonValue(j); | |
| 21383 | + cJSON_Delete(j); | |
| 21384 | + } | |
| 21385 | + } | |
| 21386 | + return x; | |
| 21387 | +} | |
| 21388 | + | |
| 21389 | +struct MarshalJson * cJSON_GetMarshalJsonValue(const cJSON * j) { | |
| 21390 | + struct MarshalJson * x = NULL; | |
| 21391 | + if (NULL != j) { | |
| 21392 | + if (NULL != (x = cJSON_malloc(sizeof(struct MarshalJson)))) { | |
| 21393 | + memset(x, 0, sizeof(struct MarshalJson)); | |
| 21394 | + } | |
| 21395 | + } | |
| 21396 | + return x; | |
| 21397 | +} | |
| 21398 | + | |
| 21399 | +cJSON * cJSON_CreateMarshalJson(const struct MarshalJson * x) { | |
| 21400 | + cJSON * j = NULL; | |
| 21401 | + if (NULL != x) { | |
| 21402 | + if (NULL != (j = cJSON_CreateObject())) { | |
| 21403 | + } | |
| 21404 | + } | |
| 21405 | + return j; | |
| 21406 | +} | |
| 21407 | + | |
| 21408 | +char * cJSON_PrintMarshalJson(const struct MarshalJson * x) { | |
| 21409 | + char * s = NULL; | |
| 21410 | + if (NULL != x) { | |
| 21411 | + cJSON * j = cJSON_CreateMarshalJson(x); | |
| 21412 | + if (NULL != j) { | |
| 21413 | + s = cJSON_Print(j); | |
| 21414 | + cJSON_Delete(j); | |
| 21415 | + } | |
| 21416 | + } | |
| 21417 | + return s; | |
| 21418 | +} | |
| 21419 | + | |
| 21420 | +void cJSON_DeleteMarshalJson(struct MarshalJson * x) { | |
| 21421 | + if (NULL != x) { | |
| 21422 | + cJSON_free(x); | |
| 21423 | + } | |
| 21424 | +} | |
| 21425 | + | |
| 21152 | 21426 | struct MetadataPropertyHandling * cJSON_ParseMetadataPropertyHandling(const char * s) { |
| 21153 | 21427 | struct MetadataPropertyHandling * x = NULL; |
| 21154 | 21428 | if (NULL != s) { |
| @@ -25118,6 +25392,55 @@ void cJSON_DeleteTimeZone(struct TimeZone * x) { | ||
| 25118 | 25392 | } |
| 25119 | 25393 | } |
| 25120 | 25394 | |
| 25395 | +struct ToDict * cJSON_ParseToDict(const char * s) { | |
| 25396 | + struct ToDict * x = NULL; | |
| 25397 | + if (NULL != s) { | |
| 25398 | + cJSON * j = cJSON_Parse(s); | |
| 25399 | + if (NULL != j) { | |
| 25400 | + x = cJSON_GetToDictValue(j); | |
| 25401 | + cJSON_Delete(j); | |
| 25402 | + } | |
| 25403 | + } | |
| 25404 | + return x; | |
| 25405 | +} | |
| 25406 | + | |
| 25407 | +struct ToDict * cJSON_GetToDictValue(const cJSON * j) { | |
| 25408 | + struct ToDict * x = NULL; | |
| 25409 | + if (NULL != j) { | |
| 25410 | + if (NULL != (x = cJSON_malloc(sizeof(struct ToDict)))) { | |
| 25411 | + memset(x, 0, sizeof(struct ToDict)); | |
| 25412 | + } | |
| 25413 | + } | |
| 25414 | + return x; | |
| 25415 | +} | |
| 25416 | + | |
| 25417 | +cJSON * cJSON_CreateToDict(const struct ToDict * x) { | |
| 25418 | + cJSON * j = NULL; | |
| 25419 | + if (NULL != x) { | |
| 25420 | + if (NULL != (j = cJSON_CreateObject())) { | |
| 25421 | + } | |
| 25422 | + } | |
| 25423 | + return j; | |
| 25424 | +} | |
| 25425 | + | |
| 25426 | +char * cJSON_PrintToDict(const struct ToDict * x) { | |
| 25427 | + char * s = NULL; | |
| 25428 | + if (NULL != x) { | |
| 25429 | + cJSON * j = cJSON_CreateToDict(x); | |
| 25430 | + if (NULL != j) { | |
| 25431 | + s = cJSON_Print(j); | |
| 25432 | + cJSON_Delete(j); | |
| 25433 | + } | |
| 25434 | + } | |
| 25435 | + return s; | |
| 25436 | +} | |
| 25437 | + | |
| 25438 | +void cJSON_DeleteToDict(struct ToDict * x) { | |
| 25439 | + if (NULL != x) { | |
| 25440 | + cJSON_free(x); | |
| 25441 | + } | |
| 25442 | +} | |
| 25443 | + | |
| 25121 | 25444 | struct ToJson * cJSON_ParseToJson(const char * s) { |
| 25122 | 25445 | struct ToJson * x = NULL; |
| 25123 | 25446 | if (NULL != s) { |
| @@ -30753,6 +31076,55 @@ void cJSON_DeleteUndefined(struct Undefined * x) { | ||
| 30753 | 31076 | } |
| 30754 | 31077 | } |
| 30755 | 31078 | |
| 31079 | +struct UnmarshalJson * cJSON_ParseUnmarshalJson(const char * s) { | |
| 31080 | + struct UnmarshalJson * x = NULL; | |
| 31081 | + if (NULL != s) { | |
| 31082 | + cJSON * j = cJSON_Parse(s); | |
| 31083 | + if (NULL != j) { | |
| 31084 | + x = cJSON_GetUnmarshalJsonValue(j); | |
| 31085 | + cJSON_Delete(j); | |
| 31086 | + } | |
| 31087 | + } | |
| 31088 | + return x; | |
| 31089 | +} | |
| 31090 | + | |
| 31091 | +struct UnmarshalJson * cJSON_GetUnmarshalJsonValue(const cJSON * j) { | |
| 31092 | + struct UnmarshalJson * x = NULL; | |
| 31093 | + if (NULL != j) { | |
| 31094 | + if (NULL != (x = cJSON_malloc(sizeof(struct UnmarshalJson)))) { | |
| 31095 | + memset(x, 0, sizeof(struct UnmarshalJson)); | |
| 31096 | + } | |
| 31097 | + } | |
| 31098 | + return x; | |
| 31099 | +} | |
| 31100 | + | |
| 31101 | +cJSON * cJSON_CreateUnmarshalJson(const struct UnmarshalJson * x) { | |
| 31102 | + cJSON * j = NULL; | |
| 31103 | + if (NULL != x) { | |
| 31104 | + if (NULL != (j = cJSON_CreateObject())) { | |
| 31105 | + } | |
| 31106 | + } | |
| 31107 | + return j; | |
| 31108 | +} | |
| 31109 | + | |
| 31110 | +char * cJSON_PrintUnmarshalJson(const struct UnmarshalJson * x) { | |
| 31111 | + char * s = NULL; | |
| 31112 | + if (NULL != x) { | |
| 31113 | + cJSON * j = cJSON_CreateUnmarshalJson(x); | |
| 31114 | + if (NULL != j) { | |
| 31115 | + s = cJSON_Print(j); | |
| 31116 | + cJSON_Delete(j); | |
| 31117 | + } | |
| 31118 | + } | |
| 31119 | + return s; | |
| 31120 | +} | |
| 31121 | + | |
| 31122 | +void cJSON_DeleteUnmarshalJson(struct UnmarshalJson * x) { | |
| 31123 | + if (NULL != x) { | |
| 31124 | + cJSON_free(x); | |
| 31125 | + } | |
| 31126 | +} | |
| 31127 | + | |
| 30756 | 31128 | struct Unowned * cJSON_ParseUnowned(const char * s) { |
| 30757 | 31129 | struct Unowned * x = NULL; |
| 30758 | 31130 | if (NULL != s) { |
| @@ -32067,6 +32439,11 @@ struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) { | ||
| 32067 | 32439 | x->from = cJSON_GetUnionFromValue(cJSON_GetObjectItemCaseSensitive(j, "from")); |
| 32068 | 32440 | if (NULL == x->from) { cJSON_DeleteTopLevel(x); return NULL; } |
| 32069 | 32441 | } |
| 32442 | + if (cJSON_HasObjectItem(j, "from_dict")) { | |
| 32443 | + if (!cJSON_IsUnionFromDict(cJSON_GetObjectItemCaseSensitive(j, "from_dict"))) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 32444 | + x->from_dict = cJSON_GetUnionFromDictValue(cJSON_GetObjectItemCaseSensitive(j, "from_dict")); | |
| 32445 | + if (NULL == x->from_dict) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 32446 | + } | |
| 32070 | 32447 | if (cJSON_HasObjectItem(j, "from_json")) { |
| 32071 | 32448 | if (!cJSON_IsUnionFromJson(cJSON_GetObjectItemCaseSensitive(j, "from_json"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 32072 | 32449 | x->from_json = cJSON_GetUnionFromJsonValue(cJSON_GetObjectItemCaseSensitive(j, "from_json")); |
| @@ -32372,6 +32749,11 @@ struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) { | ||
| 32372 | 32749 | x->map_entry = cJSON_GetUnionMapEntryValue(cJSON_GetObjectItemCaseSensitive(j, "MapEntry")); |
| 32373 | 32750 | if (NULL == x->map_entry) { cJSON_DeleteTopLevel(x); return NULL; } |
| 32374 | 32751 | } |
| 32752 | + if (cJSON_HasObjectItem(j, "MarshalJSON")) { | |
| 32753 | + if (!cJSON_IsUnionMarshalJson(cJSON_GetObjectItemCaseSensitive(j, "MarshalJSON"))) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 32754 | + x->marshal_json = cJSON_GetUnionMarshalJsonValue(cJSON_GetObjectItemCaseSensitive(j, "MarshalJSON")); | |
| 32755 | + if (NULL == x->marshal_json) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 32756 | + } | |
| 32375 | 32757 | if (cJSON_HasObjectItem(j, "metadata_property_handling")) { |
| 32376 | 32758 | if (!cJSON_IsUnionMetadataPropertyHandling(cJSON_GetObjectItemCaseSensitive(j, "metadata_property_handling"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 32377 | 32759 | x->metadata_property_handling = cJSON_GetUnionMetadataPropertyHandlingValue(cJSON_GetObjectItemCaseSensitive(j, "metadata_property_handling")); |
| @@ -32942,6 +33324,11 @@ struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) { | ||
| 32942 | 33324 | x->time_zone = cJSON_GetUnionTimeZoneValue(cJSON_GetObjectItemCaseSensitive(j, "TimeZone")); |
| 32943 | 33325 | if (NULL == x->time_zone) { cJSON_DeleteTopLevel(x); return NULL; } |
| 32944 | 33326 | } |
| 33327 | + if (cJSON_HasObjectItem(j, "to_dict")) { | |
| 33328 | + if (!cJSON_IsUnionToDict(cJSON_GetObjectItemCaseSensitive(j, "to_dict"))) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 33329 | + x->to_dict = cJSON_GetUnionToDictValue(cJSON_GetObjectItemCaseSensitive(j, "to_dict")); | |
| 33330 | + if (NULL == x->to_dict) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 33331 | + } | |
| 32945 | 33332 | if (cJSON_HasObjectItem(j, "to_json")) { |
| 32946 | 33333 | if (!cJSON_IsUnionToJson(cJSON_GetObjectItemCaseSensitive(j, "to_json"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 32947 | 33334 | x->to_json = cJSON_GetUnionToJsonValue(cJSON_GetObjectItemCaseSensitive(j, "to_json")); |
| @@ -33037,6 +33424,11 @@ struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) { | ||
| 33037 | 33424 | x->top_level_union = cJSON_GetUnionUnionUnionValue(cJSON_GetObjectItemCaseSensitive(j, "union")); |
| 33038 | 33425 | if (NULL == x->top_level_union) { cJSON_DeleteTopLevel(x); return NULL; } |
| 33039 | 33426 | } |
| 33427 | + if (cJSON_HasObjectItem(j, "UnmarshalJSON")) { | |
| 33428 | + if (!cJSON_IsUnionUnmarshalJson(cJSON_GetObjectItemCaseSensitive(j, "UnmarshalJSON"))) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 33429 | + x->unmarshal_json = cJSON_GetUnionUnmarshalJsonValue(cJSON_GetObjectItemCaseSensitive(j, "UnmarshalJSON")); | |
| 33430 | + if (NULL == x->unmarshal_json) { cJSON_DeleteTopLevel(x); return NULL; } | |
| 33431 | + } | |
| 33040 | 33432 | if (cJSON_HasObjectItem(j, "unowned")) { |
| 33041 | 33433 | if (!cJSON_IsUnionUnowned(cJSON_GetObjectItemCaseSensitive(j, "unowned"))) { cJSON_DeleteTopLevel(x); return NULL; } |
| 33042 | 33434 | x->unowned = cJSON_GetUnionUnownedValue(cJSON_GetObjectItemCaseSensitive(j, "unowned")); |
| @@ -33527,6 +33919,9 @@ cJSON * cJSON_CreateTopLevel(const struct TopLevel * x) { | ||
| 33527 | 33919 | if (NULL != x->from) { |
| 33528 | 33920 | cJSON_AddItemToObject(j, "from", cJSON_CreateUnionFrom(x->from)); |
| 33529 | 33921 | } |
| 33922 | + if (NULL != x->from_dict) { | |
| 33923 | + cJSON_AddItemToObject(j, "from_dict", cJSON_CreateUnionFromDict(x->from_dict)); | |
| 33924 | + } | |
| 33530 | 33925 | if (NULL != x->from_json) { |
| 33531 | 33926 | cJSON_AddItemToObject(j, "from_json", cJSON_CreateUnionFromJson(x->from_json)); |
| 33532 | 33927 | } |
| @@ -33710,6 +34105,9 @@ cJSON * cJSON_CreateTopLevel(const struct TopLevel * x) { | ||
| 33710 | 34105 | if (NULL != x->map_entry) { |
| 33711 | 34106 | cJSON_AddItemToObject(j, "MapEntry", cJSON_CreateUnionMapEntry(x->map_entry)); |
| 33712 | 34107 | } |
| 34108 | + if (NULL != x->marshal_json) { | |
| 34109 | + cJSON_AddItemToObject(j, "MarshalJSON", cJSON_CreateUnionMarshalJson(x->marshal_json)); | |
| 34110 | + } | |
| 33713 | 34111 | if (NULL != x->metadata_property_handling) { |
| 33714 | 34112 | cJSON_AddItemToObject(j, "metadata_property_handling", cJSON_CreateUnionMetadataPropertyHandling(x->metadata_property_handling)); |
| 33715 | 34113 | } |
| @@ -34052,6 +34450,9 @@ cJSON * cJSON_CreateTopLevel(const struct TopLevel * x) { | ||
| 34052 | 34450 | if (NULL != x->time_zone) { |
| 34053 | 34451 | cJSON_AddItemToObject(j, "TimeZone", cJSON_CreateUnionTimeZone(x->time_zone)); |
| 34054 | 34452 | } |
| 34453 | + if (NULL != x->to_dict) { | |
| 34454 | + cJSON_AddItemToObject(j, "to_dict", cJSON_CreateUnionToDict(x->to_dict)); | |
| 34455 | + } | |
| 34055 | 34456 | if (NULL != x->to_json) { |
| 34056 | 34457 | cJSON_AddItemToObject(j, "to_json", cJSON_CreateUnionToJson(x->to_json)); |
| 34057 | 34458 | } |
| @@ -34109,6 +34510,9 @@ cJSON * cJSON_CreateTopLevel(const struct TopLevel * x) { | ||
| 34109 | 34510 | if (NULL != x->top_level_union) { |
| 34110 | 34511 | cJSON_AddItemToObject(j, "union", cJSON_CreateUnionUnionUnion(x->top_level_union)); |
| 34111 | 34512 | } |
| 34513 | + if (NULL != x->unmarshal_json) { | |
| 34514 | + cJSON_AddItemToObject(j, "UnmarshalJSON", cJSON_CreateUnionUnmarshalJson(x->unmarshal_json)); | |
| 34515 | + } | |
| 34112 | 34516 | if (NULL != x->unowned) { |
| 34113 | 34517 | cJSON_AddItemToObject(j, "unowned", cJSON_CreateUnionUnowned(x->unowned)); |
| 34114 | 34518 | } |
| @@ -34563,6 +34967,9 @@ void cJSON_DeleteTopLevel(struct TopLevel * x) { | ||
| 34563 | 34967 | if (NULL != x->from) { |
| 34564 | 34968 | cJSON_DeleteUnionFrom(x->from); |
| 34565 | 34969 | } |
| 34970 | + if (NULL != x->from_dict) { | |
| 34971 | + cJSON_DeleteUnionFromDict(x->from_dict); | |
| 34972 | + } | |
| 34566 | 34973 | if (NULL != x->from_json) { |
| 34567 | 34974 | cJSON_DeleteUnionFromJson(x->from_json); |
| 34568 | 34975 | } |
| @@ -34746,6 +35153,9 @@ void cJSON_DeleteTopLevel(struct TopLevel * x) { | ||
| 34746 | 35153 | if (NULL != x->map_entry) { |
| 34747 | 35154 | cJSON_DeleteUnionMapEntry(x->map_entry); |
| 34748 | 35155 | } |
| 35156 | + if (NULL != x->marshal_json) { | |
| 35157 | + cJSON_DeleteUnionMarshalJson(x->marshal_json); | |
| 35158 | + } | |
| 34749 | 35159 | if (NULL != x->metadata_property_handling) { |
| 34750 | 35160 | cJSON_DeleteUnionMetadataPropertyHandling(x->metadata_property_handling); |
| 34751 | 35161 | } |
| @@ -35088,6 +35498,9 @@ void cJSON_DeleteTopLevel(struct TopLevel * x) { | ||
| 35088 | 35498 | if (NULL != x->time_zone) { |
| 35089 | 35499 | cJSON_DeleteUnionTimeZone(x->time_zone); |
| 35090 | 35500 | } |
| 35501 | + if (NULL != x->to_dict) { | |
| 35502 | + cJSON_DeleteUnionToDict(x->to_dict); | |
| 35503 | + } | |
| 35091 | 35504 | if (NULL != x->to_json) { |
| 35092 | 35505 | cJSON_DeleteUnionToJson(x->to_json); |
| 35093 | 35506 | } |
| @@ -35145,6 +35558,9 @@ void cJSON_DeleteTopLevel(struct TopLevel * x) { | ||
| 35145 | 35558 | if (NULL != x->top_level_union) { |
| 35146 | 35559 | cJSON_DeleteUnionUnionUnion(x->top_level_union); |
| 35147 | 35560 | } |
| 35561 | + if (NULL != x->unmarshal_json) { | |
| 35562 | + cJSON_DeleteUnionUnmarshalJson(x->unmarshal_json); | |
| 35563 | + } | |
| 35148 | 35564 | if (NULL != x->unowned) { |
| 35149 | 35565 | cJSON_DeleteUnionUnowned(x->unowned); |
| 35150 | 35566 | } |
Mschema-cjsondefault / TopLevel.h+100 −0
| @@ -840,6 +840,17 @@ struct UnionFrom { | ||
| 840 | 840 | } value; |
| 841 | 841 | }; |
| 842 | 842 | |
| 843 | +struct FromDict { | |
| 844 | +}; | |
| 845 | + | |
| 846 | +struct UnionFromDict { | |
| 847 | + int type; | |
| 848 | + union { | |
| 849 | + double number; | |
| 850 | + struct FromDict * from_dict; | |
| 851 | + } value; | |
| 852 | +}; | |
| 853 | + | |
| 843 | 854 | struct FromJson { |
| 844 | 855 | }; |
| 845 | 856 | |
| @@ -1456,6 +1467,17 @@ struct UnionMapEntry { | ||
| 1456 | 1467 | } value; |
| 1457 | 1468 | }; |
| 1458 | 1469 | |
| 1470 | +struct MarshalJson { | |
| 1471 | +}; | |
| 1472 | + | |
| 1473 | +struct UnionMarshalJson { | |
| 1474 | + int type; | |
| 1475 | + union { | |
| 1476 | + double number; | |
| 1477 | + struct MarshalJson * marshal_json; | |
| 1478 | + } value; | |
| 1479 | +}; | |
| 1480 | + | |
| 1459 | 1481 | struct MetadataPropertyHandling { |
| 1460 | 1482 | }; |
| 1461 | 1483 | |
| @@ -2347,6 +2369,17 @@ struct UnionTimeZone { | ||
| 2347 | 2369 | } value; |
| 2348 | 2370 | }; |
| 2349 | 2371 | |
| 2372 | +struct ToDict { | |
| 2373 | +}; | |
| 2374 | + | |
| 2375 | +struct UnionToDict { | |
| 2376 | + int type; | |
| 2377 | + union { | |
| 2378 | + double number; | |
| 2379 | + struct ToDict * to_dict; | |
| 2380 | + } value; | |
| 2381 | +}; | |
| 2382 | + | |
| 2350 | 2383 | struct ToJson { |
| 2351 | 2384 | }; |
| 2352 | 2385 | |
| @@ -3612,6 +3645,17 @@ struct UnionUndefined { | ||
| 3612 | 3645 | } value; |
| 3613 | 3646 | }; |
| 3614 | 3647 | |
| 3648 | +struct UnmarshalJson { | |
| 3649 | +}; | |
| 3650 | + | |
| 3651 | +struct UnionUnmarshalJson { | |
| 3652 | + int type; | |
| 3653 | + union { | |
| 3654 | + double number; | |
| 3655 | + struct UnmarshalJson * unmarshal_json; | |
| 3656 | + } value; | |
| 3657 | +}; | |
| 3658 | + | |
| 3615 | 3659 | struct Unowned { |
| 3616 | 3660 | }; |
| 3617 | 3661 | |
| @@ -3889,6 +3933,7 @@ struct TopLevel { | ||
| 3889 | 3933 | struct UnionFormatException * format_exception; |
| 3890 | 3934 | struct UnionFriend * top_level_friend; |
| 3891 | 3935 | struct UnionFrom * from; |
| 3936 | + struct UnionFromDict * from_dict; | |
| 3892 | 3937 | struct UnionFromJson * from_json; |
| 3893 | 3938 | struct UnionFunc * func; |
| 3894 | 3939 | struct UnionFunction * function; |
| @@ -3950,6 +3995,7 @@ struct TopLevel { | ||
| 3950 | 3995 | struct UnionLong * top_level_long; |
| 3951 | 3996 | struct UnionMap * map; |
| 3952 | 3997 | struct UnionMapEntry * map_entry; |
| 3998 | + struct UnionMarshalJson * marshal_json; | |
| 3953 | 3999 | struct UnionMetadataPropertyHandling * metadata_property_handling; |
| 3954 | 4000 | struct UnionModule * top_level_module; |
| 3955 | 4001 | struct UnionMutable * top_level_mutable; |
| @@ -4064,6 +4110,7 @@ struct TopLevel { | ||
| 4064 | 4110 | struct UnionTimeOnly * time_only; |
| 4065 | 4111 | struct UnionTimeOnlyConverter * time_only_converter; |
| 4066 | 4112 | struct UnionTimeZone * time_zone; |
| 4113 | + struct UnionToDict * to_dict; | |
| 4067 | 4114 | struct UnionToJson * to_json; |
| 4068 | 4115 | struct UnionTopLevel * top_level; |
| 4069 | 4116 | struct UnionToString * to_string; |
| @@ -4083,6 +4130,7 @@ struct TopLevel { | ||
| 4083 | 4130 | struct UnionUnchecked * unchecked; |
| 4084 | 4131 | struct UnionUndefined * undefined; |
| 4085 | 4132 | struct UnionUnionUnion * top_level_union; |
| 4133 | + struct UnionUnmarshalJson * unmarshal_json; | |
| 4086 | 4134 | struct UnionUnowned * unowned; |
| 4087 | 4135 | struct UnionUnsafe * unsafe; |
| 4088 | 4136 | struct UnionUnsigned * top_level_unsigned; |
| @@ -4612,6 +4660,13 @@ void cJSON_DeleteUnionFrom(struct UnionFrom * x); | ||
| 4612 | 4660 | struct UnionFrom * cJSON_ParseUnionFrom(const char * s); |
| 4613 | 4661 | char * cJSON_PrintUnionFrom(const struct UnionFrom * x); |
| 4614 | 4662 | |
| 4663 | +#define cJSON_IsUnionFromDict(j) (cJSON_IsNumber(j) || cJSON_IsObject(j)) | |
| 4664 | +struct UnionFromDict * cJSON_GetUnionFromDictValue(const cJSON * j); | |
| 4665 | +cJSON * cJSON_CreateUnionFromDict(const struct UnionFromDict * x); | |
| 4666 | +void cJSON_DeleteUnionFromDict(struct UnionFromDict * x); | |
| 4667 | +struct UnionFromDict * cJSON_ParseUnionFromDict(const char * s); | |
| 4668 | +char * cJSON_PrintUnionFromDict(const struct UnionFromDict * x); | |
| 4669 | + | |
| 4615 | 4670 | #define cJSON_IsUnionFromJson(j) (cJSON_IsNumber(j) || cJSON_IsObject(j)) |
| 4616 | 4671 | struct UnionFromJson * cJSON_GetUnionFromJsonValue(const cJSON * j); |
| 4617 | 4672 | cJSON * cJSON_CreateUnionFromJson(const struct UnionFromJson * x); |
| @@ -5004,6 +5059,13 @@ void cJSON_DeleteUnionMapEntry(struct UnionMapEntry * x); | ||
| 5004 | 5059 | struct UnionMapEntry * cJSON_ParseUnionMapEntry(const char * s); |
| 5005 | 5060 | char * cJSON_PrintUnionMapEntry(const struct UnionMapEntry * x); |
| 5006 | 5061 | |
| 5062 | +#define cJSON_IsUnionMarshalJson(j) (cJSON_IsNumber(j) || cJSON_IsObject(j)) | |
| 5063 | +struct UnionMarshalJson * cJSON_GetUnionMarshalJsonValue(const cJSON * j); | |
| 5064 | +cJSON * cJSON_CreateUnionMarshalJson(const struct UnionMarshalJson * x); | |
| 5065 | +void cJSON_DeleteUnionMarshalJson(struct UnionMarshalJson * x); | |
| 5066 | +struct UnionMarshalJson * cJSON_ParseUnionMarshalJson(const char * s); | |
| 5067 | +char * cJSON_PrintUnionMarshalJson(const struct UnionMarshalJson * x); | |
| 5068 | + | |
| 5007 | 5069 | #define cJSON_IsUnionMetadataPropertyHandling(j) (cJSON_IsNumber(j) || cJSON_IsObject(j)) |
| 5008 | 5070 | struct UnionMetadataPropertyHandling * cJSON_GetUnionMetadataPropertyHandlingValue(const cJSON * j); |
| 5009 | 5071 | cJSON * cJSON_CreateUnionMetadataPropertyHandling(const struct UnionMetadataPropertyHandling * x); |
| @@ -5571,6 +5633,13 @@ void cJSON_DeleteUnionTimeZone(struct UnionTimeZone * x); | ||
| 5571 | 5633 | struct UnionTimeZone * cJSON_ParseUnionTimeZone(const char * s); |
| 5572 | 5634 | char * cJSON_PrintUnionTimeZone(const struct UnionTimeZone * x); |
| 5573 | 5635 | |
| 5636 | +#define cJSON_IsUnionToDict(j) (cJSON_IsNumber(j) || cJSON_IsObject(j)) | |
| 5637 | +struct UnionToDict * cJSON_GetUnionToDictValue(const cJSON * j); | |
| 5638 | +cJSON * cJSON_CreateUnionToDict(const struct UnionToDict * x); | |
| 5639 | +void cJSON_DeleteUnionToDict(struct UnionToDict * x); | |
| 5640 | +struct UnionToDict * cJSON_ParseUnionToDict(const char * s); | |
| 5641 | +char * cJSON_PrintUnionToDict(const struct UnionToDict * x); | |
| 5642 | + | |
| 5574 | 5643 | #define cJSON_IsUnionToJson(j) (cJSON_IsNumber(j) || cJSON_IsObject(j)) |
| 5575 | 5644 | struct UnionToJson * cJSON_GetUnionToJsonValue(const cJSON * j); |
| 5576 | 5645 | cJSON * cJSON_CreateUnionToJson(const struct UnionToJson * x); |
| @@ -6376,6 +6445,13 @@ void cJSON_DeleteUnionUndefined(struct UnionUndefined * x); | ||
| 6376 | 6445 | struct UnionUndefined * cJSON_ParseUnionUndefined(const char * s); |
| 6377 | 6446 | char * cJSON_PrintUnionUndefined(const struct UnionUndefined * x); |
| 6378 | 6447 | |
| 6448 | +#define cJSON_IsUnionUnmarshalJson(j) (cJSON_IsNumber(j) || cJSON_IsObject(j)) | |
| 6449 | +struct UnionUnmarshalJson * cJSON_GetUnionUnmarshalJsonValue(const cJSON * j); | |
| 6450 | +cJSON * cJSON_CreateUnionUnmarshalJson(const struct UnionUnmarshalJson * x); | |
| 6451 | +void cJSON_DeleteUnionUnmarshalJson(struct UnionUnmarshalJson * x); | |
| 6452 | +struct UnionUnmarshalJson * cJSON_ParseUnionUnmarshalJson(const char * s); | |
| 6453 | +char * cJSON_PrintUnionUnmarshalJson(const struct UnionUnmarshalJson * x); | |
| 6454 | + | |
| 6379 | 6455 | #define cJSON_IsUnionUnowned(j) (cJSON_IsNumber(j) || cJSON_IsObject(j)) |
| 6380 | 6456 | struct UnionUnowned * cJSON_GetUnionUnownedValue(const cJSON * j); |
| 6381 | 6457 | cJSON * cJSON_CreateUnionUnowned(const struct UnionUnowned * x); |
| @@ -6906,6 +6982,12 @@ cJSON * cJSON_CreateFrom(const struct From * x); | ||
| 6906 | 6982 | char * cJSON_PrintFrom(const struct From * x); |
| 6907 | 6983 | void cJSON_DeleteFrom(struct From * x); |
| 6908 | 6984 | |
| 6985 | +struct FromDict * cJSON_ParseFromDict(const char * s); | |
| 6986 | +struct FromDict * cJSON_GetFromDictValue(const cJSON * j); | |
| 6987 | +cJSON * cJSON_CreateFromDict(const struct FromDict * x); | |
| 6988 | +char * cJSON_PrintFromDict(const struct FromDict * x); | |
| 6989 | +void cJSON_DeleteFromDict(struct FromDict * x); | |
| 6990 | + | |
| 6909 | 6991 | struct FromJson * cJSON_ParseFromJson(const char * s); |
| 6910 | 6992 | struct FromJson * cJSON_GetFromJsonValue(const cJSON * j); |
| 6911 | 6993 | cJSON * cJSON_CreateFromJson(const struct FromJson * x); |
| @@ -7242,6 +7324,12 @@ cJSON * cJSON_CreateMapEntry(const struct MapEntry * x); | ||
| 7242 | 7324 | char * cJSON_PrintMapEntry(const struct MapEntry * x); |
| 7243 | 7325 | void cJSON_DeleteMapEntry(struct MapEntry * x); |
| 7244 | 7326 | |
| 7327 | +struct MarshalJson * cJSON_ParseMarshalJson(const char * s); | |
| 7328 | +struct MarshalJson * cJSON_GetMarshalJsonValue(const cJSON * j); | |
| 7329 | +cJSON * cJSON_CreateMarshalJson(const struct MarshalJson * x); | |
| 7330 | +char * cJSON_PrintMarshalJson(const struct MarshalJson * x); | |
| 7331 | +void cJSON_DeleteMarshalJson(struct MarshalJson * x); | |
| 7332 | + | |
| 7245 | 7333 | struct MetadataPropertyHandling * cJSON_ParseMetadataPropertyHandling(const char * s); |
| 7246 | 7334 | struct MetadataPropertyHandling * cJSON_GetMetadataPropertyHandlingValue(const cJSON * j); |
| 7247 | 7335 | cJSON * cJSON_CreateMetadataPropertyHandling(const struct MetadataPropertyHandling * x); |
| @@ -7728,6 +7816,12 @@ cJSON * cJSON_CreateTimeZone(const struct TimeZone * x); | ||
| 7728 | 7816 | char * cJSON_PrintTimeZone(const struct TimeZone * x); |
| 7729 | 7817 | void cJSON_DeleteTimeZone(struct TimeZone * x); |
| 7730 | 7818 | |
| 7819 | +struct ToDict * cJSON_ParseToDict(const char * s); | |
| 7820 | +struct ToDict * cJSON_GetToDictValue(const cJSON * j); | |
| 7821 | +cJSON * cJSON_CreateToDict(const struct ToDict * x); | |
| 7822 | +char * cJSON_PrintToDict(const struct ToDict * x); | |
| 7823 | +void cJSON_DeleteToDict(struct ToDict * x); | |
| 7824 | + | |
| 7731 | 7825 | struct ToJson * cJSON_ParseToJson(const char * s); |
| 7732 | 7826 | struct ToJson * cJSON_GetToJsonValue(const cJSON * j); |
| 7733 | 7827 | cJSON * cJSON_CreateToJson(const struct ToJson * x); |
| @@ -8418,6 +8512,12 @@ cJSON * cJSON_CreateUndefined(const struct Undefined * x); | ||
| 8418 | 8512 | char * cJSON_PrintUndefined(const struct Undefined * x); |
| 8419 | 8513 | void cJSON_DeleteUndefined(struct Undefined * x); |
| 8420 | 8514 | |
| 8515 | +struct UnmarshalJson * cJSON_ParseUnmarshalJson(const char * s); | |
| 8516 | +struct UnmarshalJson * cJSON_GetUnmarshalJsonValue(const cJSON * j); | |
| 8517 | +cJSON * cJSON_CreateUnmarshalJson(const struct UnmarshalJson * x); | |
| 8518 | +char * cJSON_PrintUnmarshalJson(const struct UnmarshalJson * x); | |
| 8519 | +void cJSON_DeleteUnmarshalJson(struct UnmarshalJson * x); | |
| 8520 | + | |
| 8421 | 8521 | struct Unowned * cJSON_ParseUnowned(const char * s); |
| 8422 | 8522 | struct Unowned * cJSON_GetUnownedValue(const cJSON * j); |
| 8423 | 8523 | cJSON * cJSON_CreateUnowned(const struct Unowned * x); |
Mschema-cplusplusdefault / quicktype.hpp+240 −0
| @@ -953,6 +953,18 @@ namespace quicktype { | ||
| 953 | 953 | |
| 954 | 954 | using UnionFrom = std::variant<From, double>; |
| 955 | 955 | |
| 956 | + class FromDict { | |
| 957 | + public: | |
| 958 | + FromDict() = default; | |
| 959 | + virtual ~FromDict() = default; | |
| 960 | + | |
| 961 | + private: | |
| 962 | + | |
| 963 | + public: | |
| 964 | + }; | |
| 965 | + | |
| 966 | + using UnionFromDict = std::variant<FromDict, double>; | |
| 967 | + | |
| 956 | 968 | class FromJson { |
| 957 | 969 | public: |
| 958 | 970 | FromJson() = default; |
| @@ -1625,6 +1637,18 @@ namespace quicktype { | ||
| 1625 | 1637 | |
| 1626 | 1638 | using UnionMapEntry = std::variant<MapEntry, double>; |
| 1627 | 1639 | |
| 1640 | + class MarshalJson { | |
| 1641 | + public: | |
| 1642 | + MarshalJson() = default; | |
| 1643 | + virtual ~MarshalJson() = default; | |
| 1644 | + | |
| 1645 | + private: | |
| 1646 | + | |
| 1647 | + public: | |
| 1648 | + }; | |
| 1649 | + | |
| 1650 | + using UnionMarshalJson = std::variant<MarshalJson, double>; | |
| 1651 | + | |
| 1628 | 1652 | class MetadataPropertyHandling { |
| 1629 | 1653 | public: |
| 1630 | 1654 | MetadataPropertyHandling() = default; |
| @@ -2609,6 +2633,18 @@ namespace quicktype { | ||
| 2609 | 2633 | |
| 2610 | 2634 | using UnionTimeZone = std::variant<TimeZone, double>; |
| 2611 | 2635 | |
| 2636 | + class ToDict { | |
| 2637 | + public: | |
| 2638 | + ToDict() = default; | |
| 2639 | + virtual ~ToDict() = default; | |
| 2640 | + | |
| 2641 | + private: | |
| 2642 | + | |
| 2643 | + public: | |
| 2644 | + }; | |
| 2645 | + | |
| 2646 | + using UnionToDict = std::variant<ToDict, double>; | |
| 2647 | + | |
| 2612 | 2648 | class ToJson { |
| 2613 | 2649 | public: |
| 2614 | 2650 | ToJson() = default; |
| @@ -3977,6 +4013,18 @@ namespace quicktype { | ||
| 3977 | 4013 | |
| 3978 | 4014 | using UnionUndefined = std::variant<Undefined, double>; |
| 3979 | 4015 | |
| 4016 | + class UnmarshalJson { | |
| 4017 | + public: | |
| 4018 | + UnmarshalJson() = default; | |
| 4019 | + virtual ~UnmarshalJson() = default; | |
| 4020 | + | |
| 4021 | + private: | |
| 4022 | + | |
| 4023 | + public: | |
| 4024 | + }; | |
| 4025 | + | |
| 4026 | + using UnionUnmarshalJson = std::variant<UnmarshalJson, double>; | |
| 4027 | + | |
| 3980 | 4028 | class Unowned { |
| 3981 | 4029 | public: |
| 3982 | 4030 | Unowned() = default; |
| @@ -4273,6 +4321,7 @@ namespace quicktype { | ||
| 4273 | 4321 | std::optional<UnionFormatException> format_exception; |
| 4274 | 4322 | std::optional<UnionFriend> top_level_friend; |
| 4275 | 4323 | std::optional<UnionFrom> from; |
| 4324 | + std::optional<UnionFromDict> from_dict; | |
| 4276 | 4325 | std::optional<UnionFromJson> from_json; |
| 4277 | 4326 | std::optional<UnionFunc> func; |
| 4278 | 4327 | std::optional<UnionFunction> function; |
| @@ -4334,6 +4383,7 @@ namespace quicktype { | ||
| 4334 | 4383 | std::optional<UnionLong> top_level_long; |
| 4335 | 4384 | std::optional<UnionMap> map; |
| 4336 | 4385 | std::optional<UnionMapEntry> map_entry; |
| 4386 | + std::optional<UnionMarshalJson> marshal_json; | |
| 4337 | 4387 | std::optional<UnionMetadataPropertyHandling> metadata_property_handling; |
| 4338 | 4388 | std::optional<UnionModule> top_level_module; |
| 4339 | 4389 | std::optional<UnionMutable> top_level_mutable; |
| @@ -4448,6 +4498,7 @@ namespace quicktype { | ||
| 4448 | 4498 | std::optional<UnionTimeOnly> time_only; |
| 4449 | 4499 | std::optional<UnionTimeOnlyConverter> time_only_converter; |
| 4450 | 4500 | std::optional<UnionTimeZone> time_zone; |
| 4501 | + std::optional<UnionToDict> to_dict; | |
| 4451 | 4502 | std::optional<UnionToJson> to_json; |
| 4452 | 4503 | std::optional<UnionTopLevel> top_level; |
| 4453 | 4504 | std::optional<UnionToString> to_string; |
| @@ -4467,6 +4518,7 @@ namespace quicktype { | ||
| 4467 | 4518 | std::optional<UnionUnchecked> unchecked; |
| 4468 | 4519 | std::optional<UnionUndefined> undefined; |
| 4469 | 4520 | std::optional<UnionUnionUnion> top_level_union; |
| 4521 | + std::optional<UnionUnmarshalJson> unmarshal_json; | |
| 4470 | 4522 | std::optional<UnionUnowned> unowned; |
| 4471 | 4523 | std::optional<UnionUnsafe> unsafe; |
| 4472 | 4524 | std::optional<UnionUnsigned> top_level_unsigned; |
| @@ -4980,6 +5032,10 @@ namespace quicktype { | ||
| 4980 | 5032 | std::optional<UnionFrom> & get_mutable_from() { return from; } |
| 4981 | 5033 | void set_from(const std::optional<UnionFrom> & value) { this->from = value; } |
| 4982 | 5034 | |
| 5035 | + const std::optional<UnionFromDict> & get_from_dict() const { return from_dict; } | |
| 5036 | + std::optional<UnionFromDict> & get_mutable_from_dict() { return from_dict; } | |
| 5037 | + void set_from_dict(const std::optional<UnionFromDict> & value) { this->from_dict = value; } | |
| 5038 | + | |
| 4983 | 5039 | const std::optional<UnionFromJson> & get_from_json() const { return from_json; } |
| 4984 | 5040 | std::optional<UnionFromJson> & get_mutable_from_json() { return from_json; } |
| 4985 | 5041 | void set_from_json(const std::optional<UnionFromJson> & value) { this->from_json = value; } |
| @@ -5224,6 +5280,10 @@ namespace quicktype { | ||
| 5224 | 5280 | std::optional<UnionMapEntry> & get_mutable_map_entry() { return map_entry; } |
| 5225 | 5281 | void set_map_entry(const std::optional<UnionMapEntry> & value) { this->map_entry = value; } |
| 5226 | 5282 | |
| 5283 | + const std::optional<UnionMarshalJson> & get_marshal_json() const { return marshal_json; } | |
| 5284 | + std::optional<UnionMarshalJson> & get_mutable_marshal_json() { return marshal_json; } | |
| 5285 | + void set_marshal_json(const std::optional<UnionMarshalJson> & value) { this->marshal_json = value; } | |
| 5286 | + | |
| 5227 | 5287 | const std::optional<UnionMetadataPropertyHandling> & get_metadata_property_handling() const { return metadata_property_handling; } |
| 5228 | 5288 | std::optional<UnionMetadataPropertyHandling> & get_mutable_metadata_property_handling() { return metadata_property_handling; } |
| 5229 | 5289 | void set_metadata_property_handling(const std::optional<UnionMetadataPropertyHandling> & value) { this->metadata_property_handling = value; } |
| @@ -5680,6 +5740,10 @@ namespace quicktype { | ||
| 5680 | 5740 | std::optional<UnionTimeZone> & get_mutable_time_zone() { return time_zone; } |
| 5681 | 5741 | void set_time_zone(const std::optional<UnionTimeZone> & value) { this->time_zone = value; } |
| 5682 | 5742 | |
| 5743 | + const std::optional<UnionToDict> & get_to_dict() const { return to_dict; } | |
| 5744 | + std::optional<UnionToDict> & get_mutable_to_dict() { return to_dict; } | |
| 5745 | + void set_to_dict(const std::optional<UnionToDict> & value) { this->to_dict = value; } | |
| 5746 | + | |
| 5683 | 5747 | const std::optional<UnionToJson> & get_to_json() const { return to_json; } |
| 5684 | 5748 | std::optional<UnionToJson> & get_mutable_to_json() { return to_json; } |
| 5685 | 5749 | void set_to_json(const std::optional<UnionToJson> & value) { this->to_json = value; } |
| @@ -5756,6 +5820,10 @@ namespace quicktype { | ||
| 5756 | 5820 | std::optional<UnionUnionUnion> & get_mutable_top_level_union() { return top_level_union; } |
| 5757 | 5821 | void set_top_level_union(const std::optional<UnionUnionUnion> & value) { this->top_level_union = value; } |
| 5758 | 5822 | |
| 5823 | + const std::optional<UnionUnmarshalJson> & get_unmarshal_json() const { return unmarshal_json; } | |
| 5824 | + std::optional<UnionUnmarshalJson> & get_mutable_unmarshal_json() { return unmarshal_json; } | |
| 5825 | + void set_unmarshal_json(const std::optional<UnionUnmarshalJson> & value) { this->unmarshal_json = value; } | |
| 5826 | + | |
| 5759 | 5827 | const std::optional<UnionUnowned> & get_unowned() const { return unowned; } |
| 5760 | 5828 | std::optional<UnionUnowned> & get_mutable_unowned() { return unowned; } |
| 5761 | 5829 | void set_unowned(const std::optional<UnionUnowned> & value) { this->unowned = value; } |
| @@ -6067,6 +6135,9 @@ void to_json(json & j, const FormatException & x); | ||
| 6067 | 6135 | void from_json(const json & j, From & x); |
| 6068 | 6136 | void to_json(json & j, const From & x); |
| 6069 | 6137 | |
| 6138 | +void from_json(const json & j, FromDict & x); | |
| 6139 | +void to_json(json & j, const FromDict & x); | |
| 6140 | + | |
| 6070 | 6141 | void from_json(const json & j, FromJson & x); |
| 6071 | 6142 | void to_json(json & j, const FromJson & x); |
| 6072 | 6143 | |
| @@ -6235,6 +6306,9 @@ void to_json(json & j, const Map & x); | ||
| 6235 | 6306 | void from_json(const json & j, MapEntry & x); |
| 6236 | 6307 | void to_json(json & j, const MapEntry & x); |
| 6237 | 6308 | |
| 6309 | +void from_json(const json & j, MarshalJson & x); | |
| 6310 | +void to_json(json & j, const MarshalJson & x); | |
| 6311 | + | |
| 6238 | 6312 | void from_json(const json & j, MetadataPropertyHandling & x); |
| 6239 | 6313 | void to_json(json & j, const MetadataPropertyHandling & x); |
| 6240 | 6314 | |
| @@ -6481,6 +6555,9 @@ void to_json(json & j, const TimeOnlyConverter & x); | ||
| 6481 | 6555 | void from_json(const json & j, TimeZone & x); |
| 6482 | 6556 | void to_json(json & j, const TimeZone & x); |
| 6483 | 6557 | |
| 6558 | +void from_json(const json & j, ToDict & x); | |
| 6559 | +void to_json(json & j, const ToDict & x); | |
| 6560 | + | |
| 6484 | 6561 | void from_json(const json & j, ToJson & x); |
| 6485 | 6562 | void to_json(json & j, const ToJson & x); |
| 6486 | 6563 | |
| @@ -6823,6 +6900,9 @@ void to_json(json & j, const Unchecked & x); | ||
| 6823 | 6900 | void from_json(const json & j, Undefined & x); |
| 6824 | 6901 | void to_json(json & j, const Undefined & x); |
| 6825 | 6902 | |
| 6903 | +void from_json(const json & j, UnmarshalJson & x); | |
| 6904 | +void to_json(json & j, const UnmarshalJson & x); | |
| 6905 | + | |
| 6826 | 6906 | void from_json(const json & j, Unowned & x); |
| 6827 | 6907 | void to_json(json & j, const Unowned & x); |
| 6828 | 6908 | |
| @@ -7301,6 +7381,12 @@ struct adl_serializer<std::variant<quicktype::From, double>> { | ||
| 7301 | 7381 | static void to_json(json & j, const std::variant<quicktype::From, double> & x); |
| 7302 | 7382 | }; |
| 7303 | 7383 | |
| 7384 | +template <> | |
| 7385 | +struct adl_serializer<std::variant<quicktype::FromDict, double>> { | |
| 7386 | + static void from_json(const json & j, std::variant<quicktype::FromDict, double> & x); | |
| 7387 | + static void to_json(json & j, const std::variant<quicktype::FromDict, double> & x); | |
| 7388 | +}; | |
| 7389 | + | |
| 7304 | 7390 | template <> |
| 7305 | 7391 | struct adl_serializer<std::variant<quicktype::FromJson, double>> { |
| 7306 | 7392 | static void from_json(const json & j, std::variant<quicktype::FromJson, double> & x); |
| @@ -7637,6 +7723,12 @@ struct adl_serializer<std::variant<quicktype::MapEntry, double>> { | ||
| 7637 | 7723 | static void to_json(json & j, const std::variant<quicktype::MapEntry, double> & x); |
| 7638 | 7724 | }; |
| 7639 | 7725 | |
| 7726 | +template <> | |
| 7727 | +struct adl_serializer<std::variant<quicktype::MarshalJson, double>> { | |
| 7728 | + static void from_json(const json & j, std::variant<quicktype::MarshalJson, double> & x); | |
| 7729 | + static void to_json(json & j, const std::variant<quicktype::MarshalJson, double> & x); | |
| 7730 | +}; | |
| 7731 | + | |
| 7640 | 7732 | template <> |
| 7641 | 7733 | struct adl_serializer<std::variant<quicktype::MetadataPropertyHandling, double>> { |
| 7642 | 7734 | static void from_json(const json & j, std::variant<quicktype::MetadataPropertyHandling, double> & x); |
| @@ -8129,6 +8221,12 @@ struct adl_serializer<std::variant<quicktype::TimeZone, double>> { | ||
| 8129 | 8221 | static void to_json(json & j, const std::variant<quicktype::TimeZone, double> & x); |
| 8130 | 8222 | }; |
| 8131 | 8223 | |
| 8224 | +template <> | |
| 8225 | +struct adl_serializer<std::variant<quicktype::ToDict, double>> { | |
| 8226 | + static void from_json(const json & j, std::variant<quicktype::ToDict, double> & x); | |
| 8227 | + static void to_json(json & j, const std::variant<quicktype::ToDict, double> & x); | |
| 8228 | +}; | |
| 8229 | + | |
| 8132 | 8230 | template <> |
| 8133 | 8231 | struct adl_serializer<std::variant<quicktype::ToJson, double>> { |
| 8134 | 8232 | static void from_json(const json & j, std::variant<quicktype::ToJson, double> & x); |
| @@ -8813,6 +8911,12 @@ struct adl_serializer<std::variant<quicktype::Undefined, double>> { | ||
| 8813 | 8911 | static void to_json(json & j, const std::variant<quicktype::Undefined, double> & x); |
| 8814 | 8912 | }; |
| 8815 | 8913 | |
| 8914 | +template <> | |
| 8915 | +struct adl_serializer<std::variant<quicktype::UnmarshalJson, double>> { | |
| 8916 | + static void from_json(const json & j, std::variant<quicktype::UnmarshalJson, double> & x); | |
| 8917 | + static void to_json(json & j, const std::variant<quicktype::UnmarshalJson, double> & x); | |
| 8918 | +}; | |
| 8919 | + | |
| 8816 | 8920 | template <> |
| 8817 | 8921 | struct adl_serializer<std::variant<quicktype::Unowned, double>> { |
| 8818 | 8922 | static void from_json(const json & j, std::variant<quicktype::Unowned, double> & x); |
| @@ -9690,6 +9794,17 @@ namespace quicktype { | ||
| 9690 | 9794 | (void)x; |
| 9691 | 9795 | } |
| 9692 | 9796 | |
| 9797 | + inline void from_json(const json & j, FromDict& x) { | |
| 9798 | + if (!j.is_object()) throw std::runtime_error("Expected object"); | |
| 9799 | + (void)j; | |
| 9800 | + (void)x; | |
| 9801 | + } | |
| 9802 | + | |
| 9803 | + inline void to_json(json & j, const FromDict & x) { | |
| 9804 | + j = json::object(); | |
| 9805 | + (void)x; | |
| 9806 | + } | |
| 9807 | + | |
| 9693 | 9808 | inline void from_json(const json & j, FromJson& x) { |
| 9694 | 9809 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9695 | 9810 | (void)j; |
| @@ -10306,6 +10421,17 @@ namespace quicktype { | ||
| 10306 | 10421 | (void)x; |
| 10307 | 10422 | } |
| 10308 | 10423 | |
| 10424 | + inline void from_json(const json & j, MarshalJson& x) { | |
| 10425 | + if (!j.is_object()) throw std::runtime_error("Expected object"); | |
| 10426 | + (void)j; | |
| 10427 | + (void)x; | |
| 10428 | + } | |
| 10429 | + | |
| 10430 | + inline void to_json(json & j, const MarshalJson & x) { | |
| 10431 | + j = json::object(); | |
| 10432 | + (void)x; | |
| 10433 | + } | |
| 10434 | + | |
| 10309 | 10435 | inline void from_json(const json & j, MetadataPropertyHandling& x) { |
| 10310 | 10436 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 10311 | 10437 | (void)j; |
| @@ -11208,6 +11334,17 @@ namespace quicktype { | ||
| 11208 | 11334 | (void)x; |
| 11209 | 11335 | } |
| 11210 | 11336 | |
| 11337 | + inline void from_json(const json & j, ToDict& x) { | |
| 11338 | + if (!j.is_object()) throw std::runtime_error("Expected object"); | |
| 11339 | + (void)j; | |
| 11340 | + (void)x; | |
| 11341 | + } | |
| 11342 | + | |
| 11343 | + inline void to_json(json & j, const ToDict & x) { | |
| 11344 | + j = json::object(); | |
| 11345 | + (void)x; | |
| 11346 | + } | |
| 11347 | + | |
| 11211 | 11348 | inline void from_json(const json & j, ToJson& x) { |
| 11212 | 11349 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 11213 | 11350 | (void)j; |
| @@ -12462,6 +12599,17 @@ namespace quicktype { | ||
| 12462 | 12599 | (void)x; |
| 12463 | 12600 | } |
| 12464 | 12601 | |
| 12602 | + inline void from_json(const json & j, UnmarshalJson& x) { | |
| 12603 | + if (!j.is_object()) throw std::runtime_error("Expected object"); | |
| 12604 | + (void)j; | |
| 12605 | + (void)x; | |
| 12606 | + } | |
| 12607 | + | |
| 12608 | + inline void to_json(json & j, const UnmarshalJson & x) { | |
| 12609 | + j = json::object(); | |
| 12610 | + (void)x; | |
| 12611 | + } | |
| 12612 | + | |
| 12465 | 12613 | inline void from_json(const json & j, Unowned& x) { |
| 12466 | 12614 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 12467 | 12615 | (void)j; |
| @@ -12862,6 +13010,8 @@ namespace quicktype { | ||
| 12862 | 13010 | x.set_top_level_friend(get_stack_optional<std::variant<Friend, double>>(j, "friend")); |
| 12863 | 13011 | if (j.find("from") != j.end() && j.at("from").is_null()) throw std::runtime_error("Unexpected null"); |
| 12864 | 13012 | x.set_from(get_stack_optional<std::variant<From, double>>(j, "from")); |
| 13013 | + if (j.find("from_dict") != j.end() && j.at("from_dict").is_null()) throw std::runtime_error("Unexpected null"); | |
| 13014 | + x.set_from_dict(get_stack_optional<std::variant<FromDict, double>>(j, "from_dict")); | |
| 12865 | 13015 | if (j.find("from_json") != j.end() && j.at("from_json").is_null()) throw std::runtime_error("Unexpected null"); |
| 12866 | 13016 | x.set_from_json(get_stack_optional<std::variant<FromJson, double>>(j, "from_json")); |
| 12867 | 13017 | if (j.find("func") != j.end() && j.at("func").is_null()) throw std::runtime_error("Unexpected null"); |
| @@ -12984,6 +13134,8 @@ namespace quicktype { | ||
| 12984 | 13134 | x.set_map(get_stack_optional<std::variant<Map, double>>(j, "map")); |
| 12985 | 13135 | if (j.find("MapEntry") != j.end() && j.at("MapEntry").is_null()) throw std::runtime_error("Unexpected null"); |
| 12986 | 13136 | x.set_map_entry(get_stack_optional<std::variant<MapEntry, double>>(j, "MapEntry")); |
| 13137 | + if (j.find("MarshalJSON") != j.end() && j.at("MarshalJSON").is_null()) throw std::runtime_error("Unexpected null"); | |
| 13138 | + x.set_marshal_json(get_stack_optional<std::variant<MarshalJson, double>>(j, "MarshalJSON")); | |
| 12987 | 13139 | if (j.find("metadata_property_handling") != j.end() && j.at("metadata_property_handling").is_null()) throw std::runtime_error("Unexpected null"); |
| 12988 | 13140 | x.set_metadata_property_handling(get_stack_optional<std::variant<MetadataPropertyHandling, double>>(j, "metadata_property_handling")); |
| 12989 | 13141 | if (j.find("module") != j.end() && j.at("module").is_null()) throw std::runtime_error("Unexpected null"); |
| @@ -13212,6 +13364,8 @@ namespace quicktype { | ||
| 13212 | 13364 | x.set_time_only_converter(get_stack_optional<std::variant<TimeOnlyConverter, double>>(j, "TimeOnlyConverter")); |
| 13213 | 13365 | if (j.find("TimeZone") != j.end() && j.at("TimeZone").is_null()) throw std::runtime_error("Unexpected null"); |
| 13214 | 13366 | x.set_time_zone(get_stack_optional<std::variant<TimeZone, double>>(j, "TimeZone")); |
| 13367 | + if (j.find("to_dict") != j.end() && j.at("to_dict").is_null()) throw std::runtime_error("Unexpected null"); | |
| 13368 | + x.set_to_dict(get_stack_optional<std::variant<ToDict, double>>(j, "to_dict")); | |
| 13215 | 13369 | if (j.find("to_json") != j.end() && j.at("to_json").is_null()) throw std::runtime_error("Unexpected null"); |
| 13216 | 13370 | x.set_to_json(get_stack_optional<std::variant<ToJson, double>>(j, "to_json")); |
| 13217 | 13371 | if (j.find("top_level") != j.end() && j.at("top_level").is_null()) throw std::runtime_error("Unexpected null"); |
| @@ -13250,6 +13404,8 @@ namespace quicktype { | ||
| 13250 | 13404 | x.set_undefined(get_stack_optional<std::variant<Undefined, double>>(j, "undefined")); |
| 13251 | 13405 | if (j.find("union") != j.end() && j.at("union").is_null()) throw std::runtime_error("Unexpected null"); |
| 13252 | 13406 | x.set_top_level_union(get_stack_optional<std::variant<Union, double>>(j, "union")); |
| 13407 | + if (j.find("UnmarshalJSON") != j.end() && j.at("UnmarshalJSON").is_null()) throw std::runtime_error("Unexpected null"); | |
| 13408 | + x.set_unmarshal_json(get_stack_optional<std::variant<UnmarshalJson, double>>(j, "UnmarshalJSON")); | |
| 13253 | 13409 | if (j.find("unowned") != j.end() && j.at("unowned").is_null()) throw std::runtime_error("Unexpected null"); |
| 13254 | 13410 | x.set_unowned(get_stack_optional<std::variant<Unowned, double>>(j, "unowned")); |
| 13255 | 13411 | if (j.find("unsafe") != j.end() && j.at("unsafe").is_null()) throw std::runtime_error("Unexpected null"); |
| @@ -13422,6 +13578,7 @@ namespace quicktype { | ||
| 13422 | 13578 | j["FormatException"] = x.get_format_exception(); |
| 13423 | 13579 | j["friend"] = x.get_top_level_friend(); |
| 13424 | 13580 | j["from"] = x.get_from(); |
| 13581 | + j["from_dict"] = x.get_from_dict(); | |
| 13425 | 13582 | j["from_json"] = x.get_from_json(); |
| 13426 | 13583 | j["func"] = x.get_func(); |
| 13427 | 13584 | j["function"] = x.get_function(); |
| @@ -13483,6 +13640,7 @@ namespace quicktype { | ||
| 13483 | 13640 | j["long"] = x.get_top_level_long(); |
| 13484 | 13641 | j["map"] = x.get_map(); |
| 13485 | 13642 | j["MapEntry"] = x.get_map_entry(); |
| 13643 | + j["MarshalJSON"] = x.get_marshal_json(); | |
| 13486 | 13644 | j["metadata_property_handling"] = x.get_metadata_property_handling(); |
| 13487 | 13645 | j["module"] = x.get_top_level_module(); |
| 13488 | 13646 | j["mutable"] = x.get_top_level_mutable(); |
| @@ -13597,6 +13755,7 @@ namespace quicktype { | ||
| 13597 | 13755 | j["TimeOnly"] = x.get_time_only(); |
| 13598 | 13756 | j["TimeOnlyConverter"] = x.get_time_only_converter(); |
| 13599 | 13757 | j["TimeZone"] = x.get_time_zone(); |
| 13758 | + j["to_dict"] = x.get_to_dict(); | |
| 13600 | 13759 | j["to_json"] = x.get_to_json(); |
| 13601 | 13760 | j["top_level"] = x.get_top_level(); |
| 13602 | 13761 | j["toString"] = x.get_to_string(); |
| @@ -13616,6 +13775,7 @@ namespace quicktype { | ||
| 13616 | 13775 | j["unchecked"] = x.get_unchecked(); |
| 13617 | 13776 | j["undefined"] = x.get_undefined(); |
| 13618 | 13777 | j["union"] = x.get_top_level_union(); |
| 13778 | + j["UnmarshalJSON"] = x.get_unmarshal_json(); | |
| 13619 | 13779 | j["unowned"] = x.get_unowned(); |
| 13620 | 13780 | j["unsafe"] = x.get_unsafe(); |
| 13621 | 13781 | j["unsigned"] = x.get_top_level_unsigned(); |
| @@ -15082,6 +15242,26 @@ namespace nlohmann { | ||
| 15082 | 15242 | } |
| 15083 | 15243 | } |
| 15084 | 15244 | |
| 15245 | + inline void adl_serializer<std::variant<quicktype::FromDict, double>>::from_json(const json & j, std::variant<quicktype::FromDict, double> & x) { | |
| 15246 | + if (j.is_number()) | |
| 15247 | + x = j.get<double>(); | |
| 15248 | + else if (j.is_object()) | |
| 15249 | + x = j.get<quicktype::FromDict>(); | |
| 15250 | + else throw std::runtime_error("Could not deserialise!"); | |
| 15251 | + } | |
| 15252 | + | |
| 15253 | + inline void adl_serializer<std::variant<quicktype::FromDict, double>>::to_json(json & j, const std::variant<quicktype::FromDict, double> & x) { | |
| 15254 | + switch (x.index()) { | |
| 15255 | + case 0: | |
| 15256 | + j = std::get<quicktype::FromDict>(x); | |
| 15257 | + break; | |
| 15258 | + case 1: | |
| 15259 | + j = std::get<double>(x); | |
| 15260 | + break; | |
| 15261 | + default: throw std::runtime_error("Input JSON does not conform to schema!"); | |
| 15262 | + } | |
| 15263 | + } | |
| 15264 | + | |
| 15085 | 15265 | inline void adl_serializer<std::variant<quicktype::FromJson, double>>::from_json(const json & j, std::variant<quicktype::FromJson, double> & x) { |
| 15086 | 15266 | if (j.is_number()) |
| 15087 | 15267 | x = j.get<double>(); |
| @@ -16202,6 +16382,26 @@ namespace nlohmann { | ||
| 16202 | 16382 | } |
| 16203 | 16383 | } |
| 16204 | 16384 | |
| 16385 | + inline void adl_serializer<std::variant<quicktype::MarshalJson, double>>::from_json(const json & j, std::variant<quicktype::MarshalJson, double> & x) { | |
| 16386 | + if (j.is_number()) | |
| 16387 | + x = j.get<double>(); | |
| 16388 | + else if (j.is_object()) | |
| 16389 | + x = j.get<quicktype::MarshalJson>(); | |
| 16390 | + else throw std::runtime_error("Could not deserialise!"); | |
| 16391 | + } | |
| 16392 | + | |
| 16393 | + inline void adl_serializer<std::variant<quicktype::MarshalJson, double>>::to_json(json & j, const std::variant<quicktype::MarshalJson, double> & x) { | |
| 16394 | + switch (x.index()) { | |
| 16395 | + case 0: | |
| 16396 | + j = std::get<quicktype::MarshalJson>(x); | |
| 16397 | + break; | |
| 16398 | + case 1: | |
| 16399 | + j = std::get<double>(x); | |
| 16400 | + break; | |
| 16401 | + default: throw std::runtime_error("Input JSON does not conform to schema!"); | |
| 16402 | + } | |
| 16403 | + } | |
| 16404 | + | |
| 16205 | 16405 | inline void adl_serializer<std::variant<quicktype::MetadataPropertyHandling, double>>::from_json(const json & j, std::variant<quicktype::MetadataPropertyHandling, double> & x) { |
| 16206 | 16406 | if (j.is_number()) |
| 16207 | 16407 | x = j.get<double>(); |
| @@ -17842,6 +18042,26 @@ namespace nlohmann { | ||
| 17842 | 18042 | } |
| 17843 | 18043 | } |
| 17844 | 18044 | |
| 18045 | + inline void adl_serializer<std::variant<quicktype::ToDict, double>>::from_json(const json & j, std::variant<quicktype::ToDict, double> & x) { | |
| 18046 | + if (j.is_number()) | |
| 18047 | + x = j.get<double>(); | |
| 18048 | + else if (j.is_object()) | |
| 18049 | + x = j.get<quicktype::ToDict>(); | |
| 18050 | + else throw std::runtime_error("Could not deserialise!"); | |
| 18051 | + } | |
| 18052 | + | |
| 18053 | + inline void adl_serializer<std::variant<quicktype::ToDict, double>>::to_json(json & j, const std::variant<quicktype::ToDict, double> & x) { | |
| 18054 | + switch (x.index()) { | |
| 18055 | + case 0: | |
| 18056 | + j = std::get<quicktype::ToDict>(x); | |
| 18057 | + break; | |
| 18058 | + case 1: | |
| 18059 | + j = std::get<double>(x); | |
| 18060 | + break; | |
| 18061 | + default: throw std::runtime_error("Input JSON does not conform to schema!"); | |
| 18062 | + } | |
| 18063 | + } | |
| 18064 | + | |
| 17845 | 18065 | inline void adl_serializer<std::variant<quicktype::ToJson, double>>::from_json(const json & j, std::variant<quicktype::ToJson, double> & x) { |
| 17846 | 18066 | if (j.is_number()) |
| 17847 | 18067 | x = j.get<double>(); |
| @@ -20122,6 +20342,26 @@ namespace nlohmann { | ||
| 20122 | 20342 | } |
| 20123 | 20343 | } |
| 20124 | 20344 | |
| 20345 | + inline void adl_serializer<std::variant<quicktype::UnmarshalJson, double>>::from_json(const json & j, std::variant<quicktype::UnmarshalJson, double> & x) { | |
| 20346 | + if (j.is_number()) | |
| 20347 | + x = j.get<double>(); | |
| 20348 | + else if (j.is_object()) | |
| 20349 | + x = j.get<quicktype::UnmarshalJson>(); | |
| 20350 | + else throw std::runtime_error("Could not deserialise!"); | |
| 20351 | + } | |
| 20352 | + | |
| 20353 | + inline void adl_serializer<std::variant<quicktype::UnmarshalJson, double>>::to_json(json & j, const std::variant<quicktype::UnmarshalJson, double> & x) { | |
| 20354 | + switch (x.index()) { | |
| 20355 | + case 0: | |
| 20356 | + j = std::get<quicktype::UnmarshalJson>(x); | |
| 20357 | + break; | |
| 20358 | + case 1: | |
| 20359 | + j = std::get<double>(x); | |
| 20360 | + break; | |
| 20361 | + default: throw std::runtime_error("Input JSON does not conform to schema!"); | |
| 20362 | + } | |
| 20363 | + } | |
| 20364 | + | |
| 20125 | 20365 | inline void adl_serializer<std::variant<quicktype::Unowned, double>>::from_json(const json & j, std::variant<quicktype::Unowned, double> & x) { |
| 20126 | 20366 | if (j.is_number()) |
| 20127 | 20367 | x = j.get<double>(); |
Mschema-crystaldefault / TopLevel.cr+38 −0
| @@ -287,6 +287,8 @@ class TopLevel | ||
| 287 | 287 | |
| 288 | 288 | property from : UnionFrom? |
| 289 | 289 | |
| 290 | + property from_dict : UnionFromDict? | |
| 291 | + | |
| 290 | 292 | property from_json : UnionFromJson? |
| 291 | 293 | |
| 292 | 294 | property func : UnionFunc? |
| @@ -431,6 +433,9 @@ class TopLevel | ||
| 431 | 433 | @[JSON::Field(key: "MapEntry")] |
| 432 | 434 | property map_entry : UnionMapEntry? |
| 433 | 435 | |
| 436 | + @[JSON::Field(key: "MarshalJSON")] | |
| 437 | + property marshal_json : UnionMarshalJson? | |
| 438 | + | |
| 434 | 439 | property metadata_property_handling : UnionMetadataPropertyHandling? |
| 435 | 440 | |
| 436 | 441 | @[JSON::Field(key: "module")] |
| @@ -703,6 +708,8 @@ class TopLevel | ||
| 703 | 708 | @[JSON::Field(key: "TimeZone")] |
| 704 | 709 | property time_zone : UnionTimeZone? |
| 705 | 710 | |
| 711 | + property to_dict : UnionToDict? | |
| 712 | + | |
| 706 | 713 | @[JSON::Field(key: "to_json")] |
| 707 | 714 | property top_level_to_json : UnionToJson? |
| 708 | 715 | |
| @@ -749,6 +756,9 @@ class TopLevel | ||
| 749 | 756 | @[JSON::Field(key: "union")] |
| 750 | 757 | property top_level_union : UnionUnionUnion? |
| 751 | 758 | |
| 759 | + @[JSON::Field(key: "UnmarshalJSON")] | |
| 760 | + property unmarshal_json : UnionUnmarshalJson? | |
| 761 | + | |
| 752 | 762 | property unowned : UnionUnowned? |
| 753 | 763 | |
| 754 | 764 | property unsafe : UnionUnsafe? |
| @@ -1320,6 +1330,11 @@ class From | ||
| 1320 | 1330 | |
| 1321 | 1331 | end |
| 1322 | 1332 | |
| 1333 | +class FromDict | |
| 1334 | + include JSON::Serializable | |
| 1335 | + | |
| 1336 | +end | |
| 1337 | + | |
| 1323 | 1338 | class FromJson |
| 1324 | 1339 | include JSON::Serializable |
| 1325 | 1340 | |
| @@ -1620,6 +1635,11 @@ class MapEntry | ||
| 1620 | 1635 | |
| 1621 | 1636 | end |
| 1622 | 1637 | |
| 1638 | +class MarshalJson | |
| 1639 | + include JSON::Serializable | |
| 1640 | + | |
| 1641 | +end | |
| 1642 | + | |
| 1623 | 1643 | class MetadataPropertyHandling |
| 1624 | 1644 | include JSON::Serializable |
| 1625 | 1645 | |
| @@ -2130,6 +2150,11 @@ class TimeZone | ||
| 2130 | 2150 | |
| 2131 | 2151 | end |
| 2132 | 2152 | |
| 2153 | +class ToDict | |
| 2154 | + include JSON::Serializable | |
| 2155 | + | |
| 2156 | +end | |
| 2157 | + | |
| 2133 | 2158 | class ToString |
| 2134 | 2159 | include JSON::Serializable |
| 2135 | 2160 | |
| @@ -2395,6 +2420,11 @@ class Undefined | ||
| 2395 | 2420 | |
| 2396 | 2421 | end |
| 2397 | 2422 | |
| 2423 | +class UnmarshalJson | |
| 2424 | + include JSON::Serializable | |
| 2425 | + | |
| 2426 | +end | |
| 2427 | + | |
| 2398 | 2428 | class Unowned |
| 2399 | 2429 | include JSON::Serializable |
| 2400 | 2430 | |
| @@ -2701,6 +2731,8 @@ alias UnionFriend = Float64 | Friend | ||
| 2701 | 2731 | |
| 2702 | 2732 | alias UnionFrom = Float64 | From |
| 2703 | 2733 | |
| 2734 | +alias UnionFromDict = Float64 | FromDict | |
| 2735 | + | |
| 2704 | 2736 | alias UnionFromJson = Float64 | FromJson |
| 2705 | 2737 | |
| 2706 | 2738 | alias UnionFunc = Float64 | Func |
| @@ -2821,6 +2853,8 @@ alias UnionMap = Float64 | Map | ||
| 2821 | 2853 | |
| 2822 | 2854 | alias UnionMapEntry = Float64 | MapEntry |
| 2823 | 2855 | |
| 2856 | +alias UnionMarshalJson = Float64 | MarshalJson | |
| 2857 | + | |
| 2824 | 2858 | alias UnionMetadataPropertyHandling = Float64 | MetadataPropertyHandling |
| 2825 | 2859 | |
| 2826 | 2860 | alias UnionMutable = Float64 | Mutable |
| @@ -3025,6 +3059,8 @@ alias UnionTimeOnlyConverter = Float64 | TimeOnlyConverter | ||
| 3025 | 3059 | |
| 3026 | 3060 | alias UnionTimeZone = Float64 | TimeZone |
| 3027 | 3061 | |
| 3062 | +alias UnionToDict = Float64 | ToDict | |
| 3063 | + | |
| 3028 | 3064 | alias UnionToString = Float64 | ToString |
| 3029 | 3065 | |
| 3030 | 3066 | alias UnionTopLevel = Float64 | TopLevelClass |
| @@ -3131,6 +3167,8 @@ alias UnionUnchecked = Float64 | Unchecked | ||
| 3131 | 3167 | |
| 3132 | 3168 | alias UnionUndefined = Float64 | Undefined |
| 3133 | 3169 | |
| 3170 | +alias UnionUnmarshalJson = Float64 | UnmarshalJson | |
| 3171 | + | |
| 3134 | 3172 | alias UnionUnowned = Float64 | Unowned |
| 3135 | 3173 | |
| 3136 | 3174 | alias UnionUnsafe = Float64 | Unsafe |
Mschema-csharp-recordsdefault / QuickType.cs+220 −0
| @@ -391,6 +391,9 @@ namespace QuickType | ||
| 391 | 391 | [JsonProperty("from", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 392 | 392 | public UnionFrom? From { get; set; } |
| 393 | 393 | |
| 394 | + [JsonProperty("from_dict", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 395 | + public UnionFromDict? FromDict { get; set; } | |
| 396 | + | |
| 394 | 397 | [JsonProperty("from_json", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 395 | 398 | public UnionFromJson? TopLevelFromJson { get; set; } |
| 396 | 399 | |
| @@ -574,6 +577,9 @@ namespace QuickType | ||
| 574 | 577 | [JsonProperty("MapEntry", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 575 | 578 | public UnionMapEntry? MapEntry { get; set; } |
| 576 | 579 | |
| 580 | + [JsonProperty("MarshalJSON", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 581 | + public UnionMarshalJson? MarshalJson { get; set; } | |
| 582 | + | |
| 577 | 583 | [JsonProperty("metadata_property_handling", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 578 | 584 | public UnionMetadataPropertyHandling? MetadataPropertyHandling { get; set; } |
| 579 | 585 | |
| @@ -916,6 +922,9 @@ namespace QuickType | ||
| 916 | 922 | [JsonProperty("TimeZone", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 917 | 923 | public UnionTimeZone? TimeZone { get; set; } |
| 918 | 924 | |
| 925 | + [JsonProperty("to_dict", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 926 | + public UnionToDict? ToDict { get; set; } | |
| 927 | + | |
| 919 | 928 | [JsonProperty("to_json", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 920 | 929 | public UnionToJson? TopLevelToJson { get; set; } |
| 921 | 930 | |
| @@ -973,6 +982,9 @@ namespace QuickType | ||
| 973 | 982 | [JsonProperty("union", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 974 | 983 | public UnionUnionUnion? Union { get; set; } |
| 975 | 984 | |
| 985 | + [JsonProperty("UnmarshalJSON", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 986 | + public UnionUnmarshalJson? UnmarshalJson { get; set; } | |
| 987 | + | |
| 976 | 988 | [JsonProperty("unowned", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 977 | 989 | public UnionUnowned? Unowned { get; set; } |
| 978 | 990 | |
| @@ -1495,6 +1507,10 @@ namespace QuickType | ||
| 1495 | 1507 | { |
| 1496 | 1508 | } |
| 1497 | 1509 | |
| 1510 | + public partial record FromDict | |
| 1511 | + { | |
| 1512 | + } | |
| 1513 | + | |
| 1498 | 1514 | public partial record Func |
| 1499 | 1515 | { |
| 1500 | 1516 | } |
| @@ -1739,6 +1755,10 @@ namespace QuickType | ||
| 1739 | 1755 | { |
| 1740 | 1756 | } |
| 1741 | 1757 | |
| 1758 | + public partial record MarshalJson | |
| 1759 | + { | |
| 1760 | + } | |
| 1761 | + | |
| 1742 | 1762 | public partial record MetadataPropertyHandlingClass |
| 1743 | 1763 | { |
| 1744 | 1764 | } |
| @@ -2175,6 +2195,10 @@ namespace QuickType | ||
| 2175 | 2195 | { |
| 2176 | 2196 | } |
| 2177 | 2197 | |
| 2198 | + public partial record ToDict | |
| 2199 | + { | |
| 2200 | + } | |
| 2201 | + | |
| 2178 | 2202 | public partial record AnyClass |
| 2179 | 2203 | { |
| 2180 | 2204 | } |
| @@ -2303,6 +2327,10 @@ namespace QuickType | ||
| 2303 | 2327 | { |
| 2304 | 2328 | } |
| 2305 | 2329 | |
| 2330 | + public partial record UnmarshalJson | |
| 2331 | + { | |
| 2332 | + } | |
| 2333 | + | |
| 2306 | 2334 | public partial record Unowned |
| 2307 | 2335 | { |
| 2308 | 2336 | } |
| @@ -3412,6 +3440,15 @@ namespace QuickType | ||
| 3412 | 3440 | public static implicit operator UnionFrom(From From) => new UnionFrom { From = From }; |
| 3413 | 3441 | } |
| 3414 | 3442 | |
| 3443 | + public partial struct UnionFromDict | |
| 3444 | + { | |
| 3445 | + public double? Double; | |
| 3446 | + public FromDict? FromDict; | |
| 3447 | + | |
| 3448 | + public static implicit operator UnionFromDict(double Double) => new UnionFromDict { Double = Double }; | |
| 3449 | + public static implicit operator UnionFromDict(FromDict FromDict) => new UnionFromDict { FromDict = FromDict }; | |
| 3450 | + } | |
| 3451 | + | |
| 3415 | 3452 | public partial struct UnionFunc |
| 3416 | 3453 | { |
| 3417 | 3454 | public double? Double; |
| @@ -3961,6 +3998,15 @@ namespace QuickType | ||
| 3961 | 3998 | public static implicit operator UnionMapEntry(MapEntry MapEntry) => new UnionMapEntry { MapEntry = MapEntry }; |
| 3962 | 3999 | } |
| 3963 | 4000 | |
| 4001 | + public partial struct UnionMarshalJson | |
| 4002 | + { | |
| 4003 | + public double? Double; | |
| 4004 | + public MarshalJson? MarshalJson; | |
| 4005 | + | |
| 4006 | + public static implicit operator UnionMarshalJson(double Double) => new UnionMarshalJson { Double = Double }; | |
| 4007 | + public static implicit operator UnionMarshalJson(MarshalJson MarshalJson) => new UnionMarshalJson { MarshalJson = MarshalJson }; | |
| 4008 | + } | |
| 4009 | + | |
| 3964 | 4010 | public partial struct UnionMetadataPropertyHandling |
| 3965 | 4011 | { |
| 3966 | 4012 | public double? Double; |
| @@ -4942,6 +4988,15 @@ namespace QuickType | ||
| 4942 | 4988 | public static implicit operator UnionTimeZone(TimeZone TimeZone) => new UnionTimeZone { TimeZone = TimeZone }; |
| 4943 | 4989 | } |
| 4944 | 4990 | |
| 4991 | + public partial struct UnionToDict | |
| 4992 | + { | |
| 4993 | + public double? Double; | |
| 4994 | + public ToDict? ToDict; | |
| 4995 | + | |
| 4996 | + public static implicit operator UnionToDict(double Double) => new UnionToDict { Double = Double }; | |
| 4997 | + public static implicit operator UnionToDict(ToDict ToDict) => new UnionToDict { ToDict = ToDict }; | |
| 4998 | + } | |
| 4999 | + | |
| 4945 | 5000 | public partial struct UnionAnyUnion |
| 4946 | 5001 | { |
| 4947 | 5002 | public AnyClass? AnyClass; |
| @@ -5230,6 +5285,15 @@ namespace QuickType | ||
| 5230 | 5285 | public static implicit operator UnionUnionUnion(Union Union) => new UnionUnionUnion { Union = Union }; |
| 5231 | 5286 | } |
| 5232 | 5287 | |
| 5288 | + public partial struct UnionUnmarshalJson | |
| 5289 | + { | |
| 5290 | + public double? Double; | |
| 5291 | + public UnmarshalJson? UnmarshalJson; | |
| 5292 | + | |
| 5293 | + public static implicit operator UnionUnmarshalJson(double Double) => new UnionUnmarshalJson { Double = Double }; | |
| 5294 | + public static implicit operator UnionUnmarshalJson(UnmarshalJson UnmarshalJson) => new UnionUnmarshalJson { UnmarshalJson = UnmarshalJson }; | |
| 5295 | + } | |
| 5296 | + | |
| 5233 | 5297 | public partial struct UnionUnowned |
| 5234 | 5298 | { |
| 5235 | 5299 | public double? Double; |
| @@ -5493,6 +5557,7 @@ namespace QuickType | ||
| 5493 | 5557 | UnionKSerializerConverter.Singleton, |
| 5494 | 5558 | UnionLocaleConverter.Singleton, |
| 5495 | 5559 | UnionMapEntryConverter.Singleton, |
| 5560 | + UnionMarshalJsonConverter.Singleton, | |
| 5496 | 5561 | UnionNoConverter.Singleton, |
| 5497 | 5562 | UnionNsErrorConverter.Singleton, |
| 5498 | 5563 | UnionNsObjectConverter.Singleton, |
| @@ -5520,6 +5585,7 @@ namespace QuickType | ||
| 5520 | 5585 | UnionTrueConverter.Singleton, |
| 5521 | 5586 | UnionTypeConverter.Singleton, |
| 5522 | 5587 | UnionUuidConverter.Singleton, |
| 5588 | + UnionUnmarshalJsonConverter.Singleton, | |
| 5523 | 5589 | UnionUseSerializersConverter.Singleton, |
| 5524 | 5590 | UnionUtf8JsonReaderConverter.Singleton, |
| 5525 | 5591 | UnionUtf8JsonWriterConverter.Singleton, |
| @@ -5625,6 +5691,7 @@ namespace QuickType | ||
| 5625 | 5691 | UnionForeachConverter.Singleton, |
| 5626 | 5692 | UnionFriendConverter.Singleton, |
| 5627 | 5693 | UnionFromConverter.Singleton, |
| 5694 | + UnionFromDictConverter.Singleton, | |
| 5628 | 5695 | UnionFromJsonConverter.Singleton, |
| 5629 | 5696 | UnionFuncConverter.Singleton, |
| 5630 | 5697 | UnionFunctionConverter.Singleton, |
| @@ -5759,6 +5826,7 @@ namespace QuickType | ||
| 5759 | 5826 | UnionThrowConverter.Singleton, |
| 5760 | 5827 | UnionThrowsConverter.Singleton, |
| 5761 | 5828 | UnionToStringConverter.Singleton, |
| 5829 | + UnionToDictConverter.Singleton, | |
| 5762 | 5830 | UnionToJsonConverter.Singleton, |
| 5763 | 5831 | UnionTopLevelConverter.Singleton, |
| 5764 | 5832 | UnionTransientConverter.Singleton, |
| @@ -7242,6 +7310,44 @@ namespace QuickType | ||
| 7242 | 7310 | public static readonly UnionMapEntryConverter Singleton = new UnionMapEntryConverter(); |
| 7243 | 7311 | } |
| 7244 | 7312 | |
| 7313 | + internal class UnionMarshalJsonConverter : JsonConverter | |
| 7314 | + { | |
| 7315 | + public override bool CanConvert(Type t) => t == typeof(UnionMarshalJson) || t == typeof(UnionMarshalJson?); | |
| 7316 | + | |
| 7317 | + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) | |
| 7318 | + { | |
| 7319 | + switch (reader.TokenType) | |
| 7320 | + { | |
| 7321 | + case JsonToken.Integer: | |
| 7322 | + case JsonToken.Float: | |
| 7323 | + var doubleValue = serializer.Deserialize<double>(reader); | |
| 7324 | + return new UnionMarshalJson { Double = doubleValue }; | |
| 7325 | + case JsonToken.StartObject: | |
| 7326 | + var objectValue = serializer.Deserialize<MarshalJson>(reader); | |
| 7327 | + return new UnionMarshalJson { MarshalJson = objectValue }; | |
| 7328 | + } | |
| 7329 | + throw new Exception("Cannot unmarshal type UnionMarshalJson"); | |
| 7330 | + } | |
| 7331 | + | |
| 7332 | + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) | |
| 7333 | + { | |
| 7334 | + var value = (UnionMarshalJson)untypedValue; | |
| 7335 | + if (value.Double != null) | |
| 7336 | + { | |
| 7337 | + serializer.Serialize(writer, value.Double.Value); | |
| 7338 | + return; | |
| 7339 | + } | |
| 7340 | + if (value.MarshalJson != null) | |
| 7341 | + { | |
| 7342 | + serializer.Serialize(writer, value.MarshalJson); | |
| 7343 | + return; | |
| 7344 | + } | |
| 7345 | + throw new Exception("Cannot marshal type UnionMarshalJson"); | |
| 7346 | + } | |
| 7347 | + | |
| 7348 | + public static readonly UnionMarshalJsonConverter Singleton = new UnionMarshalJsonConverter(); | |
| 7349 | + } | |
| 7350 | + | |
| 7245 | 7351 | internal class UnionNoConverter : JsonConverter |
| 7246 | 7352 | { |
| 7247 | 7353 | public override bool CanConvert(Type t) => t == typeof(UnionNo) || t == typeof(UnionNo?); |
| @@ -8268,6 +8374,44 @@ namespace QuickType | ||
| 8268 | 8374 | public static readonly UnionUuidConverter Singleton = new UnionUuidConverter(); |
| 8269 | 8375 | } |
| 8270 | 8376 | |
| 8377 | + internal class UnionUnmarshalJsonConverter : JsonConverter | |
| 8378 | + { | |
| 8379 | + public override bool CanConvert(Type t) => t == typeof(UnionUnmarshalJson) || t == typeof(UnionUnmarshalJson?); | |
| 8380 | + | |
| 8381 | + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) | |
| 8382 | + { | |
| 8383 | + switch (reader.TokenType) | |
| 8384 | + { | |
| 8385 | + case JsonToken.Integer: | |
| 8386 | + case JsonToken.Float: | |
| 8387 | + var doubleValue = serializer.Deserialize<double>(reader); | |
| 8388 | + return new UnionUnmarshalJson { Double = doubleValue }; | |
| 8389 | + case JsonToken.StartObject: | |
| 8390 | + var objectValue = serializer.Deserialize<UnmarshalJson>(reader); | |
| 8391 | + return new UnionUnmarshalJson { UnmarshalJson = objectValue }; | |
| 8392 | + } | |
| 8393 | + throw new Exception("Cannot unmarshal type UnionUnmarshalJson"); | |
| 8394 | + } | |
| 8395 | + | |
| 8396 | + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) | |
| 8397 | + { | |
| 8398 | + var value = (UnionUnmarshalJson)untypedValue; | |
| 8399 | + if (value.Double != null) | |
| 8400 | + { | |
| 8401 | + serializer.Serialize(writer, value.Double.Value); | |
| 8402 | + return; | |
| 8403 | + } | |
| 8404 | + if (value.UnmarshalJson != null) | |
| 8405 | + { | |
| 8406 | + serializer.Serialize(writer, value.UnmarshalJson); | |
| 8407 | + return; | |
| 8408 | + } | |
| 8409 | + throw new Exception("Cannot marshal type UnionUnmarshalJson"); | |
| 8410 | + } | |
| 8411 | + | |
| 8412 | + public static readonly UnionUnmarshalJsonConverter Singleton = new UnionUnmarshalJsonConverter(); | |
| 8413 | + } | |
| 8414 | + | |
| 8271 | 8415 | internal class UnionUseSerializersConverter : JsonConverter |
| 8272 | 8416 | { |
| 8273 | 8417 | public override bool CanConvert(Type t) => t == typeof(UnionUseSerializers) || t == typeof(UnionUseSerializers?); |
| @@ -12258,6 +12402,44 @@ namespace QuickType | ||
| 12258 | 12402 | public static readonly UnionFromConverter Singleton = new UnionFromConverter(); |
| 12259 | 12403 | } |
| 12260 | 12404 | |
| 12405 | + internal class UnionFromDictConverter : JsonConverter | |
| 12406 | + { | |
| 12407 | + public override bool CanConvert(Type t) => t == typeof(UnionFromDict) || t == typeof(UnionFromDict?); | |
| 12408 | + | |
| 12409 | + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) | |
| 12410 | + { | |
| 12411 | + switch (reader.TokenType) | |
| 12412 | + { | |
| 12413 | + case JsonToken.Integer: | |
| 12414 | + case JsonToken.Float: | |
| 12415 | + var doubleValue = serializer.Deserialize<double>(reader); | |
| 12416 | + return new UnionFromDict { Double = doubleValue }; | |
| 12417 | + case JsonToken.StartObject: | |
| 12418 | + var objectValue = serializer.Deserialize<FromDict>(reader); | |
| 12419 | + return new UnionFromDict { FromDict = objectValue }; | |
| 12420 | + } | |
| 12421 | + throw new Exception("Cannot unmarshal type UnionFromDict"); | |
| 12422 | + } | |
| 12423 | + | |
| 12424 | + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) | |
| 12425 | + { | |
| 12426 | + var value = (UnionFromDict)untypedValue; | |
| 12427 | + if (value.Double != null) | |
| 12428 | + { | |
| 12429 | + serializer.Serialize(writer, value.Double.Value); | |
| 12430 | + return; | |
| 12431 | + } | |
| 12432 | + if (value.FromDict != null) | |
| 12433 | + { | |
| 12434 | + serializer.Serialize(writer, value.FromDict); | |
| 12435 | + return; | |
| 12436 | + } | |
| 12437 | + throw new Exception("Cannot marshal type UnionFromDict"); | |
| 12438 | + } | |
| 12439 | + | |
| 12440 | + public static readonly UnionFromDictConverter Singleton = new UnionFromDictConverter(); | |
| 12441 | + } | |
| 12442 | + | |
| 12261 | 12443 | internal class UnionFromJsonConverter : JsonConverter |
| 12262 | 12444 | { |
| 12263 | 12445 | public override bool CanConvert(Type t) => t == typeof(UnionFromJson) || t == typeof(UnionFromJson?); |
| @@ -17350,6 +17532,44 @@ namespace QuickType | ||
| 17350 | 17532 | public static readonly UnionToStringConverter Singleton = new UnionToStringConverter(); |
| 17351 | 17533 | } |
| 17352 | 17534 | |
| 17535 | + internal class UnionToDictConverter : JsonConverter | |
| 17536 | + { | |
| 17537 | + public override bool CanConvert(Type t) => t == typeof(UnionToDict) || t == typeof(UnionToDict?); | |
| 17538 | + | |
| 17539 | + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) | |
| 17540 | + { | |
| 17541 | + switch (reader.TokenType) | |
| 17542 | + { | |
| 17543 | + case JsonToken.Integer: | |
| 17544 | + case JsonToken.Float: | |
| 17545 | + var doubleValue = serializer.Deserialize<double>(reader); | |
| 17546 | + return new UnionToDict { Double = doubleValue }; | |
| 17547 | + case JsonToken.StartObject: | |
| 17548 | + var objectValue = serializer.Deserialize<ToDict>(reader); | |
| 17549 | + return new UnionToDict { ToDict = objectValue }; | |
| 17550 | + } | |
| 17551 | + throw new Exception("Cannot unmarshal type UnionToDict"); | |
| 17552 | + } | |
| 17553 | + | |
| 17554 | + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) | |
| 17555 | + { | |
| 17556 | + var value = (UnionToDict)untypedValue; | |
| 17557 | + if (value.Double != null) | |
| 17558 | + { | |
| 17559 | + serializer.Serialize(writer, value.Double.Value); | |
| 17560 | + return; | |
| 17561 | + } | |
| 17562 | + if (value.ToDict != null) | |
| 17563 | + { | |
| 17564 | + serializer.Serialize(writer, value.ToDict); | |
| 17565 | + return; | |
| 17566 | + } | |
| 17567 | + throw new Exception("Cannot marshal type UnionToDict"); | |
| 17568 | + } | |
| 17569 | + | |
| 17570 | + public static readonly UnionToDictConverter Singleton = new UnionToDictConverter(); | |
| 17571 | + } | |
| 17572 | + | |
| 17353 | 17573 | internal class UnionToJsonConverter : JsonConverter |
| 17354 | 17574 | { |
| 17355 | 17575 | public override bool CanConvert(Type t) => t == typeof(UnionToJson) || t == typeof(UnionToJson?); |
Mschema-csharp-SystemTextJsondefault / QuickType.cs+216 −0
| @@ -510,6 +510,10 @@ namespace QuickType | ||
| 510 | 510 | [JsonPropertyName("from")] |
| 511 | 511 | public UnionFrom? From { get; set; } |
| 512 | 512 | |
| 513 | + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 514 | + [JsonPropertyName("from_dict")] | |
| 515 | + public UnionFromDict? FromDict { get; set; } | |
| 516 | + | |
| 513 | 517 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] |
| 514 | 518 | [JsonPropertyName("from_json")] |
| 515 | 519 | public UnionFromJson? TopLevelFromJson { get; set; } |
| @@ -754,6 +758,10 @@ namespace QuickType | ||
| 754 | 758 | [JsonPropertyName("MapEntry")] |
| 755 | 759 | public UnionMapEntry? MapEntry { get; set; } |
| 756 | 760 | |
| 761 | + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 762 | + [JsonPropertyName("MarshalJSON")] | |
| 763 | + public UnionMarshalJson? MarshalJson { get; set; } | |
| 764 | + | |
| 757 | 765 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] |
| 758 | 766 | [JsonPropertyName("metadata_property_handling")] |
| 759 | 767 | public UnionMetadataPropertyHandling? MetadataPropertyHandling { get; set; } |
| @@ -1210,6 +1218,10 @@ namespace QuickType | ||
| 1210 | 1218 | [JsonPropertyName("TimeZone")] |
| 1211 | 1219 | public UnionTimeZone? TimeZone { get; set; } |
| 1212 | 1220 | |
| 1221 | + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 1222 | + [JsonPropertyName("to_dict")] | |
| 1223 | + public UnionToDict? ToDict { get; set; } | |
| 1224 | + | |
| 1213 | 1225 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] |
| 1214 | 1226 | [JsonPropertyName("to_json")] |
| 1215 | 1227 | public UnionToJson? TopLevelToJson { get; set; } |
| @@ -1286,6 +1298,10 @@ namespace QuickType | ||
| 1286 | 1298 | [JsonPropertyName("union")] |
| 1287 | 1299 | public UnionUnionUnion? Union { get; set; } |
| 1288 | 1300 | |
| 1301 | + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |
| 1302 | + [JsonPropertyName("UnmarshalJSON")] | |
| 1303 | + public UnionUnmarshalJson? UnmarshalJson { get; set; } | |
| 1304 | + | |
| 1289 | 1305 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] |
| 1290 | 1306 | [JsonPropertyName("unowned")] |
| 1291 | 1307 | public UnionUnowned? Unowned { get; set; } |
| @@ -1839,6 +1855,10 @@ namespace QuickType | ||
| 1839 | 1855 | { |
| 1840 | 1856 | } |
| 1841 | 1857 | |
| 1858 | + public partial class FromDict | |
| 1859 | + { | |
| 1860 | + } | |
| 1861 | + | |
| 1842 | 1862 | public partial class Func |
| 1843 | 1863 | { |
| 1844 | 1864 | } |
| @@ -2083,6 +2103,10 @@ namespace QuickType | ||
| 2083 | 2103 | { |
| 2084 | 2104 | } |
| 2085 | 2105 | |
| 2106 | + public partial class MarshalJson | |
| 2107 | + { | |
| 2108 | + } | |
| 2109 | + | |
| 2086 | 2110 | public partial class MetadataPropertyHandling |
| 2087 | 2111 | { |
| 2088 | 2112 | } |
| @@ -2523,6 +2547,10 @@ namespace QuickType | ||
| 2523 | 2547 | { |
| 2524 | 2548 | } |
| 2525 | 2549 | |
| 2550 | + public partial class ToDict | |
| 2551 | + { | |
| 2552 | + } | |
| 2553 | + | |
| 2526 | 2554 | public partial class AnyClass |
| 2527 | 2555 | { |
| 2528 | 2556 | } |
| @@ -2639,6 +2667,10 @@ namespace QuickType | ||
| 2639 | 2667 | { |
| 2640 | 2668 | } |
| 2641 | 2669 | |
| 2670 | + public partial class UnmarshalJson | |
| 2671 | + { | |
| 2672 | + } | |
| 2673 | + | |
| 2642 | 2674 | public partial class Unowned |
| 2643 | 2675 | { |
| 2644 | 2676 | } |
| @@ -3766,6 +3798,15 @@ namespace QuickType | ||
| 3766 | 3798 | public static implicit operator UnionFrom(From From) => new UnionFrom { From = From }; |
| 3767 | 3799 | } |
| 3768 | 3800 | |
| 3801 | + public partial struct UnionFromDict | |
| 3802 | + { | |
| 3803 | + public double? Double; | |
| 3804 | + public FromDict? FromDict; | |
| 3805 | + | |
| 3806 | + public static implicit operator UnionFromDict(double Double) => new UnionFromDict { Double = Double }; | |
| 3807 | + public static implicit operator UnionFromDict(FromDict FromDict) => new UnionFromDict { FromDict = FromDict }; | |
| 3808 | + } | |
| 3809 | + | |
| 3769 | 3810 | public partial struct UnionFunc |
| 3770 | 3811 | { |
| 3771 | 3812 | public double? Double; |
| @@ -4315,6 +4356,15 @@ namespace QuickType | ||
| 4315 | 4356 | public static implicit operator UnionMapEntry(MapEntry MapEntry) => new UnionMapEntry { MapEntry = MapEntry }; |
| 4316 | 4357 | } |
| 4317 | 4358 | |
| 4359 | + public partial struct UnionMarshalJson | |
| 4360 | + { | |
| 4361 | + public double? Double; | |
| 4362 | + public MarshalJson? MarshalJson; | |
| 4363 | + | |
| 4364 | + public static implicit operator UnionMarshalJson(double Double) => new UnionMarshalJson { Double = Double }; | |
| 4365 | + public static implicit operator UnionMarshalJson(MarshalJson MarshalJson) => new UnionMarshalJson { MarshalJson = MarshalJson }; | |
| 4366 | + } | |
| 4367 | + | |
| 4318 | 4368 | public partial struct UnionMetadataPropertyHandling |
| 4319 | 4369 | { |
| 4320 | 4370 | public double? Double; |
| @@ -5305,6 +5355,15 @@ namespace QuickType | ||
| 5305 | 5355 | public static implicit operator UnionTimeZone(TimeZone TimeZone) => new UnionTimeZone { TimeZone = TimeZone }; |
| 5306 | 5356 | } |
| 5307 | 5357 | |
| 5358 | + public partial struct UnionToDict | |
| 5359 | + { | |
| 5360 | + public double? Double; | |
| 5361 | + public ToDict? ToDict; | |
| 5362 | + | |
| 5363 | + public static implicit operator UnionToDict(double Double) => new UnionToDict { Double = Double }; | |
| 5364 | + public static implicit operator UnionToDict(ToDict ToDict) => new UnionToDict { ToDict = ToDict }; | |
| 5365 | + } | |
| 5366 | + | |
| 5308 | 5367 | public partial struct UnionAnyUnion |
| 5309 | 5368 | { |
| 5310 | 5369 | public AnyClass? AnyClass; |
| @@ -5566,6 +5625,15 @@ namespace QuickType | ||
| 5566 | 5625 | public static implicit operator UnionUnionUnion(Union Union) => new UnionUnionUnion { Union = Union }; |
| 5567 | 5626 | } |
| 5568 | 5627 | |
| 5628 | + public partial struct UnionUnmarshalJson | |
| 5629 | + { | |
| 5630 | + public double? Double; | |
| 5631 | + public UnmarshalJson? UnmarshalJson; | |
| 5632 | + | |
| 5633 | + public static implicit operator UnionUnmarshalJson(double Double) => new UnionUnmarshalJson { Double = Double }; | |
| 5634 | + public static implicit operator UnionUnmarshalJson(UnmarshalJson UnmarshalJson) => new UnionUnmarshalJson { UnmarshalJson = UnmarshalJson }; | |
| 5635 | + } | |
| 5636 | + | |
| 5569 | 5637 | public partial struct UnionUnowned |
| 5570 | 5638 | { |
| 5571 | 5639 | public double? Double; |
| @@ -5827,6 +5895,7 @@ namespace QuickType | ||
| 5827 | 5895 | UnionKSerializerConverter.Singleton, |
| 5828 | 5896 | UnionLocaleConverter.Singleton, |
| 5829 | 5897 | UnionMapEntryConverter.Singleton, |
| 5898 | + UnionMarshalJsonConverter.Singleton, | |
| 5830 | 5899 | UnionNoConverter.Singleton, |
| 5831 | 5900 | UnionNsErrorConverter.Singleton, |
| 5832 | 5901 | UnionNsObjectConverter.Singleton, |
| @@ -5854,6 +5923,7 @@ namespace QuickType | ||
| 5854 | 5923 | UnionTrueConverter.Singleton, |
| 5855 | 5924 | UnionTypeConverter.Singleton, |
| 5856 | 5925 | UnionUuidConverter.Singleton, |
| 5926 | + UnionUnmarshalJsonConverter.Singleton, | |
| 5857 | 5927 | UnionUseSerializersConverter.Singleton, |
| 5858 | 5928 | UnionUtf8JsonReaderConverter.Singleton, |
| 5859 | 5929 | UnionUtf8JsonWriterConverter.Singleton, |
| @@ -5959,6 +6029,7 @@ namespace QuickType | ||
| 5959 | 6029 | UnionForeachConverter.Singleton, |
| 5960 | 6030 | UnionFriendConverter.Singleton, |
| 5961 | 6031 | UnionFromConverter.Singleton, |
| 6032 | + UnionFromDictConverter.Singleton, | |
| 5962 | 6033 | UnionFromJsonConverter.Singleton, |
| 5963 | 6034 | UnionFuncConverter.Singleton, |
| 5964 | 6035 | UnionFunctionConverter.Singleton, |
| @@ -6093,6 +6164,7 @@ namespace QuickType | ||
| 6093 | 6164 | UnionThrowConverter.Singleton, |
| 6094 | 6165 | UnionThrowsConverter.Singleton, |
| 6095 | 6166 | UnionToStringConverter.Singleton, |
| 6167 | + UnionToDictConverter.Singleton, | |
| 6096 | 6168 | UnionToJsonConverter.Singleton, |
| 6097 | 6169 | UnionTopLevelConverter.Singleton, |
| 6098 | 6170 | UnionTransientConverter.Singleton, |
| @@ -7502,6 +7574,42 @@ namespace QuickType | ||
| 7502 | 7574 | public static readonly UnionMapEntryConverter Singleton = new UnionMapEntryConverter(); |
| 7503 | 7575 | } |
| 7504 | 7576 | |
| 7577 | + internal class UnionMarshalJsonConverter : JsonConverter<UnionMarshalJson> | |
| 7578 | + { | |
| 7579 | + public override bool CanConvert(Type t) => t == typeof(UnionMarshalJson); | |
| 7580 | + | |
| 7581 | + public override UnionMarshalJson Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | |
| 7582 | + { | |
| 7583 | + switch (reader.TokenType) | |
| 7584 | + { | |
| 7585 | + case JsonTokenType.Number: | |
| 7586 | + var doubleValue1 = reader.GetDouble(); | |
| 7587 | + return new UnionMarshalJson { Double = doubleValue1 }; | |
| 7588 | + case JsonTokenType.StartObject: | |
| 7589 | + var objectValue = JsonSerializer.Deserialize<MarshalJson>(ref reader, options); | |
| 7590 | + return new UnionMarshalJson { MarshalJson = objectValue }; | |
| 7591 | + } | |
| 7592 | + throw new JsonException("Cannot unmarshal type UnionMarshalJson"); | |
| 7593 | + } | |
| 7594 | + | |
| 7595 | + public override void Write(Utf8JsonWriter writer, UnionMarshalJson value, JsonSerializerOptions options) | |
| 7596 | + { | |
| 7597 | + if (value.Double != null) | |
| 7598 | + { | |
| 7599 | + JsonSerializer.Serialize(writer, value.Double.Value, options); | |
| 7600 | + return; | |
| 7601 | + } | |
| 7602 | + if (value.MarshalJson != null) | |
| 7603 | + { | |
| 7604 | + JsonSerializer.Serialize(writer, value.MarshalJson, options); | |
| 7605 | + return; | |
| 7606 | + } | |
| 7607 | + throw new NotSupportedException("Cannot marshal type UnionMarshalJson"); | |
| 7608 | + } | |
| 7609 | + | |
| 7610 | + public static readonly UnionMarshalJsonConverter Singleton = new UnionMarshalJsonConverter(); | |
| 7611 | + } | |
| 7612 | + | |
| 7505 | 7613 | internal class UnionNoConverter : JsonConverter<UnionNo> |
| 7506 | 7614 | { |
| 7507 | 7615 | public override bool CanConvert(Type t) => t == typeof(UnionNo); |
| @@ -8474,6 +8582,42 @@ namespace QuickType | ||
| 8474 | 8582 | public static readonly UnionUuidConverter Singleton = new UnionUuidConverter(); |
| 8475 | 8583 | } |
| 8476 | 8584 | |
| 8585 | + internal class UnionUnmarshalJsonConverter : JsonConverter<UnionUnmarshalJson> | |
| 8586 | + { | |
| 8587 | + public override bool CanConvert(Type t) => t == typeof(UnionUnmarshalJson); | |
| 8588 | + | |
| 8589 | + public override UnionUnmarshalJson Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | |
| 8590 | + { | |
| 8591 | + switch (reader.TokenType) | |
| 8592 | + { | |
| 8593 | + case JsonTokenType.Number: | |
| 8594 | + var doubleValue1 = reader.GetDouble(); | |
| 8595 | + return new UnionUnmarshalJson { Double = doubleValue1 }; | |
| 8596 | + case JsonTokenType.StartObject: | |
| 8597 | + var objectValue = JsonSerializer.Deserialize<UnmarshalJson>(ref reader, options); | |
| 8598 | + return new UnionUnmarshalJson { UnmarshalJson = objectValue }; | |
| 8599 | + } | |
| 8600 | + throw new JsonException("Cannot unmarshal type UnionUnmarshalJson"); | |
| 8601 | + } | |
| 8602 | + | |
| 8603 | + public override void Write(Utf8JsonWriter writer, UnionUnmarshalJson value, JsonSerializerOptions options) | |
| 8604 | + { | |
| 8605 | + if (value.Double != null) | |
| 8606 | + { | |
| 8607 | + JsonSerializer.Serialize(writer, value.Double.Value, options); | |
| 8608 | + return; | |
| 8609 | + } | |
| 8610 | + if (value.UnmarshalJson != null) | |
| 8611 | + { | |
| 8612 | + JsonSerializer.Serialize(writer, value.UnmarshalJson, options); | |
| 8613 | + return; | |
| 8614 | + } | |
| 8615 | + throw new NotSupportedException("Cannot marshal type UnionUnmarshalJson"); | |
| 8616 | + } | |
| 8617 | + | |
| 8618 | + public static readonly UnionUnmarshalJsonConverter Singleton = new UnionUnmarshalJsonConverter(); | |
| 8619 | + } | |
| 8620 | + | |
| 8477 | 8621 | internal class UnionUseSerializersConverter : JsonConverter<UnionUseSerializers> |
| 8478 | 8622 | { |
| 8479 | 8623 | public override bool CanConvert(Type t) => t == typeof(UnionUseSerializers); |
| @@ -12254,6 +12398,42 @@ namespace QuickType | ||
| 12254 | 12398 | public static readonly UnionFromConverter Singleton = new UnionFromConverter(); |
| 12255 | 12399 | } |
| 12256 | 12400 | |
| 12401 | + internal class UnionFromDictConverter : JsonConverter<UnionFromDict> | |
| 12402 | + { | |
| 12403 | + public override bool CanConvert(Type t) => t == typeof(UnionFromDict); | |
| 12404 | + | |
| 12405 | + public override UnionFromDict Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | |
| 12406 | + { | |
| 12407 | + switch (reader.TokenType) | |
| 12408 | + { | |
| 12409 | + case JsonTokenType.Number: | |
| 12410 | + var doubleValue1 = reader.GetDouble(); | |
| 12411 | + return new UnionFromDict { Double = doubleValue1 }; | |
| 12412 | + case JsonTokenType.StartObject: | |
| 12413 | + var objectValue = JsonSerializer.Deserialize<FromDict>(ref reader, options); | |
| 12414 | + return new UnionFromDict { FromDict = objectValue }; | |
| 12415 | + } | |
| 12416 | + throw new JsonException("Cannot unmarshal type UnionFromDict"); | |
| 12417 | + } | |
| 12418 | + | |
| 12419 | + public override void Write(Utf8JsonWriter writer, UnionFromDict value, JsonSerializerOptions options) | |
| 12420 | + { | |
| 12421 | + if (value.Double != null) | |
| 12422 | + { | |
| 12423 | + JsonSerializer.Serialize(writer, value.Double.Value, options); | |
| 12424 | + return; | |
| 12425 | + } | |
| 12426 | + if (value.FromDict != null) | |
| 12427 | + { | |
| 12428 | + JsonSerializer.Serialize(writer, value.FromDict, options); | |
| 12429 | + return; | |
| 12430 | + } | |
| 12431 | + throw new NotSupportedException("Cannot marshal type UnionFromDict"); | |
| 12432 | + } | |
| 12433 | + | |
| 12434 | + public static readonly UnionFromDictConverter Singleton = new UnionFromDictConverter(); | |
| 12435 | + } | |
| 12436 | + | |
| 12257 | 12437 | internal class UnionFromJsonConverter : JsonConverter<UnionFromJson> |
| 12258 | 12438 | { |
| 12259 | 12439 | public override bool CanConvert(Type t) => t == typeof(UnionFromJson); |
| @@ -17078,6 +17258,42 @@ namespace QuickType | ||
| 17078 | 17258 | public static readonly UnionToStringConverter Singleton = new UnionToStringConverter(); |
| 17079 | 17259 | } |
| 17080 | 17260 | |
| 17261 | + internal class UnionToDictConverter : JsonConverter<UnionToDict> | |
| 17262 | + { | |
| 17263 | + public override bool CanConvert(Type t) => t == typeof(UnionToDict); | |
| 17264 | + | |
| 17265 | + public override UnionToDict Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | |
| 17266 | + { | |
| 17267 | + switch (reader.TokenType) | |
| 17268 | + { | |
| 17269 | + case JsonTokenType.Number: | |
| 17270 | + var doubleValue1 = reader.GetDouble(); | |
| 17271 | + return new UnionToDict { Double = doubleValue1 }; | |
| 17272 | + case JsonTokenType.StartObject: | |
| 17273 | + var objectValue = JsonSerializer.Deserialize<ToDict>(ref reader, options); | |
| 17274 | + return new UnionToDict { ToDict = objectValue }; | |
| 17275 | + } | |
| 17276 | + throw new JsonException("Cannot unmarshal type UnionToDict"); | |
| 17277 | + } | |
| 17278 | + | |
| 17279 | + public override void Write(Utf8JsonWriter writer, UnionToDict value, JsonSerializerOptions options) | |
| 17280 | + { | |
| 17281 | + if (value.Double != null) | |
| 17282 | + { | |
| 17283 | + JsonSerializer.Serialize(writer, value.Double.Value, options); | |
| 17284 | + return; | |
| 17285 | + } | |
| 17286 | + if (value.ToDict != null) | |
| 17287 | + { | |
| 17288 | + JsonSerializer.Serialize(writer, value.ToDict, options); | |
| 17289 | + return; | |
| 17290 | + } | |
| 17291 | + throw new NotSupportedException("Cannot marshal type UnionToDict"); | |
| 17292 | + } | |
| 17293 | + | |
| 17294 | + public static readonly UnionToDictConverter Singleton = new UnionToDictConverter(); | |
| 17295 | + } | |
| 17296 | + | |
| 17081 | 17297 | internal class UnionToJsonConverter : JsonConverter<UnionToJson> |
| 17082 | 17298 | { |
| 17083 | 17299 | public override bool CanConvert(Type t) => t == typeof(UnionToJson); |
Mschema-csharpdefault / QuickType.cs+220 −0
| @@ -391,6 +391,9 @@ namespace QuickType | ||
| 391 | 391 | [JsonProperty("from", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 392 | 392 | public UnionFrom? From { get; set; } |
| 393 | 393 | |
| 394 | + [JsonProperty("from_dict", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 395 | + public UnionFromDict? FromDict { get; set; } | |
| 396 | + | |
| 394 | 397 | [JsonProperty("from_json", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 395 | 398 | public UnionFromJson? TopLevelFromJson { get; set; } |
| 396 | 399 | |
| @@ -574,6 +577,9 @@ namespace QuickType | ||
| 574 | 577 | [JsonProperty("MapEntry", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 575 | 578 | public UnionMapEntry? MapEntry { get; set; } |
| 576 | 579 | |
| 580 | + [JsonProperty("MarshalJSON", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 581 | + public UnionMarshalJson? MarshalJson { get; set; } | |
| 582 | + | |
| 577 | 583 | [JsonProperty("metadata_property_handling", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 578 | 584 | public UnionMetadataPropertyHandling? MetadataPropertyHandling { get; set; } |
| 579 | 585 | |
| @@ -916,6 +922,9 @@ namespace QuickType | ||
| 916 | 922 | [JsonProperty("TimeZone", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 917 | 923 | public UnionTimeZone? TimeZone { get; set; } |
| 918 | 924 | |
| 925 | + [JsonProperty("to_dict", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 926 | + public UnionToDict? ToDict { get; set; } | |
| 927 | + | |
| 919 | 928 | [JsonProperty("to_json", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 920 | 929 | public UnionToJson? TopLevelToJson { get; set; } |
| 921 | 930 | |
| @@ -973,6 +982,9 @@ namespace QuickType | ||
| 973 | 982 | [JsonProperty("union", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 974 | 983 | public UnionUnionUnion? Union { get; set; } |
| 975 | 984 | |
| 985 | + [JsonProperty("UnmarshalJSON", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] | |
| 986 | + public UnionUnmarshalJson? UnmarshalJson { get; set; } | |
| 987 | + | |
| 976 | 988 | [JsonProperty("unowned", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)] |
| 977 | 989 | public UnionUnowned? Unowned { get; set; } |
| 978 | 990 | |
| @@ -1503,6 +1515,10 @@ namespace QuickType | ||
| 1503 | 1515 | { |
| 1504 | 1516 | } |
| 1505 | 1517 | |
| 1518 | + public partial class FromDict | |
| 1519 | + { | |
| 1520 | + } | |
| 1521 | + | |
| 1506 | 1522 | public partial class Func |
| 1507 | 1523 | { |
| 1508 | 1524 | } |
| @@ -1747,6 +1763,10 @@ namespace QuickType | ||
| 1747 | 1763 | { |
| 1748 | 1764 | } |
| 1749 | 1765 | |
| 1766 | + public partial class MarshalJson | |
| 1767 | + { | |
| 1768 | + } | |
| 1769 | + | |
| 1750 | 1770 | public partial class MetadataPropertyHandlingClass |
| 1751 | 1771 | { |
| 1752 | 1772 | } |
| @@ -2187,6 +2207,10 @@ namespace QuickType | ||
| 2187 | 2207 | { |
| 2188 | 2208 | } |
| 2189 | 2209 | |
| 2210 | + public partial class ToDict | |
| 2211 | + { | |
| 2212 | + } | |
| 2213 | + | |
| 2190 | 2214 | public partial class AnyClass |
| 2191 | 2215 | { |
| 2192 | 2216 | } |
| @@ -2303,6 +2327,10 @@ namespace QuickType | ||
| 2303 | 2327 | { |
| 2304 | 2328 | } |
| 2305 | 2329 | |
| 2330 | + public partial class UnmarshalJson | |
| 2331 | + { | |
| 2332 | + } | |
| 2333 | + | |
| 2306 | 2334 | public partial class Unowned |
| 2307 | 2335 | { |
| 2308 | 2336 | } |
| @@ -3430,6 +3458,15 @@ namespace QuickType | ||
| 3430 | 3458 | public static implicit operator UnionFrom(From From) => new UnionFrom { From = From }; |
| 3431 | 3459 | } |
| 3432 | 3460 | |
| 3461 | + public partial struct UnionFromDict | |
| 3462 | + { | |
| 3463 | + public double? Double; | |
| 3464 | + public FromDict? FromDict; | |
| 3465 | + | |
| 3466 | + public static implicit operator UnionFromDict(double Double) => new UnionFromDict { Double = Double }; | |
| 3467 | + public static implicit operator UnionFromDict(FromDict FromDict) => new UnionFromDict { FromDict = FromDict }; | |
| 3468 | + } | |
| 3469 | + | |
| 3433 | 3470 | public partial struct UnionFunc |
| 3434 | 3471 | { |
| 3435 | 3472 | public double? Double; |
| @@ -3979,6 +4016,15 @@ namespace QuickType | ||
| 3979 | 4016 | public static implicit operator UnionMapEntry(MapEntry MapEntry) => new UnionMapEntry { MapEntry = MapEntry }; |
| 3980 | 4017 | } |
| 3981 | 4018 | |
| 4019 | + public partial struct UnionMarshalJson | |
| 4020 | + { | |
| 4021 | + public double? Double; | |
| 4022 | + public MarshalJson? MarshalJson; | |
| 4023 | + | |
| 4024 | + public static implicit operator UnionMarshalJson(double Double) => new UnionMarshalJson { Double = Double }; | |
| 4025 | + public static implicit operator UnionMarshalJson(MarshalJson MarshalJson) => new UnionMarshalJson { MarshalJson = MarshalJson }; | |
| 4026 | + } | |
| 4027 | + | |
| 3982 | 4028 | public partial struct UnionMetadataPropertyHandling |
| 3983 | 4029 | { |
| 3984 | 4030 | public double? Double; |
| @@ -4969,6 +5015,15 @@ namespace QuickType | ||
| 4969 | 5015 | public static implicit operator UnionTimeZone(TimeZone TimeZone) => new UnionTimeZone { TimeZone = TimeZone }; |
| 4970 | 5016 | } |
| 4971 | 5017 | |
| 5018 | + public partial struct UnionToDict | |
| 5019 | + { | |
| 5020 | + public double? Double; | |
| 5021 | + public ToDict? ToDict; | |
| 5022 | + | |
| 5023 | + public static implicit operator UnionToDict(double Double) => new UnionToDict { Double = Double }; | |
| 5024 | + public static implicit operator UnionToDict(ToDict ToDict) => new UnionToDict { ToDict = ToDict }; | |
| 5025 | + } | |
| 5026 | + | |
| 4972 | 5027 | public partial struct UnionAnyUnion |
| 4973 | 5028 | { |
| 4974 | 5029 | public AnyClass? AnyClass; |
| @@ -5230,6 +5285,15 @@ namespace QuickType | ||
| 5230 | 5285 | public static implicit operator UnionUnionUnion(Union Union) => new UnionUnionUnion { Union = Union }; |
| 5231 | 5286 | } |
| 5232 | 5287 | |
| 5288 | + public partial struct UnionUnmarshalJson | |
| 5289 | + { | |
| 5290 | + public double? Double; | |
| 5291 | + public UnmarshalJson? UnmarshalJson; | |
| 5292 | + | |
| 5293 | + public static implicit operator UnionUnmarshalJson(double Double) => new UnionUnmarshalJson { Double = Double }; | |
| 5294 | + public static implicit operator UnionUnmarshalJson(UnmarshalJson UnmarshalJson) => new UnionUnmarshalJson { UnmarshalJson = UnmarshalJson }; | |
| 5295 | + } | |
| 5296 | + | |
| 5233 | 5297 | public partial struct UnionUnowned |
| 5234 | 5298 | { |
| 5235 | 5299 | public double? Double; |
| @@ -5493,6 +5557,7 @@ namespace QuickType | ||
| 5493 | 5557 | UnionKSerializerConverter.Singleton, |
| 5494 | 5558 | UnionLocaleConverter.Singleton, |
| 5495 | 5559 | UnionMapEntryConverter.Singleton, |
| 5560 | + UnionMarshalJsonConverter.Singleton, | |
| 5496 | 5561 | UnionNoConverter.Singleton, |
| 5497 | 5562 | UnionNsErrorConverter.Singleton, |
| 5498 | 5563 | UnionNsObjectConverter.Singleton, |
| @@ -5520,6 +5585,7 @@ namespace QuickType | ||
| 5520 | 5585 | UnionTrueConverter.Singleton, |
| 5521 | 5586 | UnionTypeConverter.Singleton, |
| 5522 | 5587 | UnionUuidConverter.Singleton, |
| 5588 | + UnionUnmarshalJsonConverter.Singleton, | |
| 5523 | 5589 | UnionUseSerializersConverter.Singleton, |
| 5524 | 5590 | UnionUtf8JsonReaderConverter.Singleton, |
| 5525 | 5591 | UnionUtf8JsonWriterConverter.Singleton, |
| @@ -5625,6 +5691,7 @@ namespace QuickType | ||
| 5625 | 5691 | UnionForeachConverter.Singleton, |
| 5626 | 5692 | UnionFriendConverter.Singleton, |
| 5627 | 5693 | UnionFromConverter.Singleton, |
| 5694 | + UnionFromDictConverter.Singleton, | |
| 5628 | 5695 | UnionFromJsonConverter.Singleton, |
| 5629 | 5696 | UnionFuncConverter.Singleton, |
| 5630 | 5697 | UnionFunctionConverter.Singleton, |
| @@ -5759,6 +5826,7 @@ namespace QuickType | ||
| 5759 | 5826 | UnionThrowConverter.Singleton, |
| 5760 | 5827 | UnionThrowsConverter.Singleton, |
| 5761 | 5828 | UnionToStringConverter.Singleton, |
| 5829 | + UnionToDictConverter.Singleton, | |
| 5762 | 5830 | UnionToJsonConverter.Singleton, |
| 5763 | 5831 | UnionTopLevelConverter.Singleton, |
| 5764 | 5832 | UnionTransientConverter.Singleton, |
| @@ -7242,6 +7310,44 @@ namespace QuickType | ||
| 7242 | 7310 | public static readonly UnionMapEntryConverter Singleton = new UnionMapEntryConverter(); |
| 7243 | 7311 | } |
| 7244 | 7312 | |
| 7313 | + internal class UnionMarshalJsonConverter : JsonConverter | |
| 7314 | + { | |
| 7315 | + public override bool CanConvert(Type t) => t == typeof(UnionMarshalJson) || t == typeof(UnionMarshalJson?); | |
| 7316 | + | |
| 7317 | + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) | |
| 7318 | + { | |
| 7319 | + switch (reader.TokenType) | |
| 7320 | + { | |
| 7321 | + case JsonToken.Integer: | |
| 7322 | + case JsonToken.Float: | |
| 7323 | + var doubleValue = serializer.Deserialize<double>(reader); | |
| 7324 | + return new UnionMarshalJson { Double = doubleValue }; | |
| 7325 | + case JsonToken.StartObject: | |
| 7326 | + var objectValue = serializer.Deserialize<MarshalJson>(reader); | |
| 7327 | + return new UnionMarshalJson { MarshalJson = objectValue }; | |
| 7328 | + } | |
| 7329 | + throw new Exception("Cannot unmarshal type UnionMarshalJson"); | |
| 7330 | + } | |
| 7331 | + | |
| 7332 | + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) | |
| 7333 | + { | |
| 7334 | + var value = (UnionMarshalJson)untypedValue; | |
| 7335 | + if (value.Double != null) | |
| 7336 | + { | |
| 7337 | + serializer.Serialize(writer, value.Double.Value); | |
| 7338 | + return; | |
| 7339 | + } | |
| 7340 | + if (value.MarshalJson != null) | |
| 7341 | + { | |
| 7342 | + serializer.Serialize(writer, value.MarshalJson); | |
| 7343 | + return; | |
| 7344 | + } | |
| 7345 | + throw new Exception("Cannot marshal type UnionMarshalJson"); | |
| 7346 | + } | |
| 7347 | + | |
| 7348 | + public static readonly UnionMarshalJsonConverter Singleton = new UnionMarshalJsonConverter(); | |
| 7349 | + } | |
| 7350 | + | |
| 7245 | 7351 | internal class UnionNoConverter : JsonConverter |
| 7246 | 7352 | { |
| 7247 | 7353 | public override bool CanConvert(Type t) => t == typeof(UnionNo) || t == typeof(UnionNo?); |
| @@ -8268,6 +8374,44 @@ namespace QuickType | ||
| 8268 | 8374 | public static readonly UnionUuidConverter Singleton = new UnionUuidConverter(); |
| 8269 | 8375 | } |
| 8270 | 8376 | |
| 8377 | + internal class UnionUnmarshalJsonConverter : JsonConverter | |
| 8378 | + { | |
| 8379 | + public override bool CanConvert(Type t) => t == typeof(UnionUnmarshalJson) || t == typeof(UnionUnmarshalJson?); | |
| 8380 | + | |
| 8381 | + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) | |
| 8382 | + { | |
| 8383 | + switch (reader.TokenType) | |
| 8384 | + { | |
| 8385 | + case JsonToken.Integer: | |
| 8386 | + case JsonToken.Float: | |
| 8387 | + var doubleValue = serializer.Deserialize<double>(reader); | |
| 8388 | + return new UnionUnmarshalJson { Double = doubleValue }; | |
| 8389 | + case JsonToken.StartObject: | |
| 8390 | + var objectValue = serializer.Deserialize<UnmarshalJson>(reader); | |
| 8391 | + return new UnionUnmarshalJson { UnmarshalJson = objectValue }; | |
| 8392 | + } | |
| 8393 | + throw new Exception("Cannot unmarshal type UnionUnmarshalJson"); | |
| 8394 | + } | |
| 8395 | + | |
| 8396 | + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) | |
| 8397 | + { | |
| 8398 | + var value = (UnionUnmarshalJson)untypedValue; | |
| 8399 | + if (value.Double != null) | |
| 8400 | + { | |
| 8401 | + serializer.Serialize(writer, value.Double.Value); | |
| 8402 | + return; | |
| 8403 | + } | |
| 8404 | + if (value.UnmarshalJson != null) | |
| 8405 | + { | |
| 8406 | + serializer.Serialize(writer, value.UnmarshalJson); | |
| 8407 | + return; | |
| 8408 | + } | |
| 8409 | + throw new Exception("Cannot marshal type UnionUnmarshalJson"); | |
| 8410 | + } | |
| 8411 | + | |
| 8412 | + public static readonly UnionUnmarshalJsonConverter Singleton = new UnionUnmarshalJsonConverter(); | |
| 8413 | + } | |
| 8414 | + | |
| 8271 | 8415 | internal class UnionUseSerializersConverter : JsonConverter |
| 8272 | 8416 | { |
| 8273 | 8417 | public override bool CanConvert(Type t) => t == typeof(UnionUseSerializers) || t == typeof(UnionUseSerializers?); |
| @@ -12258,6 +12402,44 @@ namespace QuickType | ||
| 12258 | 12402 | public static readonly UnionFromConverter Singleton = new UnionFromConverter(); |
| 12259 | 12403 | } |
| 12260 | 12404 | |
| 12405 | + internal class UnionFromDictConverter : JsonConverter | |
| 12406 | + { | |
| 12407 | + public override bool CanConvert(Type t) => t == typeof(UnionFromDict) || t == typeof(UnionFromDict?); | |
| 12408 | + | |
| 12409 | + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) | |
| 12410 | + { | |
| 12411 | + switch (reader.TokenType) | |
| 12412 | + { | |
| 12413 | + case JsonToken.Integer: | |
| 12414 | + case JsonToken.Float: | |
| 12415 | + var doubleValue = serializer.Deserialize<double>(reader); | |
| 12416 | + return new UnionFromDict { Double = doubleValue }; | |
| 12417 | + case JsonToken.StartObject: | |
| 12418 | + var objectValue = serializer.Deserialize<FromDict>(reader); | |
| 12419 | + return new UnionFromDict { FromDict = objectValue }; | |
| 12420 | + } | |
| 12421 | + throw new Exception("Cannot unmarshal type UnionFromDict"); | |
| 12422 | + } | |
| 12423 | + | |
| 12424 | + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) | |
| 12425 | + { | |
| 12426 | + var value = (UnionFromDict)untypedValue; | |
| 12427 | + if (value.Double != null) | |
| 12428 | + { | |
| 12429 | + serializer.Serialize(writer, value.Double.Value); | |
| 12430 | + return; | |
| 12431 | + } | |
| 12432 | + if (value.FromDict != null) | |
| 12433 | + { | |
| 12434 | + serializer.Serialize(writer, value.FromDict); | |
| 12435 | + return; | |
| 12436 | + } | |
| 12437 | + throw new Exception("Cannot marshal type UnionFromDict"); | |
| 12438 | + } | |
| 12439 | + | |
| 12440 | + public static readonly UnionFromDictConverter Singleton = new UnionFromDictConverter(); | |
| 12441 | + } | |
| 12442 | + | |
| 12261 | 12443 | internal class UnionFromJsonConverter : JsonConverter |
| 12262 | 12444 | { |
| 12263 | 12445 | public override bool CanConvert(Type t) => t == typeof(UnionFromJson) || t == typeof(UnionFromJson?); |
| @@ -17350,6 +17532,44 @@ namespace QuickType | ||
| 17350 | 17532 | public static readonly UnionToStringConverter Singleton = new UnionToStringConverter(); |
| 17351 | 17533 | } |
| 17352 | 17534 | |
| 17535 | + internal class UnionToDictConverter : JsonConverter | |
| 17536 | + { | |
| 17537 | + public override bool CanConvert(Type t) => t == typeof(UnionToDict) || t == typeof(UnionToDict?); | |
| 17538 | + | |
| 17539 | + public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) | |
| 17540 | + { | |
| 17541 | + switch (reader.TokenType) | |
| 17542 | + { | |
| 17543 | + case JsonToken.Integer: | |
| 17544 | + case JsonToken.Float: | |
| 17545 | + var doubleValue = serializer.Deserialize<double>(reader); | |
| 17546 | + return new UnionToDict { Double = doubleValue }; | |
| 17547 | + case JsonToken.StartObject: | |
| 17548 | + var objectValue = serializer.Deserialize<ToDict>(reader); | |
| 17549 | + return new UnionToDict { ToDict = objectValue }; | |
| 17550 | + } | |
| 17551 | + throw new Exception("Cannot unmarshal type UnionToDict"); | |
| 17552 | + } | |
| 17553 | + | |
| 17554 | + public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) | |
| 17555 | + { | |
| 17556 | + var value = (UnionToDict)untypedValue; | |
| 17557 | + if (value.Double != null) | |
| 17558 | + { | |
| 17559 | + serializer.Serialize(writer, value.Double.Value); | |
| 17560 | + return; | |
| 17561 | + } | |
| 17562 | + if (value.ToDict != null) | |
| 17563 | + { | |
| 17564 | + serializer.Serialize(writer, value.ToDict); | |
| 17565 | + return; | |
| 17566 | + } | |
| 17567 | + throw new Exception("Cannot marshal type UnionToDict"); | |
| 17568 | + } | |
| 17569 | + | |
| 17570 | + public static readonly UnionToDictConverter Singleton = new UnionToDictConverter(); | |
| 17571 | + } | |
| 17572 | + | |
| 17353 | 17573 | internal class UnionToJsonConverter : JsonConverter |
| 17354 | 17574 | { |
| 17355 | 17575 | public override bool CanConvert(Type t) => t == typeof(UnionToJson) || t == typeof(UnionToJson?); |
Mschema-dartdefault / TopLevel.dart+56 −0
| @@ -131,6 +131,7 @@ class TopLevel { | ||
| 131 | 131 | final dynamic formatException; |
| 132 | 132 | final dynamic friend; |
| 133 | 133 | final dynamic from; |
| 134 | + final dynamic fromDict; | |
| 134 | 135 | final dynamic topLevelFromJson; |
| 135 | 136 | final dynamic func; |
| 136 | 137 | final dynamic function; |
| @@ -192,6 +193,7 @@ class TopLevel { | ||
| 192 | 193 | final dynamic long; |
| 193 | 194 | final dynamic map; |
| 194 | 195 | final dynamic mapEntry; |
| 196 | + final dynamic marshalJson; | |
| 195 | 197 | final dynamic metadataPropertyHandling; |
| 196 | 198 | final dynamic module; |
| 197 | 199 | final dynamic mutable; |
| @@ -306,6 +308,7 @@ class TopLevel { | ||
| 306 | 308 | final dynamic timeOnly; |
| 307 | 309 | final dynamic timeOnlyConverter; |
| 308 | 310 | final dynamic timeZone; |
| 311 | + final dynamic toDict; | |
| 309 | 312 | final dynamic topLevelToJson; |
| 310 | 313 | final dynamic topLevel; |
| 311 | 314 | final dynamic topLevelToString; |
| @@ -325,6 +328,7 @@ class TopLevel { | ||
| 325 | 328 | final dynamic unchecked; |
| 326 | 329 | final dynamic undefined; |
| 327 | 330 | final dynamic union; |
| 331 | + final dynamic unmarshalJson; | |
| 328 | 332 | final dynamic unowned; |
| 329 | 333 | final dynamic unsafe; |
| 330 | 334 | final dynamic unsigned; |
| @@ -472,6 +476,7 @@ class TopLevel { | ||
| 472 | 476 | this.formatException, |
| 473 | 477 | this.friend, |
| 474 | 478 | this.from, |
| 479 | + this.fromDict, | |
| 475 | 480 | this.topLevelFromJson, |
| 476 | 481 | this.func, |
| 477 | 482 | this.function, |
| @@ -533,6 +538,7 @@ class TopLevel { | ||
| 533 | 538 | this.long, |
| 534 | 539 | this.map, |
| 535 | 540 | this.mapEntry, |
| 541 | + this.marshalJson, | |
| 536 | 542 | this.metadataPropertyHandling, |
| 537 | 543 | this.module, |
| 538 | 544 | this.mutable, |
| @@ -647,6 +653,7 @@ class TopLevel { | ||
| 647 | 653 | this.timeOnly, |
| 648 | 654 | this.timeOnlyConverter, |
| 649 | 655 | this.timeZone, |
| 656 | + this.toDict, | |
| 650 | 657 | this.topLevelToJson, |
| 651 | 658 | this.topLevel, |
| 652 | 659 | this.topLevelToString, |
| @@ -666,6 +673,7 @@ class TopLevel { | ||
| 666 | 673 | this.unchecked, |
| 667 | 674 | this.undefined, |
| 668 | 675 | this.union, |
| 676 | + this.unmarshalJson, | |
| 669 | 677 | this.unowned, |
| 670 | 678 | this.unsafe, |
| 671 | 679 | this.unsigned, |
| @@ -814,6 +822,7 @@ class TopLevel { | ||
| 814 | 822 | formatException: json["FormatException"], |
| 815 | 823 | friend: json["friend"], |
| 816 | 824 | from: json["from"], |
| 825 | + fromDict: json["from_dict"], | |
| 817 | 826 | topLevelFromJson: json["from_json"], |
| 818 | 827 | func: json["func"], |
| 819 | 828 | function: json["function"], |
| @@ -875,6 +884,7 @@ class TopLevel { | ||
| 875 | 884 | long: json["long"], |
| 876 | 885 | map: json["map"], |
| 877 | 886 | mapEntry: json["MapEntry"], |
| 887 | + marshalJson: json["MarshalJSON"], | |
| 878 | 888 | metadataPropertyHandling: json["metadata_property_handling"], |
| 879 | 889 | module: json["module"], |
| 880 | 890 | mutable: json["mutable"], |
| @@ -989,6 +999,7 @@ class TopLevel { | ||
| 989 | 999 | timeOnly: json["TimeOnly"], |
| 990 | 1000 | timeOnlyConverter: json["TimeOnlyConverter"], |
| 991 | 1001 | timeZone: json["TimeZone"], |
| 1002 | + toDict: json["to_dict"], | |
| 992 | 1003 | topLevelToJson: json["to_json"], |
| 993 | 1004 | topLevel: json["top_level"], |
| 994 | 1005 | topLevelToString: json["toString"], |
| @@ -1008,6 +1019,7 @@ class TopLevel { | ||
| 1008 | 1019 | unchecked: json["unchecked"], |
| 1009 | 1020 | undefined: json["undefined"], |
| 1010 | 1021 | union: json["union"], |
| 1022 | + unmarshalJson: json["UnmarshalJSON"], | |
| 1011 | 1023 | unowned: json["unowned"], |
| 1012 | 1024 | unsafe: json["unsafe"], |
| 1013 | 1025 | unsigned: json["unsigned"], |
| @@ -1156,6 +1168,7 @@ class TopLevel { | ||
| 1156 | 1168 | "FormatException": formatException, |
| 1157 | 1169 | "friend": friend, |
| 1158 | 1170 | "from": from, |
| 1171 | + "from_dict": fromDict, | |
| 1159 | 1172 | "from_json": topLevelFromJson, |
| 1160 | 1173 | "func": func, |
| 1161 | 1174 | "function": function, |
| @@ -1217,6 +1230,7 @@ class TopLevel { | ||
| 1217 | 1230 | "long": long, |
| 1218 | 1231 | "map": map, |
| 1219 | 1232 | "MapEntry": mapEntry, |
| 1233 | + "MarshalJSON": marshalJson, | |
| 1220 | 1234 | "metadata_property_handling": metadataPropertyHandling, |
| 1221 | 1235 | "module": module, |
| 1222 | 1236 | "mutable": mutable, |
| @@ -1331,6 +1345,7 @@ class TopLevel { | ||
| 1331 | 1345 | "TimeOnly": timeOnly, |
| 1332 | 1346 | "TimeOnlyConverter": timeOnlyConverter, |
| 1333 | 1347 | "TimeZone": timeZone, |
| 1348 | + "to_dict": toDict, | |
| 1334 | 1349 | "to_json": topLevelToJson, |
| 1335 | 1350 | "top_level": topLevel, |
| 1336 | 1351 | "toString": topLevelToString, |
| @@ -1350,6 +1365,7 @@ class TopLevel { | ||
| 1350 | 1365 | "unchecked": unchecked, |
| 1351 | 1366 | "undefined": undefined, |
| 1352 | 1367 | "union": union, |
| 1368 | + "UnmarshalJSON": unmarshalJson, | |
| 1353 | 1369 | "unowned": unowned, |
| 1354 | 1370 | "unsafe": unsafe, |
| 1355 | 1371 | "unsigned": unsigned, |
| @@ -2296,6 +2312,16 @@ class From { | ||
| 2296 | 2312 | }; |
| 2297 | 2313 | } |
| 2298 | 2314 | |
| 2315 | +class FromDict { | |
| 2316 | + FromDict(); | |
| 2317 | + | |
| 2318 | + factory FromDict.fromJson(Map<String, dynamic> json) => FromDict( | |
| 2319 | + ); | |
| 2320 | + | |
| 2321 | + Map<String, dynamic> toJson() => { | |
| 2322 | + }; | |
| 2323 | +} | |
| 2324 | + | |
| 2299 | 2325 | class Func { |
| 2300 | 2326 | Func(); |
| 2301 | 2327 | |
| @@ -2816,6 +2842,16 @@ class MapEntryClass { | ||
| 2816 | 2842 | }; |
| 2817 | 2843 | } |
| 2818 | 2844 | |
| 2845 | +class MarshalJson { | |
| 2846 | + MarshalJson(); | |
| 2847 | + | |
| 2848 | + factory MarshalJson.fromJson(Map<String, dynamic> json) => MarshalJson( | |
| 2849 | + ); | |
| 2850 | + | |
| 2851 | + Map<String, dynamic> toJson() => { | |
| 2852 | + }; | |
| 2853 | +} | |
| 2854 | + | |
| 2819 | 2855 | class MetadataPropertyHandling { |
| 2820 | 2856 | MetadataPropertyHandling(); |
| 2821 | 2857 | |
| @@ -3846,6 +3882,16 @@ class TimeZone { | ||
| 3846 | 3882 | }; |
| 3847 | 3883 | } |
| 3848 | 3884 | |
| 3885 | +class ToDict { | |
| 3886 | + ToDict(); | |
| 3887 | + | |
| 3888 | + factory ToDict.fromJson(Map<String, dynamic> json) => ToDict( | |
| 3889 | + ); | |
| 3890 | + | |
| 3891 | + Map<String, dynamic> toJson() => { | |
| 3892 | + }; | |
| 3893 | +} | |
| 3894 | + | |
| 3849 | 3895 | class TopLevelClass { |
| 3850 | 3896 | TopLevelClass(); |
| 3851 | 3897 | |
| @@ -4576,6 +4622,16 @@ class Union { | ||
| 4576 | 4622 | }; |
| 4577 | 4623 | } |
| 4578 | 4624 | |
| 4625 | +class UnmarshalJson { | |
| 4626 | + UnmarshalJson(); | |
| 4627 | + | |
| 4628 | + factory UnmarshalJson.fromJson(Map<String, dynamic> json) => UnmarshalJson( | |
| 4629 | + ); | |
| 4630 | + | |
| 4631 | + Map<String, dynamic> toJson() => { | |
| 4632 | + }; | |
| 4633 | +} | |
| 4634 | + | |
| 4579 | 4635 | class Unowned { |
| 4580 | 4636 | Unowned(); |
Mschema-elixirdefault / QuickType.ex+177 −1
| @@ -3224,6 +3224,35 @@ defmodule From do | ||
| 3224 | 3224 | end |
| 3225 | 3225 | end |
| 3226 | 3226 | |
| 3227 | +defmodule FromDict do | |
| 3228 | + defstruct [] | |
| 3229 | + | |
| 3230 | + @type t :: %__MODULE__{ | |
| 3231 | + } | |
| 3232 | + | |
| 3233 | + def from_map(m) when is_map(m) do | |
| 3234 | + %FromDict{ | |
| 3235 | + } | |
| 3236 | + end | |
| 3237 | + | |
| 3238 | + def from_json(json) do | |
| 3239 | + json | |
| 3240 | + |> Jason.decode!() | |
| 3241 | + |> from_map() | |
| 3242 | + end | |
| 3243 | + | |
| 3244 | + def to_map(_struct) do | |
| 3245 | + %{ | |
| 3246 | + } | |
| 3247 | + end | |
| 3248 | + | |
| 3249 | + def to_json(struct) do | |
| 3250 | + struct | |
| 3251 | + |> to_map() | |
| 3252 | + |> Jason.encode!() | |
| 3253 | + end | |
| 3254 | +end | |
| 3255 | + | |
| 3227 | 3256 | defmodule FromJSON do |
| 3228 | 3257 | defstruct [] |
| 3229 | 3258 | |
| @@ -4964,6 +4993,35 @@ defmodule MapEntry do | ||
| 4964 | 4993 | end |
| 4965 | 4994 | end |
| 4966 | 4995 | |
| 4996 | +defmodule MarshalJSON do | |
| 4997 | + defstruct [] | |
| 4998 | + | |
| 4999 | + @type t :: %__MODULE__{ | |
| 5000 | + } | |
| 5001 | + | |
| 5002 | + def from_map(m) when is_map(m) do | |
| 5003 | + %MarshalJSON{ | |
| 5004 | + } | |
| 5005 | + end | |
| 5006 | + | |
| 5007 | + def from_json(json) do | |
| 5008 | + json | |
| 5009 | + |> Jason.decode!() | |
| 5010 | + |> from_map() | |
| 5011 | + end | |
| 5012 | + | |
| 5013 | + def to_map(_struct) do | |
| 5014 | + %{ | |
| 5015 | + } | |
| 5016 | + end | |
| 5017 | + | |
| 5018 | + def to_json(struct) do | |
| 5019 | + struct | |
| 5020 | + |> to_map() | |
| 5021 | + |> Jason.encode!() | |
| 5022 | + end | |
| 5023 | +end | |
| 5024 | + | |
| 4967 | 5025 | defmodule MetadataPropertyHandling do |
| 4968 | 5026 | defstruct [] |
| 4969 | 5027 | |
| @@ -8067,6 +8125,35 @@ defmodule TimeZone do | ||
| 8067 | 8125 | end |
| 8068 | 8126 | end |
| 8069 | 8127 | |
| 8128 | +defmodule ToDict do | |
| 8129 | + defstruct [] | |
| 8130 | + | |
| 8131 | + @type t :: %__MODULE__{ | |
| 8132 | + } | |
| 8133 | + | |
| 8134 | + def from_map(m) when is_map(m) do | |
| 8135 | + %ToDict{ | |
| 8136 | + } | |
| 8137 | + end | |
| 8138 | + | |
| 8139 | + def from_json(json) do | |
| 8140 | + json | |
| 8141 | + |> Jason.decode!() | |
| 8142 | + |> from_map() | |
| 8143 | + end | |
| 8144 | + | |
| 8145 | + def to_map(_struct) do | |
| 8146 | + %{ | |
| 8147 | + } | |
| 8148 | + end | |
| 8149 | + | |
| 8150 | + def to_json(struct) do | |
| 8151 | + struct | |
| 8152 | + |> to_map() | |
| 8153 | + |> Jason.encode!() | |
| 8154 | + end | |
| 8155 | +end | |
| 8156 | + | |
| 8070 | 8157 | defmodule ToJSON do |
| 8071 | 8158 | defstruct [] |
| 8072 | 8159 | |
| @@ -9140,6 +9227,35 @@ defmodule Union do | ||
| 9140 | 9227 | end |
| 9141 | 9228 | end |
| 9142 | 9229 | |
| 9230 | +defmodule UnmarshalJSON do | |
| 9231 | + defstruct [] | |
| 9232 | + | |
| 9233 | + @type t :: %__MODULE__{ | |
| 9234 | + } | |
| 9235 | + | |
| 9236 | + def from_map(m) when is_map(m) do | |
| 9237 | + %UnmarshalJSON{ | |
| 9238 | + } | |
| 9239 | + end | |
| 9240 | + | |
| 9241 | + def from_json(json) do | |
| 9242 | + json | |
| 9243 | + |> Jason.decode!() | |
| 9244 | + |> from_map() | |
| 9245 | + end | |
| 9246 | + | |
| 9247 | + def to_map(_struct) do | |
| 9248 | + %{ | |
| 9249 | + } | |
| 9250 | + end | |
| 9251 | + | |
| 9252 | + def to_json(struct) do | |
| 9253 | + struct | |
| 9254 | + |> to_map() | |
| 9255 | + |> Jason.encode!() | |
| 9256 | + end | |
| 9257 | +end | |
| 9258 | + | |
| 9143 | 9259 | defmodule Unowned do |
| 9144 | 9260 | defstruct [] |
| 9145 | 9261 | |
| @@ -9808,7 +9924,7 @@ defmodule Yield do | ||
| 9808 | 9924 | end |
| 9809 | 9925 | |
| 9810 | 9926 | defmodule TopLevel do |
| 9811 | - defstruct [:empty, :top_level_bool, :complex, :imaginery, :abstract, :alignas, :alignof, :top_level_and, :and_eq, :top_level_any, :any, :array, :as, :asm, :assert, :associatedtype, :associativity, :async, :atomic, :atomic_cancel, :atomic_commit, :atomic_noexcept, :auto, :await, :base, :bitand, :bitor, :bool, :bool_1, :boolean, :break, :bycopy, :byref, :byte, :calendar, :case, :top_level_catch, :chan, :char, :char16_t, :char32_t, :checked, :top_level_class, :class, :clone, :co_await, :co_return, :co_yield, :codable, :coding_key, :coding_keys, :compl, :concept, :console, :const, :const_cast, :constexpr, :constructor, :continue, :convenience, :convert, :converter, :culture_info, :date, :date_parse_handling, :date_formatter, :date_only, :date_only_converter, :date_time, :date_time_styles, :debugger, :decimal, :declare, :decltype, :decode_string, :decoder, :decoding_error, :top_level_def, :default, :defer, :deinit, :del, :delegate, :delete, :dict, :dictionary, :did_set, :top_level_do, :double, :dummy, :dynamic, :dynamic_cast, :elif, :top_level_else, :encode_quick_type, :encoder, :enum, :enum_values, :equality_contract, :equatable, :event, :except, :exception, :explicit, :export, :exposing, :extends, :extension, :extern, :fallthrough, :false_1, :top_level_false, :fileprivate, :final, :finally, :fixed, :float, :for, :foreach, :format_exception, :friend, :from, :from_json, :func, :function, :get, :global, :go, :goto, :guard, :hashable, :hash_code, :hasher, :has_own_property, :id, :if, :imp, :implements, :implicit, :top_level_import, :top_level_in, :indirect, :infix, :init, :inline, :inout, :instanceof, :int, :interface, :internal, :is, :iso_date_time_offset_converter, :iterable, :jdec, :jenc, :jpipe, :json, :json_converter, :json_serializer, :json_token, :json_writer, :json_any, :json_coding_key, :json_decoder, :json_encoder, :json_exception, :json_generator, :json_node, :json_null, :json_parser, :json_reader, :json_token_type, :k_serializer, :lambda, :lazy, :left, :let, :list, :locale, :lock, :long, :map, :map_entry, :metadata_property_handling, :module, :mutable, :mutating, :namespace, :native, :new, :newtonsoft, :top_level_nil, :no, :noexcept, :nonatomic, :top_level_none, :none, :nonlocal, :nonmutating, :no_such_method, :top_level_not, :not_eq, :ns_error, :ns_object, :ns_string, :null, :top_level_null, :nullptr, :number, :object, :object_mapper, :of, :oneway, :open, :operator, :optional, :top_level_or, :or_eq, :out, :override, :package, :params, :pass, :port, :postfix, :precedence, :prefix, :primitive_kind, :print, :printf, :print_members, :private, :protected, :protocol, :top_level_protocol, :public, :quicktype, :raise, :range, :readonly, :ref, :reg_exp, :register, :reinterpret_cast, :repeat, :require, :required, :requires, :restrict, :retain, :rethrows, :return, :right, :runtime_type, :s, :sbyte, :sealed, :sel, :select, :self, :top_level_self, :sendable, :serial_descriptor, :serializable, :serialize, :serializer_provider, :serial_name, :set, :short, :signed, :simple_module, :sizeof, :stackalloc, :standards, :static, :static_assert, :static_cast, :std_deserializer, :std_serializer, :strictfp, :string, :struct, :subscript, :super, :switch, :symbol, :synchronized, :system, :template, :then, :this, :thread_local, :throw, :throws, :time_only, :time_only_converter, :time_zone, :to_json, :top_level, :to_string, :transient, :top_level_true, :true_1, :try, :type, :top_level_type, :typealias, :typedef, :typeid, :typename, :typeof, :uint, :ulong, :unchecked, :undefined, :union, :unowned, :unsafe, :unsigned, :use_serializers, :ushort, :using, :utf8_json_reader, :utf8_json_writer, :uuid, :var, :virtual, :void, :volatile, :wchar_t, :weak, :where, :while, :will_set, :with, :xor, :xor_eq, :yes, :yield] | |
| 9927 | + defstruct [:empty, :top_level_bool, :complex, :imaginery, :abstract, :alignas, :alignof, :top_level_and, :and_eq, :top_level_any, :any, :array, :as, :asm, :assert, :associatedtype, :associativity, :async, :atomic, :atomic_cancel, :atomic_commit, :atomic_noexcept, :auto, :await, :base, :bitand, :bitor, :bool, :bool_1, :boolean, :break, :bycopy, :byref, :byte, :calendar, :case, :top_level_catch, :chan, :char, :char16_t, :char32_t, :checked, :top_level_class, :class, :clone, :co_await, :co_return, :co_yield, :codable, :coding_key, :coding_keys, :compl, :concept, :console, :const, :const_cast, :constexpr, :constructor, :continue, :convenience, :convert, :converter, :culture_info, :date, :date_parse_handling, :date_formatter, :date_only, :date_only_converter, :date_time, :date_time_styles, :debugger, :decimal, :declare, :decltype, :decode_string, :decoder, :decoding_error, :top_level_def, :default, :defer, :deinit, :del, :delegate, :delete, :dict, :dictionary, :did_set, :top_level_do, :double, :dummy, :dynamic, :dynamic_cast, :elif, :top_level_else, :encode_quick_type, :encoder, :enum, :enum_values, :equality_contract, :equatable, :event, :except, :exception, :explicit, :export, :exposing, :extends, :extension, :extern, :fallthrough, :false_1, :top_level_false, :fileprivate, :final, :finally, :fixed, :float, :for, :foreach, :format_exception, :friend, :from, :from_dict, :from_json, :func, :function, :get, :global, :go, :goto, :guard, :hashable, :hash_code, :hasher, :has_own_property, :id, :if, :imp, :implements, :implicit, :top_level_import, :top_level_in, :indirect, :infix, :init, :inline, :inout, :instanceof, :int, :interface, :internal, :is, :iso_date_time_offset_converter, :iterable, :jdec, :jenc, :jpipe, :json, :json_converter, :json_serializer, :json_token, :json_writer, :json_any, :json_coding_key, :json_decoder, :json_encoder, :json_exception, :json_generator, :json_node, :json_null, :json_parser, :json_reader, :json_token_type, :k_serializer, :lambda, :lazy, :left, :let, :list, :locale, :lock, :long, :map, :map_entry, :marshal_json, :metadata_property_handling, :module, :mutable, :mutating, :namespace, :native, :new, :newtonsoft, :top_level_nil, :no, :noexcept, :nonatomic, :top_level_none, :none, :nonlocal, :nonmutating, :no_such_method, :top_level_not, :not_eq, :ns_error, :ns_object, :ns_string, :null, :top_level_null, :nullptr, :number, :object, :object_mapper, :of, :oneway, :open, :operator, :optional, :top_level_or, :or_eq, :out, :override, :package, :params, :pass, :port, :postfix, :precedence, :prefix, :primitive_kind, :print, :printf, :print_members, :private, :protected, :protocol, :top_level_protocol, :public, :quicktype, :raise, :range, :readonly, :ref, :reg_exp, :register, :reinterpret_cast, :repeat, :require, :required, :requires, :restrict, :retain, :rethrows, :return, :right, :runtime_type, :s, :sbyte, :sealed, :sel, :select, :self, :top_level_self, :sendable, :serial_descriptor, :serializable, :serialize, :serializer_provider, :serial_name, :set, :short, :signed, :simple_module, :sizeof, :stackalloc, :standards, :static, :static_assert, :static_cast, :std_deserializer, :std_serializer, :strictfp, :string, :struct, :subscript, :super, :switch, :symbol, :synchronized, :system, :template, :then, :this, :thread_local, :throw, :throws, :time_only, :time_only_converter, :time_zone, :to_dict, :to_json, :top_level, :to_string, :transient, :top_level_true, :true_1, :try, :type, :top_level_type, :typealias, :typedef, :typeid, :typename, :typeof, :uint, :ulong, :unchecked, :undefined, :union, :unmarshal_json, :unowned, :unsafe, :unsigned, :use_serializers, :ushort, :using, :utf8_json_reader, :utf8_json_writer, :uuid, :var, :virtual, :void, :volatile, :wchar_t, :weak, :where, :while, :will_set, :with, :xor, :xor_eq, :yes, :yield] | |
| 9812 | 9928 | |
| 9813 | 9929 | @type t :: %__MODULE__{ |
| 9814 | 9930 | empty: Empty.t() | float() | nil, |
| @@ -9933,6 +10049,7 @@ defmodule TopLevel do | ||
| 9933 | 10049 | format_exception: FormatException.t() | float() | nil, |
| 9934 | 10050 | friend: Friend.t() | float() | nil, |
| 9935 | 10051 | from: From.t() | float() | nil, |
| 10052 | + from_dict: FromDict.t() | float() | nil, | |
| 9936 | 10053 | from_json: FromJSON.t() | float() | nil, |
| 9937 | 10054 | func: Func.t() | float() | nil, |
| 9938 | 10055 | function: FunctionClass.t() | float() | nil, |
| @@ -9994,6 +10111,7 @@ defmodule TopLevel do | ||
| 9994 | 10111 | long: Long.t() | float() | nil, |
| 9995 | 10112 | map: MapClass.t() | float() | nil, |
| 9996 | 10113 | map_entry: MapEntry.t() | float() | nil, |
| 10114 | + marshal_json: MarshalJSON.t() | float() | nil, | |
| 9997 | 10115 | metadata_property_handling: MetadataPropertyHandling.t() | float() | nil, |
| 9998 | 10116 | module: ModuleClass.t() | float() | nil, |
| 9999 | 10117 | mutable: Mutable.t() | float() | nil, |
| @@ -10108,6 +10226,7 @@ defmodule TopLevel do | ||
| 10108 | 10226 | time_only: TimeOnly.t() | float() | nil, |
| 10109 | 10227 | time_only_converter: TimeOnlyConverter.t() | float() | nil, |
| 10110 | 10228 | time_zone: TimeZone.t() | float() | nil, |
| 10229 | + to_dict: ToDict.t() | float() | nil, | |
| 10111 | 10230 | to_json: ToJSON.t() | float() | nil, |
| 10112 | 10231 | top_level: TopLevelClass.t() | float() | nil, |
| 10113 | 10232 | to_string: ToString.t() | float() | nil, |
| @@ -10127,6 +10246,7 @@ defmodule TopLevel do | ||
| 10127 | 10246 | unchecked: Unchecked.t() | float() | nil, |
| 10128 | 10247 | undefined: Undefined.t() | float() | nil, |
| 10129 | 10248 | union: Union.t() | float() | nil, |
| 10249 | + unmarshal_json: UnmarshalJSON.t() | float() | nil, | |
| 10130 | 10250 | unowned: Unowned.t() | float() | nil, |
| 10131 | 10251 | unsafe: Unsafe.t() | float() | nil, |
| 10132 | 10252 | unsigned: Unsigned.t() | float() | nil, |
| @@ -11612,6 +11732,18 @@ defmodule TopLevel do | ||
| 11612 | 11732 | def encode_from(value) when is_nil(value), do: value |
| 11613 | 11733 | def encode_from(_), do: {:error, "Unexpected type when encoding TopLevel.from"} |
| 11614 | 11734 | |
| 11735 | + def decode_from_dict(%{} = value), do: FromDict.from_map(value) | |
| 11736 | + def decode_from_dict(value) when is_float(value), do: value | |
| 11737 | + def decode_from_dict(value) when is_integer(value), do: value | |
| 11738 | + def decode_from_dict(value) when is_nil(value), do: value | |
| 11739 | + def decode_from_dict(_), do: {:error, "Unexpected type when decoding TopLevel.from_dict"} | |
| 11740 | + | |
| 11741 | + def encode_from_dict(%FromDict{} = value), do: FromDict.to_map(value) | |
| 11742 | + def encode_from_dict(value) when is_float(value), do: value | |
| 11743 | + def encode_from_dict(value) when is_integer(value), do: value | |
| 11744 | + def encode_from_dict(value) when is_nil(value), do: value | |
| 11745 | + def encode_from_dict(_), do: {:error, "Unexpected type when encoding TopLevel.from_dict"} | |
| 11746 | + | |
| 11615 | 11747 | def decode_from_json(%{} = value), do: FromJSON.from_map(value) |
| 11616 | 11748 | def decode_from_json(value) when is_float(value), do: value |
| 11617 | 11749 | def decode_from_json(value) when is_integer(value), do: value |
| @@ -12344,6 +12476,18 @@ defmodule TopLevel do | ||
| 12344 | 12476 | def encode_map_entry(value) when is_nil(value), do: value |
| 12345 | 12477 | def encode_map_entry(_), do: {:error, "Unexpected type when encoding TopLevel.map_entry"} |
| 12346 | 12478 | |
| 12479 | + def decode_marshal_json(%{} = value), do: MarshalJSON.from_map(value) | |
| 12480 | + def decode_marshal_json(value) when is_float(value), do: value | |
| 12481 | + def decode_marshal_json(value) when is_integer(value), do: value | |
| 12482 | + def decode_marshal_json(value) when is_nil(value), do: value | |
| 12483 | + def decode_marshal_json(_), do: {:error, "Unexpected type when decoding TopLevel.marshal_json"} | |
| 12484 | + | |
| 12485 | + def encode_marshal_json(%MarshalJSON{} = value), do: MarshalJSON.to_map(value) | |
| 12486 | + def encode_marshal_json(value) when is_float(value), do: value | |
| 12487 | + def encode_marshal_json(value) when is_integer(value), do: value | |
| 12488 | + def encode_marshal_json(value) when is_nil(value), do: value | |
| 12489 | + def encode_marshal_json(_), do: {:error, "Unexpected type when encoding TopLevel.marshal_json"} | |
| 12490 | + | |
| 12347 | 12491 | def decode_metadata_property_handling(%{} = value), do: MetadataPropertyHandling.from_map(value) |
| 12348 | 12492 | def decode_metadata_property_handling(value) when is_float(value), do: value |
| 12349 | 12493 | def decode_metadata_property_handling(value) when is_integer(value), do: value |
| @@ -13712,6 +13856,18 @@ defmodule TopLevel do | ||
| 13712 | 13856 | def encode_time_zone(value) when is_nil(value), do: value |
| 13713 | 13857 | def encode_time_zone(_), do: {:error, "Unexpected type when encoding TopLevel.time_zone"} |
| 13714 | 13858 | |
| 13859 | + def decode_to_dict(%{} = value), do: ToDict.from_map(value) | |
| 13860 | + def decode_to_dict(value) when is_float(value), do: value | |
| 13861 | + def decode_to_dict(value) when is_integer(value), do: value | |
| 13862 | + def decode_to_dict(value) when is_nil(value), do: value | |
| 13863 | + def decode_to_dict(_), do: {:error, "Unexpected type when decoding TopLevel.to_dict"} | |
| 13864 | + | |
| 13865 | + def encode_to_dict(%ToDict{} = value), do: ToDict.to_map(value) | |
| 13866 | + def encode_to_dict(value) when is_float(value), do: value | |
| 13867 | + def encode_to_dict(value) when is_integer(value), do: value | |
| 13868 | + def encode_to_dict(value) when is_nil(value), do: value | |
| 13869 | + def encode_to_dict(_), do: {:error, "Unexpected type when encoding TopLevel.to_dict"} | |
| 13870 | + | |
| 13715 | 13871 | def decode_to_json(%{} = value), do: ToJSON.from_map(value) |
| 13716 | 13872 | def decode_to_json(value) when is_float(value), do: value |
| 13717 | 13873 | def decode_to_json(value) when is_integer(value), do: value |
| @@ -13940,6 +14096,18 @@ defmodule TopLevel do | ||
| 13940 | 14096 | def encode_union(value) when is_nil(value), do: value |
| 13941 | 14097 | def encode_union(_), do: {:error, "Unexpected type when encoding TopLevel.union"} |
| 13942 | 14098 | |
| 14099 | + def decode_unmarshal_json(%{} = value), do: UnmarshalJSON.from_map(value) | |
| 14100 | + def decode_unmarshal_json(value) when is_float(value), do: value | |
| 14101 | + def decode_unmarshal_json(value) when is_integer(value), do: value | |
| 14102 | + def decode_unmarshal_json(value) when is_nil(value), do: value | |
| 14103 | + def decode_unmarshal_json(_), do: {:error, "Unexpected type when decoding TopLevel.unmarshal_json"} | |
| 14104 | + | |
| 14105 | + def encode_unmarshal_json(%UnmarshalJSON{} = value), do: UnmarshalJSON.to_map(value) | |
| 14106 | + def encode_unmarshal_json(value) when is_float(value), do: value | |
| 14107 | + def encode_unmarshal_json(value) when is_integer(value), do: value | |
| 14108 | + def encode_unmarshal_json(value) when is_nil(value), do: value | |
| 14109 | + def encode_unmarshal_json(_), do: {:error, "Unexpected type when encoding TopLevel.unmarshal_json"} | |
| 14110 | + | |
| 13943 | 14111 | def decode_unowned(%{} = value), do: Unowned.from_map(value) |
| 13944 | 14112 | def decode_unowned(value) when is_float(value), do: value |
| 13945 | 14113 | def decode_unowned(value) when is_integer(value), do: value |
| @@ -14340,6 +14508,7 @@ defmodule TopLevel do | ||
| 14340 | 14508 | format_exception: decode_format_exception(m["FormatException"]), |
| 14341 | 14509 | friend: decode_friend(m["friend"]), |
| 14342 | 14510 | from: decode_from(m["from"]), |
| 14511 | + from_dict: decode_from_dict(m["from_dict"]), | |
| 14343 | 14512 | from_json: decode_from_json(m["from_json"]), |
| 14344 | 14513 | func: decode_func(m["func"]), |
| 14345 | 14514 | function: decode_function(m["function"]), |
| @@ -14401,6 +14570,7 @@ defmodule TopLevel do | ||
| 14401 | 14570 | long: decode_long(m["long"]), |
| 14402 | 14571 | map: decode_map(m["map"]), |
| 14403 | 14572 | map_entry: decode_map_entry(m["MapEntry"]), |
| 14573 | + marshal_json: decode_marshal_json(m["MarshalJSON"]), | |
| 14404 | 14574 | metadata_property_handling: decode_metadata_property_handling(m["metadata_property_handling"]), |
| 14405 | 14575 | module: decode_module(m["module"]), |
| 14406 | 14576 | mutable: decode_mutable(m["mutable"]), |
| @@ -14515,6 +14685,7 @@ defmodule TopLevel do | ||
| 14515 | 14685 | time_only: decode_time_only(m["TimeOnly"]), |
| 14516 | 14686 | time_only_converter: decode_time_only_converter(m["TimeOnlyConverter"]), |
| 14517 | 14687 | time_zone: decode_time_zone(m["TimeZone"]), |
| 14688 | + to_dict: decode_to_dict(m["to_dict"]), | |
| 14518 | 14689 | to_json: decode_to_json(m["to_json"]), |
| 14519 | 14690 | top_level: decode_top_level(m["top_level"]), |
| 14520 | 14691 | to_string: decode_to_string(m["toString"]), |
| @@ -14534,6 +14705,7 @@ defmodule TopLevel do | ||
| 14534 | 14705 | unchecked: decode_unchecked(m["unchecked"]), |
| 14535 | 14706 | undefined: decode_undefined(m["undefined"]), |
| 14536 | 14707 | union: decode_union(m["union"]), |
| 14708 | + unmarshal_json: decode_unmarshal_json(m["UnmarshalJSON"]), | |
| 14537 | 14709 | unowned: decode_unowned(m["unowned"]), |
| 14538 | 14710 | unsafe: decode_unsafe(m["unsafe"]), |
| 14539 | 14711 | unsigned: decode_unsigned(m["unsigned"]), |
| @@ -14690,6 +14862,7 @@ defmodule TopLevel do | ||
| 14690 | 14862 | "FormatException" => encode_format_exception(struct.format_exception), |
| 14691 | 14863 | "friend" => encode_friend(struct.friend), |
| 14692 | 14864 | "from" => encode_from(struct.from), |
| 14865 | + "from_dict" => encode_from_dict(struct.from_dict), | |
| 14693 | 14866 | "from_json" => encode_from_json(struct.from_json), |
| 14694 | 14867 | "func" => encode_func(struct.func), |
| 14695 | 14868 | "function" => encode_function(struct.function), |
| @@ -14751,6 +14924,7 @@ defmodule TopLevel do | ||
| 14751 | 14924 | "long" => encode_long(struct.long), |
| 14752 | 14925 | "map" => encode_map(struct.map), |
| 14753 | 14926 | "MapEntry" => encode_map_entry(struct.map_entry), |
| 14927 | + "MarshalJSON" => encode_marshal_json(struct.marshal_json), | |
| 14754 | 14928 | "metadata_property_handling" => encode_metadata_property_handling(struct.metadata_property_handling), |
| 14755 | 14929 | "module" => encode_module(struct.module), |
| 14756 | 14930 | "mutable" => encode_mutable(struct.mutable), |
| @@ -14865,6 +15039,7 @@ defmodule TopLevel do | ||
| 14865 | 15039 | "TimeOnly" => encode_time_only(struct.time_only), |
| 14866 | 15040 | "TimeOnlyConverter" => encode_time_only_converter(struct.time_only_converter), |
| 14867 | 15041 | "TimeZone" => encode_time_zone(struct.time_zone), |
| 15042 | + "to_dict" => encode_to_dict(struct.to_dict), | |
| 14868 | 15043 | "to_json" => encode_to_json(struct.to_json), |
| 14869 | 15044 | "top_level" => encode_top_level(struct.top_level), |
| 14870 | 15045 | "toString" => encode_to_string(struct.to_string), |
| @@ -14884,6 +15059,7 @@ defmodule TopLevel do | ||
| 14884 | 15059 | "unchecked" => encode_unchecked(struct.unchecked), |
| 14885 | 15060 | "undefined" => encode_undefined(struct.undefined), |
| 14886 | 15061 | "union" => encode_union(struct.union), |
| 15062 | + "UnmarshalJSON" => encode_unmarshal_json(struct.unmarshal_json), | |
| 14887 | 15063 | "unowned" => encode_unowned(struct.unowned), |
| 14888 | 15064 | "unsafe" => encode_unsafe(struct.unsafe), |
| 14889 | 15065 | "unsigned" => encode_unsigned(struct.unsigned), |
Mschema-elmdefault / QuickType.elm+140 −0
| @@ -123,6 +123,7 @@ module QuickType exposing | ||
| 123 | 123 | , FormatException |
| 124 | 124 | , Friend |
| 125 | 125 | , From |
| 126 | + , FromDict | |
| 126 | 127 | , FromJSON |
| 127 | 128 | , Func |
| 128 | 129 | , Function |
| @@ -179,6 +180,7 @@ module QuickType exposing | ||
| 179 | 180 | , Long |
| 180 | 181 | , Map |
| 181 | 182 | , MapEntry |
| 183 | + , MarshalJSON | |
| 182 | 184 | , MetadataPropertyHandling |
| 183 | 185 | , Mutable |
| 184 | 186 | , Mutating |
| @@ -315,6 +317,7 @@ module QuickType exposing | ||
| 315 | 317 | , TimeOnly |
| 316 | 318 | , TimeOnlyConverter |
| 317 | 319 | , TimeZone |
| 320 | + , ToDict | |
| 318 | 321 | , ToJSON |
| 319 | 322 | , ToString |
| 320 | 323 | , TopLevel |
| @@ -331,6 +334,7 @@ module QuickType exposing | ||
| 331 | 334 | , Unchecked |
| 332 | 335 | , Undefined |
| 333 | 336 | , Union |
| 337 | + , UnmarshalJSON | |
| 334 | 338 | , Unowned |
| 335 | 339 | , Unsafe |
| 336 | 340 | , Unsigned |
| @@ -461,6 +465,7 @@ module QuickType exposing | ||
| 461 | 465 | , UnionFormatException(..) |
| 462 | 466 | , UnionFriend(..) |
| 463 | 467 | , UnionFrom(..) |
| 468 | + , UnionFromDict(..) | |
| 464 | 469 | , UnionFromJSON(..) |
| 465 | 470 | , UnionFunc(..) |
| 466 | 471 | , UnionFunction(..) |
| @@ -517,6 +522,7 @@ module QuickType exposing | ||
| 517 | 522 | , UnionLong(..) |
| 518 | 523 | , UnionMap(..) |
| 519 | 524 | , UnionMapEntry(..) |
| 525 | + , UnionMarshalJSON(..) | |
| 520 | 526 | , UnionMetadataPropertyHandling(..) |
| 521 | 527 | , UnionMutable(..) |
| 522 | 528 | , UnionMutating(..) |
| @@ -653,6 +659,7 @@ module QuickType exposing | ||
| 653 | 659 | , UnionTimeOnly(..) |
| 654 | 660 | , UnionTimeOnlyConverter(..) |
| 655 | 661 | , UnionTimeZone(..) |
| 662 | + , UnionToDict(..) | |
| 656 | 663 | , UnionToJSON(..) |
| 657 | 664 | , UnionToString(..) |
| 658 | 665 | , UnionTopLevel(..) |
| @@ -669,6 +676,7 @@ module QuickType exposing | ||
| 669 | 676 | , UnionUnchecked(..) |
| 670 | 677 | , UnionUndefined(..) |
| 671 | 678 | , UnionUnionUnion(..) |
| 679 | + , UnionUnmarshalJSON(..) | |
| 672 | 680 | , UnionUnowned(..) |
| 673 | 681 | , UnionUnsafe(..) |
| 674 | 682 | , UnionUnsigned(..) |
| @@ -821,6 +829,7 @@ type alias QuickType = | ||
| 821 | 829 | , formatException : Maybe UnionFormatException |
| 822 | 830 | , friend : Maybe UnionFriend |
| 823 | 831 | , from : Maybe UnionFrom |
| 832 | + , fromDict : Maybe UnionFromDict | |
| 824 | 833 | , fromJSON : Maybe UnionFromJSON |
| 825 | 834 | , func : Maybe UnionFunc |
| 826 | 835 | , function : Maybe UnionFunction |
| @@ -882,6 +891,7 @@ type alias QuickType = | ||
| 882 | 891 | , long : Maybe UnionLong |
| 883 | 892 | , map : Maybe UnionMap |
| 884 | 893 | , mapEntry : Maybe UnionMapEntry |
| 894 | + , marshalJSON : Maybe UnionMarshalJSON | |
| 885 | 895 | , metadataPropertyHandling : Maybe UnionMetadataPropertyHandling |
| 886 | 896 | , quickTypeModule : Maybe UnionModule |
| 887 | 897 | , mutable : Maybe UnionMutable |
| @@ -996,6 +1006,7 @@ type alias QuickType = | ||
| 996 | 1006 | , timeOnly : Maybe UnionTimeOnly |
| 997 | 1007 | , timeOnlyConverter : Maybe UnionTimeOnlyConverter |
| 998 | 1008 | , timeZone : Maybe UnionTimeZone |
| 1009 | + , toDict : Maybe UnionToDict | |
| 999 | 1010 | , toJSON : Maybe UnionToJSON |
| 1000 | 1011 | , topLevel : Maybe UnionTopLevel |
| 1001 | 1012 | , toString : Maybe UnionToString |
| @@ -1015,6 +1026,7 @@ type alias QuickType = | ||
| 1015 | 1026 | , unchecked : Maybe UnionUnchecked |
| 1016 | 1027 | , undefined : Maybe UnionUndefined |
| 1017 | 1028 | , union : Maybe UnionUnionUnion |
| 1029 | + , unmarshalJSON : Maybe UnionUnmarshalJSON | |
| 1018 | 1030 | , unowned : Maybe UnionUnowned |
| 1019 | 1031 | , unsafe : Maybe UnionUnsafe |
| 1020 | 1032 | , unsigned : Maybe UnionUnsigned |
| @@ -1904,6 +1916,14 @@ type alias From = | ||
| 1904 | 1916 | { |
| 1905 | 1917 | } |
| 1906 | 1918 | |
| 1919 | +type UnionFromDict | |
| 1920 | + = DoubleInUnionFromDict Float | |
| 1921 | + | FromDictInUnionFromDict FromDict | |
| 1922 | + | |
| 1923 | +type alias FromDict = | |
| 1924 | + { | |
| 1925 | + } | |
| 1926 | + | |
| 1907 | 1927 | type UnionFromJSON |
| 1908 | 1928 | = DoubleInUnionFromJSON Float |
| 1909 | 1929 | | FromJSONInUnionFromJSON FromJSON |
| @@ -2352,6 +2372,14 @@ type alias MapEntry = | ||
| 2352 | 2372 | { |
| 2353 | 2373 | } |
| 2354 | 2374 | |
| 2375 | +type UnionMarshalJSON | |
| 2376 | + = DoubleInUnionMarshalJSON Float | |
| 2377 | + | MarshalJSONInUnionMarshalJSON MarshalJSON | |
| 2378 | + | |
| 2379 | +type alias MarshalJSON = | |
| 2380 | + { | |
| 2381 | + } | |
| 2382 | + | |
| 2355 | 2383 | type UnionMetadataPropertyHandling |
| 2356 | 2384 | = DoubleInUnionMetadataPropertyHandling Float |
| 2357 | 2385 | | MetadataPropertyHandlingInUnionMetadataPropertyHandling MetadataPropertyHandling |
| @@ -3440,6 +3468,14 @@ type alias TimeZone = | ||
| 3440 | 3468 | { |
| 3441 | 3469 | } |
| 3442 | 3470 | |
| 3471 | +type UnionToDict | |
| 3472 | + = DoubleInUnionToDict Float | |
| 3473 | + | ToDictInUnionToDict ToDict | |
| 3474 | + | |
| 3475 | +type alias ToDict = | |
| 3476 | + { | |
| 3477 | + } | |
| 3478 | + | |
| 3443 | 3479 | type UnionToJSON |
| 3444 | 3480 | = DoubleInUnionToJSON Float |
| 3445 | 3481 | | ToJSONInUnionToJSON ToJSON |
| @@ -3568,6 +3604,14 @@ type alias Union = | ||
| 3568 | 3604 | { |
| 3569 | 3605 | } |
| 3570 | 3606 | |
| 3607 | +type UnionUnmarshalJSON | |
| 3608 | + = DoubleInUnionUnmarshalJSON Float | |
| 3609 | + | UnmarshalJSONInUnionUnmarshalJSON UnmarshalJSON | |
| 3610 | + | |
| 3611 | +type alias UnmarshalJSON = | |
| 3612 | + { | |
| 3613 | + } | |
| 3614 | + | |
| 3571 | 3615 | type UnionUnowned |
| 3572 | 3616 | = DoubleInUnionUnowned Float |
| 3573 | 3617 | | UnownedInUnionUnowned Unowned |
| @@ -3880,6 +3924,7 @@ quickType = | ||
| 3880 | 3924 | |> Jpipe.custom (optionalField "FormatException" (Jdec.map Just unionFormatException) Nothing) |
| 3881 | 3925 | |> Jpipe.custom (optionalField "friend" (Jdec.map Just unionFriend) Nothing) |
| 3882 | 3926 | |> Jpipe.custom (optionalField "from" (Jdec.map Just unionFrom) Nothing) |
| 3927 | + |> Jpipe.custom (optionalField "from_dict" (Jdec.map Just unionFromDict) Nothing) | |
| 3883 | 3928 | |> Jpipe.custom (optionalField "from_json" (Jdec.map Just unionFromJSON) Nothing) |
| 3884 | 3929 | |> Jpipe.custom (optionalField "func" (Jdec.map Just unionFunc) Nothing) |
| 3885 | 3930 | |> Jpipe.custom (optionalField "function" (Jdec.map Just unionFunction) Nothing) |
| @@ -3941,6 +3986,7 @@ quickType = | ||
| 3941 | 3986 | |> Jpipe.custom (optionalField "long" (Jdec.map Just unionLong) Nothing) |
| 3942 | 3987 | |> Jpipe.custom (optionalField "map" (Jdec.map Just unionMap) Nothing) |
| 3943 | 3988 | |> Jpipe.custom (optionalField "MapEntry" (Jdec.map Just unionMapEntry) Nothing) |
| 3989 | + |> Jpipe.custom (optionalField "MarshalJSON" (Jdec.map Just unionMarshalJSON) Nothing) | |
| 3944 | 3990 | |> Jpipe.custom (optionalField "metadata_property_handling" (Jdec.map Just unionMetadataPropertyHandling) Nothing) |
| 3945 | 3991 | |> Jpipe.custom (optionalField "module" (Jdec.map Just unionModule) Nothing) |
| 3946 | 3992 | |> Jpipe.custom (optionalField "mutable" (Jdec.map Just unionMutable) Nothing) |
| @@ -4055,6 +4101,7 @@ quickType = | ||
| 4055 | 4101 | |> Jpipe.custom (optionalField "TimeOnly" (Jdec.map Just unionTimeOnly) Nothing) |
| 4056 | 4102 | |> Jpipe.custom (optionalField "TimeOnlyConverter" (Jdec.map Just unionTimeOnlyConverter) Nothing) |
| 4057 | 4103 | |> Jpipe.custom (optionalField "TimeZone" (Jdec.map Just unionTimeZone) Nothing) |
| 4104 | + |> Jpipe.custom (optionalField "to_dict" (Jdec.map Just unionToDict) Nothing) | |
| 4058 | 4105 | |> Jpipe.custom (optionalField "to_json" (Jdec.map Just unionToJSON) Nothing) |
| 4059 | 4106 | |> Jpipe.custom (optionalField "top_level" (Jdec.map Just unionTopLevel) Nothing) |
| 4060 | 4107 | |> Jpipe.custom (optionalField "toString" (Jdec.map Just unionToString) Nothing) |
| @@ -4074,6 +4121,7 @@ quickType = | ||
| 4074 | 4121 | |> Jpipe.custom (optionalField "unchecked" (Jdec.map Just unionUnchecked) Nothing) |
| 4075 | 4122 | |> Jpipe.custom (optionalField "undefined" (Jdec.map Just unionUndefined) Nothing) |
| 4076 | 4123 | |> Jpipe.custom (optionalField "union" (Jdec.map Just unionUnionUnion) Nothing) |
| 4124 | + |> Jpipe.custom (optionalField "UnmarshalJSON" (Jdec.map Just unionUnmarshalJSON) Nothing) | |
| 4077 | 4125 | |> Jpipe.custom (optionalField "unowned" (Jdec.map Just unionUnowned) Nothing) |
| 4078 | 4126 | |> Jpipe.custom (optionalField "unsafe" (Jdec.map Just unionUnsafe) Nothing) |
| 4079 | 4127 | |> Jpipe.custom (optionalField "unsigned" (Jdec.map Just unionUnsigned) Nothing) |
| @@ -4223,6 +4271,7 @@ encodeQuickType x = | ||
| 4223 | 4271 | , ("FormatException", makeNullableEncoder encodeUnionFormatException x.formatException) |
| 4224 | 4272 | , ("friend", makeNullableEncoder encodeUnionFriend x.friend) |
| 4225 | 4273 | , ("from", makeNullableEncoder encodeUnionFrom x.from) |
| 4274 | + , ("from_dict", makeNullableEncoder encodeUnionFromDict x.fromDict) | |
| 4226 | 4275 | , ("from_json", makeNullableEncoder encodeUnionFromJSON x.fromJSON) |
| 4227 | 4276 | , ("func", makeNullableEncoder encodeUnionFunc x.func) |
| 4228 | 4277 | , ("function", makeNullableEncoder encodeUnionFunction x.function) |
| @@ -4284,6 +4333,7 @@ encodeQuickType x = | ||
| 4284 | 4333 | , ("long", makeNullableEncoder encodeUnionLong x.long) |
| 4285 | 4334 | , ("map", makeNullableEncoder encodeUnionMap x.map) |
| 4286 | 4335 | , ("MapEntry", makeNullableEncoder encodeUnionMapEntry x.mapEntry) |
| 4336 | + , ("MarshalJSON", makeNullableEncoder encodeUnionMarshalJSON x.marshalJSON) | |
| 4287 | 4337 | , ("metadata_property_handling", makeNullableEncoder encodeUnionMetadataPropertyHandling x.metadataPropertyHandling) |
| 4288 | 4338 | , ("module", makeNullableEncoder encodeUnionModule x.quickTypeModule) |
| 4289 | 4339 | , ("mutable", makeNullableEncoder encodeUnionMutable x.mutable) |
| @@ -4398,6 +4448,7 @@ encodeQuickType x = | ||
| 4398 | 4448 | , ("TimeOnly", makeNullableEncoder encodeUnionTimeOnly x.timeOnly) |
| 4399 | 4449 | , ("TimeOnlyConverter", makeNullableEncoder encodeUnionTimeOnlyConverter x.timeOnlyConverter) |
| 4400 | 4450 | , ("TimeZone", makeNullableEncoder encodeUnionTimeZone x.timeZone) |
| 4451 | + , ("to_dict", makeNullableEncoder encodeUnionToDict x.toDict) | |
| 4401 | 4452 | , ("to_json", makeNullableEncoder encodeUnionToJSON x.toJSON) |
| 4402 | 4453 | , ("top_level", makeNullableEncoder encodeUnionTopLevel x.topLevel) |
| 4403 | 4454 | , ("toString", makeNullableEncoder encodeUnionToString x.toString) |
| @@ -4417,6 +4468,7 @@ encodeQuickType x = | ||
| 4417 | 4468 | , ("unchecked", makeNullableEncoder encodeUnionUnchecked x.unchecked) |
| 4418 | 4469 | , ("undefined", makeNullableEncoder encodeUnionUndefined x.undefined) |
| 4419 | 4470 | , ("union", makeNullableEncoder encodeUnionUnionUnion x.union) |
| 4471 | + , ("UnmarshalJSON", makeNullableEncoder encodeUnionUnmarshalJSON x.unmarshalJSON) | |
| 4420 | 4472 | , ("unowned", makeNullableEncoder encodeUnionUnowned x.unowned) |
| 4421 | 4473 | , ("unsafe", makeNullableEncoder encodeUnionUnsafe x.unsafe) |
| 4422 | 4474 | , ("unsigned", makeNullableEncoder encodeUnionUnsigned x.unsigned) |
| @@ -6818,6 +6870,28 @@ encodeFrom x = | ||
| 6818 | 6870 | [ |
| 6819 | 6871 | ] |
| 6820 | 6872 | |
| 6873 | +unionFromDict : Jdec.Decoder UnionFromDict | |
| 6874 | +unionFromDict = | |
| 6875 | + Jdec.oneOf | |
| 6876 | + [ Jdec.map DoubleInUnionFromDict Jdec.float | |
| 6877 | + , Jdec.map FromDictInUnionFromDict fromDict | |
| 6878 | + ] | |
| 6879 | + | |
| 6880 | +encodeUnionFromDict : UnionFromDict -> Jenc.Value | |
| 6881 | +encodeUnionFromDict x = case x of | |
| 6882 | + DoubleInUnionFromDict y -> Jenc.float y | |
| 6883 | + FromDictInUnionFromDict y -> encodeFromDict y | |
| 6884 | + | |
| 6885 | +fromDict : Jdec.Decoder FromDict | |
| 6886 | +fromDict = | |
| 6887 | + Jdec.dict Jdec.value |> Jdec.map (\_ -> FromDict) | |
| 6888 | + | |
| 6889 | +encodeFromDict : FromDict -> Jenc.Value | |
| 6890 | +encodeFromDict x = | |
| 6891 | + Jenc.object | |
| 6892 | + [ | |
| 6893 | + ] | |
| 6894 | + | |
| 6821 | 6895 | unionFromJSON : Jdec.Decoder UnionFromJSON |
| 6822 | 6896 | unionFromJSON = |
| 6823 | 6897 | Jdec.oneOf |
| @@ -8050,6 +8124,28 @@ encodeMapEntry x = | ||
| 8050 | 8124 | [ |
| 8051 | 8125 | ] |
| 8052 | 8126 | |
| 8127 | +unionMarshalJSON : Jdec.Decoder UnionMarshalJSON | |
| 8128 | +unionMarshalJSON = | |
| 8129 | + Jdec.oneOf | |
| 8130 | + [ Jdec.map DoubleInUnionMarshalJSON Jdec.float | |
| 8131 | + , Jdec.map MarshalJSONInUnionMarshalJSON marshalJSON | |
| 8132 | + ] | |
| 8133 | + | |
| 8134 | +encodeUnionMarshalJSON : UnionMarshalJSON -> Jenc.Value | |
| 8135 | +encodeUnionMarshalJSON x = case x of | |
| 8136 | + DoubleInUnionMarshalJSON y -> Jenc.float y | |
| 8137 | + MarshalJSONInUnionMarshalJSON y -> encodeMarshalJSON y | |
| 8138 | + | |
| 8139 | +marshalJSON : Jdec.Decoder MarshalJSON | |
| 8140 | +marshalJSON = | |
| 8141 | + Jdec.dict Jdec.value |> Jdec.map (\_ -> MarshalJSON) | |
| 8142 | + | |
| 8143 | +encodeMarshalJSON : MarshalJSON -> Jenc.Value | |
| 8144 | +encodeMarshalJSON x = | |
| 8145 | + Jenc.object | |
| 8146 | + [ | |
| 8147 | + ] | |
| 8148 | + | |
| 8053 | 8149 | unionMetadataPropertyHandling : Jdec.Decoder UnionMetadataPropertyHandling |
| 8054 | 8150 | unionMetadataPropertyHandling = |
| 8055 | 8151 | Jdec.oneOf |
| @@ -11042,6 +11138,28 @@ encodeTimeZone x = | ||
| 11042 | 11138 | [ |
| 11043 | 11139 | ] |
| 11044 | 11140 | |
| 11141 | +unionToDict : Jdec.Decoder UnionToDict | |
| 11142 | +unionToDict = | |
| 11143 | + Jdec.oneOf | |
| 11144 | + [ Jdec.map DoubleInUnionToDict Jdec.float | |
| 11145 | + , Jdec.map ToDictInUnionToDict toDict | |
| 11146 | + ] | |
| 11147 | + | |
| 11148 | +encodeUnionToDict : UnionToDict -> Jenc.Value | |
| 11149 | +encodeUnionToDict x = case x of | |
| 11150 | + DoubleInUnionToDict y -> Jenc.float y | |
| 11151 | + ToDictInUnionToDict y -> encodeToDict y | |
| 11152 | + | |
| 11153 | +toDict : Jdec.Decoder ToDict | |
| 11154 | +toDict = | |
| 11155 | + Jdec.dict Jdec.value |> Jdec.map (\_ -> ToDict) | |
| 11156 | + | |
| 11157 | +encodeToDict : ToDict -> Jenc.Value | |
| 11158 | +encodeToDict x = | |
| 11159 | + Jenc.object | |
| 11160 | + [ | |
| 11161 | + ] | |
| 11162 | + | |
| 11045 | 11163 | unionToJSON : Jdec.Decoder UnionToJSON |
| 11046 | 11164 | unionToJSON = |
| 11047 | 11165 | Jdec.oneOf |
| @@ -11394,6 +11512,28 @@ encodeUnion x = | ||
| 11394 | 11512 | [ |
| 11395 | 11513 | ] |
| 11396 | 11514 | |
| 11515 | +unionUnmarshalJSON : Jdec.Decoder UnionUnmarshalJSON | |
| 11516 | +unionUnmarshalJSON = | |
| 11517 | + Jdec.oneOf | |
| 11518 | + [ Jdec.map DoubleInUnionUnmarshalJSON Jdec.float | |
| 11519 | + , Jdec.map UnmarshalJSONInUnionUnmarshalJSON unmarshalJSON | |
| 11520 | + ] | |
| 11521 | + | |
| 11522 | +encodeUnionUnmarshalJSON : UnionUnmarshalJSON -> Jenc.Value | |
| 11523 | +encodeUnionUnmarshalJSON x = case x of | |
| 11524 | + DoubleInUnionUnmarshalJSON y -> Jenc.float y | |
| 11525 | + UnmarshalJSONInUnionUnmarshalJSON y -> encodeUnmarshalJSON y | |
| 11526 | + | |
| 11527 | +unmarshalJSON : Jdec.Decoder UnmarshalJSON | |
| 11528 | +unmarshalJSON = | |
| 11529 | + Jdec.dict Jdec.value |> Jdec.map (\_ -> UnmarshalJSON) | |
| 11530 | + | |
| 11531 | +encodeUnmarshalJSON : UnmarshalJSON -> Jenc.Value | |
| 11532 | +encodeUnmarshalJSON x = | |
| 11533 | + Jenc.object | |
| 11534 | + [ | |
| 11535 | + ] | |
| 11536 | + | |
| 11397 | 11537 | unionUnowned : Jdec.Decoder UnionUnowned |
| 11398 | 11538 | unionUnowned = |
| 11399 | 11539 | Jdec.oneOf |
Mschema-flowdefault / TopLevel.js+38 −2
| @@ -132,6 +132,7 @@ export type TopLevel = { | ||
| 132 | 132 | FormatException?: UnionFormatException; |
| 133 | 133 | friend?: UnionFriend; |
| 134 | 134 | from?: UnionFrom; |
| 135 | + from_dict?: UnionFromDict; | |
| 135 | 136 | from_json?: UnionFromJSON; |
| 136 | 137 | func?: UnionFunc; |
| 137 | 138 | function?: UnionFunction; |
| @@ -193,6 +194,7 @@ export type TopLevel = { | ||
| 193 | 194 | long?: UnionLong; |
| 194 | 195 | map?: UnionMap; |
| 195 | 196 | MapEntry?: UnionMapEntry; |
| 197 | + MarshalJSON?: UnionMarshalJSON; | |
| 196 | 198 | metadata_property_handling?: UnionMetadataPropertyHandling; |
| 197 | 199 | module?: UnionModule; |
| 198 | 200 | mutable?: UnionMutable; |
| @@ -307,6 +309,7 @@ export type TopLevel = { | ||
| 307 | 309 | TimeOnly?: UnionTimeOnly; |
| 308 | 310 | TimeOnlyConverter?: UnionTimeOnlyConverter; |
| 309 | 311 | TimeZone?: UnionTimeZone; |
| 312 | + to_dict?: UnionToDict; | |
| 310 | 313 | to_json?: UnionToJSON; |
| 311 | 314 | top_level?: UnionTopLevel; |
| 312 | 315 | toString?: UnionToString; |
| @@ -326,6 +329,7 @@ export type TopLevel = { | ||
| 326 | 329 | unchecked?: UnionUnchecked; |
| 327 | 330 | undefined?: UnionUndefined; |
| 328 | 331 | union?: UnionUnionUnion; |
| 332 | + UnmarshalJSON?: UnionUnmarshalJSON; | |
| 329 | 333 | unowned?: UnionUnowned; |
| 330 | 334 | unsafe?: UnionUnsafe; |
| 331 | 335 | unsigned?: UnionUnsigned; |
| @@ -542,6 +546,11 @@ export type UnionMapEntry = MapEntry | number; | ||
| 542 | 546 | export type MapEntry = { |
| 543 | 547 | }; |
| 544 | 548 | |
| 549 | +export type UnionMarshalJSON = MarshalJSON | number; | |
| 550 | + | |
| 551 | +export type MarshalJSON = { | |
| 552 | +}; | |
| 553 | + | |
| 545 | 554 | export type UnionNO = No | number; |
| 546 | 555 | |
| 547 | 556 | export type No = { |
| @@ -677,6 +686,11 @@ export type UnionUUID = UUID | number; | ||
| 677 | 686 | export type UUID = { |
| 678 | 687 | }; |
| 679 | 688 | |
| 689 | +export type UnionUnmarshalJSON = UnmarshalJSON | number; | |
| 690 | + | |
| 691 | +export type UnmarshalJSON = { | |
| 692 | +}; | |
| 693 | + | |
| 680 | 694 | export type UnionUseSerializers = UseSerializers | number; |
| 681 | 695 | |
| 682 | 696 | export type UseSerializers = { |
| @@ -1202,6 +1216,11 @@ export type UnionFrom = From | number; | ||
| 1202 | 1216 | export type From = { |
| 1203 | 1217 | }; |
| 1204 | 1218 | |
| 1219 | +export type UnionFromDict = FromDict | number; | |
| 1220 | + | |
| 1221 | +export type FromDict = { | |
| 1222 | +}; | |
| 1223 | + | |
| 1205 | 1224 | export type UnionFromJSON = FromJSON | number; |
| 1206 | 1225 | |
| 1207 | 1226 | export type FromJSON = { |
| @@ -1872,6 +1891,11 @@ export type UnionToString = ToString | number; | ||
| 1872 | 1891 | export type ToString = { |
| 1873 | 1892 | }; |
| 1874 | 1893 | |
| 1894 | +export type UnionToDict = ToDict | number; | |
| 1895 | + | |
| 1896 | +export type ToDict = { | |
| 1897 | +}; | |
| 1898 | + | |
| 1875 | 1899 | export type UnionToJSON = ToJSON | number; |
| 1876 | 1900 | |
| 1877 | 1901 | export type ToJSON = { |
| @@ -2136,7 +2160,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 2136 | 2160 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 2137 | 2161 | return invalidValue(l(ref || "object"), val, key, parent); |
| 2138 | 2162 | } |
| 2139 | - const result: any = {}; | |
| 2163 | + const result: any = Object.create(null); | |
| 2140 | 2164 | Object.getOwnPropertyNames(props).forEach(key => { |
| 2141 | 2165 | const prop = props[key]; |
| 2142 | 2166 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -2147,7 +2171,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 2147 | 2171 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 2148 | 2172 | } |
| 2149 | 2173 | }); |
| 2150 | - return result; | |
| 2174 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 2151 | 2175 | } |
| 2152 | 2176 | |
| 2153 | 2177 | if (typ === "any") return val; |
| @@ -2350,6 +2374,7 @@ const typeMap: any = { | ||
| 2350 | 2374 | { json: "FormatException", js: "FormatException", typ: u(undefined, u(r("FormatException"), 3.14)) }, |
| 2351 | 2375 | { json: "friend", js: "friend", typ: u(undefined, u(r("Friend"), 3.14)) }, |
| 2352 | 2376 | { json: "from", js: "from", typ: u(undefined, u(r("From"), 3.14)) }, |
| 2377 | + { json: "from_dict", js: "from_dict", typ: u(undefined, u(r("FromDict"), 3.14)) }, | |
| 2353 | 2378 | { json: "from_json", js: "from_json", typ: u(undefined, u(r("FromJSON"), 3.14)) }, |
| 2354 | 2379 | { json: "func", js: "func", typ: u(undefined, u(r("Func"), 3.14)) }, |
| 2355 | 2380 | { json: "function", js: "function", typ: u(undefined, u(r("Function"), 3.14)) }, |
| @@ -2411,6 +2436,7 @@ const typeMap: any = { | ||
| 2411 | 2436 | { json: "long", js: "long", typ: u(undefined, u(r("Long"), 3.14)) }, |
| 2412 | 2437 | { json: "map", js: "map", typ: u(undefined, u(r("Map"), 3.14)) }, |
| 2413 | 2438 | { json: "MapEntry", js: "MapEntry", typ: u(undefined, u(r("MapEntry"), 3.14)) }, |
| 2439 | + { json: "MarshalJSON", js: "MarshalJSON", typ: u(undefined, u(r("MarshalJSON"), 3.14)) }, | |
| 2414 | 2440 | { json: "metadata_property_handling", js: "metadata_property_handling", typ: u(undefined, u(r("MetadataPropertyHandling"), 3.14)) }, |
| 2415 | 2441 | { json: "module", js: "module", typ: u(undefined, u(r("Module"), 3.14)) }, |
| 2416 | 2442 | { json: "mutable", js: "mutable", typ: u(undefined, u(r("Mutable"), 3.14)) }, |
| @@ -2525,6 +2551,7 @@ const typeMap: any = { | ||
| 2525 | 2551 | { json: "TimeOnly", js: "TimeOnly", typ: u(undefined, u(r("TimeOnly"), 3.14)) }, |
| 2526 | 2552 | { json: "TimeOnlyConverter", js: "TimeOnlyConverter", typ: u(undefined, u(r("TimeOnlyConverter"), 3.14)) }, |
| 2527 | 2553 | { json: "TimeZone", js: "TimeZone", typ: u(undefined, u(r("TimeZone"), 3.14)) }, |
| 2554 | + { json: "to_dict", js: "to_dict", typ: u(undefined, u(r("ToDict"), 3.14)) }, | |
| 2528 | 2555 | { json: "to_json", js: "to_json", typ: u(undefined, u(r("ToJSON"), 3.14)) }, |
| 2529 | 2556 | { json: "top_level", js: "top_level", typ: u(undefined, u(r("TopLevelClass"), 3.14)) }, |
| 2530 | 2557 | { json: "toString", js: "toString", typ: u(undefined, u(r("ToString"), 3.14)) }, |
| @@ -2544,6 +2571,7 @@ const typeMap: any = { | ||
| 2544 | 2571 | { json: "unchecked", js: "unchecked", typ: u(undefined, u(r("Unchecked"), 3.14)) }, |
| 2545 | 2572 | { json: "undefined", js: "undefined", typ: u(undefined, u(r("Undefined"), 3.14)) }, |
| 2546 | 2573 | { json: "union", js: "union", typ: u(undefined, u(r("Union"), 3.14)) }, |
| 2574 | + { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: u(undefined, u(r("UnmarshalJSON"), 3.14)) }, | |
| 2547 | 2575 | { json: "unowned", js: "unowned", typ: u(undefined, u(r("Unowned"), 3.14)) }, |
| 2548 | 2576 | { json: "unsafe", js: "unsafe", typ: u(undefined, u(r("Unsafe"), 3.14)) }, |
| 2549 | 2577 | { json: "unsigned", js: "unsigned", typ: u(undefined, u(r("Unsigned"), 3.14)) }, |
| @@ -2644,6 +2672,8 @@ const typeMap: any = { | ||
| 2644 | 2672 | ], false), |
| 2645 | 2673 | "MapEntry": o([ |
| 2646 | 2674 | ], false), |
| 2675 | + "MarshalJSON": o([ | |
| 2676 | + ], false), | |
| 2647 | 2677 | "No": o([ |
| 2648 | 2678 | ], false), |
| 2649 | 2679 | "NSError": o([ |
| @@ -2698,6 +2728,8 @@ const typeMap: any = { | ||
| 2698 | 2728 | ], false), |
| 2699 | 2729 | "UUID": o([ |
| 2700 | 2730 | ], false), |
| 2731 | + "UnmarshalJSON": o([ | |
| 2732 | + ], false), | |
| 2701 | 2733 | "UseSerializers": o([ |
| 2702 | 2734 | ], false), |
| 2703 | 2735 | "Utf8JSONReader": o([ |
| @@ -2908,6 +2940,8 @@ const typeMap: any = { | ||
| 2908 | 2940 | ], false), |
| 2909 | 2941 | "From": o([ |
| 2910 | 2942 | ], false), |
| 2943 | + "FromDict": o([ | |
| 2944 | + ], false), | |
| 2911 | 2945 | "FromJSON": o([ |
| 2912 | 2946 | ], false), |
| 2913 | 2947 | "Func": o([ |
| @@ -3176,6 +3210,8 @@ const typeMap: any = { | ||
| 3176 | 3210 | ], false), |
| 3177 | 3211 | "ToString": o([ |
| 3178 | 3212 | ], false), |
| 3213 | + "ToDict": o([ | |
| 3214 | + ], false), | |
| 3179 | 3215 | "ToJSON": o([ |
| 3180 | 3216 | ], false), |
| 3181 | 3217 | "TopLevelClass": o([ |
Mschema-golangdefault / quicktype.go+104 −0
| @@ -144,6 +144,7 @@ type TopLevel struct { | ||
| 144 | 144 | FormatException *UnionFormatException `json:"FormatException"` |
| 145 | 145 | Friend *UnionFriend `json:"friend"` |
| 146 | 146 | From *UnionFrom `json:"from"` |
| 147 | + FromDict *UnionFromDict `json:"from_dict"` | |
| 147 | 148 | FromJSON *UnionFromJSON `json:"from_json"` |
| 148 | 149 | Func *UnionFunc `json:"func"` |
| 149 | 150 | Function *UnionFunction `json:"function"` |
| @@ -205,6 +206,7 @@ type TopLevel struct { | ||
| 205 | 206 | Long *UnionLong `json:"long"` |
| 206 | 207 | Map *UnionMap `json:"map"` |
| 207 | 208 | MapEntry *UnionMapEntry `json:"MapEntry"` |
| 209 | + MarshalJSON *UnionMarshalJSON `json:"MarshalJSON"` | |
| 208 | 210 | MetadataPropertyHandling *UnionMetadataPropertyHandling `json:"metadata_property_handling"` |
| 209 | 211 | Module *UnionModule `json:"module"` |
| 210 | 212 | Mutable *UnionMutable `json:"mutable"` |
| @@ -319,6 +321,7 @@ type TopLevel struct { | ||
| 319 | 321 | TimeOnly *UnionTimeOnly `json:"TimeOnly"` |
| 320 | 322 | TimeOnlyConverter *UnionTimeOnlyConverter `json:"TimeOnlyConverter"` |
| 321 | 323 | TimeZone *UnionTimeZone `json:"TimeZone"` |
| 324 | + ToDict *UnionToDict `json:"to_dict"` | |
| 322 | 325 | ToJSON *UnionToJSON `json:"to_json"` |
| 323 | 326 | TopLevel *UnionTopLevel `json:"top_level"` |
| 324 | 327 | ToString *UnionToString `json:"toString"` |
| @@ -338,6 +341,7 @@ type TopLevel struct { | ||
| 338 | 341 | Unchecked *UnionUnchecked `json:"unchecked"` |
| 339 | 342 | Undefined *UnionUndefined `json:"undefined"` |
| 340 | 343 | Union *UnionUnionUnion `json:"union"` |
| 344 | + UnmarshalJSON *UnionUnmarshalJSON `json:"UnmarshalJSON"` | |
| 341 | 345 | Unowned *UnionUnowned `json:"unowned"` |
| 342 | 346 | Unsafe *UnionUnsafe `json:"unsafe"` |
| 343 | 347 | Unsigned *UnionUnsigned `json:"unsigned"` |
| @@ -708,6 +712,9 @@ type Friend struct { | ||
| 708 | 712 | type From struct { |
| 709 | 713 | } |
| 710 | 714 | |
| 715 | +type FromDict struct { | |
| 716 | +} | |
| 717 | + | |
| 711 | 718 | type FromJSON struct { |
| 712 | 719 | } |
| 713 | 720 | |
| @@ -894,6 +901,9 @@ type Map struct { | ||
| 894 | 901 | type MapEntry struct { |
| 895 | 902 | } |
| 896 | 903 | |
| 904 | +type MarshalJSON struct { | |
| 905 | +} | |
| 906 | + | |
| 897 | 907 | type MetadataPropertyHandling struct { |
| 898 | 908 | } |
| 899 | 909 | |
| @@ -1227,6 +1237,9 @@ type TimeOnlyConverter struct { | ||
| 1227 | 1237 | type TimeZone struct { |
| 1228 | 1238 | } |
| 1229 | 1239 | |
| 1240 | +type ToDict struct { | |
| 1241 | +} | |
| 1242 | + | |
| 1230 | 1243 | type ToJSON struct { |
| 1231 | 1244 | } |
| 1232 | 1245 | |
| @@ -1311,6 +1324,9 @@ type Undefined struct { | ||
| 1311 | 1324 | type Union struct { |
| 1312 | 1325 | } |
| 1313 | 1326 | |
| 1327 | +type UnmarshalJSON struct { | |
| 1328 | +} | |
| 1329 | + | |
| 1314 | 1330 | type Unowned struct { |
| 1315 | 1331 | } |
| 1316 | 1332 | |
| @@ -3907,6 +3923,28 @@ func (x *UnionFrom) MarshalJSON() ([]byte, error) { | ||
| 3907 | 3923 | return marshalUnion(nil, x.Double, nil, nil, false, nil, x.From != nil, x.From, false, nil, false, nil, false) |
| 3908 | 3924 | } |
| 3909 | 3925 | |
| 3926 | +type UnionFromDict struct { | |
| 3927 | + Double *float64 | |
| 3928 | + FromDict *FromDict | |
| 3929 | +} | |
| 3930 | + | |
| 3931 | +func (x *UnionFromDict) UnmarshalJSON(data []byte) error { | |
| 3932 | + x.FromDict = nil | |
| 3933 | + var c FromDict | |
| 3934 | + object, err := unmarshalUnion(data, nil, &x.Double, nil, nil, false, nil, true, &c, false, nil, false, nil, false) | |
| 3935 | + if err != nil { | |
| 3936 | + return err | |
| 3937 | + } | |
| 3938 | + if object { | |
| 3939 | + x.FromDict = &c | |
| 3940 | + } | |
| 3941 | + return nil | |
| 3942 | +} | |
| 3943 | + | |
| 3944 | +func (x *UnionFromDict) MarshalJSON() ([]byte, error) { | |
| 3945 | + return marshalUnion(nil, x.Double, nil, nil, false, nil, x.FromDict != nil, x.FromDict, false, nil, false, nil, false) | |
| 3946 | +} | |
| 3947 | + | |
| 3910 | 3948 | type UnionFromJSON struct { |
| 3911 | 3949 | Double *float64 |
| 3912 | 3950 | FromJSON *FromJSON |
| @@ -5271,6 +5309,28 @@ func (x *UnionMapEntry) MarshalJSON() ([]byte, error) { | ||
| 5271 | 5309 | return marshalUnion(nil, x.Double, nil, nil, false, nil, x.MapEntry != nil, x.MapEntry, false, nil, false, nil, false) |
| 5272 | 5310 | } |
| 5273 | 5311 | |
| 5312 | +type UnionMarshalJSON struct { | |
| 5313 | + Double *float64 | |
| 5314 | + PurpleMarshalJSON *MarshalJSON | |
| 5315 | +} | |
| 5316 | + | |
| 5317 | +func (x *UnionMarshalJSON) UnmarshalJSON(data []byte) error { | |
| 5318 | + x.PurpleMarshalJSON = nil | |
| 5319 | + var c MarshalJSON | |
| 5320 | + object, err := unmarshalUnion(data, nil, &x.Double, nil, nil, false, nil, true, &c, false, nil, false, nil, false) | |
| 5321 | + if err != nil { | |
| 5322 | + return err | |
| 5323 | + } | |
| 5324 | + if object { | |
| 5325 | + x.PurpleMarshalJSON = &c | |
| 5326 | + } | |
| 5327 | + return nil | |
| 5328 | +} | |
| 5329 | + | |
| 5330 | +func (x *UnionMarshalJSON) MarshalJSON() ([]byte, error) { | |
| 5331 | + return marshalUnion(nil, x.Double, nil, nil, false, nil, x.PurpleMarshalJSON != nil, x.PurpleMarshalJSON, false, nil, false, nil, false) | |
| 5332 | +} | |
| 5333 | + | |
| 5274 | 5334 | type UnionMetadataPropertyHandling struct { |
| 5275 | 5335 | Double *float64 |
| 5276 | 5336 | MetadataPropertyHandling *MetadataPropertyHandling |
| @@ -7713,6 +7773,28 @@ func (x *UnionTimeZone) MarshalJSON() ([]byte, error) { | ||
| 7713 | 7773 | return marshalUnion(nil, x.Double, nil, nil, false, nil, x.TimeZone != nil, x.TimeZone, false, nil, false, nil, false) |
| 7714 | 7774 | } |
| 7715 | 7775 | |
| 7776 | +type UnionToDict struct { | |
| 7777 | + Double *float64 | |
| 7778 | + ToDict *ToDict | |
| 7779 | +} | |
| 7780 | + | |
| 7781 | +func (x *UnionToDict) UnmarshalJSON(data []byte) error { | |
| 7782 | + x.ToDict = nil | |
| 7783 | + var c ToDict | |
| 7784 | + object, err := unmarshalUnion(data, nil, &x.Double, nil, nil, false, nil, true, &c, false, nil, false, nil, false) | |
| 7785 | + if err != nil { | |
| 7786 | + return err | |
| 7787 | + } | |
| 7788 | + if object { | |
| 7789 | + x.ToDict = &c | |
| 7790 | + } | |
| 7791 | + return nil | |
| 7792 | +} | |
| 7793 | + | |
| 7794 | +func (x *UnionToDict) MarshalJSON() ([]byte, error) { | |
| 7795 | + return marshalUnion(nil, x.Double, nil, nil, false, nil, x.ToDict != nil, x.ToDict, false, nil, false, nil, false) | |
| 7796 | +} | |
| 7797 | + | |
| 7716 | 7798 | type UnionToJSON struct { |
| 7717 | 7799 | Double *float64 |
| 7718 | 7800 | ToJSON *ToJSON |
| @@ -8329,6 +8411,28 @@ func (x *UnionUnionUnion) MarshalJSON() ([]byte, error) { | ||
| 8329 | 8411 | return marshalUnion(nil, x.Double, nil, nil, false, nil, x.Union != nil, x.Union, false, nil, false, nil, false) |
| 8330 | 8412 | } |
| 8331 | 8413 | |
| 8414 | +type UnionUnmarshalJSON struct { | |
| 8415 | + Double *float64 | |
| 8416 | + PurpleUnmarshalJSON *UnmarshalJSON | |
| 8417 | +} | |
| 8418 | + | |
| 8419 | +func (x *UnionUnmarshalJSON) UnmarshalJSON(data []byte) error { | |
| 8420 | + x.PurpleUnmarshalJSON = nil | |
| 8421 | + var c UnmarshalJSON | |
| 8422 | + object, err := unmarshalUnion(data, nil, &x.Double, nil, nil, false, nil, true, &c, false, nil, false, nil, false) | |
| 8423 | + if err != nil { | |
| 8424 | + return err | |
| 8425 | + } | |
| 8426 | + if object { | |
| 8427 | + x.PurpleUnmarshalJSON = &c | |
| 8428 | + } | |
| 8429 | + return nil | |
| 8430 | +} | |
| 8431 | + | |
| 8432 | +func (x *UnionUnmarshalJSON) MarshalJSON() ([]byte, error) { | |
| 8433 | + return marshalUnion(nil, x.Double, nil, nil, false, nil, x.PurpleUnmarshalJSON != nil, x.PurpleUnmarshalJSON, false, nil, false, nil, false) | |
| 8434 | +} | |
| 8435 | + | |
| 8332 | 8436 | type UnionUnowned struct { |
| 8333 | 8437 | Double *float64 |
| 8334 | 8438 | Unowned *Unowned |
Mschema-haskelldefault / QuickType.hs+113 −1
| @@ -112,6 +112,7 @@ module QuickType | ||
| 112 | 112 | , FormatException (..) |
| 113 | 113 | , Friend (..) |
| 114 | 114 | , From (..) |
| 115 | + , FromDict (..) | |
| 115 | 116 | , FromJSONClass (..) |
| 116 | 117 | , Func (..) |
| 117 | 118 | , Function (..) |
| @@ -168,6 +169,7 @@ module QuickType | ||
| 168 | 169 | , Long (..) |
| 169 | 170 | , MapClass (..) |
| 170 | 171 | , MapEntry (..) |
| 172 | + , MarshalJSON (..) | |
| 171 | 173 | , MetadataPropertyHandling (..) |
| 172 | 174 | , Mutable (..) |
| 173 | 175 | , Mutating (..) |
| @@ -303,6 +305,7 @@ module QuickType | ||
| 303 | 305 | , TimeOnly (..) |
| 304 | 306 | , TimeOnlyConverter (..) |
| 305 | 307 | , TimeZone (..) |
| 308 | + , ToDict (..) | |
| 306 | 309 | , ToJSONClass (..) |
| 307 | 310 | , ToString (..) |
| 308 | 311 | , TopLevel (..) |
| @@ -319,6 +322,7 @@ module QuickType | ||
| 319 | 322 | , Unchecked (..) |
| 320 | 323 | , Undefined (..) |
| 321 | 324 | , Union (..) |
| 325 | + , UnmarshalJSON (..) | |
| 322 | 326 | , Unowned (..) |
| 323 | 327 | , Unsafe (..) |
| 324 | 328 | , Unsigned (..) |
| @@ -450,6 +454,7 @@ module QuickType | ||
| 450 | 454 | , UnionFormatException (..) |
| 451 | 455 | , UnionFriend (..) |
| 452 | 456 | , UnionFrom (..) |
| 457 | + , UnionFromDict (..) | |
| 453 | 458 | , UnionFromJSON (..) |
| 454 | 459 | , UnionFunc (..) |
| 455 | 460 | , UnionFunction (..) |
| @@ -506,6 +511,7 @@ module QuickType | ||
| 506 | 511 | , UnionLong (..) |
| 507 | 512 | , UnionMap (..) |
| 508 | 513 | , UnionMapEntry (..) |
| 514 | + , UnionMarshalJSON (..) | |
| 509 | 515 | , UnionMetadataPropertyHandling (..) |
| 510 | 516 | , UnionMutable (..) |
| 511 | 517 | , UnionMutating (..) |
| @@ -641,6 +647,7 @@ module QuickType | ||
| 641 | 647 | , UnionTimeOnly (..) |
| 642 | 648 | , UnionTimeOnlyConverter (..) |
| 643 | 649 | , UnionTimeZone (..) |
| 650 | + , UnionToDict (..) | |
| 644 | 651 | , UnionToJSON (..) |
| 645 | 652 | , UnionToString (..) |
| 646 | 653 | , UnionTopLevel (..) |
| @@ -657,6 +664,7 @@ module QuickType | ||
| 657 | 664 | , UnionUnchecked (..) |
| 658 | 665 | , UnionUndefined (..) |
| 659 | 666 | , UnionUnionUnion (..) |
| 667 | + , UnionUnmarshalJSON (..) | |
| 660 | 668 | , UnionUnowned (..) |
| 661 | 669 | , UnionUnsafe (..) |
| 662 | 670 | , UnionUnsigned (..) |
| @@ -811,6 +819,7 @@ data QuickType = QuickType | ||
| 811 | 819 | , formatExceptionQuickType :: Maybe UnionFormatException |
| 812 | 820 | , friendQuickType :: Maybe UnionFriend |
| 813 | 821 | , fromQuickType :: Maybe UnionFrom |
| 822 | + , fromDictQuickType :: Maybe UnionFromDict | |
| 814 | 823 | , fromJSONQuickType :: Maybe UnionFromJSON |
| 815 | 824 | , funcQuickType :: Maybe UnionFunc |
| 816 | 825 | , functionQuickType :: Maybe UnionFunction |
| @@ -872,6 +881,7 @@ data QuickType = QuickType | ||
| 872 | 881 | , longQuickType :: Maybe UnionLong |
| 873 | 882 | , mapQuickType :: Maybe UnionMap |
| 874 | 883 | , mapEntryQuickType :: Maybe UnionMapEntry |
| 884 | + , marshalJSONQuickType :: Maybe UnionMarshalJSON | |
| 875 | 885 | , metadataPropertyHandlingQuickType :: Maybe UnionMetadataPropertyHandling |
| 876 | 886 | , quickTypeModuleQuickType :: Maybe UnionModule |
| 877 | 887 | , mutableQuickType :: Maybe UnionMutable |
| @@ -986,6 +996,7 @@ data QuickType = QuickType | ||
| 986 | 996 | , timeOnlyQuickType :: Maybe UnionTimeOnly |
| 987 | 997 | , timeOnlyConverterQuickType :: Maybe UnionTimeOnlyConverter |
| 988 | 998 | , timeZoneQuickType :: Maybe UnionTimeZone |
| 999 | + , toDictQuickType :: Maybe UnionToDict | |
| 989 | 1000 | , toJSONQuickType :: Maybe UnionToJSON |
| 990 | 1001 | , topLevelQuickType :: Maybe UnionTopLevel |
| 991 | 1002 | , toStringQuickType :: Maybe UnionToString |
| @@ -1005,6 +1016,7 @@ data QuickType = QuickType | ||
| 1005 | 1016 | , uncheckedQuickType :: Maybe UnionUnchecked |
| 1006 | 1017 | , undefinedQuickType :: Maybe UnionUndefined |
| 1007 | 1018 | , unionQuickType :: Maybe UnionUnionUnion |
| 1019 | + , unmarshalJSONQuickType :: Maybe UnionUnmarshalJSON | |
| 1008 | 1020 | , unownedQuickType :: Maybe UnionUnowned |
| 1009 | 1021 | , unsafeQuickType :: Maybe UnionUnsafe |
| 1010 | 1022 | , unsignedQuickType :: Maybe UnionUnsigned |
| @@ -2011,6 +2023,15 @@ data From = From | ||
| 2011 | 2023 | { |
| 2012 | 2024 | } deriving (Show) |
| 2013 | 2025 | |
| 2026 | +data UnionFromDict | |
| 2027 | + = DoubleInUnionFromDict Double | |
| 2028 | + | FromDictInUnionFromDict FromDict | |
| 2029 | + deriving (Show) | |
| 2030 | + | |
| 2031 | +data FromDict = FromDict | |
| 2032 | + { | |
| 2033 | + } deriving (Show) | |
| 2034 | + | |
| 2014 | 2035 | data UnionFromJSON |
| 2015 | 2036 | = DoubleInUnionFromJSON Double |
| 2016 | 2037 | | FromJSONClassInUnionFromJSON FromJSONClass |
| @@ -2515,6 +2536,15 @@ data MapEntry = MapEntry | ||
| 2515 | 2536 | { |
| 2516 | 2537 | } deriving (Show) |
| 2517 | 2538 | |
| 2539 | +data UnionMarshalJSON | |
| 2540 | + = DoubleInUnionMarshalJSON Double | |
| 2541 | + | MarshalJSONInUnionMarshalJSON MarshalJSON | |
| 2542 | + deriving (Show) | |
| 2543 | + | |
| 2544 | +data MarshalJSON = MarshalJSON | |
| 2545 | + { | |
| 2546 | + } deriving (Show) | |
| 2547 | + | |
| 2518 | 2548 | data UnionMetadataPropertyHandling |
| 2519 | 2549 | = DoubleInUnionMetadataPropertyHandling Double |
| 2520 | 2550 | | MetadataPropertyHandlingInUnionMetadataPropertyHandling MetadataPropertyHandling |
| @@ -3730,6 +3760,15 @@ data TimeZone = TimeZone | ||
| 3730 | 3760 | { |
| 3731 | 3761 | } deriving (Show) |
| 3732 | 3762 | |
| 3763 | +data UnionToDict | |
| 3764 | + = DoubleInUnionToDict Double | |
| 3765 | + | ToDictInUnionToDict ToDict | |
| 3766 | + deriving (Show) | |
| 3767 | + | |
| 3768 | +data ToDict = ToDict | |
| 3769 | + { | |
| 3770 | + } deriving (Show) | |
| 3771 | + | |
| 3733 | 3772 | data UnionToJSON |
| 3734 | 3773 | = DoubleInUnionToJSON Double |
| 3735 | 3774 | | ToJSONClassInUnionToJSON ToJSONClass |
| @@ -3874,6 +3913,15 @@ data Union = Union | ||
| 3874 | 3913 | { |
| 3875 | 3914 | } deriving (Show) |
| 3876 | 3915 | |
| 3916 | +data UnionUnmarshalJSON | |
| 3917 | + = DoubleInUnionUnmarshalJSON Double | |
| 3918 | + | UnmarshalJSONInUnionUnmarshalJSON UnmarshalJSON | |
| 3919 | + deriving (Show) | |
| 3920 | + | |
| 3921 | +data UnmarshalJSON = UnmarshalJSON | |
| 3922 | + { | |
| 3923 | + } deriving (Show) | |
| 3924 | + | |
| 3877 | 3925 | data UnionUnowned |
| 3878 | 3926 | = DoubleInUnionUnowned Double |
| 3879 | 3927 | | UnownedInUnionUnowned Unowned |
| @@ -4076,7 +4124,7 @@ decodeTopLevel :: ByteString -> Maybe QuickType | ||
| 4076 | 4124 | decodeTopLevel = decode |
| 4077 | 4125 | |
| 4078 | 4126 | instance ToJSON QuickType where |
| 4079 | - toJSON (QuickType emptyQuickType quickTypeBoolQuickType complexQuickType imagineryQuickType abstractQuickType alignasQuickType alignofQuickType andQuickType andEqQuickType quickTypeAnyQuickType anyQuickType arrayQuickType quickTypeAsQuickType asmQuickType assertQuickType associatedtypeQuickType associativityQuickType asyncQuickType atomicQuickType atomicCancelQuickType atomicCommitQuickType atomicNoexceptQuickType autoQuickType awaitQuickType baseQuickType bitandQuickType bitorQuickType boolQuickType purpleBoolQuickType booleanQuickType breakQuickType bycopyQuickType byrefQuickType byteQuickType calendarQuickType quickTypeCaseQuickType catchQuickType chanQuickType charQuickType char16TQuickType char32TQuickType checkedQuickType purpleClassQuickType quickTypeClassQuickType cloneQuickType coAwaitQuickType coReturnQuickType coYieldQuickType codableQuickType codingKeyQuickType codingKeysQuickType complQuickType conceptQuickType consoleQuickType constQuickType constCastQuickType constexprQuickType constructorQuickType continueQuickType convenienceQuickType convertQuickType converterQuickType cultureInfoQuickType dateQuickType dateParseHandlingQuickType dateFormatterQuickType dateOnlyQuickType dateOnlyConverterQuickType dateTimeQuickType dateTimeStylesQuickType debuggerQuickType decimalQuickType declareQuickType decltypeQuickType decodeStringQuickType decoderQuickType decodingErrorQuickType defQuickType quickTypeDefaultQuickType deferQuickType deinitQuickType delQuickType delegateQuickType deleteQuickType dictQuickType dictionaryQuickType didSetQuickType quickTypeDoQuickType doubleQuickType dummyQuickType dynamicQuickType dynamicCastQuickType elifQuickType quickTypeElseQuickType encodeQuickTypeQuickType encoderQuickType enumQuickType enumValuesQuickType equalityContractQuickType equatableQuickType eventQuickType exceptQuickType exceptionQuickType explicitQuickType exportQuickType exposingQuickType extendsQuickType extensionQuickType externQuickType fallthroughQuickType quickTypeFalseQuickType falseQuickType fileprivateQuickType finalQuickType finallyQuickType fixedQuickType floatQuickType forQuickType foreachQuickType formatExceptionQuickType friendQuickType fromQuickType fromJSONQuickType funcQuickType functionQuickType getQuickType globalQuickType goQuickType gotoQuickType guardQuickType hashableQuickType hashCodeQuickType hasherQuickType hasOwnPropertyQuickType quickTypeIDQuickType quickTypeIfQuickType impQuickType implementsQuickType implicitQuickType quickTypeImportQuickType quickTypeInQuickType indirectQuickType quickTypeInfixQuickType initQuickType inlineQuickType inoutQuickType instanceofQuickType intQuickType interfaceQuickType internalQuickType isQuickType isoDateTimeOffsetConverterQuickType iterableQuickType jdecQuickType jencQuickType jpipeQuickType jsonQuickType jsonConverterQuickType jsonSerializerQuickType jsonTokenQuickType jsonWriterQuickType jsonAnyQuickType jsonCodingKeyQuickType jsonDecoderQuickType jsonEncoderQuickType jsonExceptionQuickType jsonGeneratorQuickType jsonNodeQuickType jsonNullQuickType jsonParserQuickType jsonReaderQuickType jsonTokenTypeQuickType kSerializerQuickType lambdaQuickType lazyQuickType leftQuickType quickTypeLetQuickType listQuickType localeQuickType lockQuickType longQuickType mapQuickType mapEntryQuickType metadataPropertyHandlingQuickType quickTypeModuleQuickType mutableQuickType mutatingQuickType namespaceQuickType nativeQuickType newQuickType newtonsoftQuickType nilQuickType noQuickType noexceptQuickType nonatomicQuickType quickTypeNoneQuickType noneQuickType nonlocalQuickType nonmutatingQuickType noSuchMethodQuickType notQuickType notEqQuickType nsErrorQuickType nsObjectQuickType nsStringQuickType nullQuickType quickTypeNullQuickType nullptrQuickType numberQuickType objectQuickType objectMapperQuickType quickTypeOfQuickType onewayQuickType openQuickType operatorQuickType optionalQuickType orQuickType orEqQuickType outQuickType overrideQuickType packageQuickType paramsQuickType passQuickType portQuickType postfixQuickType precedenceQuickType prefixQuickType primitiveKindQuickType printQuickType printfQuickType printMembersQuickType privateQuickType protectedQuickType protocolQuickType quickTypeProtocolQuickType publicQuickType quicktypeQuickType raiseQuickType rangeQuickType readonlyQuickType refQuickType regExpQuickType registerQuickType reinterpretCastQuickType repeatQuickType requireQuickType requiredQuickType requiresQuickType restrictQuickType retainQuickType rethrowsQuickType returnQuickType rightQuickType runtimeTypeQuickType sQuickType sbyteQuickType sealedQuickType selQuickType selectQuickType selfQuickType quickTypeSelfQuickType sendableQuickType serialDescriptorQuickType serializableQuickType serializeQuickType serializerProviderQuickType serialNameQuickType setQuickType shortQuickType signedQuickType simpleModuleQuickType sizeofQuickType stackallocQuickType standardsQuickType staticQuickType staticAssertQuickType staticCastQuickType stdDeserializerQuickType stdSerializerQuickType strictfpQuickType stringQuickType structQuickType subscriptQuickType superQuickType switchQuickType symbolQuickType synchronizedQuickType systemQuickType templateQuickType quickTypeThenQuickType thisQuickType threadLocalQuickType throwQuickType throwsQuickType timeOnlyQuickType timeOnlyConverterQuickType timeZoneQuickType toJSONQuickType topLevelQuickType toStringQuickType transientQuickType trueQuickType quickTypeTrueQuickType tryQuickType quickTypeTypeQuickType purpleTypeQuickType typealiasQuickType typedefQuickType typeidQuickType typenameQuickType typeofQuickType uintQuickType ulongQuickType uncheckedQuickType undefinedQuickType unionQuickType unownedQuickType unsafeQuickType unsignedQuickType useSerializersQuickType ushortQuickType usingQuickType utf8JSONReaderQuickType utf8JSONWriterQuickType uuidQuickType varQuickType virtualQuickType voidQuickType volatileQuickType wcharTQuickType weakQuickType quickTypeWhereQuickType whileQuickType willSetQuickType withQuickType xorQuickType xorEqQuickType yesQuickType yieldQuickType) = | |
| 4127 | + toJSON (QuickType emptyQuickType quickTypeBoolQuickType complexQuickType imagineryQuickType abstractQuickType alignasQuickType alignofQuickType andQuickType andEqQuickType quickTypeAnyQuickType anyQuickType arrayQuickType quickTypeAsQuickType asmQuickType assertQuickType associatedtypeQuickType associativityQuickType asyncQuickType atomicQuickType atomicCancelQuickType atomicCommitQuickType atomicNoexceptQuickType autoQuickType awaitQuickType baseQuickType bitandQuickType bitorQuickType boolQuickType purpleBoolQuickType booleanQuickType breakQuickType bycopyQuickType byrefQuickType byteQuickType calendarQuickType quickTypeCaseQuickType catchQuickType chanQuickType charQuickType char16TQuickType char32TQuickType checkedQuickType purpleClassQuickType quickTypeClassQuickType cloneQuickType coAwaitQuickType coReturnQuickType coYieldQuickType codableQuickType codingKeyQuickType codingKeysQuickType complQuickType conceptQuickType consoleQuickType constQuickType constCastQuickType constexprQuickType constructorQuickType continueQuickType convenienceQuickType convertQuickType converterQuickType cultureInfoQuickType dateQuickType dateParseHandlingQuickType dateFormatterQuickType dateOnlyQuickType dateOnlyConverterQuickType dateTimeQuickType dateTimeStylesQuickType debuggerQuickType decimalQuickType declareQuickType decltypeQuickType decodeStringQuickType decoderQuickType decodingErrorQuickType defQuickType quickTypeDefaultQuickType deferQuickType deinitQuickType delQuickType delegateQuickType deleteQuickType dictQuickType dictionaryQuickType didSetQuickType quickTypeDoQuickType doubleQuickType dummyQuickType dynamicQuickType dynamicCastQuickType elifQuickType quickTypeElseQuickType encodeQuickTypeQuickType encoderQuickType enumQuickType enumValuesQuickType equalityContractQuickType equatableQuickType eventQuickType exceptQuickType exceptionQuickType explicitQuickType exportQuickType exposingQuickType extendsQuickType extensionQuickType externQuickType fallthroughQuickType quickTypeFalseQuickType falseQuickType fileprivateQuickType finalQuickType finallyQuickType fixedQuickType floatQuickType forQuickType foreachQuickType formatExceptionQuickType friendQuickType fromQuickType fromDictQuickType fromJSONQuickType funcQuickType functionQuickType getQuickType globalQuickType goQuickType gotoQuickType guardQuickType hashableQuickType hashCodeQuickType hasherQuickType hasOwnPropertyQuickType quickTypeIDQuickType quickTypeIfQuickType impQuickType implementsQuickType implicitQuickType quickTypeImportQuickType quickTypeInQuickType indirectQuickType quickTypeInfixQuickType initQuickType inlineQuickType inoutQuickType instanceofQuickType intQuickType interfaceQuickType internalQuickType isQuickType isoDateTimeOffsetConverterQuickType iterableQuickType jdecQuickType jencQuickType jpipeQuickType jsonQuickType jsonConverterQuickType jsonSerializerQuickType jsonTokenQuickType jsonWriterQuickType jsonAnyQuickType jsonCodingKeyQuickType jsonDecoderQuickType jsonEncoderQuickType jsonExceptionQuickType jsonGeneratorQuickType jsonNodeQuickType jsonNullQuickType jsonParserQuickType jsonReaderQuickType jsonTokenTypeQuickType kSerializerQuickType lambdaQuickType lazyQuickType leftQuickType quickTypeLetQuickType listQuickType localeQuickType lockQuickType longQuickType mapQuickType mapEntryQuickType marshalJSONQuickType metadataPropertyHandlingQuickType quickTypeModuleQuickType mutableQuickType mutatingQuickType namespaceQuickType nativeQuickType newQuickType newtonsoftQuickType nilQuickType noQuickType noexceptQuickType nonatomicQuickType quickTypeNoneQuickType noneQuickType nonlocalQuickType nonmutatingQuickType noSuchMethodQuickType notQuickType notEqQuickType nsErrorQuickType nsObjectQuickType nsStringQuickType nullQuickType quickTypeNullQuickType nullptrQuickType numberQuickType objectQuickType objectMapperQuickType quickTypeOfQuickType onewayQuickType openQuickType operatorQuickType optionalQuickType orQuickType orEqQuickType outQuickType overrideQuickType packageQuickType paramsQuickType passQuickType portQuickType postfixQuickType precedenceQuickType prefixQuickType primitiveKindQuickType printQuickType printfQuickType printMembersQuickType privateQuickType protectedQuickType protocolQuickType quickTypeProtocolQuickType publicQuickType quicktypeQuickType raiseQuickType rangeQuickType readonlyQuickType refQuickType regExpQuickType registerQuickType reinterpretCastQuickType repeatQuickType requireQuickType requiredQuickType requiresQuickType restrictQuickType retainQuickType rethrowsQuickType returnQuickType rightQuickType runtimeTypeQuickType sQuickType sbyteQuickType sealedQuickType selQuickType selectQuickType selfQuickType quickTypeSelfQuickType sendableQuickType serialDescriptorQuickType serializableQuickType serializeQuickType serializerProviderQuickType serialNameQuickType setQuickType shortQuickType signedQuickType simpleModuleQuickType sizeofQuickType stackallocQuickType standardsQuickType staticQuickType staticAssertQuickType staticCastQuickType stdDeserializerQuickType stdSerializerQuickType strictfpQuickType stringQuickType structQuickType subscriptQuickType superQuickType switchQuickType symbolQuickType synchronizedQuickType systemQuickType templateQuickType quickTypeThenQuickType thisQuickType threadLocalQuickType throwQuickType throwsQuickType timeOnlyQuickType timeOnlyConverterQuickType timeZoneQuickType toDictQuickType toJSONQuickType topLevelQuickType toStringQuickType transientQuickType trueQuickType quickTypeTrueQuickType tryQuickType quickTypeTypeQuickType purpleTypeQuickType typealiasQuickType typedefQuickType typeidQuickType typenameQuickType typeofQuickType uintQuickType ulongQuickType uncheckedQuickType undefinedQuickType unionQuickType unmarshalJSONQuickType unownedQuickType unsafeQuickType unsignedQuickType useSerializersQuickType ushortQuickType usingQuickType utf8JSONReaderQuickType utf8JSONWriterQuickType uuidQuickType varQuickType virtualQuickType voidQuickType volatileQuickType wcharTQuickType weakQuickType quickTypeWhereQuickType whileQuickType willSetQuickType withQuickType xorQuickType xorEqQuickType yesQuickType yieldQuickType) = | |
| 4080 | 4128 | object $ foldMap (maybe [] pure) |
| 4081 | 4129 | [ ("_" .=) <$> emptyQuickType |
| 4082 | 4130 | , ("_Bool" .=) <$> quickTypeBoolQuickType |
| @@ -4200,6 +4248,7 @@ instance ToJSON QuickType where | ||
| 4200 | 4248 | , ("FormatException" .=) <$> formatExceptionQuickType |
| 4201 | 4249 | , ("friend" .=) <$> friendQuickType |
| 4202 | 4250 | , ("from" .=) <$> fromQuickType |
| 4251 | + , ("from_dict" .=) <$> fromDictQuickType | |
| 4203 | 4252 | , ("from_json" .=) <$> fromJSONQuickType |
| 4204 | 4253 | , ("func" .=) <$> funcQuickType |
| 4205 | 4254 | , ("function" .=) <$> functionQuickType |
| @@ -4261,6 +4310,7 @@ instance ToJSON QuickType where | ||
| 4261 | 4310 | , ("long" .=) <$> longQuickType |
| 4262 | 4311 | , ("map" .=) <$> mapQuickType |
| 4263 | 4312 | , ("MapEntry" .=) <$> mapEntryQuickType |
| 4313 | + , ("MarshalJSON" .=) <$> marshalJSONQuickType | |
| 4264 | 4314 | , ("metadata_property_handling" .=) <$> metadataPropertyHandlingQuickType |
| 4265 | 4315 | , ("module" .=) <$> quickTypeModuleQuickType |
| 4266 | 4316 | , ("mutable" .=) <$> mutableQuickType |
| @@ -4375,6 +4425,7 @@ instance ToJSON QuickType where | ||
| 4375 | 4425 | , ("TimeOnly" .=) <$> timeOnlyQuickType |
| 4376 | 4426 | , ("TimeOnlyConverter" .=) <$> timeOnlyConverterQuickType |
| 4377 | 4427 | , ("TimeZone" .=) <$> timeZoneQuickType |
| 4428 | + , ("to_dict" .=) <$> toDictQuickType | |
| 4378 | 4429 | , ("to_json" .=) <$> toJSONQuickType |
| 4379 | 4430 | , ("top_level" .=) <$> topLevelQuickType |
| 4380 | 4431 | , ("toString" .=) <$> toStringQuickType |
| @@ -4394,6 +4445,7 @@ instance ToJSON QuickType where | ||
| 4394 | 4445 | , ("unchecked" .=) <$> uncheckedQuickType |
| 4395 | 4446 | , ("undefined" .=) <$> undefinedQuickType |
| 4396 | 4447 | , ("union" .=) <$> unionQuickType |
| 4448 | + , ("UnmarshalJSON" .=) <$> unmarshalJSONQuickType | |
| 4397 | 4449 | , ("unowned" .=) <$> unownedQuickType |
| 4398 | 4450 | , ("unsafe" .=) <$> unsafeQuickType |
| 4399 | 4451 | , ("unsigned" .=) <$> unsignedQuickType |
| @@ -4543,6 +4595,7 @@ instance FromJSON QuickType where | ||
| 4543 | 4595 | <*> v .:! "FormatException" |
| 4544 | 4596 | <*> v .:! "friend" |
| 4545 | 4597 | <*> v .:! "from" |
| 4598 | + <*> v .:! "from_dict" | |
| 4546 | 4599 | <*> v .:! "from_json" |
| 4547 | 4600 | <*> v .:! "func" |
| 4548 | 4601 | <*> v .:! "function" |
| @@ -4604,6 +4657,7 @@ instance FromJSON QuickType where | ||
| 4604 | 4657 | <*> v .:! "long" |
| 4605 | 4658 | <*> v .:! "map" |
| 4606 | 4659 | <*> v .:! "MapEntry" |
| 4660 | + <*> v .:! "MarshalJSON" | |
| 4607 | 4661 | <*> v .:! "metadata_property_handling" |
| 4608 | 4662 | <*> v .:! "module" |
| 4609 | 4663 | <*> v .:! "mutable" |
| @@ -4718,6 +4772,7 @@ instance FromJSON QuickType where | ||
| 4718 | 4772 | <*> v .:! "TimeOnly" |
| 4719 | 4773 | <*> v .:! "TimeOnlyConverter" |
| 4720 | 4774 | <*> v .:! "TimeZone" |
| 4775 | + <*> v .:! "to_dict" | |
| 4721 | 4776 | <*> v .:! "to_json" |
| 4722 | 4777 | <*> v .:! "top_level" |
| 4723 | 4778 | <*> v .:! "toString" |
| @@ -4737,6 +4792,7 @@ instance FromJSON QuickType where | ||
| 4737 | 4792 | <*> v .:! "unchecked" |
| 4738 | 4793 | <*> v .:! "undefined" |
| 4739 | 4794 | <*> v .:! "union" |
| 4795 | + <*> v .:! "UnmarshalJSON" | |
| 4740 | 4796 | <*> v .:! "unowned" |
| 4741 | 4797 | <*> v .:! "unsafe" |
| 4742 | 4798 | <*> v .:! "unsigned" |
| @@ -6287,6 +6343,20 @@ instance ToJSON From where | ||
| 6287 | 6343 | instance FromJSON From where |
| 6288 | 6344 | parseJSON (Object _) = return From |
| 6289 | 6345 | |
| 6346 | +instance ToJSON UnionFromDict where | |
| 6347 | + toJSON (DoubleInUnionFromDict x) = toJSON x | |
| 6348 | + toJSON (FromDictInUnionFromDict x) = toJSON x | |
| 6349 | + | |
| 6350 | +instance FromJSON UnionFromDict where | |
| 6351 | + parseJSON xs@(Number _) = (fmap DoubleInUnionFromDict . parseJSON) xs | |
| 6352 | + parseJSON xs@(Object _) = (fmap FromDictInUnionFromDict . parseJSON) xs | |
| 6353 | + | |
| 6354 | +instance ToJSON FromDict where | |
| 6355 | + toJSON = \_ -> emptyObject | |
| 6356 | + | |
| 6357 | +instance FromJSON FromDict where | |
| 6358 | + parseJSON (Object _) = return FromDict | |
| 6359 | + | |
| 6290 | 6360 | instance ToJSON UnionFromJSON where |
| 6291 | 6361 | toJSON (DoubleInUnionFromJSON x) = toJSON x |
| 6292 | 6362 | toJSON (FromJSONClassInUnionFromJSON x) = toJSON x |
| @@ -7071,6 +7141,20 @@ instance ToJSON MapEntry where | ||
| 7071 | 7141 | instance FromJSON MapEntry where |
| 7072 | 7142 | parseJSON (Object _) = return MapEntry |
| 7073 | 7143 | |
| 7144 | +instance ToJSON UnionMarshalJSON where | |
| 7145 | + toJSON (DoubleInUnionMarshalJSON x) = toJSON x | |
| 7146 | + toJSON (MarshalJSONInUnionMarshalJSON x) = toJSON x | |
| 7147 | + | |
| 7148 | +instance FromJSON UnionMarshalJSON where | |
| 7149 | + parseJSON xs@(Number _) = (fmap DoubleInUnionMarshalJSON . parseJSON) xs | |
| 7150 | + parseJSON xs@(Object _) = (fmap MarshalJSONInUnionMarshalJSON . parseJSON) xs | |
| 7151 | + | |
| 7152 | +instance ToJSON MarshalJSON where | |
| 7153 | + toJSON = \_ -> emptyObject | |
| 7154 | + | |
| 7155 | +instance FromJSON MarshalJSON where | |
| 7156 | + parseJSON (Object _) = return MarshalJSON | |
| 7157 | + | |
| 7074 | 7158 | instance ToJSON UnionMetadataPropertyHandling where |
| 7075 | 7159 | toJSON (DoubleInUnionMetadataPropertyHandling x) = toJSON x |
| 7076 | 7160 | toJSON (MetadataPropertyHandlingInUnionMetadataPropertyHandling x) = toJSON x |
| @@ -8961,6 +9045,20 @@ instance ToJSON TimeZone where | ||
| 8961 | 9045 | instance FromJSON TimeZone where |
| 8962 | 9046 | parseJSON (Object _) = return TimeZone |
| 8963 | 9047 | |
| 9048 | +instance ToJSON UnionToDict where | |
| 9049 | + toJSON (DoubleInUnionToDict x) = toJSON x | |
| 9050 | + toJSON (ToDictInUnionToDict x) = toJSON x | |
| 9051 | + | |
| 9052 | +instance FromJSON UnionToDict where | |
| 9053 | + parseJSON xs@(Number _) = (fmap DoubleInUnionToDict . parseJSON) xs | |
| 9054 | + parseJSON xs@(Object _) = (fmap ToDictInUnionToDict . parseJSON) xs | |
| 9055 | + | |
| 9056 | +instance ToJSON ToDict where | |
| 9057 | + toJSON = \_ -> emptyObject | |
| 9058 | + | |
| 9059 | +instance FromJSON ToDict where | |
| 9060 | + parseJSON (Object _) = return ToDict | |
| 9061 | + | |
| 8964 | 9062 | instance ToJSON UnionToJSON where |
| 8965 | 9063 | toJSON (DoubleInUnionToJSON x) = toJSON x |
| 8966 | 9064 | toJSON (ToJSONClassInUnionToJSON x) = toJSON x |
| @@ -9185,6 +9283,20 @@ instance ToJSON Union where | ||
| 9185 | 9283 | instance FromJSON Union where |
| 9186 | 9284 | parseJSON (Object _) = return Union |
| 9187 | 9285 | |
| 9286 | +instance ToJSON UnionUnmarshalJSON where | |
| 9287 | + toJSON (DoubleInUnionUnmarshalJSON x) = toJSON x | |
| 9288 | + toJSON (UnmarshalJSONInUnionUnmarshalJSON x) = toJSON x | |
| 9289 | + | |
| 9290 | +instance FromJSON UnionUnmarshalJSON where | |
| 9291 | + parseJSON xs@(Number _) = (fmap DoubleInUnionUnmarshalJSON . parseJSON) xs | |
| 9292 | + parseJSON xs@(Object _) = (fmap UnmarshalJSONInUnionUnmarshalJSON . parseJSON) xs | |
| 9293 | + | |
| 9294 | +instance ToJSON UnmarshalJSON where | |
| 9295 | + toJSON = \_ -> emptyObject | |
| 9296 | + | |
| 9297 | +instance FromJSON UnmarshalJSON where | |
| 9298 | + parseJSON (Object _) = return UnmarshalJSON | |
| 9299 | + | |
| 9188 | 9300 | instance ToJSON UnionUnowned where |
| 9189 | 9301 | toJSON (DoubleInUnionUnowned x) = toJSON x |
| 9190 | 9302 | toJSON (UnownedInUnionUnowned x) = toJSON x |
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / FromDict.java+7 −0
| @@ -0,0 +1,7 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE) | |
| 6 | +public class FromDict { | |
| 7 | +} |
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / MarshalJSON.java+7 −0
| @@ -0,0 +1,7 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE) | |
| 6 | +public class MarshalJSON { | |
| 7 | +} |
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / ToDict.java+7 −0
| @@ -0,0 +1,7 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE) | |
| 6 | +public class ToDict { | |
| 7 | +} |
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / TopLevel.java+24 −0
| @@ -125,6 +125,7 @@ public class TopLevel { | ||
| 125 | 125 | private UnionFormatException formatException; |
| 126 | 126 | private UnionFriend friend; |
| 127 | 127 | private UnionFrom from; |
| 128 | + private UnionFromDict fromDict; | |
| 128 | 129 | private UnionFromJSON fromJSON; |
| 129 | 130 | private UnionFunc func; |
| 130 | 131 | private UnionFunction function; |
| @@ -186,6 +187,7 @@ public class TopLevel { | ||
| 186 | 187 | private UnionLong topLevelLong; |
| 187 | 188 | private UnionMap map; |
| 188 | 189 | private UnionMapEntry mapEntry; |
| 190 | + private UnionMarshalJSON marshalJSON; | |
| 189 | 191 | private UnionMetadataPropertyHandling metadataPropertyHandling; |
| 190 | 192 | private UnionModule module; |
| 191 | 193 | private UnionMutable mutable; |
| @@ -300,6 +302,7 @@ public class TopLevel { | ||
| 300 | 302 | private UnionTimeOnly timeOnly; |
| 301 | 303 | private UnionTimeOnlyConverter timeOnlyConverter; |
| 302 | 304 | private UnionTimeZone timeZone; |
| 305 | + private UnionToDict toDict; | |
| 303 | 306 | private UnionToJSON toJSON; |
| 304 | 307 | private UnionTopLevel topLevel; |
| 305 | 308 | private UnionToString toString; |
| @@ -319,6 +322,7 @@ public class TopLevel { | ||
| 319 | 322 | private UnionUnchecked unchecked; |
| 320 | 323 | private UnionUndefined undefined; |
| 321 | 324 | private UnionUnionUnion union; |
| 325 | + private UnionUnmarshalJSON unmarshalJSON; | |
| 322 | 326 | private UnionUnowned unowned; |
| 323 | 327 | private UnionUnsafe unsafe; |
| 324 | 328 | private UnionUnsigned unsigned; |
| @@ -953,6 +957,11 @@ public class TopLevel { | ||
| 953 | 957 | @JsonProperty("from") |
| 954 | 958 | public void setFrom(UnionFrom value) { this.from = value; } |
| 955 | 959 | |
| 960 | + @JsonProperty("from_dict") | |
| 961 | + public UnionFromDict getFromDict() { return fromDict; } | |
| 962 | + @JsonProperty("from_dict") | |
| 963 | + public void setFromDict(UnionFromDict value) { this.fromDict = value; } | |
| 964 | + | |
| 956 | 965 | @JsonProperty("from_json") |
| 957 | 966 | public UnionFromJSON getFromJSON() { return fromJSON; } |
| 958 | 967 | @JsonProperty("from_json") |
| @@ -1258,6 +1267,11 @@ public class TopLevel { | ||
| 1258 | 1267 | @JsonProperty("MapEntry") |
| 1259 | 1268 | public void setMapEntry(UnionMapEntry value) { this.mapEntry = value; } |
| 1260 | 1269 | |
| 1270 | + @JsonProperty("MarshalJSON") | |
| 1271 | + public UnionMarshalJSON getMarshalJSON() { return marshalJSON; } | |
| 1272 | + @JsonProperty("MarshalJSON") | |
| 1273 | + public void setMarshalJSON(UnionMarshalJSON value) { this.marshalJSON = value; } | |
| 1274 | + | |
| 1261 | 1275 | @JsonProperty("metadata_property_handling") |
| 1262 | 1276 | public UnionMetadataPropertyHandling getMetadataPropertyHandling() { return metadataPropertyHandling; } |
| 1263 | 1277 | @JsonProperty("metadata_property_handling") |
| @@ -1828,6 +1842,11 @@ public class TopLevel { | ||
| 1828 | 1842 | @JsonProperty("TimeZone") |
| 1829 | 1843 | public void setTimeZone(UnionTimeZone value) { this.timeZone = value; } |
| 1830 | 1844 | |
| 1845 | + @JsonProperty("to_dict") | |
| 1846 | + public UnionToDict getToDict() { return toDict; } | |
| 1847 | + @JsonProperty("to_dict") | |
| 1848 | + public void setToDict(UnionToDict value) { this.toDict = value; } | |
| 1849 | + | |
| 1831 | 1850 | @JsonProperty("to_json") |
| 1832 | 1851 | public UnionToJSON getToJSON() { return toJSON; } |
| 1833 | 1852 | @JsonProperty("to_json") |
| @@ -1923,6 +1942,11 @@ public class TopLevel { | ||
| 1923 | 1942 | @JsonProperty("union") |
| 1924 | 1943 | public void setUnion(UnionUnionUnion value) { this.union = value; } |
| 1925 | 1944 | |
| 1945 | + @JsonProperty("UnmarshalJSON") | |
| 1946 | + public UnionUnmarshalJSON getUnmarshalJSON() { return unmarshalJSON; } | |
| 1947 | + @JsonProperty("UnmarshalJSON") | |
| 1948 | + public void setUnmarshalJSON(UnionUnmarshalJSON value) { this.unmarshalJSON = value; } | |
| 1949 | + | |
| 1926 | 1950 | @JsonProperty("unowned") |
| 1927 | 1951 | public UnionUnowned getUnowned() { return unowned; } |
| 1928 | 1952 | @JsonProperty("unowned") |
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / UnionFromDict.java+50 −0
| @@ -0,0 +1,50 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +@JsonDeserialize(using = UnionFromDict.Deserializer.class) | |
| 11 | +@JsonSerialize(using = UnionFromDict.Serializer.class) | |
| 12 | +public class UnionFromDict { | |
| 13 | + public Double doubleValue; | |
| 14 | + public FromDict fromDictValue; | |
| 15 | + | |
| 16 | + static class Deserializer extends JsonDeserializer<UnionFromDict> { | |
| 17 | + @Override | |
| 18 | + public UnionFromDict deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | + UnionFromDict value = new UnionFromDict(); | |
| 20 | + switch (jsonParser.currentToken()) { | |
| 21 | + case VALUE_NULL: | |
| 22 | + break; | |
| 23 | + case VALUE_NUMBER_INT: | |
| 24 | + case VALUE_NUMBER_FLOAT: | |
| 25 | + value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 26 | + break; | |
| 27 | + case START_OBJECT: | |
| 28 | + value.fromDictValue = jsonParser.readValueAs(FromDict.class); | |
| 29 | + break; | |
| 30 | + default: throw new IOException("Cannot deserialize UnionFromDict"); | |
| 31 | + } | |
| 32 | + return value; | |
| 33 | + } | |
| 34 | + } | |
| 35 | + | |
| 36 | + static class Serializer extends JsonSerializer<UnionFromDict> { | |
| 37 | + @Override | |
| 38 | + public void serialize(UnionFromDict obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 39 | + if (obj.doubleValue != null) { | |
| 40 | + jsonGenerator.writeObject(obj.doubleValue); | |
| 41 | + return; | |
| 42 | + } | |
| 43 | + if (obj.fromDictValue != null) { | |
| 44 | + jsonGenerator.writeObject(obj.fromDictValue); | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + jsonGenerator.writeNull(); | |
| 48 | + } | |
| 49 | + } | |
| 50 | +} |
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / UnionMarshalJSON.java+50 −0
| @@ -0,0 +1,50 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +@JsonDeserialize(using = UnionMarshalJSON.Deserializer.class) | |
| 11 | +@JsonSerialize(using = UnionMarshalJSON.Serializer.class) | |
| 12 | +public class UnionMarshalJSON { | |
| 13 | + public Double doubleValue; | |
| 14 | + public MarshalJSON marshalJSONValue; | |
| 15 | + | |
| 16 | + static class Deserializer extends JsonDeserializer<UnionMarshalJSON> { | |
| 17 | + @Override | |
| 18 | + public UnionMarshalJSON deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | + UnionMarshalJSON value = new UnionMarshalJSON(); | |
| 20 | + switch (jsonParser.currentToken()) { | |
| 21 | + case VALUE_NULL: | |
| 22 | + break; | |
| 23 | + case VALUE_NUMBER_INT: | |
| 24 | + case VALUE_NUMBER_FLOAT: | |
| 25 | + value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 26 | + break; | |
| 27 | + case START_OBJECT: | |
| 28 | + value.marshalJSONValue = jsonParser.readValueAs(MarshalJSON.class); | |
| 29 | + break; | |
| 30 | + default: throw new IOException("Cannot deserialize UnionMarshalJSON"); | |
| 31 | + } | |
| 32 | + return value; | |
| 33 | + } | |
| 34 | + } | |
| 35 | + | |
| 36 | + static class Serializer extends JsonSerializer<UnionMarshalJSON> { | |
| 37 | + @Override | |
| 38 | + public void serialize(UnionMarshalJSON obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 39 | + if (obj.doubleValue != null) { | |
| 40 | + jsonGenerator.writeObject(obj.doubleValue); | |
| 41 | + return; | |
| 42 | + } | |
| 43 | + if (obj.marshalJSONValue != null) { | |
| 44 | + jsonGenerator.writeObject(obj.marshalJSONValue); | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + jsonGenerator.writeNull(); | |
| 48 | + } | |
| 49 | + } | |
| 50 | +} |
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / UnionToDict.java+50 −0
| @@ -0,0 +1,50 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +@JsonDeserialize(using = UnionToDict.Deserializer.class) | |
| 11 | +@JsonSerialize(using = UnionToDict.Serializer.class) | |
| 12 | +public class UnionToDict { | |
| 13 | + public Double doubleValue; | |
| 14 | + public ToDict toDictValue; | |
| 15 | + | |
| 16 | + static class Deserializer extends JsonDeserializer<UnionToDict> { | |
| 17 | + @Override | |
| 18 | + public UnionToDict deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | + UnionToDict value = new UnionToDict(); | |
| 20 | + switch (jsonParser.currentToken()) { | |
| 21 | + case VALUE_NULL: | |
| 22 | + break; | |
| 23 | + case VALUE_NUMBER_INT: | |
| 24 | + case VALUE_NUMBER_FLOAT: | |
| 25 | + value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 26 | + break; | |
| 27 | + case START_OBJECT: | |
| 28 | + value.toDictValue = jsonParser.readValueAs(ToDict.class); | |
| 29 | + break; | |
| 30 | + default: throw new IOException("Cannot deserialize UnionToDict"); | |
| 31 | + } | |
| 32 | + return value; | |
| 33 | + } | |
| 34 | + } | |
| 35 | + | |
| 36 | + static class Serializer extends JsonSerializer<UnionToDict> { | |
| 37 | + @Override | |
| 38 | + public void serialize(UnionToDict obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 39 | + if (obj.doubleValue != null) { | |
| 40 | + jsonGenerator.writeObject(obj.doubleValue); | |
| 41 | + return; | |
| 42 | + } | |
| 43 | + if (obj.toDictValue != null) { | |
| 44 | + jsonGenerator.writeObject(obj.toDictValue); | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + jsonGenerator.writeNull(); | |
| 48 | + } | |
| 49 | + } | |
| 50 | +} |
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / UnionUnmarshalJSON.java+50 −0
| @@ -0,0 +1,50 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +@JsonDeserialize(using = UnionUnmarshalJSON.Deserializer.class) | |
| 11 | +@JsonSerialize(using = UnionUnmarshalJSON.Serializer.class) | |
| 12 | +public class UnionUnmarshalJSON { | |
| 13 | + public Double doubleValue; | |
| 14 | + public UnmarshalJSON unmarshalJSONValue; | |
| 15 | + | |
| 16 | + static class Deserializer extends JsonDeserializer<UnionUnmarshalJSON> { | |
| 17 | + @Override | |
| 18 | + public UnionUnmarshalJSON deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | + UnionUnmarshalJSON value = new UnionUnmarshalJSON(); | |
| 20 | + switch (jsonParser.currentToken()) { | |
| 21 | + case VALUE_NULL: | |
| 22 | + break; | |
| 23 | + case VALUE_NUMBER_INT: | |
| 24 | + case VALUE_NUMBER_FLOAT: | |
| 25 | + value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 26 | + break; | |
| 27 | + case START_OBJECT: | |
| 28 | + value.unmarshalJSONValue = jsonParser.readValueAs(UnmarshalJSON.class); | |
| 29 | + break; | |
| 30 | + default: throw new IOException("Cannot deserialize UnionUnmarshalJSON"); | |
| 31 | + } | |
| 32 | + return value; | |
| 33 | + } | |
| 34 | + } | |
| 35 | + | |
| 36 | + static class Serializer extends JsonSerializer<UnionUnmarshalJSON> { | |
| 37 | + @Override | |
| 38 | + public void serialize(UnionUnmarshalJSON obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 39 | + if (obj.doubleValue != null) { | |
| 40 | + jsonGenerator.writeObject(obj.doubleValue); | |
| 41 | + return; | |
| 42 | + } | |
| 43 | + if (obj.unmarshalJSONValue != null) { | |
| 44 | + jsonGenerator.writeObject(obj.unmarshalJSONValue); | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + jsonGenerator.writeNull(); | |
| 48 | + } | |
| 49 | + } | |
| 50 | +} |
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / UnmarshalJSON.java+7 −0
| @@ -0,0 +1,7 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE) | |
| 6 | +public class UnmarshalJSON { | |
| 7 | +} |
Aschema-java-lombokdefault / src / main / java / io / quicktype / FromDict.java+7 −0
| @@ -0,0 +1,7 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE) | |
| 6 | +public class FromDict { | |
| 7 | +} |
Aschema-java-lombokdefault / src / main / java / io / quicktype / MarshalJSON.java+7 −0
| @@ -0,0 +1,7 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE) | |
| 6 | +public class MarshalJSON { | |
| 7 | +} |
Aschema-java-lombokdefault / src / main / java / io / quicktype / ToDict.java+7 −0
| @@ -0,0 +1,7 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE) | |
| 6 | +public class ToDict { | |
| 7 | +} |
Mschema-java-lombokdefault / src / main / java / io / quicktype / TopLevel.java+24 −0
| @@ -125,6 +125,7 @@ public class TopLevel { | ||
| 125 | 125 | private UnionFormatException formatException; |
| 126 | 126 | private UnionFriend friend; |
| 127 | 127 | private UnionFrom from; |
| 128 | + private UnionFromDict fromDict; | |
| 128 | 129 | private UnionFromJSON fromJSON; |
| 129 | 130 | private UnionFunc func; |
| 130 | 131 | private UnionFunction function; |
| @@ -186,6 +187,7 @@ public class TopLevel { | ||
| 186 | 187 | private UnionLong topLevelLong; |
| 187 | 188 | private UnionMap map; |
| 188 | 189 | private UnionMapEntry mapEntry; |
| 190 | + private UnionMarshalJSON marshalJSON; | |
| 189 | 191 | private UnionMetadataPropertyHandling metadataPropertyHandling; |
| 190 | 192 | private UnionModule module; |
| 191 | 193 | private UnionMutable mutable; |
| @@ -300,6 +302,7 @@ public class TopLevel { | ||
| 300 | 302 | private UnionTimeOnly timeOnly; |
| 301 | 303 | private UnionTimeOnlyConverter timeOnlyConverter; |
| 302 | 304 | private UnionTimeZone timeZone; |
| 305 | + private UnionToDict toDict; | |
| 303 | 306 | private UnionToJSON toJSON; |
| 304 | 307 | private UnionTopLevel topLevel; |
| 305 | 308 | private UnionToString toString; |
| @@ -319,6 +322,7 @@ public class TopLevel { | ||
| 319 | 322 | private UnionUnchecked unchecked; |
| 320 | 323 | private UnionUndefined undefined; |
| 321 | 324 | private UnionUnionUnion union; |
| 325 | + private UnionUnmarshalJSON unmarshalJSON; | |
| 322 | 326 | private UnionUnowned unowned; |
| 323 | 327 | private UnionUnsafe unsafe; |
| 324 | 328 | private UnionUnsigned unsigned; |
| @@ -953,6 +957,11 @@ public class TopLevel { | ||
| 953 | 957 | @JsonProperty("from") |
| 954 | 958 | public void setFrom(UnionFrom value) { this.from = value; } |
| 955 | 959 | |
| 960 | + @JsonProperty("from_dict") | |
| 961 | + public UnionFromDict getFromDict() { return fromDict; } | |
| 962 | + @JsonProperty("from_dict") | |
| 963 | + public void setFromDict(UnionFromDict value) { this.fromDict = value; } | |
| 964 | + | |
| 956 | 965 | @JsonProperty("from_json") |
| 957 | 966 | public UnionFromJSON getFromJSON() { return fromJSON; } |
| 958 | 967 | @JsonProperty("from_json") |
| @@ -1258,6 +1267,11 @@ public class TopLevel { | ||
| 1258 | 1267 | @JsonProperty("MapEntry") |
| 1259 | 1268 | public void setMapEntry(UnionMapEntry value) { this.mapEntry = value; } |
| 1260 | 1269 | |
| 1270 | + @JsonProperty("MarshalJSON") | |
| 1271 | + public UnionMarshalJSON getMarshalJSON() { return marshalJSON; } | |
| 1272 | + @JsonProperty("MarshalJSON") | |
| 1273 | + public void setMarshalJSON(UnionMarshalJSON value) { this.marshalJSON = value; } | |
| 1274 | + | |
| 1261 | 1275 | @JsonProperty("metadata_property_handling") |
| 1262 | 1276 | public UnionMetadataPropertyHandling getMetadataPropertyHandling() { return metadataPropertyHandling; } |
| 1263 | 1277 | @JsonProperty("metadata_property_handling") |
| @@ -1828,6 +1842,11 @@ public class TopLevel { | ||
| 1828 | 1842 | @JsonProperty("TimeZone") |
| 1829 | 1843 | public void setTimeZone(UnionTimeZone value) { this.timeZone = value; } |
| 1830 | 1844 | |
| 1845 | + @JsonProperty("to_dict") | |
| 1846 | + public UnionToDict getToDict() { return toDict; } | |
| 1847 | + @JsonProperty("to_dict") | |
| 1848 | + public void setToDict(UnionToDict value) { this.toDict = value; } | |
| 1849 | + | |
| 1831 | 1850 | @JsonProperty("to_json") |
| 1832 | 1851 | public UnionToJSON getToJSON() { return toJSON; } |
| 1833 | 1852 | @JsonProperty("to_json") |
| @@ -1923,6 +1942,11 @@ public class TopLevel { | ||
| 1923 | 1942 | @JsonProperty("union") |
| 1924 | 1943 | public void setUnion(UnionUnionUnion value) { this.union = value; } |
| 1925 | 1944 | |
| 1945 | + @JsonProperty("UnmarshalJSON") | |
| 1946 | + public UnionUnmarshalJSON getUnmarshalJSON() { return unmarshalJSON; } | |
| 1947 | + @JsonProperty("UnmarshalJSON") | |
| 1948 | + public void setUnmarshalJSON(UnionUnmarshalJSON value) { this.unmarshalJSON = value; } | |
| 1949 | + | |
| 1926 | 1950 | @JsonProperty("unowned") |
| 1927 | 1951 | public UnionUnowned getUnowned() { return unowned; } |
| 1928 | 1952 | @JsonProperty("unowned") |
Aschema-java-lombokdefault / src / main / java / io / quicktype / UnionFromDict.java+50 −0
| @@ -0,0 +1,50 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +@JsonDeserialize(using = UnionFromDict.Deserializer.class) | |
| 11 | +@JsonSerialize(using = UnionFromDict.Serializer.class) | |
| 12 | +public class UnionFromDict { | |
| 13 | + public Double doubleValue; | |
| 14 | + public FromDict fromDictValue; | |
| 15 | + | |
| 16 | + static class Deserializer extends JsonDeserializer<UnionFromDict> { | |
| 17 | + @Override | |
| 18 | + public UnionFromDict deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | + UnionFromDict value = new UnionFromDict(); | |
| 20 | + switch (jsonParser.currentToken()) { | |
| 21 | + case VALUE_NULL: | |
| 22 | + break; | |
| 23 | + case VALUE_NUMBER_INT: | |
| 24 | + case VALUE_NUMBER_FLOAT: | |
| 25 | + value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 26 | + break; | |
| 27 | + case START_OBJECT: | |
| 28 | + value.fromDictValue = jsonParser.readValueAs(FromDict.class); | |
| 29 | + break; | |
| 30 | + default: throw new IOException("Cannot deserialize UnionFromDict"); | |
| 31 | + } | |
| 32 | + return value; | |
| 33 | + } | |
| 34 | + } | |
| 35 | + | |
| 36 | + static class Serializer extends JsonSerializer<UnionFromDict> { | |
| 37 | + @Override | |
| 38 | + public void serialize(UnionFromDict obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 39 | + if (obj.doubleValue != null) { | |
| 40 | + jsonGenerator.writeObject(obj.doubleValue); | |
| 41 | + return; | |
| 42 | + } | |
| 43 | + if (obj.fromDictValue != null) { | |
| 44 | + jsonGenerator.writeObject(obj.fromDictValue); | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + jsonGenerator.writeNull(); | |
| 48 | + } | |
| 49 | + } | |
| 50 | +} |
Aschema-java-lombokdefault / src / main / java / io / quicktype / UnionMarshalJSON.java+50 −0
| @@ -0,0 +1,50 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +@JsonDeserialize(using = UnionMarshalJSON.Deserializer.class) | |
| 11 | +@JsonSerialize(using = UnionMarshalJSON.Serializer.class) | |
| 12 | +public class UnionMarshalJSON { | |
| 13 | + public Double doubleValue; | |
| 14 | + public MarshalJSON marshalJSONValue; | |
| 15 | + | |
| 16 | + static class Deserializer extends JsonDeserializer<UnionMarshalJSON> { | |
| 17 | + @Override | |
| 18 | + public UnionMarshalJSON deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | + UnionMarshalJSON value = new UnionMarshalJSON(); | |
| 20 | + switch (jsonParser.currentToken()) { | |
| 21 | + case VALUE_NULL: | |
| 22 | + break; | |
| 23 | + case VALUE_NUMBER_INT: | |
| 24 | + case VALUE_NUMBER_FLOAT: | |
| 25 | + value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 26 | + break; | |
| 27 | + case START_OBJECT: | |
| 28 | + value.marshalJSONValue = jsonParser.readValueAs(MarshalJSON.class); | |
| 29 | + break; | |
| 30 | + default: throw new IOException("Cannot deserialize UnionMarshalJSON"); | |
| 31 | + } | |
| 32 | + return value; | |
| 33 | + } | |
| 34 | + } | |
| 35 | + | |
| 36 | + static class Serializer extends JsonSerializer<UnionMarshalJSON> { | |
| 37 | + @Override | |
| 38 | + public void serialize(UnionMarshalJSON obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 39 | + if (obj.doubleValue != null) { | |
| 40 | + jsonGenerator.writeObject(obj.doubleValue); | |
| 41 | + return; | |
| 42 | + } | |
| 43 | + if (obj.marshalJSONValue != null) { | |
| 44 | + jsonGenerator.writeObject(obj.marshalJSONValue); | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + jsonGenerator.writeNull(); | |
| 48 | + } | |
| 49 | + } | |
| 50 | +} |
Aschema-java-lombokdefault / src / main / java / io / quicktype / UnionToDict.java+50 −0
| @@ -0,0 +1,50 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +@JsonDeserialize(using = UnionToDict.Deserializer.class) | |
| 11 | +@JsonSerialize(using = UnionToDict.Serializer.class) | |
| 12 | +public class UnionToDict { | |
| 13 | + public Double doubleValue; | |
| 14 | + public ToDict toDictValue; | |
| 15 | + | |
| 16 | + static class Deserializer extends JsonDeserializer<UnionToDict> { | |
| 17 | + @Override | |
| 18 | + public UnionToDict deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | + UnionToDict value = new UnionToDict(); | |
| 20 | + switch (jsonParser.currentToken()) { | |
| 21 | + case VALUE_NULL: | |
| 22 | + break; | |
| 23 | + case VALUE_NUMBER_INT: | |
| 24 | + case VALUE_NUMBER_FLOAT: | |
| 25 | + value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 26 | + break; | |
| 27 | + case START_OBJECT: | |
| 28 | + value.toDictValue = jsonParser.readValueAs(ToDict.class); | |
| 29 | + break; | |
| 30 | + default: throw new IOException("Cannot deserialize UnionToDict"); | |
| 31 | + } | |
| 32 | + return value; | |
| 33 | + } | |
| 34 | + } | |
| 35 | + | |
| 36 | + static class Serializer extends JsonSerializer<UnionToDict> { | |
| 37 | + @Override | |
| 38 | + public void serialize(UnionToDict obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 39 | + if (obj.doubleValue != null) { | |
| 40 | + jsonGenerator.writeObject(obj.doubleValue); | |
| 41 | + return; | |
| 42 | + } | |
| 43 | + if (obj.toDictValue != null) { | |
| 44 | + jsonGenerator.writeObject(obj.toDictValue); | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + jsonGenerator.writeNull(); | |
| 48 | + } | |
| 49 | + } | |
| 50 | +} |
Aschema-java-lombokdefault / src / main / java / io / quicktype / UnionUnmarshalJSON.java+50 −0
| @@ -0,0 +1,50 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +@JsonDeserialize(using = UnionUnmarshalJSON.Deserializer.class) | |
| 11 | +@JsonSerialize(using = UnionUnmarshalJSON.Serializer.class) | |
| 12 | +public class UnionUnmarshalJSON { | |
| 13 | + public Double doubleValue; | |
| 14 | + public UnmarshalJSON unmarshalJSONValue; | |
| 15 | + | |
| 16 | + static class Deserializer extends JsonDeserializer<UnionUnmarshalJSON> { | |
| 17 | + @Override | |
| 18 | + public UnionUnmarshalJSON deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | + UnionUnmarshalJSON value = new UnionUnmarshalJSON(); | |
| 20 | + switch (jsonParser.currentToken()) { | |
| 21 | + case VALUE_NULL: | |
| 22 | + break; | |
| 23 | + case VALUE_NUMBER_INT: | |
| 24 | + case VALUE_NUMBER_FLOAT: | |
| 25 | + value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 26 | + break; | |
| 27 | + case START_OBJECT: | |
| 28 | + value.unmarshalJSONValue = jsonParser.readValueAs(UnmarshalJSON.class); | |
| 29 | + break; | |
| 30 | + default: throw new IOException("Cannot deserialize UnionUnmarshalJSON"); | |
| 31 | + } | |
| 32 | + return value; | |
| 33 | + } | |
| 34 | + } | |
| 35 | + | |
| 36 | + static class Serializer extends JsonSerializer<UnionUnmarshalJSON> { | |
| 37 | + @Override | |
| 38 | + public void serialize(UnionUnmarshalJSON obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 39 | + if (obj.doubleValue != null) { | |
| 40 | + jsonGenerator.writeObject(obj.doubleValue); | |
| 41 | + return; | |
| 42 | + } | |
| 43 | + if (obj.unmarshalJSONValue != null) { | |
| 44 | + jsonGenerator.writeObject(obj.unmarshalJSONValue); | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + jsonGenerator.writeNull(); | |
| 48 | + } | |
| 49 | + } | |
| 50 | +} |
Aschema-java-lombokdefault / src / main / java / io / quicktype / UnmarshalJSON.java+7 −0
| @@ -0,0 +1,7 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE) | |
| 6 | +public class UnmarshalJSON { | |
| 7 | +} |
Aschema-javadefault / src / main / java / io / quicktype / FromDict.java+7 −0
| @@ -0,0 +1,7 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE) | |
| 6 | +public class FromDict { | |
| 7 | +} |
Aschema-javadefault / src / main / java / io / quicktype / MarshalJSON.java+7 −0
| @@ -0,0 +1,7 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE) | |
| 6 | +public class MarshalJSON { | |
| 7 | +} |
Aschema-javadefault / src / main / java / io / quicktype / ToDict.java+7 −0
| @@ -0,0 +1,7 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE) | |
| 6 | +public class ToDict { | |
| 7 | +} |
Mschema-javadefault / src / main / java / io / quicktype / TopLevel.java+24 −0
| @@ -125,6 +125,7 @@ public class TopLevel { | ||
| 125 | 125 | private UnionFormatException formatException; |
| 126 | 126 | private UnionFriend friend; |
| 127 | 127 | private UnionFrom from; |
| 128 | + private UnionFromDict fromDict; | |
| 128 | 129 | private UnionFromJSON fromJSON; |
| 129 | 130 | private UnionFunc func; |
| 130 | 131 | private UnionFunction function; |
| @@ -186,6 +187,7 @@ public class TopLevel { | ||
| 186 | 187 | private UnionLong topLevelLong; |
| 187 | 188 | private UnionMap map; |
| 188 | 189 | private UnionMapEntry mapEntry; |
| 190 | + private UnionMarshalJSON marshalJSON; | |
| 189 | 191 | private UnionMetadataPropertyHandling metadataPropertyHandling; |
| 190 | 192 | private UnionModule module; |
| 191 | 193 | private UnionMutable mutable; |
| @@ -300,6 +302,7 @@ public class TopLevel { | ||
| 300 | 302 | private UnionTimeOnly timeOnly; |
| 301 | 303 | private UnionTimeOnlyConverter timeOnlyConverter; |
| 302 | 304 | private UnionTimeZone timeZone; |
| 305 | + private UnionToDict toDict; | |
| 303 | 306 | private UnionToJSON toJSON; |
| 304 | 307 | private UnionTopLevel topLevel; |
| 305 | 308 | private UnionToString toString; |
| @@ -319,6 +322,7 @@ public class TopLevel { | ||
| 319 | 322 | private UnionUnchecked unchecked; |
| 320 | 323 | private UnionUndefined undefined; |
| 321 | 324 | private UnionUnionUnion union; |
| 325 | + private UnionUnmarshalJSON unmarshalJSON; | |
| 322 | 326 | private UnionUnowned unowned; |
| 323 | 327 | private UnionUnsafe unsafe; |
| 324 | 328 | private UnionUnsigned unsigned; |
| @@ -953,6 +957,11 @@ public class TopLevel { | ||
| 953 | 957 | @JsonProperty("from") |
| 954 | 958 | public void setFrom(UnionFrom value) { this.from = value; } |
| 955 | 959 | |
| 960 | + @JsonProperty("from_dict") | |
| 961 | + public UnionFromDict getFromDict() { return fromDict; } | |
| 962 | + @JsonProperty("from_dict") | |
| 963 | + public void setFromDict(UnionFromDict value) { this.fromDict = value; } | |
| 964 | + | |
| 956 | 965 | @JsonProperty("from_json") |
| 957 | 966 | public UnionFromJSON getFromJSON() { return fromJSON; } |
| 958 | 967 | @JsonProperty("from_json") |
| @@ -1258,6 +1267,11 @@ public class TopLevel { | ||
| 1258 | 1267 | @JsonProperty("MapEntry") |
| 1259 | 1268 | public void setMapEntry(UnionMapEntry value) { this.mapEntry = value; } |
| 1260 | 1269 | |
| 1270 | + @JsonProperty("MarshalJSON") | |
| 1271 | + public UnionMarshalJSON getMarshalJSON() { return marshalJSON; } | |
| 1272 | + @JsonProperty("MarshalJSON") | |
| 1273 | + public void setMarshalJSON(UnionMarshalJSON value) { this.marshalJSON = value; } | |
| 1274 | + | |
| 1261 | 1275 | @JsonProperty("metadata_property_handling") |
| 1262 | 1276 | public UnionMetadataPropertyHandling getMetadataPropertyHandling() { return metadataPropertyHandling; } |
| 1263 | 1277 | @JsonProperty("metadata_property_handling") |
| @@ -1828,6 +1842,11 @@ public class TopLevel { | ||
| 1828 | 1842 | @JsonProperty("TimeZone") |
| 1829 | 1843 | public void setTimeZone(UnionTimeZone value) { this.timeZone = value; } |
| 1830 | 1844 | |
| 1845 | + @JsonProperty("to_dict") | |
| 1846 | + public UnionToDict getToDict() { return toDict; } | |
| 1847 | + @JsonProperty("to_dict") | |
| 1848 | + public void setToDict(UnionToDict value) { this.toDict = value; } | |
| 1849 | + | |
| 1831 | 1850 | @JsonProperty("to_json") |
| 1832 | 1851 | public UnionToJSON getToJSON() { return toJSON; } |
| 1833 | 1852 | @JsonProperty("to_json") |
| @@ -1923,6 +1942,11 @@ public class TopLevel { | ||
| 1923 | 1942 | @JsonProperty("union") |
| 1924 | 1943 | public void setUnion(UnionUnionUnion value) { this.union = value; } |
| 1925 | 1944 | |
| 1945 | + @JsonProperty("UnmarshalJSON") | |
| 1946 | + public UnionUnmarshalJSON getUnmarshalJSON() { return unmarshalJSON; } | |
| 1947 | + @JsonProperty("UnmarshalJSON") | |
| 1948 | + public void setUnmarshalJSON(UnionUnmarshalJSON value) { this.unmarshalJSON = value; } | |
| 1949 | + | |
| 1926 | 1950 | @JsonProperty("unowned") |
| 1927 | 1951 | public UnionUnowned getUnowned() { return unowned; } |
| 1928 | 1952 | @JsonProperty("unowned") |
Aschema-javadefault / src / main / java / io / quicktype / UnionFromDict.java+50 −0
| @@ -0,0 +1,50 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +@JsonDeserialize(using = UnionFromDict.Deserializer.class) | |
| 11 | +@JsonSerialize(using = UnionFromDict.Serializer.class) | |
| 12 | +public class UnionFromDict { | |
| 13 | + public Double doubleValue; | |
| 14 | + public FromDict fromDictValue; | |
| 15 | + | |
| 16 | + static class Deserializer extends JsonDeserializer<UnionFromDict> { | |
| 17 | + @Override | |
| 18 | + public UnionFromDict deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | + UnionFromDict value = new UnionFromDict(); | |
| 20 | + switch (jsonParser.currentToken()) { | |
| 21 | + case VALUE_NULL: | |
| 22 | + break; | |
| 23 | + case VALUE_NUMBER_INT: | |
| 24 | + case VALUE_NUMBER_FLOAT: | |
| 25 | + value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 26 | + break; | |
| 27 | + case START_OBJECT: | |
| 28 | + value.fromDictValue = jsonParser.readValueAs(FromDict.class); | |
| 29 | + break; | |
| 30 | + default: throw new IOException("Cannot deserialize UnionFromDict"); | |
| 31 | + } | |
| 32 | + return value; | |
| 33 | + } | |
| 34 | + } | |
| 35 | + | |
| 36 | + static class Serializer extends JsonSerializer<UnionFromDict> { | |
| 37 | + @Override | |
| 38 | + public void serialize(UnionFromDict obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 39 | + if (obj.doubleValue != null) { | |
| 40 | + jsonGenerator.writeObject(obj.doubleValue); | |
| 41 | + return; | |
| 42 | + } | |
| 43 | + if (obj.fromDictValue != null) { | |
| 44 | + jsonGenerator.writeObject(obj.fromDictValue); | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + jsonGenerator.writeNull(); | |
| 48 | + } | |
| 49 | + } | |
| 50 | +} |
Aschema-javadefault / src / main / java / io / quicktype / UnionMarshalJSON.java+50 −0
| @@ -0,0 +1,50 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +@JsonDeserialize(using = UnionMarshalJSON.Deserializer.class) | |
| 11 | +@JsonSerialize(using = UnionMarshalJSON.Serializer.class) | |
| 12 | +public class UnionMarshalJSON { | |
| 13 | + public Double doubleValue; | |
| 14 | + public MarshalJSON marshalJSONValue; | |
| 15 | + | |
| 16 | + static class Deserializer extends JsonDeserializer<UnionMarshalJSON> { | |
| 17 | + @Override | |
| 18 | + public UnionMarshalJSON deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | + UnionMarshalJSON value = new UnionMarshalJSON(); | |
| 20 | + switch (jsonParser.currentToken()) { | |
| 21 | + case VALUE_NULL: | |
| 22 | + break; | |
| 23 | + case VALUE_NUMBER_INT: | |
| 24 | + case VALUE_NUMBER_FLOAT: | |
| 25 | + value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 26 | + break; | |
| 27 | + case START_OBJECT: | |
| 28 | + value.marshalJSONValue = jsonParser.readValueAs(MarshalJSON.class); | |
| 29 | + break; | |
| 30 | + default: throw new IOException("Cannot deserialize UnionMarshalJSON"); | |
| 31 | + } | |
| 32 | + return value; | |
| 33 | + } | |
| 34 | + } | |
| 35 | + | |
| 36 | + static class Serializer extends JsonSerializer<UnionMarshalJSON> { | |
| 37 | + @Override | |
| 38 | + public void serialize(UnionMarshalJSON obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 39 | + if (obj.doubleValue != null) { | |
| 40 | + jsonGenerator.writeObject(obj.doubleValue); | |
| 41 | + return; | |
| 42 | + } | |
| 43 | + if (obj.marshalJSONValue != null) { | |
| 44 | + jsonGenerator.writeObject(obj.marshalJSONValue); | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + jsonGenerator.writeNull(); | |
| 48 | + } | |
| 49 | + } | |
| 50 | +} |
Aschema-javadefault / src / main / java / io / quicktype / UnionToDict.java+50 −0
| @@ -0,0 +1,50 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +@JsonDeserialize(using = UnionToDict.Deserializer.class) | |
| 11 | +@JsonSerialize(using = UnionToDict.Serializer.class) | |
| 12 | +public class UnionToDict { | |
| 13 | + public Double doubleValue; | |
| 14 | + public ToDict toDictValue; | |
| 15 | + | |
| 16 | + static class Deserializer extends JsonDeserializer<UnionToDict> { | |
| 17 | + @Override | |
| 18 | + public UnionToDict deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | + UnionToDict value = new UnionToDict(); | |
| 20 | + switch (jsonParser.currentToken()) { | |
| 21 | + case VALUE_NULL: | |
| 22 | + break; | |
| 23 | + case VALUE_NUMBER_INT: | |
| 24 | + case VALUE_NUMBER_FLOAT: | |
| 25 | + value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 26 | + break; | |
| 27 | + case START_OBJECT: | |
| 28 | + value.toDictValue = jsonParser.readValueAs(ToDict.class); | |
| 29 | + break; | |
| 30 | + default: throw new IOException("Cannot deserialize UnionToDict"); | |
| 31 | + } | |
| 32 | + return value; | |
| 33 | + } | |
| 34 | + } | |
| 35 | + | |
| 36 | + static class Serializer extends JsonSerializer<UnionToDict> { | |
| 37 | + @Override | |
| 38 | + public void serialize(UnionToDict obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 39 | + if (obj.doubleValue != null) { | |
| 40 | + jsonGenerator.writeObject(obj.doubleValue); | |
| 41 | + return; | |
| 42 | + } | |
| 43 | + if (obj.toDictValue != null) { | |
| 44 | + jsonGenerator.writeObject(obj.toDictValue); | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + jsonGenerator.writeNull(); | |
| 48 | + } | |
| 49 | + } | |
| 50 | +} |
Aschema-javadefault / src / main / java / io / quicktype / UnionUnmarshalJSON.java+50 −0
| @@ -0,0 +1,50 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.io.IOException; | |
| 5 | +import com.fasterxml.jackson.core.*; | |
| 6 | +import com.fasterxml.jackson.databind.*; | |
| 7 | +import com.fasterxml.jackson.databind.annotation.*; | |
| 8 | +import com.fasterxml.jackson.core.type.*; | |
| 9 | + | |
| 10 | +@JsonDeserialize(using = UnionUnmarshalJSON.Deserializer.class) | |
| 11 | +@JsonSerialize(using = UnionUnmarshalJSON.Serializer.class) | |
| 12 | +public class UnionUnmarshalJSON { | |
| 13 | + public Double doubleValue; | |
| 14 | + public UnmarshalJSON unmarshalJSONValue; | |
| 15 | + | |
| 16 | + static class Deserializer extends JsonDeserializer<UnionUnmarshalJSON> { | |
| 17 | + @Override | |
| 18 | + public UnionUnmarshalJSON deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { | |
| 19 | + UnionUnmarshalJSON value = new UnionUnmarshalJSON(); | |
| 20 | + switch (jsonParser.currentToken()) { | |
| 21 | + case VALUE_NULL: | |
| 22 | + break; | |
| 23 | + case VALUE_NUMBER_INT: | |
| 24 | + case VALUE_NUMBER_FLOAT: | |
| 25 | + value.doubleValue = jsonParser.readValueAs(Double.class); | |
| 26 | + break; | |
| 27 | + case START_OBJECT: | |
| 28 | + value.unmarshalJSONValue = jsonParser.readValueAs(UnmarshalJSON.class); | |
| 29 | + break; | |
| 30 | + default: throw new IOException("Cannot deserialize UnionUnmarshalJSON"); | |
| 31 | + } | |
| 32 | + return value; | |
| 33 | + } | |
| 34 | + } | |
| 35 | + | |
| 36 | + static class Serializer extends JsonSerializer<UnionUnmarshalJSON> { | |
| 37 | + @Override | |
| 38 | + public void serialize(UnionUnmarshalJSON obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { | |
| 39 | + if (obj.doubleValue != null) { | |
| 40 | + jsonGenerator.writeObject(obj.doubleValue); | |
| 41 | + return; | |
| 42 | + } | |
| 43 | + if (obj.unmarshalJSONValue != null) { | |
| 44 | + jsonGenerator.writeObject(obj.unmarshalJSONValue); | |
| 45 | + return; | |
| 46 | + } | |
| 47 | + jsonGenerator.writeNull(); | |
| 48 | + } | |
| 49 | + } | |
| 50 | +} |
Aschema-javadefault / src / main / java / io / quicktype / UnmarshalJSON.java+7 −0
| @@ -0,0 +1,7 @@ | ||
| 1 | +package io.quicktype; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.*; | |
| 4 | + | |
| 5 | +@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.NONE) | |
| 6 | +public class UnmarshalJSON { | |
| 7 | +} |
Mschema-javascript-prop-typesdefault / toplevel.js+16 −0
| @@ -51,6 +51,7 @@ let _JSONTokenType; | ||
| 51 | 51 | let _KSerializer; |
| 52 | 52 | let _Locale; |
| 53 | 53 | let _MapEntry; |
| 54 | +let _MarshalJSON; | |
| 54 | 55 | let _No; |
| 55 | 56 | let _NSError; |
| 56 | 57 | let _NSObject; |
| @@ -78,6 +79,7 @@ let _TimeZone; | ||
| 78 | 79 | let _True; |
| 79 | 80 | let _Type; |
| 80 | 81 | let _UUID; |
| 82 | +let _UnmarshalJSON; | |
| 81 | 83 | let _UseSerializers; |
| 82 | 84 | let _Utf8JSONReader; |
| 83 | 85 | let _Utf8JSONWriter; |
| @@ -183,6 +185,7 @@ let _For; | ||
| 183 | 185 | let _Foreach; |
| 184 | 186 | let _Friend; |
| 185 | 187 | let _From; |
| 188 | +let _FromDict; | |
| 186 | 189 | let _FromJSON; |
| 187 | 190 | let _Func; |
| 188 | 191 | let _Function; |
| @@ -317,6 +320,7 @@ let _ThreadLocal; | ||
| 317 | 320 | let _Throw; |
| 318 | 321 | let _Throws; |
| 319 | 322 | let _ToString; |
| 323 | +let _ToDict; | |
| 320 | 324 | let _ToJSON; |
| 321 | 325 | let _TopLevelClass; |
| 322 | 326 | let _Transient; |
| @@ -427,6 +431,8 @@ _Locale = PropTypes.shape({ | ||
| 427 | 431 | }); |
| 428 | 432 | _MapEntry = PropTypes.shape({ |
| 429 | 433 | }); |
| 434 | +_MarshalJSON = PropTypes.shape({ | |
| 435 | +}); | |
| 430 | 436 | _No = PropTypes.shape({ |
| 431 | 437 | }); |
| 432 | 438 | _NSError = PropTypes.shape({ |
| @@ -481,6 +487,8 @@ _Type = PropTypes.shape({ | ||
| 481 | 487 | }); |
| 482 | 488 | _UUID = PropTypes.shape({ |
| 483 | 489 | }); |
| 490 | +_UnmarshalJSON = PropTypes.shape({ | |
| 491 | +}); | |
| 484 | 492 | _UseSerializers = PropTypes.shape({ |
| 485 | 493 | }); |
| 486 | 494 | _Utf8JSONReader = PropTypes.shape({ |
| @@ -691,6 +699,8 @@ _Friend = PropTypes.shape({ | ||
| 691 | 699 | }); |
| 692 | 700 | _From = PropTypes.shape({ |
| 693 | 701 | }); |
| 702 | +_FromDict = PropTypes.shape({ | |
| 703 | +}); | |
| 694 | 704 | _FromJSON = PropTypes.shape({ |
| 695 | 705 | }); |
| 696 | 706 | _Func = PropTypes.shape({ |
| @@ -959,6 +969,8 @@ _Throws = PropTypes.shape({ | ||
| 959 | 969 | }); |
| 960 | 970 | _ToString = PropTypes.shape({ |
| 961 | 971 | }); |
| 972 | +_ToDict = PropTypes.shape({ | |
| 973 | +}); | |
| 962 | 974 | _ToJSON = PropTypes.shape({ |
| 963 | 975 | }); |
| 964 | 976 | _TopLevelClass = PropTypes.shape({ |
| @@ -1150,6 +1162,7 @@ _TopLevel = PropTypes.shape({ | ||
| 1150 | 1162 | "FormatException": PropTypes.oneOfType([_FormatException, PropTypes.number, PropTypes.oneOf([null])]), |
| 1151 | 1163 | "friend": PropTypes.oneOfType([_Friend, PropTypes.number, PropTypes.oneOf([null])]), |
| 1152 | 1164 | "from": PropTypes.oneOfType([_From, PropTypes.number, PropTypes.oneOf([null])]), |
| 1165 | + "from_dict": PropTypes.oneOfType([_FromDict, PropTypes.number, PropTypes.oneOf([null])]), | |
| 1153 | 1166 | "from_json": PropTypes.oneOfType([_FromJSON, PropTypes.number, PropTypes.oneOf([null])]), |
| 1154 | 1167 | "func": PropTypes.oneOfType([_Func, PropTypes.number, PropTypes.oneOf([null])]), |
| 1155 | 1168 | "function": PropTypes.oneOfType([_Function, PropTypes.number, PropTypes.oneOf([null])]), |
| @@ -1211,6 +1224,7 @@ _TopLevel = PropTypes.shape({ | ||
| 1211 | 1224 | "long": PropTypes.oneOfType([_Long, PropTypes.number, PropTypes.oneOf([null])]), |
| 1212 | 1225 | "map": PropTypes.oneOfType([_Map, PropTypes.number, PropTypes.oneOf([null])]), |
| 1213 | 1226 | "MapEntry": PropTypes.oneOfType([_MapEntry, PropTypes.number, PropTypes.oneOf([null])]), |
| 1227 | + "MarshalJSON": PropTypes.oneOfType([_MarshalJSON, PropTypes.number, PropTypes.oneOf([null])]), | |
| 1214 | 1228 | "metadata_property_handling": PropTypes.oneOfType([_MetadataPropertyHandling, PropTypes.number, PropTypes.oneOf([null])]), |
| 1215 | 1229 | "module": PropTypes.oneOfType([_Module, PropTypes.number, PropTypes.oneOf([null])]), |
| 1216 | 1230 | "mutable": PropTypes.oneOfType([_Mutable, PropTypes.number, PropTypes.oneOf([null])]), |
| @@ -1325,6 +1339,7 @@ _TopLevel = PropTypes.shape({ | ||
| 1325 | 1339 | "TimeOnly": PropTypes.oneOfType([_TimeOnly, PropTypes.number, PropTypes.oneOf([null])]), |
| 1326 | 1340 | "TimeOnlyConverter": PropTypes.oneOfType([_TimeOnlyConverter, PropTypes.number, PropTypes.oneOf([null])]), |
| 1327 | 1341 | "TimeZone": PropTypes.oneOfType([_TimeZone, PropTypes.number, PropTypes.oneOf([null])]), |
| 1342 | + "to_dict": PropTypes.oneOfType([_ToDict, PropTypes.number, PropTypes.oneOf([null])]), | |
| 1328 | 1343 | "to_json": PropTypes.oneOfType([_ToJSON, PropTypes.number, PropTypes.oneOf([null])]), |
| 1329 | 1344 | "top_level": PropTypes.oneOfType([_TopLevelClass, PropTypes.number, PropTypes.oneOf([null])]), |
| 1330 | 1345 | "toString": (props, name, ...args) => Object.prototype.hasOwnProperty.call(props, name) ? PropTypes.oneOfType([_ToString, PropTypes.number, PropTypes.oneOf([null])])(props, name, ...args) : null, |
| @@ -1344,6 +1359,7 @@ _TopLevel = PropTypes.shape({ | ||
| 1344 | 1359 | "unchecked": PropTypes.oneOfType([_Unchecked, PropTypes.number, PropTypes.oneOf([null])]), |
| 1345 | 1360 | "undefined": PropTypes.oneOfType([_Undefined, PropTypes.number, PropTypes.oneOf([null])]), |
| 1346 | 1361 | "union": PropTypes.oneOfType([_Union, PropTypes.number, PropTypes.oneOf([null])]), |
| 1362 | + "UnmarshalJSON": PropTypes.oneOfType([_UnmarshalJSON, PropTypes.number, PropTypes.oneOf([null])]), | |
| 1347 | 1363 | "unowned": PropTypes.oneOfType([_Unowned, PropTypes.number, PropTypes.oneOf([null])]), |
| 1348 | 1364 | "unsafe": PropTypes.oneOfType([_Unsafe, PropTypes.number, PropTypes.oneOf([null])]), |
| 1349 | 1365 | "unsigned": PropTypes.oneOfType([_Unsigned, PropTypes.number, PropTypes.oneOf([null])]), |
Mschema-javascriptdefault / TopLevel.js+14 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
| @@ -315,6 +315,7 @@ const typeMap = { | ||
| 315 | 315 | { json: "FormatException", js: "FormatException", typ: u(undefined, u(r("FormatException"), 3.14)) }, |
| 316 | 316 | { json: "friend", js: "friend", typ: u(undefined, u(r("Friend"), 3.14)) }, |
| 317 | 317 | { json: "from", js: "from", typ: u(undefined, u(r("From"), 3.14)) }, |
| 318 | + { json: "from_dict", js: "from_dict", typ: u(undefined, u(r("FromDict"), 3.14)) }, | |
| 318 | 319 | { json: "from_json", js: "from_json", typ: u(undefined, u(r("FromJSON"), 3.14)) }, |
| 319 | 320 | { json: "func", js: "func", typ: u(undefined, u(r("Func"), 3.14)) }, |
| 320 | 321 | { json: "function", js: "function", typ: u(undefined, u(r("Function"), 3.14)) }, |
| @@ -376,6 +377,7 @@ const typeMap = { | ||
| 376 | 377 | { json: "long", js: "long", typ: u(undefined, u(r("Long"), 3.14)) }, |
| 377 | 378 | { json: "map", js: "map", typ: u(undefined, u(r("Map"), 3.14)) }, |
| 378 | 379 | { json: "MapEntry", js: "MapEntry", typ: u(undefined, u(r("MapEntry"), 3.14)) }, |
| 380 | + { json: "MarshalJSON", js: "MarshalJSON", typ: u(undefined, u(r("MarshalJSON"), 3.14)) }, | |
| 379 | 381 | { json: "metadata_property_handling", js: "metadata_property_handling", typ: u(undefined, u(r("MetadataPropertyHandling"), 3.14)) }, |
| 380 | 382 | { json: "module", js: "module", typ: u(undefined, u(r("Module"), 3.14)) }, |
| 381 | 383 | { json: "mutable", js: "mutable", typ: u(undefined, u(r("Mutable"), 3.14)) }, |
| @@ -490,6 +492,7 @@ const typeMap = { | ||
| 490 | 492 | { json: "TimeOnly", js: "TimeOnly", typ: u(undefined, u(r("TimeOnly"), 3.14)) }, |
| 491 | 493 | { json: "TimeOnlyConverter", js: "TimeOnlyConverter", typ: u(undefined, u(r("TimeOnlyConverter"), 3.14)) }, |
| 492 | 494 | { json: "TimeZone", js: "TimeZone", typ: u(undefined, u(r("TimeZone"), 3.14)) }, |
| 495 | + { json: "to_dict", js: "to_dict", typ: u(undefined, u(r("ToDict"), 3.14)) }, | |
| 493 | 496 | { json: "to_json", js: "to_json", typ: u(undefined, u(r("ToJSON"), 3.14)) }, |
| 494 | 497 | { json: "top_level", js: "top_level", typ: u(undefined, u(r("TopLevelClass"), 3.14)) }, |
| 495 | 498 | { json: "toString", js: "toString", typ: u(undefined, u(r("ToString"), 3.14)) }, |
| @@ -509,6 +512,7 @@ const typeMap = { | ||
| 509 | 512 | { json: "unchecked", js: "unchecked", typ: u(undefined, u(r("Unchecked"), 3.14)) }, |
| 510 | 513 | { json: "undefined", js: "undefined", typ: u(undefined, u(r("Undefined"), 3.14)) }, |
| 511 | 514 | { json: "union", js: "union", typ: u(undefined, u(r("Union"), 3.14)) }, |
| 515 | + { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: u(undefined, u(r("UnmarshalJSON"), 3.14)) }, | |
| 512 | 516 | { json: "unowned", js: "unowned", typ: u(undefined, u(r("Unowned"), 3.14)) }, |
| 513 | 517 | { json: "unsafe", js: "unsafe", typ: u(undefined, u(r("Unsafe"), 3.14)) }, |
| 514 | 518 | { json: "unsigned", js: "unsigned", typ: u(undefined, u(r("Unsigned"), 3.14)) }, |
| @@ -609,6 +613,8 @@ const typeMap = { | ||
| 609 | 613 | ], false), |
| 610 | 614 | "MapEntry": o([ |
| 611 | 615 | ], false), |
| 616 | + "MarshalJSON": o([ | |
| 617 | + ], false), | |
| 612 | 618 | "No": o([ |
| 613 | 619 | ], false), |
| 614 | 620 | "NSError": o([ |
| @@ -663,6 +669,8 @@ const typeMap = { | ||
| 663 | 669 | ], false), |
| 664 | 670 | "UUID": o([ |
| 665 | 671 | ], false), |
| 672 | + "UnmarshalJSON": o([ | |
| 673 | + ], false), | |
| 666 | 674 | "UseSerializers": o([ |
| 667 | 675 | ], false), |
| 668 | 676 | "Utf8JSONReader": o([ |
| @@ -873,6 +881,8 @@ const typeMap = { | ||
| 873 | 881 | ], false), |
| 874 | 882 | "From": o([ |
| 875 | 883 | ], false), |
| 884 | + "FromDict": o([ | |
| 885 | + ], false), | |
| 876 | 886 | "FromJSON": o([ |
| 877 | 887 | ], false), |
| 878 | 888 | "Func": o([ |
| @@ -1141,6 +1151,8 @@ const typeMap = { | ||
| 1141 | 1151 | ], false), |
| 1142 | 1152 | "ToString": o([ |
| 1143 | 1153 | ], false), |
| 1154 | + "ToDict": o([ | |
| 1155 | + ], false), | |
| 1144 | 1156 | "ToJSON": o([ |
| 1145 | 1157 | ], false), |
| 1146 | 1158 | "TopLevelClass": o([ |
Mschema-objective-cdefault / QTTopLevel.h+20 −0
| @@ -103,6 +103,7 @@ | ||
| 103 | 103 | @class QTFormatException; |
| 104 | 104 | @class QTFriend; |
| 105 | 105 | @class QTFrom; |
| 106 | +@class QTFromDict; | |
| 106 | 107 | @class QTFromJSON; |
| 107 | 108 | @class QTFunc; |
| 108 | 109 | @class QTFunction; |
| @@ -158,6 +159,7 @@ | ||
| 158 | 159 | @class QTLock; |
| 159 | 160 | @class QTMap; |
| 160 | 161 | @class QTMapEntry; |
| 162 | +@class QTMarshalJSON; | |
| 161 | 163 | @class QTMetadataPropertyHandling; |
| 162 | 164 | @class QTModule; |
| 163 | 165 | @class QTMutable; |
| @@ -312,6 +314,7 @@ | ||
| 312 | 314 | @class QTTimeOnly; |
| 313 | 315 | @class QTTimeOnlyConverter; |
| 314 | 316 | @class QTTimeZone; |
| 317 | +@class QTToDict; | |
| 315 | 318 | @class QTToJSON; |
| 316 | 319 | @class QTToString; |
| 317 | 320 | @class QTTopLevelClass; |
| @@ -325,6 +328,7 @@ | ||
| 325 | 328 | @class QTUlong; |
| 326 | 329 | @class QTUnchecked; |
| 327 | 330 | @class QTUndefined; |
| 331 | +@class QTUnmarshalJSON; | |
| 328 | 332 | @class QTUnowned; |
| 329 | 333 | @class QTUnsafe; |
| 330 | 334 | @class QTUseSerializers; |
| @@ -479,6 +483,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 479 | 483 | @property (nonatomic, nullable, copy) id formatException; |
| 480 | 484 | @property (nonatomic, nullable, copy) id friend; |
| 481 | 485 | @property (nonatomic, nullable, copy) id from; |
| 486 | +@property (nonatomic, nullable, copy) id fromDict; | |
| 482 | 487 | @property (nonatomic, nullable, copy) id fromJSON; |
| 483 | 488 | @property (nonatomic, nullable, copy) id func; |
| 484 | 489 | @property (nonatomic, nullable, copy) id function; |
| @@ -540,6 +545,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 540 | 545 | @property (nonatomic, nullable, copy) id qtTopLevelLong; |
| 541 | 546 | @property (nonatomic, nullable, copy) id map; |
| 542 | 547 | @property (nonatomic, nullable, copy) id mapEntry; |
| 548 | +@property (nonatomic, nullable, copy) id marshalJSON; | |
| 543 | 549 | @property (nonatomic, nullable, copy) id metadataPropertyHandling; |
| 544 | 550 | @property (nonatomic, nullable, copy) id module; |
| 545 | 551 | @property (nonatomic, nullable, copy) id mutable; |
| @@ -654,6 +660,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 654 | 660 | @property (nonatomic, nullable, copy) id timeOnly; |
| 655 | 661 | @property (nonatomic, nullable, copy) id timeOnlyConverter; |
| 656 | 662 | @property (nonatomic, nullable, copy) id timeZone; |
| 663 | +@property (nonatomic, nullable, copy) id toDict; | |
| 657 | 664 | @property (nonatomic, nullable, copy) id toJSON; |
| 658 | 665 | @property (nonatomic, nullable, copy) id topLevel; |
| 659 | 666 | @property (nonatomic, nullable, copy) id toString; |
| @@ -673,6 +680,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 673 | 680 | @property (nonatomic, nullable, copy) id unchecked; |
| 674 | 681 | @property (nonatomic, nullable, copy) id undefined; |
| 675 | 682 | @property (nonatomic, nullable, copy) id qtTopLevelUnion; |
| 683 | +@property (nonatomic, nullable, copy) id unmarshalJSON; | |
| 676 | 684 | @property (nonatomic, nullable, copy) id unowned; |
| 677 | 685 | @property (nonatomic, nullable, copy) id unsafe; |
| 678 | 686 | @property (nonatomic, nullable, copy) id qtTopLevelUnsigned; |
| @@ -994,6 +1002,9 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 994 | 1002 | @interface QTFrom : NSObject |
| 995 | 1003 | @end |
| 996 | 1004 | |
| 1005 | +@interface QTFromDict : NSObject | |
| 1006 | +@end | |
| 1007 | + | |
| 997 | 1008 | @interface QTFromJSON : NSObject |
| 998 | 1009 | @end |
| 999 | 1010 | |
| @@ -1159,6 +1170,9 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 1159 | 1170 | @interface QTMapEntry : NSObject |
| 1160 | 1171 | @end |
| 1161 | 1172 | |
| 1173 | +@interface QTMarshalJSON : NSObject | |
| 1174 | +@end | |
| 1175 | + | |
| 1162 | 1176 | @interface QTMetadataPropertyHandling : NSObject |
| 1163 | 1177 | @end |
| 1164 | 1178 | |
| @@ -1621,6 +1635,9 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 1621 | 1635 | @interface QTTimeZone : NSObject |
| 1622 | 1636 | @end |
| 1623 | 1637 | |
| 1638 | +@interface QTToDict : NSObject | |
| 1639 | +@end | |
| 1640 | + | |
| 1624 | 1641 | @interface QTToJSON : NSObject |
| 1625 | 1642 | @end |
| 1626 | 1643 | |
| @@ -1660,6 +1677,9 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en | ||
| 1660 | 1677 | @interface QTUndefined : NSObject |
| 1661 | 1678 | @end |
| 1662 | 1679 | |
| 1680 | +@interface QTUnmarshalJSON : NSObject | |
| 1681 | +@end | |
| 1682 | + | |
| 1663 | 1683 | @interface QTUnowned : NSObject |
| 1664 | 1684 | @end |
Mschema-objective-cdefault / QTTopLevel.m+180 −0
| @@ -498,6 +498,11 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 498 | 498 | - (NSDictionary *)JSONDictionary; |
| 499 | 499 | @end |
| 500 | 500 | |
| 501 | +@interface QTFromDict (JSONConversion) | |
| 502 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict; | |
| 503 | +- (NSDictionary *)JSONDictionary; | |
| 504 | +@end | |
| 505 | + | |
| 501 | 506 | @interface QTFromJSON (JSONConversion) |
| 502 | 507 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict; |
| 503 | 508 | - (NSDictionary *)JSONDictionary; |
| @@ -773,6 +778,11 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 773 | 778 | - (NSDictionary *)JSONDictionary; |
| 774 | 779 | @end |
| 775 | 780 | |
| 781 | +@interface QTMarshalJSON (JSONConversion) | |
| 782 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict; | |
| 783 | +- (NSDictionary *)JSONDictionary; | |
| 784 | +@end | |
| 785 | + | |
| 776 | 786 | @interface QTMetadataPropertyHandling (JSONConversion) |
| 777 | 787 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict; |
| 778 | 788 | - (NSDictionary *)JSONDictionary; |
| @@ -1543,6 +1553,11 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 1543 | 1553 | - (NSDictionary *)JSONDictionary; |
| 1544 | 1554 | @end |
| 1545 | 1555 | |
| 1556 | +@interface QTToDict (JSONConversion) | |
| 1557 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict; | |
| 1558 | +- (NSDictionary *)JSONDictionary; | |
| 1559 | +@end | |
| 1560 | + | |
| 1546 | 1561 | @interface QTToJSON (JSONConversion) |
| 1547 | 1562 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict; |
| 1548 | 1563 | - (NSDictionary *)JSONDictionary; |
| @@ -1608,6 +1623,11 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 1608 | 1623 | - (NSDictionary *)JSONDictionary; |
| 1609 | 1624 | @end |
| 1610 | 1625 | |
| 1626 | +@interface QTUnmarshalJSON (JSONConversion) | |
| 1627 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict; | |
| 1628 | +- (NSDictionary *)JSONDictionary; | |
| 1629 | +@end | |
| 1630 | + | |
| 1611 | 1631 | @interface QTUnowned (JSONConversion) |
| 1612 | 1632 | + (instancetype)fromJSONDictionary:(NSDictionary *)dict; |
| 1613 | 1633 | - (NSDictionary *)JSONDictionary; |
| @@ -1866,6 +1886,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 1866 | 1886 | @"FormatException": @"formatException", |
| 1867 | 1887 | @"friend": @"friend", |
| 1868 | 1888 | @"from": @"from", |
| 1889 | + @"from_dict": @"fromDict", | |
| 1869 | 1890 | @"from_json": @"fromJSON", |
| 1870 | 1891 | @"func": @"func", |
| 1871 | 1892 | @"function": @"function", |
| @@ -1927,6 +1948,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 1927 | 1948 | @"long": @"qtTopLevelLong", |
| 1928 | 1949 | @"map": @"map", |
| 1929 | 1950 | @"MapEntry": @"mapEntry", |
| 1951 | + @"MarshalJSON": @"marshalJSON", | |
| 1930 | 1952 | @"metadata_property_handling": @"metadataPropertyHandling", |
| 1931 | 1953 | @"module": @"module", |
| 1932 | 1954 | @"mutable": @"mutable", |
| @@ -2041,6 +2063,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 2041 | 2063 | @"TimeOnly": @"timeOnly", |
| 2042 | 2064 | @"TimeOnlyConverter": @"timeOnlyConverter", |
| 2043 | 2065 | @"TimeZone": @"timeZone", |
| 2066 | + @"to_dict": @"toDict", | |
| 2044 | 2067 | @"to_json": @"toJSON", |
| 2045 | 2068 | @"top_level": @"topLevel", |
| 2046 | 2069 | @"toString": @"toString", |
| @@ -2060,6 +2083,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 2060 | 2083 | @"unchecked": @"unchecked", |
| 2061 | 2084 | @"undefined": @"undefined", |
| 2062 | 2085 | @"union": @"qtTopLevelUnion", |
| 2086 | + @"UnmarshalJSON": @"unmarshalJSON", | |
| 2063 | 2087 | @"unowned": @"unowned", |
| 2064 | 2088 | @"unsafe": @"unsafe", |
| 2065 | 2089 | @"unsigned": @"qtTopLevelUnsigned", |
| @@ -5930,6 +5954,45 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 5930 | 5954 | } |
| 5931 | 5955 | @end |
| 5932 | 5956 | |
| 5957 | +@implementation QTFromDict | |
| 5958 | ++ (NSDictionary<NSString *, NSString *> *)properties | |
| 5959 | +{ | |
| 5960 | + static NSDictionary<NSString *, NSString *> *properties; | |
| 5961 | + return properties = properties ? properties : @{ | |
| 5962 | + }; | |
| 5963 | +} | |
| 5964 | + | |
| 5965 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict | |
| 5966 | +{ | |
| 5967 | + return [dict isKindOfClass:NSDictionary.class] ? [[QTFromDict alloc] initWithJSONDictionary:dict] : nil; | |
| 5968 | +} | |
| 5969 | + | |
| 5970 | +- (instancetype)initWithJSONDictionary:(NSDictionary *)dict | |
| 5971 | +{ | |
| 5972 | + if (self = [super init]) { | |
| 5973 | + [self setValuesForKeysWithDictionary:dict]; | |
| 5974 | + } | |
| 5975 | + return self; | |
| 5976 | +} | |
| 5977 | + | |
| 5978 | +- (void)setValue:(nullable id)value forKey:(NSString *)key | |
| 5979 | +{ | |
| 5980 | + id resolved = QTFromDict.properties[key]; | |
| 5981 | + if (resolved) [super setValue:value forKey:resolved]; | |
| 5982 | +} | |
| 5983 | + | |
| 5984 | +- (void)setNilValueForKey:(NSString *)key | |
| 5985 | +{ | |
| 5986 | + id resolved = QTFromDict.properties[key]; | |
| 5987 | + if (resolved) [super setValue:@(0) forKey:resolved]; | |
| 5988 | +} | |
| 5989 | + | |
| 5990 | +- (NSDictionary *)JSONDictionary | |
| 5991 | +{ | |
| 5992 | + return [self dictionaryWithValuesForKeys:QTFromDict.properties.allValues]; | |
| 5993 | +} | |
| 5994 | +@end | |
| 5995 | + | |
| 5933 | 5996 | @implementation QTFromJSON |
| 5934 | 5997 | + (NSDictionary<NSString *, NSString *> *)properties |
| 5935 | 5998 | { |
| @@ -8075,6 +8138,45 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 8075 | 8138 | } |
| 8076 | 8139 | @end |
| 8077 | 8140 | |
| 8141 | +@implementation QTMarshalJSON | |
| 8142 | ++ (NSDictionary<NSString *, NSString *> *)properties | |
| 8143 | +{ | |
| 8144 | + static NSDictionary<NSString *, NSString *> *properties; | |
| 8145 | + return properties = properties ? properties : @{ | |
| 8146 | + }; | |
| 8147 | +} | |
| 8148 | + | |
| 8149 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict | |
| 8150 | +{ | |
| 8151 | + return [dict isKindOfClass:NSDictionary.class] ? [[QTMarshalJSON alloc] initWithJSONDictionary:dict] : nil; | |
| 8152 | +} | |
| 8153 | + | |
| 8154 | +- (instancetype)initWithJSONDictionary:(NSDictionary *)dict | |
| 8155 | +{ | |
| 8156 | + if (self = [super init]) { | |
| 8157 | + [self setValuesForKeysWithDictionary:dict]; | |
| 8158 | + } | |
| 8159 | + return self; | |
| 8160 | +} | |
| 8161 | + | |
| 8162 | +- (void)setValue:(nullable id)value forKey:(NSString *)key | |
| 8163 | +{ | |
| 8164 | + id resolved = QTMarshalJSON.properties[key]; | |
| 8165 | + if (resolved) [super setValue:value forKey:resolved]; | |
| 8166 | +} | |
| 8167 | + | |
| 8168 | +- (void)setNilValueForKey:(NSString *)key | |
| 8169 | +{ | |
| 8170 | + id resolved = QTMarshalJSON.properties[key]; | |
| 8171 | + if (resolved) [super setValue:@(0) forKey:resolved]; | |
| 8172 | +} | |
| 8173 | + | |
| 8174 | +- (NSDictionary *)JSONDictionary | |
| 8175 | +{ | |
| 8176 | + return [self dictionaryWithValuesForKeys:QTMarshalJSON.properties.allValues]; | |
| 8177 | +} | |
| 8178 | +@end | |
| 8179 | + | |
| 8078 | 8180 | @implementation QTMetadataPropertyHandling |
| 8079 | 8181 | + (NSDictionary<NSString *, NSString *> *)properties |
| 8080 | 8182 | { |
| @@ -14081,6 +14183,45 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 14081 | 14183 | } |
| 14082 | 14184 | @end |
| 14083 | 14185 | |
| 14186 | +@implementation QTToDict | |
| 14187 | ++ (NSDictionary<NSString *, NSString *> *)properties | |
| 14188 | +{ | |
| 14189 | + static NSDictionary<NSString *, NSString *> *properties; | |
| 14190 | + return properties = properties ? properties : @{ | |
| 14191 | + }; | |
| 14192 | +} | |
| 14193 | + | |
| 14194 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict | |
| 14195 | +{ | |
| 14196 | + return [dict isKindOfClass:NSDictionary.class] ? [[QTToDict alloc] initWithJSONDictionary:dict] : nil; | |
| 14197 | +} | |
| 14198 | + | |
| 14199 | +- (instancetype)initWithJSONDictionary:(NSDictionary *)dict | |
| 14200 | +{ | |
| 14201 | + if (self = [super init]) { | |
| 14202 | + [self setValuesForKeysWithDictionary:dict]; | |
| 14203 | + } | |
| 14204 | + return self; | |
| 14205 | +} | |
| 14206 | + | |
| 14207 | +- (void)setValue:(nullable id)value forKey:(NSString *)key | |
| 14208 | +{ | |
| 14209 | + id resolved = QTToDict.properties[key]; | |
| 14210 | + if (resolved) [super setValue:value forKey:resolved]; | |
| 14211 | +} | |
| 14212 | + | |
| 14213 | +- (void)setNilValueForKey:(NSString *)key | |
| 14214 | +{ | |
| 14215 | + id resolved = QTToDict.properties[key]; | |
| 14216 | + if (resolved) [super setValue:@(0) forKey:resolved]; | |
| 14217 | +} | |
| 14218 | + | |
| 14219 | +- (NSDictionary *)JSONDictionary | |
| 14220 | +{ | |
| 14221 | + return [self dictionaryWithValuesForKeys:QTToDict.properties.allValues]; | |
| 14222 | +} | |
| 14223 | +@end | |
| 14224 | + | |
| 14084 | 14225 | @implementation QTToJSON |
| 14085 | 14226 | + (NSDictionary<NSString *, NSString *> *)properties |
| 14086 | 14227 | { |
| @@ -14588,6 +14729,45 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco | ||
| 14588 | 14729 | } |
| 14589 | 14730 | @end |
| 14590 | 14731 | |
| 14732 | +@implementation QTUnmarshalJSON | |
| 14733 | ++ (NSDictionary<NSString *, NSString *> *)properties | |
| 14734 | +{ | |
| 14735 | + static NSDictionary<NSString *, NSString *> *properties; | |
| 14736 | + return properties = properties ? properties : @{ | |
| 14737 | + }; | |
| 14738 | +} | |
| 14739 | + | |
| 14740 | ++ (instancetype)fromJSONDictionary:(NSDictionary *)dict | |
| 14741 | +{ | |
| 14742 | + return [dict isKindOfClass:NSDictionary.class] ? [[QTUnmarshalJSON alloc] initWithJSONDictionary:dict] : nil; | |
| 14743 | +} | |
| 14744 | + | |
| 14745 | +- (instancetype)initWithJSONDictionary:(NSDictionary *)dict | |
| 14746 | +{ | |
| 14747 | + if (self = [super init]) { | |
| 14748 | + [self setValuesForKeysWithDictionary:dict]; | |
| 14749 | + } | |
| 14750 | + return self; | |
| 14751 | +} | |
| 14752 | + | |
| 14753 | +- (void)setValue:(nullable id)value forKey:(NSString *)key | |
| 14754 | +{ | |
| 14755 | + id resolved = QTUnmarshalJSON.properties[key]; | |
| 14756 | + if (resolved) [super setValue:value forKey:resolved]; | |
| 14757 | +} | |
| 14758 | + | |
| 14759 | +- (void)setNilValueForKey:(NSString *)key | |
| 14760 | +{ | |
| 14761 | + id resolved = QTUnmarshalJSON.properties[key]; | |
| 14762 | + if (resolved) [super setValue:@(0) forKey:resolved]; | |
| 14763 | +} | |
| 14764 | + | |
| 14765 | +- (NSDictionary *)JSONDictionary | |
| 14766 | +{ | |
| 14767 | + return [self dictionaryWithValuesForKeys:QTUnmarshalJSON.properties.allValues]; | |
| 14768 | +} | |
| 14769 | +@end | |
| 14770 | + | |
| 14591 | 14771 | @implementation QTUnowned |
| 14592 | 14772 | + (NSDictionary<NSString *, NSString *> *)properties |
| 14593 | 14773 | { |
Mschema-phpdefault / TopLevel.php+734 −222
| @@ -126,6 +126,7 @@ class TopLevel { | ||
| 126 | 126 | private FormatException|float|null $formatException; // json:FormatException Optional |
| 127 | 127 | private Friend|float|null $friend; // json:friend Optional |
| 128 | 128 | private From|float|null $from; // json:from Optional |
| 129 | + private FromDict|float|null $fromDict; // json:from_dict Optional | |
| 129 | 130 | private FromJSON|float|null $fromJSON; // json:from_json Optional |
| 130 | 131 | private Func|float|null $func; // json:func Optional |
| 131 | 132 | private FunctionClass|float|null $function; // json:function Optional |
| @@ -187,6 +188,7 @@ class TopLevel { | ||
| 187 | 188 | private Long|float|null $long; // json:long Optional |
| 188 | 189 | private Map|float|null $map; // json:map Optional |
| 189 | 190 | private MapEntry|float|null $mapEntry; // json:MapEntry Optional |
| 191 | + private MarshalJSON|float|null $marshalJSON; // json:MarshalJSON Optional | |
| 190 | 192 | private MetadataPropertyHandling|float|null $metadataPropertyHandling; // json:metadata_property_handling Optional |
| 191 | 193 | private Module|float|null $module; // json:module Optional |
| 192 | 194 | private Mutable|float|null $mutable; // json:mutable Optional |
| @@ -301,6 +303,7 @@ class TopLevel { | ||
| 301 | 303 | private TimeOnly|float|null $timeOnly; // json:TimeOnly Optional |
| 302 | 304 | private TimeOnlyConverter|float|null $timeOnlyConverter; // json:TimeOnlyConverter Optional |
| 303 | 305 | private TimeZone|float|null $timeZone; // json:TimeZone Optional |
| 306 | + private ToDict|float|null $toDict; // json:to_dict Optional | |
| 304 | 307 | private ToJSON|float|null $toJSON; // json:to_json Optional |
| 305 | 308 | private TopLevelClass|float|null $topLevel; // json:top_level Optional |
| 306 | 309 | private ToString|float|null $toString; // json:toString Optional |
| @@ -320,6 +323,7 @@ class TopLevel { | ||
| 320 | 323 | private Unchecked|float|null $unchecked; // json:unchecked Optional |
| 321 | 324 | private Undefined|float|null $undefined; // json:undefined Optional |
| 322 | 325 | private UnionClass|float|null $union; // json:union Optional |
| 326 | + private UnmarshalJSON|float|null $unmarshalJSON; // json:UnmarshalJSON Optional | |
| 323 | 327 | private Unowned|float|null $unowned; // json:unowned Optional |
| 324 | 328 | private Unsafe|float|null $unsafe; // json:unsafe Optional |
| 325 | 329 | private Unsigned|float|null $unsigned; // json:unsigned Optional |
| @@ -467,6 +471,7 @@ class TopLevel { | ||
| 467 | 471 | * @param FormatException|float|null $formatException |
| 468 | 472 | * @param Friend|float|null $friend |
| 469 | 473 | * @param From|float|null $from |
| 474 | + * @param FromDict|float|null $fromDict | |
| 470 | 475 | * @param FromJSON|float|null $fromJSON |
| 471 | 476 | * @param Func|float|null $func |
| 472 | 477 | * @param FunctionClass|float|null $function |
| @@ -528,6 +533,7 @@ class TopLevel { | ||
| 528 | 533 | * @param Long|float|null $long |
| 529 | 534 | * @param Map|float|null $map |
| 530 | 535 | * @param MapEntry|float|null $mapEntry |
| 536 | + * @param MarshalJSON|float|null $marshalJSON | |
| 531 | 537 | * @param MetadataPropertyHandling|float|null $metadataPropertyHandling |
| 532 | 538 | * @param Module|float|null $module |
| 533 | 539 | * @param Mutable|float|null $mutable |
| @@ -642,6 +648,7 @@ class TopLevel { | ||
| 642 | 648 | * @param TimeOnly|float|null $timeOnly |
| 643 | 649 | * @param TimeOnlyConverter|float|null $timeOnlyConverter |
| 644 | 650 | * @param TimeZone|float|null $timeZone |
| 651 | + * @param ToDict|float|null $toDict | |
| 645 | 652 | * @param ToJSON|float|null $toJSON |
| 646 | 653 | * @param TopLevelClass|float|null $topLevel |
| 647 | 654 | * @param ToString|float|null $toString |
| @@ -661,6 +668,7 @@ class TopLevel { | ||
| 661 | 668 | * @param Unchecked|float|null $unchecked |
| 662 | 669 | * @param Undefined|float|null $undefined |
| 663 | 670 | * @param UnionClass|float|null $union |
| 671 | + * @param UnmarshalJSON|float|null $unmarshalJSON | |
| 664 | 672 | * @param Unowned|float|null $unowned |
| 665 | 673 | * @param Unsafe|float|null $unsafe |
| 666 | 674 | * @param Unsigned|float|null $unsigned |
| @@ -685,7 +693,7 @@ class TopLevel { | ||
| 685 | 693 | * @param Yes|float|null $yes |
| 686 | 694 | * @param YieldClass|float|null $yield |
| 687 | 695 | */ |
| 688 | - public function __construct(Union|float|null $empty, UnionBoolBool|float|null $topLevelBool, Complex|float|null $complex, Imaginery|float|null $imaginery, AbstractClass|float|null $abstract, Alignas|float|null $alignas, Alignof|float|null $alignof, AndClass|float|null $and, AndEq|float|null $andEq, AnyClass|float|null $topLevelAny, Any|float|null $any, ArrayClass|float|null $array, AsClass|float|null $as, ASM|float|null $asm, Assert|float|null $assert, Associatedtype|float|null $associatedtype, Associativity|float|null $associativity, Async|float|null $async, Atomic|float|null $atomic, AtomicCancel|float|null $atomicCancel, AtomicCommit|float|null $atomicCommit, AtomicNoexcept|float|null $atomicNoexcept, Auto|float|null $auto, Await|float|null $await, Base|float|null $base, Bitand|float|null $bitand, Bitor|float|null $bitor, BOOLClass|float|null $bool, UnionBoolBoolClass|float|null $purpleBool, Boolean|float|null $boolean, BreakClass|float|null $break, Bycopy|float|null $bycopy, Byref|float|null $byref, Byte|float|null $byte, Calendar|float|null $calendar, CaseClass|float|null $case, CatchClass|float|null $catch, Chan|float|null $chan, Char|float|null $char, Char16T|float|null $char16T, Char32T|float|null $char32T, Checked|float|null $checked, UnionClassClass|float|null $topLevelClass, ClassClass|float|null $class, CloneClass|float|null $clone, CoAwait|float|null $coAwait, CoReturn|float|null $coReturn, CoYield|float|null $coYield, Codable|float|null $codable, CodingKey|float|null $codingKey, CodingKeys|float|null $codingKeys, Compl|float|null $compl, Concept|float|null $concept, Console|float|null $console, ConstClass|float|null $const, ConstCast|float|null $constCast, Constexpr|float|null $constexpr, Constructor|float|null $constructor, ContinueClass|float|null $continue, Convenience|float|null $convenience, Convert|float|null $convert, ConverterClass|float|null $converter, CultureInfo|float|null $cultureInfo, Date|float|null $date, DateParseHandling|float|null $dateParseHandling, DateFormatter|float|null $dateFormatter, DateOnly|float|null $dateOnly, DateOnlyConverter|float|null $dateOnlyConverter, DateTimeClass|float|null $dateTime, DateTimeStyles|float|null $dateTimeStyles, Debugger|float|null $debugger, Decimal|float|null $decimal, DeclareClass|float|null $declare, Decltype|float|null $decltype, DecodeString|float|null $decodeString, Decoder|float|null $decoder, DecodingError|float|null $decodingError, Def|float|null $def, DefaultClass|float|null $default, Defer|float|null $defer, Deinit|float|null $deinit, Del|float|null $del, Delegate|float|null $delegate, Delete|float|null $delete, Dict|float|null $dict, Dictionary|float|null $dictionary, DidSet|float|null $didSet, DoClass|float|null $do, Double|float|null $double, ?float $dummy, Dynamic|float|null $dynamic, DynamicCast|float|null $dynamicCast, Elif|float|null $elif, ElseClass|float|null $else, EncodeQuickType|float|null $encodeQuickType, Encoder|float|null $encoder, EnumClass|float|null $enum, EnumValues|float|null $enumValues, EqualityContract|float|null $equalityContract, Equatable|float|null $equatable, Event|float|null $event, Except|float|null $except, ExceptionClass|float|null $exception, Explicit|float|null $explicit, Export|float|null $export, Exposing|float|null $exposing, ExtendsClass|float|null $extends, Extension|float|null $extension, Extern|float|null $extern, Fallthrough|float|null $fallthrough, UnionFalseFalse|float|null $topLevelFalse, FalseClass|float|null $false, Fileprivate|float|null $fileprivate, FinalClass|float|null $final, FinallyClass|float|null $finally, Fixed|float|null $fixed, FloatClass|float|null $float, ForClass|float|null $for, ForeachClass|float|null $foreach, FormatException|float|null $formatException, Friend|float|null $friend, From|float|null $from, FromJSON|float|null $fromJSON, Func|float|null $func, FunctionClass|float|null $function, Get|float|null $get, GlobalClass|float|null $global, Go|float|null $go, GotoClass|float|null $goto, Guard|float|null $guard, Hashable|float|null $hashable, HashCode|float|null $hashCode, Hasher|float|null $hasher, HasOwnProperty|float|null $hasOwnProperty, ID|float|null $id, IfClass|float|null $if, Imp|float|null $imp, ImplementsClass|float|null $implements, Implicit|float|null $implicit, Import|float|null $import, In|float|null $in, Indirect|float|null $indirect, Infix|float|null $infix, Init|float|null $init, Inline|float|null $inline, Inout|float|null $inout, InstanceofClass|float|null $instanceof, IntClass|float|null $int, InterfaceClass|float|null $interface, Internal|float|null $internal, Is|float|null $is, ISODateTimeOffsetConverter|float|null $isoDateTimeOffsetConverter, IterableClass|float|null $iterable, Jdec|float|null $jdec, Jenc|float|null $jenc, Jpipe|float|null $jpipe, JSON|float|null $json, JSONConverter|float|null $jsonConverter, JSONSerializer|float|null $jsonSerializer, JSONToken|float|null $jsonToken, JSONWriter|float|null $jsonWriter, JSONAny|float|null $jsonAny, JSONCodingKey|float|null $jsonCodingKey, JSONDecoder|float|null $jsonDecoder, JSONEncoder|float|null $jsonEncoder, JSONExceptionClass|float|null $jsonException, JSONGenerator|float|null $jsonGenerator, JSONNode|float|null $jsonNode, JSONNull|float|null $jsonNull, JSONParser|float|null $jsonParser, JSONReader|float|null $jsonReader, JSONTokenType|float|null $jsonTokenType, KSerializer|float|null $kSerializer, Lambda|float|null $lambda, Lazy|float|null $lazy, Left|float|null $left, Let|float|null $let, ListClass|float|null $list, LocaleClass|float|null $locale, Lock|float|null $lock, Long|float|null $long, Map|float|null $map, MapEntry|float|null $mapEntry, MetadataPropertyHandling|float|null $metadataPropertyHandling, Module|float|null $module, Mutable|float|null $mutable, Mutating|float|null $mutating, NamespaceClass|float|null $namespace, Native|float|null $native, NewClass|float|null $new, Newtonsoft|float|null $newtonsoft, Nil|float|null $nil, No|float|null $no, Noexcept|float|null $noexcept, Nonatomic|float|null $nonatomic, NoneClass|float|null $topLevelNone, None|float|null $none, Nonlocal|float|null $nonlocal, Nonmutating|float|null $nonmutating, NoSuchMethod|float|null $noSuchMethod, Not|float|null $not, NotEq|float|null $notEq, NSError|float|null $nsError, NSObject|float|null $nsObject, NSString|float|null $nsString, NULLClass|float|null $null, UnionNullNull|float|null $topLevelNull, Nullptr|float|null $nullptr, Number|float|null $number, ObjectClass|float|null $object, ObjectMapper|float|null $objectMapper, Of|float|null $of, Oneway|float|null $oneway, Open|float|null $open, Operator|float|null $operator, Optional|float|null $optional, OrClass|float|null $or, OrEq|float|null $orEq, Out|float|null $out, OverrideClass|float|null $override, Package|float|null $package, Params|float|null $params, Pass|float|null $pass, Port|float|null $port, Postfix|float|null $postfix, Precedence|float|null $precedence, Prefix|float|null $prefix, PrimitiveKind|float|null $primitiveKind, PrintClass|float|null $print, Printf|float|null $printf, PrintMembers|float|null $printMembers, PrivateClass|float|null $private, ProtectedClass|float|null $protected, Protocol|float|null $protocol, ProtocolClass|float|null $topLevelProtocol, PublicClass|float|null $public, Quicktype|float|null $quicktype, Raise|float|null $raise, Range|float|null $range, ReadonlyClass|float|null $readonly, Ref|float|null $ref, RegExp|float|null $regExp, Register|float|null $register, ReinterpretCast|float|null $reinterpretCast, Repeat|float|null $repeat, RequireClass|float|null $require, Required|float|null $required, Requires|float|null $requires, Restrict|float|null $restrict, Retain|float|null $retain, Rethrows|float|null $rethrows, ReturnClass|float|null $return, Right|float|null $right, RuntimeType|float|null $runtimeType, S|float|null $s, Sbyte|float|null $sbyte, Sealed|float|null $sealed, Sel|float|null $sel, Select|float|null $select, SelfClass|float|null $self, UnionSelfSelf|float|null $topLevelSelf, Sendable|float|null $sendable, SerialDescriptor|float|null $serialDescriptor, SerializableClass|float|null $serializable, Serialize|float|null $serialize, SerializerProvider|float|null $serializerProvider, SerialName|float|null $serialName, Set|float|null $set, Short|float|null $short, Signed|float|null $signed, SimpleModule|float|null $simpleModule, Sizeof|float|null $sizeof, Stackalloc|float|null $stackalloc, Standards|float|null $standards, StaticClass|float|null $static, StaticAssert|float|null $staticAssert, StaticCast|float|null $staticCast, StdDeserializer|float|null $stdDeserializer, StdSerializer|float|null $stdSerializer, Strictfp|float|null $strictfp, StringClass|float|null $string, Struct|float|null $struct, Subscript|float|null $subscript, Super|float|null $super, SwitchClass|float|null $switch, Symbol|float|null $symbol, Synchronized|float|null $synchronized, System|float|null $system, Template|float|null $template, Then|float|null $then, This|float|null $topLevelThis, ThreadLocal|float|null $threadLocal, ThrowClass|float|null $throw, Throws|float|null $throws, TimeOnly|float|null $timeOnly, TimeOnlyConverter|float|null $timeOnlyConverter, TimeZone|float|null $timeZone, ToJSON|float|null $toJSON, TopLevelClass|float|null $topLevel, ToString|float|null $toString, Transient|float|null $transient, TrueClass|float|null $true, UnionTrueTrue|float|null $topLevelTrue, TryClass|float|null $try, Type|float|null $type, TypeClass|float|null $topLevelType, Typealias|float|null $typealias, Typedef|float|null $typedef, Typeid|float|null $typeid, Typename|float|null $typename, Typeof|float|null $typeof, Uint|float|null $uint, Ulong|float|null $ulong, Unchecked|float|null $unchecked, Undefined|float|null $undefined, UnionClass|float|null $union, Unowned|float|null $unowned, Unsafe|float|null $unsafe, Unsigned|float|null $unsigned, UseSerializers|float|null $useSerializers, Ushort|float|null $ushort, Using|float|null $using, Utf8JSONReader|float|null $utf8JSONReader, Utf8JSONWriter|float|null $utf8JSONWriter, UUID|float|null $uuid, VarClass|float|null $var, Virtual|float|null $virtual, VoidClass|float|null $void, Volatile|float|null $volatile, WcharT|float|null $wcharT, Weak|float|null $weak, Where|float|null $where, WhileClass|float|null $while, WillSet|float|null $willSet, With|float|null $with, XorClass|float|null $xor, XorEq|float|null $xorEq, Yes|float|null $yes, YieldClass|float|null $yield) { | |
| 696 | + public function __construct(Union|float|null $empty, UnionBoolBool|float|null $topLevelBool, Complex|float|null $complex, Imaginery|float|null $imaginery, AbstractClass|float|null $abstract, Alignas|float|null $alignas, Alignof|float|null $alignof, AndClass|float|null $and, AndEq|float|null $andEq, AnyClass|float|null $topLevelAny, Any|float|null $any, ArrayClass|float|null $array, AsClass|float|null $as, ASM|float|null $asm, Assert|float|null $assert, Associatedtype|float|null $associatedtype, Associativity|float|null $associativity, Async|float|null $async, Atomic|float|null $atomic, AtomicCancel|float|null $atomicCancel, AtomicCommit|float|null $atomicCommit, AtomicNoexcept|float|null $atomicNoexcept, Auto|float|null $auto, Await|float|null $await, Base|float|null $base, Bitand|float|null $bitand, Bitor|float|null $bitor, BOOLClass|float|null $bool, UnionBoolBoolClass|float|null $purpleBool, Boolean|float|null $boolean, BreakClass|float|null $break, Bycopy|float|null $bycopy, Byref|float|null $byref, Byte|float|null $byte, Calendar|float|null $calendar, CaseClass|float|null $case, CatchClass|float|null $catch, Chan|float|null $chan, Char|float|null $char, Char16T|float|null $char16T, Char32T|float|null $char32T, Checked|float|null $checked, UnionClassClass|float|null $topLevelClass, ClassClass|float|null $class, CloneClass|float|null $clone, CoAwait|float|null $coAwait, CoReturn|float|null $coReturn, CoYield|float|null $coYield, Codable|float|null $codable, CodingKey|float|null $codingKey, CodingKeys|float|null $codingKeys, Compl|float|null $compl, Concept|float|null $concept, Console|float|null $console, ConstClass|float|null $const, ConstCast|float|null $constCast, Constexpr|float|null $constexpr, Constructor|float|null $constructor, ContinueClass|float|null $continue, Convenience|float|null $convenience, Convert|float|null $convert, ConverterClass|float|null $converter, CultureInfo|float|null $cultureInfo, Date|float|null $date, DateParseHandling|float|null $dateParseHandling, DateFormatter|float|null $dateFormatter, DateOnly|float|null $dateOnly, DateOnlyConverter|float|null $dateOnlyConverter, DateTimeClass|float|null $dateTime, DateTimeStyles|float|null $dateTimeStyles, Debugger|float|null $debugger, Decimal|float|null $decimal, DeclareClass|float|null $declare, Decltype|float|null $decltype, DecodeString|float|null $decodeString, Decoder|float|null $decoder, DecodingError|float|null $decodingError, Def|float|null $def, DefaultClass|float|null $default, Defer|float|null $defer, Deinit|float|null $deinit, Del|float|null $del, Delegate|float|null $delegate, Delete|float|null $delete, Dict|float|null $dict, Dictionary|float|null $dictionary, DidSet|float|null $didSet, DoClass|float|null $do, Double|float|null $double, ?float $dummy, Dynamic|float|null $dynamic, DynamicCast|float|null $dynamicCast, Elif|float|null $elif, ElseClass|float|null $else, EncodeQuickType|float|null $encodeQuickType, Encoder|float|null $encoder, EnumClass|float|null $enum, EnumValues|float|null $enumValues, EqualityContract|float|null $equalityContract, Equatable|float|null $equatable, Event|float|null $event, Except|float|null $except, ExceptionClass|float|null $exception, Explicit|float|null $explicit, Export|float|null $export, Exposing|float|null $exposing, ExtendsClass|float|null $extends, Extension|float|null $extension, Extern|float|null $extern, Fallthrough|float|null $fallthrough, UnionFalseFalse|float|null $topLevelFalse, FalseClass|float|null $false, Fileprivate|float|null $fileprivate, FinalClass|float|null $final, FinallyClass|float|null $finally, Fixed|float|null $fixed, FloatClass|float|null $float, ForClass|float|null $for, ForeachClass|float|null $foreach, FormatException|float|null $formatException, Friend|float|null $friend, From|float|null $from, FromDict|float|null $fromDict, FromJSON|float|null $fromJSON, Func|float|null $func, FunctionClass|float|null $function, Get|float|null $get, GlobalClass|float|null $global, Go|float|null $go, GotoClass|float|null $goto, Guard|float|null $guard, Hashable|float|null $hashable, HashCode|float|null $hashCode, Hasher|float|null $hasher, HasOwnProperty|float|null $hasOwnProperty, ID|float|null $id, IfClass|float|null $if, Imp|float|null $imp, ImplementsClass|float|null $implements, Implicit|float|null $implicit, Import|float|null $import, In|float|null $in, Indirect|float|null $indirect, Infix|float|null $infix, Init|float|null $init, Inline|float|null $inline, Inout|float|null $inout, InstanceofClass|float|null $instanceof, IntClass|float|null $int, InterfaceClass|float|null $interface, Internal|float|null $internal, Is|float|null $is, ISODateTimeOffsetConverter|float|null $isoDateTimeOffsetConverter, IterableClass|float|null $iterable, Jdec|float|null $jdec, Jenc|float|null $jenc, Jpipe|float|null $jpipe, JSON|float|null $json, JSONConverter|float|null $jsonConverter, JSONSerializer|float|null $jsonSerializer, JSONToken|float|null $jsonToken, JSONWriter|float|null $jsonWriter, JSONAny|float|null $jsonAny, JSONCodingKey|float|null $jsonCodingKey, JSONDecoder|float|null $jsonDecoder, JSONEncoder|float|null $jsonEncoder, JSONExceptionClass|float|null $jsonException, JSONGenerator|float|null $jsonGenerator, JSONNode|float|null $jsonNode, JSONNull|float|null $jsonNull, JSONParser|float|null $jsonParser, JSONReader|float|null $jsonReader, JSONTokenType|float|null $jsonTokenType, KSerializer|float|null $kSerializer, Lambda|float|null $lambda, Lazy|float|null $lazy, Left|float|null $left, Let|float|null $let, ListClass|float|null $list, LocaleClass|float|null $locale, Lock|float|null $lock, Long|float|null $long, Map|float|null $map, MapEntry|float|null $mapEntry, MarshalJSON|float|null $marshalJSON, MetadataPropertyHandling|float|null $metadataPropertyHandling, Module|float|null $module, Mutable|float|null $mutable, Mutating|float|null $mutating, NamespaceClass|float|null $namespace, Native|float|null $native, NewClass|float|null $new, Newtonsoft|float|null $newtonsoft, Nil|float|null $nil, No|float|null $no, Noexcept|float|null $noexcept, Nonatomic|float|null $nonatomic, NoneClass|float|null $topLevelNone, None|float|null $none, Nonlocal|float|null $nonlocal, Nonmutating|float|null $nonmutating, NoSuchMethod|float|null $noSuchMethod, Not|float|null $not, NotEq|float|null $notEq, NSError|float|null $nsError, NSObject|float|null $nsObject, NSString|float|null $nsString, NULLClass|float|null $null, UnionNullNull|float|null $topLevelNull, Nullptr|float|null $nullptr, Number|float|null $number, ObjectClass|float|null $object, ObjectMapper|float|null $objectMapper, Of|float|null $of, Oneway|float|null $oneway, Open|float|null $open, Operator|float|null $operator, Optional|float|null $optional, OrClass|float|null $or, OrEq|float|null $orEq, Out|float|null $out, OverrideClass|float|null $override, Package|float|null $package, Params|float|null $params, Pass|float|null $pass, Port|float|null $port, Postfix|float|null $postfix, Precedence|float|null $precedence, Prefix|float|null $prefix, PrimitiveKind|float|null $primitiveKind, PrintClass|float|null $print, Printf|float|null $printf, PrintMembers|float|null $printMembers, PrivateClass|float|null $private, ProtectedClass|float|null $protected, Protocol|float|null $protocol, ProtocolClass|float|null $topLevelProtocol, PublicClass|float|null $public, Quicktype|float|null $quicktype, Raise|float|null $raise, Range|float|null $range, ReadonlyClass|float|null $readonly, Ref|float|null $ref, RegExp|float|null $regExp, Register|float|null $register, ReinterpretCast|float|null $reinterpretCast, Repeat|float|null $repeat, RequireClass|float|null $require, Required|float|null $required, Requires|float|null $requires, Restrict|float|null $restrict, Retain|float|null $retain, Rethrows|float|null $rethrows, ReturnClass|float|null $return, Right|float|null $right, RuntimeType|float|null $runtimeType, S|float|null $s, Sbyte|float|null $sbyte, Sealed|float|null $sealed, Sel|float|null $sel, Select|float|null $select, SelfClass|float|null $self, UnionSelfSelf|float|null $topLevelSelf, Sendable|float|null $sendable, SerialDescriptor|float|null $serialDescriptor, SerializableClass|float|null $serializable, Serialize|float|null $serialize, SerializerProvider|float|null $serializerProvider, SerialName|float|null $serialName, Set|float|null $set, Short|float|null $short, Signed|float|null $signed, SimpleModule|float|null $simpleModule, Sizeof|float|null $sizeof, Stackalloc|float|null $stackalloc, Standards|float|null $standards, StaticClass|float|null $static, StaticAssert|float|null $staticAssert, StaticCast|float|null $staticCast, StdDeserializer|float|null $stdDeserializer, StdSerializer|float|null $stdSerializer, Strictfp|float|null $strictfp, StringClass|float|null $string, Struct|float|null $struct, Subscript|float|null $subscript, Super|float|null $super, SwitchClass|float|null $switch, Symbol|float|null $symbol, Synchronized|float|null $synchronized, System|float|null $system, Template|float|null $template, Then|float|null $then, This|float|null $topLevelThis, ThreadLocal|float|null $threadLocal, ThrowClass|float|null $throw, Throws|float|null $throws, TimeOnly|float|null $timeOnly, TimeOnlyConverter|float|null $timeOnlyConverter, TimeZone|float|null $timeZone, ToDict|float|null $toDict, ToJSON|float|null $toJSON, TopLevelClass|float|null $topLevel, ToString|float|null $toString, Transient|float|null $transient, TrueClass|float|null $true, UnionTrueTrue|float|null $topLevelTrue, TryClass|float|null $try, Type|float|null $type, TypeClass|float|null $topLevelType, Typealias|float|null $typealias, Typedef|float|null $typedef, Typeid|float|null $typeid, Typename|float|null $typename, Typeof|float|null $typeof, Uint|float|null $uint, Ulong|float|null $ulong, Unchecked|float|null $unchecked, Undefined|float|null $undefined, UnionClass|float|null $union, UnmarshalJSON|float|null $unmarshalJSON, Unowned|float|null $unowned, Unsafe|float|null $unsafe, Unsigned|float|null $unsigned, UseSerializers|float|null $useSerializers, Ushort|float|null $ushort, Using|float|null $using, Utf8JSONReader|float|null $utf8JSONReader, Utf8JSONWriter|float|null $utf8JSONWriter, UUID|float|null $uuid, VarClass|float|null $var, Virtual|float|null $virtual, VoidClass|float|null $void, Volatile|float|null $volatile, WcharT|float|null $wcharT, Weak|float|null $weak, Where|float|null $where, WhileClass|float|null $while, WillSet|float|null $willSet, With|float|null $with, XorClass|float|null $xor, XorEq|float|null $xorEq, Yes|float|null $yes, YieldClass|float|null $yield) { | |
| 689 | 697 | $this->empty = $empty; |
| 690 | 698 | $this->topLevelBool = $topLevelBool; |
| 691 | 699 | $this->complex = $complex; |
| @@ -808,6 +816,7 @@ class TopLevel { | ||
| 808 | 816 | $this->formatException = $formatException; |
| 809 | 817 | $this->friend = $friend; |
| 810 | 818 | $this->from = $from; |
| 819 | + $this->fromDict = $fromDict; | |
| 811 | 820 | $this->fromJSON = $fromJSON; |
| 812 | 821 | $this->func = $func; |
| 813 | 822 | $this->function = $function; |
| @@ -869,6 +878,7 @@ class TopLevel { | ||
| 869 | 878 | $this->long = $long; |
| 870 | 879 | $this->map = $map; |
| 871 | 880 | $this->mapEntry = $mapEntry; |
| 881 | + $this->marshalJSON = $marshalJSON; | |
| 872 | 882 | $this->metadataPropertyHandling = $metadataPropertyHandling; |
| 873 | 883 | $this->module = $module; |
| 874 | 884 | $this->mutable = $mutable; |
| @@ -983,6 +993,7 @@ class TopLevel { | ||
| 983 | 993 | $this->timeOnly = $timeOnly; |
| 984 | 994 | $this->timeOnlyConverter = $timeOnlyConverter; |
| 985 | 995 | $this->timeZone = $timeZone; |
| 996 | + $this->toDict = $toDict; | |
| 986 | 997 | $this->toJSON = $toJSON; |
| 987 | 998 | $this->topLevel = $topLevel; |
| 988 | 999 | $this->toString = $toString; |
| @@ -1002,6 +1013,7 @@ class TopLevel { | ||
| 1002 | 1013 | $this->unchecked = $unchecked; |
| 1003 | 1014 | $this->undefined = $undefined; |
| 1004 | 1015 | $this->union = $union; |
| 1016 | + $this->unmarshalJSON = $unmarshalJSON; | |
| 1005 | 1017 | $this->unowned = $unowned; |
| 1006 | 1018 | $this->unsafe = $unsafe; |
| 1007 | 1019 | $this->unsigned = $unsigned; |
| @@ -7416,7 +7428,7 @@ class TopLevel { | ||
| 7416 | 7428 | * @throws Exception |
| 7417 | 7429 | * @return Dict|float|null |
| 7418 | 7430 | */ |
| 7419 | - public static function fromDict(stdClass|float|null $value): Dict|float|null { | |
| 7431 | + public static function purpleFromDict(stdClass|float|null $value): Dict|float|null { | |
| 7420 | 7432 | if (is_null($value)) { |
| 7421 | 7433 | return $value; /*null*/ |
| 7422 | 7434 | } elseif (is_object($value)) { |
| @@ -7432,7 +7444,7 @@ class TopLevel { | ||
| 7432 | 7444 | * @throws Exception |
| 7433 | 7445 | * @return stdClass|float|null |
| 7434 | 7446 | */ |
| 7435 | - public function toDict(): stdClass|float|null { | |
| 7447 | + public function purpleToDict(): stdClass|float|null { | |
| 7436 | 7448 | if (TopLevel::validateDict($this->dict)) { |
| 7437 | 7449 | if (is_null($this->dict)) { |
| 7438 | 7450 | return $this->dict; /*null*/ |
| @@ -10280,6 +10292,82 @@ class TopLevel { | ||
| 10280 | 10292 | return From::sample(); /*152:from*/ |
| 10281 | 10293 | } |
| 10282 | 10294 | |
| 10295 | + /** | |
| 10296 | + * @param stdClass|float|null $value | |
| 10297 | + * @throws Exception | |
| 10298 | + * @return FromDict|float|null | |
| 10299 | + */ | |
| 10300 | + public static function fromFromDict(stdClass|float|null $value): FromDict|float|null { | |
| 10301 | + if (is_null($value)) { | |
| 10302 | + return $value; /*null*/ | |
| 10303 | + } elseif (is_object($value)) { | |
| 10304 | + return FromDict::from($value); /*class*/ | |
| 10305 | + } elseif (is_float($value) || is_int($value)) { | |
| 10306 | + return $value; /*float*/ | |
| 10307 | + } else { | |
| 10308 | + throw new Exception('Cannot deserialize union value in TopLevel'); | |
| 10309 | + } | |
| 10310 | + } | |
| 10311 | + | |
| 10312 | + /** | |
| 10313 | + * @throws Exception | |
| 10314 | + * @return stdClass|float|null | |
| 10315 | + */ | |
| 10316 | + public function toFromDict(): stdClass|float|null { | |
| 10317 | + if (TopLevel::validateFromDict($this->fromDict)) { | |
| 10318 | + if (is_null($this->fromDict)) { | |
| 10319 | + return $this->fromDict; /*null*/ | |
| 10320 | + } elseif ($this->fromDict instanceof FromDict) { | |
| 10321 | + return $this->fromDict->to(); /*class*/ | |
| 10322 | + } elseif (is_float($this->fromDict) || is_int($this->fromDict)) { | |
| 10323 | + return $this->fromDict; /*float*/ | |
| 10324 | + } else { | |
| 10325 | + throw new Exception('Union value has no matching member in TopLevel'); | |
| 10326 | + } | |
| 10327 | + } | |
| 10328 | + throw new Exception('never get to this TopLevel::fromDict'); | |
| 10329 | + } | |
| 10330 | + | |
| 10331 | + /** | |
| 10332 | + * @param FromDict|float|null | |
| 10333 | + * @return bool | |
| 10334 | + * @throws Exception | |
| 10335 | + */ | |
| 10336 | + public static function validateFromDict(FromDict|float|null $value): bool { | |
| 10337 | + if (is_null($value)) { | |
| 10338 | + if (!is_null($value)) { | |
| 10339 | + throw new Exception("Attribute Error:TopLevel::fromDict"); | |
| 10340 | + } | |
| 10341 | + } elseif ($value instanceof FromDict) { | |
| 10342 | + $value->validate(); | |
| 10343 | + } elseif (is_float($value) || is_int($value)) { | |
| 10344 | + if (!is_float($value) && !is_int($value)) { | |
| 10345 | + throw new Exception("Attribute Error:TopLevel::fromDict"); | |
| 10346 | + } | |
| 10347 | + } else { | |
| 10348 | + throw new Exception("Attribute Error:TopLevel::fromDict"); | |
| 10349 | + } | |
| 10350 | + return true; | |
| 10351 | + } | |
| 10352 | + | |
| 10353 | + /** | |
| 10354 | + * @throws Exception | |
| 10355 | + * @return FromDict|float|null | |
| 10356 | + */ | |
| 10357 | + public function getFromDict(): FromDict|float|null { | |
| 10358 | + if (TopLevel::validateFromDict($this->fromDict)) { | |
| 10359 | + return $this->fromDict; | |
| 10360 | + } | |
| 10361 | + throw new Exception('never get to getFromDict TopLevel::fromDict'); | |
| 10362 | + } | |
| 10363 | + | |
| 10364 | + /** | |
| 10365 | + * @return FromDict|float|null | |
| 10366 | + */ | |
| 10367 | + public static function sampleFromDict(): FromDict|float|null { | |
| 10368 | + return FromDict::sample(); /*153:fromDict*/ | |
| 10369 | + } | |
| 10370 | + | |
| 10283 | 10371 | /** |
| 10284 | 10372 | * @param stdClass|float|null $value |
| 10285 | 10373 | * @throws Exception |
| @@ -10353,7 +10441,7 @@ class TopLevel { | ||
| 10353 | 10441 | * @return FromJSON|float|null |
| 10354 | 10442 | */ |
| 10355 | 10443 | public static function sampleFromJSON(): FromJSON|float|null { |
| 10356 | - return FromJSON::sample(); /*153:fromJSON*/ | |
| 10444 | + return FromJSON::sample(); /*154:fromJSON*/ | |
| 10357 | 10445 | } |
| 10358 | 10446 | |
| 10359 | 10447 | /** |
| @@ -10429,7 +10517,7 @@ class TopLevel { | ||
| 10429 | 10517 | * @return Func|float|null |
| 10430 | 10518 | */ |
| 10431 | 10519 | public static function sampleFunc(): Func|float|null { |
| 10432 | - return Func::sample(); /*154:func*/ | |
| 10520 | + return Func::sample(); /*155:func*/ | |
| 10433 | 10521 | } |
| 10434 | 10522 | |
| 10435 | 10523 | /** |
| @@ -10505,7 +10593,7 @@ class TopLevel { | ||
| 10505 | 10593 | * @return FunctionClass|float|null |
| 10506 | 10594 | */ |
| 10507 | 10595 | public static function sampleFunction(): FunctionClass|float|null { |
| 10508 | - return FunctionClass::sample(); /*155:function*/ | |
| 10596 | + return FunctionClass::sample(); /*156:function*/ | |
| 10509 | 10597 | } |
| 10510 | 10598 | |
| 10511 | 10599 | /** |
| @@ -10581,7 +10669,7 @@ class TopLevel { | ||
| 10581 | 10669 | * @return Get|float|null |
| 10582 | 10670 | */ |
| 10583 | 10671 | public static function sampleGet(): Get|float|null { |
| 10584 | - return Get::sample(); /*156:get*/ | |
| 10672 | + return Get::sample(); /*157:get*/ | |
| 10585 | 10673 | } |
| 10586 | 10674 | |
| 10587 | 10675 | /** |
| @@ -10657,7 +10745,7 @@ class TopLevel { | ||
| 10657 | 10745 | * @return GlobalClass|float|null |
| 10658 | 10746 | */ |
| 10659 | 10747 | public static function sampleGlobal(): GlobalClass|float|null { |
| 10660 | - return GlobalClass::sample(); /*157:global*/ | |
| 10748 | + return GlobalClass::sample(); /*158:global*/ | |
| 10661 | 10749 | } |
| 10662 | 10750 | |
| 10663 | 10751 | /** |
| @@ -10733,7 +10821,7 @@ class TopLevel { | ||
| 10733 | 10821 | * @return Go|float|null |
| 10734 | 10822 | */ |
| 10735 | 10823 | public static function sampleGo(): Go|float|null { |
| 10736 | - return Go::sample(); /*158:go*/ | |
| 10824 | + return Go::sample(); /*159:go*/ | |
| 10737 | 10825 | } |
| 10738 | 10826 | |
| 10739 | 10827 | /** |
| @@ -10809,7 +10897,7 @@ class TopLevel { | ||
| 10809 | 10897 | * @return GotoClass|float|null |
| 10810 | 10898 | */ |
| 10811 | 10899 | public static function sampleGoto(): GotoClass|float|null { |
| 10812 | - return GotoClass::sample(); /*159:goto*/ | |
| 10900 | + return GotoClass::sample(); /*160:goto*/ | |
| 10813 | 10901 | } |
| 10814 | 10902 | |
| 10815 | 10903 | /** |
| @@ -10885,7 +10973,7 @@ class TopLevel { | ||
| 10885 | 10973 | * @return Guard|float|null |
| 10886 | 10974 | */ |
| 10887 | 10975 | public static function sampleGuard(): Guard|float|null { |
| 10888 | - return Guard::sample(); /*160:guard*/ | |
| 10976 | + return Guard::sample(); /*161:guard*/ | |
| 10889 | 10977 | } |
| 10890 | 10978 | |
| 10891 | 10979 | /** |
| @@ -10961,7 +11049,7 @@ class TopLevel { | ||
| 10961 | 11049 | * @return Hashable|float|null |
| 10962 | 11050 | */ |
| 10963 | 11051 | public static function sampleHashable(): Hashable|float|null { |
| 10964 | - return Hashable::sample(); /*161:hashable*/ | |
| 11052 | + return Hashable::sample(); /*162:hashable*/ | |
| 10965 | 11053 | } |
| 10966 | 11054 | |
| 10967 | 11055 | /** |
| @@ -11037,7 +11125,7 @@ class TopLevel { | ||
| 11037 | 11125 | * @return HashCode|float|null |
| 11038 | 11126 | */ |
| 11039 | 11127 | public static function sampleHashCode(): HashCode|float|null { |
| 11040 | - return HashCode::sample(); /*162:hashCode*/ | |
| 11128 | + return HashCode::sample(); /*163:hashCode*/ | |
| 11041 | 11129 | } |
| 11042 | 11130 | |
| 11043 | 11131 | /** |
| @@ -11113,7 +11201,7 @@ class TopLevel { | ||
| 11113 | 11201 | * @return Hasher|float|null |
| 11114 | 11202 | */ |
| 11115 | 11203 | public static function sampleHasher(): Hasher|float|null { |
| 11116 | - return Hasher::sample(); /*163:hasher*/ | |
| 11204 | + return Hasher::sample(); /*164:hasher*/ | |
| 11117 | 11205 | } |
| 11118 | 11206 | |
| 11119 | 11207 | /** |
| @@ -11189,7 +11277,7 @@ class TopLevel { | ||
| 11189 | 11277 | * @return HasOwnProperty|float|null |
| 11190 | 11278 | */ |
| 11191 | 11279 | public static function sampleHasOwnProperty(): HasOwnProperty|float|null { |
| 11192 | - return HasOwnProperty::sample(); /*164:hasOwnProperty*/ | |
| 11280 | + return HasOwnProperty::sample(); /*165:hasOwnProperty*/ | |
| 11193 | 11281 | } |
| 11194 | 11282 | |
| 11195 | 11283 | /** |
| @@ -11265,7 +11353,7 @@ class TopLevel { | ||
| 11265 | 11353 | * @return ID|float|null |
| 11266 | 11354 | */ |
| 11267 | 11355 | public static function sampleID(): ID|float|null { |
| 11268 | - return ID::sample(); /*165:id*/ | |
| 11356 | + return ID::sample(); /*166:id*/ | |
| 11269 | 11357 | } |
| 11270 | 11358 | |
| 11271 | 11359 | /** |
| @@ -11341,7 +11429,7 @@ class TopLevel { | ||
| 11341 | 11429 | * @return IfClass|float|null |
| 11342 | 11430 | */ |
| 11343 | 11431 | public static function sampleIf(): IfClass|float|null { |
| 11344 | - return IfClass::sample(); /*166:if*/ | |
| 11432 | + return IfClass::sample(); /*167:if*/ | |
| 11345 | 11433 | } |
| 11346 | 11434 | |
| 11347 | 11435 | /** |
| @@ -11417,7 +11505,7 @@ class TopLevel { | ||
| 11417 | 11505 | * @return Imp|float|null |
| 11418 | 11506 | */ |
| 11419 | 11507 | public static function sampleImp(): Imp|float|null { |
| 11420 | - return Imp::sample(); /*167:imp*/ | |
| 11508 | + return Imp::sample(); /*168:imp*/ | |
| 11421 | 11509 | } |
| 11422 | 11510 | |
| 11423 | 11511 | /** |
| @@ -11493,7 +11581,7 @@ class TopLevel { | ||
| 11493 | 11581 | * @return ImplementsClass|float|null |
| 11494 | 11582 | */ |
| 11495 | 11583 | public static function sampleImplements(): ImplementsClass|float|null { |
| 11496 | - return ImplementsClass::sample(); /*168:implements*/ | |
| 11584 | + return ImplementsClass::sample(); /*169:implements*/ | |
| 11497 | 11585 | } |
| 11498 | 11586 | |
| 11499 | 11587 | /** |
| @@ -11569,7 +11657,7 @@ class TopLevel { | ||
| 11569 | 11657 | * @return Implicit|float|null |
| 11570 | 11658 | */ |
| 11571 | 11659 | public static function sampleImplicit(): Implicit|float|null { |
| 11572 | - return Implicit::sample(); /*169:implicit*/ | |
| 11660 | + return Implicit::sample(); /*170:implicit*/ | |
| 11573 | 11661 | } |
| 11574 | 11662 | |
| 11575 | 11663 | /** |
| @@ -11645,7 +11733,7 @@ class TopLevel { | ||
| 11645 | 11733 | * @return Import|float|null |
| 11646 | 11734 | */ |
| 11647 | 11735 | public static function sampleImport(): Import|float|null { |
| 11648 | - return Import::sample(); /*170:import*/ | |
| 11736 | + return Import::sample(); /*171:import*/ | |
| 11649 | 11737 | } |
| 11650 | 11738 | |
| 11651 | 11739 | /** |
| @@ -11721,7 +11809,7 @@ class TopLevel { | ||
| 11721 | 11809 | * @return In|float|null |
| 11722 | 11810 | */ |
| 11723 | 11811 | public static function sampleIn(): In|float|null { |
| 11724 | - return In::sample(); /*171:in*/ | |
| 11812 | + return In::sample(); /*172:in*/ | |
| 11725 | 11813 | } |
| 11726 | 11814 | |
| 11727 | 11815 | /** |
| @@ -11797,7 +11885,7 @@ class TopLevel { | ||
| 11797 | 11885 | * @return Indirect|float|null |
| 11798 | 11886 | */ |
| 11799 | 11887 | public static function sampleIndirect(): Indirect|float|null { |
| 11800 | - return Indirect::sample(); /*172:indirect*/ | |
| 11888 | + return Indirect::sample(); /*173:indirect*/ | |
| 11801 | 11889 | } |
| 11802 | 11890 | |
| 11803 | 11891 | /** |
| @@ -11873,7 +11961,7 @@ class TopLevel { | ||
| 11873 | 11961 | * @return Infix|float|null |
| 11874 | 11962 | */ |
| 11875 | 11963 | public static function sampleInfix(): Infix|float|null { |
| 11876 | - return Infix::sample(); /*173:infix*/ | |
| 11964 | + return Infix::sample(); /*174:infix*/ | |
| 11877 | 11965 | } |
| 11878 | 11966 | |
| 11879 | 11967 | /** |
| @@ -11949,7 +12037,7 @@ class TopLevel { | ||
| 11949 | 12037 | * @return Init|float|null |
| 11950 | 12038 | */ |
| 11951 | 12039 | public static function sampleInit(): Init|float|null { |
| 11952 | - return Init::sample(); /*174:init*/ | |
| 12040 | + return Init::sample(); /*175:init*/ | |
| 11953 | 12041 | } |
| 11954 | 12042 | |
| 11955 | 12043 | /** |
| @@ -12025,7 +12113,7 @@ class TopLevel { | ||
| 12025 | 12113 | * @return Inline|float|null |
| 12026 | 12114 | */ |
| 12027 | 12115 | public static function sampleInline(): Inline|float|null { |
| 12028 | - return Inline::sample(); /*175:inline*/ | |
| 12116 | + return Inline::sample(); /*176:inline*/ | |
| 12029 | 12117 | } |
| 12030 | 12118 | |
| 12031 | 12119 | /** |
| @@ -12101,7 +12189,7 @@ class TopLevel { | ||
| 12101 | 12189 | * @return Inout|float|null |
| 12102 | 12190 | */ |
| 12103 | 12191 | public static function sampleInout(): Inout|float|null { |
| 12104 | - return Inout::sample(); /*176:inout*/ | |
| 12192 | + return Inout::sample(); /*177:inout*/ | |
| 12105 | 12193 | } |
| 12106 | 12194 | |
| 12107 | 12195 | /** |
| @@ -12177,7 +12265,7 @@ class TopLevel { | ||
| 12177 | 12265 | * @return InstanceofClass|float|null |
| 12178 | 12266 | */ |
| 12179 | 12267 | public static function sampleInstanceof(): InstanceofClass|float|null { |
| 12180 | - return InstanceofClass::sample(); /*177:instanceof*/ | |
| 12268 | + return InstanceofClass::sample(); /*178:instanceof*/ | |
| 12181 | 12269 | } |
| 12182 | 12270 | |
| 12183 | 12271 | /** |
| @@ -12253,7 +12341,7 @@ class TopLevel { | ||
| 12253 | 12341 | * @return IntClass|float|null |
| 12254 | 12342 | */ |
| 12255 | 12343 | public static function sampleInt(): IntClass|float|null { |
| 12256 | - return IntClass::sample(); /*178:int*/ | |
| 12344 | + return IntClass::sample(); /*179:int*/ | |
| 12257 | 12345 | } |
| 12258 | 12346 | |
| 12259 | 12347 | /** |
| @@ -12329,7 +12417,7 @@ class TopLevel { | ||
| 12329 | 12417 | * @return InterfaceClass|float|null |
| 12330 | 12418 | */ |
| 12331 | 12419 | public static function sampleInterface(): InterfaceClass|float|null { |
| 12332 | - return InterfaceClass::sample(); /*179:interface*/ | |
| 12420 | + return InterfaceClass::sample(); /*180:interface*/ | |
| 12333 | 12421 | } |
| 12334 | 12422 | |
| 12335 | 12423 | /** |
| @@ -12405,7 +12493,7 @@ class TopLevel { | ||
| 12405 | 12493 | * @return Internal|float|null |
| 12406 | 12494 | */ |
| 12407 | 12495 | public static function sampleInternal(): Internal|float|null { |
| 12408 | - return Internal::sample(); /*180:internal*/ | |
| 12496 | + return Internal::sample(); /*181:internal*/ | |
| 12409 | 12497 | } |
| 12410 | 12498 | |
| 12411 | 12499 | /** |
| @@ -12481,7 +12569,7 @@ class TopLevel { | ||
| 12481 | 12569 | * @return Is|float|null |
| 12482 | 12570 | */ |
| 12483 | 12571 | public static function sampleIs(): Is|float|null { |
| 12484 | - return Is::sample(); /*181:is*/ | |
| 12572 | + return Is::sample(); /*182:is*/ | |
| 12485 | 12573 | } |
| 12486 | 12574 | |
| 12487 | 12575 | /** |
| @@ -12557,7 +12645,7 @@ class TopLevel { | ||
| 12557 | 12645 | * @return ISODateTimeOffsetConverter|float|null |
| 12558 | 12646 | */ |
| 12559 | 12647 | public static function sampleISODateTimeOffsetConverter(): ISODateTimeOffsetConverter|float|null { |
| 12560 | - return ISODateTimeOffsetConverter::sample(); /*182:isoDateTimeOffsetConverter*/ | |
| 12648 | + return ISODateTimeOffsetConverter::sample(); /*183:isoDateTimeOffsetConverter*/ | |
| 12561 | 12649 | } |
| 12562 | 12650 | |
| 12563 | 12651 | /** |
| @@ -12633,7 +12721,7 @@ class TopLevel { | ||
| 12633 | 12721 | * @return IterableClass|float|null |
| 12634 | 12722 | */ |
| 12635 | 12723 | public static function sampleIterable(): IterableClass|float|null { |
| 12636 | - return IterableClass::sample(); /*183:iterable*/ | |
| 12724 | + return IterableClass::sample(); /*184:iterable*/ | |
| 12637 | 12725 | } |
| 12638 | 12726 | |
| 12639 | 12727 | /** |
| @@ -12709,7 +12797,7 @@ class TopLevel { | ||
| 12709 | 12797 | * @return Jdec|float|null |
| 12710 | 12798 | */ |
| 12711 | 12799 | public static function sampleJdec(): Jdec|float|null { |
| 12712 | - return Jdec::sample(); /*184:jdec*/ | |
| 12800 | + return Jdec::sample(); /*185:jdec*/ | |
| 12713 | 12801 | } |
| 12714 | 12802 | |
| 12715 | 12803 | /** |
| @@ -12785,7 +12873,7 @@ class TopLevel { | ||
| 12785 | 12873 | * @return Jenc|float|null |
| 12786 | 12874 | */ |
| 12787 | 12875 | public static function sampleJenc(): Jenc|float|null { |
| 12788 | - return Jenc::sample(); /*185:jenc*/ | |
| 12876 | + return Jenc::sample(); /*186:jenc*/ | |
| 12789 | 12877 | } |
| 12790 | 12878 | |
| 12791 | 12879 | /** |
| @@ -12861,7 +12949,7 @@ class TopLevel { | ||
| 12861 | 12949 | * @return Jpipe|float|null |
| 12862 | 12950 | */ |
| 12863 | 12951 | public static function sampleJpipe(): Jpipe|float|null { |
| 12864 | - return Jpipe::sample(); /*186:jpipe*/ | |
| 12952 | + return Jpipe::sample(); /*187:jpipe*/ | |
| 12865 | 12953 | } |
| 12866 | 12954 | |
| 12867 | 12955 | /** |
| @@ -12937,7 +13025,7 @@ class TopLevel { | ||
| 12937 | 13025 | * @return JSON|float|null |
| 12938 | 13026 | */ |
| 12939 | 13027 | public static function sampleJSON(): JSON|float|null { |
| 12940 | - return JSON::sample(); /*187:json*/ | |
| 13028 | + return JSON::sample(); /*188:json*/ | |
| 12941 | 13029 | } |
| 12942 | 13030 | |
| 12943 | 13031 | /** |
| @@ -13013,7 +13101,7 @@ class TopLevel { | ||
| 13013 | 13101 | * @return JSONConverter|float|null |
| 13014 | 13102 | */ |
| 13015 | 13103 | public static function sampleJSONConverter(): JSONConverter|float|null { |
| 13016 | - return JSONConverter::sample(); /*188:jsonConverter*/ | |
| 13104 | + return JSONConverter::sample(); /*189:jsonConverter*/ | |
| 13017 | 13105 | } |
| 13018 | 13106 | |
| 13019 | 13107 | /** |
| @@ -13089,7 +13177,7 @@ class TopLevel { | ||
| 13089 | 13177 | * @return JSONSerializer|float|null |
| 13090 | 13178 | */ |
| 13091 | 13179 | public static function sampleJSONSerializer(): JSONSerializer|float|null { |
| 13092 | - return JSONSerializer::sample(); /*189:jsonSerializer*/ | |
| 13180 | + return JSONSerializer::sample(); /*190:jsonSerializer*/ | |
| 13093 | 13181 | } |
| 13094 | 13182 | |
| 13095 | 13183 | /** |
| @@ -13165,7 +13253,7 @@ class TopLevel { | ||
| 13165 | 13253 | * @return JSONToken|float|null |
| 13166 | 13254 | */ |
| 13167 | 13255 | public static function sampleJSONToken(): JSONToken|float|null { |
| 13168 | - return JSONToken::sample(); /*190:jsonToken*/ | |
| 13256 | + return JSONToken::sample(); /*191:jsonToken*/ | |
| 13169 | 13257 | } |
| 13170 | 13258 | |
| 13171 | 13259 | /** |
| @@ -13241,7 +13329,7 @@ class TopLevel { | ||
| 13241 | 13329 | * @return JSONWriter|float|null |
| 13242 | 13330 | */ |
| 13243 | 13331 | public static function sampleJSONWriter(): JSONWriter|float|null { |
| 13244 | - return JSONWriter::sample(); /*191:jsonWriter*/ | |
| 13332 | + return JSONWriter::sample(); /*192:jsonWriter*/ | |
| 13245 | 13333 | } |
| 13246 | 13334 | |
| 13247 | 13335 | /** |
| @@ -13317,7 +13405,7 @@ class TopLevel { | ||
| 13317 | 13405 | * @return JSONAny|float|null |
| 13318 | 13406 | */ |
| 13319 | 13407 | public static function sampleJSONAny(): JSONAny|float|null { |
| 13320 | - return JSONAny::sample(); /*192:jsonAny*/ | |
| 13408 | + return JSONAny::sample(); /*193:jsonAny*/ | |
| 13321 | 13409 | } |
| 13322 | 13410 | |
| 13323 | 13411 | /** |
| @@ -13393,7 +13481,7 @@ class TopLevel { | ||
| 13393 | 13481 | * @return JSONCodingKey|float|null |
| 13394 | 13482 | */ |
| 13395 | 13483 | public static function sampleJSONCodingKey(): JSONCodingKey|float|null { |
| 13396 | - return JSONCodingKey::sample(); /*193:jsonCodingKey*/ | |
| 13484 | + return JSONCodingKey::sample(); /*194:jsonCodingKey*/ | |
| 13397 | 13485 | } |
| 13398 | 13486 | |
| 13399 | 13487 | /** |
| @@ -13469,7 +13557,7 @@ class TopLevel { | ||
| 13469 | 13557 | * @return JSONDecoder|float|null |
| 13470 | 13558 | */ |
| 13471 | 13559 | public static function sampleJSONDecoder(): JSONDecoder|float|null { |
| 13472 | - return JSONDecoder::sample(); /*194:jsonDecoder*/ | |
| 13560 | + return JSONDecoder::sample(); /*195:jsonDecoder*/ | |
| 13473 | 13561 | } |
| 13474 | 13562 | |
| 13475 | 13563 | /** |
| @@ -13545,7 +13633,7 @@ class TopLevel { | ||
| 13545 | 13633 | * @return JSONEncoder|float|null |
| 13546 | 13634 | */ |
| 13547 | 13635 | public static function sampleJSONEncoder(): JSONEncoder|float|null { |
| 13548 | - return JSONEncoder::sample(); /*195:jsonEncoder*/ | |
| 13636 | + return JSONEncoder::sample(); /*196:jsonEncoder*/ | |
| 13549 | 13637 | } |
| 13550 | 13638 | |
| 13551 | 13639 | /** |
| @@ -13621,7 +13709,7 @@ class TopLevel { | ||
| 13621 | 13709 | * @return JSONExceptionClass|float|null |
| 13622 | 13710 | */ |
| 13623 | 13711 | public static function sampleJSONException(): JSONExceptionClass|float|null { |
| 13624 | - return JSONExceptionClass::sample(); /*196:jsonException*/ | |
| 13712 | + return JSONExceptionClass::sample(); /*197:jsonException*/ | |
| 13625 | 13713 | } |
| 13626 | 13714 | |
| 13627 | 13715 | /** |
| @@ -13697,7 +13785,7 @@ class TopLevel { | ||
| 13697 | 13785 | * @return JSONGenerator|float|null |
| 13698 | 13786 | */ |
| 13699 | 13787 | public static function sampleJSONGenerator(): JSONGenerator|float|null { |
| 13700 | - return JSONGenerator::sample(); /*197:jsonGenerator*/ | |
| 13788 | + return JSONGenerator::sample(); /*198:jsonGenerator*/ | |
| 13701 | 13789 | } |
| 13702 | 13790 | |
| 13703 | 13791 | /** |
| @@ -13773,7 +13861,7 @@ class TopLevel { | ||
| 13773 | 13861 | * @return JSONNode|float|null |
| 13774 | 13862 | */ |
| 13775 | 13863 | public static function sampleJSONNode(): JSONNode|float|null { |
| 13776 | - return JSONNode::sample(); /*198:jsonNode*/ | |
| 13864 | + return JSONNode::sample(); /*199:jsonNode*/ | |
| 13777 | 13865 | } |
| 13778 | 13866 | |
| 13779 | 13867 | /** |
| @@ -13849,7 +13937,7 @@ class TopLevel { | ||
| 13849 | 13937 | * @return JSONNull|float|null |
| 13850 | 13938 | */ |
| 13851 | 13939 | public static function sampleJSONNull(): JSONNull|float|null { |
| 13852 | - return JSONNull::sample(); /*199:jsonNull*/ | |
| 13940 | + return JSONNull::sample(); /*200:jsonNull*/ | |
| 13853 | 13941 | } |
| 13854 | 13942 | |
| 13855 | 13943 | /** |
| @@ -13925,7 +14013,7 @@ class TopLevel { | ||
| 13925 | 14013 | * @return JSONParser|float|null |
| 13926 | 14014 | */ |
| 13927 | 14015 | public static function sampleJSONParser(): JSONParser|float|null { |
| 13928 | - return JSONParser::sample(); /*200:jsonParser*/ | |
| 14016 | + return JSONParser::sample(); /*201:jsonParser*/ | |
| 13929 | 14017 | } |
| 13930 | 14018 | |
| 13931 | 14019 | /** |
| @@ -14001,7 +14089,7 @@ class TopLevel { | ||
| 14001 | 14089 | * @return JSONReader|float|null |
| 14002 | 14090 | */ |
| 14003 | 14091 | public static function sampleJSONReader(): JSONReader|float|null { |
| 14004 | - return JSONReader::sample(); /*201:jsonReader*/ | |
| 14092 | + return JSONReader::sample(); /*202:jsonReader*/ | |
| 14005 | 14093 | } |
| 14006 | 14094 | |
| 14007 | 14095 | /** |
| @@ -14077,7 +14165,7 @@ class TopLevel { | ||
| 14077 | 14165 | * @return JSONTokenType|float|null |
| 14078 | 14166 | */ |
| 14079 | 14167 | public static function sampleJSONTokenType(): JSONTokenType|float|null { |
| 14080 | - return JSONTokenType::sample(); /*202:jsonTokenType*/ | |
| 14168 | + return JSONTokenType::sample(); /*203:jsonTokenType*/ | |
| 14081 | 14169 | } |
| 14082 | 14170 | |
| 14083 | 14171 | /** |
| @@ -14153,7 +14241,7 @@ class TopLevel { | ||
| 14153 | 14241 | * @return KSerializer|float|null |
| 14154 | 14242 | */ |
| 14155 | 14243 | public static function sampleKSerializer(): KSerializer|float|null { |
| 14156 | - return KSerializer::sample(); /*203:kSerializer*/ | |
| 14244 | + return KSerializer::sample(); /*204:kSerializer*/ | |
| 14157 | 14245 | } |
| 14158 | 14246 | |
| 14159 | 14247 | /** |
| @@ -14229,7 +14317,7 @@ class TopLevel { | ||
| 14229 | 14317 | * @return Lambda|float|null |
| 14230 | 14318 | */ |
| 14231 | 14319 | public static function sampleLambda(): Lambda|float|null { |
| 14232 | - return Lambda::sample(); /*204:lambda*/ | |
| 14320 | + return Lambda::sample(); /*205:lambda*/ | |
| 14233 | 14321 | } |
| 14234 | 14322 | |
| 14235 | 14323 | /** |
| @@ -14305,7 +14393,7 @@ class TopLevel { | ||
| 14305 | 14393 | * @return Lazy|float|null |
| 14306 | 14394 | */ |
| 14307 | 14395 | public static function sampleLazy(): Lazy|float|null { |
| 14308 | - return Lazy::sample(); /*205:lazy*/ | |
| 14396 | + return Lazy::sample(); /*206:lazy*/ | |
| 14309 | 14397 | } |
| 14310 | 14398 | |
| 14311 | 14399 | /** |
| @@ -14381,7 +14469,7 @@ class TopLevel { | ||
| 14381 | 14469 | * @return Left|float|null |
| 14382 | 14470 | */ |
| 14383 | 14471 | public static function sampleLeft(): Left|float|null { |
| 14384 | - return Left::sample(); /*206:left*/ | |
| 14472 | + return Left::sample(); /*207:left*/ | |
| 14385 | 14473 | } |
| 14386 | 14474 | |
| 14387 | 14475 | /** |
| @@ -14457,7 +14545,7 @@ class TopLevel { | ||
| 14457 | 14545 | * @return Let|float|null |
| 14458 | 14546 | */ |
| 14459 | 14547 | public static function sampleLet(): Let|float|null { |
| 14460 | - return Let::sample(); /*207:let*/ | |
| 14548 | + return Let::sample(); /*208:let*/ | |
| 14461 | 14549 | } |
| 14462 | 14550 | |
| 14463 | 14551 | /** |
| @@ -14533,7 +14621,7 @@ class TopLevel { | ||
| 14533 | 14621 | * @return ListClass|float|null |
| 14534 | 14622 | */ |
| 14535 | 14623 | public static function sampleList(): ListClass|float|null { |
| 14536 | - return ListClass::sample(); /*208:list*/ | |
| 14624 | + return ListClass::sample(); /*209:list*/ | |
| 14537 | 14625 | } |
| 14538 | 14626 | |
| 14539 | 14627 | /** |
| @@ -14609,7 +14697,7 @@ class TopLevel { | ||
| 14609 | 14697 | * @return LocaleClass|float|null |
| 14610 | 14698 | */ |
| 14611 | 14699 | public static function sampleLocale(): LocaleClass|float|null { |
| 14612 | - return LocaleClass::sample(); /*209:locale*/ | |
| 14700 | + return LocaleClass::sample(); /*210:locale*/ | |
| 14613 | 14701 | } |
| 14614 | 14702 | |
| 14615 | 14703 | /** |
| @@ -14685,7 +14773,7 @@ class TopLevel { | ||
| 14685 | 14773 | * @return Lock|float|null |
| 14686 | 14774 | */ |
| 14687 | 14775 | public static function sampleLock(): Lock|float|null { |
| 14688 | - return Lock::sample(); /*210:lock*/ | |
| 14776 | + return Lock::sample(); /*211:lock*/ | |
| 14689 | 14777 | } |
| 14690 | 14778 | |
| 14691 | 14779 | /** |
| @@ -14761,7 +14849,7 @@ class TopLevel { | ||
| 14761 | 14849 | * @return Long|float|null |
| 14762 | 14850 | */ |
| 14763 | 14851 | public static function sampleLong(): Long|float|null { |
| 14764 | - return Long::sample(); /*211:long*/ | |
| 14852 | + return Long::sample(); /*212:long*/ | |
| 14765 | 14853 | } |
| 14766 | 14854 | |
| 14767 | 14855 | /** |
| @@ -14837,7 +14925,7 @@ class TopLevel { | ||
| 14837 | 14925 | * @return Map|float|null |
| 14838 | 14926 | */ |
| 14839 | 14927 | public static function sampleMap(): Map|float|null { |
| 14840 | - return Map::sample(); /*212:map*/ | |
| 14928 | + return Map::sample(); /*213:map*/ | |
| 14841 | 14929 | } |
| 14842 | 14930 | |
| 14843 | 14931 | /** |
| @@ -14913,7 +15001,83 @@ class TopLevel { | ||
| 14913 | 15001 | * @return MapEntry|float|null |
| 14914 | 15002 | */ |
| 14915 | 15003 | public static function sampleMapEntry(): MapEntry|float|null { |
| 14916 | - return MapEntry::sample(); /*213:mapEntry*/ | |
| 15004 | + return MapEntry::sample(); /*214:mapEntry*/ | |
| 15005 | + } | |
| 15006 | + | |
| 15007 | + /** | |
| 15008 | + * @param stdClass|float|null $value | |
| 15009 | + * @throws Exception | |
| 15010 | + * @return MarshalJSON|float|null | |
| 15011 | + */ | |
| 15012 | + public static function fromMarshalJSON(stdClass|float|null $value): MarshalJSON|float|null { | |
| 15013 | + if (is_null($value)) { | |
| 15014 | + return $value; /*null*/ | |
| 15015 | + } elseif (is_object($value)) { | |
| 15016 | + return MarshalJSON::from($value); /*class*/ | |
| 15017 | + } elseif (is_float($value) || is_int($value)) { | |
| 15018 | + return $value; /*float*/ | |
| 15019 | + } else { | |
| 15020 | + throw new Exception('Cannot deserialize union value in TopLevel'); | |
| 15021 | + } | |
| 15022 | + } | |
| 15023 | + | |
| 15024 | + /** | |
| 15025 | + * @throws Exception | |
| 15026 | + * @return stdClass|float|null | |
| 15027 | + */ | |
| 15028 | + public function toMarshalJSON(): stdClass|float|null { | |
| 15029 | + if (TopLevel::validateMarshalJSON($this->marshalJSON)) { | |
| 15030 | + if (is_null($this->marshalJSON)) { | |
| 15031 | + return $this->marshalJSON; /*null*/ | |
| 15032 | + } elseif ($this->marshalJSON instanceof MarshalJSON) { | |
| 15033 | + return $this->marshalJSON->to(); /*class*/ | |
| 15034 | + } elseif (is_float($this->marshalJSON) || is_int($this->marshalJSON)) { | |
| 15035 | + return $this->marshalJSON; /*float*/ | |
| 15036 | + } else { | |
| 15037 | + throw new Exception('Union value has no matching member in TopLevel'); | |
| 15038 | + } | |
| 15039 | + } | |
| 15040 | + throw new Exception('never get to this TopLevel::marshalJSON'); | |
| 15041 | + } | |
| 15042 | + | |
| 15043 | + /** | |
| 15044 | + * @param MarshalJSON|float|null | |
| 15045 | + * @return bool | |
| 15046 | + * @throws Exception | |
| 15047 | + */ | |
| 15048 | + public static function validateMarshalJSON(MarshalJSON|float|null $value): bool { | |
| 15049 | + if (is_null($value)) { | |
| 15050 | + if (!is_null($value)) { | |
| 15051 | + throw new Exception("Attribute Error:TopLevel::marshalJSON"); | |
| 15052 | + } | |
| 15053 | + } elseif ($value instanceof MarshalJSON) { | |
| 15054 | + $value->validate(); | |
| 15055 | + } elseif (is_float($value) || is_int($value)) { | |
| 15056 | + if (!is_float($value) && !is_int($value)) { | |
| 15057 | + throw new Exception("Attribute Error:TopLevel::marshalJSON"); | |
| 15058 | + } | |
| 15059 | + } else { | |
| 15060 | + throw new Exception("Attribute Error:TopLevel::marshalJSON"); | |
| 15061 | + } | |
| 15062 | + return true; | |
| 15063 | + } | |
| 15064 | + | |
| 15065 | + /** | |
| 15066 | + * @throws Exception | |
| 15067 | + * @return MarshalJSON|float|null | |
| 15068 | + */ | |
| 15069 | + public function getMarshalJSON(): MarshalJSON|float|null { | |
| 15070 | + if (TopLevel::validateMarshalJSON($this->marshalJSON)) { | |
| 15071 | + return $this->marshalJSON; | |
| 15072 | + } | |
| 15073 | + throw new Exception('never get to getMarshalJSON TopLevel::marshalJSON'); | |
| 15074 | + } | |
| 15075 | + | |
| 15076 | + /** | |
| 15077 | + * @return MarshalJSON|float|null | |
| 15078 | + */ | |
| 15079 | + public static function sampleMarshalJSON(): MarshalJSON|float|null { | |
| 15080 | + return MarshalJSON::sample(); /*215:marshalJSON*/ | |
| 14917 | 15081 | } |
| 14918 | 15082 | |
| 14919 | 15083 | /** |
| @@ -14989,7 +15153,7 @@ class TopLevel { | ||
| 14989 | 15153 | * @return MetadataPropertyHandling|float|null |
| 14990 | 15154 | */ |
| 14991 | 15155 | public static function sampleMetadataPropertyHandling(): MetadataPropertyHandling|float|null { |
| 14992 | - return MetadataPropertyHandling::sample(); /*214:metadataPropertyHandling*/ | |
| 15156 | + return MetadataPropertyHandling::sample(); /*216:metadataPropertyHandling*/ | |
| 14993 | 15157 | } |
| 14994 | 15158 | |
| 14995 | 15159 | /** |
| @@ -15065,7 +15229,7 @@ class TopLevel { | ||
| 15065 | 15229 | * @return Module|float|null |
| 15066 | 15230 | */ |
| 15067 | 15231 | public static function sampleModule(): Module|float|null { |
| 15068 | - return Module::sample(); /*215:module*/ | |
| 15232 | + return Module::sample(); /*217:module*/ | |
| 15069 | 15233 | } |
| 15070 | 15234 | |
| 15071 | 15235 | /** |
| @@ -15141,7 +15305,7 @@ class TopLevel { | ||
| 15141 | 15305 | * @return Mutable|float|null |
| 15142 | 15306 | */ |
| 15143 | 15307 | public static function sampleMutable(): Mutable|float|null { |
| 15144 | - return Mutable::sample(); /*216:mutable*/ | |
| 15308 | + return Mutable::sample(); /*218:mutable*/ | |
| 15145 | 15309 | } |
| 15146 | 15310 | |
| 15147 | 15311 | /** |
| @@ -15217,7 +15381,7 @@ class TopLevel { | ||
| 15217 | 15381 | * @return Mutating|float|null |
| 15218 | 15382 | */ |
| 15219 | 15383 | public static function sampleMutating(): Mutating|float|null { |
| 15220 | - return Mutating::sample(); /*217:mutating*/ | |
| 15384 | + return Mutating::sample(); /*219:mutating*/ | |
| 15221 | 15385 | } |
| 15222 | 15386 | |
| 15223 | 15387 | /** |
| @@ -15293,7 +15457,7 @@ class TopLevel { | ||
| 15293 | 15457 | * @return NamespaceClass|float|null |
| 15294 | 15458 | */ |
| 15295 | 15459 | public static function sampleNamespace(): NamespaceClass|float|null { |
| 15296 | - return NamespaceClass::sample(); /*218:namespace*/ | |
| 15460 | + return NamespaceClass::sample(); /*220:namespace*/ | |
| 15297 | 15461 | } |
| 15298 | 15462 | |
| 15299 | 15463 | /** |
| @@ -15369,7 +15533,7 @@ class TopLevel { | ||
| 15369 | 15533 | * @return Native|float|null |
| 15370 | 15534 | */ |
| 15371 | 15535 | public static function sampleNative(): Native|float|null { |
| 15372 | - return Native::sample(); /*219:native*/ | |
| 15536 | + return Native::sample(); /*221:native*/ | |
| 15373 | 15537 | } |
| 15374 | 15538 | |
| 15375 | 15539 | /** |
| @@ -15445,7 +15609,7 @@ class TopLevel { | ||
| 15445 | 15609 | * @return NewClass|float|null |
| 15446 | 15610 | */ |
| 15447 | 15611 | public static function sampleNew(): NewClass|float|null { |
| 15448 | - return NewClass::sample(); /*220:new*/ | |
| 15612 | + return NewClass::sample(); /*222:new*/ | |
| 15449 | 15613 | } |
| 15450 | 15614 | |
| 15451 | 15615 | /** |
| @@ -15521,7 +15685,7 @@ class TopLevel { | ||
| 15521 | 15685 | * @return Newtonsoft|float|null |
| 15522 | 15686 | */ |
| 15523 | 15687 | public static function sampleNewtonsoft(): Newtonsoft|float|null { |
| 15524 | - return Newtonsoft::sample(); /*221:newtonsoft*/ | |
| 15688 | + return Newtonsoft::sample(); /*223:newtonsoft*/ | |
| 15525 | 15689 | } |
| 15526 | 15690 | |
| 15527 | 15691 | /** |
| @@ -15597,7 +15761,7 @@ class TopLevel { | ||
| 15597 | 15761 | * @return Nil|float|null |
| 15598 | 15762 | */ |
| 15599 | 15763 | public static function sampleNil(): Nil|float|null { |
| 15600 | - return Nil::sample(); /*222:nil*/ | |
| 15764 | + return Nil::sample(); /*224:nil*/ | |
| 15601 | 15765 | } |
| 15602 | 15766 | |
| 15603 | 15767 | /** |
| @@ -15673,7 +15837,7 @@ class TopLevel { | ||
| 15673 | 15837 | * @return No|float|null |
| 15674 | 15838 | */ |
| 15675 | 15839 | public static function sampleNo(): No|float|null { |
| 15676 | - return No::sample(); /*223:no*/ | |
| 15840 | + return No::sample(); /*225:no*/ | |
| 15677 | 15841 | } |
| 15678 | 15842 | |
| 15679 | 15843 | /** |
| @@ -15749,7 +15913,7 @@ class TopLevel { | ||
| 15749 | 15913 | * @return Noexcept|float|null |
| 15750 | 15914 | */ |
| 15751 | 15915 | public static function sampleNoexcept(): Noexcept|float|null { |
| 15752 | - return Noexcept::sample(); /*224:noexcept*/ | |
| 15916 | + return Noexcept::sample(); /*226:noexcept*/ | |
| 15753 | 15917 | } |
| 15754 | 15918 | |
| 15755 | 15919 | /** |
| @@ -15825,7 +15989,7 @@ class TopLevel { | ||
| 15825 | 15989 | * @return Nonatomic|float|null |
| 15826 | 15990 | */ |
| 15827 | 15991 | public static function sampleNonatomic(): Nonatomic|float|null { |
| 15828 | - return Nonatomic::sample(); /*225:nonatomic*/ | |
| 15992 | + return Nonatomic::sample(); /*227:nonatomic*/ | |
| 15829 | 15993 | } |
| 15830 | 15994 | |
| 15831 | 15995 | /** |
| @@ -15901,7 +16065,7 @@ class TopLevel { | ||
| 15901 | 16065 | * @return NoneClass|float|null |
| 15902 | 16066 | */ |
| 15903 | 16067 | public static function sampleTopLevelNone(): NoneClass|float|null { |
| 15904 | - return NoneClass::sample(); /*226:topLevelNone*/ | |
| 16068 | + return NoneClass::sample(); /*228:topLevelNone*/ | |
| 15905 | 16069 | } |
| 15906 | 16070 | |
| 15907 | 16071 | /** |
| @@ -15977,7 +16141,7 @@ class TopLevel { | ||
| 15977 | 16141 | * @return None|float|null |
| 15978 | 16142 | */ |
| 15979 | 16143 | public static function sampleNone(): None|float|null { |
| 15980 | - return None::sample(); /*227:none*/ | |
| 16144 | + return None::sample(); /*229:none*/ | |
| 15981 | 16145 | } |
| 15982 | 16146 | |
| 15983 | 16147 | /** |
| @@ -16053,7 +16217,7 @@ class TopLevel { | ||
| 16053 | 16217 | * @return Nonlocal|float|null |
| 16054 | 16218 | */ |
| 16055 | 16219 | public static function sampleNonlocal(): Nonlocal|float|null { |
| 16056 | - return Nonlocal::sample(); /*228:nonlocal*/ | |
| 16220 | + return Nonlocal::sample(); /*230:nonlocal*/ | |
| 16057 | 16221 | } |
| 16058 | 16222 | |
| 16059 | 16223 | /** |
| @@ -16129,7 +16293,7 @@ class TopLevel { | ||
| 16129 | 16293 | * @return Nonmutating|float|null |
| 16130 | 16294 | */ |
| 16131 | 16295 | public static function sampleNonmutating(): Nonmutating|float|null { |
| 16132 | - return Nonmutating::sample(); /*229:nonmutating*/ | |
| 16296 | + return Nonmutating::sample(); /*231:nonmutating*/ | |
| 16133 | 16297 | } |
| 16134 | 16298 | |
| 16135 | 16299 | /** |
| @@ -16205,7 +16369,7 @@ class TopLevel { | ||
| 16205 | 16369 | * @return NoSuchMethod|float|null |
| 16206 | 16370 | */ |
| 16207 | 16371 | public static function sampleNoSuchMethod(): NoSuchMethod|float|null { |
| 16208 | - return NoSuchMethod::sample(); /*230:noSuchMethod*/ | |
| 16372 | + return NoSuchMethod::sample(); /*232:noSuchMethod*/ | |
| 16209 | 16373 | } |
| 16210 | 16374 | |
| 16211 | 16375 | /** |
| @@ -16281,7 +16445,7 @@ class TopLevel { | ||
| 16281 | 16445 | * @return Not|float|null |
| 16282 | 16446 | */ |
| 16283 | 16447 | public static function sampleNot(): Not|float|null { |
| 16284 | - return Not::sample(); /*231:not*/ | |
| 16448 | + return Not::sample(); /*233:not*/ | |
| 16285 | 16449 | } |
| 16286 | 16450 | |
| 16287 | 16451 | /** |
| @@ -16357,7 +16521,7 @@ class TopLevel { | ||
| 16357 | 16521 | * @return NotEq|float|null |
| 16358 | 16522 | */ |
| 16359 | 16523 | public static function sampleNotEq(): NotEq|float|null { |
| 16360 | - return NotEq::sample(); /*232:notEq*/ | |
| 16524 | + return NotEq::sample(); /*234:notEq*/ | |
| 16361 | 16525 | } |
| 16362 | 16526 | |
| 16363 | 16527 | /** |
| @@ -16433,7 +16597,7 @@ class TopLevel { | ||
| 16433 | 16597 | * @return NSError|float|null |
| 16434 | 16598 | */ |
| 16435 | 16599 | public static function sampleNSError(): NSError|float|null { |
| 16436 | - return NSError::sample(); /*233:nsError*/ | |
| 16600 | + return NSError::sample(); /*235:nsError*/ | |
| 16437 | 16601 | } |
| 16438 | 16602 | |
| 16439 | 16603 | /** |
| @@ -16509,7 +16673,7 @@ class TopLevel { | ||
| 16509 | 16673 | * @return NSObject|float|null |
| 16510 | 16674 | */ |
| 16511 | 16675 | public static function sampleNSObject(): NSObject|float|null { |
| 16512 | - return NSObject::sample(); /*234:nsObject*/ | |
| 16676 | + return NSObject::sample(); /*236:nsObject*/ | |
| 16513 | 16677 | } |
| 16514 | 16678 | |
| 16515 | 16679 | /** |
| @@ -16585,7 +16749,7 @@ class TopLevel { | ||
| 16585 | 16749 | * @return NSString|float|null |
| 16586 | 16750 | */ |
| 16587 | 16751 | public static function sampleNSString(): NSString|float|null { |
| 16588 | - return NSString::sample(); /*235:nsString*/ | |
| 16752 | + return NSString::sample(); /*237:nsString*/ | |
| 16589 | 16753 | } |
| 16590 | 16754 | |
| 16591 | 16755 | /** |
| @@ -16661,7 +16825,7 @@ class TopLevel { | ||
| 16661 | 16825 | * @return NULLClass|float|null |
| 16662 | 16826 | */ |
| 16663 | 16827 | public static function sampleNull(): NULLClass|float|null { |
| 16664 | - return NULLClass::sample(); /*236:null*/ | |
| 16828 | + return NULLClass::sample(); /*238:null*/ | |
| 16665 | 16829 | } |
| 16666 | 16830 | |
| 16667 | 16831 | /** |
| @@ -16737,7 +16901,7 @@ class TopLevel { | ||
| 16737 | 16901 | * @return UnionNullNull|float|null |
| 16738 | 16902 | */ |
| 16739 | 16903 | public static function sampleTopLevelNull(): UnionNullNull|float|null { |
| 16740 | - return UnionNullNull::sample(); /*237:topLevelNull*/ | |
| 16904 | + return UnionNullNull::sample(); /*239:topLevelNull*/ | |
| 16741 | 16905 | } |
| 16742 | 16906 | |
| 16743 | 16907 | /** |
| @@ -16813,7 +16977,7 @@ class TopLevel { | ||
| 16813 | 16977 | * @return Nullptr|float|null |
| 16814 | 16978 | */ |
| 16815 | 16979 | public static function sampleNullptr(): Nullptr|float|null { |
| 16816 | - return Nullptr::sample(); /*238:nullptr*/ | |
| 16980 | + return Nullptr::sample(); /*240:nullptr*/ | |
| 16817 | 16981 | } |
| 16818 | 16982 | |
| 16819 | 16983 | /** |
| @@ -16889,7 +17053,7 @@ class TopLevel { | ||
| 16889 | 17053 | * @return Number|float|null |
| 16890 | 17054 | */ |
| 16891 | 17055 | public static function sampleNumber(): Number|float|null { |
| 16892 | - return Number::sample(); /*239:number*/ | |
| 17056 | + return Number::sample(); /*241:number*/ | |
| 16893 | 17057 | } |
| 16894 | 17058 | |
| 16895 | 17059 | /** |
| @@ -16965,7 +17129,7 @@ class TopLevel { | ||
| 16965 | 17129 | * @return ObjectClass|float|null |
| 16966 | 17130 | */ |
| 16967 | 17131 | public static function sampleObject(): ObjectClass|float|null { |
| 16968 | - return ObjectClass::sample(); /*240:object*/ | |
| 17132 | + return ObjectClass::sample(); /*242:object*/ | |
| 16969 | 17133 | } |
| 16970 | 17134 | |
| 16971 | 17135 | /** |
| @@ -17041,7 +17205,7 @@ class TopLevel { | ||
| 17041 | 17205 | * @return ObjectMapper|float|null |
| 17042 | 17206 | */ |
| 17043 | 17207 | public static function sampleObjectMapper(): ObjectMapper|float|null { |
| 17044 | - return ObjectMapper::sample(); /*241:objectMapper*/ | |
| 17208 | + return ObjectMapper::sample(); /*243:objectMapper*/ | |
| 17045 | 17209 | } |
| 17046 | 17210 | |
| 17047 | 17211 | /** |
| @@ -17117,7 +17281,7 @@ class TopLevel { | ||
| 17117 | 17281 | * @return Of|float|null |
| 17118 | 17282 | */ |
| 17119 | 17283 | public static function sampleOf(): Of|float|null { |
| 17120 | - return Of::sample(); /*242:of*/ | |
| 17284 | + return Of::sample(); /*244:of*/ | |
| 17121 | 17285 | } |
| 17122 | 17286 | |
| 17123 | 17287 | /** |
| @@ -17193,7 +17357,7 @@ class TopLevel { | ||
| 17193 | 17357 | * @return Oneway|float|null |
| 17194 | 17358 | */ |
| 17195 | 17359 | public static function sampleOneway(): Oneway|float|null { |
| 17196 | - return Oneway::sample(); /*243:oneway*/ | |
| 17360 | + return Oneway::sample(); /*245:oneway*/ | |
| 17197 | 17361 | } |
| 17198 | 17362 | |
| 17199 | 17363 | /** |
| @@ -17269,7 +17433,7 @@ class TopLevel { | ||
| 17269 | 17433 | * @return Open|float|null |
| 17270 | 17434 | */ |
| 17271 | 17435 | public static function sampleOpen(): Open|float|null { |
| 17272 | - return Open::sample(); /*244:open*/ | |
| 17436 | + return Open::sample(); /*246:open*/ | |
| 17273 | 17437 | } |
| 17274 | 17438 | |
| 17275 | 17439 | /** |
| @@ -17345,7 +17509,7 @@ class TopLevel { | ||
| 17345 | 17509 | * @return Operator|float|null |
| 17346 | 17510 | */ |
| 17347 | 17511 | public static function sampleOperator(): Operator|float|null { |
| 17348 | - return Operator::sample(); /*245:operator*/ | |
| 17512 | + return Operator::sample(); /*247:operator*/ | |
| 17349 | 17513 | } |
| 17350 | 17514 | |
| 17351 | 17515 | /** |
| @@ -17421,7 +17585,7 @@ class TopLevel { | ||
| 17421 | 17585 | * @return Optional|float|null |
| 17422 | 17586 | */ |
| 17423 | 17587 | public static function sampleOptional(): Optional|float|null { |
| 17424 | - return Optional::sample(); /*246:optional*/ | |
| 17588 | + return Optional::sample(); /*248:optional*/ | |
| 17425 | 17589 | } |
| 17426 | 17590 | |
| 17427 | 17591 | /** |
| @@ -17497,7 +17661,7 @@ class TopLevel { | ||
| 17497 | 17661 | * @return OrClass|float|null |
| 17498 | 17662 | */ |
| 17499 | 17663 | public static function sampleOr(): OrClass|float|null { |
| 17500 | - return OrClass::sample(); /*247:or*/ | |
| 17664 | + return OrClass::sample(); /*249:or*/ | |
| 17501 | 17665 | } |
| 17502 | 17666 | |
| 17503 | 17667 | /** |
| @@ -17573,7 +17737,7 @@ class TopLevel { | ||
| 17573 | 17737 | * @return OrEq|float|null |
| 17574 | 17738 | */ |
| 17575 | 17739 | public static function sampleOrEq(): OrEq|float|null { |
| 17576 | - return OrEq::sample(); /*248:orEq*/ | |
| 17740 | + return OrEq::sample(); /*250:orEq*/ | |
| 17577 | 17741 | } |
| 17578 | 17742 | |
| 17579 | 17743 | /** |
| @@ -17649,7 +17813,7 @@ class TopLevel { | ||
| 17649 | 17813 | * @return Out|float|null |
| 17650 | 17814 | */ |
| 17651 | 17815 | public static function sampleOut(): Out|float|null { |
| 17652 | - return Out::sample(); /*249:out*/ | |
| 17816 | + return Out::sample(); /*251:out*/ | |
| 17653 | 17817 | } |
| 17654 | 17818 | |
| 17655 | 17819 | /** |
| @@ -17725,7 +17889,7 @@ class TopLevel { | ||
| 17725 | 17889 | * @return OverrideClass|float|null |
| 17726 | 17890 | */ |
| 17727 | 17891 | public static function sampleOverride(): OverrideClass|float|null { |
| 17728 | - return OverrideClass::sample(); /*250:override*/ | |
| 17892 | + return OverrideClass::sample(); /*252:override*/ | |
| 17729 | 17893 | } |
| 17730 | 17894 | |
| 17731 | 17895 | /** |
| @@ -17801,7 +17965,7 @@ class TopLevel { | ||
| 17801 | 17965 | * @return Package|float|null |
| 17802 | 17966 | */ |
| 17803 | 17967 | public static function samplePackage(): Package|float|null { |
| 17804 | - return Package::sample(); /*251:package*/ | |
| 17968 | + return Package::sample(); /*253:package*/ | |
| 17805 | 17969 | } |
| 17806 | 17970 | |
| 17807 | 17971 | /** |
| @@ -17877,7 +18041,7 @@ class TopLevel { | ||
| 17877 | 18041 | * @return Params|float|null |
| 17878 | 18042 | */ |
| 17879 | 18043 | public static function sampleParams(): Params|float|null { |
| 17880 | - return Params::sample(); /*252:params*/ | |
| 18044 | + return Params::sample(); /*254:params*/ | |
| 17881 | 18045 | } |
| 17882 | 18046 | |
| 17883 | 18047 | /** |
| @@ -17953,7 +18117,7 @@ class TopLevel { | ||
| 17953 | 18117 | * @return Pass|float|null |
| 17954 | 18118 | */ |
| 17955 | 18119 | public static function samplePass(): Pass|float|null { |
| 17956 | - return Pass::sample(); /*253:pass*/ | |
| 18120 | + return Pass::sample(); /*255:pass*/ | |
| 17957 | 18121 | } |
| 17958 | 18122 | |
| 17959 | 18123 | /** |
| @@ -18029,7 +18193,7 @@ class TopLevel { | ||
| 18029 | 18193 | * @return Port|float|null |
| 18030 | 18194 | */ |
| 18031 | 18195 | public static function samplePort(): Port|float|null { |
| 18032 | - return Port::sample(); /*254:port*/ | |
| 18196 | + return Port::sample(); /*256:port*/ | |
| 18033 | 18197 | } |
| 18034 | 18198 | |
| 18035 | 18199 | /** |
| @@ -18105,7 +18269,7 @@ class TopLevel { | ||
| 18105 | 18269 | * @return Postfix|float|null |
| 18106 | 18270 | */ |
| 18107 | 18271 | public static function samplePostfix(): Postfix|float|null { |
| 18108 | - return Postfix::sample(); /*255:postfix*/ | |
| 18272 | + return Postfix::sample(); /*257:postfix*/ | |
| 18109 | 18273 | } |
| 18110 | 18274 | |
| 18111 | 18275 | /** |
| @@ -18181,7 +18345,7 @@ class TopLevel { | ||
| 18181 | 18345 | * @return Precedence|float|null |
| 18182 | 18346 | */ |
| 18183 | 18347 | public static function samplePrecedence(): Precedence|float|null { |
| 18184 | - return Precedence::sample(); /*256:precedence*/ | |
| 18348 | + return Precedence::sample(); /*258:precedence*/ | |
| 18185 | 18349 | } |
| 18186 | 18350 | |
| 18187 | 18351 | /** |
| @@ -18257,7 +18421,7 @@ class TopLevel { | ||
| 18257 | 18421 | * @return Prefix|float|null |
| 18258 | 18422 | */ |
| 18259 | 18423 | public static function samplePrefix(): Prefix|float|null { |
| 18260 | - return Prefix::sample(); /*257:prefix*/ | |
| 18424 | + return Prefix::sample(); /*259:prefix*/ | |
| 18261 | 18425 | } |
| 18262 | 18426 | |
| 18263 | 18427 | /** |
| @@ -18333,7 +18497,7 @@ class TopLevel { | ||
| 18333 | 18497 | * @return PrimitiveKind|float|null |
| 18334 | 18498 | */ |
| 18335 | 18499 | public static function samplePrimitiveKind(): PrimitiveKind|float|null { |
| 18336 | - return PrimitiveKind::sample(); /*258:primitiveKind*/ | |
| 18500 | + return PrimitiveKind::sample(); /*260:primitiveKind*/ | |
| 18337 | 18501 | } |
| 18338 | 18502 | |
| 18339 | 18503 | /** |
| @@ -18409,7 +18573,7 @@ class TopLevel { | ||
| 18409 | 18573 | * @return PrintClass|float|null |
| 18410 | 18574 | */ |
| 18411 | 18575 | public static function samplePrint(): PrintClass|float|null { |
| 18412 | - return PrintClass::sample(); /*259:print*/ | |
| 18576 | + return PrintClass::sample(); /*261:print*/ | |
| 18413 | 18577 | } |
| 18414 | 18578 | |
| 18415 | 18579 | /** |
| @@ -18485,7 +18649,7 @@ class TopLevel { | ||
| 18485 | 18649 | * @return Printf|float|null |
| 18486 | 18650 | */ |
| 18487 | 18651 | public static function samplePrintf(): Printf|float|null { |
| 18488 | - return Printf::sample(); /*260:printf*/ | |
| 18652 | + return Printf::sample(); /*262:printf*/ | |
| 18489 | 18653 | } |
| 18490 | 18654 | |
| 18491 | 18655 | /** |
| @@ -18561,7 +18725,7 @@ class TopLevel { | ||
| 18561 | 18725 | * @return PrintMembers|float|null |
| 18562 | 18726 | */ |
| 18563 | 18727 | public static function samplePrintMembers(): PrintMembers|float|null { |
| 18564 | - return PrintMembers::sample(); /*261:printMembers*/ | |
| 18728 | + return PrintMembers::sample(); /*263:printMembers*/ | |
| 18565 | 18729 | } |
| 18566 | 18730 | |
| 18567 | 18731 | /** |
| @@ -18637,7 +18801,7 @@ class TopLevel { | ||
| 18637 | 18801 | * @return PrivateClass|float|null |
| 18638 | 18802 | */ |
| 18639 | 18803 | public static function samplePrivate(): PrivateClass|float|null { |
| 18640 | - return PrivateClass::sample(); /*262:private*/ | |
| 18804 | + return PrivateClass::sample(); /*264:private*/ | |
| 18641 | 18805 | } |
| 18642 | 18806 | |
| 18643 | 18807 | /** |
| @@ -18713,7 +18877,7 @@ class TopLevel { | ||
| 18713 | 18877 | * @return ProtectedClass|float|null |
| 18714 | 18878 | */ |
| 18715 | 18879 | public static function sampleProtected(): ProtectedClass|float|null { |
| 18716 | - return ProtectedClass::sample(); /*263:protected*/ | |
| 18880 | + return ProtectedClass::sample(); /*265:protected*/ | |
| 18717 | 18881 | } |
| 18718 | 18882 | |
| 18719 | 18883 | /** |
| @@ -18789,7 +18953,7 @@ class TopLevel { | ||
| 18789 | 18953 | * @return Protocol|float|null |
| 18790 | 18954 | */ |
| 18791 | 18955 | public static function sampleProtocol(): Protocol|float|null { |
| 18792 | - return Protocol::sample(); /*264:protocol*/ | |
| 18956 | + return Protocol::sample(); /*266:protocol*/ | |
| 18793 | 18957 | } |
| 18794 | 18958 | |
| 18795 | 18959 | /** |
| @@ -18865,7 +19029,7 @@ class TopLevel { | ||
| 18865 | 19029 | * @return ProtocolClass|float|null |
| 18866 | 19030 | */ |
| 18867 | 19031 | public static function sampleTopLevelProtocol(): ProtocolClass|float|null { |
| 18868 | - return ProtocolClass::sample(); /*265:topLevelProtocol*/ | |
| 19032 | + return ProtocolClass::sample(); /*267:topLevelProtocol*/ | |
| 18869 | 19033 | } |
| 18870 | 19034 | |
| 18871 | 19035 | /** |
| @@ -18941,7 +19105,7 @@ class TopLevel { | ||
| 18941 | 19105 | * @return PublicClass|float|null |
| 18942 | 19106 | */ |
| 18943 | 19107 | public static function samplePublic(): PublicClass|float|null { |
| 18944 | - return PublicClass::sample(); /*266:public*/ | |
| 19108 | + return PublicClass::sample(); /*268:public*/ | |
| 18945 | 19109 | } |
| 18946 | 19110 | |
| 18947 | 19111 | /** |
| @@ -19017,7 +19181,7 @@ class TopLevel { | ||
| 19017 | 19181 | * @return Quicktype|float|null |
| 19018 | 19182 | */ |
| 19019 | 19183 | public static function sampleQuicktype(): Quicktype|float|null { |
| 19020 | - return Quicktype::sample(); /*267:quicktype*/ | |
| 19184 | + return Quicktype::sample(); /*269:quicktype*/ | |
| 19021 | 19185 | } |
| 19022 | 19186 | |
| 19023 | 19187 | /** |
| @@ -19093,7 +19257,7 @@ class TopLevel { | ||
| 19093 | 19257 | * @return Raise|float|null |
| 19094 | 19258 | */ |
| 19095 | 19259 | public static function sampleRaise(): Raise|float|null { |
| 19096 | - return Raise::sample(); /*268:raise*/ | |
| 19260 | + return Raise::sample(); /*270:raise*/ | |
| 19097 | 19261 | } |
| 19098 | 19262 | |
| 19099 | 19263 | /** |
| @@ -19169,7 +19333,7 @@ class TopLevel { | ||
| 19169 | 19333 | * @return Range|float|null |
| 19170 | 19334 | */ |
| 19171 | 19335 | public static function sampleRange(): Range|float|null { |
| 19172 | - return Range::sample(); /*269:range*/ | |
| 19336 | + return Range::sample(); /*271:range*/ | |
| 19173 | 19337 | } |
| 19174 | 19338 | |
| 19175 | 19339 | /** |
| @@ -19245,7 +19409,7 @@ class TopLevel { | ||
| 19245 | 19409 | * @return ReadonlyClass|float|null |
| 19246 | 19410 | */ |
| 19247 | 19411 | public static function sampleReadonly(): ReadonlyClass|float|null { |
| 19248 | - return ReadonlyClass::sample(); /*270:readonly*/ | |
| 19412 | + return ReadonlyClass::sample(); /*272:readonly*/ | |
| 19249 | 19413 | } |
| 19250 | 19414 | |
| 19251 | 19415 | /** |
| @@ -19321,7 +19485,7 @@ class TopLevel { | ||
| 19321 | 19485 | * @return Ref|float|null |
| 19322 | 19486 | */ |
| 19323 | 19487 | public static function sampleRef(): Ref|float|null { |
| 19324 | - return Ref::sample(); /*271:ref*/ | |
| 19488 | + return Ref::sample(); /*273:ref*/ | |
| 19325 | 19489 | } |
| 19326 | 19490 | |
| 19327 | 19491 | /** |
| @@ -19397,7 +19561,7 @@ class TopLevel { | ||
| 19397 | 19561 | * @return RegExp|float|null |
| 19398 | 19562 | */ |
| 19399 | 19563 | public static function sampleRegExp(): RegExp|float|null { |
| 19400 | - return RegExp::sample(); /*272:regExp*/ | |
| 19564 | + return RegExp::sample(); /*274:regExp*/ | |
| 19401 | 19565 | } |
| 19402 | 19566 | |
| 19403 | 19567 | /** |
| @@ -19473,7 +19637,7 @@ class TopLevel { | ||
| 19473 | 19637 | * @return Register|float|null |
| 19474 | 19638 | */ |
| 19475 | 19639 | public static function sampleRegister(): Register|float|null { |
| 19476 | - return Register::sample(); /*273:register*/ | |
| 19640 | + return Register::sample(); /*275:register*/ | |
| 19477 | 19641 | } |
| 19478 | 19642 | |
| 19479 | 19643 | /** |
| @@ -19549,7 +19713,7 @@ class TopLevel { | ||
| 19549 | 19713 | * @return ReinterpretCast|float|null |
| 19550 | 19714 | */ |
| 19551 | 19715 | public static function sampleReinterpretCast(): ReinterpretCast|float|null { |
| 19552 | - return ReinterpretCast::sample(); /*274:reinterpretCast*/ | |
| 19716 | + return ReinterpretCast::sample(); /*276:reinterpretCast*/ | |
| 19553 | 19717 | } |
| 19554 | 19718 | |
| 19555 | 19719 | /** |
| @@ -19625,7 +19789,7 @@ class TopLevel { | ||
| 19625 | 19789 | * @return Repeat|float|null |
| 19626 | 19790 | */ |
| 19627 | 19791 | public static function sampleRepeat(): Repeat|float|null { |
| 19628 | - return Repeat::sample(); /*275:repeat*/ | |
| 19792 | + return Repeat::sample(); /*277:repeat*/ | |
| 19629 | 19793 | } |
| 19630 | 19794 | |
| 19631 | 19795 | /** |
| @@ -19701,7 +19865,7 @@ class TopLevel { | ||
| 19701 | 19865 | * @return RequireClass|float|null |
| 19702 | 19866 | */ |
| 19703 | 19867 | public static function sampleRequire(): RequireClass|float|null { |
| 19704 | - return RequireClass::sample(); /*276:require*/ | |
| 19868 | + return RequireClass::sample(); /*278:require*/ | |
| 19705 | 19869 | } |
| 19706 | 19870 | |
| 19707 | 19871 | /** |
| @@ -19777,7 +19941,7 @@ class TopLevel { | ||
| 19777 | 19941 | * @return Required|float|null |
| 19778 | 19942 | */ |
| 19779 | 19943 | public static function sampleRequired(): Required|float|null { |
| 19780 | - return Required::sample(); /*277:required*/ | |
| 19944 | + return Required::sample(); /*279:required*/ | |
| 19781 | 19945 | } |
| 19782 | 19946 | |
| 19783 | 19947 | /** |
| @@ -19853,7 +20017,7 @@ class TopLevel { | ||
| 19853 | 20017 | * @return Requires|float|null |
| 19854 | 20018 | */ |
| 19855 | 20019 | public static function sampleRequires(): Requires|float|null { |
| 19856 | - return Requires::sample(); /*278:requires*/ | |
| 20020 | + return Requires::sample(); /*280:requires*/ | |
| 19857 | 20021 | } |
| 19858 | 20022 | |
| 19859 | 20023 | /** |
| @@ -19929,7 +20093,7 @@ class TopLevel { | ||
| 19929 | 20093 | * @return Restrict|float|null |
| 19930 | 20094 | */ |
| 19931 | 20095 | public static function sampleRestrict(): Restrict|float|null { |
| 19932 | - return Restrict::sample(); /*279:restrict*/ | |
| 20096 | + return Restrict::sample(); /*281:restrict*/ | |
| 19933 | 20097 | } |
| 19934 | 20098 | |
| 19935 | 20099 | /** |
| @@ -20005,7 +20169,7 @@ class TopLevel { | ||
| 20005 | 20169 | * @return Retain|float|null |
| 20006 | 20170 | */ |
| 20007 | 20171 | public static function sampleRetain(): Retain|float|null { |
| 20008 | - return Retain::sample(); /*280:retain*/ | |
| 20172 | + return Retain::sample(); /*282:retain*/ | |
| 20009 | 20173 | } |
| 20010 | 20174 | |
| 20011 | 20175 | /** |
| @@ -20081,7 +20245,7 @@ class TopLevel { | ||
| 20081 | 20245 | * @return Rethrows|float|null |
| 20082 | 20246 | */ |
| 20083 | 20247 | public static function sampleRethrows(): Rethrows|float|null { |
| 20084 | - return Rethrows::sample(); /*281:rethrows*/ | |
| 20248 | + return Rethrows::sample(); /*283:rethrows*/ | |
| 20085 | 20249 | } |
| 20086 | 20250 | |
| 20087 | 20251 | /** |
| @@ -20157,7 +20321,7 @@ class TopLevel { | ||
| 20157 | 20321 | * @return ReturnClass|float|null |
| 20158 | 20322 | */ |
| 20159 | 20323 | public static function sampleReturn(): ReturnClass|float|null { |
| 20160 | - return ReturnClass::sample(); /*282:return*/ | |
| 20324 | + return ReturnClass::sample(); /*284:return*/ | |
| 20161 | 20325 | } |
| 20162 | 20326 | |
| 20163 | 20327 | /** |
| @@ -20233,7 +20397,7 @@ class TopLevel { | ||
| 20233 | 20397 | * @return Right|float|null |
| 20234 | 20398 | */ |
| 20235 | 20399 | public static function sampleRight(): Right|float|null { |
| 20236 | - return Right::sample(); /*283:right*/ | |
| 20400 | + return Right::sample(); /*285:right*/ | |
| 20237 | 20401 | } |
| 20238 | 20402 | |
| 20239 | 20403 | /** |
| @@ -20309,7 +20473,7 @@ class TopLevel { | ||
| 20309 | 20473 | * @return RuntimeType|float|null |
| 20310 | 20474 | */ |
| 20311 | 20475 | public static function sampleRuntimeType(): RuntimeType|float|null { |
| 20312 | - return RuntimeType::sample(); /*284:runtimeType*/ | |
| 20476 | + return RuntimeType::sample(); /*286:runtimeType*/ | |
| 20313 | 20477 | } |
| 20314 | 20478 | |
| 20315 | 20479 | /** |
| @@ -20385,7 +20549,7 @@ class TopLevel { | ||
| 20385 | 20549 | * @return S|float|null |
| 20386 | 20550 | */ |
| 20387 | 20551 | public static function sampleS(): S|float|null { |
| 20388 | - return S::sample(); /*285:s*/ | |
| 20552 | + return S::sample(); /*287:s*/ | |
| 20389 | 20553 | } |
| 20390 | 20554 | |
| 20391 | 20555 | /** |
| @@ -20461,7 +20625,7 @@ class TopLevel { | ||
| 20461 | 20625 | * @return Sbyte|float|null |
| 20462 | 20626 | */ |
| 20463 | 20627 | public static function sampleSbyte(): Sbyte|float|null { |
| 20464 | - return Sbyte::sample(); /*286:sbyte*/ | |
| 20628 | + return Sbyte::sample(); /*288:sbyte*/ | |
| 20465 | 20629 | } |
| 20466 | 20630 | |
| 20467 | 20631 | /** |
| @@ -20537,7 +20701,7 @@ class TopLevel { | ||
| 20537 | 20701 | * @return Sealed|float|null |
| 20538 | 20702 | */ |
| 20539 | 20703 | public static function sampleSealed(): Sealed|float|null { |
| 20540 | - return Sealed::sample(); /*287:sealed*/ | |
| 20704 | + return Sealed::sample(); /*289:sealed*/ | |
| 20541 | 20705 | } |
| 20542 | 20706 | |
| 20543 | 20707 | /** |
| @@ -20613,7 +20777,7 @@ class TopLevel { | ||
| 20613 | 20777 | * @return Sel|float|null |
| 20614 | 20778 | */ |
| 20615 | 20779 | public static function sampleSel(): Sel|float|null { |
| 20616 | - return Sel::sample(); /*288:sel*/ | |
| 20780 | + return Sel::sample(); /*290:sel*/ | |
| 20617 | 20781 | } |
| 20618 | 20782 | |
| 20619 | 20783 | /** |
| @@ -20689,7 +20853,7 @@ class TopLevel { | ||
| 20689 | 20853 | * @return Select|float|null |
| 20690 | 20854 | */ |
| 20691 | 20855 | public static function sampleSelect(): Select|float|null { |
| 20692 | - return Select::sample(); /*289:select*/ | |
| 20856 | + return Select::sample(); /*291:select*/ | |
| 20693 | 20857 | } |
| 20694 | 20858 | |
| 20695 | 20859 | /** |
| @@ -20765,7 +20929,7 @@ class TopLevel { | ||
| 20765 | 20929 | * @return SelfClass|float|null |
| 20766 | 20930 | */ |
| 20767 | 20931 | public static function sampleSelf(): SelfClass|float|null { |
| 20768 | - return SelfClass::sample(); /*290:self*/ | |
| 20932 | + return SelfClass::sample(); /*292:self*/ | |
| 20769 | 20933 | } |
| 20770 | 20934 | |
| 20771 | 20935 | /** |
| @@ -20841,7 +21005,7 @@ class TopLevel { | ||
| 20841 | 21005 | * @return UnionSelfSelf|float|null |
| 20842 | 21006 | */ |
| 20843 | 21007 | public static function sampleTopLevelSelf(): UnionSelfSelf|float|null { |
| 20844 | - return UnionSelfSelf::sample(); /*291:topLevelSelf*/ | |
| 21008 | + return UnionSelfSelf::sample(); /*293:topLevelSelf*/ | |
| 20845 | 21009 | } |
| 20846 | 21010 | |
| 20847 | 21011 | /** |
| @@ -20917,7 +21081,7 @@ class TopLevel { | ||
| 20917 | 21081 | * @return Sendable|float|null |
| 20918 | 21082 | */ |
| 20919 | 21083 | public static function sampleSendable(): Sendable|float|null { |
| 20920 | - return Sendable::sample(); /*292:sendable*/ | |
| 21084 | + return Sendable::sample(); /*294:sendable*/ | |
| 20921 | 21085 | } |
| 20922 | 21086 | |
| 20923 | 21087 | /** |
| @@ -20993,7 +21157,7 @@ class TopLevel { | ||
| 20993 | 21157 | * @return SerialDescriptor|float|null |
| 20994 | 21158 | */ |
| 20995 | 21159 | public static function sampleSerialDescriptor(): SerialDescriptor|float|null { |
| 20996 | - return SerialDescriptor::sample(); /*293:serialDescriptor*/ | |
| 21160 | + return SerialDescriptor::sample(); /*295:serialDescriptor*/ | |
| 20997 | 21161 | } |
| 20998 | 21162 | |
| 20999 | 21163 | /** |
| @@ -21069,7 +21233,7 @@ class TopLevel { | ||
| 21069 | 21233 | * @return SerializableClass|float|null |
| 21070 | 21234 | */ |
| 21071 | 21235 | public static function sampleSerializable(): SerializableClass|float|null { |
| 21072 | - return SerializableClass::sample(); /*294:serializable*/ | |
| 21236 | + return SerializableClass::sample(); /*296:serializable*/ | |
| 21073 | 21237 | } |
| 21074 | 21238 | |
| 21075 | 21239 | /** |
| @@ -21145,7 +21309,7 @@ class TopLevel { | ||
| 21145 | 21309 | * @return Serialize|float|null |
| 21146 | 21310 | */ |
| 21147 | 21311 | public static function sampleSerialize(): Serialize|float|null { |
| 21148 | - return Serialize::sample(); /*295:serialize*/ | |
| 21312 | + return Serialize::sample(); /*297:serialize*/ | |
| 21149 | 21313 | } |
| 21150 | 21314 | |
| 21151 | 21315 | /** |
| @@ -21221,7 +21385,7 @@ class TopLevel { | ||
| 21221 | 21385 | * @return SerializerProvider|float|null |
| 21222 | 21386 | */ |
| 21223 | 21387 | public static function sampleSerializerProvider(): SerializerProvider|float|null { |
| 21224 | - return SerializerProvider::sample(); /*296:serializerProvider*/ | |
| 21388 | + return SerializerProvider::sample(); /*298:serializerProvider*/ | |
| 21225 | 21389 | } |
| 21226 | 21390 | |
| 21227 | 21391 | /** |
| @@ -21297,7 +21461,7 @@ class TopLevel { | ||
| 21297 | 21461 | * @return SerialName|float|null |
| 21298 | 21462 | */ |
| 21299 | 21463 | public static function sampleSerialName(): SerialName|float|null { |
| 21300 | - return SerialName::sample(); /*297:serialName*/ | |
| 21464 | + return SerialName::sample(); /*299:serialName*/ | |
| 21301 | 21465 | } |
| 21302 | 21466 | |
| 21303 | 21467 | /** |
| @@ -21373,7 +21537,7 @@ class TopLevel { | ||
| 21373 | 21537 | * @return Set|float|null |
| 21374 | 21538 | */ |
| 21375 | 21539 | public static function sampleSet(): Set|float|null { |
| 21376 | - return Set::sample(); /*298:set*/ | |
| 21540 | + return Set::sample(); /*300:set*/ | |
| 21377 | 21541 | } |
| 21378 | 21542 | |
| 21379 | 21543 | /** |
| @@ -21449,7 +21613,7 @@ class TopLevel { | ||
| 21449 | 21613 | * @return Short|float|null |
| 21450 | 21614 | */ |
| 21451 | 21615 | public static function sampleShort(): Short|float|null { |
| 21452 | - return Short::sample(); /*299:short*/ | |
| 21616 | + return Short::sample(); /*301:short*/ | |
| 21453 | 21617 | } |
| 21454 | 21618 | |
| 21455 | 21619 | /** |
| @@ -21525,7 +21689,7 @@ class TopLevel { | ||
| 21525 | 21689 | * @return Signed|float|null |
| 21526 | 21690 | */ |
| 21527 | 21691 | public static function sampleSigned(): Signed|float|null { |
| 21528 | - return Signed::sample(); /*300:signed*/ | |
| 21692 | + return Signed::sample(); /*302:signed*/ | |
| 21529 | 21693 | } |
| 21530 | 21694 | |
| 21531 | 21695 | /** |
| @@ -21601,7 +21765,7 @@ class TopLevel { | ||
| 21601 | 21765 | * @return SimpleModule|float|null |
| 21602 | 21766 | */ |
| 21603 | 21767 | public static function sampleSimpleModule(): SimpleModule|float|null { |
| 21604 | - return SimpleModule::sample(); /*301:simpleModule*/ | |
| 21768 | + return SimpleModule::sample(); /*303:simpleModule*/ | |
| 21605 | 21769 | } |
| 21606 | 21770 | |
| 21607 | 21771 | /** |
| @@ -21677,7 +21841,7 @@ class TopLevel { | ||
| 21677 | 21841 | * @return Sizeof|float|null |
| 21678 | 21842 | */ |
| 21679 | 21843 | public static function sampleSizeof(): Sizeof|float|null { |
| 21680 | - return Sizeof::sample(); /*302:sizeof*/ | |
| 21844 | + return Sizeof::sample(); /*304:sizeof*/ | |
| 21681 | 21845 | } |
| 21682 | 21846 | |
| 21683 | 21847 | /** |
| @@ -21753,7 +21917,7 @@ class TopLevel { | ||
| 21753 | 21917 | * @return Stackalloc|float|null |
| 21754 | 21918 | */ |
| 21755 | 21919 | public static function sampleStackalloc(): Stackalloc|float|null { |
| 21756 | - return Stackalloc::sample(); /*303:stackalloc*/ | |
| 21920 | + return Stackalloc::sample(); /*305:stackalloc*/ | |
| 21757 | 21921 | } |
| 21758 | 21922 | |
| 21759 | 21923 | /** |
| @@ -21829,7 +21993,7 @@ class TopLevel { | ||
| 21829 | 21993 | * @return Standards|float|null |
| 21830 | 21994 | */ |
| 21831 | 21995 | public static function sampleStandards(): Standards|float|null { |
| 21832 | - return Standards::sample(); /*304:standards*/ | |
| 21996 | + return Standards::sample(); /*306:standards*/ | |
| 21833 | 21997 | } |
| 21834 | 21998 | |
| 21835 | 21999 | /** |
| @@ -21905,7 +22069,7 @@ class TopLevel { | ||
| 21905 | 22069 | * @return StaticClass|float|null |
| 21906 | 22070 | */ |
| 21907 | 22071 | public static function sampleStatic(): StaticClass|float|null { |
| 21908 | - return StaticClass::sample(); /*305:static*/ | |
| 22072 | + return StaticClass::sample(); /*307:static*/ | |
| 21909 | 22073 | } |
| 21910 | 22074 | |
| 21911 | 22075 | /** |
| @@ -21981,7 +22145,7 @@ class TopLevel { | ||
| 21981 | 22145 | * @return StaticAssert|float|null |
| 21982 | 22146 | */ |
| 21983 | 22147 | public static function sampleStaticAssert(): StaticAssert|float|null { |
| 21984 | - return StaticAssert::sample(); /*306:staticAssert*/ | |
| 22148 | + return StaticAssert::sample(); /*308:staticAssert*/ | |
| 21985 | 22149 | } |
| 21986 | 22150 | |
| 21987 | 22151 | /** |
| @@ -22057,7 +22221,7 @@ class TopLevel { | ||
| 22057 | 22221 | * @return StaticCast|float|null |
| 22058 | 22222 | */ |
| 22059 | 22223 | public static function sampleStaticCast(): StaticCast|float|null { |
| 22060 | - return StaticCast::sample(); /*307:staticCast*/ | |
| 22224 | + return StaticCast::sample(); /*309:staticCast*/ | |
| 22061 | 22225 | } |
| 22062 | 22226 | |
| 22063 | 22227 | /** |
| @@ -22133,7 +22297,7 @@ class TopLevel { | ||
| 22133 | 22297 | * @return StdDeserializer|float|null |
| 22134 | 22298 | */ |
| 22135 | 22299 | public static function sampleStdDeserializer(): StdDeserializer|float|null { |
| 22136 | - return StdDeserializer::sample(); /*308:stdDeserializer*/ | |
| 22300 | + return StdDeserializer::sample(); /*310:stdDeserializer*/ | |
| 22137 | 22301 | } |
| 22138 | 22302 | |
| 22139 | 22303 | /** |
| @@ -22209,7 +22373,7 @@ class TopLevel { | ||
| 22209 | 22373 | * @return StdSerializer|float|null |
| 22210 | 22374 | */ |
| 22211 | 22375 | public static function sampleStdSerializer(): StdSerializer|float|null { |
| 22212 | - return StdSerializer::sample(); /*309:stdSerializer*/ | |
| 22376 | + return StdSerializer::sample(); /*311:stdSerializer*/ | |
| 22213 | 22377 | } |
| 22214 | 22378 | |
| 22215 | 22379 | /** |
| @@ -22285,7 +22449,7 @@ class TopLevel { | ||
| 22285 | 22449 | * @return Strictfp|float|null |
| 22286 | 22450 | */ |
| 22287 | 22451 | public static function sampleStrictfp(): Strictfp|float|null { |
| 22288 | - return Strictfp::sample(); /*310:strictfp*/ | |
| 22452 | + return Strictfp::sample(); /*312:strictfp*/ | |
| 22289 | 22453 | } |
| 22290 | 22454 | |
| 22291 | 22455 | /** |
| @@ -22361,7 +22525,7 @@ class TopLevel { | ||
| 22361 | 22525 | * @return StringClass|float|null |
| 22362 | 22526 | */ |
| 22363 | 22527 | public static function sampleString(): StringClass|float|null { |
| 22364 | - return StringClass::sample(); /*311:string*/ | |
| 22528 | + return StringClass::sample(); /*313:string*/ | |
| 22365 | 22529 | } |
| 22366 | 22530 | |
| 22367 | 22531 | /** |
| @@ -22437,7 +22601,7 @@ class TopLevel { | ||
| 22437 | 22601 | * @return Struct|float|null |
| 22438 | 22602 | */ |
| 22439 | 22603 | public static function sampleStruct(): Struct|float|null { |
| 22440 | - return Struct::sample(); /*312:struct*/ | |
| 22604 | + return Struct::sample(); /*314:struct*/ | |
| 22441 | 22605 | } |
| 22442 | 22606 | |
| 22443 | 22607 | /** |
| @@ -22513,7 +22677,7 @@ class TopLevel { | ||
| 22513 | 22677 | * @return Subscript|float|null |
| 22514 | 22678 | */ |
| 22515 | 22679 | public static function sampleSubscript(): Subscript|float|null { |
| 22516 | - return Subscript::sample(); /*313:subscript*/ | |
| 22680 | + return Subscript::sample(); /*315:subscript*/ | |
| 22517 | 22681 | } |
| 22518 | 22682 | |
| 22519 | 22683 | /** |
| @@ -22589,7 +22753,7 @@ class TopLevel { | ||
| 22589 | 22753 | * @return Super|float|null |
| 22590 | 22754 | */ |
| 22591 | 22755 | public static function sampleSuper(): Super|float|null { |
| 22592 | - return Super::sample(); /*314:super*/ | |
| 22756 | + return Super::sample(); /*316:super*/ | |
| 22593 | 22757 | } |
| 22594 | 22758 | |
| 22595 | 22759 | /** |
| @@ -22665,7 +22829,7 @@ class TopLevel { | ||
| 22665 | 22829 | * @return SwitchClass|float|null |
| 22666 | 22830 | */ |
| 22667 | 22831 | public static function sampleSwitch(): SwitchClass|float|null { |
| 22668 | - return SwitchClass::sample(); /*315:switch*/ | |
| 22832 | + return SwitchClass::sample(); /*317:switch*/ | |
| 22669 | 22833 | } |
| 22670 | 22834 | |
| 22671 | 22835 | /** |
| @@ -22741,7 +22905,7 @@ class TopLevel { | ||
| 22741 | 22905 | * @return Symbol|float|null |
| 22742 | 22906 | */ |
| 22743 | 22907 | public static function sampleSymbol(): Symbol|float|null { |
| 22744 | - return Symbol::sample(); /*316:symbol*/ | |
| 22908 | + return Symbol::sample(); /*318:symbol*/ | |
| 22745 | 22909 | } |
| 22746 | 22910 | |
| 22747 | 22911 | /** |
| @@ -22817,7 +22981,7 @@ class TopLevel { | ||
| 22817 | 22981 | * @return Synchronized|float|null |
| 22818 | 22982 | */ |
| 22819 | 22983 | public static function sampleSynchronized(): Synchronized|float|null { |
| 22820 | - return Synchronized::sample(); /*317:synchronized*/ | |
| 22984 | + return Synchronized::sample(); /*319:synchronized*/ | |
| 22821 | 22985 | } |
| 22822 | 22986 | |
| 22823 | 22987 | /** |
| @@ -22893,7 +23057,7 @@ class TopLevel { | ||
| 22893 | 23057 | * @return System|float|null |
| 22894 | 23058 | */ |
| 22895 | 23059 | public static function sampleSystem(): System|float|null { |
| 22896 | - return System::sample(); /*318:system*/ | |
| 23060 | + return System::sample(); /*320:system*/ | |
| 22897 | 23061 | } |
| 22898 | 23062 | |
| 22899 | 23063 | /** |
| @@ -22969,7 +23133,7 @@ class TopLevel { | ||
| 22969 | 23133 | * @return Template|float|null |
| 22970 | 23134 | */ |
| 22971 | 23135 | public static function sampleTemplate(): Template|float|null { |
| 22972 | - return Template::sample(); /*319:template*/ | |
| 23136 | + return Template::sample(); /*321:template*/ | |
| 22973 | 23137 | } |
| 22974 | 23138 | |
| 22975 | 23139 | /** |
| @@ -23045,7 +23209,7 @@ class TopLevel { | ||
| 23045 | 23209 | * @return Then|float|null |
| 23046 | 23210 | */ |
| 23047 | 23211 | public static function sampleThen(): Then|float|null { |
| 23048 | - return Then::sample(); /*320:then*/ | |
| 23212 | + return Then::sample(); /*322:then*/ | |
| 23049 | 23213 | } |
| 23050 | 23214 | |
| 23051 | 23215 | /** |
| @@ -23121,7 +23285,7 @@ class TopLevel { | ||
| 23121 | 23285 | * @return This|float|null |
| 23122 | 23286 | */ |
| 23123 | 23287 | public static function sampleTopLevelThis(): This|float|null { |
| 23124 | - return This::sample(); /*321:topLevelThis*/ | |
| 23288 | + return This::sample(); /*323:topLevelThis*/ | |
| 23125 | 23289 | } |
| 23126 | 23290 | |
| 23127 | 23291 | /** |
| @@ -23197,7 +23361,7 @@ class TopLevel { | ||
| 23197 | 23361 | * @return ThreadLocal|float|null |
| 23198 | 23362 | */ |
| 23199 | 23363 | public static function sampleThreadLocal(): ThreadLocal|float|null { |
| 23200 | - return ThreadLocal::sample(); /*322:threadLocal*/ | |
| 23364 | + return ThreadLocal::sample(); /*324:threadLocal*/ | |
| 23201 | 23365 | } |
| 23202 | 23366 | |
| 23203 | 23367 | /** |
| @@ -23273,7 +23437,7 @@ class TopLevel { | ||
| 23273 | 23437 | * @return ThrowClass|float|null |
| 23274 | 23438 | */ |
| 23275 | 23439 | public static function sampleThrow(): ThrowClass|float|null { |
| 23276 | - return ThrowClass::sample(); /*323:throw*/ | |
| 23440 | + return ThrowClass::sample(); /*325:throw*/ | |
| 23277 | 23441 | } |
| 23278 | 23442 | |
| 23279 | 23443 | /** |
| @@ -23349,7 +23513,7 @@ class TopLevel { | ||
| 23349 | 23513 | * @return Throws|float|null |
| 23350 | 23514 | */ |
| 23351 | 23515 | public static function sampleThrows(): Throws|float|null { |
| 23352 | - return Throws::sample(); /*324:throws*/ | |
| 23516 | + return Throws::sample(); /*326:throws*/ | |
| 23353 | 23517 | } |
| 23354 | 23518 | |
| 23355 | 23519 | /** |
| @@ -23425,7 +23589,7 @@ class TopLevel { | ||
| 23425 | 23589 | * @return TimeOnly|float|null |
| 23426 | 23590 | */ |
| 23427 | 23591 | public static function sampleTimeOnly(): TimeOnly|float|null { |
| 23428 | - return TimeOnly::sample(); /*325:timeOnly*/ | |
| 23592 | + return TimeOnly::sample(); /*327:timeOnly*/ | |
| 23429 | 23593 | } |
| 23430 | 23594 | |
| 23431 | 23595 | /** |
| @@ -23501,7 +23665,7 @@ class TopLevel { | ||
| 23501 | 23665 | * @return TimeOnlyConverter|float|null |
| 23502 | 23666 | */ |
| 23503 | 23667 | public static function sampleTimeOnlyConverter(): TimeOnlyConverter|float|null { |
| 23504 | - return TimeOnlyConverter::sample(); /*326:timeOnlyConverter*/ | |
| 23668 | + return TimeOnlyConverter::sample(); /*328:timeOnlyConverter*/ | |
| 23505 | 23669 | } |
| 23506 | 23670 | |
| 23507 | 23671 | /** |
| @@ -23577,7 +23741,83 @@ class TopLevel { | ||
| 23577 | 23741 | * @return TimeZone|float|null |
| 23578 | 23742 | */ |
| 23579 | 23743 | public static function sampleTimeZone(): TimeZone|float|null { |
| 23580 | - return TimeZone::sample(); /*327:timeZone*/ | |
| 23744 | + return TimeZone::sample(); /*329:timeZone*/ | |
| 23745 | + } | |
| 23746 | + | |
| 23747 | + /** | |
| 23748 | + * @param stdClass|float|null $value | |
| 23749 | + * @throws Exception | |
| 23750 | + * @return ToDict|float|null | |
| 23751 | + */ | |
| 23752 | + public static function fromToDict(stdClass|float|null $value): ToDict|float|null { | |
| 23753 | + if (is_null($value)) { | |
| 23754 | + return $value; /*null*/ | |
| 23755 | + } elseif (is_object($value)) { | |
| 23756 | + return ToDict::from($value); /*class*/ | |
| 23757 | + } elseif (is_float($value) || is_int($value)) { | |
| 23758 | + return $value; /*float*/ | |
| 23759 | + } else { | |
| 23760 | + throw new Exception('Cannot deserialize union value in TopLevel'); | |
| 23761 | + } | |
| 23762 | + } | |
| 23763 | + | |
| 23764 | + /** | |
| 23765 | + * @throws Exception | |
| 23766 | + * @return stdClass|float|null | |
| 23767 | + */ | |
| 23768 | + public function toToDict(): stdClass|float|null { | |
| 23769 | + if (TopLevel::validateToDict($this->toDict)) { | |
| 23770 | + if (is_null($this->toDict)) { | |
| 23771 | + return $this->toDict; /*null*/ | |
| 23772 | + } elseif ($this->toDict instanceof ToDict) { | |
| 23773 | + return $this->toDict->to(); /*class*/ | |
| 23774 | + } elseif (is_float($this->toDict) || is_int($this->toDict)) { | |
| 23775 | + return $this->toDict; /*float*/ | |
| 23776 | + } else { | |
| 23777 | + throw new Exception('Union value has no matching member in TopLevel'); | |
| 23778 | + } | |
| 23779 | + } | |
| 23780 | + throw new Exception('never get to this TopLevel::toDict'); | |
| 23781 | + } | |
| 23782 | + | |
| 23783 | + /** | |
| 23784 | + * @param ToDict|float|null | |
| 23785 | + * @return bool | |
| 23786 | + * @throws Exception | |
| 23787 | + */ | |
| 23788 | + public static function validateToDict(ToDict|float|null $value): bool { | |
| 23789 | + if (is_null($value)) { | |
| 23790 | + if (!is_null($value)) { | |
| 23791 | + throw new Exception("Attribute Error:TopLevel::toDict"); | |
| 23792 | + } | |
| 23793 | + } elseif ($value instanceof ToDict) { | |
| 23794 | + $value->validate(); | |
| 23795 | + } elseif (is_float($value) || is_int($value)) { | |
| 23796 | + if (!is_float($value) && !is_int($value)) { | |
| 23797 | + throw new Exception("Attribute Error:TopLevel::toDict"); | |
| 23798 | + } | |
| 23799 | + } else { | |
| 23800 | + throw new Exception("Attribute Error:TopLevel::toDict"); | |
| 23801 | + } | |
| 23802 | + return true; | |
| 23803 | + } | |
| 23804 | + | |
| 23805 | + /** | |
| 23806 | + * @throws Exception | |
| 23807 | + * @return ToDict|float|null | |
| 23808 | + */ | |
| 23809 | + public function getToDict(): ToDict|float|null { | |
| 23810 | + if (TopLevel::validateToDict($this->toDict)) { | |
| 23811 | + return $this->toDict; | |
| 23812 | + } | |
| 23813 | + throw new Exception('never get to getToDict TopLevel::toDict'); | |
| 23814 | + } | |
| 23815 | + | |
| 23816 | + /** | |
| 23817 | + * @return ToDict|float|null | |
| 23818 | + */ | |
| 23819 | + public static function sampleToDict(): ToDict|float|null { | |
| 23820 | + return ToDict::sample(); /*330:toDict*/ | |
| 23581 | 23821 | } |
| 23582 | 23822 | |
| 23583 | 23823 | /** |
| @@ -23653,7 +23893,7 @@ class TopLevel { | ||
| 23653 | 23893 | * @return ToJSON|float|null |
| 23654 | 23894 | */ |
| 23655 | 23895 | public static function sampleToJSON(): ToJSON|float|null { |
| 23656 | - return ToJSON::sample(); /*328:toJSON*/ | |
| 23896 | + return ToJSON::sample(); /*331:toJSON*/ | |
| 23657 | 23897 | } |
| 23658 | 23898 | |
| 23659 | 23899 | /** |
| @@ -23729,7 +23969,7 @@ class TopLevel { | ||
| 23729 | 23969 | * @return TopLevelClass|float|null |
| 23730 | 23970 | */ |
| 23731 | 23971 | public static function sampleTopLevel(): TopLevelClass|float|null { |
| 23732 | - return TopLevelClass::sample(); /*329:topLevel*/ | |
| 23972 | + return TopLevelClass::sample(); /*332:topLevel*/ | |
| 23733 | 23973 | } |
| 23734 | 23974 | |
| 23735 | 23975 | /** |
| @@ -23805,7 +24045,7 @@ class TopLevel { | ||
| 23805 | 24045 | * @return ToString|float|null |
| 23806 | 24046 | */ |
| 23807 | 24047 | public static function sampleToString(): ToString|float|null { |
| 23808 | - return ToString::sample(); /*330:toString*/ | |
| 24048 | + return ToString::sample(); /*333:toString*/ | |
| 23809 | 24049 | } |
| 23810 | 24050 | |
| 23811 | 24051 | /** |
| @@ -23881,7 +24121,7 @@ class TopLevel { | ||
| 23881 | 24121 | * @return Transient|float|null |
| 23882 | 24122 | */ |
| 23883 | 24123 | public static function sampleTransient(): Transient|float|null { |
| 23884 | - return Transient::sample(); /*331:transient*/ | |
| 24124 | + return Transient::sample(); /*334:transient*/ | |
| 23885 | 24125 | } |
| 23886 | 24126 | |
| 23887 | 24127 | /** |
| @@ -23957,7 +24197,7 @@ class TopLevel { | ||
| 23957 | 24197 | * @return TrueClass|float|null |
| 23958 | 24198 | */ |
| 23959 | 24199 | public static function sampleTrue(): TrueClass|float|null { |
| 23960 | - return TrueClass::sample(); /*332:true*/ | |
| 24200 | + return TrueClass::sample(); /*335:true*/ | |
| 23961 | 24201 | } |
| 23962 | 24202 | |
| 23963 | 24203 | /** |
| @@ -24033,7 +24273,7 @@ class TopLevel { | ||
| 24033 | 24273 | * @return UnionTrueTrue|float|null |
| 24034 | 24274 | */ |
| 24035 | 24275 | public static function sampleTopLevelTrue(): UnionTrueTrue|float|null { |
| 24036 | - return UnionTrueTrue::sample(); /*333:topLevelTrue*/ | |
| 24276 | + return UnionTrueTrue::sample(); /*336:topLevelTrue*/ | |
| 24037 | 24277 | } |
| 24038 | 24278 | |
| 24039 | 24279 | /** |
| @@ -24109,7 +24349,7 @@ class TopLevel { | ||
| 24109 | 24349 | * @return TryClass|float|null |
| 24110 | 24350 | */ |
| 24111 | 24351 | public static function sampleTry(): TryClass|float|null { |
| 24112 | - return TryClass::sample(); /*334:try*/ | |
| 24352 | + return TryClass::sample(); /*337:try*/ | |
| 24113 | 24353 | } |
| 24114 | 24354 | |
| 24115 | 24355 | /** |
| @@ -24185,7 +24425,7 @@ class TopLevel { | ||
| 24185 | 24425 | * @return Type|float|null |
| 24186 | 24426 | */ |
| 24187 | 24427 | public static function sampleType(): Type|float|null { |
| 24188 | - return Type::sample(); /*335:type*/ | |
| 24428 | + return Type::sample(); /*338:type*/ | |
| 24189 | 24429 | } |
| 24190 | 24430 | |
| 24191 | 24431 | /** |
| @@ -24261,7 +24501,7 @@ class TopLevel { | ||
| 24261 | 24501 | * @return TypeClass|float|null |
| 24262 | 24502 | */ |
| 24263 | 24503 | public static function sampleTopLevelType(): TypeClass|float|null { |
| 24264 | - return TypeClass::sample(); /*336:topLevelType*/ | |
| 24504 | + return TypeClass::sample(); /*339:topLevelType*/ | |
| 24265 | 24505 | } |
| 24266 | 24506 | |
| 24267 | 24507 | /** |
| @@ -24337,7 +24577,7 @@ class TopLevel { | ||
| 24337 | 24577 | * @return Typealias|float|null |
| 24338 | 24578 | */ |
| 24339 | 24579 | public static function sampleTypealias(): Typealias|float|null { |
| 24340 | - return Typealias::sample(); /*337:typealias*/ | |
| 24580 | + return Typealias::sample(); /*340:typealias*/ | |
| 24341 | 24581 | } |
| 24342 | 24582 | |
| 24343 | 24583 | /** |
| @@ -24413,7 +24653,7 @@ class TopLevel { | ||
| 24413 | 24653 | * @return Typedef|float|null |
| 24414 | 24654 | */ |
| 24415 | 24655 | public static function sampleTypedef(): Typedef|float|null { |
| 24416 | - return Typedef::sample(); /*338:typedef*/ | |
| 24656 | + return Typedef::sample(); /*341:typedef*/ | |
| 24417 | 24657 | } |
| 24418 | 24658 | |
| 24419 | 24659 | /** |
| @@ -24489,7 +24729,7 @@ class TopLevel { | ||
| 24489 | 24729 | * @return Typeid|float|null |
| 24490 | 24730 | */ |
| 24491 | 24731 | public static function sampleTypeid(): Typeid|float|null { |
| 24492 | - return Typeid::sample(); /*339:typeid*/ | |
| 24732 | + return Typeid::sample(); /*342:typeid*/ | |
| 24493 | 24733 | } |
| 24494 | 24734 | |
| 24495 | 24735 | /** |
| @@ -24565,7 +24805,7 @@ class TopLevel { | ||
| 24565 | 24805 | * @return Typename|float|null |
| 24566 | 24806 | */ |
| 24567 | 24807 | public static function sampleTypename(): Typename|float|null { |
| 24568 | - return Typename::sample(); /*340:typename*/ | |
| 24808 | + return Typename::sample(); /*343:typename*/ | |
| 24569 | 24809 | } |
| 24570 | 24810 | |
| 24571 | 24811 | /** |
| @@ -24641,7 +24881,7 @@ class TopLevel { | ||
| 24641 | 24881 | * @return Typeof|float|null |
| 24642 | 24882 | */ |
| 24643 | 24883 | public static function sampleTypeof(): Typeof|float|null { |
| 24644 | - return Typeof::sample(); /*341:typeof*/ | |
| 24884 | + return Typeof::sample(); /*344:typeof*/ | |
| 24645 | 24885 | } |
| 24646 | 24886 | |
| 24647 | 24887 | /** |
| @@ -24717,7 +24957,7 @@ class TopLevel { | ||
| 24717 | 24957 | * @return Uint|float|null |
| 24718 | 24958 | */ |
| 24719 | 24959 | public static function sampleUint(): Uint|float|null { |
| 24720 | - return Uint::sample(); /*342:uint*/ | |
| 24960 | + return Uint::sample(); /*345:uint*/ | |
| 24721 | 24961 | } |
| 24722 | 24962 | |
| 24723 | 24963 | /** |
| @@ -24793,7 +25033,7 @@ class TopLevel { | ||
| 24793 | 25033 | * @return Ulong|float|null |
| 24794 | 25034 | */ |
| 24795 | 25035 | public static function sampleUlong(): Ulong|float|null { |
| 24796 | - return Ulong::sample(); /*343:ulong*/ | |
| 25036 | + return Ulong::sample(); /*346:ulong*/ | |
| 24797 | 25037 | } |
| 24798 | 25038 | |
| 24799 | 25039 | /** |
| @@ -24869,7 +25109,7 @@ class TopLevel { | ||
| 24869 | 25109 | * @return Unchecked|float|null |
| 24870 | 25110 | */ |
| 24871 | 25111 | public static function sampleUnchecked(): Unchecked|float|null { |
| 24872 | - return Unchecked::sample(); /*344:unchecked*/ | |
| 25112 | + return Unchecked::sample(); /*347:unchecked*/ | |
| 24873 | 25113 | } |
| 24874 | 25114 | |
| 24875 | 25115 | /** |
| @@ -24945,7 +25185,7 @@ class TopLevel { | ||
| 24945 | 25185 | * @return Undefined|float|null |
| 24946 | 25186 | */ |
| 24947 | 25187 | public static function sampleUndefined(): Undefined|float|null { |
| 24948 | - return Undefined::sample(); /*345:undefined*/ | |
| 25188 | + return Undefined::sample(); /*348:undefined*/ | |
| 24949 | 25189 | } |
| 24950 | 25190 | |
| 24951 | 25191 | /** |
| @@ -25021,7 +25261,83 @@ class TopLevel { | ||
| 25021 | 25261 | * @return UnionClass|float|null |
| 25022 | 25262 | */ |
| 25023 | 25263 | public static function sampleUnion(): UnionClass|float|null { |
| 25024 | - return UnionClass::sample(); /*346:union*/ | |
| 25264 | + return UnionClass::sample(); /*349:union*/ | |
| 25265 | + } | |
| 25266 | + | |
| 25267 | + /** | |
| 25268 | + * @param stdClass|float|null $value | |
| 25269 | + * @throws Exception | |
| 25270 | + * @return UnmarshalJSON|float|null | |
| 25271 | + */ | |
| 25272 | + public static function fromUnmarshalJSON(stdClass|float|null $value): UnmarshalJSON|float|null { | |
| 25273 | + if (is_null($value)) { | |
| 25274 | + return $value; /*null*/ | |
| 25275 | + } elseif (is_object($value)) { | |
| 25276 | + return UnmarshalJSON::from($value); /*class*/ | |
| 25277 | + } elseif (is_float($value) || is_int($value)) { | |
| 25278 | + return $value; /*float*/ | |
| 25279 | + } else { | |
| 25280 | + throw new Exception('Cannot deserialize union value in TopLevel'); | |
| 25281 | + } | |
| 25282 | + } | |
| 25283 | + | |
| 25284 | + /** | |
| 25285 | + * @throws Exception | |
| 25286 | + * @return stdClass|float|null | |
| 25287 | + */ | |
| 25288 | + public function toUnmarshalJSON(): stdClass|float|null { | |
| 25289 | + if (TopLevel::validateUnmarshalJSON($this->unmarshalJSON)) { | |
| 25290 | + if (is_null($this->unmarshalJSON)) { | |
| 25291 | + return $this->unmarshalJSON; /*null*/ | |
| 25292 | + } elseif ($this->unmarshalJSON instanceof UnmarshalJSON) { | |
| 25293 | + return $this->unmarshalJSON->to(); /*class*/ | |
| 25294 | + } elseif (is_float($this->unmarshalJSON) || is_int($this->unmarshalJSON)) { | |
| 25295 | + return $this->unmarshalJSON; /*float*/ | |
| 25296 | + } else { | |
| 25297 | + throw new Exception('Union value has no matching member in TopLevel'); | |
| 25298 | + } | |
| 25299 | + } | |
| 25300 | + throw new Exception('never get to this TopLevel::unmarshalJSON'); | |
| 25301 | + } | |
| 25302 | + | |
| 25303 | + /** | |
| 25304 | + * @param UnmarshalJSON|float|null | |
| 25305 | + * @return bool | |
| 25306 | + * @throws Exception | |
| 25307 | + */ | |
| 25308 | + public static function validateUnmarshalJSON(UnmarshalJSON|float|null $value): bool { | |
| 25309 | + if (is_null($value)) { | |
| 25310 | + if (!is_null($value)) { | |
| 25311 | + throw new Exception("Attribute Error:TopLevel::unmarshalJSON"); | |
| 25312 | + } | |
| 25313 | + } elseif ($value instanceof UnmarshalJSON) { | |
| 25314 | + $value->validate(); | |
| 25315 | + } elseif (is_float($value) || is_int($value)) { | |
| 25316 | + if (!is_float($value) && !is_int($value)) { | |
| 25317 | + throw new Exception("Attribute Error:TopLevel::unmarshalJSON"); | |
| 25318 | + } | |
| 25319 | + } else { | |
| 25320 | + throw new Exception("Attribute Error:TopLevel::unmarshalJSON"); | |
| 25321 | + } | |
| 25322 | + return true; | |
| 25323 | + } | |
| 25324 | + | |
| 25325 | + /** | |
| 25326 | + * @throws Exception | |
| 25327 | + * @return UnmarshalJSON|float|null | |
| 25328 | + */ | |
| 25329 | + public function getUnmarshalJSON(): UnmarshalJSON|float|null { | |
| 25330 | + if (TopLevel::validateUnmarshalJSON($this->unmarshalJSON)) { | |
| 25331 | + return $this->unmarshalJSON; | |
| 25332 | + } | |
| 25333 | + throw new Exception('never get to getUnmarshalJSON TopLevel::unmarshalJSON'); | |
| 25334 | + } | |
| 25335 | + | |
| 25336 | + /** | |
| 25337 | + * @return UnmarshalJSON|float|null | |
| 25338 | + */ | |
| 25339 | + public static function sampleUnmarshalJSON(): UnmarshalJSON|float|null { | |
| 25340 | + return UnmarshalJSON::sample(); /*350:unmarshalJSON*/ | |
| 25025 | 25341 | } |
| 25026 | 25342 | |
| 25027 | 25343 | /** |
| @@ -25097,7 +25413,7 @@ class TopLevel { | ||
| 25097 | 25413 | * @return Unowned|float|null |
| 25098 | 25414 | */ |
| 25099 | 25415 | public static function sampleUnowned(): Unowned|float|null { |
| 25100 | - return Unowned::sample(); /*347:unowned*/ | |
| 25416 | + return Unowned::sample(); /*351:unowned*/ | |
| 25101 | 25417 | } |
| 25102 | 25418 | |
| 25103 | 25419 | /** |
| @@ -25173,7 +25489,7 @@ class TopLevel { | ||
| 25173 | 25489 | * @return Unsafe|float|null |
| 25174 | 25490 | */ |
| 25175 | 25491 | public static function sampleUnsafe(): Unsafe|float|null { |
| 25176 | - return Unsafe::sample(); /*348:unsafe*/ | |
| 25492 | + return Unsafe::sample(); /*352:unsafe*/ | |
| 25177 | 25493 | } |
| 25178 | 25494 | |
| 25179 | 25495 | /** |
| @@ -25249,7 +25565,7 @@ class TopLevel { | ||
| 25249 | 25565 | * @return Unsigned|float|null |
| 25250 | 25566 | */ |
| 25251 | 25567 | public static function sampleUnsigned(): Unsigned|float|null { |
| 25252 | - return Unsigned::sample(); /*349:unsigned*/ | |
| 25568 | + return Unsigned::sample(); /*353:unsigned*/ | |
| 25253 | 25569 | } |
| 25254 | 25570 | |
| 25255 | 25571 | /** |
| @@ -25325,7 +25641,7 @@ class TopLevel { | ||
| 25325 | 25641 | * @return UseSerializers|float|null |
| 25326 | 25642 | */ |
| 25327 | 25643 | public static function sampleUseSerializers(): UseSerializers|float|null { |
| 25328 | - return UseSerializers::sample(); /*350:useSerializers*/ | |
| 25644 | + return UseSerializers::sample(); /*354:useSerializers*/ | |
| 25329 | 25645 | } |
| 25330 | 25646 | |
| 25331 | 25647 | /** |
| @@ -25401,7 +25717,7 @@ class TopLevel { | ||
| 25401 | 25717 | * @return Ushort|float|null |
| 25402 | 25718 | */ |
| 25403 | 25719 | public static function sampleUshort(): Ushort|float|null { |
| 25404 | - return Ushort::sample(); /*351:ushort*/ | |
| 25720 | + return Ushort::sample(); /*355:ushort*/ | |
| 25405 | 25721 | } |
| 25406 | 25722 | |
| 25407 | 25723 | /** |
| @@ -25477,7 +25793,7 @@ class TopLevel { | ||
| 25477 | 25793 | * @return Using|float|null |
| 25478 | 25794 | */ |
| 25479 | 25795 | public static function sampleUsing(): Using|float|null { |
| 25480 | - return Using::sample(); /*352:using*/ | |
| 25796 | + return Using::sample(); /*356:using*/ | |
| 25481 | 25797 | } |
| 25482 | 25798 | |
| 25483 | 25799 | /** |
| @@ -25553,7 +25869,7 @@ class TopLevel { | ||
| 25553 | 25869 | * @return Utf8JSONReader|float|null |
| 25554 | 25870 | */ |
| 25555 | 25871 | public static function sampleUtf8JSONReader(): Utf8JSONReader|float|null { |
| 25556 | - return Utf8JSONReader::sample(); /*353:utf8JSONReader*/ | |
| 25872 | + return Utf8JSONReader::sample(); /*357:utf8JSONReader*/ | |
| 25557 | 25873 | } |
| 25558 | 25874 | |
| 25559 | 25875 | /** |
| @@ -25629,7 +25945,7 @@ class TopLevel { | ||
| 25629 | 25945 | * @return Utf8JSONWriter|float|null |
| 25630 | 25946 | */ |
| 25631 | 25947 | public static function sampleUtf8JSONWriter(): Utf8JSONWriter|float|null { |
| 25632 | - return Utf8JSONWriter::sample(); /*354:utf8JSONWriter*/ | |
| 25948 | + return Utf8JSONWriter::sample(); /*358:utf8JSONWriter*/ | |
| 25633 | 25949 | } |
| 25634 | 25950 | |
| 25635 | 25951 | /** |
| @@ -25705,7 +26021,7 @@ class TopLevel { | ||
| 25705 | 26021 | * @return UUID|float|null |
| 25706 | 26022 | */ |
| 25707 | 26023 | public static function sampleUUID(): UUID|float|null { |
| 25708 | - return UUID::sample(); /*355:uuid*/ | |
| 26024 | + return UUID::sample(); /*359:uuid*/ | |
| 25709 | 26025 | } |
| 25710 | 26026 | |
| 25711 | 26027 | /** |
| @@ -25781,7 +26097,7 @@ class TopLevel { | ||
| 25781 | 26097 | * @return VarClass|float|null |
| 25782 | 26098 | */ |
| 25783 | 26099 | public static function sampleVar(): VarClass|float|null { |
| 25784 | - return VarClass::sample(); /*356:var*/ | |
| 26100 | + return VarClass::sample(); /*360:var*/ | |
| 25785 | 26101 | } |
| 25786 | 26102 | |
| 25787 | 26103 | /** |
| @@ -25857,7 +26173,7 @@ class TopLevel { | ||
| 25857 | 26173 | * @return Virtual|float|null |
| 25858 | 26174 | */ |
| 25859 | 26175 | public static function sampleVirtual(): Virtual|float|null { |
| 25860 | - return Virtual::sample(); /*357:virtual*/ | |
| 26176 | + return Virtual::sample(); /*361:virtual*/ | |
| 25861 | 26177 | } |
| 25862 | 26178 | |
| 25863 | 26179 | /** |
| @@ -25933,7 +26249,7 @@ class TopLevel { | ||
| 25933 | 26249 | * @return VoidClass|float|null |
| 25934 | 26250 | */ |
| 25935 | 26251 | public static function sampleVoid(): VoidClass|float|null { |
| 25936 | - return VoidClass::sample(); /*358:void*/ | |
| 26252 | + return VoidClass::sample(); /*362:void*/ | |
| 25937 | 26253 | } |
| 25938 | 26254 | |
| 25939 | 26255 | /** |
| @@ -26009,7 +26325,7 @@ class TopLevel { | ||
| 26009 | 26325 | * @return Volatile|float|null |
| 26010 | 26326 | */ |
| 26011 | 26327 | public static function sampleVolatile(): Volatile|float|null { |
| 26012 | - return Volatile::sample(); /*359:volatile*/ | |
| 26328 | + return Volatile::sample(); /*363:volatile*/ | |
| 26013 | 26329 | } |
| 26014 | 26330 | |
| 26015 | 26331 | /** |
| @@ -26085,7 +26401,7 @@ class TopLevel { | ||
| 26085 | 26401 | * @return WcharT|float|null |
| 26086 | 26402 | */ |
| 26087 | 26403 | public static function sampleWcharT(): WcharT|float|null { |
| 26088 | - return WcharT::sample(); /*360:wcharT*/ | |
| 26404 | + return WcharT::sample(); /*364:wcharT*/ | |
| 26089 | 26405 | } |
| 26090 | 26406 | |
| 26091 | 26407 | /** |
| @@ -26161,7 +26477,7 @@ class TopLevel { | ||
| 26161 | 26477 | * @return Weak|float|null |
| 26162 | 26478 | */ |
| 26163 | 26479 | public static function sampleWeak(): Weak|float|null { |
| 26164 | - return Weak::sample(); /*361:weak*/ | |
| 26480 | + return Weak::sample(); /*365:weak*/ | |
| 26165 | 26481 | } |
| 26166 | 26482 | |
| 26167 | 26483 | /** |
| @@ -26237,7 +26553,7 @@ class TopLevel { | ||
| 26237 | 26553 | * @return Where|float|null |
| 26238 | 26554 | */ |
| 26239 | 26555 | public static function sampleWhere(): Where|float|null { |
| 26240 | - return Where::sample(); /*362:where*/ | |
| 26556 | + return Where::sample(); /*366:where*/ | |
| 26241 | 26557 | } |
| 26242 | 26558 | |
| 26243 | 26559 | /** |
| @@ -26313,7 +26629,7 @@ class TopLevel { | ||
| 26313 | 26629 | * @return WhileClass|float|null |
| 26314 | 26630 | */ |
| 26315 | 26631 | public static function sampleWhile(): WhileClass|float|null { |
| 26316 | - return WhileClass::sample(); /*363:while*/ | |
| 26632 | + return WhileClass::sample(); /*367:while*/ | |
| 26317 | 26633 | } |
| 26318 | 26634 | |
| 26319 | 26635 | /** |
| @@ -26389,7 +26705,7 @@ class TopLevel { | ||
| 26389 | 26705 | * @return WillSet|float|null |
| 26390 | 26706 | */ |
| 26391 | 26707 | public static function sampleWillSet(): WillSet|float|null { |
| 26392 | - return WillSet::sample(); /*364:willSet*/ | |
| 26708 | + return WillSet::sample(); /*368:willSet*/ | |
| 26393 | 26709 | } |
| 26394 | 26710 | |
| 26395 | 26711 | /** |
| @@ -26465,7 +26781,7 @@ class TopLevel { | ||
| 26465 | 26781 | * @return With|float|null |
| 26466 | 26782 | */ |
| 26467 | 26783 | public static function sampleWith(): With|float|null { |
| 26468 | - return With::sample(); /*365:with*/ | |
| 26784 | + return With::sample(); /*369:with*/ | |
| 26469 | 26785 | } |
| 26470 | 26786 | |
| 26471 | 26787 | /** |
| @@ -26541,7 +26857,7 @@ class TopLevel { | ||
| 26541 | 26857 | * @return XorClass|float|null |
| 26542 | 26858 | */ |
| 26543 | 26859 | public static function sampleXor(): XorClass|float|null { |
| 26544 | - return XorClass::sample(); /*366:xor*/ | |
| 26860 | + return XorClass::sample(); /*370:xor*/ | |
| 26545 | 26861 | } |
| 26546 | 26862 | |
| 26547 | 26863 | /** |
| @@ -26617,7 +26933,7 @@ class TopLevel { | ||
| 26617 | 26933 | * @return XorEq|float|null |
| 26618 | 26934 | */ |
| 26619 | 26935 | public static function sampleXorEq(): XorEq|float|null { |
| 26620 | - return XorEq::sample(); /*367:xorEq*/ | |
| 26936 | + return XorEq::sample(); /*371:xorEq*/ | |
| 26621 | 26937 | } |
| 26622 | 26938 | |
| 26623 | 26939 | /** |
| @@ -26693,7 +27009,7 @@ class TopLevel { | ||
| 26693 | 27009 | * @return Yes|float|null |
| 26694 | 27010 | */ |
| 26695 | 27011 | public static function sampleYes(): Yes|float|null { |
| 26696 | - return Yes::sample(); /*368:yes*/ | |
| 27012 | + return Yes::sample(); /*372:yes*/ | |
| 26697 | 27013 | } |
| 26698 | 27014 | |
| 26699 | 27015 | /** |
| @@ -26769,7 +27085,7 @@ class TopLevel { | ||
| 26769 | 27085 | * @return YieldClass|float|null |
| 26770 | 27086 | */ |
| 26771 | 27087 | public static function sampleYield(): YieldClass|float|null { |
| 26772 | - return YieldClass::sample(); /*369:yield*/ | |
| 27088 | + return YieldClass::sample(); /*373:yield*/ | |
| 26773 | 27089 | } |
| 26774 | 27090 | |
| 26775 | 27091 | /** |
| @@ -26899,6 +27215,7 @@ class TopLevel { | ||
| 26899 | 27215 | || TopLevel::validateFormatException($this->formatException) |
| 26900 | 27216 | || TopLevel::validateFriend($this->friend) |
| 26901 | 27217 | || TopLevel::validateFrom($this->from) |
| 27218 | + || TopLevel::validateFromDict($this->fromDict) | |
| 26902 | 27219 | || TopLevel::validateFromJSON($this->fromJSON) |
| 26903 | 27220 | || TopLevel::validateFunc($this->func) |
| 26904 | 27221 | || TopLevel::validateFunction($this->function) |
| @@ -26960,6 +27277,7 @@ class TopLevel { | ||
| 26960 | 27277 | || TopLevel::validateLong($this->long) |
| 26961 | 27278 | || TopLevel::validateMap($this->map) |
| 26962 | 27279 | || TopLevel::validateMapEntry($this->mapEntry) |
| 27280 | + || TopLevel::validateMarshalJSON($this->marshalJSON) | |
| 26963 | 27281 | || TopLevel::validateMetadataPropertyHandling($this->metadataPropertyHandling) |
| 26964 | 27282 | || TopLevel::validateModule($this->module) |
| 26965 | 27283 | || TopLevel::validateMutable($this->mutable) |
| @@ -27074,6 +27392,7 @@ class TopLevel { | ||
| 27074 | 27392 | || TopLevel::validateTimeOnly($this->timeOnly) |
| 27075 | 27393 | || TopLevel::validateTimeOnlyConverter($this->timeOnlyConverter) |
| 27076 | 27394 | || TopLevel::validateTimeZone($this->timeZone) |
| 27395 | + || TopLevel::validateToDict($this->toDict) | |
| 27077 | 27396 | || TopLevel::validateToJSON($this->toJSON) |
| 27078 | 27397 | || TopLevel::validateTopLevel($this->topLevel) |
| 27079 | 27398 | || TopLevel::validateToString($this->toString) |
| @@ -27093,6 +27412,7 @@ class TopLevel { | ||
| 27093 | 27412 | || TopLevel::validateUnchecked($this->unchecked) |
| 27094 | 27413 | || TopLevel::validateUndefined($this->undefined) |
| 27095 | 27414 | || TopLevel::validateUnion($this->union) |
| 27415 | + || TopLevel::validateUnmarshalJSON($this->unmarshalJSON) | |
| 27096 | 27416 | || TopLevel::validateUnowned($this->unowned) |
| 27097 | 27417 | || TopLevel::validateUnsafe($this->unsafe) |
| 27098 | 27418 | || TopLevel::validateUnsigned($this->unsigned) |
| @@ -27208,7 +27528,7 @@ class TopLevel { | ||
| 27208 | 27528 | $out->{'del'} = $this->toDel(); |
| 27209 | 27529 | $out->{'delegate'} = $this->toDelegate(); |
| 27210 | 27530 | $out->{'delete'} = $this->toDelete(); |
| 27211 | - $out->{'dict'} = $this->toDict(); | |
| 27531 | + $out->{'dict'} = $this->purpleToDict(); | |
| 27212 | 27532 | $out->{'dictionary'} = $this->toDictionary(); |
| 27213 | 27533 | $out->{'didSet'} = $this->toDidSet(); |
| 27214 | 27534 | $out->{'do'} = $this->toDo(); |
| @@ -27246,6 +27566,7 @@ class TopLevel { | ||
| 27246 | 27566 | $out->{'FormatException'} = $this->toFormatException(); |
| 27247 | 27567 | $out->{'friend'} = $this->toFriend(); |
| 27248 | 27568 | $out->{'from'} = $this->toFrom(); |
| 27569 | + $out->{'from_dict'} = $this->toFromDict(); | |
| 27249 | 27570 | $out->{'from_json'} = $this->toFromJSON(); |
| 27250 | 27571 | $out->{'func'} = $this->toFunc(); |
| 27251 | 27572 | $out->{'function'} = $this->toFunction(); |
| @@ -27307,6 +27628,7 @@ class TopLevel { | ||
| 27307 | 27628 | $out->{'long'} = $this->toLong(); |
| 27308 | 27629 | $out->{'map'} = $this->toMap(); |
| 27309 | 27630 | $out->{'MapEntry'} = $this->toMapEntry(); |
| 27631 | + $out->{'MarshalJSON'} = $this->toMarshalJSON(); | |
| 27310 | 27632 | $out->{'metadata_property_handling'} = $this->toMetadataPropertyHandling(); |
| 27311 | 27633 | $out->{'module'} = $this->toModule(); |
| 27312 | 27634 | $out->{'mutable'} = $this->toMutable(); |
| @@ -27421,6 +27743,7 @@ class TopLevel { | ||
| 27421 | 27743 | $out->{'TimeOnly'} = $this->toTimeOnly(); |
| 27422 | 27744 | $out->{'TimeOnlyConverter'} = $this->toTimeOnlyConverter(); |
| 27423 | 27745 | $out->{'TimeZone'} = $this->toTimeZone(); |
| 27746 | + $out->{'to_dict'} = $this->toToDict(); | |
| 27424 | 27747 | $out->{'to_json'} = $this->toToJSON(); |
| 27425 | 27748 | $out->{'top_level'} = $this->toTopLevel(); |
| 27426 | 27749 | $out->{'toString'} = $this->toToString(); |
| @@ -27440,6 +27763,7 @@ class TopLevel { | ||
| 27440 | 27763 | $out->{'unchecked'} = $this->toUnchecked(); |
| 27441 | 27764 | $out->{'undefined'} = $this->toUndefined(); |
| 27442 | 27765 | $out->{'union'} = $this->toUnion(); |
| 27766 | + $out->{'UnmarshalJSON'} = $this->toUnmarshalJSON(); | |
| 27443 | 27767 | $out->{'unowned'} = $this->toUnowned(); |
| 27444 | 27768 | $out->{'unsafe'} = $this->toUnsafe(); |
| 27445 | 27769 | $out->{'unsigned'} = $this->toUnsigned(); |
| @@ -27557,7 +27881,7 @@ class TopLevel { | ||
| 27557 | 27881 | ,TopLevel::fromDel($obj->{'del'}) |
| 27558 | 27882 | ,TopLevel::fromDelegate($obj->{'delegate'}) |
| 27559 | 27883 | ,TopLevel::fromDelete($obj->{'delete'}) |
| 27560 | - ,TopLevel::fromDict($obj->{'dict'}) | |
| 27884 | + ,TopLevel::purpleFromDict($obj->{'dict'}) | |
| 27561 | 27885 | ,TopLevel::fromDictionary($obj->{'dictionary'}) |
| 27562 | 27886 | ,TopLevel::fromDidSet($obj->{'didSet'}) |
| 27563 | 27887 | ,TopLevel::fromDo($obj->{'do'}) |
| @@ -27595,6 +27919,7 @@ class TopLevel { | ||
| 27595 | 27919 | ,TopLevel::fromFormatException($obj->{'FormatException'}) |
| 27596 | 27920 | ,TopLevel::fromFriend($obj->{'friend'}) |
| 27597 | 27921 | ,TopLevel::fromFrom($obj->{'from'}) |
| 27922 | + ,TopLevel::fromFromDict($obj->{'from_dict'}) | |
| 27598 | 27923 | ,TopLevel::fromFromJSON($obj->{'from_json'}) |
| 27599 | 27924 | ,TopLevel::fromFunc($obj->{'func'}) |
| 27600 | 27925 | ,TopLevel::fromFunction($obj->{'function'}) |
| @@ -27656,6 +27981,7 @@ class TopLevel { | ||
| 27656 | 27981 | ,TopLevel::fromLong($obj->{'long'}) |
| 27657 | 27982 | ,TopLevel::fromMap($obj->{'map'}) |
| 27658 | 27983 | ,TopLevel::fromMapEntry($obj->{'MapEntry'}) |
| 27984 | + ,TopLevel::fromMarshalJSON($obj->{'MarshalJSON'}) | |
| 27659 | 27985 | ,TopLevel::fromMetadataPropertyHandling($obj->{'metadata_property_handling'}) |
| 27660 | 27986 | ,TopLevel::fromModule($obj->{'module'}) |
| 27661 | 27987 | ,TopLevel::fromMutable($obj->{'mutable'}) |
| @@ -27770,6 +28096,7 @@ class TopLevel { | ||
| 27770 | 28096 | ,TopLevel::fromTimeOnly($obj->{'TimeOnly'}) |
| 27771 | 28097 | ,TopLevel::fromTimeOnlyConverter($obj->{'TimeOnlyConverter'}) |
| 27772 | 28098 | ,TopLevel::fromTimeZone($obj->{'TimeZone'}) |
| 28099 | + ,TopLevel::fromToDict($obj->{'to_dict'}) | |
| 27773 | 28100 | ,TopLevel::fromToJSON($obj->{'to_json'}) |
| 27774 | 28101 | ,TopLevel::fromTopLevel($obj->{'top_level'}) |
| 27775 | 28102 | ,TopLevel::fromToString($obj->{'toString'}) |
| @@ -27789,6 +28116,7 @@ class TopLevel { | ||
| 27789 | 28116 | ,TopLevel::fromUnchecked($obj->{'unchecked'}) |
| 27790 | 28117 | ,TopLevel::fromUndefined($obj->{'undefined'}) |
| 27791 | 28118 | ,TopLevel::fromUnion($obj->{'union'}) |
| 28119 | + ,TopLevel::fromUnmarshalJSON($obj->{'UnmarshalJSON'}) | |
| 27792 | 28120 | ,TopLevel::fromUnowned($obj->{'unowned'}) |
| 27793 | 28121 | ,TopLevel::fromUnsafe($obj->{'unsafe'}) |
| 27794 | 28122 | ,TopLevel::fromUnsigned($obj->{'unsigned'}) |
| @@ -27942,6 +28270,7 @@ class TopLevel { | ||
| 27942 | 28270 | ,TopLevel::sampleFormatException() |
| 27943 | 28271 | ,TopLevel::sampleFriend() |
| 27944 | 28272 | ,TopLevel::sampleFrom() |
| 28273 | + ,TopLevel::sampleFromDict() | |
| 27945 | 28274 | ,TopLevel::sampleFromJSON() |
| 27946 | 28275 | ,TopLevel::sampleFunc() |
| 27947 | 28276 | ,TopLevel::sampleFunction() |
| @@ -28003,6 +28332,7 @@ class TopLevel { | ||
| 28003 | 28332 | ,TopLevel::sampleLong() |
| 28004 | 28333 | ,TopLevel::sampleMap() |
| 28005 | 28334 | ,TopLevel::sampleMapEntry() |
| 28335 | + ,TopLevel::sampleMarshalJSON() | |
| 28006 | 28336 | ,TopLevel::sampleMetadataPropertyHandling() |
| 28007 | 28337 | ,TopLevel::sampleModule() |
| 28008 | 28338 | ,TopLevel::sampleMutable() |
| @@ -28117,6 +28447,7 @@ class TopLevel { | ||
| 28117 | 28447 | ,TopLevel::sampleTimeOnly() |
| 28118 | 28448 | ,TopLevel::sampleTimeOnlyConverter() |
| 28119 | 28449 | ,TopLevel::sampleTimeZone() |
| 28450 | + ,TopLevel::sampleToDict() | |
| 28120 | 28451 | ,TopLevel::sampleToJSON() |
| 28121 | 28452 | ,TopLevel::sampleTopLevel() |
| 28122 | 28453 | ,TopLevel::sampleToString() |
| @@ -28136,6 +28467,7 @@ class TopLevel { | ||
| 28136 | 28467 | ,TopLevel::sampleUnchecked() |
| 28137 | 28468 | ,TopLevel::sampleUndefined() |
| 28138 | 28469 | ,TopLevel::sampleUnion() |
| 28470 | + ,TopLevel::sampleUnmarshalJSON() | |
| 28139 | 28471 | ,TopLevel::sampleUnowned() |
| 28140 | 28472 | ,TopLevel::sampleUnsafe() |
| 28141 | 28473 | ,TopLevel::sampleUnsigned() |
| @@ -33338,6 +33670,51 @@ class From { | ||
| 33338 | 33670 | } |
| 33339 | 33671 | } |
| 33340 | 33672 | |
| 33673 | +// This is an autogenerated file:FromDict | |
| 33674 | + | |
| 33675 | +class FromDict { | |
| 33676 | + | |
| 33677 | + /** | |
| 33678 | + */ | |
| 33679 | + public function __construct() { | |
| 33680 | + } | |
| 33681 | + | |
| 33682 | + /** | |
| 33683 | + * @throws Exception | |
| 33684 | + * @return bool | |
| 33685 | + */ | |
| 33686 | + public function validate(): bool { | |
| 33687 | + return true; | |
| 33688 | + } | |
| 33689 | + | |
| 33690 | + /** | |
| 33691 | + * @return stdClass | |
| 33692 | + * @throws Exception | |
| 33693 | + */ | |
| 33694 | + public function to(): stdClass { | |
| 33695 | + $out = new stdClass(); | |
| 33696 | + return $out; | |
| 33697 | + } | |
| 33698 | + | |
| 33699 | + /** | |
| 33700 | + * @param stdClass $obj | |
| 33701 | + * @return FromDict | |
| 33702 | + * @throws Exception | |
| 33703 | + */ | |
| 33704 | + public static function from(stdClass $obj): FromDict { | |
| 33705 | + return new FromDict( | |
| 33706 | + ); | |
| 33707 | + } | |
| 33708 | + | |
| 33709 | + /** | |
| 33710 | + * @return FromDict | |
| 33711 | + */ | |
| 33712 | + public static function sample(): FromDict { | |
| 33713 | + return new FromDict( | |
| 33714 | + ); | |
| 33715 | + } | |
| 33716 | +} | |
| 33717 | + | |
| 33341 | 33718 | // This is an autogenerated file:FromJSON |
| 33342 | 33719 | |
| 33343 | 33720 | class FromJSON { |
| @@ -36128,6 +36505,51 @@ class MapEntry { | ||
| 36128 | 36505 | } |
| 36129 | 36506 | } |
| 36130 | 36507 | |
| 36508 | +// This is an autogenerated file:MarshalJSON | |
| 36509 | + | |
| 36510 | +class MarshalJSON { | |
| 36511 | + | |
| 36512 | + /** | |
| 36513 | + */ | |
| 36514 | + public function __construct() { | |
| 36515 | + } | |
| 36516 | + | |
| 36517 | + /** | |
| 36518 | + * @throws Exception | |
| 36519 | + * @return bool | |
| 36520 | + */ | |
| 36521 | + public function validate(): bool { | |
| 36522 | + return true; | |
| 36523 | + } | |
| 36524 | + | |
| 36525 | + /** | |
| 36526 | + * @return stdClass | |
| 36527 | + * @throws Exception | |
| 36528 | + */ | |
| 36529 | + public function to(): stdClass { | |
| 36530 | + $out = new stdClass(); | |
| 36531 | + return $out; | |
| 36532 | + } | |
| 36533 | + | |
| 36534 | + /** | |
| 36535 | + * @param stdClass $obj | |
| 36536 | + * @return MarshalJSON | |
| 36537 | + * @throws Exception | |
| 36538 | + */ | |
| 36539 | + public static function from(stdClass $obj): MarshalJSON { | |
| 36540 | + return new MarshalJSON( | |
| 36541 | + ); | |
| 36542 | + } | |
| 36543 | + | |
| 36544 | + /** | |
| 36545 | + * @return MarshalJSON | |
| 36546 | + */ | |
| 36547 | + public static function sample(): MarshalJSON { | |
| 36548 | + return new MarshalJSON( | |
| 36549 | + ); | |
| 36550 | + } | |
| 36551 | +} | |
| 36552 | + | |
| 36131 | 36553 | // This is an autogenerated file:MetadataPropertyHandling |
| 36132 | 36554 | |
| 36133 | 36555 | class MetadataPropertyHandling { |
| @@ -41078,6 +41500,51 @@ class TimeZone { | ||
| 41078 | 41500 | } |
| 41079 | 41501 | } |
| 41080 | 41502 | |
| 41503 | +// This is an autogenerated file:ToDict | |
| 41504 | + | |
| 41505 | +class ToDict { | |
| 41506 | + | |
| 41507 | + /** | |
| 41508 | + */ | |
| 41509 | + public function __construct() { | |
| 41510 | + } | |
| 41511 | + | |
| 41512 | + /** | |
| 41513 | + * @throws Exception | |
| 41514 | + * @return bool | |
| 41515 | + */ | |
| 41516 | + public function validate(): bool { | |
| 41517 | + return true; | |
| 41518 | + } | |
| 41519 | + | |
| 41520 | + /** | |
| 41521 | + * @return stdClass | |
| 41522 | + * @throws Exception | |
| 41523 | + */ | |
| 41524 | + public function to(): stdClass { | |
| 41525 | + $out = new stdClass(); | |
| 41526 | + return $out; | |
| 41527 | + } | |
| 41528 | + | |
| 41529 | + /** | |
| 41530 | + * @param stdClass $obj | |
| 41531 | + * @return ToDict | |
| 41532 | + * @throws Exception | |
| 41533 | + */ | |
| 41534 | + public static function from(stdClass $obj): ToDict { | |
| 41535 | + return new ToDict( | |
| 41536 | + ); | |
| 41537 | + } | |
| 41538 | + | |
| 41539 | + /** | |
| 41540 | + * @return ToDict | |
| 41541 | + */ | |
| 41542 | + public static function sample(): ToDict { | |
| 41543 | + return new ToDict( | |
| 41544 | + ); | |
| 41545 | + } | |
| 41546 | +} | |
| 41547 | + | |
| 41081 | 41548 | // This is an autogenerated file:ToJSON |
| 41082 | 41549 | |
| 41083 | 41550 | class ToJSON { |
| @@ -42338,6 +42805,51 @@ class UnionClass { | ||
| 42338 | 42805 | } |
| 42339 | 42806 | } |
| 42340 | 42807 | |
| 42808 | +// This is an autogenerated file:UnmarshalJSON | |
| 42809 | + | |
| 42810 | +class UnmarshalJSON { | |
| 42811 | + | |
| 42812 | + /** | |
| 42813 | + */ | |
| 42814 | + public function __construct() { | |
| 42815 | + } | |
| 42816 | + | |
| 42817 | + /** | |
| 42818 | + * @throws Exception | |
| 42819 | + * @return bool | |
| 42820 | + */ | |
| 42821 | + public function validate(): bool { | |
| 42822 | + return true; | |
| 42823 | + } | |
| 42824 | + | |
| 42825 | + /** | |
| 42826 | + * @return stdClass | |
| 42827 | + * @throws Exception | |
| 42828 | + */ | |
| 42829 | + public function to(): stdClass { | |
| 42830 | + $out = new stdClass(); | |
| 42831 | + return $out; | |
| 42832 | + } | |
| 42833 | + | |
| 42834 | + /** | |
| 42835 | + * @param stdClass $obj | |
| 42836 | + * @return UnmarshalJSON | |
| 42837 | + * @throws Exception | |
| 42838 | + */ | |
| 42839 | + public static function from(stdClass $obj): UnmarshalJSON { | |
| 42840 | + return new UnmarshalJSON( | |
| 42841 | + ); | |
| 42842 | + } | |
| 42843 | + | |
| 42844 | + /** | |
| 42845 | + * @return UnmarshalJSON | |
| 42846 | + */ | |
| 42847 | + public static function sample(): UnmarshalJSON { | |
| 42848 | + return new UnmarshalJSON( | |
| 42849 | + ); | |
| 42850 | + } | |
| 42851 | +} | |
| 42852 | + | |
| 42341 | 42853 | // This is an autogenerated file:Unowned |
| 42342 | 42854 | |
| 42343 | 42855 | class Unowned { |
Mschema-pikedefault / TopLevel.pmod+104 −0
| @@ -135,6 +135,7 @@ class TopLevel { | ||
| 135 | 135 | UnionFormatException format_exception; // json: "FormatException" |
| 136 | 136 | UnionFriend friend; // json: "friend" |
| 137 | 137 | UnionFrom from; // json: "from" |
| 138 | + UnionFromDict from_dict; // json: "from_dict" | |
| 138 | 139 | UnionFromJson from_json; // json: "from_json" |
| 139 | 140 | UnionFunc func; // json: "func" |
| 140 | 141 | UnionFunction top_level_function; // json: "function" |
| @@ -196,6 +197,7 @@ class TopLevel { | ||
| 196 | 197 | UnionLong long; // json: "long" |
| 197 | 198 | UnionMap map; // json: "map" |
| 198 | 199 | UnionMapEntry map_entry; // json: "MapEntry" |
| 200 | + UnionMarshalJson marshal_json; // json: "MarshalJSON" | |
| 199 | 201 | UnionMetadataPropertyHandling metadata_property_handling; // json: "metadata_property_handling" |
| 200 | 202 | UnionModule module; // json: "module" |
| 201 | 203 | UnionMutable mutable; // json: "mutable" |
| @@ -310,6 +312,7 @@ class TopLevel { | ||
| 310 | 312 | UnionTimeOnly time_only; // json: "TimeOnly" |
| 311 | 313 | UnionTimeOnlyConverter time_only_converter; // json: "TimeOnlyConverter" |
| 312 | 314 | UnionTimeZone time_zone; // json: "TimeZone" |
| 315 | + UnionToDict to_dict; // json: "to_dict" | |
| 313 | 316 | UnionToJson to_json; // json: "to_json" |
| 314 | 317 | UnionTopLevel top_level; // json: "top_level" |
| 315 | 318 | UnionToString to_string; // json: "toString" |
| @@ -329,6 +332,7 @@ class TopLevel { | ||
| 329 | 332 | UnionUnchecked unchecked; // json: "unchecked" |
| 330 | 333 | UnionUndefined undefined; // json: "undefined" |
| 331 | 334 | UnionUnionUnion union; // json: "union" |
| 335 | + UnionUnmarshalJson unmarshal_json; // json: "UnmarshalJSON" | |
| 332 | 336 | UnionUnowned unowned; // json: "unowned" |
| 333 | 337 | UnionUnsafe unsafe; // json: "unsafe" |
| 334 | 338 | UnionUnsigned unsigned; // json: "unsigned" |
| @@ -477,6 +481,7 @@ class TopLevel { | ||
| 477 | 481 | "FormatException" : format_exception, |
| 478 | 482 | "friend" : friend, |
| 479 | 483 | "from" : from, |
| 484 | + "from_dict" : from_dict, | |
| 480 | 485 | "from_json" : from_json, |
| 481 | 486 | "func" : func, |
| 482 | 487 | "function" : top_level_function, |
| @@ -538,6 +543,7 @@ class TopLevel { | ||
| 538 | 543 | "long" : long, |
| 539 | 544 | "map" : map, |
| 540 | 545 | "MapEntry" : map_entry, |
| 546 | + "MarshalJSON" : marshal_json, | |
| 541 | 547 | "metadata_property_handling" : metadata_property_handling, |
| 542 | 548 | "module" : module, |
| 543 | 549 | "mutable" : mutable, |
| @@ -652,6 +658,7 @@ class TopLevel { | ||
| 652 | 658 | "TimeOnly" : time_only, |
| 653 | 659 | "TimeOnlyConverter" : time_only_converter, |
| 654 | 660 | "TimeZone" : time_zone, |
| 661 | + "to_dict" : to_dict, | |
| 655 | 662 | "to_json" : to_json, |
| 656 | 663 | "top_level" : top_level, |
| 657 | 664 | "toString" : to_string, |
| @@ -671,6 +678,7 @@ class TopLevel { | ||
| 671 | 678 | "unchecked" : unchecked, |
| 672 | 679 | "undefined" : undefined, |
| 673 | 680 | "union" : union, |
| 681 | + "UnmarshalJSON" : unmarshal_json, | |
| 674 | 682 | "unowned" : unowned, |
| 675 | 683 | "unsafe" : unsafe, |
| 676 | 684 | "unsigned" : unsigned, |
| @@ -946,6 +954,8 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 946 | 954 | retval.friend = json["friend"]; |
| 947 | 955 | if (arrayp(json["from"])) error("Unexpected array"); |
| 948 | 956 | retval.from = json["from"]; |
| 957 | + if (arrayp(json["from_dict"])) error("Unexpected array"); | |
| 958 | + retval.from_dict = json["from_dict"]; | |
| 949 | 959 | if (arrayp(json["from_json"])) error("Unexpected array"); |
| 950 | 960 | retval.from_json = json["from_json"]; |
| 951 | 961 | if (arrayp(json["func"])) error("Unexpected array"); |
| @@ -1068,6 +1078,8 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 1068 | 1078 | retval.map = json["map"]; |
| 1069 | 1079 | if (arrayp(json["MapEntry"])) error("Unexpected array"); |
| 1070 | 1080 | retval.map_entry = json["MapEntry"]; |
| 1081 | + if (arrayp(json["MarshalJSON"])) error("Unexpected array"); | |
| 1082 | + retval.marshal_json = json["MarshalJSON"]; | |
| 1071 | 1083 | if (arrayp(json["metadata_property_handling"])) error("Unexpected array"); |
| 1072 | 1084 | retval.metadata_property_handling = json["metadata_property_handling"]; |
| 1073 | 1085 | if (arrayp(json["module"])) error("Unexpected array"); |
| @@ -1296,6 +1308,8 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 1296 | 1308 | retval.time_only_converter = json["TimeOnlyConverter"]; |
| 1297 | 1309 | if (arrayp(json["TimeZone"])) error("Unexpected array"); |
| 1298 | 1310 | retval.time_zone = json["TimeZone"]; |
| 1311 | + if (arrayp(json["to_dict"])) error("Unexpected array"); | |
| 1312 | + retval.to_dict = json["to_dict"]; | |
| 1299 | 1313 | if (arrayp(json["to_json"])) error("Unexpected array"); |
| 1300 | 1314 | retval.to_json = json["to_json"]; |
| 1301 | 1315 | if (arrayp(json["top_level"])) error("Unexpected array"); |
| @@ -1334,6 +1348,8 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 1334 | 1348 | retval.undefined = json["undefined"]; |
| 1335 | 1349 | if (arrayp(json["union"])) error("Unexpected array"); |
| 1336 | 1350 | retval.union = json["union"]; |
| 1351 | + if (arrayp(json["UnmarshalJSON"])) error("Unexpected array"); | |
| 1352 | + retval.unmarshal_json = json["UnmarshalJSON"]; | |
| 1337 | 1353 | if (arrayp(json["unowned"])) error("Unexpected array"); |
| 1338 | 1354 | retval.unowned = json["unowned"]; |
| 1339 | 1355 | if (arrayp(json["unsafe"])) error("Unexpected array"); |
| @@ -3540,6 +3556,28 @@ From From_from_JSON(mixed json) { | ||
| 3540 | 3556 | return retval; |
| 3541 | 3557 | } |
| 3542 | 3558 | |
| 3559 | +typedef float|FromDict UnionFromDict; | |
| 3560 | + | |
| 3561 | +UnionFromDict UnionFromDict_from_JSON(mixed json) { | |
| 3562 | + return json; | |
| 3563 | +} | |
| 3564 | + | |
| 3565 | +class FromDict { | |
| 3566 | + | |
| 3567 | + string encode_json() { | |
| 3568 | + mapping(string:mixed) json = ([ | |
| 3569 | + ]); | |
| 3570 | + | |
| 3571 | + return Standards.JSON.encode(json); | |
| 3572 | + } | |
| 3573 | +} | |
| 3574 | + | |
| 3575 | +FromDict FromDict_from_JSON(mixed json) { | |
| 3576 | + FromDict retval = FromDict(); | |
| 3577 | + | |
| 3578 | + return retval; | |
| 3579 | +} | |
| 3580 | + | |
| 3543 | 3581 | typedef float|FromJson UnionFromJson; |
| 3544 | 3582 | |
| 3545 | 3583 | UnionFromJson UnionFromJson_from_JSON(mixed json) { |
| @@ -4750,6 +4788,28 @@ MapEntry MapEntry_from_JSON(mixed json) { | ||
| 4750 | 4788 | return retval; |
| 4751 | 4789 | } |
| 4752 | 4790 | |
| 4791 | +typedef float|MarshalJson UnionMarshalJson; | |
| 4792 | + | |
| 4793 | +UnionMarshalJson UnionMarshalJson_from_JSON(mixed json) { | |
| 4794 | + return json; | |
| 4795 | +} | |
| 4796 | + | |
| 4797 | +class MarshalJson { | |
| 4798 | + | |
| 4799 | + string encode_json() { | |
| 4800 | + mapping(string:mixed) json = ([ | |
| 4801 | + ]); | |
| 4802 | + | |
| 4803 | + return Standards.JSON.encode(json); | |
| 4804 | + } | |
| 4805 | +} | |
| 4806 | + | |
| 4807 | +MarshalJson MarshalJson_from_JSON(mixed json) { | |
| 4808 | + MarshalJson retval = MarshalJson(); | |
| 4809 | + | |
| 4810 | + return retval; | |
| 4811 | +} | |
| 4812 | + | |
| 4753 | 4813 | typedef float|MetadataPropertyHandling UnionMetadataPropertyHandling; |
| 4754 | 4814 | |
| 4755 | 4815 | UnionMetadataPropertyHandling UnionMetadataPropertyHandling_from_JSON(mixed json) { |
| @@ -7016,6 +7076,28 @@ TimeZone TimeZone_from_JSON(mixed json) { | ||
| 7016 | 7076 | return retval; |
| 7017 | 7077 | } |
| 7018 | 7078 | |
| 7079 | +typedef float|ToDict UnionToDict; | |
| 7080 | + | |
| 7081 | +UnionToDict UnionToDict_from_JSON(mixed json) { | |
| 7082 | + return json; | |
| 7083 | +} | |
| 7084 | + | |
| 7085 | +class ToDict { | |
| 7086 | + | |
| 7087 | + string encode_json() { | |
| 7088 | + mapping(string:mixed) json = ([ | |
| 7089 | + ]); | |
| 7090 | + | |
| 7091 | + return Standards.JSON.encode(json); | |
| 7092 | + } | |
| 7093 | +} | |
| 7094 | + | |
| 7095 | +ToDict ToDict_from_JSON(mixed json) { | |
| 7096 | + ToDict retval = ToDict(); | |
| 7097 | + | |
| 7098 | + return retval; | |
| 7099 | +} | |
| 7100 | + | |
| 7019 | 7101 | typedef float|ToJson UnionToJson; |
| 7020 | 7102 | |
| 7021 | 7103 | UnionToJson UnionToJson_from_JSON(mixed json) { |
| @@ -8358,6 +8440,28 @@ Union Union_from_JSON(mixed json) { | ||
| 8358 | 8440 | return retval; |
| 8359 | 8441 | } |
| 8360 | 8442 | |
| 8443 | +typedef float|UnmarshalJson UnionUnmarshalJson; | |
| 8444 | + | |
| 8445 | +UnionUnmarshalJson UnionUnmarshalJson_from_JSON(mixed json) { | |
| 8446 | + return json; | |
| 8447 | +} | |
| 8448 | + | |
| 8449 | +class UnmarshalJson { | |
| 8450 | + | |
| 8451 | + string encode_json() { | |
| 8452 | + mapping(string:mixed) json = ([ | |
| 8453 | + ]); | |
| 8454 | + | |
| 8455 | + return Standards.JSON.encode(json); | |
| 8456 | + } | |
| 8457 | +} | |
| 8458 | + | |
| 8459 | +UnmarshalJson UnmarshalJson_from_JSON(mixed json) { | |
| 8460 | + UnmarshalJson retval = UnmarshalJson(); | |
| 8461 | + | |
| 8462 | + return retval; | |
| 8463 | +} | |
| 8464 | + | |
| 8361 | 8465 | typedef float|Unowned UnionUnowned; |
| 8362 | 8466 | |
| 8363 | 8467 | UnionUnowned UnionUnowned_from_JSON(mixed json) { |
Mschema-pythondefault / quicktype.py+73 −1
| @@ -2162,6 +2162,20 @@ class MapEntry: | ||
| 2162 | 2162 | return result |
| 2163 | 2163 | |
| 2164 | 2164 | |
| 2165 | +@dataclass | |
| 2166 | +class MarshalJSON: | |
| 2167 | + pass | |
| 2168 | + | |
| 2169 | + @staticmethod | |
| 2170 | + def from_dict(obj: Any) -> 'MarshalJSON': | |
| 2171 | + assert isinstance(obj, dict) | |
| 2172 | + return MarshalJSON() | |
| 2173 | + | |
| 2174 | + def to_dict(self) -> dict: | |
| 2175 | + result: dict = {} | |
| 2176 | + return result | |
| 2177 | + | |
| 2178 | + | |
| 2165 | 2179 | @dataclass |
| 2166 | 2180 | class MetadataPropertyHandling: |
| 2167 | 2181 | pass |
| @@ -3968,6 +3982,20 @@ class From: | ||
| 3968 | 3982 | return result |
| 3969 | 3983 | |
| 3970 | 3984 | |
| 3985 | +@dataclass | |
| 3986 | +class FromDict: | |
| 3987 | + pass | |
| 3988 | + | |
| 3989 | + @staticmethod | |
| 3990 | + def from_dict(obj: Any) -> 'FromDict': | |
| 3991 | + assert isinstance(obj, dict) | |
| 3992 | + return FromDict() | |
| 3993 | + | |
| 3994 | + def to_dict(self) -> dict: | |
| 3995 | + result: dict = {} | |
| 3996 | + return result | |
| 3997 | + | |
| 3998 | + | |
| 3971 | 3999 | @dataclass |
| 3972 | 4000 | class Global: |
| 3973 | 4001 | pass |
| @@ -4220,6 +4248,20 @@ class Self: | ||
| 4220 | 4248 | return result |
| 4221 | 4249 | |
| 4222 | 4250 | |
| 4251 | +@dataclass | |
| 4252 | +class ToDict: | |
| 4253 | + pass | |
| 4254 | + | |
| 4255 | + @staticmethod | |
| 4256 | + def from_dict(obj: Any) -> 'ToDict': | |
| 4257 | + assert isinstance(obj, dict) | |
| 4258 | + return ToDict() | |
| 4259 | + | |
| 4260 | + def to_dict(self) -> dict: | |
| 4261 | + result: dict = {} | |
| 4262 | + return result | |
| 4263 | + | |
| 4264 | + | |
| 4223 | 4265 | @dataclass |
| 4224 | 4266 | class UnionTrueTrue: |
| 4225 | 4267 | pass |
| @@ -4486,6 +4528,20 @@ class UnionClass: | ||
| 4486 | 4528 | return result |
| 4487 | 4529 | |
| 4488 | 4530 | |
| 4531 | +@dataclass | |
| 4532 | +class UnmarshalJSON: | |
| 4533 | + pass | |
| 4534 | + | |
| 4535 | + @staticmethod | |
| 4536 | + def from_dict(obj: Any) -> 'UnmarshalJSON': | |
| 4537 | + assert isinstance(obj, dict) | |
| 4538 | + return UnmarshalJSON() | |
| 4539 | + | |
| 4540 | + def to_dict(self) -> dict: | |
| 4541 | + result: dict = {} | |
| 4542 | + return result | |
| 4543 | + | |
| 4544 | + | |
| 4489 | 4545 | @dataclass |
| 4490 | 4546 | class Unowned: |
| 4491 | 4547 | pass |
| @@ -4890,6 +4946,7 @@ class TopLevel: | ||
| 4890 | 4946 | format_exception: float | FormatException | None = None |
| 4891 | 4947 | friend: float | Friend | None = None |
| 4892 | 4948 | top_level_from: float | From | None = None |
| 4949 | + top_level_from_dict: float | FromDict | None = None | |
| 4893 | 4950 | from_json: float | FromJSON | None = None |
| 4894 | 4951 | func: float | Func | None = None |
| 4895 | 4952 | function: float | Function | None = None |
| @@ -4951,6 +5008,7 @@ class TopLevel: | ||
| 4951 | 5008 | long: float | Long | None = None |
| 4952 | 5009 | map: float | Map | None = None |
| 4953 | 5010 | map_entry: float | MapEntry | None = None |
| 5011 | + marshal_json: float | MarshalJSON | None = None | |
| 4954 | 5012 | metadata_property_handling: float | MetadataPropertyHandling | None = None |
| 4955 | 5013 | module: float | Module | None = None |
| 4956 | 5014 | mutable: float | Mutable | None = None |
| @@ -5065,6 +5123,7 @@ class TopLevel: | ||
| 5065 | 5123 | time_only: float | TimeOnly | None = None |
| 5066 | 5124 | time_only_converter: float | TimeOnlyConverter | None = None |
| 5067 | 5125 | time_zone: float | TimeZone | None = None |
| 5126 | + top_level_to_dict: float | ToDict | None = None | |
| 5068 | 5127 | to_json: float | ToJSON | None = None |
| 5069 | 5128 | top_level: float | TopLevelClass | None = None |
| 5070 | 5129 | to_string: float | ToString | None = None |
| @@ -5084,6 +5143,7 @@ class TopLevel: | ||
| 5084 | 5143 | unchecked: float | Unchecked | None = None |
| 5085 | 5144 | undefined: float | Undefined | None = None |
| 5086 | 5145 | union: float | UnionClass | None = None |
| 5146 | + unmarshal_json: float | UnmarshalJSON | None = None | |
| 5087 | 5147 | unowned: float | Unowned | None = None |
| 5088 | 5148 | unsafe: float | Unsafe | None = None |
| 5089 | 5149 | unsigned: float | Unsigned | None = None |
| @@ -5233,6 +5293,7 @@ class TopLevel: | ||
| 5233 | 5293 | format_exception = from_union([from_float, FormatException.from_dict, from_none], obj.get("FormatException")) |
| 5234 | 5294 | friend = from_union([from_float, Friend.from_dict, from_none], obj.get("friend")) |
| 5235 | 5295 | top_level_from = from_union([from_float, From.from_dict, from_none], obj.get("from")) |
| 5296 | + top_level_from_dict = from_union([from_float, FromDict.from_dict, from_none], obj.get("from_dict")) | |
| 5236 | 5297 | from_json = from_union([from_float, FromJSON.from_dict, from_none], obj.get("from_json")) |
| 5237 | 5298 | func = from_union([from_float, Func.from_dict, from_none], obj.get("func")) |
| 5238 | 5299 | function = from_union([from_float, Function.from_dict, from_none], obj.get("function")) |
| @@ -5294,6 +5355,7 @@ class TopLevel: | ||
| 5294 | 5355 | long = from_union([from_float, Long.from_dict, from_none], obj.get("long")) |
| 5295 | 5356 | map = from_union([from_float, Map.from_dict, from_none], obj.get("map")) |
| 5296 | 5357 | map_entry = from_union([from_float, MapEntry.from_dict, from_none], obj.get("MapEntry")) |
| 5358 | + marshal_json = from_union([from_float, MarshalJSON.from_dict, from_none], obj.get("MarshalJSON")) | |
| 5297 | 5359 | metadata_property_handling = from_union([from_float, MetadataPropertyHandling.from_dict, from_none], obj.get("metadata_property_handling")) |
| 5298 | 5360 | module = from_union([from_float, Module.from_dict, from_none], obj.get("module")) |
| 5299 | 5361 | mutable = from_union([from_float, Mutable.from_dict, from_none], obj.get("mutable")) |
| @@ -5408,6 +5470,7 @@ class TopLevel: | ||
| 5408 | 5470 | time_only = from_union([from_float, TimeOnly.from_dict, from_none], obj.get("TimeOnly")) |
| 5409 | 5471 | time_only_converter = from_union([from_float, TimeOnlyConverter.from_dict, from_none], obj.get("TimeOnlyConverter")) |
| 5410 | 5472 | time_zone = from_union([from_float, TimeZone.from_dict, from_none], obj.get("TimeZone")) |
| 5473 | + top_level_to_dict = from_union([from_float, ToDict.from_dict, from_none], obj.get("to_dict")) | |
| 5411 | 5474 | to_json = from_union([from_float, ToJSON.from_dict, from_none], obj.get("to_json")) |
| 5412 | 5475 | top_level = from_union([from_float, TopLevelClass.from_dict, from_none], obj.get("top_level")) |
| 5413 | 5476 | to_string = from_union([from_float, ToString.from_dict, from_none], obj.get("toString")) |
| @@ -5427,6 +5490,7 @@ class TopLevel: | ||
| 5427 | 5490 | unchecked = from_union([from_float, Unchecked.from_dict, from_none], obj.get("unchecked")) |
| 5428 | 5491 | undefined = from_union([from_float, Undefined.from_dict, from_none], obj.get("undefined")) |
| 5429 | 5492 | union = from_union([from_float, UnionClass.from_dict, from_none], obj.get("union")) |
| 5493 | + unmarshal_json = from_union([from_float, UnmarshalJSON.from_dict, from_none], obj.get("UnmarshalJSON")) | |
| 5430 | 5494 | unowned = from_union([from_float, Unowned.from_dict, from_none], obj.get("unowned")) |
| 5431 | 5495 | unsafe = from_union([from_float, Unsafe.from_dict, from_none], obj.get("unsafe")) |
| 5432 | 5496 | unsigned = from_union([from_float, Unsigned.from_dict, from_none], obj.get("unsigned")) |
| @@ -5450,7 +5514,7 @@ class TopLevel: | ||
| 5450 | 5514 | xor_eq = from_union([from_float, XorEq.from_dict, from_none], obj.get("xor_eq")) |
| 5451 | 5515 | yes = from_union([from_float, Yes.from_dict, from_none], obj.get("YES")) |
| 5452 | 5516 | top_level_yield = from_union([from_float, Yield.from_dict, from_none], obj.get("yield")) |
| 5453 | - return TopLevel(empty, purple_bool, complex, imaginery, abstract, alignas, alignof, top_level_and, and_eq, top_level_any, any, array, top_level_as, asm, top_level_assert, associatedtype, associativity, top_level_async, atomic, atomic_cancel, atomic_commit, atomic_noexcept, auto, top_level_await, base, bitand, bitor, top_level_bool, fluffy_bool, boolean, top_level_break, bycopy, byref, byte, calendar, case, catch, chan, char, char16_t, char32_t, checked, purple_class, top_level_class, clone, co_await, co_return, co_yield, codable, coding_key, coding_keys, compl, concept, console, const, const_cast, constexpr, constructor, top_level_continue, convenience, convert, converter, culture_info, date, date_parse_handling, date_formatter, date_only, date_only_converter, date_time, date_time_styles, debugger, decimal, declare, decltype, decode_string, decoder, decoding_error, top_level_def, default, defer, deinit, top_level_del, delegate, delete, top_level_dict, dictionary, did_set, do, double, dummy, dynamic, dynamic_cast, top_level_elif, top_level_else, encode_quick_type, encoder, enum, enum_values, equality_contract, equatable, event, top_level_except, exception, explicit, export, exposing, extends, extension, extern, fallthrough, top_level_false, false, fileprivate, final, top_level_finally, fixed, top_level_float, top_level_for, foreach, format_exception, friend, top_level_from, from_json, func, function, get, top_level_global, go, goto, guard, hashable, hash_code, hasher, has_own_property, id, top_level_if, imp, implements, implicit, top_level_import, top_level_in, indirect, infix, init, inline, inout, instanceof, top_level_int, interface, internal, top_level_is, iso_date_time_offset_converter, iterable, jdec, jenc, jpipe, json, json_converter, json_serializer, json_token, json_writer, json_any, json_coding_key, json_decoder, json_encoder, json_exception, json_generator, json_node, json_null, json_parser, json_reader, json_token_type, k_serializer, top_level_lambda, lazy, left, let, list, locale, lock, long, map, map_entry, metadata_property_handling, module, mutable, mutating, namespace, native, new, newtonsoft, nil, no, noexcept, nonatomic, top_level_none, none, top_level_nonlocal, nonmutating, no_such_method, top_level_not, not_eq, ns_error, ns_object, ns_string, null, top_level_null, nullptr, number, object, object_mapper, of, oneway, open, operator, optional, top_level_or, or_eq, out, override, package, params, top_level_pass, port, postfix, precedence, prefix, primitive_kind, top_level_print, printf, print_members, private, protected, protocol, top_level_protocol, public, quicktype, top_level_raise, range, readonly, ref, reg_exp, register, reinterpret_cast, repeat, require, required, requires, restrict, retain, rethrows, top_level_return, right, runtime_type, s, sbyte, sealed, sel, select, top_level_self, purple_self, sendable, serial_descriptor, serializable, serialize, serializer_provider, serial_name, set, short, signed, simple_module, sizeof, stackalloc, standards, static, static_assert, static_cast, std_deserializer, std_serializer, strictfp, string, struct, subscript, super, switch, symbol, synchronized, system, template, then, this, thread_local, throw, throws, time_only, time_only_converter, time_zone, to_json, top_level, to_string, transient, true, top_level_true, top_level_try, type, top_level_type, typealias, typedef, typeid, typename, typeof, uint, ulong, unchecked, undefined, union, unowned, unsafe, unsigned, use_serializers, ushort, using, utf8_json_reader, utf8_json_writer, uuid, var, virtual, void, volatile, wchar_t, weak, where, top_level_while, will_set, top_level_with, xor, xor_eq, yes, top_level_yield) | |
| 5517 | + return TopLevel(empty, purple_bool, complex, imaginery, abstract, alignas, alignof, top_level_and, and_eq, top_level_any, any, array, top_level_as, asm, top_level_assert, associatedtype, associativity, top_level_async, atomic, atomic_cancel, atomic_commit, atomic_noexcept, auto, top_level_await, base, bitand, bitor, top_level_bool, fluffy_bool, boolean, top_level_break, bycopy, byref, byte, calendar, case, catch, chan, char, char16_t, char32_t, checked, purple_class, top_level_class, clone, co_await, co_return, co_yield, codable, coding_key, coding_keys, compl, concept, console, const, const_cast, constexpr, constructor, top_level_continue, convenience, convert, converter, culture_info, date, date_parse_handling, date_formatter, date_only, date_only_converter, date_time, date_time_styles, debugger, decimal, declare, decltype, decode_string, decoder, decoding_error, top_level_def, default, defer, deinit, top_level_del, delegate, delete, top_level_dict, dictionary, did_set, do, double, dummy, dynamic, dynamic_cast, top_level_elif, top_level_else, encode_quick_type, encoder, enum, enum_values, equality_contract, equatable, event, top_level_except, exception, explicit, export, exposing, extends, extension, extern, fallthrough, top_level_false, false, fileprivate, final, top_level_finally, fixed, top_level_float, top_level_for, foreach, format_exception, friend, top_level_from, top_level_from_dict, from_json, func, function, get, top_level_global, go, goto, guard, hashable, hash_code, hasher, has_own_property, id, top_level_if, imp, implements, implicit, top_level_import, top_level_in, indirect, infix, init, inline, inout, instanceof, top_level_int, interface, internal, top_level_is, iso_date_time_offset_converter, iterable, jdec, jenc, jpipe, json, json_converter, json_serializer, json_token, json_writer, json_any, json_coding_key, json_decoder, json_encoder, json_exception, json_generator, json_node, json_null, json_parser, json_reader, json_token_type, k_serializer, top_level_lambda, lazy, left, let, list, locale, lock, long, map, map_entry, marshal_json, metadata_property_handling, module, mutable, mutating, namespace, native, new, newtonsoft, nil, no, noexcept, nonatomic, top_level_none, none, top_level_nonlocal, nonmutating, no_such_method, top_level_not, not_eq, ns_error, ns_object, ns_string, null, top_level_null, nullptr, number, object, object_mapper, of, oneway, open, operator, optional, top_level_or, or_eq, out, override, package, params, top_level_pass, port, postfix, precedence, prefix, primitive_kind, top_level_print, printf, print_members, private, protected, protocol, top_level_protocol, public, quicktype, top_level_raise, range, readonly, ref, reg_exp, register, reinterpret_cast, repeat, require, required, requires, restrict, retain, rethrows, top_level_return, right, runtime_type, s, sbyte, sealed, sel, select, top_level_self, purple_self, sendable, serial_descriptor, serializable, serialize, serializer_provider, serial_name, set, short, signed, simple_module, sizeof, stackalloc, standards, static, static_assert, static_cast, std_deserializer, std_serializer, strictfp, string, struct, subscript, super, switch, symbol, synchronized, system, template, then, this, thread_local, throw, throws, time_only, time_only_converter, time_zone, top_level_to_dict, to_json, top_level, to_string, transient, true, top_level_true, top_level_try, type, top_level_type, typealias, typedef, typeid, typename, typeof, uint, ulong, unchecked, undefined, union, unmarshal_json, unowned, unsafe, unsigned, use_serializers, ushort, using, utf8_json_reader, utf8_json_writer, uuid, var, virtual, void, volatile, wchar_t, weak, where, top_level_while, will_set, top_level_with, xor, xor_eq, yes, top_level_yield) | |
| 5454 | 5518 | |
| 5455 | 5519 | def to_dict(self) -> dict: |
| 5456 | 5520 | result: dict = {} |
| @@ -5698,6 +5762,8 @@ class TopLevel: | ||
| 5698 | 5762 | result["friend"] = from_union([to_float, lambda x: to_class(Friend, x), from_none], self.friend) |
| 5699 | 5763 | if self.top_level_from is not None: |
| 5700 | 5764 | result["from"] = from_union([to_float, lambda x: to_class(From, x), from_none], self.top_level_from) |
| 5765 | + if self.top_level_from_dict is not None: | |
| 5766 | + result["from_dict"] = from_union([to_float, lambda x: to_class(FromDict, x), from_none], self.top_level_from_dict) | |
| 5701 | 5767 | if self.from_json is not None: |
| 5702 | 5768 | result["from_json"] = from_union([to_float, lambda x: to_class(FromJSON, x), from_none], self.from_json) |
| 5703 | 5769 | if self.func is not None: |
| @@ -5820,6 +5886,8 @@ class TopLevel: | ||
| 5820 | 5886 | result["map"] = from_union([to_float, lambda x: to_class(Map, x), from_none], self.map) |
| 5821 | 5887 | if self.map_entry is not None: |
| 5822 | 5888 | result["MapEntry"] = from_union([to_float, lambda x: to_class(MapEntry, x), from_none], self.map_entry) |
| 5889 | + if self.marshal_json is not None: | |
| 5890 | + result["MarshalJSON"] = from_union([to_float, lambda x: to_class(MarshalJSON, x), from_none], self.marshal_json) | |
| 5823 | 5891 | if self.metadata_property_handling is not None: |
| 5824 | 5892 | result["metadata_property_handling"] = from_union([to_float, lambda x: to_class(MetadataPropertyHandling, x), from_none], self.metadata_property_handling) |
| 5825 | 5893 | if self.module is not None: |
| @@ -6048,6 +6116,8 @@ class TopLevel: | ||
| 6048 | 6116 | result["TimeOnlyConverter"] = from_union([to_float, lambda x: to_class(TimeOnlyConverter, x), from_none], self.time_only_converter) |
| 6049 | 6117 | if self.time_zone is not None: |
| 6050 | 6118 | result["TimeZone"] = from_union([to_float, lambda x: to_class(TimeZone, x), from_none], self.time_zone) |
| 6119 | + if self.top_level_to_dict is not None: | |
| 6120 | + result["to_dict"] = from_union([to_float, lambda x: to_class(ToDict, x), from_none], self.top_level_to_dict) | |
| 6051 | 6121 | if self.to_json is not None: |
| 6052 | 6122 | result["to_json"] = from_union([to_float, lambda x: to_class(ToJSON, x), from_none], self.to_json) |
| 6053 | 6123 | if self.top_level is not None: |
| @@ -6086,6 +6156,8 @@ class TopLevel: | ||
| 6086 | 6156 | result["undefined"] = from_union([to_float, lambda x: to_class(Undefined, x), from_none], self.undefined) |
| 6087 | 6157 | if self.union is not None: |
| 6088 | 6158 | result["union"] = from_union([to_float, lambda x: to_class(UnionClass, x), from_none], self.union) |
| 6159 | + if self.unmarshal_json is not None: | |
| 6160 | + result["UnmarshalJSON"] = from_union([to_float, lambda x: to_class(UnmarshalJSON, x), from_none], self.unmarshal_json) | |
| 6089 | 6161 | if self.unowned is not None: |
| 6090 | 6162 | result["unowned"] = from_union([to_float, lambda x: to_class(Unowned, x), from_none], self.unowned) |
| 6091 | 6163 | if self.unsafe is not None: |
Mschema-ruby-syntaxdefault / TopLevel.rb+240 −0
| @@ -5947,6 +5947,63 @@ class UnionFrom < Dry::Struct | ||
| 5947 | 5947 | end |
| 5948 | 5948 | end |
| 5949 | 5949 | |
| 5950 | +class FromDict < Dry::Struct | |
| 5951 | + | |
| 5952 | + def self.from_dynamic!(d) | |
| 5953 | + d = Types::Hash[d] | |
| 5954 | + new( | |
| 5955 | + ) | |
| 5956 | + end | |
| 5957 | + | |
| 5958 | + def self.from_json!(json) | |
| 5959 | + from_dynamic!(JSON.parse(json)) | |
| 5960 | + end | |
| 5961 | + | |
| 5962 | + def to_dynamic | |
| 5963 | + { | |
| 5964 | + } | |
| 5965 | + end | |
| 5966 | + | |
| 5967 | + def to_json(options = nil) | |
| 5968 | + JSON.generate(to_dynamic, options) | |
| 5969 | + end | |
| 5970 | +end | |
| 5971 | + | |
| 5972 | +class UnionFromDict < Dry::Struct | |
| 5973 | + attribute :double, Types::Double.optional | |
| 5974 | + attribute :from_dict, FromDict.optional | |
| 5975 | + | |
| 5976 | + def self.from_dynamic!(d) | |
| 5977 | + if schema.key(:double).type.right.valid? d | |
| 5978 | + return new(double: d, from_dict: nil) | |
| 5979 | + end | |
| 5980 | + begin | |
| 5981 | + value = FromDict.from_dynamic!(d) | |
| 5982 | + if schema.key(:from_dict).type.right.valid? value | |
| 5983 | + return new(from_dict: value, double: nil) | |
| 5984 | + end | |
| 5985 | + rescue | |
| 5986 | + end | |
| 5987 | + raise "Invalid union" | |
| 5988 | + end | |
| 5989 | + | |
| 5990 | + def self.from_json!(json) | |
| 5991 | + from_dynamic!(JSON.parse(json)) | |
| 5992 | + end | |
| 5993 | + | |
| 5994 | + def to_dynamic | |
| 5995 | + if double != nil | |
| 5996 | + double | |
| 5997 | + elsif from_dict != nil | |
| 5998 | + from_dict.to_dynamic | |
| 5999 | + end | |
| 6000 | + end | |
| 6001 | + | |
| 6002 | + def to_json(options = nil) | |
| 6003 | + JSON.generate(to_dynamic, options) | |
| 6004 | + end | |
| 6005 | +end | |
| 6006 | + | |
| 5950 | 6007 | class FromJSON < Dry::Struct |
| 5951 | 6008 | |
| 5952 | 6009 | def self.from_dynamic!(d) |
| @@ -9310,6 +9367,63 @@ class UnionMapEntry < Dry::Struct | ||
| 9310 | 9367 | end |
| 9311 | 9368 | end |
| 9312 | 9369 | |
| 9370 | +class MarshalJSON < Dry::Struct | |
| 9371 | + | |
| 9372 | + def self.from_dynamic!(d) | |
| 9373 | + d = Types::Hash[d] | |
| 9374 | + new( | |
| 9375 | + ) | |
| 9376 | + end | |
| 9377 | + | |
| 9378 | + def self.from_json!(json) | |
| 9379 | + from_dynamic!(JSON.parse(json)) | |
| 9380 | + end | |
| 9381 | + | |
| 9382 | + def to_dynamic | |
| 9383 | + { | |
| 9384 | + } | |
| 9385 | + end | |
| 9386 | + | |
| 9387 | + def to_json(options = nil) | |
| 9388 | + JSON.generate(to_dynamic, options) | |
| 9389 | + end | |
| 9390 | +end | |
| 9391 | + | |
| 9392 | +class UnionMarshalJSON < Dry::Struct | |
| 9393 | + attribute :double, Types::Double.optional | |
| 9394 | + attribute :marshal_json, MarshalJSON.optional | |
| 9395 | + | |
| 9396 | + def self.from_dynamic!(d) | |
| 9397 | + if schema.key(:double).type.right.valid? d | |
| 9398 | + return new(double: d, marshal_json: nil) | |
| 9399 | + end | |
| 9400 | + begin | |
| 9401 | + value = MarshalJSON.from_dynamic!(d) | |
| 9402 | + if schema.key(:marshal_json).type.right.valid? value | |
| 9403 | + return new(marshal_json: value, double: nil) | |
| 9404 | + end | |
| 9405 | + rescue | |
| 9406 | + end | |
| 9407 | + raise "Invalid union" | |
| 9408 | + end | |
| 9409 | + | |
| 9410 | + def self.from_json!(json) | |
| 9411 | + from_dynamic!(JSON.parse(json)) | |
| 9412 | + end | |
| 9413 | + | |
| 9414 | + def to_dynamic | |
| 9415 | + if double != nil | |
| 9416 | + double | |
| 9417 | + elsif marshal_json != nil | |
| 9418 | + marshal_json.to_dynamic | |
| 9419 | + end | |
| 9420 | + end | |
| 9421 | + | |
| 9422 | + def to_json(options = nil) | |
| 9423 | + JSON.generate(to_dynamic, options) | |
| 9424 | + end | |
| 9425 | +end | |
| 9426 | + | |
| 9313 | 9427 | class MetadataPropertyHandling < Dry::Struct |
| 9314 | 9428 | |
| 9315 | 9429 | def self.from_dynamic!(d) |
| @@ -14611,6 +14725,63 @@ class UnionTimeZone < Dry::Struct | ||
| 14611 | 14725 | end |
| 14612 | 14726 | end |
| 14613 | 14727 | |
| 14728 | +class ToDict < Dry::Struct | |
| 14729 | + | |
| 14730 | + def self.from_dynamic!(d) | |
| 14731 | + d = Types::Hash[d] | |
| 14732 | + new( | |
| 14733 | + ) | |
| 14734 | + end | |
| 14735 | + | |
| 14736 | + def self.from_json!(json) | |
| 14737 | + from_dynamic!(JSON.parse(json)) | |
| 14738 | + end | |
| 14739 | + | |
| 14740 | + def to_dynamic | |
| 14741 | + { | |
| 14742 | + } | |
| 14743 | + end | |
| 14744 | + | |
| 14745 | + def to_json(options = nil) | |
| 14746 | + JSON.generate(to_dynamic, options) | |
| 14747 | + end | |
| 14748 | +end | |
| 14749 | + | |
| 14750 | +class UnionToDict < Dry::Struct | |
| 14751 | + attribute :double, Types::Double.optional | |
| 14752 | + attribute :to_dict, ToDict.optional | |
| 14753 | + | |
| 14754 | + def self.from_dynamic!(d) | |
| 14755 | + if schema.key(:double).type.right.valid? d | |
| 14756 | + return new(double: d, to_dict: nil) | |
| 14757 | + end | |
| 14758 | + begin | |
| 14759 | + value = ToDict.from_dynamic!(d) | |
| 14760 | + if schema.key(:to_dict).type.right.valid? value | |
| 14761 | + return new(to_dict: value, double: nil) | |
| 14762 | + end | |
| 14763 | + rescue | |
| 14764 | + end | |
| 14765 | + raise "Invalid union" | |
| 14766 | + end | |
| 14767 | + | |
| 14768 | + def self.from_json!(json) | |
| 14769 | + from_dynamic!(JSON.parse(json)) | |
| 14770 | + end | |
| 14771 | + | |
| 14772 | + def to_dynamic | |
| 14773 | + if double != nil | |
| 14774 | + double | |
| 14775 | + elsif to_dict != nil | |
| 14776 | + to_dict.to_dynamic | |
| 14777 | + end | |
| 14778 | + end | |
| 14779 | + | |
| 14780 | + def to_json(options = nil) | |
| 14781 | + JSON.generate(to_dynamic, options) | |
| 14782 | + end | |
| 14783 | +end | |
| 14784 | + | |
| 14614 | 14785 | class ToString < Dry::Struct |
| 14615 | 14786 | |
| 14616 | 14787 | def self.from_dynamic!(d) |
| @@ -18145,6 +18316,63 @@ class UnionUnionUnion < Dry::Struct | ||
| 18145 | 18316 | end |
| 18146 | 18317 | end |
| 18147 | 18318 | |
| 18319 | +class UnmarshalJSON < Dry::Struct | |
| 18320 | + | |
| 18321 | + def self.from_dynamic!(d) | |
| 18322 | + d = Types::Hash[d] | |
| 18323 | + new( | |
| 18324 | + ) | |
| 18325 | + end | |
| 18326 | + | |
| 18327 | + def self.from_json!(json) | |
| 18328 | + from_dynamic!(JSON.parse(json)) | |
| 18329 | + end | |
| 18330 | + | |
| 18331 | + def to_dynamic | |
| 18332 | + { | |
| 18333 | + } | |
| 18334 | + end | |
| 18335 | + | |
| 18336 | + def to_json(options = nil) | |
| 18337 | + JSON.generate(to_dynamic, options) | |
| 18338 | + end | |
| 18339 | +end | |
| 18340 | + | |
| 18341 | +class UnionUnmarshalJSON < Dry::Struct | |
| 18342 | + attribute :double, Types::Double.optional | |
| 18343 | + attribute :unmarshal_json, UnmarshalJSON.optional | |
| 18344 | + | |
| 18345 | + def self.from_dynamic!(d) | |
| 18346 | + if schema.key(:double).type.right.valid? d | |
| 18347 | + return new(double: d, unmarshal_json: nil) | |
| 18348 | + end | |
| 18349 | + begin | |
| 18350 | + value = UnmarshalJSON.from_dynamic!(d) | |
| 18351 | + if schema.key(:unmarshal_json).type.right.valid? value | |
| 18352 | + return new(unmarshal_json: value, double: nil) | |
| 18353 | + end | |
| 18354 | + rescue | |
| 18355 | + end | |
| 18356 | + raise "Invalid union" | |
| 18357 | + end | |
| 18358 | + | |
| 18359 | + def self.from_json!(json) | |
| 18360 | + from_dynamic!(JSON.parse(json)) | |
| 18361 | + end | |
| 18362 | + | |
| 18363 | + def to_dynamic | |
| 18364 | + if double != nil | |
| 18365 | + double | |
| 18366 | + elsif unmarshal_json != nil | |
| 18367 | + unmarshal_json.to_dynamic | |
| 18368 | + end | |
| 18369 | + end | |
| 18370 | + | |
| 18371 | + def to_json(options = nil) | |
| 18372 | + JSON.generate(to_dynamic, options) | |
| 18373 | + end | |
| 18374 | +end | |
| 18375 | + | |
| 18148 | 18376 | class Unowned < Dry::Struct |
| 18149 | 18377 | |
| 18150 | 18378 | def self.from_dynamic!(d) |
| @@ -19408,6 +19636,7 @@ class TopLevel < Dry::Struct | ||
| 19408 | 19636 | attribute :format_exception, Types.Instance(UnionFormatException).optional |
| 19409 | 19637 | attribute :friend, Types.Instance(UnionFriend).optional |
| 19410 | 19638 | attribute :from, Types.Instance(UnionFrom).optional |
| 19639 | + attribute :from_dict, Types.Instance(UnionFromDict).optional | |
| 19411 | 19640 | attribute :from_json, Types.Instance(UnionFromJSON).optional |
| 19412 | 19641 | attribute :func, Types.Instance(UnionFunc).optional |
| 19413 | 19642 | attribute :function, Types.Instance(UnionFunction).optional |
| @@ -19469,6 +19698,7 @@ class TopLevel < Dry::Struct | ||
| 19469 | 19698 | attribute :long, Types.Instance(UnionLong).optional |
| 19470 | 19699 | attribute :map, Types.Instance(UnionMap).optional |
| 19471 | 19700 | attribute :map_entry, Types.Instance(UnionMapEntry).optional |
| 19701 | + attribute :marshal_json, Types.Instance(UnionMarshalJSON).optional | |
| 19472 | 19702 | attribute :metadata_property_handling, Types.Instance(UnionMetadataPropertyHandling).optional |
| 19473 | 19703 | attribute :top_level_module, Types.Instance(UnionModule).optional |
| 19474 | 19704 | attribute :mutable, Types.Instance(UnionMutable).optional |
| @@ -19583,6 +19813,7 @@ class TopLevel < Dry::Struct | ||
| 19583 | 19813 | attribute :time_only, Types.Instance(UnionTimeOnly).optional |
| 19584 | 19814 | attribute :time_only_converter, Types.Instance(UnionTimeOnlyConverter).optional |
| 19585 | 19815 | attribute :time_zone, Types.Instance(UnionTimeZone).optional |
| 19816 | + attribute :to_dict, Types.Instance(UnionToDict).optional | |
| 19586 | 19817 | attribute :top_level_to_json, Types.Instance(UnionToJSON).optional |
| 19587 | 19818 | attribute :top_level, Types.Instance(UnionTopLevel).optional |
| 19588 | 19819 | attribute :to_string, Types.Instance(UnionToString).optional |
| @@ -19602,6 +19833,7 @@ class TopLevel < Dry::Struct | ||
| 19602 | 19833 | attribute :unchecked, Types.Instance(UnionUnchecked).optional |
| 19603 | 19834 | attribute :undefined, Types.Instance(UnionUndefined).optional |
| 19604 | 19835 | attribute :union, Types.Instance(UnionUnionUnion).optional |
| 19836 | + attribute :unmarshal_json, Types.Instance(UnionUnmarshalJSON).optional | |
| 19605 | 19837 | attribute :unowned, Types.Instance(UnionUnowned).optional |
| 19606 | 19838 | attribute :unsafe, Types.Instance(UnionUnsafe).optional |
| 19607 | 19839 | attribute :unsigned, Types.Instance(UnionUnsigned).optional |
| @@ -19751,6 +19983,7 @@ class TopLevel < Dry::Struct | ||
| 19751 | 19983 | format_exception: d.key?("FormatException") ? UnionFormatException.from_dynamic!(d["FormatException"]) : nil, |
| 19752 | 19984 | friend: d.key?("friend") ? UnionFriend.from_dynamic!(d["friend"]) : nil, |
| 19753 | 19985 | from: d.key?("from") ? UnionFrom.from_dynamic!(d["from"]) : nil, |
| 19986 | + from_dict: d.key?("from_dict") ? UnionFromDict.from_dynamic!(d["from_dict"]) : nil, | |
| 19754 | 19987 | from_json: d.key?("from_json") ? UnionFromJSON.from_dynamic!(d["from_json"]) : nil, |
| 19755 | 19988 | func: d.key?("func") ? UnionFunc.from_dynamic!(d["func"]) : nil, |
| 19756 | 19989 | function: d.key?("function") ? UnionFunction.from_dynamic!(d["function"]) : nil, |
| @@ -19812,6 +20045,7 @@ class TopLevel < Dry::Struct | ||
| 19812 | 20045 | long: d.key?("long") ? UnionLong.from_dynamic!(d["long"]) : nil, |
| 19813 | 20046 | map: d.key?("map") ? UnionMap.from_dynamic!(d["map"]) : nil, |
| 19814 | 20047 | map_entry: d.key?("MapEntry") ? UnionMapEntry.from_dynamic!(d["MapEntry"]) : nil, |
| 20048 | + marshal_json: d.key?("MarshalJSON") ? UnionMarshalJSON.from_dynamic!(d["MarshalJSON"]) : nil, | |
| 19815 | 20049 | metadata_property_handling: d.key?("metadata_property_handling") ? UnionMetadataPropertyHandling.from_dynamic!(d["metadata_property_handling"]) : nil, |
| 19816 | 20050 | top_level_module: d.key?("module") ? UnionModule.from_dynamic!(d["module"]) : nil, |
| 19817 | 20051 | mutable: d.key?("mutable") ? UnionMutable.from_dynamic!(d["mutable"]) : nil, |
| @@ -19926,6 +20160,7 @@ class TopLevel < Dry::Struct | ||
| 19926 | 20160 | time_only: d.key?("TimeOnly") ? UnionTimeOnly.from_dynamic!(d["TimeOnly"]) : nil, |
| 19927 | 20161 | time_only_converter: d.key?("TimeOnlyConverter") ? UnionTimeOnlyConverter.from_dynamic!(d["TimeOnlyConverter"]) : nil, |
| 19928 | 20162 | time_zone: d.key?("TimeZone") ? UnionTimeZone.from_dynamic!(d["TimeZone"]) : nil, |
| 20163 | + to_dict: d.key?("to_dict") ? UnionToDict.from_dynamic!(d["to_dict"]) : nil, | |
| 19929 | 20164 | top_level_to_json: d.key?("to_json") ? UnionToJSON.from_dynamic!(d["to_json"]) : nil, |
| 19930 | 20165 | top_level: d.key?("top_level") ? UnionTopLevel.from_dynamic!(d["top_level"]) : nil, |
| 19931 | 20166 | to_string: d.key?("toString") ? UnionToString.from_dynamic!(d["toString"]) : nil, |
| @@ -19945,6 +20180,7 @@ class TopLevel < Dry::Struct | ||
| 19945 | 20180 | unchecked: d.key?("unchecked") ? UnionUnchecked.from_dynamic!(d["unchecked"]) : nil, |
| 19946 | 20181 | undefined: d.key?("undefined") ? UnionUndefined.from_dynamic!(d["undefined"]) : nil, |
| 19947 | 20182 | union: d.key?("union") ? UnionUnionUnion.from_dynamic!(d["union"]) : nil, |
| 20183 | + unmarshal_json: d.key?("UnmarshalJSON") ? UnionUnmarshalJSON.from_dynamic!(d["UnmarshalJSON"]) : nil, | |
| 19948 | 20184 | unowned: d.key?("unowned") ? UnionUnowned.from_dynamic!(d["unowned"]) : nil, |
| 19949 | 20185 | unsafe: d.key?("unsafe") ? UnionUnsafe.from_dynamic!(d["unsafe"]) : nil, |
| 19950 | 20186 | unsigned: d.key?("unsigned") ? UnionUnsigned.from_dynamic!(d["unsigned"]) : nil, |
| @@ -20099,6 +20335,7 @@ class TopLevel < Dry::Struct | ||
| 20099 | 20335 | "FormatException" => format_exception&.to_dynamic, |
| 20100 | 20336 | "friend" => friend&.to_dynamic, |
| 20101 | 20337 | "from" => from&.to_dynamic, |
| 20338 | + "from_dict" => from_dict&.to_dynamic, | |
| 20102 | 20339 | "from_json" => from_json&.to_dynamic, |
| 20103 | 20340 | "func" => func&.to_dynamic, |
| 20104 | 20341 | "function" => function&.to_dynamic, |
| @@ -20160,6 +20397,7 @@ class TopLevel < Dry::Struct | ||
| 20160 | 20397 | "long" => long&.to_dynamic, |
| 20161 | 20398 | "map" => map&.to_dynamic, |
| 20162 | 20399 | "MapEntry" => map_entry&.to_dynamic, |
| 20400 | + "MarshalJSON" => marshal_json&.to_dynamic, | |
| 20163 | 20401 | "metadata_property_handling" => metadata_property_handling&.to_dynamic, |
| 20164 | 20402 | "module" => top_level_module&.to_dynamic, |
| 20165 | 20403 | "mutable" => mutable&.to_dynamic, |
| @@ -20274,6 +20512,7 @@ class TopLevel < Dry::Struct | ||
| 20274 | 20512 | "TimeOnly" => time_only&.to_dynamic, |
| 20275 | 20513 | "TimeOnlyConverter" => time_only_converter&.to_dynamic, |
| 20276 | 20514 | "TimeZone" => time_zone&.to_dynamic, |
| 20515 | + "to_dict" => to_dict&.to_dynamic, | |
| 20277 | 20516 | "to_json" => top_level_to_json&.to_dynamic, |
| 20278 | 20517 | "top_level" => top_level&.to_dynamic, |
| 20279 | 20518 | "toString" => to_string&.to_dynamic, |
| @@ -20293,6 +20532,7 @@ class TopLevel < Dry::Struct | ||
| 20293 | 20532 | "unchecked" => unchecked&.to_dynamic, |
| 20294 | 20533 | "undefined" => undefined&.to_dynamic, |
| 20295 | 20534 | "union" => union&.to_dynamic, |
| 20535 | + "UnmarshalJSON" => unmarshal_json&.to_dynamic, | |
| 20296 | 20536 | "unowned" => unowned&.to_dynamic, |
| 20297 | 20537 | "unsafe" => unsafe&.to_dynamic, |
| 20298 | 20538 | "unsigned" => unsigned&.to_dynamic, |
Mschema-rubydefault / TopLevel.rb+240 −0
| @@ -5947,6 +5947,63 @@ class UnionFrom < Dry::Struct | ||
| 5947 | 5947 | end |
| 5948 | 5948 | end |
| 5949 | 5949 | |
| 5950 | +class FromDict < Dry::Struct | |
| 5951 | + | |
| 5952 | + def self.from_dynamic!(d) | |
| 5953 | + d = Types::Hash[d] | |
| 5954 | + new( | |
| 5955 | + ) | |
| 5956 | + end | |
| 5957 | + | |
| 5958 | + def self.from_json!(json) | |
| 5959 | + from_dynamic!(JSON.parse(json)) | |
| 5960 | + end | |
| 5961 | + | |
| 5962 | + def to_dynamic | |
| 5963 | + { | |
| 5964 | + } | |
| 5965 | + end | |
| 5966 | + | |
| 5967 | + def to_json(options = nil) | |
| 5968 | + JSON.generate(to_dynamic, options) | |
| 5969 | + end | |
| 5970 | +end | |
| 5971 | + | |
| 5972 | +class UnionFromDict < Dry::Struct | |
| 5973 | + attribute :double, Types::Double.optional | |
| 5974 | + attribute :from_dict, FromDict.optional | |
| 5975 | + | |
| 5976 | + def self.from_dynamic!(d) | |
| 5977 | + if schema.key(:double).type.right.valid? d | |
| 5978 | + return new(double: d, from_dict: nil) | |
| 5979 | + end | |
| 5980 | + begin | |
| 5981 | + value = FromDict.from_dynamic!(d) | |
| 5982 | + if schema.key(:from_dict).type.right.valid? value | |
| 5983 | + return new(from_dict: value, double: nil) | |
| 5984 | + end | |
| 5985 | + rescue | |
| 5986 | + end | |
| 5987 | + raise "Invalid union" | |
| 5988 | + end | |
| 5989 | + | |
| 5990 | + def self.from_json!(json) | |
| 5991 | + from_dynamic!(JSON.parse(json)) | |
| 5992 | + end | |
| 5993 | + | |
| 5994 | + def to_dynamic | |
| 5995 | + if double != nil | |
| 5996 | + double | |
| 5997 | + elsif from_dict != nil | |
| 5998 | + from_dict.to_dynamic | |
| 5999 | + end | |
| 6000 | + end | |
| 6001 | + | |
| 6002 | + def to_json(options = nil) | |
| 6003 | + JSON.generate(to_dynamic, options) | |
| 6004 | + end | |
| 6005 | +end | |
| 6006 | + | |
| 5950 | 6007 | class FromJSON < Dry::Struct |
| 5951 | 6008 | |
| 5952 | 6009 | def self.from_dynamic!(d) |
| @@ -9310,6 +9367,63 @@ class UnionMapEntry < Dry::Struct | ||
| 9310 | 9367 | end |
| 9311 | 9368 | end |
| 9312 | 9369 | |
| 9370 | +class MarshalJSON < Dry::Struct | |
| 9371 | + | |
| 9372 | + def self.from_dynamic!(d) | |
| 9373 | + d = Types::Hash[d] | |
| 9374 | + new( | |
| 9375 | + ) | |
| 9376 | + end | |
| 9377 | + | |
| 9378 | + def self.from_json!(json) | |
| 9379 | + from_dynamic!(JSON.parse(json)) | |
| 9380 | + end | |
| 9381 | + | |
| 9382 | + def to_dynamic | |
| 9383 | + { | |
| 9384 | + } | |
| 9385 | + end | |
| 9386 | + | |
| 9387 | + def to_json(options = nil) | |
| 9388 | + JSON.generate(to_dynamic, options) | |
| 9389 | + end | |
| 9390 | +end | |
| 9391 | + | |
| 9392 | +class UnionMarshalJSON < Dry::Struct | |
| 9393 | + attribute :double, Types::Double.optional | |
| 9394 | + attribute :marshal_json, MarshalJSON.optional | |
| 9395 | + | |
| 9396 | + def self.from_dynamic!(d) | |
| 9397 | + if schema.key(:double).type.right.valid? d | |
| 9398 | + return new(double: d, marshal_json: nil) | |
| 9399 | + end | |
| 9400 | + begin | |
| 9401 | + value = MarshalJSON.from_dynamic!(d) | |
| 9402 | + if schema.key(:marshal_json).type.right.valid? value | |
| 9403 | + return new(marshal_json: value, double: nil) | |
| 9404 | + end | |
| 9405 | + rescue | |
| 9406 | + end | |
| 9407 | + raise "Invalid union" | |
| 9408 | + end | |
| 9409 | + | |
| 9410 | + def self.from_json!(json) | |
| 9411 | + from_dynamic!(JSON.parse(json)) | |
| 9412 | + end | |
| 9413 | + | |
| 9414 | + def to_dynamic | |
| 9415 | + if double != nil | |
| 9416 | + double | |
| 9417 | + elsif marshal_json != nil | |
| 9418 | + marshal_json.to_dynamic | |
| 9419 | + end | |
| 9420 | + end | |
| 9421 | + | |
| 9422 | + def to_json(options = nil) | |
| 9423 | + JSON.generate(to_dynamic, options) | |
| 9424 | + end | |
| 9425 | +end | |
| 9426 | + | |
| 9313 | 9427 | class MetadataPropertyHandling < Dry::Struct |
| 9314 | 9428 | |
| 9315 | 9429 | def self.from_dynamic!(d) |
| @@ -14611,6 +14725,63 @@ class UnionTimeZone < Dry::Struct | ||
| 14611 | 14725 | end |
| 14612 | 14726 | end |
| 14613 | 14727 | |
| 14728 | +class ToDict < Dry::Struct | |
| 14729 | + | |
| 14730 | + def self.from_dynamic!(d) | |
| 14731 | + d = Types::Hash[d] | |
| 14732 | + new( | |
| 14733 | + ) | |
| 14734 | + end | |
| 14735 | + | |
| 14736 | + def self.from_json!(json) | |
| 14737 | + from_dynamic!(JSON.parse(json)) | |
| 14738 | + end | |
| 14739 | + | |
| 14740 | + def to_dynamic | |
| 14741 | + { | |
| 14742 | + } | |
| 14743 | + end | |
| 14744 | + | |
| 14745 | + def to_json(options = nil) | |
| 14746 | + JSON.generate(to_dynamic, options) | |
| 14747 | + end | |
| 14748 | +end | |
| 14749 | + | |
| 14750 | +class UnionToDict < Dry::Struct | |
| 14751 | + attribute :double, Types::Double.optional | |
| 14752 | + attribute :to_dict, ToDict.optional | |
| 14753 | + | |
| 14754 | + def self.from_dynamic!(d) | |
| 14755 | + if schema.key(:double).type.right.valid? d | |
| 14756 | + return new(double: d, to_dict: nil) | |
| 14757 | + end | |
| 14758 | + begin | |
| 14759 | + value = ToDict.from_dynamic!(d) | |
| 14760 | + if schema.key(:to_dict).type.right.valid? value | |
| 14761 | + return new(to_dict: value, double: nil) | |
| 14762 | + end | |
| 14763 | + rescue | |
| 14764 | + end | |
| 14765 | + raise "Invalid union" | |
| 14766 | + end | |
| 14767 | + | |
| 14768 | + def self.from_json!(json) | |
| 14769 | + from_dynamic!(JSON.parse(json)) | |
| 14770 | + end | |
| 14771 | + | |
| 14772 | + def to_dynamic | |
| 14773 | + if double != nil | |
| 14774 | + double | |
| 14775 | + elsif to_dict != nil | |
| 14776 | + to_dict.to_dynamic | |
| 14777 | + end | |
| 14778 | + end | |
| 14779 | + | |
| 14780 | + def to_json(options = nil) | |
| 14781 | + JSON.generate(to_dynamic, options) | |
| 14782 | + end | |
| 14783 | +end | |
| 14784 | + | |
| 14614 | 14785 | class ToString < Dry::Struct |
| 14615 | 14786 | |
| 14616 | 14787 | def self.from_dynamic!(d) |
| @@ -18145,6 +18316,63 @@ class UnionUnionUnion < Dry::Struct | ||
| 18145 | 18316 | end |
| 18146 | 18317 | end |
| 18147 | 18318 | |
| 18319 | +class UnmarshalJSON < Dry::Struct | |
| 18320 | + | |
| 18321 | + def self.from_dynamic!(d) | |
| 18322 | + d = Types::Hash[d] | |
| 18323 | + new( | |
| 18324 | + ) | |
| 18325 | + end | |
| 18326 | + | |
| 18327 | + def self.from_json!(json) | |
| 18328 | + from_dynamic!(JSON.parse(json)) | |
| 18329 | + end | |
| 18330 | + | |
| 18331 | + def to_dynamic | |
| 18332 | + { | |
| 18333 | + } | |
| 18334 | + end | |
| 18335 | + | |
| 18336 | + def to_json(options = nil) | |
| 18337 | + JSON.generate(to_dynamic, options) | |
| 18338 | + end | |
| 18339 | +end | |
| 18340 | + | |
| 18341 | +class UnionUnmarshalJSON < Dry::Struct | |
| 18342 | + attribute :double, Types::Double.optional | |
| 18343 | + attribute :unmarshal_json, UnmarshalJSON.optional | |
| 18344 | + | |
| 18345 | + def self.from_dynamic!(d) | |
| 18346 | + if schema.key(:double).type.right.valid? d | |
| 18347 | + return new(double: d, unmarshal_json: nil) | |
| 18348 | + end | |
| 18349 | + begin | |
| 18350 | + value = UnmarshalJSON.from_dynamic!(d) | |
| 18351 | + if schema.key(:unmarshal_json).type.right.valid? value | |
| 18352 | + return new(unmarshal_json: value, double: nil) | |
| 18353 | + end | |
| 18354 | + rescue | |
| 18355 | + end | |
| 18356 | + raise "Invalid union" | |
| 18357 | + end | |
| 18358 | + | |
| 18359 | + def self.from_json!(json) | |
| 18360 | + from_dynamic!(JSON.parse(json)) | |
| 18361 | + end | |
| 18362 | + | |
| 18363 | + def to_dynamic | |
| 18364 | + if double != nil | |
| 18365 | + double | |
| 18366 | + elsif unmarshal_json != nil | |
| 18367 | + unmarshal_json.to_dynamic | |
| 18368 | + end | |
| 18369 | + end | |
| 18370 | + | |
| 18371 | + def to_json(options = nil) | |
| 18372 | + JSON.generate(to_dynamic, options) | |
| 18373 | + end | |
| 18374 | +end | |
| 18375 | + | |
| 18148 | 18376 | class Unowned < Dry::Struct |
| 18149 | 18377 | |
| 18150 | 18378 | def self.from_dynamic!(d) |
| @@ -19408,6 +19636,7 @@ class TopLevel < Dry::Struct | ||
| 19408 | 19636 | attribute :format_exception, Types.Instance(UnionFormatException).optional |
| 19409 | 19637 | attribute :friend, Types.Instance(UnionFriend).optional |
| 19410 | 19638 | attribute :from, Types.Instance(UnionFrom).optional |
| 19639 | + attribute :from_dict, Types.Instance(UnionFromDict).optional | |
| 19411 | 19640 | attribute :from_json, Types.Instance(UnionFromJSON).optional |
| 19412 | 19641 | attribute :func, Types.Instance(UnionFunc).optional |
| 19413 | 19642 | attribute :function, Types.Instance(UnionFunction).optional |
| @@ -19469,6 +19698,7 @@ class TopLevel < Dry::Struct | ||
| 19469 | 19698 | attribute :long, Types.Instance(UnionLong).optional |
| 19470 | 19699 | attribute :map, Types.Instance(UnionMap).optional |
| 19471 | 19700 | attribute :map_entry, Types.Instance(UnionMapEntry).optional |
| 19701 | + attribute :marshal_json, Types.Instance(UnionMarshalJSON).optional | |
| 19472 | 19702 | attribute :metadata_property_handling, Types.Instance(UnionMetadataPropertyHandling).optional |
| 19473 | 19703 | attribute :top_level_module, Types.Instance(UnionModule).optional |
| 19474 | 19704 | attribute :mutable, Types.Instance(UnionMutable).optional |
| @@ -19583,6 +19813,7 @@ class TopLevel < Dry::Struct | ||
| 19583 | 19813 | attribute :time_only, Types.Instance(UnionTimeOnly).optional |
| 19584 | 19814 | attribute :time_only_converter, Types.Instance(UnionTimeOnlyConverter).optional |
| 19585 | 19815 | attribute :time_zone, Types.Instance(UnionTimeZone).optional |
| 19816 | + attribute :to_dict, Types.Instance(UnionToDict).optional | |
| 19586 | 19817 | attribute :top_level_to_json, Types.Instance(UnionToJSON).optional |
| 19587 | 19818 | attribute :top_level, Types.Instance(UnionTopLevel).optional |
| 19588 | 19819 | attribute :to_string, Types.Instance(UnionToString).optional |
| @@ -19602,6 +19833,7 @@ class TopLevel < Dry::Struct | ||
| 19602 | 19833 | attribute :unchecked, Types.Instance(UnionUnchecked).optional |
| 19603 | 19834 | attribute :undefined, Types.Instance(UnionUndefined).optional |
| 19604 | 19835 | attribute :union, Types.Instance(UnionUnionUnion).optional |
| 19836 | + attribute :unmarshal_json, Types.Instance(UnionUnmarshalJSON).optional | |
| 19605 | 19837 | attribute :unowned, Types.Instance(UnionUnowned).optional |
| 19606 | 19838 | attribute :unsafe, Types.Instance(UnionUnsafe).optional |
| 19607 | 19839 | attribute :unsigned, Types.Instance(UnionUnsigned).optional |
| @@ -19751,6 +19983,7 @@ class TopLevel < Dry::Struct | ||
| 19751 | 19983 | format_exception: d.key?("FormatException") ? UnionFormatException.from_dynamic!(d["FormatException"]) : nil, |
| 19752 | 19984 | friend: d.key?("friend") ? UnionFriend.from_dynamic!(d["friend"]) : nil, |
| 19753 | 19985 | from: d.key?("from") ? UnionFrom.from_dynamic!(d["from"]) : nil, |
| 19986 | + from_dict: d.key?("from_dict") ? UnionFromDict.from_dynamic!(d["from_dict"]) : nil, | |
| 19754 | 19987 | from_json: d.key?("from_json") ? UnionFromJSON.from_dynamic!(d["from_json"]) : nil, |
| 19755 | 19988 | func: d.key?("func") ? UnionFunc.from_dynamic!(d["func"]) : nil, |
| 19756 | 19989 | function: d.key?("function") ? UnionFunction.from_dynamic!(d["function"]) : nil, |
| @@ -19812,6 +20045,7 @@ class TopLevel < Dry::Struct | ||
| 19812 | 20045 | long: d.key?("long") ? UnionLong.from_dynamic!(d["long"]) : nil, |
| 19813 | 20046 | map: d.key?("map") ? UnionMap.from_dynamic!(d["map"]) : nil, |
| 19814 | 20047 | map_entry: d.key?("MapEntry") ? UnionMapEntry.from_dynamic!(d["MapEntry"]) : nil, |
| 20048 | + marshal_json: d.key?("MarshalJSON") ? UnionMarshalJSON.from_dynamic!(d["MarshalJSON"]) : nil, | |
| 19815 | 20049 | metadata_property_handling: d.key?("metadata_property_handling") ? UnionMetadataPropertyHandling.from_dynamic!(d["metadata_property_handling"]) : nil, |
| 19816 | 20050 | top_level_module: d.key?("module") ? UnionModule.from_dynamic!(d["module"]) : nil, |
| 19817 | 20051 | mutable: d.key?("mutable") ? UnionMutable.from_dynamic!(d["mutable"]) : nil, |
| @@ -19926,6 +20160,7 @@ class TopLevel < Dry::Struct | ||
| 19926 | 20160 | time_only: d.key?("TimeOnly") ? UnionTimeOnly.from_dynamic!(d["TimeOnly"]) : nil, |
| 19927 | 20161 | time_only_converter: d.key?("TimeOnlyConverter") ? UnionTimeOnlyConverter.from_dynamic!(d["TimeOnlyConverter"]) : nil, |
| 19928 | 20162 | time_zone: d.key?("TimeZone") ? UnionTimeZone.from_dynamic!(d["TimeZone"]) : nil, |
| 20163 | + to_dict: d.key?("to_dict") ? UnionToDict.from_dynamic!(d["to_dict"]) : nil, | |
| 19929 | 20164 | top_level_to_json: d.key?("to_json") ? UnionToJSON.from_dynamic!(d["to_json"]) : nil, |
| 19930 | 20165 | top_level: d.key?("top_level") ? UnionTopLevel.from_dynamic!(d["top_level"]) : nil, |
| 19931 | 20166 | to_string: d.key?("toString") ? UnionToString.from_dynamic!(d["toString"]) : nil, |
| @@ -19945,6 +20180,7 @@ class TopLevel < Dry::Struct | ||
| 19945 | 20180 | unchecked: d.key?("unchecked") ? UnionUnchecked.from_dynamic!(d["unchecked"]) : nil, |
| 19946 | 20181 | undefined: d.key?("undefined") ? UnionUndefined.from_dynamic!(d["undefined"]) : nil, |
| 19947 | 20182 | union: d.key?("union") ? UnionUnionUnion.from_dynamic!(d["union"]) : nil, |
| 20183 | + unmarshal_json: d.key?("UnmarshalJSON") ? UnionUnmarshalJSON.from_dynamic!(d["UnmarshalJSON"]) : nil, | |
| 19948 | 20184 | unowned: d.key?("unowned") ? UnionUnowned.from_dynamic!(d["unowned"]) : nil, |
| 19949 | 20185 | unsafe: d.key?("unsafe") ? UnionUnsafe.from_dynamic!(d["unsafe"]) : nil, |
| 19950 | 20186 | unsigned: d.key?("unsigned") ? UnionUnsigned.from_dynamic!(d["unsigned"]) : nil, |
| @@ -20099,6 +20335,7 @@ class TopLevel < Dry::Struct | ||
| 20099 | 20335 | "FormatException" => format_exception&.to_dynamic, |
| 20100 | 20336 | "friend" => friend&.to_dynamic, |
| 20101 | 20337 | "from" => from&.to_dynamic, |
| 20338 | + "from_dict" => from_dict&.to_dynamic, | |
| 20102 | 20339 | "from_json" => from_json&.to_dynamic, |
| 20103 | 20340 | "func" => func&.to_dynamic, |
| 20104 | 20341 | "function" => function&.to_dynamic, |
| @@ -20160,6 +20397,7 @@ class TopLevel < Dry::Struct | ||
| 20160 | 20397 | "long" => long&.to_dynamic, |
| 20161 | 20398 | "map" => map&.to_dynamic, |
| 20162 | 20399 | "MapEntry" => map_entry&.to_dynamic, |
| 20400 | + "MarshalJSON" => marshal_json&.to_dynamic, | |
| 20163 | 20401 | "metadata_property_handling" => metadata_property_handling&.to_dynamic, |
| 20164 | 20402 | "module" => top_level_module&.to_dynamic, |
| 20165 | 20403 | "mutable" => mutable&.to_dynamic, |
| @@ -20274,6 +20512,7 @@ class TopLevel < Dry::Struct | ||
| 20274 | 20512 | "TimeOnly" => time_only&.to_dynamic, |
| 20275 | 20513 | "TimeOnlyConverter" => time_only_converter&.to_dynamic, |
| 20276 | 20514 | "TimeZone" => time_zone&.to_dynamic, |
| 20515 | + "to_dict" => to_dict&.to_dynamic, | |
| 20277 | 20516 | "to_json" => top_level_to_json&.to_dynamic, |
| 20278 | 20517 | "top_level" => top_level&.to_dynamic, |
| 20279 | 20518 | "toString" => to_string&.to_dynamic, |
| @@ -20293,6 +20532,7 @@ class TopLevel < Dry::Struct | ||
| 20293 | 20532 | "unchecked" => unchecked&.to_dynamic, |
| 20294 | 20533 | "undefined" => undefined&.to_dynamic, |
| 20295 | 20534 | "union" => union&.to_dynamic, |
| 20535 | + "UnmarshalJSON" => unmarshal_json&.to_dynamic, | |
| 20296 | 20536 | "unowned" => unowned&.to_dynamic, |
| 20297 | 20537 | "unsafe" => unsafe&.to_dynamic, |
| 20298 | 20538 | "unsigned" => unsigned&.to_dynamic, |
Mschema-rustdefault / module_under_test.rs+58 −0
| @@ -304,6 +304,8 @@ pub struct TopLevel { | ||
| 304 | 304 | |
| 305 | 305 | pub from: Option<UnionFrom>, |
| 306 | 306 | |
| 307 | + pub from_dict: Option<UnionFromDict>, | |
| 308 | + | |
| 307 | 309 | pub from_json: Option<UnionFromJson>, |
| 308 | 310 | |
| 309 | 311 | pub func: Option<UnionFunc>, |
| @@ -449,6 +451,9 @@ pub struct TopLevel { | ||
| 449 | 451 | #[serde(rename = "MapEntry")] |
| 450 | 452 | pub map_entry: Option<UnionMapEntry>, |
| 451 | 453 | |
| 454 | + #[serde(rename = "MarshalJSON")] | |
| 455 | + pub marshal_json: Option<UnionMarshalJson>, | |
| 456 | + | |
| 452 | 457 | pub metadata_property_handling: Option<UnionMetadataPropertyHandling>, |
| 453 | 458 | |
| 454 | 459 | pub module: Option<UnionModule>, |
| @@ -715,6 +720,8 @@ pub struct TopLevel { | ||
| 715 | 720 | #[serde(rename = "TimeZone")] |
| 716 | 721 | pub time_zone: Option<UnionTimeZone>, |
| 717 | 722 | |
| 723 | + pub to_dict: Option<UnionToDict>, | |
| 724 | + | |
| 718 | 725 | pub to_json: Option<UnionToJson>, |
| 719 | 726 | |
| 720 | 727 | pub top_level: Option<UnionTopLevel>, |
| @@ -760,6 +767,9 @@ pub struct TopLevel { | ||
| 760 | 767 | #[serde(rename = "union")] |
| 761 | 768 | pub top_level_union: Option<UnionUnionUnion>, |
| 762 | 769 | |
| 770 | + #[serde(rename = "UnmarshalJSON")] | |
| 771 | + pub unmarshal_json: Option<UnionUnmarshalJson>, | |
| 772 | + | |
| 763 | 773 | pub unowned: Option<UnionUnowned>, |
| 764 | 774 | |
| 765 | 775 | #[serde(rename = "unsafe")] |
| @@ -2006,6 +2016,18 @@ pub enum UnionFrom { | ||
| 2006 | 2016 | pub struct From { |
| 2007 | 2017 | } |
| 2008 | 2018 | |
| 2019 | +#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 2020 | +#[serde(untagged)] | |
| 2021 | +pub enum UnionFromDict { | |
| 2022 | + Double(f64), | |
| 2023 | + | |
| 2024 | + FromDict(FromDict), | |
| 2025 | +} | |
| 2026 | + | |
| 2027 | +#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 2028 | +pub struct FromDict { | |
| 2029 | +} | |
| 2030 | + | |
| 2009 | 2031 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 2010 | 2032 | #[serde(untagged)] |
| 2011 | 2033 | pub enum UnionFromJson { |
| @@ -2714,6 +2736,18 @@ pub enum UnionMapEntry { | ||
| 2714 | 2736 | pub struct MapEntry { |
| 2715 | 2737 | } |
| 2716 | 2738 | |
| 2739 | +#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 2740 | +#[serde(untagged)] | |
| 2741 | +pub enum UnionMarshalJson { | |
| 2742 | + Double(f64), | |
| 2743 | + | |
| 2744 | + MarshalJson(MarshalJson), | |
| 2745 | +} | |
| 2746 | + | |
| 2747 | +#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 2748 | +pub struct MarshalJson { | |
| 2749 | +} | |
| 2750 | + | |
| 2717 | 2751 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 2718 | 2752 | #[serde(untagged)] |
| 2719 | 2753 | pub enum UnionMetadataPropertyHandling { |
| @@ -3998,6 +4032,18 @@ pub enum UnionTimeZone { | ||
| 3998 | 4032 | pub struct TimeZone { |
| 3999 | 4033 | } |
| 4000 | 4034 | |
| 4035 | +#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 4036 | +#[serde(untagged)] | |
| 4037 | +pub enum UnionToDict { | |
| 4038 | + Double(f64), | |
| 4039 | + | |
| 4040 | + ToDict(ToDict), | |
| 4041 | +} | |
| 4042 | + | |
| 4043 | +#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 4044 | +pub struct ToDict { | |
| 4045 | +} | |
| 4046 | + | |
| 4001 | 4047 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 4002 | 4048 | #[serde(untagged)] |
| 4003 | 4049 | pub enum UnionToJson { |
| @@ -4658,6 +4704,18 @@ pub enum UnionUndefined { | ||
| 4658 | 4704 | pub struct Undefined { |
| 4659 | 4705 | } |
| 4660 | 4706 | |
| 4707 | +#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 4708 | +#[serde(untagged)] | |
| 4709 | +pub enum UnionUnmarshalJson { | |
| 4710 | + Double(f64), | |
| 4711 | + | |
| 4712 | + UnmarshalJson(UnmarshalJson), | |
| 4713 | +} | |
| 4714 | + | |
| 4715 | +#[derive(Debug, Clone, Serialize, Deserialize)] | |
| 4716 | +pub struct UnmarshalJson { | |
| 4717 | +} | |
| 4718 | + | |
| 4661 | 4719 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 4662 | 4720 | #[serde(untagged)] |
| 4663 | 4721 | pub enum UnionUnowned { |
Mschema-schemadefault / TopLevel.schema+76 −0
| @@ -372,6 +372,9 @@ | ||
| 372 | 372 | "from": { |
| 373 | 373 | "$ref": "#/definitions/UnionFrom" |
| 374 | 374 | }, |
| 375 | + "from_dict": { | |
| 376 | + "$ref": "#/definitions/UnionFromDict" | |
| 377 | + }, | |
| 375 | 378 | "from_json": { |
| 376 | 379 | "$ref": "#/definitions/UnionFromJSON" |
| 377 | 380 | }, |
| @@ -555,6 +558,9 @@ | ||
| 555 | 558 | "MapEntry": { |
| 556 | 559 | "$ref": "#/definitions/UnionMapEntry" |
| 557 | 560 | }, |
| 561 | + "MarshalJSON": { | |
| 562 | + "$ref": "#/definitions/UnionMarshalJSON" | |
| 563 | + }, | |
| 558 | 564 | "metadata_property_handling": { |
| 559 | 565 | "$ref": "#/definitions/UnionMetadataPropertyHandling" |
| 560 | 566 | }, |
| @@ -897,6 +903,9 @@ | ||
| 897 | 903 | "TimeZone": { |
| 898 | 904 | "$ref": "#/definitions/UnionTimeZone" |
| 899 | 905 | }, |
| 906 | + "to_dict": { | |
| 907 | + "$ref": "#/definitions/UnionToDict" | |
| 908 | + }, | |
| 900 | 909 | "to_json": { |
| 901 | 910 | "$ref": "#/definitions/UnionToJSON" |
| 902 | 911 | }, |
| @@ -954,6 +963,9 @@ | ||
| 954 | 963 | "union": { |
| 955 | 964 | "$ref": "#/definitions/UnionUnionUnion" |
| 956 | 965 | }, |
| 966 | + "UnmarshalJSON": { | |
| 967 | + "$ref": "#/definitions/UnionUnmarshalJSON" | |
| 968 | + }, | |
| 957 | 969 | "unowned": { |
| 958 | 970 | "$ref": "#/definitions/UnionUnowned" |
| 959 | 971 | }, |
| @@ -1217,6 +1229,11 @@ | ||
| 1217 | 1229 | "additionalProperties": false, |
| 1218 | 1230 | "title": "MapEntry" |
| 1219 | 1231 | }, |
| 1232 | + "MarshalJSON": { | |
| 1233 | + "type": "object", | |
| 1234 | + "additionalProperties": false, | |
| 1235 | + "title": "MarshalJSON" | |
| 1236 | + }, | |
| 1220 | 1237 | "No": { |
| 1221 | 1238 | "type": "object", |
| 1222 | 1239 | "additionalProperties": false, |
| @@ -1352,6 +1369,11 @@ | ||
| 1352 | 1369 | "additionalProperties": false, |
| 1353 | 1370 | "title": "UUID" |
| 1354 | 1371 | }, |
| 1372 | + "UnmarshalJSON": { | |
| 1373 | + "type": "object", | |
| 1374 | + "additionalProperties": false, | |
| 1375 | + "title": "UnmarshalJSON" | |
| 1376 | + }, | |
| 1355 | 1377 | "UseSerializers": { |
| 1356 | 1378 | "type": "object", |
| 1357 | 1379 | "additionalProperties": false, |
| @@ -1877,6 +1899,11 @@ | ||
| 1877 | 1899 | "additionalProperties": false, |
| 1878 | 1900 | "title": "From" |
| 1879 | 1901 | }, |
| 1902 | + "FromDict": { | |
| 1903 | + "type": "object", | |
| 1904 | + "additionalProperties": false, | |
| 1905 | + "title": "FromDict" | |
| 1906 | + }, | |
| 1880 | 1907 | "FromJSON": { |
| 1881 | 1908 | "type": "object", |
| 1882 | 1909 | "additionalProperties": false, |
| @@ -2547,6 +2574,11 @@ | ||
| 2547 | 2574 | "additionalProperties": false, |
| 2548 | 2575 | "title": "ToString" |
| 2549 | 2576 | }, |
| 2577 | + "ToDict": { | |
| 2578 | + "type": "object", | |
| 2579 | + "additionalProperties": false, | |
| 2580 | + "title": "ToDict" | |
| 2581 | + }, | |
| 2550 | 2582 | "ToJSON": { |
| 2551 | 2583 | "type": "object", |
| 2552 | 2584 | "additionalProperties": false, |
| @@ -3135,6 +3167,17 @@ | ||
| 3135 | 3167 | ], |
| 3136 | 3168 | "title": "UnionMapEntry" |
| 3137 | 3169 | }, |
| 3170 | + "UnionMarshalJSON": { | |
| 3171 | + "anyOf": [ | |
| 3172 | + { | |
| 3173 | + "$ref": "#/definitions/MarshalJSON" | |
| 3174 | + }, | |
| 3175 | + { | |
| 3176 | + "type": "number" | |
| 3177 | + } | |
| 3178 | + ], | |
| 3179 | + "title": "UnionMarshalJSON" | |
| 3180 | + }, | |
| 3138 | 3181 | "UnionNO": { |
| 3139 | 3182 | "anyOf": [ |
| 3140 | 3183 | { |
| @@ -3432,6 +3475,17 @@ | ||
| 3432 | 3475 | ], |
| 3433 | 3476 | "title": "UnionUUID" |
| 3434 | 3477 | }, |
| 3478 | + "UnionUnmarshalJSON": { | |
| 3479 | + "anyOf": [ | |
| 3480 | + { | |
| 3481 | + "$ref": "#/definitions/UnmarshalJSON" | |
| 3482 | + }, | |
| 3483 | + { | |
| 3484 | + "type": "number" | |
| 3485 | + } | |
| 3486 | + ], | |
| 3487 | + "title": "UnionUnmarshalJSON" | |
| 3488 | + }, | |
| 3435 | 3489 | "UnionUseSerializers": { |
| 3436 | 3490 | "anyOf": [ |
| 3437 | 3491 | { |
| @@ -4587,6 +4641,17 @@ | ||
| 4587 | 4641 | ], |
| 4588 | 4642 | "title": "UnionFrom" |
| 4589 | 4643 | }, |
| 4644 | + "UnionFromDict": { | |
| 4645 | + "anyOf": [ | |
| 4646 | + { | |
| 4647 | + "$ref": "#/definitions/FromDict" | |
| 4648 | + }, | |
| 4649 | + { | |
| 4650 | + "type": "number" | |
| 4651 | + } | |
| 4652 | + ], | |
| 4653 | + "title": "UnionFromDict" | |
| 4654 | + }, | |
| 4590 | 4655 | "UnionFromJSON": { |
| 4591 | 4656 | "anyOf": [ |
| 4592 | 4657 | { |
| @@ -6061,6 +6126,17 @@ | ||
| 6061 | 6126 | ], |
| 6062 | 6127 | "title": "UnionToString" |
| 6063 | 6128 | }, |
| 6129 | + "UnionToDict": { | |
| 6130 | + "anyOf": [ | |
| 6131 | + { | |
| 6132 | + "$ref": "#/definitions/ToDict" | |
| 6133 | + }, | |
| 6134 | + { | |
| 6135 | + "type": "number" | |
| 6136 | + } | |
| 6137 | + ], | |
| 6138 | + "title": "UnionToDict" | |
| 6139 | + }, | |
| 6064 | 6140 | "UnionToJSON": { |
| 6065 | 6141 | "anyOf": [ |
| 6066 | 6142 | { |
Mschema-swiftdefault / quicktype.swift+300 −0
| @@ -129,6 +129,7 @@ struct TopLevel: Codable { | ||
| 129 | 129 | let formatException: UnionFormatException? |
| 130 | 130 | let friend: UnionFriend? |
| 131 | 131 | let from: UnionFrom? |
| 132 | + let fromDict: UnionFromDict? | |
| 132 | 133 | let fromJSON: UnionFromJSON? |
| 133 | 134 | let topLevelFunc: UnionFunc? |
| 134 | 135 | let function: UnionFunction? |
| @@ -190,6 +191,7 @@ struct TopLevel: Codable { | ||
| 190 | 191 | let long: UnionLong? |
| 191 | 192 | let map: UnionMap? |
| 192 | 193 | let mapEntry: UnionMapEntry? |
| 194 | + let marshalJSON: UnionMarshalJSON? | |
| 193 | 195 | let metadataPropertyHandling: UnionMetadataPropertyHandling? |
| 194 | 196 | let module: UnionModule? |
| 195 | 197 | let mutable: UnionMutable? |
| @@ -304,6 +306,7 @@ struct TopLevel: Codable { | ||
| 304 | 306 | let timeOnly: UnionTimeOnly? |
| 305 | 307 | let timeOnlyConverter: UnionTimeOnlyConverter? |
| 306 | 308 | let timeZone: UnionTimeZone? |
| 309 | + let toDict: UnionToDict? | |
| 307 | 310 | let toJSON: UnionToJSON? |
| 308 | 311 | let topLevel: UnionTopLevel? |
| 309 | 312 | let toString: UnionToString? |
| @@ -323,6 +326,7 @@ struct TopLevel: Codable { | ||
| 323 | 326 | let unchecked: UnionUnchecked? |
| 324 | 327 | let undefined: UnionUndefined? |
| 325 | 328 | let union: UnionUnionUnion? |
| 329 | + let unmarshalJSON: UnionUnmarshalJSON? | |
| 326 | 330 | let topLevelUnowned: UnionUnowned? |
| 327 | 331 | let unsafe: UnionUnsafe? |
| 328 | 332 | let unsigned: UnionUnsigned? |
| @@ -470,6 +474,7 @@ struct TopLevel: Codable { | ||
| 470 | 474 | case formatException = "FormatException" |
| 471 | 475 | case friend = "friend" |
| 472 | 476 | case from = "from" |
| 477 | + case fromDict = "from_dict" | |
| 473 | 478 | case fromJSON = "from_json" |
| 474 | 479 | case topLevelFunc = "func" |
| 475 | 480 | case function = "function" |
| @@ -531,6 +536,7 @@ struct TopLevel: Codable { | ||
| 531 | 536 | case long = "long" |
| 532 | 537 | case map = "map" |
| 533 | 538 | case mapEntry = "MapEntry" |
| 539 | + case marshalJSON = "MarshalJSON" | |
| 534 | 540 | case metadataPropertyHandling = "metadata_property_handling" |
| 535 | 541 | case module = "module" |
| 536 | 542 | case mutable = "mutable" |
| @@ -645,6 +651,7 @@ struct TopLevel: Codable { | ||
| 645 | 651 | case timeOnly = "TimeOnly" |
| 646 | 652 | case timeOnlyConverter = "TimeOnlyConverter" |
| 647 | 653 | case timeZone = "TimeZone" |
| 654 | + case toDict = "to_dict" | |
| 648 | 655 | case toJSON = "to_json" |
| 649 | 656 | case topLevel = "top_level" |
| 650 | 657 | case toString = "toString" |
| @@ -664,6 +671,7 @@ struct TopLevel: Codable { | ||
| 664 | 671 | case unchecked = "unchecked" |
| 665 | 672 | case undefined = "undefined" |
| 666 | 673 | case union = "union" |
| 674 | + case unmarshalJSON = "UnmarshalJSON" | |
| 667 | 675 | case topLevelUnowned = "unowned" |
| 668 | 676 | case unsafe = "unsafe" |
| 669 | 677 | case unsigned = "unsigned" |
| @@ -831,6 +839,7 @@ extension TopLevel { | ||
| 831 | 839 | formatException: UnionFormatException?? = nil, |
| 832 | 840 | friend: UnionFriend?? = nil, |
| 833 | 841 | from: UnionFrom?? = nil, |
| 842 | + fromDict: UnionFromDict?? = nil, | |
| 834 | 843 | fromJSON: UnionFromJSON?? = nil, |
| 835 | 844 | topLevelFunc: UnionFunc?? = nil, |
| 836 | 845 | function: UnionFunction?? = nil, |
| @@ -892,6 +901,7 @@ extension TopLevel { | ||
| 892 | 901 | long: UnionLong?? = nil, |
| 893 | 902 | map: UnionMap?? = nil, |
| 894 | 903 | mapEntry: UnionMapEntry?? = nil, |
| 904 | + marshalJSON: UnionMarshalJSON?? = nil, | |
| 895 | 905 | metadataPropertyHandling: UnionMetadataPropertyHandling?? = nil, |
| 896 | 906 | module: UnionModule?? = nil, |
| 897 | 907 | mutable: UnionMutable?? = nil, |
| @@ -1006,6 +1016,7 @@ extension TopLevel { | ||
| 1006 | 1016 | timeOnly: UnionTimeOnly?? = nil, |
| 1007 | 1017 | timeOnlyConverter: UnionTimeOnlyConverter?? = nil, |
| 1008 | 1018 | timeZone: UnionTimeZone?? = nil, |
| 1019 | + toDict: UnionToDict?? = nil, | |
| 1009 | 1020 | toJSON: UnionToJSON?? = nil, |
| 1010 | 1021 | topLevel: UnionTopLevel?? = nil, |
| 1011 | 1022 | toString: UnionToString?? = nil, |
| @@ -1025,6 +1036,7 @@ extension TopLevel { | ||
| 1025 | 1036 | unchecked: UnionUnchecked?? = nil, |
| 1026 | 1037 | undefined: UnionUndefined?? = nil, |
| 1027 | 1038 | union: UnionUnionUnion?? = nil, |
| 1039 | + unmarshalJSON: UnionUnmarshalJSON?? = nil, | |
| 1028 | 1040 | topLevelUnowned: UnionUnowned?? = nil, |
| 1029 | 1041 | unsafe: UnionUnsafe?? = nil, |
| 1030 | 1042 | unsigned: UnionUnsigned?? = nil, |
| @@ -1172,6 +1184,7 @@ extension TopLevel { | ||
| 1172 | 1184 | formatException: formatException ?? self.formatException, |
| 1173 | 1185 | friend: friend ?? self.friend, |
| 1174 | 1186 | from: from ?? self.from, |
| 1187 | + fromDict: fromDict ?? self.fromDict, | |
| 1175 | 1188 | fromJSON: fromJSON ?? self.fromJSON, |
| 1176 | 1189 | topLevelFunc: topLevelFunc ?? self.topLevelFunc, |
| 1177 | 1190 | function: function ?? self.function, |
| @@ -1233,6 +1246,7 @@ extension TopLevel { | ||
| 1233 | 1246 | long: long ?? self.long, |
| 1234 | 1247 | map: map ?? self.map, |
| 1235 | 1248 | mapEntry: mapEntry ?? self.mapEntry, |
| 1249 | + marshalJSON: marshalJSON ?? self.marshalJSON, | |
| 1236 | 1250 | metadataPropertyHandling: metadataPropertyHandling ?? self.metadataPropertyHandling, |
| 1237 | 1251 | module: module ?? self.module, |
| 1238 | 1252 | mutable: mutable ?? self.mutable, |
| @@ -1347,6 +1361,7 @@ extension TopLevel { | ||
| 1347 | 1361 | timeOnly: timeOnly ?? self.timeOnly, |
| 1348 | 1362 | timeOnlyConverter: timeOnlyConverter ?? self.timeOnlyConverter, |
| 1349 | 1363 | timeZone: timeZone ?? self.timeZone, |
| 1364 | + toDict: toDict ?? self.toDict, | |
| 1350 | 1365 | toJSON: toJSON ?? self.toJSON, |
| 1351 | 1366 | topLevel: topLevel ?? self.topLevel, |
| 1352 | 1367 | toString: toString ?? self.toString, |
| @@ -1366,6 +1381,7 @@ extension TopLevel { | ||
| 1366 | 1381 | unchecked: unchecked ?? self.unchecked, |
| 1367 | 1382 | undefined: undefined ?? self.undefined, |
| 1368 | 1383 | union: union ?? self.union, |
| 1384 | + unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON, | |
| 1369 | 1385 | topLevelUnowned: topLevelUnowned ?? self.topLevelUnowned, |
| 1370 | 1386 | unsafe: unsafe ?? self.unsafe, |
| 1371 | 1387 | unsigned: unsigned ?? self.unsigned, |
| @@ -7862,6 +7878,77 @@ extension From { | ||
| 7862 | 7878 | } |
| 7863 | 7879 | } |
| 7864 | 7880 | |
| 7881 | +enum UnionFromDict: Codable { | |
| 7882 | + case double(Double) | |
| 7883 | + case fromDict(FromDict) | |
| 7884 | + | |
| 7885 | + init(from decoder: Decoder) throws { | |
| 7886 | + let container = try decoder.singleValueContainer() | |
| 7887 | + if let x = try? container.decode(Double.self) { | |
| 7888 | + self = .double(x) | |
| 7889 | + return | |
| 7890 | + } | |
| 7891 | + if let x = try? container.decode(FromDict.self) { | |
| 7892 | + self = .fromDict(x) | |
| 7893 | + return | |
| 7894 | + } | |
| 7895 | + throw DecodingError.typeMismatch(UnionFromDict.self, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Wrong type for UnionFromDict")) | |
| 7896 | + } | |
| 7897 | + | |
| 7898 | + func encode(to encoder: Encoder) throws { | |
| 7899 | + var container = encoder.singleValueContainer() | |
| 7900 | + switch self { | |
| 7901 | + case .double(let x): | |
| 7902 | + try container.encode(x) | |
| 7903 | + case .fromDict(let x): | |
| 7904 | + try container.encode(x) | |
| 7905 | + } | |
| 7906 | + } | |
| 7907 | +} | |
| 7908 | + | |
| 7909 | +// MARK: - FromDict | |
| 7910 | +struct FromDict: Codable { | |
| 7911 | + private enum K: String, CodingKey { case unused } | |
| 7912 | + init(from decoder: Decoder) throws { | |
| 7913 | + _ = try decoder.container(keyedBy: K.self) | |
| 7914 | + } | |
| 7915 | + init() { | |
| 7916 | + } | |
| 7917 | +} | |
| 7918 | + | |
| 7919 | +// MARK: FromDict convenience initializers and mutators | |
| 7920 | + | |
| 7921 | +extension FromDict { | |
| 7922 | + init(data: Data) throws { | |
| 7923 | + self = try newJSONDecoder().decode(FromDict.self, from: data) | |
| 7924 | + } | |
| 7925 | + | |
| 7926 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 7927 | + guard let data = json.data(using: encoding) else { | |
| 7928 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 7929 | + } | |
| 7930 | + try self.init(data: data) | |
| 7931 | + } | |
| 7932 | + | |
| 7933 | + init(fromURL url: URL) throws { | |
| 7934 | + try self.init(data: try Data(contentsOf: url)) | |
| 7935 | + } | |
| 7936 | + | |
| 7937 | + func with( | |
| 7938 | + ) -> FromDict { | |
| 7939 | + return FromDict( | |
| 7940 | + ) | |
| 7941 | + } | |
| 7942 | + | |
| 7943 | + func jsonData() throws -> Data { | |
| 7944 | + return try newJSONEncoder().encode(self) | |
| 7945 | + } | |
| 7946 | + | |
| 7947 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 7948 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 7949 | + } | |
| 7950 | +} | |
| 7951 | + | |
| 7865 | 7952 | enum UnionFromJSON: Codable { |
| 7866 | 7953 | case double(Double) |
| 7867 | 7954 | case fromJSON(FromJSON) |
| @@ -11128,6 +11215,77 @@ extension MapEntry { | ||
| 11128 | 11215 | } |
| 11129 | 11216 | } |
| 11130 | 11217 | |
| 11218 | +enum UnionMarshalJSON: Codable { | |
| 11219 | + case double(Double) | |
| 11220 | + case marshalJSON(MarshalJSON) | |
| 11221 | + | |
| 11222 | + init(from decoder: Decoder) throws { | |
| 11223 | + let container = try decoder.singleValueContainer() | |
| 11224 | + if let x = try? container.decode(Double.self) { | |
| 11225 | + self = .double(x) | |
| 11226 | + return | |
| 11227 | + } | |
| 11228 | + if let x = try? container.decode(MarshalJSON.self) { | |
| 11229 | + self = .marshalJSON(x) | |
| 11230 | + return | |
| 11231 | + } | |
| 11232 | + throw DecodingError.typeMismatch(UnionMarshalJSON.self, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Wrong type for UnionMarshalJSON")) | |
| 11233 | + } | |
| 11234 | + | |
| 11235 | + func encode(to encoder: Encoder) throws { | |
| 11236 | + var container = encoder.singleValueContainer() | |
| 11237 | + switch self { | |
| 11238 | + case .double(let x): | |
| 11239 | + try container.encode(x) | |
| 11240 | + case .marshalJSON(let x): | |
| 11241 | + try container.encode(x) | |
| 11242 | + } | |
| 11243 | + } | |
| 11244 | +} | |
| 11245 | + | |
| 11246 | +// MARK: - MarshalJSON | |
| 11247 | +struct MarshalJSON: Codable { | |
| 11248 | + private enum K: String, CodingKey { case unused } | |
| 11249 | + init(from decoder: Decoder) throws { | |
| 11250 | + _ = try decoder.container(keyedBy: K.self) | |
| 11251 | + } | |
| 11252 | + init() { | |
| 11253 | + } | |
| 11254 | +} | |
| 11255 | + | |
| 11256 | +// MARK: MarshalJSON convenience initializers and mutators | |
| 11257 | + | |
| 11258 | +extension MarshalJSON { | |
| 11259 | + init(data: Data) throws { | |
| 11260 | + self = try newJSONDecoder().decode(MarshalJSON.self, from: data) | |
| 11261 | + } | |
| 11262 | + | |
| 11263 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 11264 | + guard let data = json.data(using: encoding) else { | |
| 11265 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 11266 | + } | |
| 11267 | + try self.init(data: data) | |
| 11268 | + } | |
| 11269 | + | |
| 11270 | + init(fromURL url: URL) throws { | |
| 11271 | + try self.init(data: try Data(contentsOf: url)) | |
| 11272 | + } | |
| 11273 | + | |
| 11274 | + func with( | |
| 11275 | + ) -> MarshalJSON { | |
| 11276 | + return MarshalJSON( | |
| 11277 | + ) | |
| 11278 | + } | |
| 11279 | + | |
| 11280 | + func jsonData() throws -> Data { | |
| 11281 | + return try newJSONEncoder().encode(self) | |
| 11282 | + } | |
| 11283 | + | |
| 11284 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 11285 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 11286 | + } | |
| 11287 | +} | |
| 11288 | + | |
| 11131 | 11289 | enum UnionMetadataPropertyHandling: Codable { |
| 11132 | 11290 | case double(Double) |
| 11133 | 11291 | case metadataPropertyHandling(MetadataPropertyHandling) |
| @@ -17447,6 +17605,77 @@ extension TimeZoneClass { | ||
| 17447 | 17605 | } |
| 17448 | 17606 | } |
| 17449 | 17607 | |
| 17608 | +enum UnionToDict: Codable { | |
| 17609 | + case double(Double) | |
| 17610 | + case toDict(ToDict) | |
| 17611 | + | |
| 17612 | + init(from decoder: Decoder) throws { | |
| 17613 | + let container = try decoder.singleValueContainer() | |
| 17614 | + if let x = try? container.decode(Double.self) { | |
| 17615 | + self = .double(x) | |
| 17616 | + return | |
| 17617 | + } | |
| 17618 | + if let x = try? container.decode(ToDict.self) { | |
| 17619 | + self = .toDict(x) | |
| 17620 | + return | |
| 17621 | + } | |
| 17622 | + throw DecodingError.typeMismatch(UnionToDict.self, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Wrong type for UnionToDict")) | |
| 17623 | + } | |
| 17624 | + | |
| 17625 | + func encode(to encoder: Encoder) throws { | |
| 17626 | + var container = encoder.singleValueContainer() | |
| 17627 | + switch self { | |
| 17628 | + case .double(let x): | |
| 17629 | + try container.encode(x) | |
| 17630 | + case .toDict(let x): | |
| 17631 | + try container.encode(x) | |
| 17632 | + } | |
| 17633 | + } | |
| 17634 | +} | |
| 17635 | + | |
| 17636 | +// MARK: - ToDict | |
| 17637 | +struct ToDict: Codable { | |
| 17638 | + private enum K: String, CodingKey { case unused } | |
| 17639 | + init(from decoder: Decoder) throws { | |
| 17640 | + _ = try decoder.container(keyedBy: K.self) | |
| 17641 | + } | |
| 17642 | + init() { | |
| 17643 | + } | |
| 17644 | +} | |
| 17645 | + | |
| 17646 | +// MARK: ToDict convenience initializers and mutators | |
| 17647 | + | |
| 17648 | +extension ToDict { | |
| 17649 | + init(data: Data) throws { | |
| 17650 | + self = try newJSONDecoder().decode(ToDict.self, from: data) | |
| 17651 | + } | |
| 17652 | + | |
| 17653 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 17654 | + guard let data = json.data(using: encoding) else { | |
| 17655 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 17656 | + } | |
| 17657 | + try self.init(data: data) | |
| 17658 | + } | |
| 17659 | + | |
| 17660 | + init(fromURL url: URL) throws { | |
| 17661 | + try self.init(data: try Data(contentsOf: url)) | |
| 17662 | + } | |
| 17663 | + | |
| 17664 | + func with( | |
| 17665 | + ) -> ToDict { | |
| 17666 | + return ToDict( | |
| 17667 | + ) | |
| 17668 | + } | |
| 17669 | + | |
| 17670 | + func jsonData() throws -> Data { | |
| 17671 | + return try newJSONEncoder().encode(self) | |
| 17672 | + } | |
| 17673 | + | |
| 17674 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 17675 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 17676 | + } | |
| 17677 | +} | |
| 17678 | + | |
| 17450 | 17679 | enum UnionToJSON: Codable { |
| 17451 | 17680 | case double(Double) |
| 17452 | 17681 | case toJSON(ToJSON) |
| @@ -24192,6 +24421,77 @@ extension Union { | ||
| 24192 | 24421 | } |
| 24193 | 24422 | } |
| 24194 | 24423 | |
| 24424 | +enum UnionUnmarshalJSON: Codable { | |
| 24425 | + case double(Double) | |
| 24426 | + case unmarshalJSON(UnmarshalJSON) | |
| 24427 | + | |
| 24428 | + init(from decoder: Decoder) throws { | |
| 24429 | + let container = try decoder.singleValueContainer() | |
| 24430 | + if let x = try? container.decode(Double.self) { | |
| 24431 | + self = .double(x) | |
| 24432 | + return | |
| 24433 | + } | |
| 24434 | + if let x = try? container.decode(UnmarshalJSON.self) { | |
| 24435 | + self = .unmarshalJSON(x) | |
| 24436 | + return | |
| 24437 | + } | |
| 24438 | + throw DecodingError.typeMismatch(UnionUnmarshalJSON.self, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Wrong type for UnionUnmarshalJSON")) | |
| 24439 | + } | |
| 24440 | + | |
| 24441 | + func encode(to encoder: Encoder) throws { | |
| 24442 | + var container = encoder.singleValueContainer() | |
| 24443 | + switch self { | |
| 24444 | + case .double(let x): | |
| 24445 | + try container.encode(x) | |
| 24446 | + case .unmarshalJSON(let x): | |
| 24447 | + try container.encode(x) | |
| 24448 | + } | |
| 24449 | + } | |
| 24450 | +} | |
| 24451 | + | |
| 24452 | +// MARK: - UnmarshalJSON | |
| 24453 | +struct UnmarshalJSON: Codable { | |
| 24454 | + private enum K: String, CodingKey { case unused } | |
| 24455 | + init(from decoder: Decoder) throws { | |
| 24456 | + _ = try decoder.container(keyedBy: K.self) | |
| 24457 | + } | |
| 24458 | + init() { | |
| 24459 | + } | |
| 24460 | +} | |
| 24461 | + | |
| 24462 | +// MARK: UnmarshalJSON convenience initializers and mutators | |
| 24463 | + | |
| 24464 | +extension UnmarshalJSON { | |
| 24465 | + init(data: Data) throws { | |
| 24466 | + self = try newJSONDecoder().decode(UnmarshalJSON.self, from: data) | |
| 24467 | + } | |
| 24468 | + | |
| 24469 | + init(_ json: String, using encoding: String.Encoding = .utf8) throws { | |
| 24470 | + guard let data = json.data(using: encoding) else { | |
| 24471 | + throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil) | |
| 24472 | + } | |
| 24473 | + try self.init(data: data) | |
| 24474 | + } | |
| 24475 | + | |
| 24476 | + init(fromURL url: URL) throws { | |
| 24477 | + try self.init(data: try Data(contentsOf: url)) | |
| 24478 | + } | |
| 24479 | + | |
| 24480 | + func with( | |
| 24481 | + ) -> UnmarshalJSON { | |
| 24482 | + return UnmarshalJSON( | |
| 24483 | + ) | |
| 24484 | + } | |
| 24485 | + | |
| 24486 | + func jsonData() throws -> Data { | |
| 24487 | + return try newJSONEncoder().encode(self) | |
| 24488 | + } | |
| 24489 | + | |
| 24490 | + func jsonString(encoding: String.Encoding = .utf8) throws -> String? { | |
| 24491 | + return String(data: try self.jsonData(), encoding: encoding) | |
| 24492 | + } | |
| 24493 | +} | |
| 24494 | + | |
| 24195 | 24495 | enum UnionUnsafe: Codable { |
| 24196 | 24496 | case double(Double) |
| 24197 | 24497 | case unsafe(Unsafe) |
Mschema-typescript-effect-schemadefault / TopLevel.ts+16 −0
| @@ -70,6 +70,9 @@ export class Unsafe extends S.Class<Unsafe>("Unsafe")(S.Struct({}).pipe(S.filter | ||
| 70 | 70 | export class Unowned extends S.Class<Unowned>("Unowned")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value))) |
| 71 | 71 | ) {} |
| 72 | 72 | |
| 73 | +export class UnmarshalJson extends S.Class<UnmarshalJson>("UnmarshalJson")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value))) | |
| 74 | +) {} | |
| 75 | + | |
| 73 | 76 | export class Union extends S.Class<Union>("Union")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value))) |
| 74 | 77 | ) {} |
| 75 | 78 | |
| @@ -151,6 +154,9 @@ export class ToString extends S.Class<ToString>("ToString")(S.Struct({}).pipe(S. | ||
| 151 | 154 | export class ToJson extends S.Class<ToJson>("ToJson")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value))) |
| 152 | 155 | ) {} |
| 153 | 156 | |
| 157 | +export class ToDict extends S.Class<ToDict>("ToDict")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value))) | |
| 158 | +) {} | |
| 159 | + | |
| 154 | 160 | export class TimeZone extends S.Class<TimeZone>("TimeZone")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value))) |
| 155 | 161 | ) {} |
| 156 | 162 | |
| @@ -484,6 +490,9 @@ export class Module extends S.Class<Module>("Module")(S.Struct({}).pipe(S.filter | ||
| 484 | 490 | export class MetadataPropertyHandling extends S.Class<MetadataPropertyHandling>("MetadataPropertyHandling")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value))) |
| 485 | 491 | ) {} |
| 486 | 492 | |
| 493 | +export class MarshalJson extends S.Class<MarshalJson>("MarshalJson")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value))) | |
| 494 | +) {} | |
| 495 | + | |
| 487 | 496 | export class MapEntry extends S.Class<MapEntry>("MapEntry")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value))) |
| 488 | 497 | ) {} |
| 489 | 498 | |
| @@ -670,6 +679,9 @@ export class Func extends S.Class<Func>("Func")(S.Struct({}).pipe(S.filter(value | ||
| 670 | 679 | export class FromJson extends S.Class<FromJson>("FromJson")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value))) |
| 671 | 680 | ) {} |
| 672 | 681 | |
| 682 | +export class FromDict extends S.Class<FromDict>("FromDict")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value))) | |
| 683 | +) {} | |
| 684 | + | |
| 673 | 685 | export class From extends S.Class<From>("From")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value))) |
| 674 | 686 | ) {} |
| 675 | 687 | |
| @@ -1138,6 +1150,7 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({ | ||
| 1138 | 1150 | "FormatException": S.optional(S.Union(S.Number, FormatException)), |
| 1139 | 1151 | "friend": S.optional(S.Union(S.Number, Friend)), |
| 1140 | 1152 | "from": S.optional(S.Union(S.Number, From)), |
| 1153 | + "from_dict": S.optional(S.Union(S.Number, FromDict)), | |
| 1141 | 1154 | "from_json": S.optional(S.Union(S.Number, FromJson)), |
| 1142 | 1155 | "func": S.optional(S.Union(S.Number, Func)), |
| 1143 | 1156 | "function": S.optional(S.Union(S.Number, Function)), |
| @@ -1199,6 +1212,7 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({ | ||
| 1199 | 1212 | "long": S.optional(S.Union(S.Number, Long)), |
| 1200 | 1213 | "map": S.optional(S.Union(S.Number, Map)), |
| 1201 | 1214 | "MapEntry": S.optional(S.Union(S.Number, MapEntry)), |
| 1215 | + "MarshalJSON": S.optional(S.Union(S.Number, MarshalJson)), | |
| 1202 | 1216 | "metadata_property_handling": S.optional(S.Union(S.Number, MetadataPropertyHandling)), |
| 1203 | 1217 | "module": S.optional(S.Union(S.Number, Module)), |
| 1204 | 1218 | "mutable": S.optional(S.Union(S.Number, Mutable)), |
| @@ -1313,6 +1327,7 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({ | ||
| 1313 | 1327 | "TimeOnly": S.optional(S.Union(S.Number, TimeOnly)), |
| 1314 | 1328 | "TimeOnlyConverter": S.optional(S.Union(S.Number, TimeOnlyConverter)), |
| 1315 | 1329 | "TimeZone": S.optional(S.Union(S.Number, TimeZone)), |
| 1330 | + "to_dict": S.optional(S.Union(S.Number, ToDict)), | |
| 1316 | 1331 | "to_json": S.optional(S.Union(S.Number, ToJson)), |
| 1317 | 1332 | "top_level": S.optional(S.Union(S.Number, TopLevelClass)), |
| 1318 | 1333 | "toString": S.optional(S.Union(S.Number, ToString)), |
| @@ -1332,6 +1347,7 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({ | ||
| 1332 | 1347 | "unchecked": S.optional(S.Union(S.Number, Unchecked)), |
| 1333 | 1348 | "undefined": S.optional(S.Union(S.Number, Undefined)), |
| 1334 | 1349 | "union": S.optional(S.Union(S.Number, Union)), |
| 1350 | + "UnmarshalJSON": S.optional(S.Union(S.Number, UnmarshalJson)), | |
| 1335 | 1351 | "unowned": S.optional(S.Union(S.Number, Unowned)), |
| 1336 | 1352 | "unsafe": S.optional(S.Union(S.Number, Unsafe)), |
| 1337 | 1353 | "unsigned": S.optional(S.Union(S.Number, Unsigned)), |
Mschema-typescript-zoddefault / TopLevel.ts+20 −0
| @@ -461,6 +461,10 @@ export const FromSchema = z.object({ | ||
| 461 | 461 | }); |
| 462 | 462 | export type From = z.infer<typeof FromSchema>; |
| 463 | 463 | |
| 464 | +export const FromDictSchema = z.object({ | |
| 465 | +}); | |
| 466 | +export type FromDict = z.infer<typeof FromDictSchema>; | |
| 467 | + | |
| 464 | 468 | export const FromJsonSchema = z.object({ |
| 465 | 469 | }); |
| 466 | 470 | export type FromJson = z.infer<typeof FromJsonSchema>; |
| @@ -709,6 +713,10 @@ export const MapEntrySchema = z.object({ | ||
| 709 | 713 | }); |
| 710 | 714 | export type MapEntry = z.infer<typeof MapEntrySchema>; |
| 711 | 715 | |
| 716 | +export const MarshalJsonSchema = z.object({ | |
| 717 | +}); | |
| 718 | +export type MarshalJson = z.infer<typeof MarshalJsonSchema>; | |
| 719 | + | |
| 712 | 720 | export const MetadataPropertyHandlingSchema = z.object({ |
| 713 | 721 | }); |
| 714 | 722 | export type MetadataPropertyHandling = z.infer<typeof MetadataPropertyHandlingSchema>; |
| @@ -1153,6 +1161,10 @@ export const TimeZoneSchema = z.object({ | ||
| 1153 | 1161 | }); |
| 1154 | 1162 | export type TimeZone = z.infer<typeof TimeZoneSchema>; |
| 1155 | 1163 | |
| 1164 | +export const ToDictSchema = z.object({ | |
| 1165 | +}); | |
| 1166 | +export type ToDict = z.infer<typeof ToDictSchema>; | |
| 1167 | + | |
| 1156 | 1168 | export const ToJsonSchema = z.object({ |
| 1157 | 1169 | }); |
| 1158 | 1170 | export type ToJson = z.infer<typeof ToJsonSchema>; |
| @@ -1261,6 +1273,10 @@ export const UnionSchema = z.object({ | ||
| 1261 | 1273 | }); |
| 1262 | 1274 | export type Union = z.infer<typeof UnionSchema>; |
| 1263 | 1275 | |
| 1276 | +export const UnmarshalJsonSchema = z.object({ | |
| 1277 | +}); | |
| 1278 | +export type UnmarshalJson = z.infer<typeof UnmarshalJsonSchema>; | |
| 1279 | + | |
| 1264 | 1280 | export const UnownedSchema = z.object({ |
| 1265 | 1281 | }); |
| 1266 | 1282 | export type Unowned = z.infer<typeof UnownedSchema>; |
| @@ -1476,6 +1492,7 @@ export const TopLevelSchema = z.preprocess(value => typeof value === "object" && | ||
| 1476 | 1492 | "FormatException": z.union([FormatExceptionSchema, z.number()]).optional(), |
| 1477 | 1493 | "friend": z.union([FriendSchema, z.number()]).optional(), |
| 1478 | 1494 | "from": z.union([FromSchema, z.number()]).optional(), |
| 1495 | + "from_dict": z.union([FromDictSchema, z.number()]).optional(), | |
| 1479 | 1496 | "from_json": z.union([FromJsonSchema, z.number()]).optional(), |
| 1480 | 1497 | "func": z.union([FuncSchema, z.number()]).optional(), |
| 1481 | 1498 | "function": z.union([FunctionSchema, z.number()]).optional(), |
| @@ -1537,6 +1554,7 @@ export const TopLevelSchema = z.preprocess(value => typeof value === "object" && | ||
| 1537 | 1554 | "long": z.union([LongSchema, z.number()]).optional(), |
| 1538 | 1555 | "map": z.union([MapSchema, z.number()]).optional(), |
| 1539 | 1556 | "MapEntry": z.union([MapEntrySchema, z.number()]).optional(), |
| 1557 | + "MarshalJSON": z.union([MarshalJsonSchema, z.number()]).optional(), | |
| 1540 | 1558 | "metadata_property_handling": z.union([MetadataPropertyHandlingSchema, z.number()]).optional(), |
| 1541 | 1559 | "module": z.union([ModuleSchema, z.number()]).optional(), |
| 1542 | 1560 | "mutable": z.union([MutableSchema, z.number()]).optional(), |
| @@ -1651,6 +1669,7 @@ export const TopLevelSchema = z.preprocess(value => typeof value === "object" && | ||
| 1651 | 1669 | "TimeOnly": z.union([TimeOnlySchema, z.number()]).optional(), |
| 1652 | 1670 | "TimeOnlyConverter": z.union([TimeOnlyConverterSchema, z.number()]).optional(), |
| 1653 | 1671 | "TimeZone": z.union([TimeZoneSchema, z.number()]).optional(), |
| 1672 | + "to_dict": z.union([ToDictSchema, z.number()]).optional(), | |
| 1654 | 1673 | "to_json": z.union([ToJsonSchema, z.number()]).optional(), |
| 1655 | 1674 | "top_level": z.union([TopLevelClassSchema, z.number()]).optional(), |
| 1656 | 1675 | "toString": z.union([ToStringSchema, z.number()]).optional(), |
| @@ -1670,6 +1689,7 @@ export const TopLevelSchema = z.preprocess(value => typeof value === "object" && | ||
| 1670 | 1689 | "unchecked": z.union([UncheckedSchema, z.number()]).optional(), |
| 1671 | 1690 | "undefined": z.union([UndefinedSchema, z.number()]).optional(), |
| 1672 | 1691 | "union": z.union([UnionSchema, z.number()]).optional(), |
| 1692 | + "UnmarshalJSON": z.union([UnmarshalJsonSchema, z.number()]).optional(), | |
| 1673 | 1693 | "unowned": z.union([UnownedSchema, z.number()]).optional(), |
| 1674 | 1694 | "unsafe": z.union([UnsafeSchema, z.number()]).optional(), |
| 1675 | 1695 | "unsigned": z.union([UnsignedSchema, z.number()]).optional(), |
Mschema-typescriptdefault / TopLevel.ts+18 −2
| @@ -130,6 +130,7 @@ export interface TopLevel { | ||
| 130 | 130 | FormatException?: UnionFormatException; |
| 131 | 131 | friend?: UnionFriend; |
| 132 | 132 | from?: UnionFrom; |
| 133 | + from_dict?: UnionFromDict; | |
| 133 | 134 | from_json?: UnionFromJSON; |
| 134 | 135 | func?: UnionFunc; |
| 135 | 136 | function?: UnionFunction; |
| @@ -191,6 +192,7 @@ export interface TopLevel { | ||
| 191 | 192 | long?: UnionLong; |
| 192 | 193 | map?: UnionMap; |
| 193 | 194 | MapEntry?: UnionMapEntry; |
| 195 | + MarshalJSON?: UnionMarshalJSON; | |
| 194 | 196 | metadata_property_handling?: UnionMetadataPropertyHandling; |
| 195 | 197 | module?: UnionModule; |
| 196 | 198 | mutable?: UnionMutable; |
| @@ -305,6 +307,7 @@ export interface TopLevel { | ||
| 305 | 307 | TimeOnly?: UnionTimeOnly; |
| 306 | 308 | TimeOnlyConverter?: UnionTimeOnlyConverter; |
| 307 | 309 | TimeZone?: UnionTimeZone; |
| 310 | + to_dict?: UnionToDict; | |
| 308 | 311 | to_json?: UnionToJSON; |
| 309 | 312 | top_level?: UnionTopLevel; |
| 310 | 313 | toString?: UnionToString; |
| @@ -324,6 +327,7 @@ export interface TopLevel { | ||
| 324 | 327 | unchecked?: UnionUnchecked; |
| 325 | 328 | undefined?: UnionUndefined; |
| 326 | 329 | union?: UnionUnionUnion; |
| 330 | + UnmarshalJSON?: UnionUnmarshalJSON; | |
| 327 | 331 | unowned?: UnionUnowned; |
| 328 | 332 | unsafe?: UnionUnsafe; |
| 329 | 333 | unsigned?: UnionUnsigned; |
| @@ -426,6 +430,8 @@ export type UnionLocale = object | number; | ||
| 426 | 430 | |
| 427 | 431 | export type UnionMapEntry = object | number; |
| 428 | 432 | |
| 433 | +export type UnionMarshalJSON = object | number; | |
| 434 | + | |
| 429 | 435 | export type UnionNO = object | number; |
| 430 | 436 | |
| 431 | 437 | export type UnionNSError = object | number; |
| @@ -480,6 +486,8 @@ export type UnionType = object | number; | ||
| 480 | 486 | |
| 481 | 487 | export type UnionUUID = object | number; |
| 482 | 488 | |
| 489 | +export type UnionUnmarshalJSON = object | number; | |
| 490 | + | |
| 483 | 491 | export type UnionUseSerializers = object | number; |
| 484 | 492 | |
| 485 | 493 | export type UnionUtf8JSONReader = object | number; |
| @@ -690,6 +698,8 @@ export type UnionFriend = object | number; | ||
| 690 | 698 | |
| 691 | 699 | export type UnionFrom = object | number; |
| 692 | 700 | |
| 701 | +export type UnionFromDict = object | number; | |
| 702 | + | |
| 693 | 703 | export type UnionFromJSON = object | number; |
| 694 | 704 | |
| 695 | 705 | export type UnionFunc = object | number; |
| @@ -958,6 +968,8 @@ export type UnionThrows = object | number; | ||
| 958 | 968 | |
| 959 | 969 | export type UnionToString = object | number; |
| 960 | 970 | |
| 971 | +export type UnionToDict = object | number; | |
| 972 | + | |
| 961 | 973 | export type UnionToJSON = object | number; |
| 962 | 974 | |
| 963 | 975 | export type UnionTopLevel = object | number; |
| @@ -1122,7 +1134,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 1122 | 1134 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 1123 | 1135 | return invalidValue(l(ref || "object"), val, key, parent); |
| 1124 | 1136 | } |
| 1125 | - const result: any = {}; | |
| 1137 | + const result: any = Object.create(null); | |
| 1126 | 1138 | Object.getOwnPropertyNames(props).forEach(key => { |
| 1127 | 1139 | const prop = props[key]; |
| 1128 | 1140 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -1133,7 +1145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 1133 | 1145 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 1134 | 1146 | } |
| 1135 | 1147 | }); |
| 1136 | - return result; | |
| 1148 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 1137 | 1149 | } |
| 1138 | 1150 | |
| 1139 | 1151 | if (typ === "any") return val; |
| @@ -1336,6 +1348,7 @@ const typeMap: any = { | ||
| 1336 | 1348 | { json: "FormatException", js: "FormatException", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1337 | 1349 | { json: "friend", js: "friend", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1338 | 1350 | { json: "from", js: "from", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1351 | + { json: "from_dict", js: "from_dict", typ: u(undefined, u(m("any"), 3.14)) }, | |
| 1339 | 1352 | { json: "from_json", js: "from_json", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1340 | 1353 | { json: "func", js: "func", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1341 | 1354 | { json: "function", js: "function", typ: u(undefined, u(m("any"), 3.14)) }, |
| @@ -1397,6 +1410,7 @@ const typeMap: any = { | ||
| 1397 | 1410 | { json: "long", js: "long", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1398 | 1411 | { json: "map", js: "map", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1399 | 1412 | { json: "MapEntry", js: "MapEntry", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1413 | + { json: "MarshalJSON", js: "MarshalJSON", typ: u(undefined, u(m("any"), 3.14)) }, | |
| 1400 | 1414 | { json: "metadata_property_handling", js: "metadata_property_handling", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1401 | 1415 | { json: "module", js: "module", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1402 | 1416 | { json: "mutable", js: "mutable", typ: u(undefined, u(m("any"), 3.14)) }, |
| @@ -1511,6 +1525,7 @@ const typeMap: any = { | ||
| 1511 | 1525 | { json: "TimeOnly", js: "TimeOnly", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1512 | 1526 | { json: "TimeOnlyConverter", js: "TimeOnlyConverter", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1513 | 1527 | { json: "TimeZone", js: "TimeZone", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1528 | + { json: "to_dict", js: "to_dict", typ: u(undefined, u(m("any"), 3.14)) }, | |
| 1514 | 1529 | { json: "to_json", js: "to_json", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1515 | 1530 | { json: "top_level", js: "top_level", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1516 | 1531 | { json: "toString", js: "toString", typ: u(undefined, u(m("any"), 3.14)) }, |
| @@ -1530,6 +1545,7 @@ const typeMap: any = { | ||
| 1530 | 1545 | { json: "unchecked", js: "unchecked", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1531 | 1546 | { json: "undefined", js: "undefined", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1532 | 1547 | { json: "union", js: "union", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1548 | + { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: u(undefined, u(m("any"), 3.14)) }, | |
| 1533 | 1549 | { json: "unowned", js: "unowned", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1534 | 1550 | { json: "unsafe", js: "unsafe", typ: u(undefined, u(m("any"), 3.14)) }, |
| 1535 | 1551 | { json: "unsigned", js: "unsigned", typ: u(undefined, u(m("any"), 3.14)) }, |
Test case
3 generated files · +6 −6test/inputs/schema/light.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/list.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/min-max-items.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 114 | 114 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 115 | 115 | return invalidValue(l(ref || "object"), val, key, parent); |
| 116 | 116 | } |
| 117 | - const result: any = {}; | |
| 117 | + const result: any = Object.create(null); | |
| 118 | 118 | Object.getOwnPropertyNames(props).forEach(key => { |
| 119 | 119 | const prop = props[key]; |
| 120 | 120 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 125 | 125 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 126 | 126 | } |
| 127 | 127 | }); |
| 128 | - return result; | |
| 128 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/minmax-integer.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/minmax.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/minmaxlength.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/multi-type-enum.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/mutually-recursive.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/nested-intersection-union.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/non-standard-ref.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/nullable-optional-one-of.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/object-type-required.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/optional-any.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/optional-const-ref.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 118 | 118 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 119 | 119 | return invalidValue(l(ref || "object"), val, key, parent); |
| 120 | 120 | } |
| 121 | - const result: any = {}; | |
| 121 | + const result: any = Object.create(null); | |
| 122 | 122 | Object.getOwnPropertyNames(props).forEach(key => { |
| 123 | 123 | const prop = props[key]; |
| 124 | 124 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -129,7 +129,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 129 | 129 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 130 | 130 | } |
| 131 | 131 | }); |
| 132 | - return result; | |
| 132 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 118 | 118 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 119 | 119 | return invalidValue(l(ref || "object"), val, key, parent); |
| 120 | 120 | } |
| 121 | - const result: any = {}; | |
| 121 | + const result: any = Object.create(null); | |
| 122 | 122 | Object.getOwnPropertyNames(props).forEach(key => { |
| 123 | 123 | const prop = props[key]; |
| 124 | 124 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -129,7 +129,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 129 | 129 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 130 | 130 | } |
| 131 | 131 | }); |
| 132 | - return result; | |
| 132 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/optional-constraints.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/optional-date-time.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/optional-enum.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/optional-property.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 107 | 107 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 108 | 108 | return invalidValue(l(ref || "object"), val, key, parent); |
| 109 | 109 | } |
| 110 | - const result: any = {}; | |
| 110 | + const result: any = Object.create(null); | |
| 111 | 111 | Object.getOwnPropertyNames(props).forEach(key => { |
| 112 | 112 | const prop = props[key]; |
| 113 | 113 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 118 | 118 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 119 | 119 | } |
| 120 | 120 | }); |
| 121 | - return result; | |
| 121 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 107 | 107 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 108 | 108 | return invalidValue(l(ref || "object"), val, key, parent); |
| 109 | 109 | } |
| 110 | - const result: any = {}; | |
| 110 | + const result: any = Object.create(null); | |
| 111 | 111 | Object.getOwnPropertyNames(props).forEach(key => { |
| 112 | 112 | const prop = props[key]; |
| 113 | 113 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 118 | 118 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 119 | 119 | } |
| 120 | 120 | }); |
| 121 | - return result; | |
| 121 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/pattern.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 115 | 115 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 116 | 116 | return invalidValue(l(ref || "object"), val, key, parent); |
| 117 | 117 | } |
| 118 | - const result: any = {}; | |
| 118 | + const result: any = Object.create(null); | |
| 119 | 119 | Object.getOwnPropertyNames(props).forEach(key => { |
| 120 | 120 | const prop = props[key]; |
| 121 | 121 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 127 | 127 | } |
| 128 | 128 | }); |
| 129 | - return result; | |
| 129 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/postman-collection.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 118 | 118 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 119 | 119 | return invalidValue(l(ref || "object"), val, key, parent); |
| 120 | 120 | } |
| 121 | - const result: any = {}; | |
| 121 | + const result: any = Object.create(null); | |
| 122 | 122 | Object.getOwnPropertyNames(props).forEach(key => { |
| 123 | 123 | const prop = props[key]; |
| 124 | 124 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -129,7 +129,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 129 | 129 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 130 | 130 | } |
| 131 | 131 | }); |
| 132 | - return result; | |
| 132 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 118 | 118 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 119 | 119 | return invalidValue(l(ref || "object"), val, key, parent); |
| 120 | 120 | } |
| 121 | - const result: any = {}; | |
| 121 | + const result: any = Object.create(null); | |
| 122 | 122 | Object.getOwnPropertyNames(props).forEach(key => { |
| 123 | 123 | const prop = props[key]; |
| 124 | 124 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -129,7 +129,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 129 | 129 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 130 | 130 | } |
| 131 | 131 | }); |
| 132 | - return result; | |
| 132 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/prefix-items.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/recursive-union-flattening.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 122 | 122 | return invalidValue(l(ref || "object"), val, key, parent); |
| 123 | 123 | } |
| 124 | - const result: any = {}; | |
| 124 | + const result: any = Object.create(null); | |
| 125 | 125 | Object.getOwnPropertyNames(props).forEach(key => { |
| 126 | 126 | const prop = props[key]; |
| 127 | 127 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 132 | 132 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 133 | 133 | } |
| 134 | 134 | }); |
| 135 | - return result; | |
| 135 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 122 | 122 | return invalidValue(l(ref || "object"), val, key, parent); |
| 123 | 123 | } |
| 124 | - const result: any = {}; | |
| 124 | + const result: any = Object.create(null); | |
| 125 | 125 | Object.getOwnPropertyNames(props).forEach(key => { |
| 126 | 126 | const prop = props[key]; |
| 127 | 127 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 132 | 132 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 133 | 133 | } |
| 134 | 134 | }); |
| 135 | - return result; | |
| 135 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/ref-id-files.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/ref-remote.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/renaming-bug.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -210,7 +210,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 210 | 210 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 211 | 211 | return invalidValue(l(ref || "object"), val, key, parent); |
| 212 | 212 | } |
| 213 | - const result: any = {}; | |
| 213 | + const result: any = Object.create(null); | |
| 214 | 214 | Object.getOwnPropertyNames(props).forEach(key => { |
| 215 | 215 | const prop = props[key]; |
| 216 | 216 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -221,7 +221,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 221 | 221 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 222 | 222 | } |
| 223 | 223 | }); |
| 224 | - return result; | |
| 224 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -195,7 +195,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 195 | 195 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 196 | 196 | return invalidValue(l(ref || "object"), val, key, parent); |
| 197 | 197 | } |
| 198 | - const result: any = {}; | |
| 198 | + const result: any = Object.create(null); | |
| 199 | 199 | Object.getOwnPropertyNames(props).forEach(key => { |
| 200 | 200 | const prop = props[key]; |
| 201 | 201 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -206,7 +206,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 206 | 206 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 207 | 207 | } |
| 208 | 208 | }); |
| 209 | - return result; | |
| 209 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/required-draft3.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/required-non-properties.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/required.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/rust-cycle-breaker-union.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/schema-constraints.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 109 | 109 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 110 | 110 | return invalidValue(l(ref || "object"), val, key, parent); |
| 111 | 111 | } |
| 112 | - const result: any = {}; | |
| 112 | + const result: any = Object.create(null); | |
| 113 | 113 | Object.getOwnPropertyNames(props).forEach(key => { |
| 114 | 114 | const prop = props[key]; |
| 115 | 115 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 120 | 120 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 121 | 121 | } |
| 122 | 122 | }); |
| 123 | - return result; | |
| 123 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/simple-ref.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/strict-optional.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/top-level-array.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 111 | 111 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 112 | 112 | return invalidValue(l(ref || "object"), val, key, parent); |
| 113 | 113 | } |
| 114 | - const result: any = {}; | |
| 114 | + const result: any = Object.create(null); | |
| 115 | 115 | Object.getOwnPropertyNames(props).forEach(key => { |
| 116 | 116 | const prop = props[key]; |
| 117 | 117 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -122,7 +122,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 122 | 122 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | - return result; | |
| 125 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/top-level-enum.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 105 | 105 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 106 | 106 | return invalidValue(l(ref || "object"), val, key, parent); |
| 107 | 107 | } |
| 108 | - const result: any = {}; | |
| 108 | + const result: any = Object.create(null); | |
| 109 | 109 | Object.getOwnPropertyNames(props).forEach(key => { |
| 110 | 110 | const prop = props[key]; |
| 111 | 111 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 117 | 117 | } |
| 118 | 118 | }); |
| 119 | - return result; | |
| 119 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/top-level-primitive-array.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 105 | 105 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 106 | 106 | return invalidValue(l(ref || "object"), val, key, parent); |
| 107 | 107 | } |
| 108 | - const result: any = {}; | |
| 108 | + const result: any = Object.create(null); | |
| 109 | 109 | Object.getOwnPropertyNames(props).forEach(key => { |
| 110 | 110 | const prop = props[key]; |
| 111 | 111 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 117 | 117 | } |
| 118 | 118 | }); |
| 119 | - return result; | |
| 119 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 105 | 105 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 106 | 106 | return invalidValue(l(ref || "object"), val, key, parent); |
| 107 | 107 | } |
| 108 | - const result: any = {}; | |
| 108 | + const result: any = Object.create(null); | |
| 109 | 109 | Object.getOwnPropertyNames(props).forEach(key => { |
| 110 | 110 | const prop = props[key]; |
| 111 | 111 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 116 | 116 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 117 | 117 | } |
| 118 | 118 | }); |
| 119 | - return result; | |
| 119 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/top-level-primitive.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 108 | 108 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 109 | 109 | return invalidValue(l(ref || "object"), val, key, parent); |
| 110 | 110 | } |
| 111 | - const result: any = {}; | |
| 111 | + const result: any = Object.create(null); | |
| 112 | 112 | Object.getOwnPropertyNames(props).forEach(key => { |
| 113 | 113 | const prop = props[key]; |
| 114 | 114 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 119 | 119 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 120 | 120 | } |
| 121 | 121 | }); |
| 122 | - return result; | |
| 122 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/tuple.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Test case
4 generated files · +15 −7test/inputs/schema/unevaluated-properties.schema
Mschema-elmdefault / QuickType.elm+9 −1
| @@ -88,7 +88,7 @@ encodeConfig x = | ||
| 88 | 88 | Jenc.object |
| 89 | 89 | [ ("closed", makeNullableEncoder encodeClosed x.closed) |
| 90 | 90 | , ("name", makeNullableEncoder Jenc.string x.name) |
| 91 | - , ("settings", makeNullableEncoder (Jenc.dict identity (Jenc.list encodeItem)) x.settings) | |
| 91 | + , ("settings", makeNullableEncoder (makeDictEncoder identity (Jenc.list encodeItem)) x.settings) | |
| 92 | 92 | ] |
| 93 | 93 | |
| 94 | 94 | closed : Jdec.Decoder Closed |
| @@ -138,6 +138,14 @@ encodeItem x = | ||
| 138 | 138 | |
| 139 | 139 | --- encoder helpers |
| 140 | 140 | |
| 141 | +makeDictEncoder : (String -> String) -> (a -> Jenc.Value) -> Dict String a -> Jenc.Value | |
| 142 | +makeDictEncoder f m r = | |
| 143 | + r | |
| 144 | + |> Dict.toList | |
| 145 | + |> List.map (\( x, y ) -> Jenc.encode 0 (Jenc.string (f x)) ++ ":" ++ Jenc.encode 0 (m y)) | |
| 146 | + |> String.join "," | |
| 147 | + |> (\str -> Jdec.decodeString Jdec.value ("{" ++ str ++ "}") |> Result.withDefault Jenc.null) | |
| 148 | + | |
| 141 | 149 | makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value |
| 142 | 150 | makeNullableEncoder f m = |
| 143 | 151 | case m of |
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 126 | 126 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 127 | 127 | return invalidValue(l(ref || "object"), val, key, parent); |
| 128 | 128 | } |
| 129 | - const result: any = {}; | |
| 129 | + const result: any = Object.create(null); | |
| 130 | 130 | Object.getOwnPropertyNames(props).forEach(key => { |
| 131 | 131 | const prop = props[key]; |
| 132 | 132 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 138 | 138 | } |
| 139 | 139 | }); |
| 140 | - return result; | |
| 140 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 124 | 124 | return invalidValue(l(ref || "object"), val, key, parent); |
| 125 | 125 | } |
| 126 | - const result: any = {}; | |
| 126 | + const result: any = Object.create(null); | |
| 127 | 127 | Object.getOwnPropertyNames(props).forEach(key => { |
| 128 | 128 | const prop = props[key]; |
| 129 | 129 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -134,7 +134,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 134 | 134 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 135 | 135 | } |
| 136 | 136 | }); |
| 137 | - return result; | |
| 137 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/unicode-codepoint-length.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/union-int-double.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 110 | 110 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 111 | 111 | return invalidValue(l(ref || "object"), val, key, parent); |
| 112 | 112 | } |
| 113 | - const result: any = {}; | |
| 113 | + const result: any = Object.create(null); | |
| 114 | 114 | Object.getOwnPropertyNames(props).forEach(key => { |
| 115 | 115 | const prop = props[key]; |
| 116 | 116 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 121 | 121 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 122 | 122 | } |
| 123 | 123 | }); |
| 124 | - return result; | |
| 124 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/union-list.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 113 | 113 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 114 | 114 | return invalidValue(l(ref || "object"), val, key, parent); |
| 115 | 115 | } |
| 116 | - const result: any = {}; | |
| 116 | + const result: any = Object.create(null); | |
| 117 | 117 | Object.getOwnPropertyNames(props).forEach(key => { |
| 118 | 118 | const prop = props[key]; |
| 119 | 119 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 124 | 124 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | - return result; | |
| 127 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/union.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 112 | 112 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 113 | 113 | return invalidValue(l(ref || "object"), val, key, parent); |
| 114 | 114 | } |
| 115 | - const result: any = {}; | |
| 115 | + const result: any = Object.create(null); | |
| 116 | 116 | Object.getOwnPropertyNames(props).forEach(key => { |
| 117 | 117 | const prop = props[key]; |
| 118 | 118 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 123 | 123 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 124 | 124 | } |
| 125 | 125 | }); |
| 126 | - return result; | |
| 126 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/uuid.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 118 | 118 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 119 | 119 | return invalidValue(l(ref || "object"), val, key, parent); |
| 120 | 120 | } |
| 121 | - const result: any = {}; | |
| 121 | + const result: any = Object.create(null); | |
| 122 | 122 | Object.getOwnPropertyNames(props).forEach(key => { |
| 123 | 123 | const prop = props[key]; |
| 124 | 124 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -129,7 +129,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 129 | 129 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 130 | 130 | } |
| 131 | 131 | }); |
| 132 | - return result; | |
| 132 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 117 | 117 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 118 | 118 | return invalidValue(l(ref || "object"), val, key, parent); |
| 119 | 119 | } |
| 120 | - const result: any = {}; | |
| 120 | + const result: any = Object.create(null); | |
| 121 | 121 | Object.getOwnPropertyNames(props).forEach(key => { |
| 122 | 122 | const prop = props[key]; |
| 123 | 123 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 128 | 128 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 129 | 129 | } |
| 130 | 130 | }); |
| 131 | - return result; | |
| 131 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (typ === "any") return val; |
Test case
3 generated files · +6 −6test/inputs/schema/vega-lite.schema
Mschema-flowdefault / TopLevel.js+2 −2
| @@ -6199,7 +6199,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 6199 | 6199 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 6200 | 6200 | return invalidValue(l(ref || "object"), val, key, parent); |
| 6201 | 6201 | } |
| 6202 | - const result: any = {}; | |
| 6202 | + const result: any = Object.create(null); | |
| 6203 | 6203 | Object.getOwnPropertyNames(props).forEach(key => { |
| 6204 | 6204 | const prop = props[key]; |
| 6205 | 6205 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -6210,7 +6210,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 6210 | 6210 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 6211 | 6211 | } |
| 6212 | 6212 | }); |
| 6213 | - return result; | |
| 6213 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 6214 | 6214 | } |
| 6215 | 6215 | |
| 6216 | 6216 | if (typ === "any") return val; |
Mschema-javascriptdefault / TopLevel.js+2 −2
| @@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 101 | 101 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 102 | 102 | return invalidValue(l(ref || "object"), val, key, parent); |
| 103 | 103 | } |
| 104 | - const result = {}; | |
| 104 | + const result = Object.create(null); | |
| 105 | 105 | Object.getOwnPropertyNames(props).forEach(key => { |
| 106 | 106 | const prop = props[key]; |
| 107 | 107 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 112 | 112 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 113 | 113 | } |
| 114 | 114 | }); |
| 115 | - return result; | |
| 115 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (typ === "any") return val; |
Mschema-typescriptdefault / TopLevel.ts+2 −2
| @@ -5956,7 +5956,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 5956 | 5956 | if (val === null || typeof val !== "object" || Array.isArray(val)) { |
| 5957 | 5957 | return invalidValue(l(ref || "object"), val, key, parent); |
| 5958 | 5958 | } |
| 5959 | - const result: any = {}; | |
| 5959 | + const result: any = Object.create(null); | |
| 5960 | 5960 | Object.getOwnPropertyNames(props).forEach(key => { |
| 5961 | 5961 | const prop = props[key]; |
| 5962 | 5962 | const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; |
| @@ -5967,7 +5967,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 5967 | 5967 | result[key] = transform(val[key], additional, getProps, key, ref); |
| 5968 | 5968 | } |
| 5969 | 5969 | }); |
| 5970 | - return result; | |
| 5970 | + return Object.setPrototypeOf(result, Object.prototype); | |
| 5971 | 5971 | } |
| 5972 | 5972 | |
| 5973 | 5973 | if (typ === "any") return val; |
No generated files match these filters.