Generated-output differences

quicktype output changed between the PR base and tested PR merge revisions.
← Back to the pull request
316test cases
1,231files differ
1,222modified
9new
0deleted
21,585changed lines
+12,464 −9,121insertions / deletions
Base df7e1659455882562e2da548ccde09768d85339a · PR merge 08743aae11b6c971ad5d5a9f8aabecb26e2755ba · Head d42d8eb782b4ee33a823f36eaaefff7e7330a9c7 · raw patch
Test case

test/inputs/graphql/github1.graphql

3 generated files · +6 −6
Mgraphql-flowdefault / TopLevel.js+2 −2
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 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
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 if (typ === "any") return val;
Mgraphql-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 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
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 if (typ === "any") return val;
Test case

test/inputs/graphql/github2.graphql

3 generated files · +6 −6
Mgraphql-flowdefault / TopLevel.js+2 −2
@@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
130130 if (val === null || typeof val !== "object" || Array.isArray(val)) {
131131 return invalidValue(l(ref || "object"), val, key, parent);
132132 }
133- const result: any = {};
133+ const result: any = Object.create(null);
134134 Object.getOwnPropertyNames(props).forEach(key => {
135135 const prop = props[key];
136136 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
141141 result[key] = transform(val[key], additional, getProps, key, ref);
142142 }
143143 });
144- return result;
144+ return Object.setPrototypeOf(result, Object.prototype);
145145 }
146146
147147 if (typ === "any") return val;
Mgraphql-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
130130 if (val === null || typeof val !== "object" || Array.isArray(val)) {
131131 return invalidValue(l(ref || "object"), val, key, parent);
132132 }
133- const result: any = {};
133+ const result: any = Object.create(null);
134134 Object.getOwnPropertyNames(props).forEach(key => {
135135 const prop = props[key];
136136 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
141141 result[key] = transform(val[key], additional, getProps, key, ref);
142142 }
143143 });
144- return result;
144+ return Object.setPrototypeOf(result, Object.prototype);
145145 }
146146
147147 if (typ === "any") return val;
Test case

test/inputs/graphql/github3.graphql

3 generated files · +6 −6
Mgraphql-flowdefault / TopLevel.js+2 −2
@@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
138138 if (val === null || typeof val !== "object" || Array.isArray(val)) {
139139 return invalidValue(l(ref || "object"), val, key, parent);
140140 }
141- const result: any = {};
141+ const result: any = Object.create(null);
142142 Object.getOwnPropertyNames(props).forEach(key => {
143143 const prop = props[key];
144144 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
149149 result[key] = transform(val[key], additional, getProps, key, ref);
150150 }
151151 });
152- return result;
152+ return Object.setPrototypeOf(result, Object.prototype);
153153 }
154154
155155 if (typ === "any") return val;
Mgraphql-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
135135 if (val === null || typeof val !== "object" || Array.isArray(val)) {
136136 return invalidValue(l(ref || "object"), val, key, parent);
137137 }
138- const result: any = {};
138+ const result: any = Object.create(null);
139139 Object.getOwnPropertyNames(props).forEach(key => {
140140 const prop = props[key];
141141 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
146146 result[key] = transform(val[key], additional, getProps, key, ref);
147147 }
148148 });
149- return result;
149+ return Object.setPrototypeOf(result, Object.prototype);
150150 }
151151
152152 if (typ === "any") return val;
Test case

test/inputs/graphql/github4.graphql

3 generated files · +6 −6
Mgraphql-flowdefault / TopLevel.js+2 −2
@@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
139139 if (val === null || typeof val !== "object" || Array.isArray(val)) {
140140 return invalidValue(l(ref || "object"), val, key, parent);
141141 }
142- const result: any = {};
142+ const result: any = Object.create(null);
143143 Object.getOwnPropertyNames(props).forEach(key => {
144144 const prop = props[key];
145145 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
150150 result[key] = transform(val[key], additional, getProps, key, ref);
151151 }
152152 });
153- return result;
153+ return Object.setPrototypeOf(result, Object.prototype);
154154 }
155155
156156 if (typ === "any") return val;
Mgraphql-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
136136 if (val === null || typeof val !== "object" || Array.isArray(val)) {
137137 return invalidValue(l(ref || "object"), val, key, parent);
138138 }
139- const result: any = {};
139+ const result: any = Object.create(null);
140140 Object.getOwnPropertyNames(props).forEach(key => {
141141 const prop = props[key];
142142 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
147147 result[key] = transform(val[key], additional, getProps, key, ref);
148148 }
149149 });
150- return result;
150+ return Object.setPrototypeOf(result, Object.prototype);
151151 }
152152
153153 if (typ === "any") return val;
Test case

test/inputs/graphql/github5.graphql

3 generated files · +6 −6
Mgraphql-flowdefault / TopLevel.js+2 −2
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 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
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 if (typ === "any") return val;
Mgraphql-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 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
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 if (typ === "any") return val;
Test case

test/inputs/graphql/github6.graphql

3 generated files · +6 −6
Mgraphql-flowdefault / TopLevel.js+2 −2
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 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
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 if (typ === "any") return val;
Mgraphql-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 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
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 if (typ === "any") return val;
Test case

test/inputs/graphql/github7.graphql

3 generated files · +6 −6
Mgraphql-flowdefault / TopLevel.js+2 −2
@@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
142142 if (val === null || typeof val !== "object" || Array.isArray(val)) {
143143 return invalidValue(l(ref || "object"), val, key, parent);
144144 }
145- const result: any = {};
145+ const result: any = Object.create(null);
146146 Object.getOwnPropertyNames(props).forEach(key => {
147147 const prop = props[key];
148148 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
153153 result[key] = transform(val[key], additional, getProps, key, ref);
154154 }
155155 });
156- return result;
156+ return Object.setPrototypeOf(result, Object.prototype);
157157 }
158158
159159 if (typ === "any") return val;
Mgraphql-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
142142 if (val === null || typeof val !== "object" || Array.isArray(val)) {
143143 return invalidValue(l(ref || "object"), val, key, parent);
144144 }
145- const result: any = {};
145+ const result: any = Object.create(null);
146146 Object.getOwnPropertyNames(props).forEach(key => {
147147 const prop = props[key];
148148 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
153153 result[key] = transform(val[key], additional, getProps, key, ref);
154154 }
155155 });
156- return result;
156+ return Object.setPrototypeOf(result, Object.prototype);
157157 }
158158
159159 if (typ === "any") return val;
Test case

test/inputs/graphql/github8.graphql

3 generated files · +6 −6
Mgraphql-flowdefault / TopLevel.js+2 −2
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 if (val === null || typeof val !== "object" || Array.isArray(val)) {
133133 return invalidValue(l(ref || "object"), val, key, parent);
134134 }
135- const result: any = {};
135+ const result: any = Object.create(null);
136136 Object.getOwnPropertyNames(props).forEach(key => {
137137 const prop = props[key];
138138 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
143143 result[key] = transform(val[key], additional, getProps, key, ref);
144144 }
145145 });
146- return result;
146+ return Object.setPrototypeOf(result, Object.prototype);
147147 }
148148
149149 if (typ === "any") return val;
Mgraphql-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
130130 if (val === null || typeof val !== "object" || Array.isArray(val)) {
131131 return invalidValue(l(ref || "object"), val, key, parent);
132132 }
133- const result: any = {};
133+ const result: any = Object.create(null);
134134 Object.getOwnPropertyNames(props).forEach(key => {
135135 const prop = props[key];
136136 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
141141 result[key] = transform(val[key], additional, getProps, key, ref);
142142 }
143143 });
144- return result;
144+ return Object.setPrototypeOf(result, Object.prototype);
145145 }
146146
147147 if (typ === "any") return val;
Test case

test/inputs/graphql/github9.graphql

3 generated files · +6 −6
Mgraphql-flowdefault / TopLevel.js+2 −2
@@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
139139 if (val === null || typeof val !== "object" || Array.isArray(val)) {
140140 return invalidValue(l(ref || "object"), val, key, parent);
141141 }
142- const result: any = {};
142+ const result: any = Object.create(null);
143143 Object.getOwnPropertyNames(props).forEach(key => {
144144 const prop = props[key];
145145 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
150150 result[key] = transform(val[key], additional, getProps, key, ref);
151151 }
152152 });
153- return result;
153+ return Object.setPrototypeOf(result, Object.prototype);
154154 }
155155
156156 if (typ === "any") return val;
Mgraphql-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
133133 if (val === null || typeof val !== "object" || Array.isArray(val)) {
134134 return invalidValue(l(ref || "object"), val, key, parent);
135135 }
136- const result: any = {};
136+ const result: any = Object.create(null);
137137 Object.getOwnPropertyNames(props).forEach(key => {
138138 const prop = props[key];
139139 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
144144 result[key] = transform(val[key], additional, getProps, key, ref);
145145 }
146146 });
147- return result;
147+ return Object.setPrototypeOf(result, Object.prototype);
148148 }
149149
150150 if (typ === "any") return val;
Test case

test/inputs/json/misc/00c36.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 if (val === null || typeof val !== "object" || Array.isArray(val)) {
136136 return invalidValue(l(ref || "object"), val, key, parent);
137137 }
138- const result: any = {};
138+ const result: any = Object.create(null);
139139 Object.getOwnPropertyNames(props).forEach(key => {
140140 const prop = props[key];
141141 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
146146 result[key] = transform(val[key], additional, getProps, key, ref);
147147 }
148148 });
149- return result;
149+ return Object.setPrototypeOf(result, Object.prototype);
150150 }
151151
152152 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
131131 if (val === null || typeof val !== "object" || Array.isArray(val)) {
132132 return invalidValue(l(ref || "object"), val, key, parent);
133133 }
134- const result: any = {};
134+ const result: any = Object.create(null);
135135 Object.getOwnPropertyNames(props).forEach(key => {
136136 const prop = props[key];
137137 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
142142 result[key] = transform(val[key], additional, getProps, key, ref);
143143 }
144144 });
145- return result;
145+ return Object.setPrototypeOf(result, Object.prototype);
146146 }
147147
148148 if (typ === "any") return val;
Test case

test/inputs/json/misc/00ec5.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -160,7 +160,7 @@ provider =
160160 encodeProvider : Provider -> Jenc.Value
161161 encodeProvider x =
162162 Jenc.object
163- [ ("properties", Jenc.dict identity encodeProperty x.properties)
163+ [ ("properties", makeDictEncoder identity encodeProperty x.properties)
164164 ]
165165
166166 property : Jdec.Decoder Property
@@ -303,6 +303,14 @@ encodeSchema x =
303303
304304 --- encoder helpers
305305
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+
306314 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
307315 makeNullableEncoder f m =
308316 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -174,7 +174,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
174174 if (val === null || typeof val !== "object" || Array.isArray(val)) {
175175 return invalidValue(l(ref || "object"), val, key, parent);
176176 }
177- const result: any = {};
177+ const result: any = Object.create(null);
178178 Object.getOwnPropertyNames(props).forEach(key => {
179179 const prop = props[key];
180180 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
185185 result[key] = transform(val[key], additional, getProps, key, ref);
186186 }
187187 });
188- return result;
188+ return Object.setPrototypeOf(result, Object.prototype);
189189 }
190190
191191 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export const Type = S.Literal(
523 "string",
@@ -56,7 +74,7 @@ export class Property extends S.Class<Property>("Property")({
5674 }) {}
5775
5876 export class Provider extends S.Class<Provider>("Provider")({
59- "properties": S.Record({ key: S.String, value: Property}),
77+ "properties": mapSchema(Property),
6078 }) {}
6179
6280 export class Definitions extends S.Class<Definitions>("Definitions")({
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -173,7 +173,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
173173 if (val === null || typeof val !== "object" || Array.isArray(val)) {
174174 return invalidValue(l(ref || "object"), val, key, parent);
175175 }
176- const result: any = {};
176+ const result: any = Object.create(null);
177177 Object.getOwnPropertyNames(props).forEach(key => {
178178 const prop = props[key];
179179 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
184184 result[key] = transform(val[key], additional, getProps, key, ref);
185185 }
186186 });
187- return result;
187+ return Object.setPrototypeOf(result, Object.prototype);
188188 }
189189
190190 if (typ === "any") return val;
Test case

test/inputs/json/misc/010b1.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 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
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/json/misc/016af.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/033b1.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
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+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,8 +1,26 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
523 "base": S.String,
624 "date": S.String.pipe(S.pattern(/^\d{4}-\d{2}-\d{2}$/)),
7- "rates": S.Record({ key: S.String, value: S.Number}),
25+ "rates": mapSchema(S.Number),
826 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/050b0.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -163,7 +163,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
163163 if (val === null || typeof val !== "object" || Array.isArray(val)) {
164164 return invalidValue(l(ref || "object"), val, key, parent);
165165 }
166- const result: any = {};
166+ const result: any = Object.create(null);
167167 Object.getOwnPropertyNames(props).forEach(key => {
168168 const prop = props[key];
169169 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
174174 result[key] = transform(val[key], additional, getProps, key, ref);
175175 }
176176 });
177- return result;
177+ return Object.setPrototypeOf(result, Object.prototype);
178178 }
179179
180180 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
147147 if (val === null || typeof val !== "object" || Array.isArray(val)) {
148148 return invalidValue(l(ref || "object"), val, key, parent);
149149 }
150- const result: any = {};
150+ const result: any = Object.create(null);
151151 Object.getOwnPropertyNames(props).forEach(key => {
152152 const prop = props[key];
153153 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
158158 result[key] = transform(val[key], additional, getProps, key, ref);
159159 }
160160 });
161- return result;
161+ return Object.setPrototypeOf(result, Object.prototype);
162162 }
163163
164164 if (typ === "any") return val;
Test case

test/inputs/json/misc/06bee.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 if (val === null || typeof val !== "object" || Array.isArray(val)) {
152152 return invalidValue(l(ref || "object"), val, key, parent);
153153 }
154- const result: any = {};
154+ const result: any = Object.create(null);
155155 Object.getOwnPropertyNames(props).forEach(key => {
156156 const prop = props[key];
157157 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
162162 result[key] = transform(val[key], additional, getProps, key, ref);
163163 }
164164 });
165- return result;
165+ return Object.setPrototypeOf(result, Object.prototype);
166166 }
167167
168168 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
142142 if (val === null || typeof val !== "object" || Array.isArray(val)) {
143143 return invalidValue(l(ref || "object"), val, key, parent);
144144 }
145- const result: any = {};
145+ const result: any = Object.create(null);
146146 Object.getOwnPropertyNames(props).forEach(key => {
147147 const prop = props[key];
148148 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
153153 result[key] = transform(val[key], additional, getProps, key, ref);
154154 }
155155 });
156- return result;
156+ return Object.setPrototypeOf(result, Object.prototype);
157157 }
158158
159159 if (typ === "any") return val;
Test case

test/inputs/json/misc/07540.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 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
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Test case

test/inputs/json/misc/0779f.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/07c75.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 if (val === null || typeof val !== "object" || Array.isArray(val)) {
133133 return invalidValue(l(ref || "object"), val, key, parent);
134134 }
135- const result: any = {};
135+ const result: any = Object.create(null);
136136 Object.getOwnPropertyNames(props).forEach(key => {
137137 const prop = props[key];
138138 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
143143 result[key] = transform(val[key], additional, getProps, key, ref);
144144 }
145145 });
146- return result;
146+ return Object.setPrototypeOf(result, Object.prototype);
147147 }
148148
149149 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
132132 if (val === null || typeof val !== "object" || Array.isArray(val)) {
133133 return invalidValue(l(ref || "object"), val, key, parent);
134134 }
135- const result: any = {};
135+ const result: any = Object.create(null);
136136 Object.getOwnPropertyNames(props).forEach(key => {
137137 const prop = props[key];
138138 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
143143 result[key] = transform(val[key], additional, getProps, key, ref);
144144 }
145145 });
146- return result;
146+ return Object.setPrototypeOf(result, Object.prototype);
147147 }
148148
149149 if (typ === "any") return val;
Test case

test/inputs/json/misc/09f54.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -61,7 +61,7 @@ quickType =
6161 encodeQuickType : QuickType -> Jenc.Value
6262 encodeQuickType x =
6363 Jenc.object
64- [ ("data", Jenc.dict identity encodeDatum x.data)
64+ [ ("data", makeDictEncoder identity encodeDatum x.data)
6565 , ("description", encodeDescription x.description)
6666 ]
6767
@@ -97,6 +97,14 @@ encodeDescription x =
9797
9898 --- encoder helpers
9999
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+
100108 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
101109 makeNullableEncoder f m =
102110 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 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
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class Description extends S.Class<Description>("Description")({
523 "base_period": S.String,
@@ -14,6 +32,6 @@ export class Datum extends S.Class<Datum>("Datum")({
1432 }) {}
1533
1634 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
17- "data": S.Record({ key: S.String, value: Datum}),
35+ "data": mapSchema(Datum),
1836 "description": Description,
1937 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 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
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Test case

test/inputs/json/misc/0a358.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 if (val === null || typeof val !== "object" || Array.isArray(val)) {
126126 return invalidValue(l(ref || "object"), val, key, parent);
127127 }
128- const result: any = {};
128+ const result: any = Object.create(null);
129129 Object.getOwnPropertyNames(props).forEach(key => {
130130 const prop = props[key];
131131 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
136136 result[key] = transform(val[key], additional, getProps, key, ref);
137137 }
138138 });
139- return result;
139+ return Object.setPrototypeOf(result, Object.prototype);
140140 }
141141
142142 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
122122 if (val === null || typeof val !== "object" || Array.isArray(val)) {
123123 return invalidValue(l(ref || "object"), val, key, parent);
124124 }
125- const result: any = {};
125+ const result: any = Object.create(null);
126126 Object.getOwnPropertyNames(props).forEach(key => {
127127 const prop = props[key];
128128 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
133133 result[key] = transform(val[key], additional, getProps, key, ref);
134134 }
135135 });
136- return result;
136+ return Object.setPrototypeOf(result, Object.prototype);
137137 }
138138
139139 if (typ === "any") return val;
Test case

test/inputs/json/misc/0a91a.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -327,7 +327,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
327327 if (val === null || typeof val !== "object" || Array.isArray(val)) {
328328 return invalidValue(l(ref || "object"), val, key, parent);
329329 }
330- const result: any = {};
330+ const result: any = Object.create(null);
331331 Object.getOwnPropertyNames(props).forEach(key => {
332332 const prop = props[key];
333333 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
338338 result[key] = transform(val[key], additional, getProps, key, ref);
339339 }
340340 });
341- return result;
341+ return Object.setPrototypeOf(result, Object.prototype);
342342 }
343343
344344 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
322322 if (val === null || typeof val !== "object" || Array.isArray(val)) {
323323 return invalidValue(l(ref || "object"), val, key, parent);
324324 }
325- const result: any = {};
325+ const result: any = Object.create(null);
326326 Object.getOwnPropertyNames(props).forEach(key => {
327327 const prop = props[key];
328328 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
333333 result[key] = transform(val[key], additional, getProps, key, ref);
334334 }
335335 });
336- return result;
336+ return Object.setPrototypeOf(result, Object.prototype);
337337 }
338338
339339 if (typ === "any") return val;
Test case

test/inputs/json/misc/0b91a.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
147147 if (val === null || typeof val !== "object" || Array.isArray(val)) {
148148 return invalidValue(l(ref || "object"), val, key, parent);
149149 }
150- const result: any = {};
150+ const result: any = Object.create(null);
151151 Object.getOwnPropertyNames(props).forEach(key => {
152152 const prop = props[key];
153153 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
158158 result[key] = transform(val[key], additional, getProps, key, ref);
159159 }
160160 });
161- return result;
161+ return Object.setPrototypeOf(result, Object.prototype);
162162 }
163163
164164 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
147147 if (val === null || typeof val !== "object" || Array.isArray(val)) {
148148 return invalidValue(l(ref || "object"), val, key, parent);
149149 }
150- const result: any = {};
150+ const result: any = Object.create(null);
151151 Object.getOwnPropertyNames(props).forEach(key => {
152152 const prop = props[key];
153153 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
158158 result[key] = transform(val[key], additional, getProps, key, ref);
159159 }
160160 });
161- return result;
161+ return Object.setPrototypeOf(result, Object.prototype);
162162 }
163163
164164 if (typ === "any") return val;
Test case

test/inputs/json/misc/0cffa.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -222,7 +222,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
222222 if (val === null || typeof val !== "object" || Array.isArray(val)) {
223223 return invalidValue(l(ref || "object"), val, key, parent);
224224 }
225- const result: any = {};
225+ const result: any = Object.create(null);
226226 Object.getOwnPropertyNames(props).forEach(key => {
227227 const prop = props[key];
228228 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
233233 result[key] = transform(val[key], additional, getProps, key, ref);
234234 }
235235 });
236- return result;
236+ return Object.setPrototypeOf(result, Object.prototype);
237237 }
238238
239239 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
215215 if (val === null || typeof val !== "object" || Array.isArray(val)) {
216216 return invalidValue(l(ref || "object"), val, key, parent);
217217 }
218- const result: any = {};
218+ const result: any = Object.create(null);
219219 Object.getOwnPropertyNames(props).forEach(key => {
220220 const prop = props[key];
221221 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
226226 result[key] = transform(val[key], additional, getProps, key, ref);
227227 }
228228 });
229- return result;
229+ return Object.setPrototypeOf(result, Object.prototype);
230230 }
231231
232232 if (typ === "any") return val;
Test case

test/inputs/json/misc/0e0c2.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -184,7 +184,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
184184 if (val === null || typeof val !== "object" || Array.isArray(val)) {
185185 return invalidValue(l(ref || "object"), val, key, parent);
186186 }
187- const result: any = {};
187+ const result: any = Object.create(null);
188188 Object.getOwnPropertyNames(props).forEach(key => {
189189 const prop = props[key];
190190 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
195195 result[key] = transform(val[key], additional, getProps, key, ref);
196196 }
197197 });
198- return result;
198+ return Object.setPrototypeOf(result, Object.prototype);
199199 }
200200
201201 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
178178 if (val === null || typeof val !== "object" || Array.isArray(val)) {
179179 return invalidValue(l(ref || "object"), val, key, parent);
180180 }
181- const result: any = {};
181+ const result: any = Object.create(null);
182182 Object.getOwnPropertyNames(props).forEach(key => {
183183 const prop = props[key];
184184 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
189189 result[key] = transform(val[key], additional, getProps, key, ref);
190190 }
191191 });
192- return result;
192+ return Object.setPrototypeOf(result, Object.prototype);
193193 }
194194
195195 if (typ === "any") return val;
Test case

test/inputs/json/misc/0fecf.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 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
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 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
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Test case

test/inputs/json/misc/10be4.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -174,7 +174,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
174174 if (val === null || typeof val !== "object" || Array.isArray(val)) {
175175 return invalidValue(l(ref || "object"), val, key, parent);
176176 }
177- const result: any = {};
177+ const result: any = Object.create(null);
178178 Object.getOwnPropertyNames(props).forEach(key => {
179179 const prop = props[key];
180180 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
185185 result[key] = transform(val[key], additional, getProps, key, ref);
186186 }
187187 });
188- return result;
188+ return Object.setPrototypeOf(result, Object.prototype);
189189 }
190190
191191 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
147147 if (val === null || typeof val !== "object" || Array.isArray(val)) {
148148 return invalidValue(l(ref || "object"), val, key, parent);
149149 }
150- const result: any = {};
150+ const result: any = Object.create(null);
151151 Object.getOwnPropertyNames(props).forEach(key => {
152152 const prop = props[key];
153153 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
158158 result[key] = transform(val[key], additional, getProps, key, ref);
159159 }
160160 });
161- return result;
161+ return Object.setPrototypeOf(result, Object.prototype);
162162 }
163163
164164 if (typ === "any") return val;
Test case

test/inputs/json/misc/112b5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 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
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Test case

test/inputs/json/misc/127a1.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -221,7 +221,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
221221 if (val === null || typeof val !== "object" || Array.isArray(val)) {
222222 return invalidValue(l(ref || "object"), val, key, parent);
223223 }
224- const result: any = {};
224+ const result: any = Object.create(null);
225225 Object.getOwnPropertyNames(props).forEach(key => {
226226 const prop = props[key];
227227 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
232232 result[key] = transform(val[key], additional, getProps, key, ref);
233233 }
234234 });
235- return result;
235+ return Object.setPrototypeOf(result, Object.prototype);
236236 }
237237
238238 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
215215 if (val === null || typeof val !== "object" || Array.isArray(val)) {
216216 return invalidValue(l(ref || "object"), val, key, parent);
217217 }
218- const result: any = {};
218+ const result: any = Object.create(null);
219219 Object.getOwnPropertyNames(props).forEach(key => {
220220 const prop = props[key];
221221 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
226226 result[key] = transform(val[key], additional, getProps, key, ref);
227227 }
228228 });
229- return result;
229+ return Object.setPrototypeOf(result, Object.prototype);
230230 }
231231
232232 if (typ === "any") return val;
Test case

test/inputs/json/misc/13d8d.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
133133 if (val === null || typeof val !== "object" || Array.isArray(val)) {
134134 return invalidValue(l(ref || "object"), val, key, parent);
135135 }
136- const result: any = {};
136+ const result: any = Object.create(null);
137137 Object.getOwnPropertyNames(props).forEach(key => {
138138 const prop = props[key];
139139 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
144144 result[key] = transform(val[key], additional, getProps, key, ref);
145145 }
146146 });
147- return result;
147+ return Object.setPrototypeOf(result, Object.prototype);
148148 }
149149
150150 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
133133 if (val === null || typeof val !== "object" || Array.isArray(val)) {
134134 return invalidValue(l(ref || "object"), val, key, parent);
135135 }
136- const result: any = {};
136+ const result: any = Object.create(null);
137137 Object.getOwnPropertyNames(props).forEach(key => {
138138 const prop = props[key];
139139 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
144144 result[key] = transform(val[key], additional, getProps, key, ref);
145145 }
146146 });
147- return result;
147+ return Object.setPrototypeOf(result, Object.prototype);
148148 }
149149
150150 if (typ === "any") return val;
Test case

test/inputs/json/misc/14d38.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/json/misc/167d6.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
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+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,8 +1,26 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
523 "base": S.String,
624 "date": S.String.pipe(S.pattern(/^\d{4}-\d{2}-\d{2}$/)),
7- "rates": S.Record({ key: S.String, value: S.Number}),
25+ "rates": mapSchema(S.Number),
826 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/16bc5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 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
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 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
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Test case

test/inputs/json/misc/176f1.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 if (val === null || typeof val !== "object" || Array.isArray(val)) {
133133 return invalidValue(l(ref || "object"), val, key, parent);
134134 }
135- const result: any = {};
135+ const result: any = Object.create(null);
136136 Object.getOwnPropertyNames(props).forEach(key => {
137137 const prop = props[key];
138138 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
143143 result[key] = transform(val[key], additional, getProps, key, ref);
144144 }
145145 });
146- return result;
146+ return Object.setPrototypeOf(result, Object.prototype);
147147 }
148148
149149 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
132132 if (val === null || typeof val !== "object" || Array.isArray(val)) {
133133 return invalidValue(l(ref || "object"), val, key, parent);
134134 }
135- const result: any = {};
135+ const result: any = Object.create(null);
136136 Object.getOwnPropertyNames(props).forEach(key => {
137137 const prop = props[key];
138138 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
143143 result[key] = transform(val[key], additional, getProps, key, ref);
144144 }
145145 });
146- return result;
146+ return Object.setPrototypeOf(result, Object.prototype);
147147 }
148148
149149 if (typ === "any") return val;
Test case

test/inputs/json/misc/1a7f5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 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
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/json/misc/1b28c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/1b409.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -198,7 +198,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
198198 if (val === null || typeof val !== "object" || Array.isArray(val)) {
199199 return invalidValue(l(ref || "object"), val, key, parent);
200200 }
201- const result: any = {};
201+ const result: any = Object.create(null);
202202 Object.getOwnPropertyNames(props).forEach(key => {
203203 const prop = props[key];
204204 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
209209 result[key] = transform(val[key], additional, getProps, key, ref);
210210 }
211211 });
212- return result;
212+ return Object.setPrototypeOf(result, Object.prototype);
213213 }
214214
215215 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
181181 if (val === null || typeof val !== "object" || Array.isArray(val)) {
182182 return invalidValue(l(ref || "object"), val, key, parent);
183183 }
184- const result: any = {};
184+ const result: any = Object.create(null);
185185 Object.getOwnPropertyNames(props).forEach(key => {
186186 const prop = props[key];
187187 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
192192 result[key] = transform(val[key], additional, getProps, key, ref);
193193 }
194194 });
195- return result;
195+ return Object.setPrototypeOf(result, Object.prototype);
196196 }
197197
198198 if (typ === "any") return val;
Test case

test/inputs/json/misc/2465e.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -180,7 +180,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
180180 if (val === null || typeof val !== "object" || Array.isArray(val)) {
181181 return invalidValue(l(ref || "object"), val, key, parent);
182182 }
183- const result: any = {};
183+ const result: any = Object.create(null);
184184 Object.getOwnPropertyNames(props).forEach(key => {
185185 const prop = props[key];
186186 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
191191 result[key] = transform(val[key], additional, getProps, key, ref);
192192 }
193193 });
194- return result;
194+ return Object.setPrototypeOf(result, Object.prototype);
195195 }
196196
197197 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
180180 if (val === null || typeof val !== "object" || Array.isArray(val)) {
181181 return invalidValue(l(ref || "object"), val, key, parent);
182182 }
183- const result: any = {};
183+ const result: any = Object.create(null);
184184 Object.getOwnPropertyNames(props).forEach(key => {
185185 const prop = props[key];
186186 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
191191 result[key] = transform(val[key], additional, getProps, key, ref);
192192 }
193193 });
194- return result;
194+ return Object.setPrototypeOf(result, Object.prototype);
195195 }
196196
197197 if (typ === "any") return val;
Test case

test/inputs/json/misc/24f52.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/262f0.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -210,7 +210,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
210210 if (val === null || typeof val !== "object" || Array.isArray(val)) {
211211 return invalidValue(l(ref || "object"), val, key, parent);
212212 }
213- const result: any = {};
213+ const result: any = Object.create(null);
214214 Object.getOwnPropertyNames(props).forEach(key => {
215215 const prop = props[key];
216216 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
221221 result[key] = transform(val[key], additional, getProps, key, ref);
222222 }
223223 });
224- return result;
224+ return Object.setPrototypeOf(result, Object.prototype);
225225 }
226226
227227 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
207207 if (val === null || typeof val !== "object" || Array.isArray(val)) {
208208 return invalidValue(l(ref || "object"), val, key, parent);
209209 }
210- const result: any = {};
210+ const result: any = Object.create(null);
211211 Object.getOwnPropertyNames(props).forEach(key => {
212212 const prop = props[key];
213213 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
218218 result[key] = transform(val[key], additional, getProps, key, ref);
219219 }
220220 });
221- return result;
221+ return Object.setPrototypeOf(result, Object.prototype);
222222 }
223223
224224 if (typ === "any") return val;
Test case

test/inputs/json/misc/26b49.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -219,7 +219,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
219219 if (val === null || typeof val !== "object" || Array.isArray(val)) {
220220 return invalidValue(l(ref || "object"), val, key, parent);
221221 }
222- const result: any = {};
222+ const result: any = Object.create(null);
223223 Object.getOwnPropertyNames(props).forEach(key => {
224224 const prop = props[key];
225225 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
230230 result[key] = transform(val[key], additional, getProps, key, ref);
231231 }
232232 });
233- return result;
233+ return Object.setPrototypeOf(result, Object.prototype);
234234 }
235235
236236 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
214214 if (val === null || typeof val !== "object" || Array.isArray(val)) {
215215 return invalidValue(l(ref || "object"), val, key, parent);
216216 }
217- const result: any = {};
217+ const result: any = Object.create(null);
218218 Object.getOwnPropertyNames(props).forEach(key => {
219219 const prop = props[key];
220220 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
225225 result[key] = transform(val[key], additional, getProps, key, ref);
226226 }
227227 });
228- return result;
228+ return Object.setPrototypeOf(result, Object.prototype);
229229 }
230230
231231 if (typ === "any") return val;
Test case

test/inputs/json/misc/26c9c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -294,7 +294,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
294294 if (val === null || typeof val !== "object" || Array.isArray(val)) {
295295 return invalidValue(l(ref || "object"), val, key, parent);
296296 }
297- const result: any = {};
297+ const result: any = Object.create(null);
298298 Object.getOwnPropertyNames(props).forEach(key => {
299299 const prop = props[key];
300300 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
305305 result[key] = transform(val[key], additional, getProps, key, ref);
306306 }
307307 });
308- return result;
308+ return Object.setPrototypeOf(result, Object.prototype);
309309 }
310310
311311 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
294294 if (val === null || typeof val !== "object" || Array.isArray(val)) {
295295 return invalidValue(l(ref || "object"), val, key, parent);
296296 }
297- const result: any = {};
297+ const result: any = Object.create(null);
298298 Object.getOwnPropertyNames(props).forEach(key => {
299299 const prop = props[key];
300300 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
305305 result[key] = transform(val[key], additional, getProps, key, ref);
306306 }
307307 });
308- return result;
308+ return Object.setPrototypeOf(result, Object.prototype);
309309 }
310310
311311 if (typ === "any") return val;
Test case

test/inputs/json/misc/27332.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -260,7 +260,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
260260 if (val === null || typeof val !== "object" || Array.isArray(val)) {
261261 return invalidValue(l(ref || "object"), val, key, parent);
262262 }
263- const result: any = {};
263+ const result: any = Object.create(null);
264264 Object.getOwnPropertyNames(props).forEach(key => {
265265 const prop = props[key];
266266 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
271271 result[key] = transform(val[key], additional, getProps, key, ref);
272272 }
273273 });
274- return result;
274+ return Object.setPrototypeOf(result, Object.prototype);
275275 }
276276
277277 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
246246 if (val === null || typeof val !== "object" || Array.isArray(val)) {
247247 return invalidValue(l(ref || "object"), val, key, parent);
248248 }
249- const result: any = {};
249+ const result: any = Object.create(null);
250250 Object.getOwnPropertyNames(props).forEach(key => {
251251 const prop = props[key];
252252 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
257257 result[key] = transform(val[key], additional, getProps, key, ref);
258258 }
259259 });
260- return result;
260+ return Object.setPrototypeOf(result, Object.prototype);
261261 }
262262
263263 if (typ === "any") return val;
Test case

test/inputs/json/misc/29f47.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -246,7 +246,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
246246 if (val === null || typeof val !== "object" || Array.isArray(val)) {
247247 return invalidValue(l(ref || "object"), val, key, parent);
248248 }
249- const result: any = {};
249+ const result: any = Object.create(null);
250250 Object.getOwnPropertyNames(props).forEach(key => {
251251 const prop = props[key];
252252 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
257257 result[key] = transform(val[key], additional, getProps, key, ref);
258258 }
259259 });
260- return result;
260+ return Object.setPrototypeOf(result, Object.prototype);
261261 }
262262
263263 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
233233 if (val === null || typeof val !== "object" || Array.isArray(val)) {
234234 return invalidValue(l(ref || "object"), val, key, parent);
235235 }
236- const result: any = {};
236+ const result: any = Object.create(null);
237237 Object.getOwnPropertyNames(props).forEach(key => {
238238 const prop = props[key];
239239 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
244244 result[key] = transform(val[key], additional, getProps, key, ref);
245245 }
246246 });
247- return result;
247+ return Object.setPrototypeOf(result, Object.prototype);
248248 }
249249
250250 if (typ === "any") return val;
Test case

test/inputs/json/misc/2d4e2.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -214,7 +214,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
214214 if (val === null || typeof val !== "object" || Array.isArray(val)) {
215215 return invalidValue(l(ref || "object"), val, key, parent);
216216 }
217- const result: any = {};
217+ const result: any = Object.create(null);
218218 Object.getOwnPropertyNames(props).forEach(key => {
219219 const prop = props[key];
220220 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
225225 result[key] = transform(val[key], additional, getProps, key, ref);
226226 }
227227 });
228- return result;
228+ return Object.setPrototypeOf(result, Object.prototype);
229229 }
230230
231231 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
191191 if (val === null || typeof val !== "object" || Array.isArray(val)) {
192192 return invalidValue(l(ref || "object"), val, key, parent);
193193 }
194- const result: any = {};
194+ const result: any = Object.create(null);
195195 Object.getOwnPropertyNames(props).forEach(key => {
196196 const prop = props[key];
197197 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
202202 result[key] = transform(val[key], additional, getProps, key, ref);
203203 }
204204 });
205- return result;
205+ return Object.setPrototypeOf(result, Object.prototype);
206206 }
207207
208208 if (typ === "any") return val;
Test case

test/inputs/json/misc/2df80.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -180,7 +180,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
180180 if (val === null || typeof val !== "object" || Array.isArray(val)) {
181181 return invalidValue(l(ref || "object"), val, key, parent);
182182 }
183- const result: any = {};
183+ const result: any = Object.create(null);
184184 Object.getOwnPropertyNames(props).forEach(key => {
185185 const prop = props[key];
186186 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
191191 result[key] = transform(val[key], additional, getProps, key, ref);
192192 }
193193 });
194- return result;
194+ return Object.setPrototypeOf(result, Object.prototype);
195195 }
196196
197197 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
136136 if (val === null || typeof val !== "object" || Array.isArray(val)) {
137137 return invalidValue(l(ref || "object"), val, key, parent);
138138 }
139- const result: any = {};
139+ const result: any = Object.create(null);
140140 Object.getOwnPropertyNames(props).forEach(key => {
141141 const prop = props[key];
142142 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
147147 result[key] = transform(val[key], additional, getProps, key, ref);
148148 }
149149 });
150- return result;
150+ return Object.setPrototypeOf(result, Object.prototype);
151151 }
152152
153153 if (typ === "any") return val;
Test case

test/inputs/json/misc/31189.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 if (val === null || typeof val !== "object" || Array.isArray(val)) {
136136 return invalidValue(l(ref || "object"), val, key, parent);
137137 }
138- const result: any = {};
138+ const result: any = Object.create(null);
139139 Object.getOwnPropertyNames(props).forEach(key => {
140140 const prop = props[key];
141141 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
146146 result[key] = transform(val[key], additional, getProps, key, ref);
147147 }
148148 });
149- return result;
149+ return Object.setPrototypeOf(result, Object.prototype);
150150 }
151151
152152 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
134134 if (val === null || typeof val !== "object" || Array.isArray(val)) {
135135 return invalidValue(l(ref || "object"), val, key, parent);
136136 }
137- const result: any = {};
137+ const result: any = Object.create(null);
138138 Object.getOwnPropertyNames(props).forEach(key => {
139139 const prop = props[key];
140140 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
145145 result[key] = transform(val[key], additional, getProps, key, ref);
146146 }
147147 });
148- return result;
148+ return Object.setPrototypeOf(result, Object.prototype);
149149 }
150150
151151 if (typ === "any") return val;
Test case

test/inputs/json/misc/32431.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -178,7 +178,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
178178 if (val === null || typeof val !== "object" || Array.isArray(val)) {
179179 return invalidValue(l(ref || "object"), val, key, parent);
180180 }
181- const result: any = {};
181+ const result: any = Object.create(null);
182182 Object.getOwnPropertyNames(props).forEach(key => {
183183 const prop = props[key];
184184 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
189189 result[key] = transform(val[key], additional, getProps, key, ref);
190190 }
191191 });
192- return result;
192+ return Object.setPrototypeOf(result, Object.prototype);
193193 }
194194
195195 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
170170 if (val === null || typeof val !== "object" || Array.isArray(val)) {
171171 return invalidValue(l(ref || "object"), val, key, parent);
172172 }
173- const result: any = {};
173+ const result: any = Object.create(null);
174174 Object.getOwnPropertyNames(props).forEach(key => {
175175 const prop = props[key];
176176 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
181181 result[key] = transform(val[key], additional, getProps, key, ref);
182182 }
183183 });
184- return result;
184+ return Object.setPrototypeOf(result, Object.prototype);
185185 }
186186
187187 if (typ === "any") return val;
Test case

test/inputs/json/misc/32d5c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 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
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 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
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/json/misc/337ed.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -175,7 +175,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
175175 if (val === null || typeof val !== "object" || Array.isArray(val)) {
176176 return invalidValue(l(ref || "object"), val, key, parent);
177177 }
178- const result: any = {};
178+ const result: any = Object.create(null);
179179 Object.getOwnPropertyNames(props).forEach(key => {
180180 const prop = props[key];
181181 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
186186 result[key] = transform(val[key], additional, getProps, key, ref);
187187 }
188188 });
189- return result;
189+ return Object.setPrototypeOf(result, Object.prototype);
190190 }
191191
192192 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
165165 if (val === null || typeof val !== "object" || Array.isArray(val)) {
166166 return invalidValue(l(ref || "object"), val, key, parent);
167167 }
168- const result: any = {};
168+ const result: any = Object.create(null);
169169 Object.getOwnPropertyNames(props).forEach(key => {
170170 const prop = props[key];
171171 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
176176 result[key] = transform(val[key], additional, getProps, key, ref);
177177 }
178178 });
179- return result;
179+ return Object.setPrototypeOf(result, Object.prototype);
180180 }
181181
182182 if (typ === "any") return val;
Test case

test/inputs/json/misc/33d2e.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -160,7 +160,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
160160 if (val === null || typeof val !== "object" || Array.isArray(val)) {
161161 return invalidValue(l(ref || "object"), val, key, parent);
162162 }
163- const result: any = {};
163+ const result: any = Object.create(null);
164164 Object.getOwnPropertyNames(props).forEach(key => {
165165 const prop = props[key];
166166 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
171171 result[key] = transform(val[key], additional, getProps, key, ref);
172172 }
173173 });
174- return result;
174+ return Object.setPrototypeOf(result, Object.prototype);
175175 }
176176
177177 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
148148 if (val === null || typeof val !== "object" || Array.isArray(val)) {
149149 return invalidValue(l(ref || "object"), val, key, parent);
150150 }
151- const result: any = {};
151+ const result: any = Object.create(null);
152152 Object.getOwnPropertyNames(props).forEach(key => {
153153 const prop = props[key];
154154 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
159159 result[key] = transform(val[key], additional, getProps, key, ref);
160160 }
161161 });
162- return result;
162+ return Object.setPrototypeOf(result, Object.prototype);
163163 }
164164
165165 if (typ === "any") return val;
Test case

test/inputs/json/misc/34702.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -195,7 +195,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
195195 if (val === null || typeof val !== "object" || Array.isArray(val)) {
196196 return invalidValue(l(ref || "object"), val, key, parent);
197197 }
198- const result: any = {};
198+ const result: any = Object.create(null);
199199 Object.getOwnPropertyNames(props).forEach(key => {
200200 const prop = props[key];
201201 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
206206 result[key] = transform(val[key], additional, getProps, key, ref);
207207 }
208208 });
209- return result;
209+ return Object.setPrototypeOf(result, Object.prototype);
210210 }
211211
212212 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
162162 if (val === null || typeof val !== "object" || Array.isArray(val)) {
163163 return invalidValue(l(ref || "object"), val, key, parent);
164164 }
165- const result: any = {};
165+ const result: any = Object.create(null);
166166 Object.getOwnPropertyNames(props).forEach(key => {
167167 const prop = props[key];
168168 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
173173 result[key] = transform(val[key], additional, getProps, key, ref);
174174 }
175175 });
176- return result;
176+ return Object.setPrototypeOf(result, Object.prototype);
177177 }
178178
179179 if (typ === "any") return val;
Test case

test/inputs/json/misc/3536b.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
142142 if (val === null || typeof val !== "object" || Array.isArray(val)) {
143143 return invalidValue(l(ref || "object"), val, key, parent);
144144 }
145- const result: any = {};
145+ const result: any = Object.create(null);
146146 Object.getOwnPropertyNames(props).forEach(key => {
147147 const prop = props[key];
148148 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
153153 result[key] = transform(val[key], additional, getProps, key, ref);
154154 }
155155 });
156- return result;
156+ return Object.setPrototypeOf(result, Object.prototype);
157157 }
158158
159159 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
136136 if (val === null || typeof val !== "object" || Array.isArray(val)) {
137137 return invalidValue(l(ref || "object"), val, key, parent);
138138 }
139- const result: any = {};
139+ const result: any = Object.create(null);
140140 Object.getOwnPropertyNames(props).forEach(key => {
141141 const prop = props[key];
142142 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
147147 result[key] = transform(val[key], additional, getProps, key, ref);
148148 }
149149 });
150- return result;
150+ return Object.setPrototypeOf(result, Object.prototype);
151151 }
152152
153153 if (typ === "any") return val;
Test case

test/inputs/json/misc/3659d.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/36d5d.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/3a6b3.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/3e9a3.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -132,7 +132,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
132132 if (val === null || typeof val !== "object" || Array.isArray(val)) {
133133 return invalidValue(l(ref || "object"), val, key, parent);
134134 }
135- const result: any = {};
135+ const result: any = Object.create(null);
136136 Object.getOwnPropertyNames(props).forEach(key => {
137137 const prop = props[key];
138138 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
143143 result[key] = transform(val[key], additional, getProps, key, ref);
144144 }
145145 });
146- return result;
146+ return Object.setPrototypeOf(result, Object.prototype);
147147 }
148148
149149 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
132132 if (val === null || typeof val !== "object" || Array.isArray(val)) {
133133 return invalidValue(l(ref || "object"), val, key, parent);
134134 }
135- const result: any = {};
135+ const result: any = Object.create(null);
136136 Object.getOwnPropertyNames(props).forEach(key => {
137137 const prop = props[key];
138138 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
143143 result[key] = transform(val[key], additional, getProps, key, ref);
144144 }
145145 });
146- return result;
146+ return Object.setPrototypeOf(result, Object.prototype);
147147 }
148148
149149 if (typ === "any") return val;
Test case

test/inputs/json/misc/3f1ce.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -208,7 +208,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
208208 if (val === null || typeof val !== "object" || Array.isArray(val)) {
209209 return invalidValue(l(ref || "object"), val, key, parent);
210210 }
211- const result: any = {};
211+ const result: any = Object.create(null);
212212 Object.getOwnPropertyNames(props).forEach(key => {
213213 const prop = props[key];
214214 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
219219 result[key] = transform(val[key], additional, getProps, key, ref);
220220 }
221221 });
222- return result;
222+ return Object.setPrototypeOf(result, Object.prototype);
223223 }
224224
225225 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
207207 if (val === null || typeof val !== "object" || Array.isArray(val)) {
208208 return invalidValue(l(ref || "object"), val, key, parent);
209209 }
210- const result: any = {};
210+ const result: any = Object.create(null);
211211 Object.getOwnPropertyNames(props).forEach(key => {
212212 const prop = props[key];
213213 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
218218 result[key] = transform(val[key], additional, getProps, key, ref);
219219 }
220220 });
221- return result;
221+ return Object.setPrototypeOf(result, Object.prototype);
222222 }
223223
224224 if (typ === "any") return val;
Test case

test/inputs/json/misc/421d4.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -221,7 +221,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
221221 if (val === null || typeof val !== "object" || Array.isArray(val)) {
222222 return invalidValue(l(ref || "object"), val, key, parent);
223223 }
224- const result: any = {};
224+ const result: any = Object.create(null);
225225 Object.getOwnPropertyNames(props).forEach(key => {
226226 const prop = props[key];
227227 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
232232 result[key] = transform(val[key], additional, getProps, key, ref);
233233 }
234234 });
235- return result;
235+ return Object.setPrototypeOf(result, Object.prototype);
236236 }
237237
238238 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
218218 if (val === null || typeof val !== "object" || Array.isArray(val)) {
219219 return invalidValue(l(ref || "object"), val, key, parent);
220220 }
221- const result: any = {};
221+ const result: any = Object.create(null);
222222 Object.getOwnPropertyNames(props).forEach(key => {
223223 const prop = props[key];
224224 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
229229 result[key] = transform(val[key], additional, getProps, key, ref);
230230 }
231231 });
232- return result;
232+ return Object.setPrototypeOf(result, Object.prototype);
233233 }
234234
235235 if (typ === "any") return val;
Test case

test/inputs/json/misc/437e7.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -216,7 +216,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
216216 if (val === null || typeof val !== "object" || Array.isArray(val)) {
217217 return invalidValue(l(ref || "object"), val, key, parent);
218218 }
219- const result: any = {};
219+ const result: any = Object.create(null);
220220 Object.getOwnPropertyNames(props).forEach(key => {
221221 const prop = props[key];
222222 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
227227 result[key] = transform(val[key], additional, getProps, key, ref);
228228 }
229229 });
230- return result;
230+ return Object.setPrototypeOf(result, Object.prototype);
231231 }
232232
233233 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
211211 if (val === null || typeof val !== "object" || Array.isArray(val)) {
212212 return invalidValue(l(ref || "object"), val, key, parent);
213213 }
214- const result: any = {};
214+ const result: any = Object.create(null);
215215 Object.getOwnPropertyNames(props).forEach(key => {
216216 const prop = props[key];
217217 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
222222 result[key] = transform(val[key], additional, getProps, key, ref);
223223 }
224224 });
225- return result;
225+ return Object.setPrototypeOf(result, Object.prototype);
226226 }
227227
228228 if (typ === "any") return val;
Test case

test/inputs/json/misc/43970.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/misc/43eaf.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
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+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,8 +1,26 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
523 "base": S.String,
624 "date": S.String.pipe(S.pattern(/^\d{4}-\d{2}-\d{2}$/)),
7- "rates": S.Record({ key: S.String, value: S.Number}),
25+ "rates": mapSchema(S.Number),
826 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/458db.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
149149 if (val === null || typeof val !== "object" || Array.isArray(val)) {
150150 return invalidValue(l(ref || "object"), val, key, parent);
151151 }
152- const result: any = {};
152+ const result: any = Object.create(null);
153153 Object.getOwnPropertyNames(props).forEach(key => {
154154 const prop = props[key];
155155 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
160160 result[key] = transform(val[key], additional, getProps, key, ref);
161161 }
162162 });
163- return result;
163+ return Object.setPrototypeOf(result, Object.prototype);
164164 }
165165
166166 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
148148 if (val === null || typeof val !== "object" || Array.isArray(val)) {
149149 return invalidValue(l(ref || "object"), val, key, parent);
150150 }
151- const result: any = {};
151+ const result: any = Object.create(null);
152152 Object.getOwnPropertyNames(props).forEach(key => {
153153 const prop = props[key];
154154 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
159159 result[key] = transform(val[key], additional, getProps, key, ref);
160160 }
161161 });
162- return result;
162+ return Object.setPrototypeOf(result, Object.prototype);
163163 }
164164
165165 if (typ === "any") return val;
Test case

test/inputs/json/misc/4961a.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/4a0d7.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/4a455.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -150,7 +150,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
150150 if (val === null || typeof val !== "object" || Array.isArray(val)) {
151151 return invalidValue(l(ref || "object"), val, key, parent);
152152 }
153- const result: any = {};
153+ const result: any = Object.create(null);
154154 Object.getOwnPropertyNames(props).forEach(key => {
155155 const prop = props[key];
156156 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
161161 result[key] = transform(val[key], additional, getProps, key, ref);
162162 }
163163 });
164- return result;
164+ return Object.setPrototypeOf(result, Object.prototype);
165165 }
166166
167167 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
147147 if (val === null || typeof val !== "object" || Array.isArray(val)) {
148148 return invalidValue(l(ref || "object"), val, key, parent);
149149 }
150- const result: any = {};
150+ const result: any = Object.create(null);
151151 Object.getOwnPropertyNames(props).forEach(key => {
152152 const prop = props[key];
153153 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
158158 result[key] = transform(val[key], additional, getProps, key, ref);
159159 }
160160 });
161- return result;
161+ return Object.setPrototypeOf(result, Object.prototype);
162162 }
163163
164164 if (typ === "any") return val;
Test case

test/inputs/json/misc/4c547.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 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
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 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
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Test case

test/inputs/json/misc/4d6fb.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -255,7 +255,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
255255 if (val === null || typeof val !== "object" || Array.isArray(val)) {
256256 return invalidValue(l(ref || "object"), val, key, parent);
257257 }
258- const result: any = {};
258+ const result: any = Object.create(null);
259259 Object.getOwnPropertyNames(props).forEach(key => {
260260 const prop = props[key];
261261 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
266266 result[key] = transform(val[key], additional, getProps, key, ref);
267267 }
268268 });
269- return result;
269+ return Object.setPrototypeOf(result, Object.prototype);
270270 }
271271
272272 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
245245 if (val === null || typeof val !== "object" || Array.isArray(val)) {
246246 return invalidValue(l(ref || "object"), val, key, parent);
247247 }
248- const result: any = {};
248+ const result: any = Object.create(null);
249249 Object.getOwnPropertyNames(props).forEach(key => {
250250 const prop = props[key];
251251 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
256256 result[key] = transform(val[key], additional, getProps, key, ref);
257257 }
258258 });
259- return result;
259+ return Object.setPrototypeOf(result, Object.prototype);
260260 }
261261
262262 if (typ === "any") return val;
Test case

test/inputs/json/misc/4e336.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/54147.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 if (val === null || typeof val !== "object" || Array.isArray(val)) {
124124 return invalidValue(l(ref || "object"), val, key, parent);
125125 }
126- const result: any = {};
126+ const result: any = Object.create(null);
127127 Object.getOwnPropertyNames(props).forEach(key => {
128128 const prop = props[key];
129129 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
134134 result[key] = transform(val[key], additional, getProps, key, ref);
135135 }
136136 });
137- return result;
137+ return Object.setPrototypeOf(result, Object.prototype);
138138 }
139139
140140 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 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
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Test case

test/inputs/json/misc/54d32.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -129,7 +129,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
129129 if (val === null || typeof val !== "object" || Array.isArray(val)) {
130130 return invalidValue(l(ref || "object"), val, key, parent);
131131 }
132- const result: any = {};
132+ const result: any = Object.create(null);
133133 Object.getOwnPropertyNames(props).forEach(key => {
134134 const prop = props[key];
135135 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
140140 result[key] = transform(val[key], additional, getProps, key, ref);
141141 }
142142 });
143- return result;
143+ return Object.setPrototypeOf(result, Object.prototype);
144144 }
145145
146146 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
124124 if (val === null || typeof val !== "object" || Array.isArray(val)) {
125125 return invalidValue(l(ref || "object"), val, key, parent);
126126 }
127- const result: any = {};
127+ const result: any = Object.create(null);
128128 Object.getOwnPropertyNames(props).forEach(key => {
129129 const prop = props[key];
130130 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
135135 result[key] = transform(val[key], additional, getProps, key, ref);
136136 }
137137 });
138- return result;
138+ return Object.setPrototypeOf(result, Object.prototype);
139139 }
140140
141141 if (typ === "any") return val;
Test case

test/inputs/json/misc/570ec.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
142142 if (val === null || typeof val !== "object" || Array.isArray(val)) {
143143 return invalidValue(l(ref || "object"), val, key, parent);
144144 }
145- const result: any = {};
145+ const result: any = Object.create(null);
146146 Object.getOwnPropertyNames(props).forEach(key => {
147147 const prop = props[key];
148148 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
153153 result[key] = transform(val[key], additional, getProps, key, ref);
154154 }
155155 });
156- return result;
156+ return Object.setPrototypeOf(result, Object.prototype);
157157 }
158158
159159 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
139139 if (val === null || typeof val !== "object" || Array.isArray(val)) {
140140 return invalidValue(l(ref || "object"), val, key, parent);
141141 }
142- const result: any = {};
142+ const result: any = Object.create(null);
143143 Object.getOwnPropertyNames(props).forEach(key => {
144144 const prop = props[key];
145145 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
150150 result[key] = transform(val[key], additional, getProps, key, ref);
151151 }
152152 });
153- return result;
153+ return Object.setPrototypeOf(result, Object.prototype);
154154 }
155155
156156 if (typ === "any") return val;
Test case

test/inputs/json/misc/5dd0d.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/5eae5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/5eb20.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/5f3a1.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
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+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,8 +1,26 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
523 "base": S.String,
624 "date": S.String.pipe(S.pattern(/^\d{4}-\d{2}-\d{2}$/)),
7- "rates": S.Record({ key: S.String, value: S.Number}),
25+ "rates": mapSchema(S.Number),
826 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/5f7fe.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -295,7 +295,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
295295 if (val === null || typeof val !== "object" || Array.isArray(val)) {
296296 return invalidValue(l(ref || "object"), val, key, parent);
297297 }
298- const result: any = {};
298+ const result: any = Object.create(null);
299299 Object.getOwnPropertyNames(props).forEach(key => {
300300 const prop = props[key];
301301 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
306306 result[key] = transform(val[key], additional, getProps, key, ref);
307307 }
308308 });
309- return result;
309+ return Object.setPrototypeOf(result, Object.prototype);
310310 }
311311
312312 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
292292 if (val === null || typeof val !== "object" || Array.isArray(val)) {
293293 return invalidValue(l(ref || "object"), val, key, parent);
294294 }
295- const result: any = {};
295+ const result: any = Object.create(null);
296296 Object.getOwnPropertyNames(props).forEach(key => {
297297 const prop = props[key];
298298 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
303303 result[key] = transform(val[key], additional, getProps, key, ref);
304304 }
305305 });
306- return result;
306+ return Object.setPrototypeOf(result, Object.prototype);
307307 }
308308
309309 if (typ === "any") return val;
Test case

test/inputs/json/misc/617e8.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -294,7 +294,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
294294 if (val === null || typeof val !== "object" || Array.isArray(val)) {
295295 return invalidValue(l(ref || "object"), val, key, parent);
296296 }
297- const result: any = {};
297+ const result: any = Object.create(null);
298298 Object.getOwnPropertyNames(props).forEach(key => {
299299 const prop = props[key];
300300 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
305305 result[key] = transform(val[key], additional, getProps, key, ref);
306306 }
307307 });
308- return result;
308+ return Object.setPrototypeOf(result, Object.prototype);
309309 }
310310
311311 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
291291 if (val === null || typeof val !== "object" || Array.isArray(val)) {
292292 return invalidValue(l(ref || "object"), val, key, parent);
293293 }
294- const result: any = {};
294+ const result: any = Object.create(null);
295295 Object.getOwnPropertyNames(props).forEach(key => {
296296 const prop = props[key];
297297 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
302302 result[key] = transform(val[key], additional, getProps, key, ref);
303303 }
304304 });
305- return result;
305+ return Object.setPrototypeOf(result, Object.prototype);
306306 }
307307
308308 if (typ === "any") return val;
Test case

test/inputs/json/misc/61b66.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/6260a.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
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+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,8 +1,26 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
523 "base": S.String,
624 "date": S.String.pipe(S.pattern(/^\d{4}-\d{2}-\d{2}$/)),
7- "rates": S.Record({ key: S.String, value: S.Number}),
25+ "rates": mapSchema(S.Number),
826 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/65dec.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -194,7 +194,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
194194 if (val === null || typeof val !== "object" || Array.isArray(val)) {
195195 return invalidValue(l(ref || "object"), val, key, parent);
196196 }
197- const result: any = {};
197+ const result: any = Object.create(null);
198198 Object.getOwnPropertyNames(props).forEach(key => {
199199 const prop = props[key];
200200 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
205205 result[key] = transform(val[key], additional, getProps, key, ref);
206206 }
207207 });
208- return result;
208+ return Object.setPrototypeOf(result, Object.prototype);
209209 }
210210
211211 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
170170 if (val === null || typeof val !== "object" || Array.isArray(val)) {
171171 return invalidValue(l(ref || "object"), val, key, parent);
172172 }
173- const result: any = {};
173+ const result: any = Object.create(null);
174174 Object.getOwnPropertyNames(props).forEach(key => {
175175 const prop = props[key];
176176 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
181181 result[key] = transform(val[key], additional, getProps, key, ref);
182182 }
183183 });
184- return result;
184+ return Object.setPrototypeOf(result, Object.prototype);
185185 }
186186
187187 if (typ === "any") return val;
Test case

test/inputs/json/misc/66121.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 if (val === null || typeof val !== "object" || Array.isArray(val)) {
152152 return invalidValue(l(ref || "object"), val, key, parent);
153153 }
154- const result: any = {};
154+ const result: any = Object.create(null);
155155 Object.getOwnPropertyNames(props).forEach(key => {
156156 const prop = props[key];
157157 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
162162 result[key] = transform(val[key], additional, getProps, key, ref);
163163 }
164164 });
165- return result;
165+ return Object.setPrototypeOf(result, Object.prototype);
166166 }
167167
168168 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
142142 if (val === null || typeof val !== "object" || Array.isArray(val)) {
143143 return invalidValue(l(ref || "object"), val, key, parent);
144144 }
145- const result: any = {};
145+ const result: any = Object.create(null);
146146 Object.getOwnPropertyNames(props).forEach(key => {
147147 const prop = props[key];
148148 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
153153 result[key] = transform(val[key], additional, getProps, key, ref);
154154 }
155155 });
156- return result;
156+ return Object.setPrototypeOf(result, Object.prototype);
157157 }
158158
159159 if (typ === "any") return val;
Test case

test/inputs/json/misc/6617c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/json/misc/67c03.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/json/misc/68c30.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
138138 if (val === null || typeof val !== "object" || Array.isArray(val)) {
139139 return invalidValue(l(ref || "object"), val, key, parent);
140140 }
141- const result: any = {};
141+ const result: any = Object.create(null);
142142 Object.getOwnPropertyNames(props).forEach(key => {
143143 const prop = props[key];
144144 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
149149 result[key] = transform(val[key], additional, getProps, key, ref);
150150 }
151151 });
152- return result;
152+ return Object.setPrototypeOf(result, Object.prototype);
153153 }
154154
155155 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
138138 if (val === null || typeof val !== "object" || Array.isArray(val)) {
139139 return invalidValue(l(ref || "object"), val, key, parent);
140140 }
141- const result: any = {};
141+ const result: any = Object.create(null);
142142 Object.getOwnPropertyNames(props).forEach(key => {
143143 const prop = props[key];
144144 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
149149 result[key] = transform(val[key], additional, getProps, key, ref);
150150 }
151151 });
152- return result;
152+ return Object.setPrototypeOf(result, Object.prototype);
153153 }
154154
155155 if (typ === "any") return val;
Test case

test/inputs/json/misc/6c155.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -160,7 +160,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
160160 if (val === null || typeof val !== "object" || Array.isArray(val)) {
161161 return invalidValue(l(ref || "object"), val, key, parent);
162162 }
163- const result: any = {};
163+ const result: any = Object.create(null);
164164 Object.getOwnPropertyNames(props).forEach(key => {
165165 const prop = props[key];
166166 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
171171 result[key] = transform(val[key], additional, getProps, key, ref);
172172 }
173173 });
174- return result;
174+ return Object.setPrototypeOf(result, Object.prototype);
175175 }
176176
177177 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
160160 if (val === null || typeof val !== "object" || Array.isArray(val)) {
161161 return invalidValue(l(ref || "object"), val, key, parent);
162162 }
163- const result: any = {};
163+ const result: any = Object.create(null);
164164 Object.getOwnPropertyNames(props).forEach(key => {
165165 const prop = props[key];
166166 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
171171 result[key] = transform(val[key], additional, getProps, key, ref);
172172 }
173173 });
174- return result;
174+ return Object.setPrototypeOf(result, Object.prototype);
175175 }
176176
177177 if (typ === "any") return val;
Test case

test/inputs/json/misc/6de06.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -255,7 +255,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
255255 if (val === null || typeof val !== "object" || Array.isArray(val)) {
256256 return invalidValue(l(ref || "object"), val, key, parent);
257257 }
258- const result: any = {};
258+ const result: any = Object.create(null);
259259 Object.getOwnPropertyNames(props).forEach(key => {
260260 const prop = props[key];
261261 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
266266 result[key] = transform(val[key], additional, getProps, key, ref);
267267 }
268268 });
269- return result;
269+ return Object.setPrototypeOf(result, Object.prototype);
270270 }
271271
272272 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
250250 if (val === null || typeof val !== "object" || Array.isArray(val)) {
251251 return invalidValue(l(ref || "object"), val, key, parent);
252252 }
253- const result: any = {};
253+ const result: any = Object.create(null);
254254 Object.getOwnPropertyNames(props).forEach(key => {
255255 const prop = props[key];
256256 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
261261 result[key] = transform(val[key], additional, getProps, key, ref);
262262 }
263263 });
264- return result;
264+ return Object.setPrototypeOf(result, Object.prototype);
265265 }
266266
267267 if (typ === "any") return val;
Test case

test/inputs/json/misc/6dec6.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -210,7 +210,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
210210 if (val === null || typeof val !== "object" || Array.isArray(val)) {
211211 return invalidValue(l(ref || "object"), val, key, parent);
212212 }
213- const result: any = {};
213+ const result: any = Object.create(null);
214214 Object.getOwnPropertyNames(props).forEach(key => {
215215 const prop = props[key];
216216 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
221221 result[key] = transform(val[key], additional, getProps, key, ref);
222222 }
223223 });
224- return result;
224+ return Object.setPrototypeOf(result, Object.prototype);
225225 }
226226
227227 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
207207 if (val === null || typeof val !== "object" || Array.isArray(val)) {
208208 return invalidValue(l(ref || "object"), val, key, parent);
209209 }
210- const result: any = {};
210+ const result: any = Object.create(null);
211211 Object.getOwnPropertyNames(props).forEach(key => {
212212 const prop = props[key];
213213 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
218218 result[key] = transform(val[key], additional, getProps, key, ref);
219219 }
220220 });
221- return result;
221+ return Object.setPrototypeOf(result, Object.prototype);
222222 }
223223
224224 if (typ === "any") return val;
Test case

test/inputs/json/misc/6eb00.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/misc/70c77.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
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+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,8 +1,26 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
523 "base": S.String,
624 "date": S.String.pipe(S.pattern(/^\d{4}-\d{2}-\d{2}$/)),
7- "rates": S.Record({ key: S.String, value: S.Number}),
25+ "rates": mapSchema(S.Number),
826 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/734ad.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -181,7 +181,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
181181 if (val === null || typeof val !== "object" || Array.isArray(val)) {
182182 return invalidValue(l(ref || "object"), val, key, parent);
183183 }
184- const result: any = {};
184+ const result: any = Object.create(null);
185185 Object.getOwnPropertyNames(props).forEach(key => {
186186 const prop = props[key];
187187 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
192192 result[key] = transform(val[key], additional, getProps, key, ref);
193193 }
194194 });
195- return result;
195+ return Object.setPrototypeOf(result, Object.prototype);
196196 }
197197
198198 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
176176 if (val === null || typeof val !== "object" || Array.isArray(val)) {
177177 return invalidValue(l(ref || "object"), val, key, parent);
178178 }
179- const result: any = {};
179+ const result: any = Object.create(null);
180180 Object.getOwnPropertyNames(props).forEach(key => {
181181 const prop = props[key];
182182 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
187187 result[key] = transform(val[key], additional, getProps, key, ref);
188188 }
189189 });
190- return result;
190+ return Object.setPrototypeOf(result, Object.prototype);
191191 }
192192
193193 if (typ === "any") return val;
Test case

test/inputs/json/misc/75912.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
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+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,8 +1,26 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
523 "base": S.String,
624 "date": S.String.pipe(S.pattern(/^\d{4}-\d{2}-\d{2}$/)),
7- "rates": S.Record({ key: S.String, value: S.Number}),
25+ "rates": mapSchema(S.Number),
826 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/7681c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -223,7 +223,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
223223 if (val === null || typeof val !== "object" || Array.isArray(val)) {
224224 return invalidValue(l(ref || "object"), val, key, parent);
225225 }
226- const result: any = {};
226+ const result: any = Object.create(null);
227227 Object.getOwnPropertyNames(props).forEach(key => {
228228 const prop = props[key];
229229 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
234234 result[key] = transform(val[key], additional, getProps, key, ref);
235235 }
236236 });
237- return result;
237+ return Object.setPrototypeOf(result, Object.prototype);
238238 }
239239
240240 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
215215 if (val === null || typeof val !== "object" || Array.isArray(val)) {
216216 return invalidValue(l(ref || "object"), val, key, parent);
217217 }
218- const result: any = {};
218+ const result: any = Object.create(null);
219219 Object.getOwnPropertyNames(props).forEach(key => {
220220 const prop = props[key];
221221 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
226226 result[key] = transform(val[key], additional, getProps, key, ref);
227227 }
228228 });
229- return result;
229+ return Object.setPrototypeOf(result, Object.prototype);
230230 }
231231
232232 if (typ === "any") return val;
Test case

test/inputs/json/misc/76ae1.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -316,7 +316,7 @@ article =
316316 encodeArticle : Article -> Jenc.Value
317317 encodeArticle x =
318318 Jenc.object
319- [ ("properties", Jenc.dict identity encodeProperty x.properties)
319+ [ ("properties", makeDictEncoder identity encodeProperty x.properties)
320320 ]
321321
322322 property : Jdec.Decoder Property
@@ -722,6 +722,14 @@ encodeSchemaType x = case x of
722722
723723 --- encoder helpers
724724
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+
725733 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
726734 makeNullableEncoder f m =
727735 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -291,7 +291,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
291291 if (val === null || typeof val !== "object" || Array.isArray(val)) {
292292 return invalidValue(l(ref || "object"), val, key, parent);
293293 }
294- const result: any = {};
294+ const result: any = Object.create(null);
295295 Object.getOwnPropertyNames(props).forEach(key => {
296296 const prop = props[key];
297297 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
302302 result[key] = transform(val[key], additional, getProps, key, ref);
303303 }
304304 });
305- return result;
305+ return Object.setPrototypeOf(result, Object.prototype);
306306 }
307307
308308 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export const FormatEnum = S.Literal(
523 "string",
@@ -80,7 +98,7 @@ export class Property extends S.Class<Property>("Property")({
8098 }) {}
8199
82100 export class Article extends S.Class<Article>("Article")({
83- "properties": S.Record({ key: S.String, value: Property}),
101+ "properties": mapSchema(Property),
84102 }) {}
85103
86104 export class Definitions extends S.Class<Definitions>("Definitions")({
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -288,7 +288,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
288288 if (val === null || typeof val !== "object" || Array.isArray(val)) {
289289 return invalidValue(l(ref || "object"), val, key, parent);
290290 }
291- const result: any = {};
291+ const result: any = Object.create(null);
292292 Object.getOwnPropertyNames(props).forEach(key => {
293293 const prop = props[key];
294294 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
299299 result[key] = transform(val[key], additional, getProps, key, ref);
300300 }
301301 });
302- return result;
302+ return Object.setPrototypeOf(result, Object.prototype);
303303 }
304304
305305 if (typ === "any") return val;
Test case

test/inputs/json/misc/77392.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -134,7 +134,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
134134 if (val === null || typeof val !== "object" || Array.isArray(val)) {
135135 return invalidValue(l(ref || "object"), val, key, parent);
136136 }
137- const result: any = {};
137+ const result: any = Object.create(null);
138138 Object.getOwnPropertyNames(props).forEach(key => {
139139 const prop = props[key];
140140 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
145145 result[key] = transform(val[key], additional, getProps, key, ref);
146146 }
147147 });
148- return result;
148+ return Object.setPrototypeOf(result, Object.prototype);
149149 }
150150
151151 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
122122 if (val === null || typeof val !== "object" || Array.isArray(val)) {
123123 return invalidValue(l(ref || "object"), val, key, parent);
124124 }
125- const result: any = {};
125+ const result: any = Object.create(null);
126126 Object.getOwnPropertyNames(props).forEach(key => {
127127 const prop = props[key];
128128 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
133133 result[key] = transform(val[key], additional, getProps, key, ref);
134134 }
135135 });
136- return result;
136+ return Object.setPrototypeOf(result, Object.prototype);
137137 }
138138
139139 if (typ === "any") return val;
Test case

test/inputs/json/misc/7d397.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -170,7 +170,7 @@ listClass =
170170 encodeListClass : ListClass -> Jenc.Value
171171 encodeListClass x =
172172 Jenc.object
173- [ ("properties", Jenc.dict identity encodeProperty x.properties)
173+ [ ("properties", makeDictEncoder identity encodeProperty x.properties)
174174 ]
175175
176176 property : Jdec.Decoder Property
@@ -339,6 +339,14 @@ encodeItems x =
339339
340340 --- encoder helpers
341341
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+
342350 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
343351 makeNullableEncoder f m =
344352 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -182,7 +182,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
182182 if (val === null || typeof val !== "object" || Array.isArray(val)) {
183183 return invalidValue(l(ref || "object"), val, key, parent);
184184 }
185- const result: any = {};
185+ const result: any = Object.create(null);
186186 Object.getOwnPropertyNames(props).forEach(key => {
187187 const prop = props[key];
188188 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
193193 result[key] = transform(val[key], additional, getProps, key, ref);
194194 }
195195 });
196- return result;
196+ return Object.setPrototypeOf(result, Object.prototype);
197197 }
198198
199199 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export const Type = S.Literal(
523 "string",
@@ -67,7 +85,7 @@ export class Property extends S.Class<Property>("Property")({
6785 }) {}
6886
6987 export class List extends S.Class<List>("List")({
70- "properties": S.Record({ key: S.String, value: Property}),
88+ "properties": mapSchema(Property),
7189 }) {}
7290
7391 export class Definitions extends S.Class<Definitions>("Definitions")({
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -180,7 +180,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
180180 if (val === null || typeof val !== "object" || Array.isArray(val)) {
181181 return invalidValue(l(ref || "object"), val, key, parent);
182182 }
183- const result: any = {};
183+ const result: any = Object.create(null);
184184 Object.getOwnPropertyNames(props).forEach(key => {
185185 const prop = props[key];
186186 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
191191 result[key] = transform(val[key], additional, getProps, key, ref);
192192 }
193193 });
194- return result;
194+ return Object.setPrototypeOf(result, Object.prototype);
195195 }
196196
197197 if (typ === "any") return val;
Test case

test/inputs/json/misc/7d722.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/7df41.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Test case

test/inputs/json/misc/7dfa6.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/7eb30.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 if (val === null || typeof val !== "object" || Array.isArray(val)) {
152152 return invalidValue(l(ref || "object"), val, key, parent);
153153 }
154- const result: any = {};
154+ const result: any = Object.create(null);
155155 Object.getOwnPropertyNames(props).forEach(key => {
156156 const prop = props[key];
157157 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
162162 result[key] = transform(val[key], additional, getProps, key, ref);
163163 }
164164 });
165- return result;
165+ return Object.setPrototypeOf(result, Object.prototype);
166166 }
167167
168168 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
144144 if (val === null || typeof val !== "object" || Array.isArray(val)) {
145145 return invalidValue(l(ref || "object"), val, key, parent);
146146 }
147- const result: any = {};
147+ const result: any = Object.create(null);
148148 Object.getOwnPropertyNames(props).forEach(key => {
149149 const prop = props[key];
150150 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
155155 result[key] = transform(val[key], additional, getProps, key, ref);
156156 }
157157 });
158- return result;
158+ return Object.setPrototypeOf(result, Object.prototype);
159159 }
160160
161161 if (typ === "any") return val;
Test case

test/inputs/json/misc/7f568.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -103,7 +103,7 @@ encodeQuickTypeElement x =
103103 , ("commits_url", Jenc.string x.commitsURL)
104104 , ("created_at", Jenc.string x.createdAt)
105105 , ("description", makeNullableEncoder Jenc.string x.description)
106- , ("files", Jenc.dict identity encodeFile x.files)
106+ , ("files", makeDictEncoder identity encodeFile x.files)
107107 , ("forks_url", Jenc.string x.forksURL)
108108 , ("git_pull_url", Jenc.string x.gitPullURL)
109109 , ("git_push_url", Jenc.string x.gitPushURL)
@@ -163,6 +163,14 @@ encodeLanguage x = case x of
163163
164164 --- encoder helpers
165165
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+
166174 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
167175 makeNullableEncoder f m =
168176 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
138138 if (val === null || typeof val !== "object" || Array.isArray(val)) {
139139 return invalidValue(l(ref || "object"), val, key, parent);
140140 }
141- const result: any = {};
141+ const result: any = Object.create(null);
142142 Object.getOwnPropertyNames(props).forEach(key => {
143143 const prop = props[key];
144144 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
149149 result[key] = transform(val[key], additional, getProps, key, ref);
150150 }
151151 });
152- return result;
152+ return Object.setPrototypeOf(result, Object.prototype);
153153 }
154154
155155 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export const Language = S.Literal(
523 "Markdown",
@@ -26,7 +44,7 @@ export class TopLevelElement extends S.Class<TopLevelElement>("TopLevelElement")
2644 "commits_url": S.String,
2745 "created_at": S.String.pipe(S.pattern(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/)),
2846 "description": S.NullOr(S.String),
29- "files": S.Record({ key: S.String, value: File}),
47+ "files": mapSchema(File),
3048 "forks_url": S.String,
3149 "git_pull_url": S.String,
3250 "git_push_url": S.String,
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
136136 if (val === null || typeof val !== "object" || Array.isArray(val)) {
137137 return invalidValue(l(ref || "object"), val, key, parent);
138138 }
139- const result: any = {};
139+ const result: any = Object.create(null);
140140 Object.getOwnPropertyNames(props).forEach(key => {
141141 const prop = props[key];
142142 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
147147 result[key] = transform(val[key], additional, getProps, key, ref);
148148 }
149149 });
150- return result;
150+ return Object.setPrototypeOf(result, Object.prototype);
151151 }
152152
153153 if (typ === "any") return val;
Test case

test/inputs/json/misc/7fbfb.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 if (val === null || typeof val !== "object" || Array.isArray(val)) {
136136 return invalidValue(l(ref || "object"), val, key, parent);
137137 }
138- const result: any = {};
138+ const result: any = Object.create(null);
139139 Object.getOwnPropertyNames(props).forEach(key => {
140140 const prop = props[key];
141141 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
146146 result[key] = transform(val[key], additional, getProps, key, ref);
147147 }
148148 });
149- return result;
149+ return Object.setPrototypeOf(result, Object.prototype);
150150 }
151151
152152 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
131131 if (val === null || typeof val !== "object" || Array.isArray(val)) {
132132 return invalidValue(l(ref || "object"), val, key, parent);
133133 }
134- const result: any = {};
134+ const result: any = Object.create(null);
135135 Object.getOwnPropertyNames(props).forEach(key => {
136136 const prop = props[key];
137137 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
142142 result[key] = transform(val[key], additional, getProps, key, ref);
143143 }
144144 });
145- return result;
145+ return Object.setPrototypeOf(result, Object.prototype);
146146 }
147147
148148 if (typ === "any") return val;
Test case

test/inputs/json/misc/80aff.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -126,7 +126,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
126126 if (val === null || typeof val !== "object" || Array.isArray(val)) {
127127 return invalidValue(l(ref || "object"), val, key, parent);
128128 }
129- const result: any = {};
129+ const result: any = Object.create(null);
130130 Object.getOwnPropertyNames(props).forEach(key => {
131131 const prop = props[key];
132132 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
137137 result[key] = transform(val[key], additional, getProps, key, ref);
138138 }
139139 });
140- return result;
140+ return Object.setPrototypeOf(result, Object.prototype);
141141 }
142142
143143 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
123123 if (val === null || typeof val !== "object" || Array.isArray(val)) {
124124 return invalidValue(l(ref || "object"), val, key, parent);
125125 }
126- const result: any = {};
126+ const result: any = Object.create(null);
127127 Object.getOwnPropertyNames(props).forEach(key => {
128128 const prop = props[key];
129129 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
134134 result[key] = transform(val[key], additional, getProps, key, ref);
135135 }
136136 });
137- return result;
137+ return Object.setPrototypeOf(result, Object.prototype);
138138 }
139139
140140 if (typ === "any") return val;
Test case

test/inputs/json/misc/82509.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 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
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 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
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Test case

test/inputs/json/misc/8592b.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -230,7 +230,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
230230 if (val === null || typeof val !== "object" || Array.isArray(val)) {
231231 return invalidValue(l(ref || "object"), val, key, parent);
232232 }
233- const result: any = {};
233+ const result: any = Object.create(null);
234234 Object.getOwnPropertyNames(props).forEach(key => {
235235 const prop = props[key];
236236 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
241241 result[key] = transform(val[key], additional, getProps, key, ref);
242242 }
243243 });
244- return result;
244+ return Object.setPrototypeOf(result, Object.prototype);
245245 }
246246
247247 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
219219 if (val === null || typeof val !== "object" || Array.isArray(val)) {
220220 return invalidValue(l(ref || "object"), val, key, parent);
221221 }
222- const result: any = {};
222+ const result: any = Object.create(null);
223223 Object.getOwnPropertyNames(props).forEach(key => {
224224 const prop = props[key];
225225 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
230230 result[key] = transform(val[key], additional, getProps, key, ref);
231231 }
232232 });
233- return result;
233+ return Object.setPrototypeOf(result, Object.prototype);
234234 }
235235
236236 if (typ === "any") return val;
Test case

test/inputs/json/misc/88130.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 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
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 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
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Test case

test/inputs/json/misc/8a62c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/908db.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 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
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 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
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/json/misc/9617f.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
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+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,8 +1,26 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
523 "base": S.String,
624 "date": S.String.pipe(S.pattern(/^\d{4}-\d{2}-\d{2}$/)),
7- "rates": S.Record({ key: S.String, value: S.Number}),
25+ "rates": mapSchema(S.Number),
826 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/96f7c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/9847b.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/json/misc/9929c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 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
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 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
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Test case

test/inputs/json/misc/996bd.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
151151 if (val === null || typeof val !== "object" || Array.isArray(val)) {
152152 return invalidValue(l(ref || "object"), val, key, parent);
153153 }
154- const result: any = {};
154+ const result: any = Object.create(null);
155155 Object.getOwnPropertyNames(props).forEach(key => {
156156 const prop = props[key];
157157 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
162162 result[key] = transform(val[key], additional, getProps, key, ref);
163163 }
164164 });
165- return result;
165+ return Object.setPrototypeOf(result, Object.prototype);
166166 }
167167
168168 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/9a503.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
137137 if (val === null || typeof val !== "object" || Array.isArray(val)) {
138138 return invalidValue(l(ref || "object"), val, key, parent);
139139 }
140- const result: any = {};
140+ const result: any = Object.create(null);
141141 Object.getOwnPropertyNames(props).forEach(key => {
142142 const prop = props[key];
143143 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
148148 result[key] = transform(val[key], additional, getProps, key, ref);
149149 }
150150 });
151- return result;
151+ return Object.setPrototypeOf(result, Object.prototype);
152152 }
153153
154154 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
134134 if (val === null || typeof val !== "object" || Array.isArray(val)) {
135135 return invalidValue(l(ref || "object"), val, key, parent);
136136 }
137- const result: any = {};
137+ const result: any = Object.create(null);
138138 Object.getOwnPropertyNames(props).forEach(key => {
139139 const prop = props[key];
140140 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
145145 result[key] = transform(val[key], additional, getProps, key, ref);
146146 }
147147 });
148- return result;
148+ return Object.setPrototypeOf(result, Object.prototype);
149149 }
150150
151151 if (typ === "any") return val;
Test case

test/inputs/json/misc/9ac3b.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
138138 if (val === null || typeof val !== "object" || Array.isArray(val)) {
139139 return invalidValue(l(ref || "object"), val, key, parent);
140140 }
141- const result: any = {};
141+ const result: any = Object.create(null);
142142 Object.getOwnPropertyNames(props).forEach(key => {
143143 const prop = props[key];
144144 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
149149 result[key] = transform(val[key], additional, getProps, key, ref);
150150 }
151151 });
152- return result;
152+ return Object.setPrototypeOf(result, Object.prototype);
153153 }
154154
155155 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
131131 if (val === null || typeof val !== "object" || Array.isArray(val)) {
132132 return invalidValue(l(ref || "object"), val, key, parent);
133133 }
134- const result: any = {};
134+ const result: any = Object.create(null);
135135 Object.getOwnPropertyNames(props).forEach(key => {
136136 const prop = props[key];
137137 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
142142 result[key] = transform(val[key], additional, getProps, key, ref);
143143 }
144144 });
145- return result;
145+ return Object.setPrototypeOf(result, Object.prototype);
146146 }
147147
148148 if (typ === "any") return val;
Test case

test/inputs/json/misc/9eed5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
136136 if (val === null || typeof val !== "object" || Array.isArray(val)) {
137137 return invalidValue(l(ref || "object"), val, key, parent);
138138 }
139- const result: any = {};
139+ const result: any = Object.create(null);
140140 Object.getOwnPropertyNames(props).forEach(key => {
141141 const prop = props[key];
142142 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
147147 result[key] = transform(val[key], additional, getProps, key, ref);
148148 }
149149 });
150- return result;
150+ return Object.setPrototypeOf(result, Object.prototype);
151151 }
152152
153153 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
134134 if (val === null || typeof val !== "object" || Array.isArray(val)) {
135135 return invalidValue(l(ref || "object"), val, key, parent);
136136 }
137- const result: any = {};
137+ const result: any = Object.create(null);
138138 Object.getOwnPropertyNames(props).forEach(key => {
139139 const prop = props[key];
140140 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
145145 result[key] = transform(val[key], additional, getProps, key, ref);
146146 }
147147 });
148- return result;
148+ return Object.setPrototypeOf(result, Object.prototype);
149149 }
150150
151151 if (typ === "any") return val;
Test case

test/inputs/json/misc/a0496.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -128,7 +128,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
128128 if (val === null || typeof val !== "object" || Array.isArray(val)) {
129129 return invalidValue(l(ref || "object"), val, key, parent);
130130 }
131- const result: any = {};
131+ const result: any = Object.create(null);
132132 Object.getOwnPropertyNames(props).forEach(key => {
133133 const prop = props[key];
134134 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
139139 result[key] = transform(val[key], additional, getProps, key, ref);
140140 }
141141 });
142- return result;
142+ return Object.setPrototypeOf(result, Object.prototype);
143143 }
144144
145145 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
125125 if (val === null || typeof val !== "object" || Array.isArray(val)) {
126126 return invalidValue(l(ref || "object"), val, key, parent);
127127 }
128- const result: any = {};
128+ const result: any = Object.create(null);
129129 Object.getOwnPropertyNames(props).forEach(key => {
130130 const prop = props[key];
131131 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
136136 result[key] = transform(val[key], additional, getProps, key, ref);
137137 }
138138 });
139- return result;
139+ return Object.setPrototypeOf(result, Object.prototype);
140140 }
141141
142142 if (typ === "any") return val;
Test case

test/inputs/json/misc/a1eca.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 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
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 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
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Test case

test/inputs/json/misc/a3d8c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -223,7 +223,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
223223 if (val === null || typeof val !== "object" || Array.isArray(val)) {
224224 return invalidValue(l(ref || "object"), val, key, parent);
225225 }
226- const result: any = {};
226+ const result: any = Object.create(null);
227227 Object.getOwnPropertyNames(props).forEach(key => {
228228 const prop = props[key];
229229 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
234234 result[key] = transform(val[key], additional, getProps, key, ref);
235235 }
236236 });
237- return result;
237+ return Object.setPrototypeOf(result, Object.prototype);
238238 }
239239
240240 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
217217 if (val === null || typeof val !== "object" || Array.isArray(val)) {
218218 return invalidValue(l(ref || "object"), val, key, parent);
219219 }
220- const result: any = {};
220+ const result: any = Object.create(null);
221221 Object.getOwnPropertyNames(props).forEach(key => {
222222 const prop = props[key];
223223 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
228228 result[key] = transform(val[key], additional, getProps, key, ref);
229229 }
230230 });
231- return result;
231+ return Object.setPrototypeOf(result, Object.prototype);
232232 }
233233
234234 if (typ === "any") return val;
Test case

test/inputs/json/misc/a45b0.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 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
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/json/misc/a71df.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/a9691.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
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+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,8 +1,26 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
523 "base": S.String,
624 "date": S.String.pipe(S.pattern(/^\d{4}-\d{2}-\d{2}$/)),
7- "rates": S.Record({ key: S.String, value: S.Number}),
25+ "rates": mapSchema(S.Number),
826 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/ab0d1.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 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
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/json/misc/abb4b.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/ac944.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
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+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,8 +1,26 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
523 "base": S.String,
624 "date": S.String.pipe(S.pattern(/^\d{4}-\d{2}-\d{2}$/)),
7- "rates": S.Record({ key: S.String, value: S.Number}),
25+ "rates": mapSchema(S.Number),
826 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/ad8be.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -174,7 +174,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
174174 if (val === null || typeof val !== "object" || Array.isArray(val)) {
175175 return invalidValue(l(ref || "object"), val, key, parent);
176176 }
177- const result: any = {};
177+ const result: any = Object.create(null);
178178 Object.getOwnPropertyNames(props).forEach(key => {
179179 const prop = props[key];
180180 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
185185 result[key] = transform(val[key], additional, getProps, key, ref);
186186 }
187187 });
188- return result;
188+ return Object.setPrototypeOf(result, Object.prototype);
189189 }
190190
191191 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
147147 if (val === null || typeof val !== "object" || Array.isArray(val)) {
148148 return invalidValue(l(ref || "object"), val, key, parent);
149149 }
150- const result: any = {};
150+ const result: any = Object.create(null);
151151 Object.getOwnPropertyNames(props).forEach(key => {
152152 const prop = props[key];
153153 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
158158 result[key] = transform(val[key], additional, getProps, key, ref);
159159 }
160160 });
161- return result;
161+ return Object.setPrototypeOf(result, Object.prototype);
162162 }
163163
164164 if (typ === "any") return val;
Test case

test/inputs/json/misc/ae7f0.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -204,7 +204,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
204204 if (val === null || typeof val !== "object" || Array.isArray(val)) {
205205 return invalidValue(l(ref || "object"), val, key, parent);
206206 }
207- const result: any = {};
207+ const result: any = Object.create(null);
208208 Object.getOwnPropertyNames(props).forEach(key => {
209209 const prop = props[key];
210210 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
215215 result[key] = transform(val[key], additional, getProps, key, ref);
216216 }
217217 });
218- return result;
218+ return Object.setPrototypeOf(result, Object.prototype);
219219 }
220220
221221 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
195195 if (val === null || typeof val !== "object" || Array.isArray(val)) {
196196 return invalidValue(l(ref || "object"), val, key, parent);
197197 }
198- const result: any = {};
198+ const result: any = Object.create(null);
199199 Object.getOwnPropertyNames(props).forEach(key => {
200200 const prop = props[key];
201201 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
206206 result[key] = transform(val[key], additional, getProps, key, ref);
207207 }
208208 });
209- return result;
209+ return Object.setPrototypeOf(result, Object.prototype);
210210 }
211211
212212 if (typ === "any") return val;
Test case

test/inputs/json/misc/ae9ca.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -153,7 +153,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
153153 if (val === null || typeof val !== "object" || Array.isArray(val)) {
154154 return invalidValue(l(ref || "object"), val, key, parent);
155155 }
156- const result: any = {};
156+ const result: any = Object.create(null);
157157 Object.getOwnPropertyNames(props).forEach(key => {
158158 const prop = props[key];
159159 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
164164 result[key] = transform(val[key], additional, getProps, key, ref);
165165 }
166166 });
167- return result;
167+ return Object.setPrototypeOf(result, Object.prototype);
168168 }
169169
170170 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
143143 if (val === null || typeof val !== "object" || Array.isArray(val)) {
144144 return invalidValue(l(ref || "object"), val, key, parent);
145145 }
146- const result: any = {};
146+ const result: any = Object.create(null);
147147 Object.getOwnPropertyNames(props).forEach(key => {
148148 const prop = props[key];
149149 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
154154 result[key] = transform(val[key], additional, getProps, key, ref);
155155 }
156156 });
157- return result;
157+ return Object.setPrototypeOf(result, Object.prototype);
158158 }
159159
160160 if (typ === "any") return val;
Test case

test/inputs/json/misc/af2d1.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -215,7 +215,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
215215 if (val === null || typeof val !== "object" || Array.isArray(val)) {
216216 return invalidValue(l(ref || "object"), val, key, parent);
217217 }
218- const result: any = {};
218+ const result: any = Object.create(null);
219219 Object.getOwnPropertyNames(props).forEach(key => {
220220 const prop = props[key];
221221 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
226226 result[key] = transform(val[key], additional, getProps, key, ref);
227227 }
228228 });
229- return result;
229+ return Object.setPrototypeOf(result, Object.prototype);
230230 }
231231
232232 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
193193 if (val === null || typeof val !== "object" || Array.isArray(val)) {
194194 return invalidValue(l(ref || "object"), val, key, parent);
195195 }
196- const result: any = {};
196+ const result: any = Object.create(null);
197197 Object.getOwnPropertyNames(props).forEach(key => {
198198 const prop = props[key];
199199 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
204204 result[key] = transform(val[key], additional, getProps, key, ref);
205205 }
206206 });
207- return result;
207+ return Object.setPrototypeOf(result, Object.prototype);
208208 }
209209
210210 if (typ === "any") return val;
Test case

test/inputs/json/misc/b4865.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 if (val === null || typeof val !== "object" || Array.isArray(val)) {
136136 return invalidValue(l(ref || "object"), val, key, parent);
137137 }
138- const result: any = {};
138+ const result: any = Object.create(null);
139139 Object.getOwnPropertyNames(props).forEach(key => {
140140 const prop = props[key];
141141 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
146146 result[key] = transform(val[key], additional, getProps, key, ref);
147147 }
148148 });
149- return result;
149+ return Object.setPrototypeOf(result, Object.prototype);
150150 }
151151
152152 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
131131 if (val === null || typeof val !== "object" || Array.isArray(val)) {
132132 return invalidValue(l(ref || "object"), val, key, parent);
133133 }
134- const result: any = {};
134+ const result: any = Object.create(null);
135135 Object.getOwnPropertyNames(props).forEach(key => {
136136 const prop = props[key];
137137 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
142142 result[key] = transform(val[key], additional, getProps, key, ref);
143143 }
144144 });
145- return result;
145+ return Object.setPrototypeOf(result, Object.prototype);
146146 }
147147
148148 if (typ === "any") return val;
Test case

test/inputs/json/misc/b6f2c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/b6fe5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/json/misc/b9f64.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 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
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 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
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Test case

test/inputs/json/misc/bb1ec.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/be234.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -269,7 +269,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
269269 if (val === null || typeof val !== "object" || Array.isArray(val)) {
270270 return invalidValue(l(ref || "object"), val, key, parent);
271271 }
272- const result: any = {};
272+ const result: any = Object.create(null);
273273 Object.getOwnPropertyNames(props).forEach(key => {
274274 const prop = props[key];
275275 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
280280 result[key] = transform(val[key], additional, getProps, key, ref);
281281 }
282282 });
283- return result;
283+ return Object.setPrototypeOf(result, Object.prototype);
284284 }
285285
286286 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
256256 if (val === null || typeof val !== "object" || Array.isArray(val)) {
257257 return invalidValue(l(ref || "object"), val, key, parent);
258258 }
259- const result: any = {};
259+ const result: any = Object.create(null);
260260 Object.getOwnPropertyNames(props).forEach(key => {
261261 const prop = props[key];
262262 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
267267 result[key] = transform(val[key], additional, getProps, key, ref);
268268 }
269269 });
270- return result;
270+ return Object.setPrototypeOf(result, Object.prototype);
271271 }
272272
273273 if (typ === "any") return val;
Test case

test/inputs/json/misc/c0356.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -60,7 +60,7 @@ quickType =
6060 encodeQuickType : QuickType -> Jenc.Value
6161 encodeQuickType x =
6262 Jenc.object
63- [ ("data", Jenc.dict identity encodeDatum x.data)
63+ [ ("data", makeDictEncoder identity encodeDatum x.data)
6464 , ("description", encodeDescription x.description)
6565 ]
6666
@@ -94,6 +94,14 @@ encodeDescription x =
9494
9595 --- encoder helpers
9696
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+
97105 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
98106 makeNullableEncoder f m =
99107 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 if (val === null || typeof val !== "object" || Array.isArray(val)) {
120120 return invalidValue(l(ref || "object"), val, key, parent);
121121 }
122- const result: any = {};
122+ const result: any = Object.create(null);
123123 Object.getOwnPropertyNames(props).forEach(key => {
124124 const prop = props[key];
125125 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
130130 result[key] = transform(val[key], additional, getProps, key, ref);
131131 }
132132 });
133- return result;
133+ return Object.setPrototypeOf(result, Object.prototype);
134134 }
135135
136136 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class Description extends S.Class<Description>("Description")({
523 "base_period": S.String,
@@ -13,6 +31,6 @@ export class Datum extends S.Class<Datum>("Datum")({
1331 }) {}
1432
1533 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
16- "data": S.Record({ key: S.String, value: Datum}),
34+ "data": mapSchema(Datum),
1735 "description": Description,
1836 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 if (val === null || typeof val !== "object" || Array.isArray(val)) {
120120 return invalidValue(l(ref || "object"), val, key, parent);
121121 }
122- const result: any = {};
122+ const result: any = Object.create(null);
123123 Object.getOwnPropertyNames(props).forEach(key => {
124124 const prop = props[key];
125125 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
130130 result[key] = transform(val[key], additional, getProps, key, ref);
131131 }
132132 });
133- return result;
133+ return Object.setPrototypeOf(result, Object.prototype);
134134 }
135135
136136 if (typ === "any") return val;
Test case

test/inputs/json/misc/c0a3a.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/c3303.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -220,7 +220,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
220220 if (val === null || typeof val !== "object" || Array.isArray(val)) {
221221 return invalidValue(l(ref || "object"), val, key, parent);
222222 }
223- const result: any = {};
223+ const result: any = Object.create(null);
224224 Object.getOwnPropertyNames(props).forEach(key => {
225225 const prop = props[key];
226226 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
231231 result[key] = transform(val[key], additional, getProps, key, ref);
232232 }
233233 });
234- return result;
234+ return Object.setPrototypeOf(result, Object.prototype);
235235 }
236236
237237 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
214214 if (val === null || typeof val !== "object" || Array.isArray(val)) {
215215 return invalidValue(l(ref || "object"), val, key, parent);
216216 }
217- const result: any = {};
217+ const result: any = Object.create(null);
218218 Object.getOwnPropertyNames(props).forEach(key => {
219219 const prop = props[key];
220220 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
225225 result[key] = transform(val[key], additional, getProps, key, ref);
226226 }
227227 });
228- return result;
228+ return Object.setPrototypeOf(result, Object.prototype);
229229 }
230230
231231 if (typ === "any") return val;
Test case

test/inputs/json/misc/c6cfd.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/c8c7e.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 if (val === null || typeof val !== "object" || Array.isArray(val)) {
136136 return invalidValue(l(ref || "object"), val, key, parent);
137137 }
138- const result: any = {};
138+ const result: any = Object.create(null);
139139 Object.getOwnPropertyNames(props).forEach(key => {
140140 const prop = props[key];
141141 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
146146 result[key] = transform(val[key], additional, getProps, key, ref);
147147 }
148148 });
149- return result;
149+ return Object.setPrototypeOf(result, Object.prototype);
150150 }
151151
152152 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
131131 if (val === null || typeof val !== "object" || Array.isArray(val)) {
132132 return invalidValue(l(ref || "object"), val, key, parent);
133133 }
134- const result: any = {};
134+ const result: any = Object.create(null);
135135 Object.getOwnPropertyNames(props).forEach(key => {
136136 const prop = props[key];
137137 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
142142 result[key] = transform(val[key], additional, getProps, key, ref);
143143 }
144144 });
145- return result;
145+ return Object.setPrototypeOf(result, Object.prototype);
146146 }
147147
148148 if (typ === "any") return val;
Test case

test/inputs/json/misc/cb0cc.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -130,7 +130,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
130130 if (val === null || typeof val !== "object" || Array.isArray(val)) {
131131 return invalidValue(l(ref || "object"), val, key, parent);
132132 }
133- const result: any = {};
133+ const result: any = Object.create(null);
134134 Object.getOwnPropertyNames(props).forEach(key => {
135135 const prop = props[key];
136136 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
141141 result[key] = transform(val[key], additional, getProps, key, ref);
142142 }
143143 });
144- return result;
144+ return Object.setPrototypeOf(result, Object.prototype);
145145 }
146146
147147 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
124124 if (val === null || typeof val !== "object" || Array.isArray(val)) {
125125 return invalidValue(l(ref || "object"), val, key, parent);
126126 }
127- const result: any = {};
127+ const result: any = Object.create(null);
128128 Object.getOwnPropertyNames(props).forEach(key => {
129129 const prop = props[key];
130130 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
135135 result[key] = transform(val[key], additional, getProps, key, ref);
136136 }
137137 });
138- return result;
138+ return Object.setPrototypeOf(result, Object.prototype);
139139 }
140140
141141 if (typ === "any") return val;
Test case

test/inputs/json/misc/cb81e.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -55,7 +55,7 @@ quickType =
5555 encodeQuickType : QuickType -> Jenc.Value
5656 encodeQuickType x =
5757 Jenc.object
58- [ ("data", Jenc.dict identity Jenc.string x.data)
58+ [ ("data", makeDictEncoder identity Jenc.string x.data)
5959 , ("description", encodeDescription x.description)
6060 ]
6161
@@ -78,6 +78,14 @@ encodeDescription x =
7878
7979 --- encoder helpers
8080
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+
8189 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
8290 makeNullableEncoder f m =
8391 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class Description extends S.Class<Description>("Description")({
523 "base_period": S.String,
@@ -9,6 +27,6 @@ export class Description extends S.Class<Description>("Description")({
927 }) {}
1028
1129 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
12- "data": S.Record({ key: S.String, value: S.String}),
30+ "data": mapSchema(S.String),
1331 "description": Description,
1432 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/json/misc/ccd18.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/cd238.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
140140 if (val === null || typeof val !== "object" || Array.isArray(val)) {
141141 return invalidValue(l(ref || "object"), val, key, parent);
142142 }
143- const result: any = {};
143+ const result: any = Object.create(null);
144144 Object.getOwnPropertyNames(props).forEach(key => {
145145 const prop = props[key];
146146 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
151151 result[key] = transform(val[key], additional, getProps, key, ref);
152152 }
153153 });
154- return result;
154+ return Object.setPrototypeOf(result, Object.prototype);
155155 }
156156
157157 if (typ === "any") return val;
Test case

test/inputs/json/misc/cd463.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
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+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,8 +1,26 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
523 "base": S.String,
624 "date": S.String.pipe(S.pattern(/^\d{4}-\d{2}-\d{2}$/)),
7- "rates": S.Record({ key: S.String, value: S.Number}),
25+ "rates": mapSchema(S.Number),
826 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/cda6c.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 if (val === null || typeof val !== "object" || Array.isArray(val)) {
136136 return invalidValue(l(ref || "object"), val, key, parent);
137137 }
138- const result: any = {};
138+ const result: any = Object.create(null);
139139 Object.getOwnPropertyNames(props).forEach(key => {
140140 const prop = props[key];
141141 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
146146 result[key] = transform(val[key], additional, getProps, key, ref);
147147 }
148148 });
149- return result;
149+ return Object.setPrototypeOf(result, Object.prototype);
150150 }
151151
152152 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
131131 if (val === null || typeof val !== "object" || Array.isArray(val)) {
132132 return invalidValue(l(ref || "object"), val, key, parent);
133133 }
134- const result: any = {};
134+ const result: any = Object.create(null);
135135 Object.getOwnPropertyNames(props).forEach(key => {
136136 const prop = props[key];
137137 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
142142 result[key] = transform(val[key], additional, getProps, key, ref);
143143 }
144144 });
145- return result;
145+ return Object.setPrototypeOf(result, Object.prototype);
146146 }
147147
148148 if (typ === "any") return val;
Test case

test/inputs/json/misc/cf0d8.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 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
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 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
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Test case

test/inputs/json/misc/cfbce.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -51,11 +51,19 @@ encodeQuickType x =
5151 Jenc.object
5252 [ ("base", Jenc.string x.base)
5353 , ("date", Jenc.string x.date)
54- , ("rates", Jenc.dict identity Jenc.float x.rates)
54+ , ("rates", makeDictEncoder identity Jenc.float x.rates)
5555 ]
5656
5757 --- encoder helpers
5858
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+
5967 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
6068 makeNullableEncoder f m =
6169 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,8 +1,26 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
523 "base": S.String,
624 "date": S.String.pipe(S.pattern(/^\d{4}-\d{2}-\d{2}$/)),
7- "rates": S.Record({ key: S.String, value: S.Number}),
25+ "rates": mapSchema(S.Number),
826 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/misc/d0908.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/d23d5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -125,7 +125,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
125125 if (val === null || typeof val !== "object" || Array.isArray(val)) {
126126 return invalidValue(l(ref || "object"), val, key, parent);
127127 }
128- const result: any = {};
128+ const result: any = Object.create(null);
129129 Object.getOwnPropertyNames(props).forEach(key => {
130130 const prop = props[key];
131131 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
136136 result[key] = transform(val[key], additional, getProps, key, ref);
137137 }
138138 });
139- return result;
139+ return Object.setPrototypeOf(result, Object.prototype);
140140 }
141141
142142 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
122122 if (val === null || typeof val !== "object" || Array.isArray(val)) {
123123 return invalidValue(l(ref || "object"), val, key, parent);
124124 }
125- const result: any = {};
125+ const result: any = Object.create(null);
126126 Object.getOwnPropertyNames(props).forEach(key => {
127127 const prop = props[key];
128128 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
133133 result[key] = transform(val[key], additional, getProps, key, ref);
134134 }
135135 });
136- return result;
136+ return Object.setPrototypeOf(result, Object.prototype);
137137 }
138138
139139 if (typ === "any") return val;
Test case

test/inputs/json/misc/dbfb3.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -209,7 +209,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
209209 if (val === null || typeof val !== "object" || Array.isArray(val)) {
210210 return invalidValue(l(ref || "object"), val, key, parent);
211211 }
212- const result: any = {};
212+ const result: any = Object.create(null);
213213 Object.getOwnPropertyNames(props).forEach(key => {
214214 const prop = props[key];
215215 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
220220 result[key] = transform(val[key], additional, getProps, key, ref);
221221 }
222222 });
223- return result;
223+ return Object.setPrototypeOf(result, Object.prototype);
224224 }
225225
226226 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
207207 if (val === null || typeof val !== "object" || Array.isArray(val)) {
208208 return invalidValue(l(ref || "object"), val, key, parent);
209209 }
210- const result: any = {};
210+ const result: any = Object.create(null);
211211 Object.getOwnPropertyNames(props).forEach(key => {
212212 const prop = props[key];
213213 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
218218 result[key] = transform(val[key], additional, getProps, key, ref);
219219 }
220220 });
221- return result;
221+ return Object.setPrototypeOf(result, Object.prototype);
222222 }
223223
224224 if (typ === "any") return val;
Test case

test/inputs/json/misc/dc44f.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
233233 if (val === null || typeof val !== "object" || Array.isArray(val)) {
234234 return invalidValue(l(ref || "object"), val, key, parent);
235235 }
236- const result: any = {};
236+ const result: any = Object.create(null);
237237 Object.getOwnPropertyNames(props).forEach(key => {
238238 const prop = props[key];
239239 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
244244 result[key] = transform(val[key], additional, getProps, key, ref);
245245 }
246246 });
247- return result;
247+ return Object.setPrototypeOf(result, Object.prototype);
248248 }
249249
250250 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
175175 if (val === null || typeof val !== "object" || Array.isArray(val)) {
176176 return invalidValue(l(ref || "object"), val, key, parent);
177177 }
178- const result: any = {};
178+ const result: any = Object.create(null);
179179 Object.getOwnPropertyNames(props).forEach(key => {
180180 const prop = props[key];
181181 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
186186 result[key] = transform(val[key], additional, getProps, key, ref);
187187 }
188188 });
189- return result;
189+ return Object.setPrototypeOf(result, Object.prototype);
190190 }
191191
192192 if (typ === "any") return val;
Test case

test/inputs/json/misc/dd1ce.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
233233 if (val === null || typeof val !== "object" || Array.isArray(val)) {
234234 return invalidValue(l(ref || "object"), val, key, parent);
235235 }
236- const result: any = {};
236+ const result: any = Object.create(null);
237237 Object.getOwnPropertyNames(props).forEach(key => {
238238 const prop = props[key];
239239 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
244244 result[key] = transform(val[key], additional, getProps, key, ref);
245245 }
246246 });
247- return result;
247+ return Object.setPrototypeOf(result, Object.prototype);
248248 }
249249
250250 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
175175 if (val === null || typeof val !== "object" || Array.isArray(val)) {
176176 return invalidValue(l(ref || "object"), val, key, parent);
177177 }
178- const result: any = {};
178+ const result: any = Object.create(null);
179179 Object.getOwnPropertyNames(props).forEach(key => {
180180 const prop = props[key];
181181 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
186186 result[key] = transform(val[key], additional, getProps, key, ref);
187187 }
188188 });
189- return result;
189+ return Object.setPrototypeOf(result, Object.prototype);
190190 }
191191
192192 if (typ === "any") return val;
Test case

test/inputs/json/misc/dec3a.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
168168 if (val === null || typeof val !== "object" || Array.isArray(val)) {
169169 return invalidValue(l(ref || "object"), val, key, parent);
170170 }
171- const result: any = {};
171+ const result: any = Object.create(null);
172172 Object.getOwnPropertyNames(props).forEach(key => {
173173 const prop = props[key];
174174 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
179179 result[key] = transform(val[key], additional, getProps, key, ref);
180180 }
181181 });
182- return result;
182+ return Object.setPrototypeOf(result, Object.prototype);
183183 }
184184
185185 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
168168 if (val === null || typeof val !== "object" || Array.isArray(val)) {
169169 return invalidValue(l(ref || "object"), val, key, parent);
170170 }
171- const result: any = {};
171+ const result: any = Object.create(null);
172172 Object.getOwnPropertyNames(props).forEach(key => {
173173 const prop = props[key];
174174 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
179179 result[key] = transform(val[key], additional, getProps, key, ref);
180180 }
181181 });
182- return result;
182+ return Object.setPrototypeOf(result, Object.prototype);
183183 }
184184
185185 if (typ === "any") return val;
Test case

test/inputs/json/misc/df957.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 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
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
205205 if (val === null || typeof val !== "object" || Array.isArray(val)) {
206206 return invalidValue(l(ref || "object"), val, key, parent);
207207 }
208- const result: any = {};
208+ const result: any = Object.create(null);
209209 Object.getOwnPropertyNames(props).forEach(key => {
210210 const prop = props[key];
211211 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
216216 result[key] = transform(val[key], additional, getProps, key, ref);
217217 }
218218 });
219- return result;
219+ return Object.setPrototypeOf(result, Object.prototype);
220220 }
221221
222222 if (typ === "any") return val;
Test case

test/inputs/json/misc/e0ac7.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -217,7 +217,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
217217 if (val === null || typeof val !== "object" || Array.isArray(val)) {
218218 return invalidValue(l(ref || "object"), val, key, parent);
219219 }
220- const result: any = {};
220+ const result: any = Object.create(null);
221221 Object.getOwnPropertyNames(props).forEach(key => {
222222 const prop = props[key];
223223 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
228228 result[key] = transform(val[key], additional, getProps, key, ref);
229229 }
230230 });
231- return result;
231+ return Object.setPrototypeOf(result, Object.prototype);
232232 }
233233
234234 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
213213 if (val === null || typeof val !== "object" || Array.isArray(val)) {
214214 return invalidValue(l(ref || "object"), val, key, parent);
215215 }
216- const result: any = {};
216+ const result: any = Object.create(null);
217217 Object.getOwnPropertyNames(props).forEach(key => {
218218 const prop = props[key];
219219 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
224224 result[key] = transform(val[key], additional, getProps, key, ref);
225225 }
226226 });
227- return result;
227+ return Object.setPrototypeOf(result, Object.prototype);
228228 }
229229
230230 if (typ === "any") return val;
Test case

test/inputs/json/misc/e2915.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -208,7 +208,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
208208 if (val === null || typeof val !== "object" || Array.isArray(val)) {
209209 return invalidValue(l(ref || "object"), val, key, parent);
210210 }
211- const result: any = {};
211+ const result: any = Object.create(null);
212212 Object.getOwnPropertyNames(props).forEach(key => {
213213 const prop = props[key];
214214 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
219219 result[key] = transform(val[key], additional, getProps, key, ref);
220220 }
221221 });
222- return result;
222+ return Object.setPrototypeOf(result, Object.prototype);
223223 }
224224
225225 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
207207 if (val === null || typeof val !== "object" || Array.isArray(val)) {
208208 return invalidValue(l(ref || "object"), val, key, parent);
209209 }
210- const result: any = {};
210+ const result: any = Object.create(null);
211211 Object.getOwnPropertyNames(props).forEach(key => {
212212 const prop = props[key];
213213 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
218218 result[key] = transform(val[key], additional, getProps, key, ref);
219219 }
220220 });
221- return result;
221+ return Object.setPrototypeOf(result, Object.prototype);
222222 }
223223
224224 if (typ === "any") return val;
Test case

test/inputs/json/misc/e2a58.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/json/misc/e324e.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -166,7 +166,7 @@ rate =
166166 encodeRate : Rate -> Jenc.Value
167167 encodeRate x =
168168 Jenc.object
169- [ ("properties", Jenc.dict identity encodeProperty x.properties)
169+ [ ("properties", makeDictEncoder identity encodeProperty x.properties)
170170 ]
171171
172172 property : Jdec.Decoder Property
@@ -322,6 +322,14 @@ encodeItems x =
322322
323323 --- encoder helpers
324324
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+
325333 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
326334 makeNullableEncoder f m =
327335 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -179,7 +179,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
179179 if (val === null || typeof val !== "object" || Array.isArray(val)) {
180180 return invalidValue(l(ref || "object"), val, key, parent);
181181 }
182- const result: any = {};
182+ const result: any = Object.create(null);
183183 Object.getOwnPropertyNames(props).forEach(key => {
184184 const prop = props[key];
185185 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
190190 result[key] = transform(val[key], additional, getProps, key, ref);
191191 }
192192 });
193- return result;
193+ return Object.setPrototypeOf(result, Object.prototype);
194194 }
195195
196196 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export const Type = S.Literal(
523 "string",
@@ -61,7 +79,7 @@ export class Property extends S.Class<Property>("Property")({
6179 }) {}
6280
6381 export class Rate extends S.Class<Rate>("Rate")({
64- "properties": S.Record({ key: S.String, value: Property}),
82+ "properties": mapSchema(Property),
6583 }) {}
6684
6785 export class Definitions extends S.Class<Definitions>("Definitions")({
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -178,7 +178,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
178178 if (val === null || typeof val !== "object" || Array.isArray(val)) {
179179 return invalidValue(l(ref || "object"), val, key, parent);
180180 }
181- const result: any = {};
181+ const result: any = Object.create(null);
182182 Object.getOwnPropertyNames(props).forEach(key => {
183183 const prop = props[key];
184184 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
189189 result[key] = transform(val[key], additional, getProps, key, ref);
190190 }
191191 });
192- return result;
192+ return Object.setPrototypeOf(result, Object.prototype);
193193 }
194194
195195 if (typ === "any") return val;
Test case

test/inputs/json/misc/e53b5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
135135 if (val === null || typeof val !== "object" || Array.isArray(val)) {
136136 return invalidValue(l(ref || "object"), val, key, parent);
137137 }
138- const result: any = {};
138+ const result: any = Object.create(null);
139139 Object.getOwnPropertyNames(props).forEach(key => {
140140 const prop = props[key];
141141 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
146146 result[key] = transform(val[key], additional, getProps, key, ref);
147147 }
148148 });
149- return result;
149+ return Object.setPrototypeOf(result, Object.prototype);
150150 }
151151
152152 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
131131 if (val === null || typeof val !== "object" || Array.isArray(val)) {
132132 return invalidValue(l(ref || "object"), val, key, parent);
133133 }
134- const result: any = {};
134+ const result: any = Object.create(null);
135135 Object.getOwnPropertyNames(props).forEach(key => {
136136 const prop = props[key];
137137 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
142142 result[key] = transform(val[key], additional, getProps, key, ref);
143143 }
144144 });
145- return result;
145+ return Object.setPrototypeOf(result, Object.prototype);
146146 }
147147
148148 if (typ === "any") return val;
Test case

test/inputs/json/misc/e64a0.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 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
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Test case

test/inputs/json/misc/e8a0b.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 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
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/json/misc/e8b04.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -377,7 +377,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
377377 if (val === null || typeof val !== "object" || Array.isArray(val)) {
378378 return invalidValue(l(ref || "object"), val, key, parent);
379379 }
380- const result: any = {};
380+ const result: any = Object.create(null);
381381 Object.getOwnPropertyNames(props).forEach(key => {
382382 const prop = props[key];
383383 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
388388 result[key] = transform(val[key], additional, getProps, key, ref);
389389 }
390390 });
391- return result;
391+ return Object.setPrototypeOf(result, Object.prototype);
392392 }
393393
394394 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
338338 if (val === null || typeof val !== "object" || Array.isArray(val)) {
339339 return invalidValue(l(ref || "object"), val, key, parent);
340340 }
341- const result: any = {};
341+ const result: any = Object.create(null);
342342 Object.getOwnPropertyNames(props).forEach(key => {
343343 const prop = props[key];
344344 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
349349 result[key] = transform(val[key], additional, getProps, key, ref);
350350 }
351351 });
352- return result;
352+ return Object.setPrototypeOf(result, Object.prototype);
353353 }
354354
355355 if (typ === "any") return val;
Test case

test/inputs/json/misc/ed095.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -36,10 +36,18 @@ quickType : Jdec.Decoder QuickType
3636 quickType = Jdec.dict Jdec.string
3737
3838 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)
4040
4141 --- encoder helpers
4242
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+
4351 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
4452 makeNullableEncoder f m =
4553 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 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
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,4 +1,22 @@
11 import * as S from "effect/Schema";
22
3-export const TopLevel = S.Record({ key: S.String, value: S.String});
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
21+export const TopLevel = mapSchema(S.String);
422 export type TopLevel = S.Schema.Type<typeof TopLevel>;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 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
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Test case

test/inputs/json/misc/f22f5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -201,7 +201,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
201201 if (val === null || typeof val !== "object" || Array.isArray(val)) {
202202 return invalidValue(l(ref || "object"), val, key, parent);
203203 }
204- const result: any = {};
204+ const result: any = Object.create(null);
205205 Object.getOwnPropertyNames(props).forEach(key => {
206206 const prop = props[key];
207207 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
212212 result[key] = transform(val[key], additional, getProps, key, ref);
213213 }
214214 });
215- return result;
215+ return Object.setPrototypeOf(result, Object.prototype);
216216 }
217217
218218 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
193193 if (val === null || typeof val !== "object" || Array.isArray(val)) {
194194 return invalidValue(l(ref || "object"), val, key, parent);
195195 }
196- const result: any = {};
196+ const result: any = Object.create(null);
197197 Object.getOwnPropertyNames(props).forEach(key => {
198198 const prop = props[key];
199199 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
204204 result[key] = transform(val[key], additional, getProps, key, ref);
205205 }
206206 });
207- return result;
207+ return Object.setPrototypeOf(result, Object.prototype);
208208 }
209209
210210 if (typ === "any") return val;
Test case

test/inputs/json/misc/f3139.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/json/misc/f3edf.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 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
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/json/misc/f466a.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 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
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/json/misc/f6a65.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -224,7 +224,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
224224 if (val === null || typeof val !== "object" || Array.isArray(val)) {
225225 return invalidValue(l(ref || "object"), val, key, parent);
226226 }
227- const result: any = {};
227+ const result: any = Object.create(null);
228228 Object.getOwnPropertyNames(props).forEach(key => {
229229 const prop = props[key];
230230 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
235235 result[key] = transform(val[key], additional, getProps, key, ref);
236236 }
237237 });
238- return result;
238+ return Object.setPrototypeOf(result, Object.prototype);
239239 }
240240
241241 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
215215 if (val === null || typeof val !== "object" || Array.isArray(val)) {
216216 return invalidValue(l(ref || "object"), val, key, parent);
217217 }
218- const result: any = {};
218+ const result: any = Object.create(null);
219219 Object.getOwnPropertyNames(props).forEach(key => {
220220 const prop = props[key];
221221 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
226226 result[key] = transform(val[key], additional, getProps, key, ref);
227227 }
228228 });
229- return result;
229+ return Object.setPrototypeOf(result, Object.prototype);
230230 }
231231
232232 if (typ === "any") return val;
Test case

test/inputs/json/misc/f74d5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -223,7 +223,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
223223 if (val === null || typeof val !== "object" || Array.isArray(val)) {
224224 return invalidValue(l(ref || "object"), val, key, parent);
225225 }
226- const result: any = {};
226+ const result: any = Object.create(null);
227227 Object.getOwnPropertyNames(props).forEach(key => {
228228 const prop = props[key];
229229 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
234234 result[key] = transform(val[key], additional, getProps, key, ref);
235235 }
236236 });
237- return result;
237+ return Object.setPrototypeOf(result, Object.prototype);
238238 }
239239
240240 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
217217 if (val === null || typeof val !== "object" || Array.isArray(val)) {
218218 return invalidValue(l(ref || "object"), val, key, parent);
219219 }
220- const result: any = {};
220+ const result: any = Object.create(null);
221221 Object.getOwnPropertyNames(props).forEach(key => {
222222 const prop = props[key];
223223 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
228228 result[key] = transform(val[key], additional, getProps, key, ref);
229229 }
230230 });
231- return result;
231+ return Object.setPrototypeOf(result, Object.prototype);
232232 }
233233
234234 if (typ === "any") return val;
Test case

test/inputs/json/misc/f82d9.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -192,7 +192,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
192192 if (val === null || typeof val !== "object" || Array.isArray(val)) {
193193 return invalidValue(l(ref || "object"), val, key, parent);
194194 }
195- const result: any = {};
195+ const result: any = Object.create(null);
196196 Object.getOwnPropertyNames(props).forEach(key => {
197197 const prop = props[key];
198198 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
203203 result[key] = transform(val[key], additional, getProps, key, ref);
204204 }
205205 });
206- return result;
206+ return Object.setPrototypeOf(result, Object.prototype);
207207 }
208208
209209 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
191191 if (val === null || typeof val !== "object" || Array.isArray(val)) {
192192 return invalidValue(l(ref || "object"), val, key, parent);
193193 }
194- const result: any = {};
194+ const result: any = Object.create(null);
195195 Object.getOwnPropertyNames(props).forEach(key => {
196196 const prop = props[key];
197197 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
202202 result[key] = transform(val[key], additional, getProps, key, ref);
203203 }
204204 });
205- return result;
205+ return Object.setPrototypeOf(result, Object.prototype);
206206 }
207207
208208 if (typ === "any") return val;
Test case

test/inputs/json/misc/f974d.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/misc/faff5.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/misc/fcca3.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -320,7 +320,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
320320 if (val === null || typeof val !== "object" || Array.isArray(val)) {
321321 return invalidValue(l(ref || "object"), val, key, parent);
322322 }
323- const result: any = {};
323+ const result: any = Object.create(null);
324324 Object.getOwnPropertyNames(props).forEach(key => {
325325 const prop = props[key];
326326 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
331331 result[key] = transform(val[key], additional, getProps, key, ref);
332332 }
333333 });
334- return result;
334+ return Object.setPrototypeOf(result, Object.prototype);
335335 }
336336
337337 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
317317 if (val === null || typeof val !== "object" || Array.isArray(val)) {
318318 return invalidValue(l(ref || "object"), val, key, parent);
319319 }
320- const result: any = {};
320+ const result: any = Object.create(null);
321321 Object.getOwnPropertyNames(props).forEach(key => {
322322 const prop = props[key];
323323 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
328328 result[key] = transform(val[key], additional, getProps, key, ref);
329329 }
330330 });
331- return result;
331+ return Object.setPrototypeOf(result, Object.prototype);
332332 }
333333
334334 if (typ === "any") return val;
Test case

test/inputs/json/misc/fd329.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -61,7 +61,7 @@ quickType =
6161 encodeQuickType : QuickType -> Jenc.Value
6262 encodeQuickType x =
6363 Jenc.object
64- [ ("data", Jenc.dict identity encodeDatum x.data)
64+ [ ("data", makeDictEncoder identity encodeDatum x.data)
6565 , ("description", encodeDescription x.description)
6666 ]
6767
@@ -97,6 +97,14 @@ encodeDescription x =
9797
9898 --- encoder helpers
9999
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+
100108 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
101109 makeNullableEncoder f m =
102110 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 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
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class Description extends S.Class<Description>("Description")({
523 "base_period": S.String,
@@ -14,6 +32,6 @@ export class Datum extends S.Class<Datum>("Datum")({
1432 }) {}
1533
1634 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
17- "data": S.Record({ key: S.String, value: Datum}),
35+ "data": mapSchema(Datum),
1836 "description": Description,
1937 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 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
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Test case

test/inputs/json/priority/blns-object.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -702,7 +702,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
702702 if (val === null || typeof val !== "object" || Array.isArray(val)) {
703703 return invalidValue(l(ref || "object"), val, key, parent);
704704 }
705- const result: any = {};
705+ const result: any = Object.create(null);
706706 Object.getOwnPropertyNames(props).forEach(key => {
707707 const prop = props[key];
708708 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
713713 result[key] = transform(val[key], additional, getProps, key, ref);
714714 }
715715 });
716- return result;
716+ return Object.setPrototypeOf(result, Object.prototype);
717717 }
718718
719719 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
702702 if (val === null || typeof val !== "object" || Array.isArray(val)) {
703703 return invalidValue(l(ref || "object"), val, key, parent);
704704 }
705- const result: any = {};
705+ const result: any = Object.create(null);
706706 Object.getOwnPropertyNames(props).forEach(key => {
707707 const prop = props[key];
708708 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
713713 result[key] = transform(val[key], additional, getProps, key, ref);
714714 }
715715 });
716- return result;
716+ return Object.setPrototypeOf(result, Object.prototype);
717717 }
718718
719719 if (typ === "any") return val;
Test case

test/inputs/json/priority/bug2037.json

5 generated files · +38 −12
Melmdefault / QuickType.elm+11 −3
@@ -60,7 +60,7 @@ quickType =
6060 encodeQuickType : QuickType -> Jenc.Value
6161 encodeQuickType x =
6262 Jenc.object
63- [ ("mission_specs", Jenc.dict identity encodeMissionSpec x.missionSpecs)
63+ [ ("mission_specs", makeDictEncoder identity encodeMissionSpec x.missionSpecs)
6464 ]
6565
6666 missionSpec : Jdec.Decoder MissionSpec
@@ -71,7 +71,7 @@ missionSpec =
7171 encodeMissionSpec : MissionSpec -> Jenc.Value
7272 encodeMissionSpec x =
7373 Jenc.object
74- [ ("objectives", Jenc.dict identity encodeObjective x.objectives)
74+ [ ("objectives", makeDictEncoder identity encodeObjective x.objectives)
7575 ]
7676
7777 objective : Jdec.Decoder Objective
@@ -82,7 +82,7 @@ objective =
8282 encodeObjective : Objective -> Jenc.Value
8383 encodeObjective x =
8484 Jenc.object
85- [ ("rewards", Jenc.dict identity encodeReward x.rewards)
85+ [ ("rewards", makeDictEncoder identity encodeReward x.rewards)
8686 ]
8787
8888 reward : Jdec.Decoder Reward
@@ -97,6 +97,14 @@ encodeReward x =
9797
9898 --- encoder helpers
9999
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+
100108 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
101109 makeNullableEncoder f m =
102110 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 if (val === null || typeof val !== "object" || Array.isArray(val)) {
119119 return invalidValue(l(ref || "object"), val, key, parent);
120120 }
121- const result: any = {};
121+ const result: any = Object.create(null);
122122 Object.getOwnPropertyNames(props).forEach(key => {
123123 const prop = props[key];
124124 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
129129 result[key] = transform(val[key], additional, getProps, key, ref);
130130 }
131131 });
132- return result;
132+ return Object.setPrototypeOf(result, Object.prototype);
133133 }
134134
135135 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+21 −3
@@ -1,17 +1,35 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class Reward extends S.Class<Reward>("Reward")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value)))
523 ) {}
624
725 export class Objective extends S.Class<Objective>("Objective")({
8- "rewards": S.Record({ key: S.String, value: Reward}),
26+ "rewards": mapSchema(Reward),
927 }) {}
1028
1129 export class MissionSpec extends S.Class<MissionSpec>("MissionSpec")({
12- "objectives": S.Record({ key: S.String, value: Objective}),
30+ "objectives": mapSchema(Objective),
1331 }) {}
1432
1533 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
16- "mission_specs": S.Record({ key: S.String, value: MissionSpec}),
34+ "mission_specs": mapSchema(MissionSpec),
1735 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/json/priority/bug2521.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/priority/bug2590.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Test case

test/inputs/json/priority/bug2663.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/priority/bug2793.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 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
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Test case

test/inputs/json/priority/bug427.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -718,7 +718,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
718718 if (val === null || typeof val !== "object" || Array.isArray(val)) {
719719 return invalidValue(l(ref || "object"), val, key, parent);
720720 }
721- const result: any = {};
721+ const result: any = Object.create(null);
722722 Object.getOwnPropertyNames(props).forEach(key => {
723723 const prop = props[key];
724724 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
729729 result[key] = transform(val[key], additional, getProps, key, ref);
730730 }
731731 });
732- return result;
732+ return Object.setPrototypeOf(result, Object.prototype);
733733 }
734734
735735 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
664664 if (val === null || typeof val !== "object" || Array.isArray(val)) {
665665 return invalidValue(l(ref || "object"), val, key, parent);
666666 }
667- const result: any = {};
667+ const result: any = Object.create(null);
668668 Object.getOwnPropertyNames(props).forEach(key => {
669669 const prop = props[key];
670670 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
675675 result[key] = transform(val[key], additional, getProps, key, ref);
676676 }
677677 });
678- return result;
678+ return Object.setPrototypeOf(result, Object.prototype);
679679 }
680680
681681 if (typ === "any") return val;
Test case

test/inputs/json/priority/bug790.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/json/priority/bug855-short.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -45,7 +45,7 @@ quickType : Jdec.Decoder QuickType
4545 quickType = Jdec.dict quickTypeValue
4646
4747 quickTypeToString : QuickType -> String
48-quickTypeToString r = Jenc.encode 0 (Jenc.dict identity encodeQuickTypeValue r)
48+quickTypeToString r = Jenc.encode 0 (makeDictEncoder identity encodeQuickTypeValue r)
4949
5050 quickTypeValue : Jdec.Decoder QuickTypeValue
5151 quickTypeValue =
@@ -68,6 +68,14 @@ encodeQuickTypeValue x =
6868
6969 --- encoder helpers
7070
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+
7179 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
7280 makeNullableEncoder f m =
7381 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class TopLevelValue extends S.Class<TopLevelValue>("TopLevelValue")({
523 "channel_id": S.String.pipe(S.pattern(/^-?\d+$/)),
@@ -9,5 +27,5 @@ export class TopLevelValue extends S.Class<TopLevelValue>("TopLevelValue")({
927 "id": S.Int,
1028 }) {}
1129
12-export const TopLevel = S.Record({ key: S.String, value: TopLevelValue});
30+export const TopLevel = mapSchema(TopLevelValue);
1331 export type TopLevel = S.Schema.Type<typeof TopLevel>;
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/priority/bug863.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -193,7 +193,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
193193 if (val === null || typeof val !== "object" || Array.isArray(val)) {
194194 return invalidValue(l(ref || "object"), val, key, parent);
195195 }
196- const result: any = {};
196+ const result: any = Object.create(null);
197197 Object.getOwnPropertyNames(props).forEach(key => {
198198 const prop = props[key];
199199 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
204204 result[key] = transform(val[key], additional, getProps, key, ref);
205205 }
206206 });
207- return result;
207+ return Object.setPrototypeOf(result, Object.prototype);
208208 }
209209
210210 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
177177 if (val === null || typeof val !== "object" || Array.isArray(val)) {
178178 return invalidValue(l(ref || "object"), val, key, parent);
179179 }
180- const result: any = {};
180+ const result: any = Object.create(null);
181181 Object.getOwnPropertyNames(props).forEach(key => {
182182 const prop = props[key];
183183 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
188188 result[key] = transform(val[key], additional, getProps, key, ref);
189189 }
190190 });
191- return result;
191+ return Object.setPrototypeOf(result, Object.prototype);
192192 }
193193
194194 if (typ === "any") return val;
Test case

test/inputs/json/priority/coin-pairs.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -59,7 +59,7 @@ quickType =
5959 encodeQuickType : QuickType -> Jenc.Value
6060 encodeQuickType x =
6161 Jenc.object
62- [ ("pairs", Jenc.dict identity encodePair x.pairs)
62+ [ ("pairs", makeDictEncoder identity encodePair x.pairs)
6363 , ("server_time", Jenc.int x.serverTime)
6464 ]
6565
@@ -90,6 +90,14 @@ encodePair x =
9090
9191 --- encoder helpers
9292
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+
93101 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
94102 makeNullableEncoder f m =
95103 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 if (val === null || typeof val !== "object" || Array.isArray(val)) {
120120 return invalidValue(l(ref || "object"), val, key, parent);
121121 }
122- const result: any = {};
122+ const result: any = Object.create(null);
123123 Object.getOwnPropertyNames(props).forEach(key => {
124124 const prop = props[key];
125125 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
130130 result[key] = transform(val[key], additional, getProps, key, ref);
131131 }
132132 });
133- return result;
133+ return Object.setPrototypeOf(result, Object.prototype);
134134 }
135135
136136 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class Pair extends S.Class<Pair>("Pair")({
523 "decimal_places": S.Int,
@@ -13,6 +31,6 @@ export class Pair extends S.Class<Pair>("Pair")({
1331 }) {}
1432
1533 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
16- "pairs": S.Record({ key: S.String, value: Pair}),
34+ "pairs": mapSchema(Pair),
1735 "server_time": S.Int,
1836 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 if (val === null || typeof val !== "object" || Array.isArray(val)) {
120120 return invalidValue(l(ref || "object"), val, key, parent);
121121 }
122- const result: any = {};
122+ const result: any = Object.create(null);
123123 Object.getOwnPropertyNames(props).forEach(key => {
124124 const prop = props[key];
125125 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
130130 result[key] = transform(val[key], additional, getProps, key, ref);
131131 }
132132 });
133- return result;
133+ return Object.setPrototypeOf(result, Object.prototype);
134134 }
135135
136136 if (typ === "any") return val;
Test case

test/inputs/json/priority/combinations1.json

24 generated files · +128 −76
Melmarray-type-array--eed288b23e27 / QuickType.elm+17 −9
@@ -642,7 +642,7 @@ encodeQuickType x =
642642 , ("fuzzy", Jenc.array encodeFuzzy x.fuzzy)
643643 , ("gardenwards", Jenc.array encodeGardenward x.gardenwards)
644644 , ("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)
646646 , ("hemicrystalline", Jenc.array encodeHemicrystalline x.hemicrystalline)
647647 , ("hemocoele", Jenc.array encodeHemocoeleElement x.hemocoele)
648648 , ("hoister", Jenc.array encodeHoister x.hoister)
@@ -916,7 +916,7 @@ consilience =
916916 encodeConsilience : Consilience -> Jenc.Value
917917 encodeConsilience x = case x of
918918 DoubleInConsilience y -> Jenc.float y
919- IntegerMapInConsilience y -> Jenc.dict identity Jenc.int y
919+ IntegerMapInConsilience y -> makeDictEncoder identity Jenc.int y
920920
921921 constructor : Jdec.Decoder Constructor
922922 constructor =
@@ -928,7 +928,7 @@ constructor =
928928 encodeConstructor : Constructor -> Jenc.Value
929929 encodeConstructor x = case x of
930930 BoolInConstructor y -> Jenc.bool y
931- UnionMapInConstructor y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
931+ UnionMapInConstructor y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
932932
933933 continuative : Jdec.Decoder Continuative
934934 continuative =
@@ -940,7 +940,7 @@ continuative =
940940 encodeContinuative : Continuative -> Jenc.Value
941941 encodeContinuative x = case x of
942942 StringInContinuative y -> Jenc.string y
943- IntegerMapInContinuative y -> Jenc.dict identity Jenc.int y
943+ IntegerMapInContinuative y -> makeDictEncoder identity Jenc.int y
944944
945945 credulityElement : Jdec.Decoder CredulityElement
946946 credulityElement =
@@ -1017,7 +1017,7 @@ encodeCreviced : Creviced -> Jenc.Value
10171017 encodeCreviced x = case x of
10181018 BoolInCreviced y -> Jenc.bool y
10191019 StringInCreviced y -> Jenc.string y
1020- IntegerMapInCreviced y -> Jenc.dict identity Jenc.int y
1020+ IntegerMapInCreviced y -> makeDictEncoder identity Jenc.int y
10211021
10221022 deruralizeElement : Jdec.Decoder DeruralizeElement
10231023 deruralizeElement =
@@ -1171,7 +1171,7 @@ encodeEleutheromania : Eleutheromania -> Jenc.Value
11711171 encodeEleutheromania x = case x of
11721172 StringInEleutheromania y -> Jenc.string y
11731173 DoubleInEleutheromania y -> Jenc.float y
1174- IntegerMapInEleutheromania y -> Jenc.dict identity Jenc.int y
1174+ IntegerMapInEleutheromania y -> makeDictEncoder identity Jenc.int y
11751175
11761176 encrust : Jdec.Decoder Encrust
11771177 encrust =
@@ -1469,7 +1469,7 @@ fuzzy =
14691469 encodeFuzzy : Fuzzy -> Jenc.Value
14701470 encodeFuzzy x = case x of
14711471 IntegerInFuzzy y -> Jenc.int y
1472- UnionMapInFuzzy y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
1472+ UnionMapInFuzzy y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
14731473
14741474 gardenward : Jdec.Decoder Gardenward
14751475 gardenward =
@@ -1497,7 +1497,7 @@ encodeGeneralissimo : Generalissimo -> Jenc.Value
14971497 encodeGeneralissimo x = case x of
14981498 BoolInGeneralissimo y -> Jenc.bool y
14991499 NullInGeneralissimo -> Jenc.null
1500- IntegerMapInGeneralissimo y -> Jenc.dict identity Jenc.int y
1500+ IntegerMapInGeneralissimo y -> makeDictEncoder identity Jenc.int y
15011501
15021502 hemicrystalline : Jdec.Decoder Hemicrystalline
15031503 hemicrystalline =
@@ -1695,10 +1695,18 @@ jacutinga =
16951695 encodeJacutinga : Jacutinga -> Jenc.Value
16961696 encodeJacutinga x = case x of
16971697 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
16991699
17001700 --- encoder helpers
17011701
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+
17021710 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
17031711 makeNullableEncoder f m =
17041712 case m of
Melmdefault / QuickType.elm+17 −9
@@ -641,7 +641,7 @@ encodeQuickType x =
641641 , ("fuzzy", Jenc.list encodeFuzzy x.fuzzy)
642642 , ("gardenwards", Jenc.list encodeGardenward x.gardenwards)
643643 , ("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)
645645 , ("hemicrystalline", Jenc.list encodeHemicrystalline x.hemicrystalline)
646646 , ("hemocoele", Jenc.list encodeHemocoeleElement x.hemocoele)
647647 , ("hoister", Jenc.list encodeHoister x.hoister)
@@ -915,7 +915,7 @@ consilience =
915915 encodeConsilience : Consilience -> Jenc.Value
916916 encodeConsilience x = case x of
917917 DoubleInConsilience y -> Jenc.float y
918- IntegerMapInConsilience y -> Jenc.dict identity Jenc.int y
918+ IntegerMapInConsilience y -> makeDictEncoder identity Jenc.int y
919919
920920 constructor : Jdec.Decoder Constructor
921921 constructor =
@@ -927,7 +927,7 @@ constructor =
927927 encodeConstructor : Constructor -> Jenc.Value
928928 encodeConstructor x = case x of
929929 BoolInConstructor y -> Jenc.bool y
930- UnionMapInConstructor y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
930+ UnionMapInConstructor y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
931931
932932 continuative : Jdec.Decoder Continuative
933933 continuative =
@@ -939,7 +939,7 @@ continuative =
939939 encodeContinuative : Continuative -> Jenc.Value
940940 encodeContinuative x = case x of
941941 StringInContinuative y -> Jenc.string y
942- IntegerMapInContinuative y -> Jenc.dict identity Jenc.int y
942+ IntegerMapInContinuative y -> makeDictEncoder identity Jenc.int y
943943
944944 credulityElement : Jdec.Decoder CredulityElement
945945 credulityElement =
@@ -1016,7 +1016,7 @@ encodeCreviced : Creviced -> Jenc.Value
10161016 encodeCreviced x = case x of
10171017 BoolInCreviced y -> Jenc.bool y
10181018 StringInCreviced y -> Jenc.string y
1019- IntegerMapInCreviced y -> Jenc.dict identity Jenc.int y
1019+ IntegerMapInCreviced y -> makeDictEncoder identity Jenc.int y
10201020
10211021 deruralizeElement : Jdec.Decoder DeruralizeElement
10221022 deruralizeElement =
@@ -1170,7 +1170,7 @@ encodeEleutheromania : Eleutheromania -> Jenc.Value
11701170 encodeEleutheromania x = case x of
11711171 StringInEleutheromania y -> Jenc.string y
11721172 DoubleInEleutheromania y -> Jenc.float y
1173- IntegerMapInEleutheromania y -> Jenc.dict identity Jenc.int y
1173+ IntegerMapInEleutheromania y -> makeDictEncoder identity Jenc.int y
11741174
11751175 encrust : Jdec.Decoder Encrust
11761176 encrust =
@@ -1468,7 +1468,7 @@ fuzzy =
14681468 encodeFuzzy : Fuzzy -> Jenc.Value
14691469 encodeFuzzy x = case x of
14701470 IntegerInFuzzy y -> Jenc.int y
1471- UnionMapInFuzzy y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
1471+ UnionMapInFuzzy y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
14721472
14731473 gardenward : Jdec.Decoder Gardenward
14741474 gardenward =
@@ -1496,7 +1496,7 @@ encodeGeneralissimo : Generalissimo -> Jenc.Value
14961496 encodeGeneralissimo x = case x of
14971497 BoolInGeneralissimo y -> Jenc.bool y
14981498 NullInGeneralissimo -> Jenc.null
1499- IntegerMapInGeneralissimo y -> Jenc.dict identity Jenc.int y
1499+ IntegerMapInGeneralissimo y -> makeDictEncoder identity Jenc.int y
15001500
15011501 hemicrystalline : Jdec.Decoder Hemicrystalline
15021502 hemicrystalline =
@@ -1694,10 +1694,18 @@ jacutinga =
16941694 encodeJacutinga : Jacutinga -> Jenc.Value
16951695 encodeJacutinga x = case x of
16961696 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
16981698
16991699 --- encoder helpers
17001700
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+
17011709 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
17021710 makeNullableEncoder f m =
17031711 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 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
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 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
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 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
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 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
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 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
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 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
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 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
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 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
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 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
510510 result[key] = val[key];
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 if (typ === "any") return val;
Mjavascriptconverters-top-level--67aa452ed509 / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptraw-type-any--474b307c39db / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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 = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = val[key];
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+27 −9
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class Interacinar extends S.Class<Interacinar>("Interacinar")({
523 "assapan": S.Number,
@@ -293,18 +311,18 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
293311 "citrated": S.Int,
294312 "clinodome": S.Array(S.Union(S.Number, S.String)),
295313 "coadjust": S.Array(S.Union(S.Number, CoadjustClass)),
296- "consilience": S.Array(S.Union(S.Number, S.Record({ key: S.String, value: S.Int}))),
297- "constructor": S.Array(S.Union(S.Boolean, S.Record({ key: S.String, value: S.NullOr(S.Int)}))),
298- "continuative": S.Array(S.Union(S.Record({ key: S.String, value: S.Int}), S.String)),
314+ "consilience": S.Array(S.Union(S.Number, mapSchema(S.Int))),
315+ "constructor": S.Array(S.Union(S.Boolean, mapSchema(S.NullOr(S.Int)))),
316+ "continuative": S.Array(S.Union(mapSchema(S.Int), S.String)),
299317 "credulity": S.Array(S.Union(S.Int, S.String, CredulityClass)),
300- "creviced": S.Array(S.Union(S.Boolean, S.Record({ key: S.String, value: S.Int}), S.String)),
318+ "creviced": S.Array(S.Union(S.Boolean, mapSchema(S.Int), S.String)),
301319 "cubiculum": S.Array(S.Array(S.NullOr(S.Int))),
302320 "deruralize": S.Array(S.Union(S.Array(S.Null), S.Boolean, DeruralizeClass)),
303321 "diaereses": S.Array(S.Union(S.Array(S.Int), S.Boolean, DiaereseClass)),
304322 "dissolution": S.Array(S.NullOr(S.Array(S.Null))),
305323 "downstroke": S.Array(S.Union(S.Array(S.Null), S.Boolean, S.String)),
306324 "electrotautomerism": S.Array(S.NullOr(S.Number)),
307- "eleutheromania": S.Array(S.Union(S.Number, S.Record({ key: S.String, value: S.Int}), S.String)),
325+ "eleutheromania": S.Array(S.Union(S.Number, mapSchema(S.Int), S.String)),
308326 "encrust": Encrust,
309327 "entomoid": S.Array(S.Union(S.Int, CimeliaClass)),
310328 "epipaleolithic": S.Array(S.Union(S.Array(S.Int), S.Number)),
@@ -314,10 +332,10 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
314332 "flagmaking": S.Array(S.Union(S.Boolean, S.Number, FlagmakingClass)),
315333 "fluorometer": S.Array(S.Union(S.Int, S.String, S.Null)),
316334 "fulsome": S.Array(S.NullOr(S.Int)),
317- "fuzzy": S.Array(S.Union(S.Int, S.Record({ key: S.String, value: S.NullOr(S.Int)}))),
335+ "fuzzy": S.Array(S.Union(S.Int, mapSchema(S.NullOr(S.Int)))),
318336 "gardenwards": S.Array(S.Union(S.Array(S.Int), S.Boolean, S.String)),
319- "generalissimo": S.Array(S.Union(S.Boolean, S.Record({ key: S.String, value: S.Int}), S.Null)),
320- "habeas": S.Array(S.NullOr(S.Record({ key: S.String, value: S.Int}))),
337+ "generalissimo": S.Array(S.Union(S.Boolean, mapSchema(S.Int), S.Null)),
338+ "habeas": S.Array(S.NullOr(mapSchema(S.Int))),
321339 "hemicrystalline": S.Array(S.Union(S.String, CimeliaClass)),
322340 "hemocoele": S.Array(S.Union(S.Array(S.Int), HemocoeleClass)),
323341 "hoister": S.Array(S.Union(S.String, CimeliaClass, S.Null)),
@@ -328,5 +346,5 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
328346 "intentiveness": S.Array(S.Union(S.Number, S.String, CimeliaClass)),
329347 "interacinar": Interacinar,
330348 "intercorrelation": S.Array(S.NullOr(S.Array(S.Int))),
331- "jacutinga": S.Array(S.Union(S.Array(S.Int), S.Record({ key: S.String, value: S.NullOr(S.Int)}))),
349+ "jacutinga": S.Array(S.Union(S.Array(S.Int), mapSchema(S.NullOr(S.Int)))),
332350 }) {}
Mtypescript-effect-schemajust-schema-true--8c4ca457bcba / TopLevel.ts+27 −9
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class Interacinar extends S.Class<Interacinar>("Interacinar")({
523 "assapan": S.Number,
@@ -293,18 +311,18 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
293311 "citrated": S.Int,
294312 "clinodome": S.Array(S.Union(S.Number, S.String)),
295313 "coadjust": S.Array(S.Union(S.Number, CoadjustClass)),
296- "consilience": S.Array(S.Union(S.Number, S.Record({ key: S.String, value: S.Int}))),
297- "constructor": S.Array(S.Union(S.Boolean, S.Record({ key: S.String, value: S.NullOr(S.Int)}))),
298- "continuative": S.Array(S.Union(S.Record({ key: S.String, value: S.Int}), S.String)),
314+ "consilience": S.Array(S.Union(S.Number, mapSchema(S.Int))),
315+ "constructor": S.Array(S.Union(S.Boolean, mapSchema(S.NullOr(S.Int)))),
316+ "continuative": S.Array(S.Union(mapSchema(S.Int), S.String)),
299317 "credulity": S.Array(S.Union(S.Int, S.String, CredulityClass)),
300- "creviced": S.Array(S.Union(S.Boolean, S.Record({ key: S.String, value: S.Int}), S.String)),
318+ "creviced": S.Array(S.Union(S.Boolean, mapSchema(S.Int), S.String)),
301319 "cubiculum": S.Array(S.Array(S.NullOr(S.Int))),
302320 "deruralize": S.Array(S.Union(S.Array(S.Null), S.Boolean, DeruralizeClass)),
303321 "diaereses": S.Array(S.Union(S.Array(S.Int), S.Boolean, DiaereseClass)),
304322 "dissolution": S.Array(S.NullOr(S.Array(S.Null))),
305323 "downstroke": S.Array(S.Union(S.Array(S.Null), S.Boolean, S.String)),
306324 "electrotautomerism": S.Array(S.NullOr(S.Number)),
307- "eleutheromania": S.Array(S.Union(S.Number, S.Record({ key: S.String, value: S.Int}), S.String)),
325+ "eleutheromania": S.Array(S.Union(S.Number, mapSchema(S.Int), S.String)),
308326 "encrust": Encrust,
309327 "entomoid": S.Array(S.Union(S.Int, CimeliaClass)),
310328 "epipaleolithic": S.Array(S.Union(S.Array(S.Int), S.Number)),
@@ -314,10 +332,10 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
314332 "flagmaking": S.Array(S.Union(S.Boolean, S.Number, FlagmakingClass)),
315333 "fluorometer": S.Array(S.Union(S.Int, S.String, S.Null)),
316334 "fulsome": S.Array(S.NullOr(S.Int)),
317- "fuzzy": S.Array(S.Union(S.Int, S.Record({ key: S.String, value: S.NullOr(S.Int)}))),
335+ "fuzzy": S.Array(S.Union(S.Int, mapSchema(S.NullOr(S.Int)))),
318336 "gardenwards": S.Array(S.Union(S.Array(S.Int), S.Boolean, S.String)),
319- "generalissimo": S.Array(S.Union(S.Boolean, S.Record({ key: S.String, value: S.Int}), S.Null)),
320- "habeas": S.Array(S.NullOr(S.Record({ key: S.String, value: S.Int}))),
337+ "generalissimo": S.Array(S.Union(S.Boolean, mapSchema(S.Int), S.Null)),
338+ "habeas": S.Array(S.NullOr(mapSchema(S.Int))),
321339 "hemicrystalline": S.Array(S.Union(S.String, CimeliaClass)),
322340 "hemocoele": S.Array(S.Union(S.Array(S.Int), HemocoeleClass)),
323341 "hoister": S.Array(S.Union(S.String, CimeliaClass, S.Null)),
@@ -328,5 +346,5 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
328346 "intentiveness": S.Array(S.Union(S.Number, S.String, CimeliaClass)),
329347 "interacinar": Interacinar,
330348 "intercorrelation": S.Array(S.NullOr(S.Array(S.Int))),
331- "jacutinga": S.Array(S.Union(S.Array(S.Int), S.Record({ key: S.String, value: S.NullOr(S.Int)}))),
349+ "jacutinga": S.Array(S.Union(S.Array(S.Int), mapSchema(S.NullOr(S.Int)))),
332350 }) {}
Mtypescriptacronym-style-pascal--d9e0c1bd777a / TopLevel.ts+2 −2
@@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 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
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 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
603603 if (val === null || typeof val !== "object" || Array.isArray(val)) {
604604 return invalidValue(l(ref || "object"), val, key, parent);
605605 }
606- const result: any = {};
606+ const result: any = Object.create(null);
607607 Object.getOwnPropertyNames(props).forEach(key => {
608608 const prop = props[key];
609609 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
614614 result[key] = transform(val[key], additional, getProps, key, ref);
615615 }
616616 });
617- return result;
617+ return Object.setPrototypeOf(result, Object.prototype);
618618 }
619619
620620 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
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 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
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 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
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 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
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 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
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 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
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 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
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 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
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 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
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 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
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 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
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 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
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 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
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 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
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 if (typ === "any") return val;
Mtypescriptreadonly-true--24da4fc107df / TopLevel.ts+2 −2
@@ -499,7 +499,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 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
510510 result[key] = transform(val[key], additional, getProps, key, ref);
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 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
499499 if (val === null || typeof val !== "object" || Array.isArray(val)) {
500500 return invalidValue(l(ref || "object"), val, key, parent);
501501 }
502- const result: any = {};
502+ const result: any = Object.create(null);
503503 Object.getOwnPropertyNames(props).forEach(key => {
504504 const prop = props[key];
505505 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
510510 result[key] = val[key];
511511 }
512512 });
513- return result;
513+ return Object.setPrototypeOf(result, Object.prototype);
514514 }
515515
516516 if (typ === "any") return val;
Test case

test/inputs/json/priority/combinations2.json

24 generated files · +140 −88
Melmarray-type-array--eed288b23e27 / QuickType.elm+20 −12
@@ -579,13 +579,13 @@ encodeQuickType x =
579579 , ("amphithyron", Jenc.array (makeNullableEncoder encodeAmphithyron) x.amphithyron)
580580 , ("Andriana", Jenc.array (makeNullableEncoder Jenc.string) x.andriana)
581581 , ("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)
583583 , ("annulose", always Jenc.null x.annulose)
584584 , ("Ansarie", Jenc.array encodeAnsarieElement x.ansarie)
585585 , ("aphasia", Jenc.array encodeAphasia x.aphasia)
586586 , ("asprawl", Jenc.array encodeAsprawl x.asprawl)
587587 , ("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)
589589 , ("bedesman", Jenc.array encodeBedesman x.bedesman)
590590 , ("belard", Jenc.array encodeBelard x.belard)
591591 , ("bocking", Jenc.array encodeBocking x.bocking)
@@ -612,7 +612,7 @@ encodeQuickType x =
612612 , ("School", Jenc.array encodeSchool x.school)
613613 , ("Shakespearolater", Jenc.array encodeShakespearolater x.shakespearolater)
614614 , ("Svan", Jenc.array Jenc.float x.svan)
615- , ("Wayao", Jenc.dict identity Jenc.float x.wayao)
615+ , ("Wayao", makeDictEncoder identity Jenc.float x.wayao)
616616 ]
617617
618618 abranchiata : Jdec.Decoder Abranchiata
@@ -641,7 +641,7 @@ encodeAcademe : Academe -> Jenc.Value
641641 encodeAcademe x = case x of
642642 IntegerArrayInAcademe y -> Jenc.array Jenc.int y
643643 IntegerInAcademe y -> Jenc.int y
644- IntegerMapInAcademe y -> Jenc.dict identity Jenc.int y
644+ IntegerMapInAcademe y -> makeDictEncoder identity Jenc.int y
645645
646646 acquirable : Jdec.Decoder Acquirable
647647 acquirable =
@@ -653,7 +653,7 @@ acquirable =
653653 encodeAcquirable : Acquirable -> Jenc.Value
654654 encodeAcquirable x = case x of
655655 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
657657
658658 aerometry : Jdec.Decoder Aerometry
659659 aerometry =
@@ -1034,7 +1034,7 @@ encodeBocking : Bocking -> Jenc.Value
10341034 encodeBocking x = case x of
10351035 IntegerArrayInBocking y -> Jenc.array Jenc.int y
10361036 BoolInBocking y -> Jenc.bool y
1037- IntegerMapInBocking y -> Jenc.dict identity Jenc.int y
1037+ IntegerMapInBocking y -> makeDictEncoder identity Jenc.int y
10381038
10391039 brawlingly : Jdec.Decoder Brawlingly
10401040 brawlingly =
@@ -1046,7 +1046,7 @@ brawlingly =
10461046 encodeBrawlingly : Brawlingly -> Jenc.Value
10471047 encodeBrawlingly x = case x of
10481048 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
10501050
10511051 brookie : Jdec.Decoder Brookie
10521052 brookie =
@@ -1098,7 +1098,7 @@ encodeCatallactic : Catallactic -> Jenc.Value
10981098 encodeCatallactic x = case x of
10991099 NullArrayInCatallactic y -> Jenc.array (always Jenc.null) y
11001100 BoolInCatallactic y -> Jenc.bool y
1101- IntegerMapInCatallactic y -> Jenc.dict identity Jenc.int y
1101+ IntegerMapInCatallactic y -> makeDictEncoder identity Jenc.int y
11021102
11031103 cemental : Jdec.Decoder Cemental
11041104 cemental =
@@ -1112,7 +1112,7 @@ encodeCemental : Cemental -> Jenc.Value
11121112 encodeCemental x = case x of
11131113 IntegerArrayInCemental y -> Jenc.array Jenc.int y
11141114 DoubleInCemental y -> Jenc.float y
1115- IntegerMapInCemental y -> Jenc.dict identity Jenc.int y
1115+ IntegerMapInCemental y -> makeDictEncoder identity Jenc.int y
11161116
11171117 chytridiaceaeElement : Jdec.Decoder ChytridiaceaeElement
11181118 chytridiaceaeElement =
@@ -1284,7 +1284,7 @@ eupatorium =
12841284 encodeEupatorium : Eupatorium -> Jenc.Value
12851285 encodeEupatorium x = case x of
12861286 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
12881288
12891289 gryphosaurusElement : Jdec.Decoder GryphosaurusElement
12901290 gryphosaurusElement =
@@ -1359,7 +1359,7 @@ koryak =
13591359 encodeKoryak : Koryak -> Jenc.Value
13601360 encodeKoryak x = case x of
13611361 StringInKoryak y -> Jenc.string y
1362- UnionMapInKoryak y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
1362+ UnionMapInKoryak y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
13631363
13641364 laviniaElement : Jdec.Decoder LaviniaElement
13651365 laviniaElement =
@@ -1547,7 +1547,7 @@ encodeSchool : School -> Jenc.Value
15471547 encodeSchool x = case x of
15481548 IntegerInSchool y -> Jenc.int y
15491549 NullInSchool -> Jenc.null
1550- IntegerMapInSchool y -> Jenc.dict identity Jenc.int y
1550+ IntegerMapInSchool y -> makeDictEncoder identity Jenc.int y
15511551
15521552 shakespearolater : Jdec.Decoder Shakespearolater
15531553 shakespearolater =
@@ -1565,6 +1565,14 @@ encodeShakespearolater x = case x of
15651565
15661566 --- encoder helpers
15671567
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+
15681576 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
15691577 makeNullableEncoder f m =
15701578 case m of
Melmdefault / QuickType.elm+20 −12
@@ -578,13 +578,13 @@ encodeQuickType x =
578578 , ("amphithyron", Jenc.list (makeNullableEncoder encodeAmphithyron) x.amphithyron)
579579 , ("Andriana", Jenc.list (makeNullableEncoder Jenc.string) x.andriana)
580580 , ("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)
582582 , ("annulose", always Jenc.null x.annulose)
583583 , ("Ansarie", Jenc.list encodeAnsarieElement x.ansarie)
584584 , ("aphasia", Jenc.list encodeAphasia x.aphasia)
585585 , ("asprawl", Jenc.list encodeAsprawl x.asprawl)
586586 , ("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)
588588 , ("bedesman", Jenc.list encodeBedesman x.bedesman)
589589 , ("belard", Jenc.list encodeBelard x.belard)
590590 , ("bocking", Jenc.list encodeBocking x.bocking)
@@ -611,7 +611,7 @@ encodeQuickType x =
611611 , ("School", Jenc.list encodeSchool x.school)
612612 , ("Shakespearolater", Jenc.list encodeShakespearolater x.shakespearolater)
613613 , ("Svan", Jenc.list Jenc.float x.svan)
614- , ("Wayao", Jenc.dict identity Jenc.float x.wayao)
614+ , ("Wayao", makeDictEncoder identity Jenc.float x.wayao)
615615 ]
616616
617617 abranchiata : Jdec.Decoder Abranchiata
@@ -640,7 +640,7 @@ encodeAcademe : Academe -> Jenc.Value
640640 encodeAcademe x = case x of
641641 IntegerArrayInAcademe y -> Jenc.list Jenc.int y
642642 IntegerInAcademe y -> Jenc.int y
643- IntegerMapInAcademe y -> Jenc.dict identity Jenc.int y
643+ IntegerMapInAcademe y -> makeDictEncoder identity Jenc.int y
644644
645645 acquirable : Jdec.Decoder Acquirable
646646 acquirable =
@@ -652,7 +652,7 @@ acquirable =
652652 encodeAcquirable : Acquirable -> Jenc.Value
653653 encodeAcquirable x = case x of
654654 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
656656
657657 aerometry : Jdec.Decoder Aerometry
658658 aerometry =
@@ -1033,7 +1033,7 @@ encodeBocking : Bocking -> Jenc.Value
10331033 encodeBocking x = case x of
10341034 IntegerArrayInBocking y -> Jenc.list Jenc.int y
10351035 BoolInBocking y -> Jenc.bool y
1036- IntegerMapInBocking y -> Jenc.dict identity Jenc.int y
1036+ IntegerMapInBocking y -> makeDictEncoder identity Jenc.int y
10371037
10381038 brawlingly : Jdec.Decoder Brawlingly
10391039 brawlingly =
@@ -1045,7 +1045,7 @@ brawlingly =
10451045 encodeBrawlingly : Brawlingly -> Jenc.Value
10461046 encodeBrawlingly x = case x of
10471047 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
10491049
10501050 brookie : Jdec.Decoder Brookie
10511051 brookie =
@@ -1097,7 +1097,7 @@ encodeCatallactic : Catallactic -> Jenc.Value
10971097 encodeCatallactic x = case x of
10981098 NullArrayInCatallactic y -> Jenc.list (always Jenc.null) y
10991099 BoolInCatallactic y -> Jenc.bool y
1100- IntegerMapInCatallactic y -> Jenc.dict identity Jenc.int y
1100+ IntegerMapInCatallactic y -> makeDictEncoder identity Jenc.int y
11011101
11021102 cemental : Jdec.Decoder Cemental
11031103 cemental =
@@ -1111,7 +1111,7 @@ encodeCemental : Cemental -> Jenc.Value
11111111 encodeCemental x = case x of
11121112 IntegerArrayInCemental y -> Jenc.list Jenc.int y
11131113 DoubleInCemental y -> Jenc.float y
1114- IntegerMapInCemental y -> Jenc.dict identity Jenc.int y
1114+ IntegerMapInCemental y -> makeDictEncoder identity Jenc.int y
11151115
11161116 chytridiaceaeElement : Jdec.Decoder ChytridiaceaeElement
11171117 chytridiaceaeElement =
@@ -1283,7 +1283,7 @@ eupatorium =
12831283 encodeEupatorium : Eupatorium -> Jenc.Value
12841284 encodeEupatorium x = case x of
12851285 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
12871287
12881288 gryphosaurusElement : Jdec.Decoder GryphosaurusElement
12891289 gryphosaurusElement =
@@ -1358,7 +1358,7 @@ koryak =
13581358 encodeKoryak : Koryak -> Jenc.Value
13591359 encodeKoryak x = case x of
13601360 StringInKoryak y -> Jenc.string y
1361- UnionMapInKoryak y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
1361+ UnionMapInKoryak y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
13621362
13631363 laviniaElement : Jdec.Decoder LaviniaElement
13641364 laviniaElement =
@@ -1546,7 +1546,7 @@ encodeSchool : School -> Jenc.Value
15461546 encodeSchool x = case x of
15471547 IntegerInSchool y -> Jenc.int y
15481548 NullInSchool -> Jenc.null
1549- IntegerMapInSchool y -> Jenc.dict identity Jenc.int y
1549+ IntegerMapInSchool y -> makeDictEncoder identity Jenc.int y
15501550
15511551 shakespearolater : Jdec.Decoder Shakespearolater
15521552 shakespearolater =
@@ -1564,6 +1564,14 @@ encodeShakespearolater x = case x of
15641564
15651565 --- encoder helpers
15661566
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+
15671575 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
15681576 makeNullableEncoder f m =
15691577 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 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
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 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
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 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
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 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
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 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
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 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
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 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
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 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
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 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
462462 result[key] = val[key];
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 if (typ === "any") return val;
Mjavascriptconverters-top-level--67aa452ed509 / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptraw-type-any--474b307c39db / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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 = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = val[key];
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+30 −12
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class OskarClass extends S.Class<OskarClass>("OskarClass")({
523 "Acrobates": S.Null,
@@ -233,8 +251,8 @@ export class AlleviateClass extends S.Class<AlleviateClass>("AlleviateClass")({
233251
234252 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
235253 "Abranchiata": S.Array(S.Union(S.Array(S.Int), S.Int, S.Null)),
236- "academe": S.Array(S.Union(S.Array(S.Int), S.Int, S.Record({ key: S.String, value: S.Int}))),
237- "acquirable": S.Array(S.Union(S.Array(S.NullOr(S.Int)), S.Record({ key: S.String, value: S.Int}))),
254+ "academe": S.Array(S.Union(S.Array(S.Int), S.Int, mapSchema(S.Int))),
255+ "acquirable": S.Array(S.Union(S.Array(S.NullOr(S.Int)), mapSchema(S.Int))),
238256 "aerometry": S.Array(S.Union(S.Boolean, S.Number)),
239257 "alexin": S.Array(S.Union(S.Array(S.Int), S.Boolean)),
240258 "alleviate": S.Array(S.Union(S.Array(S.NullOr(S.Int)), AlleviateClass)),
@@ -243,38 +261,38 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
243261 "amphithyron": S.Array(S.NullOr(Amphithyron)),
244262 "Andriana": S.Array(S.NullOr(S.String)),
245263 "ankee": S.Array(S.Union(S.Array(S.Int), S.Int, AnkeeClass)),
246- "annihilator": S.Array(S.NullOr(S.Record({ key: S.String, value: S.NullOr(S.Int)}))),
264+ "annihilator": S.Array(S.NullOr(mapSchema(S.NullOr(S.Int)))),
247265 "annulose": S.Null,
248266 "Ansarie": S.Array(S.Union(S.Array(S.Int), AnsarieClass, S.Null)),
249267 "aphasia": S.Array(S.Union(S.Array(S.Int), S.Int)),
250268 "asprawl": S.Array(S.Union(S.Number, S.String)),
251269 "attractive": S.Array(S.NullOr(S.Boolean)),
252- "barksome": S.Record({ key: S.String, value: S.Int}),
270+ "barksome": mapSchema(S.Int),
253271 "bedesman": S.Array(S.Union(S.Boolean, S.Number, S.String)),
254272 "belard": S.Array(S.Union(S.Array(S.Int), S.Number, Rebecca)),
255- "bocking": S.Array(S.Union(S.Array(S.Int), S.Boolean, S.Record({ key: S.String, value: S.Int}))),
256- "brawlingly": S.Array(S.Union(S.Array(S.Null), S.Record({ key: S.String, value: S.NullOr(S.Int)}))),
273+ "bocking": S.Array(S.Union(S.Array(S.Int), S.Boolean, mapSchema(S.Int))),
274+ "brawlingly": S.Array(S.Union(S.Array(S.Null), mapSchema(S.NullOr(S.Int)))),
257275 "brookie": S.Array(S.Union(S.Array(S.Int), Rebecca)),
258276 "bumboatman": S.Array(S.Union(S.Array(S.Null), S.String, S.Null)),
259277 "bystreet": S.Array(S.Null),
260278 "calaverite": S.Array(S.Union(S.Array(S.Int), S.String)),
261- "catallactic": S.Array(S.Union(S.Array(S.Null), S.Boolean, S.Record({ key: S.String, value: S.Int}))),
262- "cemental": S.Array(S.Union(S.Array(S.Int), S.Number, S.Record({ key: S.String, value: S.Int}))),
279+ "catallactic": S.Array(S.Union(S.Array(S.Null), S.Boolean, mapSchema(S.Int))),
280+ "cemental": S.Array(S.Union(S.Array(S.Int), S.Number, mapSchema(S.Int))),
263281 "Chytridiaceae": S.Array(S.Union(S.Boolean, ChytridiaceaeClass, S.Null)),
264282 "Discordia": S.Array(S.Union(S.Array(S.Int), DiscordiaClass)),
265283 "Endomyces": S.Array(S.Union(S.Int, S.String)),
266284 "Epinephelidae": S.Array(S.Union(S.Boolean, S.Int, S.String)),
267- "Eupatorium": S.Array(S.Union(S.Array(S.Null), S.Record({ key: S.String, value: S.Int}))),
285+ "Eupatorium": S.Array(S.Union(S.Array(S.Null), mapSchema(S.Int))),
268286 "Gryphosaurus": S.Array(S.Union(S.Array(S.Int), S.String, GryphosaurusClass)),
269- "Koryak": S.Array(S.Union(S.Record({ key: S.String, value: S.NullOr(S.Int)}), S.String)),
287+ "Koryak": S.Array(S.Union(mapSchema(S.NullOr(S.Int)), S.String)),
270288 "Lavinia": S.Array(S.Union(S.String, LaviniaClass)),
271289 "Oskar": S.Array(S.Union(S.Array(S.Int), OskarClass)),
272290 "Rebecca": S.Array(S.Union(S.Int, S.String, Rebecca)),
273291 "Rhomboganoidei": S.Array(S.Union(S.Array(S.Int), S.String, Rebecca)),
274292 "Rigsmal": S.Boolean,
275293 "Ruellia": S.Array(S.Union(S.Boolean, S.String, Rebecca)),
276- "School": S.Array(S.Union(S.Int, S.Record({ key: S.String, value: S.Int}), S.Null)),
294+ "School": S.Array(S.Union(S.Int, mapSchema(S.Int), S.Null)),
277295 "Shakespearolater": S.Array(S.Union(S.Array(S.Int), S.Number, S.String)),
278296 "Svan": S.Array(S.Number),
279- "Wayao": S.Record({ key: S.String, value: S.Number}),
297+ "Wayao": mapSchema(S.Number),
280298 }) {}
Mtypescript-effect-schemajust-schema-true--8c4ca457bcba / TopLevel.ts+30 −12
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class OskarClass extends S.Class<OskarClass>("OskarClass")({
523 "Acrobates": S.Null,
@@ -233,8 +251,8 @@ export class AlleviateClass extends S.Class<AlleviateClass>("AlleviateClass")({
233251
234252 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
235253 "Abranchiata": S.Array(S.Union(S.Array(S.Int), S.Int, S.Null)),
236- "academe": S.Array(S.Union(S.Array(S.Int), S.Int, S.Record({ key: S.String, value: S.Int}))),
237- "acquirable": S.Array(S.Union(S.Array(S.NullOr(S.Int)), S.Record({ key: S.String, value: S.Int}))),
254+ "academe": S.Array(S.Union(S.Array(S.Int), S.Int, mapSchema(S.Int))),
255+ "acquirable": S.Array(S.Union(S.Array(S.NullOr(S.Int)), mapSchema(S.Int))),
238256 "aerometry": S.Array(S.Union(S.Boolean, S.Number)),
239257 "alexin": S.Array(S.Union(S.Array(S.Int), S.Boolean)),
240258 "alleviate": S.Array(S.Union(S.Array(S.NullOr(S.Int)), AlleviateClass)),
@@ -243,38 +261,38 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
243261 "amphithyron": S.Array(S.NullOr(Amphithyron)),
244262 "Andriana": S.Array(S.NullOr(S.String)),
245263 "ankee": S.Array(S.Union(S.Array(S.Int), S.Int, AnkeeClass)),
246- "annihilator": S.Array(S.NullOr(S.Record({ key: S.String, value: S.NullOr(S.Int)}))),
264+ "annihilator": S.Array(S.NullOr(mapSchema(S.NullOr(S.Int)))),
247265 "annulose": S.Null,
248266 "Ansarie": S.Array(S.Union(S.Array(S.Int), AnsarieClass, S.Null)),
249267 "aphasia": S.Array(S.Union(S.Array(S.Int), S.Int)),
250268 "asprawl": S.Array(S.Union(S.Number, S.String)),
251269 "attractive": S.Array(S.NullOr(S.Boolean)),
252- "barksome": S.Record({ key: S.String, value: S.Int}),
270+ "barksome": mapSchema(S.Int),
253271 "bedesman": S.Array(S.Union(S.Boolean, S.Number, S.String)),
254272 "belard": S.Array(S.Union(S.Array(S.Int), S.Number, Rebecca)),
255- "bocking": S.Array(S.Union(S.Array(S.Int), S.Boolean, S.Record({ key: S.String, value: S.Int}))),
256- "brawlingly": S.Array(S.Union(S.Array(S.Null), S.Record({ key: S.String, value: S.NullOr(S.Int)}))),
273+ "bocking": S.Array(S.Union(S.Array(S.Int), S.Boolean, mapSchema(S.Int))),
274+ "brawlingly": S.Array(S.Union(S.Array(S.Null), mapSchema(S.NullOr(S.Int)))),
257275 "brookie": S.Array(S.Union(S.Array(S.Int), Rebecca)),
258276 "bumboatman": S.Array(S.Union(S.Array(S.Null), S.String, S.Null)),
259277 "bystreet": S.Array(S.Null),
260278 "calaverite": S.Array(S.Union(S.Array(S.Int), S.String)),
261- "catallactic": S.Array(S.Union(S.Array(S.Null), S.Boolean, S.Record({ key: S.String, value: S.Int}))),
262- "cemental": S.Array(S.Union(S.Array(S.Int), S.Number, S.Record({ key: S.String, value: S.Int}))),
279+ "catallactic": S.Array(S.Union(S.Array(S.Null), S.Boolean, mapSchema(S.Int))),
280+ "cemental": S.Array(S.Union(S.Array(S.Int), S.Number, mapSchema(S.Int))),
263281 "Chytridiaceae": S.Array(S.Union(S.Boolean, ChytridiaceaeClass, S.Null)),
264282 "Discordia": S.Array(S.Union(S.Array(S.Int), DiscordiaClass)),
265283 "Endomyces": S.Array(S.Union(S.Int, S.String)),
266284 "Epinephelidae": S.Array(S.Union(S.Boolean, S.Int, S.String)),
267- "Eupatorium": S.Array(S.Union(S.Array(S.Null), S.Record({ key: S.String, value: S.Int}))),
285+ "Eupatorium": S.Array(S.Union(S.Array(S.Null), mapSchema(S.Int))),
268286 "Gryphosaurus": S.Array(S.Union(S.Array(S.Int), S.String, GryphosaurusClass)),
269- "Koryak": S.Array(S.Union(S.Record({ key: S.String, value: S.NullOr(S.Int)}), S.String)),
287+ "Koryak": S.Array(S.Union(mapSchema(S.NullOr(S.Int)), S.String)),
270288 "Lavinia": S.Array(S.Union(S.String, LaviniaClass)),
271289 "Oskar": S.Array(S.Union(S.Array(S.Int), OskarClass)),
272290 "Rebecca": S.Array(S.Union(S.Int, S.String, Rebecca)),
273291 "Rhomboganoidei": S.Array(S.Union(S.Array(S.Int), S.String, Rebecca)),
274292 "Rigsmal": S.Boolean,
275293 "Ruellia": S.Array(S.Union(S.Boolean, S.String, Rebecca)),
276- "School": S.Array(S.Union(S.Int, S.Record({ key: S.String, value: S.Int}), S.Null)),
294+ "School": S.Array(S.Union(S.Int, mapSchema(S.Int), S.Null)),
277295 "Shakespearolater": S.Array(S.Union(S.Array(S.Int), S.Number, S.String)),
278296 "Svan": S.Array(S.Number),
279- "Wayao": S.Record({ key: S.String, value: S.Number}),
297+ "Wayao": mapSchema(S.Number),
280298 }) {}
Mtypescriptacronym-style-pascal--d9e0c1bd777a / TopLevel.ts+2 −2
@@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 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
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 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
531531 if (val === null || typeof val !== "object" || Array.isArray(val)) {
532532 return invalidValue(l(ref || "object"), val, key, parent);
533533 }
534- const result: any = {};
534+ const result: any = Object.create(null);
535535 Object.getOwnPropertyNames(props).forEach(key => {
536536 const prop = props[key];
537537 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
542542 result[key] = transform(val[key], additional, getProps, key, ref);
543543 }
544544 });
545- return result;
545+ return Object.setPrototypeOf(result, Object.prototype);
546546 }
547547
548548 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
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 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
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 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
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 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
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 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
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 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
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 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
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 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
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 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
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 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
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 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
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 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
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 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
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 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
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 if (typ === "any") return val;
Mtypescriptreadonly-true--24da4fc107df / TopLevel.ts+2 −2
@@ -451,7 +451,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 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
462462 result[key] = transform(val[key], additional, getProps, key, ref);
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 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
451451 if (val === null || typeof val !== "object" || Array.isArray(val)) {
452452 return invalidValue(l(ref || "object"), val, key, parent);
453453 }
454- const result: any = {};
454+ const result: any = Object.create(null);
455455 Object.getOwnPropertyNames(props).forEach(key => {
456456 const prop = props[key];
457457 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
462462 result[key] = val[key];
463463 }
464464 });
465- return result;
465+ return Object.setPrototypeOf(result, Object.prototype);
466466 }
467467
468468 if (typ === "any") return val;
Test case

test/inputs/json/priority/combinations3.json

24 generated files · +120 −68
Melmarray-type-array--eed288b23e27 / QuickType.elm+15 −7
@@ -714,7 +714,7 @@ encodeQuickType x =
714714 , ("prefreshman", Jenc.array encodePrefreshmanElement x.prefreshman)
715715 , ("prehensility", Jenc.array encodePrehensility x.prehensility)
716716 , ("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)
718718 , ("protext", Jenc.array encodeProtext x.protext)
719719 ]
720720
@@ -789,7 +789,7 @@ kongoni =
789789 encodeKongoni : Kongoni -> Jenc.Value
790790 encodeKongoni x = case x of
791791 IntegerArrayInKongoni y -> Jenc.array Jenc.int y
792- IntegerMapInKongoni y -> Jenc.dict identity Jenc.int y
792+ IntegerMapInKongoni y -> makeDictEncoder identity Jenc.int y
793793
794794 ladronismElement : Jdec.Decoder LadronismElement
795795 ladronismElement =
@@ -1462,7 +1462,7 @@ paleographically =
14621462 encodePaleographically : Paleographically -> Jenc.Value
14631463 encodePaleographically x = case x of
14641464 DoubleInPaleographically y -> Jenc.float y
1465- UnionMapInPaleographically y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
1465+ UnionMapInPaleographically y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
14661466
14671467 pamphletwise : Jdec.Decoder Pamphletwise
14681468 pamphletwise =
@@ -1476,7 +1476,7 @@ encodePamphletwise : Pamphletwise -> Jenc.Value
14761476 encodePamphletwise x = case x of
14771477 IntegerInPamphletwise y -> Jenc.int y
14781478 StringInPamphletwise y -> Jenc.string y
1479- IntegerMapInPamphletwise y -> Jenc.dict identity Jenc.int y
1479+ IntegerMapInPamphletwise y -> makeDictEncoder identity Jenc.int y
14801480
14811481 pediatric : Jdec.Decoder Pediatric
14821482 pediatric =
@@ -1613,7 +1613,7 @@ placuntiti =
16131613 encodePlacuntiti : Placuntiti -> Jenc.Value
16141614 encodePlacuntiti x = case x of
16151615 IntegerInPlacuntiti y -> Jenc.int y
1616- IntegerMapInPlacuntiti y -> Jenc.dict identity Jenc.int y
1616+ IntegerMapInPlacuntiti y -> makeDictEncoder identity Jenc.int y
16171617
16181618 plectopterous : Jdec.Decoder Plectopterous
16191619 plectopterous =
@@ -1625,7 +1625,7 @@ plectopterous =
16251625 encodePlectopterous : Plectopterous -> Jenc.Value
16261626 encodePlectopterous x = case x of
16271627 DoubleInPlectopterous y -> Jenc.float y
1628- IntegerMapInPlectopterous y -> Jenc.dict identity Jenc.int y
1628+ IntegerMapInPlectopterous y -> makeDictEncoder identity Jenc.int y
16291629
16301630 pneumocele : Jdec.Decoder Pneumocele
16311631 pneumocele =
@@ -1710,7 +1710,7 @@ encodePoormaster : Poormaster -> Jenc.Value
17101710 encodePoormaster x = case x of
17111711 IntegerArrayInPoormaster y -> Jenc.array Jenc.int y
17121712 NullInPoormaster -> Jenc.null
1713- IntegerMapInPoormaster y -> Jenc.dict identity Jenc.int y
1713+ IntegerMapInPoormaster y -> makeDictEncoder identity Jenc.int y
17141714
17151715 potwhiskyElement : Jdec.Decoder PotwhiskyElement
17161716 potwhiskyElement =
@@ -1896,6 +1896,14 @@ encodeProtext x = case x of
18961896
18971897 --- encoder helpers
18981898
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+
18991907 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
19001908 makeNullableEncoder f m =
19011909 case m of
Melmdefault / QuickType.elm+15 −7
@@ -713,7 +713,7 @@ encodeQuickType x =
713713 , ("prefreshman", Jenc.list encodePrefreshmanElement x.prefreshman)
714714 , ("prehensility", Jenc.list encodePrehensility x.prehensility)
715715 , ("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)
717717 , ("protext", Jenc.list encodeProtext x.protext)
718718 ]
719719
@@ -788,7 +788,7 @@ kongoni =
788788 encodeKongoni : Kongoni -> Jenc.Value
789789 encodeKongoni x = case x of
790790 IntegerArrayInKongoni y -> Jenc.list Jenc.int y
791- IntegerMapInKongoni y -> Jenc.dict identity Jenc.int y
791+ IntegerMapInKongoni y -> makeDictEncoder identity Jenc.int y
792792
793793 ladronismElement : Jdec.Decoder LadronismElement
794794 ladronismElement =
@@ -1461,7 +1461,7 @@ paleographically =
14611461 encodePaleographically : Paleographically -> Jenc.Value
14621462 encodePaleographically x = case x of
14631463 DoubleInPaleographically y -> Jenc.float y
1464- UnionMapInPaleographically y -> Jenc.dict identity (makeNullableEncoder Jenc.int) y
1464+ UnionMapInPaleographically y -> makeDictEncoder identity (makeNullableEncoder Jenc.int) y
14651465
14661466 pamphletwise : Jdec.Decoder Pamphletwise
14671467 pamphletwise =
@@ -1475,7 +1475,7 @@ encodePamphletwise : Pamphletwise -> Jenc.Value
14751475 encodePamphletwise x = case x of
14761476 IntegerInPamphletwise y -> Jenc.int y
14771477 StringInPamphletwise y -> Jenc.string y
1478- IntegerMapInPamphletwise y -> Jenc.dict identity Jenc.int y
1478+ IntegerMapInPamphletwise y -> makeDictEncoder identity Jenc.int y
14791479
14801480 pediatric : Jdec.Decoder Pediatric
14811481 pediatric =
@@ -1612,7 +1612,7 @@ placuntiti =
16121612 encodePlacuntiti : Placuntiti -> Jenc.Value
16131613 encodePlacuntiti x = case x of
16141614 IntegerInPlacuntiti y -> Jenc.int y
1615- IntegerMapInPlacuntiti y -> Jenc.dict identity Jenc.int y
1615+ IntegerMapInPlacuntiti y -> makeDictEncoder identity Jenc.int y
16161616
16171617 plectopterous : Jdec.Decoder Plectopterous
16181618 plectopterous =
@@ -1624,7 +1624,7 @@ plectopterous =
16241624 encodePlectopterous : Plectopterous -> Jenc.Value
16251625 encodePlectopterous x = case x of
16261626 DoubleInPlectopterous y -> Jenc.float y
1627- IntegerMapInPlectopterous y -> Jenc.dict identity Jenc.int y
1627+ IntegerMapInPlectopterous y -> makeDictEncoder identity Jenc.int y
16281628
16291629 pneumocele : Jdec.Decoder Pneumocele
16301630 pneumocele =
@@ -1709,7 +1709,7 @@ encodePoormaster : Poormaster -> Jenc.Value
17091709 encodePoormaster x = case x of
17101710 IntegerArrayInPoormaster y -> Jenc.list Jenc.int y
17111711 NullInPoormaster -> Jenc.null
1712- IntegerMapInPoormaster y -> Jenc.dict identity Jenc.int y
1712+ IntegerMapInPoormaster y -> makeDictEncoder identity Jenc.int y
17131713
17141714 potwhiskyElement : Jdec.Decoder PotwhiskyElement
17151715 potwhiskyElement =
@@ -1895,6 +1895,14 @@ encodeProtext x = case x of
18951895
18961896 --- encoder helpers
18971897
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+
18981906 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
18991907 makeNullableEncoder f m =
19001908 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 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
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 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
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 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
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 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
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 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
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 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
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 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
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 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
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 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
566566 result[key] = val[key];
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 if (typ === "any") return val;
Mjavascriptconverters-top-level--67aa452ed509 / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptraw-type-any--474b307c39db / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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 = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = val[key];
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+25 −7
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class PrefreshmanClass extends S.Class<PrefreshmanClass>("PrefreshmanClass")({
523 "azorubine": S.Null,
@@ -340,7 +358,7 @@ export class JurorClass extends S.Class<JurorClass>("JurorClass")({
340358
341359 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
342360 "juror": S.Array(S.Union(S.Boolean, JurorClass)),
343- "kongoni": S.Array(S.Union(S.Array(S.Int), S.Record({ key: S.String, value: S.Int}))),
361+ "kongoni": S.Array(S.Union(S.Array(S.Int), mapSchema(S.Int))),
344362 "ladronism": S.Array(S.Union(S.Number, S.String, LadronismClass)),
345363 "landlubberly": S.Array(S.Union(S.Boolean, S.Int, LandlubberlyClass)),
346364 "listener": S.Array(S.Union(S.Array(S.Null), S.Int)),
@@ -361,24 +379,24 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
361379 "nonvaluation": S.Array(S.Union(S.Array(S.Null), S.Boolean, S.Number)),
362380 "occupationalist": S.Array(S.Union(S.Array(S.Null), OccupationalistClass, S.Null)),
363381 "outrival": S.Array(S.Union(S.Number, OutrivalClass, S.Null)),
364- "paleographically": S.Array(S.Union(S.Number, S.Record({ key: S.String, value: S.NullOr(S.Int)}))),
365- "pamphletwise": S.Array(S.Union(S.Int, S.Record({ key: S.String, value: S.Int}), S.String)),
382+ "paleographically": S.Array(S.Union(S.Number, mapSchema(S.NullOr(S.Int)))),
383+ "pamphletwise": S.Array(S.Union(S.Int, mapSchema(S.Int), S.String)),
366384 "pediatrics": S.Array(S.Union(S.Boolean, S.Number, S.Null)),
367385 "perceptive": S.Array(S.Boolean),
368386 "piaculum": S.Array(S.Union(S.Number, PiaculumClass)),
369387 "piccadilly": S.Array(S.Union(S.Number, S.String, S.Null)),
370388 "piffler": S.Array(S.Union(S.Array(S.Null), MonaziteClass)),
371389 "pithful": S.Array(S.Union(S.Boolean, S.Int, S.Null)),
372- "placuntitis": S.Array(S.Union(S.Int, S.Record({ key: S.String, value: S.Int}))),
373- "plectopterous": S.Array(S.Union(S.Number, S.Record({ key: S.String, value: S.Int}))),
390+ "placuntitis": S.Array(S.Union(S.Int, mapSchema(S.Int))),
391+ "plectopterous": S.Array(S.Union(S.Number, mapSchema(S.Int))),
374392 "pneumocele": S.Array(S.NullOr(Pneumocele)),
375393 "poliorcetic": S.Array(S.Union(S.Boolean, MonaziteClass)),
376- "poormaster": S.Array(S.Union(S.Array(S.Int), S.Record({ key: S.String, value: S.Int}), S.Null)),
394+ "poormaster": S.Array(S.Union(S.Array(S.Int), mapSchema(S.Int), S.Null)),
377395 "potwhisky": S.Array(S.Union(S.Int, PotwhiskyClass, S.Null)),
378396 "practicalizer": S.Array(S.Union(S.Array(S.Null), S.String, MonaziteClass)),
379397 "prefreshman": S.Array(S.Union(S.Array(S.Null), S.String, PrefreshmanClass)),
380398 "prehensility": S.Array(S.Union(S.Array(S.Null), S.Boolean, MonaziteClass)),
381399 "prevoidance": S.Array(S.Union(S.Array(S.Int), S.Int, MonaziteClass)),
382- "probant": S.Array(S.Record({ key: S.String, value: S.NullOr(S.Int)})),
400+ "probant": S.Array(mapSchema(S.NullOr(S.Int))),
383401 "protext": S.Array(S.Union(S.Array(S.Int), S.Boolean, MonaziteClass)),
384402 }) {}
Mtypescript-effect-schemajust-schema-true--8c4ca457bcba / TopLevel.ts+25 −7
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class PrefreshmanClass extends S.Class<PrefreshmanClass>("PrefreshmanClass")({
523 "azorubine": S.Null,
@@ -340,7 +358,7 @@ export class JurorClass extends S.Class<JurorClass>("JurorClass")({
340358
341359 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
342360 "juror": S.Array(S.Union(S.Boolean, JurorClass)),
343- "kongoni": S.Array(S.Union(S.Array(S.Int), S.Record({ key: S.String, value: S.Int}))),
361+ "kongoni": S.Array(S.Union(S.Array(S.Int), mapSchema(S.Int))),
344362 "ladronism": S.Array(S.Union(S.Number, S.String, LadronismClass)),
345363 "landlubberly": S.Array(S.Union(S.Boolean, S.Int, LandlubberlyClass)),
346364 "listener": S.Array(S.Union(S.Array(S.Null), S.Int)),
@@ -361,24 +379,24 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
361379 "nonvaluation": S.Array(S.Union(S.Array(S.Null), S.Boolean, S.Number)),
362380 "occupationalist": S.Array(S.Union(S.Array(S.Null), OccupationalistClass, S.Null)),
363381 "outrival": S.Array(S.Union(S.Number, OutrivalClass, S.Null)),
364- "paleographically": S.Array(S.Union(S.Number, S.Record({ key: S.String, value: S.NullOr(S.Int)}))),
365- "pamphletwise": S.Array(S.Union(S.Int, S.Record({ key: S.String, value: S.Int}), S.String)),
382+ "paleographically": S.Array(S.Union(S.Number, mapSchema(S.NullOr(S.Int)))),
383+ "pamphletwise": S.Array(S.Union(S.Int, mapSchema(S.Int), S.String)),
366384 "pediatrics": S.Array(S.Union(S.Boolean, S.Number, S.Null)),
367385 "perceptive": S.Array(S.Boolean),
368386 "piaculum": S.Array(S.Union(S.Number, PiaculumClass)),
369387 "piccadilly": S.Array(S.Union(S.Number, S.String, S.Null)),
370388 "piffler": S.Array(S.Union(S.Array(S.Null), MonaziteClass)),
371389 "pithful": S.Array(S.Union(S.Boolean, S.Int, S.Null)),
372- "placuntitis": S.Array(S.Union(S.Int, S.Record({ key: S.String, value: S.Int}))),
373- "plectopterous": S.Array(S.Union(S.Number, S.Record({ key: S.String, value: S.Int}))),
390+ "placuntitis": S.Array(S.Union(S.Int, mapSchema(S.Int))),
391+ "plectopterous": S.Array(S.Union(S.Number, mapSchema(S.Int))),
374392 "pneumocele": S.Array(S.NullOr(Pneumocele)),
375393 "poliorcetic": S.Array(S.Union(S.Boolean, MonaziteClass)),
376- "poormaster": S.Array(S.Union(S.Array(S.Int), S.Record({ key: S.String, value: S.Int}), S.Null)),
394+ "poormaster": S.Array(S.Union(S.Array(S.Int), mapSchema(S.Int), S.Null)),
377395 "potwhisky": S.Array(S.Union(S.Int, PotwhiskyClass, S.Null)),
378396 "practicalizer": S.Array(S.Union(S.Array(S.Null), S.String, MonaziteClass)),
379397 "prefreshman": S.Array(S.Union(S.Array(S.Null), S.String, PrefreshmanClass)),
380398 "prehensility": S.Array(S.Union(S.Array(S.Null), S.Boolean, MonaziteClass)),
381399 "prevoidance": S.Array(S.Union(S.Array(S.Int), S.Int, MonaziteClass)),
382- "probant": S.Array(S.Record({ key: S.String, value: S.NullOr(S.Int)})),
400+ "probant": S.Array(mapSchema(S.NullOr(S.Int))),
383401 "protext": S.Array(S.Union(S.Array(S.Int), S.Boolean, MonaziteClass)),
384402 }) {}
Mtypescriptacronym-style-pascal--d9e0c1bd777a / TopLevel.ts+2 −2
@@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 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
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 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
667667 if (val === null || typeof val !== "object" || Array.isArray(val)) {
668668 return invalidValue(l(ref || "object"), val, key, parent);
669669 }
670- const result: any = {};
670+ const result: any = Object.create(null);
671671 Object.getOwnPropertyNames(props).forEach(key => {
672672 const prop = props[key];
673673 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
678678 result[key] = transform(val[key], additional, getProps, key, ref);
679679 }
680680 });
681- return result;
681+ return Object.setPrototypeOf(result, Object.prototype);
682682 }
683683
684684 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
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 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
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 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
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 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
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 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
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 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
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 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
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 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
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 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
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 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
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 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
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 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
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 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
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 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
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 if (typ === "any") return val;
Mtypescriptreadonly-true--24da4fc107df / TopLevel.ts+2 −2
@@ -555,7 +555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 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
566566 result[key] = transform(val[key], additional, getProps, key, ref);
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 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
555555 if (val === null || typeof val !== "object" || Array.isArray(val)) {
556556 return invalidValue(l(ref || "object"), val, key, parent);
557557 }
558- const result: any = {};
558+ const result: any = Object.create(null);
559559 Object.getOwnPropertyNames(props).forEach(key => {
560560 const prop = props[key];
561561 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
566566 result[key] = val[key];
567567 }
568568 });
569- return result;
569+ return Object.setPrototypeOf(result, Object.prototype);
570570 }
571571
572572 if (typ === "any") return val;
Test case

test/inputs/json/priority/combinations4.json

24 generated files · +136 −84
Melmarray-type-array--eed288b23e27 / QuickType.elm+19 −11
@@ -830,7 +830,7 @@ encodeQuickType x =
830830 , ("untasked", Jenc.array encodeUntasked x.untasked)
831831 , ("unvarying", Jenc.array encodeUnvarying x.unvarying)
832832 , ("vehemently", Jenc.array encodeVehemently x.vehemently)
833- , ("warriorship", Jenc.dict identity Jenc.bool x.warriorship)
833+ , ("warriorship", makeDictEncoder identity Jenc.bool x.warriorship)
834834 , ("whitepot", Jenc.array encodeWhitepot x.whitepot)
835835 , ("wrothy", Jenc.array encodeWrothyElement x.wrothy)
836836 ]
@@ -1014,7 +1014,7 @@ querier =
10141014 encodeQuerier : Querier -> Jenc.Value
10151015 encodeQuerier x = case x of
10161016 BoolInQuerier y -> Jenc.bool y
1017- IntegerMapInQuerier y -> Jenc.dict identity Jenc.int y
1017+ IntegerMapInQuerier y -> makeDictEncoder identity Jenc.int y
10181018
10191019 rebarbative : Jdec.Decoder Rebarbative
10201020 rebarbative =
@@ -1312,7 +1312,7 @@ encodeSaprophilous : Saprophilous -> Jenc.Value
13121312 encodeSaprophilous x = case x of
13131313 NullInSaprophilous -> Jenc.null
13141314 StringInSaprophilous y -> Jenc.string y
1315- IntegerMapInSaprophilous y -> Jenc.dict identity Jenc.int y
1315+ IntegerMapInSaprophilous y -> makeDictEncoder identity Jenc.int y
13161316
13171317 saxtenElement : Jdec.Decoder SaxtenElement
13181318 saxtenElement =
@@ -1446,7 +1446,7 @@ encodeScoffer : Scoffer -> Jenc.Value
14461446 encodeScoffer x = case x of
14471447 NullArrayInScoffer y -> Jenc.array (always Jenc.null) y
14481448 NullInScoffer -> Jenc.null
1449- IntegerMapInScoffer y -> Jenc.dict identity Jenc.int y
1449+ IntegerMapInScoffer y -> makeDictEncoder identity Jenc.int y
14501450
14511451 scrampum : Jdec.Decoder Scrampum
14521452 scrampum =
@@ -1632,7 +1632,7 @@ encodeStimulability : Stimulability -> Jenc.Value
16321632 encodeStimulability x = case x of
16331633 BoolInStimulability y -> Jenc.bool y
16341634 IntegerInStimulability y -> Jenc.int y
1635- IntegerMapInStimulability y -> Jenc.dict identity Jenc.int y
1635+ IntegerMapInStimulability y -> makeDictEncoder identity Jenc.int y
16361636
16371637 strangleable : Jdec.Decoder Strangleable
16381638 strangleable =
@@ -1852,7 +1852,7 @@ encodeUnbeginning : Unbeginning -> Jenc.Value
18521852 encodeUnbeginning x = case x of
18531853 NullArrayInUnbeginning y -> Jenc.array (always Jenc.null) y
18541854 StringInUnbeginning y -> Jenc.string y
1855- IntegerMapInUnbeginning y -> Jenc.dict identity Jenc.int y
1855+ IntegerMapInUnbeginning y -> makeDictEncoder identity Jenc.int y
18561856
18571857 undesirability : Jdec.Decoder Undesirability
18581858 undesirability =
@@ -1866,7 +1866,7 @@ encodeUndesirability : Undesirability -> Jenc.Value
18661866 encodeUndesirability x = case x of
18671867 IntegerArrayInUndesirability y -> Jenc.array Jenc.int y
18681868 StringInUndesirability y -> Jenc.string y
1869- IntegerMapInUndesirability y -> Jenc.dict identity Jenc.int y
1869+ IntegerMapInUndesirability y -> makeDictEncoder identity Jenc.int y
18701870
18711871 unerasing : Jdec.Decoder Unerasing
18721872 unerasing =
@@ -1880,7 +1880,7 @@ encodeUnerasing : Unerasing -> Jenc.Value
18801880 encodeUnerasing x = case x of
18811881 NullArrayInUnerasing y -> Jenc.array (always Jenc.null) y
18821882 IntegerInUnerasing y -> Jenc.int y
1883- IntegerMapInUnerasing y -> Jenc.dict identity Jenc.int y
1883+ IntegerMapInUnerasing y -> makeDictEncoder identity Jenc.int y
18841884
18851885 unguentarium : Jdec.Decoder Unguentarium
18861886 unguentarium =
@@ -1979,7 +1979,7 @@ encodeUnmortgaged : Unmortgaged -> Jenc.Value
19791979 encodeUnmortgaged x = case x of
19801980 NullInUnmortgaged -> Jenc.null
19811981 DoubleInUnmortgaged y -> Jenc.float y
1982- IntegerMapInUnmortgaged y -> Jenc.dict identity Jenc.int y
1982+ IntegerMapInUnmortgaged y -> makeDictEncoder identity Jenc.int y
19831983
19841984 unobstructed : Jdec.Decoder Unobstructed
19851985 unobstructed =
@@ -2098,7 +2098,7 @@ encodeUntasked : Untasked -> Jenc.Value
20982098 encodeUntasked x = case x of
20992099 NullArrayInUntasked y -> Jenc.array (always Jenc.null) y
21002100 DoubleInUntasked y -> Jenc.float y
2101- IntegerMapInUntasked y -> Jenc.dict identity Jenc.int y
2101+ IntegerMapInUntasked y -> makeDictEncoder identity Jenc.int y
21022102
21032103 unvarying : Jdec.Decoder Unvarying
21042104 unvarying =
@@ -2112,7 +2112,7 @@ encodeUnvarying : Unvarying -> Jenc.Value
21122112 encodeUnvarying x = case x of
21132113 BoolInUnvarying y -> Jenc.bool y
21142114 DoubleInUnvarying y -> Jenc.float y
2115- IntegerMapInUnvarying y -> Jenc.dict identity Jenc.int y
2115+ IntegerMapInUnvarying y -> makeDictEncoder identity Jenc.int y
21162116
21172117 vehemently : Jdec.Decoder Vehemently
21182118 vehemently =
@@ -2203,6 +2203,14 @@ encodeWrothyClass x =
22032203
22042204 --- encoder helpers
22052205
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+
22062214 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
22072215 makeNullableEncoder f m =
22082216 case m of
Melmdefault / QuickType.elm+19 −11
@@ -829,7 +829,7 @@ encodeQuickType x =
829829 , ("untasked", Jenc.list encodeUntasked x.untasked)
830830 , ("unvarying", Jenc.list encodeUnvarying x.unvarying)
831831 , ("vehemently", Jenc.list encodeVehemently x.vehemently)
832- , ("warriorship", Jenc.dict identity Jenc.bool x.warriorship)
832+ , ("warriorship", makeDictEncoder identity Jenc.bool x.warriorship)
833833 , ("whitepot", Jenc.list encodeWhitepot x.whitepot)
834834 , ("wrothy", Jenc.list encodeWrothyElement x.wrothy)
835835 ]
@@ -1013,7 +1013,7 @@ querier =
10131013 encodeQuerier : Querier -> Jenc.Value
10141014 encodeQuerier x = case x of
10151015 BoolInQuerier y -> Jenc.bool y
1016- IntegerMapInQuerier y -> Jenc.dict identity Jenc.int y
1016+ IntegerMapInQuerier y -> makeDictEncoder identity Jenc.int y
10171017
10181018 rebarbative : Jdec.Decoder Rebarbative
10191019 rebarbative =
@@ -1311,7 +1311,7 @@ encodeSaprophilous : Saprophilous -> Jenc.Value
13111311 encodeSaprophilous x = case x of
13121312 NullInSaprophilous -> Jenc.null
13131313 StringInSaprophilous y -> Jenc.string y
1314- IntegerMapInSaprophilous y -> Jenc.dict identity Jenc.int y
1314+ IntegerMapInSaprophilous y -> makeDictEncoder identity Jenc.int y
13151315
13161316 saxtenElement : Jdec.Decoder SaxtenElement
13171317 saxtenElement =
@@ -1445,7 +1445,7 @@ encodeScoffer : Scoffer -> Jenc.Value
14451445 encodeScoffer x = case x of
14461446 NullArrayInScoffer y -> Jenc.list (always Jenc.null) y
14471447 NullInScoffer -> Jenc.null
1448- IntegerMapInScoffer y -> Jenc.dict identity Jenc.int y
1448+ IntegerMapInScoffer y -> makeDictEncoder identity Jenc.int y
14491449
14501450 scrampum : Jdec.Decoder Scrampum
14511451 scrampum =
@@ -1631,7 +1631,7 @@ encodeStimulability : Stimulability -> Jenc.Value
16311631 encodeStimulability x = case x of
16321632 BoolInStimulability y -> Jenc.bool y
16331633 IntegerInStimulability y -> Jenc.int y
1634- IntegerMapInStimulability y -> Jenc.dict identity Jenc.int y
1634+ IntegerMapInStimulability y -> makeDictEncoder identity Jenc.int y
16351635
16361636 strangleable : Jdec.Decoder Strangleable
16371637 strangleable =
@@ -1851,7 +1851,7 @@ encodeUnbeginning : Unbeginning -> Jenc.Value
18511851 encodeUnbeginning x = case x of
18521852 NullArrayInUnbeginning y -> Jenc.list (always Jenc.null) y
18531853 StringInUnbeginning y -> Jenc.string y
1854- IntegerMapInUnbeginning y -> Jenc.dict identity Jenc.int y
1854+ IntegerMapInUnbeginning y -> makeDictEncoder identity Jenc.int y
18551855
18561856 undesirability : Jdec.Decoder Undesirability
18571857 undesirability =
@@ -1865,7 +1865,7 @@ encodeUndesirability : Undesirability -> Jenc.Value
18651865 encodeUndesirability x = case x of
18661866 IntegerArrayInUndesirability y -> Jenc.list Jenc.int y
18671867 StringInUndesirability y -> Jenc.string y
1868- IntegerMapInUndesirability y -> Jenc.dict identity Jenc.int y
1868+ IntegerMapInUndesirability y -> makeDictEncoder identity Jenc.int y
18691869
18701870 unerasing : Jdec.Decoder Unerasing
18711871 unerasing =
@@ -1879,7 +1879,7 @@ encodeUnerasing : Unerasing -> Jenc.Value
18791879 encodeUnerasing x = case x of
18801880 NullArrayInUnerasing y -> Jenc.list (always Jenc.null) y
18811881 IntegerInUnerasing y -> Jenc.int y
1882- IntegerMapInUnerasing y -> Jenc.dict identity Jenc.int y
1882+ IntegerMapInUnerasing y -> makeDictEncoder identity Jenc.int y
18831883
18841884 unguentarium : Jdec.Decoder Unguentarium
18851885 unguentarium =
@@ -1978,7 +1978,7 @@ encodeUnmortgaged : Unmortgaged -> Jenc.Value
19781978 encodeUnmortgaged x = case x of
19791979 NullInUnmortgaged -> Jenc.null
19801980 DoubleInUnmortgaged y -> Jenc.float y
1981- IntegerMapInUnmortgaged y -> Jenc.dict identity Jenc.int y
1981+ IntegerMapInUnmortgaged y -> makeDictEncoder identity Jenc.int y
19821982
19831983 unobstructed : Jdec.Decoder Unobstructed
19841984 unobstructed =
@@ -2097,7 +2097,7 @@ encodeUntasked : Untasked -> Jenc.Value
20972097 encodeUntasked x = case x of
20982098 NullArrayInUntasked y -> Jenc.list (always Jenc.null) y
20992099 DoubleInUntasked y -> Jenc.float y
2100- IntegerMapInUntasked y -> Jenc.dict identity Jenc.int y
2100+ IntegerMapInUntasked y -> makeDictEncoder identity Jenc.int y
21012101
21022102 unvarying : Jdec.Decoder Unvarying
21032103 unvarying =
@@ -2111,7 +2111,7 @@ encodeUnvarying : Unvarying -> Jenc.Value
21112111 encodeUnvarying x = case x of
21122112 BoolInUnvarying y -> Jenc.bool y
21132113 DoubleInUnvarying y -> Jenc.float y
2114- IntegerMapInUnvarying y -> Jenc.dict identity Jenc.int y
2114+ IntegerMapInUnvarying y -> makeDictEncoder identity Jenc.int y
21152115
21162116 vehemently : Jdec.Decoder Vehemently
21172117 vehemently =
@@ -2202,6 +2202,14 @@ encodeWrothyClass x =
22022202
22032203 --- encoder helpers
22042204
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+
22052213 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
22062214 makeNullableEncoder f m =
22072215 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 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
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 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
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 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
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 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
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 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
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 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
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 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
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 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
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 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
636636 result[key] = val[key];
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 if (typ === "any") return val;
Mjavascriptconverters-top-level--67aa452ed509 / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptraw-type-any--474b307c39db / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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 = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = val[key];
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+29 −11
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class WrothyClass extends S.Class<WrothyClass>("WrothyClass")({
523 "Aeschynanthus": S.Null,
@@ -389,7 +407,7 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
389407 "pulpitism": S.Array(S.Union(S.Array(S.Int), S.Number, PulpitismClass)),
390408 "pyodermia": S.Array(S.Union(S.Int, PyodermiaClass)),
391409 "quebrachine": S.Array(S.Union(S.Boolean, QuebrachineClass, S.Null)),
392- "querier": S.Array(S.Union(S.Boolean, S.Record({ key: S.String, value: S.Int}))),
410+ "querier": S.Array(S.Union(S.Boolean, mapSchema(S.Int))),
393411 "rebarbative": S.Array(S.Union(S.Array(S.Int), S.Boolean, S.Number)),
394412 "reimagine": S.Array(Reimagine),
395413 "ressaut": Ressaut,
@@ -398,10 +416,10 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
398416 "rewrite": S.Array(S.Union(S.Array(S.Null), S.Number, RewriteClass)),
399417 "saccoderm": S.Array(S.Union(S.Array(S.Int), S.String, S.Null)),
400418 "santir": S.Array(S.Union(S.Number, SantirClass)),
401- "saprophilous": S.Array(S.Union(S.Record({ key: S.String, value: S.Int}), S.String, S.Null)),
419+ "saprophilous": S.Array(S.Union(mapSchema(S.Int), S.String, S.Null)),
402420 "saxten": S.Array(S.Union(S.String, SaxtenClass)),
403421 "scatty": S.Array(S.NullOr(Scatty)),
404- "scoffer": S.Array(S.Union(S.Array(S.Null), S.Record({ key: S.String, value: S.Int}), S.Null)),
422+ "scoffer": S.Array(S.Union(S.Array(S.Null), mapSchema(S.Int), S.Null)),
405423 "scrampum": S.Array(S.Union(S.Array(S.Int), S.Boolean, S.Null)),
406424 "semantic": S.Number,
407425 "serpentinic": S.Array(S.Union(S.Array(S.Int), S.Number)),
@@ -409,7 +427,7 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
409427 "sistering": S.Array(S.Union(S.Array(S.Null), S.Int, SisteringClass)),
410428 "staghunting": S.Array(Staghunting),
411429 "stagmometer": S.Array(S.Union(S.Array(S.NullOr(S.Int)), S.String)),
412- "stimulability": S.Array(S.Union(S.Boolean, S.Int, S.Record({ key: S.String, value: S.Int}))),
430+ "stimulability": S.Array(S.Union(S.Boolean, S.Int, mapSchema(S.Int))),
413431 "strangleable": S.Array(S.Union(S.Array(S.Null), S.Number)),
414432 "strenuosity": S.Array(S.Union(S.Array(S.Null), StrenuosityClass)),
415433 "tabaxir": S.Array(S.Union(S.Boolean, S.Number)),
@@ -419,22 +437,22 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
419437 "tortricine": S.Array(S.Union(S.Array(S.NullOr(S.Int)), QuebrachineClass)),
420438 "truantcy": S.Array(S.Union(S.Boolean, TruantcyClass)),
421439 "turgesce": S.Array(S.String),
422- "unbeginning": S.Array(S.Union(S.Array(S.Null), S.Record({ key: S.String, value: S.Int}), S.String)),
440+ "unbeginning": S.Array(S.Union(S.Array(S.Null), mapSchema(S.Int), S.String)),
423441 "underdunged": S.Array(S.Number),
424- "undesirability": S.Array(S.Union(S.Array(S.Int), S.Record({ key: S.String, value: S.Int}), S.String)),
425- "unerasing": S.Array(S.Union(S.Array(S.Null), S.Int, S.Record({ key: S.String, value: S.Int}))),
442+ "undesirability": S.Array(S.Union(S.Array(S.Int), mapSchema(S.Int), S.String)),
443+ "unerasing": S.Array(S.Union(S.Array(S.Null), S.Int, mapSchema(S.Int))),
426444 "unguentarium": S.Array(S.Union(S.Array(S.Null), S.Int, S.Null)),
427445 "unimpeachably": S.Array(S.Union(S.Boolean, UnimpeachablyClass)),
428- "unmortgaged": S.Array(S.Union(S.Number, S.Record({ key: S.String, value: S.Int}), S.Null)),
446+ "unmortgaged": S.Array(S.Union(S.Number, mapSchema(S.Int), S.Null)),
429447 "unobstructed": S.Array(S.Union(S.Int, QuebrachineClass, S.Null)),
430448 "unreceptivity": S.Array(S.Union(S.Array(S.Null), S.Int, S.String)),
431449 "unsatisfactoriness": S.Array(S.Union(S.Array(S.Int), S.Boolean, S.Int)),
432450 "unsecurity": S.Array(S.Int),
433451 "unstressed": S.Array(S.Union(S.Boolean, S.String, UnstressedClass)),
434- "untasked": S.Array(S.Union(S.Array(S.Null), S.Number, S.Record({ key: S.String, value: S.Int}))),
435- "unvarying": S.Array(S.Union(S.Boolean, S.Number, S.Record({ key: S.String, value: S.Int}))),
452+ "untasked": S.Array(S.Union(S.Array(S.Null), S.Number, mapSchema(S.Int))),
453+ "unvarying": S.Array(S.Union(S.Boolean, S.Number, mapSchema(S.Int))),
436454 "vehemently": S.Array(S.Union(S.Array(S.Null), S.Boolean, S.Null)),
437- "warriorship": S.Record({ key: S.String, value: S.Boolean}),
455+ "warriorship": mapSchema(S.Boolean),
438456 "whitepot": S.Array(S.Union(S.Number, QuebrachineClass)),
439457 "wrothy": S.Array(S.Union(S.Array(S.Null), WrothyClass)),
440458 }) {}
Mtypescript-effect-schemajust-schema-true--8c4ca457bcba / TopLevel.ts+29 −11
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class WrothyClass extends S.Class<WrothyClass>("WrothyClass")({
523 "Aeschynanthus": S.Null,
@@ -389,7 +407,7 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
389407 "pulpitism": S.Array(S.Union(S.Array(S.Int), S.Number, PulpitismClass)),
390408 "pyodermia": S.Array(S.Union(S.Int, PyodermiaClass)),
391409 "quebrachine": S.Array(S.Union(S.Boolean, QuebrachineClass, S.Null)),
392- "querier": S.Array(S.Union(S.Boolean, S.Record({ key: S.String, value: S.Int}))),
410+ "querier": S.Array(S.Union(S.Boolean, mapSchema(S.Int))),
393411 "rebarbative": S.Array(S.Union(S.Array(S.Int), S.Boolean, S.Number)),
394412 "reimagine": S.Array(Reimagine),
395413 "ressaut": Ressaut,
@@ -398,10 +416,10 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
398416 "rewrite": S.Array(S.Union(S.Array(S.Null), S.Number, RewriteClass)),
399417 "saccoderm": S.Array(S.Union(S.Array(S.Int), S.String, S.Null)),
400418 "santir": S.Array(S.Union(S.Number, SantirClass)),
401- "saprophilous": S.Array(S.Union(S.Record({ key: S.String, value: S.Int}), S.String, S.Null)),
419+ "saprophilous": S.Array(S.Union(mapSchema(S.Int), S.String, S.Null)),
402420 "saxten": S.Array(S.Union(S.String, SaxtenClass)),
403421 "scatty": S.Array(S.NullOr(Scatty)),
404- "scoffer": S.Array(S.Union(S.Array(S.Null), S.Record({ key: S.String, value: S.Int}), S.Null)),
422+ "scoffer": S.Array(S.Union(S.Array(S.Null), mapSchema(S.Int), S.Null)),
405423 "scrampum": S.Array(S.Union(S.Array(S.Int), S.Boolean, S.Null)),
406424 "semantic": S.Number,
407425 "serpentinic": S.Array(S.Union(S.Array(S.Int), S.Number)),
@@ -409,7 +427,7 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
409427 "sistering": S.Array(S.Union(S.Array(S.Null), S.Int, SisteringClass)),
410428 "staghunting": S.Array(Staghunting),
411429 "stagmometer": S.Array(S.Union(S.Array(S.NullOr(S.Int)), S.String)),
412- "stimulability": S.Array(S.Union(S.Boolean, S.Int, S.Record({ key: S.String, value: S.Int}))),
430+ "stimulability": S.Array(S.Union(S.Boolean, S.Int, mapSchema(S.Int))),
413431 "strangleable": S.Array(S.Union(S.Array(S.Null), S.Number)),
414432 "strenuosity": S.Array(S.Union(S.Array(S.Null), StrenuosityClass)),
415433 "tabaxir": S.Array(S.Union(S.Boolean, S.Number)),
@@ -419,22 +437,22 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
419437 "tortricine": S.Array(S.Union(S.Array(S.NullOr(S.Int)), QuebrachineClass)),
420438 "truantcy": S.Array(S.Union(S.Boolean, TruantcyClass)),
421439 "turgesce": S.Array(S.String),
422- "unbeginning": S.Array(S.Union(S.Array(S.Null), S.Record({ key: S.String, value: S.Int}), S.String)),
440+ "unbeginning": S.Array(S.Union(S.Array(S.Null), mapSchema(S.Int), S.String)),
423441 "underdunged": S.Array(S.Number),
424- "undesirability": S.Array(S.Union(S.Array(S.Int), S.Record({ key: S.String, value: S.Int}), S.String)),
425- "unerasing": S.Array(S.Union(S.Array(S.Null), S.Int, S.Record({ key: S.String, value: S.Int}))),
442+ "undesirability": S.Array(S.Union(S.Array(S.Int), mapSchema(S.Int), S.String)),
443+ "unerasing": S.Array(S.Union(S.Array(S.Null), S.Int, mapSchema(S.Int))),
426444 "unguentarium": S.Array(S.Union(S.Array(S.Null), S.Int, S.Null)),
427445 "unimpeachably": S.Array(S.Union(S.Boolean, UnimpeachablyClass)),
428- "unmortgaged": S.Array(S.Union(S.Number, S.Record({ key: S.String, value: S.Int}), S.Null)),
446+ "unmortgaged": S.Array(S.Union(S.Number, mapSchema(S.Int), S.Null)),
429447 "unobstructed": S.Array(S.Union(S.Int, QuebrachineClass, S.Null)),
430448 "unreceptivity": S.Array(S.Union(S.Array(S.Null), S.Int, S.String)),
431449 "unsatisfactoriness": S.Array(S.Union(S.Array(S.Int), S.Boolean, S.Int)),
432450 "unsecurity": S.Array(S.Int),
433451 "unstressed": S.Array(S.Union(S.Boolean, S.String, UnstressedClass)),
434- "untasked": S.Array(S.Union(S.Array(S.Null), S.Number, S.Record({ key: S.String, value: S.Int}))),
435- "unvarying": S.Array(S.Union(S.Boolean, S.Number, S.Record({ key: S.String, value: S.Int}))),
452+ "untasked": S.Array(S.Union(S.Array(S.Null), S.Number, mapSchema(S.Int))),
453+ "unvarying": S.Array(S.Union(S.Boolean, S.Number, mapSchema(S.Int))),
436454 "vehemently": S.Array(S.Union(S.Array(S.Null), S.Boolean, S.Null)),
437- "warriorship": S.Record({ key: S.String, value: S.Boolean}),
455+ "warriorship": mapSchema(S.Boolean),
438456 "whitepot": S.Array(S.Union(S.Number, QuebrachineClass)),
439457 "wrothy": S.Array(S.Union(S.Array(S.Null), WrothyClass)),
440458 }) {}
Mtypescriptacronym-style-pascal--d9e0c1bd777a / TopLevel.ts+2 −2
@@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 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
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 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
753753 if (val === null || typeof val !== "object" || Array.isArray(val)) {
754754 return invalidValue(l(ref || "object"), val, key, parent);
755755 }
756- const result: any = {};
756+ const result: any = Object.create(null);
757757 Object.getOwnPropertyNames(props).forEach(key => {
758758 const prop = props[key];
759759 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
764764 result[key] = transform(val[key], additional, getProps, key, ref);
765765 }
766766 });
767- return result;
767+ return Object.setPrototypeOf(result, Object.prototype);
768768 }
769769
770770 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
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 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
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 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
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 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
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 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
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 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
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 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
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 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
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 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
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 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
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 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
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 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
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 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
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 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
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 if (typ === "any") return val;
Mtypescriptreadonly-true--24da4fc107df / TopLevel.ts+2 −2
@@ -625,7 +625,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 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
636636 result[key] = transform(val[key], additional, getProps, key, ref);
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 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
625625 if (val === null || typeof val !== "object" || Array.isArray(val)) {
626626 return invalidValue(l(ref || "object"), val, key, parent);
627627 }
628- const result: any = {};
628+ const result: any = Object.create(null);
629629 Object.getOwnPropertyNames(props).forEach(key => {
630630 const prop = props[key];
631631 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
636636 result[key] = val[key];
637637 }
638638 });
639- return result;
639+ return Object.setPrototypeOf(result, Object.prototype);
640640 }
641641
642642 if (typ === "any") return val;
Test case

test/inputs/json/priority/combined-enum.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/json/priority/direct-recursive.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/priority/empty-enum.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/priority/identifiers.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
138138 if (val === null || typeof val !== "object" || Array.isArray(val)) {
139139 return invalidValue(l(ref || "object"), val, key, parent);
140140 }
141- const result: any = {};
141+ const result: any = Object.create(null);
142142 Object.getOwnPropertyNames(props).forEach(key => {
143143 const prop = props[key];
144144 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
149149 result[key] = transform(val[key], additional, getProps, key, ref);
150150 }
151151 });
152- return result;
152+ return Object.setPrototypeOf(result, Object.prototype);
153153 }
154154
155155 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
135135 if (val === null || typeof val !== "object" || Array.isArray(val)) {
136136 return invalidValue(l(ref || "object"), val, key, parent);
137137 }
138- const result: any = {};
138+ const result: any = Object.create(null);
139139 Object.getOwnPropertyNames(props).forEach(key => {
140140 const prop = props[key];
141141 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
146146 result[key] = transform(val[key], additional, getProps, key, ref);
147147 }
148148 });
149- return result;
149+ return Object.setPrototypeOf(result, Object.prototype);
150150 }
151151
152152 if (typ === "any") return val;
Test case

test/inputs/json/priority/issue2680-object-array.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/priority/issue2680-scalar-array.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 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
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 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
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Test case

test/inputs/json/priority/keywords.json

50 generated files · +7,509 −6,619
Mcjsondefault / TopLevel.c+583 −518
@@ -11031,6 +11031,61 @@ void cJSON_DeleteLock(struct Lock * x) {
1103111031 }
1103211032 }
1103311033
11034+struct MakeDictEncoder * cJSON_ParseMakeDictEncoder(const char * s) {
11035+ struct MakeDictEncoder * x = NULL;
11036+ if (NULL != s) {
11037+ cJSON * j = cJSON_Parse(s);
11038+ if (NULL != j) {
11039+ x = cJSON_GetMakeDictEncoderValue(j);
11040+ cJSON_Delete(j);
11041+ }
11042+ }
11043+ return x;
11044+}
11045+
11046+struct MakeDictEncoder * cJSON_GetMakeDictEncoderValue(const cJSON * j) {
11047+ struct MakeDictEncoder * x = NULL;
11048+ if (NULL != j) {
11049+ if (NULL != (x = cJSON_malloc(sizeof(struct MakeDictEncoder)))) {
11050+ memset(x, 0, sizeof(struct MakeDictEncoder));
11051+ if (!cJSON_HasObjectItem(j, "makeDictEncoder")) { cJSON_DeleteMakeDictEncoder(x); return NULL; }
11052+ if (cJSON_HasObjectItem(j, "makeDictEncoder")) {
11053+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "makeDictEncoder"))) { cJSON_DeleteMakeDictEncoder(x); return NULL; }
11054+ x->make_dict_encoder = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "makeDictEncoder"));
11055+ }
11056+ }
11057+ }
11058+ return x;
11059+}
11060+
11061+cJSON * cJSON_CreateMakeDictEncoder(const struct MakeDictEncoder * x) {
11062+ cJSON * j = NULL;
11063+ if (NULL != x) {
11064+ if (NULL != (j = cJSON_CreateObject())) {
11065+ cJSON_AddNumberToObject(j, "makeDictEncoder", x->make_dict_encoder);
11066+ }
11067+ }
11068+ return j;
11069+}
11070+
11071+char * cJSON_PrintMakeDictEncoder(const struct MakeDictEncoder * x) {
11072+ char * s = NULL;
11073+ if (NULL != x) {
11074+ cJSON * j = cJSON_CreateMakeDictEncoder(x);
11075+ if (NULL != j) {
11076+ s = cJSON_Print(j);
11077+ cJSON_Delete(j);
11078+ }
11079+ }
11080+ return s;
11081+}
11082+
11083+void cJSON_DeleteMakeDictEncoder(struct MakeDictEncoder * x) {
11084+ if (NULL != x) {
11085+ cJSON_free(x);
11086+ }
11087+}
11088+
1103411089 struct Map * cJSON_ParseMap(const char * s) {
1103511090 struct Map * x = NULL;
1103611091 if (NULL != s) {
@@ -11416,116 +11471,6 @@ void cJSON_DeleteNewtonsoft(struct Newtonsoft * x) {
1141611471 }
1141711472 }
1141811473
11419-struct Nil * cJSON_ParseNil(const char * s) {
11420- struct Nil * x = NULL;
11421- if (NULL != s) {
11422- cJSON * j = cJSON_Parse(s);
11423- if (NULL != j) {
11424- x = cJSON_GetNilValue(j);
11425- cJSON_Delete(j);
11426- }
11427- }
11428- return x;
11429-}
11430-
11431-struct Nil * cJSON_GetNilValue(const cJSON * j) {
11432- struct Nil * x = NULL;
11433- if (NULL != j) {
11434- if (NULL != (x = cJSON_malloc(sizeof(struct Nil)))) {
11435- memset(x, 0, sizeof(struct Nil));
11436- if (!cJSON_HasObjectItem(j, "nil")) { cJSON_DeleteNil(x); return NULL; }
11437- if (cJSON_HasObjectItem(j, "nil")) {
11438- if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "nil"))) { cJSON_DeleteNil(x); return NULL; }
11439- x->nil = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "nil"));
11440- }
11441- }
11442- }
11443- return x;
11444-}
11445-
11446-cJSON * cJSON_CreateNil(const struct Nil * x) {
11447- cJSON * j = NULL;
11448- if (NULL != x) {
11449- if (NULL != (j = cJSON_CreateObject())) {
11450- cJSON_AddNumberToObject(j, "nil", x->nil);
11451- }
11452- }
11453- return j;
11454-}
11455-
11456-char * cJSON_PrintNil(const struct Nil * x) {
11457- char * s = NULL;
11458- if (NULL != x) {
11459- cJSON * j = cJSON_CreateNil(x);
11460- if (NULL != j) {
11461- s = cJSON_Print(j);
11462- cJSON_Delete(j);
11463- }
11464- }
11465- return s;
11466-}
11467-
11468-void cJSON_DeleteNil(struct Nil * x) {
11469- if (NULL != x) {
11470- cJSON_free(x);
11471- }
11472-}
11473-
11474-struct No * cJSON_ParseNo(const char * s) {
11475- struct No * x = NULL;
11476- if (NULL != s) {
11477- cJSON * j = cJSON_Parse(s);
11478- if (NULL != j) {
11479- x = cJSON_GetNoValue(j);
11480- cJSON_Delete(j);
11481- }
11482- }
11483- return x;
11484-}
11485-
11486-struct No * cJSON_GetNoValue(const cJSON * j) {
11487- struct No * x = NULL;
11488- if (NULL != j) {
11489- if (NULL != (x = cJSON_malloc(sizeof(struct No)))) {
11490- memset(x, 0, sizeof(struct No));
11491- if (!cJSON_HasObjectItem(j, "NO")) { cJSON_DeleteNo(x); return NULL; }
11492- if (cJSON_HasObjectItem(j, "NO")) {
11493- if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "NO"))) { cJSON_DeleteNo(x); return NULL; }
11494- x->no = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "NO"));
11495- }
11496- }
11497- }
11498- return x;
11499-}
11500-
11501-cJSON * cJSON_CreateNo(const struct No * x) {
11502- cJSON * j = NULL;
11503- if (NULL != x) {
11504- if (NULL != (j = cJSON_CreateObject())) {
11505- cJSON_AddNumberToObject(j, "NO", x->no);
11506- }
11507- }
11508- return j;
11509-}
11510-
11511-char * cJSON_PrintNo(const struct No * x) {
11512- char * s = NULL;
11513- if (NULL != x) {
11514- cJSON * j = cJSON_CreateNo(x);
11515- if (NULL != j) {
11516- s = cJSON_Print(j);
11517- cJSON_Delete(j);
11518- }
11519- }
11520- return s;
11521-}
11522-
11523-void cJSON_DeleteNo(struct No * x) {
11524- if (NULL != x) {
11525- cJSON_free(x);
11526- }
11527-}
11528-
1152911474 struct Goto * cJSON_ParseGoto(const char * s) {
1153011475 struct Goto * x = NULL;
1153111476 if (NULL != s) {
@@ -12374,6 +12319,12 @@ struct Obj3 * cJSON_GetObj3Value(const cJSON * j) {
1237412319 x->lock = cJSON_GetLockValue(cJSON_GetObjectItemCaseSensitive(j, "lock"));
1237512320 if (NULL == x->lock) { cJSON_DeleteObj3(x); return NULL; }
1237612321 }
12322+ if (!cJSON_HasObjectItem(j, "makeDictEncoder")) { cJSON_DeleteObj3(x); return NULL; }
12323+ if (cJSON_HasObjectItem(j, "makeDictEncoder")) {
12324+ if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "makeDictEncoder"))) { cJSON_DeleteObj3(x); return NULL; }
12325+ x->make_dict_encoder = cJSON_GetMakeDictEncoderValue(cJSON_GetObjectItemCaseSensitive(j, "makeDictEncoder"));
12326+ if (NULL == x->make_dict_encoder) { cJSON_DeleteObj3(x); return NULL; }
12327+ }
1237712328 if (!cJSON_HasObjectItem(j, "map")) { cJSON_DeleteObj3(x); return NULL; }
1237812329 if (cJSON_HasObjectItem(j, "map")) {
1237912330 if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "map"))) { cJSON_DeleteObj3(x); return NULL; }
@@ -12416,18 +12367,6 @@ struct Obj3 * cJSON_GetObj3Value(const cJSON * j) {
1241612367 x->newtonsoft = cJSON_GetNewtonsoftValue(cJSON_GetObjectItemCaseSensitive(j, "newtonsoft"));
1241712368 if (NULL == x->newtonsoft) { cJSON_DeleteObj3(x); return NULL; }
1241812369 }
12419- if (!cJSON_HasObjectItem(j, "nil")) { cJSON_DeleteObj3(x); return NULL; }
12420- if (cJSON_HasObjectItem(j, "nil")) {
12421- if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "nil"))) { cJSON_DeleteObj3(x); return NULL; }
12422- x->nil = cJSON_GetNilValue(cJSON_GetObjectItemCaseSensitive(j, "nil"));
12423- if (NULL == x->nil) { cJSON_DeleteObj3(x); return NULL; }
12424- }
12425- if (!cJSON_HasObjectItem(j, "NO")) { cJSON_DeleteObj3(x); return NULL; }
12426- if (cJSON_HasObjectItem(j, "NO")) {
12427- if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "NO"))) { cJSON_DeleteObj3(x); return NULL; }
12428- x->no = cJSON_GetNoValue(cJSON_GetObjectItemCaseSensitive(j, "NO"));
12429- if (NULL == x->no) { cJSON_DeleteObj3(x); return NULL; }
12430- }
1243112370 if (!cJSON_HasObjectItem(j, "goto")) { cJSON_DeleteObj3(x); return NULL; }
1243212371 if (cJSON_HasObjectItem(j, "goto")) {
1243312372 if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "goto"))) { cJSON_DeleteObj3(x); return NULL; }
@@ -12544,6 +12483,7 @@ cJSON * cJSON_CreateObj3(const struct Obj3 * x) {
1254412483 cJSON_AddItemToObject(j, "list", cJSON_CreateList(x->list));
1254512484 cJSON_AddItemToObject(j, "Locale", cJSON_CreateLocale(x->locale));
1254612485 cJSON_AddItemToObject(j, "lock", cJSON_CreateLock(x->lock));
12486+ cJSON_AddItemToObject(j, "makeDictEncoder", cJSON_CreateMakeDictEncoder(x->make_dict_encoder));
1254712487 cJSON_AddItemToObject(j, "map", cJSON_CreateMap(x->map));
1254812488 cJSON_AddItemToObject(j, "MapEntry", cJSON_CreateMapEntry(x->map_entry));
1254912489 cJSON_AddItemToObject(j, "MarshalJSON", cJSON_CreateMarshalJson(x->marshal_json));
@@ -12551,8 +12491,6 @@ cJSON * cJSON_CreateObj3(const struct Obj3 * x) {
1255112491 cJSON_AddItemToObject(j, "mutating", cJSON_CreateMutating(x->mutating));
1255212492 cJSON_AddItemToObject(j, "native", cJSON_CreateNative(x->native));
1255312493 cJSON_AddItemToObject(j, "newtonsoft", cJSON_CreateNewtonsoft(x->newtonsoft));
12554- cJSON_AddItemToObject(j, "nil", cJSON_CreateNil(x->nil));
12555- cJSON_AddItemToObject(j, "NO", cJSON_CreateNo(x->no));
1255612494 cJSON_AddItemToObject(j, "goto", cJSON_CreateGoto(x->obj3_goto));
1255712495 cJSON_AddItemToObject(j, "if", cJSON_CreateIf(x->obj3_if));
1255812496 cJSON_AddItemToObject(j, "import", cJSON_CreateImport(x->obj3_import));
@@ -12720,6 +12658,9 @@ void cJSON_DeleteObj3(struct Obj3 * x) {
1272012658 if (NULL != x->lock) {
1272112659 cJSON_DeleteLock(x->lock);
1272212660 }
12661+ if (NULL != x->make_dict_encoder) {
12662+ cJSON_DeleteMakeDictEncoder(x->make_dict_encoder);
12663+ }
1272312664 if (NULL != x->map) {
1272412665 cJSON_DeleteMap(x->map);
1272512666 }
@@ -12741,12 +12682,6 @@ void cJSON_DeleteObj3(struct Obj3 * x) {
1274112682 if (NULL != x->newtonsoft) {
1274212683 cJSON_DeleteNewtonsoft(x->newtonsoft);
1274312684 }
12744- if (NULL != x->nil) {
12745- cJSON_DeleteNil(x->nil);
12746- }
12747- if (NULL != x->no) {
12748- cJSON_DeleteNo(x->no);
12749- }
1275012685 if (NULL != x->obj3_goto) {
1275112686 cJSON_DeleteGoto(x->obj3_goto);
1275212687 }
@@ -12781,6 +12716,116 @@ void cJSON_DeleteObj3(struct Obj3 * x) {
1278112716 }
1278212717 }
1278312718
12719+struct Nil * cJSON_ParseNil(const char * s) {
12720+ struct Nil * x = NULL;
12721+ if (NULL != s) {
12722+ cJSON * j = cJSON_Parse(s);
12723+ if (NULL != j) {
12724+ x = cJSON_GetNilValue(j);
12725+ cJSON_Delete(j);
12726+ }
12727+ }
12728+ return x;
12729+}
12730+
12731+struct Nil * cJSON_GetNilValue(const cJSON * j) {
12732+ struct Nil * x = NULL;
12733+ if (NULL != j) {
12734+ if (NULL != (x = cJSON_malloc(sizeof(struct Nil)))) {
12735+ memset(x, 0, sizeof(struct Nil));
12736+ if (!cJSON_HasObjectItem(j, "nil")) { cJSON_DeleteNil(x); return NULL; }
12737+ if (cJSON_HasObjectItem(j, "nil")) {
12738+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "nil"))) { cJSON_DeleteNil(x); return NULL; }
12739+ x->nil = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "nil"));
12740+ }
12741+ }
12742+ }
12743+ return x;
12744+}
12745+
12746+cJSON * cJSON_CreateNil(const struct Nil * x) {
12747+ cJSON * j = NULL;
12748+ if (NULL != x) {
12749+ if (NULL != (j = cJSON_CreateObject())) {
12750+ cJSON_AddNumberToObject(j, "nil", x->nil);
12751+ }
12752+ }
12753+ return j;
12754+}
12755+
12756+char * cJSON_PrintNil(const struct Nil * x) {
12757+ char * s = NULL;
12758+ if (NULL != x) {
12759+ cJSON * j = cJSON_CreateNil(x);
12760+ if (NULL != j) {
12761+ s = cJSON_Print(j);
12762+ cJSON_Delete(j);
12763+ }
12764+ }
12765+ return s;
12766+}
12767+
12768+void cJSON_DeleteNil(struct Nil * x) {
12769+ if (NULL != x) {
12770+ cJSON_free(x);
12771+ }
12772+}
12773+
12774+struct No * cJSON_ParseNo(const char * s) {
12775+ struct No * x = NULL;
12776+ if (NULL != s) {
12777+ cJSON * j = cJSON_Parse(s);
12778+ if (NULL != j) {
12779+ x = cJSON_GetNoValue(j);
12780+ cJSON_Delete(j);
12781+ }
12782+ }
12783+ return x;
12784+}
12785+
12786+struct No * cJSON_GetNoValue(const cJSON * j) {
12787+ struct No * x = NULL;
12788+ if (NULL != j) {
12789+ if (NULL != (x = cJSON_malloc(sizeof(struct No)))) {
12790+ memset(x, 0, sizeof(struct No));
12791+ if (!cJSON_HasObjectItem(j, "NO")) { cJSON_DeleteNo(x); return NULL; }
12792+ if (cJSON_HasObjectItem(j, "NO")) {
12793+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "NO"))) { cJSON_DeleteNo(x); return NULL; }
12794+ x->no = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "NO"));
12795+ }
12796+ }
12797+ }
12798+ return x;
12799+}
12800+
12801+cJSON * cJSON_CreateNo(const struct No * x) {
12802+ cJSON * j = NULL;
12803+ if (NULL != x) {
12804+ if (NULL != (j = cJSON_CreateObject())) {
12805+ cJSON_AddNumberToObject(j, "NO", x->no);
12806+ }
12807+ }
12808+ return j;
12809+}
12810+
12811+char * cJSON_PrintNo(const struct No * x) {
12812+ char * s = NULL;
12813+ if (NULL != x) {
12814+ cJSON * j = cJSON_CreateNo(x);
12815+ if (NULL != j) {
12816+ s = cJSON_Print(j);
12817+ cJSON_Delete(j);
12818+ }
12819+ }
12820+ return s;
12821+}
12822+
12823+void cJSON_DeleteNo(struct No * x) {
12824+ if (NULL != x) {
12825+ cJSON_free(x);
12826+ }
12827+}
12828+
1278412829 struct NoSuchMethod * cJSON_ParseNoSuchMethod(const char * s) {
1278512830 struct NoSuchMethod * x = NULL;
1278612831 if (NULL != s) {
@@ -16204,116 +16249,6 @@ void cJSON_DeleteSbyte(struct Sbyte * x) {
1620416249 }
1620516250 }
1620616251
16207-struct Sealed * cJSON_ParseSealed(const char * s) {
16208- struct Sealed * x = NULL;
16209- if (NULL != s) {
16210- cJSON * j = cJSON_Parse(s);
16211- if (NULL != j) {
16212- x = cJSON_GetSealedValue(j);
16213- cJSON_Delete(j);
16214- }
16215- }
16216- return x;
16217-}
16218-
16219-struct Sealed * cJSON_GetSealedValue(const cJSON * j) {
16220- struct Sealed * x = NULL;
16221- if (NULL != j) {
16222- if (NULL != (x = cJSON_malloc(sizeof(struct Sealed)))) {
16223- memset(x, 0, sizeof(struct Sealed));
16224- if (!cJSON_HasObjectItem(j, "sealed")) { cJSON_DeleteSealed(x); return NULL; }
16225- if (cJSON_HasObjectItem(j, "sealed")) {
16226- if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "sealed"))) { cJSON_DeleteSealed(x); return NULL; }
16227- x->sealed = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "sealed"));
16228- }
16229- }
16230- }
16231- return x;
16232-}
16233-
16234-cJSON * cJSON_CreateSealed(const struct Sealed * x) {
16235- cJSON * j = NULL;
16236- if (NULL != x) {
16237- if (NULL != (j = cJSON_CreateObject())) {
16238- cJSON_AddNumberToObject(j, "sealed", x->sealed);
16239- }
16240- }
16241- return j;
16242-}
16243-
16244-char * cJSON_PrintSealed(const struct Sealed * x) {
16245- char * s = NULL;
16246- if (NULL != x) {
16247- cJSON * j = cJSON_CreateSealed(x);
16248- if (NULL != j) {
16249- s = cJSON_Print(j);
16250- cJSON_Delete(j);
16251- }
16252- }
16253- return s;
16254-}
16255-
16256-void cJSON_DeleteSealed(struct Sealed * x) {
16257- if (NULL != x) {
16258- cJSON_free(x);
16259- }
16260-}
16261-
16262-struct Sel * cJSON_ParseSel(const char * s) {
16263- struct Sel * x = NULL;
16264- if (NULL != s) {
16265- cJSON * j = cJSON_Parse(s);
16266- if (NULL != j) {
16267- x = cJSON_GetSelValue(j);
16268- cJSON_Delete(j);
16269- }
16270- }
16271- return x;
16272-}
16273-
16274-struct Sel * cJSON_GetSelValue(const cJSON * j) {
16275- struct Sel * x = NULL;
16276- if (NULL != j) {
16277- if (NULL != (x = cJSON_malloc(sizeof(struct Sel)))) {
16278- memset(x, 0, sizeof(struct Sel));
16279- if (!cJSON_HasObjectItem(j, "SEL")) { cJSON_DeleteSel(x); return NULL; }
16280- if (cJSON_HasObjectItem(j, "SEL")) {
16281- if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "SEL"))) { cJSON_DeleteSel(x); return NULL; }
16282- x->sel = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "SEL"));
16283- }
16284- }
16285- }
16286- return x;
16287-}
16288-
16289-cJSON * cJSON_CreateSel(const struct Sel * x) {
16290- cJSON * j = NULL;
16291- if (NULL != x) {
16292- if (NULL != (j = cJSON_CreateObject())) {
16293- cJSON_AddNumberToObject(j, "SEL", x->sel);
16294- }
16295- }
16296- return j;
16297-}
16298-
16299-char * cJSON_PrintSel(const struct Sel * x) {
16300- char * s = NULL;
16301- if (NULL != x) {
16302- cJSON * j = cJSON_CreateSel(x);
16303- if (NULL != j) {
16304- s = cJSON_Print(j);
16305- cJSON_Delete(j);
16306- }
16307- }
16308- return s;
16309-}
16310-
16311-void cJSON_DeleteSel(struct Sel * x) {
16312- if (NULL != x) {
16313- cJSON_free(x);
16314- }
16315-}
16316-
1631716252 struct Obj4 * cJSON_ParseObj4(const char * s) {
1631816253 struct Obj4 * x = NULL;
1631916254 if (NULL != s) {
@@ -16336,6 +16271,18 @@ struct Obj4 * cJSON_GetObj4Value(const cJSON * j) {
1633616271 if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "dummy"))) { cJSON_DeleteObj4(x); return NULL; }
1633716272 x->dummy = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "dummy"));
1633816273 }
16274+ if (!cJSON_HasObjectItem(j, "nil")) { cJSON_DeleteObj4(x); return NULL; }
16275+ if (cJSON_HasObjectItem(j, "nil")) {
16276+ if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "nil"))) { cJSON_DeleteObj4(x); return NULL; }
16277+ x->nil = cJSON_GetNilValue(cJSON_GetObjectItemCaseSensitive(j, "nil"));
16278+ if (NULL == x->nil) { cJSON_DeleteObj4(x); return NULL; }
16279+ }
16280+ if (!cJSON_HasObjectItem(j, "NO")) { cJSON_DeleteObj4(x); return NULL; }
16281+ if (cJSON_HasObjectItem(j, "NO")) {
16282+ if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "NO"))) { cJSON_DeleteObj4(x); return NULL; }
16283+ x->no = cJSON_GetNoValue(cJSON_GetObjectItemCaseSensitive(j, "NO"));
16284+ if (NULL == x->no) { cJSON_DeleteObj4(x); return NULL; }
16285+ }
1633916286 if (!cJSON_HasObjectItem(j, "noSuchMethod")) { cJSON_DeleteObj4(x); return NULL; }
1634016287 if (cJSON_HasObjectItem(j, "noSuchMethod")) {
1634116288 if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "noSuchMethod"))) { cJSON_DeleteObj4(x); return NULL; }
@@ -16708,18 +16655,6 @@ struct Obj4 * cJSON_GetObj4Value(const cJSON * j) {
1670816655 x->sbyte = cJSON_GetSbyteValue(cJSON_GetObjectItemCaseSensitive(j, "sbyte"));
1670916656 if (NULL == x->sbyte) { cJSON_DeleteObj4(x); return NULL; }
1671016657 }
16711- if (!cJSON_HasObjectItem(j, "sealed")) { cJSON_DeleteObj4(x); return NULL; }
16712- if (cJSON_HasObjectItem(j, "sealed")) {
16713- if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "sealed"))) { cJSON_DeleteObj4(x); return NULL; }
16714- x->sealed = cJSON_GetSealedValue(cJSON_GetObjectItemCaseSensitive(j, "sealed"));
16715- if (NULL == x->sealed) { cJSON_DeleteObj4(x); return NULL; }
16716- }
16717- if (!cJSON_HasObjectItem(j, "SEL")) { cJSON_DeleteObj4(x); return NULL; }
16718- if (cJSON_HasObjectItem(j, "SEL")) {
16719- if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "SEL"))) { cJSON_DeleteObj4(x); return NULL; }
16720- x->sel = cJSON_GetSelValue(cJSON_GetObjectItemCaseSensitive(j, "SEL"));
16721- if (NULL == x->sel) { cJSON_DeleteObj4(x); return NULL; }
16722- }
1672316658 }
1672416659 }
1672516660 return x;
@@ -16730,6 +16665,8 @@ cJSON * cJSON_CreateObj4(const struct Obj4 * x) {
1673016665 if (NULL != x) {
1673116666 if (NULL != (j = cJSON_CreateObject())) {
1673216667 cJSON_AddNumberToObject(j, "dummy", x->dummy);
16668+ cJSON_AddItemToObject(j, "nil", cJSON_CreateNil(x->nil));
16669+ cJSON_AddItemToObject(j, "NO", cJSON_CreateNo(x->no));
1673316670 cJSON_AddItemToObject(j, "noSuchMethod", cJSON_CreateNoSuchMethod(x->no_such_method));
1673416671 cJSON_AddItemToObject(j, "nonatomic", cJSON_CreateNonatomic(x->nonatomic));
1673516672 cJSON_AddItemToObject(j, "None", cJSON_CreateNone(x->none));
@@ -16792,8 +16729,6 @@ cJSON * cJSON_CreateObj4(const struct Obj4 * x) {
1679216729 cJSON_AddItemToObject(j, "runtimeType", cJSON_CreateRuntimeType(x->runtime_type));
1679316730 cJSON_AddItemToObject(j, "s", cJSON_CreateS(x->s));
1679416731 cJSON_AddItemToObject(j, "sbyte", cJSON_CreateSbyte(x->sbyte));
16795- cJSON_AddItemToObject(j, "sealed", cJSON_CreateSealed(x->sealed));
16796- cJSON_AddItemToObject(j, "SEL", cJSON_CreateSel(x->sel));
1679716732 }
1679816733 }
1679916734 return j;
@@ -16813,6 +16748,12 @@ char * cJSON_PrintObj4(const struct Obj4 * x) {
1681316748
1681416749 void cJSON_DeleteObj4(struct Obj4 * x) {
1681516750 if (NULL != x) {
16751+ if (NULL != x->nil) {
16752+ cJSON_DeleteNil(x->nil);
16753+ }
16754+ if (NULL != x->no) {
16755+ cJSON_DeleteNo(x->no);
16756+ }
1681616757 if (NULL != x->no_such_method) {
1681716758 cJSON_DeleteNoSuchMethod(x->no_such_method);
1681816759 }
@@ -16999,12 +16940,6 @@ void cJSON_DeleteObj4(struct Obj4 * x) {
1699916940 if (NULL != x->sbyte) {
1700016941 cJSON_DeleteSbyte(x->sbyte);
1700116942 }
17002- if (NULL != x->sealed) {
17003- cJSON_DeleteSealed(x->sealed);
17004- }
17005- if (NULL != x->sel) {
17006- cJSON_DeleteSel(x->sel);
17007- }
1700816943 cJSON_free(x);
1700916944 }
1701016945 }
@@ -18231,35 +18166,145 @@ struct Union * cJSON_ParseUnion(const char * s) {
1823118166 return x;
1823218167 }
1823318168
18234-struct Union * cJSON_GetUnionValue(const cJSON * j) {
18235- struct Union * x = NULL;
18169+struct Union * cJSON_GetUnionValue(const cJSON * j) {
18170+ struct Union * x = NULL;
18171+ if (NULL != j) {
18172+ if (NULL != (x = cJSON_malloc(sizeof(struct Union)))) {
18173+ memset(x, 0, sizeof(struct Union));
18174+ if (!cJSON_HasObjectItem(j, "union")) { cJSON_DeleteUnion(x); return NULL; }
18175+ if (cJSON_HasObjectItem(j, "union")) {
18176+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "union"))) { cJSON_DeleteUnion(x); return NULL; }
18177+ x->union_union = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "union"));
18178+ }
18179+ }
18180+ }
18181+ return x;
18182+}
18183+
18184+cJSON * cJSON_CreateUnion(const struct Union * x) {
18185+ cJSON * j = NULL;
18186+ if (NULL != x) {
18187+ if (NULL != (j = cJSON_CreateObject())) {
18188+ cJSON_AddNumberToObject(j, "union", x->union_union);
18189+ }
18190+ }
18191+ return j;
18192+}
18193+
18194+char * cJSON_PrintUnion(const struct Union * x) {
18195+ char * s = NULL;
18196+ if (NULL != x) {
18197+ cJSON * j = cJSON_CreateUnion(x);
18198+ if (NULL != j) {
18199+ s = cJSON_Print(j);
18200+ cJSON_Delete(j);
18201+ }
18202+ }
18203+ return s;
18204+}
18205+
18206+void cJSON_DeleteUnion(struct Union * x) {
18207+ if (NULL != x) {
18208+ cJSON_free(x);
18209+ }
18210+}
18211+
18212+struct PrimitiveKind * cJSON_ParsePrimitiveKind(const char * s) {
18213+ struct PrimitiveKind * x = NULL;
18214+ if (NULL != s) {
18215+ cJSON * j = cJSON_Parse(s);
18216+ if (NULL != j) {
18217+ x = cJSON_GetPrimitiveKindValue(j);
18218+ cJSON_Delete(j);
18219+ }
18220+ }
18221+ return x;
18222+}
18223+
18224+struct PrimitiveKind * cJSON_GetPrimitiveKindValue(const cJSON * j) {
18225+ struct PrimitiveKind * x = NULL;
18226+ if (NULL != j) {
18227+ if (NULL != (x = cJSON_malloc(sizeof(struct PrimitiveKind)))) {
18228+ memset(x, 0, sizeof(struct PrimitiveKind));
18229+ if (!cJSON_HasObjectItem(j, "PrimitiveKind")) { cJSON_DeletePrimitiveKind(x); return NULL; }
18230+ if (cJSON_HasObjectItem(j, "PrimitiveKind")) {
18231+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "PrimitiveKind"))) { cJSON_DeletePrimitiveKind(x); return NULL; }
18232+ x->primitive_kind = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "PrimitiveKind"));
18233+ }
18234+ }
18235+ }
18236+ return x;
18237+}
18238+
18239+cJSON * cJSON_CreatePrimitiveKind(const struct PrimitiveKind * x) {
18240+ cJSON * j = NULL;
18241+ if (NULL != x) {
18242+ if (NULL != (j = cJSON_CreateObject())) {
18243+ cJSON_AddNumberToObject(j, "PrimitiveKind", x->primitive_kind);
18244+ }
18245+ }
18246+ return j;
18247+}
18248+
18249+char * cJSON_PrintPrimitiveKind(const struct PrimitiveKind * x) {
18250+ char * s = NULL;
18251+ if (NULL != x) {
18252+ cJSON * j = cJSON_CreatePrimitiveKind(x);
18253+ if (NULL != j) {
18254+ s = cJSON_Print(j);
18255+ cJSON_Delete(j);
18256+ }
18257+ }
18258+ return s;
18259+}
18260+
18261+void cJSON_DeletePrimitiveKind(struct PrimitiveKind * x) {
18262+ if (NULL != x) {
18263+ cJSON_free(x);
18264+ }
18265+}
18266+
18267+struct Obj5True * cJSON_ParseObj5True(const char * s) {
18268+ struct Obj5True * x = NULL;
18269+ if (NULL != s) {
18270+ cJSON * j = cJSON_Parse(s);
18271+ if (NULL != j) {
18272+ x = cJSON_GetObj5TrueValue(j);
18273+ cJSON_Delete(j);
18274+ }
18275+ }
18276+ return x;
18277+}
18278+
18279+struct Obj5True * cJSON_GetObj5TrueValue(const cJSON * j) {
18280+ struct Obj5True * x = NULL;
1823618281 if (NULL != j) {
18237- if (NULL != (x = cJSON_malloc(sizeof(struct Union)))) {
18238- memset(x, 0, sizeof(struct Union));
18239- if (!cJSON_HasObjectItem(j, "union")) { cJSON_DeleteUnion(x); return NULL; }
18240- if (cJSON_HasObjectItem(j, "union")) {
18241- if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "union"))) { cJSON_DeleteUnion(x); return NULL; }
18242- x->union_union = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "union"));
18282+ if (NULL != (x = cJSON_malloc(sizeof(struct Obj5True)))) {
18283+ memset(x, 0, sizeof(struct Obj5True));
18284+ if (!cJSON_HasObjectItem(j, "true")) { cJSON_DeleteObj5True(x); return NULL; }
18285+ if (cJSON_HasObjectItem(j, "true")) {
18286+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "true"))) { cJSON_DeleteObj5True(x); return NULL; }
18287+ x->true_true = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "true"));
1824318288 }
1824418289 }
1824518290 }
1824618291 return x;
1824718292 }
1824818293
18249-cJSON * cJSON_CreateUnion(const struct Union * x) {
18294+cJSON * cJSON_CreateObj5True(const struct Obj5True * x) {
1825018295 cJSON * j = NULL;
1825118296 if (NULL != x) {
1825218297 if (NULL != (j = cJSON_CreateObject())) {
18253- cJSON_AddNumberToObject(j, "union", x->union_union);
18298+ cJSON_AddNumberToObject(j, "true", x->true_true);
1825418299 }
1825518300 }
1825618301 return j;
1825718302 }
1825818303
18259-char * cJSON_PrintUnion(const struct Union * x) {
18304+char * cJSON_PrintObj5True(const struct Obj5True * x) {
1826018305 char * s = NULL;
1826118306 if (NULL != x) {
18262- cJSON * j = cJSON_CreateUnion(x);
18307+ cJSON * j = cJSON_CreateObj5True(x);
1826318308 if (NULL != j) {
1826418309 s = cJSON_Print(j);
1826518310 cJSON_Delete(j);
@@ -18268,53 +18313,53 @@ char * cJSON_PrintUnion(const struct Union * x) {
1826818313 return s;
1826918314 }
1827018315
18271-void cJSON_DeleteUnion(struct Union * x) {
18316+void cJSON_DeleteObj5True(struct Obj5True * x) {
1827218317 if (NULL != x) {
1827318318 cJSON_free(x);
1827418319 }
1827518320 }
1827618321
18277-struct PrimitiveKind * cJSON_ParsePrimitiveKind(const char * s) {
18278- struct PrimitiveKind * x = NULL;
18322+struct Sealed * cJSON_ParseSealed(const char * s) {
18323+ struct Sealed * x = NULL;
1827918324 if (NULL != s) {
1828018325 cJSON * j = cJSON_Parse(s);
1828118326 if (NULL != j) {
18282- x = cJSON_GetPrimitiveKindValue(j);
18327+ x = cJSON_GetSealedValue(j);
1828318328 cJSON_Delete(j);
1828418329 }
1828518330 }
1828618331 return x;
1828718332 }
1828818333
18289-struct PrimitiveKind * cJSON_GetPrimitiveKindValue(const cJSON * j) {
18290- struct PrimitiveKind * x = NULL;
18334+struct Sealed * cJSON_GetSealedValue(const cJSON * j) {
18335+ struct Sealed * x = NULL;
1829118336 if (NULL != j) {
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"));
18337+ if (NULL != (x = cJSON_malloc(sizeof(struct Sealed)))) {
18338+ memset(x, 0, sizeof(struct Sealed));
18339+ if (!cJSON_HasObjectItem(j, "sealed")) { cJSON_DeleteSealed(x); return NULL; }
18340+ if (cJSON_HasObjectItem(j, "sealed")) {
18341+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "sealed"))) { cJSON_DeleteSealed(x); return NULL; }
18342+ x->sealed = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "sealed"));
1829818343 }
1829918344 }
1830018345 }
1830118346 return x;
1830218347 }
1830318348
18304-cJSON * cJSON_CreatePrimitiveKind(const struct PrimitiveKind * x) {
18349+cJSON * cJSON_CreateSealed(const struct Sealed * x) {
1830518350 cJSON * j = NULL;
1830618351 if (NULL != x) {
1830718352 if (NULL != (j = cJSON_CreateObject())) {
18308- cJSON_AddNumberToObject(j, "PrimitiveKind", x->primitive_kind);
18353+ cJSON_AddNumberToObject(j, "sealed", x->sealed);
1830918354 }
1831018355 }
1831118356 return j;
1831218357 }
1831318358
18314-char * cJSON_PrintPrimitiveKind(const struct PrimitiveKind * x) {
18359+char * cJSON_PrintSealed(const struct Sealed * x) {
1831518360 char * s = NULL;
1831618361 if (NULL != x) {
18317- cJSON * j = cJSON_CreatePrimitiveKind(x);
18362+ cJSON * j = cJSON_CreateSealed(x);
1831818363 if (NULL != j) {
1831918364 s = cJSON_Print(j);
1832018365 cJSON_Delete(j);
@@ -18323,53 +18368,53 @@ char * cJSON_PrintPrimitiveKind(const struct PrimitiveKind * x) {
1832318368 return s;
1832418369 }
1832518370
18326-void cJSON_DeletePrimitiveKind(struct PrimitiveKind * x) {
18371+void cJSON_DeleteSealed(struct Sealed * x) {
1832718372 if (NULL != x) {
1832818373 cJSON_free(x);
1832918374 }
1833018375 }
1833118376
18332-struct Obj5True * cJSON_ParseObj5True(const char * s) {
18333- struct Obj5True * x = NULL;
18377+struct Sel * cJSON_ParseSel(const char * s) {
18378+ struct Sel * x = NULL;
1833418379 if (NULL != s) {
1833518380 cJSON * j = cJSON_Parse(s);
1833618381 if (NULL != j) {
18337- x = cJSON_GetObj5TrueValue(j);
18382+ x = cJSON_GetSelValue(j);
1833818383 cJSON_Delete(j);
1833918384 }
1834018385 }
1834118386 return x;
1834218387 }
1834318388
18344-struct Obj5True * cJSON_GetObj5TrueValue(const cJSON * j) {
18345- struct Obj5True * x = NULL;
18389+struct Sel * cJSON_GetSelValue(const cJSON * j) {
18390+ struct Sel * x = NULL;
1834618391 if (NULL != j) {
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"));
18392+ if (NULL != (x = cJSON_malloc(sizeof(struct Sel)))) {
18393+ memset(x, 0, sizeof(struct Sel));
18394+ if (!cJSON_HasObjectItem(j, "SEL")) { cJSON_DeleteSel(x); return NULL; }
18395+ if (cJSON_HasObjectItem(j, "SEL")) {
18396+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "SEL"))) { cJSON_DeleteSel(x); return NULL; }
18397+ x->sel = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "SEL"));
1835318398 }
1835418399 }
1835518400 }
1835618401 return x;
1835718402 }
1835818403
18359-cJSON * cJSON_CreateObj5True(const struct Obj5True * x) {
18404+cJSON * cJSON_CreateSel(const struct Sel * x) {
1836018405 cJSON * j = NULL;
1836118406 if (NULL != x) {
1836218407 if (NULL != (j = cJSON_CreateObject())) {
18363- cJSON_AddNumberToObject(j, "true", x->true_true);
18408+ cJSON_AddNumberToObject(j, "SEL", x->sel);
1836418409 }
1836518410 }
1836618411 return j;
1836718412 }
1836818413
18369-char * cJSON_PrintObj5True(const struct Obj5True * x) {
18414+char * cJSON_PrintSel(const struct Sel * x) {
1837018415 char * s = NULL;
1837118416 if (NULL != x) {
18372- cJSON * j = cJSON_CreateObj5True(x);
18417+ cJSON * j = cJSON_CreateSel(x);
1837318418 if (NULL != j) {
1837418419 s = cJSON_Print(j);
1837518420 cJSON_Delete(j);
@@ -18378,7 +18423,7 @@ char * cJSON_PrintObj5True(const struct Obj5True * x) {
1837818423 return s;
1837918424 }
1838018425
18381-void cJSON_DeleteObj5True(struct Obj5True * x) {
18426+void cJSON_DeleteSel(struct Sel * x) {
1838218427 if (NULL != x) {
1838318428 cJSON_free(x);
1838418429 }
@@ -20349,172 +20394,7 @@ cJSON * cJSON_CreateUndefined(const struct Undefined * x) {
2034920394 char * cJSON_PrintUndefined(const struct Undefined * x) {
2035020395 char * s = NULL;
2035120396 if (NULL != x) {
20352- cJSON * j = cJSON_CreateUndefined(x);
20353- if (NULL != j) {
20354- s = cJSON_Print(j);
20355- cJSON_Delete(j);
20356- }
20357- }
20358- return s;
20359-}
20360-
20361-void cJSON_DeleteUndefined(struct Undefined * x) {
20362- if (NULL != x) {
20363- cJSON_free(x);
20364- }
20365-}
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-
20422-struct Unowned * cJSON_ParseUnowned(const char * s) {
20423- struct Unowned * x = NULL;
20424- if (NULL != s) {
20425- cJSON * j = cJSON_Parse(s);
20426- if (NULL != j) {
20427- x = cJSON_GetUnownedValue(j);
20428- cJSON_Delete(j);
20429- }
20430- }
20431- return x;
20432-}
20433-
20434-struct Unowned * cJSON_GetUnownedValue(const cJSON * j) {
20435- struct Unowned * x = NULL;
20436- if (NULL != j) {
20437- if (NULL != (x = cJSON_malloc(sizeof(struct Unowned)))) {
20438- memset(x, 0, sizeof(struct Unowned));
20439- if (!cJSON_HasObjectItem(j, "unowned")) { cJSON_DeleteUnowned(x); return NULL; }
20440- if (cJSON_HasObjectItem(j, "unowned")) {
20441- if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "unowned"))) { cJSON_DeleteUnowned(x); return NULL; }
20442- x->unowned = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "unowned"));
20443- }
20444- }
20445- }
20446- return x;
20447-}
20448-
20449-cJSON * cJSON_CreateUnowned(const struct Unowned * x) {
20450- cJSON * j = NULL;
20451- if (NULL != x) {
20452- if (NULL != (j = cJSON_CreateObject())) {
20453- cJSON_AddNumberToObject(j, "unowned", x->unowned);
20454- }
20455- }
20456- return j;
20457-}
20458-
20459-char * cJSON_PrintUnowned(const struct Unowned * x) {
20460- char * s = NULL;
20461- if (NULL != x) {
20462- cJSON * j = cJSON_CreateUnowned(x);
20463- if (NULL != j) {
20464- s = cJSON_Print(j);
20465- cJSON_Delete(j);
20466- }
20467- }
20468- return s;
20469-}
20470-
20471-void cJSON_DeleteUnowned(struct Unowned * x) {
20472- if (NULL != x) {
20473- cJSON_free(x);
20474- }
20475-}
20476-
20477-struct Unsafe * cJSON_ParseUnsafe(const char * s) {
20478- struct Unsafe * x = NULL;
20479- if (NULL != s) {
20480- cJSON * j = cJSON_Parse(s);
20481- if (NULL != j) {
20482- x = cJSON_GetUnsafeValue(j);
20483- cJSON_Delete(j);
20484- }
20485- }
20486- return x;
20487-}
20488-
20489-struct Unsafe * cJSON_GetUnsafeValue(const cJSON * j) {
20490- struct Unsafe * x = NULL;
20491- if (NULL != j) {
20492- if (NULL != (x = cJSON_malloc(sizeof(struct Unsafe)))) {
20493- memset(x, 0, sizeof(struct Unsafe));
20494- if (!cJSON_HasObjectItem(j, "unsafe")) { cJSON_DeleteUnsafe(x); return NULL; }
20495- if (cJSON_HasObjectItem(j, "unsafe")) {
20496- if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "unsafe"))) { cJSON_DeleteUnsafe(x); return NULL; }
20497- x->unsafe = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "unsafe"));
20498- }
20499- }
20500- }
20501- return x;
20502-}
20503-
20504-cJSON * cJSON_CreateUnsafe(const struct Unsafe * x) {
20505- cJSON * j = NULL;
20506- if (NULL != x) {
20507- if (NULL != (j = cJSON_CreateObject())) {
20508- cJSON_AddNumberToObject(j, "unsafe", x->unsafe);
20509- }
20510- }
20511- return j;
20512-}
20513-
20514-char * cJSON_PrintUnsafe(const struct Unsafe * x) {
20515- char * s = NULL;
20516- if (NULL != x) {
20517- cJSON * j = cJSON_CreateUnsafe(x);
20397+ cJSON * j = cJSON_CreateUndefined(x);
2051820398 if (NULL != j) {
2051920399 s = cJSON_Print(j);
2052020400 cJSON_Delete(j);
@@ -20523,53 +20403,53 @@ char * cJSON_PrintUnsafe(const struct Unsafe * x) {
2052320403 return s;
2052420404 }
2052520405
20526-void cJSON_DeleteUnsafe(struct Unsafe * x) {
20406+void cJSON_DeleteUndefined(struct Undefined * x) {
2052720407 if (NULL != x) {
2052820408 cJSON_free(x);
2052920409 }
2053020410 }
2053120411
20532-struct UseSerializers * cJSON_ParseUseSerializers(const char * s) {
20533- struct UseSerializers * x = NULL;
20412+struct UnmarshalJson * cJSON_ParseUnmarshalJson(const char * s) {
20413+ struct UnmarshalJson * x = NULL;
2053420414 if (NULL != s) {
2053520415 cJSON * j = cJSON_Parse(s);
2053620416 if (NULL != j) {
20537- x = cJSON_GetUseSerializersValue(j);
20417+ x = cJSON_GetUnmarshalJsonValue(j);
2053820418 cJSON_Delete(j);
2053920419 }
2054020420 }
2054120421 return x;
2054220422 }
2054320423
20544-struct UseSerializers * cJSON_GetUseSerializersValue(const cJSON * j) {
20545- struct UseSerializers * x = NULL;
20424+struct UnmarshalJson * cJSON_GetUnmarshalJsonValue(const cJSON * j) {
20425+ struct UnmarshalJson * x = NULL;
2054620426 if (NULL != j) {
20547- if (NULL != (x = cJSON_malloc(sizeof(struct UseSerializers)))) {
20548- memset(x, 0, sizeof(struct UseSerializers));
20549- if (!cJSON_HasObjectItem(j, "UseSerializers")) { cJSON_DeleteUseSerializers(x); return NULL; }
20550- if (cJSON_HasObjectItem(j, "UseSerializers")) {
20551- if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "UseSerializers"))) { cJSON_DeleteUseSerializers(x); return NULL; }
20552- x->use_serializers = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "UseSerializers"));
20427+ if (NULL != (x = cJSON_malloc(sizeof(struct UnmarshalJson)))) {
20428+ memset(x, 0, sizeof(struct UnmarshalJson));
20429+ if (!cJSON_HasObjectItem(j, "UnmarshalJSON")) { cJSON_DeleteUnmarshalJson(x); return NULL; }
20430+ if (cJSON_HasObjectItem(j, "UnmarshalJSON")) {
20431+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "UnmarshalJSON"))) { cJSON_DeleteUnmarshalJson(x); return NULL; }
20432+ x->unmarshal_json = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "UnmarshalJSON"));
2055320433 }
2055420434 }
2055520435 }
2055620436 return x;
2055720437 }
2055820438
20559-cJSON * cJSON_CreateUseSerializers(const struct UseSerializers * x) {
20439+cJSON * cJSON_CreateUnmarshalJson(const struct UnmarshalJson * x) {
2056020440 cJSON * j = NULL;
2056120441 if (NULL != x) {
2056220442 if (NULL != (j = cJSON_CreateObject())) {
20563- cJSON_AddNumberToObject(j, "UseSerializers", x->use_serializers);
20443+ cJSON_AddNumberToObject(j, "UnmarshalJSON", x->unmarshal_json);
2056420444 }
2056520445 }
2056620446 return j;
2056720447 }
2056820448
20569-char * cJSON_PrintUseSerializers(const struct UseSerializers * x) {
20449+char * cJSON_PrintUnmarshalJson(const struct UnmarshalJson * x) {
2057020450 char * s = NULL;
2057120451 if (NULL != x) {
20572- cJSON * j = cJSON_CreateUseSerializers(x);
20452+ cJSON * j = cJSON_CreateUnmarshalJson(x);
2057320453 if (NULL != j) {
2057420454 s = cJSON_Print(j);
2057520455 cJSON_Delete(j);
@@ -20578,7 +20458,7 @@ char * cJSON_PrintUseSerializers(const struct UseSerializers * x) {
2057820458 return s;
2057920459 }
2058020460
20581-void cJSON_DeleteUseSerializers(struct UseSerializers * x) {
20461+void cJSON_DeleteUnmarshalJson(struct UnmarshalJson * x) {
2058220462 if (NULL != x) {
2058320463 cJSON_free(x);
2058420464 }
@@ -20756,6 +20636,18 @@ struct Obj5 * cJSON_GetObj5Value(const cJSON * j) {
2075620636 x->purple_true = cJSON_GetObj5TrueValue(cJSON_GetObjectItemCaseSensitive(j, "true"));
2075720637 if (NULL == x->purple_true) { cJSON_DeleteObj5(x); return NULL; }
2075820638 }
20639+ if (!cJSON_HasObjectItem(j, "sealed")) { cJSON_DeleteObj5(x); return NULL; }
20640+ if (cJSON_HasObjectItem(j, "sealed")) {
20641+ if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "sealed"))) { cJSON_DeleteObj5(x); return NULL; }
20642+ x->sealed = cJSON_GetSealedValue(cJSON_GetObjectItemCaseSensitive(j, "sealed"));
20643+ if (NULL == x->sealed) { cJSON_DeleteObj5(x); return NULL; }
20644+ }
20645+ if (!cJSON_HasObjectItem(j, "SEL")) { cJSON_DeleteObj5(x); return NULL; }
20646+ if (cJSON_HasObjectItem(j, "SEL")) {
20647+ if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "SEL"))) { cJSON_DeleteObj5(x); return NULL; }
20648+ x->sel = cJSON_GetSelValue(cJSON_GetObjectItemCaseSensitive(j, "SEL"));
20649+ if (NULL == x->sel) { cJSON_DeleteObj5(x); return NULL; }
20650+ }
2075920651 if (!cJSON_HasObjectItem(j, "select")) { cJSON_DeleteObj5(x); return NULL; }
2076020652 if (cJSON_HasObjectItem(j, "select")) {
2076120653 if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "select"))) { cJSON_DeleteObj5(x); return NULL; }
@@ -20978,24 +20870,6 @@ struct Obj5 * cJSON_GetObj5Value(const cJSON * j) {
2097820870 x->unmarshal_json = cJSON_GetUnmarshalJsonValue(cJSON_GetObjectItemCaseSensitive(j, "UnmarshalJSON"));
2097920871 if (NULL == x->unmarshal_json) { cJSON_DeleteObj5(x); return NULL; }
2098020872 }
20981- if (!cJSON_HasObjectItem(j, "unowned")) { cJSON_DeleteObj5(x); return NULL; }
20982- if (cJSON_HasObjectItem(j, "unowned")) {
20983- if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "unowned"))) { cJSON_DeleteObj5(x); return NULL; }
20984- x->unowned = cJSON_GetUnownedValue(cJSON_GetObjectItemCaseSensitive(j, "unowned"));
20985- if (NULL == x->unowned) { cJSON_DeleteObj5(x); return NULL; }
20986- }
20987- if (!cJSON_HasObjectItem(j, "unsafe")) { cJSON_DeleteObj5(x); return NULL; }
20988- if (cJSON_HasObjectItem(j, "unsafe")) {
20989- if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "unsafe"))) { cJSON_DeleteObj5(x); return NULL; }
20990- x->unsafe = cJSON_GetUnsafeValue(cJSON_GetObjectItemCaseSensitive(j, "unsafe"));
20991- if (NULL == x->unsafe) { cJSON_DeleteObj5(x); return NULL; }
20992- }
20993- if (!cJSON_HasObjectItem(j, "UseSerializers")) { cJSON_DeleteObj5(x); return NULL; }
20994- if (cJSON_HasObjectItem(j, "UseSerializers")) {
20995- if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "UseSerializers"))) { cJSON_DeleteObj5(x); return NULL; }
20996- x->use_serializers = cJSON_GetUseSerializersValue(cJSON_GetObjectItemCaseSensitive(j, "UseSerializers"));
20997- if (NULL == x->use_serializers) { cJSON_DeleteObj5(x); return NULL; }
20998- }
2099920873 }
2100020874 }
2100120875 return x;
@@ -21031,6 +20905,8 @@ cJSON * cJSON_CreateObj5(const struct Obj5 * x) {
2103120905 cJSON_AddItemToObject(j, "union", cJSON_CreateUnion(x->obj5_union));
2103220906 cJSON_AddItemToObject(j, "PrimitiveKind", cJSON_CreatePrimitiveKind(x->primitive_kind));
2103320907 cJSON_AddItemToObject(j, "true", cJSON_CreateObj5True(x->purple_true));
20908+ cJSON_AddItemToObject(j, "sealed", cJSON_CreateSealed(x->sealed));
20909+ cJSON_AddItemToObject(j, "SEL", cJSON_CreateSel(x->sel));
2103420910 cJSON_AddItemToObject(j, "select", cJSON_CreateSelect(x->select));
2103520911 cJSON_AddItemToObject(j, "Self", cJSON_CreateSelf(x->self));
2103620912 cJSON_AddItemToObject(j, "Sendable", cJSON_CreateSendable(x->sendable));
@@ -21068,9 +20944,6 @@ cJSON * cJSON_CreateObj5(const struct Obj5 * x) {
2106820944 cJSON_AddItemToObject(j, "unchecked", cJSON_CreateUnchecked(x->unchecked));
2106920945 cJSON_AddItemToObject(j, "undefined", cJSON_CreateUndefined(x->undefined));
2107020946 cJSON_AddItemToObject(j, "UnmarshalJSON", cJSON_CreateUnmarshalJson(x->unmarshal_json));
21071- cJSON_AddItemToObject(j, "unowned", cJSON_CreateUnowned(x->unowned));
21072- cJSON_AddItemToObject(j, "unsafe", cJSON_CreateUnsafe(x->unsafe));
21073- cJSON_AddItemToObject(j, "UseSerializers", cJSON_CreateUseSerializers(x->use_serializers));
2107420947 }
2107520948 }
2107620949 return j;
@@ -21165,6 +21038,12 @@ void cJSON_DeleteObj5(struct Obj5 * x) {
2116521038 if (NULL != x->purple_true) {
2116621039 cJSON_DeleteObj5True(x->purple_true);
2116721040 }
21041+ if (NULL != x->sealed) {
21042+ cJSON_DeleteSealed(x->sealed);
21043+ }
21044+ if (NULL != x->sel) {
21045+ cJSON_DeleteSel(x->sel);
21046+ }
2116821047 if (NULL != x->select) {
2116921048 cJSON_DeleteSelect(x->select);
2117021049 }
@@ -21276,15 +21155,6 @@ void cJSON_DeleteObj5(struct Obj5 * x) {
2127621155 if (NULL != x->unmarshal_json) {
2127721156 cJSON_DeleteUnmarshalJson(x->unmarshal_json);
2127821157 }
21279- if (NULL != x->unowned) {
21280- cJSON_DeleteUnowned(x->unowned);
21281- }
21282- if (NULL != x->unsafe) {
21283- cJSON_DeleteUnsafe(x->unsafe);
21284- }
21285- if (NULL != x->use_serializers) {
21286- cJSON_DeleteUseSerializers(x->use_serializers);
21287- }
2128821158 cJSON_free(x);
2128921159 }
2129021160 }
@@ -21784,6 +21654,171 @@ void cJSON_DeleteXorEq(struct XorEq * x) {
2178421654 }
2178521655 }
2178621656
21657+struct Unowned * cJSON_ParseUnowned(const char * s) {
21658+ struct Unowned * x = NULL;
21659+ if (NULL != s) {
21660+ cJSON * j = cJSON_Parse(s);
21661+ if (NULL != j) {
21662+ x = cJSON_GetUnownedValue(j);
21663+ cJSON_Delete(j);
21664+ }
21665+ }
21666+ return x;
21667+}
21668+
21669+struct Unowned * cJSON_GetUnownedValue(const cJSON * j) {
21670+ struct Unowned * x = NULL;
21671+ if (NULL != j) {
21672+ if (NULL != (x = cJSON_malloc(sizeof(struct Unowned)))) {
21673+ memset(x, 0, sizeof(struct Unowned));
21674+ if (!cJSON_HasObjectItem(j, "unowned")) { cJSON_DeleteUnowned(x); return NULL; }
21675+ if (cJSON_HasObjectItem(j, "unowned")) {
21676+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "unowned"))) { cJSON_DeleteUnowned(x); return NULL; }
21677+ x->unowned = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "unowned"));
21678+ }
21679+ }
21680+ }
21681+ return x;
21682+}
21683+
21684+cJSON * cJSON_CreateUnowned(const struct Unowned * x) {
21685+ cJSON * j = NULL;
21686+ if (NULL != x) {
21687+ if (NULL != (j = cJSON_CreateObject())) {
21688+ cJSON_AddNumberToObject(j, "unowned", x->unowned);
21689+ }
21690+ }
21691+ return j;
21692+}
21693+
21694+char * cJSON_PrintUnowned(const struct Unowned * x) {
21695+ char * s = NULL;
21696+ if (NULL != x) {
21697+ cJSON * j = cJSON_CreateUnowned(x);
21698+ if (NULL != j) {
21699+ s = cJSON_Print(j);
21700+ cJSON_Delete(j);
21701+ }
21702+ }
21703+ return s;
21704+}
21705+
21706+void cJSON_DeleteUnowned(struct Unowned * x) {
21707+ if (NULL != x) {
21708+ cJSON_free(x);
21709+ }
21710+}
21711+
21712+struct Unsafe * cJSON_ParseUnsafe(const char * s) {
21713+ struct Unsafe * x = NULL;
21714+ if (NULL != s) {
21715+ cJSON * j = cJSON_Parse(s);
21716+ if (NULL != j) {
21717+ x = cJSON_GetUnsafeValue(j);
21718+ cJSON_Delete(j);
21719+ }
21720+ }
21721+ return x;
21722+}
21723+
21724+struct Unsafe * cJSON_GetUnsafeValue(const cJSON * j) {
21725+ struct Unsafe * x = NULL;
21726+ if (NULL != j) {
21727+ if (NULL != (x = cJSON_malloc(sizeof(struct Unsafe)))) {
21728+ memset(x, 0, sizeof(struct Unsafe));
21729+ if (!cJSON_HasObjectItem(j, "unsafe")) { cJSON_DeleteUnsafe(x); return NULL; }
21730+ if (cJSON_HasObjectItem(j, "unsafe")) {
21731+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "unsafe"))) { cJSON_DeleteUnsafe(x); return NULL; }
21732+ x->unsafe = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "unsafe"));
21733+ }
21734+ }
21735+ }
21736+ return x;
21737+}
21738+
21739+cJSON * cJSON_CreateUnsafe(const struct Unsafe * x) {
21740+ cJSON * j = NULL;
21741+ if (NULL != x) {
21742+ if (NULL != (j = cJSON_CreateObject())) {
21743+ cJSON_AddNumberToObject(j, "unsafe", x->unsafe);
21744+ }
21745+ }
21746+ return j;
21747+}
21748+
21749+char * cJSON_PrintUnsafe(const struct Unsafe * x) {
21750+ char * s = NULL;
21751+ if (NULL != x) {
21752+ cJSON * j = cJSON_CreateUnsafe(x);
21753+ if (NULL != j) {
21754+ s = cJSON_Print(j);
21755+ cJSON_Delete(j);
21756+ }
21757+ }
21758+ return s;
21759+}
21760+
21761+void cJSON_DeleteUnsafe(struct Unsafe * x) {
21762+ if (NULL != x) {
21763+ cJSON_free(x);
21764+ }
21765+}
21766+
21767+struct UseSerializers * cJSON_ParseUseSerializers(const char * s) {
21768+ struct UseSerializers * x = NULL;
21769+ if (NULL != s) {
21770+ cJSON * j = cJSON_Parse(s);
21771+ if (NULL != j) {
21772+ x = cJSON_GetUseSerializersValue(j);
21773+ cJSON_Delete(j);
21774+ }
21775+ }
21776+ return x;
21777+}
21778+
21779+struct UseSerializers * cJSON_GetUseSerializersValue(const cJSON * j) {
21780+ struct UseSerializers * x = NULL;
21781+ if (NULL != j) {
21782+ if (NULL != (x = cJSON_malloc(sizeof(struct UseSerializers)))) {
21783+ memset(x, 0, sizeof(struct UseSerializers));
21784+ if (!cJSON_HasObjectItem(j, "UseSerializers")) { cJSON_DeleteUseSerializers(x); return NULL; }
21785+ if (cJSON_HasObjectItem(j, "UseSerializers")) {
21786+ if (!quicktype_cJSON_IsInteger(cJSON_GetObjectItemCaseSensitive(j, "UseSerializers"))) { cJSON_DeleteUseSerializers(x); return NULL; }
21787+ x->use_serializers = cJSON_GetNumberValue(cJSON_GetObjectItemCaseSensitive(j, "UseSerializers"));
21788+ }
21789+ }
21790+ }
21791+ return x;
21792+}
21793+
21794+cJSON * cJSON_CreateUseSerializers(const struct UseSerializers * x) {
21795+ cJSON * j = NULL;
21796+ if (NULL != x) {
21797+ if (NULL != (j = cJSON_CreateObject())) {
21798+ cJSON_AddNumberToObject(j, "UseSerializers", x->use_serializers);
21799+ }
21800+ }
21801+ return j;
21802+}
21803+
21804+char * cJSON_PrintUseSerializers(const struct UseSerializers * x) {
21805+ char * s = NULL;
21806+ if (NULL != x) {
21807+ cJSON * j = cJSON_CreateUseSerializers(x);
21808+ if (NULL != j) {
21809+ s = cJSON_Print(j);
21810+ cJSON_Delete(j);
21811+ }
21812+ }
21813+ return s;
21814+}
21815+
21816+void cJSON_DeleteUseSerializers(struct UseSerializers * x) {
21817+ if (NULL != x) {
21818+ cJSON_free(x);
21819+ }
21820+}
21821+
2178721822 struct Ushort * cJSON_ParseUshort(const char * s) {
2178821823 struct Ushort * x = NULL;
2178921824 if (NULL != s) {
@@ -22465,6 +22500,24 @@ struct Obj6 * cJSON_GetObj6Value(const cJSON * j) {
2246522500 x->obj6_xor_eq = cJSON_GetXorEqValue(cJSON_GetObjectItemCaseSensitive(j, "xor_eq"));
2246622501 if (NULL == x->obj6_xor_eq) { cJSON_DeleteObj6(x); return NULL; }
2246722502 }
22503+ if (!cJSON_HasObjectItem(j, "unowned")) { cJSON_DeleteObj6(x); return NULL; }
22504+ if (cJSON_HasObjectItem(j, "unowned")) {
22505+ if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "unowned"))) { cJSON_DeleteObj6(x); return NULL; }
22506+ x->unowned = cJSON_GetUnownedValue(cJSON_GetObjectItemCaseSensitive(j, "unowned"));
22507+ if (NULL == x->unowned) { cJSON_DeleteObj6(x); return NULL; }
22508+ }
22509+ if (!cJSON_HasObjectItem(j, "unsafe")) { cJSON_DeleteObj6(x); return NULL; }
22510+ if (cJSON_HasObjectItem(j, "unsafe")) {
22511+ if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "unsafe"))) { cJSON_DeleteObj6(x); return NULL; }
22512+ x->unsafe = cJSON_GetUnsafeValue(cJSON_GetObjectItemCaseSensitive(j, "unsafe"));
22513+ if (NULL == x->unsafe) { cJSON_DeleteObj6(x); return NULL; }
22514+ }
22515+ if (!cJSON_HasObjectItem(j, "UseSerializers")) { cJSON_DeleteObj6(x); return NULL; }
22516+ if (cJSON_HasObjectItem(j, "UseSerializers")) {
22517+ if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "UseSerializers"))) { cJSON_DeleteObj6(x); return NULL; }
22518+ x->use_serializers = cJSON_GetUseSerializersValue(cJSON_GetObjectItemCaseSensitive(j, "UseSerializers"));
22519+ if (NULL == x->use_serializers) { cJSON_DeleteObj6(x); return NULL; }
22520+ }
2246822521 if (!cJSON_HasObjectItem(j, "ushort")) { cJSON_DeleteObj6(x); return NULL; }
2246922522 if (cJSON_HasObjectItem(j, "ushort")) {
2247022523 if (!cJSON_IsObject(cJSON_GetObjectItemCaseSensitive(j, "ushort"))) { cJSON_DeleteObj6(x); return NULL; }
@@ -22550,6 +22603,9 @@ cJSON * cJSON_CreateObj6(const struct Obj6 * x) {
2255022603 cJSON_AddItemToObject(j, "while", cJSON_CreateWhile(x->obj6_while));
2255122604 cJSON_AddItemToObject(j, "xor", cJSON_CreateXor(x->obj6_xor));
2255222605 cJSON_AddItemToObject(j, "xor_eq", cJSON_CreateXorEq(x->obj6_xor_eq));
22606+ cJSON_AddItemToObject(j, "unowned", cJSON_CreateUnowned(x->unowned));
22607+ cJSON_AddItemToObject(j, "unsafe", cJSON_CreateUnsafe(x->unsafe));
22608+ cJSON_AddItemToObject(j, "UseSerializers", cJSON_CreateUseSerializers(x->use_serializers));
2255322609 cJSON_AddItemToObject(j, "ushort", cJSON_CreateUshort(x->ushort));
2255422610 cJSON_AddItemToObject(j, "Utf8JsonReader", cJSON_CreateUtf8JsonReader(x->utf8_json_reader));
2255522611 cJSON_AddItemToObject(j, "Utf8JsonWriter", cJSON_CreateUtf8JsonWriter(x->utf8_json_writer));
@@ -22607,6 +22663,15 @@ void cJSON_DeleteObj6(struct Obj6 * x) {
2260722663 if (NULL != x->obj6_xor_eq) {
2260822664 cJSON_DeleteXorEq(x->obj6_xor_eq);
2260922665 }
22666+ if (NULL != x->unowned) {
22667+ cJSON_DeleteUnowned(x->unowned);
22668+ }
22669+ if (NULL != x->unsafe) {
22670+ cJSON_DeleteUnsafe(x->unsafe);
22671+ }
22672+ if (NULL != x->use_serializers) {
22673+ cJSON_DeleteUseSerializers(x->use_serializers);
22674+ }
2261022675 if (NULL != x->ushort) {
2261122676 cJSON_DeleteUshort(x->ushort);
2261222677 }
Mcjsondefault / TopLevel.h+88 −77
@@ -885,6 +885,10 @@ struct Lock {
885885 int64_t lock;
886886 };
887887
888+struct MakeDictEncoder {
889+ int64_t make_dict_encoder;
890+};
891+
888892 struct Map {
889893 int64_t map;
890894 };
@@ -913,14 +917,6 @@ struct Newtonsoft {
913917 int64_t newtonsoft;
914918 };
915919
916-struct Nil {
917- int64_t nil;
918-};
919-
920-struct No {
921- int64_t no;
922-};
923-
924920 struct Goto {
925921 int64_t goto_goto;
926922 };
@@ -1009,6 +1005,7 @@ struct Obj3 {
10091005 struct List * list;
10101006 struct Locale * locale;
10111007 struct Lock * lock;
1008+ struct MakeDictEncoder * make_dict_encoder;
10121009 struct Map * map;
10131010 struct MapEntry * map_entry;
10141011 struct MarshalJson * marshal_json;
@@ -1016,8 +1013,6 @@ struct Obj3 {
10161013 struct Mutating * mutating;
10171014 struct Native * native;
10181015 struct Newtonsoft * newtonsoft;
1019- struct Nil * nil;
1020- struct No * no;
10211016 struct Goto * obj3_goto;
10221017 struct If * obj3_if;
10231018 struct Import * obj3_import;
@@ -1030,6 +1025,14 @@ struct Obj3 {
10301025 struct New * obj3_new;
10311026 };
10321027
1028+struct Nil {
1029+ int64_t nil;
1030+};
1031+
1032+struct No {
1033+ int64_t no;
1034+};
1035+
10331036 struct NoSuchMethod {
10341037 int64_t no_such_method;
10351038 };
@@ -1278,16 +1281,10 @@ struct Sbyte {
12781281 int64_t sbyte;
12791282 };
12801283
1281-struct Sealed {
1282- int64_t sealed;
1283-};
1284-
1285-struct Sel {
1286- int64_t sel;
1287-};
1288-
12891284 struct Obj4 {
12901285 int64_t dummy;
1286+ struct Nil * nil;
1287+ struct No * no;
12911288 struct NoSuchMethod * no_such_method;
12921289 struct Nonatomic * nonatomic;
12931290 struct None * none;
@@ -1350,8 +1347,6 @@ struct Obj4 {
13501347 struct RuntimeType * runtime_type;
13511348 struct S * s;
13521349 struct Sbyte * sbyte;
1353- struct Sealed * sealed;
1354- struct Sel * sel;
13551350 };
13561351
13571352 struct KSerializer {
@@ -1454,6 +1449,14 @@ struct Obj5True {
14541449 int64_t true_true;
14551450 };
14561451
1452+struct Sealed {
1453+ int64_t sealed;
1454+};
1455+
1456+struct Sel {
1457+ int64_t sel;
1458+};
1459+
14571460 struct Select {
14581461 int64_t select;
14591462 };
@@ -1602,18 +1605,6 @@ struct UnmarshalJson {
16021605 int64_t unmarshal_json;
16031606 };
16041607
1605-struct Unowned {
1606- int64_t unowned;
1607-};
1608-
1609-struct Unsafe {
1610- int64_t unsafe;
1611-};
1612-
1613-struct UseSerializers {
1614- int64_t use_serializers;
1615-};
1616-
16171608 struct Obj5 {
16181609 int64_t dummy;
16191610 struct KSerializer * k_serializer;
@@ -1641,6 +1632,8 @@ struct Obj5 {
16411632 struct Union * obj5_union;
16421633 struct PrimitiveKind * primitive_kind;
16431634 struct Obj5True * purple_true;
1635+ struct Sealed * sealed;
1636+ struct Sel * sel;
16441637 struct Select * select;
16451638 struct Self * self;
16461639 struct Sendable * sendable;
@@ -1678,9 +1671,6 @@ struct Obj5 {
16781671 struct Unchecked * unchecked;
16791672 struct Undefined * undefined;
16801673 struct UnmarshalJson * unmarshal_json;
1681- struct Unowned * unowned;
1682- struct Unsafe * unsafe;
1683- struct UseSerializers * use_serializers;
16841674 };
16851675
16861676 struct Unsigned {
@@ -1719,6 +1709,18 @@ struct XorEq {
17191709 int64_t xor_eq_xor_eq;
17201710 };
17211711
1712+struct Unowned {
1713+ int64_t unowned;
1714+};
1715+
1716+struct Unsafe {
1717+ int64_t unsafe;
1718+};
1719+
1720+struct UseSerializers {
1721+ int64_t use_serializers;
1722+};
1723+
17221724 struct Ushort {
17231725 int64_t ushort;
17241726 };
@@ -1774,6 +1776,9 @@ struct Obj6 {
17741776 struct While * obj6_while;
17751777 struct Xor * obj6_xor;
17761778 struct XorEq * obj6_xor_eq;
1779+ struct Unowned * unowned;
1780+ struct Unsafe * unsafe;
1781+ struct UseSerializers * use_serializers;
17771782 struct Ushort * ushort;
17781783 struct Utf8JsonReader * utf8_json_reader;
17791784 struct Utf8JsonWriter * utf8_json_writer;
@@ -2856,6 +2861,12 @@ cJSON * cJSON_CreateLock(const struct Lock * x);
28562861 char * cJSON_PrintLock(const struct Lock * x);
28572862 void cJSON_DeleteLock(struct Lock * x);
28582863
2864+struct MakeDictEncoder * cJSON_ParseMakeDictEncoder(const char * s);
2865+struct MakeDictEncoder * cJSON_GetMakeDictEncoderValue(const cJSON * j);
2866+cJSON * cJSON_CreateMakeDictEncoder(const struct MakeDictEncoder * x);
2867+char * cJSON_PrintMakeDictEncoder(const struct MakeDictEncoder * x);
2868+void cJSON_DeleteMakeDictEncoder(struct MakeDictEncoder * x);
2869+
28592870 struct Map * cJSON_ParseMap(const char * s);
28602871 struct Map * cJSON_GetMapValue(const cJSON * j);
28612872 cJSON * cJSON_CreateMap(const struct Map * x);
@@ -2898,18 +2909,6 @@ cJSON * cJSON_CreateNewtonsoft(const struct Newtonsoft * x);
28982909 char * cJSON_PrintNewtonsoft(const struct Newtonsoft * x);
28992910 void cJSON_DeleteNewtonsoft(struct Newtonsoft * x);
29002911
2901-struct Nil * cJSON_ParseNil(const char * s);
2902-struct Nil * cJSON_GetNilValue(const cJSON * j);
2903-cJSON * cJSON_CreateNil(const struct Nil * x);
2904-char * cJSON_PrintNil(const struct Nil * x);
2905-void cJSON_DeleteNil(struct Nil * x);
2906-
2907-struct No * cJSON_ParseNo(const char * s);
2908-struct No * cJSON_GetNoValue(const cJSON * j);
2909-cJSON * cJSON_CreateNo(const struct No * x);
2910-char * cJSON_PrintNo(const struct No * x);
2911-void cJSON_DeleteNo(struct No * x);
2912-
29132912 struct Goto * cJSON_ParseGoto(const char * s);
29142913 struct Goto * cJSON_GetGotoValue(const cJSON * j);
29152914 cJSON * cJSON_CreateGoto(const struct Goto * x);
@@ -2976,6 +2975,18 @@ cJSON * cJSON_CreateObj3(const struct Obj3 * x);
29762975 char * cJSON_PrintObj3(const struct Obj3 * x);
29772976 void cJSON_DeleteObj3(struct Obj3 * x);
29782977
2978+struct Nil * cJSON_ParseNil(const char * s);
2979+struct Nil * cJSON_GetNilValue(const cJSON * j);
2980+cJSON * cJSON_CreateNil(const struct Nil * x);
2981+char * cJSON_PrintNil(const struct Nil * x);
2982+void cJSON_DeleteNil(struct Nil * x);
2983+
2984+struct No * cJSON_ParseNo(const char * s);
2985+struct No * cJSON_GetNoValue(const cJSON * j);
2986+cJSON * cJSON_CreateNo(const struct No * x);
2987+char * cJSON_PrintNo(const struct No * x);
2988+void cJSON_DeleteNo(struct No * x);
2989+
29792990 struct NoSuchMethod * cJSON_ParseNoSuchMethod(const char * s);
29802991 struct NoSuchMethod * cJSON_GetNoSuchMethodValue(const cJSON * j);
29812992 cJSON * cJSON_CreateNoSuchMethod(const struct NoSuchMethod * x);
@@ -3348,18 +3359,6 @@ cJSON * cJSON_CreateSbyte(const struct Sbyte * x);
33483359 char * cJSON_PrintSbyte(const struct Sbyte * x);
33493360 void cJSON_DeleteSbyte(struct Sbyte * x);
33503361
3351-struct Sealed * cJSON_ParseSealed(const char * s);
3352-struct Sealed * cJSON_GetSealedValue(const cJSON * j);
3353-cJSON * cJSON_CreateSealed(const struct Sealed * x);
3354-char * cJSON_PrintSealed(const struct Sealed * x);
3355-void cJSON_DeleteSealed(struct Sealed * x);
3356-
3357-struct Sel * cJSON_ParseSel(const char * s);
3358-struct Sel * cJSON_GetSelValue(const cJSON * j);
3359-cJSON * cJSON_CreateSel(const struct Sel * x);
3360-char * cJSON_PrintSel(const struct Sel * x);
3361-void cJSON_DeleteSel(struct Sel * x);
3362-
33633362 struct Obj4 * cJSON_ParseObj4(const char * s);
33643363 struct Obj4 * cJSON_GetObj4Value(const cJSON * j);
33653364 cJSON * cJSON_CreateObj4(const struct Obj4 * x);
@@ -3516,6 +3515,18 @@ cJSON * cJSON_CreateObj5True(const struct Obj5True * x);
35163515 char * cJSON_PrintObj5True(const struct Obj5True * x);
35173516 void cJSON_DeleteObj5True(struct Obj5True * x);
35183517
3518+struct Sealed * cJSON_ParseSealed(const char * s);
3519+struct Sealed * cJSON_GetSealedValue(const cJSON * j);
3520+cJSON * cJSON_CreateSealed(const struct Sealed * x);
3521+char * cJSON_PrintSealed(const struct Sealed * x);
3522+void cJSON_DeleteSealed(struct Sealed * x);
3523+
3524+struct Sel * cJSON_ParseSel(const char * s);
3525+struct Sel * cJSON_GetSelValue(const cJSON * j);
3526+cJSON * cJSON_CreateSel(const struct Sel * x);
3527+char * cJSON_PrintSel(const struct Sel * x);
3528+void cJSON_DeleteSel(struct Sel * x);
3529+
35193530 struct Select * cJSON_ParseSelect(const char * s);
35203531 struct Select * cJSON_GetSelectValue(const cJSON * j);
35213532 cJSON * cJSON_CreateSelect(const struct Select * x);
@@ -3738,24 +3749,6 @@ cJSON * cJSON_CreateUnmarshalJson(const struct UnmarshalJson * x);
37383749 char * cJSON_PrintUnmarshalJson(const struct UnmarshalJson * x);
37393750 void cJSON_DeleteUnmarshalJson(struct UnmarshalJson * x);
37403751
3741-struct Unowned * cJSON_ParseUnowned(const char * s);
3742-struct Unowned * cJSON_GetUnownedValue(const cJSON * j);
3743-cJSON * cJSON_CreateUnowned(const struct Unowned * x);
3744-char * cJSON_PrintUnowned(const struct Unowned * x);
3745-void cJSON_DeleteUnowned(struct Unowned * x);
3746-
3747-struct Unsafe * cJSON_ParseUnsafe(const char * s);
3748-struct Unsafe * cJSON_GetUnsafeValue(const cJSON * j);
3749-cJSON * cJSON_CreateUnsafe(const struct Unsafe * x);
3750-char * cJSON_PrintUnsafe(const struct Unsafe * x);
3751-void cJSON_DeleteUnsafe(struct Unsafe * x);
3752-
3753-struct UseSerializers * cJSON_ParseUseSerializers(const char * s);
3754-struct UseSerializers * cJSON_GetUseSerializersValue(const cJSON * j);
3755-cJSON * cJSON_CreateUseSerializers(const struct UseSerializers * x);
3756-char * cJSON_PrintUseSerializers(const struct UseSerializers * x);
3757-void cJSON_DeleteUseSerializers(struct UseSerializers * x);
3758-
37593752 struct Obj5 * cJSON_ParseObj5(const char * s);
37603753 struct Obj5 * cJSON_GetObj5Value(const cJSON * j);
37613754 cJSON * cJSON_CreateObj5(const struct Obj5 * x);
@@ -3816,6 +3809,24 @@ cJSON * cJSON_CreateXorEq(const struct XorEq * x);
38163809 char * cJSON_PrintXorEq(const struct XorEq * x);
38173810 void cJSON_DeleteXorEq(struct XorEq * x);
38183811
3812+struct Unowned * cJSON_ParseUnowned(const char * s);
3813+struct Unowned * cJSON_GetUnownedValue(const cJSON * j);
3814+cJSON * cJSON_CreateUnowned(const struct Unowned * x);
3815+char * cJSON_PrintUnowned(const struct Unowned * x);
3816+void cJSON_DeleteUnowned(struct Unowned * x);
3817+
3818+struct Unsafe * cJSON_ParseUnsafe(const char * s);
3819+struct Unsafe * cJSON_GetUnsafeValue(const cJSON * j);
3820+cJSON * cJSON_CreateUnsafe(const struct Unsafe * x);
3821+char * cJSON_PrintUnsafe(const struct Unsafe * x);
3822+void cJSON_DeleteUnsafe(struct Unsafe * x);
3823+
3824+struct UseSerializers * cJSON_ParseUseSerializers(const char * s);
3825+struct UseSerializers * cJSON_GetUseSerializersValue(const cJSON * j);
3826+cJSON * cJSON_CreateUseSerializers(const struct UseSerializers * x);
3827+char * cJSON_PrintUseSerializers(const struct UseSerializers * x);
3828+void cJSON_DeleteUseSerializers(struct UseSerializers * x);
3829+
38193830 struct Ushort * cJSON_ParseUshort(const char * s);
38203831 struct Ushort * cJSON_GetUshortValue(const cJSON * j);
38213832 cJSON * cJSON_CreateUshort(const struct Ushort * x);
Mcplusplusdefault / quicktype.hpp+280 −245
@@ -3137,6 +3137,20 @@ namespace quicktype {
31373137 void set_lock(const int64_t & value) { this->lock = value; }
31383138 };
31393139
3140+ class MakeDictEncoder {
3141+ public:
3142+ MakeDictEncoder() = default;
3143+ virtual ~MakeDictEncoder() = default;
3144+
3145+ private:
3146+ int64_t make_dict_encoder;
3147+
3148+ public:
3149+ const int64_t & get_make_dict_encoder() const { return make_dict_encoder; }
3150+ int64_t & get_mutable_make_dict_encoder() { return make_dict_encoder; }
3151+ void set_make_dict_encoder(const int64_t & value) { this->make_dict_encoder = value; }
3152+ };
3153+
31403154 class Map {
31413155 public:
31423156 Map() = default;
@@ -3235,34 +3249,6 @@ namespace quicktype {
32353249 void set_newtonsoft(const int64_t & value) { this->newtonsoft = value; }
32363250 };
32373251
3238- class Nil {
3239- public:
3240- Nil() = default;
3241- virtual ~Nil() = default;
3242-
3243- private:
3244- int64_t nil;
3245-
3246- public:
3247- const int64_t & get_nil() const { return nil; }
3248- int64_t & get_mutable_nil() { return nil; }
3249- void set_nil(const int64_t & value) { this->nil = value; }
3250- };
3251-
3252- class No {
3253- public:
3254- No() = default;
3255- virtual ~No() = default;
3256-
3257- private:
3258- int64_t no;
3259-
3260- public:
3261- const int64_t & get_no() const { return no; }
3262- int64_t & get_mutable_no() { return no; }
3263- void set_no(const int64_t & value) { this->no = value; }
3264- };
3265-
32663252 class Goto {
32673253 public:
32683254 Goto() = default;
@@ -3456,6 +3442,7 @@ namespace quicktype {
34563442 List list;
34573443 Locale locale;
34583444 Lock lock;
3445+ MakeDictEncoder make_dict_encoder;
34593446 Map map;
34603447 MapEntry map_entry;
34613448 MarshalJson marshal_json;
@@ -3463,8 +3450,6 @@ namespace quicktype {
34633450 Mutating mutating;
34643451 Native native;
34653452 Newtonsoft newtonsoft;
3466- Nil nil;
3467- No no;
34683453 Goto obj3_goto;
34693454 If obj3_if;
34703455 Import obj3_import;
@@ -3665,6 +3650,10 @@ namespace quicktype {
36653650 Lock & get_mutable_lock() { return lock; }
36663651 void set_lock(const Lock & value) { this->lock = value; }
36673652
3653+ const MakeDictEncoder & get_make_dict_encoder() const { return make_dict_encoder; }
3654+ MakeDictEncoder & get_mutable_make_dict_encoder() { return make_dict_encoder; }
3655+ void set_make_dict_encoder(const MakeDictEncoder & value) { this->make_dict_encoder = value; }
3656+
36683657 const Map & get_map() const { return map; }
36693658 Map & get_mutable_map() { return map; }
36703659 void set_map(const Map & value) { this->map = value; }
@@ -3693,14 +3682,6 @@ namespace quicktype {
36933682 Newtonsoft & get_mutable_newtonsoft() { return newtonsoft; }
36943683 void set_newtonsoft(const Newtonsoft & value) { this->newtonsoft = value; }
36953684
3696- const Nil & get_nil() const { return nil; }
3697- Nil & get_mutable_nil() { return nil; }
3698- void set_nil(const Nil & value) { this->nil = value; }
3699-
3700- const No & get_no() const { return no; }
3701- No & get_mutable_no() { return no; }
3702- void set_no(const No & value) { this->no = value; }
3703-
37043685 const Goto & get_obj3_goto() const { return obj3_goto; }
37053686 Goto & get_mutable_obj3_goto() { return obj3_goto; }
37063687 void set_obj3_goto(const Goto & value) { this->obj3_goto = value; }
@@ -3742,6 +3723,34 @@ namespace quicktype {
37423723 void set_obj3_new(const New & value) { this->obj3_new = value; }
37433724 };
37443725
3726+ class Nil {
3727+ public:
3728+ Nil() = default;
3729+ virtual ~Nil() = default;
3730+
3731+ private:
3732+ int64_t nil;
3733+
3734+ public:
3735+ const int64_t & get_nil() const { return nil; }
3736+ int64_t & get_mutable_nil() { return nil; }
3737+ void set_nil(const int64_t & value) { this->nil = value; }
3738+ };
3739+
3740+ class No {
3741+ public:
3742+ No() = default;
3743+ virtual ~No() = default;
3744+
3745+ private:
3746+ int64_t no;
3747+
3748+ public:
3749+ const int64_t & get_no() const { return no; }
3750+ int64_t & get_mutable_no() { return no; }
3751+ void set_no(const int64_t & value) { this->no = value; }
3752+ };
3753+
37453754 class NoSuchMethod {
37463755 public:
37473756 NoSuchMethod() = default;
@@ -4610,34 +4619,6 @@ namespace quicktype {
46104619 void set_sbyte(const int64_t & value) { this->sbyte = value; }
46114620 };
46124621
4613- class Sealed {
4614- public:
4615- Sealed() = default;
4616- virtual ~Sealed() = default;
4617-
4618- private:
4619- int64_t sealed;
4620-
4621- public:
4622- const int64_t & get_sealed() const { return sealed; }
4623- int64_t & get_mutable_sealed() { return sealed; }
4624- void set_sealed(const int64_t & value) { this->sealed = value; }
4625- };
4626-
4627- class Sel {
4628- public:
4629- Sel() = default;
4630- virtual ~Sel() = default;
4631-
4632- private:
4633- int64_t sel;
4634-
4635- public:
4636- const int64_t & get_sel() const { return sel; }
4637- int64_t & get_mutable_sel() { return sel; }
4638- void set_sel(const int64_t & value) { this->sel = value; }
4639- };
4640-
46414622 class Obj4 {
46424623 public:
46434624 Obj4() = default;
@@ -4645,6 +4626,8 @@ namespace quicktype {
46454626
46464627 private:
46474628 int64_t dummy;
4629+ Nil nil;
4630+ No no;
46484631 NoSuchMethod no_such_method;
46494632 Nonatomic nonatomic;
46504633 None none;
@@ -4707,14 +4690,20 @@ namespace quicktype {
47074690 RuntimeType runtime_type;
47084691 S s;
47094692 Sbyte sbyte;
4710- Sealed sealed;
4711- Sel sel;
47124693
47134694 public:
47144695 const int64_t & get_dummy() const { return dummy; }
47154696 int64_t & get_mutable_dummy() { return dummy; }
47164697 void set_dummy(const int64_t & value) { this->dummy = value; }
47174698
4699+ const Nil & get_nil() const { return nil; }
4700+ Nil & get_mutable_nil() { return nil; }
4701+ void set_nil(const Nil & value) { this->nil = value; }
4702+
4703+ const No & get_no() const { return no; }
4704+ No & get_mutable_no() { return no; }
4705+ void set_no(const No & value) { this->no = value; }
4706+
47184707 const NoSuchMethod & get_no_such_method() const { return no_such_method; }
47194708 NoSuchMethod & get_mutable_no_such_method() { return no_such_method; }
47204709 void set_no_such_method(const NoSuchMethod & value) { this->no_such_method = value; }
@@ -4962,14 +4951,6 @@ namespace quicktype {
49624951 const Sbyte & get_sbyte() const { return sbyte; }
49634952 Sbyte & get_mutable_sbyte() { return sbyte; }
49644953 void set_sbyte(const Sbyte & value) { this->sbyte = value; }
4965-
4966- const Sealed & get_sealed() const { return sealed; }
4967- Sealed & get_mutable_sealed() { return sealed; }
4968- void set_sealed(const Sealed & value) { this->sealed = value; }
4969-
4970- const Sel & get_sel() const { return sel; }
4971- Sel & get_mutable_sel() { return sel; }
4972- void set_sel(const Sel & value) { this->sel = value; }
49734954 };
49744955
49754956 class KSerializer {
@@ -5308,6 +5289,34 @@ namespace quicktype {
53085289 void set_true_true(const int64_t & value) { this->true_true = value; }
53095290 };
53105291
5292+ class Sealed {
5293+ public:
5294+ Sealed() = default;
5295+ virtual ~Sealed() = default;
5296+
5297+ private:
5298+ int64_t sealed;
5299+
5300+ public:
5301+ const int64_t & get_sealed() const { return sealed; }
5302+ int64_t & get_mutable_sealed() { return sealed; }
5303+ void set_sealed(const int64_t & value) { this->sealed = value; }
5304+ };
5305+
5306+ class Sel {
5307+ public:
5308+ Sel() = default;
5309+ virtual ~Sel() = default;
5310+
5311+ private:
5312+ int64_t sel;
5313+
5314+ public:
5315+ const int64_t & get_sel() const { return sel; }
5316+ int64_t & get_mutable_sel() { return sel; }
5317+ void set_sel(const int64_t & value) { this->sel = value; }
5318+ };
5319+
53115320 class Select {
53125321 public:
53135322 Select() = default;
@@ -5840,48 +5849,6 @@ namespace quicktype {
58405849 void set_unmarshal_json(const int64_t & value) { this->unmarshal_json = value; }
58415850 };
58425851
5843- class Unowned {
5844- public:
5845- Unowned() = default;
5846- virtual ~Unowned() = default;
5847-
5848- private:
5849- int64_t unowned;
5850-
5851- public:
5852- const int64_t & get_unowned() const { return unowned; }
5853- int64_t & get_mutable_unowned() { return unowned; }
5854- void set_unowned(const int64_t & value) { this->unowned = value; }
5855- };
5856-
5857- class Unsafe {
5858- public:
5859- Unsafe() = default;
5860- virtual ~Unsafe() = default;
5861-
5862- private:
5863- int64_t unsafe;
5864-
5865- public:
5866- const int64_t & get_unsafe() const { return unsafe; }
5867- int64_t & get_mutable_unsafe() { return unsafe; }
5868- void set_unsafe(const int64_t & value) { this->unsafe = value; }
5869- };
5870-
5871- class UseSerializers {
5872- public:
5873- UseSerializers() = default;
5874- virtual ~UseSerializers() = default;
5875-
5876- private:
5877- int64_t use_serializers;
5878-
5879- public:
5880- const int64_t & get_use_serializers() const { return use_serializers; }
5881- int64_t & get_mutable_use_serializers() { return use_serializers; }
5882- void set_use_serializers(const int64_t & value) { this->use_serializers = value; }
5883- };
5884-
58855852 class Obj5 {
58865853 public:
58875854 Obj5() = default;
@@ -5913,6 +5880,8 @@ namespace quicktype {
59135880 Union obj5_union;
59145881 PrimitiveKind primitive_kind;
59155882 TrueClass purple_true;
5883+ Sealed sealed;
5884+ Sel sel;
59165885 Select select;
59175886 Self self;
59185887 Sendable sendable;
@@ -5951,9 +5920,6 @@ namespace quicktype {
59515920 Unchecked unchecked;
59525921 Undefined undefined;
59535922 UnmarshalJson unmarshal_json;
5954- Unowned unowned;
5955- Unsafe unsafe;
5956- UseSerializers use_serializers;
59575923
59585924 public:
59595925 const int64_t & get_dummy() const { return dummy; }
@@ -6056,6 +6022,14 @@ namespace quicktype {
60566022 TrueClass & get_mutable_purple_true() { return purple_true; }
60576023 void set_purple_true(const TrueClass & value) { this->purple_true = value; }
60586024
6025+ const Sealed & get_sealed() const { return sealed; }
6026+ Sealed & get_mutable_sealed() { return sealed; }
6027+ void set_sealed(const Sealed & value) { this->sealed = value; }
6028+
6029+ const Sel & get_sel() const { return sel; }
6030+ Sel & get_mutable_sel() { return sel; }
6031+ void set_sel(const Sel & value) { this->sel = value; }
6032+
60596033 const Select & get_select() const { return select; }
60606034 Select & get_mutable_select() { return select; }
60616035 void set_select(const Select & value) { this->select = value; }
@@ -6207,18 +6181,6 @@ namespace quicktype {
62076181 const UnmarshalJson & get_unmarshal_json() const { return unmarshal_json; }
62086182 UnmarshalJson & get_mutable_unmarshal_json() { return unmarshal_json; }
62096183 void set_unmarshal_json(const UnmarshalJson & value) { this->unmarshal_json = value; }
6210-
6211- const Unowned & get_unowned() const { return unowned; }
6212- Unowned & get_mutable_unowned() { return unowned; }
6213- void set_unowned(const Unowned & value) { this->unowned = value; }
6214-
6215- const Unsafe & get_unsafe() const { return unsafe; }
6216- Unsafe & get_mutable_unsafe() { return unsafe; }
6217- void set_unsafe(const Unsafe & value) { this->unsafe = value; }
6218-
6219- const UseSerializers & get_use_serializers() const { return use_serializers; }
6220- UseSerializers & get_mutable_use_serializers() { return use_serializers; }
6221- void set_use_serializers(const UseSerializers & value) { this->use_serializers = value; }
62226184 };
62236185
62246186 class Unsigned {
@@ -6347,6 +6309,48 @@ namespace quicktype {
63476309 void set_xor_eq_xor_eq(const int64_t & value) { this->xor_eq_xor_eq = value; }
63486310 };
63496311
6312+ class Unowned {
6313+ public:
6314+ Unowned() = default;
6315+ virtual ~Unowned() = default;
6316+
6317+ private:
6318+ int64_t unowned;
6319+
6320+ public:
6321+ const int64_t & get_unowned() const { return unowned; }
6322+ int64_t & get_mutable_unowned() { return unowned; }
6323+ void set_unowned(const int64_t & value) { this->unowned = value; }
6324+ };
6325+
6326+ class Unsafe {
6327+ public:
6328+ Unsafe() = default;
6329+ virtual ~Unsafe() = default;
6330+
6331+ private:
6332+ int64_t unsafe;
6333+
6334+ public:
6335+ const int64_t & get_unsafe() const { return unsafe; }
6336+ int64_t & get_mutable_unsafe() { return unsafe; }
6337+ void set_unsafe(const int64_t & value) { this->unsafe = value; }
6338+ };
6339+
6340+ class UseSerializers {
6341+ public:
6342+ UseSerializers() = default;
6343+ virtual ~UseSerializers() = default;
6344+
6345+ private:
6346+ int64_t use_serializers;
6347+
6348+ public:
6349+ const int64_t & get_use_serializers() const { return use_serializers; }
6350+ int64_t & get_mutable_use_serializers() { return use_serializers; }
6351+ void set_use_serializers(const int64_t & value) { this->use_serializers = value; }
6352+ };
6353+
63506354 class Ushort {
63516355 public:
63526356 Ushort() = default;
@@ -6517,6 +6521,9 @@ namespace quicktype {
65176521 While obj6_while;
65186522 Xor obj6_xor;
65196523 XorEq obj6_xor_eq;
6524+ Unowned unowned;
6525+ Unsafe unsafe;
6526+ UseSerializers use_serializers;
65206527 Ushort ushort;
65216528 Utf8JsonReader utf8_json_reader;
65226529 Utf8JsonWriter utf8_json_writer;
@@ -6570,6 +6577,18 @@ namespace quicktype {
65706577 XorEq & get_mutable_obj6_xor_eq() { return obj6_xor_eq; }
65716578 void set_obj6_xor_eq(const XorEq & value) { this->obj6_xor_eq = value; }
65726579
6580+ const Unowned & get_unowned() const { return unowned; }
6581+ Unowned & get_mutable_unowned() { return unowned; }
6582+ void set_unowned(const Unowned & value) { this->unowned = value; }
6583+
6584+ const Unsafe & get_unsafe() const { return unsafe; }
6585+ Unsafe & get_mutable_unsafe() { return unsafe; }
6586+ void set_unsafe(const Unsafe & value) { this->unsafe = value; }
6587+
6588+ const UseSerializers & get_use_serializers() const { return use_serializers; }
6589+ UseSerializers & get_mutable_use_serializers() { return use_serializers; }
6590+ void set_use_serializers(const UseSerializers & value) { this->use_serializers = value; }
6591+
65736592 const Ushort & get_ushort() const { return ushort; }
65746593 Ushort & get_mutable_ushort() { return ushort; }
65756594 void set_ushort(const Ushort & value) { this->ushort = value; }
@@ -7189,6 +7208,9 @@ namespace quicktype {
71897208 void from_json(const json & j, Lock & x);
71907209 void to_json(json & j, const Lock & x);
71917210
7211+ void from_json(const json & j, MakeDictEncoder & x);
7212+ void to_json(json & j, const MakeDictEncoder & x);
7213+
71927214 void from_json(const json & j, Map & x);
71937215 void to_json(json & j, const Map & x);
71947216
@@ -7210,12 +7232,6 @@ namespace quicktype {
72107232 void from_json(const json & j, Newtonsoft & x);
72117233 void to_json(json & j, const Newtonsoft & x);
72127234
7213- void from_json(const json & j, Nil & x);
7214- void to_json(json & j, const Nil & x);
7215-
7216- void from_json(const json & j, No & x);
7217- void to_json(json & j, const No & x);
7218-
72197235 void from_json(const json & j, Goto & x);
72207236 void to_json(json & j, const Goto & x);
72217237
@@ -7249,6 +7265,12 @@ namespace quicktype {
72497265 void from_json(const json & j, Obj3 & x);
72507266 void to_json(json & j, const Obj3 & x);
72517267
7268+ void from_json(const json & j, Nil & x);
7269+ void to_json(json & j, const Nil & x);
7270+
7271+ void from_json(const json & j, No & x);
7272+ void to_json(json & j, const No & x);
7273+
72527274 void from_json(const json & j, NoSuchMethod & x);
72537275 void to_json(json & j, const NoSuchMethod & x);
72547276
@@ -7435,12 +7457,6 @@ namespace quicktype {
74357457 void from_json(const json & j, Sbyte & x);
74367458 void to_json(json & j, const Sbyte & x);
74377459
7438- void from_json(const json & j, Sealed & x);
7439- void to_json(json & j, const Sealed & x);
7440-
7441- void from_json(const json & j, Sel & x);
7442- void to_json(json & j, const Sel & x);
7443-
74447460 void from_json(const json & j, Obj4 & x);
74457461 void to_json(json & j, const Obj4 & x);
74467462
@@ -7516,6 +7532,12 @@ namespace quicktype {
75167532 void from_json(const json & j, TrueClass & x);
75177533 void to_json(json & j, const TrueClass & x);
75187534
7535+ void from_json(const json & j, Sealed & x);
7536+ void to_json(json & j, const Sealed & x);
7537+
7538+ void from_json(const json & j, Sel & x);
7539+ void to_json(json & j, const Sel & x);
7540+
75197541 void from_json(const json & j, Select & x);
75207542 void to_json(json & j, const Select & x);
75217543
@@ -7630,15 +7652,6 @@ namespace quicktype {
76307652 void from_json(const json & j, UnmarshalJson & x);
76317653 void to_json(json & j, const UnmarshalJson & x);
76327654
7633- void from_json(const json & j, Unowned & x);
7634- void to_json(json & j, const Unowned & x);
7635-
7636- void from_json(const json & j, Unsafe & x);
7637- void to_json(json & j, const Unsafe & x);
7638-
7639- void from_json(const json & j, UseSerializers & x);
7640- void to_json(json & j, const UseSerializers & x);
7641-
76427655 void from_json(const json & j, Obj5 & x);
76437656 void to_json(json & j, const Obj5 & x);
76447657
@@ -7669,6 +7682,15 @@ namespace quicktype {
76697682 void from_json(const json & j, XorEq & x);
76707683 void to_json(json & j, const XorEq & x);
76717684
7685+ void from_json(const json & j, Unowned & x);
7686+ void to_json(json & j, const Unowned & x);
7687+
7688+ void from_json(const json & j, Unsafe & x);
7689+ void to_json(json & j, const Unsafe & x);
7690+
7691+ void from_json(const json & j, UseSerializers & x);
7692+ void to_json(json & j, const UseSerializers & x);
7693+
76727694 void from_json(const json & j, Ushort & x);
76737695 void to_json(json & j, const Ushort & x);
76747696
@@ -9901,6 +9923,17 @@ namespace quicktype {
99019923 j["lock"] = x.get_lock();
99029924 }
99039925
9926+ inline void from_json(const json & j, MakeDictEncoder& x) {
9927+ if (!j.is_object()) throw std::runtime_error("Expected object");
9928+ if (j.find("makeDictEncoder") != j.end() && !j.at("makeDictEncoder").is_number_integer()) throw std::runtime_error("Expected integer");
9929+ x.set_make_dict_encoder(j.at("makeDictEncoder").get<int64_t>());
9930+ }
9931+
9932+ inline void to_json(json & j, const MakeDictEncoder & x) {
9933+ j = json::object();
9934+ j["makeDictEncoder"] = x.get_make_dict_encoder();
9935+ }
9936+
99049937 inline void from_json(const json & j, Map& x) {
99059938 if (!j.is_object()) throw std::runtime_error("Expected object");
99069939 if (j.find("map") != j.end() && !j.at("map").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -9978,28 +10011,6 @@ namespace quicktype {
997810011 j["newtonsoft"] = x.get_newtonsoft();
997910012 }
998010013
9981- inline void from_json(const json & j, Nil& x) {
9982- if (!j.is_object()) throw std::runtime_error("Expected object");
9983- if (j.find("nil") != j.end() && !j.at("nil").is_number_integer()) throw std::runtime_error("Expected integer");
9984- x.set_nil(j.at("nil").get<int64_t>());
9985- }
9986-
9987- inline void to_json(json & j, const Nil & x) {
9988- j = json::object();
9989- j["nil"] = x.get_nil();
9990- }
9991-
9992- inline void from_json(const json & j, No& x) {
9993- if (!j.is_object()) throw std::runtime_error("Expected object");
9994- if (j.find("NO") != j.end() && !j.at("NO").is_number_integer()) throw std::runtime_error("Expected integer");
9995- x.set_no(j.at("NO").get<int64_t>());
9996- }
9997-
9998- inline void to_json(json & j, const No & x) {
9999- j = json::object();
10000- j["NO"] = x.get_no();
10001- }
10002-
1000310014 inline void from_json(const json & j, Goto& x) {
1000410015 if (!j.is_object()) throw std::runtime_error("Expected object");
1000510016 if (j.find("goto") != j.end() && !j.at("goto").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -10160,6 +10171,7 @@ namespace quicktype {
1016010171 x.set_list(j.at("list").get<List>());
1016110172 x.set_locale(j.at("Locale").get<Locale>());
1016210173 x.set_lock(j.at("lock").get<Lock>());
10174+ x.set_make_dict_encoder(j.at("makeDictEncoder").get<MakeDictEncoder>());
1016310175 x.set_map(j.at("map").get<Map>());
1016410176 x.set_map_entry(j.at("MapEntry").get<MapEntry>());
1016510177 x.set_marshal_json(j.at("MarshalJSON").get<MarshalJson>());
@@ -10167,8 +10179,6 @@ namespace quicktype {
1016710179 x.set_mutating(j.at("mutating").get<Mutating>());
1016810180 x.set_native(j.at("native").get<Native>());
1016910181 x.set_newtonsoft(j.at("newtonsoft").get<Newtonsoft>());
10170- x.set_nil(j.at("nil").get<Nil>());
10171- x.set_no(j.at("NO").get<No>());
1017210182 x.set_obj3_goto(j.at("goto").get<Goto>());
1017310183 x.set_obj3_if(j.at("if").get<If>());
1017410184 x.set_obj3_import(j.at("import").get<Import>());
@@ -10230,6 +10240,7 @@ namespace quicktype {
1023010240 j["list"] = x.get_list();
1023110241 j["Locale"] = x.get_locale();
1023210242 j["lock"] = x.get_lock();
10243+ j["makeDictEncoder"] = x.get_make_dict_encoder();
1023310244 j["map"] = x.get_map();
1023410245 j["MapEntry"] = x.get_map_entry();
1023510246 j["MarshalJSON"] = x.get_marshal_json();
@@ -10237,8 +10248,6 @@ namespace quicktype {
1023710248 j["mutating"] = x.get_mutating();
1023810249 j["native"] = x.get_native();
1023910250 j["newtonsoft"] = x.get_newtonsoft();
10240- j["nil"] = x.get_nil();
10241- j["NO"] = x.get_no();
1024210251 j["goto"] = x.get_obj3_goto();
1024310252 j["if"] = x.get_obj3_if();
1024410253 j["import"] = x.get_obj3_import();
@@ -10251,6 +10260,28 @@ namespace quicktype {
1025110260 j["new"] = x.get_obj3_new();
1025210261 }
1025310262
10263+ inline void from_json(const json & j, Nil& x) {
10264+ if (!j.is_object()) throw std::runtime_error("Expected object");
10265+ if (j.find("nil") != j.end() && !j.at("nil").is_number_integer()) throw std::runtime_error("Expected integer");
10266+ x.set_nil(j.at("nil").get<int64_t>());
10267+ }
10268+
10269+ inline void to_json(json & j, const Nil & x) {
10270+ j = json::object();
10271+ j["nil"] = x.get_nil();
10272+ }
10273+
10274+ inline void from_json(const json & j, No& x) {
10275+ if (!j.is_object()) throw std::runtime_error("Expected object");
10276+ if (j.find("NO") != j.end() && !j.at("NO").is_number_integer()) throw std::runtime_error("Expected integer");
10277+ x.set_no(j.at("NO").get<int64_t>());
10278+ }
10279+
10280+ inline void to_json(json & j, const No & x) {
10281+ j = json::object();
10282+ j["NO"] = x.get_no();
10283+ }
10284+
1025410285 inline void from_json(const json & j, NoSuchMethod& x) {
1025510286 if (!j.is_object()) throw std::runtime_error("Expected object");
1025610287 if (j.find("noSuchMethod") != j.end() && !j.at("noSuchMethod").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -10933,32 +10964,12 @@ namespace quicktype {
1093310964 j["sbyte"] = x.get_sbyte();
1093410965 }
1093510966
10936- inline void from_json(const json & j, Sealed& x) {
10937- if (!j.is_object()) throw std::runtime_error("Expected object");
10938- if (j.find("sealed") != j.end() && !j.at("sealed").is_number_integer()) throw std::runtime_error("Expected integer");
10939- x.set_sealed(j.at("sealed").get<int64_t>());
10940- }
10941-
10942- inline void to_json(json & j, const Sealed & x) {
10943- j = json::object();
10944- j["sealed"] = x.get_sealed();
10945- }
10946-
10947- inline void from_json(const json & j, Sel& x) {
10948- if (!j.is_object()) throw std::runtime_error("Expected object");
10949- if (j.find("SEL") != j.end() && !j.at("SEL").is_number_integer()) throw std::runtime_error("Expected integer");
10950- x.set_sel(j.at("SEL").get<int64_t>());
10951- }
10952-
10953- inline void to_json(json & j, const Sel & x) {
10954- j = json::object();
10955- j["SEL"] = x.get_sel();
10956- }
10957-
1095810967 inline void from_json(const json & j, Obj4& x) {
1095910968 if (!j.is_object()) throw std::runtime_error("Expected object");
1096010969 if (j.find("dummy") != j.end() && !j.at("dummy").is_number_integer()) throw std::runtime_error("Expected integer");
1096110970 x.set_dummy(j.at("dummy").get<int64_t>());
10971+ x.set_nil(j.at("nil").get<Nil>());
10972+ x.set_no(j.at("NO").get<No>());
1096210973 x.set_no_such_method(j.at("noSuchMethod").get<NoSuchMethod>());
1096310974 x.set_nonatomic(j.at("nonatomic").get<Nonatomic>());
1096410975 x.set_none(j.at("None").get<None>());
@@ -11021,13 +11032,13 @@ namespace quicktype {
1102111032 x.set_runtime_type(j.at("runtimeType").get<RuntimeType>());
1102211033 x.set_s(j.at("s").get<S>());
1102311034 x.set_sbyte(j.at("sbyte").get<Sbyte>());
11024- x.set_sealed(j.at("sealed").get<Sealed>());
11025- x.set_sel(j.at("SEL").get<Sel>());
1102611035 }
1102711036
1102811037 inline void to_json(json & j, const Obj4 & x) {
1102911038 j = json::object();
1103011039 j["dummy"] = x.get_dummy();
11040+ j["nil"] = x.get_nil();
11041+ j["NO"] = x.get_no();
1103111042 j["noSuchMethod"] = x.get_no_such_method();
1103211043 j["nonatomic"] = x.get_nonatomic();
1103311044 j["None"] = x.get_none();
@@ -11090,8 +11101,6 @@ namespace quicktype {
1109011101 j["runtimeType"] = x.get_runtime_type();
1109111102 j["s"] = x.get_s();
1109211103 j["sbyte"] = x.get_sbyte();
11093- j["sealed"] = x.get_sealed();
11094- j["SEL"] = x.get_sel();
1109511104 }
1109611105
1109711106 inline void from_json(const json & j, KSerializer& x) {
@@ -11358,6 +11367,28 @@ namespace quicktype {
1135811367 j["true"] = x.get_true_true();
1135911368 }
1136011369
11370+ inline void from_json(const json & j, Sealed& x) {
11371+ if (!j.is_object()) throw std::runtime_error("Expected object");
11372+ if (j.find("sealed") != j.end() && !j.at("sealed").is_number_integer()) throw std::runtime_error("Expected integer");
11373+ x.set_sealed(j.at("sealed").get<int64_t>());
11374+ }
11375+
11376+ inline void to_json(json & j, const Sealed & x) {
11377+ j = json::object();
11378+ j["sealed"] = x.get_sealed();
11379+ }
11380+
11381+ inline void from_json(const json & j, Sel& x) {
11382+ if (!j.is_object()) throw std::runtime_error("Expected object");
11383+ if (j.find("SEL") != j.end() && !j.at("SEL").is_number_integer()) throw std::runtime_error("Expected integer");
11384+ x.set_sel(j.at("SEL").get<int64_t>());
11385+ }
11386+
11387+ inline void to_json(json & j, const Sel & x) {
11388+ j = json::object();
11389+ j["SEL"] = x.get_sel();
11390+ }
11391+
1136111392 inline void from_json(const json & j, Select& x) {
1136211393 if (!j.is_object()) throw std::runtime_error("Expected object");
1136311394 if (j.find("select") != j.end() && !j.at("select").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -11776,39 +11807,6 @@ namespace quicktype {
1177611807 j["UnmarshalJSON"] = x.get_unmarshal_json();
1177711808 }
1177811809
11779- inline void from_json(const json & j, Unowned& x) {
11780- if (!j.is_object()) throw std::runtime_error("Expected object");
11781- if (j.find("unowned") != j.end() && !j.at("unowned").is_number_integer()) throw std::runtime_error("Expected integer");
11782- x.set_unowned(j.at("unowned").get<int64_t>());
11783- }
11784-
11785- inline void to_json(json & j, const Unowned & x) {
11786- j = json::object();
11787- j["unowned"] = x.get_unowned();
11788- }
11789-
11790- inline void from_json(const json & j, Unsafe& x) {
11791- if (!j.is_object()) throw std::runtime_error("Expected object");
11792- if (j.find("unsafe") != j.end() && !j.at("unsafe").is_number_integer()) throw std::runtime_error("Expected integer");
11793- x.set_unsafe(j.at("unsafe").get<int64_t>());
11794- }
11795-
11796- inline void to_json(json & j, const Unsafe & x) {
11797- j = json::object();
11798- j["unsafe"] = x.get_unsafe();
11799- }
11800-
11801- inline void from_json(const json & j, UseSerializers& x) {
11802- if (!j.is_object()) throw std::runtime_error("Expected object");
11803- if (j.find("UseSerializers") != j.end() && !j.at("UseSerializers").is_number_integer()) throw std::runtime_error("Expected integer");
11804- x.set_use_serializers(j.at("UseSerializers").get<int64_t>());
11805- }
11806-
11807- inline void to_json(json & j, const UseSerializers & x) {
11808- j = json::object();
11809- j["UseSerializers"] = x.get_use_serializers();
11810- }
11811-
1181211810 inline void from_json(const json & j, Obj5& x) {
1181311811 if (!j.is_object()) throw std::runtime_error("Expected object");
1181411812 if (j.find("dummy") != j.end() && !j.at("dummy").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -11837,6 +11835,8 @@ namespace quicktype {
1183711835 x.set_obj5_union(j.at("union").get<Union>());
1183811836 x.set_primitive_kind(j.at("PrimitiveKind").get<PrimitiveKind>());
1183911837 x.set_purple_true(j.at("true").get<TrueClass>());
11838+ x.set_sealed(j.at("sealed").get<Sealed>());
11839+ x.set_sel(j.at("SEL").get<Sel>());
1184011840 x.set_select(j.at("select").get<Select>());
1184111841 x.set_self(j.at("Self").get<Self>());
1184211842 x.set_sendable(j.at("Sendable").get<Sendable>());
@@ -11875,9 +11875,6 @@ namespace quicktype {
1187511875 x.set_unchecked(j.at("unchecked").get<Unchecked>());
1187611876 x.set_undefined(j.at("undefined").get<Undefined>());
1187711877 x.set_unmarshal_json(j.at("UnmarshalJSON").get<UnmarshalJson>());
11878- x.set_unowned(j.at("unowned").get<Unowned>());
11879- x.set_unsafe(j.at("unsafe").get<Unsafe>());
11880- x.set_use_serializers(j.at("UseSerializers").get<UseSerializers>());
1188111878 }
1188211879
1188311880 inline void to_json(json & j, const Obj5 & x) {
@@ -11907,6 +11904,8 @@ namespace quicktype {
1190711904 j["union"] = x.get_obj5_union();
1190811905 j["PrimitiveKind"] = x.get_primitive_kind();
1190911906 j["true"] = x.get_purple_true();
11907+ j["sealed"] = x.get_sealed();
11908+ j["SEL"] = x.get_sel();
1191011909 j["select"] = x.get_select();
1191111910 j["Self"] = x.get_self();
1191211911 j["Sendable"] = x.get_sendable();
@@ -11945,9 +11944,6 @@ namespace quicktype {
1194511944 j["unchecked"] = x.get_unchecked();
1194611945 j["undefined"] = x.get_undefined();
1194711946 j["UnmarshalJSON"] = x.get_unmarshal_json();
11948- j["unowned"] = x.get_unowned();
11949- j["unsafe"] = x.get_unsafe();
11950- j["UseSerializers"] = x.get_use_serializers();
1195111947 }
1195211948
1195311949 inline void from_json(const json & j, Unsigned& x) {
@@ -12049,6 +12045,39 @@ namespace quicktype {
1204912045 j["xor_eq"] = x.get_xor_eq_xor_eq();
1205012046 }
1205112047
12048+ inline void from_json(const json & j, Unowned& x) {
12049+ if (!j.is_object()) throw std::runtime_error("Expected object");
12050+ if (j.find("unowned") != j.end() && !j.at("unowned").is_number_integer()) throw std::runtime_error("Expected integer");
12051+ x.set_unowned(j.at("unowned").get<int64_t>());
12052+ }
12053+
12054+ inline void to_json(json & j, const Unowned & x) {
12055+ j = json::object();
12056+ j["unowned"] = x.get_unowned();
12057+ }
12058+
12059+ inline void from_json(const json & j, Unsafe& x) {
12060+ if (!j.is_object()) throw std::runtime_error("Expected object");
12061+ if (j.find("unsafe") != j.end() && !j.at("unsafe").is_number_integer()) throw std::runtime_error("Expected integer");
12062+ x.set_unsafe(j.at("unsafe").get<int64_t>());
12063+ }
12064+
12065+ inline void to_json(json & j, const Unsafe & x) {
12066+ j = json::object();
12067+ j["unsafe"] = x.get_unsafe();
12068+ }
12069+
12070+ inline void from_json(const json & j, UseSerializers& x) {
12071+ if (!j.is_object()) throw std::runtime_error("Expected object");
12072+ if (j.find("UseSerializers") != j.end() && !j.at("UseSerializers").is_number_integer()) throw std::runtime_error("Expected integer");
12073+ x.set_use_serializers(j.at("UseSerializers").get<int64_t>());
12074+ }
12075+
12076+ inline void to_json(json & j, const UseSerializers & x) {
12077+ j = json::object();
12078+ j["UseSerializers"] = x.get_use_serializers();
12079+ }
12080+
1205212081 inline void from_json(const json & j, Ushort& x) {
1205312082 if (!j.is_object()) throw std::runtime_error("Expected object");
1205412083 if (j.find("ushort") != j.end() && !j.at("ushort").is_number_integer()) throw std::runtime_error("Expected integer");
@@ -12183,6 +12212,9 @@ namespace quicktype {
1218312212 x.set_obj6_while(j.at("while").get<While>());
1218412213 x.set_obj6_xor(j.at("xor").get<Xor>());
1218512214 x.set_obj6_xor_eq(j.at("xor_eq").get<XorEq>());
12215+ x.set_unowned(j.at("unowned").get<Unowned>());
12216+ x.set_unsafe(j.at("unsafe").get<Unsafe>());
12217+ x.set_use_serializers(j.at("UseSerializers").get<UseSerializers>());
1218612218 x.set_ushort(j.at("ushort").get<Ushort>());
1218712219 x.set_utf8_json_reader(j.at("Utf8JsonReader").get<Utf8JsonReader>());
1218812220 x.set_utf8_json_writer(j.at("Utf8JsonWriter").get<Utf8JsonWriter>());
@@ -12208,6 +12240,9 @@ namespace quicktype {
1220812240 j["while"] = x.get_obj6_while();
1220912241 j["xor"] = x.get_obj6_xor();
1221012242 j["xor_eq"] = x.get_obj6_xor_eq();
12243+ j["unowned"] = x.get_unowned();
12244+ j["unsafe"] = x.get_unsafe();
12245+ j["UseSerializers"] = x.get_use_serializers();
1221112246 j["ushort"] = x.get_ushort();
1221212247 j["Utf8JsonReader"] = x.get_utf8_json_reader();
1221312248 j["Utf8JsonWriter"] = x.get_utf8_json_writer();
Mcrystaldefault / TopLevel.cr+72 −62
@@ -1255,6 +1255,9 @@ class Obj3
12551255
12561256 property long : Long
12571257
1258+ @[JSON::Field(key: "makeDictEncoder")]
1259+ property make_dict_encoder : MakeDictEncoder
1260+
12581261 property map : Map
12591262
12601263 @[JSON::Field(key: "MapEntry")]
@@ -1277,9 +1280,6 @@ class Obj3
12771280
12781281 property newtonsoft : Newtonsoft
12791282
1280- @[JSON::Field(key: "NO")]
1281- property no : No
1282-
12831283 @[JSON::Field(key: "if")]
12841284 property obj3_if : If
12851285
@@ -1288,9 +1288,6 @@ class Obj3
12881288
12891289 @[JSON::Field(key: "module")]
12901290 property obj3_module : Module
1291-
1292- @[JSON::Field(key: "nil")]
1293- property obj3_nil : NilClass
12941291 end
12951292
12961293 class Goto
@@ -1611,6 +1608,13 @@ class Long
16111608 property long : Int64
16121609 end
16131610
1611+class MakeDictEncoder
1612+ include JSON::Serializable
1613+
1614+ @[JSON::Field(key: "makeDictEncoder")]
1615+ property make_dict_encoder : Int64
1616+end
1617+
16141618 class Map
16151619 include JSON::Serializable
16161620
@@ -1673,13 +1677,6 @@ class Newtonsoft
16731677 property newtonsoft : Int64
16741678 end
16751679
1676-class No
1677- include JSON::Serializable
1678-
1679- @[JSON::Field(key: "NO")]
1680- property no : Int64
1681-end
1682-
16831680 class If
16841681 include JSON::Serializable
16851682
@@ -1701,18 +1698,14 @@ class Module
17011698 property module_module : Int64
17021699 end
17031700
1704-class NilClass
1705- include JSON::Serializable
1706-
1707- @[JSON::Field(key: "nil")]
1708- property nil_nil : Int64
1709-end
1710-
17111701 class Obj4
17121702 include JSON::Serializable
17131703
17141704 property dummy : Int64
17151705
1706+ @[JSON::Field(key: "NO")]
1707+ property no : No
1708+
17161709 @[JSON::Field(key: "noSuchMethod")]
17171710 property no_such_method : NoSuchMethod
17181711
@@ -1747,6 +1740,9 @@ class Obj4
17471740
17481741 property number : NumberClass
17491742
1743+ @[JSON::Field(key: "nil")]
1744+ property obj4_nil : NilClass
1745+
17501746 @[JSON::Field(key: "none")]
17511747 property obj4_none : NoneClass
17521748
@@ -1856,11 +1852,13 @@ class Obj4
18561852 property s : S
18571853
18581854 property sbyte : Sbyte
1855+end
18591856
1860- property sealed : Sealed
1857+class No
1858+ include JSON::Serializable
18611859
1862- @[JSON::Field(key: "SEL")]
1863- property sel : Sel
1860+ @[JSON::Field(key: "NO")]
1861+ property no : Int64
18641862 end
18651863
18661864 class NoSuchMethod
@@ -1953,6 +1951,13 @@ class NumberClass
19531951 property number : Int64
19541952 end
19551953
1954+class NilClass
1955+ include JSON::Serializable
1956+
1957+ @[JSON::Field(key: "nil")]
1958+ property nil_nil : Int64
1959+end
1960+
19561961 class NoneClass
19571962 include JSON::Serializable
19581963
@@ -2252,19 +2257,6 @@ class Sbyte
22522257 property sbyte : Int64
22532258 end
22542259
2255-class Sealed
2256- include JSON::Serializable
2257-
2258- property sealed : Int64
2259-end
2260-
2261-class Sel
2262- include JSON::Serializable
2263-
2264- @[JSON::Field(key: "SEL")]
2265- property sel : Int64
2266-end
2267-
22682260 class Obj5
22692261 include JSON::Serializable
22702262
@@ -2318,6 +2310,11 @@ class Obj5
23182310 @[JSON::Field(key: "type")]
23192311 property purple_type : TypeClass
23202312
2313+ property sealed : Sealed
2314+
2315+ @[JSON::Field(key: "SEL")]
2316+ property sel : Sel
2317+
23212318 @[JSON::Field(key: "Sendable")]
23222319 property sendable : Sendable
23232320
@@ -2423,13 +2420,6 @@ class Obj5
24232420
24242421 @[JSON::Field(key: "UnmarshalJSON")]
24252422 property unmarshal_json : UnmarshalJson
2426-
2427- property unowned : Unowned
2428-
2429- property unsafe : Unsafe
2430-
2431- @[JSON::Field(key: "UseSerializers")]
2432- property use_serializers : UseSerializers
24332423 end
24342424
24352425 class KSerializer
@@ -2544,6 +2534,19 @@ class TypeClass
25442534 property type_type : Int64
25452535 end
25462536
2537+class Sealed
2538+ include JSON::Serializable
2539+
2540+ property sealed : Int64
2541+end
2542+
2543+class Sel
2544+ include JSON::Serializable
2545+
2546+ @[JSON::Field(key: "SEL")]
2547+ property sel : Int64
2548+end
2549+
25472550 class Sendable
25482551 include JSON::Serializable
25492552
@@ -2834,25 +2837,6 @@ class UnmarshalJson
28342837 property unmarshal_json : Int64
28352838 end
28362839
2837-class Unowned
2838- include JSON::Serializable
2839-
2840- property unowned : Int64
2841-end
2842-
2843-class Unsafe
2844- include JSON::Serializable
2845-
2846- property unsafe : Int64
2847-end
2848-
2849-class UseSerializers
2850- include JSON::Serializable
2851-
2852- @[JSON::Field(key: "UseSerializers")]
2853- property use_serializers : Int64
2854-end
2855-
28562840 class Obj6
28572841 include JSON::Serializable
28582842
@@ -2867,8 +2851,15 @@ class Obj6
28672851 @[JSON::Field(key: "yield")]
28682852 property obj6_yield : Yield
28692853
2854+ property unowned : Unowned
2855+
2856+ property unsafe : Unsafe
2857+
28702858 property unsigned : Unsigned
28712859
2860+ @[JSON::Field(key: "UseSerializers")]
2861+ property use_serializers : UseSerializers
2862+
28722863 property ushort : Ushort
28732864
28742865 property using : Using
@@ -2928,12 +2919,31 @@ class Yield
29282919 property yield_yield : Int64
29292920 end
29302921
2922+class Unowned
2923+ include JSON::Serializable
2924+
2925+ property unowned : Int64
2926+end
2927+
2928+class Unsafe
2929+ include JSON::Serializable
2930+
2931+ property unsafe : Int64
2932+end
2933+
29312934 class Unsigned
29322935 include JSON::Serializable
29332936
29342937 property unsigned : Int64
29352938 end
29362939
2940+class UseSerializers
2941+ include JSON::Serializable
2942+
2943+ @[JSON::Field(key: "UseSerializers")]
2944+ property use_serializers : Int64
2945+end
2946+
29372947 class Ushort
29382948 include JSON::Serializable
Mcsharp-recordsdefault / QuickType.cs+70 −61
@@ -1372,6 +1372,9 @@ namespace QuickType
13721372 [JsonProperty("long", Required = Required.Always)]
13731373 public Long Long { get; set; }
13741374
1375+ [JsonProperty("makeDictEncoder", Required = Required.Always)]
1376+ public MakeDictEncoder MakeDictEncoder { get; set; }
1377+
13751378 [JsonProperty("map", Required = Required.Always)]
13761379 public Map Map { get; set; }
13771380
@@ -1404,12 +1407,6 @@ namespace QuickType
14041407
14051408 [JsonProperty("newtonsoft", Required = Required.Always)]
14061409 public NewtonsoftClass Newtonsoft { get; set; }
1407-
1408- [JsonProperty("nil", Required = Required.Always)]
1409- public Nil Nil { get; set; }
1410-
1411- [JsonProperty("NO", Required = Required.Always)]
1412- public No No { get; set; }
14131410 }
14141411
14151412 public partial record Goto
@@ -1724,6 +1721,12 @@ namespace QuickType
17241721 public long LongLong { get; set; }
17251722 }
17261723
1724+ public partial record MakeDictEncoder
1725+ {
1726+ [JsonProperty("makeDictEncoder", Required = Required.Always)]
1727+ public long MakeDictEncoderMakeDictEncoder { get; set; }
1728+ }
1729+
17271730 public partial record Map
17281731 {
17291732 [JsonProperty("map", Required = Required.Always)]
@@ -1790,23 +1793,17 @@ namespace QuickType
17901793 public long Newtonsoft { get; set; }
17911794 }
17921795
1793- public partial record Nil
1794- {
1795- [JsonProperty("nil", Required = Required.Always)]
1796- public long NilNil { get; set; }
1797- }
1798-
1799- public partial record No
1800- {
1801- [JsonProperty("NO", Required = Required.Always)]
1802- public long NoNo { get; set; }
1803- }
1804-
18051796 public partial record Obj4
18061797 {
18071798 [JsonProperty("dummy", Required = Required.Always)]
18081799 public long Dummy { get; set; }
18091800
1801+ [JsonProperty("nil", Required = Required.Always)]
1802+ public Nil Nil { get; set; }
1803+
1804+ [JsonProperty("NO", Required = Required.Always)]
1805+ public No No { get; set; }
1806+
18101807 [JsonProperty("noSuchMethod", Required = Required.Always)]
18111808 public NoSuchMethod NoSuchMethod { get; set; }
18121809
@@ -1992,12 +1989,18 @@ namespace QuickType
19921989
19931990 [JsonProperty("sbyte", Required = Required.Always)]
19941991 public Sbyte Sbyte { get; set; }
1992+ }
19951993
1996- [JsonProperty("sealed", Required = Required.Always)]
1997- public Sealed Sealed { get; set; }
1994+ public partial record Nil
1995+ {
1996+ [JsonProperty("nil", Required = Required.Always)]
1997+ public long NilNil { get; set; }
1998+ }
19981999
1999- [JsonProperty("SEL", Required = Required.Always)]
2000- public Sel Sel { get; set; }
2000+ public partial record No
2001+ {
2002+ [JsonProperty("NO", Required = Required.Always)]
2003+ public long NoNo { get; set; }
20012004 }
20022005
20032006 public partial record NoSuchMethod
@@ -2372,18 +2375,6 @@ namespace QuickType
23722375 public long SbyteSbyte { get; set; }
23732376 }
23742377
2375- public partial record Sealed
2376- {
2377- [JsonProperty("sealed", Required = Required.Always)]
2378- public long SealedSealed { get; set; }
2379- }
2380-
2381- public partial record Sel
2382- {
2383- [JsonProperty("SEL", Required = Required.Always)]
2384- public long SelSel { get; set; }
2385- }
2386-
23872378 public partial record Obj5
23882379 {
23892380 [JsonProperty("dummy", Required = Required.Always)]
@@ -2410,6 +2401,12 @@ namespace QuickType
24102401 [JsonProperty("PrimitiveKind", Required = Required.Always)]
24112402 public PrimitiveKind PrimitiveKind { get; set; }
24122403
2404+ [JsonProperty("sealed", Required = Required.Always)]
2405+ public Sealed Sealed { get; set; }
2406+
2407+ [JsonProperty("SEL", Required = Required.Always)]
2408+ public Sel Sel { get; set; }
2409+
24132410 [JsonProperty("select", Required = Required.Always)]
24142411 public Select Select { get; set; }
24152412
@@ -2574,15 +2571,6 @@ namespace QuickType
25742571
25752572 [JsonProperty("UnmarshalJSON", Required = Required.Always)]
25762573 public UnmarshalJson UnmarshalJson { get; set; }
2577-
2578- [JsonProperty("unowned", Required = Required.Always)]
2579- public Unowned Unowned { get; set; }
2580-
2581- [JsonProperty("unsafe", Required = Required.Always)]
2582- public Unsafe Unsafe { get; set; }
2583-
2584- [JsonProperty("UseSerializers", Required = Required.Always)]
2585- public UseSerializers UseSerializers { get; set; }
25862574 }
25872575
25882576 public partial record KSerializer
@@ -2627,6 +2615,18 @@ namespace QuickType
26272615 public long PrimitiveKindPrimitiveKind { get; set; }
26282616 }
26292617
2618+ public partial record Sealed
2619+ {
2620+ [JsonProperty("sealed", Required = Required.Always)]
2621+ public long SealedSealed { get; set; }
2622+ }
2623+
2624+ public partial record Sel
2625+ {
2626+ [JsonProperty("SEL", Required = Required.Always)]
2627+ public long SelSel { get; set; }
2628+ }
2629+
26302630 public partial record Select
26312631 {
26322632 [JsonProperty("select", Required = Required.Always)]
@@ -2957,32 +2957,23 @@ namespace QuickType
29572957 public long UnmarshalJsonUnmarshalJson { get; set; }
29582958 }
29592959
2960- public partial record Unowned
2961- {
2962- [JsonProperty("unowned", Required = Required.Always)]
2963- public long UnownedUnowned { get; set; }
2964- }
2965-
2966- public partial record Unsafe
2967- {
2968- [JsonProperty("unsafe", Required = Required.Always)]
2969- public long UnsafeUnsafe { get; set; }
2970- }
2971-
2972- public partial record UseSerializers
2973- {
2974- [JsonProperty("UseSerializers", Required = Required.Always)]
2975- public long UseSerializersUseSerializers { get; set; }
2976- }
2977-
29782960 public partial record Obj6
29792961 {
29802962 [JsonProperty("dummy", Required = Required.Always)]
29812963 public long Dummy { get; set; }
29822964
2965+ [JsonProperty("unowned", Required = Required.Always)]
2966+ public Unowned Unowned { get; set; }
2967+
2968+ [JsonProperty("unsafe", Required = Required.Always)]
2969+ public Unsafe Unsafe { get; set; }
2970+
29832971 [JsonProperty("unsigned", Required = Required.Always)]
29842972 public Unsigned Unsigned { get; set; }
29852973
2974+ [JsonProperty("UseSerializers", Required = Required.Always)]
2975+ public UseSerializers UseSerializers { get; set; }
2976+
29862977 [JsonProperty("ushort", Required = Required.Always)]
29872978 public Ushort Ushort { get; set; }
29882979
@@ -3041,12 +3032,30 @@ namespace QuickType
30413032 public Yield Yield { get; set; }
30423033 }
30433034
3035+ public partial record Unowned
3036+ {
3037+ [JsonProperty("unowned", Required = Required.Always)]
3038+ public long UnownedUnowned { get; set; }
3039+ }
3040+
3041+ public partial record Unsafe
3042+ {
3043+ [JsonProperty("unsafe", Required = Required.Always)]
3044+ public long UnsafeUnsafe { get; set; }
3045+ }
3046+
30443047 public partial record Unsigned
30453048 {
30463049 [JsonProperty("unsigned", Required = Required.Always)]
30473050 public long UnsignedUnsigned { get; set; }
30483051 }
30493052
3053+ public partial record UseSerializers
3054+ {
3055+ [JsonProperty("UseSerializers", Required = Required.Always)]
3056+ public long UseSerializersUseSerializers { get; set; }
3057+ }
3058+
30503059 public partial record Ushort
30513060 {
30523061 [JsonProperty("ushort", Required = Required.Always)]
Mcsharp-SystemTextJsondefault / QuickType.cs+82 −71
@@ -1687,6 +1687,10 @@ namespace QuickType
16871687 [JsonPropertyName("long")]
16881688 public Long Long { get; set; }
16891689
1690+ [JsonRequired]
1691+ [JsonPropertyName("makeDictEncoder")]
1692+ public MakeDictEncoder MakeDictEncoder { get; set; }
1693+
16901694 [JsonRequired]
16911695 [JsonPropertyName("map")]
16921696 public Map Map { get; set; }
@@ -1730,14 +1734,6 @@ namespace QuickType
17301734 [JsonRequired]
17311735 [JsonPropertyName("newtonsoft")]
17321736 public Newtonsoft Newtonsoft { get; set; }
1733-
1734- [JsonRequired]
1735- [JsonPropertyName("nil")]
1736- public Nil Nil { get; set; }
1737-
1738- [JsonRequired]
1739- [JsonPropertyName("NO")]
1740- public No No { get; set; }
17411737 }
17421738
17431739 public partial class Goto
@@ -2104,6 +2100,13 @@ namespace QuickType
21042100 public long LongLong { get; set; }
21052101 }
21062102
2103+ public partial class MakeDictEncoder
2104+ {
2105+ [JsonRequired]
2106+ [JsonPropertyName("makeDictEncoder")]
2107+ public long MakeDictEncoderMakeDictEncoder { get; set; }
2108+ }
2109+
21072110 public partial class Map
21082111 {
21092112 [JsonRequired]
@@ -2181,25 +2184,19 @@ namespace QuickType
21812184 public long NewtonsoftNewtonsoft { get; set; }
21822185 }
21832186
2184- public partial class Nil
2187+ public partial class Obj4
21852188 {
21862189 [JsonRequired]
2187- [JsonPropertyName("nil")]
2188- public long NilNil { get; set; }
2189- }
2190+ [JsonPropertyName("dummy")]
2191+ public long Dummy { get; set; }
21902192
2191- public partial class No
2192- {
21932193 [JsonRequired]
2194- [JsonPropertyName("NO")]
2195- public long NoNo { get; set; }
2196- }
2194+ [JsonPropertyName("nil")]
2195+ public Nil Nil { get; set; }
21972196
2198- public partial class Obj4
2199- {
22002197 [JsonRequired]
2201- [JsonPropertyName("dummy")]
2202- public long Dummy { get; set; }
2198+ [JsonPropertyName("NO")]
2199+ public No No { get; set; }
22032200
22042201 [JsonRequired]
22052202 [JsonPropertyName("noSuchMethod")]
@@ -2448,14 +2445,20 @@ namespace QuickType
24482445 [JsonRequired]
24492446 [JsonPropertyName("sbyte")]
24502447 public Sbyte Sbyte { get; set; }
2448+ }
24512449
2450+ public partial class Nil
2451+ {
24522452 [JsonRequired]
2453- [JsonPropertyName("sealed")]
2454- public Sealed Sealed { get; set; }
2453+ [JsonPropertyName("nil")]
2454+ public long NilNil { get; set; }
2455+ }
24552456
2457+ public partial class No
2458+ {
24562459 [JsonRequired]
2457- [JsonPropertyName("SEL")]
2458- public Sel Sel { get; set; }
2460+ [JsonPropertyName("NO")]
2461+ public long NoNo { get; set; }
24592462 }
24602463
24612464 public partial class NoSuchMethod
@@ -2892,20 +2895,6 @@ namespace QuickType
28922895 public long SbyteSbyte { get; set; }
28932896 }
28942897
2895- public partial class Sealed
2896- {
2897- [JsonRequired]
2898- [JsonPropertyName("sealed")]
2899- public long SealedSealed { get; set; }
2900- }
2901-
2902- public partial class Sel
2903- {
2904- [JsonRequired]
2905- [JsonPropertyName("SEL")]
2906- public long SelSel { get; set; }
2907- }
2908-
29092898 public partial class Obj5
29102899 {
29112900 [JsonRequired]
@@ -2940,6 +2929,14 @@ namespace QuickType
29402929 [JsonPropertyName("PrimitiveKind")]
29412930 public PrimitiveKind PrimitiveKind { get; set; }
29422931
2932+ [JsonRequired]
2933+ [JsonPropertyName("sealed")]
2934+ public Sealed Sealed { get; set; }
2935+
2936+ [JsonRequired]
2937+ [JsonPropertyName("SEL")]
2938+ public Sel Sel { get; set; }
2939+
29432940 [JsonRequired]
29442941 [JsonPropertyName("select")]
29452942 public Select Select { get; set; }
@@ -3159,18 +3156,6 @@ namespace QuickType
31593156 [JsonRequired]
31603157 [JsonPropertyName("UnmarshalJSON")]
31613158 public UnmarshalJson UnmarshalJson { get; set; }
3162-
3163- [JsonRequired]
3164- [JsonPropertyName("unowned")]
3165- public Unowned Unowned { get; set; }
3166-
3167- [JsonRequired]
3168- [JsonPropertyName("unsafe")]
3169- public Unsafe Unsafe { get; set; }
3170-
3171- [JsonRequired]
3172- [JsonPropertyName("UseSerializers")]
3173- public UseSerializers UseSerializers { get; set; }
31743159 }
31753160
31763161 public partial class KSerializer
@@ -3222,6 +3207,20 @@ namespace QuickType
32223207 public long PrimitiveKindPrimitiveKind { get; set; }
32233208 }
32243209
3210+ public partial class Sealed
3211+ {
3212+ [JsonRequired]
3213+ [JsonPropertyName("sealed")]
3214+ public long SealedSealed { get; set; }
3215+ }
3216+
3217+ public partial class Sel
3218+ {
3219+ [JsonRequired]
3220+ [JsonPropertyName("SEL")]
3221+ public long SelSel { get; set; }
3222+ }
3223+
32253224 public partial class Select
32263225 {
32273226 [JsonRequired]
@@ -3607,37 +3606,28 @@ namespace QuickType
36073606 public long UnmarshalJsonUnmarshalJson { get; set; }
36083607 }
36093608
3610- public partial class Unowned
3611- {
3612- [JsonRequired]
3613- [JsonPropertyName("unowned")]
3614- public long UnownedUnowned { get; set; }
3615- }
3616-
3617- public partial class Unsafe
3609+ public partial class Obj6
36183610 {
36193611 [JsonRequired]
3620- [JsonPropertyName("unsafe")]
3621- public long UnsafeUnsafe { get; set; }
3622- }
3612+ [JsonPropertyName("dummy")]
3613+ public long Dummy { get; set; }
36233614
3624- public partial class UseSerializers
3625- {
36263615 [JsonRequired]
3627- [JsonPropertyName("UseSerializers")]
3628- public long UseSerializersUseSerializers { get; set; }
3629- }
3616+ [JsonPropertyName("unowned")]
3617+ public Unowned Unowned { get; set; }
36303618
3631- public partial class Obj6
3632- {
36333619 [JsonRequired]
3634- [JsonPropertyName("dummy")]
3635- public long Dummy { get; set; }
3620+ [JsonPropertyName("unsafe")]
3621+ public Unsafe Unsafe { get; set; }
36363622
36373623 [JsonRequired]
36383624 [JsonPropertyName("unsigned")]
36393625 public Unsigned Unsigned { get; set; }
36403626
3627+ [JsonRequired]
3628+ [JsonPropertyName("UseSerializers")]
3629+ public UseSerializers UseSerializers { get; set; }
3630+
36413631 [JsonRequired]
36423632 [JsonPropertyName("ushort")]
36433633 public Ushort Ushort { get; set; }
@@ -3715,6 +3705,20 @@ namespace QuickType
37153705 public Yield Yield { get; set; }
37163706 }
37173707
3708+ public partial class Unowned
3709+ {
3710+ [JsonRequired]
3711+ [JsonPropertyName("unowned")]
3712+ public long UnownedUnowned { get; set; }
3713+ }
3714+
3715+ public partial class Unsafe
3716+ {
3717+ [JsonRequired]
3718+ [JsonPropertyName("unsafe")]
3719+ public long UnsafeUnsafe { get; set; }
3720+ }
3721+
37183722 public partial class Unsigned
37193723 {
37203724 [JsonRequired]
@@ -3722,6 +3726,13 @@ namespace QuickType
37223726 public long UnsignedUnsigned { get; set; }
37233727 }
37243728
3729+ public partial class UseSerializers
3730+ {
3731+ [JsonRequired]
3732+ [JsonPropertyName("UseSerializers")]
3733+ public long UseSerializersUseSerializers { get; set; }
3734+ }
3735+
37253736 public partial class Ushort
37263737 {
37273738 [JsonRequired]
Mcsharpdefault / QuickType.cs+70 −61
@@ -1372,6 +1372,9 @@ namespace QuickType
13721372 [JsonProperty("long", Required = Required.Always)]
13731373 public Long Long { get; set; }
13741374
1375+ [JsonProperty("makeDictEncoder", Required = Required.Always)]
1376+ public MakeDictEncoder MakeDictEncoder { get; set; }
1377+
13751378 [JsonProperty("map", Required = Required.Always)]
13761379 public Map Map { get; set; }
13771380
@@ -1404,12 +1407,6 @@ namespace QuickType
14041407
14051408 [JsonProperty("newtonsoft", Required = Required.Always)]
14061409 public NewtonsoftClass Newtonsoft { get; set; }
1407-
1408- [JsonProperty("nil", Required = Required.Always)]
1409- public Nil Nil { get; set; }
1410-
1411- [JsonProperty("NO", Required = Required.Always)]
1412- public No No { get; set; }
14131410 }
14141411
14151412 public partial class Goto
@@ -1724,6 +1721,12 @@ namespace QuickType
17241721 public long LongLong { get; set; }
17251722 }
17261723
1724+ public partial class MakeDictEncoder
1725+ {
1726+ [JsonProperty("makeDictEncoder", Required = Required.Always)]
1727+ public long MakeDictEncoderMakeDictEncoder { get; set; }
1728+ }
1729+
17271730 public partial class Map
17281731 {
17291732 [JsonProperty("map", Required = Required.Always)]
@@ -1790,23 +1793,17 @@ namespace QuickType
17901793 public long Newtonsoft { get; set; }
17911794 }
17921795
1793- public partial class Nil
1794- {
1795- [JsonProperty("nil", Required = Required.Always)]
1796- public long NilNil { get; set; }
1797- }
1798-
1799- public partial class No
1800- {
1801- [JsonProperty("NO", Required = Required.Always)]
1802- public long NoNo { get; set; }
1803- }
1804-
18051796 public partial class Obj4
18061797 {
18071798 [JsonProperty("dummy", Required = Required.Always)]
18081799 public long Dummy { get; set; }
18091800
1801+ [JsonProperty("nil", Required = Required.Always)]
1802+ public Nil Nil { get; set; }
1803+
1804+ [JsonProperty("NO", Required = Required.Always)]
1805+ public No No { get; set; }
1806+
18101807 [JsonProperty("noSuchMethod", Required = Required.Always)]
18111808 public NoSuchMethod NoSuchMethod { get; set; }
18121809
@@ -1992,12 +1989,18 @@ namespace QuickType
19921989
19931990 [JsonProperty("sbyte", Required = Required.Always)]
19941991 public Sbyte Sbyte { get; set; }
1992+ }
19951993
1996- [JsonProperty("sealed", Required = Required.Always)]
1997- public Sealed Sealed { get; set; }
1994+ public partial class Nil
1995+ {
1996+ [JsonProperty("nil", Required = Required.Always)]
1997+ public long NilNil { get; set; }
1998+ }
19981999
1999- [JsonProperty("SEL", Required = Required.Always)]
2000- public Sel Sel { get; set; }
2000+ public partial class No
2001+ {
2002+ [JsonProperty("NO", Required = Required.Always)]
2003+ public long NoNo { get; set; }
20012004 }
20022005
20032006 public partial class NoSuchMethod
@@ -2372,18 +2375,6 @@ namespace QuickType
23722375 public long SbyteSbyte { get; set; }
23732376 }
23742377
2375- public partial class Sealed
2376- {
2377- [JsonProperty("sealed", Required = Required.Always)]
2378- public long SealedSealed { get; set; }
2379- }
2380-
2381- public partial class Sel
2382- {
2383- [JsonProperty("SEL", Required = Required.Always)]
2384- public long SelSel { get; set; }
2385- }
2386-
23872378 public partial class Obj5
23882379 {
23892380 [JsonProperty("dummy", Required = Required.Always)]
@@ -2410,6 +2401,12 @@ namespace QuickType
24102401 [JsonProperty("PrimitiveKind", Required = Required.Always)]
24112402 public PrimitiveKind PrimitiveKind { get; set; }
24122403
2404+ [JsonProperty("sealed", Required = Required.Always)]
2405+ public Sealed Sealed { get; set; }
2406+
2407+ [JsonProperty("SEL", Required = Required.Always)]
2408+ public Sel Sel { get; set; }
2409+
24132410 [JsonProperty("select", Required = Required.Always)]
24142411 public Select Select { get; set; }
24152412
@@ -2574,15 +2571,6 @@ namespace QuickType
25742571
25752572 [JsonProperty("UnmarshalJSON", Required = Required.Always)]
25762573 public UnmarshalJson UnmarshalJson { get; set; }
2577-
2578- [JsonProperty("unowned", Required = Required.Always)]
2579- public Unowned Unowned { get; set; }
2580-
2581- [JsonProperty("unsafe", Required = Required.Always)]
2582- public Unsafe Unsafe { get; set; }
2583-
2584- [JsonProperty("UseSerializers", Required = Required.Always)]
2585- public UseSerializers UseSerializers { get; set; }
25862574 }
25872575
25882576 public partial class KSerializer
@@ -2627,6 +2615,18 @@ namespace QuickType
26272615 public long PrimitiveKindPrimitiveKind { get; set; }
26282616 }
26292617
2618+ public partial class Sealed
2619+ {
2620+ [JsonProperty("sealed", Required = Required.Always)]
2621+ public long SealedSealed { get; set; }
2622+ }
2623+
2624+ public partial class Sel
2625+ {
2626+ [JsonProperty("SEL", Required = Required.Always)]
2627+ public long SelSel { get; set; }
2628+ }
2629+
26302630 public partial class Select
26312631 {
26322632 [JsonProperty("select", Required = Required.Always)]
@@ -2957,32 +2957,23 @@ namespace QuickType
29572957 public long UnmarshalJsonUnmarshalJson { get; set; }
29582958 }
29592959
2960- public partial class Unowned
2961- {
2962- [JsonProperty("unowned", Required = Required.Always)]
2963- public long UnownedUnowned { get; set; }
2964- }
2965-
2966- public partial class Unsafe
2967- {
2968- [JsonProperty("unsafe", Required = Required.Always)]
2969- public long UnsafeUnsafe { get; set; }
2970- }
2971-
2972- public partial class UseSerializers
2973- {
2974- [JsonProperty("UseSerializers", Required = Required.Always)]
2975- public long UseSerializersUseSerializers { get; set; }
2976- }
2977-
29782960 public partial class Obj6
29792961 {
29802962 [JsonProperty("dummy", Required = Required.Always)]
29812963 public long Dummy { get; set; }
29822964
2965+ [JsonProperty("unowned", Required = Required.Always)]
2966+ public Unowned Unowned { get; set; }
2967+
2968+ [JsonProperty("unsafe", Required = Required.Always)]
2969+ public Unsafe Unsafe { get; set; }
2970+
29832971 [JsonProperty("unsigned", Required = Required.Always)]
29842972 public Unsigned Unsigned { get; set; }
29852973
2974+ [JsonProperty("UseSerializers", Required = Required.Always)]
2975+ public UseSerializers UseSerializers { get; set; }
2976+
29862977 [JsonProperty("ushort", Required = Required.Always)]
29872978 public Ushort Ushort { get; set; }
29882979
@@ -3041,12 +3032,30 @@ namespace QuickType
30413032 public Yield Yield { get; set; }
30423033 }
30433034
3035+ public partial class Unowned
3036+ {
3037+ [JsonProperty("unowned", Required = Required.Always)]
3038+ public long UnownedUnowned { get; set; }
3039+ }
3040+
3041+ public partial class Unsafe
3042+ {
3043+ [JsonProperty("unsafe", Required = Required.Always)]
3044+ public long UnsafeUnsafe { get; set; }
3045+ }
3046+
30443047 public partial class Unsigned
30453048 {
30463049 [JsonProperty("unsigned", Required = Required.Always)]
30473050 public long UnsignedUnsigned { get; set; }
30483051 }
30493052
3053+ public partial class UseSerializers
3054+ {
3055+ [JsonProperty("UseSerializers", Required = Required.Always)]
3056+ public long UseSerializersUseSerializers { get; set; }
3057+ }
3058+
30503059 public partial class Ushort
30513060 {
30523061 [JsonProperty("ushort", Required = Required.Always)]
Mdartdefault / TopLevel.dart+160 −140
@@ -2696,6 +2696,7 @@ class Obj3 {
26962696 final Locale locale;
26972697 final Lock lock;
26982698 final Long long;
2699+ final MakeDictEncoder makeDictEncoder;
26992700 final MapClass map;
27002701 final MapEntryClass mapEntry;
27012702 final MarshalJson marshalJson;
@@ -2706,8 +2707,6 @@ class Obj3 {
27062707 final Namespace namespace;
27072708 final Native native;
27082709 final Newtonsoft newtonsoft;
2709- final Nil nil;
2710- final No no;
27112710 final HashCode obj3HashCode;
27122711 final If obj3If;
27132712 final Implements obj3Implements;
@@ -2764,6 +2763,7 @@ class Obj3 {
27642763 required this.locale,
27652764 required this.lock,
27662765 required this.long,
2766+ required this.makeDictEncoder,
27672767 required this.map,
27682768 required this.mapEntry,
27692769 required this.marshalJson,
@@ -2774,8 +2774,6 @@ class Obj3 {
27742774 required this.namespace,
27752775 required this.native,
27762776 required this.newtonsoft,
2777- required this.nil,
2778- required this.no,
27792777 required this.obj3HashCode,
27802778 required this.obj3If,
27812779 required this.obj3Implements,
@@ -2833,6 +2831,7 @@ class Obj3 {
28332831 locale: Locale.fromJson(json["Locale"]),
28342832 lock: Lock.fromJson(json["lock"]),
28352833 long: Long.fromJson(json["long"]),
2834+ makeDictEncoder: MakeDictEncoder.fromJson(json["makeDictEncoder"]),
28362835 map: MapClass.fromJson(json["map"]),
28372836 mapEntry: MapEntryClass.fromJson(json["MapEntry"]),
28382837 marshalJson: MarshalJson.fromJson(json["MarshalJSON"]),
@@ -2843,8 +2842,6 @@ class Obj3 {
28432842 namespace: Namespace.fromJson(json["namespace"]),
28442843 native: Native.fromJson(json["native"]),
28452844 newtonsoft: Newtonsoft.fromJson(json["newtonsoft"]),
2846- nil: Nil.fromJson(json["nil"]),
2847- no: No.fromJson(json["NO"]),
28482845 obj3HashCode: HashCode.fromJson(json["hashCode"]),
28492846 obj3If: If.fromJson(json["if"]),
28502847 obj3Implements: Implements.fromJson(json["implements"]),
@@ -2902,6 +2899,7 @@ class Obj3 {
29022899 "Locale": locale.toJson(),
29032900 "lock": lock.toJson(),
29042901 "long": long.toJson(),
2902+ "makeDictEncoder": makeDictEncoder.toJson(),
29052903 "map": map.toJson(),
29062904 "MapEntry": mapEntry.toJson(),
29072905 "MarshalJSON": marshalJson.toJson(),
@@ -2912,8 +2910,6 @@ class Obj3 {
29122910 "namespace": namespace.toJson(),
29132911 "native": native.toJson(),
29142912 "newtonsoft": newtonsoft.toJson(),
2915- "nil": nil.toJson(),
2916- "NO": no.toJson(),
29172913 "hashCode": obj3HashCode.toJson(),
29182914 "if": obj3If.toJson(),
29192915 "implements": obj3Implements.toJson(),
@@ -3630,6 +3626,22 @@ class Long {
36303626 };
36313627 }
36323628
3629+class MakeDictEncoder {
3630+ final int makeDictEncoder;
3631+
3632+ MakeDictEncoder({
3633+ required this.makeDictEncoder,
3634+ });
3635+
3636+ factory MakeDictEncoder.fromJson(Map<String, dynamic> json) => MakeDictEncoder(
3637+ makeDictEncoder: json["makeDictEncoder"],
3638+ );
3639+
3640+ Map<String, dynamic> toJson() => {
3641+ "makeDictEncoder": makeDictEncoder,
3642+ };
3643+}
3644+
36333645 class MapClass {
36343646 final int map;
36353647
@@ -3790,38 +3802,6 @@ class Newtonsoft {
37903802 };
37913803 }
37923804
3793-class Nil {
3794- final int nil;
3795-
3796- Nil({
3797- required this.nil,
3798- });
3799-
3800- factory Nil.fromJson(Map<String, dynamic> json) => Nil(
3801- nil: json["nil"],
3802- );
3803-
3804- Map<String, dynamic> toJson() => {
3805- "nil": nil,
3806- };
3807-}
3808-
3809-class No {
3810- final int no;
3811-
3812- No({
3813- required this.no,
3814- });
3815-
3816- factory No.fromJson(Map<String, dynamic> json) => No(
3817- no: json["NO"],
3818- );
3819-
3820- Map<String, dynamic> toJson() => {
3821- "NO": no,
3822- };
3823-}
3824-
38253805 class HashCode {
38263806 final int hashCodeHashCode;
38273807
@@ -3968,6 +3948,8 @@ class New {
39683948
39693949 class Obj4 {
39703950 final int dummy;
3951+ final Nil nil;
3952+ final No no;
39713953 final Noexcept noexcept;
39723954 final Nonatomic nonatomic;
39733955 final None none;
@@ -4030,11 +4012,11 @@ class Obj4 {
40304012 final Right right;
40314013 final S s;
40324014 final Sbyte sbyte;
4033- final Sealed sealed;
4034- final Sel sel;
40354015
40364016 Obj4({
40374017 required this.dummy,
4018+ required this.nil,
4019+ required this.no,
40384020 required this.noexcept,
40394021 required this.nonatomic,
40404022 required this.none,
@@ -4097,12 +4079,12 @@ class Obj4 {
40974079 required this.right,
40984080 required this.s,
40994081 required this.sbyte,
4100- required this.sealed,
4101- required this.sel,
41024082 });
41034083
41044084 factory Obj4.fromJson(Map<String, dynamic> json) => Obj4(
41054085 dummy: json["dummy"],
4086+ nil: Nil.fromJson(json["nil"]),
4087+ no: No.fromJson(json["NO"]),
41064088 noexcept: Noexcept.fromJson(json["noexcept"]),
41074089 nonatomic: Nonatomic.fromJson(json["nonatomic"]),
41084090 none: None.fromJson(json["None"]),
@@ -4165,12 +4147,12 @@ class Obj4 {
41654147 right: Right.fromJson(json["right"]),
41664148 s: S.fromJson(json["s"]),
41674149 sbyte: Sbyte.fromJson(json["sbyte"]),
4168- sealed: Sealed.fromJson(json["sealed"]),
4169- sel: Sel.fromJson(json["SEL"]),
41704150 );
41714151
41724152 Map<String, dynamic> toJson() => {
41734153 "dummy": dummy,
4154+ "nil": nil.toJson(),
4155+ "NO": no.toJson(),
41744156 "noexcept": noexcept.toJson(),
41754157 "nonatomic": nonatomic.toJson(),
41764158 "None": none.toJson(),
@@ -4233,8 +4215,38 @@ class Obj4 {
42334215 "right": right.toJson(),
42344216 "s": s.toJson(),
42354217 "sbyte": sbyte.toJson(),
4236- "sealed": sealed.toJson(),
4237- "SEL": sel.toJson(),
4218+ };
4219+}
4220+
4221+class Nil {
4222+ final int nil;
4223+
4224+ Nil({
4225+ required this.nil,
4226+ });
4227+
4228+ factory Nil.fromJson(Map<String, dynamic> json) => Nil(
4229+ nil: json["nil"],
4230+ );
4231+
4232+ Map<String, dynamic> toJson() => {
4233+ "nil": nil,
4234+ };
4235+}
4236+
4237+class No {
4238+ final int no;
4239+
4240+ No({
4241+ required this.no,
4242+ });
4243+
4244+ factory No.fromJson(Map<String, dynamic> json) => No(
4245+ no: json["NO"],
4246+ );
4247+
4248+ Map<String, dynamic> toJson() => {
4249+ "NO": no,
42384250 };
42394251 }
42404252
@@ -5230,38 +5242,6 @@ class Sbyte {
52305242 };
52315243 }
52325244
5233-class Sealed {
5234- final int sealed;
5235-
5236- Sealed({
5237- required this.sealed,
5238- });
5239-
5240- factory Sealed.fromJson(Map<String, dynamic> json) => Sealed(
5241- sealed: json["sealed"],
5242- );
5243-
5244- Map<String, dynamic> toJson() => {
5245- "sealed": sealed,
5246- };
5247-}
5248-
5249-class Sel {
5250- final int sel;
5251-
5252- Sel({
5253- required this.sel,
5254- });
5255-
5256- factory Sel.fromJson(Map<String, dynamic> json) => Sel(
5257- sel: json["SEL"],
5258- );
5259-
5260- Map<String, dynamic> toJson() => {
5261- "SEL": sel,
5262- };
5263-}
5264-
52655245 class Obj5 {
52665246 final int dummy;
52675247 final KSerializer kSerializer;
@@ -5280,6 +5260,8 @@ class Obj5 {
52805260 final Typedef obj5Typedef;
52815261 final PrimitiveKind primitiveKind;
52825262 final TrueClass purpleTrue;
5263+ final Sealed sealed;
5264+ final Sel sel;
52835265 final Select select;
52845266 final Self self;
52855267 final Sendable sendable;
@@ -5326,9 +5308,6 @@ class Obj5 {
53265308 final Undefined undefined;
53275309 final Union union;
53285310 final UnmarshalJson unmarshalJson;
5329- final Unowned unowned;
5330- final Unsafe unsafe;
5331- final UseSerializers useSerializers;
53325311
53335312 Obj5({
53345313 required this.dummy,
@@ -5348,6 +5327,8 @@ class Obj5 {
53485327 required this.obj5Typedef,
53495328 required this.primitiveKind,
53505329 required this.purpleTrue,
5330+ required this.sealed,
5331+ required this.sel,
53515332 required this.select,
53525333 required this.self,
53535334 required this.sendable,
@@ -5394,9 +5375,6 @@ class Obj5 {
53945375 required this.undefined,
53955376 required this.union,
53965377 required this.unmarshalJson,
5397- required this.unowned,
5398- required this.unsafe,
5399- required this.useSerializers,
54005378 });
54015379
54025380 factory Obj5.fromJson(Map<String, dynamic> json) => Obj5(
@@ -5417,6 +5395,8 @@ class Obj5 {
54175395 obj5Typedef: Typedef.fromJson(json["typedef"]),
54185396 primitiveKind: PrimitiveKind.fromJson(json["PrimitiveKind"]),
54195397 purpleTrue: TrueClass.fromJson(json["true"]),
5398+ sealed: Sealed.fromJson(json["sealed"]),
5399+ sel: Sel.fromJson(json["SEL"]),
54205400 select: Select.fromJson(json["select"]),
54215401 self: Self.fromJson(json["Self"]),
54225402 sendable: Sendable.fromJson(json["Sendable"]),
@@ -5463,9 +5443,6 @@ class Obj5 {
54635443 undefined: Undefined.fromJson(json["undefined"]),
54645444 union: Union.fromJson(json["union"]),
54655445 unmarshalJson: UnmarshalJson.fromJson(json["UnmarshalJSON"]),
5466- unowned: Unowned.fromJson(json["unowned"]),
5467- unsafe: Unsafe.fromJson(json["unsafe"]),
5468- useSerializers: UseSerializers.fromJson(json["UseSerializers"]),
54695446 );
54705447
54715448 Map<String, dynamic> toJson() => {
@@ -5486,6 +5463,8 @@ class Obj5 {
54865463 "typedef": obj5Typedef.toJson(),
54875464 "PrimitiveKind": primitiveKind.toJson(),
54885465 "true": purpleTrue.toJson(),
5466+ "sealed": sealed.toJson(),
5467+ "SEL": sel.toJson(),
54895468 "select": select.toJson(),
54905469 "Self": self.toJson(),
54915470 "Sendable": sendable.toJson(),
@@ -5532,9 +5511,6 @@ class Obj5 {
55325511 "undefined": undefined.toJson(),
55335512 "union": union.toJson(),
55345513 "UnmarshalJSON": unmarshalJson.toJson(),
5535- "unowned": unowned.toJson(),
5536- "unsafe": unsafe.toJson(),
5537- "UseSerializers": useSerializers.toJson(),
55385514 };
55395515 }
55405516
@@ -5794,6 +5770,38 @@ class TrueClass {
57945770 };
57955771 }
57965772
5773+class Sealed {
5774+ final int sealed;
5775+
5776+ Sealed({
5777+ required this.sealed,
5778+ });
5779+
5780+ factory Sealed.fromJson(Map<String, dynamic> json) => Sealed(
5781+ sealed: json["sealed"],
5782+ );
5783+
5784+ Map<String, dynamic> toJson() => {
5785+ "sealed": sealed,
5786+ };
5787+}
5788+
5789+class Sel {
5790+ final int sel;
5791+
5792+ Sel({
5793+ required this.sel,
5794+ });
5795+
5796+ factory Sel.fromJson(Map<String, dynamic> json) => Sel(
5797+ sel: json["SEL"],
5798+ );
5799+
5800+ Map<String, dynamic> toJson() => {
5801+ "SEL": sel,
5802+ };
5803+}
5804+
57975805 class Select {
57985806 final int select;
57995807
@@ -6530,54 +6538,6 @@ class UnmarshalJson {
65306538 };
65316539 }
65326540
6533-class Unowned {
6534- final int unowned;
6535-
6536- Unowned({
6537- required this.unowned,
6538- });
6539-
6540- factory Unowned.fromJson(Map<String, dynamic> json) => Unowned(
6541- unowned: json["unowned"],
6542- );
6543-
6544- Map<String, dynamic> toJson() => {
6545- "unowned": unowned,
6546- };
6547-}
6548-
6549-class Unsafe {
6550- final int unsafe;
6551-
6552- Unsafe({
6553- required this.unsafe,
6554- });
6555-
6556- factory Unsafe.fromJson(Map<String, dynamic> json) => Unsafe(
6557- unsafe: json["unsafe"],
6558- );
6559-
6560- Map<String, dynamic> toJson() => {
6561- "unsafe": unsafe,
6562- };
6563-}
6564-
6565-class UseSerializers {
6566- final int useSerializers;
6567-
6568- UseSerializers({
6569- required this.useSerializers,
6570- });
6571-
6572- factory UseSerializers.fromJson(Map<String, dynamic> json) => UseSerializers(
6573- useSerializers: json["UseSerializers"],
6574- );
6575-
6576- Map<String, dynamic> toJson() => {
6577- "UseSerializers": useSerializers,
6578- };
6579-}
6580-
65816541 class Obj6 {
65826542 final int dummy;
65836543 final Var obj6Var;
@@ -6585,7 +6545,10 @@ class Obj6 {
65856545 final While obj6While;
65866546 final With obj6With;
65876547 final Yield obj6Yield;
6548+ final Unowned unowned;
6549+ final Unsafe unsafe;
65886550 final Unsigned unsigned;
6551+ final UseSerializers useSerializers;
65896552 final Ushort ushort;
65906553 final Using using;
65916554 final Utf8JsonReader utf8JsonReader;
@@ -6608,7 +6571,10 @@ class Obj6 {
66086571 required this.obj6While,
66096572 required this.obj6With,
66106573 required this.obj6Yield,
6574+ required this.unowned,
6575+ required this.unsafe,
66116576 required this.unsigned,
6577+ required this.useSerializers,
66126578 required this.ushort,
66136579 required this.using,
66146580 required this.utf8JsonReader,
@@ -6632,7 +6598,10 @@ class Obj6 {
66326598 obj6While: While.fromJson(json["while"]),
66336599 obj6With: With.fromJson(json["with"]),
66346600 obj6Yield: Yield.fromJson(json["yield"]),
6601+ unowned: Unowned.fromJson(json["unowned"]),
6602+ unsafe: Unsafe.fromJson(json["unsafe"]),
66356603 unsigned: Unsigned.fromJson(json["unsigned"]),
6604+ useSerializers: UseSerializers.fromJson(json["UseSerializers"]),
66366605 ushort: Ushort.fromJson(json["ushort"]),
66376606 using: Using.fromJson(json["using"]),
66386607 utf8JsonReader: Utf8JsonReader.fromJson(json["Utf8JsonReader"]),
@@ -6656,7 +6625,10 @@ class Obj6 {
66566625 "while": obj6While.toJson(),
66576626 "with": obj6With.toJson(),
66586627 "yield": obj6Yield.toJson(),
6628+ "unowned": unowned.toJson(),
6629+ "unsafe": unsafe.toJson(),
66596630 "unsigned": unsigned.toJson(),
6631+ "UseSerializers": useSerializers.toJson(),
66606632 "ushort": ushort.toJson(),
66616633 "using": using.toJson(),
66626634 "Utf8JsonReader": utf8JsonReader.toJson(),
@@ -6754,6 +6726,38 @@ class Yield {
67546726 };
67556727 }
67566728
6729+class Unowned {
6730+ final int unowned;
6731+
6732+ Unowned({
6733+ required this.unowned,
6734+ });
6735+
6736+ factory Unowned.fromJson(Map<String, dynamic> json) => Unowned(
6737+ unowned: json["unowned"],
6738+ );
6739+
6740+ Map<String, dynamic> toJson() => {
6741+ "unowned": unowned,
6742+ };
6743+}
6744+
6745+class Unsafe {
6746+ final int unsafe;
6747+
6748+ Unsafe({
6749+ required this.unsafe,
6750+ });
6751+
6752+ factory Unsafe.fromJson(Map<String, dynamic> json) => Unsafe(
6753+ unsafe: json["unsafe"],
6754+ );
6755+
6756+ Map<String, dynamic> toJson() => {
6757+ "unsafe": unsafe,
6758+ };
6759+}
6760+
67576761 class Unsigned {
67586762 final int unsigned;
67596763
@@ -6770,6 +6774,22 @@ class Unsigned {
67706774 };
67716775 }
67726776
6777+class UseSerializers {
6778+ final int useSerializers;
6779+
6780+ UseSerializers({
6781+ required this.useSerializers,
6782+ });
6783+
6784+ factory UseSerializers.fromJson(Map<String, dynamic> json) => UseSerializers(
6785+ useSerializers: json["UseSerializers"],
6786+ );
6787+
6788+ Map<String, dynamic> toJson() => {
6789+ "UseSerializers": useSerializers,
6790+ };
6791+}
6792+
67736793 class Ushort {
67746794 final int ushort;
Melixirdefault / QuickType.ex+347 −305
@@ -7455,6 +7455,45 @@ defmodule Long do
74557455 end
74567456 end
74577457
7458+defmodule MakeDictEncoder do
7459+ @enforce_keys [:make_dict_encoder]
7460+ defstruct [:make_dict_encoder]
7461+
7462+ @type t :: %__MODULE__{
7463+ make_dict_encoder: integer()
7464+ }
7465+
7466+ def decode_make_dict_encoder(value) when is_integer(value), do: value
7467+ def decode_make_dict_encoder(_), do: {:error, "Unexpected type when decoding MakeDictEncoder.make_dict_encoder"}
7468+
7469+ def encode_make_dict_encoder(value) when is_integer(value), do: value
7470+ def encode_make_dict_encoder(_), do: {:error, "Unexpected type when encoding MakeDictEncoder.make_dict_encoder"}
7471+
7472+ def from_map(m) do
7473+ %MakeDictEncoder{
7474+ make_dict_encoder: decode_make_dict_encoder(m["makeDictEncoder"]),
7475+ }
7476+ end
7477+
7478+ def from_json(json) do
7479+ json
7480+ |> Jason.decode!()
7481+ |> from_map()
7482+ end
7483+
7484+ def to_map(struct) do
7485+ %{
7486+ "makeDictEncoder" => struct.make_dict_encoder,
7487+ }
7488+ end
7489+
7490+ def to_json(struct) do
7491+ struct
7492+ |> to_map()
7493+ |> Jason.encode!()
7494+ end
7495+end
7496+
74587497 defmodule MapClass do
74597498 @enforce_keys [:map]
74607499 defstruct [:map]
@@ -7884,45 +7923,6 @@ defmodule Newtonsoft do
78847923 end
78857924 end
78867925
7887-defmodule No do
7888- @enforce_keys [:no]
7889- defstruct [:no]
7890-
7891- @type t :: %__MODULE__{
7892- no: integer()
7893- }
7894-
7895- def decode_no(value) when is_integer(value), do: value
7896- def decode_no(_), do: {:error, "Unexpected type when decoding No.no"}
7897-
7898- def encode_no(value) when is_integer(value), do: value
7899- def encode_no(_), do: {:error, "Unexpected type when encoding No.no"}
7900-
7901- def from_map(m) do
7902- %No{
7903- no: decode_no(m["NO"]),
7904- }
7905- end
7906-
7907- def from_json(json) do
7908- json
7909- |> Jason.decode!()
7910- |> from_map()
7911- end
7912-
7913- def to_map(struct) do
7914- %{
7915- "NO" => struct.no,
7916- }
7917- end
7918-
7919- def to_json(struct) do
7920- struct
7921- |> to_map()
7922- |> Jason.encode!()
7923- end
7924-end
7925-
79267926 defmodule ImportClass do
79277927 @enforce_keys [:import_import]
79287928 defstruct [:import_import]
@@ -8001,48 +8001,9 @@ defmodule InClass do
80018001 end
80028002 end
80038003
8004-defmodule NilClass do
8005- @enforce_keys [:nil_nil]
8006- defstruct [:nil_nil]
8007-
8008- @type t :: %__MODULE__{
8009- nil_nil: integer()
8010- }
8011-
8012- def decode_nil_nil(value) when is_integer(value), do: value
8013- def decode_nil_nil(_), do: {:error, "Unexpected type when decoding NilClass.nil_nil"}
8014-
8015- def encode_nil_nil(value) when is_integer(value), do: value
8016- def encode_nil_nil(_), do: {:error, "Unexpected type when encoding NilClass.nil_nil"}
8017-
8018- def from_map(m) do
8019- %NilClass{
8020- nil_nil: decode_nil_nil(m["nil"]),
8021- }
8022- end
8023-
8024- def from_json(json) do
8025- json
8026- |> Jason.decode!()
8027- |> from_map()
8028- end
8029-
8030- def to_map(struct) do
8031- %{
8032- "nil" => struct.nil_nil,
8033- }
8034- end
8035-
8036- def to_json(struct) do
8037- struct
8038- |> to_map()
8039- |> Jason.encode!()
8040- end
8041-end
8042-
80438004 defmodule Obj3 do
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]
8005+ @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, :make_dict_encoder, :map, :map_entry, :marshal_json, :metadata_property_handling, :module, :mutable, :mutating, :namespace, :native, :new, :newtonsoft, :obj3_import, :obj3_in]
8006+ 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, :make_dict_encoder, :map, :map_entry, :marshal_json, :metadata_property_handling, :module, :mutable, :mutating, :namespace, :native, :new, :newtonsoft, :obj3_import, :obj3_in]
80468007
80478008 @type t :: %__MODULE__{
80488009 dummy: integer(),
@@ -8096,6 +8057,7 @@ defmodule Obj3 do
80968057 locale: Locale.t(),
80978058 lock: Lock.t(),
80988059 long: Long.t(),
8060+ make_dict_encoder: MakeDictEncoder.t(),
80998061 map: MapClass.t(),
81008062 map_entry: MapEntry.t(),
81018063 marshal_json: MarshalJSON.t(),
@@ -8107,10 +8069,8 @@ defmodule Obj3 do
81078069 native: Native.t(),
81088070 new: New.t(),
81098071 newtonsoft: Newtonsoft.t(),
8110- no: No.t(),
81118072 obj3_import: ImportClass.t(),
8112- obj3_in: InClass.t(),
8113- obj3_nil: NilClass.t()
8073+ obj3_in: InClass.t()
81148074 }
81158075
81168076 def decode_dummy(value) when is_integer(value), do: value
@@ -8172,6 +8132,7 @@ defmodule Obj3 do
81728132 locale: Locale.from_map(m["Locale"]),
81738133 lock: Lock.from_map(m["lock"]),
81748134 long: Long.from_map(m["long"]),
8135+ make_dict_encoder: MakeDictEncoder.from_map(m["makeDictEncoder"]),
81758136 map: MapClass.from_map(m["map"]),
81768137 map_entry: MapEntry.from_map(m["MapEntry"]),
81778138 marshal_json: MarshalJSON.from_map(m["MarshalJSON"]),
@@ -8183,10 +8144,8 @@ defmodule Obj3 do
81838144 native: Native.from_map(m["native"]),
81848145 new: New.from_map(m["new"]),
81858146 newtonsoft: Newtonsoft.from_map(m["newtonsoft"]),
8186- no: No.from_map(m["NO"]),
81878147 obj3_import: ImportClass.from_map(m["import"]),
81888148 obj3_in: InClass.from_map(m["in"]),
8189- obj3_nil: NilClass.from_map(m["nil"]),
81908149 }
81918150 end
81928151
@@ -8249,6 +8208,7 @@ defmodule Obj3 do
82498208 "Locale" => Locale.to_map(struct.locale),
82508209 "lock" => Lock.to_map(struct.lock),
82518210 "long" => Long.to_map(struct.long),
8211+ "makeDictEncoder" => MakeDictEncoder.to_map(struct.make_dict_encoder),
82528212 "map" => MapClass.to_map(struct.map),
82538213 "MapEntry" => MapEntry.to_map(struct.map_entry),
82548214 "MarshalJSON" => MarshalJSON.to_map(struct.marshal_json),
@@ -8260,10 +8220,47 @@ defmodule Obj3 do
82608220 "native" => Native.to_map(struct.native),
82618221 "new" => New.to_map(struct.new),
82628222 "newtonsoft" => Newtonsoft.to_map(struct.newtonsoft),
8263- "NO" => No.to_map(struct.no),
82648223 "import" => ImportClass.to_map(struct.obj3_import),
82658224 "in" => InClass.to_map(struct.obj3_in),
8266- "nil" => NilClass.to_map(struct.obj3_nil),
8225+ }
8226+ end
8227+
8228+ def to_json(struct) do
8229+ struct
8230+ |> to_map()
8231+ |> Jason.encode!()
8232+ end
8233+end
8234+
8235+defmodule No do
8236+ @enforce_keys [:no]
8237+ defstruct [:no]
8238+
8239+ @type t :: %__MODULE__{
8240+ no: integer()
8241+ }
8242+
8243+ def decode_no(value) when is_integer(value), do: value
8244+ def decode_no(_), do: {:error, "Unexpected type when decoding No.no"}
8245+
8246+ def encode_no(value) when is_integer(value), do: value
8247+ def encode_no(_), do: {:error, "Unexpected type when encoding No.no"}
8248+
8249+ def from_map(m) do
8250+ %No{
8251+ no: decode_no(m["NO"]),
8252+ }
8253+ end
8254+
8255+ def from_json(json) do
8256+ json
8257+ |> Jason.decode!()
8258+ |> from_map()
8259+ end
8260+
8261+ def to_map(struct) do
8262+ %{
8263+ "NO" => struct.no,
82678264 }
82688265 end
82698266
@@ -8781,6 +8778,45 @@ defmodule Number do
87818778 end
87828779 end
87838780
8781+defmodule NilClass do
8782+ @enforce_keys [:nil_nil]
8783+ defstruct [:nil_nil]
8784+
8785+ @type t :: %__MODULE__{
8786+ nil_nil: integer()
8787+ }
8788+
8789+ def decode_nil_nil(value) when is_integer(value), do: value
8790+ def decode_nil_nil(_), do: {:error, "Unexpected type when decoding NilClass.nil_nil"}
8791+
8792+ def encode_nil_nil(value) when is_integer(value), do: value
8793+ def encode_nil_nil(_), do: {:error, "Unexpected type when encoding NilClass.nil_nil"}
8794+
8795+ def from_map(m) do
8796+ %NilClass{
8797+ nil_nil: decode_nil_nil(m["nil"]),
8798+ }
8799+ end
8800+
8801+ def from_json(json) do
8802+ json
8803+ |> Jason.decode!()
8804+ |> from_map()
8805+ end
8806+
8807+ def to_map(struct) do
8808+ %{
8809+ "nil" => struct.nil_nil,
8810+ }
8811+ end
8812+
8813+ def to_json(struct) do
8814+ struct
8815+ |> to_map()
8816+ |> Jason.encode!()
8817+ end
8818+end
8819+
87848820 defmodule NoneClass do
87858821 @enforce_keys [:none]
87868822 defstruct [:none]
@@ -10692,90 +10728,13 @@ defmodule Sbyte do
1069210728 end
1069310729 end
1069410730
10695-defmodule Sealed do
10696- @enforce_keys [:sealed]
10697- defstruct [:sealed]
10698-
10699- @type t :: %__MODULE__{
10700- sealed: integer()
10701- }
10702-
10703- def decode_sealed(value) when is_integer(value), do: value
10704- def decode_sealed(_), do: {:error, "Unexpected type when decoding Sealed.sealed"}
10705-
10706- def encode_sealed(value) when is_integer(value), do: value
10707- def encode_sealed(_), do: {:error, "Unexpected type when encoding Sealed.sealed"}
10708-
10709- def from_map(m) do
10710- %Sealed{
10711- sealed: decode_sealed(m["sealed"]),
10712- }
10713- end
10714-
10715- def from_json(json) do
10716- json
10717- |> Jason.decode!()
10718- |> from_map()
10719- end
10720-
10721- def to_map(struct) do
10722- %{
10723- "sealed" => struct.sealed,
10724- }
10725- end
10726-
10727- def to_json(struct) do
10728- struct
10729- |> to_map()
10730- |> Jason.encode!()
10731- end
10732-end
10733-
10734-defmodule Sel do
10735- @enforce_keys [:sel]
10736- defstruct [:sel]
10737-
10738- @type t :: %__MODULE__{
10739- sel: integer()
10740- }
10741-
10742- def decode_sel(value) when is_integer(value), do: value
10743- def decode_sel(_), do: {:error, "Unexpected type when decoding Sel.sel"}
10744-
10745- def encode_sel(value) when is_integer(value), do: value
10746- def encode_sel(_), do: {:error, "Unexpected type when encoding Sel.sel"}
10747-
10748- def from_map(m) do
10749- %Sel{
10750- sel: decode_sel(m["SEL"]),
10751- }
10752- end
10753-
10754- def from_json(json) do
10755- json
10756- |> Jason.decode!()
10757- |> from_map()
10758- end
10759-
10760- def to_map(struct) do
10761- %{
10762- "SEL" => struct.sel,
10763- }
10764- end
10765-
10766- def to_json(struct) do
10767- struct
10768- |> to_map()
10769- |> Jason.encode!()
10770- end
10771-end
10772-
1077310731 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]
10732+ @enforce_keys [:dummy, :no, :no_such_method, :noexcept, :nonatomic, :none, :nonlocal, :nonmutating, :not_eq, :ns_error, :ns_object, :ns_string, :null, :nullptr, :number, :obj4_nil, :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]
10733+ defstruct [:dummy, :no, :no_such_method, :noexcept, :nonatomic, :none, :nonlocal, :nonmutating, :not_eq, :ns_error, :ns_object, :ns_string, :null, :nullptr, :number, :obj4_nil, :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]
1077610734
1077710735 @type t :: %__MODULE__{
1077810736 dummy: integer(),
10737+ no: No.t(),
1077910738 no_such_method: NoSuchMethod.t(),
1078010739 noexcept: Noexcept.t(),
1078110740 nonatomic: Nonatomic.t(),
@@ -10789,6 +10748,7 @@ defmodule Obj4 do
1078910748 null: Null.t(),
1079010749 nullptr: Nullptr.t(),
1079110750 number: Number.t(),
10751+ obj4_nil: NilClass.t(),
1079210752 obj4_none: NoneClass.t(),
1079310753 obj4_not: NotClass.t(),
1079410754 obj4_null: NullClass.t(),
@@ -10837,9 +10797,7 @@ defmodule Obj4 do
1083710797 right: Right.t(),
1083810798 runtime_type: RuntimeType.t(),
1083910799 s: S.t(),
10840- sbyte: Sbyte.t(),
10841- sealed: Sealed.t(),
10842- sel: Sel.t()
10800+ sbyte: Sbyte.t()
1084310801 }
1084410802
1084510803 def decode_dummy(value) when is_integer(value), do: value
@@ -10851,6 +10809,7 @@ defmodule Obj4 do
1085110809 def from_map(m) do
1085210810 %Obj4{
1085310811 dummy: decode_dummy(m["dummy"]),
10812+ no: No.from_map(m["NO"]),
1085410813 no_such_method: NoSuchMethod.from_map(m["noSuchMethod"]),
1085510814 noexcept: Noexcept.from_map(m["noexcept"]),
1085610815 nonatomic: Nonatomic.from_map(m["nonatomic"]),
@@ -10864,6 +10823,7 @@ defmodule Obj4 do
1086410823 null: Null.from_map(m["NULL"]),
1086510824 nullptr: Nullptr.from_map(m["nullptr"]),
1086610825 number: Number.from_map(m["number"]),
10826+ obj4_nil: NilClass.from_map(m["nil"]),
1086710827 obj4_none: NoneClass.from_map(m["none"]),
1086810828 obj4_not: NotClass.from_map(m["not"]),
1086910829 obj4_null: NullClass.from_map(m["null"]),
@@ -10913,8 +10873,6 @@ defmodule Obj4 do
1091310873 runtime_type: RuntimeType.from_map(m["runtimeType"]),
1091410874 s: S.from_map(m["s"]),
1091510875 sbyte: Sbyte.from_map(m["sbyte"]),
10916- sealed: Sealed.from_map(m["sealed"]),
10917- sel: Sel.from_map(m["SEL"]),
1091810876 }
1091910877 end
1092010878
@@ -10927,6 +10885,7 @@ defmodule Obj4 do
1092710885 def to_map(struct) do
1092810886 %{
1092910887 "dummy" => struct.dummy,
10888+ "NO" => No.to_map(struct.no),
1093010889 "noSuchMethod" => NoSuchMethod.to_map(struct.no_such_method),
1093110890 "noexcept" => Noexcept.to_map(struct.noexcept),
1093210891 "nonatomic" => Nonatomic.to_map(struct.nonatomic),
@@ -10940,6 +10899,7 @@ defmodule Obj4 do
1094010899 "NULL" => Null.to_map(struct.null),
1094110900 "nullptr" => Nullptr.to_map(struct.nullptr),
1094210901 "number" => Number.to_map(struct.number),
10902+ "nil" => NilClass.to_map(struct.obj4_nil),
1094310903 "none" => NoneClass.to_map(struct.obj4_none),
1094410904 "not" => NotClass.to_map(struct.obj4_not),
1094510905 "null" => NullClass.to_map(struct.obj4_null),
@@ -10989,8 +10949,6 @@ defmodule Obj4 do
1098910949 "runtimeType" => RuntimeType.to_map(struct.runtime_type),
1099010950 "s" => S.to_map(struct.s),
1099110951 "sbyte" => Sbyte.to_map(struct.sbyte),
10992- "sealed" => Sealed.to_map(struct.sealed),
10993- "SEL" => Sel.to_map(struct.sel),
1099410952 }
1099510953 end
1099610954
@@ -11196,6 +11154,84 @@ defmodule PrimitiveKind do
1119611154 end
1119711155 end
1119811156
11157+defmodule Sealed do
11158+ @enforce_keys [:sealed]
11159+ defstruct [:sealed]
11160+
11161+ @type t :: %__MODULE__{
11162+ sealed: integer()
11163+ }
11164+
11165+ def decode_sealed(value) when is_integer(value), do: value
11166+ def decode_sealed(_), do: {:error, "Unexpected type when decoding Sealed.sealed"}
11167+
11168+ def encode_sealed(value) when is_integer(value), do: value
11169+ def encode_sealed(_), do: {:error, "Unexpected type when encoding Sealed.sealed"}
11170+
11171+ def from_map(m) do
11172+ %Sealed{
11173+ sealed: decode_sealed(m["sealed"]),
11174+ }
11175+ end
11176+
11177+ def from_json(json) do
11178+ json
11179+ |> Jason.decode!()
11180+ |> from_map()
11181+ end
11182+
11183+ def to_map(struct) do
11184+ %{
11185+ "sealed" => struct.sealed,
11186+ }
11187+ end
11188+
11189+ def to_json(struct) do
11190+ struct
11191+ |> to_map()
11192+ |> Jason.encode!()
11193+ end
11194+end
11195+
11196+defmodule Sel do
11197+ @enforce_keys [:sel]
11198+ defstruct [:sel]
11199+
11200+ @type t :: %__MODULE__{
11201+ sel: integer()
11202+ }
11203+
11204+ def decode_sel(value) when is_integer(value), do: value
11205+ def decode_sel(_), do: {:error, "Unexpected type when decoding Sel.sel"}
11206+
11207+ def encode_sel(value) when is_integer(value), do: value
11208+ def encode_sel(_), do: {:error, "Unexpected type when encoding Sel.sel"}
11209+
11210+ def from_map(m) do
11211+ %Sel{
11212+ sel: decode_sel(m["SEL"]),
11213+ }
11214+ end
11215+
11216+ def from_json(json) do
11217+ json
11218+ |> Jason.decode!()
11219+ |> from_map()
11220+ end
11221+
11222+ def to_map(struct) do
11223+ %{
11224+ "SEL" => struct.sel,
11225+ }
11226+ end
11227+
11228+ def to_json(struct) do
11229+ struct
11230+ |> to_map()
11231+ |> Jason.encode!()
11232+ end
11233+end
11234+
1119911235 defmodule Select do
1120011236 @enforce_keys [:select]
1120111237 defstruct [:select]
@@ -13419,126 +13455,9 @@ defmodule UnmarshalJSON do
1341913455 end
1342013456 end
1342113457
13422-defmodule Unowned do
13423- @enforce_keys [:unowned]
13424- defstruct [:unowned]
13425-
13426- @type t :: %__MODULE__{
13427- unowned: integer()
13428- }
13429-
13430- def decode_unowned(value) when is_integer(value), do: value
13431- def decode_unowned(_), do: {:error, "Unexpected type when decoding Unowned.unowned"}
13432-
13433- def encode_unowned(value) when is_integer(value), do: value
13434- def encode_unowned(_), do: {:error, "Unexpected type when encoding Unowned.unowned"}
13435-
13436- def from_map(m) do
13437- %Unowned{
13438- unowned: decode_unowned(m["unowned"]),
13439- }
13440- end
13441-
13442- def from_json(json) do
13443- json
13444- |> Jason.decode!()
13445- |> from_map()
13446- end
13447-
13448- def to_map(struct) do
13449- %{
13450- "unowned" => struct.unowned,
13451- }
13452- end
13453-
13454- def to_json(struct) do
13455- struct
13456- |> to_map()
13457- |> Jason.encode!()
13458- end
13459-end
13460-
13461-defmodule Unsafe do
13462- @enforce_keys [:unsafe]
13463- defstruct [:unsafe]
13464-
13465- @type t :: %__MODULE__{
13466- unsafe: integer()
13467- }
13468-
13469- def decode_unsafe(value) when is_integer(value), do: value
13470- def decode_unsafe(_), do: {:error, "Unexpected type when decoding Unsafe.unsafe"}
13471-
13472- def encode_unsafe(value) when is_integer(value), do: value
13473- def encode_unsafe(_), do: {:error, "Unexpected type when encoding Unsafe.unsafe"}
13474-
13475- def from_map(m) do
13476- %Unsafe{
13477- unsafe: decode_unsafe(m["unsafe"]),
13478- }
13479- end
13480-
13481- def from_json(json) do
13482- json
13483- |> Jason.decode!()
13484- |> from_map()
13485- end
13486-
13487- def to_map(struct) do
13488- %{
13489- "unsafe" => struct.unsafe,
13490- }
13491- end
13492-
13493- def to_json(struct) do
13494- struct
13495- |> to_map()
13496- |> Jason.encode!()
13497- end
13498-end
13499-
13500-defmodule UseSerializers do
13501- @enforce_keys [:use_serializers]
13502- defstruct [:use_serializers]
13503-
13504- @type t :: %__MODULE__{
13505- use_serializers: integer()
13506- }
13507-
13508- def decode_use_serializers(value) when is_integer(value), do: value
13509- def decode_use_serializers(_), do: {:error, "Unexpected type when decoding UseSerializers.use_serializers"}
13510-
13511- def encode_use_serializers(value) when is_integer(value), do: value
13512- def encode_use_serializers(_), do: {:error, "Unexpected type when encoding UseSerializers.use_serializers"}
13513-
13514- def from_map(m) do
13515- %UseSerializers{
13516- use_serializers: decode_use_serializers(m["UseSerializers"]),
13517- }
13518- end
13519-
13520- def from_json(json) do
13521- json
13522- |> Jason.decode!()
13523- |> from_map()
13524- end
13525-
13526- def to_map(struct) do
13527- %{
13528- "UseSerializers" => struct.use_serializers,
13529- }
13530- end
13531-
13532- def to_json(struct) do
13533- struct
13534- |> to_map()
13535- |> Jason.encode!()
13536- end
13537-end
13538-
1353913458 defmodule Obj5 do
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]
13459+ @enforce_keys [:dummy, :k_serializer, :obj5_self, :obj5_true, :obj5_type, :primitive_kind, :sealed, :sel, :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]
13460+ defstruct [:dummy, :k_serializer, :obj5_self, :obj5_true, :obj5_type, :primitive_kind, :sealed, :sel, :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]
1354213461
1354313462 @type t :: %__MODULE__{
1354413463 dummy: integer(),
@@ -13547,6 +13466,8 @@ defmodule Obj5 do
1354713466 obj5_true: TrueClass.t(),
1354813467 obj5_type: TypeClass.t(),
1354913468 primitive_kind: PrimitiveKind.t(),
13469+ sealed: Sealed.t(),
13470+ sel: Sel.t(),
1355013471 select: Select.t(),
1355113472 self: Self.t(),
1355213473 sendable: Sendable.t(),
@@ -13603,10 +13524,7 @@ defmodule Obj5 do
1360313524 unchecked: Unchecked.t(),
1360413525 undefined: Undefined.t(),
1360513526 union: Union.t(),
13606- unmarshal_json: UnmarshalJSON.t(),
13607- unowned: Unowned.t(),
13608- unsafe: Unsafe.t(),
13609- use_serializers: UseSerializers.t()
13527+ unmarshal_json: UnmarshalJSON.t()
1361013528 }
1361113529
1361213530 def decode_dummy(value) when is_integer(value), do: value
@@ -13623,6 +13541,8 @@ defmodule Obj5 do
1362313541 obj5_true: TrueClass.from_map(m["True"]),
1362413542 obj5_type: TypeClass.from_map(m["type"]),
1362513543 primitive_kind: PrimitiveKind.from_map(m["PrimitiveKind"]),
13544+ sealed: Sealed.from_map(m["sealed"]),
13545+ sel: Sel.from_map(m["SEL"]),
1362613546 select: Select.from_map(m["select"]),
1362713547 self: Self.from_map(m["Self"]),
1362813548 sendable: Sendable.from_map(m["Sendable"]),
@@ -13680,9 +13600,6 @@ defmodule Obj5 do
1368013600 undefined: Undefined.from_map(m["undefined"]),
1368113601 union: Union.from_map(m["union"]),
1368213602 unmarshal_json: UnmarshalJSON.from_map(m["UnmarshalJSON"]),
13683- unowned: Unowned.from_map(m["unowned"]),
13684- unsafe: Unsafe.from_map(m["unsafe"]),
13685- use_serializers: UseSerializers.from_map(m["UseSerializers"]),
1368613603 }
1368713604 end
1368813605
@@ -13700,6 +13617,8 @@ defmodule Obj5 do
1370013617 "True" => TrueClass.to_map(struct.obj5_true),
1370113618 "type" => TypeClass.to_map(struct.obj5_type),
1370213619 "PrimitiveKind" => PrimitiveKind.to_map(struct.primitive_kind),
13620+ "sealed" => Sealed.to_map(struct.sealed),
13621+ "SEL" => Sel.to_map(struct.sel),
1370313622 "select" => Select.to_map(struct.select),
1370413623 "Self" => Self.to_map(struct.self),
1370513624 "Sendable" => Sendable.to_map(struct.sendable),
@@ -13757,9 +13676,84 @@ defmodule Obj5 do
1375713676 "undefined" => Undefined.to_map(struct.undefined),
1375813677 "union" => Union.to_map(struct.union),
1375913678 "UnmarshalJSON" => UnmarshalJSON.to_map(struct.unmarshal_json),
13760- "unowned" => Unowned.to_map(struct.unowned),
13761- "unsafe" => Unsafe.to_map(struct.unsafe),
13762- "UseSerializers" => UseSerializers.to_map(struct.use_serializers),
13679+ }
13680+ end
13681+
13682+ def to_json(struct) do
13683+ struct
13684+ |> to_map()
13685+ |> Jason.encode!()
13686+ end
13687+end
13688+
13689+defmodule Unowned do
13690+ @enforce_keys [:unowned]
13691+ defstruct [:unowned]
13692+
13693+ @type t :: %__MODULE__{
13694+ unowned: integer()
13695+ }
13696+
13697+ def decode_unowned(value) when is_integer(value), do: value
13698+ def decode_unowned(_), do: {:error, "Unexpected type when decoding Unowned.unowned"}
13699+
13700+ def encode_unowned(value) when is_integer(value), do: value
13701+ def encode_unowned(_), do: {:error, "Unexpected type when encoding Unowned.unowned"}
13702+
13703+ def from_map(m) do
13704+ %Unowned{
13705+ unowned: decode_unowned(m["unowned"]),
13706+ }
13707+ end
13708+
13709+ def from_json(json) do
13710+ json
13711+ |> Jason.decode!()
13712+ |> from_map()
13713+ end
13714+
13715+ def to_map(struct) do
13716+ %{
13717+ "unowned" => struct.unowned,
13718+ }
13719+ end
13720+
13721+ def to_json(struct) do
13722+ struct
13723+ |> to_map()
13724+ |> Jason.encode!()
13725+ end
13726+end
13727+
13728+defmodule Unsafe do
13729+ @enforce_keys [:unsafe]
13730+ defstruct [:unsafe]
13731+
13732+ @type t :: %__MODULE__{
13733+ unsafe: integer()
13734+ }
13735+
13736+ def decode_unsafe(value) when is_integer(value), do: value
13737+ def decode_unsafe(_), do: {:error, "Unexpected type when decoding Unsafe.unsafe"}
13738+
13739+ def encode_unsafe(value) when is_integer(value), do: value
13740+ def encode_unsafe(_), do: {:error, "Unexpected type when encoding Unsafe.unsafe"}
13741+
13742+ def from_map(m) do
13743+ %Unsafe{
13744+ unsafe: decode_unsafe(m["unsafe"]),
13745+ }
13746+ end
13747+
13748+ def from_json(json) do
13749+ json
13750+ |> Jason.decode!()
13751+ |> from_map()
13752+ end
13753+
13754+ def to_map(struct) do
13755+ %{
13756+ "unsafe" => struct.unsafe,
1376313757 }
1376413758 end
1376513759
@@ -13809,6 +13803,45 @@ defmodule Unsigned do
1380913803 end
1381013804 end
1381113805
13806+defmodule UseSerializers do
13807+ @enforce_keys [:use_serializers]
13808+ defstruct [:use_serializers]
13809+
13810+ @type t :: %__MODULE__{
13811+ use_serializers: integer()
13812+ }
13813+
13814+ def decode_use_serializers(value) when is_integer(value), do: value
13815+ def decode_use_serializers(_), do: {:error, "Unexpected type when decoding UseSerializers.use_serializers"}
13816+
13817+ def encode_use_serializers(value) when is_integer(value), do: value
13818+ def encode_use_serializers(_), do: {:error, "Unexpected type when encoding UseSerializers.use_serializers"}
13819+
13820+ def from_map(m) do
13821+ %UseSerializers{
13822+ use_serializers: decode_use_serializers(m["UseSerializers"]),
13823+ }
13824+ end
13825+
13826+ def from_json(json) do
13827+ json
13828+ |> Jason.decode!()
13829+ |> from_map()
13830+ end
13831+
13832+ def to_map(struct) do
13833+ %{
13834+ "UseSerializers" => struct.use_serializers,
13835+ }
13836+ end
13837+
13838+ def to_json(struct) do
13839+ struct
13840+ |> to_map()
13841+ |> Jason.encode!()
13842+ end
13843+end
13844+
1381213845 defmodule Ushort do
1381313846 @enforce_keys [:ushort]
1381413847 defstruct [:ushort]
@@ -14551,12 +14584,15 @@ defmodule Yield do
1455114584 end
1455214585
1455314586 defmodule Obj6 do
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]
14587+ @enforce_keys [:dummy, :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]
14588+ defstruct [:dummy, :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]
1455614589
1455714590 @type t :: %__MODULE__{
1455814591 dummy: integer(),
14592+ unowned: Unowned.t(),
14593+ unsafe: Unsafe.t(),
1455914594 unsigned: Unsigned.t(),
14595+ use_serializers: UseSerializers.t(),
1456014596 ushort: Ushort.t(),
1456114597 using: Using.t(),
1456214598 utf8_json_reader: Utf8JSONReader.t(),
@@ -14587,7 +14623,10 @@ defmodule Obj6 do
1458714623 def from_map(m) do
1458814624 %Obj6{
1458914625 dummy: decode_dummy(m["dummy"]),
14626+ unowned: Unowned.from_map(m["unowned"]),
14627+ unsafe: Unsafe.from_map(m["unsafe"]),
1459014628 unsigned: Unsigned.from_map(m["unsigned"]),
14629+ use_serializers: UseSerializers.from_map(m["UseSerializers"]),
1459114630 ushort: Ushort.from_map(m["ushort"]),
1459214631 using: Using.from_map(m["using"]),
1459314632 utf8_json_reader: Utf8JSONReader.from_map(m["Utf8JsonReader"]),
@@ -14619,7 +14658,10 @@ defmodule Obj6 do
1461914658 def to_map(struct) do
1462014659 %{
1462114660 "dummy" => struct.dummy,
14661+ "unowned" => Unowned.to_map(struct.unowned),
14662+ "unsafe" => Unsafe.to_map(struct.unsafe),
1462214663 "unsigned" => Unsigned.to_map(struct.unsigned),
14664+ "UseSerializers" => UseSerializers.to_map(struct.use_serializers),
1462314665 "ushort" => Ushort.to_map(struct.ushort),
1462414666 "using" => Using.to_map(struct.using),
1462514667 "Utf8JsonReader" => Utf8JSONReader.to_map(struct.utf8_json_reader),
Melmdefault / QuickType.elm+152 −133
@@ -192,6 +192,7 @@ module QuickType exposing
192192 , Locale
193193 , Lock
194194 , Long
195+ , MakeDictEncoder
195196 , Map
196197 , MapEntry
197198 , MarshalJSON
@@ -202,8 +203,6 @@ module QuickType exposing
202203 , Native
203204 , New
204205 , Newtonsoft
205- , Nil
206- , No
207206 , If
208207 , Import
209208 , In
@@ -212,6 +211,8 @@ module QuickType exposing
212211 , Let
213212 , Module
214213 , Obj4
214+ , Nil
215+ , No
215216 , NoSuchMethod
216217 , Noexcept
217218 , Nonatomic
@@ -274,8 +275,6 @@ module QuickType exposing
274275 , RuntimeType
275276 , S
276277 , Sbyte
277- , Sealed
278- , Sel
279278 , Obj5
280279 , KSerializer
281280 , SelfClass
@@ -285,6 +284,8 @@ module QuickType exposing
285284 , Type
286285 , PrimitiveKind
287286 , TypeClass
287+ , Sealed
288+ , Sel
288289 , Select
289290 , Self
290291 , Sendable
@@ -339,12 +340,12 @@ module QuickType exposing
339340 , Undefined
340341 , Union
341342 , UnmarshalJSON
342- , Unowned
343- , Unsafe
344- , UseSerializers
345343 , Obj6
346344 , Where
345+ , Unowned
346+ , Unsafe
347347 , Unsigned
348+ , UseSerializers
348349 , Ushort
349350 , Using
350351 , Utf8JSONReader
@@ -1081,6 +1082,7 @@ type alias Obj3 =
10811082 , locale : Locale
10821083 , lock : Lock
10831084 , long : Long
1085+ , makeDictEncoder : MakeDictEncoder
10841086 , map : Map
10851087 , mapEntry : MapEntry
10861088 , marshalJSON : MarshalJSON
@@ -1091,8 +1093,6 @@ type alias Obj3 =
10911093 , native : Native
10921094 , new : New
10931095 , newtonsoft : Newtonsoft
1094- , nil : Nil
1095- , no : No
10961096 , obj3If : If
10971097 , obj3Import : Import
10981098 , obj3In : In
@@ -1286,6 +1286,10 @@ type alias Long =
12861286 { long : Int
12871287 }
12881288
1289+type alias MakeDictEncoder =
1290+ { makeDictEncoder : Int
1291+ }
1292+
12891293 type alias Map =
12901294 { map : Int
12911295 }
@@ -1326,14 +1330,6 @@ type alias Newtonsoft =
13261330 { newtonsoft : Int
13271331 }
13281332
1329-type alias Nil =
1330- { nil : Int
1331- }
1332-
1333-type alias No =
1334- { no : Int
1335- }
1336-
13371333 type alias If =
13381334 { ifIf : Int
13391335 }
@@ -1364,6 +1360,8 @@ type alias Module =
13641360
13651361 type alias Obj4 =
13661362 { dummy : Int
1363+ , nil : Nil
1364+ , no : No
13671365 , noSuchMethod : NoSuchMethod
13681366 , noexcept : Noexcept
13691367 , nonatomic : Nonatomic
@@ -1426,8 +1424,14 @@ type alias Obj4 =
14261424 , runtimeType : RuntimeType
14271425 , s : S
14281426 , sbyte : Sbyte
1429- , sealed : Sealed
1430- , sel : Sel
1427+ }
1428+
1429+type alias Nil =
1430+ { nil : Int
1431+ }
1432+
1433+type alias No =
1434+ { no : Int
14311435 }
14321436
14331437 type alias NoSuchMethod =
@@ -1678,14 +1682,6 @@ type alias Sbyte =
16781682 { sbyte : Int
16791683 }
16801684
1681-type alias Sealed =
1682- { sealed : Int
1683- }
1684-
1685-type alias Sel =
1686- { sel : Int
1687- }
1688-
16891685 type alias Obj5 =
16901686 { dummy : Int
16911687 , kSerializer : KSerializer
@@ -1696,6 +1692,8 @@ type alias Obj5 =
16961692 , obj5Type : Type
16971693 , primitiveKind : PrimitiveKind
16981694 , purpleType : TypeClass
1695+ , sealed : Sealed
1696+ , sel : Sel
16991697 , select : Select
17001698 , self : Self
17011699 , sendable : Sendable
@@ -1750,9 +1748,6 @@ type alias Obj5 =
17501748 , undefined : Undefined
17511749 , union : Union
17521750 , unmarshalJSON : UnmarshalJSON
1753- , unowned : Unowned
1754- , unsafe : Unsafe
1755- , useSerializers : UseSerializers
17561751 }
17571752
17581753 type alias KSerializer =
@@ -1787,6 +1782,14 @@ type alias TypeClass =
17871782 { typeType : Int
17881783 }
17891784
1785+type alias Sealed =
1786+ { sealed : Int
1787+ }
1788+
1789+type alias Sel =
1790+ { sel : Int
1791+ }
1792+
17901793 type alias Select =
17911794 { select : Int
17921795 }
@@ -2003,22 +2006,13 @@ type alias UnmarshalJSON =
20032006 { unmarshalJSON : Int
20042007 }
20052008
2006-type alias Unowned =
2007- { unowned : Int
2008- }
2009-
2010-type alias Unsafe =
2011- { unsafe : Int
2012- }
2013-
2014-type alias UseSerializers =
2015- { useSerializers : Int
2016- }
2017-
20182009 type alias Obj6 =
20192010 { dummy : Int
20202011 , obj6Where : Where
2012+ , unowned : Unowned
2013+ , unsafe : Unsafe
20212014 , unsigned : Unsigned
2015+ , useSerializers : UseSerializers
20222016 , ushort : Ushort
20232017 , using : Using
20242018 , utf8JSONReader : Utf8JSONReader
@@ -2043,10 +2037,22 @@ type alias Where =
20432037 { whereWhere : Int
20442038 }
20452039
2040+type alias Unowned =
2041+ { unowned : Int
2042+ }
2043+
2044+type alias Unsafe =
2045+ { unsafe : Int
2046+ }
2047+
20462048 type alias Unsigned =
20472049 { unsigned : Int
20482050 }
20492051
2052+type alias UseSerializers =
2053+ { useSerializers : Int
2054+ }
2055+
20502056 type alias Ushort =
20512057 { ushort : Int
20522058 }
@@ -3904,6 +3910,7 @@ obj3 =
39043910 |> Jpipe.required "Locale" locale
39053911 |> Jpipe.required "lock" lock
39063912 |> Jpipe.required "long" long
3913+ |> Jpipe.required "makeDictEncoder" makeDictEncoder
39073914 |> Jpipe.required "map" map
39083915 |> Jpipe.required "MapEntry" mapEntry
39093916 |> Jpipe.required "MarshalJSON" marshalJSON
@@ -3914,8 +3921,6 @@ obj3 =
39143921 |> Jpipe.required "native" native
39153922 |> Jpipe.required "new" new
39163923 |> Jpipe.required "newtonsoft" newtonsoft
3917- |> Jpipe.required "nil" nil
3918- |> Jpipe.required "NO" no
39193924 |> Jpipe.required "if" purpleIf
39203925 |> Jpipe.required "import" purpleImport
39213926 |> Jpipe.required "in" purpleIn
@@ -3974,6 +3979,7 @@ encodeObj3 x =
39743979 , ("Locale", encodeLocale x.locale)
39753980 , ("lock", encodeLock x.lock)
39763981 , ("long", encodeLong x.long)
3982+ , ("makeDictEncoder", encodeMakeDictEncoder x.makeDictEncoder)
39773983 , ("map", encodeMap x.map)
39783984 , ("MapEntry", encodeMapEntry x.mapEntry)
39793985 , ("MarshalJSON", encodeMarshalJSON x.marshalJSON)
@@ -3984,8 +3990,6 @@ encodeObj3 x =
39843990 , ("native", encodeNative x.native)
39853991 , ("new", encodeNew x.new)
39863992 , ("newtonsoft", encodeNewtonsoft x.newtonsoft)
3987- , ("nil", encodeNil x.nil)
3988- , ("NO", encodeNo x.no)
39893993 , ("if", encodeIf x.obj3If)
39903994 , ("import", encodeImport x.obj3Import)
39913995 , ("in", encodeIn x.obj3In)
@@ -4501,6 +4505,17 @@ encodeLong x =
45014505 [ ("long", Jenc.int x.long)
45024506 ]
45034507
4508+makeDictEncoder : Jdec.Decoder MakeDictEncoder
4509+makeDictEncoder =
4510+ Jdec.succeed MakeDictEncoder
4511+ |> Jpipe.required "makeDictEncoder" Jdec.int
4512+
4513+encodeMakeDictEncoder : MakeDictEncoder -> Jenc.Value
4514+encodeMakeDictEncoder x =
4515+ Jenc.object
4516+ [ ("makeDictEncoder", Jenc.int x.makeDictEncoder)
4517+ ]
4518+
45044519 map : Jdec.Decoder Map
45054520 map =
45064521 Jdec.succeed Map
@@ -4611,28 +4626,6 @@ encodeNewtonsoft x =
46114626 [ ("newtonsoft", Jenc.int x.newtonsoft)
46124627 ]
46134628
4614-nil : Jdec.Decoder Nil
4615-nil =
4616- Jdec.succeed Nil
4617- |> Jpipe.required "nil" Jdec.int
4618-
4619-encodeNil : Nil -> Jenc.Value
4620-encodeNil x =
4621- Jenc.object
4622- [ ("nil", Jenc.int x.nil)
4623- ]
4624-
4625-no : Jdec.Decoder No
4626-no =
4627- Jdec.succeed No
4628- |> Jpipe.required "NO" Jdec.int
4629-
4630-encodeNo : No -> Jenc.Value
4631-encodeNo x =
4632- Jenc.object
4633- [ ("NO", Jenc.int x.no)
4634- ]
4635-
46364629 purpleIf : Jdec.Decoder If
46374630 purpleIf =
46384631 Jdec.succeed If
@@ -4714,6 +4707,8 @@ obj4 : Jdec.Decoder Obj4
47144707 obj4 =
47154708 Jdec.succeed Obj4
47164709 |> Jpipe.required "dummy" Jdec.int
4710+ |> Jpipe.required "nil" nil
4711+ |> Jpipe.required "NO" no
47174712 |> Jpipe.required "noSuchMethod" noSuchMethod
47184713 |> Jpipe.required "noexcept" noexcept
47194714 |> Jpipe.required "nonatomic" nonatomic
@@ -4776,13 +4771,13 @@ obj4 =
47764771 |> Jpipe.required "runtimeType" runtimeType
47774772 |> Jpipe.required "s" s
47784773 |> Jpipe.required "sbyte" sbyte
4779- |> Jpipe.required "sealed" sealed
4780- |> Jpipe.required "SEL" sel
47814774
47824775 encodeObj4 : Obj4 -> Jenc.Value
47834776 encodeObj4 x =
47844777 Jenc.object
47854778 [ ("dummy", Jenc.int x.dummy)
4779+ , ("nil", encodeNil x.nil)
4780+ , ("NO", encodeNo x.no)
47864781 , ("noSuchMethod", encodeNoSuchMethod x.noSuchMethod)
47874782 , ("noexcept", encodeNoexcept x.noexcept)
47884783 , ("nonatomic", encodeNonatomic x.nonatomic)
@@ -4845,8 +4840,28 @@ encodeObj4 x =
48454840 , ("runtimeType", encodeRuntimeType x.runtimeType)
48464841 , ("s", encodeS x.s)
48474842 , ("sbyte", encodeSbyte x.sbyte)
4848- , ("sealed", encodeSealed x.sealed)
4849- , ("SEL", encodeSel x.sel)
4843+ ]
4844+
4845+nil : Jdec.Decoder Nil
4846+nil =
4847+ Jdec.succeed Nil
4848+ |> Jpipe.required "nil" Jdec.int
4849+
4850+encodeNil : Nil -> Jenc.Value
4851+encodeNil x =
4852+ Jenc.object
4853+ [ ("nil", Jenc.int x.nil)
4854+ ]
4855+
4856+no : Jdec.Decoder No
4857+no =
4858+ Jdec.succeed No
4859+ |> Jpipe.required "NO" Jdec.int
4860+
4861+encodeNo : No -> Jenc.Value
4862+encodeNo x =
4863+ Jenc.object
4864+ [ ("NO", Jenc.int x.no)
48504865 ]
48514866
48524867 noSuchMethod : Jdec.Decoder NoSuchMethod
@@ -5531,28 +5546,6 @@ encodeSbyte x =
55315546 [ ("sbyte", Jenc.int x.sbyte)
55325547 ]
55335548
5534-sealed : Jdec.Decoder Sealed
5535-sealed =
5536- Jdec.succeed Sealed
5537- |> Jpipe.required "sealed" Jdec.int
5538-
5539-encodeSealed : Sealed -> Jenc.Value
5540-encodeSealed x =
5541- Jenc.object
5542- [ ("sealed", Jenc.int x.sealed)
5543- ]
5544-
5545-sel : Jdec.Decoder Sel
5546-sel =
5547- Jdec.succeed Sel
5548- |> Jpipe.required "SEL" Jdec.int
5549-
5550-encodeSel : Sel -> Jenc.Value
5551-encodeSel x =
5552- Jenc.object
5553- [ ("SEL", Jenc.int x.sel)
5554- ]
5555-
55565549 obj5 : Jdec.Decoder Obj5
55575550 obj5 =
55585551 Jdec.succeed Obj5
@@ -5565,6 +5558,8 @@ obj5 =
55655558 |> Jpipe.required "Type" purpleType
55665559 |> Jpipe.required "PrimitiveKind" primitiveKind
55675560 |> Jpipe.required "type" typeClass
5561+ |> Jpipe.required "sealed" sealed
5562+ |> Jpipe.required "SEL" sel
55685563 |> Jpipe.required "select" select
55695564 |> Jpipe.required "Self" self
55705565 |> Jpipe.required "Sendable" sendable
@@ -5619,9 +5614,6 @@ obj5 =
56195614 |> Jpipe.required "undefined" undefined
56205615 |> Jpipe.required "union" union
56215616 |> Jpipe.required "UnmarshalJSON" unmarshalJSON
5622- |> Jpipe.required "unowned" unowned
5623- |> Jpipe.required "unsafe" unsafe
5624- |> Jpipe.required "UseSerializers" useSerializers
56255617
56265618 encodeObj5 : Obj5 -> Jenc.Value
56275619 encodeObj5 x =
@@ -5635,6 +5627,8 @@ encodeObj5 x =
56355627 , ("Type", encodeType x.obj5Type)
56365628 , ("PrimitiveKind", encodePrimitiveKind x.primitiveKind)
56375629 , ("type", encodeTypeClass x.purpleType)
5630+ , ("sealed", encodeSealed x.sealed)
5631+ , ("SEL", encodeSel x.sel)
56385632 , ("select", encodeSelect x.select)
56395633 , ("Self", encodeSelf x.self)
56405634 , ("Sendable", encodeSendable x.sendable)
@@ -5689,9 +5683,6 @@ encodeObj5 x =
56895683 , ("undefined", encodeUndefined x.undefined)
56905684 , ("union", encodeUnion x.union)
56915685 , ("UnmarshalJSON", encodeUnmarshalJSON x.unmarshalJSON)
5692- , ("unowned", encodeUnowned x.unowned)
5693- , ("unsafe", encodeUnsafe x.unsafe)
5694- , ("UseSerializers", encodeUseSerializers x.useSerializers)
56955686 ]
56965687
56975688 kSerializer : Jdec.Decoder KSerializer
@@ -5782,6 +5773,28 @@ encodeTypeClass x =
57825773 [ ("type", Jenc.int x.typeType)
57835774 ]
57845775
5776+sealed : Jdec.Decoder Sealed
5777+sealed =
5778+ Jdec.succeed Sealed
5779+ |> Jpipe.required "sealed" Jdec.int
5780+
5781+encodeSealed : Sealed -> Jenc.Value
5782+encodeSealed x =
5783+ Jenc.object
5784+ [ ("sealed", Jenc.int x.sealed)
5785+ ]
5786+
5787+sel : Jdec.Decoder Sel
5788+sel =
5789+ Jdec.succeed Sel
5790+ |> Jpipe.required "SEL" Jdec.int
5791+
5792+encodeSel : Sel -> Jenc.Value
5793+encodeSel x =
5794+ Jenc.object
5795+ [ ("SEL", Jenc.int x.sel)
5796+ ]
5797+
57855798 select : Jdec.Decoder Select
57865799 select =
57875800 Jdec.succeed Select
@@ -6376,45 +6389,15 @@ encodeUnmarshalJSON x =
63766389 [ ("UnmarshalJSON", Jenc.int x.unmarshalJSON)
63776390 ]
63786391
6379-unowned : Jdec.Decoder Unowned
6380-unowned =
6381- Jdec.succeed Unowned
6382- |> Jpipe.required "unowned" Jdec.int
6383-
6384-encodeUnowned : Unowned -> Jenc.Value
6385-encodeUnowned x =
6386- Jenc.object
6387- [ ("unowned", Jenc.int x.unowned)
6388- ]
6389-
6390-unsafe : Jdec.Decoder Unsafe
6391-unsafe =
6392- Jdec.succeed Unsafe
6393- |> Jpipe.required "unsafe" Jdec.int
6394-
6395-encodeUnsafe : Unsafe -> Jenc.Value
6396-encodeUnsafe x =
6397- Jenc.object
6398- [ ("unsafe", Jenc.int x.unsafe)
6399- ]
6400-
6401-useSerializers : Jdec.Decoder UseSerializers
6402-useSerializers =
6403- Jdec.succeed UseSerializers
6404- |> Jpipe.required "UseSerializers" Jdec.int
6405-
6406-encodeUseSerializers : UseSerializers -> Jenc.Value
6407-encodeUseSerializers x =
6408- Jenc.object
6409- [ ("UseSerializers", Jenc.int x.useSerializers)
6410- ]
6411-
64126392 obj6 : Jdec.Decoder Obj6
64136393 obj6 =
64146394 Jdec.succeed Obj6
64156395 |> Jpipe.required "dummy" Jdec.int
64166396 |> Jpipe.required "where" purpleWhere
6397+ |> Jpipe.required "unowned" unowned
6398+ |> Jpipe.required "unsafe" unsafe
64176399 |> Jpipe.required "unsigned" unsigned
6400+ |> Jpipe.required "UseSerializers" useSerializers
64186401 |> Jpipe.required "ushort" ushort
64196402 |> Jpipe.required "using" using
64206403 |> Jpipe.required "Utf8JsonReader" utf8JSONReader
@@ -6439,7 +6422,10 @@ encodeObj6 x =
64396422 Jenc.object
64406423 [ ("dummy", Jenc.int x.dummy)
64416424 , ("where", encodeWhere x.obj6Where)
6425+ , ("unowned", encodeUnowned x.unowned)
6426+ , ("unsafe", encodeUnsafe x.unsafe)
64426427 , ("unsigned", encodeUnsigned x.unsigned)
6428+ , ("UseSerializers", encodeUseSerializers x.useSerializers)
64436429 , ("ushort", encodeUshort x.ushort)
64446430 , ("using", encodeUsing x.using)
64456431 , ("Utf8JsonReader", encodeUtf8JSONReader x.utf8JSONReader)
@@ -6471,6 +6457,28 @@ encodeWhere x =
64716457 [ ("where", Jenc.int x.whereWhere)
64726458 ]
64736459
6460+unowned : Jdec.Decoder Unowned
6461+unowned =
6462+ Jdec.succeed Unowned
6463+ |> Jpipe.required "unowned" Jdec.int
6464+
6465+encodeUnowned : Unowned -> Jenc.Value
6466+encodeUnowned x =
6467+ Jenc.object
6468+ [ ("unowned", Jenc.int x.unowned)
6469+ ]
6470+
6471+unsafe : Jdec.Decoder Unsafe
6472+unsafe =
6473+ Jdec.succeed Unsafe
6474+ |> Jpipe.required "unsafe" Jdec.int
6475+
6476+encodeUnsafe : Unsafe -> Jenc.Value
6477+encodeUnsafe x =
6478+ Jenc.object
6479+ [ ("unsafe", Jenc.int x.unsafe)
6480+ ]
6481+
64746482 unsigned : Jdec.Decoder Unsigned
64756483 unsigned =
64766484 Jdec.succeed Unsigned
@@ -6482,6 +6490,17 @@ encodeUnsigned x =
64826490 [ ("unsigned", Jenc.int x.unsigned)
64836491 ]
64846492
6493+useSerializers : Jdec.Decoder UseSerializers
6494+useSerializers =
6495+ Jdec.succeed UseSerializers
6496+ |> Jpipe.required "UseSerializers" Jdec.int
6497+
6498+encodeUseSerializers : UseSerializers -> Jenc.Value
6499+encodeUseSerializers x =
6500+ Jenc.object
6501+ [ ("UseSerializers", Jenc.int x.useSerializers)
6502+ ]
6503+
64856504 ushort : Jdec.Decoder Ushort
64866505 ushort =
64876506 Jdec.succeed Ushort
Mflowdefault / TopLevel.js+68 −59
@@ -690,7 +690,6 @@ export type Obj3 = {
690690 Locale: Locale;
691691 MapEntry: MapEntry;
692692 MarshalJSON: MarshalJSON;
693- NO: No;
694693 dummy: number;
695694 goto: Goto;
696695 guard: Guard;
@@ -728,6 +727,7 @@ export type Obj3 = {
728727 list: List;
729728 lock: Lock;
730729 long: Long;
730+ makeDictEncoder: MakeDictEncoder;
731731 map: Map;
732732 metadata_property_handling: MetadataPropertyHandling;
733733 module: Module;
@@ -737,7 +737,6 @@ export type Obj3 = {
737737 native: Native;
738738 new: New;
739739 newtonsoft: Newtonsoft;
740- nil: Nil;
741740 };
742741
743742 export type Hashable = {
@@ -812,10 +811,6 @@ export type MarshalJSON = {
812811 MarshalJSON: number;
813812 };
814813
815-export type No = {
816- NO: number;
817-};
818-
819814 export type Goto = {
820815 goto: number;
821816 };
@@ -960,6 +955,10 @@ export type Long = {
960955 long: number;
961956 };
962957
958+export type MakeDictEncoder = {
959+ makeDictEncoder: number;
960+};
961+
963962 export type Map = {
964963 map: number;
965964 };
@@ -996,11 +995,8 @@ export type Newtonsoft = {
996995 newtonsoft: number;
997996 };
998997
999-export type Nil = {
1000- nil: number;
1001-};
1002-
1003998 export type Obj4 = {
999+ NO: No;
10041000 NSError: NSError;
10051001 NSObject: NSObject;
10061002 NSString: NSString;
@@ -1009,8 +1005,8 @@ export type Obj4 = {
10091005 ObjectMapper: ObjectMapper;
10101006 Protocol: Protocol;
10111007 RegExp: RegExpClass;
1012- SEL: Sel;
10131008 dummy: number;
1009+ nil: Nil;
10141010 noSuchMethod: NoSuchMethod;
10151011 noexcept: Noexcept;
10161012 nonatomic: Nonatomic;
@@ -1065,7 +1061,10 @@ export type Obj4 = {
10651061 runtimeType: RuntimeType;
10661062 s: S;
10671063 sbyte: Sbyte;
1068- sealed: Sealed;
1064+};
1065+
1066+export type No = {
1067+ NO: number;
10691068 };
10701069
10711070 export type NSError = {
@@ -1100,8 +1099,8 @@ export type RegExpClass = {
11001099 RegExp: string;
11011100 };
11021101
1103-export type Sel = {
1104- SEL: number;
1102+export type Nil = {
1103+ nil: number;
11051104 };
11061105
11071106 export type NoSuchMethod = {
@@ -1320,13 +1319,10 @@ export type Sbyte = {
13201319 sbyte: number;
13211320 };
13221321
1323-export type Sealed = {
1324- sealed: number;
1325-};
1326-
13271322 export type Obj5 = {
13281323 KSerializer: KSerializer;
13291324 PrimitiveKind: PrimitiveKind;
1325+ SEL: Sel;
13301326 Self: Self;
13311327 Sendable: Sendable;
13321328 SerialDescriptor: SerialDescriptor;
@@ -1343,8 +1339,8 @@ export type Obj5 = {
13431339 True: True;
13441340 Type: Type;
13451341 UnmarshalJSON: UnmarshalJSON;
1346- UseSerializers: UseSerializers;
13471342 dummy: number;
1343+ sealed: Sealed;
13481344 select: Select;
13491345 self: SelfClass;
13501346 serialize: Serialize;
@@ -1389,8 +1385,6 @@ export type Obj5 = {
13891385 unchecked: Unchecked;
13901386 undefined: Undefined;
13911387 union: Union;
1392- unowned: Unowned;
1393- unsafe: Unsafe;
13941388 };
13951389
13961390 export type KSerializer = {
@@ -1401,6 +1395,10 @@ export type PrimitiveKind = {
14011395 PrimitiveKind: number;
14021396 };
14031397
1398+export type Sel = {
1399+ SEL: number;
1400+};
1401+
14041402 export type Self = {
14051403 Self: number;
14061404 };
@@ -1465,8 +1463,8 @@ export type UnmarshalJSON = {
14651463 UnmarshalJSON: number;
14661464 };
14671465
1468-export type UseSerializers = {
1469- UseSerializers: number;
1466+export type Sealed = {
1467+ sealed: number;
14701468 };
14711469
14721470 export type Select = {
@@ -1645,20 +1643,15 @@ export type Union = {
16451643 union: number;
16461644 };
16471645
1648-export type Unowned = {
1649- unowned: number;
1650-};
1651-
1652-export type Unsafe = {
1653- unsafe: number;
1654-};
1655-
16561646 export type Obj6 = {
16571647 UUID: UUID;
1648+ UseSerializers: UseSerializers;
16581649 Utf8JsonReader: Utf8JSONReader;
16591650 Utf8JsonWriter: Utf8JSONWriter;
16601651 YES: Yes;
16611652 dummy: number;
1653+ unowned: Unowned;
1654+ unsafe: Unsafe;
16621655 unsigned: Unsigned;
16631656 ushort: Ushort;
16641657 using: Using;
@@ -1681,6 +1674,10 @@ export type UUID = {
16811674 UUID: number;
16821675 };
16831676
1677+export type UseSerializers = {
1678+ UseSerializers: number;
1679+};
1680+
16841681 export type Utf8JSONReader = {
16851682 Utf8JsonReader: number;
16861683 };
@@ -1693,6 +1690,14 @@ export type Yes = {
16931690 YES: number;
16941691 };
16951692
1693+export type Unowned = {
1694+ unowned: number;
1695+};
1696+
1697+export type Unsafe = {
1698+ unsafe: number;
1699+};
1700+
16961701 export type Unsigned = {
16971702 unsigned: number;
16981703 };
@@ -1851,7 +1856,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
18511856 if (val === null || typeof val !== "object" || Array.isArray(val)) {
18521857 return invalidValue(l(ref || "object"), val, key, parent);
18531858 }
1854- const result: any = {};
1859+ const result: any = Object.create(null);
18551860 Object.getOwnPropertyNames(props).forEach(key => {
18561861 const prop = props[key];
18571862 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -1862,7 +1867,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
18621867 result[key] = transform(val[key], additional, getProps, key, ref);
18631868 }
18641869 });
1865- return result;
1870+ return Object.setPrototypeOf(result, Object.prototype);
18661871 }
18671872
18681873 if (typ === "any") return val;
@@ -2489,7 +2494,6 @@ const typeMap: any = {
24892494 { json: "Locale", js: "Locale", typ: r("Locale") },
24902495 { json: "MapEntry", js: "MapEntry", typ: r("MapEntry") },
24912496 { json: "MarshalJSON", js: "MarshalJSON", typ: r("MarshalJSON") },
2492- { json: "NO", js: "NO", typ: r("No") },
24932497 { json: "dummy", js: "dummy", typ: i(0) },
24942498 { json: "goto", js: "goto", typ: r("Goto") },
24952499 { json: "guard", js: "guard", typ: r("Guard") },
@@ -2527,6 +2531,7 @@ const typeMap: any = {
25272531 { json: "list", js: "list", typ: r("List") },
25282532 { json: "lock", js: "lock", typ: r("Lock") },
25292533 { json: "long", js: "long", typ: r("Long") },
2534+ { json: "makeDictEncoder", js: "makeDictEncoder", typ: r("MakeDictEncoder") },
25302535 { json: "map", js: "map", typ: r("Map") },
25312536 { json: "metadata_property_handling", js: "metadata_property_handling", typ: r("MetadataPropertyHandling") },
25322537 { json: "module", js: "module", typ: r("Module") },
@@ -2536,7 +2541,6 @@ const typeMap: any = {
25362541 { json: "native", js: "native", typ: r("Native") },
25372542 { json: "new", js: "new", typ: r("New") },
25382543 { json: "newtonsoft", js: "newtonsoft", typ: r("Newtonsoft") },
2539- { json: "nil", js: "nil", typ: r("Nil") },
25402544 ], false),
25412545 "Hashable": o([
25422546 { json: "Hashable", js: "Hashable", typ: i(0) },
@@ -2592,9 +2596,6 @@ const typeMap: any = {
25922596 "MarshalJSON": o([
25932597 { json: "MarshalJSON", js: "MarshalJSON", typ: i(0) },
25942598 ], false),
2595- "No": o([
2596- { json: "NO", js: "NO", typ: i(0) },
2597- ], false),
25982599 "Goto": o([
25992600 { json: "goto", js: "goto", typ: i(0) },
26002601 ], false),
@@ -2703,6 +2704,9 @@ const typeMap: any = {
27032704 "Long": o([
27042705 { json: "long", js: "long", typ: i(0) },
27052706 ], false),
2707+ "MakeDictEncoder": o([
2708+ { json: "makeDictEncoder", js: "makeDictEncoder", typ: i(0) },
2709+ ], false),
27062710 "Map": o([
27072711 { json: "map", js: "map", typ: i(0) },
27082712 ], false),
@@ -2730,10 +2734,8 @@ const typeMap: any = {
27302734 "Newtonsoft": o([
27312735 { json: "newtonsoft", js: "newtonsoft", typ: i(0) },
27322736 ], false),
2733- "Nil": o([
2734- { json: "nil", js: "nil", typ: i(0) },
2735- ], false),
27362737 "Obj4": o([
2738+ { json: "NO", js: "NO", typ: r("No") },
27372739 { json: "NSError", js: "NSError", typ: r("NSError") },
27382740 { json: "NSObject", js: "NSObject", typ: r("NSObject") },
27392741 { json: "NSString", js: "NSString", typ: r("NSString") },
@@ -2742,8 +2744,8 @@ const typeMap: any = {
27422744 { json: "ObjectMapper", js: "ObjectMapper", typ: r("ObjectMapper") },
27432745 { json: "Protocol", js: "Protocol", typ: r("Protocol") },
27442746 { json: "RegExp", js: "RegExp", typ: r("RegExpClass") },
2745- { json: "SEL", js: "SEL", typ: r("Sel") },
27462747 { json: "dummy", js: "dummy", typ: i(0) },
2748+ { json: "nil", js: "nil", typ: r("Nil") },
27472749 { json: "noSuchMethod", js: "noSuchMethod", typ: r("NoSuchMethod") },
27482750 { json: "noexcept", js: "noexcept", typ: r("Noexcept") },
27492751 { json: "nonatomic", js: "nonatomic", typ: r("Nonatomic") },
@@ -2798,7 +2800,9 @@ const typeMap: any = {
27982800 { json: "runtimeType", js: "runtimeType", typ: r("RuntimeType") },
27992801 { json: "s", js: "s", typ: r("S") },
28002802 { json: "sbyte", js: "sbyte", typ: r("Sbyte") },
2801- { json: "sealed", js: "sealed", typ: r("Sealed") },
2803+ ], false),
2804+ "No": o([
2805+ { json: "NO", js: "NO", typ: i(0) },
28022806 ], false),
28032807 "NSError": o([
28042808 { json: "NSError", js: "NSError", typ: i(0) },
@@ -2824,8 +2828,8 @@ const typeMap: any = {
28242828 "RegExpClass": o([
28252829 { json: "RegExp", js: "RegExp", typ: { uuid: "" } },
28262830 ], false),
2827- "Sel": o([
2828- { json: "SEL", js: "SEL", typ: i(0) },
2831+ "Nil": o([
2832+ { json: "nil", js: "nil", typ: i(0) },
28292833 ], false),
28302834 "NoSuchMethod": o([
28312835 { json: "noSuchMethod", js: "noSuchMethod", typ: i(0) },
@@ -2989,12 +2993,10 @@ const typeMap: any = {
29892993 "Sbyte": o([
29902994 { json: "sbyte", js: "sbyte", typ: i(0) },
29912995 ], false),
2992- "Sealed": o([
2993- { json: "sealed", js: "sealed", typ: i(0) },
2994- ], false),
29952996 "Obj5": o([
29962997 { json: "KSerializer", js: "KSerializer", typ: r("KSerializer") },
29972998 { json: "PrimitiveKind", js: "PrimitiveKind", typ: r("PrimitiveKind") },
2999+ { json: "SEL", js: "SEL", typ: r("Sel") },
29983000 { json: "Self", js: "Self", typ: r("Self") },
29993001 { json: "Sendable", js: "Sendable", typ: r("Sendable") },
30003002 { json: "SerialDescriptor", js: "SerialDescriptor", typ: r("SerialDescriptor") },
@@ -3011,8 +3013,8 @@ const typeMap: any = {
30113013 { json: "True", js: "True", typ: r("True") },
30123014 { json: "Type", js: "Type", typ: r("Type") },
30133015 { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: r("UnmarshalJSON") },
3014- { json: "UseSerializers", js: "UseSerializers", typ: r("UseSerializers") },
30153016 { json: "dummy", js: "dummy", typ: i(0) },
3017+ { json: "sealed", js: "sealed", typ: r("Sealed") },
30163018 { json: "select", js: "select", typ: r("Select") },
30173019 { json: "self", js: "self", typ: r("SelfClass") },
30183020 { json: "serialize", js: "serialize", typ: r("Serialize") },
@@ -3057,8 +3059,6 @@ const typeMap: any = {
30573059 { json: "unchecked", js: "unchecked", typ: r("Unchecked") },
30583060 { json: "undefined", js: "undefined", typ: r("Undefined") },
30593061 { json: "union", js: "union", typ: r("Union") },
3060- { json: "unowned", js: "unowned", typ: r("Unowned") },
3061- { json: "unsafe", js: "unsafe", typ: r("Unsafe") },
30623062 ], false),
30633063 "KSerializer": o([
30643064 { json: "KSerializer", js: "KSerializer", typ: i(0) },
@@ -3066,6 +3066,9 @@ const typeMap: any = {
30663066 "PrimitiveKind": o([
30673067 { json: "PrimitiveKind", js: "PrimitiveKind", typ: i(0) },
30683068 ], false),
3069+ "Sel": o([
3070+ { json: "SEL", js: "SEL", typ: i(0) },
3071+ ], false),
30693072 "Self": o([
30703073 { json: "Self", js: "Self", typ: i(0) },
30713074 ], false),
@@ -3114,8 +3117,8 @@ const typeMap: any = {
31143117 "UnmarshalJSON": o([
31153118 { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: i(0) },
31163119 ], false),
3117- "UseSerializers": o([
3118- { json: "UseSerializers", js: "UseSerializers", typ: i(0) },
3120+ "Sealed": o([
3121+ { json: "sealed", js: "sealed", typ: i(0) },
31193122 ], false),
31203123 "Select": o([
31213124 { json: "select", js: "select", typ: i(0) },
@@ -3249,18 +3252,15 @@ const typeMap: any = {
32493252 "Union": o([
32503253 { json: "union", js: "union", typ: i(0) },
32513254 ], false),
3252- "Unowned": o([
3253- { json: "unowned", js: "unowned", typ: i(0) },
3254- ], false),
3255- "Unsafe": o([
3256- { json: "unsafe", js: "unsafe", typ: i(0) },
3257- ], false),
32583255 "Obj6": o([
32593256 { json: "UUID", js: "UUID", typ: r("UUID") },
3257+ { json: "UseSerializers", js: "UseSerializers", typ: r("UseSerializers") },
32603258 { json: "Utf8JsonReader", js: "Utf8JsonReader", typ: r("Utf8JSONReader") },
32613259 { json: "Utf8JsonWriter", js: "Utf8JsonWriter", typ: r("Utf8JSONWriter") },
32623260 { json: "YES", js: "YES", typ: r("Yes") },
32633261 { json: "dummy", js: "dummy", typ: i(0) },
3262+ { json: "unowned", js: "unowned", typ: r("Unowned") },
3263+ { json: "unsafe", js: "unsafe", typ: r("Unsafe") },
32643264 { json: "unsigned", js: "unsigned", typ: r("Unsigned") },
32653265 { json: "ushort", js: "ushort", typ: r("Ushort") },
32663266 { json: "using", js: "using", typ: r("Using") },
@@ -3281,6 +3281,9 @@ const typeMap: any = {
32813281 "UUID": o([
32823282 { json: "UUID", js: "UUID", typ: i(0) },
32833283 ], false),
3284+ "UseSerializers": o([
3285+ { json: "UseSerializers", js: "UseSerializers", typ: i(0) },
3286+ ], false),
32843287 "Utf8JSONReader": o([
32853288 { json: "Utf8JsonReader", js: "Utf8JsonReader", typ: i(0) },
32863289 ], false),
@@ -3290,6 +3293,12 @@ const typeMap: any = {
32903293 "Yes": o([
32913294 { json: "YES", js: "YES", typ: i(0) },
32923295 ], false),
3296+ "Unowned": o([
3297+ { json: "unowned", js: "unowned", typ: i(0) },
3298+ ], false),
3299+ "Unsafe": o([
3300+ { json: "unsafe", js: "unsafe", typ: i(0) },
3301+ ], false),
32933302 "Unsigned": o([
32943303 { json: "unsigned", js: "unsigned", typ: i(0) },
32953304 ], false),
Mgolangdefault / quicktype.go+40 −35
@@ -732,6 +732,7 @@ type Obj3 struct {
732732 Locale Locale `json:"Locale"`
733733 Lock Lock `json:"lock"`
734734 Long Long `json:"long"`
735+ MakeDictEncoder MakeDictEncoder `json:"makeDictEncoder"`
735736 Map Map `json:"map"`
736737 MapEntry MapEntry `json:"MapEntry"`
737738 MarshalJSON MarshalJSON `json:"MarshalJSON"`
@@ -743,8 +744,6 @@ type Obj3 struct {
743744 Native Native `json:"native"`
744745 New New `json:"new"`
745746 Newtonsoft Newtonsoft `json:"newtonsoft"`
746- Nil Nil `json:"nil"`
747- No No `json:"NO"`
748747 }
749748
750749 type Goto struct {
@@ -955,6 +954,10 @@ type Long struct {
955954 Long int64 `json:"long"`
956955 }
957956
957+type MakeDictEncoder struct {
958+ MakeDictEncoder int64 `json:"makeDictEncoder"`
959+}
960+
958961 type Map struct {
959962 Map int64 `json:"map"`
960963 }
@@ -999,19 +1002,13 @@ type Newtonsoft struct {
9991002 Newtonsoft int64 `json:"newtonsoft"`
10001003 }
10011004
1002-type Nil struct {
1003- Nil int64 `json:"nil"`
1004-}
1005-
1006-type No struct {
1007- No int64 `json:"NO"`
1008-}
1009-
10101005 type Obj4 struct {
10111006 Dummy int64 `json:"dummy"`
10121007 NSError NSError `json:"NSError"`
10131008 NSObject NSObject `json:"NSObject"`
10141009 NSString NSString `json:"NSString"`
1010+ Nil Nil `json:"nil"`
1011+ No No `json:"NO"`
10151012 NoSuchMethod NoSuchMethod `json:"noSuchMethod"`
10161013 Noexcept Noexcept `json:"noexcept"`
10171014 Nonatomic Nonatomic `json:"nonatomic"`
@@ -1071,8 +1068,6 @@ type Obj4 struct {
10711068 RuntimeType RuntimeType `json:"runtimeType"`
10721069 S S `json:"s"`
10731070 Sbyte Sbyte `json:"sbyte"`
1074- Sealed Sealed `json:"sealed"`
1075- Sel Sel `json:"SEL"`
10761071 }
10771072
10781073 type NSError struct {
@@ -1087,6 +1082,14 @@ type NSString struct {
10871082 NSString int64 `json:"NSString"`
10881083 }
10891084
1085+type Nil struct {
1086+ Nil int64 `json:"nil"`
1087+}
1088+
1089+type No struct {
1090+ No int64 `json:"NO"`
1091+}
1092+
10901093 type NoSuchMethod struct {
10911094 NoSuchMethod int64 `json:"noSuchMethod"`
10921095 }
@@ -1323,14 +1326,6 @@ type Sbyte struct {
13231326 Sbyte int64 `json:"sbyte"`
13241327 }
13251328
1326-type Sealed struct {
1327- Sealed int64 `json:"sealed"`
1328-}
1329-
1330-type Sel struct {
1331- Sel int64 `json:"SEL"`
1332-}
1333-
13341329 type Obj5 struct {
13351330 Dummy int64 `json:"dummy"`
13361331 KSerializer KSerializer `json:"KSerializer"`
@@ -1338,6 +1333,8 @@ type Obj5 struct {
13381333 Obj5True TrueClass `json:"true"`
13391334 Obj5Type TypeClass `json:"type"`
13401335 PrimitiveKind PrimitiveKind `json:"PrimitiveKind"`
1336+ Sealed Sealed `json:"sealed"`
1337+ Sel Sel `json:"SEL"`
13411338 Select Select `json:"select"`
13421339 Self Self `json:"Self"`
13431340 Sendable Sendable `json:"Sendable"`
@@ -1395,9 +1392,6 @@ type Obj5 struct {
13951392 Undefined Undefined `json:"undefined"`
13961393 Union Union `json:"union"`
13971394 UnmarshalJSON UnmarshalJSON `json:"UnmarshalJSON"`
1398- Unowned Unowned `json:"unowned"`
1399- Unsafe Unsafe `json:"unsafe"`
1400- UseSerializers UseSerializers `json:"UseSerializers"`
14011395 }
14021396
14031397 type KSerializer struct {
@@ -1420,6 +1414,14 @@ type PrimitiveKind struct {
14201414 PrimitiveKind int64 `json:"PrimitiveKind"`
14211415 }
14221416
1417+type Sealed struct {
1418+ Sealed int64 `json:"sealed"`
1419+}
1420+
1421+type Sel struct {
1422+ Sel int64 `json:"SEL"`
1423+}
1424+
14231425 type Select struct {
14241426 Select int64 `json:"select"`
14251427 }
@@ -1648,22 +1650,13 @@ type UnmarshalJSON struct {
16481650 UnmarshalJSON int64 `json:"UnmarshalJSON"`
16491651 }
16501652
1651-type Unowned struct {
1652- Unowned int64 `json:"unowned"`
1653-}
1654-
1655-type Unsafe struct {
1656- Unsafe int64 `json:"unsafe"`
1657-}
1658-
1659-type UseSerializers struct {
1660- UseSerializers int64 `json:"UseSerializers"`
1661-}
1662-
16631653 type Obj6 struct {
16641654 Dummy int64 `json:"dummy"`
16651655 UUID UUID `json:"UUID"`
1656+ Unowned Unowned `json:"unowned"`
1657+ Unsafe Unsafe `json:"unsafe"`
16661658 Unsigned Unsigned `json:"unsigned"`
1659+ UseSerializers UseSerializers `json:"UseSerializers"`
16671660 Ushort Ushort `json:"ushort"`
16681661 Using Using `json:"using"`
16691662 Utf8JSONReader Utf8JSONReader `json:"Utf8JsonReader"`
@@ -1688,10 +1681,22 @@ type UUID struct {
16881681 UUID int64 `json:"UUID"`
16891682 }
16901683
1684+type Unowned struct {
1685+ Unowned int64 `json:"unowned"`
1686+}
1687+
1688+type Unsafe struct {
1689+ Unsafe int64 `json:"unsafe"`
1690+}
1691+
16911692 type Unsigned struct {
16921693 Unsigned int64 `json:"unsigned"`
16931694 }
16941695
1696+type UseSerializers struct {
1697+ UseSerializers int64 `json:"UseSerializers"`
1698+}
1699+
16951700 type Ushort struct {
16961701 Ushort int64 `json:"ushort"`
16971702 }
Mhaskelldefault / QuickType.hs+148 −130
@@ -180,6 +180,7 @@ module QuickType
180180 , Locale (..)
181181 , Lock (..)
182182 , Long (..)
183+ , MakeDictEncoder (..)
183184 , MapClass (..)
184185 , MapEntry (..)
185186 , MarshalJSON (..)
@@ -190,8 +191,6 @@ module QuickType
190191 , Native (..)
191192 , New (..)
192193 , Newtonsoft (..)
193- , Nil (..)
194- , No (..)
195194 , ID (..)
196195 , If (..)
197196 , Import (..)
@@ -200,6 +199,8 @@ module QuickType
200199 , Let (..)
201200 , Module (..)
202201 , Obj4 (..)
202+ , Nil (..)
203+ , No (..)
203204 , NoSuchMethod (..)
204205 , Noexcept (..)
205206 , Nonatomic (..)
@@ -262,8 +263,6 @@ module QuickType
262263 , RuntimeType (..)
263264 , S (..)
264265 , Sbyte (..)
265- , Sealed (..)
266- , Sel (..)
267266 , Obj5 (..)
268267 , KSerializer (..)
269268 , SelfClass (..)
@@ -272,6 +271,8 @@ module QuickType
272271 , Type (..)
273272 , PrimitiveKind (..)
274273 , TypeClass (..)
274+ , Sealed (..)
275+ , Sel (..)
275276 , Select (..)
276277 , Self (..)
277278 , Sendable (..)
@@ -327,12 +328,12 @@ module QuickType
327328 , Undefined (..)
328329 , Union (..)
329330 , UnmarshalJSON (..)
330- , Unowned (..)
331- , Unsafe (..)
332- , UseSerializers (..)
333331 , Obj6 (..)
334332 , Where (..)
333+ , Unowned (..)
334+ , Unsafe (..)
335335 , Unsigned (..)
336+ , UseSerializers (..)
336337 , Ushort (..)
337338 , Using (..)
338339 , Utf8JSONReader (..)
@@ -1072,6 +1073,7 @@ data Obj3 = Obj3
10721073 , localeObj3 :: Locale
10731074 , lockObj3 :: Lock
10741075 , longObj3 :: Long
1076+ , makeDictEncoderObj3 :: MakeDictEncoder
10751077 , mapObj3 :: MapClass
10761078 , mapEntryObj3 :: MapEntry
10771079 , marshalJSONObj3 :: MarshalJSON
@@ -1082,8 +1084,6 @@ data Obj3 = Obj3
10821084 , nativeObj3 :: Native
10831085 , newObj3 :: New
10841086 , newtonsoftObj3 :: Newtonsoft
1085- , nilObj3 :: Nil
1086- , noObj3 :: No
10871087 , obj3IDObj3 :: ID
10881088 , obj3IfObj3 :: If
10891089 , obj3ImportObj3 :: Import
@@ -1277,6 +1277,10 @@ data Long = Long
12771277 { longLong :: Int
12781278 } deriving (Show)
12791279
1280+data MakeDictEncoder = MakeDictEncoder
1281+ { makeDictEncoderMakeDictEncoder :: Int
1282+ } deriving (Show)
1283+
12801284 data MapClass = MapClass
12811285 { mapMapClass :: Int
12821286 } deriving (Show)
@@ -1317,14 +1321,6 @@ data Newtonsoft = Newtonsoft
13171321 { newtonsoftNewtonsoft :: Int
13181322 } deriving (Show)
13191323
1320-data Nil = Nil
1321- { nilNil :: Int
1322- } deriving (Show)
1323-
1324-data No = No
1325- { noNo :: Int
1326- } deriving (Show)
1327-
13281324 data ID = ID
13291325 { idIDID :: Int
13301326 } deriving (Show)
@@ -1355,6 +1351,8 @@ data Module = Module
13551351
13561352 data Obj4 = Obj4
13571353 { dummyObj4 :: Int
1354+ , nilObj4 :: Nil
1355+ , noObj4 :: No
13581356 , noSuchMethodObj4 :: NoSuchMethod
13591357 , noexceptObj4 :: Noexcept
13601358 , nonatomicObj4 :: Nonatomic
@@ -1417,8 +1415,14 @@ data Obj4 = Obj4
14171415 , runtimeTypeObj4 :: RuntimeType
14181416 , sObj4 :: S
14191417 , sbyteObj4 :: Sbyte
1420- , sealedObj4 :: Sealed
1421- , selObj4 :: Sel
1418+ } deriving (Show)
1419+
1420+data Nil = Nil
1421+ { nilNil :: Int
1422+ } deriving (Show)
1423+
1424+data No = No
1425+ { noNo :: Int
14221426 } deriving (Show)
14231427
14241428 data NoSuchMethod = NoSuchMethod
@@ -1669,14 +1673,6 @@ data Sbyte = Sbyte
16691673 { sbyteSbyte :: Int
16701674 } deriving (Show)
16711675
1672-data Sealed = Sealed
1673- { sealedSealed :: Int
1674- } deriving (Show)
1675-
1676-data Sel = Sel
1677- { selSel :: Int
1678- } deriving (Show)
1679-
16801676 data Obj5 = Obj5
16811677 { dummyObj5 :: Int
16821678 , kSerializerObj5 :: KSerializer
@@ -1686,6 +1682,8 @@ data Obj5 = Obj5
16861682 , obj5TypeObj5 :: Type
16871683 , primitiveKindObj5 :: PrimitiveKind
16881684 , purpleTypeObj5 :: TypeClass
1685+ , sealedObj5 :: Sealed
1686+ , selObj5 :: Sel
16891687 , selectObj5 :: Select
16901688 , selfObj5 :: Self
16911689 , sendableObj5 :: Sendable
@@ -1741,9 +1739,6 @@ data Obj5 = Obj5
17411739 , undefinedObj5 :: Undefined
17421740 , unionObj5 :: Union
17431741 , unmarshalJSONObj5 :: UnmarshalJSON
1744- , unownedObj5 :: Unowned
1745- , unsafeObj5 :: Unsafe
1746- , useSerializersObj5 :: UseSerializers
17471742 } deriving (Show)
17481743
17491744 data KSerializer = KSerializer
@@ -1774,6 +1769,14 @@ data TypeClass = TypeClass
17741769 { typeTypeTypeClass :: Int
17751770 } deriving (Show)
17761771
1772+data Sealed = Sealed
1773+ { sealedSealed :: Int
1774+ } deriving (Show)
1775+
1776+data Sel = Sel
1777+ { selSel :: Int
1778+ } deriving (Show)
1779+
17771780 data Select = Select
17781781 { selectSelect :: Int
17791782 } deriving (Show)
@@ -1994,22 +1997,13 @@ data UnmarshalJSON = UnmarshalJSON
19941997 { unmarshalJSONUnmarshalJSON :: Int
19951998 } deriving (Show)
19961999
1997-data Unowned = Unowned
1998- { unownedUnowned :: Int
1999- } deriving (Show)
2000-
2001-data Unsafe = Unsafe
2002- { unsafeUnsafe :: Int
2003- } deriving (Show)
2004-
2005-data UseSerializers = UseSerializers
2006- { useSerializersUseSerializers :: Int
2007- } deriving (Show)
2008-
20092000 data Obj6 = Obj6
20102001 { dummyObj6 :: Int
20112002 , obj6WhereObj6 :: Where
2003+ , unownedObj6 :: Unowned
2004+ , unsafeObj6 :: Unsafe
20122005 , unsignedObj6 :: Unsigned
2006+ , useSerializersObj6 :: UseSerializers
20132007 , ushortObj6 :: Ushort
20142008 , usingObj6 :: Using
20152009 , utf8JSONReaderObj6 :: Utf8JSONReader
@@ -2034,10 +2028,22 @@ data Where = Where
20342028 { whereWhereWhere :: Int
20352029 } deriving (Show)
20362030
2031+data Unowned = Unowned
2032+ { unownedUnowned :: Int
2033+ } deriving (Show)
2034+
2035+data Unsafe = Unsafe
2036+ { unsafeUnsafe :: Int
2037+ } deriving (Show)
2038+
20372039 data Unsigned = Unsigned
20382040 { unsignedUnsigned :: Int
20392041 } deriving (Show)
20402042
2043+data UseSerializers = UseSerializers
2044+ { useSerializersUseSerializers :: Int
2045+ } deriving (Show)
2046+
20412047 data Ushort = Ushort
20422048 { ushortUshort :: Int
20432049 } deriving (Show)
@@ -3702,7 +3708,7 @@ instance FromJSON Obj2False where
37023708 <$> v .: "false"
37033709
37043710 instance ToJSON Obj3 where
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) =
3711+ 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 makeDictEncoderObj3 mapObj3 mapEntryObj3 marshalJSONObj3 metadataPropertyHandlingObj3 mutableObj3 mutatingObj3 namespaceObj3 nativeObj3 newObj3 newtonsoftObj3 obj3IDObj3 obj3IfObj3 obj3ImportObj3 obj3InObj3 obj3InfixObj3 obj3LetObj3 obj3ModuleObj3) =
37063712 object $ foldMap (maybe [] pure)
37073713 [ Just $ "dummy" .= dummyObj3
37083714 , Just $ "goto" .= gotoObj3
@@ -3751,6 +3757,7 @@ instance ToJSON Obj3 where
37513757 , Just $ "Locale" .= localeObj3
37523758 , Just $ "lock" .= lockObj3
37533759 , Just $ "long" .= longObj3
3760+ , Just $ "makeDictEncoder" .= makeDictEncoderObj3
37543761 , Just $ "map" .= mapObj3
37553762 , Just $ "MapEntry" .= mapEntryObj3
37563763 , Just $ "MarshalJSON" .= marshalJSONObj3
@@ -3761,8 +3768,6 @@ instance ToJSON Obj3 where
37613768 , Just $ "native" .= nativeObj3
37623769 , Just $ "new" .= newObj3
37633770 , Just $ "newtonsoft" .= newtonsoftObj3
3764- , Just $ "nil" .= nilObj3
3765- , Just $ "NO" .= noObj3
37663771 , Just $ "id" .= obj3IDObj3
37673772 , Just $ "if" .= obj3IfObj3
37683773 , Just $ "import" .= obj3ImportObj3
@@ -3821,6 +3826,7 @@ instance FromJSON Obj3 where
38213826 <*> v .: "Locale"
38223827 <*> v .: "lock"
38233828 <*> v .: "long"
3829+ <*> v .: "makeDictEncoder"
38243830 <*> v .: "map"
38253831 <*> v .: "MapEntry"
38263832 <*> v .: "MarshalJSON"
@@ -3831,8 +3837,6 @@ instance FromJSON Obj3 where
38313837 <*> v .: "native"
38323838 <*> v .: "new"
38333839 <*> v .: "newtonsoft"
3834- <*> v .: "nil"
3835- <*> v .: "NO"
38363840 <*> v .: "id"
38373841 <*> v .: "if"
38383842 <*> v .: "import"
@@ -4301,6 +4305,16 @@ instance FromJSON Long where
43014305 parseJSON (Object v) = Long
43024306 <$> v .: "long"
43034307
4308+instance ToJSON MakeDictEncoder where
4309+ toJSON (MakeDictEncoder makeDictEncoderMakeDictEncoder) =
4310+ object $ foldMap (maybe [] pure)
4311+ [ Just $ "makeDictEncoder" .= makeDictEncoderMakeDictEncoder
4312+ ]
4313+
4314+instance FromJSON MakeDictEncoder where
4315+ parseJSON (Object v) = MakeDictEncoder
4316+ <$> v .: "makeDictEncoder"
4317+
43044318 instance ToJSON MapClass where
43054319 toJSON (MapClass mapMapClass) =
43064320 object $ foldMap (maybe [] pure)
@@ -4401,26 +4415,6 @@ instance FromJSON Newtonsoft where
44014415 parseJSON (Object v) = Newtonsoft
44024416 <$> v .: "newtonsoft"
44034417
4404-instance ToJSON Nil where
4405- toJSON (Nil nilNil) =
4406- object $ foldMap (maybe [] pure)
4407- [ Just $ "nil" .= nilNil
4408- ]
4409-
4410-instance FromJSON Nil where
4411- parseJSON (Object v) = Nil
4412- <$> v .: "nil"
4413-
4414-instance ToJSON No where
4415- toJSON (No noNo) =
4416- object $ foldMap (maybe [] pure)
4417- [ Just $ "NO" .= noNo
4418- ]
4419-
4420-instance FromJSON No where
4421- parseJSON (Object v) = No
4422- <$> v .: "NO"
4423-
44244418 instance ToJSON ID where
44254419 toJSON (ID idIDID) =
44264420 object $ foldMap (maybe [] pure)
@@ -4492,9 +4486,11 @@ instance FromJSON Module where
44924486 <$> v .: "module"
44934487
44944488 instance ToJSON Obj4 where
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) =
4489+ toJSON (Obj4 dummyObj4 nilObj4 noObj4 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) =
44964490 object $ foldMap (maybe [] pure)
44974491 [ Just $ "dummy" .= dummyObj4
4492+ , Just $ "nil" .= nilObj4
4493+ , Just $ "NO" .= noObj4
44984494 , Just $ "noSuchMethod" .= noSuchMethodObj4
44994495 , Just $ "noexcept" .= noexceptObj4
45004496 , Just $ "nonatomic" .= nonatomicObj4
@@ -4557,13 +4553,13 @@ instance ToJSON Obj4 where
45574553 , Just $ "runtimeType" .= runtimeTypeObj4
45584554 , Just $ "s" .= sObj4
45594555 , Just $ "sbyte" .= sbyteObj4
4560- , Just $ "sealed" .= sealedObj4
4561- , Just $ "SEL" .= selObj4
45624556 ]
45634557
45644558 instance FromJSON Obj4 where
45654559 parseJSON (Object v) = Obj4
45664560 <$> v .: "dummy"
4561+ <*> v .: "nil"
4562+ <*> v .: "NO"
45674563 <*> v .: "noSuchMethod"
45684564 <*> v .: "noexcept"
45694565 <*> v .: "nonatomic"
@@ -4626,8 +4622,26 @@ instance FromJSON Obj4 where
46264622 <*> v .: "runtimeType"
46274623 <*> v .: "s"
46284624 <*> v .: "sbyte"
4629- <*> v .: "sealed"
4630- <*> v .: "SEL"
4625+
4626+instance ToJSON Nil where
4627+ toJSON (Nil nilNil) =
4628+ object $ foldMap (maybe [] pure)
4629+ [ Just $ "nil" .= nilNil
4630+ ]
4631+
4632+instance FromJSON Nil where
4633+ parseJSON (Object v) = Nil
4634+ <$> v .: "nil"
4635+
4636+instance ToJSON No where
4637+ toJSON (No noNo) =
4638+ object $ foldMap (maybe [] pure)
4639+ [ Just $ "NO" .= noNo
4640+ ]
4641+
4642+instance FromJSON No where
4643+ parseJSON (Object v) = No
4644+ <$> v .: "NO"
46314645
46324646 instance ToJSON NoSuchMethod where
46334647 toJSON (NoSuchMethod noSuchMethodNoSuchMethod) =
@@ -5249,28 +5263,8 @@ instance FromJSON Sbyte where
52495263 parseJSON (Object v) = Sbyte
52505264 <$> v .: "sbyte"
52515265
5252-instance ToJSON Sealed where
5253- toJSON (Sealed sealedSealed) =
5254- object $ foldMap (maybe [] pure)
5255- [ Just $ "sealed" .= sealedSealed
5256- ]
5257-
5258-instance FromJSON Sealed where
5259- parseJSON (Object v) = Sealed
5260- <$> v .: "sealed"
5261-
5262-instance ToJSON Sel where
5263- toJSON (Sel selSel) =
5264- object $ foldMap (maybe [] pure)
5265- [ Just $ "SEL" .= selSel
5266- ]
5267-
5268-instance FromJSON Sel where
5269- parseJSON (Object v) = Sel
5270- <$> v .: "SEL"
5271-
52725266 instance ToJSON Obj5 where
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) =
5267+ toJSON (Obj5 dummyObj5 kSerializerObj5 obj5SelfObj5 obj5ThenObj5 obj5TrueObj5 obj5TypeObj5 primitiveKindObj5 purpleTypeObj5 sealedObj5 selObj5 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) =
52745268 object $ foldMap (maybe [] pure)
52755269 [ Just $ "dummy" .= dummyObj5
52765270 , Just $ "KSerializer" .= kSerializerObj5
@@ -5280,6 +5274,8 @@ instance ToJSON Obj5 where
52805274 , Just $ "Type" .= obj5TypeObj5
52815275 , Just $ "PrimitiveKind" .= primitiveKindObj5
52825276 , Just $ "type" .= purpleTypeObj5
5277+ , Just $ "sealed" .= sealedObj5
5278+ , Just $ "SEL" .= selObj5
52835279 , Just $ "select" .= selectObj5
52845280 , Just $ "Self" .= selfObj5
52855281 , Just $ "Sendable" .= sendableObj5
@@ -5335,9 +5331,6 @@ instance ToJSON Obj5 where
53355331 , Just $ "undefined" .= undefinedObj5
53365332 , Just $ "union" .= unionObj5
53375333 , Just $ "UnmarshalJSON" .= unmarshalJSONObj5
5338- , Just $ "unowned" .= unownedObj5
5339- , Just $ "unsafe" .= unsafeObj5
5340- , Just $ "UseSerializers" .= useSerializersObj5
53415334 ]
53425335
53435336 instance FromJSON Obj5 where
@@ -5350,6 +5343,8 @@ instance FromJSON Obj5 where
53505343 <*> v .: "Type"
53515344 <*> v .: "PrimitiveKind"
53525345 <*> v .: "type"
5346+ <*> v .: "sealed"
5347+ <*> v .: "SEL"
53535348 <*> v .: "select"
53545349 <*> v .: "Self"
53555350 <*> v .: "Sendable"
@@ -5405,9 +5400,6 @@ instance FromJSON Obj5 where
54055400 <*> v .: "undefined"
54065401 <*> v .: "union"
54075402 <*> v .: "UnmarshalJSON"
5408- <*> v .: "unowned"
5409- <*> v .: "unsafe"
5410- <*> v .: "UseSerializers"
54115403
54125404 instance ToJSON KSerializer where
54135405 toJSON (KSerializer kSerializerKSerializer) =
@@ -5479,6 +5471,26 @@ instance FromJSON TypeClass where
54795471 parseJSON (Object v) = TypeClass
54805472 <$> v .: "type"
54815473
5474+instance ToJSON Sealed where
5475+ toJSON (Sealed sealedSealed) =
5476+ object $ foldMap (maybe [] pure)
5477+ [ Just $ "sealed" .= sealedSealed
5478+ ]
5479+
5480+instance FromJSON Sealed where
5481+ parseJSON (Object v) = Sealed
5482+ <$> v .: "sealed"
5483+
5484+instance ToJSON Sel where
5485+ toJSON (Sel selSel) =
5486+ object $ foldMap (maybe [] pure)
5487+ [ Just $ "SEL" .= selSel
5488+ ]
5489+
5490+instance FromJSON Sel where
5491+ parseJSON (Object v) = Sel
5492+ <$> v .: "SEL"
5493+
54825494 instance ToJSON Select where
54835495 toJSON (Select selectSelect) =
54845496 object $ foldMap (maybe [] pure)
@@ -6029,42 +6041,15 @@ instance FromJSON UnmarshalJSON where
60296041 parseJSON (Object v) = UnmarshalJSON
60306042 <$> v .: "UnmarshalJSON"
60316043
6032-instance ToJSON Unowned where
6033- toJSON (Unowned unownedUnowned) =
6034- object $ foldMap (maybe [] pure)
6035- [ Just $ "unowned" .= unownedUnowned
6036- ]
6037-
6038-instance FromJSON Unowned where
6039- parseJSON (Object v) = Unowned
6040- <$> v .: "unowned"
6041-
6042-instance ToJSON Unsafe where
6043- toJSON (Unsafe unsafeUnsafe) =
6044- object $ foldMap (maybe [] pure)
6045- [ Just $ "unsafe" .= unsafeUnsafe
6046- ]
6047-
6048-instance FromJSON Unsafe where
6049- parseJSON (Object v) = Unsafe
6050- <$> v .: "unsafe"
6051-
6052-instance ToJSON UseSerializers where
6053- toJSON (UseSerializers useSerializersUseSerializers) =
6054- object $ foldMap (maybe [] pure)
6055- [ Just $ "UseSerializers" .= useSerializersUseSerializers
6056- ]
6057-
6058-instance FromJSON UseSerializers where
6059- parseJSON (Object v) = UseSerializers
6060- <$> v .: "UseSerializers"
6061-
60626044 instance ToJSON Obj6 where
6063- toJSON (Obj6 dummyObj6 obj6WhereObj6 unsignedObj6 ushortObj6 usingObj6 utf8JSONReaderObj6 utf8JSONWriterObj6 uuidObj6 varObj6 virtualObj6 voidObj6 volatileObj6 wcharTObj6 weakObj6 whileObj6 willSetObj6 withObj6 xorObj6 xorEqObj6 yesObj6 yieldObj6) =
6045+ toJSON (Obj6 dummyObj6 obj6WhereObj6 unownedObj6 unsafeObj6 unsignedObj6 useSerializersObj6 ushortObj6 usingObj6 utf8JSONReaderObj6 utf8JSONWriterObj6 uuidObj6 varObj6 virtualObj6 voidObj6 volatileObj6 wcharTObj6 weakObj6 whileObj6 willSetObj6 withObj6 xorObj6 xorEqObj6 yesObj6 yieldObj6) =
60646046 object $ foldMap (maybe [] pure)
60656047 [ Just $ "dummy" .= dummyObj6
60666048 , Just $ "where" .= obj6WhereObj6
6049+ , Just $ "unowned" .= unownedObj6
6050+ , Just $ "unsafe" .= unsafeObj6
60676051 , Just $ "unsigned" .= unsignedObj6
6052+ , Just $ "UseSerializers" .= useSerializersObj6
60686053 , Just $ "ushort" .= ushortObj6
60696054 , Just $ "using" .= usingObj6
60706055 , Just $ "Utf8JsonReader" .= utf8JSONReaderObj6
@@ -6089,7 +6074,10 @@ instance FromJSON Obj6 where
60896074 parseJSON (Object v) = Obj6
60906075 <$> v .: "dummy"
60916076 <*> v .: "where"
6077+ <*> v .: "unowned"
6078+ <*> v .: "unsafe"
60926079 <*> v .: "unsigned"
6080+ <*> v .: "UseSerializers"
60936081 <*> v .: "ushort"
60946082 <*> v .: "using"
60956083 <*> v .: "Utf8JsonReader"
@@ -6119,6 +6107,26 @@ instance FromJSON Where where
61196107 parseJSON (Object v) = Where
61206108 <$> v .: "where"
61216109
6110+instance ToJSON Unowned where
6111+ toJSON (Unowned unownedUnowned) =
6112+ object $ foldMap (maybe [] pure)
6113+ [ Just $ "unowned" .= unownedUnowned
6114+ ]
6115+
6116+instance FromJSON Unowned where
6117+ parseJSON (Object v) = Unowned
6118+ <$> v .: "unowned"
6119+
6120+instance ToJSON Unsafe where
6121+ toJSON (Unsafe unsafeUnsafe) =
6122+ object $ foldMap (maybe [] pure)
6123+ [ Just $ "unsafe" .= unsafeUnsafe
6124+ ]
6125+
6126+instance FromJSON Unsafe where
6127+ parseJSON (Object v) = Unsafe
6128+ <$> v .: "unsafe"
6129+
61226130 instance ToJSON Unsigned where
61236131 toJSON (Unsigned unsignedUnsigned) =
61246132 object $ foldMap (maybe [] pure)
@@ -6129,6 +6137,16 @@ instance FromJSON Unsigned where
61296137 parseJSON (Object v) = Unsigned
61306138 <$> v .: "unsigned"
61316139
6140+instance ToJSON UseSerializers where
6141+ toJSON (UseSerializers useSerializersUseSerializers) =
6142+ object $ foldMap (maybe [] pure)
6143+ [ Just $ "UseSerializers" .= useSerializersUseSerializers
6144+ ]
6145+
6146+instance FromJSON UseSerializers where
6147+ parseJSON (Object v) = UseSerializers
6148+ <$> v .: "UseSerializers"
6149+
61326150 instance ToJSON Ushort where
61336151 toJSON (Ushort ushortUshort) =
61346152 object $ foldMap (maybe [] pure)
Ajava-datetime-legacydefault / src / main / java / io / quicktype / MakeDictEncoder.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class MakeDictEncoder {
6+ private long makeDictEncoder;
7+
8+ @JsonProperty("makeDictEncoder")
9+ public long getMakeDictEncoder() { return makeDictEncoder; }
10+ @JsonProperty("makeDictEncoder")
11+ public void setMakeDictEncoder(long value) { this.makeDictEncoder = value; }
12+}
Mjava-datetime-legacydefault / src / main / java / io / quicktype / Obj3.java+6 −12
@@ -48,6 +48,7 @@ public class Obj3 {
4848 private ListClass list;
4949 private Locale locale;
5050 private Lock lock;
51+ private MakeDictEncoder makeDictEncoder;
5152 private MapClass map;
5253 private MapEntry mapEntry;
5354 private MarshalJSON marshalJSON;
@@ -57,8 +58,6 @@ public class Obj3 {
5758 private Mutating mutating;
5859 private Namespace namespace;
5960 private Newtonsoft newtonsoft;
60- private Nil nil;
61- private No no;
6261 private Goto obj3Goto;
6362 private If obj3If;
6463 private Implements obj3Implements;
@@ -295,6 +294,11 @@ public class Obj3 {
295294 @JsonProperty("lock")
296295 public void setLock(Lock value) { this.lock = value; }
297296
297+ @JsonProperty("makeDictEncoder")
298+ public MakeDictEncoder getMakeDictEncoder() { return makeDictEncoder; }
299+ @JsonProperty("makeDictEncoder")
300+ public void setMakeDictEncoder(MakeDictEncoder value) { this.makeDictEncoder = value; }
301+
298302 @JsonProperty("map")
299303 public MapClass getMap() { return map; }
300304 @JsonProperty("map")
@@ -340,16 +344,6 @@ public class Obj3 {
340344 @JsonProperty("newtonsoft")
341345 public void setNewtonsoft(Newtonsoft value) { this.newtonsoft = value; }
342346
343- @JsonProperty("nil")
344- public Nil getNil() { return nil; }
345- @JsonProperty("nil")
346- public void setNil(Nil value) { this.nil = value; }
347-
348- @JsonProperty("NO")
349- public No getNo() { return no; }
350- @JsonProperty("NO")
351- public void setNo(No value) { this.no = value; }
352-
353347 @JsonProperty("goto")
354348 public Goto getObj3Goto() { return obj3Goto; }
355349 @JsonProperty("goto")
Mjava-datetime-legacydefault / src / main / java / io / quicktype / Obj4.java+12 −12
@@ -4,6 +4,8 @@ import com.fasterxml.jackson.annotation.*;
44
55 public class Obj4 {
66 private long dummy;
7+ private Nil nil;
8+ private No no;
79 private NoSuchMethod noSuchMethod;
810 private Noexcept noexcept;
911 private Nonatomic nonatomic;
@@ -66,14 +68,22 @@ public class Obj4 {
6668 private RuntimeType runtimeType;
6769 private S s;
6870 private Sbyte sbyte;
69- private Sealed sealed;
70- private Sel sel;
7171
7272 @JsonProperty("dummy")
7373 public long getDummy() { return dummy; }
7474 @JsonProperty("dummy")
7575 public void setDummy(long value) { this.dummy = value; }
7676
77+ @JsonProperty("nil")
78+ public Nil getNil() { return nil; }
79+ @JsonProperty("nil")
80+ public void setNil(Nil value) { this.nil = value; }
81+
82+ @JsonProperty("NO")
83+ public No getNo() { return no; }
84+ @JsonProperty("NO")
85+ public void setNo(No value) { this.no = value; }
86+
7787 @JsonProperty("noSuchMethod")
7888 public NoSuchMethod getNoSuchMethod() { return noSuchMethod; }
7989 @JsonProperty("noSuchMethod")
@@ -383,14 +393,4 @@ public class Obj4 {
383393 public Sbyte getSbyte() { return sbyte; }
384394 @JsonProperty("sbyte")
385395 public void setSbyte(Sbyte value) { this.sbyte = value; }
386-
387- @JsonProperty("sealed")
388- public Sealed getSealed() { return sealed; }
389- @JsonProperty("sealed")
390- public void setSealed(Sealed value) { this.sealed = value; }
391-
392- @JsonProperty("SEL")
393- public Sel getSel() { return sel; }
394- @JsonProperty("SEL")
395- public void setSel(Sel value) { this.sel = value; }
396396 }
Mjava-datetime-legacydefault / src / main / java / io / quicktype / Obj5.java+12 −18
@@ -21,6 +21,8 @@ public class Obj5 {
2121 private TypeClass obj5Type;
2222 private PrimitiveKind primitiveKind;
2323 private TrueClass purpleTrue;
24+ private Sealed sealed;
25+ private Sel sel;
2426 private Select select;
2527 private Self self;
2628 private Sendable sendable;
@@ -66,9 +68,6 @@ public class Obj5 {
6668 private Undefined undefined;
6769 private Union union;
6870 private UnmarshalJSON unmarshalJSON;
69- private Unowned unowned;
70- private Unsafe unsafe;
71- private UseSerializers useSerializers;
7271
7372 @JsonProperty("dummy")
7473 public long getDummy() { return dummy; }
@@ -160,6 +159,16 @@ public class Obj5 {
160159 @JsonProperty("true")
161160 public void setPurpleTrue(TrueClass value) { this.purpleTrue = value; }
162161
162+ @JsonProperty("sealed")
163+ public Sealed getSealed() { return sealed; }
164+ @JsonProperty("sealed")
165+ public void setSealed(Sealed value) { this.sealed = value; }
166+
167+ @JsonProperty("SEL")
168+ public Sel getSel() { return sel; }
169+ @JsonProperty("SEL")
170+ public void setSel(Sel value) { this.sel = value; }
171+
163172 @JsonProperty("select")
164173 public Select getSelect() { return select; }
165174 @JsonProperty("select")
@@ -384,19 +393,4 @@ public class Obj5 {
384393 public UnmarshalJSON getUnmarshalJSON() { return unmarshalJSON; }
385394 @JsonProperty("UnmarshalJSON")
386395 public void setUnmarshalJSON(UnmarshalJSON value) { this.unmarshalJSON = value; }
387-
388- @JsonProperty("unowned")
389- public Unowned getUnowned() { return unowned; }
390- @JsonProperty("unowned")
391- public void setUnowned(Unowned value) { this.unowned = value; }
392-
393- @JsonProperty("unsafe")
394- public Unsafe getUnsafe() { return unsafe; }
395- @JsonProperty("unsafe")
396- public void setUnsafe(Unsafe value) { this.unsafe = value; }
397-
398- @JsonProperty("UseSerializers")
399- public UseSerializers getUseSerializers() { return useSerializers; }
400- @JsonProperty("UseSerializers")
401- public void setUseSerializers(UseSerializers value) { this.useSerializers = value; }
402396 }
Mjava-datetime-legacydefault / src / main / java / io / quicktype / Obj6.java+18 −0
@@ -7,7 +7,10 @@ public class Obj6 {
77 private Void obj6Void;
88 private Volatile obj6Volatile;
99 private While obj6While;
10+ private Unowned unowned;
11+ private Unsafe unsafe;
1012 private Unsigned unsigned;
13+ private UseSerializers useSerializers;
1114 private Ushort ushort;
1215 private Using using;
1316 private Utf8JSONReader utf8JSONReader;
@@ -45,11 +48,26 @@ public class Obj6 {
4548 @JsonProperty("while")
4649 public void setObj6While(While value) { this.obj6While = value; }
4750
51+ @JsonProperty("unowned")
52+ public Unowned getUnowned() { return unowned; }
53+ @JsonProperty("unowned")
54+ public void setUnowned(Unowned value) { this.unowned = value; }
55+
56+ @JsonProperty("unsafe")
57+ public Unsafe getUnsafe() { return unsafe; }
58+ @JsonProperty("unsafe")
59+ public void setUnsafe(Unsafe value) { this.unsafe = value; }
60+
4861 @JsonProperty("unsigned")
4962 public Unsigned getUnsigned() { return unsigned; }
5063 @JsonProperty("unsigned")
5164 public void setUnsigned(Unsigned value) { this.unsigned = value; }
5265
66+ @JsonProperty("UseSerializers")
67+ public UseSerializers getUseSerializers() { return useSerializers; }
68+ @JsonProperty("UseSerializers")
69+ public void setUseSerializers(UseSerializers value) { this.useSerializers = value; }
70+
5371 @JsonProperty("ushort")
5472 public Ushort getUshort() { return ushort; }
5573 @JsonProperty("ushort")
Ajava-lombokdefault / src / main / java / io / quicktype / MakeDictEncoder.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class MakeDictEncoder {
6+ private long makeDictEncoder;
7+
8+ @JsonProperty("makeDictEncoder")
9+ public long getMakeDictEncoder() { return makeDictEncoder; }
10+ @JsonProperty("makeDictEncoder")
11+ public void setMakeDictEncoder(long value) { this.makeDictEncoder = value; }
12+}
Mjava-lombokdefault / src / main / java / io / quicktype / Obj3.java+6 −12
@@ -48,6 +48,7 @@ public class Obj3 {
4848 private ListClass list;
4949 private Locale locale;
5050 private Lock lock;
51+ private MakeDictEncoder makeDictEncoder;
5152 private MapClass map;
5253 private MapEntry mapEntry;
5354 private MarshalJSON marshalJSON;
@@ -57,8 +58,6 @@ public class Obj3 {
5758 private Mutating mutating;
5859 private Namespace namespace;
5960 private Newtonsoft newtonsoft;
60- private Nil nil;
61- private No no;
6261 private Goto obj3Goto;
6362 private If obj3If;
6463 private Implements obj3Implements;
@@ -295,6 +294,11 @@ public class Obj3 {
295294 @JsonProperty("lock")
296295 public void setLock(Lock value) { this.lock = value; }
297296
297+ @JsonProperty("makeDictEncoder")
298+ public MakeDictEncoder getMakeDictEncoder() { return makeDictEncoder; }
299+ @JsonProperty("makeDictEncoder")
300+ public void setMakeDictEncoder(MakeDictEncoder value) { this.makeDictEncoder = value; }
301+
298302 @JsonProperty("map")
299303 public MapClass getMap() { return map; }
300304 @JsonProperty("map")
@@ -340,16 +344,6 @@ public class Obj3 {
340344 @JsonProperty("newtonsoft")
341345 public void setNewtonsoft(Newtonsoft value) { this.newtonsoft = value; }
342346
343- @JsonProperty("nil")
344- public Nil getNil() { return nil; }
345- @JsonProperty("nil")
346- public void setNil(Nil value) { this.nil = value; }
347-
348- @JsonProperty("NO")
349- public No getNo() { return no; }
350- @JsonProperty("NO")
351- public void setNo(No value) { this.no = value; }
352-
353347 @JsonProperty("goto")
354348 public Goto getObj3Goto() { return obj3Goto; }
355349 @JsonProperty("goto")
Mjava-lombokdefault / src / main / java / io / quicktype / Obj4.java+12 −12
@@ -4,6 +4,8 @@ import com.fasterxml.jackson.annotation.*;
44
55 public class Obj4 {
66 private long dummy;
7+ private Nil nil;
8+ private No no;
79 private NoSuchMethod noSuchMethod;
810 private Noexcept noexcept;
911 private Nonatomic nonatomic;
@@ -66,14 +68,22 @@ public class Obj4 {
6668 private RuntimeType runtimeType;
6769 private S s;
6870 private Sbyte sbyte;
69- private Sealed sealed;
70- private Sel sel;
7171
7272 @JsonProperty("dummy")
7373 public long getDummy() { return dummy; }
7474 @JsonProperty("dummy")
7575 public void setDummy(long value) { this.dummy = value; }
7676
77+ @JsonProperty("nil")
78+ public Nil getNil() { return nil; }
79+ @JsonProperty("nil")
80+ public void setNil(Nil value) { this.nil = value; }
81+
82+ @JsonProperty("NO")
83+ public No getNo() { return no; }
84+ @JsonProperty("NO")
85+ public void setNo(No value) { this.no = value; }
86+
7787 @JsonProperty("noSuchMethod")
7888 public NoSuchMethod getNoSuchMethod() { return noSuchMethod; }
7989 @JsonProperty("noSuchMethod")
@@ -383,14 +393,4 @@ public class Obj4 {
383393 public Sbyte getSbyte() { return sbyte; }
384394 @JsonProperty("sbyte")
385395 public void setSbyte(Sbyte value) { this.sbyte = value; }
386-
387- @JsonProperty("sealed")
388- public Sealed getSealed() { return sealed; }
389- @JsonProperty("sealed")
390- public void setSealed(Sealed value) { this.sealed = value; }
391-
392- @JsonProperty("SEL")
393- public Sel getSel() { return sel; }
394- @JsonProperty("SEL")
395- public void setSel(Sel value) { this.sel = value; }
396396 }
Mjava-lombokdefault / src / main / java / io / quicktype / Obj5.java+12 −18
@@ -21,6 +21,8 @@ public class Obj5 {
2121 private TypeClass obj5Type;
2222 private PrimitiveKind primitiveKind;
2323 private TrueClass purpleTrue;
24+ private Sealed sealed;
25+ private Sel sel;
2426 private Select select;
2527 private Self self;
2628 private Sendable sendable;
@@ -66,9 +68,6 @@ public class Obj5 {
6668 private Undefined undefined;
6769 private Union union;
6870 private UnmarshalJSON unmarshalJSON;
69- private Unowned unowned;
70- private Unsafe unsafe;
71- private UseSerializers useSerializers;
7271
7372 @JsonProperty("dummy")
7473 public long getDummy() { return dummy; }
@@ -160,6 +159,16 @@ public class Obj5 {
160159 @JsonProperty("true")
161160 public void setPurpleTrue(TrueClass value) { this.purpleTrue = value; }
162161
162+ @JsonProperty("sealed")
163+ public Sealed getSealed() { return sealed; }
164+ @JsonProperty("sealed")
165+ public void setSealed(Sealed value) { this.sealed = value; }
166+
167+ @JsonProperty("SEL")
168+ public Sel getSel() { return sel; }
169+ @JsonProperty("SEL")
170+ public void setSel(Sel value) { this.sel = value; }
171+
163172 @JsonProperty("select")
164173 public Select getSelect() { return select; }
165174 @JsonProperty("select")
@@ -384,19 +393,4 @@ public class Obj5 {
384393 public UnmarshalJSON getUnmarshalJSON() { return unmarshalJSON; }
385394 @JsonProperty("UnmarshalJSON")
386395 public void setUnmarshalJSON(UnmarshalJSON value) { this.unmarshalJSON = value; }
387-
388- @JsonProperty("unowned")
389- public Unowned getUnowned() { return unowned; }
390- @JsonProperty("unowned")
391- public void setUnowned(Unowned value) { this.unowned = value; }
392-
393- @JsonProperty("unsafe")
394- public Unsafe getUnsafe() { return unsafe; }
395- @JsonProperty("unsafe")
396- public void setUnsafe(Unsafe value) { this.unsafe = value; }
397-
398- @JsonProperty("UseSerializers")
399- public UseSerializers getUseSerializers() { return useSerializers; }
400- @JsonProperty("UseSerializers")
401- public void setUseSerializers(UseSerializers value) { this.useSerializers = value; }
402396 }
Mjava-lombokdefault / src / main / java / io / quicktype / Obj6.java+18 −0
@@ -7,7 +7,10 @@ public class Obj6 {
77 private Void obj6Void;
88 private Volatile obj6Volatile;
99 private While obj6While;
10+ private Unowned unowned;
11+ private Unsafe unsafe;
1012 private Unsigned unsigned;
13+ private UseSerializers useSerializers;
1114 private Ushort ushort;
1215 private Using using;
1316 private Utf8JSONReader utf8JSONReader;
@@ -45,11 +48,26 @@ public class Obj6 {
4548 @JsonProperty("while")
4649 public void setObj6While(While value) { this.obj6While = value; }
4750
51+ @JsonProperty("unowned")
52+ public Unowned getUnowned() { return unowned; }
53+ @JsonProperty("unowned")
54+ public void setUnowned(Unowned value) { this.unowned = value; }
55+
56+ @JsonProperty("unsafe")
57+ public Unsafe getUnsafe() { return unsafe; }
58+ @JsonProperty("unsafe")
59+ public void setUnsafe(Unsafe value) { this.unsafe = value; }
60+
4861 @JsonProperty("unsigned")
4962 public Unsigned getUnsigned() { return unsigned; }
5063 @JsonProperty("unsigned")
5164 public void setUnsigned(Unsigned value) { this.unsigned = value; }
5265
66+ @JsonProperty("UseSerializers")
67+ public UseSerializers getUseSerializers() { return useSerializers; }
68+ @JsonProperty("UseSerializers")
69+ public void setUseSerializers(UseSerializers value) { this.useSerializers = value; }
70+
5371 @JsonProperty("ushort")
5472 public Ushort getUshort() { return ushort; }
5573 @JsonProperty("ushort")
Ajavadefault / src / main / java / io / quicktype / MakeDictEncoder.java+12 −0
@@ -0,0 +1,12 @@
1+package io.quicktype;
2+
3+import com.fasterxml.jackson.annotation.*;
4+
5+public class MakeDictEncoder {
6+ private long makeDictEncoder;
7+
8+ @JsonProperty("makeDictEncoder")
9+ public long getMakeDictEncoder() { return makeDictEncoder; }
10+ @JsonProperty("makeDictEncoder")
11+ public void setMakeDictEncoder(long value) { this.makeDictEncoder = value; }
12+}
Mjavadefault / src / main / java / io / quicktype / Obj3.java+6 −12
@@ -48,6 +48,7 @@ public class Obj3 {
4848 private ListClass list;
4949 private Locale locale;
5050 private Lock lock;
51+ private MakeDictEncoder makeDictEncoder;
5152 private MapClass map;
5253 private MapEntry mapEntry;
5354 private MarshalJSON marshalJSON;
@@ -57,8 +58,6 @@ public class Obj3 {
5758 private Mutating mutating;
5859 private Namespace namespace;
5960 private Newtonsoft newtonsoft;
60- private Nil nil;
61- private No no;
6261 private Goto obj3Goto;
6362 private If obj3If;
6463 private Implements obj3Implements;
@@ -295,6 +294,11 @@ public class Obj3 {
295294 @JsonProperty("lock")
296295 public void setLock(Lock value) { this.lock = value; }
297296
297+ @JsonProperty("makeDictEncoder")
298+ public MakeDictEncoder getMakeDictEncoder() { return makeDictEncoder; }
299+ @JsonProperty("makeDictEncoder")
300+ public void setMakeDictEncoder(MakeDictEncoder value) { this.makeDictEncoder = value; }
301+
298302 @JsonProperty("map")
299303 public MapClass getMap() { return map; }
300304 @JsonProperty("map")
@@ -340,16 +344,6 @@ public class Obj3 {
340344 @JsonProperty("newtonsoft")
341345 public void setNewtonsoft(Newtonsoft value) { this.newtonsoft = value; }
342346
343- @JsonProperty("nil")
344- public Nil getNil() { return nil; }
345- @JsonProperty("nil")
346- public void setNil(Nil value) { this.nil = value; }
347-
348- @JsonProperty("NO")
349- public No getNo() { return no; }
350- @JsonProperty("NO")
351- public void setNo(No value) { this.no = value; }
352-
353347 @JsonProperty("goto")
354348 public Goto getObj3Goto() { return obj3Goto; }
355349 @JsonProperty("goto")
Mjavadefault / src / main / java / io / quicktype / Obj4.java+12 −12
@@ -4,6 +4,8 @@ import com.fasterxml.jackson.annotation.*;
44
55 public class Obj4 {
66 private long dummy;
7+ private Nil nil;
8+ private No no;
79 private NoSuchMethod noSuchMethod;
810 private Noexcept noexcept;
911 private Nonatomic nonatomic;
@@ -66,14 +68,22 @@ public class Obj4 {
6668 private RuntimeType runtimeType;
6769 private S s;
6870 private Sbyte sbyte;
69- private Sealed sealed;
70- private Sel sel;
7171
7272 @JsonProperty("dummy")
7373 public long getDummy() { return dummy; }
7474 @JsonProperty("dummy")
7575 public void setDummy(long value) { this.dummy = value; }
7676
77+ @JsonProperty("nil")
78+ public Nil getNil() { return nil; }
79+ @JsonProperty("nil")
80+ public void setNil(Nil value) { this.nil = value; }
81+
82+ @JsonProperty("NO")
83+ public No getNo() { return no; }
84+ @JsonProperty("NO")
85+ public void setNo(No value) { this.no = value; }
86+
7787 @JsonProperty("noSuchMethod")
7888 public NoSuchMethod getNoSuchMethod() { return noSuchMethod; }
7989 @JsonProperty("noSuchMethod")
@@ -383,14 +393,4 @@ public class Obj4 {
383393 public Sbyte getSbyte() { return sbyte; }
384394 @JsonProperty("sbyte")
385395 public void setSbyte(Sbyte value) { this.sbyte = value; }
386-
387- @JsonProperty("sealed")
388- public Sealed getSealed() { return sealed; }
389- @JsonProperty("sealed")
390- public void setSealed(Sealed value) { this.sealed = value; }
391-
392- @JsonProperty("SEL")
393- public Sel getSel() { return sel; }
394- @JsonProperty("SEL")
395- public void setSel(Sel value) { this.sel = value; }
396396 }
Mjavadefault / src / main / java / io / quicktype / Obj5.java+12 −18
@@ -21,6 +21,8 @@ public class Obj5 {
2121 private TypeClass obj5Type;
2222 private PrimitiveKind primitiveKind;
2323 private TrueClass purpleTrue;
24+ private Sealed sealed;
25+ private Sel sel;
2426 private Select select;
2527 private Self self;
2628 private Sendable sendable;
@@ -66,9 +68,6 @@ public class Obj5 {
6668 private Undefined undefined;
6769 private Union union;
6870 private UnmarshalJSON unmarshalJSON;
69- private Unowned unowned;
70- private Unsafe unsafe;
71- private UseSerializers useSerializers;
7271
7372 @JsonProperty("dummy")
7473 public long getDummy() { return dummy; }
@@ -160,6 +159,16 @@ public class Obj5 {
160159 @JsonProperty("true")
161160 public void setPurpleTrue(TrueClass value) { this.purpleTrue = value; }
162161
162+ @JsonProperty("sealed")
163+ public Sealed getSealed() { return sealed; }
164+ @JsonProperty("sealed")
165+ public void setSealed(Sealed value) { this.sealed = value; }
166+
167+ @JsonProperty("SEL")
168+ public Sel getSel() { return sel; }
169+ @JsonProperty("SEL")
170+ public void setSel(Sel value) { this.sel = value; }
171+
163172 @JsonProperty("select")
164173 public Select getSelect() { return select; }
165174 @JsonProperty("select")
@@ -384,19 +393,4 @@ public class Obj5 {
384393 public UnmarshalJSON getUnmarshalJSON() { return unmarshalJSON; }
385394 @JsonProperty("UnmarshalJSON")
386395 public void setUnmarshalJSON(UnmarshalJSON value) { this.unmarshalJSON = value; }
387-
388- @JsonProperty("unowned")
389- public Unowned getUnowned() { return unowned; }
390- @JsonProperty("unowned")
391- public void setUnowned(Unowned value) { this.unowned = value; }
392-
393- @JsonProperty("unsafe")
394- public Unsafe getUnsafe() { return unsafe; }
395- @JsonProperty("unsafe")
396- public void setUnsafe(Unsafe value) { this.unsafe = value; }
397-
398- @JsonProperty("UseSerializers")
399- public UseSerializers getUseSerializers() { return useSerializers; }
400- @JsonProperty("UseSerializers")
401- public void setUseSerializers(UseSerializers value) { this.useSerializers = value; }
402396 }
Mjavadefault / src / main / java / io / quicktype / Obj6.java+18 −0
@@ -7,7 +7,10 @@ public class Obj6 {
77 private Void obj6Void;
88 private Volatile obj6Volatile;
99 private While obj6While;
10+ private Unowned unowned;
11+ private Unsafe unsafe;
1012 private Unsigned unsigned;
13+ private UseSerializers useSerializers;
1114 private Ushort ushort;
1215 private Using using;
1316 private Utf8JSONReader utf8JSONReader;
@@ -45,11 +48,26 @@ public class Obj6 {
4548 @JsonProperty("while")
4649 public void setObj6While(While value) { this.obj6While = value; }
4750
51+ @JsonProperty("unowned")
52+ public Unowned getUnowned() { return unowned; }
53+ @JsonProperty("unowned")
54+ public void setUnowned(Unowned value) { this.unowned = value; }
55+
56+ @JsonProperty("unsafe")
57+ public Unsafe getUnsafe() { return unsafe; }
58+ @JsonProperty("unsafe")
59+ public void setUnsafe(Unsafe value) { this.unsafe = value; }
60+
4861 @JsonProperty("unsigned")
4962 public Unsigned getUnsigned() { return unsigned; }
5063 @JsonProperty("unsigned")
5164 public void setUnsigned(Unsigned value) { this.unsigned = value; }
5265
66+ @JsonProperty("UseSerializers")
67+ public UseSerializers getUseSerializers() { return useSerializers; }
68+ @JsonProperty("UseSerializers")
69+ public void setUseSerializers(UseSerializers value) { this.useSerializers = value; }
70+
5371 @JsonProperty("ushort")
5472 public Ushort getUshort() { return ushort; }
5573 @JsonProperty("ushort")
Mjavascript-prop-typesdefault / toplevel.js+38 −33
@@ -163,7 +163,6 @@ let _JSONTokenType;
163163 let _Locale;
164164 let _MapEntry;
165165 let _MarshalJSON;
166-let _No;
167166 let _Goto;
168167 let _Guard;
169168 let _HasOwnProperty;
@@ -200,6 +199,7 @@ let _Let;
200199 let _List;
201200 let _Lock;
202201 let _Long;
202+let _MakeDictEncoder;
203203 let _Map;
204204 let _MetadataPropertyHandling;
205205 let _Module;
@@ -209,8 +209,8 @@ let _Namespace;
209209 let _Native;
210210 let _New;
211211 let _Newtonsoft;
212-let _Nil;
213212 let _Obj4;
213+let _No;
214214 let _NSError;
215215 let _NSObject;
216216 let _NSString;
@@ -219,7 +219,7 @@ let _None;
219219 let _ObjectMapper;
220220 let _Protocol;
221221 let _RegExp;
222-let _Sel;
222+let _Nil;
223223 let _NoSuchMethod;
224224 let _Noexcept;
225225 let _Nonatomic;
@@ -274,10 +274,10 @@ let _Right;
274274 let _RuntimeType;
275275 let _S;
276276 let _Sbyte;
277-let _Sealed;
278277 let _Obj5;
279278 let _KSerializer;
280279 let _PrimitiveKind;
280+let _Sel;
281281 let _Self;
282282 let _Sendable;
283283 let _SerialDescriptor;
@@ -294,7 +294,7 @@ let _TimeZone;
294294 let _True;
295295 let _Type;
296296 let _UnmarshalJSON;
297-let _UseSerializers;
297+let _Sealed;
298298 let _Select;
299299 let _SelfClass;
300300 let _Serialize;
@@ -339,13 +339,14 @@ let _Ulong;
339339 let _Unchecked;
340340 let _Undefined;
341341 let _Union;
342-let _Unowned;
343-let _Unsafe;
344342 let _Obj6;
345343 let _UUID;
344+let _UseSerializers;
346345 let _Utf8JSONReader;
347346 let _Utf8JSONWriter;
348347 let _Yes;
348+let _Unowned;
349+let _Unsafe;
349350 let _Unsigned;
350351 let _Ushort;
351352 let _Using;
@@ -935,9 +936,6 @@ _MapEntry = PropTypes.shape({
935936 _MarshalJSON = PropTypes.shape({
936937 "MarshalJSON": PropTypes.oneOfType([Integer]).isRequired,
937938 });
938-_No = PropTypes.shape({
939- "NO": PropTypes.oneOfType([Integer]).isRequired,
940-});
941939 _Goto = PropTypes.shape({
942940 "goto": PropTypes.oneOfType([Integer]).isRequired,
943941 });
@@ -1046,6 +1044,9 @@ _Lock = PropTypes.shape({
10461044 _Long = PropTypes.shape({
10471045 "long": PropTypes.oneOfType([Integer]).isRequired,
10481046 });
1047+_MakeDictEncoder = PropTypes.shape({
1048+ "makeDictEncoder": PropTypes.oneOfType([Integer]).isRequired,
1049+});
10491050 _Map = PropTypes.shape({
10501051 "map": PropTypes.oneOfType([Integer]).isRequired,
10511052 });
@@ -1073,9 +1074,6 @@ _New = PropTypes.shape({
10731074 _Newtonsoft = PropTypes.shape({
10741075 "newtonsoft": PropTypes.oneOfType([Integer]).isRequired,
10751076 });
1076-_Nil = PropTypes.shape({
1077- "nil": PropTypes.oneOfType([Integer]).isRequired,
1078-});
10791077 _Obj3 = PropTypes.shape({
10801078 "Hashable": _Hashable,
10811079 "Hasher": _Hasher,
@@ -1095,7 +1093,6 @@ _Obj3 = PropTypes.shape({
10951093 "Locale": _Locale,
10961094 "MapEntry": _MapEntry,
10971095 "MarshalJSON": _MarshalJSON,
1098- "NO": _No,
10991096 "dummy": PropTypes.oneOfType([Integer]).isRequired,
11001097 "goto": _Goto,
11011098 "guard": _Guard,
@@ -1133,6 +1130,7 @@ _Obj3 = PropTypes.shape({
11331130 "list": _List,
11341131 "lock": _Lock,
11351132 "long": _Long,
1133+ "makeDictEncoder": _MakeDictEncoder,
11361134 "map": _Map,
11371135 "metadata_property_handling": _MetadataPropertyHandling,
11381136 "module": _Module,
@@ -1142,7 +1140,9 @@ _Obj3 = PropTypes.shape({
11421140 "native": _Native,
11431141 "new": _New,
11441142 "newtonsoft": _Newtonsoft,
1145- "nil": _Nil,
1143+});
1144+_No = PropTypes.shape({
1145+ "NO": PropTypes.oneOfType([Integer]).isRequired,
11461146 });
11471147 _NSError = PropTypes.shape({
11481148 "NSError": PropTypes.oneOfType([Integer]).isRequired,
@@ -1168,8 +1168,8 @@ _Protocol = PropTypes.shape({
11681168 _RegExp = PropTypes.shape({
11691169 "RegExp": PropTypes.oneOfType([(props, name) => props[name] == null || /^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(props[name]) ? null : new Error("Expected UUID")]).isRequired,
11701170 });
1171-_Sel = PropTypes.shape({
1172- "SEL": PropTypes.oneOfType([Integer]).isRequired,
1171+_Nil = PropTypes.shape({
1172+ "nil": PropTypes.oneOfType([Integer]).isRequired,
11731173 });
11741174 _NoSuchMethod = PropTypes.shape({
11751175 "noSuchMethod": PropTypes.oneOfType([Integer]).isRequired,
@@ -1333,10 +1333,8 @@ _S = PropTypes.shape({
13331333 _Sbyte = PropTypes.shape({
13341334 "sbyte": PropTypes.oneOfType([Integer]).isRequired,
13351335 });
1336-_Sealed = PropTypes.shape({
1337- "sealed": PropTypes.oneOfType([Integer]).isRequired,
1338-});
13391336 _Obj4 = PropTypes.shape({
1337+ "NO": _No,
13401338 "NSError": _NSError,
13411339 "NSObject": _NSObject,
13421340 "NSString": _NSString,
@@ -1345,8 +1343,8 @@ _Obj4 = PropTypes.shape({
13451343 "ObjectMapper": _ObjectMapper,
13461344 "Protocol": _Protocol,
13471345 "RegExp": _RegExp,
1348- "SEL": _Sel,
13491346 "dummy": PropTypes.oneOfType([Integer]).isRequired,
1347+ "nil": _Nil,
13501348 "noSuchMethod": _NoSuchMethod,
13511349 "noexcept": _Noexcept,
13521350 "nonatomic": _Nonatomic,
@@ -1401,7 +1399,6 @@ _Obj4 = PropTypes.shape({
14011399 "runtimeType": _RuntimeType,
14021400 "s": _S,
14031401 "sbyte": _Sbyte,
1404- "sealed": _Sealed,
14051402 });
14061403 _KSerializer = PropTypes.shape({
14071404 "KSerializer": PropTypes.oneOfType([Integer]).isRequired,
@@ -1409,6 +1406,9 @@ _KSerializer = PropTypes.shape({
14091406 _PrimitiveKind = PropTypes.shape({
14101407 "PrimitiveKind": PropTypes.oneOfType([Integer]).isRequired,
14111408 });
1409+_Sel = PropTypes.shape({
1410+ "SEL": PropTypes.oneOfType([Integer]).isRequired,
1411+});
14121412 _Self = PropTypes.shape({
14131413 "Self": PropTypes.oneOfType([Integer]).isRequired,
14141414 });
@@ -1457,8 +1457,8 @@ _Type = PropTypes.shape({
14571457 _UnmarshalJSON = PropTypes.shape({
14581458 "UnmarshalJSON": PropTypes.oneOfType([Integer]).isRequired,
14591459 });
1460-_UseSerializers = PropTypes.shape({
1461- "UseSerializers": PropTypes.oneOfType([Integer]).isRequired,
1460+_Sealed = PropTypes.shape({
1461+ "sealed": PropTypes.oneOfType([Integer]).isRequired,
14621462 });
14631463 _Select = PropTypes.shape({
14641464 "select": PropTypes.oneOfType([Integer]).isRequired,
@@ -1592,15 +1592,10 @@ _Undefined = PropTypes.shape({
15921592 _Union = PropTypes.shape({
15931593 "union": PropTypes.oneOfType([Integer]).isRequired,
15941594 });
1595-_Unowned = PropTypes.shape({
1596- "unowned": PropTypes.oneOfType([Integer]).isRequired,
1597-});
1598-_Unsafe = PropTypes.shape({
1599- "unsafe": PropTypes.oneOfType([Integer]).isRequired,
1600-});
16011595 _Obj5 = PropTypes.shape({
16021596 "KSerializer": _KSerializer,
16031597 "PrimitiveKind": _PrimitiveKind,
1598+ "SEL": _Sel,
16041599 "Self": _Self,
16051600 "Sendable": _Sendable,
16061601 "SerialDescriptor": _SerialDescriptor,
@@ -1617,8 +1612,8 @@ _Obj5 = PropTypes.shape({
16171612 "True": _True,
16181613 "Type": _Type,
16191614 "UnmarshalJSON": _UnmarshalJSON,
1620- "UseSerializers": _UseSerializers,
16211615 "dummy": PropTypes.oneOfType([Integer]).isRequired,
1616+ "sealed": _Sealed,
16221617 "select": _Select,
16231618 "self": _SelfClass,
16241619 "serialize": _Serialize,
@@ -1663,12 +1658,13 @@ _Obj5 = PropTypes.shape({
16631658 "unchecked": _Unchecked,
16641659 "undefined": _Undefined,
16651660 "union": _Union,
1666- "unowned": _Unowned,
1667- "unsafe": _Unsafe,
16681661 });
16691662 _UUID = PropTypes.shape({
16701663 "UUID": PropTypes.oneOfType([Integer]).isRequired,
16711664 });
1665+_UseSerializers = PropTypes.shape({
1666+ "UseSerializers": PropTypes.oneOfType([Integer]).isRequired,
1667+});
16721668 _Utf8JSONReader = PropTypes.shape({
16731669 "Utf8JsonReader": PropTypes.oneOfType([Integer]).isRequired,
16741670 });
@@ -1678,6 +1674,12 @@ _Utf8JSONWriter = PropTypes.shape({
16781674 _Yes = PropTypes.shape({
16791675 "YES": PropTypes.oneOfType([Integer]).isRequired,
16801676 });
1677+_Unowned = PropTypes.shape({
1678+ "unowned": PropTypes.oneOfType([Integer]).isRequired,
1679+});
1680+_Unsafe = PropTypes.shape({
1681+ "unsafe": PropTypes.oneOfType([Integer]).isRequired,
1682+});
16811683 _Unsigned = PropTypes.shape({
16821684 "unsigned": PropTypes.oneOfType([Integer]).isRequired,
16831685 });
@@ -1728,10 +1730,13 @@ _Yield = PropTypes.shape({
17281730 });
17291731 _Obj6 = PropTypes.shape({
17301732 "UUID": _UUID,
1733+ "UseSerializers": _UseSerializers,
17311734 "Utf8JsonReader": _Utf8JSONReader,
17321735 "Utf8JsonWriter": _Utf8JSONWriter,
17331736 "YES": _Yes,
17341737 "dummy": PropTypes.oneOfType([Integer]).isRequired,
1738+ "unowned": _Unowned,
1739+ "unsafe": _Unsafe,
17351740 "unsigned": _Unsigned,
17361741 "ushort": _Ushort,
17371742 "using": _Using,
Mjavascriptdefault / TopLevel.js+32 −28
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
@@ -739,7 +739,6 @@ const typeMap = {
739739 { json: "Locale", js: "Locale", typ: r("Locale") },
740740 { json: "MapEntry", js: "MapEntry", typ: r("MapEntry") },
741741 { json: "MarshalJSON", js: "MarshalJSON", typ: r("MarshalJSON") },
742- { json: "NO", js: "NO", typ: r("No") },
743742 { json: "dummy", js: "dummy", typ: i(0) },
744743 { json: "goto", js: "goto", typ: r("Goto") },
745744 { json: "guard", js: "guard", typ: r("Guard") },
@@ -777,6 +776,7 @@ const typeMap = {
777776 { json: "list", js: "list", typ: r("List") },
778777 { json: "lock", js: "lock", typ: r("Lock") },
779778 { json: "long", js: "long", typ: r("Long") },
779+ { json: "makeDictEncoder", js: "makeDictEncoder", typ: r("MakeDictEncoder") },
780780 { json: "map", js: "map", typ: r("Map") },
781781 { json: "metadata_property_handling", js: "metadata_property_handling", typ: r("MetadataPropertyHandling") },
782782 { json: "module", js: "module", typ: r("Module") },
@@ -786,7 +786,6 @@ const typeMap = {
786786 { json: "native", js: "native", typ: r("Native") },
787787 { json: "new", js: "new", typ: r("New") },
788788 { json: "newtonsoft", js: "newtonsoft", typ: r("Newtonsoft") },
789- { json: "nil", js: "nil", typ: r("Nil") },
790789 ], false),
791790 "Hashable": o([
792791 { json: "Hashable", js: "Hashable", typ: i(0) },
@@ -842,9 +841,6 @@ const typeMap = {
842841 "MarshalJSON": o([
843842 { json: "MarshalJSON", js: "MarshalJSON", typ: i(0) },
844843 ], false),
845- "No": o([
846- { json: "NO", js: "NO", typ: i(0) },
847- ], false),
848844 "Goto": o([
849845 { json: "goto", js: "goto", typ: i(0) },
850846 ], false),
@@ -953,6 +949,9 @@ const typeMap = {
953949 "Long": o([
954950 { json: "long", js: "long", typ: i(0) },
955951 ], false),
952+ "MakeDictEncoder": o([
953+ { json: "makeDictEncoder", js: "makeDictEncoder", typ: i(0) },
954+ ], false),
956955 "Map": o([
957956 { json: "map", js: "map", typ: i(0) },
958957 ], false),
@@ -980,10 +979,8 @@ const typeMap = {
980979 "Newtonsoft": o([
981980 { json: "newtonsoft", js: "newtonsoft", typ: i(0) },
982981 ], false),
983- "Nil": o([
984- { json: "nil", js: "nil", typ: i(0) },
985- ], false),
986982 "Obj4": o([
983+ { json: "NO", js: "NO", typ: r("No") },
987984 { json: "NSError", js: "NSError", typ: r("NSError") },
988985 { json: "NSObject", js: "NSObject", typ: r("NSObject") },
989986 { json: "NSString", js: "NSString", typ: r("NSString") },
@@ -992,8 +989,8 @@ const typeMap = {
992989 { json: "ObjectMapper", js: "ObjectMapper", typ: r("ObjectMapper") },
993990 { json: "Protocol", js: "Protocol", typ: r("Protocol") },
994991 { json: "RegExp", js: "RegExp", typ: r("RegExp") },
995- { json: "SEL", js: "SEL", typ: r("Sel") },
996992 { json: "dummy", js: "dummy", typ: i(0) },
993+ { json: "nil", js: "nil", typ: r("Nil") },
997994 { json: "noSuchMethod", js: "noSuchMethod", typ: r("NoSuchMethod") },
998995 { json: "noexcept", js: "noexcept", typ: r("Noexcept") },
999996 { json: "nonatomic", js: "nonatomic", typ: r("Nonatomic") },
@@ -1048,7 +1045,9 @@ const typeMap = {
10481045 { json: "runtimeType", js: "runtimeType", typ: r("RuntimeType") },
10491046 { json: "s", js: "s", typ: r("S") },
10501047 { json: "sbyte", js: "sbyte", typ: r("Sbyte") },
1051- { json: "sealed", js: "sealed", typ: r("Sealed") },
1048+ ], false),
1049+ "No": o([
1050+ { json: "NO", js: "NO", typ: i(0) },
10521051 ], false),
10531052 "NSError": o([
10541053 { json: "NSError", js: "NSError", typ: i(0) },
@@ -1074,8 +1073,8 @@ const typeMap = {
10741073 "RegExp": o([
10751074 { json: "RegExp", js: "RegExp", typ: { uuid: "" } },
10761075 ], false),
1077- "Sel": o([
1078- { json: "SEL", js: "SEL", typ: i(0) },
1076+ "Nil": o([
1077+ { json: "nil", js: "nil", typ: i(0) },
10791078 ], false),
10801079 "NoSuchMethod": o([
10811080 { json: "noSuchMethod", js: "noSuchMethod", typ: i(0) },
@@ -1239,12 +1238,10 @@ const typeMap = {
12391238 "Sbyte": o([
12401239 { json: "sbyte", js: "sbyte", typ: i(0) },
12411240 ], false),
1242- "Sealed": o([
1243- { json: "sealed", js: "sealed", typ: i(0) },
1244- ], false),
12451241 "Obj5": o([
12461242 { json: "KSerializer", js: "KSerializer", typ: r("KSerializer") },
12471243 { json: "PrimitiveKind", js: "PrimitiveKind", typ: r("PrimitiveKind") },
1244+ { json: "SEL", js: "SEL", typ: r("Sel") },
12481245 { json: "Self", js: "Self", typ: r("Self") },
12491246 { json: "Sendable", js: "Sendable", typ: r("Sendable") },
12501247 { json: "SerialDescriptor", js: "SerialDescriptor", typ: r("SerialDescriptor") },
@@ -1261,8 +1258,8 @@ const typeMap = {
12611258 { json: "True", js: "True", typ: r("True") },
12621259 { json: "Type", js: "Type", typ: r("Type") },
12631260 { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: r("UnmarshalJSON") },
1264- { json: "UseSerializers", js: "UseSerializers", typ: r("UseSerializers") },
12651261 { json: "dummy", js: "dummy", typ: i(0) },
1262+ { json: "sealed", js: "sealed", typ: r("Sealed") },
12661263 { json: "select", js: "select", typ: r("Select") },
12671264 { json: "self", js: "self", typ: r("SelfClass") },
12681265 { json: "serialize", js: "serialize", typ: r("Serialize") },
@@ -1307,8 +1304,6 @@ const typeMap = {
13071304 { json: "unchecked", js: "unchecked", typ: r("Unchecked") },
13081305 { json: "undefined", js: "undefined", typ: r("Undefined") },
13091306 { json: "union", js: "union", typ: r("Union") },
1310- { json: "unowned", js: "unowned", typ: r("Unowned") },
1311- { json: "unsafe", js: "unsafe", typ: r("Unsafe") },
13121307 ], false),
13131308 "KSerializer": o([
13141309 { json: "KSerializer", js: "KSerializer", typ: i(0) },
@@ -1316,6 +1311,9 @@ const typeMap = {
13161311 "PrimitiveKind": o([
13171312 { json: "PrimitiveKind", js: "PrimitiveKind", typ: i(0) },
13181313 ], false),
1314+ "Sel": o([
1315+ { json: "SEL", js: "SEL", typ: i(0) },
1316+ ], false),
13191317 "Self": o([
13201318 { json: "Self", js: "Self", typ: i(0) },
13211319 ], false),
@@ -1364,8 +1362,8 @@ const typeMap = {
13641362 "UnmarshalJSON": o([
13651363 { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: i(0) },
13661364 ], false),
1367- "UseSerializers": o([
1368- { json: "UseSerializers", js: "UseSerializers", typ: i(0) },
1365+ "Sealed": o([
1366+ { json: "sealed", js: "sealed", typ: i(0) },
13691367 ], false),
13701368 "Select": o([
13711369 { json: "select", js: "select", typ: i(0) },
@@ -1499,18 +1497,15 @@ const typeMap = {
14991497 "Union": o([
15001498 { json: "union", js: "union", typ: i(0) },
15011499 ], false),
1502- "Unowned": o([
1503- { json: "unowned", js: "unowned", typ: i(0) },
1504- ], false),
1505- "Unsafe": o([
1506- { json: "unsafe", js: "unsafe", typ: i(0) },
1507- ], false),
15081500 "Obj6": o([
15091501 { json: "UUID", js: "UUID", typ: r("UUID") },
1502+ { json: "UseSerializers", js: "UseSerializers", typ: r("UseSerializers") },
15101503 { json: "Utf8JsonReader", js: "Utf8JsonReader", typ: r("Utf8JSONReader") },
15111504 { json: "Utf8JsonWriter", js: "Utf8JsonWriter", typ: r("Utf8JSONWriter") },
15121505 { json: "YES", js: "YES", typ: r("Yes") },
15131506 { json: "dummy", js: "dummy", typ: i(0) },
1507+ { json: "unowned", js: "unowned", typ: r("Unowned") },
1508+ { json: "unsafe", js: "unsafe", typ: r("Unsafe") },
15141509 { json: "unsigned", js: "unsigned", typ: r("Unsigned") },
15151510 { json: "ushort", js: "ushort", typ: r("Ushort") },
15161511 { json: "using", js: "using", typ: r("Using") },
@@ -1531,6 +1526,9 @@ const typeMap = {
15311526 "UUID": o([
15321527 { json: "UUID", js: "UUID", typ: i(0) },
15331528 ], false),
1529+ "UseSerializers": o([
1530+ { json: "UseSerializers", js: "UseSerializers", typ: i(0) },
1531+ ], false),
15341532 "Utf8JSONReader": o([
15351533 { json: "Utf8JsonReader", js: "Utf8JsonReader", typ: i(0) },
15361534 ], false),
@@ -1540,6 +1538,12 @@ const typeMap = {
15401538 "Yes": o([
15411539 { json: "YES", js: "YES", typ: i(0) },
15421540 ], false),
1541+ "Unowned": o([
1542+ { json: "unowned", js: "unowned", typ: i(0) },
1543+ ], false),
1544+ "Unsafe": o([
1545+ { json: "unsafe", js: "unsafe", typ: i(0) },
1546+ ], false),
15431547 "Unsigned": o([
15441548 { json: "unsigned", js: "unsigned", typ: i(0) },
15451549 ], false),
Mkotlin-jacksondefault / TopLevel.kt+63 −55
@@ -1258,6 +1258,9 @@ data class Obj3 (
12581258 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
12591259 val long: LongClass,
12601260
1261+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
1262+ val makeDictEncoder: MakeDictEncoder,
1263+
12611264 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
12621265 val map: MapClass,
12631266
@@ -1291,12 +1294,6 @@ data class Obj3 (
12911294 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
12921295 val newtonsoft: Newtonsoft,
12931296
1294- @get:JsonProperty(required=true)@field:JsonProperty(required=true)
1295- val nil: Nil,
1296-
1297- @get:JsonProperty("NO", required=true)@field:JsonProperty("NO", required=true)
1298- val no: No,
1299-
13001297 @get:JsonProperty("if", required=true)@field:JsonProperty("if", required=true)
13011298 val obj3If: If,
13021299
@@ -1550,6 +1547,11 @@ data class LongClass (
15501547 val long: Long
15511548 )
15521549
1550+data class MakeDictEncoder (
1551+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
1552+ val makeDictEncoder: Long
1553+)
1554+
15531555 data class MapClass (
15541556 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
15551557 val map: Long
@@ -1605,16 +1607,6 @@ data class Newtonsoft (
16051607 val newtonsoft: Long
16061608 )
16071609
1608-data class Nil (
1609- @get:JsonProperty(required=true)@field:JsonProperty(required=true)
1610- val nil: Long
1611-)
1612-
1613-data class No (
1614- @get:JsonProperty("NO", required=true)@field:JsonProperty("NO", required=true)
1615- val no: Long
1616-)
1617-
16181610 data class If (
16191611 @get:JsonProperty("if", required=true)@field:JsonProperty("if", required=true)
16201612 val ifIf: Long
@@ -1639,6 +1631,12 @@ data class Obj4 (
16391631 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
16401632 val dummy: Long,
16411633
1634+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
1635+ val nil: Nil,
1636+
1637+ @get:JsonProperty("NO", required=true)@field:JsonProperty("NO", required=true)
1638+ val no: No,
1639+
16421640 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
16431641 val noSuchMethod: NoSuchMethod,
16441642
@@ -1823,13 +1821,17 @@ data class Obj4 (
18231821 val s: S,
18241822
18251823 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
1826- val sbyte: Sbyte,
1824+ val sbyte: Sbyte
1825+)
18271826
1827+data class Nil (
18281828 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
1829- val sealed: Sealed,
1829+ val nil: Long
1830+)
18301831
1831- @get:JsonProperty("SEL", required=true)@field:JsonProperty("SEL", required=true)
1832- val sel: Sel
1832+data class No (
1833+ @get:JsonProperty("NO", required=true)@field:JsonProperty("NO", required=true)
1834+ val no: Long
18331835 )
18341836
18351837 data class NoSuchMethod (
@@ -2142,16 +2144,6 @@ data class Sbyte (
21422144 val sbyte: Long
21432145 )
21442146
2145-data class Sealed (
2146- @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2147- val sealed: Long
2148-)
2149-
2150-data class Sel (
2151- @get:JsonProperty("SEL", required=true)@field:JsonProperty("SEL", required=true)
2152- val sel: Long
2153-)
2154-
21552147 data class Obj5 (
21562148 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
21572149 val dummy: Long,
@@ -2192,6 +2184,12 @@ data class Obj5 (
21922184 @get:JsonProperty("true", required=true)@field:JsonProperty("true", required=true)
21932185 val purpleTrue: TrueClass,
21942186
2187+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2188+ val sealed: Sealed,
2189+
2190+ @get:JsonProperty("SEL", required=true)@field:JsonProperty("SEL", required=true)
2191+ val sel: Sel,
2192+
21952193 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
21962194 val select: Select,
21972195
@@ -2340,16 +2338,7 @@ data class Obj5 (
23402338 val union: Union,
23412339
23422340 @get:JsonProperty("UnmarshalJSON", required=true)@field:JsonProperty("UnmarshalJSON", required=true)
2343- val unmarshalJSON: UnmarshalJSON,
2344-
2345- @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2346- val unowned: Unowned,
2347-
2348- @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2349- val unsafe: Unsafe,
2350-
2351- @get:JsonProperty("UseSerializers", required=true)@field:JsonProperty("UseSerializers", required=true)
2352- val useSerializers: UseSerializers
2341+ val unmarshalJSON: UnmarshalJSON
23532342 )
23542343
23552344 data class KSerializer (
@@ -2412,6 +2401,16 @@ data class TrueClass (
24122401 val trueTrue: Long
24132402 )
24142403
2404+data class Sealed (
2405+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2406+ val sealed: Long
2407+)
2408+
2409+data class Sel (
2410+ @get:JsonProperty("SEL", required=true)@field:JsonProperty("SEL", required=true)
2411+ val sel: Long
2412+)
2413+
24152414 data class Select (
24162415 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
24172416 val select: Long
@@ -2662,21 +2661,6 @@ data class UnmarshalJSON (
26622661 val unmarshalJSON: Long
26632662 )
26642663
2665-data class Unowned (
2666- @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2667- val unowned: Long
2668-)
2669-
2670-data class Unsafe (
2671- @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2672- val unsafe: Long
2673-)
2674-
2675-data class UseSerializers (
2676- @get:JsonProperty("UseSerializers", required=true)@field:JsonProperty("UseSerializers", required=true)
2677- val useSerializers: Long
2678-)
2679-
26802664 data class Obj6 (
26812665 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
26822666 val dummy: Long,
@@ -2687,9 +2671,18 @@ data class Obj6 (
26872671 @get:JsonProperty("while", required=true)@field:JsonProperty("while", required=true)
26882672 val obj6While: While,
26892673
2674+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2675+ val unowned: Unowned,
2676+
2677+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2678+ val unsafe: Unsafe,
2679+
26902680 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
26912681 val unsigned: Unsigned,
26922682
2683+ @get:JsonProperty("UseSerializers", required=true)@field:JsonProperty("UseSerializers", required=true)
2684+ val useSerializers: UseSerializers,
2685+
26932686 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
26942687 val ushort: Ushort,
26952688
@@ -2752,11 +2745,26 @@ data class While (
27522745 val whileWhile: Long
27532746 )
27542747
2748+data class Unowned (
2749+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2750+ val unowned: Long
2751+)
2752+
2753+data class Unsafe (
2754+ @get:JsonProperty(required=true)@field:JsonProperty(required=true)
2755+ val unsafe: Long
2756+)
2757+
27552758 data class Unsigned (
27562759 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
27572760 val unsigned: Long
27582761 )
27592762
2763+data class UseSerializers (
2764+ @get:JsonProperty("UseSerializers", required=true)@field:JsonProperty("UseSerializers", required=true)
2765+ val useSerializers: Long
2766+)
2767+
27602768 data class Ushort (
27612769 @get:JsonProperty(required=true)@field:JsonProperty(required=true)
27622770 val ushort: Long
Mkotlindefault / TopLevel.kt+53 −46
@@ -956,6 +956,7 @@ data class Obj3 (
956956
957957 val lock: Lock,
958958 val long: LongClass,
959+ val makeDictEncoder: MakeDictEncoder,
959960 val map: MapClass,
960961
961962 @Json(name = "MapEntry")
@@ -974,10 +975,6 @@ data class Obj3 (
974975 val native: Native,
975976 val new: New,
976977 val newtonsoft: Newtonsoft,
977- val nil: Nil,
978-
979- @Json(name = "NO")
980- val no: No,
981978
982979 @Json(name = "if")
983980 val obj3If: If,
@@ -1204,6 +1201,10 @@ data class LongClass (
12041201 val long: Long
12051202 )
12061203
1204+data class MakeDictEncoder (
1205+ val makeDictEncoder: Long
1206+)
1207+
12071208 data class MapClass (
12081209 val map: Long
12091210 )
@@ -1251,15 +1252,6 @@ data class Newtonsoft (
12511252 val newtonsoft: Long
12521253 )
12531254
1254-data class Nil (
1255- val nil: Long
1256-)
1257-
1258-data class No (
1259- @Json(name = "NO")
1260- val no: Long
1261-)
1262-
12631255 data class If (
12641256 @Json(name = "if")
12651257 val ifIf: Long
@@ -1282,6 +1274,11 @@ data class Is (
12821274
12831275 data class Obj4 (
12841276 val dummy: Long,
1277+ val nil: Nil,
1278+
1279+ @Json(name = "NO")
1280+ val no: No,
1281+
12851282 val noSuchMethod: NoSuchMethod,
12861283 val noexcept: Noexcept,
12871284 val nonatomic: Nonatomic,
@@ -1384,11 +1381,16 @@ data class Obj4 (
13841381 val right: Right,
13851382 val runtimeType: RuntimeType,
13861383 val s: S,
1387- val sbyte: Sbyte,
1388- val sealed: Sealed,
1384+ val sbyte: Sbyte
1385+)
13891386
1390- @Json(name = "SEL")
1391- val sel: Sel
1387+data class Nil (
1388+ val nil: Long
1389+)
1390+
1391+data class No (
1392+ @Json(name = "NO")
1393+ val no: Long
13921394 )
13931395
13941396 data class NoSuchMethod (
@@ -1654,15 +1656,6 @@ data class Sbyte (
16541656 val sbyte: Long
16551657 )
16561658
1657-data class Sealed (
1658- val sealed: Long
1659-)
1660-
1661-data class Sel (
1662- @Json(name = "SEL")
1663- val sel: Long
1664-)
1665-
16661659 data class Obj5 (
16671660 val dummy: Long,
16681661
@@ -1702,6 +1695,11 @@ data class Obj5 (
17021695 @Json(name = "true")
17031696 val purpleTrue: TrueClass,
17041697
1698+ val sealed: Sealed,
1699+
1700+ @Json(name = "SEL")
1701+ val sel: Sel,
1702+
17051703 val select: Select,
17061704
17071705 @Json(name = "Self")
@@ -1802,13 +1800,7 @@ data class Obj5 (
18021800 val union: Union,
18031801
18041802 @Json(name = "UnmarshalJSON")
1805- val unmarshalJSON: UnmarshalJSON,
1806-
1807- val unowned: Unowned,
1808- val unsafe: Unsafe,
1809-
1810- @Json(name = "UseSerializers")
1811- val useSerializers: UseSerializers
1803+ val unmarshalJSON: UnmarshalJSON
18121804 )
18131805
18141806 data class KSerializer (
@@ -1869,6 +1861,15 @@ data class TrueClass (
18691861 val trueTrue: Long
18701862 )
18711863
1864+data class Sealed (
1865+ val sealed: Long
1866+)
1867+
1868+data class Sel (
1869+ @Json(name = "SEL")
1870+ val sel: Long
1871+)
1872+
18721873 data class Select (
18731874 val select: Long
18741875 )
@@ -2090,19 +2091,6 @@ data class UnmarshalJSON (
20902091 val unmarshalJSON: Long
20912092 )
20922093
2093-data class Unowned (
2094- val unowned: Long
2095-)
2096-
2097-data class Unsafe (
2098- val unsafe: Long
2099-)
2100-
2101-data class UseSerializers (
2102- @Json(name = "UseSerializers")
2103- val useSerializers: Long
2104-)
2105-
21062094 data class Obj6 (
21072095 val dummy: Long,
21082096
@@ -2112,7 +2100,13 @@ data class Obj6 (
21122100 @Json(name = "while")
21132101 val obj6While: While,
21142102
2103+ val unowned: Unowned,
2104+ val unsafe: Unsafe,
21152105 val unsigned: Unsigned,
2106+
2107+ @Json(name = "UseSerializers")
2108+ val useSerializers: UseSerializers,
2109+
21162110 val ushort: Ushort,
21172111 val using: Using,
21182112
@@ -2157,10 +2151,23 @@ data class While (
21572151 val whileWhile: Long
21582152 )
21592153
2154+data class Unowned (
2155+ val unowned: Long
2156+)
2157+
2158+data class Unsafe (
2159+ val unsafe: Long
2160+)
2161+
21602162 data class Unsigned (
21612163 val unsigned: Long
21622164 )
21632165
2166+data class UseSerializers (
2167+ @Json(name = "UseSerializers")
2168+ val useSerializers: Long
2169+)
2170+
21642171 data class Ushort (
21652172 val ushort: Long
21662173 )
Mkotlinxdefault / TopLevel.kt+61 −53
@@ -1069,6 +1069,7 @@ data class Obj3 (
10691069
10701070 val lock: Lock,
10711071 val long: LongClass,
1072+ val makeDictEncoder: MakeDictEncoder,
10721073 val map: MapClass,
10731074
10741075 @SerialName("MapEntry")
@@ -1087,10 +1088,6 @@ data class Obj3 (
10871088 val native: Native,
10881089 val new: New,
10891090 val newtonsoft: Newtonsoft,
1090- val nil: Nil,
1091-
1092- @SerialName("NO")
1093- val no: No,
10941091
10951092 @SerialName("if")
10961093 val obj3If: If,
@@ -1365,6 +1362,11 @@ data class LongClass (
13651362 val long: Long
13661363 )
13671364
1365+@Serializable
1366+data class MakeDictEncoder (
1367+ val makeDictEncoder: Long
1368+)
1369+
13681370 @Serializable
13691371 data class MapClass (
13701372 val map: Long
@@ -1423,17 +1425,6 @@ data class Newtonsoft (
14231425 val newtonsoft: Long
14241426 )
14251427
1426-@Serializable
1427-data class Nil (
1428- val nil: Long
1429-)
1430-
1431-@Serializable
1432-data class No (
1433- @SerialName("NO")
1434- val no: Long
1435-)
1436-
14371428 @Serializable
14381429 data class If (
14391430 @SerialName("if")
@@ -1461,6 +1452,11 @@ data class Is (
14611452 @Serializable
14621453 data class Obj4 (
14631454 val dummy: Long,
1455+ val nil: Nil,
1456+
1457+ @SerialName("NO")
1458+ val no: No,
1459+
14641460 val noSuchMethod: NoSuchMethod,
14651461 val noexcept: Noexcept,
14661462 val nonatomic: Nonatomic,
@@ -1563,11 +1559,18 @@ data class Obj4 (
15631559 val right: Right,
15641560 val runtimeType: RuntimeType,
15651561 val s: S,
1566- val sbyte: Sbyte,
1567- val sealed: Sealed,
1562+ val sbyte: Sbyte
1563+)
15681564
1569- @SerialName("SEL")
1570- val sel: Sel
1565+@Serializable
1566+data class Nil (
1567+ val nil: Long
1568+)
1569+
1570+@Serializable
1571+data class No (
1572+ @SerialName("NO")
1573+ val no: Long
15711574 )
15721575
15731576 @Serializable
@@ -1895,17 +1898,6 @@ data class Sbyte (
18951898 val sbyte: Long
18961899 )
18971900
1898-@Serializable
1899-data class Sealed (
1900- val sealed: Long
1901-)
1902-
1903-@Serializable
1904-data class Sel (
1905- @SerialName("SEL")
1906- val sel: Long
1907-)
1908-
19091901 @Serializable
19101902 data class Obj5 (
19111903 val dummy: Long,
@@ -1946,6 +1938,11 @@ data class Obj5 (
19461938 @SerialName("true")
19471939 val purpleTrue: TrueClass,
19481940
1941+ val sealed: Sealed,
1942+
1943+ @SerialName("SEL")
1944+ val sel: Sel,
1945+
19491946 val select: Select,
19501947
19511948 @SerialName("Self")
@@ -2046,13 +2043,7 @@ data class Obj5 (
20462043 val union: Union,
20472044
20482045 @SerialName("UnmarshalJSON")
2049- val unmarshalJSON: UnmarshalJSON,
2050-
2051- val unowned: Unowned,
2052- val unsafe: Unsafe,
2053-
2054- @SerialName("UseSerializers")
2055- val useSerializers: UseSerializersClass
2046+ val unmarshalJSON: UnmarshalJSON
20562047 )
20572048
20582049 @Serializable
@@ -2125,6 +2116,17 @@ data class TrueClass (
21252116 val trueTrue: Long
21262117 )
21272118
2119+@Serializable
2120+data class Sealed (
2121+ val sealed: Long
2122+)
2123+
2124+@Serializable
2125+data class Sel (
2126+ @SerialName("SEL")
2127+ val sel: Long
2128+)
2129+
21282130 @Serializable
21292131 data class Select (
21302132 val select: Long
@@ -2396,22 +2398,6 @@ data class UnmarshalJSON (
23962398 val unmarshalJSON: Long
23972399 )
23982400
2399-@Serializable
2400-data class Unowned (
2401- val unowned: Long
2402-)
2403-
2404-@Serializable
2405-data class Unsafe (
2406- val unsafe: Long
2407-)
2408-
2409-@Serializable
2410-data class UseSerializersClass (
2411- @SerialName("UseSerializers")
2412- val useSerializers: Long
2413-)
2414-
24152401 @Serializable
24162402 data class Obj6 (
24172403 val dummy: Long,
@@ -2422,7 +2408,13 @@ data class Obj6 (
24222408 @SerialName("while")
24232409 val obj6While: While,
24242410
2411+ val unowned: Unowned,
2412+ val unsafe: Unsafe,
24252413 val unsigned: Unsigned,
2414+
2415+ @SerialName("UseSerializers")
2416+ val useSerializers: UseSerializersClass,
2417+
24262418 val ushort: Ushort,
24272419 val using: Using,
24282420
@@ -2469,11 +2461,27 @@ data class While (
24692461 val whileWhile: Long
24702462 )
24712463
2464+@Serializable
2465+data class Unowned (
2466+ val unowned: Long
2467+)
2468+
2469+@Serializable
2470+data class Unsafe (
2471+ val unsafe: Long
2472+)
2473+
24722474 @Serializable
24732475 data class Unsigned (
24742476 val unsigned: Long
24752477 )
24762478
2479+@Serializable
2480+data class UseSerializersClass (
2481+ @SerialName("UseSerializers")
2482+ val useSerializers: Long
2483+)
2484+
24772485 @Serializable
24782486 data class Ushort (
24792487 val ushort: Long
Mobjective-cdefault / QTTopLevel.h+48 −42
@@ -183,6 +183,7 @@
183183 @class QTList;
184184 @class QTLocale;
185185 @class QTLock;
186+@class QTMakeDictEncoder;
186187 @class QTMap;
187188 @class QTMapEntry;
188189 @class QTMarshalJSON;
@@ -193,17 +194,16 @@
193194 @class QTNamespace;
194195 @class QTNative;
195196 @class QTNewtonsoft;
196-@class QTNo;
197197 @class QTGoto;
198198 @class QTIf;
199199 @class QTInline;
200200 @class QTInt;
201201 @class QTLong;
202-@class QTNil;
203202 @class QTHashCode;
204203 @class QTInit;
205204 @class QTNew;
206205 @class QTObj4;
206+@class QTNo;
207207 @class QTNoSuchMethod;
208208 @class QTNoexcept;
209209 @class QTNone;
@@ -217,6 +217,7 @@
217217 @class QTNull;
218218 @class QTNullptr;
219219 @class QTNumber;
220+@class QTNil;
220221 @class QTNonatomic;
221222 @class QTNoneClass;
222223 @class QTNullClass;
@@ -266,8 +267,6 @@
266267 @class QTRuntimeType;
267268 @class QTS;
268269 @class QTSbyte;
269-@class QTSealed;
270-@class QTSel;
271270 @class QTObj5;
272271 @class QTKSerializer;
273272 @class QTSelfClass;
@@ -283,6 +282,8 @@
283282 @class QTTypeof;
284283 @class QTUnion;
285284 @class QTPrimitiveKind;
285+@class QTSealed;
286+@class QTSel;
286287 @class QTSelect;
287288 @class QTSelf;
288289 @class QTSendable;
@@ -331,14 +332,14 @@
331332 @class QTUnchecked;
332333 @class QTUndefined;
333334 @class QTUnmarshalJSON;
334-@class QTUnowned;
335-@class QTUnsafe;
336-@class QTUseSerializers;
337335 @class QTObj6;
338336 @class QTUnsigned;
339337 @class QTVoid;
340338 @class QTVolatile;
341339 @class QTWhile;
340+@class QTUnowned;
341+@class QTUnsafe;
342+@class QTUseSerializers;
342343 @class QTUshort;
343344 @class QTUsing;
344345 @class QTUtf8JSONReader;
@@ -1086,6 +1087,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
10861087 @property (nonatomic, strong) QTList *list;
10871088 @property (nonatomic, strong) QTLocale *locale;
10881089 @property (nonatomic, strong) QTLock *lock;
1090+@property (nonatomic, strong) QTMakeDictEncoder *makeDictEncoder;
10891091 @property (nonatomic, strong) QTMap *map;
10901092 @property (nonatomic, strong) QTMapEntry *mapEntry;
10911093 @property (nonatomic, strong) QTMarshalJSON *marshalJSON;
@@ -1096,13 +1098,11 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
10961098 @property (nonatomic, strong) QTNamespace *namespace;
10971099 @property (nonatomic, strong) QTNative *native;
10981100 @property (nonatomic, strong) QTNewtonsoft *newtonsoft;
1099-@property (nonatomic, strong) QTNo *no;
11001101 @property (nonatomic, strong) QTGoto *obj3Goto;
11011102 @property (nonatomic, strong) QTIf *obj3If;
11021103 @property (nonatomic, strong) QTInline *obj3Inline;
11031104 @property (nonatomic, strong) QTInt *obj3Int;
11041105 @property (nonatomic, strong) QTLong *obj3Long;
1105-@property (nonatomic, strong) QTNil *obj3Nil;
11061106 @property (nonatomic, strong) QTHashCode *theHashCode;
11071107 @property (nonatomic, strong) QTInit *theInit;
11081108 @property (nonatomic, strong) QTNew *theNew;
@@ -1288,6 +1288,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
12881288 @property (nonatomic, assign) NSInteger lock;
12891289 @end
12901290
1291+@interface QTMakeDictEncoder : NSObject
1292+@property (nonatomic, assign) NSInteger makeDictEncoder;
1293+@end
1294+
12911295 @interface QTMap : NSObject
12921296 @property (nonatomic, assign) NSInteger map;
12931297 @end
@@ -1328,10 +1332,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
13281332 @property (nonatomic, assign) NSInteger newtonsoft;
13291333 @end
13301334
1331-@interface QTNo : NSObject
1332-@property (nonatomic, assign) NSInteger no;
1333-@end
1334-
13351335 @interface QTGoto : NSObject
13361336 @property (nonatomic, assign) NSInteger gotoGoto;
13371337 @end
@@ -1352,10 +1352,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
13521352 @property (nonatomic, assign) NSInteger longLong;
13531353 @end
13541354
1355-@interface QTNil : NSObject
1356-@property (nonatomic, assign) NSInteger nilNil;
1357-@end
1358-
13591355 @interface QTHashCode : NSObject
13601356 @property (nonatomic, assign) NSInteger theHashCode;
13611357 @end
@@ -1370,6 +1366,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
13701366
13711367 @interface QTObj4 : NSObject
13721368 @property (nonatomic, assign) NSInteger dummy;
1369+@property (nonatomic, strong) QTNo *no;
13731370 @property (nonatomic, strong) QTNoSuchMethod *noSuchMethod;
13741371 @property (nonatomic, strong) QTNoexcept *noexcept;
13751372 @property (nonatomic, strong) QTNone *none;
@@ -1383,6 +1380,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
13831380 @property (nonatomic, strong) QTNull *null;
13841381 @property (nonatomic, strong) QTNullptr *nullptr;
13851382 @property (nonatomic, strong) QTNumber *number;
1383+@property (nonatomic, strong) QTNil *obj4Nil;
13861384 @property (nonatomic, strong) QTNonatomic *obj4Nonatomic;
13871385 @property (nonatomic, strong) QTNoneClass *obj4None;
13881386 @property (nonatomic, strong) QTNullClass *obj4Null;
@@ -1432,8 +1430,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
14321430 @property (nonatomic, strong) QTRuntimeType *runtimeType;
14331431 @property (nonatomic, strong) QTS *s;
14341432 @property (nonatomic, strong) QTSbyte *sbyte;
1435-@property (nonatomic, strong) QTSealed *sealed;
1436-@property (nonatomic, strong) QTSel *sel;
1433+@end
1434+
1435+@interface QTNo : NSObject
1436+@property (nonatomic, assign) NSInteger no;
14371437 @end
14381438
14391439 @interface QTNoSuchMethod : NSObject
@@ -1488,6 +1488,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
14881488 @property (nonatomic, assign) NSInteger number;
14891489 @end
14901490
1491+@interface QTNil : NSObject
1492+@property (nonatomic, assign) NSInteger nilNil;
1493+@end
1494+
14911495 @interface QTNonatomic : NSObject
14921496 @property (nonatomic, assign) NSInteger nonatomicNonatomic;
14931497 @end
@@ -1684,14 +1688,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
16841688 @property (nonatomic, assign) NSInteger sbyte;
16851689 @end
16861690
1687-@interface QTSealed : NSObject
1688-@property (nonatomic, assign) NSInteger sealed;
1689-@end
1690-
1691-@interface QTSel : NSObject
1692-@property (nonatomic, assign) NSInteger sel;
1693-@end
1694-
16951691 @interface QTObj5 : NSObject
16961692 @property (nonatomic, assign) NSInteger dummy;
16971693 @property (nonatomic, strong) QTKSerializer *kSerializer;
@@ -1708,6 +1704,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
17081704 @property (nonatomic, strong) QTTypeof *obj5Typeof;
17091705 @property (nonatomic, strong) QTUnion *obj5Union;
17101706 @property (nonatomic, strong) QTPrimitiveKind *primitiveKind;
1707+@property (nonatomic, strong) QTSealed *sealed;
1708+@property (nonatomic, strong) QTSel *sel;
17111709 @property (nonatomic, strong) QTSelect *select;
17121710 @property (nonatomic, strong) QTSelf *self;
17131711 @property (nonatomic, strong) QTSendable *sendable;
@@ -1756,9 +1754,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
17561754 @property (nonatomic, strong) QTUnchecked *unchecked;
17571755 @property (nonatomic, strong) QTUndefined *undefined;
17581756 @property (nonatomic, strong) QTUnmarshalJSON *unmarshalJSON;
1759-@property (nonatomic, strong) QTUnowned *unowned;
1760-@property (nonatomic, strong) QTUnsafe *unsafe;
1761-@property (nonatomic, strong) QTUseSerializers *useSerializers;
17621757 @end
17631758
17641759 @interface QTKSerializer : NSObject
@@ -1817,6 +1812,14 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
18171812 @property (nonatomic, assign) NSInteger primitiveKind;
18181813 @end
18191814
1815+@interface QTSealed : NSObject
1816+@property (nonatomic, assign) NSInteger sealed;
1817+@end
1818+
1819+@interface QTSel : NSObject
1820+@property (nonatomic, assign) NSInteger sel;
1821+@end
1822+
18201823 @interface QTSelect : NSObject
18211824 @property (nonatomic, assign) NSInteger select;
18221825 @end
@@ -2009,24 +2012,15 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
20092012 @property (nonatomic, assign) NSInteger unmarshalJSON;
20102013 @end
20112014
2012-@interface QTUnowned : NSObject
2013-@property (nonatomic, assign) NSInteger unowned;
2014-@end
2015-
2016-@interface QTUnsafe : NSObject
2017-@property (nonatomic, assign) NSInteger unsafe;
2018-@end
2019-
2020-@interface QTUseSerializers : NSObject
2021-@property (nonatomic, assign) NSInteger useSerializers;
2022-@end
2023-
20242015 @interface QTObj6 : NSObject
20252016 @property (nonatomic, assign) NSInteger dummy;
20262017 @property (nonatomic, strong) QTUnsigned *obj6Unsigned;
20272018 @property (nonatomic, strong) QTVoid *obj6Void;
20282019 @property (nonatomic, strong) QTVolatile *obj6Volatile;
20292020 @property (nonatomic, strong) QTWhile *obj6While;
2021+@property (nonatomic, strong) QTUnowned *unowned;
2022+@property (nonatomic, strong) QTUnsafe *unsafe;
2023+@property (nonatomic, strong) QTUseSerializers *useSerializers;
20302024 @property (nonatomic, strong) QTUshort *ushort;
20312025 @property (nonatomic, strong) QTUsing *using;
20322026 @property (nonatomic, strong) QTUtf8JSONReader *utf8JSONReader;
@@ -2061,6 +2055,18 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
20612055 @property (nonatomic, assign) NSInteger whileWhile;
20622056 @end
20632057
2058+@interface QTUnowned : NSObject
2059+@property (nonatomic, assign) NSInteger unowned;
2060+@end
2061+
2062+@interface QTUnsafe : NSObject
2063+@property (nonatomic, assign) NSInteger unsafe;
2064+@end
2065+
2066+@interface QTUseSerializers : NSObject
2067+@property (nonatomic, assign) NSInteger useSerializers;
2068+@end
2069+
20642070 @interface QTUshort : NSObject
20652071 @property (nonatomic, assign) NSInteger ushort;
20662072 @end
Mobjective-cdefault / QTTopLevel.m+484 −432
@@ -893,6 +893,11 @@ NS_ASSUME_NONNULL_BEGIN
893893 - (NSDictionary *)JSONDictionary;
894894 @end
895895
896+@interface QTMakeDictEncoder (JSONConversion)
897++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
898+- (NSDictionary *)JSONDictionary;
899+@end
900+
896901 @interface QTMap (JSONConversion)
897902 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
898903 - (NSDictionary *)JSONDictionary;
@@ -943,11 +948,6 @@ NS_ASSUME_NONNULL_BEGIN
943948 - (NSDictionary *)JSONDictionary;
944949 @end
945950
946-@interface QTNo (JSONConversion)
947-+ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
948-- (NSDictionary *)JSONDictionary;
949-@end
950-
951951 @interface QTGoto (JSONConversion)
952952 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
953953 - (NSDictionary *)JSONDictionary;
@@ -973,11 +973,6 @@ NS_ASSUME_NONNULL_BEGIN
973973 - (NSDictionary *)JSONDictionary;
974974 @end
975975
976-@interface QTNil (JSONConversion)
977-+ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
978-- (NSDictionary *)JSONDictionary;
979-@end
980-
981976 @interface QTHashCode (JSONConversion)
982977 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
983978 - (NSDictionary *)JSONDictionary;
@@ -998,6 +993,11 @@ NS_ASSUME_NONNULL_BEGIN
998993 - (NSDictionary *)JSONDictionary;
999994 @end
1000995
996+@interface QTNo (JSONConversion)
997++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
998+- (NSDictionary *)JSONDictionary;
999+@end
1000+
10011001 @interface QTNoSuchMethod (JSONConversion)
10021002 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
10031003 - (NSDictionary *)JSONDictionary;
@@ -1063,6 +1063,11 @@ NS_ASSUME_NONNULL_BEGIN
10631063 - (NSDictionary *)JSONDictionary;
10641064 @end
10651065
1066+@interface QTNil (JSONConversion)
1067++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
1068+- (NSDictionary *)JSONDictionary;
1069+@end
1070+
10661071 @interface QTNonatomic (JSONConversion)
10671072 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
10681073 - (NSDictionary *)JSONDictionary;
@@ -1308,16 +1313,6 @@ NS_ASSUME_NONNULL_BEGIN
13081313 - (NSDictionary *)JSONDictionary;
13091314 @end
13101315
1311-@interface QTSealed (JSONConversion)
1312-+ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
1313-- (NSDictionary *)JSONDictionary;
1314-@end
1315-
1316-@interface QTSel (JSONConversion)
1317-+ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
1318-- (NSDictionary *)JSONDictionary;
1319-@end
1320-
13211316 @interface QTObj5 (JSONConversion)
13221317 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
13231318 - (NSDictionary *)JSONDictionary;
@@ -1393,6 +1388,16 @@ NS_ASSUME_NONNULL_BEGIN
13931388 - (NSDictionary *)JSONDictionary;
13941389 @end
13951390
1391+@interface QTSealed (JSONConversion)
1392++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
1393+- (NSDictionary *)JSONDictionary;
1394+@end
1395+
1396+@interface QTSel (JSONConversion)
1397++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
1398+- (NSDictionary *)JSONDictionary;
1399+@end
1400+
13961401 @interface QTSelect (JSONConversion)
13971402 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
13981403 - (NSDictionary *)JSONDictionary;
@@ -1633,42 +1638,42 @@ NS_ASSUME_NONNULL_BEGIN
16331638 - (NSDictionary *)JSONDictionary;
16341639 @end
16351640
1636-@interface QTUnowned (JSONConversion)
1641+@interface QTObj6 (JSONConversion)
16371642 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
16381643 - (NSDictionary *)JSONDictionary;
16391644 @end
16401645
1641-@interface QTUnsafe (JSONConversion)
1646+@interface QTUnsigned (JSONConversion)
16421647 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
16431648 - (NSDictionary *)JSONDictionary;
16441649 @end
16451650
1646-@interface QTUseSerializers (JSONConversion)
1651+@interface QTVoid (JSONConversion)
16471652 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
16481653 - (NSDictionary *)JSONDictionary;
16491654 @end
16501655
1651-@interface QTObj6 (JSONConversion)
1656+@interface QTVolatile (JSONConversion)
16521657 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
16531658 - (NSDictionary *)JSONDictionary;
16541659 @end
16551660
1656-@interface QTUnsigned (JSONConversion)
1661+@interface QTWhile (JSONConversion)
16571662 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
16581663 - (NSDictionary *)JSONDictionary;
16591664 @end
16601665
1661-@interface QTVoid (JSONConversion)
1666+@interface QTUnowned (JSONConversion)
16621667 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
16631668 - (NSDictionary *)JSONDictionary;
16641669 @end
16651670
1666-@interface QTVolatile (JSONConversion)
1671+@interface QTUnsafe (JSONConversion)
16671672 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
16681673 - (NSDictionary *)JSONDictionary;
16691674 @end
16701675
1671-@interface QTWhile (JSONConversion)
1676+@interface QTUseSerializers (JSONConversion)
16721677 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
16731678 - (NSDictionary *)JSONDictionary;
16741679 @end
@@ -8686,6 +8691,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
86868691 @"list": @"list",
86878692 @"Locale": @"locale",
86888693 @"lock": @"lock",
8694+ @"makeDictEncoder": @"makeDictEncoder",
86898695 @"map": @"map",
86908696 @"MapEntry": @"mapEntry",
86918697 @"MarshalJSON": @"marshalJSON",
@@ -8696,13 +8702,11 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
86968702 @"namespace": @"namespace",
86978703 @"native": @"native",
86988704 @"newtonsoft": @"newtonsoft",
8699- @"NO": @"no",
87008705 @"goto": @"obj3Goto",
87018706 @"if": @"obj3If",
87028707 @"inline": @"obj3Inline",
87038708 @"int": @"obj3Int",
87048709 @"long": @"obj3Long",
8705- @"nil": @"obj3Nil",
87068710 @"hashCode": @"theHashCode",
87078711 @"init": @"theInit",
87088712 @"new": @"theNew",
@@ -8764,6 +8768,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
87648768 if (![dict[@"list"] isKindOfClass:NSDictionary.class]) return nil;
87658769 if (![dict[@"Locale"] isKindOfClass:NSDictionary.class]) return nil;
87668770 if (![dict[@"lock"] isKindOfClass:NSDictionary.class]) return nil;
8771+ if (![dict[@"makeDictEncoder"] isKindOfClass:NSDictionary.class]) return nil;
87678772 if (![dict[@"map"] isKindOfClass:NSDictionary.class]) return nil;
87688773 if (![dict[@"MapEntry"] isKindOfClass:NSDictionary.class]) return nil;
87698774 if (![dict[@"MarshalJSON"] isKindOfClass:NSDictionary.class]) return nil;
@@ -8774,13 +8779,11 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
87748779 if (![dict[@"namespace"] isKindOfClass:NSDictionary.class]) return nil;
87758780 if (![dict[@"native"] isKindOfClass:NSDictionary.class]) return nil;
87768781 if (![dict[@"newtonsoft"] isKindOfClass:NSDictionary.class]) return nil;
8777- if (![dict[@"NO"] isKindOfClass:NSDictionary.class]) return nil;
87788782 if (![dict[@"goto"] isKindOfClass:NSDictionary.class]) return nil;
87798783 if (![dict[@"if"] isKindOfClass:NSDictionary.class]) return nil;
87808784 if (![dict[@"inline"] isKindOfClass:NSDictionary.class]) return nil;
87818785 if (![dict[@"int"] isKindOfClass:NSDictionary.class]) return nil;
87828786 if (![dict[@"long"] isKindOfClass:NSDictionary.class]) return nil;
8783- if (![dict[@"nil"] isKindOfClass:NSDictionary.class]) return nil;
87848787 if (![dict[@"hashCode"] isKindOfClass:NSDictionary.class]) return nil;
87858788 if (![dict[@"init"] isKindOfClass:NSDictionary.class]) return nil;
87868789 if (![dict[@"new"] isKindOfClass:NSDictionary.class]) return nil;
@@ -8875,6 +8878,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
88758878 if (!_locale && dict[@"Locale"] && ![dict[@"Locale"] isKindOfClass:NSNull.class]) return nil;
88768879 _lock = [QTLock fromJSONDictionary:(id)_lock];
88778880 if (!_lock && dict[@"lock"] && ![dict[@"lock"] isKindOfClass:NSNull.class]) return nil;
8881+ _makeDictEncoder = [QTMakeDictEncoder fromJSONDictionary:(id)_makeDictEncoder];
8882+ if (!_makeDictEncoder && dict[@"makeDictEncoder"] && ![dict[@"makeDictEncoder"] isKindOfClass:NSNull.class]) return nil;
88788883 _map = [QTMap fromJSONDictionary:(id)_map];
88798884 if (!_map && dict[@"map"] && ![dict[@"map"] isKindOfClass:NSNull.class]) return nil;
88808885 _mapEntry = [QTMapEntry fromJSONDictionary:(id)_mapEntry];
@@ -8895,8 +8900,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
88958900 if (!_native && dict[@"native"] && ![dict[@"native"] isKindOfClass:NSNull.class]) return nil;
88968901 _newtonsoft = [QTNewtonsoft fromJSONDictionary:(id)_newtonsoft];
88978902 if (!_newtonsoft && dict[@"newtonsoft"] && ![dict[@"newtonsoft"] isKindOfClass:NSNull.class]) return nil;
8898- _no = [QTNo fromJSONDictionary:(id)_no];
8899- if (!_no && dict[@"NO"] && ![dict[@"NO"] isKindOfClass:NSNull.class]) return nil;
89008903 _obj3Goto = [QTGoto fromJSONDictionary:(id)_obj3Goto];
89018904 if (!_obj3Goto && dict[@"goto"] && ![dict[@"goto"] isKindOfClass:NSNull.class]) return nil;
89028905 _obj3If = [QTIf fromJSONDictionary:(id)_obj3If];
@@ -8907,8 +8910,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
89078910 if (!_obj3Int && dict[@"int"] && ![dict[@"int"] isKindOfClass:NSNull.class]) return nil;
89088911 _obj3Long = [QTLong fromJSONDictionary:(id)_obj3Long];
89098912 if (!_obj3Long && dict[@"long"] && ![dict[@"long"] isKindOfClass:NSNull.class]) return nil;
8910- _obj3Nil = [QTNil fromJSONDictionary:(id)_obj3Nil];
8911- if (!_obj3Nil && dict[@"nil"] && ![dict[@"nil"] isKindOfClass:NSNull.class]) return nil;
89128913 _theHashCode = [QTHashCode fromJSONDictionary:(id)_theHashCode];
89138914 if (!_theHashCode && dict[@"hashCode"] && ![dict[@"hashCode"] isKindOfClass:NSNull.class]) return nil;
89148915 _theInit = [QTInit fromJSONDictionary:(id)_theInit];
@@ -8989,6 +8990,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
89898990 @"list": [_list JSONDictionary],
89908991 @"Locale": [_locale JSONDictionary],
89918992 @"lock": [_lock JSONDictionary],
8993+ @"makeDictEncoder": [_makeDictEncoder JSONDictionary],
89928994 @"map": [_map JSONDictionary],
89938995 @"MapEntry": [_mapEntry JSONDictionary],
89948996 @"MarshalJSON": [_marshalJSON JSONDictionary],
@@ -8999,13 +9001,11 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
89999001 @"namespace": [_namespace JSONDictionary],
90009002 @"native": [_native JSONDictionary],
90019003 @"newtonsoft": [_newtonsoft JSONDictionary],
9002- @"NO": [_no JSONDictionary],
90039004 @"goto": [_obj3Goto JSONDictionary],
90049005 @"if": [_obj3If JSONDictionary],
90059006 @"inline": [_obj3Inline JSONDictionary],
90069007 @"int": [_obj3Int JSONDictionary],
90079008 @"long": [_obj3Long JSONDictionary],
9008- @"nil": [_obj3Nil JSONDictionary],
90099009 @"hashCode": [_theHashCode JSONDictionary],
90109010 @"init": [_theInit JSONDictionary],
90119011 @"new": [_theNew JSONDictionary],
@@ -11114,6 +11114,48 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1111411114 }
1111511115 @end
1111611116
11117+@implementation QTMakeDictEncoder
11118++ (NSDictionary<NSString *, NSString *> *)properties
11119+{
11120+ static NSDictionary<NSString *, NSString *> *properties;
11121+ return properties = properties ? properties : @{
11122+ @"makeDictEncoder": @"makeDictEncoder",
11123+ };
11124+}
11125+
11126++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
11127+{
11128+ return [dict isKindOfClass:NSDictionary.class] ? [[QTMakeDictEncoder alloc] initWithJSONDictionary:dict] : nil;
11129+}
11130+
11131+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
11132+{
11133+ if (self = [super init]) {
11134+ if (![dict[@"makeDictEncoder"] isKindOfClass:NSNumber.class]) return nil;
11135+ if ([dict[@"makeDictEncoder"] doubleValue] != [dict[@"makeDictEncoder"] longLongValue]) return nil;
11136+ [self setValuesForKeysWithDictionary:dict];
11137+ }
11138+ return self;
11139+}
11140+
11141+- (void)setValue:(nullable id)value forKey:(NSString *)key
11142+{
11143+ id resolved = QTMakeDictEncoder.properties[key];
11144+ if (resolved) [super setValue:value forKey:resolved];
11145+}
11146+
11147+- (void)setNilValueForKey:(NSString *)key
11148+{
11149+ id resolved = QTMakeDictEncoder.properties[key];
11150+ if (resolved) [super setValue:@(0) forKey:resolved];
11151+}
11152+
11153+- (NSDictionary *)JSONDictionary
11154+{
11155+ return [self dictionaryWithValuesForKeys:QTMakeDictEncoder.properties.allValues];
11156+}
11157+@end
11158+
1111711159 @implementation QTMap
1111811160 + (NSDictionary<NSString *, NSString *> *)properties
1111911161 {
@@ -11564,58 +11606,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1156411606 }
1156511607 @end
1156611608
11567-@implementation QTNo
11568-+ (NSDictionary<NSString *, NSString *> *)properties
11569-{
11570- static NSDictionary<NSString *, NSString *> *properties;
11571- return properties = properties ? properties : @{
11572- @"NO": @"no",
11573- };
11574-}
11575-
11576-+ (instancetype)fromJSONDictionary:(NSDictionary *)dict
11577-{
11578- return [dict isKindOfClass:NSDictionary.class] ? [[QTNo alloc] initWithJSONDictionary:dict] : nil;
11579-}
11580-
11581-- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
11582-{
11583- if (self = [super init]) {
11584- if (![dict[@"NO"] isKindOfClass:NSNumber.class]) return nil;
11585- if ([dict[@"NO"] doubleValue] != [dict[@"NO"] longLongValue]) return nil;
11586- [self setValuesForKeysWithDictionary:dict];
11587- }
11588- return self;
11589-}
11590-
11591-- (void)setValue:(nullable id)value forKey:(NSString *)key
11592-{
11593- id resolved = QTNo.properties[key];
11594- if (resolved) [super setValue:value forKey:resolved];
11595-}
11596-
11597-- (void)setNilValueForKey:(NSString *)key
11598-{
11599- id resolved = QTNo.properties[key];
11600- if (resolved) [super setValue:@(0) forKey:resolved];
11601-}
11602-
11603-- (NSDictionary *)JSONDictionary
11604-{
11605- id dict = [[self dictionaryWithValuesForKeys:QTNo.properties.allValues] mutableCopy];
11606-
11607- for (id jsonName in QTNo.properties) {
11608- id propertyName = QTNo.properties[jsonName];
11609- if (![jsonName isEqualToString:propertyName]) {
11610- dict[jsonName] = dict[propertyName];
11611- [dict removeObjectForKey:propertyName];
11612- }
11613- }
11614-
11615- return dict;
11616-}
11617-@end
11618-
1161911609 @implementation QTGoto
1162011610 + (NSDictionary<NSString *, NSString *> *)properties
1162111611 {
@@ -11876,58 +11866,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1187611866 }
1187711867 @end
1187811868
11879-@implementation QTNil
11880-+ (NSDictionary<NSString *, NSString *> *)properties
11881-{
11882- static NSDictionary<NSString *, NSString *> *properties;
11883- return properties = properties ? properties : @{
11884- @"nil": @"nilNil",
11885- };
11886-}
11887-
11888-+ (instancetype)fromJSONDictionary:(NSDictionary *)dict
11889-{
11890- return [dict isKindOfClass:NSDictionary.class] ? [[QTNil alloc] initWithJSONDictionary:dict] : nil;
11891-}
11892-
11893-- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
11894-{
11895- if (self = [super init]) {
11896- if (![dict[@"nil"] isKindOfClass:NSNumber.class]) return nil;
11897- if ([dict[@"nil"] doubleValue] != [dict[@"nil"] longLongValue]) return nil;
11898- [self setValuesForKeysWithDictionary:dict];
11899- }
11900- return self;
11901-}
11902-
11903-- (void)setValue:(nullable id)value forKey:(NSString *)key
11904-{
11905- id resolved = QTNil.properties[key];
11906- if (resolved) [super setValue:value forKey:resolved];
11907-}
11908-
11909-- (void)setNilValueForKey:(NSString *)key
11910-{
11911- id resolved = QTNil.properties[key];
11912- if (resolved) [super setValue:@(0) forKey:resolved];
11913-}
11914-
11915-- (NSDictionary *)JSONDictionary
11916-{
11917- id dict = [[self dictionaryWithValuesForKeys:QTNil.properties.allValues] mutableCopy];
11918-
11919- for (id jsonName in QTNil.properties) {
11920- id propertyName = QTNil.properties[jsonName];
11921- if (![jsonName isEqualToString:propertyName]) {
11922- dict[jsonName] = dict[propertyName];
11923- [dict removeObjectForKey:propertyName];
11924- }
11925- }
11926-
11927- return dict;
11928-}
11929-@end
11930-
1193111869 @implementation QTHashCode
1193211870 + (NSDictionary<NSString *, NSString *> *)properties
1193311871 {
@@ -12090,6 +12028,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1209012028 static NSDictionary<NSString *, NSString *> *properties;
1209112029 return properties = properties ? properties : @{
1209212030 @"dummy": @"dummy",
12031+ @"NO": @"no",
1209312032 @"noSuchMethod": @"noSuchMethod",
1209412033 @"noexcept": @"noexcept",
1209512034 @"None": @"none",
@@ -12103,6 +12042,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1210312042 @"NULL": @"null",
1210412043 @"nullptr": @"nullptr",
1210512044 @"number": @"number",
12045+ @"nil": @"obj4Nil",
1210612046 @"nonatomic": @"obj4Nonatomic",
1210712047 @"none": @"obj4None",
1210812048 @"null": @"obj4Null",
@@ -12152,8 +12092,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1215212092 @"runtimeType": @"runtimeType",
1215312093 @"s": @"s",
1215412094 @"sbyte": @"sbyte",
12155- @"sealed": @"sealed",
12156- @"SEL": @"sel",
1215712095 };
1215812096 }
1215912097
@@ -12167,6 +12105,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1216712105 if (self = [super init]) {
1216812106 if (![dict[@"dummy"] isKindOfClass:NSNumber.class]) return nil;
1216912107 if ([dict[@"dummy"] doubleValue] != [dict[@"dummy"] longLongValue]) return nil;
12108+ if (![dict[@"NO"] isKindOfClass:NSDictionary.class]) return nil;
1217012109 if (![dict[@"noSuchMethod"] isKindOfClass:NSDictionary.class]) return nil;
1217112110 if (![dict[@"noexcept"] isKindOfClass:NSDictionary.class]) return nil;
1217212111 if (![dict[@"None"] isKindOfClass:NSDictionary.class]) return nil;
@@ -12180,6 +12119,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1218012119 if (![dict[@"NULL"] isKindOfClass:NSDictionary.class]) return nil;
1218112120 if (![dict[@"nullptr"] isKindOfClass:NSDictionary.class]) return nil;
1218212121 if (![dict[@"number"] isKindOfClass:NSDictionary.class]) return nil;
12122+ if (![dict[@"nil"] isKindOfClass:NSDictionary.class]) return nil;
1218312123 if (![dict[@"nonatomic"] isKindOfClass:NSDictionary.class]) return nil;
1218412124 if (![dict[@"none"] isKindOfClass:NSDictionary.class]) return nil;
1218512125 if (![dict[@"null"] isKindOfClass:NSDictionary.class]) return nil;
@@ -12229,9 +12169,9 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1222912169 if (![dict[@"runtimeType"] isKindOfClass:NSDictionary.class]) return nil;
1223012170 if (![dict[@"s"] isKindOfClass:NSDictionary.class]) return nil;
1223112171 if (![dict[@"sbyte"] isKindOfClass:NSDictionary.class]) return nil;
12232- if (![dict[@"sealed"] isKindOfClass:NSDictionary.class]) return nil;
12233- if (![dict[@"SEL"] isKindOfClass:NSDictionary.class]) return nil;
1223412172 [self setValuesForKeysWithDictionary:dict];
12173+ _no = [QTNo fromJSONDictionary:(id)_no];
12174+ if (!_no && dict[@"NO"] && ![dict[@"NO"] isKindOfClass:NSNull.class]) return nil;
1223512175 _noSuchMethod = [QTNoSuchMethod fromJSONDictionary:(id)_noSuchMethod];
1223612176 if (!_noSuchMethod && dict[@"noSuchMethod"] && ![dict[@"noSuchMethod"] isKindOfClass:NSNull.class]) return nil;
1223712177 _noexcept = [QTNoexcept fromJSONDictionary:(id)_noexcept];
@@ -12258,6 +12198,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1225812198 if (!_nullptr && dict[@"nullptr"] && ![dict[@"nullptr"] isKindOfClass:NSNull.class]) return nil;
1225912199 _number = [QTNumber fromJSONDictionary:(id)_number];
1226012200 if (!_number && dict[@"number"] && ![dict[@"number"] isKindOfClass:NSNull.class]) return nil;
12201+ _obj4Nil = [QTNil fromJSONDictionary:(id)_obj4Nil];
12202+ if (!_obj4Nil && dict[@"nil"] && ![dict[@"nil"] isKindOfClass:NSNull.class]) return nil;
1226112203 _obj4Nonatomic = [QTNonatomic fromJSONDictionary:(id)_obj4Nonatomic];
1226212204 if (!_obj4Nonatomic && dict[@"nonatomic"] && ![dict[@"nonatomic"] isKindOfClass:NSNull.class]) return nil;
1226312205 _obj4None = [QTNoneClass fromJSONDictionary:(id)_obj4None];
@@ -12356,10 +12298,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1235612298 if (!_s && dict[@"s"] && ![dict[@"s"] isKindOfClass:NSNull.class]) return nil;
1235712299 _sbyte = [QTSbyte fromJSONDictionary:(id)_sbyte];
1235812300 if (!_sbyte && dict[@"sbyte"] && ![dict[@"sbyte"] isKindOfClass:NSNull.class]) return nil;
12359- _sealed = [QTSealed fromJSONDictionary:(id)_sealed];
12360- if (!_sealed && dict[@"sealed"] && ![dict[@"sealed"] isKindOfClass:NSNull.class]) return nil;
12361- _sel = [QTSel fromJSONDictionary:(id)_sel];
12362- if (!_sel && dict[@"SEL"] && ![dict[@"SEL"] isKindOfClass:NSNull.class]) return nil;
1236312301 }
1236412302 return self;
1236512303 }
@@ -12389,6 +12327,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1238912327 }
1239012328
1239112329 [dict addEntriesFromDictionary:@{
12330+ @"NO": [_no JSONDictionary],
1239212331 @"noSuchMethod": [_noSuchMethod JSONDictionary],
1239312332 @"noexcept": [_noexcept JSONDictionary],
1239412333 @"None": [_none JSONDictionary],
@@ -12402,6 +12341,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1240212341 @"NULL": [_null JSONDictionary],
1240312342 @"nullptr": [_nullptr JSONDictionary],
1240412343 @"number": [_number JSONDictionary],
12344+ @"nil": [_obj4Nil JSONDictionary],
1240512345 @"nonatomic": [_obj4Nonatomic JSONDictionary],
1240612346 @"none": [_obj4None JSONDictionary],
1240712347 @"null": [_obj4Null JSONDictionary],
@@ -12451,33 +12391,31 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1245112391 @"runtimeType": [_runtimeType JSONDictionary],
1245212392 @"s": [_s JSONDictionary],
1245312393 @"sbyte": [_sbyte JSONDictionary],
12454- @"sealed": [_sealed JSONDictionary],
12455- @"SEL": [_sel JSONDictionary],
1245612394 }];
1245712395
1245812396 return dict;
1245912397 }
1246012398 @end
1246112399
12462-@implementation QTNoSuchMethod
12400+@implementation QTNo
1246312401 + (NSDictionary<NSString *, NSString *> *)properties
1246412402 {
1246512403 static NSDictionary<NSString *, NSString *> *properties;
1246612404 return properties = properties ? properties : @{
12467- @"noSuchMethod": @"noSuchMethod",
12405+ @"NO": @"no",
1246812406 };
1246912407 }
1247012408
1247112409 + (instancetype)fromJSONDictionary:(NSDictionary *)dict
1247212410 {
12473- return [dict isKindOfClass:NSDictionary.class] ? [[QTNoSuchMethod alloc] initWithJSONDictionary:dict] : nil;
12411+ return [dict isKindOfClass:NSDictionary.class] ? [[QTNo alloc] initWithJSONDictionary:dict] : nil;
1247412412 }
1247512413
1247612414 - (instancetype)initWithJSONDictionary:(NSDictionary *)dict
1247712415 {
1247812416 if (self = [super init]) {
12479- if (![dict[@"noSuchMethod"] isKindOfClass:NSNumber.class]) return nil;
12480- if ([dict[@"noSuchMethod"] doubleValue] != [dict[@"noSuchMethod"] longLongValue]) return nil;
12417+ if (![dict[@"NO"] isKindOfClass:NSNumber.class]) return nil;
12418+ if ([dict[@"NO"] doubleValue] != [dict[@"NO"] longLongValue]) return nil;
1248112419 [self setValuesForKeysWithDictionary:dict];
1248212420 }
1248312421 return self;
@@ -12485,41 +12423,93 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1248512423
1248612424 - (void)setValue:(nullable id)value forKey:(NSString *)key
1248712425 {
12488- id resolved = QTNoSuchMethod.properties[key];
12426+ id resolved = QTNo.properties[key];
1248912427 if (resolved) [super setValue:value forKey:resolved];
1249012428 }
1249112429
1249212430 - (void)setNilValueForKey:(NSString *)key
1249312431 {
12494- id resolved = QTNoSuchMethod.properties[key];
12432+ id resolved = QTNo.properties[key];
1249512433 if (resolved) [super setValue:@(0) forKey:resolved];
1249612434 }
1249712435
1249812436 - (NSDictionary *)JSONDictionary
1249912437 {
12500- return [self dictionaryWithValuesForKeys:QTNoSuchMethod.properties.allValues];
12438+ id dict = [[self dictionaryWithValuesForKeys:QTNo.properties.allValues] mutableCopy];
12439+
12440+ for (id jsonName in QTNo.properties) {
12441+ id propertyName = QTNo.properties[jsonName];
12442+ if (![jsonName isEqualToString:propertyName]) {
12443+ dict[jsonName] = dict[propertyName];
12444+ [dict removeObjectForKey:propertyName];
12445+ }
12446+ }
12447+
12448+ return dict;
1250112449 }
1250212450 @end
1250312451
12504-@implementation QTNoexcept
12452+@implementation QTNoSuchMethod
1250512453 + (NSDictionary<NSString *, NSString *> *)properties
1250612454 {
1250712455 static NSDictionary<NSString *, NSString *> *properties;
1250812456 return properties = properties ? properties : @{
12509- @"noexcept": @"noexcept",
12457+ @"noSuchMethod": @"noSuchMethod",
1251012458 };
1251112459 }
1251212460
1251312461 + (instancetype)fromJSONDictionary:(NSDictionary *)dict
1251412462 {
12515- return [dict isKindOfClass:NSDictionary.class] ? [[QTNoexcept alloc] initWithJSONDictionary:dict] : nil;
12463+ return [dict isKindOfClass:NSDictionary.class] ? [[QTNoSuchMethod alloc] initWithJSONDictionary:dict] : nil;
1251612464 }
1251712465
1251812466 - (instancetype)initWithJSONDictionary:(NSDictionary *)dict
1251912467 {
1252012468 if (self = [super init]) {
12521- if (![dict[@"noexcept"] isKindOfClass:NSNumber.class]) return nil;
12522- if ([dict[@"noexcept"] doubleValue] != [dict[@"noexcept"] longLongValue]) return nil;
12469+ if (![dict[@"noSuchMethod"] isKindOfClass:NSNumber.class]) return nil;
12470+ if ([dict[@"noSuchMethod"] doubleValue] != [dict[@"noSuchMethod"] longLongValue]) return nil;
12471+ [self setValuesForKeysWithDictionary:dict];
12472+ }
12473+ return self;
12474+}
12475+
12476+- (void)setValue:(nullable id)value forKey:(NSString *)key
12477+{
12478+ id resolved = QTNoSuchMethod.properties[key];
12479+ if (resolved) [super setValue:value forKey:resolved];
12480+}
12481+
12482+- (void)setNilValueForKey:(NSString *)key
12483+{
12484+ id resolved = QTNoSuchMethod.properties[key];
12485+ if (resolved) [super setValue:@(0) forKey:resolved];
12486+}
12487+
12488+- (NSDictionary *)JSONDictionary
12489+{
12490+ return [self dictionaryWithValuesForKeys:QTNoSuchMethod.properties.allValues];
12491+}
12492+@end
12493+
12494+@implementation QTNoexcept
12495++ (NSDictionary<NSString *, NSString *> *)properties
12496+{
12497+ static NSDictionary<NSString *, NSString *> *properties;
12498+ return properties = properties ? properties : @{
12499+ @"noexcept": @"noexcept",
12500+ };
12501+}
12502+
12503++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
12504+{
12505+ return [dict isKindOfClass:NSDictionary.class] ? [[QTNoexcept alloc] initWithJSONDictionary:dict] : nil;
12506+}
12507+
12508+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
12509+{
12510+ if (self = [super init]) {
12511+ if (![dict[@"noexcept"] isKindOfClass:NSNumber.class]) return nil;
12512+ if ([dict[@"noexcept"] doubleValue] != [dict[@"noexcept"] longLongValue]) return nil;
1252312513 [self setValuesForKeysWithDictionary:dict];
1252412514 }
1252512515 return self;
@@ -13065,6 +13055,58 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1306513055 }
1306613056 @end
1306713057
13058+@implementation QTNil
13059++ (NSDictionary<NSString *, NSString *> *)properties
13060+{
13061+ static NSDictionary<NSString *, NSString *> *properties;
13062+ return properties = properties ? properties : @{
13063+ @"nil": @"nilNil",
13064+ };
13065+}
13066+
13067++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
13068+{
13069+ return [dict isKindOfClass:NSDictionary.class] ? [[QTNil alloc] initWithJSONDictionary:dict] : nil;
13070+}
13071+
13072+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
13073+{
13074+ if (self = [super init]) {
13075+ if (![dict[@"nil"] isKindOfClass:NSNumber.class]) return nil;
13076+ if ([dict[@"nil"] doubleValue] != [dict[@"nil"] longLongValue]) return nil;
13077+ [self setValuesForKeysWithDictionary:dict];
13078+ }
13079+ return self;
13080+}
13081+
13082+- (void)setValue:(nullable id)value forKey:(NSString *)key
13083+{
13084+ id resolved = QTNil.properties[key];
13085+ if (resolved) [super setValue:value forKey:resolved];
13086+}
13087+
13088+- (void)setNilValueForKey:(NSString *)key
13089+{
13090+ id resolved = QTNil.properties[key];
13091+ if (resolved) [super setValue:@(0) forKey:resolved];
13092+}
13093+
13094+- (NSDictionary *)JSONDictionary
13095+{
13096+ id dict = [[self dictionaryWithValuesForKeys:QTNil.properties.allValues] mutableCopy];
13097+
13098+ for (id jsonName in QTNil.properties) {
13099+ id propertyName = QTNil.properties[jsonName];
13100+ if (![jsonName isEqualToString:propertyName]) {
13101+ dict[jsonName] = dict[propertyName];
13102+ [dict removeObjectForKey:propertyName];
13103+ }
13104+ }
13105+
13106+ return dict;
13107+}
13108+@end
13109+
1306813110 @implementation QTNonatomic
1306913111 + (NSDictionary<NSString *, NSString *> *)properties
1307013112 {
@@ -15223,100 +15265,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1522315265 }
1522415266 @end
1522515267
15226-@implementation QTSealed
15227-+ (NSDictionary<NSString *, NSString *> *)properties
15228-{
15229- static NSDictionary<NSString *, NSString *> *properties;
15230- return properties = properties ? properties : @{
15231- @"sealed": @"sealed",
15232- };
15233-}
15234-
15235-+ (instancetype)fromJSONDictionary:(NSDictionary *)dict
15236-{
15237- return [dict isKindOfClass:NSDictionary.class] ? [[QTSealed alloc] initWithJSONDictionary:dict] : nil;
15238-}
15239-
15240-- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
15241-{
15242- if (self = [super init]) {
15243- if (![dict[@"sealed"] isKindOfClass:NSNumber.class]) return nil;
15244- if ([dict[@"sealed"] doubleValue] != [dict[@"sealed"] longLongValue]) return nil;
15245- [self setValuesForKeysWithDictionary:dict];
15246- }
15247- return self;
15248-}
15249-
15250-- (void)setValue:(nullable id)value forKey:(NSString *)key
15251-{
15252- id resolved = QTSealed.properties[key];
15253- if (resolved) [super setValue:value forKey:resolved];
15254-}
15255-
15256-- (void)setNilValueForKey:(NSString *)key
15257-{
15258- id resolved = QTSealed.properties[key];
15259- if (resolved) [super setValue:@(0) forKey:resolved];
15260-}
15261-
15262-- (NSDictionary *)JSONDictionary
15263-{
15264- return [self dictionaryWithValuesForKeys:QTSealed.properties.allValues];
15265-}
15266-@end
15267-
15268-@implementation QTSel
15269-+ (NSDictionary<NSString *, NSString *> *)properties
15270-{
15271- static NSDictionary<NSString *, NSString *> *properties;
15272- return properties = properties ? properties : @{
15273- @"SEL": @"sel",
15274- };
15275-}
15276-
15277-+ (instancetype)fromJSONDictionary:(NSDictionary *)dict
15278-{
15279- return [dict isKindOfClass:NSDictionary.class] ? [[QTSel alloc] initWithJSONDictionary:dict] : nil;
15280-}
15281-
15282-- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
15283-{
15284- if (self = [super init]) {
15285- if (![dict[@"SEL"] isKindOfClass:NSNumber.class]) return nil;
15286- if ([dict[@"SEL"] doubleValue] != [dict[@"SEL"] longLongValue]) return nil;
15287- [self setValuesForKeysWithDictionary:dict];
15288- }
15289- return self;
15290-}
15291-
15292-- (void)setValue:(nullable id)value forKey:(NSString *)key
15293-{
15294- id resolved = QTSel.properties[key];
15295- if (resolved) [super setValue:value forKey:resolved];
15296-}
15297-
15298-- (void)setNilValueForKey:(NSString *)key
15299-{
15300- id resolved = QTSel.properties[key];
15301- if (resolved) [super setValue:@(0) forKey:resolved];
15302-}
15303-
15304-- (NSDictionary *)JSONDictionary
15305-{
15306- id dict = [[self dictionaryWithValuesForKeys:QTSel.properties.allValues] mutableCopy];
15307-
15308- for (id jsonName in QTSel.properties) {
15309- id propertyName = QTSel.properties[jsonName];
15310- if (![jsonName isEqualToString:propertyName]) {
15311- dict[jsonName] = dict[propertyName];
15312- [dict removeObjectForKey:propertyName];
15313- }
15314- }
15315-
15316- return dict;
15317-}
15318-@end
15319-
1532015268 @implementation QTObj5
1532115269 + (NSDictionary<NSString *, NSString *> *)properties
1532215270 {
@@ -15337,6 +15285,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1533715285 @"typeof": @"obj5Typeof",
1533815286 @"union": @"obj5Union",
1533915287 @"PrimitiveKind": @"primitiveKind",
15288+ @"sealed": @"sealed",
15289+ @"SEL": @"sel",
1534015290 @"select": @"select",
1534115291 @"Self": @"self",
1534215292 @"Sendable": @"sendable",
@@ -15385,9 +15335,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1538515335 @"unchecked": @"unchecked",
1538615336 @"undefined": @"undefined",
1538715337 @"UnmarshalJSON": @"unmarshalJSON",
15388- @"unowned": @"unowned",
15389- @"unsafe": @"unsafe",
15390- @"UseSerializers": @"useSerializers",
1539115338 };
1539215339 }
1539315340
@@ -15415,6 +15362,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1541515362 if (![dict[@"typeof"] isKindOfClass:NSDictionary.class]) return nil;
1541615363 if (![dict[@"union"] isKindOfClass:NSDictionary.class]) return nil;
1541715364 if (![dict[@"PrimitiveKind"] isKindOfClass:NSDictionary.class]) return nil;
15365+ if (![dict[@"sealed"] isKindOfClass:NSDictionary.class]) return nil;
15366+ if (![dict[@"SEL"] isKindOfClass:NSDictionary.class]) return nil;
1541815367 if (![dict[@"select"] isKindOfClass:NSDictionary.class]) return nil;
1541915368 if (![dict[@"Self"] isKindOfClass:NSDictionary.class]) return nil;
1542015369 if (![dict[@"Sendable"] isKindOfClass:NSDictionary.class]) return nil;
@@ -15463,9 +15412,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1546315412 if (![dict[@"unchecked"] isKindOfClass:NSDictionary.class]) return nil;
1546415413 if (![dict[@"undefined"] isKindOfClass:NSDictionary.class]) return nil;
1546515414 if (![dict[@"UnmarshalJSON"] isKindOfClass:NSDictionary.class]) return nil;
15466- if (![dict[@"unowned"] isKindOfClass:NSDictionary.class]) return nil;
15467- if (![dict[@"unsafe"] isKindOfClass:NSDictionary.class]) return nil;
15468- if (![dict[@"UseSerializers"] isKindOfClass:NSDictionary.class]) return nil;
1546915415 [self setValuesForKeysWithDictionary:dict];
1547015416 _kSerializer = [QTKSerializer fromJSONDictionary:(id)_kSerializer];
1547115417 if (!_kSerializer && dict[@"KSerializer"] && ![dict[@"KSerializer"] isKindOfClass:NSNull.class]) return nil;
@@ -15495,6 +15441,10 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1549515441 if (!_obj5Union && dict[@"union"] && ![dict[@"union"] isKindOfClass:NSNull.class]) return nil;
1549615442 _primitiveKind = [QTPrimitiveKind fromJSONDictionary:(id)_primitiveKind];
1549715443 if (!_primitiveKind && dict[@"PrimitiveKind"] && ![dict[@"PrimitiveKind"] isKindOfClass:NSNull.class]) return nil;
15444+ _sealed = [QTSealed fromJSONDictionary:(id)_sealed];
15445+ if (!_sealed && dict[@"sealed"] && ![dict[@"sealed"] isKindOfClass:NSNull.class]) return nil;
15446+ _sel = [QTSel fromJSONDictionary:(id)_sel];
15447+ if (!_sel && dict[@"SEL"] && ![dict[@"SEL"] isKindOfClass:NSNull.class]) return nil;
1549815448 _select = [QTSelect fromJSONDictionary:(id)_select];
1549915449 if (!_select && dict[@"select"] && ![dict[@"select"] isKindOfClass:NSNull.class]) return nil;
1550015450 _self = [QTSelf fromJSONDictionary:(id)_self];
@@ -15591,12 +15541,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1559115541 if (!_undefined && dict[@"undefined"] && ![dict[@"undefined"] isKindOfClass:NSNull.class]) return nil;
1559215542 _unmarshalJSON = [QTUnmarshalJSON fromJSONDictionary:(id)_unmarshalJSON];
1559315543 if (!_unmarshalJSON && dict[@"UnmarshalJSON"] && ![dict[@"UnmarshalJSON"] isKindOfClass:NSNull.class]) return nil;
15594- _unowned = [QTUnowned fromJSONDictionary:(id)_unowned];
15595- if (!_unowned && dict[@"unowned"] && ![dict[@"unowned"] isKindOfClass:NSNull.class]) return nil;
15596- _unsafe = [QTUnsafe fromJSONDictionary:(id)_unsafe];
15597- if (!_unsafe && dict[@"unsafe"] && ![dict[@"unsafe"] isKindOfClass:NSNull.class]) return nil;
15598- _useSerializers = [QTUseSerializers fromJSONDictionary:(id)_useSerializers];
15599- if (!_useSerializers && dict[@"UseSerializers"] && ![dict[@"UseSerializers"] isKindOfClass:NSNull.class]) return nil;
1560015544 }
1560115545 return self;
1560215546 }
@@ -15640,6 +15584,8 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1564015584 @"typeof": [_obj5Typeof JSONDictionary],
1564115585 @"union": [_obj5Union JSONDictionary],
1564215586 @"PrimitiveKind": [_primitiveKind JSONDictionary],
15587+ @"sealed": [_sealed JSONDictionary],
15588+ @"SEL": [_sel JSONDictionary],
1564315589 @"select": [_select JSONDictionary],
1564415590 @"Self": [_self JSONDictionary],
1564515591 @"Sendable": [_sendable JSONDictionary],
@@ -15688,9 +15634,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1568815634 @"unchecked": [_unchecked JSONDictionary],
1568915635 @"undefined": [_undefined JSONDictionary],
1569015636 @"UnmarshalJSON": [_unmarshalJSON JSONDictionary],
15691- @"unowned": [_unowned JSONDictionary],
15692- @"unsafe": [_unsafe JSONDictionary],
15693- @"UseSerializers": [_useSerializers JSONDictionary],
1569415637 }];
1569515638
1569615639 return dict;
@@ -16405,25 +16348,25 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1640516348 }
1640616349 @end
1640716350
16408-@implementation QTSelect
16351+@implementation QTSealed
1640916352 + (NSDictionary<NSString *, NSString *> *)properties
1641016353 {
1641116354 static NSDictionary<NSString *, NSString *> *properties;
1641216355 return properties = properties ? properties : @{
16413- @"select": @"select",
16356+ @"sealed": @"sealed",
1641416357 };
1641516358 }
1641616359
1641716360 + (instancetype)fromJSONDictionary:(NSDictionary *)dict
1641816361 {
16419- return [dict isKindOfClass:NSDictionary.class] ? [[QTSelect alloc] initWithJSONDictionary:dict] : nil;
16362+ return [dict isKindOfClass:NSDictionary.class] ? [[QTSealed alloc] initWithJSONDictionary:dict] : nil;
1642016363 }
1642116364
1642216365 - (instancetype)initWithJSONDictionary:(NSDictionary *)dict
1642316366 {
1642416367 if (self = [super init]) {
16425- if (![dict[@"select"] isKindOfClass:NSNumber.class]) return nil;
16426- if ([dict[@"select"] doubleValue] != [dict[@"select"] longLongValue]) return nil;
16368+ if (![dict[@"sealed"] isKindOfClass:NSNumber.class]) return nil;
16369+ if ([dict[@"sealed"] doubleValue] != [dict[@"sealed"] longLongValue]) return nil;
1642716370 [self setValuesForKeysWithDictionary:dict];
1642816371 }
1642916372 return self;
@@ -16431,41 +16374,41 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1643116374
1643216375 - (void)setValue:(nullable id)value forKey:(NSString *)key
1643316376 {
16434- id resolved = QTSelect.properties[key];
16377+ id resolved = QTSealed.properties[key];
1643516378 if (resolved) [super setValue:value forKey:resolved];
1643616379 }
1643716380
1643816381 - (void)setNilValueForKey:(NSString *)key
1643916382 {
16440- id resolved = QTSelect.properties[key];
16383+ id resolved = QTSealed.properties[key];
1644116384 if (resolved) [super setValue:@(0) forKey:resolved];
1644216385 }
1644316386
1644416387 - (NSDictionary *)JSONDictionary
1644516388 {
16446- return [self dictionaryWithValuesForKeys:QTSelect.properties.allValues];
16389+ return [self dictionaryWithValuesForKeys:QTSealed.properties.allValues];
1644716390 }
1644816391 @end
1644916392
16450-@implementation QTSelf
16393+@implementation QTSel
1645116394 + (NSDictionary<NSString *, NSString *> *)properties
1645216395 {
1645316396 static NSDictionary<NSString *, NSString *> *properties;
1645416397 return properties = properties ? properties : @{
16455- @"Self": @"self",
16398+ @"SEL": @"sel",
1645616399 };
1645716400 }
1645816401
1645916402 + (instancetype)fromJSONDictionary:(NSDictionary *)dict
1646016403 {
16461- return [dict isKindOfClass:NSDictionary.class] ? [[QTSelf alloc] initWithJSONDictionary:dict] : nil;
16404+ return [dict isKindOfClass:NSDictionary.class] ? [[QTSel alloc] initWithJSONDictionary:dict] : nil;
1646216405 }
1646316406
1646416407 - (instancetype)initWithJSONDictionary:(NSDictionary *)dict
1646516408 {
1646616409 if (self = [super init]) {
16467- if (![dict[@"Self"] isKindOfClass:NSNumber.class]) return nil;
16468- if ([dict[@"Self"] doubleValue] != [dict[@"Self"] longLongValue]) return nil;
16410+ if (![dict[@"SEL"] isKindOfClass:NSNumber.class]) return nil;
16411+ if ([dict[@"SEL"] doubleValue] != [dict[@"SEL"] longLongValue]) return nil;
1646916412 [self setValuesForKeysWithDictionary:dict];
1647016413 }
1647116414 return self;
@@ -16473,22 +16416,22 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1647316416
1647416417 - (void)setValue:(nullable id)value forKey:(NSString *)key
1647516418 {
16476- id resolved = QTSelf.properties[key];
16419+ id resolved = QTSel.properties[key];
1647716420 if (resolved) [super setValue:value forKey:resolved];
1647816421 }
1647916422
1648016423 - (void)setNilValueForKey:(NSString *)key
1648116424 {
16482- id resolved = QTSelf.properties[key];
16425+ id resolved = QTSel.properties[key];
1648316426 if (resolved) [super setValue:@(0) forKey:resolved];
1648416427 }
1648516428
1648616429 - (NSDictionary *)JSONDictionary
1648716430 {
16488- id dict = [[self dictionaryWithValuesForKeys:QTSelf.properties.allValues] mutableCopy];
16431+ id dict = [[self dictionaryWithValuesForKeys:QTSel.properties.allValues] mutableCopy];
1648916432
16490- for (id jsonName in QTSelf.properties) {
16491- id propertyName = QTSelf.properties[jsonName];
16433+ for (id jsonName in QTSel.properties) {
16434+ id propertyName = QTSel.properties[jsonName];
1649216435 if (![jsonName isEqualToString:propertyName]) {
1649316436 dict[jsonName] = dict[propertyName];
1649416437 [dict removeObjectForKey:propertyName];
@@ -16499,24 +16442,118 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1649916442 }
1650016443 @end
1650116444
16502-@implementation QTSendable
16445+@implementation QTSelect
1650316446 + (NSDictionary<NSString *, NSString *> *)properties
1650416447 {
1650516448 static NSDictionary<NSString *, NSString *> *properties;
1650616449 return properties = properties ? properties : @{
16507- @"Sendable": @"sendable",
16450+ @"select": @"select",
1650816451 };
1650916452 }
1651016453
1651116454 + (instancetype)fromJSONDictionary:(NSDictionary *)dict
1651216455 {
16513- return [dict isKindOfClass:NSDictionary.class] ? [[QTSendable alloc] initWithJSONDictionary:dict] : nil;
16456+ return [dict isKindOfClass:NSDictionary.class] ? [[QTSelect alloc] initWithJSONDictionary:dict] : nil;
1651416457 }
1651516458
1651616459 - (instancetype)initWithJSONDictionary:(NSDictionary *)dict
1651716460 {
1651816461 if (self = [super init]) {
16519- if (![dict[@"Sendable"] isKindOfClass:NSNumber.class]) return nil;
16462+ if (![dict[@"select"] isKindOfClass:NSNumber.class]) return nil;
16463+ if ([dict[@"select"] doubleValue] != [dict[@"select"] longLongValue]) return nil;
16464+ [self setValuesForKeysWithDictionary:dict];
16465+ }
16466+ return self;
16467+}
16468+
16469+- (void)setValue:(nullable id)value forKey:(NSString *)key
16470+{
16471+ id resolved = QTSelect.properties[key];
16472+ if (resolved) [super setValue:value forKey:resolved];
16473+}
16474+
16475+- (void)setNilValueForKey:(NSString *)key
16476+{
16477+ id resolved = QTSelect.properties[key];
16478+ if (resolved) [super setValue:@(0) forKey:resolved];
16479+}
16480+
16481+- (NSDictionary *)JSONDictionary
16482+{
16483+ return [self dictionaryWithValuesForKeys:QTSelect.properties.allValues];
16484+}
16485+@end
16486+
16487+@implementation QTSelf
16488++ (NSDictionary<NSString *, NSString *> *)properties
16489+{
16490+ static NSDictionary<NSString *, NSString *> *properties;
16491+ return properties = properties ? properties : @{
16492+ @"Self": @"self",
16493+ };
16494+}
16495+
16496++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
16497+{
16498+ return [dict isKindOfClass:NSDictionary.class] ? [[QTSelf alloc] initWithJSONDictionary:dict] : nil;
16499+}
16500+
16501+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
16502+{
16503+ if (self = [super init]) {
16504+ if (![dict[@"Self"] isKindOfClass:NSNumber.class]) return nil;
16505+ if ([dict[@"Self"] doubleValue] != [dict[@"Self"] longLongValue]) return nil;
16506+ [self setValuesForKeysWithDictionary:dict];
16507+ }
16508+ return self;
16509+}
16510+
16511+- (void)setValue:(nullable id)value forKey:(NSString *)key
16512+{
16513+ id resolved = QTSelf.properties[key];
16514+ if (resolved) [super setValue:value forKey:resolved];
16515+}
16516+
16517+- (void)setNilValueForKey:(NSString *)key
16518+{
16519+ id resolved = QTSelf.properties[key];
16520+ if (resolved) [super setValue:@(0) forKey:resolved];
16521+}
16522+
16523+- (NSDictionary *)JSONDictionary
16524+{
16525+ id dict = [[self dictionaryWithValuesForKeys:QTSelf.properties.allValues] mutableCopy];
16526+
16527+ for (id jsonName in QTSelf.properties) {
16528+ id propertyName = QTSelf.properties[jsonName];
16529+ if (![jsonName isEqualToString:propertyName]) {
16530+ dict[jsonName] = dict[propertyName];
16531+ [dict removeObjectForKey:propertyName];
16532+ }
16533+ }
16534+
16535+ return dict;
16536+}
16537+@end
16538+
16539+@implementation QTSendable
16540++ (NSDictionary<NSString *, NSString *> *)properties
16541+{
16542+ static NSDictionary<NSString *, NSString *> *properties;
16543+ return properties = properties ? properties : @{
16544+ @"Sendable": @"sendable",
16545+ };
16546+}
16547+
16548++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
16549+{
16550+ return [dict isKindOfClass:NSDictionary.class] ? [[QTSendable alloc] initWithJSONDictionary:dict] : nil;
16551+}
16552+
16553+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
16554+{
16555+ if (self = [super init]) {
16556+ if (![dict[@"Sendable"] isKindOfClass:NSNumber.class]) return nil;
1652016557 if ([dict[@"Sendable"] doubleValue] != [dict[@"Sendable"] longLongValue]) return nil;
1652116558 [self setValuesForKeysWithDictionary:dict];
1652216559 }
@@ -18641,142 +18678,6 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1864118678 }
1864218679 @end
1864318680
18644-@implementation QTUnowned
18645-+ (NSDictionary<NSString *, NSString *> *)properties
18646-{
18647- static NSDictionary<NSString *, NSString *> *properties;
18648- return properties = properties ? properties : @{
18649- @"unowned": @"unowned",
18650- };
18651-}
18652-
18653-+ (instancetype)fromJSONDictionary:(NSDictionary *)dict
18654-{
18655- return [dict isKindOfClass:NSDictionary.class] ? [[QTUnowned alloc] initWithJSONDictionary:dict] : nil;
18656-}
18657-
18658-- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
18659-{
18660- if (self = [super init]) {
18661- if (![dict[@"unowned"] isKindOfClass:NSNumber.class]) return nil;
18662- if ([dict[@"unowned"] doubleValue] != [dict[@"unowned"] longLongValue]) return nil;
18663- [self setValuesForKeysWithDictionary:dict];
18664- }
18665- return self;
18666-}
18667-
18668-- (void)setValue:(nullable id)value forKey:(NSString *)key
18669-{
18670- id resolved = QTUnowned.properties[key];
18671- if (resolved) [super setValue:value forKey:resolved];
18672-}
18673-
18674-- (void)setNilValueForKey:(NSString *)key
18675-{
18676- id resolved = QTUnowned.properties[key];
18677- if (resolved) [super setValue:@(0) forKey:resolved];
18678-}
18679-
18680-- (NSDictionary *)JSONDictionary
18681-{
18682- return [self dictionaryWithValuesForKeys:QTUnowned.properties.allValues];
18683-}
18684-@end
18685-
18686-@implementation QTUnsafe
18687-+ (NSDictionary<NSString *, NSString *> *)properties
18688-{
18689- static NSDictionary<NSString *, NSString *> *properties;
18690- return properties = properties ? properties : @{
18691- @"unsafe": @"unsafe",
18692- };
18693-}
18694-
18695-+ (instancetype)fromJSONDictionary:(NSDictionary *)dict
18696-{
18697- return [dict isKindOfClass:NSDictionary.class] ? [[QTUnsafe alloc] initWithJSONDictionary:dict] : nil;
18698-}
18699-
18700-- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
18701-{
18702- if (self = [super init]) {
18703- if (![dict[@"unsafe"] isKindOfClass:NSNumber.class]) return nil;
18704- if ([dict[@"unsafe"] doubleValue] != [dict[@"unsafe"] longLongValue]) return nil;
18705- [self setValuesForKeysWithDictionary:dict];
18706- }
18707- return self;
18708-}
18709-
18710-- (void)setValue:(nullable id)value forKey:(NSString *)key
18711-{
18712- id resolved = QTUnsafe.properties[key];
18713- if (resolved) [super setValue:value forKey:resolved];
18714-}
18715-
18716-- (void)setNilValueForKey:(NSString *)key
18717-{
18718- id resolved = QTUnsafe.properties[key];
18719- if (resolved) [super setValue:@(0) forKey:resolved];
18720-}
18721-
18722-- (NSDictionary *)JSONDictionary
18723-{
18724- return [self dictionaryWithValuesForKeys:QTUnsafe.properties.allValues];
18725-}
18726-@end
18727-
18728-@implementation QTUseSerializers
18729-+ (NSDictionary<NSString *, NSString *> *)properties
18730-{
18731- static NSDictionary<NSString *, NSString *> *properties;
18732- return properties = properties ? properties : @{
18733- @"UseSerializers": @"useSerializers",
18734- };
18735-}
18736-
18737-+ (instancetype)fromJSONDictionary:(NSDictionary *)dict
18738-{
18739- return [dict isKindOfClass:NSDictionary.class] ? [[QTUseSerializers alloc] initWithJSONDictionary:dict] : nil;
18740-}
18741-
18742-- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
18743-{
18744- if (self = [super init]) {
18745- if (![dict[@"UseSerializers"] isKindOfClass:NSNumber.class]) return nil;
18746- if ([dict[@"UseSerializers"] doubleValue] != [dict[@"UseSerializers"] longLongValue]) return nil;
18747- [self setValuesForKeysWithDictionary:dict];
18748- }
18749- return self;
18750-}
18751-
18752-- (void)setValue:(nullable id)value forKey:(NSString *)key
18753-{
18754- id resolved = QTUseSerializers.properties[key];
18755- if (resolved) [super setValue:value forKey:resolved];
18756-}
18757-
18758-- (void)setNilValueForKey:(NSString *)key
18759-{
18760- id resolved = QTUseSerializers.properties[key];
18761- if (resolved) [super setValue:@(0) forKey:resolved];
18762-}
18763-
18764-- (NSDictionary *)JSONDictionary
18765-{
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;
18777-}
18778-@end
18779-
1878018681 @implementation QTObj6
1878118682 + (NSDictionary<NSString *, NSString *> *)properties
1878218683 {
@@ -18787,6 +18688,9 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1878718688 @"void": @"obj6Void",
1878818689 @"volatile": @"obj6Volatile",
1878918690 @"while": @"obj6While",
18691+ @"unowned": @"unowned",
18692+ @"unsafe": @"unsafe",
18693+ @"UseSerializers": @"useSerializers",
1879018694 @"ushort": @"ushort",
1879118695 @"using": @"using",
1879218696 @"Utf8JsonReader": @"utf8JSONReader",
@@ -18820,6 +18724,9 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1882018724 if (![dict[@"void"] isKindOfClass:NSDictionary.class]) return nil;
1882118725 if (![dict[@"volatile"] isKindOfClass:NSDictionary.class]) return nil;
1882218726 if (![dict[@"while"] isKindOfClass:NSDictionary.class]) return nil;
18727+ if (![dict[@"unowned"] isKindOfClass:NSDictionary.class]) return nil;
18728+ if (![dict[@"unsafe"] isKindOfClass:NSDictionary.class]) return nil;
18729+ if (![dict[@"UseSerializers"] isKindOfClass:NSDictionary.class]) return nil;
1882318730 if (![dict[@"ushort"] isKindOfClass:NSDictionary.class]) return nil;
1882418731 if (![dict[@"using"] isKindOfClass:NSDictionary.class]) return nil;
1882518732 if (![dict[@"Utf8JsonReader"] isKindOfClass:NSDictionary.class]) return nil;
@@ -18845,6 +18752,12 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1884518752 if (!_obj6Volatile && dict[@"volatile"] && ![dict[@"volatile"] isKindOfClass:NSNull.class]) return nil;
1884618753 _obj6While = [QTWhile fromJSONDictionary:(id)_obj6While];
1884718754 if (!_obj6While && dict[@"while"] && ![dict[@"while"] isKindOfClass:NSNull.class]) return nil;
18755+ _unowned = [QTUnowned fromJSONDictionary:(id)_unowned];
18756+ if (!_unowned && dict[@"unowned"] && ![dict[@"unowned"] isKindOfClass:NSNull.class]) return nil;
18757+ _unsafe = [QTUnsafe fromJSONDictionary:(id)_unsafe];
18758+ if (!_unsafe && dict[@"unsafe"] && ![dict[@"unsafe"] isKindOfClass:NSNull.class]) return nil;
18759+ _useSerializers = [QTUseSerializers fromJSONDictionary:(id)_useSerializers];
18760+ if (!_useSerializers && dict[@"UseSerializers"] && ![dict[@"UseSerializers"] isKindOfClass:NSNull.class]) return nil;
1884818761 _ushort = [QTUshort fromJSONDictionary:(id)_ushort];
1884918762 if (!_ushort && dict[@"ushort"] && ![dict[@"ushort"] isKindOfClass:NSNull.class]) return nil;
1885018763 _using = [QTUsing fromJSONDictionary:(id)_using];
@@ -18910,6 +18823,9 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1891018823 @"void": [_obj6Void JSONDictionary],
1891118824 @"volatile": [_obj6Volatile JSONDictionary],
1891218825 @"while": [_obj6While JSONDictionary],
18826+ @"unowned": [_unowned JSONDictionary],
18827+ @"unsafe": [_unsafe JSONDictionary],
18828+ @"UseSerializers": [_useSerializers JSONDictionary],
1891318829 @"ushort": [_ushort JSONDictionary],
1891418830 @"using": [_using JSONDictionary],
1891518831 @"Utf8JsonReader": [_utf8JSONReader JSONDictionary],
@@ -19140,6 +19056,142 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
1914019056 }
1914119057 @end
1914219058
19059+@implementation QTUnowned
19060++ (NSDictionary<NSString *, NSString *> *)properties
19061+{
19062+ static NSDictionary<NSString *, NSString *> *properties;
19063+ return properties = properties ? properties : @{
19064+ @"unowned": @"unowned",
19065+ };
19066+}
19067+
19068++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
19069+{
19070+ return [dict isKindOfClass:NSDictionary.class] ? [[QTUnowned alloc] initWithJSONDictionary:dict] : nil;
19071+}
19072+
19073+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
19074+{
19075+ if (self = [super init]) {
19076+ if (![dict[@"unowned"] isKindOfClass:NSNumber.class]) return nil;
19077+ if ([dict[@"unowned"] doubleValue] != [dict[@"unowned"] longLongValue]) return nil;
19078+ [self setValuesForKeysWithDictionary:dict];
19079+ }
19080+ return self;
19081+}
19082+
19083+- (void)setValue:(nullable id)value forKey:(NSString *)key
19084+{
19085+ id resolved = QTUnowned.properties[key];
19086+ if (resolved) [super setValue:value forKey:resolved];
19087+}
19088+
19089+- (void)setNilValueForKey:(NSString *)key
19090+{
19091+ id resolved = QTUnowned.properties[key];
19092+ if (resolved) [super setValue:@(0) forKey:resolved];
19093+}
19094+
19095+- (NSDictionary *)JSONDictionary
19096+{
19097+ return [self dictionaryWithValuesForKeys:QTUnowned.properties.allValues];
19098+}
19099+@end
19100+
19101+@implementation QTUnsafe
19102++ (NSDictionary<NSString *, NSString *> *)properties
19103+{
19104+ static NSDictionary<NSString *, NSString *> *properties;
19105+ return properties = properties ? properties : @{
19106+ @"unsafe": @"unsafe",
19107+ };
19108+}
19109+
19110++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
19111+{
19112+ return [dict isKindOfClass:NSDictionary.class] ? [[QTUnsafe alloc] initWithJSONDictionary:dict] : nil;
19113+}
19114+
19115+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
19116+{
19117+ if (self = [super init]) {
19118+ if (![dict[@"unsafe"] isKindOfClass:NSNumber.class]) return nil;
19119+ if ([dict[@"unsafe"] doubleValue] != [dict[@"unsafe"] longLongValue]) return nil;
19120+ [self setValuesForKeysWithDictionary:dict];
19121+ }
19122+ return self;
19123+}
19124+
19125+- (void)setValue:(nullable id)value forKey:(NSString *)key
19126+{
19127+ id resolved = QTUnsafe.properties[key];
19128+ if (resolved) [super setValue:value forKey:resolved];
19129+}
19130+
19131+- (void)setNilValueForKey:(NSString *)key
19132+{
19133+ id resolved = QTUnsafe.properties[key];
19134+ if (resolved) [super setValue:@(0) forKey:resolved];
19135+}
19136+
19137+- (NSDictionary *)JSONDictionary
19138+{
19139+ return [self dictionaryWithValuesForKeys:QTUnsafe.properties.allValues];
19140+}
19141+@end
19142+
19143+@implementation QTUseSerializers
19144++ (NSDictionary<NSString *, NSString *> *)properties
19145+{
19146+ static NSDictionary<NSString *, NSString *> *properties;
19147+ return properties = properties ? properties : @{
19148+ @"UseSerializers": @"useSerializers",
19149+ };
19150+}
19151+
19152++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
19153+{
19154+ return [dict isKindOfClass:NSDictionary.class] ? [[QTUseSerializers alloc] initWithJSONDictionary:dict] : nil;
19155+}
19156+
19157+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
19158+{
19159+ if (self = [super init]) {
19160+ if (![dict[@"UseSerializers"] isKindOfClass:NSNumber.class]) return nil;
19161+ if ([dict[@"UseSerializers"] doubleValue] != [dict[@"UseSerializers"] 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 = QTUseSerializers.properties[key];
19170+ if (resolved) [super setValue:value forKey:resolved];
19171+}
19172+
19173+- (void)setNilValueForKey:(NSString *)key
19174+{
19175+ id resolved = QTUseSerializers.properties[key];
19176+ if (resolved) [super setValue:@(0) forKey:resolved];
19177+}
19178+
19179+- (NSDictionary *)JSONDictionary
19180+{
19181+ id dict = [[self dictionaryWithValuesForKeys:QTUseSerializers.properties.allValues] mutableCopy];
19182+
19183+ for (id jsonName in QTUseSerializers.properties) {
19184+ id propertyName = QTUseSerializers.properties[jsonName];
19185+ if (![jsonName isEqualToString:propertyName]) {
19186+ dict[jsonName] = dict[propertyName];
19187+ [dict removeObjectForKey:propertyName];
19188+ }
19189+ }
19190+
19191+ return dict;
19192+}
19193+@end
19194+
1914319195 @implementation QTUshort
1914419196 + (NSDictionary<NSString *, NSString *> *)properties
1914519197 {
Mphpdefault / TopLevel.php+1,800 −1,641
@@ -21128,6 +21128,7 @@ class Obj3 {
2112821128 private LocaleClass $locale; // json:Locale Required
2112921129 private Lock $lock; // json:lock Required
2113021130 private Long $long; // json:long Required
21131+ private MakeDictEncoder $makeDictEncoder; // json:makeDictEncoder Required
2113121132 private Map $map; // json:map Required
2113221133 private MapEntry $mapEntry; // json:MapEntry Required
2113321134 private MarshalJSON $marshalJSON; // json:MarshalJSON Required
@@ -21139,8 +21140,6 @@ class Obj3 {
2113921140 private Native $native; // json:native Required
2114021141 private NewClass $new; // json:new Required
2114121142 private Newtonsoft $newtonsoft; // json:newtonsoft Required
21142- private Nil $nil; // json:nil Required
21143- private No $no; // json:NO Required
2114421143
2114521144 /**
2114621145 * @param int $dummy
@@ -21196,6 +21195,7 @@ class Obj3 {
2119621195 * @param LocaleClass $locale
2119721196 * @param Lock $lock
2119821197 * @param Long $long
21198+ * @param MakeDictEncoder $makeDictEncoder
2119921199 * @param Map $map
2120021200 * @param MapEntry $mapEntry
2120121201 * @param MarshalJSON $marshalJSON
@@ -21207,10 +21207,8 @@ class Obj3 {
2120721207 * @param Native $native
2120821208 * @param NewClass $new
2120921209 * @param Newtonsoft $newtonsoft
21210- * @param Nil $nil
21211- * @param No $no
2121221210 */
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) {
21211+ 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, MakeDictEncoder $makeDictEncoder, Map $map, MapEntry $mapEntry, MarshalJSON $marshalJSON, MetadataPropertyHandling $metadataPropertyHandling, Module $module, Mutable $mutable, Mutating $mutating, NamespaceClass $namespace, Native $native, NewClass $new, Newtonsoft $newtonsoft) {
2121421212 $this->dummy = $dummy;
2121521213 $this->goto = $goto;
2121621214 $this->guard = $guard;
@@ -21264,6 +21262,7 @@ class Obj3 {
2126421262 $this->locale = $locale;
2126521263 $this->lock = $lock;
2126621264 $this->long = $long;
21265+ $this->makeDictEncoder = $makeDictEncoder;
2126721266 $this->map = $map;
2126821267 $this->mapEntry = $mapEntry;
2126921268 $this->marshalJSON = $marshalJSON;
@@ -21275,8 +21274,6 @@ class Obj3 {
2127521274 $this->native = $native;
2127621275 $this->new = $new;
2127721276 $this->newtonsoft = $newtonsoft;
21278- $this->nil = $nil;
21279- $this->no = $no;
2128021277 }
2128121278
2128221279 /**
@@ -23822,6 +23819,54 @@ class Obj3 {
2382223819 return Long::sample(); /*83:long*/
2382323820 }
2382423821
23822+ /**
23823+ * @param stdClass $value
23824+ * @throws Exception
23825+ * @return MakeDictEncoder
23826+ */
23827+ public static function fromMakeDictEncoder(stdClass $value): MakeDictEncoder {
23828+ return MakeDictEncoder::from($value); /*class*/
23829+ }
23830+
23831+ /**
23832+ * @throws Exception
23833+ * @return stdClass
23834+ */
23835+ public function toMakeDictEncoder(): stdClass {
23836+ if (Obj3::validateMakeDictEncoder($this->makeDictEncoder)) {
23837+ return $this->makeDictEncoder->to(); /*class*/
23838+ }
23839+ throw new Exception('never get to this Obj3::makeDictEncoder');
23840+ }
23841+
23842+ /**
23843+ * @param MakeDictEncoder
23844+ * @return bool
23845+ * @throws Exception
23846+ */
23847+ public static function validateMakeDictEncoder(MakeDictEncoder $value): bool {
23848+ $value->validate();
23849+ return true;
23850+ }
23851+
23852+ /**
23853+ * @throws Exception
23854+ * @return MakeDictEncoder
23855+ */
23856+ public function getMakeDictEncoder(): MakeDictEncoder {
23857+ if (Obj3::validateMakeDictEncoder($this->makeDictEncoder)) {
23858+ return $this->makeDictEncoder;
23859+ }
23860+ throw new Exception('never get to getMakeDictEncoder Obj3::makeDictEncoder');
23861+ }
23862+
23863+ /**
23864+ * @return MakeDictEncoder
23865+ */
23866+ public static function sampleMakeDictEncoder(): MakeDictEncoder {
23867+ return MakeDictEncoder::sample(); /*84:makeDictEncoder*/
23868+ }
23869+
2382523870 /**
2382623871 * @param stdClass $value
2382723872 * @throws Exception
@@ -23867,7 +23912,7 @@ class Obj3 {
2386723912 * @return Map
2386823913 */
2386923914 public static function sampleMap(): Map {
23870- return Map::sample(); /*84:map*/
23915+ return Map::sample(); /*85:map*/
2387123916 }
2387223917
2387323918 /**
@@ -23915,7 +23960,7 @@ class Obj3 {
2391523960 * @return MapEntry
2391623961 */
2391723962 public static function sampleMapEntry(): MapEntry {
23918- return MapEntry::sample(); /*85:mapEntry*/
23963+ return MapEntry::sample(); /*86:mapEntry*/
2391923964 }
2392023965
2392123966 /**
@@ -23963,7 +24008,7 @@ class Obj3 {
2396324008 * @return MarshalJSON
2396424009 */
2396524010 public static function sampleMarshalJSON(): MarshalJSON {
23966- return MarshalJSON::sample(); /*86:marshalJSON*/
24011+ return MarshalJSON::sample(); /*87:marshalJSON*/
2396724012 }
2396824013
2396924014 /**
@@ -24011,7 +24056,7 @@ class Obj3 {
2401124056 * @return MetadataPropertyHandling
2401224057 */
2401324058 public static function sampleMetadataPropertyHandling(): MetadataPropertyHandling {
24014- return MetadataPropertyHandling::sample(); /*87:metadataPropertyHandling*/
24059+ return MetadataPropertyHandling::sample(); /*88:metadataPropertyHandling*/
2401524060 }
2401624061
2401724062 /**
@@ -24059,7 +24104,7 @@ class Obj3 {
2405924104 * @return Module
2406024105 */
2406124106 public static function sampleModule(): Module {
24062- return Module::sample(); /*88:module*/
24107+ return Module::sample(); /*89:module*/
2406324108 }
2406424109
2406524110 /**
@@ -24107,7 +24152,7 @@ class Obj3 {
2410724152 * @return Mutable
2410824153 */
2410924154 public static function sampleMutable(): Mutable {
24110- return Mutable::sample(); /*89:mutable*/
24155+ return Mutable::sample(); /*90:mutable*/
2411124156 }
2411224157
2411324158 /**
@@ -24155,7 +24200,7 @@ class Obj3 {
2415524200 * @return Mutating
2415624201 */
2415724202 public static function sampleMutating(): Mutating {
24158- return Mutating::sample(); /*90:mutating*/
24203+ return Mutating::sample(); /*91:mutating*/
2415924204 }
2416024205
2416124206 /**
@@ -24203,7 +24248,7 @@ class Obj3 {
2420324248 * @return NamespaceClass
2420424249 */
2420524250 public static function sampleNamespace(): NamespaceClass {
24206- return NamespaceClass::sample(); /*91:namespace*/
24251+ return NamespaceClass::sample(); /*92:namespace*/
2420724252 }
2420824253
2420924254 /**
@@ -24251,7 +24296,7 @@ class Obj3 {
2425124296 * @return Native
2425224297 */
2425324298 public static function sampleNative(): Native {
24254- return Native::sample(); /*92:native*/
24299+ return Native::sample(); /*93:native*/
2425524300 }
2425624301
2425724302 /**
@@ -24299,7 +24344,7 @@ class Obj3 {
2429924344 * @return NewClass
2430024345 */
2430124346 public static function sampleNew(): NewClass {
24302- return NewClass::sample(); /*93:new*/
24347+ return NewClass::sample(); /*94:new*/
2430324348 }
2430424349
2430524350 /**
@@ -24347,103 +24392,7 @@ class Obj3 {
2434724392 * @return Newtonsoft
2434824393 */
2434924394 public static function sampleNewtonsoft(): Newtonsoft {
24350- return Newtonsoft::sample(); /*94:newtonsoft*/
24351- }
24352-
24353- /**
24354- * @param stdClass $value
24355- * @throws Exception
24356- * @return Nil
24357- */
24358- public static function fromNil(stdClass $value): Nil {
24359- return Nil::from($value); /*class*/
24360- }
24361-
24362- /**
24363- * @throws Exception
24364- * @return stdClass
24365- */
24366- public function toNil(): stdClass {
24367- if (Obj3::validateNil($this->nil)) {
24368- return $this->nil->to(); /*class*/
24369- }
24370- throw new Exception('never get to this Obj3::nil');
24371- }
24372-
24373- /**
24374- * @param Nil
24375- * @return bool
24376- * @throws Exception
24377- */
24378- public static function validateNil(Nil $value): bool {
24379- $value->validate();
24380- return true;
24381- }
24382-
24383- /**
24384- * @throws Exception
24385- * @return Nil
24386- */
24387- public function getNil(): Nil {
24388- if (Obj3::validateNil($this->nil)) {
24389- return $this->nil;
24390- }
24391- throw new Exception('never get to getNil Obj3::nil');
24392- }
24393-
24394- /**
24395- * @return Nil
24396- */
24397- public static function sampleNil(): Nil {
24398- return Nil::sample(); /*95:nil*/
24399- }
24400-
24401- /**
24402- * @param stdClass $value
24403- * @throws Exception
24404- * @return No
24405- */
24406- public static function fromNo(stdClass $value): No {
24407- return No::from($value); /*class*/
24408- }
24409-
24410- /**
24411- * @throws Exception
24412- * @return stdClass
24413- */
24414- public function toNo(): stdClass {
24415- if (Obj3::validateNo($this->no)) {
24416- return $this->no->to(); /*class*/
24417- }
24418- throw new Exception('never get to this Obj3::no');
24419- }
24420-
24421- /**
24422- * @param No
24423- * @return bool
24424- * @throws Exception
24425- */
24426- public static function validateNo(No $value): bool {
24427- $value->validate();
24428- return true;
24429- }
24430-
24431- /**
24432- * @throws Exception
24433- * @return No
24434- */
24435- public function getNo(): No {
24436- if (Obj3::validateNo($this->no)) {
24437- return $this->no;
24438- }
24439- throw new Exception('never get to getNo Obj3::no');
24440- }
24441-
24442- /**
24443- * @return No
24444- */
24445- public static function sampleNo(): No {
24446- return No::sample(); /*96:no*/
24395+ return Newtonsoft::sample(); /*95:newtonsoft*/
2444724396 }
2444824397
2444924398 /**
@@ -24504,6 +24453,7 @@ class Obj3 {
2450424453 || Obj3::validateLocale($this->locale)
2450524454 || Obj3::validateLock($this->lock)
2450624455 || Obj3::validateLong($this->long)
24456+ || Obj3::validateMakeDictEncoder($this->makeDictEncoder)
2450724457 || Obj3::validateMap($this->map)
2450824458 || Obj3::validateMapEntry($this->mapEntry)
2450924459 || Obj3::validateMarshalJSON($this->marshalJSON)
@@ -24514,9 +24464,7 @@ class Obj3 {
2451424464 || Obj3::validateNamespace($this->namespace)
2451524465 || Obj3::validateNative($this->native)
2451624466 || Obj3::validateNew($this->new)
24517- || Obj3::validateNewtonsoft($this->newtonsoft)
24518- || Obj3::validateNil($this->nil)
24519- || Obj3::validateNo($this->no);
24467+ || Obj3::validateNewtonsoft($this->newtonsoft);
2452024468 }
2452124469
2452224470 /**
@@ -24578,6 +24526,7 @@ class Obj3 {
2457824526 $out->{'Locale'} = $this->toLocale();
2457924527 $out->{'lock'} = $this->toLock();
2458024528 $out->{'long'} = $this->toLong();
24529+ $out->{'makeDictEncoder'} = $this->toMakeDictEncoder();
2458124530 $out->{'map'} = $this->toMap();
2458224531 $out->{'MapEntry'} = $this->toMapEntry();
2458324532 $out->{'MarshalJSON'} = $this->toMarshalJSON();
@@ -24589,8 +24538,6 @@ class Obj3 {
2458924538 $out->{'native'} = $this->toNative();
2459024539 $out->{'new'} = $this->toNew();
2459124540 $out->{'newtonsoft'} = $this->toNewtonsoft();
24592- $out->{'nil'} = $this->toNil();
24593- $out->{'NO'} = $this->toNo();
2459424541 return $out;
2459524542 }
2459624543
@@ -24759,6 +24706,9 @@ class Obj3 {
2475924706 if (!property_exists($obj, 'long')) {
2476024707 throw new Exception("Missing required property");
2476124708 }
24709+ if (!property_exists($obj, 'makeDictEncoder')) {
24710+ throw new Exception("Missing required property");
24711+ }
2476224712 if (!property_exists($obj, 'map')) {
2476324713 throw new Exception("Missing required property");
2476424714 }
@@ -24792,12 +24742,6 @@ class Obj3 {
2479224742 if (!property_exists($obj, 'newtonsoft')) {
2479324743 throw new Exception("Missing required property");
2479424744 }
24795- if (!property_exists($obj, 'nil')) {
24796- throw new Exception("Missing required property");
24797- }
24798- if (!property_exists($obj, 'NO')) {
24799- throw new Exception("Missing required property");
24800- }
2480124745 return new Obj3(
2480224746 Obj3::fromDummy($obj->{'dummy'})
2480324747 ,Obj3::fromGoto($obj->{'goto'})
@@ -24852,6 +24796,7 @@ class Obj3 {
2485224796 ,Obj3::fromLocale($obj->{'Locale'})
2485324797 ,Obj3::fromLock($obj->{'lock'})
2485424798 ,Obj3::fromLong($obj->{'long'})
24799+ ,Obj3::fromMakeDictEncoder($obj->{'makeDictEncoder'})
2485524800 ,Obj3::fromMap($obj->{'map'})
2485624801 ,Obj3::fromMapEntry($obj->{'MapEntry'})
2485724802 ,Obj3::fromMarshalJSON($obj->{'MarshalJSON'})
@@ -24863,8 +24808,6 @@ class Obj3 {
2486324808 ,Obj3::fromNative($obj->{'native'})
2486424809 ,Obj3::fromNew($obj->{'new'})
2486524810 ,Obj3::fromNewtonsoft($obj->{'newtonsoft'})
24866- ,Obj3::fromNil($obj->{'nil'})
24867- ,Obj3::fromNo($obj->{'NO'})
2486824811 );
2486924812 }
2487024813
@@ -24926,6 +24869,7 @@ class Obj3 {
2492624869 ,Obj3::sampleLocale()
2492724870 ,Obj3::sampleLock()
2492824871 ,Obj3::sampleLong()
24872+ ,Obj3::sampleMakeDictEncoder()
2492924873 ,Obj3::sampleMap()
2493024874 ,Obj3::sampleMapEntry()
2493124875 ,Obj3::sampleMarshalJSON()
@@ -24937,8 +24881,6 @@ class Obj3 {
2493724881 ,Obj3::sampleNative()
2493824882 ,Obj3::sampleNew()
2493924883 ,Obj3::sampleNewtonsoft()
24940- ,Obj3::sampleNil()
24941- ,Obj3::sampleNo()
2494224884 );
2494324885 }
2494424886 }
@@ -30198,6 +30140,107 @@ class Long {
3019830140 }
3019930141 }
3020030142
30143+// This is an autogenerated file:MakeDictEncoder
30144+
30145+class MakeDictEncoder {
30146+ private int $makeDictEncoder; // json:makeDictEncoder Required
30147+
30148+ /**
30149+ * @param int $makeDictEncoder
30150+ */
30151+ public function __construct(int $makeDictEncoder) {
30152+ $this->makeDictEncoder = $makeDictEncoder;
30153+ }
30154+
30155+ /**
30156+ * @param int $value
30157+ * @throws Exception
30158+ * @return int
30159+ */
30160+ public static function fromMakeDictEncoder(int $value): int {
30161+ return $value; /*int*/
30162+ }
30163+
30164+ /**
30165+ * @throws Exception
30166+ * @return int
30167+ */
30168+ public function toMakeDictEncoder(): int {
30169+ if (MakeDictEncoder::validateMakeDictEncoder($this->makeDictEncoder)) {
30170+ return $this->makeDictEncoder; /*int*/
30171+ }
30172+ throw new Exception('never get to this MakeDictEncoder::makeDictEncoder');
30173+ }
30174+
30175+ /**
30176+ * @param int
30177+ * @return bool
30178+ * @throws Exception
30179+ */
30180+ public static function validateMakeDictEncoder(int $value): bool {
30181+ return true;
30182+ }
30183+
30184+ /**
30185+ * @throws Exception
30186+ * @return int
30187+ */
30188+ public function getMakeDictEncoder(): int {
30189+ if (MakeDictEncoder::validateMakeDictEncoder($this->makeDictEncoder)) {
30190+ return $this->makeDictEncoder;
30191+ }
30192+ throw new Exception('never get to getMakeDictEncoder MakeDictEncoder::makeDictEncoder');
30193+ }
30194+
30195+ /**
30196+ * @return int
30197+ */
30198+ public static function sampleMakeDictEncoder(): int {
30199+ return 31; /*31:makeDictEncoder*/
30200+ }
30201+
30202+ /**
30203+ * @throws Exception
30204+ * @return bool
30205+ */
30206+ public function validate(): bool {
30207+ return MakeDictEncoder::validateMakeDictEncoder($this->makeDictEncoder);
30208+ }
30209+
30210+ /**
30211+ * @return stdClass
30212+ * @throws Exception
30213+ */
30214+ public function to(): stdClass {
30215+ $out = new stdClass();
30216+ $out->{'makeDictEncoder'} = $this->toMakeDictEncoder();
30217+ return $out;
30218+ }
30219+
30220+ /**
30221+ * @param stdClass $obj
30222+ * @return MakeDictEncoder
30223+ * @throws Exception
30224+ */
30225+ public static function from(stdClass $obj): MakeDictEncoder {
30226+ if (!property_exists($obj, 'makeDictEncoder')) {
30227+ throw new Exception("Missing required property");
30228+ }
30229+ return new MakeDictEncoder(
30230+ MakeDictEncoder::fromMakeDictEncoder($obj->{'makeDictEncoder'})
30231+ );
30232+ }
30233+
30234+ /**
30235+ * @return MakeDictEncoder
30236+ */
30237+ public static function sample(): MakeDictEncoder {
30238+ return new MakeDictEncoder(
30239+ MakeDictEncoder::sampleMakeDictEncoder()
30240+ );
30241+ }
30242+}
30243+
3020130244 // This is an autogenerated file:Map
3020230245
3020330246 class Map {
@@ -31309,212 +31352,12 @@ class Newtonsoft {
3130931352 }
3131031353 }
3131131354
31312-// This is an autogenerated file:Nil
31313-
31314-class Nil {
31315- private int $nil; // json:nil Required
31316-
31317- /**
31318- * @param int $nil
31319- */
31320- public function __construct(int $nil) {
31321- $this->nil = $nil;
31322- }
31323-
31324- /**
31325- * @param int $value
31326- * @throws Exception
31327- * @return int
31328- */
31329- public static function fromNil(int $value): int {
31330- return $value; /*int*/
31331- }
31332-
31333- /**
31334- * @throws Exception
31335- * @return int
31336- */
31337- public function toNil(): int {
31338- if (Nil::validateNil($this->nil)) {
31339- return $this->nil; /*int*/
31340- }
31341- throw new Exception('never get to this Nil::nil');
31342- }
31343-
31344- /**
31345- * @param int
31346- * @return bool
31347- * @throws Exception
31348- */
31349- public static function validateNil(int $value): bool {
31350- return true;
31351- }
31352-
31353- /**
31354- * @throws Exception
31355- * @return int
31356- */
31357- public function getNil(): int {
31358- if (Nil::validateNil($this->nil)) {
31359- return $this->nil;
31360- }
31361- throw new Exception('never get to getNil Nil::nil');
31362- }
31363-
31364- /**
31365- * @return int
31366- */
31367- public static function sampleNil(): int {
31368- return 31; /*31:nil*/
31369- }
31370-
31371- /**
31372- * @throws Exception
31373- * @return bool
31374- */
31375- public function validate(): bool {
31376- return Nil::validateNil($this->nil);
31377- }
31378-
31379- /**
31380- * @return stdClass
31381- * @throws Exception
31382- */
31383- public function to(): stdClass {
31384- $out = new stdClass();
31385- $out->{'nil'} = $this->toNil();
31386- return $out;
31387- }
31388-
31389- /**
31390- * @param stdClass $obj
31391- * @return Nil
31392- * @throws Exception
31393- */
31394- public static function from(stdClass $obj): Nil {
31395- if (!property_exists($obj, 'nil')) {
31396- throw new Exception("Missing required property");
31397- }
31398- return new Nil(
31399- Nil::fromNil($obj->{'nil'})
31400- );
31401- }
31402-
31403- /**
31404- * @return Nil
31405- */
31406- public static function sample(): Nil {
31407- return new Nil(
31408- Nil::sampleNil()
31409- );
31410- }
31411-}
31412-
31413-// This is an autogenerated file:No
31414-
31415-class No {
31416- private int $no; // json:NO Required
31417-
31418- /**
31419- * @param int $no
31420- */
31421- public function __construct(int $no) {
31422- $this->no = $no;
31423- }
31424-
31425- /**
31426- * @param int $value
31427- * @throws Exception
31428- * @return int
31429- */
31430- public static function fromNo(int $value): int {
31431- return $value; /*int*/
31432- }
31433-
31434- /**
31435- * @throws Exception
31436- * @return int
31437- */
31438- public function toNo(): int {
31439- if (No::validateNo($this->no)) {
31440- return $this->no; /*int*/
31441- }
31442- throw new Exception('never get to this No::no');
31443- }
31444-
31445- /**
31446- * @param int
31447- * @return bool
31448- * @throws Exception
31449- */
31450- public static function validateNo(int $value): bool {
31451- return true;
31452- }
31453-
31454- /**
31455- * @throws Exception
31456- * @return int
31457- */
31458- public function getNo(): int {
31459- if (No::validateNo($this->no)) {
31460- return $this->no;
31461- }
31462- throw new Exception('never get to getNo No::no');
31463- }
31464-
31465- /**
31466- * @return int
31467- */
31468- public static function sampleNo(): int {
31469- return 31; /*31:no*/
31470- }
31471-
31472- /**
31473- * @throws Exception
31474- * @return bool
31475- */
31476- public function validate(): bool {
31477- return No::validateNo($this->no);
31478- }
31479-
31480- /**
31481- * @return stdClass
31482- * @throws Exception
31483- */
31484- public function to(): stdClass {
31485- $out = new stdClass();
31486- $out->{'NO'} = $this->toNo();
31487- return $out;
31488- }
31489-
31490- /**
31491- * @param stdClass $obj
31492- * @return No
31493- * @throws Exception
31494- */
31495- public static function from(stdClass $obj): No {
31496- if (!property_exists($obj, 'NO')) {
31497- throw new Exception("Missing required property");
31498- }
31499- return new No(
31500- No::fromNo($obj->{'NO'})
31501- );
31502- }
31503-
31504- /**
31505- * @return No
31506- */
31507- public static function sample(): No {
31508- return new No(
31509- No::sampleNo()
31510- );
31511- }
31512-}
31513-
31514-// This is an autogenerated file:Obj4
31355+// This is an autogenerated file:Obj4
3151531356
3151631357 class Obj4 {
3151731358 private int $dummy; // json:dummy Required
31359+ private Nil $nil; // json:nil Required
31360+ private No $no; // json:NO Required
3151831361 private NoSuchMethod $noSuchMethod; // json:noSuchMethod Required
3151931362 private Noexcept $noexcept; // json:noexcept Required
3152031363 private Nonatomic $nonatomic; // json:nonatomic Required
@@ -31577,11 +31420,11 @@ class Obj4 {
3157731420 private RuntimeType $runtimeType; // json:runtimeType Required
3157831421 private S $s; // json:s Required
3157931422 private Sbyte $sbyte; // json:sbyte Required
31580- private Sealed $sealed; // json:sealed Required
31581- private Sel $sel; // json:SEL Required
3158231423
3158331424 /**
3158431425 * @param int $dummy
31426+ * @param Nil $nil
31427+ * @param No $no
3158531428 * @param NoSuchMethod $noSuchMethod
3158631429 * @param Noexcept $noexcept
3158731430 * @param Nonatomic $nonatomic
@@ -31644,11 +31487,11 @@ class Obj4 {
3164431487 * @param RuntimeType $runtimeType
3164531488 * @param S $s
3164631489 * @param Sbyte $sbyte
31647- * @param Sealed $sealed
31648- * @param Sel $sel
3164931490 */
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) {
31491+ public function __construct(int $dummy, Nil $nil, No $no, 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) {
3165131492 $this->dummy = $dummy;
31493+ $this->nil = $nil;
31494+ $this->no = $no;
3165231495 $this->noSuchMethod = $noSuchMethod;
3165331496 $this->noexcept = $noexcept;
3165431497 $this->nonatomic = $nonatomic;
@@ -31711,8 +31554,6 @@ class Obj4 {
3171131554 $this->runtimeType = $runtimeType;
3171231555 $this->s = $s;
3171331556 $this->sbyte = $sbyte;
31714- $this->sealed = $sealed;
31715- $this->sel = $sel;
3171631557 }
3171731558
3171831559 /**
@@ -31762,6 +31603,102 @@ class Obj4 {
3176231603 return 31; /*31:dummy*/
3176331604 }
3176431605
31606+ /**
31607+ * @param stdClass $value
31608+ * @throws Exception
31609+ * @return Nil
31610+ */
31611+ public static function fromNil(stdClass $value): Nil {
31612+ return Nil::from($value); /*class*/
31613+ }
31614+
31615+ /**
31616+ * @throws Exception
31617+ * @return stdClass
31618+ */
31619+ public function toNil(): stdClass {
31620+ if (Obj4::validateNil($this->nil)) {
31621+ return $this->nil->to(); /*class*/
31622+ }
31623+ throw new Exception('never get to this Obj4::nil');
31624+ }
31625+
31626+ /**
31627+ * @param Nil
31628+ * @return bool
31629+ * @throws Exception
31630+ */
31631+ public static function validateNil(Nil $value): bool {
31632+ $value->validate();
31633+ return true;
31634+ }
31635+
31636+ /**
31637+ * @throws Exception
31638+ * @return Nil
31639+ */
31640+ public function getNil(): Nil {
31641+ if (Obj4::validateNil($this->nil)) {
31642+ return $this->nil;
31643+ }
31644+ throw new Exception('never get to getNil Obj4::nil');
31645+ }
31646+
31647+ /**
31648+ * @return Nil
31649+ */
31650+ public static function sampleNil(): Nil {
31651+ return Nil::sample(); /*32:nil*/
31652+ }
31653+
31654+ /**
31655+ * @param stdClass $value
31656+ * @throws Exception
31657+ * @return No
31658+ */
31659+ public static function fromNo(stdClass $value): No {
31660+ return No::from($value); /*class*/
31661+ }
31662+
31663+ /**
31664+ * @throws Exception
31665+ * @return stdClass
31666+ */
31667+ public function toNo(): stdClass {
31668+ if (Obj4::validateNo($this->no)) {
31669+ return $this->no->to(); /*class*/
31670+ }
31671+ throw new Exception('never get to this Obj4::no');
31672+ }
31673+
31674+ /**
31675+ * @param No
31676+ * @return bool
31677+ * @throws Exception
31678+ */
31679+ public static function validateNo(No $value): bool {
31680+ $value->validate();
31681+ return true;
31682+ }
31683+
31684+ /**
31685+ * @throws Exception
31686+ * @return No
31687+ */
31688+ public function getNo(): No {
31689+ if (Obj4::validateNo($this->no)) {
31690+ return $this->no;
31691+ }
31692+ throw new Exception('never get to getNo Obj4::no');
31693+ }
31694+
31695+ /**
31696+ * @return No
31697+ */
31698+ public static function sampleNo(): No {
31699+ return No::sample(); /*33:no*/
31700+ }
31701+
3176531702 /**
3176631703 * @param stdClass $value
3176731704 * @throws Exception
@@ -31807,7 +31744,7 @@ class Obj4 {
3180731744 * @return NoSuchMethod
3180831745 */
3180931746 public static function sampleNoSuchMethod(): NoSuchMethod {
31810- return NoSuchMethod::sample(); /*32:noSuchMethod*/
31747+ return NoSuchMethod::sample(); /*34:noSuchMethod*/
3181131748 }
3181231749
3181331750 /**
@@ -31855,7 +31792,7 @@ class Obj4 {
3185531792 * @return Noexcept
3185631793 */
3185731794 public static function sampleNoexcept(): Noexcept {
31858- return Noexcept::sample(); /*33:noexcept*/
31795+ return Noexcept::sample(); /*35:noexcept*/
3185931796 }
3186031797
3186131798 /**
@@ -31903,7 +31840,7 @@ class Obj4 {
3190331840 * @return Nonatomic
3190431841 */
3190531842 public static function sampleNonatomic(): Nonatomic {
31906- return Nonatomic::sample(); /*34:nonatomic*/
31843+ return Nonatomic::sample(); /*36:nonatomic*/
3190731844 }
3190831845
3190931846 /**
@@ -31951,7 +31888,7 @@ class Obj4 {
3195131888 * @return None
3195231889 */
3195331890 public static function sampleNone(): None {
31954- return None::sample(); /*35:none*/
31891+ return None::sample(); /*37:none*/
3195531892 }
3195631893
3195731894 /**
@@ -31999,7 +31936,7 @@ class Obj4 {
3199931936 * @return Nonlocal
3200031937 */
3200131938 public static function sampleNonlocal(): Nonlocal {
32002- return Nonlocal::sample(); /*36:nonlocal*/
31939+ return Nonlocal::sample(); /*38:nonlocal*/
3200331940 }
3200431941
3200531942 /**
@@ -32047,7 +31984,7 @@ class Obj4 {
3204731984 * @return Nonmutating
3204831985 */
3204931986 public static function sampleNonmutating(): Nonmutating {
32050- return Nonmutating::sample(); /*37:nonmutating*/
31987+ return Nonmutating::sample(); /*39:nonmutating*/
3205131988 }
3205231989
3205331990 /**
@@ -32095,7 +32032,7 @@ class Obj4 {
3209532032 * @return Not
3209632033 */
3209732034 public static function sampleNot(): Not {
32098- return Not::sample(); /*38:not*/
32035+ return Not::sample(); /*40:not*/
3209932036 }
3210032037
3210132038 /**
@@ -32143,7 +32080,7 @@ class Obj4 {
3214332080 * @return NotEq
3214432081 */
3214532082 public static function sampleNotEq(): NotEq {
32146- return NotEq::sample(); /*39:notEq*/
32083+ return NotEq::sample(); /*41:notEq*/
3214732084 }
3214832085
3214932086 /**
@@ -32191,7 +32128,7 @@ class Obj4 {
3219132128 * @return NSError
3219232129 */
3219332130 public static function sampleNSError(): NSError {
32194- return NSError::sample(); /*40:nsError*/
32131+ return NSError::sample(); /*42:nsError*/
3219532132 }
3219632133
3219732134 /**
@@ -32239,7 +32176,7 @@ class Obj4 {
3223932176 * @return NSObject
3224032177 */
3224132178 public static function sampleNSObject(): NSObject {
32242- return NSObject::sample(); /*41:nsObject*/
32179+ return NSObject::sample(); /*43:nsObject*/
3224332180 }
3224432181
3224532182 /**
@@ -32287,7 +32224,7 @@ class Obj4 {
3228732224 * @return NSString
3228832225 */
3228932226 public static function sampleNSString(): NSString {
32290- return NSString::sample(); /*42:nsString*/
32227+ return NSString::sample(); /*44:nsString*/
3229132228 }
3229232229
3229332230 /**
@@ -32335,7 +32272,7 @@ class Obj4 {
3233532272 * @return NULLClass
3233632273 */
3233732274 public static function sampleNull(): NULLClass {
32338- return NULLClass::sample(); /*43:null*/
32275+ return NULLClass::sample(); /*45:null*/
3233932276 }
3234032277
3234132278 /**
@@ -32383,7 +32320,7 @@ class Obj4 {
3238332320 * @return Nullptr
3238432321 */
3238532322 public static function sampleNullptr(): Nullptr {
32386- return Nullptr::sample(); /*44:nullptr*/
32323+ return Nullptr::sample(); /*46:nullptr*/
3238732324 }
3238832325
3238932326 /**
@@ -32431,7 +32368,7 @@ class Obj4 {
3243132368 * @return Number
3243232369 */
3243332370 public static function sampleNumber(): Number {
32434- return Number::sample(); /*45:number*/
32371+ return Number::sample(); /*47:number*/
3243532372 }
3243632373
3243732374 /**
@@ -32479,7 +32416,7 @@ class Obj4 {
3247932416 * @return NoneClass
3248032417 */
3248132418 public static function sampleObj4None(): NoneClass {
32482- return NoneClass::sample(); /*46:obj4None*/
32419+ return NoneClass::sample(); /*48:obj4None*/
3248332420 }
3248432421
3248532422 /**
@@ -32527,7 +32464,7 @@ class Obj4 {
3252732464 * @return Obj4Null
3252832465 */
3252932466 public static function sampleObj4Null(): Obj4Null {
32530- return Obj4Null::sample(); /*47:obj4Null*/
32467+ return Obj4Null::sample(); /*49:obj4Null*/
3253132468 }
3253232469
3253332470 /**
@@ -32575,7 +32512,7 @@ class Obj4 {
3257532512 * @return ProtocolClass
3257632513 */
3257732514 public static function sampleObj4Protocol(): ProtocolClass {
32578- return ProtocolClass::sample(); /*48:obj4Protocol*/
32515+ return ProtocolClass::sample(); /*50:obj4Protocol*/
3257932516 }
3258032517
3258132518 /**
@@ -32623,7 +32560,7 @@ class Obj4 {
3262332560 * @return ObjectClass
3262432561 */
3262532562 public static function sampleObject(): ObjectClass {
32626- return ObjectClass::sample(); /*49:object*/
32563+ return ObjectClass::sample(); /*51:object*/
3262732564 }
3262832565
3262932566 /**
@@ -32671,7 +32608,7 @@ class Obj4 {
3267132608 * @return ObjectMapper
3267232609 */
3267332610 public static function sampleObjectMapper(): ObjectMapper {
32674- return ObjectMapper::sample(); /*50:objectMapper*/
32611+ return ObjectMapper::sample(); /*52:objectMapper*/
3267532612 }
3267632613
3267732614 /**
@@ -32719,7 +32656,7 @@ class Obj4 {
3271932656 * @return Of
3272032657 */
3272132658 public static function sampleOf(): Of {
32722- return Of::sample(); /*51:of*/
32659+ return Of::sample(); /*53:of*/
3272332660 }
3272432661
3272532662 /**
@@ -32767,7 +32704,7 @@ class Obj4 {
3276732704 * @return Oneway
3276832705 */
3276932706 public static function sampleOneway(): Oneway {
32770- return Oneway::sample(); /*52:oneway*/
32707+ return Oneway::sample(); /*54:oneway*/
3277132708 }
3277232709
3277332710 /**
@@ -32815,7 +32752,7 @@ class Obj4 {
3281532752 * @return Open
3281632753 */
3281732754 public static function sampleOpen(): Open {
32818- return Open::sample(); /*53:open*/
32755+ return Open::sample(); /*55:open*/
3281932756 }
3282032757
3282132758 /**
@@ -32863,7 +32800,7 @@ class Obj4 {
3286332800 * @return Operator
3286432801 */
3286532802 public static function sampleOperator(): Operator {
32866- return Operator::sample(); /*54:operator*/
32803+ return Operator::sample(); /*56:operator*/
3286732804 }
3286832805
3286932806 /**
@@ -32911,7 +32848,7 @@ class Obj4 {
3291132848 * @return Optional
3291232849 */
3291332850 public static function sampleOptional(): Optional {
32914- return Optional::sample(); /*55:optional*/
32851+ return Optional::sample(); /*57:optional*/
3291532852 }
3291632853
3291732854 /**
@@ -32959,7 +32896,7 @@ class Obj4 {
3295932896 * @return OrClass
3296032897 */
3296132898 public static function sampleOr(): OrClass {
32962- return OrClass::sample(); /*56:or*/
32899+ return OrClass::sample(); /*58:or*/
3296332900 }
3296432901
3296532902 /**
@@ -33007,7 +32944,7 @@ class Obj4 {
3300732944 * @return OrEq
3300832945 */
3300932946 public static function sampleOrEq(): OrEq {
33010- return OrEq::sample(); /*57:orEq*/
32947+ return OrEq::sample(); /*59:orEq*/
3301132948 }
3301232949
3301332950 /**
@@ -33055,7 +32992,7 @@ class Obj4 {
3305532992 * @return Out
3305632993 */
3305732994 public static function sampleOut(): Out {
33058- return Out::sample(); /*58:out*/
32995+ return Out::sample(); /*60:out*/
3305932996 }
3306032997
3306132998 /**
@@ -33103,7 +33040,7 @@ class Obj4 {
3310333040 * @return OverrideClass
3310433041 */
3310533042 public static function sampleOverride(): OverrideClass {
33106- return OverrideClass::sample(); /*59:override*/
33043+ return OverrideClass::sample(); /*61:override*/
3310733044 }
3310833045
3310933046 /**
@@ -33151,7 +33088,7 @@ class Obj4 {
3315133088 * @return Package
3315233089 */
3315333090 public static function samplePackage(): Package {
33154- return Package::sample(); /*60:package*/
33091+ return Package::sample(); /*62:package*/
3315533092 }
3315633093
3315733094 /**
@@ -33199,7 +33136,7 @@ class Obj4 {
3319933136 * @return Params
3320033137 */
3320133138 public static function sampleParams(): Params {
33202- return Params::sample(); /*61:params*/
33139+ return Params::sample(); /*63:params*/
3320333140 }
3320433141
3320533142 /**
@@ -33247,7 +33184,7 @@ class Obj4 {
3324733184 * @return Pass
3324833185 */
3324933186 public static function samplePass(): Pass {
33250- return Pass::sample(); /*62:pass*/
33187+ return Pass::sample(); /*64:pass*/
3325133188 }
3325233189
3325333190 /**
@@ -33295,7 +33232,7 @@ class Obj4 {
3329533232 * @return Port
3329633233 */
3329733234 public static function samplePort(): Port {
33298- return Port::sample(); /*63:port*/
33235+ return Port::sample(); /*65:port*/
3329933236 }
3330033237
3330133238 /**
@@ -33343,7 +33280,7 @@ class Obj4 {
3334333280 * @return Postfix
3334433281 */
3334533282 public static function samplePostfix(): Postfix {
33346- return Postfix::sample(); /*64:postfix*/
33283+ return Postfix::sample(); /*66:postfix*/
3334733284 }
3334833285
3334933286 /**
@@ -33391,7 +33328,7 @@ class Obj4 {
3339133328 * @return Precedence
3339233329 */
3339333330 public static function samplePrecedence(): Precedence {
33394- return Precedence::sample(); /*65:precedence*/
33331+ return Precedence::sample(); /*67:precedence*/
3339533332 }
3339633333
3339733334 /**
@@ -33439,7 +33376,7 @@ class Obj4 {
3343933376 * @return Prefix
3344033377 */
3344133378 public static function samplePrefix(): Prefix {
33442- return Prefix::sample(); /*66:prefix*/
33379+ return Prefix::sample(); /*68:prefix*/
3344333380 }
3344433381
3344533382 /**
@@ -33487,7 +33424,7 @@ class Obj4 {
3348733424 * @return PrintClass
3348833425 */
3348933426 public static function samplePrint(): PrintClass {
33490- return PrintClass::sample(); /*67:print*/
33427+ return PrintClass::sample(); /*69:print*/
3349133428 }
3349233429
3349333430 /**
@@ -33535,7 +33472,7 @@ class Obj4 {
3353533472 * @return PrintMembers
3353633473 */
3353733474 public static function samplePrintMembers(): PrintMembers {
33538- return PrintMembers::sample(); /*68:printMembers*/
33475+ return PrintMembers::sample(); /*70:printMembers*/
3353933476 }
3354033477
3354133478 /**
@@ -33583,7 +33520,7 @@ class Obj4 {
3358333520 * @return Printf
3358433521 */
3358533522 public static function samplePrintf(): Printf {
33586- return Printf::sample(); /*69:printf*/
33523+ return Printf::sample(); /*71:printf*/
3358733524 }
3358833525
3358933526 /**
@@ -33631,7 +33568,7 @@ class Obj4 {
3363133568 * @return PrivateClass
3363233569 */
3363333570 public static function samplePrivate(): PrivateClass {
33634- return PrivateClass::sample(); /*70:private*/
33571+ return PrivateClass::sample(); /*72:private*/
3363533572 }
3363633573
3363733574 /**
@@ -33679,7 +33616,7 @@ class Obj4 {
3367933616 * @return ProtectedClass
3368033617 */
3368133618 public static function sampleProtected(): ProtectedClass {
33682- return ProtectedClass::sample(); /*71:protected*/
33619+ return ProtectedClass::sample(); /*73:protected*/
3368333620 }
3368433621
3368533622 /**
@@ -33727,7 +33664,7 @@ class Obj4 {
3372733664 * @return Protocol
3372833665 */
3372933666 public static function sampleProtocol(): Protocol {
33730- return Protocol::sample(); /*72:protocol*/
33667+ return Protocol::sample(); /*74:protocol*/
3373133668 }
3373233669
3373333670 /**
@@ -33775,7 +33712,7 @@ class Obj4 {
3377533712 * @return PublicClass
3377633713 */
3377733714 public static function samplePublic(): PublicClass {
33778- return PublicClass::sample(); /*73:public*/
33715+ return PublicClass::sample(); /*75:public*/
3377933716 }
3378033717
3378133718 /**
@@ -33823,7 +33760,7 @@ class Obj4 {
3382333760 * @return Quicktype
3382433761 */
3382533762 public static function sampleQuicktype(): Quicktype {
33826- return Quicktype::sample(); /*74:quicktype*/
33763+ return Quicktype::sample(); /*76:quicktype*/
3382733764 }
3382833765
3382933766 /**
@@ -33871,7 +33808,7 @@ class Obj4 {
3387133808 * @return Raise
3387233809 */
3387333810 public static function sampleRaise(): Raise {
33874- return Raise::sample(); /*75:raise*/
33811+ return Raise::sample(); /*77:raise*/
3387533812 }
3387633813
3387733814 /**
@@ -33919,7 +33856,7 @@ class Obj4 {
3391933856 * @return Range
3392033857 */
3392133858 public static function sampleRange(): Range {
33922- return Range::sample(); /*76:range*/
33859+ return Range::sample(); /*78:range*/
3392333860 }
3392433861
3392533862 /**
@@ -33967,7 +33904,7 @@ class Obj4 {
3396733904 * @return ReadonlyClass
3396833905 */
3396933906 public static function sampleReadonly(): ReadonlyClass {
33970- return ReadonlyClass::sample(); /*77:readonly*/
33907+ return ReadonlyClass::sample(); /*79:readonly*/
3397133908 }
3397233909
3397333910 /**
@@ -34015,7 +33952,7 @@ class Obj4 {
3401533952 * @return Ref
3401633953 */
3401733954 public static function sampleRef(): Ref {
34018- return Ref::sample(); /*78:ref*/
33955+ return Ref::sample(); /*80:ref*/
3401933956 }
3402033957
3402133958 /**
@@ -34063,7 +34000,7 @@ class Obj4 {
3406334000 * @return RegExp
3406434001 */
3406534002 public static function sampleRegExp(): RegExp {
34066- return RegExp::sample(); /*79:regExp*/
34003+ return RegExp::sample(); /*81:regExp*/
3406734004 }
3406834005
3406934006 /**
@@ -34111,7 +34048,7 @@ class Obj4 {
3411134048 * @return Register
3411234049 */
3411334050 public static function sampleRegister(): Register {
34114- return Register::sample(); /*80:register*/
34051+ return Register::sample(); /*82:register*/
3411534052 }
3411634053
3411734054 /**
@@ -34159,7 +34096,7 @@ class Obj4 {
3415934096 * @return ReinterpretCast
3416034097 */
3416134098 public static function sampleReinterpretCast(): ReinterpretCast {
34162- return ReinterpretCast::sample(); /*81:reinterpretCast*/
34099+ return ReinterpretCast::sample(); /*83:reinterpretCast*/
3416334100 }
3416434101
3416534102 /**
@@ -34207,7 +34144,7 @@ class Obj4 {
3420734144 * @return Repeat
3420834145 */
3420934146 public static function sampleRepeat(): Repeat {
34210- return Repeat::sample(); /*82:repeat*/
34147+ return Repeat::sample(); /*84:repeat*/
3421134148 }
3421234149
3421334150 /**
@@ -34255,7 +34192,7 @@ class Obj4 {
3425534192 * @return RequireClass
3425634193 */
3425734194 public static function sampleRequire(): RequireClass {
34258- return RequireClass::sample(); /*83:require*/
34195+ return RequireClass::sample(); /*85:require*/
3425934196 }
3426034197
3426134198 /**
@@ -34303,7 +34240,7 @@ class Obj4 {
3430334240 * @return Required
3430434241 */
3430534242 public static function sampleRequired(): Required {
34306- return Required::sample(); /*84:required*/
34243+ return Required::sample(); /*86:required*/
3430734244 }
3430834245
3430934246 /**
@@ -34351,7 +34288,7 @@ class Obj4 {
3435134288 * @return Requires
3435234289 */
3435334290 public static function sampleRequires(): Requires {
34354- return Requires::sample(); /*85:requires*/
34291+ return Requires::sample(); /*87:requires*/
3435534292 }
3435634293
3435734294 /**
@@ -34399,7 +34336,7 @@ class Obj4 {
3439934336 * @return Restrict
3440034337 */
3440134338 public static function sampleRestrict(): Restrict {
34402- return Restrict::sample(); /*86:restrict*/
34339+ return Restrict::sample(); /*88:restrict*/
3440334340 }
3440434341
3440534342 /**
@@ -34447,7 +34384,7 @@ class Obj4 {
3444734384 * @return Retain
3444834385 */
3444934386 public static function sampleRetain(): Retain {
34450- return Retain::sample(); /*87:retain*/
34387+ return Retain::sample(); /*89:retain*/
3445134388 }
3445234389
3445334390 /**
@@ -34495,7 +34432,7 @@ class Obj4 {
3449534432 * @return Rethrows
3449634433 */
3449734434 public static function sampleRethrows(): Rethrows {
34498- return Rethrows::sample(); /*88:rethrows*/
34435+ return Rethrows::sample(); /*90:rethrows*/
3449934436 }
3450034437
3450134438 /**
@@ -34543,7 +34480,7 @@ class Obj4 {
3454334480 * @return ReturnClass
3454434481 */
3454534482 public static function sampleReturn(): ReturnClass {
34546- return ReturnClass::sample(); /*89:return*/
34483+ return ReturnClass::sample(); /*91:return*/
3454734484 }
3454834485
3454934486 /**
@@ -34591,7 +34528,7 @@ class Obj4 {
3459134528 * @return Right
3459234529 */
3459334530 public static function sampleRight(): Right {
34594- return Right::sample(); /*90:right*/
34531+ return Right::sample(); /*92:right*/
3459534532 }
3459634533
3459734534 /**
@@ -34639,7 +34576,7 @@ class Obj4 {
3463934576 * @return RuntimeType
3464034577 */
3464134578 public static function sampleRuntimeType(): RuntimeType {
34642- return RuntimeType::sample(); /*91:runtimeType*/
34579+ return RuntimeType::sample(); /*93:runtimeType*/
3464334580 }
3464434581
3464534582 /**
@@ -34687,7 +34624,7 @@ class Obj4 {
3468734624 * @return S
3468834625 */
3468934626 public static function sampleS(): S {
34690- return S::sample(); /*92:s*/
34627+ return S::sample(); /*94:s*/
3469134628 }
3469234629
3469334630 /**
@@ -34735,111 +34672,17 @@ class Obj4 {
3473534672 * @return Sbyte
3473634673 */
3473734674 public static function sampleSbyte(): Sbyte {
34738- return Sbyte::sample(); /*93:sbyte*/
34675+ return Sbyte::sample(); /*95:sbyte*/
3473934676 }
3474034677
3474134678 /**
34742- * @param stdClass $value
3474334679 * @throws Exception
34744- * @return Sealed
34745- */
34746- public static function fromSealed(stdClass $value): Sealed {
34747- return Sealed::from($value); /*class*/
34748- }
34749-
34750- /**
34751- * @throws Exception
34752- * @return stdClass
34753- */
34754- public function toSealed(): stdClass {
34755- if (Obj4::validateSealed($this->sealed)) {
34756- return $this->sealed->to(); /*class*/
34757- }
34758- throw new Exception('never get to this Obj4::sealed');
34759- }
34760-
34761- /**
34762- * @param Sealed
34763- * @return bool
34764- * @throws Exception
34765- */
34766- public static function validateSealed(Sealed $value): bool {
34767- $value->validate();
34768- return true;
34769- }
34770-
34771- /**
34772- * @throws Exception
34773- * @return Sealed
34774- */
34775- public function getSealed(): Sealed {
34776- if (Obj4::validateSealed($this->sealed)) {
34777- return $this->sealed;
34778- }
34779- throw new Exception('never get to getSealed Obj4::sealed');
34780- }
34781-
34782- /**
34783- * @return Sealed
34784- */
34785- public static function sampleSealed(): Sealed {
34786- return Sealed::sample(); /*94:sealed*/
34787- }
34788-
34789- /**
34790- * @param stdClass $value
34791- * @throws Exception
34792- * @return Sel
34793- */
34794- public static function fromSel(stdClass $value): Sel {
34795- return Sel::from($value); /*class*/
34796- }
34797-
34798- /**
34799- * @throws Exception
34800- * @return stdClass
34801- */
34802- public function toSel(): stdClass {
34803- if (Obj4::validateSel($this->sel)) {
34804- return $this->sel->to(); /*class*/
34805- }
34806- throw new Exception('never get to this Obj4::sel');
34807- }
34808-
34809- /**
34810- * @param Sel
34811- * @return bool
34812- * @throws Exception
34813- */
34814- public static function validateSel(Sel $value): bool {
34815- $value->validate();
34816- return true;
34817- }
34818-
34819- /**
34820- * @throws Exception
34821- * @return Sel
34822- */
34823- public function getSel(): Sel {
34824- if (Obj4::validateSel($this->sel)) {
34825- return $this->sel;
34826- }
34827- throw new Exception('never get to getSel Obj4::sel');
34828- }
34829-
34830- /**
34831- * @return Sel
34832- */
34833- public static function sampleSel(): Sel {
34834- return Sel::sample(); /*95:sel*/
34835- }
34836-
34837- /**
34838- * @throws Exception
34839- * @return bool
34680+ * @return bool
3484034681 */
3484134682 public function validate(): bool {
3484234683 return Obj4::validateDummy($this->dummy)
34684+ || Obj4::validateNil($this->nil)
34685+ || Obj4::validateNo($this->no)
3484334686 || Obj4::validateNoSuchMethod($this->noSuchMethod)
3484434687 || Obj4::validateNoexcept($this->noexcept)
3484534688 || Obj4::validateNonatomic($this->nonatomic)
@@ -34901,9 +34744,7 @@ class Obj4 {
3490134744 || Obj4::validateRight($this->right)
3490234745 || Obj4::validateRuntimeType($this->runtimeType)
3490334746 || Obj4::validateS($this->s)
34904- || Obj4::validateSbyte($this->sbyte)
34905- || Obj4::validateSealed($this->sealed)
34906- || Obj4::validateSel($this->sel);
34747+ || Obj4::validateSbyte($this->sbyte);
3490734748 }
3490834749
3490934750 /**
@@ -34913,6 +34754,8 @@ class Obj4 {
3491334754 public function to(): stdClass {
3491434755 $out = new stdClass();
3491534756 $out->{'dummy'} = $this->toDummy();
34757+ $out->{'nil'} = $this->toNil();
34758+ $out->{'NO'} = $this->toNo();
3491634759 $out->{'noSuchMethod'} = $this->toNoSuchMethod();
3491734760 $out->{'noexcept'} = $this->toNoexcept();
3491834761 $out->{'nonatomic'} = $this->toNonatomic();
@@ -34975,8 +34818,6 @@ class Obj4 {
3497534818 $out->{'runtimeType'} = $this->toRuntimeType();
3497634819 $out->{'s'} = $this->toS();
3497734820 $out->{'sbyte'} = $this->toSbyte();
34978- $out->{'sealed'} = $this->toSealed();
34979- $out->{'SEL'} = $this->toSel();
3498034821 return $out;
3498134822 }
3498234823
@@ -34989,6 +34830,12 @@ class Obj4 {
3498934830 if (!property_exists($obj, 'dummy')) {
3499034831 throw new Exception("Missing required property");
3499134832 }
34833+ if (!property_exists($obj, 'nil')) {
34834+ throw new Exception("Missing required property");
34835+ }
34836+ if (!property_exists($obj, 'NO')) {
34837+ throw new Exception("Missing required property");
34838+ }
3499234839 if (!property_exists($obj, 'noSuchMethod')) {
3499334840 throw new Exception("Missing required property");
3499434841 }
@@ -35175,14 +35022,10 @@ class Obj4 {
3517535022 if (!property_exists($obj, 'sbyte')) {
3517635023 throw new Exception("Missing required property");
3517735024 }
35178- if (!property_exists($obj, 'sealed')) {
35179- throw new Exception("Missing required property");
35180- }
35181- if (!property_exists($obj, 'SEL')) {
35182- throw new Exception("Missing required property");
35183- }
3518435025 return new Obj4(
3518535026 Obj4::fromDummy($obj->{'dummy'})
35027+ ,Obj4::fromNil($obj->{'nil'})
35028+ ,Obj4::fromNo($obj->{'NO'})
3518635029 ,Obj4::fromNoSuchMethod($obj->{'noSuchMethod'})
3518735030 ,Obj4::fromNoexcept($obj->{'noexcept'})
3518835031 ,Obj4::fromNonatomic($obj->{'nonatomic'})
@@ -35245,8 +35088,6 @@ class Obj4 {
3524535088 ,Obj4::fromRuntimeType($obj->{'runtimeType'})
3524635089 ,Obj4::fromS($obj->{'s'})
3524735090 ,Obj4::fromSbyte($obj->{'sbyte'})
35248- ,Obj4::fromSealed($obj->{'sealed'})
35249- ,Obj4::fromSel($obj->{'SEL'})
3525035091 );
3525135092 }
3525235093
@@ -35256,6 +35097,8 @@ class Obj4 {
3525635097 public static function sample(): Obj4 {
3525735098 return new Obj4(
3525835099 Obj4::sampleDummy()
35100+ ,Obj4::sampleNil()
35101+ ,Obj4::sampleNo()
3525935102 ,Obj4::sampleNoSuchMethod()
3526035103 ,Obj4::sampleNoexcept()
3526135104 ,Obj4::sampleNonatomic()
@@ -35318,22 +35161,20 @@ class Obj4 {
3531835161 ,Obj4::sampleRuntimeType()
3531935162 ,Obj4::sampleS()
3532035163 ,Obj4::sampleSbyte()
35321- ,Obj4::sampleSealed()
35322- ,Obj4::sampleSel()
3532335164 );
3532435165 }
3532535166 }
3532635167
35327-// This is an autogenerated file:NoSuchMethod
35168+// This is an autogenerated file:Nil
3532835169
35329-class NoSuchMethod {
35330- private int $noSuchMethod; // json:noSuchMethod Required
35170+class Nil {
35171+ private int $nil; // json:nil Required
3533135172
3533235173 /**
35333- * @param int $noSuchMethod
35174+ * @param int $nil
3533435175 */
35335- public function __construct(int $noSuchMethod) {
35336- $this->noSuchMethod = $noSuchMethod;
35176+ public function __construct(int $nil) {
35177+ $this->nil = $nil;
3533735178 }
3533835179
3533935180 /**
@@ -35341,7 +35182,7 @@ class NoSuchMethod {
3534135182 * @throws Exception
3534235183 * @return int
3534335184 */
35344- public static function fromNoSuchMethod(int $value): int {
35185+ public static function fromNil(int $value): int {
3534535186 return $value; /*int*/
3534635187 }
3534735188
@@ -35349,11 +35190,11 @@ class NoSuchMethod {
3534935190 * @throws Exception
3535035191 * @return int
3535135192 */
35352- public function toNoSuchMethod(): int {
35353- if (NoSuchMethod::validateNoSuchMethod($this->noSuchMethod)) {
35354- return $this->noSuchMethod; /*int*/
35193+ public function toNil(): int {
35194+ if (Nil::validateNil($this->nil)) {
35195+ return $this->nil; /*int*/
3535535196 }
35356- throw new Exception('never get to this NoSuchMethod::noSuchMethod');
35197+ throw new Exception('never get to this Nil::nil');
3535735198 }
3535835199
3535935200 /**
@@ -35361,7 +35202,7 @@ class NoSuchMethod {
3536135202 * @return bool
3536235203 * @throws Exception
3536335204 */
35364- public static function validateNoSuchMethod(int $value): bool {
35205+ public static function validateNil(int $value): bool {
3536535206 return true;
3536635207 }
3536735208
@@ -35369,18 +35210,18 @@ class NoSuchMethod {
3536935210 * @throws Exception
3537035211 * @return int
3537135212 */
35372- public function getNoSuchMethod(): int {
35373- if (NoSuchMethod::validateNoSuchMethod($this->noSuchMethod)) {
35374- return $this->noSuchMethod;
35213+ public function getNil(): int {
35214+ if (Nil::validateNil($this->nil)) {
35215+ return $this->nil;
3537535216 }
35376- throw new Exception('never get to getNoSuchMethod NoSuchMethod::noSuchMethod');
35217+ throw new Exception('never get to getNil Nil::nil');
3537735218 }
3537835219
3537935220 /**
3538035221 * @return int
3538135222 */
35382- public static function sampleNoSuchMethod(): int {
35383- return 31; /*31:noSuchMethod*/
35223+ public static function sampleNil(): int {
35224+ return 31; /*31:nil*/
3538435225 }
3538535226
3538635227 /**
@@ -35388,7 +35229,7 @@ class NoSuchMethod {
3538835229 * @return bool
3538935230 */
3539035231 public function validate(): bool {
35391- return NoSuchMethod::validateNoSuchMethod($this->noSuchMethod);
35232+ return Nil::validateNil($this->nil);
3539235233 }
3539335234
3539435235 /**
@@ -35397,44 +35238,44 @@ class NoSuchMethod {
3539735238 */
3539835239 public function to(): stdClass {
3539935240 $out = new stdClass();
35400- $out->{'noSuchMethod'} = $this->toNoSuchMethod();
35241+ $out->{'nil'} = $this->toNil();
3540135242 return $out;
3540235243 }
3540335244
3540435245 /**
3540535246 * @param stdClass $obj
35406- * @return NoSuchMethod
35247+ * @return Nil
3540735248 * @throws Exception
3540835249 */
35409- public static function from(stdClass $obj): NoSuchMethod {
35410- if (!property_exists($obj, 'noSuchMethod')) {
35250+ public static function from(stdClass $obj): Nil {
35251+ if (!property_exists($obj, 'nil')) {
3541135252 throw new Exception("Missing required property");
3541235253 }
35413- return new NoSuchMethod(
35414- NoSuchMethod::fromNoSuchMethod($obj->{'noSuchMethod'})
35254+ return new Nil(
35255+ Nil::fromNil($obj->{'nil'})
3541535256 );
3541635257 }
3541735258
3541835259 /**
35419- * @return NoSuchMethod
35260+ * @return Nil
3542035261 */
35421- public static function sample(): NoSuchMethod {
35422- return new NoSuchMethod(
35423- NoSuchMethod::sampleNoSuchMethod()
35262+ public static function sample(): Nil {
35263+ return new Nil(
35264+ Nil::sampleNil()
3542435265 );
3542535266 }
3542635267 }
3542735268
35428-// This is an autogenerated file:Noexcept
35269+// This is an autogenerated file:No
3542935270
35430-class Noexcept {
35431- private int $noexcept; // json:noexcept Required
35271+class No {
35272+ private int $no; // json:NO Required
3543235273
3543335274 /**
35434- * @param int $noexcept
35275+ * @param int $no
3543535276 */
35436- public function __construct(int $noexcept) {
35437- $this->noexcept = $noexcept;
35277+ public function __construct(int $no) {
35278+ $this->no = $no;
3543835279 }
3543935280
3544035281 /**
@@ -35442,7 +35283,7 @@ class Noexcept {
3544235283 * @throws Exception
3544335284 * @return int
3544435285 */
35445- public static function fromNoexcept(int $value): int {
35286+ public static function fromNo(int $value): int {
3544635287 return $value; /*int*/
3544735288 }
3544835289
@@ -35450,11 +35291,11 @@ class Noexcept {
3545035291 * @throws Exception
3545135292 * @return int
3545235293 */
35453- public function toNoexcept(): int {
35454- if (Noexcept::validateNoexcept($this->noexcept)) {
35455- return $this->noexcept; /*int*/
35294+ public function toNo(): int {
35295+ if (No::validateNo($this->no)) {
35296+ return $this->no; /*int*/
3545635297 }
35457- throw new Exception('never get to this Noexcept::noexcept');
35298+ throw new Exception('never get to this No::no');
3545835299 }
3545935300
3546035301 /**
@@ -35462,7 +35303,7 @@ class Noexcept {
3546235303 * @return bool
3546335304 * @throws Exception
3546435305 */
35465- public static function validateNoexcept(int $value): bool {
35306+ public static function validateNo(int $value): bool {
3546635307 return true;
3546735308 }
3546835309
@@ -35470,18 +35311,18 @@ class Noexcept {
3547035311 * @throws Exception
3547135312 * @return int
3547235313 */
35473- public function getNoexcept(): int {
35474- if (Noexcept::validateNoexcept($this->noexcept)) {
35475- return $this->noexcept;
35314+ public function getNo(): int {
35315+ if (No::validateNo($this->no)) {
35316+ return $this->no;
3547635317 }
35477- throw new Exception('never get to getNoexcept Noexcept::noexcept');
35318+ throw new Exception('never get to getNo No::no');
3547835319 }
3547935320
3548035321 /**
3548135322 * @return int
3548235323 */
35483- public static function sampleNoexcept(): int {
35484- return 31; /*31:noexcept*/
35324+ public static function sampleNo(): int {
35325+ return 31; /*31:no*/
3548535326 }
3548635327
3548735328 /**
@@ -35489,7 +35330,7 @@ class Noexcept {
3548935330 * @return bool
3549035331 */
3549135332 public function validate(): bool {
35492- return Noexcept::validateNoexcept($this->noexcept);
35333+ return No::validateNo($this->no);
3549335334 }
3549435335
3549535336 /**
@@ -35498,44 +35339,44 @@ class Noexcept {
3549835339 */
3549935340 public function to(): stdClass {
3550035341 $out = new stdClass();
35501- $out->{'noexcept'} = $this->toNoexcept();
35342+ $out->{'NO'} = $this->toNo();
3550235343 return $out;
3550335344 }
3550435345
3550535346 /**
3550635347 * @param stdClass $obj
35507- * @return Noexcept
35348+ * @return No
3550835349 * @throws Exception
3550935350 */
35510- public static function from(stdClass $obj): Noexcept {
35511- if (!property_exists($obj, 'noexcept')) {
35351+ public static function from(stdClass $obj): No {
35352+ if (!property_exists($obj, 'NO')) {
3551235353 throw new Exception("Missing required property");
3551335354 }
35514- return new Noexcept(
35515- Noexcept::fromNoexcept($obj->{'noexcept'})
35355+ return new No(
35356+ No::fromNo($obj->{'NO'})
3551635357 );
3551735358 }
3551835359
3551935360 /**
35520- * @return Noexcept
35361+ * @return No
3552135362 */
35522- public static function sample(): Noexcept {
35523- return new Noexcept(
35524- Noexcept::sampleNoexcept()
35363+ public static function sample(): No {
35364+ return new No(
35365+ No::sampleNo()
3552535366 );
3552635367 }
3552735368 }
3552835369
35529-// This is an autogenerated file:Nonatomic
35370+// This is an autogenerated file:NoSuchMethod
3553035371
35531-class Nonatomic {
35532- private int $nonatomic; // json:nonatomic Required
35372+class NoSuchMethod {
35373+ private int $noSuchMethod; // json:noSuchMethod Required
3553335374
3553435375 /**
35535- * @param int $nonatomic
35376+ * @param int $noSuchMethod
3553635377 */
35537- public function __construct(int $nonatomic) {
35538- $this->nonatomic = $nonatomic;
35378+ public function __construct(int $noSuchMethod) {
35379+ $this->noSuchMethod = $noSuchMethod;
3553935380 }
3554035381
3554135382 /**
@@ -35543,7 +35384,7 @@ class Nonatomic {
3554335384 * @throws Exception
3554435385 * @return int
3554535386 */
35546- public static function fromNonatomic(int $value): int {
35387+ public static function fromNoSuchMethod(int $value): int {
3554735388 return $value; /*int*/
3554835389 }
3554935390
@@ -35551,11 +35392,11 @@ class Nonatomic {
3555135392 * @throws Exception
3555235393 * @return int
3555335394 */
35554- public function toNonatomic(): int {
35555- if (Nonatomic::validateNonatomic($this->nonatomic)) {
35556- return $this->nonatomic; /*int*/
35395+ public function toNoSuchMethod(): int {
35396+ if (NoSuchMethod::validateNoSuchMethod($this->noSuchMethod)) {
35397+ return $this->noSuchMethod; /*int*/
3555735398 }
35558- throw new Exception('never get to this Nonatomic::nonatomic');
35399+ throw new Exception('never get to this NoSuchMethod::noSuchMethod');
3555935400 }
3556035401
3556135402 /**
@@ -35563,7 +35404,7 @@ class Nonatomic {
3556335404 * @return bool
3556435405 * @throws Exception
3556535406 */
35566- public static function validateNonatomic(int $value): bool {
35407+ public static function validateNoSuchMethod(int $value): bool {
3556735408 return true;
3556835409 }
3556935410
@@ -35571,18 +35412,18 @@ class Nonatomic {
3557135412 * @throws Exception
3557235413 * @return int
3557335414 */
35574- public function getNonatomic(): int {
35575- if (Nonatomic::validateNonatomic($this->nonatomic)) {
35576- return $this->nonatomic;
35415+ public function getNoSuchMethod(): int {
35416+ if (NoSuchMethod::validateNoSuchMethod($this->noSuchMethod)) {
35417+ return $this->noSuchMethod;
3557735418 }
35578- throw new Exception('never get to getNonatomic Nonatomic::nonatomic');
35419+ throw new Exception('never get to getNoSuchMethod NoSuchMethod::noSuchMethod');
3557935420 }
3558035421
3558135422 /**
3558235423 * @return int
3558335424 */
35584- public static function sampleNonatomic(): int {
35585- return 31; /*31:nonatomic*/
35425+ public static function sampleNoSuchMethod(): int {
35426+ return 31; /*31:noSuchMethod*/
3558635427 }
3558735428
3558835429 /**
@@ -35590,7 +35431,7 @@ class Nonatomic {
3559035431 * @return bool
3559135432 */
3559235433 public function validate(): bool {
35593- return Nonatomic::validateNonatomic($this->nonatomic);
35434+ return NoSuchMethod::validateNoSuchMethod($this->noSuchMethod);
3559435435 }
3559535436
3559635437 /**
@@ -35599,13 +35440,215 @@ class Nonatomic {
3559935440 */
3560035441 public function to(): stdClass {
3560135442 $out = new stdClass();
35602- $out->{'nonatomic'} = $this->toNonatomic();
35443+ $out->{'noSuchMethod'} = $this->toNoSuchMethod();
3560335444 return $out;
3560435445 }
3560535446
3560635447 /**
3560735448 * @param stdClass $obj
35608- * @return Nonatomic
35449+ * @return NoSuchMethod
35450+ * @throws Exception
35451+ */
35452+ public static function from(stdClass $obj): NoSuchMethod {
35453+ if (!property_exists($obj, 'noSuchMethod')) {
35454+ throw new Exception("Missing required property");
35455+ }
35456+ return new NoSuchMethod(
35457+ NoSuchMethod::fromNoSuchMethod($obj->{'noSuchMethod'})
35458+ );
35459+ }
35460+
35461+ /**
35462+ * @return NoSuchMethod
35463+ */
35464+ public static function sample(): NoSuchMethod {
35465+ return new NoSuchMethod(
35466+ NoSuchMethod::sampleNoSuchMethod()
35467+ );
35468+ }
35469+}
35470+
35471+// This is an autogenerated file:Noexcept
35472+
35473+class Noexcept {
35474+ private int $noexcept; // json:noexcept Required
35475+
35476+ /**
35477+ * @param int $noexcept
35478+ */
35479+ public function __construct(int $noexcept) {
35480+ $this->noexcept = $noexcept;
35481+ }
35482+
35483+ /**
35484+ * @param int $value
35485+ * @throws Exception
35486+ * @return int
35487+ */
35488+ public static function fromNoexcept(int $value): int {
35489+ return $value; /*int*/
35490+ }
35491+
35492+ /**
35493+ * @throws Exception
35494+ * @return int
35495+ */
35496+ public function toNoexcept(): int {
35497+ if (Noexcept::validateNoexcept($this->noexcept)) {
35498+ return $this->noexcept; /*int*/
35499+ }
35500+ throw new Exception('never get to this Noexcept::noexcept');
35501+ }
35502+
35503+ /**
35504+ * @param int
35505+ * @return bool
35506+ * @throws Exception
35507+ */
35508+ public static function validateNoexcept(int $value): bool {
35509+ return true;
35510+ }
35511+
35512+ /**
35513+ * @throws Exception
35514+ * @return int
35515+ */
35516+ public function getNoexcept(): int {
35517+ if (Noexcept::validateNoexcept($this->noexcept)) {
35518+ return $this->noexcept;
35519+ }
35520+ throw new Exception('never get to getNoexcept Noexcept::noexcept');
35521+ }
35522+
35523+ /**
35524+ * @return int
35525+ */
35526+ public static function sampleNoexcept(): int {
35527+ return 31; /*31:noexcept*/
35528+ }
35529+
35530+ /**
35531+ * @throws Exception
35532+ * @return bool
35533+ */
35534+ public function validate(): bool {
35535+ return Noexcept::validateNoexcept($this->noexcept);
35536+ }
35537+
35538+ /**
35539+ * @return stdClass
35540+ * @throws Exception
35541+ */
35542+ public function to(): stdClass {
35543+ $out = new stdClass();
35544+ $out->{'noexcept'} = $this->toNoexcept();
35545+ return $out;
35546+ }
35547+
35548+ /**
35549+ * @param stdClass $obj
35550+ * @return Noexcept
35551+ * @throws Exception
35552+ */
35553+ public static function from(stdClass $obj): Noexcept {
35554+ if (!property_exists($obj, 'noexcept')) {
35555+ throw new Exception("Missing required property");
35556+ }
35557+ return new Noexcept(
35558+ Noexcept::fromNoexcept($obj->{'noexcept'})
35559+ );
35560+ }
35561+
35562+ /**
35563+ * @return Noexcept
35564+ */
35565+ public static function sample(): Noexcept {
35566+ return new Noexcept(
35567+ Noexcept::sampleNoexcept()
35568+ );
35569+ }
35570+}
35571+
35572+// This is an autogenerated file:Nonatomic
35573+
35574+class Nonatomic {
35575+ private int $nonatomic; // json:nonatomic Required
35576+
35577+ /**
35578+ * @param int $nonatomic
35579+ */
35580+ public function __construct(int $nonatomic) {
35581+ $this->nonatomic = $nonatomic;
35582+ }
35583+
35584+ /**
35585+ * @param int $value
35586+ * @throws Exception
35587+ * @return int
35588+ */
35589+ public static function fromNonatomic(int $value): int {
35590+ return $value; /*int*/
35591+ }
35592+
35593+ /**
35594+ * @throws Exception
35595+ * @return int
35596+ */
35597+ public function toNonatomic(): int {
35598+ if (Nonatomic::validateNonatomic($this->nonatomic)) {
35599+ return $this->nonatomic; /*int*/
35600+ }
35601+ throw new Exception('never get to this Nonatomic::nonatomic');
35602+ }
35603+
35604+ /**
35605+ * @param int
35606+ * @return bool
35607+ * @throws Exception
35608+ */
35609+ public static function validateNonatomic(int $value): bool {
35610+ return true;
35611+ }
35612+
35613+ /**
35614+ * @throws Exception
35615+ * @return int
35616+ */
35617+ public function getNonatomic(): int {
35618+ if (Nonatomic::validateNonatomic($this->nonatomic)) {
35619+ return $this->nonatomic;
35620+ }
35621+ throw new Exception('never get to getNonatomic Nonatomic::nonatomic');
35622+ }
35623+
35624+ /**
35625+ * @return int
35626+ */
35627+ public static function sampleNonatomic(): int {
35628+ return 31; /*31:nonatomic*/
35629+ }
35630+
35631+ /**
35632+ * @throws Exception
35633+ * @return bool
35634+ */
35635+ public function validate(): bool {
35636+ return Nonatomic::validateNonatomic($this->nonatomic);
35637+ }
35638+
35639+ /**
35640+ * @return stdClass
35641+ * @throws Exception
35642+ */
35643+ public function to(): stdClass {
35644+ $out = new stdClass();
35645+ $out->{'nonatomic'} = $this->toNonatomic();
35646+ return $out;
35647+ }
35648+
35649+ /**
35650+ * @param stdClass $obj
35651+ * @return Nonatomic
3560935652 * @throws Exception
3561035653 */
3561135654 public static function from(stdClass $obj): Nonatomic {
@@ -41589,209 +41632,7 @@ class Sbyte {
4158941632 }
4159041633 }
4159141634
41592-// This is an autogenerated file:Sealed
41593-
41594-class Sealed {
41595- private int $sealed; // json:sealed Required
41596-
41597- /**
41598- * @param int $sealed
41599- */
41600- public function __construct(int $sealed) {
41601- $this->sealed = $sealed;
41602- }
41603-
41604- /**
41605- * @param int $value
41606- * @throws Exception
41607- * @return int
41608- */
41609- public static function fromSealed(int $value): int {
41610- return $value; /*int*/
41611- }
41612-
41613- /**
41614- * @throws Exception
41615- * @return int
41616- */
41617- public function toSealed(): int {
41618- if (Sealed::validateSealed($this->sealed)) {
41619- return $this->sealed; /*int*/
41620- }
41621- throw new Exception('never get to this Sealed::sealed');
41622- }
41623-
41624- /**
41625- * @param int
41626- * @return bool
41627- * @throws Exception
41628- */
41629- public static function validateSealed(int $value): bool {
41630- return true;
41631- }
41632-
41633- /**
41634- * @throws Exception
41635- * @return int
41636- */
41637- public function getSealed(): int {
41638- if (Sealed::validateSealed($this->sealed)) {
41639- return $this->sealed;
41640- }
41641- throw new Exception('never get to getSealed Sealed::sealed');
41642- }
41643-
41644- /**
41645- * @return int
41646- */
41647- public static function sampleSealed(): int {
41648- return 31; /*31:sealed*/
41649- }
41650-
41651- /**
41652- * @throws Exception
41653- * @return bool
41654- */
41655- public function validate(): bool {
41656- return Sealed::validateSealed($this->sealed);
41657- }
41658-
41659- /**
41660- * @return stdClass
41661- * @throws Exception
41662- */
41663- public function to(): stdClass {
41664- $out = new stdClass();
41665- $out->{'sealed'} = $this->toSealed();
41666- return $out;
41667- }
41668-
41669- /**
41670- * @param stdClass $obj
41671- * @return Sealed
41672- * @throws Exception
41673- */
41674- public static function from(stdClass $obj): Sealed {
41675- if (!property_exists($obj, 'sealed')) {
41676- throw new Exception("Missing required property");
41677- }
41678- return new Sealed(
41679- Sealed::fromSealed($obj->{'sealed'})
41680- );
41681- }
41682-
41683- /**
41684- * @return Sealed
41685- */
41686- public static function sample(): Sealed {
41687- return new Sealed(
41688- Sealed::sampleSealed()
41689- );
41690- }
41691-}
41692-
41693-// This is an autogenerated file:Sel
41694-
41695-class Sel {
41696- private int $sel; // json:SEL Required
41697-
41698- /**
41699- * @param int $sel
41700- */
41701- public function __construct(int $sel) {
41702- $this->sel = $sel;
41703- }
41704-
41705- /**
41706- * @param int $value
41707- * @throws Exception
41708- * @return int
41709- */
41710- public static function fromSel(int $value): int {
41711- return $value; /*int*/
41712- }
41713-
41714- /**
41715- * @throws Exception
41716- * @return int
41717- */
41718- public function toSel(): int {
41719- if (Sel::validateSel($this->sel)) {
41720- return $this->sel; /*int*/
41721- }
41722- throw new Exception('never get to this Sel::sel');
41723- }
41724-
41725- /**
41726- * @param int
41727- * @return bool
41728- * @throws Exception
41729- */
41730- public static function validateSel(int $value): bool {
41731- return true;
41732- }
41733-
41734- /**
41735- * @throws Exception
41736- * @return int
41737- */
41738- public function getSel(): int {
41739- if (Sel::validateSel($this->sel)) {
41740- return $this->sel;
41741- }
41742- throw new Exception('never get to getSel Sel::sel');
41743- }
41744-
41745- /**
41746- * @return int
41747- */
41748- public static function sampleSel(): int {
41749- return 31; /*31:sel*/
41750- }
41751-
41752- /**
41753- * @throws Exception
41754- * @return bool
41755- */
41756- public function validate(): bool {
41757- return Sel::validateSel($this->sel);
41758- }
41759-
41760- /**
41761- * @return stdClass
41762- * @throws Exception
41763- */
41764- public function to(): stdClass {
41765- $out = new stdClass();
41766- $out->{'SEL'} = $this->toSel();
41767- return $out;
41768- }
41769-
41770- /**
41771- * @param stdClass $obj
41772- * @return Sel
41773- * @throws Exception
41774- */
41775- public static function from(stdClass $obj): Sel {
41776- if (!property_exists($obj, 'SEL')) {
41777- throw new Exception("Missing required property");
41778- }
41779- return new Sel(
41780- Sel::fromSel($obj->{'SEL'})
41781- );
41782- }
41783-
41784- /**
41785- * @return Sel
41786- */
41787- public static function sample(): Sel {
41788- return new Sel(
41789- Sel::sampleSel()
41790- );
41791- }
41792-}
41793-
41794-// This is an autogenerated file:Obj5
41635+// This is an autogenerated file:Obj5
4179541636
4179641637 class Obj5 {
4179741638 private int $dummy; // json:dummy Required
@@ -41801,6 +41642,8 @@ class Obj5 {
4180141642 private Obj5True $obj5True; // json:true Required
4180241643 private TypeClass $obj5Type; // json:type Required
4180341644 private PrimitiveKind $primitiveKind; // json:PrimitiveKind Required
41645+ private Sealed $sealed; // json:sealed Required
41646+ private Sel $sel; // json:SEL Required
4180441647 private Select $select; // json:select Required
4180541648 private SelfClass $self; // json:Self Required
4180641649 private Sendable $sendable; // json:Sendable Required
@@ -41857,9 +41700,6 @@ class Obj5 {
4185741700 private Undefined $undefined; // json:undefined Required
4185841701 private Union $union; // json:union Required
4185941702 private UnmarshalJSON $unmarshalJSON; // json:UnmarshalJSON Required
41860- private Unowned $unowned; // json:unowned Required
41861- private Unsafe $unsafe; // json:unsafe Required
41862- private UseSerializers $useSerializers; // json:UseSerializers Required
4186341703
4186441704 /**
4186541705 * @param int $dummy
@@ -41869,6 +41709,8 @@ class Obj5 {
4186941709 * @param Obj5True $obj5True
4187041710 * @param TypeClass $obj5Type
4187141711 * @param PrimitiveKind $primitiveKind
41712+ * @param Sealed $sealed
41713+ * @param Sel $sel
4187241714 * @param Select $select
4187341715 * @param SelfClass $self
4187441716 * @param Sendable $sendable
@@ -41925,11 +41767,8 @@ class Obj5 {
4192541767 * @param Undefined $undefined
4192641768 * @param Union $union
4192741769 * @param UnmarshalJSON $unmarshalJSON
41928- * @param Unowned $unowned
41929- * @param Unsafe $unsafe
41930- * @param UseSerializers $useSerializers
4193141770 */
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) {
41771+ public function __construct(int $dummy, KSerializer $kSerializer, Obj5Self $obj5Self, This $obj5This, Obj5True $obj5True, TypeClass $obj5Type, PrimitiveKind $primitiveKind, Sealed $sealed, Sel $sel, 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) {
4193341772 $this->dummy = $dummy;
4193441773 $this->kSerializer = $kSerializer;
4193541774 $this->obj5Self = $obj5Self;
@@ -41937,6 +41776,8 @@ class Obj5 {
4193741776 $this->obj5True = $obj5True;
4193841777 $this->obj5Type = $obj5Type;
4193941778 $this->primitiveKind = $primitiveKind;
41779+ $this->sealed = $sealed;
41780+ $this->sel = $sel;
4194041781 $this->select = $select;
4194141782 $this->self = $self;
4194241783 $this->sendable = $sendable;
@@ -41993,9 +41834,6 @@ class Obj5 {
4199341834 $this->undefined = $undefined;
4199441835 $this->union = $union;
4199541836 $this->unmarshalJSON = $unmarshalJSON;
41996- $this->unowned = $unowned;
41997- $this->unsafe = $unsafe;
41998- $this->useSerializers = $useSerializers;
4199941837 }
4200041838
4200141839 /**
@@ -42333,6 +42171,102 @@ class Obj5 {
4233342171 return PrimitiveKind::sample(); /*37:primitiveKind*/
4233442172 }
4233542173
42174+ /**
42175+ * @param stdClass $value
42176+ * @throws Exception
42177+ * @return Sealed
42178+ */
42179+ public static function fromSealed(stdClass $value): Sealed {
42180+ return Sealed::from($value); /*class*/
42181+ }
42182+
42183+ /**
42184+ * @throws Exception
42185+ * @return stdClass
42186+ */
42187+ public function toSealed(): stdClass {
42188+ if (Obj5::validateSealed($this->sealed)) {
42189+ return $this->sealed->to(); /*class*/
42190+ }
42191+ throw new Exception('never get to this Obj5::sealed');
42192+ }
42193+
42194+ /**
42195+ * @param Sealed
42196+ * @return bool
42197+ * @throws Exception
42198+ */
42199+ public static function validateSealed(Sealed $value): bool {
42200+ $value->validate();
42201+ return true;
42202+ }
42203+
42204+ /**
42205+ * @throws Exception
42206+ * @return Sealed
42207+ */
42208+ public function getSealed(): Sealed {
42209+ if (Obj5::validateSealed($this->sealed)) {
42210+ return $this->sealed;
42211+ }
42212+ throw new Exception('never get to getSealed Obj5::sealed');
42213+ }
42214+
42215+ /**
42216+ * @return Sealed
42217+ */
42218+ public static function sampleSealed(): Sealed {
42219+ return Sealed::sample(); /*38:sealed*/
42220+ }
42221+
42222+ /**
42223+ * @param stdClass $value
42224+ * @throws Exception
42225+ * @return Sel
42226+ */
42227+ public static function fromSel(stdClass $value): Sel {
42228+ return Sel::from($value); /*class*/
42229+ }
42230+
42231+ /**
42232+ * @throws Exception
42233+ * @return stdClass
42234+ */
42235+ public function toSel(): stdClass {
42236+ if (Obj5::validateSel($this->sel)) {
42237+ return $this->sel->to(); /*class*/
42238+ }
42239+ throw new Exception('never get to this Obj5::sel');
42240+ }
42241+
42242+ /**
42243+ * @param Sel
42244+ * @return bool
42245+ * @throws Exception
42246+ */
42247+ public static function validateSel(Sel $value): bool {
42248+ $value->validate();
42249+ return true;
42250+ }
42251+
42252+ /**
42253+ * @throws Exception
42254+ * @return Sel
42255+ */
42256+ public function getSel(): Sel {
42257+ if (Obj5::validateSel($this->sel)) {
42258+ return $this->sel;
42259+ }
42260+ throw new Exception('never get to getSel Obj5::sel');
42261+ }
42262+
42263+ /**
42264+ * @return Sel
42265+ */
42266+ public static function sampleSel(): Sel {
42267+ return Sel::sample(); /*39:sel*/
42268+ }
42269+
4233642270 /**
4233742271 * @param stdClass $value
4233842272 * @throws Exception
@@ -42378,7 +42312,7 @@ class Obj5 {
4237842312 * @return Select
4237942313 */
4238042314 public static function sampleSelect(): Select {
42381- return Select::sample(); /*38:select*/
42315+ return Select::sample(); /*40:select*/
4238242316 }
4238342317
4238442318 /**
@@ -42426,7 +42360,7 @@ class Obj5 {
4242642360 * @return SelfClass
4242742361 */
4242842362 public static function sampleSelf(): SelfClass {
42429- return SelfClass::sample(); /*39:self*/
42363+ return SelfClass::sample(); /*41:self*/
4243042364 }
4243142365
4243242366 /**
@@ -42474,7 +42408,7 @@ class Obj5 {
4247442408 * @return Sendable
4247542409 */
4247642410 public static function sampleSendable(): Sendable {
42477- return Sendable::sample(); /*40:sendable*/
42411+ return Sendable::sample(); /*42:sendable*/
4247842412 }
4247942413
4248042414 /**
@@ -42522,7 +42456,7 @@ class Obj5 {
4252242456 * @return SerialDescriptor
4252342457 */
4252442458 public static function sampleSerialDescriptor(): SerialDescriptor {
42525- return SerialDescriptor::sample(); /*41:serialDescriptor*/
42459+ return SerialDescriptor::sample(); /*43:serialDescriptor*/
4252642460 }
4252742461
4252842462 /**
@@ -42570,7 +42504,7 @@ class Obj5 {
4257042504 * @return SerialName
4257142505 */
4257242506 public static function sampleSerialName(): SerialName {
42573- return SerialName::sample(); /*42:serialName*/
42507+ return SerialName::sample(); /*44:serialName*/
4257442508 }
4257542509
4257642510 /**
@@ -42618,7 +42552,7 @@ class Obj5 {
4261842552 * @return SerializableClass
4261942553 */
4262042554 public static function sampleSerializable(): SerializableClass {
42621- return SerializableClass::sample(); /*43:serializable*/
42555+ return SerializableClass::sample(); /*45:serializable*/
4262242556 }
4262342557
4262442558 /**
@@ -42666,7 +42600,7 @@ class Obj5 {
4266642600 * @return Serialize
4266742601 */
4266842602 public static function sampleSerialize(): Serialize {
42669- return Serialize::sample(); /*44:serialize*/
42603+ return Serialize::sample(); /*46:serialize*/
4267042604 }
4267142605
4267242606 /**
@@ -42714,7 +42648,7 @@ class Obj5 {
4271442648 * @return SerializerProvider
4271542649 */
4271642650 public static function sampleSerializerProvider(): SerializerProvider {
42717- return SerializerProvider::sample(); /*45:serializerProvider*/
42651+ return SerializerProvider::sample(); /*47:serializerProvider*/
4271842652 }
4271942653
4272042654 /**
@@ -42762,7 +42696,7 @@ class Obj5 {
4276242696 * @return Set
4276342697 */
4276442698 public static function sampleSet(): Set {
42765- return Set::sample(); /*46:set*/
42699+ return Set::sample(); /*48:set*/
4276642700 }
4276742701
4276842702 /**
@@ -42810,7 +42744,7 @@ class Obj5 {
4281042744 * @return Short
4281142745 */
4281242746 public static function sampleShort(): Short {
42813- return Short::sample(); /*47:short*/
42747+ return Short::sample(); /*49:short*/
4281442748 }
4281542749
4281642750 /**
@@ -42858,7 +42792,7 @@ class Obj5 {
4285842792 * @return Signed
4285942793 */
4286042794 public static function sampleSigned(): Signed {
42861- return Signed::sample(); /*48:signed*/
42795+ return Signed::sample(); /*50:signed*/
4286242796 }
4286342797
4286442798 /**
@@ -42906,7 +42840,7 @@ class Obj5 {
4290642840 * @return SimpleModule
4290742841 */
4290842842 public static function sampleSimpleModule(): SimpleModule {
42909- return SimpleModule::sample(); /*49:simpleModule*/
42843+ return SimpleModule::sample(); /*51:simpleModule*/
4291042844 }
4291142845
4291242846 /**
@@ -42954,7 +42888,7 @@ class Obj5 {
4295442888 * @return Sizeof
4295542889 */
4295642890 public static function sampleSizeof(): Sizeof {
42957- return Sizeof::sample(); /*50:sizeof*/
42891+ return Sizeof::sample(); /*52:sizeof*/
4295842892 }
4295942893
4296042894 /**
@@ -43002,7 +42936,7 @@ class Obj5 {
4300242936 * @return Stackalloc
4300342937 */
4300442938 public static function sampleStackalloc(): Stackalloc {
43005- return Stackalloc::sample(); /*51:stackalloc*/
42939+ return Stackalloc::sample(); /*53:stackalloc*/
4300642940 }
4300742941
4300842942 /**
@@ -43050,7 +42984,7 @@ class Obj5 {
4305042984 * @return Standards
4305142985 */
4305242986 public static function sampleStandards(): Standards {
43053- return Standards::sample(); /*52:standards*/
42987+ return Standards::sample(); /*54:standards*/
4305442988 }
4305542989
4305642990 /**
@@ -43098,7 +43032,7 @@ class Obj5 {
4309843032 * @return StaticClass
4309943033 */
4310043034 public static function sampleStatic(): StaticClass {
43101- return StaticClass::sample(); /*53:static*/
43035+ return StaticClass::sample(); /*55:static*/
4310243036 }
4310343037
4310443038 /**
@@ -43146,7 +43080,7 @@ class Obj5 {
4314643080 * @return StaticAssert
4314743081 */
4314843082 public static function sampleStaticAssert(): StaticAssert {
43149- return StaticAssert::sample(); /*54:staticAssert*/
43083+ return StaticAssert::sample(); /*56:staticAssert*/
4315043084 }
4315143085
4315243086 /**
@@ -43194,7 +43128,7 @@ class Obj5 {
4319443128 * @return StaticCast
4319543129 */
4319643130 public static function sampleStaticCast(): StaticCast {
43197- return StaticCast::sample(); /*55:staticCast*/
43131+ return StaticCast::sample(); /*57:staticCast*/
4319843132 }
4319943133
4320043134 /**
@@ -43242,7 +43176,7 @@ class Obj5 {
4324243176 * @return StdDeserializer
4324343177 */
4324443178 public static function sampleStdDeserializer(): StdDeserializer {
43245- return StdDeserializer::sample(); /*56:stdDeserializer*/
43179+ return StdDeserializer::sample(); /*58:stdDeserializer*/
4324643180 }
4324743181
4324843182 /**
@@ -43290,7 +43224,7 @@ class Obj5 {
4329043224 * @return StdSerializer
4329143225 */
4329243226 public static function sampleStdSerializer(): StdSerializer {
43293- return StdSerializer::sample(); /*57:stdSerializer*/
43227+ return StdSerializer::sample(); /*59:stdSerializer*/
4329443228 }
4329543229
4329643230 /**
@@ -43338,7 +43272,7 @@ class Obj5 {
4333843272 * @return Strictfp
4333943273 */
4334043274 public static function sampleStrictfp(): Strictfp {
43341- return Strictfp::sample(); /*58:strictfp*/
43275+ return Strictfp::sample(); /*60:strictfp*/
4334243276 }
4334343277
4334443278 /**
@@ -43386,7 +43320,7 @@ class Obj5 {
4338643320 * @return StringClass
4338743321 */
4338843322 public static function sampleString(): StringClass {
43389- return StringClass::sample(); /*59:string*/
43323+ return StringClass::sample(); /*61:string*/
4339043324 }
4339143325
4339243326 /**
@@ -43434,7 +43368,7 @@ class Obj5 {
4343443368 * @return Struct
4343543369 */
4343643370 public static function sampleStruct(): Struct {
43437- return Struct::sample(); /*60:struct*/
43371+ return Struct::sample(); /*62:struct*/
4343843372 }
4343943373
4344043374 /**
@@ -43482,7 +43416,7 @@ class Obj5 {
4348243416 * @return Subscript
4348343417 */
4348443418 public static function sampleSubscript(): Subscript {
43485- return Subscript::sample(); /*61:subscript*/
43419+ return Subscript::sample(); /*63:subscript*/
4348643420 }
4348743421
4348843422 /**
@@ -43530,7 +43464,7 @@ class Obj5 {
4353043464 * @return Super
4353143465 */
4353243466 public static function sampleSuper(): Super {
43533- return Super::sample(); /*62:super*/
43467+ return Super::sample(); /*64:super*/
4353443468 }
4353543469
4353643470 /**
@@ -43578,7 +43512,7 @@ class Obj5 {
4357843512 * @return SwitchClass
4357943513 */
4358043514 public static function sampleSwitch(): SwitchClass {
43581- return SwitchClass::sample(); /*63:switch*/
43515+ return SwitchClass::sample(); /*65:switch*/
4358243516 }
4358343517
4358443518 /**
@@ -43626,7 +43560,7 @@ class Obj5 {
4362643560 * @return Symbol
4362743561 */
4362843562 public static function sampleSymbol(): Symbol {
43629- return Symbol::sample(); /*64:symbol*/
43563+ return Symbol::sample(); /*66:symbol*/
4363043564 }
4363143565
4363243566 /**
@@ -43674,7 +43608,7 @@ class Obj5 {
4367443608 * @return Synchronized
4367543609 */
4367643610 public static function sampleSynchronized(): Synchronized {
43677- return Synchronized::sample(); /*65:synchronized*/
43611+ return Synchronized::sample(); /*67:synchronized*/
4367843612 }
4367943613
4368043614 /**
@@ -43722,7 +43656,7 @@ class Obj5 {
4372243656 * @return System
4372343657 */
4372443658 public static function sampleSystem(): System {
43725- return System::sample(); /*66:system*/
43659+ return System::sample(); /*68:system*/
4372643660 }
4372743661
4372843662 /**
@@ -43770,7 +43704,7 @@ class Obj5 {
4377043704 * @return Template
4377143705 */
4377243706 public static function sampleTemplate(): Template {
43773- return Template::sample(); /*67:template*/
43707+ return Template::sample(); /*69:template*/
4377443708 }
4377543709
4377643710 /**
@@ -43818,7 +43752,7 @@ class Obj5 {
4381843752 * @return Then
4381943753 */
4382043754 public static function sampleThen(): Then {
43821- return Then::sample(); /*68:then*/
43755+ return Then::sample(); /*70:then*/
4382243756 }
4382343757
4382443758 /**
@@ -43866,7 +43800,7 @@ class Obj5 {
4386643800 * @return ThreadLocal
4386743801 */
4386843802 public static function sampleThreadLocal(): ThreadLocal {
43869- return ThreadLocal::sample(); /*69:threadLocal*/
43803+ return ThreadLocal::sample(); /*71:threadLocal*/
4387043804 }
4387143805
4387243806 /**
@@ -43914,7 +43848,7 @@ class Obj5 {
4391443848 * @return ThrowClass
4391543849 */
4391643850 public static function sampleThrow(): ThrowClass {
43917- return ThrowClass::sample(); /*70:throw*/
43851+ return ThrowClass::sample(); /*72:throw*/
4391843852 }
4391943853
4392043854 /**
@@ -43962,7 +43896,7 @@ class Obj5 {
4396243896 * @return Throws
4396343897 */
4396443898 public static function sampleThrows(): Throws {
43965- return Throws::sample(); /*71:throws*/
43899+ return Throws::sample(); /*73:throws*/
4396643900 }
4396743901
4396843902 /**
@@ -44010,7 +43944,7 @@ class Obj5 {
4401043944 * @return TimeOnly
4401143945 */
4401243946 public static function sampleTimeOnly(): TimeOnly {
44013- return TimeOnly::sample(); /*72:timeOnly*/
43947+ return TimeOnly::sample(); /*74:timeOnly*/
4401443948 }
4401543949
4401643950 /**
@@ -44058,7 +43992,7 @@ class Obj5 {
4405843992 * @return TimeOnlyConverter
4405943993 */
4406043994 public static function sampleTimeOnlyConverter(): TimeOnlyConverter {
44061- return TimeOnlyConverter::sample(); /*73:timeOnlyConverter*/
43995+ return TimeOnlyConverter::sample(); /*75:timeOnlyConverter*/
4406243996 }
4406343997
4406443998 /**
@@ -44106,7 +44040,7 @@ class Obj5 {
4410644040 * @return TimeZone
4410744041 */
4410844042 public static function sampleTimeZone(): TimeZone {
44109- return TimeZone::sample(); /*74:timeZone*/
44043+ return TimeZone::sample(); /*76:timeZone*/
4411044044 }
4411144045
4411244046 /**
@@ -44154,7 +44088,7 @@ class Obj5 {
4415444088 * @return ToDict
4415544089 */
4415644090 public static function sampleToDict(): ToDict {
44157- return ToDict::sample(); /*75:toDict*/
44091+ return ToDict::sample(); /*77:toDict*/
4415844092 }
4415944093
4416044094 /**
@@ -44202,7 +44136,7 @@ class Obj5 {
4420244136 * @return ToJSON
4420344137 */
4420444138 public static function sampleToJSON(): ToJSON {
44205- return ToJSON::sample(); /*76:toJSON*/
44139+ return ToJSON::sample(); /*78:toJSON*/
4420644140 }
4420744141
4420844142 /**
@@ -44250,7 +44184,7 @@ class Obj5 {
4425044184 * @return ToString
4425144185 */
4425244186 public static function sampleToString(): ToString {
44253- return ToString::sample(); /*77:toString*/
44187+ return ToString::sample(); /*79:toString*/
4425444188 }
4425544189
4425644190 /**
@@ -44298,7 +44232,7 @@ class Obj5 {
4429844232 * @return TopLevelClass
4429944233 */
4430044234 public static function sampleTopLevel(): TopLevelClass {
44301- return TopLevelClass::sample(); /*78:topLevel*/
44235+ return TopLevelClass::sample(); /*80:topLevel*/
4430244236 }
4430344237
4430444238 /**
@@ -44346,7 +44280,7 @@ class Obj5 {
4434644280 * @return Transient
4434744281 */
4434844282 public static function sampleTransient(): Transient {
44349- return Transient::sample(); /*79:transient*/
44283+ return Transient::sample(); /*81:transient*/
4435044284 }
4435144285
4435244286 /**
@@ -44394,7 +44328,7 @@ class Obj5 {
4439444328 * @return TrueClass
4439544329 */
4439644330 public static function sampleTrue(): TrueClass {
44397- return TrueClass::sample(); /*80:true*/
44331+ return TrueClass::sample(); /*82:true*/
4439844332 }
4439944333
4440044334 /**
@@ -44442,7 +44376,7 @@ class Obj5 {
4444244376 * @return TryClass
4444344377 */
4444444378 public static function sampleTry(): TryClass {
44445- return TryClass::sample(); /*81:try*/
44379+ return TryClass::sample(); /*83:try*/
4444644380 }
4444744381
4444844382 /**
@@ -44490,7 +44424,7 @@ class Obj5 {
4449044424 * @return Type
4449144425 */
4449244426 public static function sampleType(): Type {
44493- return Type::sample(); /*82:type*/
44427+ return Type::sample(); /*84:type*/
4449444428 }
4449544429
4449644430 /**
@@ -44538,7 +44472,7 @@ class Obj5 {
4453844472 * @return Typealias
4453944473 */
4454044474 public static function sampleTypealias(): Typealias {
44541- return Typealias::sample(); /*83:typealias*/
44475+ return Typealias::sample(); /*85:typealias*/
4454244476 }
4454344477
4454444478 /**
@@ -44586,7 +44520,7 @@ class Obj5 {
4458644520 * @return Typedef
4458744521 */
4458844522 public static function sampleTypedef(): Typedef {
44589- return Typedef::sample(); /*84:typedef*/
44523+ return Typedef::sample(); /*86:typedef*/
4459044524 }
4459144525
4459244526 /**
@@ -44634,7 +44568,7 @@ class Obj5 {
4463444568 * @return Typeid
4463544569 */
4463644570 public static function sampleTypeid(): Typeid {
44637- return Typeid::sample(); /*85:typeid*/
44571+ return Typeid::sample(); /*87:typeid*/
4463844572 }
4463944573
4464044574 /**
@@ -44682,7 +44616,7 @@ class Obj5 {
4468244616 * @return Typename
4468344617 */
4468444618 public static function sampleTypename(): Typename {
44685- return Typename::sample(); /*86:typename*/
44619+ return Typename::sample(); /*88:typename*/
4468644620 }
4468744621
4468844622 /**
@@ -44730,7 +44664,7 @@ class Obj5 {
4473044664 * @return Typeof
4473144665 */
4473244666 public static function sampleTypeof(): Typeof {
44733- return Typeof::sample(); /*87:typeof*/
44667+ return Typeof::sample(); /*89:typeof*/
4473444668 }
4473544669
4473644670 /**
@@ -44778,7 +44712,7 @@ class Obj5 {
4477844712 * @return Uint
4477944713 */
4478044714 public static function sampleUint(): Uint {
44781- return Uint::sample(); /*88:uint*/
44715+ return Uint::sample(); /*90:uint*/
4478244716 }
4478344717
4478444718 /**
@@ -44826,7 +44760,7 @@ class Obj5 {
4482644760 * @return Ulong
4482744761 */
4482844762 public static function sampleUlong(): Ulong {
44829- return Ulong::sample(); /*89:ulong*/
44763+ return Ulong::sample(); /*91:ulong*/
4483044764 }
4483144765
4483244766 /**
@@ -44874,7 +44808,7 @@ class Obj5 {
4487444808 * @return Unchecked
4487544809 */
4487644810 public static function sampleUnchecked(): Unchecked {
44877- return Unchecked::sample(); /*90:unchecked*/
44811+ return Unchecked::sample(); /*92:unchecked*/
4487844812 }
4487944813
4488044814 /**
@@ -44922,7 +44856,7 @@ class Obj5 {
4492244856 * @return Undefined
4492344857 */
4492444858 public static function sampleUndefined(): Undefined {
44925- return Undefined::sample(); /*91:undefined*/
44859+ return Undefined::sample(); /*93:undefined*/
4492644860 }
4492744861
4492844862 /**
@@ -44970,7 +44904,7 @@ class Obj5 {
4497044904 * @return Union
4497144905 */
4497244906 public static function sampleUnion(): Union {
44973- return Union::sample(); /*92:union*/
44907+ return Union::sample(); /*94:union*/
4497444908 }
4497544909
4497644910 /**
@@ -45018,156 +44952,12 @@ class Obj5 {
4501844952 * @return UnmarshalJSON
4501944953 */
4502044954 public static function sampleUnmarshalJSON(): UnmarshalJSON {
45021- return UnmarshalJSON::sample(); /*93:unmarshalJSON*/
44955+ return UnmarshalJSON::sample(); /*95:unmarshalJSON*/
4502244956 }
4502344957
4502444958 /**
45025- * @param stdClass $value
4502644959 * @throws Exception
45027- * @return Unowned
45028- */
45029- public static function fromUnowned(stdClass $value): Unowned {
45030- return Unowned::from($value); /*class*/
45031- }
45032-
45033- /**
45034- * @throws Exception
45035- * @return stdClass
45036- */
45037- public function toUnowned(): stdClass {
45038- if (Obj5::validateUnowned($this->unowned)) {
45039- return $this->unowned->to(); /*class*/
45040- }
45041- throw new Exception('never get to this Obj5::unowned');
45042- }
45043-
45044- /**
45045- * @param Unowned
45046- * @return bool
45047- * @throws Exception
45048- */
45049- public static function validateUnowned(Unowned $value): bool {
45050- $value->validate();
45051- return true;
45052- }
45053-
45054- /**
45055- * @throws Exception
45056- * @return Unowned
45057- */
45058- public function getUnowned(): Unowned {
45059- if (Obj5::validateUnowned($this->unowned)) {
45060- return $this->unowned;
45061- }
45062- throw new Exception('never get to getUnowned Obj5::unowned');
45063- }
45064-
45065- /**
45066- * @return Unowned
45067- */
45068- public static function sampleUnowned(): Unowned {
45069- return Unowned::sample(); /*94:unowned*/
45070- }
45071-
45072- /**
45073- * @param stdClass $value
45074- * @throws Exception
45075- * @return Unsafe
45076- */
45077- public static function fromUnsafe(stdClass $value): Unsafe {
45078- return Unsafe::from($value); /*class*/
45079- }
45080-
45081- /**
45082- * @throws Exception
45083- * @return stdClass
45084- */
45085- public function toUnsafe(): stdClass {
45086- if (Obj5::validateUnsafe($this->unsafe)) {
45087- return $this->unsafe->to(); /*class*/
45088- }
45089- throw new Exception('never get to this Obj5::unsafe');
45090- }
45091-
45092- /**
45093- * @param Unsafe
45094- * @return bool
45095- * @throws Exception
45096- */
45097- public static function validateUnsafe(Unsafe $value): bool {
45098- $value->validate();
45099- return true;
45100- }
45101-
45102- /**
45103- * @throws Exception
45104- * @return Unsafe
45105- */
45106- public function getUnsafe(): Unsafe {
45107- if (Obj5::validateUnsafe($this->unsafe)) {
45108- return $this->unsafe;
45109- }
45110- throw new Exception('never get to getUnsafe Obj5::unsafe');
45111- }
45112-
45113- /**
45114- * @return Unsafe
45115- */
45116- public static function sampleUnsafe(): Unsafe {
45117- return Unsafe::sample(); /*95:unsafe*/
45118- }
45119-
45120- /**
45121- * @param stdClass $value
45122- * @throws Exception
45123- * @return UseSerializers
45124- */
45125- public static function fromUseSerializers(stdClass $value): UseSerializers {
45126- return UseSerializers::from($value); /*class*/
45127- }
45128-
45129- /**
45130- * @throws Exception
45131- * @return stdClass
45132- */
45133- public function toUseSerializers(): stdClass {
45134- if (Obj5::validateUseSerializers($this->useSerializers)) {
45135- return $this->useSerializers->to(); /*class*/
45136- }
45137- throw new Exception('never get to this Obj5::useSerializers');
45138- }
45139-
45140- /**
45141- * @param UseSerializers
45142- * @return bool
45143- * @throws Exception
45144- */
45145- public static function validateUseSerializers(UseSerializers $value): bool {
45146- $value->validate();
45147- return true;
45148- }
45149-
45150- /**
45151- * @throws Exception
45152- * @return UseSerializers
45153- */
45154- public function getUseSerializers(): UseSerializers {
45155- if (Obj5::validateUseSerializers($this->useSerializers)) {
45156- return $this->useSerializers;
45157- }
45158- throw new Exception('never get to getUseSerializers Obj5::useSerializers');
45159- }
45160-
45161- /**
45162- * @return UseSerializers
45163- */
45164- public static function sampleUseSerializers(): UseSerializers {
45165- return UseSerializers::sample(); /*96:useSerializers*/
45166- }
45167-
45168- /**
45169- * @throws Exception
45170- * @return bool
44960+ * @return bool
4517144961 */
4517244962 public function validate(): bool {
4517344963 return Obj5::validateDummy($this->dummy)
@@ -45177,6 +44967,8 @@ class Obj5 {
4517744967 || Obj5::validateObj5True($this->obj5True)
4517844968 || Obj5::validateObj5Type($this->obj5Type)
4517944969 || Obj5::validatePrimitiveKind($this->primitiveKind)
44970+ || Obj5::validateSealed($this->sealed)
44971+ || Obj5::validateSel($this->sel)
4518044972 || Obj5::validateSelect($this->select)
4518144973 || Obj5::validateSelf($this->self)
4518244974 || Obj5::validateSendable($this->sendable)
@@ -45232,10 +45024,7 @@ class Obj5 {
4523245024 || Obj5::validateUnchecked($this->unchecked)
4523345025 || Obj5::validateUndefined($this->undefined)
4523445026 || Obj5::validateUnion($this->union)
45235- || Obj5::validateUnmarshalJSON($this->unmarshalJSON)
45236- || Obj5::validateUnowned($this->unowned)
45237- || Obj5::validateUnsafe($this->unsafe)
45238- || Obj5::validateUseSerializers($this->useSerializers);
45027+ || Obj5::validateUnmarshalJSON($this->unmarshalJSON);
4523945028 }
4524045029
4524145030 /**
@@ -45251,6 +45040,8 @@ class Obj5 {
4525145040 $out->{'true'} = $this->toObj5True();
4525245041 $out->{'type'} = $this->toObj5Type();
4525345042 $out->{'PrimitiveKind'} = $this->toPrimitiveKind();
45043+ $out->{'sealed'} = $this->toSealed();
45044+ $out->{'SEL'} = $this->toSel();
4525445045 $out->{'select'} = $this->toSelect();
4525545046 $out->{'Self'} = $this->toSelf();
4525645047 $out->{'Sendable'} = $this->toSendable();
@@ -45307,9 +45098,6 @@ class Obj5 {
4530745098 $out->{'undefined'} = $this->toUndefined();
4530845099 $out->{'union'} = $this->toUnion();
4530945100 $out->{'UnmarshalJSON'} = $this->toUnmarshalJSON();
45310- $out->{'unowned'} = $this->toUnowned();
45311- $out->{'unsafe'} = $this->toUnsafe();
45312- $out->{'UseSerializers'} = $this->toUseSerializers();
4531345101 return $out;
4531445102 }
4531545103
@@ -45340,6 +45128,12 @@ class Obj5 {
4534045128 if (!property_exists($obj, 'PrimitiveKind')) {
4534145129 throw new Exception("Missing required property");
4534245130 }
45131+ if (!property_exists($obj, 'sealed')) {
45132+ throw new Exception("Missing required property");
45133+ }
45134+ if (!property_exists($obj, 'SEL')) {
45135+ throw new Exception("Missing required property");
45136+ }
4534345137 if (!property_exists($obj, 'select')) {
4534445138 throw new Exception("Missing required property");
4534545139 }
@@ -45508,15 +45302,6 @@ class Obj5 {
4550845302 if (!property_exists($obj, 'UnmarshalJSON')) {
4550945303 throw new Exception("Missing required property");
4551045304 }
45511- if (!property_exists($obj, 'unowned')) {
45512- throw new Exception("Missing required property");
45513- }
45514- if (!property_exists($obj, 'unsafe')) {
45515- throw new Exception("Missing required property");
45516- }
45517- if (!property_exists($obj, 'UseSerializers')) {
45518- throw new Exception("Missing required property");
45519- }
4552045305 return new Obj5(
4552145306 Obj5::fromDummy($obj->{'dummy'})
4552245307 ,Obj5::fromKSerializer($obj->{'KSerializer'})
@@ -45525,6 +45310,8 @@ class Obj5 {
4552545310 ,Obj5::fromObj5True($obj->{'true'})
4552645311 ,Obj5::fromObj5Type($obj->{'type'})
4552745312 ,Obj5::fromPrimitiveKind($obj->{'PrimitiveKind'})
45313+ ,Obj5::fromSealed($obj->{'sealed'})
45314+ ,Obj5::fromSel($obj->{'SEL'})
4552845315 ,Obj5::fromSelect($obj->{'select'})
4552945316 ,Obj5::fromSelf($obj->{'Self'})
4553045317 ,Obj5::fromSendable($obj->{'Sendable'})
@@ -45581,9 +45368,6 @@ class Obj5 {
4558145368 ,Obj5::fromUndefined($obj->{'undefined'})
4558245369 ,Obj5::fromUnion($obj->{'union'})
4558345370 ,Obj5::fromUnmarshalJSON($obj->{'UnmarshalJSON'})
45584- ,Obj5::fromUnowned($obj->{'unowned'})
45585- ,Obj5::fromUnsafe($obj->{'unsafe'})
45586- ,Obj5::fromUseSerializers($obj->{'UseSerializers'})
4558745371 );
4558845372 }
4558945373
@@ -45599,6 +45383,8 @@ class Obj5 {
4559945383 ,Obj5::sampleObj5True()
4560045384 ,Obj5::sampleObj5Type()
4560145385 ,Obj5::samplePrimitiveKind()
45386+ ,Obj5::sampleSealed()
45387+ ,Obj5::sampleSel()
4560245388 ,Obj5::sampleSelect()
4560345389 ,Obj5::sampleSelf()
4560445390 ,Obj5::sampleSendable()
@@ -45655,9 +45441,6 @@ class Obj5 {
4565545441 ,Obj5::sampleUndefined()
4565645442 ,Obj5::sampleUnion()
4565745443 ,Obj5::sampleUnmarshalJSON()
45658- ,Obj5::sampleUnowned()
45659- ,Obj5::sampleUnsafe()
45660- ,Obj5::sampleUseSerializers()
4566145444 );
4566245445 }
4566345446 }
@@ -46268,16 +46051,16 @@ class PrimitiveKind {
4626846051 }
4626946052 }
4627046053
46271-// This is an autogenerated file:Select
46054+// This is an autogenerated file:Sealed
4627246055
46273-class Select {
46274- private int $select; // json:select Required
46056+class Sealed {
46057+ private int $sealed; // json:sealed Required
4627546058
4627646059 /**
46277- * @param int $select
46060+ * @param int $sealed
4627846061 */
46279- public function __construct(int $select) {
46280- $this->select = $select;
46062+ public function __construct(int $sealed) {
46063+ $this->sealed = $sealed;
4628146064 }
4628246065
4628346066 /**
@@ -46285,7 +46068,7 @@ class Select {
4628546068 * @throws Exception
4628646069 * @return int
4628746070 */
46288- public static function fromSelect(int $value): int {
46071+ public static function fromSealed(int $value): int {
4628946072 return $value; /*int*/
4629046073 }
4629146074
@@ -46293,11 +46076,11 @@ class Select {
4629346076 * @throws Exception
4629446077 * @return int
4629546078 */
46296- public function toSelect(): int {
46297- if (Select::validateSelect($this->select)) {
46298- return $this->select; /*int*/
46079+ public function toSealed(): int {
46080+ if (Sealed::validateSealed($this->sealed)) {
46081+ return $this->sealed; /*int*/
4629946082 }
46300- throw new Exception('never get to this Select::select');
46083+ throw new Exception('never get to this Sealed::sealed');
4630146084 }
4630246085
4630346086 /**
@@ -46305,7 +46088,7 @@ class Select {
4630546088 * @return bool
4630646089 * @throws Exception
4630746090 */
46308- public static function validateSelect(int $value): bool {
46091+ public static function validateSealed(int $value): bool {
4630946092 return true;
4631046093 }
4631146094
@@ -46313,18 +46096,18 @@ class Select {
4631346096 * @throws Exception
4631446097 * @return int
4631546098 */
46316- public function getSelect(): int {
46317- if (Select::validateSelect($this->select)) {
46318- return $this->select;
46099+ public function getSealed(): int {
46100+ if (Sealed::validateSealed($this->sealed)) {
46101+ return $this->sealed;
4631946102 }
46320- throw new Exception('never get to getSelect Select::select');
46103+ throw new Exception('never get to getSealed Sealed::sealed');
4632146104 }
4632246105
4632346106 /**
4632446107 * @return int
4632546108 */
46326- public static function sampleSelect(): int {
46327- return 31; /*31:select*/
46109+ public static function sampleSealed(): int {
46110+ return 31; /*31:sealed*/
4632846111 }
4632946112
4633046113 /**
@@ -46332,7 +46115,7 @@ class Select {
4633246115 * @return bool
4633346116 */
4633446117 public function validate(): bool {
46335- return Select::validateSelect($this->select);
46118+ return Sealed::validateSealed($this->sealed);
4633646119 }
4633746120
4633846121 /**
@@ -46341,44 +46124,44 @@ class Select {
4634146124 */
4634246125 public function to(): stdClass {
4634346126 $out = new stdClass();
46344- $out->{'select'} = $this->toSelect();
46127+ $out->{'sealed'} = $this->toSealed();
4634546128 return $out;
4634646129 }
4634746130
4634846131 /**
4634946132 * @param stdClass $obj
46350- * @return Select
46133+ * @return Sealed
4635146134 * @throws Exception
4635246135 */
46353- public static function from(stdClass $obj): Select {
46354- if (!property_exists($obj, 'select')) {
46136+ public static function from(stdClass $obj): Sealed {
46137+ if (!property_exists($obj, 'sealed')) {
4635546138 throw new Exception("Missing required property");
4635646139 }
46357- return new Select(
46358- Select::fromSelect($obj->{'select'})
46140+ return new Sealed(
46141+ Sealed::fromSealed($obj->{'sealed'})
4635946142 );
4636046143 }
4636146144
4636246145 /**
46363- * @return Select
46146+ * @return Sealed
4636446147 */
46365- public static function sample(): Select {
46366- return new Select(
46367- Select::sampleSelect()
46148+ public static function sample(): Sealed {
46149+ return new Sealed(
46150+ Sealed::sampleSealed()
4636846151 );
4636946152 }
4637046153 }
4637146154
46372-// This is an autogenerated file:SelfClass
46155+// This is an autogenerated file:Sel
4637346156
46374-class SelfClass {
46375- private int $self; // json:Self Required
46157+class Sel {
46158+ private int $sel; // json:SEL Required
4637646159
4637746160 /**
46378- * @param int $self
46161+ * @param int $sel
4637946162 */
46380- public function __construct(int $self) {
46381- $this->self = $self;
46163+ public function __construct(int $sel) {
46164+ $this->sel = $sel;
4638246165 }
4638346166
4638446167 /**
@@ -46386,7 +46169,7 @@ class SelfClass {
4638646169 * @throws Exception
4638746170 * @return int
4638846171 */
46389- public static function fromSelf(int $value): int {
46172+ public static function fromSel(int $value): int {
4639046173 return $value; /*int*/
4639146174 }
4639246175
@@ -46394,11 +46177,11 @@ class SelfClass {
4639446177 * @throws Exception
4639546178 * @return int
4639646179 */
46397- public function toSelf(): int {
46398- if (SelfClass::validateSelf($this->self)) {
46399- return $this->self; /*int*/
46180+ public function toSel(): int {
46181+ if (Sel::validateSel($this->sel)) {
46182+ return $this->sel; /*int*/
4640046183 }
46401- throw new Exception('never get to this SelfClass::self');
46184+ throw new Exception('never get to this Sel::sel');
4640246185 }
4640346186
4640446187 /**
@@ -46406,7 +46189,7 @@ class SelfClass {
4640646189 * @return bool
4640746190 * @throws Exception
4640846191 */
46409- public static function validateSelf(int $value): bool {
46192+ public static function validateSel(int $value): bool {
4641046193 return true;
4641146194 }
4641246195
@@ -46414,18 +46197,18 @@ class SelfClass {
4641446197 * @throws Exception
4641546198 * @return int
4641646199 */
46417- public function getSelf(): int {
46418- if (SelfClass::validateSelf($this->self)) {
46419- return $this->self;
46200+ public function getSel(): int {
46201+ if (Sel::validateSel($this->sel)) {
46202+ return $this->sel;
4642046203 }
46421- throw new Exception('never get to getSelf SelfClass::self');
46204+ throw new Exception('never get to getSel Sel::sel');
4642246205 }
4642346206
4642446207 /**
4642546208 * @return int
4642646209 */
46427- public static function sampleSelf(): int {
46428- return 31; /*31:self*/
46210+ public static function sampleSel(): int {
46211+ return 31; /*31:sel*/
4642946212 }
4643046213
4643146214 /**
@@ -46433,7 +46216,7 @@ class SelfClass {
4643346216 * @return bool
4643446217 */
4643546218 public function validate(): bool {
46436- return SelfClass::validateSelf($this->self);
46219+ return Sel::validateSel($this->sel);
4643746220 }
4643846221
4643946222 /**
@@ -46442,26 +46225,228 @@ class SelfClass {
4644246225 */
4644346226 public function to(): stdClass {
4644446227 $out = new stdClass();
46445- $out->{'Self'} = $this->toSelf();
46228+ $out->{'SEL'} = $this->toSel();
4644646229 return $out;
4644746230 }
4644846231
4644946232 /**
4645046233 * @param stdClass $obj
46451- * @return SelfClass
46234+ * @return Sel
4645246235 * @throws Exception
4645346236 */
46454- public static function from(stdClass $obj): SelfClass {
46455- if (!property_exists($obj, 'Self')) {
46237+ public static function from(stdClass $obj): Sel {
46238+ if (!property_exists($obj, 'SEL')) {
4645646239 throw new Exception("Missing required property");
4645746240 }
46458- return new SelfClass(
46459- SelfClass::fromSelf($obj->{'Self'})
46241+ return new Sel(
46242+ Sel::fromSel($obj->{'SEL'})
4646046243 );
4646146244 }
4646246245
4646346246 /**
46464- * @return SelfClass
46247+ * @return Sel
46248+ */
46249+ public static function sample(): Sel {
46250+ return new Sel(
46251+ Sel::sampleSel()
46252+ );
46253+ }
46254+}
46255+
46256+// This is an autogenerated file:Select
46257+
46258+class Select {
46259+ private int $select; // json:select Required
46260+
46261+ /**
46262+ * @param int $select
46263+ */
46264+ public function __construct(int $select) {
46265+ $this->select = $select;
46266+ }
46267+
46268+ /**
46269+ * @param int $value
46270+ * @throws Exception
46271+ * @return int
46272+ */
46273+ public static function fromSelect(int $value): int {
46274+ return $value; /*int*/
46275+ }
46276+
46277+ /**
46278+ * @throws Exception
46279+ * @return int
46280+ */
46281+ public function toSelect(): int {
46282+ if (Select::validateSelect($this->select)) {
46283+ return $this->select; /*int*/
46284+ }
46285+ throw new Exception('never get to this Select::select');
46286+ }
46287+
46288+ /**
46289+ * @param int
46290+ * @return bool
46291+ * @throws Exception
46292+ */
46293+ public static function validateSelect(int $value): bool {
46294+ return true;
46295+ }
46296+
46297+ /**
46298+ * @throws Exception
46299+ * @return int
46300+ */
46301+ public function getSelect(): int {
46302+ if (Select::validateSelect($this->select)) {
46303+ return $this->select;
46304+ }
46305+ throw new Exception('never get to getSelect Select::select');
46306+ }
46307+
46308+ /**
46309+ * @return int
46310+ */
46311+ public static function sampleSelect(): int {
46312+ return 31; /*31:select*/
46313+ }
46314+
46315+ /**
46316+ * @throws Exception
46317+ * @return bool
46318+ */
46319+ public function validate(): bool {
46320+ return Select::validateSelect($this->select);
46321+ }
46322+
46323+ /**
46324+ * @return stdClass
46325+ * @throws Exception
46326+ */
46327+ public function to(): stdClass {
46328+ $out = new stdClass();
46329+ $out->{'select'} = $this->toSelect();
46330+ return $out;
46331+ }
46332+
46333+ /**
46334+ * @param stdClass $obj
46335+ * @return Select
46336+ * @throws Exception
46337+ */
46338+ public static function from(stdClass $obj): Select {
46339+ if (!property_exists($obj, 'select')) {
46340+ throw new Exception("Missing required property");
46341+ }
46342+ return new Select(
46343+ Select::fromSelect($obj->{'select'})
46344+ );
46345+ }
46346+
46347+ /**
46348+ * @return Select
46349+ */
46350+ public static function sample(): Select {
46351+ return new Select(
46352+ Select::sampleSelect()
46353+ );
46354+ }
46355+}
46356+
46357+// This is an autogenerated file:SelfClass
46358+
46359+class SelfClass {
46360+ private int $self; // json:Self Required
46361+
46362+ /**
46363+ * @param int $self
46364+ */
46365+ public function __construct(int $self) {
46366+ $this->self = $self;
46367+ }
46368+
46369+ /**
46370+ * @param int $value
46371+ * @throws Exception
46372+ * @return int
46373+ */
46374+ public static function fromSelf(int $value): int {
46375+ return $value; /*int*/
46376+ }
46377+
46378+ /**
46379+ * @throws Exception
46380+ * @return int
46381+ */
46382+ public function toSelf(): int {
46383+ if (SelfClass::validateSelf($this->self)) {
46384+ return $this->self; /*int*/
46385+ }
46386+ throw new Exception('never get to this SelfClass::self');
46387+ }
46388+
46389+ /**
46390+ * @param int
46391+ * @return bool
46392+ * @throws Exception
46393+ */
46394+ public static function validateSelf(int $value): bool {
46395+ return true;
46396+ }
46397+
46398+ /**
46399+ * @throws Exception
46400+ * @return int
46401+ */
46402+ public function getSelf(): int {
46403+ if (SelfClass::validateSelf($this->self)) {
46404+ return $this->self;
46405+ }
46406+ throw new Exception('never get to getSelf SelfClass::self');
46407+ }
46408+
46409+ /**
46410+ * @return int
46411+ */
46412+ public static function sampleSelf(): int {
46413+ return 31; /*31:self*/
46414+ }
46415+
46416+ /**
46417+ * @throws Exception
46418+ * @return bool
46419+ */
46420+ public function validate(): bool {
46421+ return SelfClass::validateSelf($this->self);
46422+ }
46423+
46424+ /**
46425+ * @return stdClass
46426+ * @throws Exception
46427+ */
46428+ public function to(): stdClass {
46429+ $out = new stdClass();
46430+ $out->{'Self'} = $this->toSelf();
46431+ return $out;
46432+ }
46433+
46434+ /**
46435+ * @param stdClass $obj
46436+ * @return SelfClass
46437+ * @throws Exception
46438+ */
46439+ public static function from(stdClass $obj): SelfClass {
46440+ if (!property_exists($obj, 'Self')) {
46441+ throw new Exception("Missing required property");
46442+ }
46443+ return new SelfClass(
46444+ SelfClass::fromSelf($obj->{'Self'})
46445+ );
46446+ }
46447+
46448+ /**
46449+ * @return SelfClass
4646546450 */
4646646451 public static function sample(): SelfClass {
4646746452 return new SelfClass(
@@ -51924,36 +51909,105 @@ class UnmarshalJSON {
5192451909 }
5192551910 }
5192651911
51927-// This is an autogenerated file:Unowned
51928-
51929-class Unowned {
51930- private int $unowned; // json:unowned Required
51931-
51932- /**
51933- * @param int $unowned
51934- */
51935- public function __construct(int $unowned) {
51936- $this->unowned = $unowned;
51937- }
51912+// This is an autogenerated file:Obj6
5193851913
51939- /**
51940- * @param int $value
51941- * @throws Exception
51942- * @return int
51943- */
51944- public static function fromUnowned(int $value): int {
51945- return $value; /*int*/
51946- }
51914+class Obj6 {
51915+ private int $dummy; // json:dummy Required
51916+ private Unowned $unowned; // json:unowned Required
51917+ private Unsafe $unsafe; // json:unsafe Required
51918+ private Unsigned $unsigned; // json:unsigned Required
51919+ private UseSerializers $useSerializers; // json:UseSerializers Required
51920+ private Ushort $ushort; // json:ushort Required
51921+ private Using $using; // json:using Required
51922+ private Utf8JSONReader $utf8JSONReader; // json:Utf8JsonReader Required
51923+ private Utf8JSONWriter $utf8JSONWriter; // json:Utf8JsonWriter Required
51924+ private UUID $uuid; // json:UUID Required
51925+ private VarClass $var; // json:var Required
51926+ private Virtual $virtual; // json:virtual Required
51927+ private VoidClass $void; // json:void Required
51928+ private Volatile $volatile; // json:volatile Required
51929+ private WcharT $wcharT; // json:wchar_t Required
51930+ private Weak $weak; // json:weak Required
51931+ private Where $where; // json:where Required
51932+ private WhileClass $while; // json:while Required
51933+ private WillSet $willSet; // json:willSet Required
51934+ private With $with; // json:with Required
51935+ private XorClass $xor; // json:xor Required
51936+ private XorEq $xorEq; // json:xor_eq Required
51937+ private Yes $yes; // json:YES Required
51938+ private YieldClass $yield; // json:yield Required
5194751939
5194851940 /**
51949- * @throws Exception
51950- * @return int
51951- */
51952- public function toUnowned(): int {
51953- if (Unowned::validateUnowned($this->unowned)) {
51954- return $this->unowned; /*int*/
51955- }
51956- throw new Exception('never get to this Unowned::unowned');
51941+ * @param int $dummy
51942+ * @param Unowned $unowned
51943+ * @param Unsafe $unsafe
51944+ * @param Unsigned $unsigned
51945+ * @param UseSerializers $useSerializers
51946+ * @param Ushort $ushort
51947+ * @param Using $using
51948+ * @param Utf8JSONReader $utf8JSONReader
51949+ * @param Utf8JSONWriter $utf8JSONWriter
51950+ * @param UUID $uuid
51951+ * @param VarClass $var
51952+ * @param Virtual $virtual
51953+ * @param VoidClass $void
51954+ * @param Volatile $volatile
51955+ * @param WcharT $wcharT
51956+ * @param Weak $weak
51957+ * @param Where $where
51958+ * @param WhileClass $while
51959+ * @param WillSet $willSet
51960+ * @param With $with
51961+ * @param XorClass $xor
51962+ * @param XorEq $xorEq
51963+ * @param Yes $yes
51964+ * @param YieldClass $yield
51965+ */
51966+ public function __construct(int $dummy, Unowned $unowned, Unsafe $unsafe, Unsigned $unsigned, UseSerializers $useSerializers, 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) {
51967+ $this->dummy = $dummy;
51968+ $this->unowned = $unowned;
51969+ $this->unsafe = $unsafe;
51970+ $this->unsigned = $unsigned;
51971+ $this->useSerializers = $useSerializers;
51972+ $this->ushort = $ushort;
51973+ $this->using = $using;
51974+ $this->utf8JSONReader = $utf8JSONReader;
51975+ $this->utf8JSONWriter = $utf8JSONWriter;
51976+ $this->uuid = $uuid;
51977+ $this->var = $var;
51978+ $this->virtual = $virtual;
51979+ $this->void = $void;
51980+ $this->volatile = $volatile;
51981+ $this->wcharT = $wcharT;
51982+ $this->weak = $weak;
51983+ $this->where = $where;
51984+ $this->while = $while;
51985+ $this->willSet = $willSet;
51986+ $this->with = $with;
51987+ $this->xor = $xor;
51988+ $this->xorEq = $xorEq;
51989+ $this->yes = $yes;
51990+ $this->yield = $yield;
51991+ }
51992+
51993+ /**
51994+ * @param int $value
51995+ * @throws Exception
51996+ * @return int
51997+ */
51998+ public static function fromDummy(int $value): int {
51999+ return $value; /*int*/
52000+ }
52001+
52002+ /**
52003+ * @throws Exception
52004+ * @return int
52005+ */
52006+ public function toDummy(): int {
52007+ if (Obj6::validateDummy($this->dummy)) {
52008+ return $this->dummy; /*int*/
52009+ }
52010+ throw new Exception('never get to this Obj6::dummy');
5195752011 }
5195852012
5195952013 /**
@@ -51961,7 +52015,7 @@ class Unowned {
5196152015 * @return bool
5196252016 * @throws Exception
5196352017 */
51964- public static function validateUnowned(int $value): bool {
52018+ public static function validateDummy(int $value): bool {
5196552019 return true;
5196652020 }
5196752021
@@ -51969,435 +52023,216 @@ class Unowned {
5196952023 * @throws Exception
5197052024 * @return int
5197152025 */
51972- public function getUnowned(): int {
51973- if (Unowned::validateUnowned($this->unowned)) {
51974- return $this->unowned;
52026+ public function getDummy(): int {
52027+ if (Obj6::validateDummy($this->dummy)) {
52028+ return $this->dummy;
5197552029 }
51976- throw new Exception('never get to getUnowned Unowned::unowned');
52030+ throw new Exception('never get to getDummy Obj6::dummy');
5197752031 }
5197852032
5197952033 /**
5198052034 * @return int
5198152035 */
51982- public static function sampleUnowned(): int {
51983- return 31; /*31:unowned*/
52036+ public static function sampleDummy(): int {
52037+ return 31; /*31:dummy*/
5198452038 }
5198552039
5198652040 /**
52041+ * @param stdClass $value
5198752042 * @throws Exception
51988- * @return bool
52043+ * @return Unowned
5198952044 */
51990- public function validate(): bool {
51991- return Unowned::validateUnowned($this->unowned);
52045+ public static function fromUnowned(stdClass $value): Unowned {
52046+ return Unowned::from($value); /*class*/
5199252047 }
5199352048
5199452049 /**
51995- * @return stdClass
5199652050 * @throws Exception
52051+ * @return stdClass
5199752052 */
51998- public function to(): stdClass {
51999- $out = new stdClass();
52000- $out->{'unowned'} = $this->toUnowned();
52001- return $out;
52053+ public function toUnowned(): stdClass {
52054+ if (Obj6::validateUnowned($this->unowned)) {
52055+ return $this->unowned->to(); /*class*/
52056+ }
52057+ throw new Exception('never get to this Obj6::unowned');
5200252058 }
5200352059
5200452060 /**
52005- * @param stdClass $obj
52006- * @return Unowned
52061+ * @param Unowned
52062+ * @return bool
5200752063 * @throws Exception
5200852064 */
52009- public static function from(stdClass $obj): Unowned {
52010- if (!property_exists($obj, 'unowned')) {
52011- throw new Exception("Missing required property");
52012- }
52013- return new Unowned(
52014- Unowned::fromUnowned($obj->{'unowned'})
52015- );
52065+ public static function validateUnowned(Unowned $value): bool {
52066+ $value->validate();
52067+ return true;
5201652068 }
5201752069
5201852070 /**
52071+ * @throws Exception
5201952072 * @return Unowned
5202052073 */
52021- public static function sample(): Unowned {
52022- return new Unowned(
52023- Unowned::sampleUnowned()
52024- );
52074+ public function getUnowned(): Unowned {
52075+ if (Obj6::validateUnowned($this->unowned)) {
52076+ return $this->unowned;
52077+ }
52078+ throw new Exception('never get to getUnowned Obj6::unowned');
5202552079 }
52026-}
52027-
52028-// This is an autogenerated file:Unsafe
52029-
52030-class Unsafe {
52031- private int $unsafe; // json:unsafe Required
5203252080
5203352081 /**
52034- * @param int $unsafe
52082+ * @return Unowned
5203552083 */
52036- public function __construct(int $unsafe) {
52037- $this->unsafe = $unsafe;
52084+ public static function sampleUnowned(): Unowned {
52085+ return Unowned::sample(); /*32:unowned*/
5203852086 }
5203952087
5204052088 /**
52041- * @param int $value
52089+ * @param stdClass $value
5204252090 * @throws Exception
52043- * @return int
52091+ * @return Unsafe
5204452092 */
52045- public static function fromUnsafe(int $value): int {
52046- return $value; /*int*/
52093+ public static function fromUnsafe(stdClass $value): Unsafe {
52094+ return Unsafe::from($value); /*class*/
5204752095 }
5204852096
5204952097 /**
5205052098 * @throws Exception
52051- * @return int
52099+ * @return stdClass
5205252100 */
52053- public function toUnsafe(): int {
52054- if (Unsafe::validateUnsafe($this->unsafe)) {
52055- return $this->unsafe; /*int*/
52101+ public function toUnsafe(): stdClass {
52102+ if (Obj6::validateUnsafe($this->unsafe)) {
52103+ return $this->unsafe->to(); /*class*/
5205652104 }
52057- throw new Exception('never get to this Unsafe::unsafe');
52105+ throw new Exception('never get to this Obj6::unsafe');
5205852106 }
5205952107
5206052108 /**
52061- * @param int
52109+ * @param Unsafe
5206252110 * @return bool
5206352111 * @throws Exception
5206452112 */
52065- public static function validateUnsafe(int $value): bool {
52113+ public static function validateUnsafe(Unsafe $value): bool {
52114+ $value->validate();
5206652115 return true;
5206752116 }
5206852117
5206952118 /**
5207052119 * @throws Exception
52071- * @return int
52120+ * @return Unsafe
5207252121 */
52073- public function getUnsafe(): int {
52074- if (Unsafe::validateUnsafe($this->unsafe)) {
52122+ public function getUnsafe(): Unsafe {
52123+ if (Obj6::validateUnsafe($this->unsafe)) {
5207552124 return $this->unsafe;
5207652125 }
52077- throw new Exception('never get to getUnsafe Unsafe::unsafe');
52126+ throw new Exception('never get to getUnsafe Obj6::unsafe');
5207852127 }
5207952128
5208052129 /**
52081- * @return int
52130+ * @return Unsafe
5208252131 */
52083- public static function sampleUnsafe(): int {
52084- return 31; /*31:unsafe*/
52132+ public static function sampleUnsafe(): Unsafe {
52133+ return Unsafe::sample(); /*33:unsafe*/
5208552134 }
5208652135
5208752136 /**
52137+ * @param stdClass $value
5208852138 * @throws Exception
52089- * @return bool
52139+ * @return Unsigned
5209052140 */
52091- public function validate(): bool {
52092- return Unsafe::validateUnsafe($this->unsafe);
52141+ public static function fromUnsigned(stdClass $value): Unsigned {
52142+ return Unsigned::from($value); /*class*/
5209352143 }
5209452144
5209552145 /**
52096- * @return stdClass
5209752146 * @throws Exception
52147+ * @return stdClass
5209852148 */
52099- public function to(): stdClass {
52100- $out = new stdClass();
52101- $out->{'unsafe'} = $this->toUnsafe();
52102- return $out;
52149+ public function toUnsigned(): stdClass {
52150+ if (Obj6::validateUnsigned($this->unsigned)) {
52151+ return $this->unsigned->to(); /*class*/
52152+ }
52153+ throw new Exception('never get to this Obj6::unsigned');
5210352154 }
5210452155
5210552156 /**
52106- * @param stdClass $obj
52107- * @return Unsafe
52157+ * @param Unsigned
52158+ * @return bool
5210852159 * @throws Exception
5210952160 */
52110- public static function from(stdClass $obj): Unsafe {
52111- if (!property_exists($obj, 'unsafe')) {
52112- throw new Exception("Missing required property");
52113- }
52114- return new Unsafe(
52115- Unsafe::fromUnsafe($obj->{'unsafe'})
52116- );
52161+ public static function validateUnsigned(Unsigned $value): bool {
52162+ $value->validate();
52163+ return true;
5211752164 }
5211852165
5211952166 /**
52120- * @return Unsafe
52167+ * @throws Exception
52168+ * @return Unsigned
5212152169 */
52122- public static function sample(): Unsafe {
52123- return new Unsafe(
52124- Unsafe::sampleUnsafe()
52125- );
52170+ public function getUnsigned(): Unsigned {
52171+ if (Obj6::validateUnsigned($this->unsigned)) {
52172+ return $this->unsigned;
52173+ }
52174+ throw new Exception('never get to getUnsigned Obj6::unsigned');
5212652175 }
52127-}
52128-
52129-// This is an autogenerated file:UseSerializers
52130-
52131-class UseSerializers {
52132- private int $useSerializers; // json:UseSerializers Required
5213352176
5213452177 /**
52135- * @param int $useSerializers
52178+ * @return Unsigned
5213652179 */
52137- public function __construct(int $useSerializers) {
52138- $this->useSerializers = $useSerializers;
52180+ public static function sampleUnsigned(): Unsigned {
52181+ return Unsigned::sample(); /*34:unsigned*/
5213952182 }
5214052183
5214152184 /**
52142- * @param int $value
52185+ * @param stdClass $value
5214352186 * @throws Exception
52144- * @return int
52187+ * @return UseSerializers
5214552188 */
52146- public static function fromUseSerializers(int $value): int {
52147- return $value; /*int*/
52189+ public static function fromUseSerializers(stdClass $value): UseSerializers {
52190+ return UseSerializers::from($value); /*class*/
5214852191 }
5214952192
5215052193 /**
5215152194 * @throws Exception
52152- * @return int
52195+ * @return stdClass
5215352196 */
52154- public function toUseSerializers(): int {
52155- if (UseSerializers::validateUseSerializers($this->useSerializers)) {
52156- return $this->useSerializers; /*int*/
52197+ public function toUseSerializers(): stdClass {
52198+ if (Obj6::validateUseSerializers($this->useSerializers)) {
52199+ return $this->useSerializers->to(); /*class*/
5215752200 }
52158- throw new Exception('never get to this UseSerializers::useSerializers');
52201+ throw new Exception('never get to this Obj6::useSerializers');
5215952202 }
5216052203
5216152204 /**
52162- * @param int
52205+ * @param UseSerializers
5216352206 * @return bool
5216452207 * @throws Exception
5216552208 */
52166- public static function validateUseSerializers(int $value): bool {
52209+ public static function validateUseSerializers(UseSerializers $value): bool {
52210+ $value->validate();
5216752211 return true;
5216852212 }
5216952213
5217052214 /**
5217152215 * @throws Exception
52172- * @return int
52216+ * @return UseSerializers
5217352217 */
52174- public function getUseSerializers(): int {
52175- if (UseSerializers::validateUseSerializers($this->useSerializers)) {
52218+ public function getUseSerializers(): UseSerializers {
52219+ if (Obj6::validateUseSerializers($this->useSerializers)) {
5217652220 return $this->useSerializers;
5217752221 }
52178- throw new Exception('never get to getUseSerializers UseSerializers::useSerializers');
52222+ throw new Exception('never get to getUseSerializers Obj6::useSerializers');
5217952223 }
5218052224
5218152225 /**
52182- * @return int
52226+ * @return UseSerializers
5218352227 */
52184- public static function sampleUseSerializers(): int {
52185- return 31; /*31:useSerializers*/
52228+ public static function sampleUseSerializers(): UseSerializers {
52229+ return UseSerializers::sample(); /*35:useSerializers*/
5218652230 }
5218752231
5218852232 /**
52233+ * @param stdClass $value
5218952234 * @throws Exception
52190- * @return bool
52191- */
52192- public function validate(): bool {
52193- return UseSerializers::validateUseSerializers($this->useSerializers);
52194- }
52195-
52196- /**
52197- * @return stdClass
52198- * @throws Exception
52199- */
52200- public function to(): stdClass {
52201- $out = new stdClass();
52202- $out->{'UseSerializers'} = $this->toUseSerializers();
52203- return $out;
52204- }
52205-
52206- /**
52207- * @param stdClass $obj
52208- * @return UseSerializers
52209- * @throws Exception
52210- */
52211- public static function from(stdClass $obj): UseSerializers {
52212- if (!property_exists($obj, 'UseSerializers')) {
52213- throw new Exception("Missing required property");
52214- }
52215- return new UseSerializers(
52216- UseSerializers::fromUseSerializers($obj->{'UseSerializers'})
52217- );
52218- }
52219-
52220- /**
52221- * @return UseSerializers
52222- */
52223- public static function sample(): UseSerializers {
52224- return new UseSerializers(
52225- UseSerializers::sampleUseSerializers()
52226- );
52227- }
52228-}
52229-
52230-// This is an autogenerated file:Obj6
52231-
52232-class Obj6 {
52233- private int $dummy; // json:dummy Required
52234- private Unsigned $unsigned; // json:unsigned Required
52235- private Ushort $ushort; // json:ushort Required
52236- private Using $using; // json:using Required
52237- private Utf8JSONReader $utf8JSONReader; // json:Utf8JsonReader Required
52238- private Utf8JSONWriter $utf8JSONWriter; // json:Utf8JsonWriter Required
52239- private UUID $uuid; // json:UUID Required
52240- private VarClass $var; // json:var Required
52241- private Virtual $virtual; // json:virtual Required
52242- private VoidClass $void; // json:void Required
52243- private Volatile $volatile; // json:volatile Required
52244- private WcharT $wcharT; // json:wchar_t Required
52245- private Weak $weak; // json:weak Required
52246- private Where $where; // json:where Required
52247- private WhileClass $while; // json:while Required
52248- private WillSet $willSet; // json:willSet Required
52249- private With $with; // json:with Required
52250- private XorClass $xor; // json:xor Required
52251- private XorEq $xorEq; // json:xor_eq Required
52252- private Yes $yes; // json:YES Required
52253- private YieldClass $yield; // json:yield Required
52254-
52255- /**
52256- * @param int $dummy
52257- * @param Unsigned $unsigned
52258- * @param Ushort $ushort
52259- * @param Using $using
52260- * @param Utf8JSONReader $utf8JSONReader
52261- * @param Utf8JSONWriter $utf8JSONWriter
52262- * @param UUID $uuid
52263- * @param VarClass $var
52264- * @param Virtual $virtual
52265- * @param VoidClass $void
52266- * @param Volatile $volatile
52267- * @param WcharT $wcharT
52268- * @param Weak $weak
52269- * @param Where $where
52270- * @param WhileClass $while
52271- * @param WillSet $willSet
52272- * @param With $with
52273- * @param XorClass $xor
52274- * @param XorEq $xorEq
52275- * @param Yes $yes
52276- * @param YieldClass $yield
52277- */
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) {
52279- $this->dummy = $dummy;
52280- $this->unsigned = $unsigned;
52281- $this->ushort = $ushort;
52282- $this->using = $using;
52283- $this->utf8JSONReader = $utf8JSONReader;
52284- $this->utf8JSONWriter = $utf8JSONWriter;
52285- $this->uuid = $uuid;
52286- $this->var = $var;
52287- $this->virtual = $virtual;
52288- $this->void = $void;
52289- $this->volatile = $volatile;
52290- $this->wcharT = $wcharT;
52291- $this->weak = $weak;
52292- $this->where = $where;
52293- $this->while = $while;
52294- $this->willSet = $willSet;
52295- $this->with = $with;
52296- $this->xor = $xor;
52297- $this->xorEq = $xorEq;
52298- $this->yes = $yes;
52299- $this->yield = $yield;
52300- }
52301-
52302- /**
52303- * @param int $value
52304- * @throws Exception
52305- * @return int
52306- */
52307- public static function fromDummy(int $value): int {
52308- return $value; /*int*/
52309- }
52310-
52311- /**
52312- * @throws Exception
52313- * @return int
52314- */
52315- public function toDummy(): int {
52316- if (Obj6::validateDummy($this->dummy)) {
52317- return $this->dummy; /*int*/
52318- }
52319- throw new Exception('never get to this Obj6::dummy');
52320- }
52321-
52322- /**
52323- * @param int
52324- * @return bool
52325- * @throws Exception
52326- */
52327- public static function validateDummy(int $value): bool {
52328- return true;
52329- }
52330-
52331- /**
52332- * @throws Exception
52333- * @return int
52334- */
52335- public function getDummy(): int {
52336- if (Obj6::validateDummy($this->dummy)) {
52337- return $this->dummy;
52338- }
52339- throw new Exception('never get to getDummy Obj6::dummy');
52340- }
52341-
52342- /**
52343- * @return int
52344- */
52345- public static function sampleDummy(): int {
52346- return 31; /*31:dummy*/
52347- }
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
52235+ * @return Ushort
5240152236 */
5240252237 public static function fromUshort(stdClass $value): Ushort {
5240352238 return Ushort::from($value); /*class*/
@@ -52439,7 +52274,7 @@ class Obj6 {
5243952274 * @return Ushort
5244052275 */
5244152276 public static function sampleUshort(): Ushort {
52442- return Ushort::sample(); /*33:ushort*/
52277+ return Ushort::sample(); /*36:ushort*/
5244352278 }
5244452279
5244552280 /**
@@ -52487,7 +52322,7 @@ class Obj6 {
5248752322 * @return Using
5248852323 */
5248952324 public static function sampleUsing(): Using {
52490- return Using::sample(); /*34:using*/
52325+ return Using::sample(); /*37:using*/
5249152326 }
5249252327
5249352328 /**
@@ -52535,7 +52370,7 @@ class Obj6 {
5253552370 * @return Utf8JSONReader
5253652371 */
5253752372 public static function sampleUtf8JSONReader(): Utf8JSONReader {
52538- return Utf8JSONReader::sample(); /*35:utf8JSONReader*/
52373+ return Utf8JSONReader::sample(); /*38:utf8JSONReader*/
5253952374 }
5254052375
5254152376 /**
@@ -52583,7 +52418,7 @@ class Obj6 {
5258352418 * @return Utf8JSONWriter
5258452419 */
5258552420 public static function sampleUtf8JSONWriter(): Utf8JSONWriter {
52586- return Utf8JSONWriter::sample(); /*36:utf8JSONWriter*/
52421+ return Utf8JSONWriter::sample(); /*39:utf8JSONWriter*/
5258752422 }
5258852423
5258952424 /**
@@ -52631,7 +52466,7 @@ class Obj6 {
5263152466 * @return UUID
5263252467 */
5263352468 public static function sampleUUID(): UUID {
52634- return UUID::sample(); /*37:uuid*/
52469+ return UUID::sample(); /*40:uuid*/
5263552470 }
5263652471
5263752472 /**
@@ -52679,7 +52514,7 @@ class Obj6 {
5267952514 * @return VarClass
5268052515 */
5268152516 public static function sampleVar(): VarClass {
52682- return VarClass::sample(); /*38:var*/
52517+ return VarClass::sample(); /*41:var*/
5268352518 }
5268452519
5268552520 /**
@@ -52727,7 +52562,7 @@ class Obj6 {
5272752562 * @return Virtual
5272852563 */
5272952564 public static function sampleVirtual(): Virtual {
52730- return Virtual::sample(); /*39:virtual*/
52565+ return Virtual::sample(); /*42:virtual*/
5273152566 }
5273252567
5273352568 /**
@@ -52775,7 +52610,7 @@ class Obj6 {
5277552610 * @return VoidClass
5277652611 */
5277752612 public static function sampleVoid(): VoidClass {
52778- return VoidClass::sample(); /*40:void*/
52613+ return VoidClass::sample(); /*43:void*/
5277952614 }
5278052615
5278152616 /**
@@ -52823,7 +52658,7 @@ class Obj6 {
5282352658 * @return Volatile
5282452659 */
5282552660 public static function sampleVolatile(): Volatile {
52826- return Volatile::sample(); /*41:volatile*/
52661+ return Volatile::sample(); /*44:volatile*/
5282752662 }
5282852663
5282952664 /**
@@ -52871,7 +52706,7 @@ class Obj6 {
5287152706 * @return WcharT
5287252707 */
5287352708 public static function sampleWcharT(): WcharT {
52874- return WcharT::sample(); /*42:wcharT*/
52709+ return WcharT::sample(); /*45:wcharT*/
5287552710 }
5287652711
5287752712 /**
@@ -52919,7 +52754,7 @@ class Obj6 {
5291952754 * @return Weak
5292052755 */
5292152756 public static function sampleWeak(): Weak {
52922- return Weak::sample(); /*43:weak*/
52757+ return Weak::sample(); /*46:weak*/
5292352758 }
5292452759
5292552760 /**
@@ -52967,7 +52802,7 @@ class Obj6 {
5296752802 * @return Where
5296852803 */
5296952804 public static function sampleWhere(): Where {
52970- return Where::sample(); /*44:where*/
52805+ return Where::sample(); /*47:where*/
5297152806 }
5297252807
5297352808 /**
@@ -53015,7 +52850,7 @@ class Obj6 {
5301552850 * @return WhileClass
5301652851 */
5301752852 public static function sampleWhile(): WhileClass {
53018- return WhileClass::sample(); /*45:while*/
52853+ return WhileClass::sample(); /*48:while*/
5301952854 }
5302052855
5302152856 /**
@@ -53063,7 +52898,7 @@ class Obj6 {
5306352898 * @return WillSet
5306452899 */
5306552900 public static function sampleWillSet(): WillSet {
53066- return WillSet::sample(); /*46:willSet*/
52901+ return WillSet::sample(); /*49:willSet*/
5306752902 }
5306852903
5306952904 /**
@@ -53111,7 +52946,7 @@ class Obj6 {
5311152946 * @return With
5311252947 */
5311352948 public static function sampleWith(): With {
53114- return With::sample(); /*47:with*/
52949+ return With::sample(); /*50:with*/
5311552950 }
5311652951
5311752952 /**
@@ -53159,7 +52994,7 @@ class Obj6 {
5315952994 * @return XorClass
5316052995 */
5316152996 public static function sampleXor(): XorClass {
53162- return XorClass::sample(); /*48:xor*/
52997+ return XorClass::sample(); /*51:xor*/
5316352998 }
5316452999
5316553000 /**
@@ -53207,7 +53042,7 @@ class Obj6 {
5320753042 * @return XorEq
5320853043 */
5320953044 public static function sampleXorEq(): XorEq {
53210- return XorEq::sample(); /*49:xorEq*/
53045+ return XorEq::sample(); /*52:xorEq*/
5321153046 }
5321253047
5321353048 /**
@@ -53255,55 +53090,519 @@ class Obj6 {
5325553090 * @return Yes
5325653091 */
5325753092 public static function sampleYes(): Yes {
53258- return Yes::sample(); /*50:yes*/
53093+ return Yes::sample(); /*53:yes*/
53094+ }
53095+
53096+ /**
53097+ * @param stdClass $value
53098+ * @throws Exception
53099+ * @return YieldClass
53100+ */
53101+ public static function fromYield(stdClass $value): YieldClass {
53102+ return YieldClass::from($value); /*class*/
53103+ }
53104+
53105+ /**
53106+ * @throws Exception
53107+ * @return stdClass
53108+ */
53109+ public function toYield(): stdClass {
53110+ if (Obj6::validateYield($this->yield)) {
53111+ return $this->yield->to(); /*class*/
53112+ }
53113+ throw new Exception('never get to this Obj6::yield');
53114+ }
53115+
53116+ /**
53117+ * @param YieldClass
53118+ * @return bool
53119+ * @throws Exception
53120+ */
53121+ public static function validateYield(YieldClass $value): bool {
53122+ $value->validate();
53123+ return true;
53124+ }
53125+
53126+ /**
53127+ * @throws Exception
53128+ * @return YieldClass
53129+ */
53130+ public function getYield(): YieldClass {
53131+ if (Obj6::validateYield($this->yield)) {
53132+ return $this->yield;
53133+ }
53134+ throw new Exception('never get to getYield Obj6::yield');
53135+ }
53136+
53137+ /**
53138+ * @return YieldClass
53139+ */
53140+ public static function sampleYield(): YieldClass {
53141+ return YieldClass::sample(); /*54:yield*/
53142+ }
53143+
53144+ /**
53145+ * @throws Exception
53146+ * @return bool
53147+ */
53148+ public function validate(): bool {
53149+ return Obj6::validateDummy($this->dummy)
53150+ || Obj6::validateUnowned($this->unowned)
53151+ || Obj6::validateUnsafe($this->unsafe)
53152+ || Obj6::validateUnsigned($this->unsigned)
53153+ || Obj6::validateUseSerializers($this->useSerializers)
53154+ || Obj6::validateUshort($this->ushort)
53155+ || Obj6::validateUsing($this->using)
53156+ || Obj6::validateUtf8JSONReader($this->utf8JSONReader)
53157+ || Obj6::validateUtf8JSONWriter($this->utf8JSONWriter)
53158+ || Obj6::validateUUID($this->uuid)
53159+ || Obj6::validateVar($this->var)
53160+ || Obj6::validateVirtual($this->virtual)
53161+ || Obj6::validateVoid($this->void)
53162+ || Obj6::validateVolatile($this->volatile)
53163+ || Obj6::validateWcharT($this->wcharT)
53164+ || Obj6::validateWeak($this->weak)
53165+ || Obj6::validateWhere($this->where)
53166+ || Obj6::validateWhile($this->while)
53167+ || Obj6::validateWillSet($this->willSet)
53168+ || Obj6::validateWith($this->with)
53169+ || Obj6::validateXor($this->xor)
53170+ || Obj6::validateXorEq($this->xorEq)
53171+ || Obj6::validateYes($this->yes)
53172+ || Obj6::validateYield($this->yield);
53173+ }
53174+
53175+ /**
53176+ * @return stdClass
53177+ * @throws Exception
53178+ */
53179+ public function to(): stdClass {
53180+ $out = new stdClass();
53181+ $out->{'dummy'} = $this->toDummy();
53182+ $out->{'unowned'} = $this->toUnowned();
53183+ $out->{'unsafe'} = $this->toUnsafe();
53184+ $out->{'unsigned'} = $this->toUnsigned();
53185+ $out->{'UseSerializers'} = $this->toUseSerializers();
53186+ $out->{'ushort'} = $this->toUshort();
53187+ $out->{'using'} = $this->toUsing();
53188+ $out->{'Utf8JsonReader'} = $this->toUtf8JSONReader();
53189+ $out->{'Utf8JsonWriter'} = $this->toUtf8JSONWriter();
53190+ $out->{'UUID'} = $this->toUUID();
53191+ $out->{'var'} = $this->toVar();
53192+ $out->{'virtual'} = $this->toVirtual();
53193+ $out->{'void'} = $this->toVoid();
53194+ $out->{'volatile'} = $this->toVolatile();
53195+ $out->{'wchar_t'} = $this->toWcharT();
53196+ $out->{'weak'} = $this->toWeak();
53197+ $out->{'where'} = $this->toWhere();
53198+ $out->{'while'} = $this->toWhile();
53199+ $out->{'willSet'} = $this->toWillSet();
53200+ $out->{'with'} = $this->toWith();
53201+ $out->{'xor'} = $this->toXor();
53202+ $out->{'xor_eq'} = $this->toXorEq();
53203+ $out->{'YES'} = $this->toYes();
53204+ $out->{'yield'} = $this->toYield();
53205+ return $out;
53206+ }
53207+
53208+ /**
53209+ * @param stdClass $obj
53210+ * @return Obj6
53211+ * @throws Exception
53212+ */
53213+ public static function from(stdClass $obj): Obj6 {
53214+ if (!property_exists($obj, 'dummy')) {
53215+ throw new Exception("Missing required property");
53216+ }
53217+ if (!property_exists($obj, 'unowned')) {
53218+ throw new Exception("Missing required property");
53219+ }
53220+ if (!property_exists($obj, 'unsafe')) {
53221+ throw new Exception("Missing required property");
53222+ }
53223+ if (!property_exists($obj, 'unsigned')) {
53224+ throw new Exception("Missing required property");
53225+ }
53226+ if (!property_exists($obj, 'UseSerializers')) {
53227+ throw new Exception("Missing required property");
53228+ }
53229+ if (!property_exists($obj, 'ushort')) {
53230+ throw new Exception("Missing required property");
53231+ }
53232+ if (!property_exists($obj, 'using')) {
53233+ throw new Exception("Missing required property");
53234+ }
53235+ if (!property_exists($obj, 'Utf8JsonReader')) {
53236+ throw new Exception("Missing required property");
53237+ }
53238+ if (!property_exists($obj, 'Utf8JsonWriter')) {
53239+ throw new Exception("Missing required property");
53240+ }
53241+ if (!property_exists($obj, 'UUID')) {
53242+ throw new Exception("Missing required property");
53243+ }
53244+ if (!property_exists($obj, 'var')) {
53245+ throw new Exception("Missing required property");
53246+ }
53247+ if (!property_exists($obj, 'virtual')) {
53248+ throw new Exception("Missing required property");
53249+ }
53250+ if (!property_exists($obj, 'void')) {
53251+ throw new Exception("Missing required property");
53252+ }
53253+ if (!property_exists($obj, 'volatile')) {
53254+ throw new Exception("Missing required property");
53255+ }
53256+ if (!property_exists($obj, 'wchar_t')) {
53257+ throw new Exception("Missing required property");
53258+ }
53259+ if (!property_exists($obj, 'weak')) {
53260+ throw new Exception("Missing required property");
53261+ }
53262+ if (!property_exists($obj, 'where')) {
53263+ throw new Exception("Missing required property");
53264+ }
53265+ if (!property_exists($obj, 'while')) {
53266+ throw new Exception("Missing required property");
53267+ }
53268+ if (!property_exists($obj, 'willSet')) {
53269+ throw new Exception("Missing required property");
53270+ }
53271+ if (!property_exists($obj, 'with')) {
53272+ throw new Exception("Missing required property");
53273+ }
53274+ if (!property_exists($obj, 'xor')) {
53275+ throw new Exception("Missing required property");
53276+ }
53277+ if (!property_exists($obj, 'xor_eq')) {
53278+ throw new Exception("Missing required property");
53279+ }
53280+ if (!property_exists($obj, 'YES')) {
53281+ throw new Exception("Missing required property");
53282+ }
53283+ if (!property_exists($obj, 'yield')) {
53284+ throw new Exception("Missing required property");
53285+ }
53286+ return new Obj6(
53287+ Obj6::fromDummy($obj->{'dummy'})
53288+ ,Obj6::fromUnowned($obj->{'unowned'})
53289+ ,Obj6::fromUnsafe($obj->{'unsafe'})
53290+ ,Obj6::fromUnsigned($obj->{'unsigned'})
53291+ ,Obj6::fromUseSerializers($obj->{'UseSerializers'})
53292+ ,Obj6::fromUshort($obj->{'ushort'})
53293+ ,Obj6::fromUsing($obj->{'using'})
53294+ ,Obj6::fromUtf8JSONReader($obj->{'Utf8JsonReader'})
53295+ ,Obj6::fromUtf8JSONWriter($obj->{'Utf8JsonWriter'})
53296+ ,Obj6::fromUUID($obj->{'UUID'})
53297+ ,Obj6::fromVar($obj->{'var'})
53298+ ,Obj6::fromVirtual($obj->{'virtual'})
53299+ ,Obj6::fromVoid($obj->{'void'})
53300+ ,Obj6::fromVolatile($obj->{'volatile'})
53301+ ,Obj6::fromWcharT($obj->{'wchar_t'})
53302+ ,Obj6::fromWeak($obj->{'weak'})
53303+ ,Obj6::fromWhere($obj->{'where'})
53304+ ,Obj6::fromWhile($obj->{'while'})
53305+ ,Obj6::fromWillSet($obj->{'willSet'})
53306+ ,Obj6::fromWith($obj->{'with'})
53307+ ,Obj6::fromXor($obj->{'xor'})
53308+ ,Obj6::fromXorEq($obj->{'xor_eq'})
53309+ ,Obj6::fromYes($obj->{'YES'})
53310+ ,Obj6::fromYield($obj->{'yield'})
53311+ );
53312+ }
53313+
53314+ /**
53315+ * @return Obj6
53316+ */
53317+ public static function sample(): Obj6 {
53318+ return new Obj6(
53319+ Obj6::sampleDummy()
53320+ ,Obj6::sampleUnowned()
53321+ ,Obj6::sampleUnsafe()
53322+ ,Obj6::sampleUnsigned()
53323+ ,Obj6::sampleUseSerializers()
53324+ ,Obj6::sampleUshort()
53325+ ,Obj6::sampleUsing()
53326+ ,Obj6::sampleUtf8JSONReader()
53327+ ,Obj6::sampleUtf8JSONWriter()
53328+ ,Obj6::sampleUUID()
53329+ ,Obj6::sampleVar()
53330+ ,Obj6::sampleVirtual()
53331+ ,Obj6::sampleVoid()
53332+ ,Obj6::sampleVolatile()
53333+ ,Obj6::sampleWcharT()
53334+ ,Obj6::sampleWeak()
53335+ ,Obj6::sampleWhere()
53336+ ,Obj6::sampleWhile()
53337+ ,Obj6::sampleWillSet()
53338+ ,Obj6::sampleWith()
53339+ ,Obj6::sampleXor()
53340+ ,Obj6::sampleXorEq()
53341+ ,Obj6::sampleYes()
53342+ ,Obj6::sampleYield()
53343+ );
53344+ }
53345+}
53346+
53347+// This is an autogenerated file:Unowned
53348+
53349+class Unowned {
53350+ private int $unowned; // json:unowned Required
53351+
53352+ /**
53353+ * @param int $unowned
53354+ */
53355+ public function __construct(int $unowned) {
53356+ $this->unowned = $unowned;
53357+ }
53358+
53359+ /**
53360+ * @param int $value
53361+ * @throws Exception
53362+ * @return int
53363+ */
53364+ public static function fromUnowned(int $value): int {
53365+ return $value; /*int*/
53366+ }
53367+
53368+ /**
53369+ * @throws Exception
53370+ * @return int
53371+ */
53372+ public function toUnowned(): int {
53373+ if (Unowned::validateUnowned($this->unowned)) {
53374+ return $this->unowned; /*int*/
53375+ }
53376+ throw new Exception('never get to this Unowned::unowned');
53377+ }
53378+
53379+ /**
53380+ * @param int
53381+ * @return bool
53382+ * @throws Exception
53383+ */
53384+ public static function validateUnowned(int $value): bool {
53385+ return true;
53386+ }
53387+
53388+ /**
53389+ * @throws Exception
53390+ * @return int
53391+ */
53392+ public function getUnowned(): int {
53393+ if (Unowned::validateUnowned($this->unowned)) {
53394+ return $this->unowned;
53395+ }
53396+ throw new Exception('never get to getUnowned Unowned::unowned');
53397+ }
53398+
53399+ /**
53400+ * @return int
53401+ */
53402+ public static function sampleUnowned(): int {
53403+ return 31; /*31:unowned*/
53404+ }
53405+
53406+ /**
53407+ * @throws Exception
53408+ * @return bool
53409+ */
53410+ public function validate(): bool {
53411+ return Unowned::validateUnowned($this->unowned);
53412+ }
53413+
53414+ /**
53415+ * @return stdClass
53416+ * @throws Exception
53417+ */
53418+ public function to(): stdClass {
53419+ $out = new stdClass();
53420+ $out->{'unowned'} = $this->toUnowned();
53421+ return $out;
53422+ }
53423+
53424+ /**
53425+ * @param stdClass $obj
53426+ * @return Unowned
53427+ * @throws Exception
53428+ */
53429+ public static function from(stdClass $obj): Unowned {
53430+ if (!property_exists($obj, 'unowned')) {
53431+ throw new Exception("Missing required property");
53432+ }
53433+ return new Unowned(
53434+ Unowned::fromUnowned($obj->{'unowned'})
53435+ );
53436+ }
53437+
53438+ /**
53439+ * @return Unowned
53440+ */
53441+ public static function sample(): Unowned {
53442+ return new Unowned(
53443+ Unowned::sampleUnowned()
53444+ );
53445+ }
53446+}
53447+
53448+// This is an autogenerated file:Unsafe
53449+
53450+class Unsafe {
53451+ private int $unsafe; // json:unsafe Required
53452+
53453+ /**
53454+ * @param int $unsafe
53455+ */
53456+ public function __construct(int $unsafe) {
53457+ $this->unsafe = $unsafe;
53458+ }
53459+
53460+ /**
53461+ * @param int $value
53462+ * @throws Exception
53463+ * @return int
53464+ */
53465+ public static function fromUnsafe(int $value): int {
53466+ return $value; /*int*/
53467+ }
53468+
53469+ /**
53470+ * @throws Exception
53471+ * @return int
53472+ */
53473+ public function toUnsafe(): int {
53474+ if (Unsafe::validateUnsafe($this->unsafe)) {
53475+ return $this->unsafe; /*int*/
53476+ }
53477+ throw new Exception('never get to this Unsafe::unsafe');
53478+ }
53479+
53480+ /**
53481+ * @param int
53482+ * @return bool
53483+ * @throws Exception
53484+ */
53485+ public static function validateUnsafe(int $value): bool {
53486+ return true;
53487+ }
53488+
53489+ /**
53490+ * @throws Exception
53491+ * @return int
53492+ */
53493+ public function getUnsafe(): int {
53494+ if (Unsafe::validateUnsafe($this->unsafe)) {
53495+ return $this->unsafe;
53496+ }
53497+ throw new Exception('never get to getUnsafe Unsafe::unsafe');
53498+ }
53499+
53500+ /**
53501+ * @return int
53502+ */
53503+ public static function sampleUnsafe(): int {
53504+ return 31; /*31:unsafe*/
53505+ }
53506+
53507+ /**
53508+ * @throws Exception
53509+ * @return bool
53510+ */
53511+ public function validate(): bool {
53512+ return Unsafe::validateUnsafe($this->unsafe);
53513+ }
53514+
53515+ /**
53516+ * @return stdClass
53517+ * @throws Exception
53518+ */
53519+ public function to(): stdClass {
53520+ $out = new stdClass();
53521+ $out->{'unsafe'} = $this->toUnsafe();
53522+ return $out;
53523+ }
53524+
53525+ /**
53526+ * @param stdClass $obj
53527+ * @return Unsafe
53528+ * @throws Exception
53529+ */
53530+ public static function from(stdClass $obj): Unsafe {
53531+ if (!property_exists($obj, 'unsafe')) {
53532+ throw new Exception("Missing required property");
53533+ }
53534+ return new Unsafe(
53535+ Unsafe::fromUnsafe($obj->{'unsafe'})
53536+ );
53537+ }
53538+
53539+ /**
53540+ * @return Unsafe
53541+ */
53542+ public static function sample(): Unsafe {
53543+ return new Unsafe(
53544+ Unsafe::sampleUnsafe()
53545+ );
53546+ }
53547+}
53548+
53549+// This is an autogenerated file:Unsigned
53550+
53551+class Unsigned {
53552+ private int $unsigned; // json:unsigned Required
53553+
53554+ /**
53555+ * @param int $unsigned
53556+ */
53557+ public function __construct(int $unsigned) {
53558+ $this->unsigned = $unsigned;
5325953559 }
5326053560
5326153561 /**
53262- * @param stdClass $value
53562+ * @param int $value
5326353563 * @throws Exception
53264- * @return YieldClass
53564+ * @return int
5326553565 */
53266- public static function fromYield(stdClass $value): YieldClass {
53267- return YieldClass::from($value); /*class*/
53566+ public static function fromUnsigned(int $value): int {
53567+ return $value; /*int*/
5326853568 }
5326953569
5327053570 /**
5327153571 * @throws Exception
53272- * @return stdClass
53572+ * @return int
5327353573 */
53274- public function toYield(): stdClass {
53275- if (Obj6::validateYield($this->yield)) {
53276- return $this->yield->to(); /*class*/
53574+ public function toUnsigned(): int {
53575+ if (Unsigned::validateUnsigned($this->unsigned)) {
53576+ return $this->unsigned; /*int*/
5327753577 }
53278- throw new Exception('never get to this Obj6::yield');
53578+ throw new Exception('never get to this Unsigned::unsigned');
5327953579 }
5328053580
5328153581 /**
53282- * @param YieldClass
53582+ * @param int
5328353583 * @return bool
5328453584 * @throws Exception
5328553585 */
53286- public static function validateYield(YieldClass $value): bool {
53287- $value->validate();
53586+ public static function validateUnsigned(int $value): bool {
5328853587 return true;
5328953588 }
5329053589
5329153590 /**
5329253591 * @throws Exception
53293- * @return YieldClass
53592+ * @return int
5329453593 */
53295- public function getYield(): YieldClass {
53296- if (Obj6::validateYield($this->yield)) {
53297- return $this->yield;
53594+ public function getUnsigned(): int {
53595+ if (Unsigned::validateUnsigned($this->unsigned)) {
53596+ return $this->unsigned;
5329853597 }
53299- throw new Exception('never get to getYield Obj6::yield');
53598+ throw new Exception('never get to getUnsigned Unsigned::unsigned');
5330053599 }
5330153600
5330253601 /**
53303- * @return YieldClass
53602+ * @return int
5330453603 */
53305- public static function sampleYield(): YieldClass {
53306- return YieldClass::sample(); /*51:yield*/
53604+ public static function sampleUnsigned(): int {
53605+ return 31; /*31:unsigned*/
5330753606 }
5330853607
5330953608 /**
@@ -53311,27 +53610,7 @@ class Obj6 {
5331153610 * @return bool
5331253611 */
5331353612 public function validate(): bool {
53314- return Obj6::validateDummy($this->dummy)
53315- || Obj6::validateUnsigned($this->unsigned)
53316- || Obj6::validateUshort($this->ushort)
53317- || Obj6::validateUsing($this->using)
53318- || Obj6::validateUtf8JSONReader($this->utf8JSONReader)
53319- || Obj6::validateUtf8JSONWriter($this->utf8JSONWriter)
53320- || Obj6::validateUUID($this->uuid)
53321- || Obj6::validateVar($this->var)
53322- || Obj6::validateVirtual($this->virtual)
53323- || Obj6::validateVoid($this->void)
53324- || Obj6::validateVolatile($this->volatile)
53325- || Obj6::validateWcharT($this->wcharT)
53326- || Obj6::validateWeak($this->weak)
53327- || Obj6::validateWhere($this->where)
53328- || Obj6::validateWhile($this->while)
53329- || Obj6::validateWillSet($this->willSet)
53330- || Obj6::validateWith($this->with)
53331- || Obj6::validateXor($this->xor)
53332- || Obj6::validateXorEq($this->xorEq)
53333- || Obj6::validateYes($this->yes)
53334- || Obj6::validateYield($this->yield);
53613+ return Unsigned::validateUnsigned($this->unsigned);
5333553614 }
5333653615
5333753616 /**
@@ -53340,164 +53619,44 @@ class Obj6 {
5334053619 */
5334153620 public function to(): stdClass {
5334253621 $out = new stdClass();
53343- $out->{'dummy'} = $this->toDummy();
5334453622 $out->{'unsigned'} = $this->toUnsigned();
53345- $out->{'ushort'} = $this->toUshort();
53346- $out->{'using'} = $this->toUsing();
53347- $out->{'Utf8JsonReader'} = $this->toUtf8JSONReader();
53348- $out->{'Utf8JsonWriter'} = $this->toUtf8JSONWriter();
53349- $out->{'UUID'} = $this->toUUID();
53350- $out->{'var'} = $this->toVar();
53351- $out->{'virtual'} = $this->toVirtual();
53352- $out->{'void'} = $this->toVoid();
53353- $out->{'volatile'} = $this->toVolatile();
53354- $out->{'wchar_t'} = $this->toWcharT();
53355- $out->{'weak'} = $this->toWeak();
53356- $out->{'where'} = $this->toWhere();
53357- $out->{'while'} = $this->toWhile();
53358- $out->{'willSet'} = $this->toWillSet();
53359- $out->{'with'} = $this->toWith();
53360- $out->{'xor'} = $this->toXor();
53361- $out->{'xor_eq'} = $this->toXorEq();
53362- $out->{'YES'} = $this->toYes();
53363- $out->{'yield'} = $this->toYield();
5336453623 return $out;
5336553624 }
5336653625
5336753626 /**
5336853627 * @param stdClass $obj
53369- * @return Obj6
53628+ * @return Unsigned
5337053629 * @throws Exception
5337153630 */
53372- public static function from(stdClass $obj): Obj6 {
53373- if (!property_exists($obj, 'dummy')) {
53374- throw new Exception("Missing required property");
53375- }
53631+ public static function from(stdClass $obj): Unsigned {
5337653632 if (!property_exists($obj, 'unsigned')) {
5337753633 throw new Exception("Missing required property");
5337853634 }
53379- if (!property_exists($obj, 'ushort')) {
53380- throw new Exception("Missing required property");
53381- }
53382- if (!property_exists($obj, 'using')) {
53383- throw new Exception("Missing required property");
53384- }
53385- if (!property_exists($obj, 'Utf8JsonReader')) {
53386- throw new Exception("Missing required property");
53387- }
53388- if (!property_exists($obj, 'Utf8JsonWriter')) {
53389- throw new Exception("Missing required property");
53390- }
53391- if (!property_exists($obj, 'UUID')) {
53392- throw new Exception("Missing required property");
53393- }
53394- if (!property_exists($obj, 'var')) {
53395- throw new Exception("Missing required property");
53396- }
53397- if (!property_exists($obj, 'virtual')) {
53398- throw new Exception("Missing required property");
53399- }
53400- if (!property_exists($obj, 'void')) {
53401- throw new Exception("Missing required property");
53402- }
53403- if (!property_exists($obj, 'volatile')) {
53404- throw new Exception("Missing required property");
53405- }
53406- if (!property_exists($obj, 'wchar_t')) {
53407- throw new Exception("Missing required property");
53408- }
53409- if (!property_exists($obj, 'weak')) {
53410- throw new Exception("Missing required property");
53411- }
53412- if (!property_exists($obj, 'where')) {
53413- throw new Exception("Missing required property");
53414- }
53415- if (!property_exists($obj, 'while')) {
53416- throw new Exception("Missing required property");
53417- }
53418- if (!property_exists($obj, 'willSet')) {
53419- throw new Exception("Missing required property");
53420- }
53421- if (!property_exists($obj, 'with')) {
53422- throw new Exception("Missing required property");
53423- }
53424- if (!property_exists($obj, 'xor')) {
53425- throw new Exception("Missing required property");
53426- }
53427- if (!property_exists($obj, 'xor_eq')) {
53428- throw new Exception("Missing required property");
53429- }
53430- if (!property_exists($obj, 'YES')) {
53431- throw new Exception("Missing required property");
53432- }
53433- if (!property_exists($obj, 'yield')) {
53434- throw new Exception("Missing required property");
53435- }
53436- return new Obj6(
53437- Obj6::fromDummy($obj->{'dummy'})
53438- ,Obj6::fromUnsigned($obj->{'unsigned'})
53439- ,Obj6::fromUshort($obj->{'ushort'})
53440- ,Obj6::fromUsing($obj->{'using'})
53441- ,Obj6::fromUtf8JSONReader($obj->{'Utf8JsonReader'})
53442- ,Obj6::fromUtf8JSONWriter($obj->{'Utf8JsonWriter'})
53443- ,Obj6::fromUUID($obj->{'UUID'})
53444- ,Obj6::fromVar($obj->{'var'})
53445- ,Obj6::fromVirtual($obj->{'virtual'})
53446- ,Obj6::fromVoid($obj->{'void'})
53447- ,Obj6::fromVolatile($obj->{'volatile'})
53448- ,Obj6::fromWcharT($obj->{'wchar_t'})
53449- ,Obj6::fromWeak($obj->{'weak'})
53450- ,Obj6::fromWhere($obj->{'where'})
53451- ,Obj6::fromWhile($obj->{'while'})
53452- ,Obj6::fromWillSet($obj->{'willSet'})
53453- ,Obj6::fromWith($obj->{'with'})
53454- ,Obj6::fromXor($obj->{'xor'})
53455- ,Obj6::fromXorEq($obj->{'xor_eq'})
53456- ,Obj6::fromYes($obj->{'YES'})
53457- ,Obj6::fromYield($obj->{'yield'})
53635+ return new Unsigned(
53636+ Unsigned::fromUnsigned($obj->{'unsigned'})
5345853637 );
5345953638 }
5346053639
5346153640 /**
53462- * @return Obj6
53641+ * @return Unsigned
5346353642 */
53464- public static function sample(): Obj6 {
53465- return new Obj6(
53466- Obj6::sampleDummy()
53467- ,Obj6::sampleUnsigned()
53468- ,Obj6::sampleUshort()
53469- ,Obj6::sampleUsing()
53470- ,Obj6::sampleUtf8JSONReader()
53471- ,Obj6::sampleUtf8JSONWriter()
53472- ,Obj6::sampleUUID()
53473- ,Obj6::sampleVar()
53474- ,Obj6::sampleVirtual()
53475- ,Obj6::sampleVoid()
53476- ,Obj6::sampleVolatile()
53477- ,Obj6::sampleWcharT()
53478- ,Obj6::sampleWeak()
53479- ,Obj6::sampleWhere()
53480- ,Obj6::sampleWhile()
53481- ,Obj6::sampleWillSet()
53482- ,Obj6::sampleWith()
53483- ,Obj6::sampleXor()
53484- ,Obj6::sampleXorEq()
53485- ,Obj6::sampleYes()
53486- ,Obj6::sampleYield()
53643+ public static function sample(): Unsigned {
53644+ return new Unsigned(
53645+ Unsigned::sampleUnsigned()
5348753646 );
5348853647 }
5348953648 }
5349053649
53491-// This is an autogenerated file:Unsigned
53650+// This is an autogenerated file:UseSerializers
5349253651
53493-class Unsigned {
53494- private int $unsigned; // json:unsigned Required
53652+class UseSerializers {
53653+ private int $useSerializers; // json:UseSerializers Required
5349553654
5349653655 /**
53497- * @param int $unsigned
53656+ * @param int $useSerializers
5349853657 */
53499- public function __construct(int $unsigned) {
53500- $this->unsigned = $unsigned;
53658+ public function __construct(int $useSerializers) {
53659+ $this->useSerializers = $useSerializers;
5350153660 }
5350253661
5350353662 /**
@@ -53505,7 +53664,7 @@ class Unsigned {
5350553664 * @throws Exception
5350653665 * @return int
5350753666 */
53508- public static function fromUnsigned(int $value): int {
53667+ public static function fromUseSerializers(int $value): int {
5350953668 return $value; /*int*/
5351053669 }
5351153670
@@ -53513,11 +53672,11 @@ class Unsigned {
5351353672 * @throws Exception
5351453673 * @return int
5351553674 */
53516- public function toUnsigned(): int {
53517- if (Unsigned::validateUnsigned($this->unsigned)) {
53518- return $this->unsigned; /*int*/
53675+ public function toUseSerializers(): int {
53676+ if (UseSerializers::validateUseSerializers($this->useSerializers)) {
53677+ return $this->useSerializers; /*int*/
5351953678 }
53520- throw new Exception('never get to this Unsigned::unsigned');
53679+ throw new Exception('never get to this UseSerializers::useSerializers');
5352153680 }
5352253681
5352353682 /**
@@ -53525,7 +53684,7 @@ class Unsigned {
5352553684 * @return bool
5352653685 * @throws Exception
5352753686 */
53528- public static function validateUnsigned(int $value): bool {
53687+ public static function validateUseSerializers(int $value): bool {
5352953688 return true;
5353053689 }
5353153690
@@ -53533,18 +53692,18 @@ class Unsigned {
5353353692 * @throws Exception
5353453693 * @return int
5353553694 */
53536- public function getUnsigned(): int {
53537- if (Unsigned::validateUnsigned($this->unsigned)) {
53538- return $this->unsigned;
53695+ public function getUseSerializers(): int {
53696+ if (UseSerializers::validateUseSerializers($this->useSerializers)) {
53697+ return $this->useSerializers;
5353953698 }
53540- throw new Exception('never get to getUnsigned Unsigned::unsigned');
53699+ throw new Exception('never get to getUseSerializers UseSerializers::useSerializers');
5354153700 }
5354253701
5354353702 /**
5354453703 * @return int
5354553704 */
53546- public static function sampleUnsigned(): int {
53547- return 31; /*31:unsigned*/
53705+ public static function sampleUseSerializers(): int {
53706+ return 31; /*31:useSerializers*/
5354853707 }
5354953708
5355053709 /**
@@ -53552,7 +53711,7 @@ class Unsigned {
5355253711 * @return bool
5355353712 */
5355453713 public function validate(): bool {
53555- return Unsigned::validateUnsigned($this->unsigned);
53714+ return UseSerializers::validateUseSerializers($this->useSerializers);
5355653715 }
5355753716
5355853717 /**
@@ -53561,30 +53720,30 @@ class Unsigned {
5356153720 */
5356253721 public function to(): stdClass {
5356353722 $out = new stdClass();
53564- $out->{'unsigned'} = $this->toUnsigned();
53723+ $out->{'UseSerializers'} = $this->toUseSerializers();
5356553724 return $out;
5356653725 }
5356753726
5356853727 /**
5356953728 * @param stdClass $obj
53570- * @return Unsigned
53729+ * @return UseSerializers
5357153730 * @throws Exception
5357253731 */
53573- public static function from(stdClass $obj): Unsigned {
53574- if (!property_exists($obj, 'unsigned')) {
53732+ public static function from(stdClass $obj): UseSerializers {
53733+ if (!property_exists($obj, 'UseSerializers')) {
5357553734 throw new Exception("Missing required property");
5357653735 }
53577- return new Unsigned(
53578- Unsigned::fromUnsigned($obj->{'unsigned'})
53736+ return new UseSerializers(
53737+ UseSerializers::fromUseSerializers($obj->{'UseSerializers'})
5357953738 );
5358053739 }
5358153740
5358253741 /**
53583- * @return Unsigned
53742+ * @return UseSerializers
5358453743 */
53585- public static function sample(): Unsigned {
53586- return new Unsigned(
53587- Unsigned::sampleUnsigned()
53744+ public static function sample(): UseSerializers {
53745+ return new UseSerializers(
53746+ UseSerializers::sampleUseSerializers()
5358853747 );
5358953748 }
5359053749 }
Mpikedefault / TopLevel.pmod+200 −175
@@ -3355,6 +3355,7 @@ class Obj3 {
33553355 Locale locale; // json: "Locale"
33563356 Lock lock; // json: "lock"
33573357 Long long; // json: "long"
3358+ MakeDictEncoder make_dict_encoder; // json: "makeDictEncoder"
33583359 Map map; // json: "map"
33593360 MapEntry map_entry; // json: "MapEntry"
33603361 MarshalJson marshal_json; // json: "MarshalJSON"
@@ -3366,8 +3367,6 @@ class Obj3 {
33663367 Native native; // json: "native"
33673368 New new; // json: "new"
33683369 Newtonsoft newtonsoft; // json: "newtonsoft"
3369- Nil nil; // json: "nil"
3370- No no; // json: "NO"
33713370 If obj3_if; // json: "if"
33723371 Import obj3_import; // json: "import"
33733372 Inline obj3_inline; // json: "inline"
@@ -3424,6 +3423,7 @@ class Obj3 {
34243423 "Locale" : locale,
34253424 "lock" : lock,
34263425 "long" : long,
3426+ "makeDictEncoder" : make_dict_encoder,
34273427 "map" : map,
34283428 "MapEntry" : map_entry,
34293429 "MarshalJSON" : marshal_json,
@@ -3435,8 +3435,6 @@ class Obj3 {
34353435 "native" : native,
34363436 "new" : new,
34373437 "newtonsoft" : newtonsoft,
3438- "nil" : nil,
3439- "NO" : no,
34403438 "if" : obj3_if,
34413439 "import" : obj3_import,
34423440 "inline" : obj3_inline,
@@ -3547,6 +3545,8 @@ Obj3 Obj3_from_JSON(mixed json) {
35473545 retval.lock = json["lock"];
35483546 if (!mappingp(json["long"])) error("Expected object");
35493547 retval.long = json["long"];
3548+ if (!mappingp(json["makeDictEncoder"])) error("Expected object");
3549+ retval.make_dict_encoder = json["makeDictEncoder"];
35503550 if (!mappingp(json["map"])) error("Expected object");
35513551 retval.map = json["map"];
35523552 if (!mappingp(json["MapEntry"])) error("Expected object");
@@ -3569,10 +3569,6 @@ Obj3 Obj3_from_JSON(mixed json) {
35693569 retval.new = json["new"];
35703570 if (!mappingp(json["newtonsoft"])) error("Expected object");
35713571 retval.newtonsoft = json["newtonsoft"];
3572- if (!mappingp(json["nil"])) error("Expected object");
3573- retval.nil = json["nil"];
3574- if (!mappingp(json["NO"])) error("Expected object");
3575- retval.no = json["NO"];
35763572 if (!mappingp(json["if"])) error("Expected object");
35773573 retval.obj3_if = json["if"];
35783574 if (!mappingp(json["import"])) error("Expected object");
@@ -4573,6 +4569,27 @@ Long Long_from_JSON(mixed json) {
45734569 return retval;
45744570 }
45754571
4572+class MakeDictEncoder {
4573+ int make_dict_encoder; // json: "makeDictEncoder"
4574+
4575+ string encode_json() {
4576+ mapping(string:mixed) json = ([
4577+ "makeDictEncoder" : make_dict_encoder,
4578+ ]);
4579+
4580+ return Standards.JSON.encode(json);
4581+ }
4582+}
4583+
4584+MakeDictEncoder MakeDictEncoder_from_JSON(mixed json) {
4585+ MakeDictEncoder retval = MakeDictEncoder();
4586+
4587+ if (!intp(json["makeDictEncoder"])) error("Expected integer");
4588+ retval.make_dict_encoder = json["makeDictEncoder"];
4589+
4590+ return retval;
4591+}
4592+
45764593 class Map {
45774594 int map; // json: "map"
45784595
@@ -4804,48 +4821,6 @@ Newtonsoft Newtonsoft_from_JSON(mixed json) {
48044821 return retval;
48054822 }
48064823
4807-class Nil {
4808- int nil; // json: "nil"
4809-
4810- string encode_json() {
4811- mapping(string:mixed) json = ([
4812- "nil" : nil,
4813- ]);
4814-
4815- return Standards.JSON.encode(json);
4816- }
4817-}
4818-
4819-Nil Nil_from_JSON(mixed json) {
4820- Nil retval = Nil();
4821-
4822- if (!intp(json["nil"])) error("Expected integer");
4823- retval.nil = json["nil"];
4824-
4825- return retval;
4826-}
4827-
4828-class No {
4829- int no; // json: "NO"
4830-
4831- string encode_json() {
4832- mapping(string:mixed) json = ([
4833- "NO" : no,
4834- ]);
4835-
4836- return Standards.JSON.encode(json);
4837- }
4838-}
4839-
4840-No No_from_JSON(mixed json) {
4841- No retval = No();
4842-
4843- if (!intp(json["NO"])) error("Expected integer");
4844- retval.no = json["NO"];
4845-
4846- return retval;
4847-}
4848-
48494824 class If {
48504825 int if_if; // json: "if"
48514826
@@ -4953,6 +4928,8 @@ Lambda Lambda_from_JSON(mixed json) {
49534928
49544929 class Obj4 {
49554930 int dummy; // json: "dummy"
4931+ Nil nil; // json: "nil"
4932+ No no; // json: "NO"
49564933 NoSuchMethod no_such_method; // json: "noSuchMethod"
49574934 Noexcept noexcept; // json: "noexcept"
49584935 Nonatomic nonatomic; // json: "nonatomic"
@@ -5015,12 +4992,12 @@ class Obj4 {
50154992 RuntimeType runtime_type; // json: "runtimeType"
50164993 S s; // json: "s"
50174994 Sbyte sbyte; // json: "sbyte"
5018- Sealed sealed; // json: "sealed"
5019- Sel sel; // json: "SEL"
50204995
50214996 string encode_json() {
50224997 mapping(string:mixed) json = ([
50234998 "dummy" : dummy,
4999+ "nil" : nil,
5000+ "NO" : no,
50245001 "noSuchMethod" : no_such_method,
50255002 "noexcept" : noexcept,
50265003 "nonatomic" : nonatomic,
@@ -5083,8 +5060,6 @@ class Obj4 {
50835060 "runtimeType" : runtime_type,
50845061 "s" : s,
50855062 "sbyte" : sbyte,
5086- "sealed" : sealed,
5087- "SEL" : sel,
50885063 ]);
50895064
50905065 return Standards.JSON.encode(json);
@@ -5096,6 +5071,10 @@ Obj4 Obj4_from_JSON(mixed json) {
50965071
50975072 if (!intp(json["dummy"])) error("Expected integer");
50985073 retval.dummy = json["dummy"];
5074+ if (!mappingp(json["nil"])) error("Expected object");
5075+ retval.nil = json["nil"];
5076+ if (!mappingp(json["NO"])) error("Expected object");
5077+ retval.no = json["NO"];
50995078 if (!mappingp(json["noSuchMethod"])) error("Expected object");
51005079 retval.no_such_method = json["noSuchMethod"];
51015080 if (!mappingp(json["noexcept"])) error("Expected object");
@@ -5220,10 +5199,48 @@ Obj4 Obj4_from_JSON(mixed json) {
52205199 retval.s = json["s"];
52215200 if (!mappingp(json["sbyte"])) error("Expected object");
52225201 retval.sbyte = json["sbyte"];
5223- if (!mappingp(json["sealed"])) error("Expected object");
5224- retval.sealed = json["sealed"];
5225- if (!mappingp(json["SEL"])) error("Expected object");
5226- retval.sel = json["SEL"];
5202+
5203+ return retval;
5204+}
5205+
5206+class Nil {
5207+ int nil; // json: "nil"
5208+
5209+ string encode_json() {
5210+ mapping(string:mixed) json = ([
5211+ "nil" : nil,
5212+ ]);
5213+
5214+ return Standards.JSON.encode(json);
5215+ }
5216+}
5217+
5218+Nil Nil_from_JSON(mixed json) {
5219+ Nil retval = Nil();
5220+
5221+ if (!intp(json["nil"])) error("Expected integer");
5222+ retval.nil = json["nil"];
5223+
5224+ return retval;
5225+}
5226+
5227+class No {
5228+ int no; // json: "NO"
5229+
5230+ string encode_json() {
5231+ mapping(string:mixed) json = ([
5232+ "NO" : no,
5233+ ]);
5234+
5235+ return Standards.JSON.encode(json);
5236+ }
5237+}
5238+
5239+No No_from_JSON(mixed json) {
5240+ No retval = No();
5241+
5242+ if (!intp(json["NO"])) error("Expected integer");
5243+ retval.no = json["NO"];
52275244
52285245 return retval;
52295246 }
@@ -6529,48 +6546,6 @@ Sbyte Sbyte_from_JSON(mixed json) {
65296546 return retval;
65306547 }
65316548
6532-class Sealed {
6533- int sealed; // json: "sealed"
6534-
6535- string encode_json() {
6536- mapping(string:mixed) json = ([
6537- "sealed" : sealed,
6538- ]);
6539-
6540- return Standards.JSON.encode(json);
6541- }
6542-}
6543-
6544-Sealed Sealed_from_JSON(mixed json) {
6545- Sealed retval = Sealed();
6546-
6547- if (!intp(json["sealed"])) error("Expected integer");
6548- retval.sealed = json["sealed"];
6549-
6550- return retval;
6551-}
6552-
6553-class Sel {
6554- int sel; // json: "SEL"
6555-
6556- string encode_json() {
6557- mapping(string:mixed) json = ([
6558- "SEL" : sel,
6559- ]);
6560-
6561- return Standards.JSON.encode(json);
6562- }
6563-}
6564-
6565-Sel Sel_from_JSON(mixed json) {
6566- Sel retval = Sel();
6567-
6568- if (!intp(json["SEL"])) error("Expected integer");
6569- retval.sel = json["SEL"];
6570-
6571- return retval;
6572-}
6573-
65746549 class Obj5 {
65756550 int dummy; // json: "dummy"
65766551 KSerializer k_serializer; // json: "KSerializer"
@@ -6583,6 +6558,8 @@ class Obj5 {
65836558 Typedef obj5_typedef; // json: "typedef"
65846559 Typeof obj5_typeof; // json: "typeof"
65856560 PrimitiveKind primitive_kind; // json: "PrimitiveKind"
6561+ Sealed sealed; // json: "sealed"
6562+ Sel sel; // json: "SEL"
65866563 Select select; // json: "select"
65876564 Self self; // json: "Self"
65886565 Sendable sendable; // json: "Sendable"
@@ -6635,9 +6612,6 @@ class Obj5 {
66356612 Undefined undefined; // json: "undefined"
66366613 Union union; // json: "union"
66376614 UnmarshalJson unmarshal_json; // json: "UnmarshalJSON"
6638- Unowned unowned; // json: "unowned"
6639- Unsafe unsafe; // json: "unsafe"
6640- UseSerializers use_serializers; // json: "UseSerializers"
66416615
66426616 string encode_json() {
66436617 mapping(string:mixed) json = ([
@@ -6652,6 +6626,8 @@ class Obj5 {
66526626 "typedef" : obj5_typedef,
66536627 "typeof" : obj5_typeof,
66546628 "PrimitiveKind" : primitive_kind,
6629+ "sealed" : sealed,
6630+ "SEL" : sel,
66556631 "select" : select,
66566632 "Self" : self,
66576633 "Sendable" : sendable,
@@ -6704,9 +6680,6 @@ class Obj5 {
67046680 "undefined" : undefined,
67056681 "union" : union,
67066682 "UnmarshalJSON" : unmarshal_json,
6707- "unowned" : unowned,
6708- "unsafe" : unsafe,
6709- "UseSerializers" : use_serializers,
67106683 ]);
67116684
67126685 return Standards.JSON.encode(json);
@@ -6738,6 +6711,10 @@ Obj5 Obj5_from_JSON(mixed json) {
67386711 retval.obj5_typeof = json["typeof"];
67396712 if (!mappingp(json["PrimitiveKind"])) error("Expected object");
67406713 retval.primitive_kind = json["PrimitiveKind"];
6714+ if (!mappingp(json["sealed"])) error("Expected object");
6715+ retval.sealed = json["sealed"];
6716+ if (!mappingp(json["SEL"])) error("Expected object");
6717+ retval.sel = json["SEL"];
67416718 if (!mappingp(json["select"])) error("Expected object");
67426719 retval.select = json["select"];
67436720 if (!mappingp(json["Self"])) error("Expected object");
@@ -6842,12 +6819,6 @@ Obj5 Obj5_from_JSON(mixed json) {
68426819 retval.union = json["union"];
68436820 if (!mappingp(json["UnmarshalJSON"])) error("Expected object");
68446821 retval.unmarshal_json = json["UnmarshalJSON"];
6845- if (!mappingp(json["unowned"])) error("Expected object");
6846- retval.unowned = json["unowned"];
6847- if (!mappingp(json["unsafe"])) error("Expected object");
6848- retval.unsafe = json["unsafe"];
6849- if (!mappingp(json["UseSerializers"])) error("Expected object");
6850- retval.use_serializers = json["UseSerializers"];
68516822
68526823 return retval;
68536824 }
@@ -7062,6 +7033,48 @@ PrimitiveKind PrimitiveKind_from_JSON(mixed json) {
70627033 return retval;
70637034 }
70647035
7036+class Sealed {
7037+ int sealed; // json: "sealed"
7038+
7039+ string encode_json() {
7040+ mapping(string:mixed) json = ([
7041+ "sealed" : sealed,
7042+ ]);
7043+
7044+ return Standards.JSON.encode(json);
7045+ }
7046+}
7047+
7048+Sealed Sealed_from_JSON(mixed json) {
7049+ Sealed retval = Sealed();
7050+
7051+ if (!intp(json["sealed"])) error("Expected integer");
7052+ retval.sealed = json["sealed"];
7053+
7054+ return retval;
7055+}
7056+
7057+class Sel {
7058+ int sel; // json: "SEL"
7059+
7060+ string encode_json() {
7061+ mapping(string:mixed) json = ([
7062+ "SEL" : sel,
7063+ ]);
7064+
7065+ return Standards.JSON.encode(json);
7066+ }
7067+}
7068+
7069+Sel Sel_from_JSON(mixed json) {
7070+ Sel retval = Sel();
7071+
7072+ if (!intp(json["SEL"])) error("Expected integer");
7073+ retval.sel = json["SEL"];
7074+
7075+ return retval;
7076+}
7077+
70657078 class Select {
70667079 int select; // json: "select"
70677080
@@ -8154,74 +8167,14 @@ UnmarshalJson UnmarshalJson_from_JSON(mixed json) {
81548167 return retval;
81558168 }
81568169
8157-class Unowned {
8158- int unowned; // json: "unowned"
8159-
8160- string encode_json() {
8161- mapping(string:mixed) json = ([
8162- "unowned" : unowned,
8163- ]);
8164-
8165- return Standards.JSON.encode(json);
8166- }
8167-}
8168-
8169-Unowned Unowned_from_JSON(mixed json) {
8170- Unowned retval = Unowned();
8171-
8172- if (!intp(json["unowned"])) error("Expected integer");
8173- retval.unowned = json["unowned"];
8174-
8175- return retval;
8176-}
8177-
8178-class Unsafe {
8179- int unsafe; // json: "unsafe"
8180-
8181- string encode_json() {
8182- mapping(string:mixed) json = ([
8183- "unsafe" : unsafe,
8184- ]);
8185-
8186- return Standards.JSON.encode(json);
8187- }
8188-}
8189-
8190-Unsafe Unsafe_from_JSON(mixed json) {
8191- Unsafe retval = Unsafe();
8192-
8193- if (!intp(json["unsafe"])) error("Expected integer");
8194- retval.unsafe = json["unsafe"];
8195-
8196- return retval;
8197-}
8198-
8199-class UseSerializers {
8200- int use_serializers; // json: "UseSerializers"
8201-
8202- string encode_json() {
8203- mapping(string:mixed) json = ([
8204- "UseSerializers" : use_serializers,
8205- ]);
8206-
8207- return Standards.JSON.encode(json);
8208- }
8209-}
8210-
8211-UseSerializers UseSerializers_from_JSON(mixed json) {
8212- UseSerializers retval = UseSerializers();
8213-
8214- if (!intp(json["UseSerializers"])) error("Expected integer");
8215- retval.use_serializers = json["UseSerializers"];
8216-
8217- return retval;
8218-}
8219-
82208170 class Obj6 {
82218171 int dummy; // json: "dummy"
82228172 Void obj6_void; // json: "void"
82238173 While obj6_while; // json: "while"
8174+ Unowned unowned; // json: "unowned"
8175+ Unsafe unsafe; // json: "unsafe"
82248176 Unsigned unsigned; // json: "unsigned"
8177+ UseSerializers use_serializers; // json: "UseSerializers"
82258178 Ushort ushort; // json: "ushort"
82268179 Using using; // json: "using"
82278180 Utf8JsonReader utf8_json_reader; // json: "Utf8JsonReader"
@@ -8245,7 +8198,10 @@ class Obj6 {
82458198 "dummy" : dummy,
82468199 "void" : obj6_void,
82478200 "while" : obj6_while,
8201+ "unowned" : unowned,
8202+ "unsafe" : unsafe,
82488203 "unsigned" : unsigned,
8204+ "UseSerializers" : use_serializers,
82498205 "ushort" : ushort,
82508206 "using" : using,
82518207 "Utf8JsonReader" : utf8_json_reader,
@@ -8278,8 +8234,14 @@ Obj6 Obj6_from_JSON(mixed json) {
82788234 retval.obj6_void = json["void"];
82798235 if (!mappingp(json["while"])) error("Expected object");
82808236 retval.obj6_while = json["while"];
8237+ if (!mappingp(json["unowned"])) error("Expected object");
8238+ retval.unowned = json["unowned"];
8239+ if (!mappingp(json["unsafe"])) error("Expected object");
8240+ retval.unsafe = json["unsafe"];
82818241 if (!mappingp(json["unsigned"])) error("Expected object");
82828242 retval.unsigned = json["unsigned"];
8243+ if (!mappingp(json["UseSerializers"])) error("Expected object");
8244+ retval.use_serializers = json["UseSerializers"];
82838245 if (!mappingp(json["ushort"])) error("Expected object");
82848246 retval.ushort = json["ushort"];
82858247 if (!mappingp(json["using"])) error("Expected object");
@@ -8360,6 +8322,48 @@ While While_from_JSON(mixed json) {
83608322 return retval;
83618323 }
83628324
8325+class Unowned {
8326+ int unowned; // json: "unowned"
8327+
8328+ string encode_json() {
8329+ mapping(string:mixed) json = ([
8330+ "unowned" : unowned,
8331+ ]);
8332+
8333+ return Standards.JSON.encode(json);
8334+ }
8335+}
8336+
8337+Unowned Unowned_from_JSON(mixed json) {
8338+ Unowned retval = Unowned();
8339+
8340+ if (!intp(json["unowned"])) error("Expected integer");
8341+ retval.unowned = json["unowned"];
8342+
8343+ return retval;
8344+}
8345+
8346+class Unsafe {
8347+ int unsafe; // json: "unsafe"
8348+
8349+ string encode_json() {
8350+ mapping(string:mixed) json = ([
8351+ "unsafe" : unsafe,
8352+ ]);
8353+
8354+ return Standards.JSON.encode(json);
8355+ }
8356+}
8357+
8358+Unsafe Unsafe_from_JSON(mixed json) {
8359+ Unsafe retval = Unsafe();
8360+
8361+ if (!intp(json["unsafe"])) error("Expected integer");
8362+ retval.unsafe = json["unsafe"];
8363+
8364+ return retval;
8365+}
8366+
83638367 class Unsigned {
83648368 int unsigned; // json: "unsigned"
83658369
@@ -8381,6 +8385,27 @@ Unsigned Unsigned_from_JSON(mixed json) {
83818385 return retval;
83828386 }
83838387
8388+class UseSerializers {
8389+ int use_serializers; // json: "UseSerializers"
8390+
8391+ string encode_json() {
8392+ mapping(string:mixed) json = ([
8393+ "UseSerializers" : use_serializers,
8394+ ]);
8395+
8396+ return Standards.JSON.encode(json);
8397+ }
8398+}
8399+
8400+UseSerializers UseSerializers_from_JSON(mixed json) {
8401+ UseSerializers retval = UseSerializers();
8402+
8403+ if (!intp(json["UseSerializers"])) error("Expected integer");
8404+ retval.use_serializers = json["UseSerializers"];
8405+
8406+ return retval;
8407+}
8408+
83848409 class Ushort {
83858410 int ushort; // json: "ushort"
Mpythondefault / quicktype.py+156 −137
@@ -3244,6 +3244,22 @@ class Long:
32443244 return result
32453245
32463246
3247+@dataclass
3248+class MakeDictEncoder:
3249+ make_dict_encoder: int
3250+
3251+ @staticmethod
3252+ def from_dict(obj: Any) -> 'MakeDictEncoder':
3253+ assert isinstance(obj, dict)
3254+ make_dict_encoder = from_int(obj["makeDictEncoder"])
3255+ return MakeDictEncoder(make_dict_encoder)
3256+
3257+ def to_dict(self) -> dict:
3258+ result: dict = {}
3259+ result["makeDictEncoder"] = from_int(self.make_dict_encoder)
3260+ return result
3261+
3262+
32473263 @dataclass
32483264 class Map:
32493265 map: int
@@ -3420,38 +3436,6 @@ class Newtonsoft:
34203436 return result
34213437
34223438
3423-@dataclass
3424-class Nil:
3425- nil: int
3426-
3427- @staticmethod
3428- def from_dict(obj: Any) -> 'Nil':
3429- assert isinstance(obj, dict)
3430- nil = from_int(obj["nil"])
3431- return Nil(nil)
3432-
3433- def to_dict(self) -> dict:
3434- result: dict = {}
3435- result["nil"] = from_int(self.nil)
3436- return result
3437-
3438-
3439-@dataclass
3440-class No:
3441- no: int
3442-
3443- @staticmethod
3444- def from_dict(obj: Any) -> 'No':
3445- assert isinstance(obj, dict)
3446- no = from_int(obj["NO"])
3447- return No(no)
3448-
3449- def to_dict(self) -> dict:
3450- result: dict = {}
3451- result["NO"] = from_int(self.no)
3452- return result
3453-
3454-
34553439 @dataclass
34563440 class If:
34573441 if_if: int
@@ -3568,7 +3552,6 @@ class Obj3:
35683552 locale: Locale
35693553 map_entry: MapEntry
35703554 marshal_json: MarshalJSON
3571- no: No
35723555 dummy: int
35733556 goto: Goto
35743557 guard: Guard
@@ -3606,6 +3589,7 @@ class Obj3:
36063589 list: ListClass
36073590 lock: Lock
36083591 long: Long
3592+ make_dict_encoder: MakeDictEncoder
36093593 map: Map
36103594 metadata_property_handling: MetadataPropertyHandling
36113595 module: Module
@@ -3615,7 +3599,6 @@ class Obj3:
36153599 native: Native
36163600 new: New
36173601 newtonsoft: Newtonsoft
3618- nil: Nil
36193602
36203603 @staticmethod
36213604 def from_dict(obj: Any) -> 'Obj3':
@@ -3638,7 +3621,6 @@ class Obj3:
36383621 locale = Locale.from_dict(obj["Locale"])
36393622 map_entry = MapEntry.from_dict(obj["MapEntry"])
36403623 marshal_json = MarshalJSON.from_dict(obj["MarshalJSON"])
3641- no = No.from_dict(obj["NO"])
36423624 dummy = from_int(obj["dummy"])
36433625 goto = Goto.from_dict(obj["goto"])
36443626 guard = Guard.from_dict(obj["guard"])
@@ -3676,6 +3658,7 @@ class Obj3:
36763658 list = ListClass.from_dict(obj["list"])
36773659 lock = Lock.from_dict(obj["lock"])
36783660 long = Long.from_dict(obj["long"])
3661+ make_dict_encoder = MakeDictEncoder.from_dict(obj["makeDictEncoder"])
36793662 map = Map.from_dict(obj["map"])
36803663 metadata_property_handling = MetadataPropertyHandling.from_dict(obj["metadata_property_handling"])
36813664 module = Module.from_dict(obj["module"])
@@ -3685,8 +3668,7 @@ class Obj3:
36853668 native = Native.from_dict(obj["native"])
36863669 new = New.from_dict(obj["new"])
36873670 newtonsoft = Newtonsoft.from_dict(obj["newtonsoft"])
3688- nil = Nil.from_dict(obj["nil"])
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)
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, marshal_json, 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, make_dict_encoder, map, metadata_property_handling, module, mutable, mutating, namespace, native, new, newtonsoft)
36903672
36913673 def to_dict(self) -> dict:
36923674 result: dict = {}
@@ -3708,7 +3690,6 @@ class Obj3:
37083690 result["Locale"] = to_class(Locale, self.locale)
37093691 result["MapEntry"] = to_class(MapEntry, self.map_entry)
37103692 result["MarshalJSON"] = to_class(MarshalJSON, self.marshal_json)
3711- result["NO"] = to_class(No, self.no)
37123693 result["dummy"] = from_int(self.dummy)
37133694 result["goto"] = to_class(Goto, self.goto)
37143695 result["guard"] = to_class(Guard, self.guard)
@@ -3746,6 +3727,7 @@ class Obj3:
37463727 result["list"] = to_class(ListClass, self.list)
37473728 result["lock"] = to_class(Lock, self.lock)
37483729 result["long"] = to_class(Long, self.long)
3730+ result["makeDictEncoder"] = to_class(MakeDictEncoder, self.make_dict_encoder)
37493731 result["map"] = to_class(Map, self.map)
37503732 result["metadata_property_handling"] = to_class(MetadataPropertyHandling, self.metadata_property_handling)
37513733 result["module"] = to_class(Module, self.module)
@@ -3755,7 +3737,38 @@ class Obj3:
37553737 result["native"] = to_class(Native, self.native)
37563738 result["new"] = to_class(New, self.new)
37573739 result["newtonsoft"] = to_class(Newtonsoft, self.newtonsoft)
3758- result["nil"] = to_class(Nil, self.nil)
3740+ return result
3741+
3742+
3743+@dataclass
3744+class Nil:
3745+ nil: int
3746+
3747+ @staticmethod
3748+ def from_dict(obj: Any) -> 'Nil':
3749+ assert isinstance(obj, dict)
3750+ nil = from_int(obj["nil"])
3751+ return Nil(nil)
3752+
3753+ def to_dict(self) -> dict:
3754+ result: dict = {}
3755+ result["nil"] = from_int(self.nil)
3756+ return result
3757+
3758+
3759+@dataclass
3760+class No:
3761+ no: int
3762+
3763+ @staticmethod
3764+ def from_dict(obj: Any) -> 'No':
3765+ assert isinstance(obj, dict)
3766+ no = from_int(obj["NO"])
3767+ return No(no)
3768+
3769+ def to_dict(self) -> dict:
3770+ result: dict = {}
3771+ result["NO"] = from_int(self.no)
37593772 return result
37603773
37613774
@@ -4751,40 +4764,9 @@ class Sbyte:
47514764 return result
47524765
47534766
4754-@dataclass
4755-class Sealed:
4756- sealed: int
4757-
4758- @staticmethod
4759- def from_dict(obj: Any) -> 'Sealed':
4760- assert isinstance(obj, dict)
4761- sealed = from_int(obj["sealed"])
4762- return Sealed(sealed)
4763-
4764- def to_dict(self) -> dict:
4765- result: dict = {}
4766- result["sealed"] = from_int(self.sealed)
4767- return result
4768-
4769-
4770-@dataclass
4771-class Sel:
4772- sel: int
4773-
4774- @staticmethod
4775- def from_dict(obj: Any) -> 'Sel':
4776- assert isinstance(obj, dict)
4777- sel = from_int(obj["SEL"])
4778- return Sel(sel)
4779-
4780- def to_dict(self) -> dict:
4781- result: dict = {}
4782- result["SEL"] = from_int(self.sel)
4783- return result
4784-
4785-
47864767 @dataclass
47874768 class Obj4:
4769+ no: No
47884770 ns_error: NSError
47894771 ns_object: NSObject
47904772 ns_string: NSString
@@ -4793,8 +4775,8 @@ class Obj4:
47934775 object_mapper: ObjectMapper
47944776 protocol: Protocol
47954777 reg_exp: RegExp
4796- sel: Sel
47974778 dummy: int
4779+ nil: Nil
47984780 no_such_method: NoSuchMethod
47994781 noexcept: Noexcept
48004782 nonatomic: Nonatomic
@@ -4849,11 +4831,11 @@ class Obj4:
48494831 runtime_type: RuntimeType
48504832 s: S
48514833 sbyte: Sbyte
4852- sealed: Sealed
48534834
48544835 @staticmethod
48554836 def from_dict(obj: Any) -> 'Obj4':
48564837 assert isinstance(obj, dict)
4838+ no = No.from_dict(obj["NO"])
48574839 ns_error = NSError.from_dict(obj["NSError"])
48584840 ns_object = NSObject.from_dict(obj["NSObject"])
48594841 ns_string = NSString.from_dict(obj["NSString"])
@@ -4862,8 +4844,8 @@ class Obj4:
48624844 object_mapper = ObjectMapper.from_dict(obj["ObjectMapper"])
48634845 protocol = Protocol.from_dict(obj["Protocol"])
48644846 reg_exp = RegExp.from_dict(obj["RegExp"])
4865- sel = Sel.from_dict(obj["SEL"])
48664847 dummy = from_int(obj["dummy"])
4848+ nil = Nil.from_dict(obj["nil"])
48674849 no_such_method = NoSuchMethod.from_dict(obj["noSuchMethod"])
48684850 noexcept = Noexcept.from_dict(obj["noexcept"])
48694851 nonatomic = Nonatomic.from_dict(obj["nonatomic"])
@@ -4918,11 +4900,11 @@ class Obj4:
49184900 runtime_type = RuntimeType.from_dict(obj["runtimeType"])
49194901 s = S.from_dict(obj["s"])
49204902 sbyte = Sbyte.from_dict(obj["sbyte"])
4921- sealed = Sealed.from_dict(obj["sealed"])
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)
4903+ return Obj4(no, ns_error, ns_object, ns_string, null, none, object_mapper, protocol, reg_exp, dummy, nil, 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)
49234904
49244905 def to_dict(self) -> dict:
49254906 result: dict = {}
4907+ result["NO"] = to_class(No, self.no)
49264908 result["NSError"] = to_class(NSError, self.ns_error)
49274909 result["NSObject"] = to_class(NSObject, self.ns_object)
49284910 result["NSString"] = to_class(NSString, self.ns_string)
@@ -4931,8 +4913,8 @@ class Obj4:
49314913 result["ObjectMapper"] = to_class(ObjectMapper, self.object_mapper)
49324914 result["Protocol"] = to_class(Protocol, self.protocol)
49334915 result["RegExp"] = to_class(RegExp, self.reg_exp)
4934- result["SEL"] = to_class(Sel, self.sel)
49354916 result["dummy"] = from_int(self.dummy)
4917+ result["nil"] = to_class(Nil, self.nil)
49364918 result["noSuchMethod"] = to_class(NoSuchMethod, self.no_such_method)
49374919 result["noexcept"] = to_class(Noexcept, self.noexcept)
49384920 result["nonatomic"] = to_class(Nonatomic, self.nonatomic)
@@ -4987,7 +4969,6 @@ class Obj4:
49874969 result["runtimeType"] = to_class(RuntimeType, self.runtime_type)
49884970 result["s"] = to_class(S, self.s)
49894971 result["sbyte"] = to_class(Sbyte, self.sbyte)
4990- result["sealed"] = to_class(Sealed, self.sealed)
49914972 return result
49924973
49934974
@@ -5119,6 +5100,38 @@ class SelfClass:
51195100 return result
51205101
51215102
5103+@dataclass
5104+class Sealed:
5105+ sealed: int
5106+
5107+ @staticmethod
5108+ def from_dict(obj: Any) -> 'Sealed':
5109+ assert isinstance(obj, dict)
5110+ sealed = from_int(obj["sealed"])
5111+ return Sealed(sealed)
5112+
5113+ def to_dict(self) -> dict:
5114+ result: dict = {}
5115+ result["sealed"] = from_int(self.sealed)
5116+ return result
5117+
5118+
5119+@dataclass
5120+class Sel:
5121+ sel: int
5122+
5123+ @staticmethod
5124+ def from_dict(obj: Any) -> 'Sel':
5125+ assert isinstance(obj, dict)
5126+ sel = from_int(obj["SEL"])
5127+ return Sel(sel)
5128+
5129+ def to_dict(self) -> dict:
5130+ result: dict = {}
5131+ result["SEL"] = from_int(self.sel)
5132+ return result
5133+
5134+
51225135 @dataclass
51235136 class Select:
51245137 select: int
@@ -5983,58 +5996,11 @@ class UnmarshalJSON:
59835996 return result
59845997
59855998
5986-@dataclass
5987-class Unowned:
5988- unowned: int
5989-
5990- @staticmethod
5991- def from_dict(obj: Any) -> 'Unowned':
5992- assert isinstance(obj, dict)
5993- unowned = from_int(obj["unowned"])
5994- return Unowned(unowned)
5995-
5996- def to_dict(self) -> dict:
5997- result: dict = {}
5998- result["unowned"] = from_int(self.unowned)
5999- return result
6000-
6001-
6002-@dataclass
6003-class Unsafe:
6004- unsafe: int
6005-
6006- @staticmethod
6007- def from_dict(obj: Any) -> 'Unsafe':
6008- assert isinstance(obj, dict)
6009- unsafe = from_int(obj["unsafe"])
6010- return Unsafe(unsafe)
6011-
6012- def to_dict(self) -> dict:
6013- result: dict = {}
6014- result["unsafe"] = from_int(self.unsafe)
6015- return result
6016-
6017-
6018-@dataclass
6019-class UseSerializers:
6020- use_serializers: int
6021-
6022- @staticmethod
6023- def from_dict(obj: Any) -> 'UseSerializers':
6024- assert isinstance(obj, dict)
6025- use_serializers = from_int(obj["UseSerializers"])
6026- return UseSerializers(use_serializers)
6027-
6028- def to_dict(self) -> dict:
6029- result: dict = {}
6030- result["UseSerializers"] = from_int(self.use_serializers)
6031- return result
6032-
6033-
60345999 @dataclass
60356000 class Obj5:
60366001 k_serializer: KSerializer
60376002 primitive_kind: PrimitiveKind
6003+ sel: Sel
60386004 obj5_self: Self
60396005 sendable: Sendable
60406006 serial_descriptor: SerialDescriptor
@@ -6051,8 +6017,8 @@ class Obj5:
60516017 true: TrueClass
60526018 type: TypeClass
60536019 unmarshal_json: UnmarshalJSON
6054- use_serializers: UseSerializers
60556020 dummy: int
6021+ sealed: Sealed
60566022 select: Select
60576023 purple_self: SelfClass
60586024 serialize: Serialize
@@ -6097,14 +6063,13 @@ class Obj5:
60976063 unchecked: Unchecked
60986064 undefined: Undefined
60996065 union: UnionClass
6100- unowned: Unowned
6101- unsafe: Unsafe
61026066
61036067 @staticmethod
61046068 def from_dict(obj: Any) -> 'Obj5':
61056069 assert isinstance(obj, dict)
61066070 k_serializer = KSerializer.from_dict(obj["KSerializer"])
61076071 primitive_kind = PrimitiveKind.from_dict(obj["PrimitiveKind"])
6072+ sel = Sel.from_dict(obj["SEL"])
61086073 obj5_self = Self.from_dict(obj["Self"])
61096074 sendable = Sendable.from_dict(obj["Sendable"])
61106075 serial_descriptor = SerialDescriptor.from_dict(obj["SerialDescriptor"])
@@ -6121,8 +6086,8 @@ class Obj5:
61216086 true = TrueClass.from_dict(obj["True"])
61226087 type = TypeClass.from_dict(obj["Type"])
61236088 unmarshal_json = UnmarshalJSON.from_dict(obj["UnmarshalJSON"])
6124- use_serializers = UseSerializers.from_dict(obj["UseSerializers"])
61256089 dummy = from_int(obj["dummy"])
6090+ sealed = Sealed.from_dict(obj["sealed"])
61266091 select = Select.from_dict(obj["select"])
61276092 purple_self = SelfClass.from_dict(obj["self"])
61286093 serialize = Serialize.from_dict(obj["serialize"])
@@ -6167,14 +6132,13 @@ class Obj5:
61676132 unchecked = Unchecked.from_dict(obj["unchecked"])
61686133 undefined = Undefined.from_dict(obj["undefined"])
61696134 union = UnionClass.from_dict(obj["union"])
6170- unowned = Unowned.from_dict(obj["unowned"])
6171- unsafe = Unsafe.from_dict(obj["unsafe"])
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)
6135+ return Obj5(k_serializer, primitive_kind, sel, 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, dummy, sealed, 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)
61736136
61746137 def to_dict(self) -> dict:
61756138 result: dict = {}
61766139 result["KSerializer"] = to_class(KSerializer, self.k_serializer)
61776140 result["PrimitiveKind"] = to_class(PrimitiveKind, self.primitive_kind)
6141+ result["SEL"] = to_class(Sel, self.sel)
61786142 result["Self"] = to_class(Self, self.obj5_self)
61796143 result["Sendable"] = to_class(Sendable, self.sendable)
61806144 result["SerialDescriptor"] = to_class(SerialDescriptor, self.serial_descriptor)
@@ -6191,8 +6155,8 @@ class Obj5:
61916155 result["True"] = to_class(TrueClass, self.true)
61926156 result["Type"] = to_class(TypeClass, self.type)
61936157 result["UnmarshalJSON"] = to_class(UnmarshalJSON, self.unmarshal_json)
6194- result["UseSerializers"] = to_class(UseSerializers, self.use_serializers)
61956158 result["dummy"] = from_int(self.dummy)
6159+ result["sealed"] = to_class(Sealed, self.sealed)
61966160 result["select"] = to_class(Select, self.select)
61976161 result["self"] = to_class(SelfClass, self.purple_self)
61986162 result["serialize"] = to_class(Serialize, self.serialize)
@@ -6237,8 +6201,6 @@ class Obj5:
62376201 result["unchecked"] = to_class(Unchecked, self.unchecked)
62386202 result["undefined"] = to_class(Undefined, self.undefined)
62396203 result["union"] = to_class(UnionClass, self.union)
6240- result["unowned"] = to_class(Unowned, self.unowned)
6241- result["unsafe"] = to_class(Unsafe, self.unsafe)
62426204 return result
62436205
62446206
@@ -6290,6 +6252,38 @@ class Yield:
62906252 return result
62916253
62926254
6255+@dataclass
6256+class Unowned:
6257+ unowned: int
6258+
6259+ @staticmethod
6260+ def from_dict(obj: Any) -> 'Unowned':
6261+ assert isinstance(obj, dict)
6262+ unowned = from_int(obj["unowned"])
6263+ return Unowned(unowned)
6264+
6265+ def to_dict(self) -> dict:
6266+ result: dict = {}
6267+ result["unowned"] = from_int(self.unowned)
6268+ return result
6269+
6270+
6271+@dataclass
6272+class Unsafe:
6273+ unsafe: int
6274+
6275+ @staticmethod
6276+ def from_dict(obj: Any) -> 'Unsafe':
6277+ assert isinstance(obj, dict)
6278+ unsafe = from_int(obj["unsafe"])
6279+ return Unsafe(unsafe)
6280+
6281+ def to_dict(self) -> dict:
6282+ result: dict = {}
6283+ result["unsafe"] = from_int(self.unsafe)
6284+ return result
6285+
6286+
62936287 @dataclass
62946288 class Unsigned:
62956289 unsigned: int
@@ -6306,6 +6300,22 @@ class Unsigned:
63066300 return result
63076301
63086302
6303+@dataclass
6304+class UseSerializers:
6305+ use_serializers: int
6306+
6307+ @staticmethod
6308+ def from_dict(obj: Any) -> 'UseSerializers':
6309+ assert isinstance(obj, dict)
6310+ use_serializers = from_int(obj["UseSerializers"])
6311+ return UseSerializers(use_serializers)
6312+
6313+ def to_dict(self) -> dict:
6314+ result: dict = {}
6315+ result["UseSerializers"] = from_int(self.use_serializers)
6316+ return result
6317+
6318+
63096319 @dataclass
63106320 class Ushort:
63116321 ushort: int
@@ -6565,10 +6575,13 @@ class Yes:
65656575 @dataclass
65666576 class Obj6:
65676577 uuid: UUIDClass
6578+ use_serializers: UseSerializers
65686579 utf8_json_reader: Utf8JSONReader
65696580 utf8_json_writer: Utf8JSONWriter
65706581 yes: Yes
65716582 dummy: int
6583+ unowned: Unowned
6584+ unsafe: Unsafe
65726585 unsigned: Unsigned
65736586 ushort: Ushort
65746587 using: Using
@@ -6590,10 +6603,13 @@ class Obj6:
65906603 def from_dict(obj: Any) -> 'Obj6':
65916604 assert isinstance(obj, dict)
65926605 uuid = UUIDClass.from_dict(obj["UUID"])
6606+ use_serializers = UseSerializers.from_dict(obj["UseSerializers"])
65936607 utf8_json_reader = Utf8JSONReader.from_dict(obj["Utf8JsonReader"])
65946608 utf8_json_writer = Utf8JSONWriter.from_dict(obj["Utf8JsonWriter"])
65956609 yes = Yes.from_dict(obj["YES"])
65966610 dummy = from_int(obj["dummy"])
6611+ unowned = Unowned.from_dict(obj["unowned"])
6612+ unsafe = Unsafe.from_dict(obj["unsafe"])
65976613 unsigned = Unsigned.from_dict(obj["unsigned"])
65986614 ushort = Ushort.from_dict(obj["ushort"])
65996615 using = Using.from_dict(obj["using"])
@@ -6610,15 +6626,18 @@ class Obj6:
66106626 xor = Xor.from_dict(obj["xor"])
66116627 xor_eq = XorEq.from_dict(obj["xor_eq"])
66126628 obj6_yield = Yield.from_dict(obj["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)
6629+ return Obj6(uuid, use_serializers, utf8_json_reader, utf8_json_writer, yes, dummy, unowned, unsafe, unsigned, ushort, using, var, virtual, void, volatile, wchar_t, weak, where, obj6_while, will_set, obj6_with, xor, xor_eq, obj6_yield)
66146630
66156631 def to_dict(self) -> dict:
66166632 result: dict = {}
66176633 result["UUID"] = to_class(UUIDClass, self.uuid)
6634+ result["UseSerializers"] = to_class(UseSerializers, self.use_serializers)
66186635 result["Utf8JsonReader"] = to_class(Utf8JSONReader, self.utf8_json_reader)
66196636 result["Utf8JsonWriter"] = to_class(Utf8JSONWriter, self.utf8_json_writer)
66206637 result["YES"] = to_class(Yes, self.yes)
66216638 result["dummy"] = from_int(self.dummy)
6639+ result["unowned"] = to_class(Unowned, self.unowned)
6640+ result["unsafe"] = to_class(Unsafe, self.unsafe)
66226641 result["unsigned"] = to_class(Unsigned, self.unsigned)
66236642 result["ushort"] = to_class(Ushort, self.ushort)
66246643 result["using"] = to_class(Using, self.using)
Mrubydefault / TopLevel.rb+224 −196
@@ -4886,6 +4886,31 @@ class Long < Dry::Struct
48864886 end
48874887 end
48884888
4889+class MakeDictEncoder < Dry::Struct
4890+ attribute :make_dict_encoder, Types::Integer
4891+
4892+ def self.from_dynamic!(d)
4893+ d = Types::Hash[d]
4894+ new(
4895+ make_dict_encoder: d.fetch("makeDictEncoder"),
4896+ )
4897+ end
4898+
4899+ def self.from_json!(json)
4900+ from_dynamic!(JSON.parse(json))
4901+ end
4902+
4903+ def to_dynamic
4904+ {
4905+ "makeDictEncoder" => make_dict_encoder,
4906+ }
4907+ end
4908+
4909+ def to_json(options = nil)
4910+ JSON.generate(to_dynamic, options)
4911+ end
4912+end
4913+
48894914 class Map < Dry::Struct
48904915 attribute :map, Types::Integer
48914916
@@ -5111,31 +5136,6 @@ class Newtonsoft < Dry::Struct
51115136 end
51125137 end
51135138
5114-class No < Dry::Struct
5115- attribute :no, Types::Integer
5116-
5117- def self.from_dynamic!(d)
5118- d = Types::Hash[d]
5119- new(
5120- no: d.fetch("NO"),
5121- )
5122- end
5123-
5124- def self.from_json!(json)
5125- from_dynamic!(JSON.parse(json))
5126- end
5127-
5128- def to_dynamic
5129- {
5130- "NO" => no,
5131- }
5132- end
5133-
5134- def to_json(options = nil)
5135- JSON.generate(to_dynamic, options)
5136- end
5137-end
5138-
51395139 class If < Dry::Struct
51405140 attribute :if_if, Types::Integer
51415141
@@ -5261,31 +5261,6 @@ class New < Dry::Struct
52615261 end
52625262 end
52635263
5264-class Nil < Dry::Struct
5265- attribute :nil_nil, Types::Integer
5266-
5267- def self.from_dynamic!(d)
5268- d = Types::Hash[d]
5269- new(
5270- nil_nil: d.fetch("nil"),
5271- )
5272- end
5273-
5274- def self.from_json!(json)
5275- from_dynamic!(JSON.parse(json))
5276- end
5277-
5278- def to_dynamic
5279- {
5280- "nil" => nil_nil,
5281- }
5282- end
5283-
5284- def to_json(options = nil)
5285- JSON.generate(to_dynamic, options)
5286- end
5287-end
5288-
52895264 class Obj3 < Dry::Struct
52905265 attribute :dummy, Types::Integer
52915266 attribute :goto, Goto
@@ -5337,6 +5312,7 @@ class Obj3 < Dry::Struct
53375312 attribute :locale, Locale
53385313 attribute :lock, Lock
53395314 attribute :long, Long
5315+ attribute :make_dict_encoder, MakeDictEncoder
53405316 attribute :map, Map
53415317 attribute :map_entry, MapEntry
53425318 attribute :marshal_json, MarshalJSON
@@ -5346,13 +5322,11 @@ class Obj3 < Dry::Struct
53465322 attribute :namespace, Namespace
53475323 attribute :native, Native
53485324 attribute :newtonsoft, Newtonsoft
5349- attribute :no, No
53505325 attribute :obj3_if, If
53515326 attribute :obj3_in, In
53525327 attribute :obj3_lambda, Lambda
53535328 attribute :obj3_module, ModuleClass
53545329 attribute :obj3_new, New
5355- attribute :obj3_nil, Nil
53565330
53575331 def self.from_dynamic!(d)
53585332 d = Types::Hash[d]
@@ -5407,6 +5381,7 @@ class Obj3 < Dry::Struct
54075381 locale: Locale.from_dynamic!(d.fetch("Locale")),
54085382 lock: Lock.from_dynamic!(d.fetch("lock")),
54095383 long: Long.from_dynamic!(d.fetch("long")),
5384+ make_dict_encoder: MakeDictEncoder.from_dynamic!(d.fetch("makeDictEncoder")),
54105385 map: Map.from_dynamic!(d.fetch("map")),
54115386 map_entry: MapEntry.from_dynamic!(d.fetch("MapEntry")),
54125387 marshal_json: MarshalJSON.from_dynamic!(d.fetch("MarshalJSON")),
@@ -5416,13 +5391,11 @@ class Obj3 < Dry::Struct
54165391 namespace: Namespace.from_dynamic!(d.fetch("namespace")),
54175392 native: Native.from_dynamic!(d.fetch("native")),
54185393 newtonsoft: Newtonsoft.from_dynamic!(d.fetch("newtonsoft")),
5419- no: No.from_dynamic!(d.fetch("NO")),
54205394 obj3_if: If.from_dynamic!(d.fetch("if")),
54215395 obj3_in: In.from_dynamic!(d.fetch("in")),
54225396 obj3_lambda: Lambda.from_dynamic!(d.fetch("lambda")),
54235397 obj3_module: ModuleClass.from_dynamic!(d.fetch("module")),
54245398 obj3_new: New.from_dynamic!(d.fetch("new")),
5425- obj3_nil: Nil.from_dynamic!(d.fetch("nil")),
54265399 )
54275400 end
54285401
@@ -5482,6 +5455,7 @@ class Obj3 < Dry::Struct
54825455 "Locale" => locale.to_dynamic,
54835456 "lock" => lock.to_dynamic,
54845457 "long" => long.to_dynamic,
5458+ "makeDictEncoder" => make_dict_encoder.to_dynamic,
54855459 "map" => map.to_dynamic,
54865460 "MapEntry" => map_entry.to_dynamic,
54875461 "MarshalJSON" => marshal_json.to_dynamic,
@@ -5491,13 +5465,36 @@ class Obj3 < Dry::Struct
54915465 "namespace" => namespace.to_dynamic,
54925466 "native" => native.to_dynamic,
54935467 "newtonsoft" => newtonsoft.to_dynamic,
5494- "NO" => no.to_dynamic,
54955468 "if" => obj3_if.to_dynamic,
54965469 "in" => obj3_in.to_dynamic,
54975470 "lambda" => obj3_lambda.to_dynamic,
54985471 "module" => obj3_module.to_dynamic,
54995472 "new" => obj3_new.to_dynamic,
5500- "nil" => obj3_nil.to_dynamic,
5473+ }
5474+ end
5475+
5476+ def to_json(options = nil)
5477+ JSON.generate(to_dynamic, options)
5478+ end
5479+end
5480+
5481+class No < Dry::Struct
5482+ attribute :no, Types::Integer
5483+
5484+ def self.from_dynamic!(d)
5485+ d = Types::Hash[d]
5486+ new(
5487+ no: d.fetch("NO"),
5488+ )
5489+ end
5490+
5491+ def self.from_json!(json)
5492+ from_dynamic!(JSON.parse(json))
5493+ end
5494+
5495+ def to_dynamic
5496+ {
5497+ "NO" => no,
55015498 }
55025499 end
55035500
@@ -5831,6 +5828,31 @@ class Number < Dry::Struct
58315828 end
58325829 end
58335830
5831+class Nil < Dry::Struct
5832+ attribute :nil_nil, Types::Integer
5833+
5834+ def self.from_dynamic!(d)
5835+ d = Types::Hash[d]
5836+ new(
5837+ nil_nil: d.fetch("nil"),
5838+ )
5839+ end
5840+
5841+ def self.from_json!(json)
5842+ from_dynamic!(JSON.parse(json))
5843+ end
5844+
5845+ def to_dynamic
5846+ {
5847+ "nil" => nil_nil,
5848+ }
5849+ end
5850+
5851+ def to_json(options = nil)
5852+ JSON.generate(to_dynamic, options)
5853+ end
5854+end
5855+
58345856 class NoneClass < Dry::Struct
58355857 attribute :none, Types::Integer
58365858
@@ -7056,58 +7078,9 @@ class Sbyte < Dry::Struct
70567078 end
70577079 end
70587080
7059-class Sealed < Dry::Struct
7060- attribute :sealed, Types::Integer
7061-
7062- def self.from_dynamic!(d)
7063- d = Types::Hash[d]
7064- new(
7065- sealed: d.fetch("sealed"),
7066- )
7067- end
7068-
7069- def self.from_json!(json)
7070- from_dynamic!(JSON.parse(json))
7071- end
7072-
7073- def to_dynamic
7074- {
7075- "sealed" => sealed,
7076- }
7077- end
7078-
7079- def to_json(options = nil)
7080- JSON.generate(to_dynamic, options)
7081- end
7082-end
7083-
7084-class Sel < Dry::Struct
7085- attribute :sel, Types::Integer
7086-
7087- def self.from_dynamic!(d)
7088- d = Types::Hash[d]
7089- new(
7090- sel: d.fetch("SEL"),
7091- )
7092- end
7093-
7094- def self.from_json!(json)
7095- from_dynamic!(JSON.parse(json))
7096- end
7097-
7098- def to_dynamic
7099- {
7100- "SEL" => sel,
7101- }
7102- end
7103-
7104- def to_json(options = nil)
7105- JSON.generate(to_dynamic, options)
7106- end
7107-end
7108-
71097081 class Obj4 < Dry::Struct
71107082 attribute :dummy, Types::Integer
7083+ attribute :no, No
71117084 attribute :no_such_method, NoSuchMethod
71127085 attribute :noexcept, Noexcept
71137086 attribute :nonatomic, Nonatomic
@@ -7121,6 +7094,7 @@ class Obj4 < Dry::Struct
71217094 attribute :null, Null
71227095 attribute :nullptr, Nullptr
71237096 attribute :number, Number
7097+ attribute :obj4_nil, Nil
71247098 attribute :obj4_none, NoneClass
71257099 attribute :obj4_not, Not
71267100 attribute :obj4_null, NullClass
@@ -7170,13 +7144,12 @@ class Obj4 < Dry::Struct
71707144 attribute :runtime_type, RuntimeType
71717145 attribute :s, S
71727146 attribute :sbyte, Sbyte
7173- attribute :sealed, Sealed
7174- attribute :sel, Sel
71757147
71767148 def self.from_dynamic!(d)
71777149 d = Types::Hash[d]
71787150 new(
71797151 dummy: d.fetch("dummy"),
7152+ no: No.from_dynamic!(d.fetch("NO")),
71807153 no_such_method: NoSuchMethod.from_dynamic!(d.fetch("noSuchMethod")),
71817154 noexcept: Noexcept.from_dynamic!(d.fetch("noexcept")),
71827155 nonatomic: Nonatomic.from_dynamic!(d.fetch("nonatomic")),
@@ -7190,6 +7163,7 @@ class Obj4 < Dry::Struct
71907163 null: Null.from_dynamic!(d.fetch("NULL")),
71917164 nullptr: Nullptr.from_dynamic!(d.fetch("nullptr")),
71927165 number: Number.from_dynamic!(d.fetch("number")),
7166+ obj4_nil: Nil.from_dynamic!(d.fetch("nil")),
71937167 obj4_none: NoneClass.from_dynamic!(d.fetch("none")),
71947168 obj4_not: Not.from_dynamic!(d.fetch("not")),
71957169 obj4_null: NullClass.from_dynamic!(d.fetch("null")),
@@ -7239,8 +7213,6 @@ class Obj4 < Dry::Struct
72397213 runtime_type: RuntimeType.from_dynamic!(d.fetch("runtimeType")),
72407214 s: S.from_dynamic!(d.fetch("s")),
72417215 sbyte: Sbyte.from_dynamic!(d.fetch("sbyte")),
7242- sealed: Sealed.from_dynamic!(d.fetch("sealed")),
7243- sel: Sel.from_dynamic!(d.fetch("SEL")),
72447216 )
72457217 end
72467218
@@ -7251,6 +7223,7 @@ class Obj4 < Dry::Struct
72517223 def to_dynamic
72527224 {
72537225 "dummy" => dummy,
7226+ "NO" => no.to_dynamic,
72547227 "noSuchMethod" => no_such_method.to_dynamic,
72557228 "noexcept" => noexcept.to_dynamic,
72567229 "nonatomic" => nonatomic.to_dynamic,
@@ -7264,6 +7237,7 @@ class Obj4 < Dry::Struct
72647237 "NULL" => null.to_dynamic,
72657238 "nullptr" => nullptr.to_dynamic,
72667239 "number" => number.to_dynamic,
7240+ "nil" => obj4_nil.to_dynamic,
72677241 "none" => obj4_none.to_dynamic,
72687242 "not" => obj4_not.to_dynamic,
72697243 "null" => obj4_null.to_dynamic,
@@ -7313,8 +7287,6 @@ class Obj4 < Dry::Struct
73137287 "runtimeType" => runtime_type.to_dynamic,
73147288 "s" => s.to_dynamic,
73157289 "sbyte" => sbyte.to_dynamic,
7316- "sealed" => sealed.to_dynamic,
7317- "SEL" => sel.to_dynamic,
73187290 }
73197291 end
73207292
@@ -7623,6 +7595,56 @@ class PrimitiveKind < Dry::Struct
76237595 end
76247596 end
76257597
7598+class Sealed < Dry::Struct
7599+ attribute :sealed, Types::Integer
7600+
7601+ def self.from_dynamic!(d)
7602+ d = Types::Hash[d]
7603+ new(
7604+ sealed: d.fetch("sealed"),
7605+ )
7606+ end
7607+
7608+ def self.from_json!(json)
7609+ from_dynamic!(JSON.parse(json))
7610+ end
7611+
7612+ def to_dynamic
7613+ {
7614+ "sealed" => sealed,
7615+ }
7616+ end
7617+
7618+ def to_json(options = nil)
7619+ JSON.generate(to_dynamic, options)
7620+ end
7621+end
7622+
7623+class Sel < Dry::Struct
7624+ attribute :sel, Types::Integer
7625+
7626+ def self.from_dynamic!(d)
7627+ d = Types::Hash[d]
7628+ new(
7629+ sel: d.fetch("SEL"),
7630+ )
7631+ end
7632+
7633+ def self.from_json!(json)
7634+ from_dynamic!(JSON.parse(json))
7635+ end
7636+
7637+ def to_dynamic
7638+ {
7639+ "SEL" => sel,
7640+ }
7641+ end
7642+
7643+ def to_json(options = nil)
7644+ JSON.generate(to_dynamic, options)
7645+ end
7646+end
7647+
76267648 class Obj5Self < Dry::Struct
76277649 attribute :self_self, Types::Integer
76287650
@@ -8873,81 +8895,6 @@ class UnmarshalJSON < Dry::Struct
88738895 end
88748896 end
88758897
8876-class Unowned < Dry::Struct
8877- attribute :unowned, Types::Integer
8878-
8879- def self.from_dynamic!(d)
8880- d = Types::Hash[d]
8881- new(
8882- unowned: d.fetch("unowned"),
8883- )
8884- end
8885-
8886- def self.from_json!(json)
8887- from_dynamic!(JSON.parse(json))
8888- end
8889-
8890- def to_dynamic
8891- {
8892- "unowned" => unowned,
8893- }
8894- end
8895-
8896- def to_json(options = nil)
8897- JSON.generate(to_dynamic, options)
8898- end
8899-end
8900-
8901-class Unsafe < Dry::Struct
8902- attribute :unsafe, Types::Integer
8903-
8904- def self.from_dynamic!(d)
8905- d = Types::Hash[d]
8906- new(
8907- unsafe: d.fetch("unsafe"),
8908- )
8909- end
8910-
8911- def self.from_json!(json)
8912- from_dynamic!(JSON.parse(json))
8913- end
8914-
8915- def to_dynamic
8916- {
8917- "unsafe" => unsafe,
8918- }
8919- end
8920-
8921- def to_json(options = nil)
8922- JSON.generate(to_dynamic, options)
8923- end
8924-end
8925-
8926-class UseSerializers < Dry::Struct
8927- attribute :use_serializers, Types::Integer
8928-
8929- def self.from_dynamic!(d)
8930- d = Types::Hash[d]
8931- new(
8932- use_serializers: d.fetch("UseSerializers"),
8933- )
8934- end
8935-
8936- def self.from_json!(json)
8937- from_dynamic!(JSON.parse(json))
8938- end
8939-
8940- def to_dynamic
8941- {
8942- "UseSerializers" => use_serializers,
8943- }
8944- end
8945-
8946- def to_json(options = nil)
8947- JSON.generate(to_dynamic, options)
8948- end
8949-end
8950-
89518898 class Obj5 < Dry::Struct
89528899 attribute :dummy, Types::Integer
89538900 attribute :k_serializer, KSerializer
@@ -8962,6 +8909,8 @@ class Obj5 < Dry::Struct
89628909 attribute :obj5_try, Try
89638910 attribute :obj5_type, Type
89648911 attribute :primitive_kind, PrimitiveKind
8912+ attribute :sealed, Sealed
8913+ attribute :sel, Sel
89658914 attribute :self_1, Obj5Self
89668915 attribute :sendable, Sendable
89678916 attribute :serial_descriptor, SerialDescriptor
@@ -9012,9 +8961,6 @@ class Obj5 < Dry::Struct
90128961 attribute :undefined, UndefinedClass
90138962 attribute :union, Union
90148963 attribute :unmarshal_json, UnmarshalJSON
9015- attribute :unowned, Unowned
9016- attribute :unsafe, Unsafe
9017- attribute :use_serializers, UseSerializers
90188964
90198965 def self.from_dynamic!(d)
90208966 d = Types::Hash[d]
@@ -9032,6 +8978,8 @@ class Obj5 < Dry::Struct
90328978 obj5_try: Try.from_dynamic!(d.fetch("try")),
90338979 obj5_type: Type.from_dynamic!(d.fetch("Type")),
90348980 primitive_kind: PrimitiveKind.from_dynamic!(d.fetch("PrimitiveKind")),
8981+ sealed: Sealed.from_dynamic!(d.fetch("sealed")),
8982+ sel: Sel.from_dynamic!(d.fetch("SEL")),
90358983 self_1: Obj5Self.from_dynamic!(d.fetch("self")),
90368984 sendable: Sendable.from_dynamic!(d.fetch("Sendable")),
90378985 serial_descriptor: SerialDescriptor.from_dynamic!(d.fetch("SerialDescriptor")),
@@ -9082,9 +9030,6 @@ class Obj5 < Dry::Struct
90829030 undefined: UndefinedClass.from_dynamic!(d.fetch("undefined")),
90839031 union: Union.from_dynamic!(d.fetch("union")),
90849032 unmarshal_json: UnmarshalJSON.from_dynamic!(d.fetch("UnmarshalJSON")),
9085- unowned: Unowned.from_dynamic!(d.fetch("unowned")),
9086- unsafe: Unsafe.from_dynamic!(d.fetch("unsafe")),
9087- use_serializers: UseSerializers.from_dynamic!(d.fetch("UseSerializers")),
90889033 )
90899034 end
90909035
@@ -9107,6 +9052,8 @@ class Obj5 < Dry::Struct
91079052 "try" => obj5_try.to_dynamic,
91089053 "Type" => obj5_type.to_dynamic,
91099054 "PrimitiveKind" => primitive_kind.to_dynamic,
9055+ "sealed" => sealed.to_dynamic,
9056+ "SEL" => sel.to_dynamic,
91109057 "self" => self_1.to_dynamic,
91119058 "Sendable" => sendable.to_dynamic,
91129059 "SerialDescriptor" => serial_descriptor.to_dynamic,
@@ -9157,9 +9104,6 @@ class Obj5 < Dry::Struct
91579104 "undefined" => undefined.to_dynamic,
91589105 "union" => union.to_dynamic,
91599106 "UnmarshalJSON" => unmarshal_json.to_dynamic,
9160- "unowned" => unowned.to_dynamic,
9161- "unsafe" => unsafe.to_dynamic,
9162- "UseSerializers" => use_serializers.to_dynamic,
91639107 }
91649108 end
91659109
@@ -9243,6 +9187,56 @@ class Yield < Dry::Struct
92439187 end
92449188 end
92459189
9190+class Unowned < Dry::Struct
9191+ attribute :unowned, Types::Integer
9192+
9193+ def self.from_dynamic!(d)
9194+ d = Types::Hash[d]
9195+ new(
9196+ unowned: d.fetch("unowned"),
9197+ )
9198+ end
9199+
9200+ def self.from_json!(json)
9201+ from_dynamic!(JSON.parse(json))
9202+ end
9203+
9204+ def to_dynamic
9205+ {
9206+ "unowned" => unowned,
9207+ }
9208+ end
9209+
9210+ def to_json(options = nil)
9211+ JSON.generate(to_dynamic, options)
9212+ end
9213+end
9214+
9215+class Unsafe < Dry::Struct
9216+ attribute :unsafe, Types::Integer
9217+
9218+ def self.from_dynamic!(d)
9219+ d = Types::Hash[d]
9220+ new(
9221+ unsafe: d.fetch("unsafe"),
9222+ )
9223+ end
9224+
9225+ def self.from_json!(json)
9226+ from_dynamic!(JSON.parse(json))
9227+ end
9228+
9229+ def to_dynamic
9230+ {
9231+ "unsafe" => unsafe,
9232+ }
9233+ end
9234+
9235+ def to_json(options = nil)
9236+ JSON.generate(to_dynamic, options)
9237+ end
9238+end
9239+
92469240 class Unsigned < Dry::Struct
92479241 attribute :unsigned, Types::Integer
92489242
@@ -9268,6 +9262,31 @@ class Unsigned < Dry::Struct
92689262 end
92699263 end
92709264
9265+class UseSerializers < Dry::Struct
9266+ attribute :use_serializers, Types::Integer
9267+
9268+ def self.from_dynamic!(d)
9269+ d = Types::Hash[d]
9270+ new(
9271+ use_serializers: d.fetch("UseSerializers"),
9272+ )
9273+ end
9274+
9275+ def self.from_json!(json)
9276+ from_dynamic!(JSON.parse(json))
9277+ end
9278+
9279+ def to_dynamic
9280+ {
9281+ "UseSerializers" => use_serializers,
9282+ }
9283+ end
9284+
9285+ def to_json(options = nil)
9286+ JSON.generate(to_dynamic, options)
9287+ end
9288+end
9289+
92719290 class Ushort < Dry::Struct
92729291 attribute :ushort, Types::Integer
92739292
@@ -9673,7 +9692,10 @@ class Obj6 < Dry::Struct
96739692 attribute :obj6_while, While
96749693 attribute :obj6_with, With
96759694 attribute :obj6_yield, Yield
9695+ attribute :unowned, Unowned
9696+ attribute :unsafe, Unsafe
96769697 attribute :unsigned, Unsigned
9698+ attribute :use_serializers, UseSerializers
96779699 attribute :ushort, Ushort
96789700 attribute :using, Using
96799701 attribute :utf8_json_reader, Utf8JSONReader
@@ -9698,7 +9720,10 @@ class Obj6 < Dry::Struct
96989720 obj6_while: While.from_dynamic!(d.fetch("while")),
96999721 obj6_with: With.from_dynamic!(d.fetch("with")),
97009722 obj6_yield: Yield.from_dynamic!(d.fetch("yield")),
9723+ unowned: Unowned.from_dynamic!(d.fetch("unowned")),
9724+ unsafe: Unsafe.from_dynamic!(d.fetch("unsafe")),
97019725 unsigned: Unsigned.from_dynamic!(d.fetch("unsigned")),
9726+ use_serializers: UseSerializers.from_dynamic!(d.fetch("UseSerializers")),
97029727 ushort: Ushort.from_dynamic!(d.fetch("ushort")),
97039728 using: Using.from_dynamic!(d.fetch("using")),
97049729 utf8_json_reader: Utf8JSONReader.from_dynamic!(d.fetch("Utf8JsonReader")),
@@ -9728,7 +9753,10 @@ class Obj6 < Dry::Struct
97289753 "while" => obj6_while.to_dynamic,
97299754 "with" => obj6_with.to_dynamic,
97309755 "yield" => obj6_yield.to_dynamic,
9756+ "unowned" => unowned.to_dynamic,
9757+ "unsafe" => unsafe.to_dynamic,
97319758 "unsigned" => unsigned.to_dynamic,
9759+ "UseSerializers" => use_serializers.to_dynamic,
97329760 "ushort" => ushort.to_dynamic,
97339761 "using" => using.to_dynamic,
97349762 "Utf8JsonReader" => utf8_json_reader.to_dynamic,
Mrustdefault / module_under_test.rs+64 −55
@@ -1152,6 +1152,9 @@ pub struct Obj3 {
11521152
11531153 pub long: Long,
11541154
1155+ #[serde(rename = "makeDictEncoder")]
1156+ pub make_dict_encoder: MakeDictEncoder,
1157+
11551158 pub map: Map,
11561159
11571160 #[serde(rename = "MapEntry")]
@@ -1176,11 +1179,6 @@ pub struct Obj3 {
11761179
11771180 pub newtonsoft: Newtonsoft,
11781181
1179- pub nil: Nil,
1180-
1181- #[serde(rename = "NO")]
1182- pub no: No,
1183-
11841182 #[serde(rename = "if")]
11851183 pub obj3_if: If,
11861184
@@ -1459,6 +1457,12 @@ pub struct Long {
14591457 pub long: i64,
14601458 }
14611459
1460+#[derive(Debug, Clone, Serialize, Deserialize)]
1461+#[serde(rename_all = "camelCase")]
1462+pub struct MakeDictEncoder {
1463+ pub make_dict_encoder: i64,
1464+}
1465+
14621466 #[derive(Debug, Clone, Serialize, Deserialize)]
14631467 pub struct Map {
14641468 pub map: i64,
@@ -1517,17 +1521,6 @@ pub struct Newtonsoft {
15171521 pub newtonsoft: i64,
15181522 }
15191523
1520-#[derive(Debug, Clone, Serialize, Deserialize)]
1521-pub struct Nil {
1522- pub nil: i64,
1523-}
1524-
1525-#[derive(Debug, Clone, Serialize, Deserialize)]
1526-#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1527-pub struct No {
1528- pub no: i64,
1529-}
1530-
15311524 #[derive(Debug, Clone, Serialize, Deserialize)]
15321525 pub struct If {
15331526 #[serde(rename = "if")]
@@ -1550,6 +1543,11 @@ pub struct Let {
15501543 pub struct Obj4 {
15511544 pub dummy: i64,
15521545
1546+ pub nil: Nil,
1547+
1548+ #[serde(rename = "NO")]
1549+ pub no: No,
1550+
15531551 #[serde(rename = "noSuchMethod")]
15541552 pub no_such_method: NoSuchMethod,
15551553
@@ -1690,11 +1688,17 @@ pub struct Obj4 {
16901688 pub s: S,
16911689
16921690 pub sbyte: Sbyte,
1691+}
16931692
1694- pub sealed: Sealed,
1693+#[derive(Debug, Clone, Serialize, Deserialize)]
1694+pub struct Nil {
1695+ pub nil: i64,
1696+}
16951697
1696- #[serde(rename = "SEL")]
1697- pub sel: Sel,
1698+#[derive(Debug, Clone, Serialize, Deserialize)]
1699+#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1700+pub struct No {
1701+ pub no: i64,
16981702 }
16991703
17001704 #[derive(Debug, Clone, Serialize, Deserialize)]
@@ -2024,17 +2028,6 @@ pub struct Sbyte {
20242028 pub sbyte: i64,
20252029 }
20262030
2027-#[derive(Debug, Clone, Serialize, Deserialize)]
2028-pub struct Sealed {
2029- pub sealed: i64,
2030-}
2031-
2032-#[derive(Debug, Clone, Serialize, Deserialize)]
2033-#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2034-pub struct Sel {
2035- pub sel: i64,
2036-}
2037-
20382031 #[derive(Debug, Clone, Serialize, Deserialize)]
20392032 pub struct Obj5 {
20402033 pub dummy: i64,
@@ -2069,9 +2062,6 @@ pub struct Obj5 {
20692062 #[serde(rename = "union")]
20702063 pub obj5_union: Union,
20712064
2072- #[serde(rename = "unsafe")]
2073- pub obj5_unsafe: Unsafe,
2074-
20752065 #[serde(rename = "PrimitiveKind")]
20762066 pub primitive_kind: PrimitiveKind,
20772067
@@ -2084,6 +2074,11 @@ pub struct Obj5 {
20842074 #[serde(rename = "type")]
20852075 pub purple_type: TypeClass,
20862076
2077+ pub sealed: Sealed,
2078+
2079+ #[serde(rename = "SEL")]
2080+ pub sel: Sel,
2081+
20872082 pub select: Select,
20882083
20892084 #[serde(rename = "Sendable")]
@@ -2193,11 +2188,6 @@ pub struct Obj5 {
21932188
21942189 #[serde(rename = "UnmarshalJSON")]
21952190 pub unmarshal_json: UnmarshalJson,
2196-
2197- pub unowned: Unowned,
2198-
2199- #[serde(rename = "UseSerializers")]
2200- pub use_serializers: UseSerializers,
22012191 }
22022192
22032193 #[derive(Debug, Clone, Serialize, Deserialize)]
@@ -2263,12 +2253,6 @@ pub struct Union {
22632253 pub union_union: i64,
22642254 }
22652255
2266-#[derive(Debug, Clone, Serialize, Deserialize)]
2267-pub struct Unsafe {
2268- #[serde(rename = "unsafe")]
2269- pub unsafe_unsafe: i64,
2270-}
2271-
22722256 #[derive(Debug, Clone, Serialize, Deserialize)]
22732257 #[serde(rename_all = "PascalCase")]
22742258 pub struct PrimitiveKind {
@@ -2293,6 +2277,17 @@ pub struct TypeClass {
22932277 pub type_type: i64,
22942278 }
22952279
2280+#[derive(Debug, Clone, Serialize, Deserialize)]
2281+pub struct Sealed {
2282+ pub sealed: i64,
2283+}
2284+
2285+#[derive(Debug, Clone, Serialize, Deserialize)]
2286+#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2287+pub struct Sel {
2288+ pub sel: i64,
2289+}
2290+
22962291 #[derive(Debug, Clone, Serialize, Deserialize)]
22972292 pub struct Select {
22982293 pub select: i64,
@@ -2548,21 +2543,13 @@ pub struct UnmarshalJson {
25482543 pub unmarshal_json: i64,
25492544 }
25502545
2551-#[derive(Debug, Clone, Serialize, Deserialize)]
2552-pub struct Unowned {
2553- pub unowned: i64,
2554-}
2555-
2556-#[derive(Debug, Clone, Serialize, Deserialize)]
2557-#[serde(rename_all = "PascalCase")]
2558-pub struct UseSerializers {
2559- pub use_serializers: i64,
2560-}
2561-
25622546 #[derive(Debug, Clone, Serialize, Deserialize)]
25632547 pub struct Obj6 {
25642548 pub dummy: i64,
25652549
2550+ #[serde(rename = "unsafe")]
2551+ pub obj6_unsafe: Unsafe,
2552+
25662553 #[serde(rename = "virtual")]
25672554 pub obj6_virtual: Virtual,
25682555
@@ -2575,8 +2562,13 @@ pub struct Obj6 {
25752562 #[serde(rename = "yield")]
25762563 pub obj6_yield: Yield,
25772564
2565+ pub unowned: Unowned,
2566+
25782567 pub unsigned: Unsigned,
25792568
2569+ #[serde(rename = "UseSerializers")]
2570+ pub use_serializers: UseSerializers,
2571+
25802572 pub ushort: Ushort,
25812573
25822574 pub using: Using,
@@ -2613,6 +2605,12 @@ pub struct Obj6 {
26132605 pub yes: Yes,
26142606 }
26152607
2608+#[derive(Debug, Clone, Serialize, Deserialize)]
2609+pub struct Unsafe {
2610+ #[serde(rename = "unsafe")]
2611+ pub unsafe_unsafe: i64,
2612+}
2613+
26162614 #[derive(Debug, Clone, Serialize, Deserialize)]
26172615 pub struct Virtual {
26182616 #[serde(rename = "virtual")]
@@ -2637,11 +2635,22 @@ pub struct Yield {
26372635 pub yield_yield: i64,
26382636 }
26392637
2638+#[derive(Debug, Clone, Serialize, Deserialize)]
2639+pub struct Unowned {
2640+ pub unowned: i64,
2641+}
2642+
26402643 #[derive(Debug, Clone, Serialize, Deserialize)]
26412644 pub struct Unsigned {
26422645 pub unsigned: i64,
26432646 }
26442647
2648+#[derive(Debug, Clone, Serialize, Deserialize)]
2649+#[serde(rename_all = "PascalCase")]
2650+pub struct UseSerializers {
2651+ pub use_serializers: i64,
2652+}
2653+
26452654 #[derive(Debug, Clone, Serialize, Deserialize)]
26462655 pub struct Ushort {
26472656 pub ushort: i64,
Mscala3-upickledefault / TopLevel.scala+42 −37
@@ -807,6 +807,7 @@ case class Obj3 (
807807 val Locale : Locale,
808808 val lock : Lock,
809809 val long : LongClass,
810+ val makeDictEncoder : MakeDictEncoder,
810811 val map : MapClass,
811812 val MapEntry : MapEntry,
812813 val MarshalJSON : MarshalJSON,
@@ -817,8 +818,6 @@ case class Obj3 (
817818 val namespace : Namespace,
818819 val native : Native,
819820 val newtonsoft : Newtonsoft,
820- val nil : Nil,
821- val NO : No,
822821 val `if` : If,
823822 val `implicit` : Implicit,
824823 val `import` : Import,
@@ -1019,6 +1018,10 @@ case class LongClass (
10191018 val long : Long
10201019 ) derives OptionPickler.ReadWriter
10211020
1021+case class MakeDictEncoder (
1022+ val makeDictEncoder : Long
1023+) derives OptionPickler.ReadWriter
1024+
10221025 case class MapClass (
10231026 val map : Long
10241027 ) derives OptionPickler.ReadWriter
@@ -1059,14 +1062,6 @@ case class Newtonsoft (
10591062 val newtonsoft : Long
10601063 ) derives OptionPickler.ReadWriter
10611064
1062-case class Nil (
1063- val nil : Long
1064-) derives OptionPickler.ReadWriter
1065-
1066-case class No (
1067- val NO : Long
1068-) derives OptionPickler.ReadWriter
1069-
10701065 case class If (
10711066 val `if` : Long
10721067 ) derives OptionPickler.ReadWriter
@@ -1089,6 +1084,8 @@ case class New (
10891084
10901085 case class Obj4 (
10911086 val dummy : Long,
1087+ val nil : Nil,
1088+ val NO : No,
10921089 val noSuchMethod : NoSuchMethod,
10931090 val noexcept : Noexcept,
10941091 val nonatomic : Nonatomic,
@@ -1112,7 +1109,6 @@ case class Obj4 (
11121109 val `protected` : Protected,
11131110 val protocol : ProtocolClass,
11141111 val `return` : Return,
1115- val `sealed` : Sealed,
11161112 val ObjectMapper : ObjectMapper,
11171113 val of : Of,
11181114 val oneway : Oneway,
@@ -1151,8 +1147,15 @@ case class Obj4 (
11511147 val right : Right,
11521148 val runtimeType : RuntimeType,
11531149 val s : S,
1154- val sbyte : Sbyte,
1155- val SEL : Sel
1150+ val sbyte : Sbyte
1151+) derives OptionPickler.ReadWriter
1152+
1153+case class Nil (
1154+ val nil : Long
1155+) derives OptionPickler.ReadWriter
1156+
1157+case class No (
1158+ val NO : Long
11561159 ) derives OptionPickler.ReadWriter
11571160
11581161 case class NoSuchMethod (
@@ -1247,10 +1250,6 @@ case class Return (
12471250 val `return` : Long
12481251 ) derives OptionPickler.ReadWriter
12491252
1250-case class Sealed (
1251- val `sealed` : Long
1252-) derives OptionPickler.ReadWriter
1253-
12541253 case class ObjectMapper (
12551254 val ObjectMapper : Long
12561255 ) derives OptionPickler.ReadWriter
@@ -1407,13 +1406,10 @@ case class Sbyte (
14071406 val sbyte : Long
14081407 ) derives OptionPickler.ReadWriter
14091408
1410-case class Sel (
1411- val SEL : Long
1412-) derives OptionPickler.ReadWriter
1413-
14141409 case class Obj5 (
14151410 val dummy : Long,
14161411 val KSerializer : KSerializer,
1412+ val `sealed` : Sealed,
14171413 val self : SelfClass,
14181414 val `super` : Super,
14191415 val `then` : Then,
@@ -1425,6 +1421,7 @@ case class Obj5 (
14251421 val PrimitiveKind : PrimitiveKind,
14261422 val `true` : TrueClass,
14271423 val `type` : TypeClass,
1424+ val SEL : Sel,
14281425 val select : Select,
14291426 val Self : Self,
14301427 val Sendable : Sendable,
@@ -1476,16 +1473,17 @@ case class Obj5 (
14761473 val unchecked : Unchecked,
14771474 val undefined : Undefined,
14781475 val union : Union,
1479- val UnmarshalJSON : UnmarshalJSON,
1480- val unowned : Unowned,
1481- val unsafe : Unsafe,
1482- val UseSerializers : UseSerializers
1476+ val UnmarshalJSON : UnmarshalJSON
14831477 ) derives OptionPickler.ReadWriter
14841478
14851479 case class KSerializer (
14861480 val KSerializer : Long
14871481 ) derives OptionPickler.ReadWriter
14881482
1483+case class Sealed (
1484+ val `sealed` : Long
1485+) derives OptionPickler.ReadWriter
1486+
14891487 case class SelfClass (
14901488 val self : Long
14911489 ) derives OptionPickler.ReadWriter
@@ -1530,6 +1528,10 @@ case class TypeClass (
15301528 val `type` : Long
15311529 ) derives OptionPickler.ReadWriter
15321530
1531+case class Sel (
1532+ val SEL : Long
1533+) derives OptionPickler.ReadWriter
1534+
15331535 case class Select (
15341536 val select : Long
15351537 ) derives OptionPickler.ReadWriter
@@ -1732,25 +1734,16 @@ case class UnmarshalJSON (
17321734 val UnmarshalJSON : Long
17331735 ) derives OptionPickler.ReadWriter
17341736
1735-case class Unowned (
1736- val unowned : Long
1737-) derives OptionPickler.ReadWriter
1738-
1739-case class Unsafe (
1740- val unsafe : Long
1741-) derives OptionPickler.ReadWriter
1742-
1743-case class UseSerializers (
1744- val UseSerializers : Long
1745-) derives OptionPickler.ReadWriter
1746-
17471737 case class Obj6 (
17481738 val dummy : Long,
17491739 val `var` : Var,
17501740 val `while` : While,
17511741 val `with` : With,
17521742 val `yield` : Yield,
1743+ val unowned : Unowned,
1744+ val unsafe : Unsafe,
17531745 val unsigned : Unsigned,
1746+ val UseSerializers : UseSerializers,
17541747 val ushort : Ushort,
17551748 val using : Using,
17561749 val Utf8JsonReader : Utf8JSONReader,
@@ -1784,10 +1777,22 @@ case class Yield (
17841777 val `yield` : Long
17851778 ) derives OptionPickler.ReadWriter
17861779
1780+case class Unowned (
1781+ val unowned : Long
1782+) derives OptionPickler.ReadWriter
1783+
1784+case class Unsafe (
1785+ val unsafe : Long
1786+) derives OptionPickler.ReadWriter
1787+
17871788 case class Unsigned (
17881789 val unsigned : Long
17891790 ) derives OptionPickler.ReadWriter
17901791
1792+case class UseSerializers (
1793+ val UseSerializers : Long
1794+) derives OptionPickler.ReadWriter
1795+
17911796 case class Ushort (
17921797 val ushort : Long
17931798 ) derives OptionPickler.ReadWriter
Mscala3default / TopLevel.scala+42 −37
@@ -757,6 +757,7 @@ case class Obj3 (
757757 val Locale : Locale,
758758 val lock : Lock,
759759 val long : LongClass,
760+ val makeDictEncoder : MakeDictEncoder,
760761 val map : MapClass,
761762 val MapEntry : MapEntry,
762763 val MarshalJSON : MarshalJSON,
@@ -767,8 +768,6 @@ case class Obj3 (
767768 val namespace : Namespace,
768769 val native : Native,
769770 val newtonsoft : Newtonsoft,
770- val nil : Nil,
771- val NO : No,
772771 val `if` : If,
773772 val `implicit` : Implicit,
774773 val `import` : Import,
@@ -986,6 +985,10 @@ case class LongClass (
986985 val long : Long
987986 ) derives Encoder.AsObject, Decoder
988987
988+case class MakeDictEncoder (
989+ val makeDictEncoder : Long
990+) derives Encoder.AsObject, Decoder
991+
989992 case class MapClass (
990993 val map : Long
991994 ) derives Encoder.AsObject, Decoder
@@ -1026,14 +1029,6 @@ case class Newtonsoft (
10261029 val newtonsoft : Long
10271030 ) derives Encoder.AsObject, Decoder
10281031
1029-case class Nil (
1030- val nil : Long
1031-) derives Encoder.AsObject, Decoder
1032-
1033-case class No (
1034- val NO : Long
1035-) derives Encoder.AsObject, Decoder
1036-
10371032 case class If (
10381033 val `if` : Long
10391034 ) derives Encoder.AsObject, Decoder
@@ -1056,6 +1051,8 @@ case class New (
10561051
10571052 case class Obj4 (
10581053 val dummy : Long,
1054+ val nil : Nil,
1055+ val NO : No,
10591056 val noSuchMethod : NoSuchMethod,
10601057 val noexcept : Noexcept,
10611058 val nonatomic : Nonatomic,
@@ -1079,7 +1076,6 @@ case class Obj4 (
10791076 val `protected` : Protected,
10801077 val protocol : ProtocolClass,
10811078 val `return` : Return,
1082- val `sealed` : Sealed,
10831079 val ObjectMapper : ObjectMapper,
10841080 val of : Of,
10851081 val oneway : Oneway,
@@ -1118,8 +1114,15 @@ case class Obj4 (
11181114 val right : Right,
11191115 val runtimeType : RuntimeType,
11201116 val s : S,
1121- val sbyte : Sbyte,
1122- val SEL : Sel
1117+ val sbyte : Sbyte
1118+) derives Encoder.AsObject, Decoder
1119+
1120+case class Nil (
1121+ val nil : Long
1122+) derives Encoder.AsObject, Decoder
1123+
1124+case class No (
1125+ val NO : Long
11231126 ) derives Encoder.AsObject, Decoder
11241127
11251128 case class NoSuchMethod (
@@ -1214,10 +1217,6 @@ case class Return (
12141217 val `return` : Long
12151218 ) derives Encoder.AsObject, Decoder
12161219
1217-case class Sealed (
1218- val `sealed` : Long
1219-) derives Encoder.AsObject, Decoder
1220-
12211220 case class ObjectMapper (
12221221 val ObjectMapper : Long
12231222 ) derives Encoder.AsObject, Decoder
@@ -1374,13 +1373,10 @@ case class Sbyte (
13741373 val sbyte : Long
13751374 ) derives Encoder.AsObject, Decoder
13761375
1377-case class Sel (
1378- val SEL : Long
1379-) derives Encoder.AsObject, Decoder
1380-
13811376 case class Obj5 (
13821377 val dummy : Long,
13831378 val KSerializer : KSerializer,
1379+ val `sealed` : Sealed,
13841380 val self : SelfClass,
13851381 val `super` : Super,
13861382 val `then` : Then,
@@ -1392,6 +1388,7 @@ case class Obj5 (
13921388 val PrimitiveKind : PrimitiveKind,
13931389 val `true` : TrueClass,
13941390 val `type` : TypeClass,
1391+ val SEL : Sel,
13951392 val select : Select,
13961393 val Self : Self,
13971394 val Sendable : Sendable,
@@ -1441,10 +1438,7 @@ case class Obj5 (
14411438 val unchecked : Unchecked,
14421439 val undefined : Undefined,
14431440 val union : Union,
1444- val UnmarshalJSON : UnmarshalJSON,
1445- val unowned : Unowned,
1446- val unsafe : Unsafe,
1447- val UseSerializers : UseSerializers
1441+ val UnmarshalJSON : UnmarshalJSON
14481442 )
14491443
14501444 object Obj5:
@@ -1461,6 +1455,10 @@ case class KSerializer (
14611455 val KSerializer : Long
14621456 ) derives Encoder.AsObject, Decoder
14631457
1458+case class Sealed (
1459+ val `sealed` : Long
1460+) derives Encoder.AsObject, Decoder
1461+
14641462 case class SelfClass (
14651463 val self : Long
14661464 ) derives Encoder.AsObject, Decoder
@@ -1505,6 +1503,10 @@ case class TypeClass (
15051503 val `type` : Long
15061504 ) derives Encoder.AsObject, Decoder
15071505
1506+case class Sel (
1507+ val SEL : Long
1508+) derives Encoder.AsObject, Decoder
1509+
15081510 case class Select (
15091511 val select : Long
15101512 ) derives Encoder.AsObject, Decoder
@@ -1723,25 +1725,16 @@ case class UnmarshalJSON (
17231725 val UnmarshalJSON : Long
17241726 ) derives Encoder.AsObject, Decoder
17251727
1726-case class Unowned (
1727- val unowned : Long
1728-) derives Encoder.AsObject, Decoder
1729-
1730-case class Unsafe (
1731- val unsafe : Long
1732-) derives Encoder.AsObject, Decoder
1733-
1734-case class UseSerializers (
1735- val UseSerializers : Long
1736-) derives Encoder.AsObject, Decoder
1737-
17381728 case class Obj6 (
17391729 val dummy : Long,
17401730 val `var` : Var,
17411731 val `while` : While,
17421732 val `with` : With,
17431733 val `yield` : Yield,
1734+ val unowned : Unowned,
1735+ val unsafe : Unsafe,
17441736 val unsigned : Unsigned,
1737+ val UseSerializers : UseSerializers,
17451738 val ushort : Ushort,
17461739 val using : Using,
17471740 val Utf8JsonReader : Utf8JSONReader,
@@ -1775,10 +1768,22 @@ case class Yield (
17751768 val `yield` : Long
17761769 ) derives Encoder.AsObject, Decoder
17771770
1771+case class Unowned (
1772+ val unowned : Long
1773+) derives Encoder.AsObject, Decoder
1774+
1775+case class Unsafe (
1776+ val unsafe : Long
1777+) derives Encoder.AsObject, Decoder
1778+
17781779 case class Unsigned (
17791780 val unsigned : Long
17801781 ) derives Encoder.AsObject, Decoder
17811782
1783+case class UseSerializers (
1784+ val UseSerializers : Long
1785+) derives Encoder.AsObject, Decoder
1786+
17821787 case class Ushort (
17831788 val ushort : Long
17841789 ) derives Encoder.AsObject, Decoder
Mswiftdefault / quicktype.swift+390 −342
@@ -6351,6 +6351,7 @@ struct Obj3: Codable {
63516351 let locale: LocaleClass
63526352 let lock: Lock
63536353 let long: Long
6354+ let makeDictEncoder: MakeDictEncoder
63546355 let map: Map
63556356 let mapEntry: MapEntry
63566357 let marshalJSON: MarshalJSON
@@ -6361,7 +6362,6 @@ struct Obj3: Codable {
63616362 let native: Native
63626363 let new: New
63636364 let newtonsoft: Newtonsoft
6364- let no: No
63656365 let obj3Guard: Guard
63666366 let obj3If: If
63676367 let obj3Import: Import
@@ -6377,7 +6377,6 @@ struct Obj3: Codable {
63776377 let obj3Left: Left
63786378 let obj3Let: Let
63796379 let obj3Mutating: Mutating
6380- let obj3Nil: Nil
63816380
63826381 enum CodingKeys: String, CodingKey {
63836382 case dummy = "dummy"
@@ -6419,6 +6418,7 @@ struct Obj3: Codable {
64196418 case locale = "Locale"
64206419 case lock = "lock"
64216420 case long = "long"
6421+ case makeDictEncoder = "makeDictEncoder"
64226422 case map = "map"
64236423 case mapEntry = "MapEntry"
64246424 case marshalJSON = "MarshalJSON"
@@ -6429,7 +6429,6 @@ struct Obj3: Codable {
64296429 case native = "native"
64306430 case new = "new"
64316431 case newtonsoft = "newtonsoft"
6432- case no = "NO"
64336432 case obj3Guard = "guard"
64346433 case obj3If = "if"
64356434 case obj3Import = "import"
@@ -6445,7 +6444,6 @@ struct Obj3: Codable {
64456444 case obj3Left = "left"
64466445 case obj3Let = "let"
64476446 case obj3Mutating = "mutating"
6448- case obj3Nil = "nil"
64496447 }
64506448 }
64516449
@@ -6507,6 +6505,7 @@ extension Obj3 {
65076505 locale: LocaleClass? = nil,
65086506 lock: Lock? = nil,
65096507 long: Long? = nil,
6508+ makeDictEncoder: MakeDictEncoder? = nil,
65106509 map: Map? = nil,
65116510 mapEntry: MapEntry? = nil,
65126511 marshalJSON: MarshalJSON? = nil,
@@ -6517,7 +6516,6 @@ extension Obj3 {
65176516 native: Native? = nil,
65186517 new: New? = nil,
65196518 newtonsoft: Newtonsoft? = nil,
6520- no: No? = nil,
65216519 obj3Guard: Guard? = nil,
65226520 obj3If: If? = nil,
65236521 obj3Import: Import? = nil,
@@ -6532,8 +6530,7 @@ extension Obj3 {
65326530 obj3Lazy: Lazy? = nil,
65336531 obj3Left: Left? = nil,
65346532 obj3Let: Let? = nil,
6535- obj3Mutating: Mutating? = nil,
6536- obj3Nil: Nil? = nil
6533+ obj3Mutating: Mutating? = nil
65376534 ) -> Obj3 {
65386535 return Obj3(
65396536 dummy: dummy ?? self.dummy,
@@ -6575,6 +6572,7 @@ extension Obj3 {
65756572 locale: locale ?? self.locale,
65766573 lock: lock ?? self.lock,
65776574 long: long ?? self.long,
6575+ makeDictEncoder: makeDictEncoder ?? self.makeDictEncoder,
65786576 map: map ?? self.map,
65796577 mapEntry: mapEntry ?? self.mapEntry,
65806578 marshalJSON: marshalJSON ?? self.marshalJSON,
@@ -6585,7 +6583,6 @@ extension Obj3 {
65856583 native: native ?? self.native,
65866584 new: new ?? self.new,
65876585 newtonsoft: newtonsoft ?? self.newtonsoft,
6588- no: no ?? self.no,
65896586 obj3Guard: obj3Guard ?? self.obj3Guard,
65906587 obj3If: obj3If ?? self.obj3If,
65916588 obj3Import: obj3Import ?? self.obj3Import,
@@ -6600,8 +6597,7 @@ extension Obj3 {
66006597 obj3Lazy: obj3Lazy ?? self.obj3Lazy,
66016598 obj3Left: obj3Left ?? self.obj3Left,
66026599 obj3Let: obj3Let ?? self.obj3Let,
6603- obj3Mutating: obj3Mutating ?? self.obj3Mutating,
6604- obj3Nil: obj3Nil ?? self.obj3Nil
6600+ obj3Mutating: obj3Mutating ?? self.obj3Mutating
66056601 )
66066602 }
66076603
@@ -8286,6 +8282,50 @@ extension Long {
82868282 }
82878283 }
82888284
8285+// MARK: - MakeDictEncoder
8286+struct MakeDictEncoder: Codable {
8287+ let makeDictEncoder: Int
8288+
8289+ enum CodingKeys: String, CodingKey {
8290+ case makeDictEncoder = "makeDictEncoder"
8291+ }
8292+}
8293+
8294+// MARK: MakeDictEncoder convenience initializers and mutators
8295+
8296+extension MakeDictEncoder {
8297+ init(data: Data) throws {
8298+ self = try newJSONDecoder().decode(MakeDictEncoder.self, from: data)
8299+ }
8300+
8301+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
8302+ guard let data = json.data(using: encoding) else {
8303+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
8304+ }
8305+ try self.init(data: data)
8306+ }
8307+
8308+ init(fromURL url: URL) throws {
8309+ try self.init(data: try Data(contentsOf: url))
8310+ }
8311+
8312+ func with(
8313+ makeDictEncoder: Int? = nil
8314+ ) -> MakeDictEncoder {
8315+ return MakeDictEncoder(
8316+ makeDictEncoder: makeDictEncoder ?? self.makeDictEncoder
8317+ )
8318+ }
8319+
8320+ func jsonData() throws -> Data {
8321+ return try newJSONEncoder().encode(self)
8322+ }
8323+
8324+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
8325+ return String(data: try self.jsonData(), encoding: encoding)
8326+ }
8327+}
8328+
82898329 // MARK: - Map
82908330 struct Map: Codable {
82918331 let map: Int
@@ -8726,50 +8766,6 @@ extension Newtonsoft {
87268766 }
87278767 }
87288768
8729-// MARK: - No
8730-struct No: Codable {
8731- let no: Int
8732-
8733- enum CodingKeys: String, CodingKey {
8734- case no = "NO"
8735- }
8736-}
8737-
8738-// MARK: No convenience initializers and mutators
8739-
8740-extension No {
8741- init(data: Data) throws {
8742- self = try newJSONDecoder().decode(No.self, from: data)
8743- }
8744-
8745- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
8746- guard let data = json.data(using: encoding) else {
8747- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
8748- }
8749- try self.init(data: data)
8750- }
8751-
8752- init(fromURL url: URL) throws {
8753- try self.init(data: try Data(contentsOf: url))
8754- }
8755-
8756- func with(
8757- no: Int? = nil
8758- ) -> No {
8759- return No(
8760- no: no ?? self.no
8761- )
8762- }
8763-
8764- func jsonData() throws -> Data {
8765- return try newJSONEncoder().encode(self)
8766- }
8767-
8768- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
8769- return String(data: try self.jsonData(), encoding: encoding)
8770- }
8771-}
8772-
87738769 // MARK: - Guard
87748770 struct Guard: Codable {
87758771 let guardGuard: Int
@@ -9430,53 +9426,10 @@ extension Mutating {
94309426 }
94319427 }
94329428
9433-// MARK: - Nil
9434-struct Nil: Codable {
9435- let nilNil: Int
9436-
9437- enum CodingKeys: String, CodingKey {
9438- case nilNil = "nil"
9439- }
9440-}
9441-
9442-// MARK: Nil convenience initializers and mutators
9443-
9444-extension Nil {
9445- init(data: Data) throws {
9446- self = try newJSONDecoder().decode(Nil.self, from: data)
9447- }
9448-
9449- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
9450- guard let data = json.data(using: encoding) else {
9451- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
9452- }
9453- try self.init(data: data)
9454- }
9455-
9456- init(fromURL url: URL) throws {
9457- try self.init(data: try Data(contentsOf: url))
9458- }
9459-
9460- func with(
9461- nilNil: Int? = nil
9462- ) -> Nil {
9463- return Nil(
9464- nilNil: nilNil ?? self.nilNil
9465- )
9466- }
9467-
9468- func jsonData() throws -> Data {
9469- return try newJSONEncoder().encode(self)
9470- }
9471-
9472- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
9473- return String(data: try self.jsonData(), encoding: encoding)
9474- }
9475-}
9476-
94779429 // MARK: - Obj4
94789430 struct Obj4: Codable {
94799431 let dummy: Int
9432+ let no: No
94809433 let noSuchMethod: NoSuchMethod
94819434 let noexcept: Noexcept
94829435 let nonatomic: Nonatomic
@@ -9490,6 +9443,7 @@ struct Obj4: Codable {
94909443 let null: Null
94919444 let nullptr: Nullptr
94929445 let number: Number
9446+ let obj4Nil: Nil
94939447 let obj4None: NoneClass
94949448 let obj4Nonmutating: Nonmutating
94959449 let obj4Null: NullClass
@@ -9539,11 +9493,10 @@ struct Obj4: Codable {
95399493 let runtimeType: RuntimeType
95409494 let s: S
95419495 let sbyte: Sbyte
9542- let sealed: Sealed
9543- let sel: Sel
95449496
95459497 enum CodingKeys: String, CodingKey {
95469498 case dummy = "dummy"
9499+ case no = "NO"
95479500 case noSuchMethod = "noSuchMethod"
95489501 case noexcept = "noexcept"
95499502 case nonatomic = "nonatomic"
@@ -9557,6 +9510,7 @@ struct Obj4: Codable {
95579510 case null = "NULL"
95589511 case nullptr = "nullptr"
95599512 case number = "number"
9513+ case obj4Nil = "nil"
95609514 case obj4None = "none"
95619515 case obj4Nonmutating = "nonmutating"
95629516 case obj4Null = "null"
@@ -9606,8 +9560,6 @@ struct Obj4: Codable {
96069560 case runtimeType = "runtimeType"
96079561 case s = "s"
96089562 case sbyte = "sbyte"
9609- case sealed = "sealed"
9610- case sel = "SEL"
96119563 }
96129564 }
96139565
@@ -9631,6 +9583,7 @@ extension Obj4 {
96319583
96329584 func with(
96339585 dummy: Int? = nil,
9586+ no: No? = nil,
96349587 noSuchMethod: NoSuchMethod? = nil,
96359588 noexcept: Noexcept? = nil,
96369589 nonatomic: Nonatomic? = nil,
@@ -9644,6 +9597,7 @@ extension Obj4 {
96449597 null: Null? = nil,
96459598 nullptr: Nullptr? = nil,
96469599 number: Number? = nil,
9600+ obj4Nil: Nil? = nil,
96479601 obj4None: NoneClass? = nil,
96489602 obj4Nonmutating: Nonmutating? = nil,
96499603 obj4Null: NullClass? = nil,
@@ -9692,12 +9646,11 @@ extension Obj4 {
96929646 retain: Retain? = nil,
96939647 runtimeType: RuntimeType? = nil,
96949648 s: S? = nil,
9695- sbyte: Sbyte? = nil,
9696- sealed: Sealed? = nil,
9697- sel: Sel? = nil
9649+ sbyte: Sbyte? = nil
96989650 ) -> Obj4 {
96999651 return Obj4(
97009652 dummy: dummy ?? self.dummy,
9653+ no: no ?? self.no,
97019654 noSuchMethod: noSuchMethod ?? self.noSuchMethod,
97029655 noexcept: noexcept ?? self.noexcept,
97039656 nonatomic: nonatomic ?? self.nonatomic,
@@ -9711,6 +9664,7 @@ extension Obj4 {
97119664 null: null ?? self.null,
97129665 nullptr: nullptr ?? self.nullptr,
97139666 number: number ?? self.number,
9667+ obj4Nil: obj4Nil ?? self.obj4Nil,
97149668 obj4None: obj4None ?? self.obj4None,
97159669 obj4Nonmutating: obj4Nonmutating ?? self.obj4Nonmutating,
97169670 obj4Null: obj4Null ?? self.obj4Null,
@@ -9759,9 +9713,51 @@ extension Obj4 {
97599713 retain: retain ?? self.retain,
97609714 runtimeType: runtimeType ?? self.runtimeType,
97619715 s: s ?? self.s,
9762- sbyte: sbyte ?? self.sbyte,
9763- sealed: sealed ?? self.sealed,
9764- sel: sel ?? self.sel
9716+ sbyte: sbyte ?? self.sbyte
9717+ )
9718+ }
9719+
9720+ func jsonData() throws -> Data {
9721+ return try newJSONEncoder().encode(self)
9722+ }
9723+
9724+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
9725+ return String(data: try self.jsonData(), encoding: encoding)
9726+ }
9727+}
9728+
9729+// MARK: - No
9730+struct No: Codable {
9731+ let no: Int
9732+
9733+ enum CodingKeys: String, CodingKey {
9734+ case no = "NO"
9735+ }
9736+}
9737+
9738+// MARK: No convenience initializers and mutators
9739+
9740+extension No {
9741+ init(data: Data) throws {
9742+ self = try newJSONDecoder().decode(No.self, from: data)
9743+ }
9744+
9745+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
9746+ guard let data = json.data(using: encoding) else {
9747+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
9748+ }
9749+ try self.init(data: data)
9750+ }
9751+
9752+ init(fromURL url: URL) throws {
9753+ try self.init(data: try Data(contentsOf: url))
9754+ }
9755+
9756+ func with(
9757+ no: Int? = nil
9758+ ) -> No {
9759+ return No(
9760+ no: no ?? self.no
97659761 )
97669762 }
97679763
@@ -10346,6 +10342,50 @@ extension Number {
1034610342 }
1034710343 }
1034810344
10345+// MARK: - Nil
10346+struct Nil: Codable {
10347+ let nilNil: Int
10348+
10349+ enum CodingKeys: String, CodingKey {
10350+ case nilNil = "nil"
10351+ }
10352+}
10353+
10354+// MARK: Nil convenience initializers and mutators
10355+
10356+extension Nil {
10357+ init(data: Data) throws {
10358+ self = try newJSONDecoder().decode(Nil.self, from: data)
10359+ }
10360+
10361+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
10362+ guard let data = json.data(using: encoding) else {
10363+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
10364+ }
10365+ try self.init(data: data)
10366+ }
10367+
10368+ init(fromURL url: URL) throws {
10369+ try self.init(data: try Data(contentsOf: url))
10370+ }
10371+
10372+ func with(
10373+ nilNil: Int? = nil
10374+ ) -> Nil {
10375+ return Nil(
10376+ nilNil: nilNil ?? self.nilNil
10377+ )
10378+ }
10379+
10380+ func jsonData() throws -> Data {
10381+ return try newJSONEncoder().encode(self)
10382+ }
10383+
10384+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
10385+ return String(data: try self.jsonData(), encoding: encoding)
10386+ }
10387+}
10388+
1034910389 // MARK: - NoneClass
1035010390 struct NoneClass: Codable {
1035110391 let none: Int
@@ -12502,94 +12542,6 @@ extension Sbyte {
1250212542 }
1250312543 }
1250412544
12505-// MARK: - Sealed
12506-struct Sealed: Codable {
12507- let sealed: Int
12508-
12509- enum CodingKeys: String, CodingKey {
12510- case sealed = "sealed"
12511- }
12512-}
12513-
12514-// MARK: Sealed convenience initializers and mutators
12515-
12516-extension Sealed {
12517- init(data: Data) throws {
12518- self = try newJSONDecoder().decode(Sealed.self, from: data)
12519- }
12520-
12521- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
12522- guard let data = json.data(using: encoding) else {
12523- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
12524- }
12525- try self.init(data: data)
12526- }
12527-
12528- init(fromURL url: URL) throws {
12529- try self.init(data: try Data(contentsOf: url))
12530- }
12531-
12532- func with(
12533- sealed: Int? = nil
12534- ) -> Sealed {
12535- return Sealed(
12536- sealed: sealed ?? self.sealed
12537- )
12538- }
12539-
12540- func jsonData() throws -> Data {
12541- return try newJSONEncoder().encode(self)
12542- }
12543-
12544- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
12545- return String(data: try self.jsonData(), encoding: encoding)
12546- }
12547-}
12548-
12549-// MARK: - Sel
12550-struct Sel: Codable {
12551- let sel: Int
12552-
12553- enum CodingKeys: String, CodingKey {
12554- case sel = "SEL"
12555- }
12556-}
12557-
12558-// MARK: Sel convenience initializers and mutators
12559-
12560-extension Sel {
12561- init(data: Data) throws {
12562- self = try newJSONDecoder().decode(Sel.self, from: data)
12563- }
12564-
12565- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
12566- guard let data = json.data(using: encoding) else {
12567- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
12568- }
12569- try self.init(data: data)
12570- }
12571-
12572- init(fromURL url: URL) throws {
12573- try self.init(data: try Data(contentsOf: url))
12574- }
12575-
12576- func with(
12577- sel: Int? = nil
12578- ) -> Sel {
12579- return Sel(
12580- sel: sel ?? self.sel
12581- )
12582- }
12583-
12584- func jsonData() throws -> Data {
12585- return try newJSONEncoder().encode(self)
12586- }
12587-
12588- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
12589- return String(data: try self.jsonData(), encoding: encoding)
12590- }
12591-}
12592-
1259312545 // MARK: - Obj5
1259412546 struct Obj5: Codable {
1259512547 let dummy: Int
@@ -12607,10 +12559,11 @@ struct Obj5: Codable {
1260712559 let obj5Try: Try
1260812560 let obj5Type: Obj5Type
1260912561 let obj5Typealias: Typealias
12610- let obj5Unowned: Unowned
1261112562 let primitiveKind: PrimitiveKind
1261212563 let purpleSelf: Obj5Self
1261312564 let purpleTrue: TrueClass
12565+ let sealed: Sealed
12566+ let sel: Sel
1261412567 let select: Select
1261512568 let sendable: Sendable
1261612569 let serialDescriptor: SerialDescriptor
@@ -12656,8 +12609,6 @@ struct Obj5: Codable {
1265612609 let undefined: Undefined
1265712610 let union: Union
1265812611 let unmarshalJSON: UnmarshalJSON
12659- let unsafe: Unsafe
12660- let useSerializers: UseSerializers
1266112612
1266212613 enum CodingKeys: String, CodingKey {
1266312614 case dummy = "dummy"
@@ -12675,10 +12626,11 @@ struct Obj5: Codable {
1267512626 case obj5Try = "try"
1267612627 case obj5Type = "type"
1267712628 case obj5Typealias = "typealias"
12678- case obj5Unowned = "unowned"
1267912629 case primitiveKind = "PrimitiveKind"
1268012630 case purpleSelf = "self"
1268112631 case purpleTrue = "true"
12632+ case sealed = "sealed"
12633+ case sel = "SEL"
1268212634 case select = "select"
1268312635 case sendable = "Sendable"
1268412636 case serialDescriptor = "SerialDescriptor"
@@ -12724,8 +12676,6 @@ struct Obj5: Codable {
1272412676 case undefined = "undefined"
1272512677 case union = "union"
1272612678 case unmarshalJSON = "UnmarshalJSON"
12727- case unsafe = "unsafe"
12728- case useSerializers = "UseSerializers"
1272912679 }
1273012680 }
1273112681
@@ -12763,10 +12713,11 @@ extension Obj5 {
1276312713 obj5Try: Try? = nil,
1276412714 obj5Type: Obj5Type? = nil,
1276512715 obj5Typealias: Typealias? = nil,
12766- obj5Unowned: Unowned? = nil,
1276712716 primitiveKind: PrimitiveKind? = nil,
1276812717 purpleSelf: Obj5Self? = nil,
1276912718 purpleTrue: TrueClass? = nil,
12719+ sealed: Sealed? = nil,
12720+ sel: Sel? = nil,
1277012721 select: Select? = nil,
1277112722 sendable: Sendable? = nil,
1277212723 serialDescriptor: SerialDescriptor? = nil,
@@ -12811,9 +12762,7 @@ extension Obj5 {
1281112762 unchecked: Unchecked? = nil,
1281212763 undefined: Undefined? = nil,
1281312764 union: Union? = nil,
12814- unmarshalJSON: UnmarshalJSON? = nil,
12815- unsafe: Unsafe? = nil,
12816- useSerializers: UseSerializers? = nil
12765+ unmarshalJSON: UnmarshalJSON? = nil
1281712766 ) -> Obj5 {
1281812767 return Obj5(
1281912768 dummy: dummy ?? self.dummy,
@@ -12831,10 +12780,11 @@ extension Obj5 {
1283112780 obj5Try: obj5Try ?? self.obj5Try,
1283212781 obj5Type: obj5Type ?? self.obj5Type,
1283312782 obj5Typealias: obj5Typealias ?? self.obj5Typealias,
12834- obj5Unowned: obj5Unowned ?? self.obj5Unowned,
1283512783 primitiveKind: primitiveKind ?? self.primitiveKind,
1283612784 purpleSelf: purpleSelf ?? self.purpleSelf,
1283712785 purpleTrue: purpleTrue ?? self.purpleTrue,
12786+ sealed: sealed ?? self.sealed,
12787+ sel: sel ?? self.sel,
1283812788 select: select ?? self.select,
1283912789 sendable: sendable ?? self.sendable,
1284012790 serialDescriptor: serialDescriptor ?? self.serialDescriptor,
@@ -12879,9 +12829,7 @@ extension Obj5 {
1287912829 unchecked: unchecked ?? self.unchecked,
1288012830 undefined: undefined ?? self.undefined,
1288112831 union: union ?? self.union,
12882- unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON,
12883- unsafe: unsafe ?? self.unsafe,
12884- useSerializers: useSerializers ?? self.useSerializers
12832+ unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON
1288512833 )
1288612834 }
1288712835
@@ -13510,50 +13458,6 @@ extension Typealias {
1351013458 }
1351113459 }
1351213460
13513-// MARK: - Unowned
13514-struct Unowned: Codable {
13515- let unownedUnowned: Int
13516-
13517- enum CodingKeys: String, CodingKey {
13518- case unownedUnowned = "unowned"
13519- }
13520-}
13521-
13522-// MARK: Unowned convenience initializers and mutators
13523-
13524-extension Unowned {
13525- init(data: Data) throws {
13526- self = try newJSONDecoder().decode(Unowned.self, from: data)
13527- }
13528-
13529- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
13530- guard let data = json.data(using: encoding) else {
13531- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
13532- }
13533- try self.init(data: data)
13534- }
13535-
13536- init(fromURL url: URL) throws {
13537- try self.init(data: try Data(contentsOf: url))
13538- }
13539-
13540- func with(
13541- unownedUnowned: Int? = nil
13542- ) -> Unowned {
13543- return Unowned(
13544- unownedUnowned: unownedUnowned ?? self.unownedUnowned
13545- )
13546- }
13547-
13548- func jsonData() throws -> Data {
13549- return try newJSONEncoder().encode(self)
13550- }
13551-
13552- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
13553- return String(data: try self.jsonData(), encoding: encoding)
13554- }
13555-}
13556-
1355713461 // MARK: - PrimitiveKind
1355813462 struct PrimitiveKind: Codable {
1355913463 let primitiveKind: Int
@@ -13686,6 +13590,94 @@ extension TrueClass {
1368613590 }
1368713591 }
1368813592
13593+// MARK: - Sealed
13594+struct Sealed: Codable {
13595+ let sealed: Int
13596+
13597+ enum CodingKeys: String, CodingKey {
13598+ case sealed = "sealed"
13599+ }
13600+}
13601+
13602+// MARK: Sealed convenience initializers and mutators
13603+
13604+extension Sealed {
13605+ init(data: Data) throws {
13606+ self = try newJSONDecoder().decode(Sealed.self, from: data)
13607+ }
13608+
13609+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
13610+ guard let data = json.data(using: encoding) else {
13611+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
13612+ }
13613+ try self.init(data: data)
13614+ }
13615+
13616+ init(fromURL url: URL) throws {
13617+ try self.init(data: try Data(contentsOf: url))
13618+ }
13619+
13620+ func with(
13621+ sealed: Int? = nil
13622+ ) -> Sealed {
13623+ return Sealed(
13624+ sealed: sealed ?? self.sealed
13625+ )
13626+ }
13627+
13628+ func jsonData() throws -> Data {
13629+ return try newJSONEncoder().encode(self)
13630+ }
13631+
13632+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
13633+ return String(data: try self.jsonData(), encoding: encoding)
13634+ }
13635+}
13636+
13637+// MARK: - Sel
13638+struct Sel: Codable {
13639+ let sel: Int
13640+
13641+ enum CodingKeys: String, CodingKey {
13642+ case sel = "SEL"
13643+ }
13644+}
13645+
13646+// MARK: Sel convenience initializers and mutators
13647+
13648+extension Sel {
13649+ init(data: Data) throws {
13650+ self = try newJSONDecoder().decode(Sel.self, from: data)
13651+ }
13652+
13653+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
13654+ guard let data = json.data(using: encoding) else {
13655+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
13656+ }
13657+ try self.init(data: data)
13658+ }
13659+
13660+ init(fromURL url: URL) throws {
13661+ try self.init(data: try Data(contentsOf: url))
13662+ }
13663+
13664+ func with(
13665+ sel: Int? = nil
13666+ ) -> Sel {
13667+ return Sel(
13668+ sel: sel ?? self.sel
13669+ )
13670+ }
13671+
13672+ func jsonData() throws -> Data {
13673+ return try newJSONEncoder().encode(self)
13674+ }
13675+
13676+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
13677+ return String(data: try self.jsonData(), encoding: encoding)
13678+ }
13679+}
13680+
1368913681 // MARK: - Select
1369013682 struct Select: Codable {
1369113683 let select: Int
@@ -15666,103 +15658,18 @@ extension UnmarshalJSON {
1566615658 }
1566715659 }
1566815660
15669-// MARK: - Unsafe
15670-struct Unsafe: Codable {
15671- let unsafe: Int
15672-
15673- enum CodingKeys: String, CodingKey {
15674- case unsafe = "unsafe"
15675- }
15676-}
15677-
15678-// MARK: Unsafe convenience initializers and mutators
15679-
15680-extension Unsafe {
15681- init(data: Data) throws {
15682- self = try newJSONDecoder().decode(Unsafe.self, from: data)
15683- }
15684-
15685- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
15686- guard let data = json.data(using: encoding) else {
15687- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
15688- }
15689- try self.init(data: data)
15690- }
15691-
15692- init(fromURL url: URL) throws {
15693- try self.init(data: try Data(contentsOf: url))
15694- }
15695-
15696- func with(
15697- unsafe: Int? = nil
15698- ) -> Unsafe {
15699- return Unsafe(
15700- unsafe: unsafe ?? self.unsafe
15701- )
15702- }
15703-
15704- func jsonData() throws -> Data {
15705- return try newJSONEncoder().encode(self)
15706- }
15707-
15708- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
15709- return String(data: try self.jsonData(), encoding: encoding)
15710- }
15711-}
15712-
15713-// MARK: - UseSerializers
15714-struct UseSerializers: Codable {
15715- let useSerializers: Int
15716-
15717- enum CodingKeys: String, CodingKey {
15718- case useSerializers = "UseSerializers"
15719- }
15720-}
15721-
15722-// MARK: UseSerializers convenience initializers and mutators
15723-
15724-extension UseSerializers {
15725- init(data: Data) throws {
15726- self = try newJSONDecoder().decode(UseSerializers.self, from: data)
15727- }
15728-
15729- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
15730- guard let data = json.data(using: encoding) else {
15731- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
15732- }
15733- try self.init(data: data)
15734- }
15735-
15736- init(fromURL url: URL) throws {
15737- try self.init(data: try Data(contentsOf: url))
15738- }
15739-
15740- func with(
15741- useSerializers: Int? = nil
15742- ) -> UseSerializers {
15743- return UseSerializers(
15744- useSerializers: useSerializers ?? self.useSerializers
15745- )
15746- }
15747-
15748- func jsonData() throws -> Data {
15749- return try newJSONEncoder().encode(self)
15750- }
15751-
15752- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
15753- return String(data: try self.jsonData(), encoding: encoding)
15754- }
15755-}
15756-
1575715661 // MARK: - Obj6
1575815662 struct Obj6: Codable {
1575915663 let dummy: Int
15664+ let obj6Unowned: Unowned
1576015665 let obj6Var: Var
1576115666 let obj6Weak: Weak
1576215667 let obj6Where: Where
1576315668 let obj6While: While
1576415669 let obj6WillSet: WillSet
15670+ let unsafe: Unsafe
1576515671 let unsigned: Unsigned
15672+ let useSerializers: UseSerializers
1576615673 let ushort: Ushort
1576715674 let using: Using
1576815675 let utf8JSONReader: Utf8JSONReader
@@ -15780,12 +15687,15 @@ struct Obj6: Codable {
1578015687
1578115688 enum CodingKeys: String, CodingKey {
1578215689 case dummy = "dummy"
15690+ case obj6Unowned = "unowned"
1578315691 case obj6Var = "var"
1578415692 case obj6Weak = "weak"
1578515693 case obj6Where = "where"
1578615694 case obj6While = "while"
1578715695 case obj6WillSet = "willSet"
15696+ case unsafe = "unsafe"
1578815697 case unsigned = "unsigned"
15698+ case useSerializers = "UseSerializers"
1578915699 case ushort = "ushort"
1579015700 case using = "using"
1579115701 case utf8JSONReader = "Utf8JsonReader"
@@ -15823,12 +15733,15 @@ extension Obj6 {
1582315733
1582415734 func with(
1582515735 dummy: Int? = nil,
15736+ obj6Unowned: Unowned? = nil,
1582615737 obj6Var: Var? = nil,
1582715738 obj6Weak: Weak? = nil,
1582815739 obj6Where: Where? = nil,
1582915740 obj6While: While? = nil,
1583015741 obj6WillSet: WillSet? = nil,
15742+ unsafe: Unsafe? = nil,
1583115743 unsigned: Unsigned? = nil,
15744+ useSerializers: UseSerializers? = nil,
1583215745 ushort: Ushort? = nil,
1583315746 using: Using? = nil,
1583415747 utf8JSONReader: Utf8JSONReader? = nil,
@@ -15846,12 +15759,15 @@ extension Obj6 {
1584615759 ) -> Obj6 {
1584715760 return Obj6(
1584815761 dummy: dummy ?? self.dummy,
15762+ obj6Unowned: obj6Unowned ?? self.obj6Unowned,
1584915763 obj6Var: obj6Var ?? self.obj6Var,
1585015764 obj6Weak: obj6Weak ?? self.obj6Weak,
1585115765 obj6Where: obj6Where ?? self.obj6Where,
1585215766 obj6While: obj6While ?? self.obj6While,
1585315767 obj6WillSet: obj6WillSet ?? self.obj6WillSet,
15768+ unsafe: unsafe ?? self.unsafe,
1585415769 unsigned: unsigned ?? self.unsigned,
15770+ useSerializers: useSerializers ?? self.useSerializers,
1585515771 ushort: ushort ?? self.ushort,
1585615772 using: using ?? self.using,
1585715773 utf8JSONReader: utf8JSONReader ?? self.utf8JSONReader,
@@ -15878,6 +15794,50 @@ extension Obj6 {
1587815794 }
1587915795 }
1588015796
15797+// MARK: - Unowned
15798+struct Unowned: Codable {
15799+ let unownedUnowned: Int
15800+
15801+ enum CodingKeys: String, CodingKey {
15802+ case unownedUnowned = "unowned"
15803+ }
15804+}
15805+
15806+// MARK: Unowned convenience initializers and mutators
15807+
15808+extension Unowned {
15809+ init(data: Data) throws {
15810+ self = try newJSONDecoder().decode(Unowned.self, from: data)
15811+ }
15812+
15813+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
15814+ guard let data = json.data(using: encoding) else {
15815+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
15816+ }
15817+ try self.init(data: data)
15818+ }
15819+
15820+ init(fromURL url: URL) throws {
15821+ try self.init(data: try Data(contentsOf: url))
15822+ }
15823+
15824+ func with(
15825+ unownedUnowned: Int? = nil
15826+ ) -> Unowned {
15827+ return Unowned(
15828+ unownedUnowned: unownedUnowned ?? self.unownedUnowned
15829+ )
15830+ }
15831+
15832+ func jsonData() throws -> Data {
15833+ return try newJSONEncoder().encode(self)
15834+ }
15835+
15836+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
15837+ return String(data: try self.jsonData(), encoding: encoding)
15838+ }
15839+}
15840+
1588115841 // MARK: - Var
1588215842 struct Var: Codable {
1588315843 let varVar: Int
@@ -16098,6 +16058,50 @@ extension WillSet {
1609816058 }
1609916059 }
1610016060
16061+// MARK: - Unsafe
16062+struct Unsafe: Codable {
16063+ let unsafe: Int
16064+
16065+ enum CodingKeys: String, CodingKey {
16066+ case unsafe = "unsafe"
16067+ }
16068+}
16069+
16070+// MARK: Unsafe convenience initializers and mutators
16071+
16072+extension Unsafe {
16073+ init(data: Data) throws {
16074+ self = try newJSONDecoder().decode(Unsafe.self, from: data)
16075+ }
16076+
16077+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
16078+ guard let data = json.data(using: encoding) else {
16079+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
16080+ }
16081+ try self.init(data: data)
16082+ }
16083+
16084+ init(fromURL url: URL) throws {
16085+ try self.init(data: try Data(contentsOf: url))
16086+ }
16087+
16088+ func with(
16089+ unsafe: Int? = nil
16090+ ) -> Unsafe {
16091+ return Unsafe(
16092+ unsafe: unsafe ?? self.unsafe
16093+ )
16094+ }
16095+
16096+ func jsonData() throws -> Data {
16097+ return try newJSONEncoder().encode(self)
16098+ }
16099+
16100+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
16101+ return String(data: try self.jsonData(), encoding: encoding)
16102+ }
16103+}
16104+
1610116105 // MARK: - Unsigned
1610216106 struct Unsigned: Codable {
1610316107 let unsigned: Int
@@ -16142,6 +16146,50 @@ extension Unsigned {
1614216146 }
1614316147 }
1614416148
16149+// MARK: - UseSerializers
16150+struct UseSerializers: Codable {
16151+ let useSerializers: Int
16152+
16153+ enum CodingKeys: String, CodingKey {
16154+ case useSerializers = "UseSerializers"
16155+ }
16156+}
16157+
16158+// MARK: UseSerializers convenience initializers and mutators
16159+
16160+extension UseSerializers {
16161+ init(data: Data) throws {
16162+ self = try newJSONDecoder().decode(UseSerializers.self, from: data)
16163+ }
16164+
16165+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
16166+ guard let data = json.data(using: encoding) else {
16167+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
16168+ }
16169+ try self.init(data: data)
16170+ }
16171+
16172+ init(fromURL url: URL) throws {
16173+ try self.init(data: try Data(contentsOf: url))
16174+ }
16175+
16176+ func with(
16177+ useSerializers: Int? = nil
16178+ ) -> UseSerializers {
16179+ return UseSerializers(
16180+ useSerializers: useSerializers ?? self.useSerializers
16181+ )
16182+ }
16183+
16184+ func jsonData() throws -> Data {
16185+ return try newJSONEncoder().encode(self)
16186+ }
16187+
16188+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
16189+ return String(data: try self.jsonData(), encoding: encoding)
16190+ }
16191+}
16192+
1614516193 // MARK: - Ushort
1614616194 struct Ushort: Codable {
1614716195 let ushort: Int
Mswiftobjective-c-support-true__struct-or-class-class--f14372afa3e4 / quicktype.swift+446 −392
@@ -7140,6 +7140,7 @@ extension FalseClass {
71407140 let locale: LocaleClass
71417141 let lock: Lock
71427142 let long: Long
7143+ let makeDictEncoder: MakeDictEncoder
71437144 let map: Map
71447145 let mapEntry: MapEntry
71457146 let marshalJSON: MarshalJSON
@@ -7150,7 +7151,6 @@ extension FalseClass {
71507151 let native: Native
71517152 let new: New
71527153 let newtonsoft: Newtonsoft
7153- let no: No
71547154 let obj3Guard: Guard
71557155 let obj3If: If
71567156 let obj3Import: Import
@@ -7166,7 +7166,6 @@ extension FalseClass {
71667166 let obj3Left: Left
71677167 let obj3Let: Let
71687168 let obj3Mutating: Mutating
7169- let obj3Nil: Nil
71707169
71717170 enum CodingKeys: String, CodingKey {
71727171 case dummy = "dummy"
@@ -7208,6 +7207,7 @@ extension FalseClass {
72087207 case locale = "Locale"
72097208 case lock = "lock"
72107209 case long = "long"
7210+ case makeDictEncoder = "makeDictEncoder"
72117211 case map = "map"
72127212 case mapEntry = "MapEntry"
72137213 case marshalJSON = "MarshalJSON"
@@ -7218,7 +7218,6 @@ extension FalseClass {
72187218 case native = "native"
72197219 case new = "new"
72207220 case newtonsoft = "newtonsoft"
7221- case no = "NO"
72227221 case obj3Guard = "guard"
72237222 case obj3If = "if"
72247223 case obj3Import = "import"
@@ -7234,10 +7233,9 @@ extension FalseClass {
72347233 case obj3Left = "left"
72357234 case obj3Let = "let"
72367235 case obj3Mutating = "mutating"
7237- case obj3Nil = "nil"
72387236 }
72397237
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) {
7238+ 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, makeDictEncoder: MakeDictEncoder, map: Map, mapEntry: MapEntry, marshalJSON: MarshalJSON, metadataPropertyHandling: MetadataPropertyHandling, module: Module, mutable: Mutable, namespace: Namespace, native: Native, new: New, newtonsoft: Newtonsoft, 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) {
72417239 self.dummy = dummy
72427240 self.goto = goto
72437241 self.hasOwnProperty = hasOwnProperty
@@ -7277,6 +7275,7 @@ extension FalseClass {
72777275 self.locale = locale
72787276 self.lock = lock
72797277 self.long = long
7278+ self.makeDictEncoder = makeDictEncoder
72807279 self.map = map
72817280 self.mapEntry = mapEntry
72827281 self.marshalJSON = marshalJSON
@@ -7287,7 +7286,6 @@ extension FalseClass {
72877286 self.native = native
72887287 self.new = new
72897288 self.newtonsoft = newtonsoft
7290- self.no = no
72917289 self.obj3Guard = obj3Guard
72927290 self.obj3If = obj3If
72937291 self.obj3Import = obj3Import
@@ -7303,7 +7301,6 @@ extension FalseClass {
73037301 self.obj3Left = obj3Left
73047302 self.obj3Let = obj3Let
73057303 self.obj3Mutating = obj3Mutating
7306- self.obj3Nil = obj3Nil
73077304 }
73087305 }
73097306
@@ -7312,7 +7309,7 @@ extension FalseClass {
73127309 extension Obj3 {
73137310 convenience init(data: Data) throws {
73147311 let me = try newJSONDecoder().decode(Obj3.self, from: data)
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)
7312+ 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, makeDictEncoder: me.makeDictEncoder, 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, 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)
73167313 }
73177314
73187315 convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -7366,6 +7363,7 @@ extension Obj3 {
73667363 locale: LocaleClass? = nil,
73677364 lock: Lock? = nil,
73687365 long: Long? = nil,
7366+ makeDictEncoder: MakeDictEncoder? = nil,
73697367 map: Map? = nil,
73707368 mapEntry: MapEntry? = nil,
73717369 marshalJSON: MarshalJSON? = nil,
@@ -7376,7 +7374,6 @@ extension Obj3 {
73767374 native: Native? = nil,
73777375 new: New? = nil,
73787376 newtonsoft: Newtonsoft? = nil,
7379- no: No? = nil,
73807377 obj3Guard: Guard? = nil,
73817378 obj3If: If? = nil,
73827379 obj3Import: Import? = nil,
@@ -7391,8 +7388,7 @@ extension Obj3 {
73917388 obj3Lazy: Lazy? = nil,
73927389 obj3Left: Left? = nil,
73937390 obj3Let: Let? = nil,
7394- obj3Mutating: Mutating? = nil,
7395- obj3Nil: Nil? = nil
7391+ obj3Mutating: Mutating? = nil
73967392 ) -> Obj3 {
73977393 return Obj3(
73987394 dummy: dummy ?? self.dummy,
@@ -7434,6 +7430,7 @@ extension Obj3 {
74347430 locale: locale ?? self.locale,
74357431 lock: lock ?? self.lock,
74367432 long: long ?? self.long,
7433+ makeDictEncoder: makeDictEncoder ?? self.makeDictEncoder,
74377434 map: map ?? self.map,
74387435 mapEntry: mapEntry ?? self.mapEntry,
74397436 marshalJSON: marshalJSON ?? self.marshalJSON,
@@ -7444,7 +7441,6 @@ extension Obj3 {
74447441 native: native ?? self.native,
74457442 new: new ?? self.new,
74467443 newtonsoft: newtonsoft ?? self.newtonsoft,
7447- no: no ?? self.no,
74487444 obj3Guard: obj3Guard ?? self.obj3Guard,
74497445 obj3If: obj3If ?? self.obj3If,
74507446 obj3Import: obj3Import ?? self.obj3Import,
@@ -7459,8 +7455,7 @@ extension Obj3 {
74597455 obj3Lazy: obj3Lazy ?? self.obj3Lazy,
74607456 obj3Left: obj3Left ?? self.obj3Left,
74617457 obj3Let: obj3Let ?? self.obj3Let,
7462- obj3Mutating: obj3Mutating ?? self.obj3Mutating,
7463- obj3Nil: obj3Nil ?? self.obj3Nil
7458+ obj3Mutating: obj3Mutating ?? self.obj3Mutating
74647459 )
74657460 }
74667461
@@ -9335,6 +9330,55 @@ extension Long {
93359330 }
93369331 }
93379332
9333+// MARK: - MakeDictEncoder
9334+@objcMembers class MakeDictEncoder: NSObject, Codable {
9335+ let makeDictEncoder: Int
9336+
9337+ enum CodingKeys: String, CodingKey {
9338+ case makeDictEncoder = "makeDictEncoder"
9339+ }
9340+
9341+ init(makeDictEncoder: Int) {
9342+ self.makeDictEncoder = makeDictEncoder
9343+ }
9344+}
9345+
9346+// MARK: MakeDictEncoder convenience initializers and mutators
9347+
9348+extension MakeDictEncoder {
9349+ convenience init(data: Data) throws {
9350+ let me = try newJSONDecoder().decode(MakeDictEncoder.self, from: data)
9351+ self.init(makeDictEncoder: me.makeDictEncoder)
9352+ }
9353+
9354+ convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
9355+ guard let data = json.data(using: encoding) else {
9356+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
9357+ }
9358+ try self.init(data: data)
9359+ }
9360+
9361+ convenience init(fromURL url: URL) throws {
9362+ try self.init(data: try Data(contentsOf: url))
9363+ }
9364+
9365+ func with(
9366+ makeDictEncoder: Int? = nil
9367+ ) -> MakeDictEncoder {
9368+ return MakeDictEncoder(
9369+ makeDictEncoder: makeDictEncoder ?? self.makeDictEncoder
9370+ )
9371+ }
9372+
9373+ func jsonData() throws -> Data {
9374+ return try newJSONEncoder().encode(self)
9375+ }
9376+
9377+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
9378+ return String(data: try self.jsonData(), encoding: encoding)
9379+ }
9380+}
9381+
93389382 // MARK: - Map
93399383 @objcMembers class Map: NSObject, Codable {
93409384 let map: Int
@@ -9825,55 +9869,6 @@ extension Newtonsoft {
98259869 }
98269870 }
98279871
9828-// MARK: - No
9829-@objcMembers class No: NSObject, Codable {
9830- let no: Int
9831-
9832- enum CodingKeys: String, CodingKey {
9833- case no = "NO"
9834- }
9835-
9836- init(no: Int) {
9837- self.no = no
9838- }
9839-}
9840-
9841-// MARK: No convenience initializers and mutators
9842-
9843-extension No {
9844- convenience init(data: Data) throws {
9845- let me = try newJSONDecoder().decode(No.self, from: data)
9846- self.init(no: me.no)
9847- }
9848-
9849- convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
9850- guard let data = json.data(using: encoding) else {
9851- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
9852- }
9853- try self.init(data: data)
9854- }
9855-
9856- convenience init(fromURL url: URL) throws {
9857- try self.init(data: try Data(contentsOf: url))
9858- }
9859-
9860- func with(
9861- no: Int? = nil
9862- ) -> No {
9863- return No(
9864- no: no ?? self.no
9865- )
9866- }
9867-
9868- func jsonData() throws -> Data {
9869- return try newJSONEncoder().encode(self)
9870- }
9871-
9872- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
9873- return String(data: try self.jsonData(), encoding: encoding)
9874- }
9875-}
9876-
98779872 // MARK: - Guard
98789873 @objcMembers class Guard: NSObject, Codable {
98799874 let guardGuard: Int
@@ -10609,58 +10604,10 @@ extension Mutating {
1060910604 }
1061010605 }
1061110606
10612-// MARK: - Nil
10613-@objcMembers class Nil: NSObject, Codable {
10614- let nilNil: Int
10615-
10616- enum CodingKeys: String, CodingKey {
10617- case nilNil = "nil"
10618- }
10619-
10620- init(nilNil: Int) {
10621- self.nilNil = nilNil
10622- }
10623-}
10624-
10625-// MARK: Nil convenience initializers and mutators
10626-
10627-extension Nil {
10628- convenience init(data: Data) throws {
10629- let me = try newJSONDecoder().decode(Nil.self, from: data)
10630- self.init(nilNil: me.nilNil)
10631- }
10632-
10633- convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
10634- guard let data = json.data(using: encoding) else {
10635- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
10636- }
10637- try self.init(data: data)
10638- }
10639-
10640- convenience init(fromURL url: URL) throws {
10641- try self.init(data: try Data(contentsOf: url))
10642- }
10643-
10644- func with(
10645- nilNil: Int? = nil
10646- ) -> Nil {
10647- return Nil(
10648- nilNil: nilNil ?? self.nilNil
10649- )
10650- }
10651-
10652- func jsonData() throws -> Data {
10653- return try newJSONEncoder().encode(self)
10654- }
10655-
10656- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
10657- return String(data: try self.jsonData(), encoding: encoding)
10658- }
10659-}
10660-
1066110607 // MARK: - Obj4
1066210608 @objcMembers class Obj4: NSObject, Codable {
1066310609 let dummy: Int
10610+ let no: No
1066410611 let noSuchMethod: NoSuchMethod
1066510612 let noexcept: Noexcept
1066610613 let nonatomic: Nonatomic
@@ -10674,6 +10621,7 @@ extension Nil {
1067410621 let null: Null
1067510622 let nullptr: Nullptr
1067610623 let number: Number
10624+ let obj4Nil: Nil
1067710625 let obj4None: NoneClass
1067810626 let obj4Nonmutating: Nonmutating
1067910627 let obj4Null: NullClass
@@ -10723,11 +10671,10 @@ extension Nil {
1072310671 let runtimeType: RuntimeType
1072410672 let s: S
1072510673 let sbyte: Sbyte
10726- let sealed: Sealed
10727- let sel: Sel
1072810674
1072910675 enum CodingKeys: String, CodingKey {
1073010676 case dummy = "dummy"
10677+ case no = "NO"
1073110678 case noSuchMethod = "noSuchMethod"
1073210679 case noexcept = "noexcept"
1073310680 case nonatomic = "nonatomic"
@@ -10741,6 +10688,7 @@ extension Nil {
1074110688 case null = "NULL"
1074210689 case nullptr = "nullptr"
1074310690 case number = "number"
10691+ case obj4Nil = "nil"
1074410692 case obj4None = "none"
1074510693 case obj4Nonmutating = "nonmutating"
1074610694 case obj4Null = "null"
@@ -10790,12 +10738,11 @@ extension Nil {
1079010738 case runtimeType = "runtimeType"
1079110739 case s = "s"
1079210740 case sbyte = "sbyte"
10793- case sealed = "sealed"
10794- case sel = "SEL"
1079510741 }
1079610742
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) {
10743+ init(dummy: Int, no: No, 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, obj4Nil: Nil, 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) {
1079810744 self.dummy = dummy
10745+ self.no = no
1079910746 self.noSuchMethod = noSuchMethod
1080010747 self.noexcept = noexcept
1080110748 self.nonatomic = nonatomic
@@ -10809,6 +10756,7 @@ extension Nil {
1080910756 self.null = null
1081010757 self.nullptr = nullptr
1081110758 self.number = number
10759+ self.obj4Nil = obj4Nil
1081210760 self.obj4None = obj4None
1081310761 self.obj4Nonmutating = obj4Nonmutating
1081410762 self.obj4Null = obj4Null
@@ -10858,8 +10806,6 @@ extension Nil {
1085810806 self.runtimeType = runtimeType
1085910807 self.s = s
1086010808 self.sbyte = sbyte
10861- self.sealed = sealed
10862- self.sel = sel
1086310809 }
1086410810 }
1086510811
@@ -10868,7 +10814,7 @@ extension Nil {
1086810814 extension Obj4 {
1086910815 convenience init(data: Data) throws {
1087010816 let me = try newJSONDecoder().decode(Obj4.self, from: data)
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)
10817+ self.init(dummy: me.dummy, no: me.no, 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, obj4Nil: me.obj4Nil, 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)
1087210818 }
1087310819
1087410820 convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -10884,6 +10830,7 @@ extension Obj4 {
1088410830
1088510831 func with(
1088610832 dummy: Int? = nil,
10833+ no: No? = nil,
1088710834 noSuchMethod: NoSuchMethod? = nil,
1088810835 noexcept: Noexcept? = nil,
1088910836 nonatomic: Nonatomic? = nil,
@@ -10897,6 +10844,7 @@ extension Obj4 {
1089710844 null: Null? = nil,
1089810845 nullptr: Nullptr? = nil,
1089910846 number: Number? = nil,
10847+ obj4Nil: Nil? = nil,
1090010848 obj4None: NoneClass? = nil,
1090110849 obj4Nonmutating: Nonmutating? = nil,
1090210850 obj4Null: NullClass? = nil,
@@ -10945,12 +10893,11 @@ extension Obj4 {
1094510893 restrict: Restrict? = nil,
1094610894 runtimeType: RuntimeType? = nil,
1094710895 s: S? = nil,
10948- sbyte: Sbyte? = nil,
10949- sealed: Sealed? = nil,
10950- sel: Sel? = nil
10896+ sbyte: Sbyte? = nil
1095110897 ) -> Obj4 {
1095210898 return Obj4(
1095310899 dummy: dummy ?? self.dummy,
10900+ no: no ?? self.no,
1095410901 noSuchMethod: noSuchMethod ?? self.noSuchMethod,
1095510902 noexcept: noexcept ?? self.noexcept,
1095610903 nonatomic: nonatomic ?? self.nonatomic,
@@ -10964,6 +10911,7 @@ extension Obj4 {
1096410911 null: null ?? self.null,
1096510912 nullptr: nullptr ?? self.nullptr,
1096610913 number: number ?? self.number,
10914+ obj4Nil: obj4Nil ?? self.obj4Nil,
1096710915 obj4None: obj4None ?? self.obj4None,
1096810916 obj4Nonmutating: obj4Nonmutating ?? self.obj4Nonmutating,
1096910917 obj4Null: obj4Null ?? self.obj4Null,
@@ -11012,9 +10960,56 @@ extension Obj4 {
1101210960 restrict: restrict ?? self.restrict,
1101310961 runtimeType: runtimeType ?? self.runtimeType,
1101410962 s: s ?? self.s,
11015- sbyte: sbyte ?? self.sbyte,
11016- sealed: sealed ?? self.sealed,
11017- sel: sel ?? self.sel
10963+ sbyte: sbyte ?? self.sbyte
10964+ )
10965+ }
10966+
10967+ func jsonData() throws -> Data {
10968+ return try newJSONEncoder().encode(self)
10969+ }
10970+
10971+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
10972+ return String(data: try self.jsonData(), encoding: encoding)
10973+ }
10974+}
10975+
10976+// MARK: - No
10977+@objcMembers class No: NSObject, Codable {
10978+ let no: Int
10979+
10980+ enum CodingKeys: String, CodingKey {
10981+ case no = "NO"
10982+ }
10983+
10984+ init(no: Int) {
10985+ self.no = no
10986+ }
10987+}
10988+
10989+// MARK: No convenience initializers and mutators
10990+
10991+extension No {
10992+ convenience init(data: Data) throws {
10993+ let me = try newJSONDecoder().decode(No.self, from: data)
10994+ self.init(no: me.no)
10995+ }
10996+
10997+ convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
10998+ guard let data = json.data(using: encoding) else {
10999+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
11000+ }
11001+ try self.init(data: data)
11002+ }
11003+
11004+ convenience init(fromURL url: URL) throws {
11005+ try self.init(data: try Data(contentsOf: url))
11006+ }
11007+
11008+ func with(
11009+ no: Int? = nil
11010+ ) -> No {
11011+ return No(
11012+ no: no ?? self.no
1101811013 )
1101911014 }
1102011015
@@ -11664,6 +11659,55 @@ extension Number {
1166411659 }
1166511660 }
1166611661
11662+// MARK: - Nil
11663+@objcMembers class Nil: NSObject, Codable {
11664+ let nilNil: Int
11665+
11666+ enum CodingKeys: String, CodingKey {
11667+ case nilNil = "nil"
11668+ }
11669+
11670+ init(nilNil: Int) {
11671+ self.nilNil = nilNil
11672+ }
11673+}
11674+
11675+// MARK: Nil convenience initializers and mutators
11676+
11677+extension Nil {
11678+ convenience init(data: Data) throws {
11679+ let me = try newJSONDecoder().decode(Nil.self, from: data)
11680+ self.init(nilNil: me.nilNil)
11681+ }
11682+
11683+ convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
11684+ guard let data = json.data(using: encoding) else {
11685+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
11686+ }
11687+ try self.init(data: data)
11688+ }
11689+
11690+ convenience init(fromURL url: URL) throws {
11691+ try self.init(data: try Data(contentsOf: url))
11692+ }
11693+
11694+ func with(
11695+ nilNil: Int? = nil
11696+ ) -> Nil {
11697+ return Nil(
11698+ nilNil: nilNil ?? self.nilNil
11699+ )
11700+ }
11701+
11702+ func jsonData() throws -> Data {
11703+ return try newJSONEncoder().encode(self)
11704+ }
11705+
11706+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
11707+ return String(data: try self.jsonData(), encoding: encoding)
11708+ }
11709+}
11710+
1166711711 // MARK: - NoneClass
1166811712 @objcMembers class NoneClass: NSObject, Codable {
1166911713 let none: Int
@@ -14065,104 +14109,6 @@ extension Sbyte {
1406514109 }
1406614110 }
1406714111
14068-// MARK: - Sealed
14069-@objcMembers class Sealed: NSObject, Codable {
14070- let sealed: Int
14071-
14072- enum CodingKeys: String, CodingKey {
14073- case sealed = "sealed"
14074- }
14075-
14076- init(sealed: Int) {
14077- self.sealed = sealed
14078- }
14079-}
14080-
14081-// MARK: Sealed convenience initializers and mutators
14082-
14083-extension Sealed {
14084- convenience init(data: Data) throws {
14085- let me = try newJSONDecoder().decode(Sealed.self, from: data)
14086- self.init(sealed: me.sealed)
14087- }
14088-
14089- convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
14090- guard let data = json.data(using: encoding) else {
14091- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
14092- }
14093- try self.init(data: data)
14094- }
14095-
14096- convenience init(fromURL url: URL) throws {
14097- try self.init(data: try Data(contentsOf: url))
14098- }
14099-
14100- func with(
14101- sealed: Int? = nil
14102- ) -> Sealed {
14103- return Sealed(
14104- sealed: sealed ?? self.sealed
14105- )
14106- }
14107-
14108- func jsonData() throws -> Data {
14109- return try newJSONEncoder().encode(self)
14110- }
14111-
14112- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
14113- return String(data: try self.jsonData(), encoding: encoding)
14114- }
14115-}
14116-
14117-// MARK: - Sel
14118-@objcMembers class Sel: NSObject, Codable {
14119- let sel: Int
14120-
14121- enum CodingKeys: String, CodingKey {
14122- case sel = "SEL"
14123- }
14124-
14125- init(sel: Int) {
14126- self.sel = sel
14127- }
14128-}
14129-
14130-// MARK: Sel convenience initializers and mutators
14131-
14132-extension Sel {
14133- convenience init(data: Data) throws {
14134- let me = try newJSONDecoder().decode(Sel.self, from: data)
14135- self.init(sel: me.sel)
14136- }
14137-
14138- convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
14139- guard let data = json.data(using: encoding) else {
14140- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
14141- }
14142- try self.init(data: data)
14143- }
14144-
14145- convenience init(fromURL url: URL) throws {
14146- try self.init(data: try Data(contentsOf: url))
14147- }
14148-
14149- func with(
14150- sel: Int? = nil
14151- ) -> Sel {
14152- return Sel(
14153- sel: sel ?? self.sel
14154- )
14155- }
14156-
14157- func jsonData() throws -> Data {
14158- return try newJSONEncoder().encode(self)
14159- }
14160-
14161- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
14162- return String(data: try self.jsonData(), encoding: encoding)
14163- }
14164-}
14165-
1416614112 // MARK: - Obj5
1416714113 @objcMembers class Obj5: NSObject, Codable {
1416814114 let dummy: Int
@@ -14180,10 +14126,11 @@ extension Sel {
1418014126 let obj5Try: Try
1418114127 let obj5Type: Obj5Type
1418214128 let obj5Typealias: Typealias
14183- let obj5Unowned: Unowned
1418414129 let primitiveKind: PrimitiveKind
1418514130 let purpleSelf: Obj5Self
1418614131 let purpleTrue: TrueClass
14132+ let sealed: Sealed
14133+ let sel: Sel
1418714134 let select: Select
1418814135 let sendable: Sendable
1418914136 let serialDescriptor: SerialDescriptor
@@ -14229,8 +14176,6 @@ extension Sel {
1422914176 let undefined: Undefined
1423014177 let union: Union
1423114178 let unmarshalJSON: UnmarshalJSON
14232- let unsafe: Unsafe
14233- let useSerializers: UseSerializers
1423414179
1423514180 enum CodingKeys: String, CodingKey {
1423614181 case dummy = "dummy"
@@ -14248,10 +14193,11 @@ extension Sel {
1424814193 case obj5Try = "try"
1424914194 case obj5Type = "type"
1425014195 case obj5Typealias = "typealias"
14251- case obj5Unowned = "unowned"
1425214196 case primitiveKind = "PrimitiveKind"
1425314197 case purpleSelf = "self"
1425414198 case purpleTrue = "true"
14199+ case sealed = "sealed"
14200+ case sel = "SEL"
1425514201 case select = "select"
1425614202 case sendable = "Sendable"
1425714203 case serialDescriptor = "SerialDescriptor"
@@ -14297,11 +14243,9 @@ extension Sel {
1429714243 case undefined = "undefined"
1429814244 case union = "union"
1429914245 case unmarshalJSON = "UnmarshalJSON"
14300- case unsafe = "unsafe"
14301- case useSerializers = "UseSerializers"
1430214246 }
1430314247
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) {
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, primitiveKind: PrimitiveKind, purpleSelf: Obj5Self, purpleTrue: TrueClass, sealed: Sealed, sel: Sel, 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) {
1430514249 self.dummy = dummy
1430614250 self.kSerializer = kSerializer
1430714251 self.obj5Self = obj5Self
@@ -14317,10 +14261,11 @@ extension Sel {
1431714261 self.obj5Try = obj5Try
1431814262 self.obj5Type = obj5Type
1431914263 self.obj5Typealias = obj5Typealias
14320- self.obj5Unowned = obj5Unowned
1432114264 self.primitiveKind = primitiveKind
1432214265 self.purpleSelf = purpleSelf
1432314266 self.purpleTrue = purpleTrue
14267+ self.sealed = sealed
14268+ self.sel = sel
1432414269 self.select = select
1432514270 self.sendable = sendable
1432614271 self.serialDescriptor = serialDescriptor
@@ -14366,8 +14311,6 @@ extension Sel {
1436614311 self.undefined = undefined
1436714312 self.union = union
1436814313 self.unmarshalJSON = unmarshalJSON
14369- self.unsafe = unsafe
14370- self.useSerializers = useSerializers
1437114314 }
1437214315 }
1437314316
@@ -14376,7 +14319,7 @@ extension Sel {
1437614319 extension Obj5 {
1437714320 convenience init(data: Data) throws {
1437814321 let me = try newJSONDecoder().decode(Obj5.self, from: data)
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)
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, primitiveKind: me.primitiveKind, purpleSelf: me.purpleSelf, purpleTrue: me.purpleTrue, sealed: me.sealed, sel: me.sel, 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)
1438014323 }
1438114324
1438214325 convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -14406,10 +14349,11 @@ extension Obj5 {
1440614349 obj5Try: Try? = nil,
1440714350 obj5Type: Obj5Type? = nil,
1440814351 obj5Typealias: Typealias? = nil,
14409- obj5Unowned: Unowned? = nil,
1441014352 primitiveKind: PrimitiveKind? = nil,
1441114353 purpleSelf: Obj5Self? = nil,
1441214354 purpleTrue: TrueClass? = nil,
14355+ sealed: Sealed? = nil,
14356+ sel: Sel? = nil,
1441314357 select: Select? = nil,
1441414358 sendable: Sendable? = nil,
1441514359 serialDescriptor: SerialDescriptor? = nil,
@@ -14454,9 +14398,7 @@ extension Obj5 {
1445414398 unchecked: Unchecked? = nil,
1445514399 undefined: Undefined? = nil,
1445614400 union: Union? = nil,
14457- unmarshalJSON: UnmarshalJSON? = nil,
14458- unsafe: Unsafe? = nil,
14459- useSerializers: UseSerializers? = nil
14401+ unmarshalJSON: UnmarshalJSON? = nil
1446014402 ) -> Obj5 {
1446114403 return Obj5(
1446214404 dummy: dummy ?? self.dummy,
@@ -14474,10 +14416,11 @@ extension Obj5 {
1447414416 obj5Try: obj5Try ?? self.obj5Try,
1447514417 obj5Type: obj5Type ?? self.obj5Type,
1447614418 obj5Typealias: obj5Typealias ?? self.obj5Typealias,
14477- obj5Unowned: obj5Unowned ?? self.obj5Unowned,
1447814419 primitiveKind: primitiveKind ?? self.primitiveKind,
1447914420 purpleSelf: purpleSelf ?? self.purpleSelf,
1448014421 purpleTrue: purpleTrue ?? self.purpleTrue,
14422+ sealed: sealed ?? self.sealed,
14423+ sel: sel ?? self.sel,
1448114424 select: select ?? self.select,
1448214425 sendable: sendable ?? self.sendable,
1448314426 serialDescriptor: serialDescriptor ?? self.serialDescriptor,
@@ -14522,9 +14465,7 @@ extension Obj5 {
1452214465 unchecked: unchecked ?? self.unchecked,
1452314466 undefined: undefined ?? self.undefined,
1452414467 union: union ?? self.union,
14525- unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON,
14526- unsafe: unsafe ?? self.unsafe,
14527- useSerializers: useSerializers ?? self.useSerializers
14468+ unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON
1452814469 )
1452914470 }
1453014471
@@ -15223,55 +15164,6 @@ extension Typealias {
1522315164 }
1522415165 }
1522515166
15226-// MARK: - Unowned
15227-@objcMembers class Unowned: NSObject, Codable {
15228- let unownedUnowned: Int
15229-
15230- enum CodingKeys: String, CodingKey {
15231- case unownedUnowned = "unowned"
15232- }
15233-
15234- init(unownedUnowned: Int) {
15235- self.unownedUnowned = unownedUnowned
15236- }
15237-}
15238-
15239-// MARK: Unowned convenience initializers and mutators
15240-
15241-extension Unowned {
15242- convenience init(data: Data) throws {
15243- let me = try newJSONDecoder().decode(Unowned.self, from: data)
15244- self.init(unownedUnowned: me.unownedUnowned)
15245- }
15246-
15247- convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
15248- guard let data = json.data(using: encoding) else {
15249- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
15250- }
15251- try self.init(data: data)
15252- }
15253-
15254- convenience init(fromURL url: URL) throws {
15255- try self.init(data: try Data(contentsOf: url))
15256- }
15257-
15258- func with(
15259- unownedUnowned: Int? = nil
15260- ) -> Unowned {
15261- return Unowned(
15262- unownedUnowned: unownedUnowned ?? self.unownedUnowned
15263- )
15264- }
15265-
15266- func jsonData() throws -> Data {
15267- return try newJSONEncoder().encode(self)
15268- }
15269-
15270- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
15271- return String(data: try self.jsonData(), encoding: encoding)
15272- }
15273-}
15274-
1527515167 // MARK: - PrimitiveKind
1527615168 @objcMembers class PrimitiveKind: NSObject, Codable {
1527715169 let primitiveKind: Int
@@ -15419,6 +15311,104 @@ extension TrueClass {
1541915311 }
1542015312 }
1542115313
15314+// MARK: - Sealed
15315+@objcMembers class Sealed: NSObject, Codable {
15316+ let sealed: Int
15317+
15318+ enum CodingKeys: String, CodingKey {
15319+ case sealed = "sealed"
15320+ }
15321+
15322+ init(sealed: Int) {
15323+ self.sealed = sealed
15324+ }
15325+}
15326+
15327+// MARK: Sealed convenience initializers and mutators
15328+
15329+extension Sealed {
15330+ convenience init(data: Data) throws {
15331+ let me = try newJSONDecoder().decode(Sealed.self, from: data)
15332+ self.init(sealed: me.sealed)
15333+ }
15334+
15335+ convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
15336+ guard let data = json.data(using: encoding) else {
15337+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
15338+ }
15339+ try self.init(data: data)
15340+ }
15341+
15342+ convenience init(fromURL url: URL) throws {
15343+ try self.init(data: try Data(contentsOf: url))
15344+ }
15345+
15346+ func with(
15347+ sealed: Int? = nil
15348+ ) -> Sealed {
15349+ return Sealed(
15350+ sealed: sealed ?? self.sealed
15351+ )
15352+ }
15353+
15354+ func jsonData() throws -> Data {
15355+ return try newJSONEncoder().encode(self)
15356+ }
15357+
15358+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
15359+ return String(data: try self.jsonData(), encoding: encoding)
15360+ }
15361+}
15362+
15363+// MARK: - Sel
15364+@objcMembers class Sel: NSObject, Codable {
15365+ let sel: Int
15366+
15367+ enum CodingKeys: String, CodingKey {
15368+ case sel = "SEL"
15369+ }
15370+
15371+ init(sel: Int) {
15372+ self.sel = sel
15373+ }
15374+}
15375+
15376+// MARK: Sel convenience initializers and mutators
15377+
15378+extension Sel {
15379+ convenience init(data: Data) throws {
15380+ let me = try newJSONDecoder().decode(Sel.self, from: data)
15381+ self.init(sel: me.sel)
15382+ }
15383+
15384+ convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
15385+ guard let data = json.data(using: encoding) else {
15386+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
15387+ }
15388+ try self.init(data: data)
15389+ }
15390+
15391+ convenience init(fromURL url: URL) throws {
15392+ try self.init(data: try Data(contentsOf: url))
15393+ }
15394+
15395+ func with(
15396+ sel: Int? = nil
15397+ ) -> Sel {
15398+ return Sel(
15399+ sel: sel ?? self.sel
15400+ )
15401+ }
15402+
15403+ func jsonData() throws -> Data {
15404+ return try newJSONEncoder().encode(self)
15405+ }
15406+
15407+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
15408+ return String(data: try self.jsonData(), encoding: encoding)
15409+ }
15410+}
15411+
1542215412 // MARK: - Select
1542315413 @objcMembers class Select: NSObject, Codable {
1542415414 let select: Int
@@ -17624,113 +17614,18 @@ extension UnmarshalJSON {
1762417614 }
1762517615 }
1762617616
17627-// MARK: - Unsafe
17628-@objcMembers class Unsafe: NSObject, Codable {
17629- let unsafe: Int
17630-
17631- enum CodingKeys: String, CodingKey {
17632- case unsafe = "unsafe"
17633- }
17634-
17635- init(unsafe: Int) {
17636- self.unsafe = unsafe
17637- }
17638-}
17639-
17640-// MARK: Unsafe convenience initializers and mutators
17641-
17642-extension Unsafe {
17643- convenience init(data: Data) throws {
17644- let me = try newJSONDecoder().decode(Unsafe.self, from: data)
17645- self.init(unsafe: me.unsafe)
17646- }
17647-
17648- convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
17649- guard let data = json.data(using: encoding) else {
17650- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
17651- }
17652- try self.init(data: data)
17653- }
17654-
17655- convenience init(fromURL url: URL) throws {
17656- try self.init(data: try Data(contentsOf: url))
17657- }
17658-
17659- func with(
17660- unsafe: Int? = nil
17661- ) -> Unsafe {
17662- return Unsafe(
17663- unsafe: unsafe ?? self.unsafe
17664- )
17665- }
17666-
17667- func jsonData() throws -> Data {
17668- return try newJSONEncoder().encode(self)
17669- }
17670-
17671- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
17672- return String(data: try self.jsonData(), encoding: encoding)
17673- }
17674-}
17675-
17676-// MARK: - UseSerializers
17677-@objcMembers class UseSerializers: NSObject, Codable {
17678- let useSerializers: Int
17679-
17680- enum CodingKeys: String, CodingKey {
17681- case useSerializers = "UseSerializers"
17682- }
17683-
17684- init(useSerializers: Int) {
17685- self.useSerializers = useSerializers
17686- }
17687-}
17688-
17689-// MARK: UseSerializers convenience initializers and mutators
17690-
17691-extension UseSerializers {
17692- convenience init(data: Data) throws {
17693- let me = try newJSONDecoder().decode(UseSerializers.self, from: data)
17694- self.init(useSerializers: me.useSerializers)
17695- }
17696-
17697- convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
17698- guard let data = json.data(using: encoding) else {
17699- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
17700- }
17701- try self.init(data: data)
17702- }
17703-
17704- convenience init(fromURL url: URL) throws {
17705- try self.init(data: try Data(contentsOf: url))
17706- }
17707-
17708- func with(
17709- useSerializers: Int? = nil
17710- ) -> UseSerializers {
17711- return UseSerializers(
17712- useSerializers: useSerializers ?? self.useSerializers
17713- )
17714- }
17715-
17716- func jsonData() throws -> Data {
17717- return try newJSONEncoder().encode(self)
17718- }
17719-
17720- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
17721- return String(data: try self.jsonData(), encoding: encoding)
17722- }
17723-}
17724-
1772517617 // MARK: - Obj6
1772617618 @objcMembers class Obj6: NSObject, Codable {
1772717619 let dummy: Int
17620+ let obj6Unowned: Unowned
1772817621 let obj6Var: Var
1772917622 let obj6Weak: Weak
1773017623 let obj6Where: Where
1773117624 let obj6While: While
1773217625 let obj6WillSet: WillSet
17626+ let unsafe: Unsafe
1773317627 let unsigned: Unsigned
17628+ let useSerializers: UseSerializers
1773417629 let ushort: Ushort
1773517630 let using: Using
1773617631 let utf8JSONReader: Utf8JSONReader
@@ -17748,12 +17643,15 @@ extension UseSerializers {
1774817643
1774917644 enum CodingKeys: String, CodingKey {
1775017645 case dummy = "dummy"
17646+ case obj6Unowned = "unowned"
1775117647 case obj6Var = "var"
1775217648 case obj6Weak = "weak"
1775317649 case obj6Where = "where"
1775417650 case obj6While = "while"
1775517651 case obj6WillSet = "willSet"
17652+ case unsafe = "unsafe"
1775617653 case unsigned = "unsigned"
17654+ case useSerializers = "UseSerializers"
1775717655 case ushort = "ushort"
1775817656 case using = "using"
1775917657 case utf8JSONReader = "Utf8JsonReader"
@@ -17770,14 +17668,17 @@ extension UseSerializers {
1777017668 case yield = "yield"
1777117669 }
1777217670
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) {
17671+ init(dummy: Int, obj6Unowned: Unowned, obj6Var: Var, obj6Weak: Weak, obj6Where: Where, obj6While: While, obj6WillSet: WillSet, unsafe: Unsafe, unsigned: Unsigned, useSerializers: UseSerializers, 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) {
1777417672 self.dummy = dummy
17673+ self.obj6Unowned = obj6Unowned
1777517674 self.obj6Var = obj6Var
1777617675 self.obj6Weak = obj6Weak
1777717676 self.obj6Where = obj6Where
1777817677 self.obj6While = obj6While
1777917678 self.obj6WillSet = obj6WillSet
17679+ self.unsafe = unsafe
1778017680 self.unsigned = unsigned
17681+ self.useSerializers = useSerializers
1778117682 self.ushort = ushort
1778217683 self.using = using
1778317684 self.utf8JSONReader = utf8JSONReader
@@ -17800,7 +17701,7 @@ extension UseSerializers {
1780017701 extension Obj6 {
1780117702 convenience init(data: Data) throws {
1780217703 let me = try newJSONDecoder().decode(Obj6.self, from: data)
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)
17704+ self.init(dummy: me.dummy, obj6Unowned: me.obj6Unowned, obj6Var: me.obj6Var, obj6Weak: me.obj6Weak, obj6Where: me.obj6Where, obj6While: me.obj6While, obj6WillSet: me.obj6WillSet, unsafe: me.unsafe, unsigned: me.unsigned, useSerializers: me.useSerializers, 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)
1780417705 }
1780517706
1780617707 convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -17816,12 +17717,15 @@ extension Obj6 {
1781617717
1781717718 func with(
1781817719 dummy: Int? = nil,
17720+ obj6Unowned: Unowned? = nil,
1781917721 obj6Var: Var? = nil,
1782017722 obj6Weak: Weak? = nil,
1782117723 obj6Where: Where? = nil,
1782217724 obj6While: While? = nil,
1782317725 obj6WillSet: WillSet? = nil,
17726+ unsafe: Unsafe? = nil,
1782417727 unsigned: Unsigned? = nil,
17728+ useSerializers: UseSerializers? = nil,
1782517729 ushort: Ushort? = nil,
1782617730 using: Using? = nil,
1782717731 utf8JSONReader: Utf8JSONReader? = nil,
@@ -17839,12 +17743,15 @@ extension Obj6 {
1783917743 ) -> Obj6 {
1784017744 return Obj6(
1784117745 dummy: dummy ?? self.dummy,
17746+ obj6Unowned: obj6Unowned ?? self.obj6Unowned,
1784217747 obj6Var: obj6Var ?? self.obj6Var,
1784317748 obj6Weak: obj6Weak ?? self.obj6Weak,
1784417749 obj6Where: obj6Where ?? self.obj6Where,
1784517750 obj6While: obj6While ?? self.obj6While,
1784617751 obj6WillSet: obj6WillSet ?? self.obj6WillSet,
17752+ unsafe: unsafe ?? self.unsafe,
1784717753 unsigned: unsigned ?? self.unsigned,
17754+ useSerializers: useSerializers ?? self.useSerializers,
1784817755 ushort: ushort ?? self.ushort,
1784917756 using: using ?? self.using,
1785017757 utf8JSONReader: utf8JSONReader ?? self.utf8JSONReader,
@@ -17871,6 +17778,55 @@ extension Obj6 {
1787117778 }
1787217779 }
1787317780
17781+// MARK: - Unowned
17782+@objcMembers class Unowned: NSObject, Codable {
17783+ let unownedUnowned: Int
17784+
17785+ enum CodingKeys: String, CodingKey {
17786+ case unownedUnowned = "unowned"
17787+ }
17788+
17789+ init(unownedUnowned: Int) {
17790+ self.unownedUnowned = unownedUnowned
17791+ }
17792+}
17793+
17794+// MARK: Unowned convenience initializers and mutators
17795+
17796+extension Unowned {
17797+ convenience init(data: Data) throws {
17798+ let me = try newJSONDecoder().decode(Unowned.self, from: data)
17799+ self.init(unownedUnowned: me.unownedUnowned)
17800+ }
17801+
17802+ convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
17803+ guard let data = json.data(using: encoding) else {
17804+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
17805+ }
17806+ try self.init(data: data)
17807+ }
17808+
17809+ convenience init(fromURL url: URL) throws {
17810+ try self.init(data: try Data(contentsOf: url))
17811+ }
17812+
17813+ func with(
17814+ unownedUnowned: Int? = nil
17815+ ) -> Unowned {
17816+ return Unowned(
17817+ unownedUnowned: unownedUnowned ?? self.unownedUnowned
17818+ )
17819+ }
17820+
17821+ func jsonData() throws -> Data {
17822+ return try newJSONEncoder().encode(self)
17823+ }
17824+
17825+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
17826+ return String(data: try self.jsonData(), encoding: encoding)
17827+ }
17828+}
17829+
1787417830 // MARK: - Var
1787517831 @objcMembers class Var: NSObject, Codable {
1787617832 let varVar: Int
@@ -18116,6 +18072,55 @@ extension WillSet {
1811618072 }
1811718073 }
1811818074
18075+// MARK: - Unsafe
18076+@objcMembers class Unsafe: NSObject, Codable {
18077+ let unsafe: Int
18078+
18079+ enum CodingKeys: String, CodingKey {
18080+ case unsafe = "unsafe"
18081+ }
18082+
18083+ init(unsafe: Int) {
18084+ self.unsafe = unsafe
18085+ }
18086+}
18087+
18088+// MARK: Unsafe convenience initializers and mutators
18089+
18090+extension Unsafe {
18091+ convenience init(data: Data) throws {
18092+ let me = try newJSONDecoder().decode(Unsafe.self, from: data)
18093+ self.init(unsafe: me.unsafe)
18094+ }
18095+
18096+ convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
18097+ guard let data = json.data(using: encoding) else {
18098+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
18099+ }
18100+ try self.init(data: data)
18101+ }
18102+
18103+ convenience init(fromURL url: URL) throws {
18104+ try self.init(data: try Data(contentsOf: url))
18105+ }
18106+
18107+ func with(
18108+ unsafe: Int? = nil
18109+ ) -> Unsafe {
18110+ return Unsafe(
18111+ unsafe: unsafe ?? self.unsafe
18112+ )
18113+ }
18114+
18115+ func jsonData() throws -> Data {
18116+ return try newJSONEncoder().encode(self)
18117+ }
18118+
18119+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
18120+ return String(data: try self.jsonData(), encoding: encoding)
18121+ }
18122+}
18123+
1811918124 // MARK: - Unsigned
1812018125 @objcMembers class Unsigned: NSObject, Codable {
1812118126 let unsigned: Int
@@ -18165,6 +18170,55 @@ extension Unsigned {
1816518170 }
1816618171 }
1816718172
18173+// MARK: - UseSerializers
18174+@objcMembers class UseSerializers: NSObject, Codable {
18175+ let useSerializers: Int
18176+
18177+ enum CodingKeys: String, CodingKey {
18178+ case useSerializers = "UseSerializers"
18179+ }
18180+
18181+ init(useSerializers: Int) {
18182+ self.useSerializers = useSerializers
18183+ }
18184+}
18185+
18186+// MARK: UseSerializers convenience initializers and mutators
18187+
18188+extension UseSerializers {
18189+ convenience init(data: Data) throws {
18190+ let me = try newJSONDecoder().decode(UseSerializers.self, from: data)
18191+ self.init(useSerializers: me.useSerializers)
18192+ }
18193+
18194+ convenience init(_ json: String, using encoding: String.Encoding = .utf8) throws {
18195+ guard let data = json.data(using: encoding) else {
18196+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
18197+ }
18198+ try self.init(data: data)
18199+ }
18200+
18201+ convenience init(fromURL url: URL) throws {
18202+ try self.init(data: try Data(contentsOf: url))
18203+ }
18204+
18205+ func with(
18206+ useSerializers: Int? = nil
18207+ ) -> UseSerializers {
18208+ return UseSerializers(
18209+ useSerializers: useSerializers ?? self.useSerializers
18210+ )
18211+ }
18212+
18213+ func jsonData() throws -> Data {
18214+ return try newJSONEncoder().encode(self)
18215+ }
18216+
18217+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
18218+ return String(data: try self.jsonData(), encoding: encoding)
18219+ }
18220+}
18221+
1816818222 // MARK: - Ushort
1816918223 @objcMembers class Ushort: NSObject, Codable {
1817018224 let ushort: Int
Mswiftprotocol-equatable--bd9068f466c1 / quicktype.swift+432 −378
@@ -7143,6 +7143,7 @@ struct Obj3: Codable, Equatable {
71437143 let locale: LocaleClass
71447144 let lock: Lock
71457145 let long: Long
7146+ let makeDictEncoder: MakeDictEncoder
71467147 let map: Map
71477148 let mapEntry: MapEntry
71487149 let marshalJSON: MarshalJSON
@@ -7153,7 +7154,6 @@ struct Obj3: Codable, Equatable {
71537154 let native: Native
71547155 let new: New
71557156 let newtonsoft: Newtonsoft
7156- let no: No
71577157 let obj3Guard: Guard
71587158 let obj3If: If
71597159 let obj3Import: Import
@@ -7169,7 +7169,6 @@ struct Obj3: Codable, Equatable {
71697169 let obj3Left: Left
71707170 let obj3Let: Let
71717171 let obj3Mutating: Mutating
7172- let obj3Nil: Nil
71737172
71747173 enum CodingKeys: String, CodingKey {
71757174 case dummy = "dummy"
@@ -7211,6 +7210,7 @@ struct Obj3: Codable, Equatable {
72117210 case locale = "Locale"
72127211 case lock = "lock"
72137212 case long = "long"
7213+ case makeDictEncoder = "makeDictEncoder"
72147214 case map = "map"
72157215 case mapEntry = "MapEntry"
72167216 case marshalJSON = "MarshalJSON"
@@ -7221,7 +7221,6 @@ struct Obj3: Codable, Equatable {
72217221 case native = "native"
72227222 case new = "new"
72237223 case newtonsoft = "newtonsoft"
7224- case no = "NO"
72257224 case obj3Guard = "guard"
72267225 case obj3If = "if"
72277226 case obj3Import = "import"
@@ -7237,7 +7236,6 @@ struct Obj3: Codable, Equatable {
72377236 case obj3Left = "left"
72387237 case obj3Let = "let"
72397238 case obj3Mutating = "mutating"
7240- case obj3Nil = "nil"
72417239 }
72427240 }
72437241
@@ -7299,6 +7297,7 @@ extension Obj3 {
72997297 locale: LocaleClass? = nil,
73007298 lock: Lock? = nil,
73017299 long: Long? = nil,
7300+ makeDictEncoder: MakeDictEncoder? = nil,
73027301 map: Map? = nil,
73037302 mapEntry: MapEntry? = nil,
73047303 marshalJSON: MarshalJSON? = nil,
@@ -7309,7 +7308,6 @@ extension Obj3 {
73097308 native: Native? = nil,
73107309 new: New? = nil,
73117310 newtonsoft: Newtonsoft? = nil,
7312- no: No? = nil,
73137311 obj3Guard: Guard? = nil,
73147312 obj3If: If? = nil,
73157313 obj3Import: Import? = nil,
@@ -7324,8 +7322,7 @@ extension Obj3 {
73247322 obj3Lazy: Lazy? = nil,
73257323 obj3Left: Left? = nil,
73267324 obj3Let: Let? = nil,
7327- obj3Mutating: Mutating? = nil,
7328- obj3Nil: Nil? = nil
7325+ obj3Mutating: Mutating? = nil
73297326 ) -> Obj3 {
73307327 return Obj3(
73317328 dummy: dummy ?? self.dummy,
@@ -7367,6 +7364,7 @@ extension Obj3 {
73677364 locale: locale ?? self.locale,
73687365 lock: lock ?? self.lock,
73697366 long: long ?? self.long,
7367+ makeDictEncoder: makeDictEncoder ?? self.makeDictEncoder,
73707368 map: map ?? self.map,
73717369 mapEntry: mapEntry ?? self.mapEntry,
73727370 marshalJSON: marshalJSON ?? self.marshalJSON,
@@ -7377,7 +7375,6 @@ extension Obj3 {
73777375 native: native ?? self.native,
73787376 new: new ?? self.new,
73797377 newtonsoft: newtonsoft ?? self.newtonsoft,
7380- no: no ?? self.no,
73817378 obj3Guard: obj3Guard ?? self.obj3Guard,
73827379 obj3If: obj3If ?? self.obj3If,
73837380 obj3Import: obj3Import ?? self.obj3Import,
@@ -7392,8 +7389,7 @@ extension Obj3 {
73927389 obj3Lazy: obj3Lazy ?? self.obj3Lazy,
73937390 obj3Left: obj3Left ?? self.obj3Left,
73947391 obj3Let: obj3Let ?? self.obj3Let,
7395- obj3Mutating: obj3Mutating ?? self.obj3Mutating,
7396- obj3Nil: obj3Nil ?? self.obj3Nil
7392+ obj3Mutating: obj3Mutating ?? self.obj3Mutating
73977393 )
73987394 }
73997395
@@ -9312,6 +9308,56 @@ extension Long {
93129308 // for types that require the use of JSONAny, nor will the implementation of Hashable be
93139309 // synthesized for types that have collections (such as arrays or dictionaries).
93149310
9311+// MARK: - MakeDictEncoder
9312+struct MakeDictEncoder: Codable, Equatable {
9313+ let makeDictEncoder: Int
9314+
9315+ enum CodingKeys: String, CodingKey {
9316+ case makeDictEncoder = "makeDictEncoder"
9317+ }
9318+}
9319+
9320+// MARK: MakeDictEncoder convenience initializers and mutators
9321+
9322+extension MakeDictEncoder {
9323+ init(data: Data) throws {
9324+ self = try newJSONDecoder().decode(MakeDictEncoder.self, from: data)
9325+ }
9326+
9327+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
9328+ guard let data = json.data(using: encoding) else {
9329+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
9330+ }
9331+ try self.init(data: data)
9332+ }
9333+
9334+ init(fromURL url: URL) throws {
9335+ try self.init(data: try Data(contentsOf: url))
9336+ }
9337+
9338+ func with(
9339+ makeDictEncoder: Int? = nil
9340+ ) -> MakeDictEncoder {
9341+ return MakeDictEncoder(
9342+ makeDictEncoder: makeDictEncoder ?? self.makeDictEncoder
9343+ )
9344+ }
9345+
9346+ func jsonData() throws -> Data {
9347+ return try newJSONEncoder().encode(self)
9348+ }
9349+
9350+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
9351+ return String(data: try self.jsonData(), encoding: encoding)
9352+ }
9353+}
9354+
9355+//
9356+// Hashable or Equatable:
9357+// The compiler will not be able to synthesize the implementation of Hashable or Equatable
9358+// for types that require the use of JSONAny, nor will the implementation of Hashable be
9359+// synthesized for types that have collections (such as arrays or dictionaries).
9360+
93159361 // MARK: - Map
93169362 struct Map: Codable, Equatable {
93179363 let map: Int
@@ -9812,56 +9858,6 @@ extension Newtonsoft {
98129858 // for types that require the use of JSONAny, nor will the implementation of Hashable be
98139859 // synthesized for types that have collections (such as arrays or dictionaries).
98149860
9815-// MARK: - No
9816-struct No: Codable, Equatable {
9817- let no: Int
9818-
9819- enum CodingKeys: String, CodingKey {
9820- case no = "NO"
9821- }
9822-}
9823-
9824-// MARK: No convenience initializers and mutators
9825-
9826-extension No {
9827- init(data: Data) throws {
9828- self = try newJSONDecoder().decode(No.self, from: data)
9829- }
9830-
9831- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
9832- guard let data = json.data(using: encoding) else {
9833- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
9834- }
9835- try self.init(data: data)
9836- }
9837-
9838- init(fromURL url: URL) throws {
9839- try self.init(data: try Data(contentsOf: url))
9840- }
9841-
9842- func with(
9843- no: Int? = nil
9844- ) -> No {
9845- return No(
9846- no: no ?? self.no
9847- )
9848- }
9849-
9850- func jsonData() throws -> Data {
9851- return try newJSONEncoder().encode(self)
9852- }
9853-
9854- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
9855- return String(data: try self.jsonData(), encoding: encoding)
9856- }
9857-}
9858-
9859-//
9860-// Hashable or Equatable:
9861-// The compiler will not be able to synthesize the implementation of Hashable or Equatable
9862-// for types that require the use of JSONAny, nor will the implementation of Hashable be
9863-// synthesized for types that have collections (such as arrays or dictionaries).
9864-
98659861 // MARK: - Guard
98669862 struct Guard: Codable, Equatable {
98679863 let guardGuard: Int
@@ -10612,59 +10608,10 @@ extension Mutating {
1061210608 // for types that require the use of JSONAny, nor will the implementation of Hashable be
1061310609 // synthesized for types that have collections (such as arrays or dictionaries).
1061410610
10615-// MARK: - Nil
10616-struct Nil: Codable, Equatable {
10617- let nilNil: Int
10618-
10619- enum CodingKeys: String, CodingKey {
10620- case nilNil = "nil"
10621- }
10622-}
10623-
10624-// MARK: Nil convenience initializers and mutators
10625-
10626-extension Nil {
10627- init(data: Data) throws {
10628- self = try newJSONDecoder().decode(Nil.self, from: data)
10629- }
10630-
10631- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
10632- guard let data = json.data(using: encoding) else {
10633- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
10634- }
10635- try self.init(data: data)
10636- }
10637-
10638- init(fromURL url: URL) throws {
10639- try self.init(data: try Data(contentsOf: url))
10640- }
10641-
10642- func with(
10643- nilNil: Int? = nil
10644- ) -> Nil {
10645- return Nil(
10646- nilNil: nilNil ?? self.nilNil
10647- )
10648- }
10649-
10650- func jsonData() throws -> Data {
10651- return try newJSONEncoder().encode(self)
10652- }
10653-
10654- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
10655- return String(data: try self.jsonData(), encoding: encoding)
10656- }
10657-}
10658-
10659-//
10660-// Hashable or Equatable:
10661-// The compiler will not be able to synthesize the implementation of Hashable or Equatable
10662-// for types that require the use of JSONAny, nor will the implementation of Hashable be
10663-// synthesized for types that have collections (such as arrays or dictionaries).
10664-
1066510611 // MARK: - Obj4
1066610612 struct Obj4: Codable, Equatable {
1066710613 let dummy: Int
10614+ let no: No
1066810615 let noSuchMethod: NoSuchMethod
1066910616 let noexcept: Noexcept
1067010617 let nonatomic: Nonatomic
@@ -10678,6 +10625,7 @@ struct Obj4: Codable, Equatable {
1067810625 let null: Null
1067910626 let nullptr: Nullptr
1068010627 let number: Number
10628+ let obj4Nil: Nil
1068110629 let obj4None: NoneClass
1068210630 let obj4Nonmutating: Nonmutating
1068310631 let obj4Null: NullClass
@@ -10727,11 +10675,10 @@ struct Obj4: Codable, Equatable {
1072710675 let runtimeType: RuntimeType
1072810676 let s: S
1072910677 let sbyte: Sbyte
10730- let sealed: Sealed
10731- let sel: Sel
1073210678
1073310679 enum CodingKeys: String, CodingKey {
1073410680 case dummy = "dummy"
10681+ case no = "NO"
1073510682 case noSuchMethod = "noSuchMethod"
1073610683 case noexcept = "noexcept"
1073710684 case nonatomic = "nonatomic"
@@ -10745,6 +10692,7 @@ struct Obj4: Codable, Equatable {
1074510692 case null = "NULL"
1074610693 case nullptr = "nullptr"
1074710694 case number = "number"
10695+ case obj4Nil = "nil"
1074810696 case obj4None = "none"
1074910697 case obj4Nonmutating = "nonmutating"
1075010698 case obj4Null = "null"
@@ -10794,8 +10742,6 @@ struct Obj4: Codable, Equatable {
1079410742 case runtimeType = "runtimeType"
1079510743 case s = "s"
1079610744 case sbyte = "sbyte"
10797- case sealed = "sealed"
10798- case sel = "SEL"
1079910745 }
1080010746 }
1080110747
@@ -10819,6 +10765,7 @@ extension Obj4 {
1081910765
1082010766 func with(
1082110767 dummy: Int? = nil,
10768+ no: No? = nil,
1082210769 noSuchMethod: NoSuchMethod? = nil,
1082310770 noexcept: Noexcept? = nil,
1082410771 nonatomic: Nonatomic? = nil,
@@ -10832,6 +10779,7 @@ extension Obj4 {
1083210779 null: Null? = nil,
1083310780 nullptr: Nullptr? = nil,
1083410781 number: Number? = nil,
10782+ obj4Nil: Nil? = nil,
1083510783 obj4None: NoneClass? = nil,
1083610784 obj4Nonmutating: Nonmutating? = nil,
1083710785 obj4Null: NullClass? = nil,
@@ -10880,12 +10828,11 @@ extension Obj4 {
1088010828 retain: Retain? = nil,
1088110829 runtimeType: RuntimeType? = nil,
1088210830 s: S? = nil,
10883- sbyte: Sbyte? = nil,
10884- sealed: Sealed? = nil,
10885- sel: Sel? = nil
10831+ sbyte: Sbyte? = nil
1088610832 ) -> Obj4 {
1088710833 return Obj4(
1088810834 dummy: dummy ?? self.dummy,
10835+ no: no ?? self.no,
1088910836 noSuchMethod: noSuchMethod ?? self.noSuchMethod,
1089010837 noexcept: noexcept ?? self.noexcept,
1089110838 nonatomic: nonatomic ?? self.nonatomic,
@@ -10899,6 +10846,7 @@ extension Obj4 {
1089910846 null: null ?? self.null,
1090010847 nullptr: nullptr ?? self.nullptr,
1090110848 number: number ?? self.number,
10849+ obj4Nil: obj4Nil ?? self.obj4Nil,
1090210850 obj4None: obj4None ?? self.obj4None,
1090310851 obj4Nonmutating: obj4Nonmutating ?? self.obj4Nonmutating,
1090410852 obj4Null: obj4Null ?? self.obj4Null,
@@ -10947,9 +10895,57 @@ extension Obj4 {
1094710895 retain: retain ?? self.retain,
1094810896 runtimeType: runtimeType ?? self.runtimeType,
1094910897 s: s ?? self.s,
10950- sbyte: sbyte ?? self.sbyte,
10951- sealed: sealed ?? self.sealed,
10952- sel: sel ?? self.sel
10898+ sbyte: sbyte ?? self.sbyte
10899+ )
10900+ }
10901+
10902+ func jsonData() throws -> Data {
10903+ return try newJSONEncoder().encode(self)
10904+ }
10905+
10906+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
10907+ return String(data: try self.jsonData(), encoding: encoding)
10908+ }
10909+}
10910+
10911+//
10912+// Hashable or Equatable:
10913+// The compiler will not be able to synthesize the implementation of Hashable or Equatable
10914+// for types that require the use of JSONAny, nor will the implementation of Hashable be
10915+// synthesized for types that have collections (such as arrays or dictionaries).
10916+
10917+// MARK: - No
10918+struct No: Codable, Equatable {
10919+ let no: Int
10920+
10921+ enum CodingKeys: String, CodingKey {
10922+ case no = "NO"
10923+ }
10924+}
10925+
10926+// MARK: No convenience initializers and mutators
10927+
10928+extension No {
10929+ init(data: Data) throws {
10930+ self = try newJSONDecoder().decode(No.self, from: data)
10931+ }
10932+
10933+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
10934+ guard let data = json.data(using: encoding) else {
10935+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
10936+ }
10937+ try self.init(data: data)
10938+ }
10939+
10940+ init(fromURL url: URL) throws {
10941+ try self.init(data: try Data(contentsOf: url))
10942+ }
10943+
10944+ func with(
10945+ no: Int? = nil
10946+ ) -> No {
10947+ return No(
10948+ no: no ?? self.no
1095310949 )
1095410950 }
1095510951
@@ -11618,6 +11614,56 @@ extension Number {
1161811614 // for types that require the use of JSONAny, nor will the implementation of Hashable be
1161911615 // synthesized for types that have collections (such as arrays or dictionaries).
1162011616
11617+// MARK: - Nil
11618+struct Nil: Codable, Equatable {
11619+ let nilNil: Int
11620+
11621+ enum CodingKeys: String, CodingKey {
11622+ case nilNil = "nil"
11623+ }
11624+}
11625+
11626+// MARK: Nil convenience initializers and mutators
11627+
11628+extension Nil {
11629+ init(data: Data) throws {
11630+ self = try newJSONDecoder().decode(Nil.self, from: data)
11631+ }
11632+
11633+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
11634+ guard let data = json.data(using: encoding) else {
11635+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
11636+ }
11637+ try self.init(data: data)
11638+ }
11639+
11640+ init(fromURL url: URL) throws {
11641+ try self.init(data: try Data(contentsOf: url))
11642+ }
11643+
11644+ func with(
11645+ nilNil: Int? = nil
11646+ ) -> Nil {
11647+ return Nil(
11648+ nilNil: nilNil ?? self.nilNil
11649+ )
11650+ }
11651+
11652+ func jsonData() throws -> Data {
11653+ return try newJSONEncoder().encode(self)
11654+ }
11655+
11656+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
11657+ return String(data: try self.jsonData(), encoding: encoding)
11658+ }
11659+}
11660+
11661+//
11662+// Hashable or Equatable:
11663+// The compiler will not be able to synthesize the implementation of Hashable or Equatable
11664+// for types that require the use of JSONAny, nor will the implementation of Hashable be
11665+// synthesized for types that have collections (such as arrays or dictionaries).
11666+
1162111667 // MARK: - NoneClass
1162211668 struct NoneClass: Codable, Equatable {
1162311669 let none: Int
@@ -14068,106 +14114,6 @@ extension Sbyte {
1406814114 // for types that require the use of JSONAny, nor will the implementation of Hashable be
1406914115 // synthesized for types that have collections (such as arrays or dictionaries).
1407014116
14071-// MARK: - Sealed
14072-struct Sealed: Codable, Equatable {
14073- let sealed: Int
14074-
14075- enum CodingKeys: String, CodingKey {
14076- case sealed = "sealed"
14077- }
14078-}
14079-
14080-// MARK: Sealed convenience initializers and mutators
14081-
14082-extension Sealed {
14083- init(data: Data) throws {
14084- self = try newJSONDecoder().decode(Sealed.self, from: data)
14085- }
14086-
14087- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
14088- guard let data = json.data(using: encoding) else {
14089- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
14090- }
14091- try self.init(data: data)
14092- }
14093-
14094- init(fromURL url: URL) throws {
14095- try self.init(data: try Data(contentsOf: url))
14096- }
14097-
14098- func with(
14099- sealed: Int? = nil
14100- ) -> Sealed {
14101- return Sealed(
14102- sealed: sealed ?? self.sealed
14103- )
14104- }
14105-
14106- func jsonData() throws -> Data {
14107- return try newJSONEncoder().encode(self)
14108- }
14109-
14110- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
14111- return String(data: try self.jsonData(), encoding: encoding)
14112- }
14113-}
14114-
14115-//
14116-// Hashable or Equatable:
14117-// The compiler will not be able to synthesize the implementation of Hashable or Equatable
14118-// for types that require the use of JSONAny, nor will the implementation of Hashable be
14119-// synthesized for types that have collections (such as arrays or dictionaries).
14120-
14121-// MARK: - Sel
14122-struct Sel: Codable, Equatable {
14123- let sel: Int
14124-
14125- enum CodingKeys: String, CodingKey {
14126- case sel = "SEL"
14127- }
14128-}
14129-
14130-// MARK: Sel convenience initializers and mutators
14131-
14132-extension Sel {
14133- init(data: Data) throws {
14134- self = try newJSONDecoder().decode(Sel.self, from: data)
14135- }
14136-
14137- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
14138- guard let data = json.data(using: encoding) else {
14139- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
14140- }
14141- try self.init(data: data)
14142- }
14143-
14144- init(fromURL url: URL) throws {
14145- try self.init(data: try Data(contentsOf: url))
14146- }
14147-
14148- func with(
14149- sel: Int? = nil
14150- ) -> Sel {
14151- return Sel(
14152- sel: sel ?? self.sel
14153- )
14154- }
14155-
14156- func jsonData() throws -> Data {
14157- return try newJSONEncoder().encode(self)
14158- }
14159-
14160- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
14161- return String(data: try self.jsonData(), encoding: encoding)
14162- }
14163-}
14164-
14165-//
14166-// Hashable or Equatable:
14167-// The compiler will not be able to synthesize the implementation of Hashable or Equatable
14168-// for types that require the use of JSONAny, nor will the implementation of Hashable be
14169-// synthesized for types that have collections (such as arrays or dictionaries).
14170-
1417114117 // MARK: - Obj5
1417214118 struct Obj5: Codable, Equatable {
1417314119 let dummy: Int
@@ -14185,10 +14131,11 @@ struct Obj5: Codable, Equatable {
1418514131 let obj5Try: Try
1418614132 let obj5Type: Obj5Type
1418714133 let obj5Typealias: Typealias
14188- let obj5Unowned: Unowned
1418914134 let primitiveKind: PrimitiveKind
1419014135 let purpleSelf: Obj5Self
1419114136 let purpleTrue: TrueClass
14137+ let sealed: Sealed
14138+ let sel: Sel
1419214139 let select: Select
1419314140 let sendable: Sendable
1419414141 let serialDescriptor: SerialDescriptor
@@ -14234,8 +14181,6 @@ struct Obj5: Codable, Equatable {
1423414181 let undefined: Undefined
1423514182 let union: Union
1423614183 let unmarshalJSON: UnmarshalJSON
14237- let unsafe: Unsafe
14238- let useSerializers: UseSerializers
1423914184
1424014185 enum CodingKeys: String, CodingKey {
1424114186 case dummy = "dummy"
@@ -14253,10 +14198,11 @@ struct Obj5: Codable, Equatable {
1425314198 case obj5Try = "try"
1425414199 case obj5Type = "type"
1425514200 case obj5Typealias = "typealias"
14256- case obj5Unowned = "unowned"
1425714201 case primitiveKind = "PrimitiveKind"
1425814202 case purpleSelf = "self"
1425914203 case purpleTrue = "true"
14204+ case sealed = "sealed"
14205+ case sel = "SEL"
1426014206 case select = "select"
1426114207 case sendable = "Sendable"
1426214208 case serialDescriptor = "SerialDescriptor"
@@ -14302,8 +14248,6 @@ struct Obj5: Codable, Equatable {
1430214248 case undefined = "undefined"
1430314249 case union = "union"
1430414250 case unmarshalJSON = "UnmarshalJSON"
14305- case unsafe = "unsafe"
14306- case useSerializers = "UseSerializers"
1430714251 }
1430814252 }
1430914253
@@ -14341,10 +14285,11 @@ extension Obj5 {
1434114285 obj5Try: Try? = nil,
1434214286 obj5Type: Obj5Type? = nil,
1434314287 obj5Typealias: Typealias? = nil,
14344- obj5Unowned: Unowned? = nil,
1434514288 primitiveKind: PrimitiveKind? = nil,
1434614289 purpleSelf: Obj5Self? = nil,
1434714290 purpleTrue: TrueClass? = nil,
14291+ sealed: Sealed? = nil,
14292+ sel: Sel? = nil,
1434814293 select: Select? = nil,
1434914294 sendable: Sendable? = nil,
1435014295 serialDescriptor: SerialDescriptor? = nil,
@@ -14389,9 +14334,7 @@ extension Obj5 {
1438914334 unchecked: Unchecked? = nil,
1439014335 undefined: Undefined? = nil,
1439114336 union: Union? = nil,
14392- unmarshalJSON: UnmarshalJSON? = nil,
14393- unsafe: Unsafe? = nil,
14394- useSerializers: UseSerializers? = nil
14337+ unmarshalJSON: UnmarshalJSON? = nil
1439514338 ) -> Obj5 {
1439614339 return Obj5(
1439714340 dummy: dummy ?? self.dummy,
@@ -14409,10 +14352,11 @@ extension Obj5 {
1440914352 obj5Try: obj5Try ?? self.obj5Try,
1441014353 obj5Type: obj5Type ?? self.obj5Type,
1441114354 obj5Typealias: obj5Typealias ?? self.obj5Typealias,
14412- obj5Unowned: obj5Unowned ?? self.obj5Unowned,
1441314355 primitiveKind: primitiveKind ?? self.primitiveKind,
1441414356 purpleSelf: purpleSelf ?? self.purpleSelf,
1441514357 purpleTrue: purpleTrue ?? self.purpleTrue,
14358+ sealed: sealed ?? self.sealed,
14359+ sel: sel ?? self.sel,
1441614360 select: select ?? self.select,
1441714361 sendable: sendable ?? self.sendable,
1441814362 serialDescriptor: serialDescriptor ?? self.serialDescriptor,
@@ -14457,9 +14401,7 @@ extension Obj5 {
1445714401 unchecked: unchecked ?? self.unchecked,
1445814402 undefined: undefined ?? self.undefined,
1445914403 union: union ?? self.union,
14460- unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON,
14461- unsafe: unsafe ?? self.unsafe,
14462- useSerializers: useSerializers ?? self.useSerializers
14404+ unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON
1446314405 )
1446414406 }
1446514407
@@ -15178,20 +15120,20 @@ extension Typealias {
1517815120 // for types that require the use of JSONAny, nor will the implementation of Hashable be
1517915121 // synthesized for types that have collections (such as arrays or dictionaries).
1518015122
15181-// MARK: - Unowned
15182-struct Unowned: Codable, Equatable {
15183- let unownedUnowned: Int
15123+// MARK: - PrimitiveKind
15124+struct PrimitiveKind: Codable, Equatable {
15125+ let primitiveKind: Int
1518415126
1518515127 enum CodingKeys: String, CodingKey {
15186- case unownedUnowned = "unowned"
15128+ case primitiveKind = "PrimitiveKind"
1518715129 }
1518815130 }
1518915131
15190-// MARK: Unowned convenience initializers and mutators
15132+// MARK: PrimitiveKind convenience initializers and mutators
1519115133
15192-extension Unowned {
15134+extension PrimitiveKind {
1519315135 init(data: Data) throws {
15194- self = try newJSONDecoder().decode(Unowned.self, from: data)
15136+ self = try newJSONDecoder().decode(PrimitiveKind.self, from: data)
1519515137 }
1519615138
1519715139 init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -15206,10 +15148,10 @@ extension Unowned {
1520615148 }
1520715149
1520815150 func with(
15209- unownedUnowned: Int? = nil
15210- ) -> Unowned {
15211- return Unowned(
15212- unownedUnowned: unownedUnowned ?? self.unownedUnowned
15151+ primitiveKind: Int? = nil
15152+ ) -> PrimitiveKind {
15153+ return PrimitiveKind(
15154+ primitiveKind: primitiveKind ?? self.primitiveKind
1521315155 )
1521415156 }
1521515157
@@ -15228,20 +15170,20 @@ extension Unowned {
1522815170 // for types that require the use of JSONAny, nor will the implementation of Hashable be
1522915171 // synthesized for types that have collections (such as arrays or dictionaries).
1523015172
15231-// MARK: - PrimitiveKind
15232-struct PrimitiveKind: Codable, Equatable {
15233- let primitiveKind: Int
15173+// MARK: - Obj5Self
15174+struct Obj5Self: Codable, Equatable {
15175+ let selfSelf: Int
1523415176
1523515177 enum CodingKeys: String, CodingKey {
15236- case primitiveKind = "PrimitiveKind"
15178+ case selfSelf = "self"
1523715179 }
1523815180 }
1523915181
15240-// MARK: PrimitiveKind convenience initializers and mutators
15182+// MARK: Obj5Self convenience initializers and mutators
1524115183
15242-extension PrimitiveKind {
15184+extension Obj5Self {
1524315185 init(data: Data) throws {
15244- self = try newJSONDecoder().decode(PrimitiveKind.self, from: data)
15186+ self = try newJSONDecoder().decode(Obj5Self.self, from: data)
1524515187 }
1524615188
1524715189 init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -15256,10 +15198,10 @@ extension PrimitiveKind {
1525615198 }
1525715199
1525815200 func with(
15259- primitiveKind: Int? = nil
15260- ) -> PrimitiveKind {
15261- return PrimitiveKind(
15262- primitiveKind: primitiveKind ?? self.primitiveKind
15201+ selfSelf: Int? = nil
15202+ ) -> Obj5Self {
15203+ return Obj5Self(
15204+ selfSelf: selfSelf ?? self.selfSelf
1526315205 )
1526415206 }
1526515207
@@ -15278,20 +15220,20 @@ extension PrimitiveKind {
1527815220 // for types that require the use of JSONAny, nor will the implementation of Hashable be
1527915221 // synthesized for types that have collections (such as arrays or dictionaries).
1528015222
15281-// MARK: - Obj5Self
15282-struct Obj5Self: Codable, Equatable {
15283- let selfSelf: Int
15223+// MARK: - TrueClass
15224+struct TrueClass: Codable, Equatable {
15225+ let trueTrue: Int
1528415226
1528515227 enum CodingKeys: String, CodingKey {
15286- case selfSelf = "self"
15228+ case trueTrue = "true"
1528715229 }
1528815230 }
1528915231
15290-// MARK: Obj5Self convenience initializers and mutators
15232+// MARK: TrueClass convenience initializers and mutators
1529115233
15292-extension Obj5Self {
15234+extension TrueClass {
1529315235 init(data: Data) throws {
15294- self = try newJSONDecoder().decode(Obj5Self.self, from: data)
15236+ self = try newJSONDecoder().decode(TrueClass.self, from: data)
1529515237 }
1529615238
1529715239 init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -15306,10 +15248,10 @@ extension Obj5Self {
1530615248 }
1530715249
1530815250 func with(
15309- selfSelf: Int? = nil
15310- ) -> Obj5Self {
15311- return Obj5Self(
15312- selfSelf: selfSelf ?? self.selfSelf
15251+ trueTrue: Int? = nil
15252+ ) -> TrueClass {
15253+ return TrueClass(
15254+ trueTrue: trueTrue ?? self.trueTrue
1531315255 )
1531415256 }
1531515257
@@ -15328,20 +15270,20 @@ extension Obj5Self {
1532815270 // for types that require the use of JSONAny, nor will the implementation of Hashable be
1532915271 // synthesized for types that have collections (such as arrays or dictionaries).
1533015272
15331-// MARK: - TrueClass
15332-struct TrueClass: Codable, Equatable {
15333- let trueTrue: Int
15273+// MARK: - Sealed
15274+struct Sealed: Codable, Equatable {
15275+ let sealed: Int
1533415276
1533515277 enum CodingKeys: String, CodingKey {
15336- case trueTrue = "true"
15278+ case sealed = "sealed"
1533715279 }
1533815280 }
1533915281
15340-// MARK: TrueClass convenience initializers and mutators
15282+// MARK: Sealed convenience initializers and mutators
1534115283
15342-extension TrueClass {
15284+extension Sealed {
1534315285 init(data: Data) throws {
15344- self = try newJSONDecoder().decode(TrueClass.self, from: data)
15286+ self = try newJSONDecoder().decode(Sealed.self, from: data)
1534515287 }
1534615288
1534715289 init(_ json: String, using encoding: String.Encoding = .utf8) throws {
@@ -15356,10 +15298,60 @@ extension TrueClass {
1535615298 }
1535715299
1535815300 func with(
15359- trueTrue: Int? = nil
15360- ) -> TrueClass {
15361- return TrueClass(
15362- trueTrue: trueTrue ?? self.trueTrue
15301+ sealed: Int? = nil
15302+ ) -> Sealed {
15303+ return Sealed(
15304+ sealed: sealed ?? self.sealed
15305+ )
15306+ }
15307+
15308+ func jsonData() throws -> Data {
15309+ return try newJSONEncoder().encode(self)
15310+ }
15311+
15312+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
15313+ return String(data: try self.jsonData(), encoding: encoding)
15314+ }
15315+}
15316+
15317+//
15318+// Hashable or Equatable:
15319+// The compiler will not be able to synthesize the implementation of Hashable or Equatable
15320+// for types that require the use of JSONAny, nor will the implementation of Hashable be
15321+// synthesized for types that have collections (such as arrays or dictionaries).
15322+
15323+// MARK: - Sel
15324+struct Sel: Codable, Equatable {
15325+ let sel: Int
15326+
15327+ enum CodingKeys: String, CodingKey {
15328+ case sel = "SEL"
15329+ }
15330+}
15331+
15332+// MARK: Sel convenience initializers and mutators
15333+
15334+extension Sel {
15335+ init(data: Data) throws {
15336+ self = try newJSONDecoder().decode(Sel.self, from: data)
15337+ }
15338+
15339+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
15340+ guard let data = json.data(using: encoding) else {
15341+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
15342+ }
15343+ try self.init(data: data)
15344+ }
15345+
15346+ init(fromURL url: URL) throws {
15347+ try self.init(data: try Data(contentsOf: url))
15348+ }
15349+
15350+ func with(
15351+ sel: Int? = nil
15352+ ) -> Sel {
15353+ return Sel(
15354+ sel: sel ?? self.sel
1536315355 )
1536415356 }
1536515357
@@ -17628,115 +17620,18 @@ extension UnmarshalJSON {
1762817620 // for types that require the use of JSONAny, nor will the implementation of Hashable be
1762917621 // synthesized for types that have collections (such as arrays or dictionaries).
1763017622
17631-// MARK: - Unsafe
17632-struct Unsafe: Codable, Equatable {
17633- let unsafe: Int
17634-
17635- enum CodingKeys: String, CodingKey {
17636- case unsafe = "unsafe"
17637- }
17638-}
17639-
17640-// MARK: Unsafe convenience initializers and mutators
17641-
17642-extension Unsafe {
17643- init(data: Data) throws {
17644- self = try newJSONDecoder().decode(Unsafe.self, from: data)
17645- }
17646-
17647- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
17648- guard let data = json.data(using: encoding) else {
17649- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
17650- }
17651- try self.init(data: data)
17652- }
17653-
17654- init(fromURL url: URL) throws {
17655- try self.init(data: try Data(contentsOf: url))
17656- }
17657-
17658- func with(
17659- unsafe: Int? = nil
17660- ) -> Unsafe {
17661- return Unsafe(
17662- unsafe: unsafe ?? self.unsafe
17663- )
17664- }
17665-
17666- func jsonData() throws -> Data {
17667- return try newJSONEncoder().encode(self)
17668- }
17669-
17670- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
17671- return String(data: try self.jsonData(), encoding: encoding)
17672- }
17673-}
17674-
17675-//
17676-// Hashable or Equatable:
17677-// The compiler will not be able to synthesize the implementation of Hashable or Equatable
17678-// for types that require the use of JSONAny, nor will the implementation of Hashable be
17679-// synthesized for types that have collections (such as arrays or dictionaries).
17680-
17681-// MARK: - UseSerializers
17682-struct UseSerializers: Codable, Equatable {
17683- let useSerializers: Int
17684-
17685- enum CodingKeys: String, CodingKey {
17686- case useSerializers = "UseSerializers"
17687- }
17688-}
17689-
17690-// MARK: UseSerializers convenience initializers and mutators
17691-
17692-extension UseSerializers {
17693- init(data: Data) throws {
17694- self = try newJSONDecoder().decode(UseSerializers.self, from: data)
17695- }
17696-
17697- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
17698- guard let data = json.data(using: encoding) else {
17699- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
17700- }
17701- try self.init(data: data)
17702- }
17703-
17704- init(fromURL url: URL) throws {
17705- try self.init(data: try Data(contentsOf: url))
17706- }
17707-
17708- func with(
17709- useSerializers: Int? = nil
17710- ) -> UseSerializers {
17711- return UseSerializers(
17712- useSerializers: useSerializers ?? self.useSerializers
17713- )
17714- }
17715-
17716- func jsonData() throws -> Data {
17717- return try newJSONEncoder().encode(self)
17718- }
17719-
17720- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
17721- return String(data: try self.jsonData(), encoding: encoding)
17722- }
17723-}
17724-
17725-//
17726-// Hashable or Equatable:
17727-// The compiler will not be able to synthesize the implementation of Hashable or Equatable
17728-// for types that require the use of JSONAny, nor will the implementation of Hashable be
17729-// synthesized for types that have collections (such as arrays or dictionaries).
17730-
1773117623 // MARK: - Obj6
1773217624 struct Obj6: Codable, Equatable {
1773317625 let dummy: Int
17626+ let obj6Unowned: Unowned
1773417627 let obj6Var: Var
1773517628 let obj6Weak: Weak
1773617629 let obj6Where: Where
1773717630 let obj6While: While
1773817631 let obj6WillSet: WillSet
17632+ let unsafe: Unsafe
1773917633 let unsigned: Unsigned
17634+ let useSerializers: UseSerializers
1774017635 let ushort: Ushort
1774117636 let using: Using
1774217637 let utf8JSONReader: Utf8JSONReader
@@ -17754,12 +17649,15 @@ struct Obj6: Codable, Equatable {
1775417649
1775517650 enum CodingKeys: String, CodingKey {
1775617651 case dummy = "dummy"
17652+ case obj6Unowned = "unowned"
1775717653 case obj6Var = "var"
1775817654 case obj6Weak = "weak"
1775917655 case obj6Where = "where"
1776017656 case obj6While = "while"
1776117657 case obj6WillSet = "willSet"
17658+ case unsafe = "unsafe"
1776217659 case unsigned = "unsigned"
17660+ case useSerializers = "UseSerializers"
1776317661 case ushort = "ushort"
1776417662 case using = "using"
1776517663 case utf8JSONReader = "Utf8JsonReader"
@@ -17797,12 +17695,15 @@ extension Obj6 {
1779717695
1779817696 func with(
1779917697 dummy: Int? = nil,
17698+ obj6Unowned: Unowned? = nil,
1780017699 obj6Var: Var? = nil,
1780117700 obj6Weak: Weak? = nil,
1780217701 obj6Where: Where? = nil,
1780317702 obj6While: While? = nil,
1780417703 obj6WillSet: WillSet? = nil,
17704+ unsafe: Unsafe? = nil,
1780517705 unsigned: Unsigned? = nil,
17706+ useSerializers: UseSerializers? = nil,
1780617707 ushort: Ushort? = nil,
1780717708 using: Using? = nil,
1780817709 utf8JSONReader: Utf8JSONReader? = nil,
@@ -17820,12 +17721,15 @@ extension Obj6 {
1782017721 ) -> Obj6 {
1782117722 return Obj6(
1782217723 dummy: dummy ?? self.dummy,
17724+ obj6Unowned: obj6Unowned ?? self.obj6Unowned,
1782317725 obj6Var: obj6Var ?? self.obj6Var,
1782417726 obj6Weak: obj6Weak ?? self.obj6Weak,
1782517727 obj6Where: obj6Where ?? self.obj6Where,
1782617728 obj6While: obj6While ?? self.obj6While,
1782717729 obj6WillSet: obj6WillSet ?? self.obj6WillSet,
17730+ unsafe: unsafe ?? self.unsafe,
1782817731 unsigned: unsigned ?? self.unsigned,
17732+ useSerializers: useSerializers ?? self.useSerializers,
1782917733 ushort: ushort ?? self.ushort,
1783017734 using: using ?? self.using,
1783117735 utf8JSONReader: utf8JSONReader ?? self.utf8JSONReader,
@@ -17858,6 +17762,56 @@ extension Obj6 {
1785817762 // for types that require the use of JSONAny, nor will the implementation of Hashable be
1785917763 // synthesized for types that have collections (such as arrays or dictionaries).
1786017764
17765+// MARK: - Unowned
17766+struct Unowned: Codable, Equatable {
17767+ let unownedUnowned: Int
17768+
17769+ enum CodingKeys: String, CodingKey {
17770+ case unownedUnowned = "unowned"
17771+ }
17772+}
17773+
17774+// MARK: Unowned convenience initializers and mutators
17775+
17776+extension Unowned {
17777+ init(data: Data) throws {
17778+ self = try newJSONDecoder().decode(Unowned.self, from: data)
17779+ }
17780+
17781+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
17782+ guard let data = json.data(using: encoding) else {
17783+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
17784+ }
17785+ try self.init(data: data)
17786+ }
17787+
17788+ init(fromURL url: URL) throws {
17789+ try self.init(data: try Data(contentsOf: url))
17790+ }
17791+
17792+ func with(
17793+ unownedUnowned: Int? = nil
17794+ ) -> Unowned {
17795+ return Unowned(
17796+ unownedUnowned: unownedUnowned ?? self.unownedUnowned
17797+ )
17798+ }
17799+
17800+ func jsonData() throws -> Data {
17801+ return try newJSONEncoder().encode(self)
17802+ }
17803+
17804+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
17805+ return String(data: try self.jsonData(), encoding: encoding)
17806+ }
17807+}
17808+
17809+//
17810+// Hashable or Equatable:
17811+// The compiler will not be able to synthesize the implementation of Hashable or Equatable
17812+// for types that require the use of JSONAny, nor will the implementation of Hashable be
17813+// synthesized for types that have collections (such as arrays or dictionaries).
17814+
1786117815 // MARK: - Var
1786217816 struct Var: Codable, Equatable {
1786317817 let varVar: Int
@@ -18108,6 +18062,56 @@ extension WillSet {
1810818062 // for types that require the use of JSONAny, nor will the implementation of Hashable be
1810918063 // synthesized for types that have collections (such as arrays or dictionaries).
1811018064
18065+// MARK: - Unsafe
18066+struct Unsafe: Codable, Equatable {
18067+ let unsafe: Int
18068+
18069+ enum CodingKeys: String, CodingKey {
18070+ case unsafe = "unsafe"
18071+ }
18072+}
18073+
18074+// MARK: Unsafe convenience initializers and mutators
18075+
18076+extension Unsafe {
18077+ init(data: Data) throws {
18078+ self = try newJSONDecoder().decode(Unsafe.self, from: data)
18079+ }
18080+
18081+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
18082+ guard let data = json.data(using: encoding) else {
18083+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
18084+ }
18085+ try self.init(data: data)
18086+ }
18087+
18088+ init(fromURL url: URL) throws {
18089+ try self.init(data: try Data(contentsOf: url))
18090+ }
18091+
18092+ func with(
18093+ unsafe: Int? = nil
18094+ ) -> Unsafe {
18095+ return Unsafe(
18096+ unsafe: unsafe ?? self.unsafe
18097+ )
18098+ }
18099+
18100+ func jsonData() throws -> Data {
18101+ return try newJSONEncoder().encode(self)
18102+ }
18103+
18104+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
18105+ return String(data: try self.jsonData(), encoding: encoding)
18106+ }
18107+}
18108+
18109+//
18110+// Hashable or Equatable:
18111+// The compiler will not be able to synthesize the implementation of Hashable or Equatable
18112+// for types that require the use of JSONAny, nor will the implementation of Hashable be
18113+// synthesized for types that have collections (such as arrays or dictionaries).
18114+
1811118115 // MARK: - Unsigned
1811218116 struct Unsigned: Codable, Equatable {
1811318117 let unsigned: Int
@@ -18158,6 +18162,56 @@ extension Unsigned {
1815818162 // for types that require the use of JSONAny, nor will the implementation of Hashable be
1815918163 // synthesized for types that have collections (such as arrays or dictionaries).
1816018164
18165+// MARK: - UseSerializers
18166+struct UseSerializers: Codable, Equatable {
18167+ let useSerializers: Int
18168+
18169+ enum CodingKeys: String, CodingKey {
18170+ case useSerializers = "UseSerializers"
18171+ }
18172+}
18173+
18174+// MARK: UseSerializers convenience initializers and mutators
18175+
18176+extension UseSerializers {
18177+ init(data: Data) throws {
18178+ self = try newJSONDecoder().decode(UseSerializers.self, from: data)
18179+ }
18180+
18181+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
18182+ guard let data = json.data(using: encoding) else {
18183+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
18184+ }
18185+ try self.init(data: data)
18186+ }
18187+
18188+ init(fromURL url: URL) throws {
18189+ try self.init(data: try Data(contentsOf: url))
18190+ }
18191+
18192+ func with(
18193+ useSerializers: Int? = nil
18194+ ) -> UseSerializers {
18195+ return UseSerializers(
18196+ useSerializers: useSerializers ?? self.useSerializers
18197+ )
18198+ }
18199+
18200+ func jsonData() throws -> Data {
18201+ return try newJSONEncoder().encode(self)
18202+ }
18203+
18204+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
18205+ return String(data: try self.jsonData(), encoding: encoding)
18206+ }
18207+}
18208+
18209+//
18210+// Hashable or Equatable:
18211+// The compiler will not be able to synthesize the implementation of Hashable or Equatable
18212+// for types that require the use of JSONAny, nor will the implementation of Hashable be
18213+// synthesized for types that have collections (such as arrays or dictionaries).
18214+
1816118215 // MARK: - Ushort
1816218216 struct Ushort: Codable, Equatable {
1816318217 let ushort: Int
Mswiftsendable-true--1c3982c78639 / quicktype.swift+390 −342
@@ -6351,6 +6351,7 @@ struct Obj3: Codable, Sendable {
63516351 let locale: LocaleClass
63526352 let lock: Lock
63536353 let long: Long
6354+ let makeDictEncoder: MakeDictEncoder
63546355 let map: Map
63556356 let mapEntry: MapEntry
63566357 let marshalJSON: MarshalJSON
@@ -6361,7 +6362,6 @@ struct Obj3: Codable, Sendable {
63616362 let native: Native
63626363 let new: New
63636364 let newtonsoft: Newtonsoft
6364- let no: No
63656365 let obj3Guard: Guard
63666366 let obj3If: If
63676367 let obj3Import: Import
@@ -6377,7 +6377,6 @@ struct Obj3: Codable, Sendable {
63776377 let obj3Left: Left
63786378 let obj3Let: Let
63796379 let obj3Mutating: Mutating
6380- let obj3Nil: Nil
63816380
63826381 enum CodingKeys: String, CodingKey {
63836382 case dummy = "dummy"
@@ -6419,6 +6418,7 @@ struct Obj3: Codable, Sendable {
64196418 case locale = "Locale"
64206419 case lock = "lock"
64216420 case long = "long"
6421+ case makeDictEncoder = "makeDictEncoder"
64226422 case map = "map"
64236423 case mapEntry = "MapEntry"
64246424 case marshalJSON = "MarshalJSON"
@@ -6429,7 +6429,6 @@ struct Obj3: Codable, Sendable {
64296429 case native = "native"
64306430 case new = "new"
64316431 case newtonsoft = "newtonsoft"
6432- case no = "NO"
64336432 case obj3Guard = "guard"
64346433 case obj3If = "if"
64356434 case obj3Import = "import"
@@ -6445,7 +6444,6 @@ struct Obj3: Codable, Sendable {
64456444 case obj3Left = "left"
64466445 case obj3Let = "let"
64476446 case obj3Mutating = "mutating"
6448- case obj3Nil = "nil"
64496447 }
64506448 }
64516449
@@ -6507,6 +6505,7 @@ extension Obj3 {
65076505 locale: LocaleClass? = nil,
65086506 lock: Lock? = nil,
65096507 long: Long? = nil,
6508+ makeDictEncoder: MakeDictEncoder? = nil,
65106509 map: Map? = nil,
65116510 mapEntry: MapEntry? = nil,
65126511 marshalJSON: MarshalJSON? = nil,
@@ -6517,7 +6516,6 @@ extension Obj3 {
65176516 native: Native? = nil,
65186517 new: New? = nil,
65196518 newtonsoft: Newtonsoft? = nil,
6520- no: No? = nil,
65216519 obj3Guard: Guard? = nil,
65226520 obj3If: If? = nil,
65236521 obj3Import: Import? = nil,
@@ -6532,8 +6530,7 @@ extension Obj3 {
65326530 obj3Lazy: Lazy? = nil,
65336531 obj3Left: Left? = nil,
65346532 obj3Let: Let? = nil,
6535- obj3Mutating: Mutating? = nil,
6536- obj3Nil: Nil? = nil
6533+ obj3Mutating: Mutating? = nil
65376534 ) -> Obj3 {
65386535 return Obj3(
65396536 dummy: dummy ?? self.dummy,
@@ -6575,6 +6572,7 @@ extension Obj3 {
65756572 locale: locale ?? self.locale,
65766573 lock: lock ?? self.lock,
65776574 long: long ?? self.long,
6575+ makeDictEncoder: makeDictEncoder ?? self.makeDictEncoder,
65786576 map: map ?? self.map,
65796577 mapEntry: mapEntry ?? self.mapEntry,
65806578 marshalJSON: marshalJSON ?? self.marshalJSON,
@@ -6585,7 +6583,6 @@ extension Obj3 {
65856583 native: native ?? self.native,
65866584 new: new ?? self.new,
65876585 newtonsoft: newtonsoft ?? self.newtonsoft,
6588- no: no ?? self.no,
65896586 obj3Guard: obj3Guard ?? self.obj3Guard,
65906587 obj3If: obj3If ?? self.obj3If,
65916588 obj3Import: obj3Import ?? self.obj3Import,
@@ -6600,8 +6597,7 @@ extension Obj3 {
66006597 obj3Lazy: obj3Lazy ?? self.obj3Lazy,
66016598 obj3Left: obj3Left ?? self.obj3Left,
66026599 obj3Let: obj3Let ?? self.obj3Let,
6603- obj3Mutating: obj3Mutating ?? self.obj3Mutating,
6604- obj3Nil: obj3Nil ?? self.obj3Nil
6600+ obj3Mutating: obj3Mutating ?? self.obj3Mutating
66056601 )
66066602 }
66076603
@@ -8286,6 +8282,50 @@ extension Long {
82868282 }
82878283 }
82888284
8285+// MARK: - MakeDictEncoder
8286+struct MakeDictEncoder: Codable, Sendable {
8287+ let makeDictEncoder: Int
8288+
8289+ enum CodingKeys: String, CodingKey {
8290+ case makeDictEncoder = "makeDictEncoder"
8291+ }
8292+}
8293+
8294+// MARK: MakeDictEncoder convenience initializers and mutators
8295+
8296+extension MakeDictEncoder {
8297+ init(data: Data) throws {
8298+ self = try newJSONDecoder().decode(MakeDictEncoder.self, from: data)
8299+ }
8300+
8301+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
8302+ guard let data = json.data(using: encoding) else {
8303+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
8304+ }
8305+ try self.init(data: data)
8306+ }
8307+
8308+ init(fromURL url: URL) throws {
8309+ try self.init(data: try Data(contentsOf: url))
8310+ }
8311+
8312+ func with(
8313+ makeDictEncoder: Int? = nil
8314+ ) -> MakeDictEncoder {
8315+ return MakeDictEncoder(
8316+ makeDictEncoder: makeDictEncoder ?? self.makeDictEncoder
8317+ )
8318+ }
8319+
8320+ func jsonData() throws -> Data {
8321+ return try newJSONEncoder().encode(self)
8322+ }
8323+
8324+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
8325+ return String(data: try self.jsonData(), encoding: encoding)
8326+ }
8327+}
8328+
82898329 // MARK: - Map
82908330 struct Map: Codable, Sendable {
82918331 let map: Int
@@ -8726,50 +8766,6 @@ extension Newtonsoft {
87268766 }
87278767 }
87288768
8729-// MARK: - No
8730-struct No: Codable, Sendable {
8731- let no: Int
8732-
8733- enum CodingKeys: String, CodingKey {
8734- case no = "NO"
8735- }
8736-}
8737-
8738-// MARK: No convenience initializers and mutators
8739-
8740-extension No {
8741- init(data: Data) throws {
8742- self = try newJSONDecoder().decode(No.self, from: data)
8743- }
8744-
8745- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
8746- guard let data = json.data(using: encoding) else {
8747- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
8748- }
8749- try self.init(data: data)
8750- }
8751-
8752- init(fromURL url: URL) throws {
8753- try self.init(data: try Data(contentsOf: url))
8754- }
8755-
8756- func with(
8757- no: Int? = nil
8758- ) -> No {
8759- return No(
8760- no: no ?? self.no
8761- )
8762- }
8763-
8764- func jsonData() throws -> Data {
8765- return try newJSONEncoder().encode(self)
8766- }
8767-
8768- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
8769- return String(data: try self.jsonData(), encoding: encoding)
8770- }
8771-}
8772-
87738769 // MARK: - Guard
87748770 struct Guard: Codable, Sendable {
87758771 let guardGuard: Int
@@ -9430,53 +9426,10 @@ extension Mutating {
94309426 }
94319427 }
94329428
9433-// MARK: - Nil
9434-struct Nil: Codable, Sendable {
9435- let nilNil: Int
9436-
9437- enum CodingKeys: String, CodingKey {
9438- case nilNil = "nil"
9439- }
9440-}
9441-
9442-// MARK: Nil convenience initializers and mutators
9443-
9444-extension Nil {
9445- init(data: Data) throws {
9446- self = try newJSONDecoder().decode(Nil.self, from: data)
9447- }
9448-
9449- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
9450- guard let data = json.data(using: encoding) else {
9451- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
9452- }
9453- try self.init(data: data)
9454- }
9455-
9456- init(fromURL url: URL) throws {
9457- try self.init(data: try Data(contentsOf: url))
9458- }
9459-
9460- func with(
9461- nilNil: Int? = nil
9462- ) -> Nil {
9463- return Nil(
9464- nilNil: nilNil ?? self.nilNil
9465- )
9466- }
9467-
9468- func jsonData() throws -> Data {
9469- return try newJSONEncoder().encode(self)
9470- }
9471-
9472- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
9473- return String(data: try self.jsonData(), encoding: encoding)
9474- }
9475-}
9476-
94779429 // MARK: - Obj4
94789430 struct Obj4: Codable, Sendable {
94799431 let dummy: Int
9432+ let no: No
94809433 let noSuchMethod: NoSuchMethod
94819434 let noexcept: Noexcept
94829435 let nonatomic: Nonatomic
@@ -9490,6 +9443,7 @@ struct Obj4: Codable, Sendable {
94909443 let null: Null
94919444 let nullptr: Nullptr
94929445 let number: Number
9446+ let obj4Nil: Nil
94939447 let obj4None: NoneClass
94949448 let obj4Nonmutating: Nonmutating
94959449 let obj4Null: NullClass
@@ -9539,11 +9493,10 @@ struct Obj4: Codable, Sendable {
95399493 let runtimeType: RuntimeType
95409494 let s: S
95419495 let sbyte: Sbyte
9542- let sealed: Sealed
9543- let sel: Sel
95449496
95459497 enum CodingKeys: String, CodingKey {
95469498 case dummy = "dummy"
9499+ case no = "NO"
95479500 case noSuchMethod = "noSuchMethod"
95489501 case noexcept = "noexcept"
95499502 case nonatomic = "nonatomic"
@@ -9557,6 +9510,7 @@ struct Obj4: Codable, Sendable {
95579510 case null = "NULL"
95589511 case nullptr = "nullptr"
95599512 case number = "number"
9513+ case obj4Nil = "nil"
95609514 case obj4None = "none"
95619515 case obj4Nonmutating = "nonmutating"
95629516 case obj4Null = "null"
@@ -9606,8 +9560,6 @@ struct Obj4: Codable, Sendable {
96069560 case runtimeType = "runtimeType"
96079561 case s = "s"
96089562 case sbyte = "sbyte"
9609- case sealed = "sealed"
9610- case sel = "SEL"
96119563 }
96129564 }
96139565
@@ -9631,6 +9583,7 @@ extension Obj4 {
96319583
96329584 func with(
96339585 dummy: Int? = nil,
9586+ no: No? = nil,
96349587 noSuchMethod: NoSuchMethod? = nil,
96359588 noexcept: Noexcept? = nil,
96369589 nonatomic: Nonatomic? = nil,
@@ -9644,6 +9597,7 @@ extension Obj4 {
96449597 null: Null? = nil,
96459598 nullptr: Nullptr? = nil,
96469599 number: Number? = nil,
9600+ obj4Nil: Nil? = nil,
96479601 obj4None: NoneClass? = nil,
96489602 obj4Nonmutating: Nonmutating? = nil,
96499603 obj4Null: NullClass? = nil,
@@ -9692,12 +9646,11 @@ extension Obj4 {
96929646 retain: Retain? = nil,
96939647 runtimeType: RuntimeType? = nil,
96949648 s: S? = nil,
9695- sbyte: Sbyte? = nil,
9696- sealed: Sealed? = nil,
9697- sel: Sel? = nil
9649+ sbyte: Sbyte? = nil
96989650 ) -> Obj4 {
96999651 return Obj4(
97009652 dummy: dummy ?? self.dummy,
9653+ no: no ?? self.no,
97019654 noSuchMethod: noSuchMethod ?? self.noSuchMethod,
97029655 noexcept: noexcept ?? self.noexcept,
97039656 nonatomic: nonatomic ?? self.nonatomic,
@@ -9711,6 +9664,7 @@ extension Obj4 {
97119664 null: null ?? self.null,
97129665 nullptr: nullptr ?? self.nullptr,
97139666 number: number ?? self.number,
9667+ obj4Nil: obj4Nil ?? self.obj4Nil,
97149668 obj4None: obj4None ?? self.obj4None,
97159669 obj4Nonmutating: obj4Nonmutating ?? self.obj4Nonmutating,
97169670 obj4Null: obj4Null ?? self.obj4Null,
@@ -9759,9 +9713,51 @@ extension Obj4 {
97599713 retain: retain ?? self.retain,
97609714 runtimeType: runtimeType ?? self.runtimeType,
97619715 s: s ?? self.s,
9762- sbyte: sbyte ?? self.sbyte,
9763- sealed: sealed ?? self.sealed,
9764- sel: sel ?? self.sel
9716+ sbyte: sbyte ?? self.sbyte
9717+ )
9718+ }
9719+
9720+ func jsonData() throws -> Data {
9721+ return try newJSONEncoder().encode(self)
9722+ }
9723+
9724+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
9725+ return String(data: try self.jsonData(), encoding: encoding)
9726+ }
9727+}
9728+
9729+// MARK: - No
9730+struct No: Codable, Sendable {
9731+ let no: Int
9732+
9733+ enum CodingKeys: String, CodingKey {
9734+ case no = "NO"
9735+ }
9736+}
9737+
9738+// MARK: No convenience initializers and mutators
9739+
9740+extension No {
9741+ init(data: Data) throws {
9742+ self = try newJSONDecoder().decode(No.self, from: data)
9743+ }
9744+
9745+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
9746+ guard let data = json.data(using: encoding) else {
9747+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
9748+ }
9749+ try self.init(data: data)
9750+ }
9751+
9752+ init(fromURL url: URL) throws {
9753+ try self.init(data: try Data(contentsOf: url))
9754+ }
9755+
9756+ func with(
9757+ no: Int? = nil
9758+ ) -> No {
9759+ return No(
9760+ no: no ?? self.no
97659761 )
97669762 }
97679763
@@ -10346,6 +10342,50 @@ extension Number {
1034610342 }
1034710343 }
1034810344
10345+// MARK: - Nil
10346+struct Nil: Codable, Sendable {
10347+ let nilNil: Int
10348+
10349+ enum CodingKeys: String, CodingKey {
10350+ case nilNil = "nil"
10351+ }
10352+}
10353+
10354+// MARK: Nil convenience initializers and mutators
10355+
10356+extension Nil {
10357+ init(data: Data) throws {
10358+ self = try newJSONDecoder().decode(Nil.self, from: data)
10359+ }
10360+
10361+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
10362+ guard let data = json.data(using: encoding) else {
10363+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
10364+ }
10365+ try self.init(data: data)
10366+ }
10367+
10368+ init(fromURL url: URL) throws {
10369+ try self.init(data: try Data(contentsOf: url))
10370+ }
10371+
10372+ func with(
10373+ nilNil: Int? = nil
10374+ ) -> Nil {
10375+ return Nil(
10376+ nilNil: nilNil ?? self.nilNil
10377+ )
10378+ }
10379+
10380+ func jsonData() throws -> Data {
10381+ return try newJSONEncoder().encode(self)
10382+ }
10383+
10384+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
10385+ return String(data: try self.jsonData(), encoding: encoding)
10386+ }
10387+}
10388+
1034910389 // MARK: - NoneClass
1035010390 struct NoneClass: Codable, Sendable {
1035110391 let none: Int
@@ -12502,94 +12542,6 @@ extension Sbyte {
1250212542 }
1250312543 }
1250412544
12505-// MARK: - Sealed
12506-struct Sealed: Codable, Sendable {
12507- let sealed: Int
12508-
12509- enum CodingKeys: String, CodingKey {
12510- case sealed = "sealed"
12511- }
12512-}
12513-
12514-// MARK: Sealed convenience initializers and mutators
12515-
12516-extension Sealed {
12517- init(data: Data) throws {
12518- self = try newJSONDecoder().decode(Sealed.self, from: data)
12519- }
12520-
12521- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
12522- guard let data = json.data(using: encoding) else {
12523- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
12524- }
12525- try self.init(data: data)
12526- }
12527-
12528- init(fromURL url: URL) throws {
12529- try self.init(data: try Data(contentsOf: url))
12530- }
12531-
12532- func with(
12533- sealed: Int? = nil
12534- ) -> Sealed {
12535- return Sealed(
12536- sealed: sealed ?? self.sealed
12537- )
12538- }
12539-
12540- func jsonData() throws -> Data {
12541- return try newJSONEncoder().encode(self)
12542- }
12543-
12544- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
12545- return String(data: try self.jsonData(), encoding: encoding)
12546- }
12547-}
12548-
12549-// MARK: - Sel
12550-struct Sel: Codable, Sendable {
12551- let sel: Int
12552-
12553- enum CodingKeys: String, CodingKey {
12554- case sel = "SEL"
12555- }
12556-}
12557-
12558-// MARK: Sel convenience initializers and mutators
12559-
12560-extension Sel {
12561- init(data: Data) throws {
12562- self = try newJSONDecoder().decode(Sel.self, from: data)
12563- }
12564-
12565- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
12566- guard let data = json.data(using: encoding) else {
12567- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
12568- }
12569- try self.init(data: data)
12570- }
12571-
12572- init(fromURL url: URL) throws {
12573- try self.init(data: try Data(contentsOf: url))
12574- }
12575-
12576- func with(
12577- sel: Int? = nil
12578- ) -> Sel {
12579- return Sel(
12580- sel: sel ?? self.sel
12581- )
12582- }
12583-
12584- func jsonData() throws -> Data {
12585- return try newJSONEncoder().encode(self)
12586- }
12587-
12588- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
12589- return String(data: try self.jsonData(), encoding: encoding)
12590- }
12591-}
12592-
1259312545 // MARK: - Obj5
1259412546 struct Obj5: Codable, Sendable {
1259512547 let dummy: Int
@@ -12607,10 +12559,11 @@ struct Obj5: Codable, Sendable {
1260712559 let obj5Try: Try
1260812560 let obj5Type: Obj5Type
1260912561 let obj5Typealias: Typealias
12610- let obj5Unowned: Unowned
1261112562 let primitiveKind: PrimitiveKind
1261212563 let purpleSelf: Obj5Self
1261312564 let purpleTrue: TrueClass
12565+ let sealed: Sealed
12566+ let sel: Sel
1261412567 let select: Select
1261512568 let sendable: SendableClass
1261612569 let serialDescriptor: SerialDescriptor
@@ -12656,8 +12609,6 @@ struct Obj5: Codable, Sendable {
1265612609 let undefined: Undefined
1265712610 let union: Union
1265812611 let unmarshalJSON: UnmarshalJSON
12659- let unsafe: Unsafe
12660- let useSerializers: UseSerializers
1266112612
1266212613 enum CodingKeys: String, CodingKey {
1266312614 case dummy = "dummy"
@@ -12675,10 +12626,11 @@ struct Obj5: Codable, Sendable {
1267512626 case obj5Try = "try"
1267612627 case obj5Type = "type"
1267712628 case obj5Typealias = "typealias"
12678- case obj5Unowned = "unowned"
1267912629 case primitiveKind = "PrimitiveKind"
1268012630 case purpleSelf = "self"
1268112631 case purpleTrue = "true"
12632+ case sealed = "sealed"
12633+ case sel = "SEL"
1268212634 case select = "select"
1268312635 case sendable = "Sendable"
1268412636 case serialDescriptor = "SerialDescriptor"
@@ -12724,8 +12676,6 @@ struct Obj5: Codable, Sendable {
1272412676 case undefined = "undefined"
1272512677 case union = "union"
1272612678 case unmarshalJSON = "UnmarshalJSON"
12727- case unsafe = "unsafe"
12728- case useSerializers = "UseSerializers"
1272912679 }
1273012680 }
1273112681
@@ -12763,10 +12713,11 @@ extension Obj5 {
1276312713 obj5Try: Try? = nil,
1276412714 obj5Type: Obj5Type? = nil,
1276512715 obj5Typealias: Typealias? = nil,
12766- obj5Unowned: Unowned? = nil,
1276712716 primitiveKind: PrimitiveKind? = nil,
1276812717 purpleSelf: Obj5Self? = nil,
1276912718 purpleTrue: TrueClass? = nil,
12719+ sealed: Sealed? = nil,
12720+ sel: Sel? = nil,
1277012721 select: Select? = nil,
1277112722 sendable: SendableClass? = nil,
1277212723 serialDescriptor: SerialDescriptor? = nil,
@@ -12811,9 +12762,7 @@ extension Obj5 {
1281112762 unchecked: Unchecked? = nil,
1281212763 undefined: Undefined? = nil,
1281312764 union: Union? = nil,
12814- unmarshalJSON: UnmarshalJSON? = nil,
12815- unsafe: Unsafe? = nil,
12816- useSerializers: UseSerializers? = nil
12765+ unmarshalJSON: UnmarshalJSON? = nil
1281712766 ) -> Obj5 {
1281812767 return Obj5(
1281912768 dummy: dummy ?? self.dummy,
@@ -12831,10 +12780,11 @@ extension Obj5 {
1283112780 obj5Try: obj5Try ?? self.obj5Try,
1283212781 obj5Type: obj5Type ?? self.obj5Type,
1283312782 obj5Typealias: obj5Typealias ?? self.obj5Typealias,
12834- obj5Unowned: obj5Unowned ?? self.obj5Unowned,
1283512783 primitiveKind: primitiveKind ?? self.primitiveKind,
1283612784 purpleSelf: purpleSelf ?? self.purpleSelf,
1283712785 purpleTrue: purpleTrue ?? self.purpleTrue,
12786+ sealed: sealed ?? self.sealed,
12787+ sel: sel ?? self.sel,
1283812788 select: select ?? self.select,
1283912789 sendable: sendable ?? self.sendable,
1284012790 serialDescriptor: serialDescriptor ?? self.serialDescriptor,
@@ -12879,9 +12829,7 @@ extension Obj5 {
1287912829 unchecked: unchecked ?? self.unchecked,
1288012830 undefined: undefined ?? self.undefined,
1288112831 union: union ?? self.union,
12882- unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON,
12883- unsafe: unsafe ?? self.unsafe,
12884- useSerializers: useSerializers ?? self.useSerializers
12832+ unmarshalJSON: unmarshalJSON ?? self.unmarshalJSON
1288512833 )
1288612834 }
1288712835
@@ -13510,50 +13458,6 @@ extension Typealias {
1351013458 }
1351113459 }
1351213460
13513-// MARK: - Unowned
13514-struct Unowned: Codable, Sendable {
13515- let unownedUnowned: Int
13516-
13517- enum CodingKeys: String, CodingKey {
13518- case unownedUnowned = "unowned"
13519- }
13520-}
13521-
13522-// MARK: Unowned convenience initializers and mutators
13523-
13524-extension Unowned {
13525- init(data: Data) throws {
13526- self = try newJSONDecoder().decode(Unowned.self, from: data)
13527- }
13528-
13529- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
13530- guard let data = json.data(using: encoding) else {
13531- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
13532- }
13533- try self.init(data: data)
13534- }
13535-
13536- init(fromURL url: URL) throws {
13537- try self.init(data: try Data(contentsOf: url))
13538- }
13539-
13540- func with(
13541- unownedUnowned: Int? = nil
13542- ) -> Unowned {
13543- return Unowned(
13544- unownedUnowned: unownedUnowned ?? self.unownedUnowned
13545- )
13546- }
13547-
13548- func jsonData() throws -> Data {
13549- return try newJSONEncoder().encode(self)
13550- }
13551-
13552- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
13553- return String(data: try self.jsonData(), encoding: encoding)
13554- }
13555-}
13556-
1355713461 // MARK: - PrimitiveKind
1355813462 struct PrimitiveKind: Codable, Sendable {
1355913463 let primitiveKind: Int
@@ -13686,6 +13590,94 @@ extension TrueClass {
1368613590 }
1368713591 }
1368813592
13593+// MARK: - Sealed
13594+struct Sealed: Codable, Sendable {
13595+ let sealed: Int
13596+
13597+ enum CodingKeys: String, CodingKey {
13598+ case sealed = "sealed"
13599+ }
13600+}
13601+
13602+// MARK: Sealed convenience initializers and mutators
13603+
13604+extension Sealed {
13605+ init(data: Data) throws {
13606+ self = try newJSONDecoder().decode(Sealed.self, from: data)
13607+ }
13608+
13609+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
13610+ guard let data = json.data(using: encoding) else {
13611+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
13612+ }
13613+ try self.init(data: data)
13614+ }
13615+
13616+ init(fromURL url: URL) throws {
13617+ try self.init(data: try Data(contentsOf: url))
13618+ }
13619+
13620+ func with(
13621+ sealed: Int? = nil
13622+ ) -> Sealed {
13623+ return Sealed(
13624+ sealed: sealed ?? self.sealed
13625+ )
13626+ }
13627+
13628+ func jsonData() throws -> Data {
13629+ return try newJSONEncoder().encode(self)
13630+ }
13631+
13632+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
13633+ return String(data: try self.jsonData(), encoding: encoding)
13634+ }
13635+}
13636+
13637+// MARK: - Sel
13638+struct Sel: Codable, Sendable {
13639+ let sel: Int
13640+
13641+ enum CodingKeys: String, CodingKey {
13642+ case sel = "SEL"
13643+ }
13644+}
13645+
13646+// MARK: Sel convenience initializers and mutators
13647+
13648+extension Sel {
13649+ init(data: Data) throws {
13650+ self = try newJSONDecoder().decode(Sel.self, from: data)
13651+ }
13652+
13653+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
13654+ guard let data = json.data(using: encoding) else {
13655+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
13656+ }
13657+ try self.init(data: data)
13658+ }
13659+
13660+ init(fromURL url: URL) throws {
13661+ try self.init(data: try Data(contentsOf: url))
13662+ }
13663+
13664+ func with(
13665+ sel: Int? = nil
13666+ ) -> Sel {
13667+ return Sel(
13668+ sel: sel ?? self.sel
13669+ )
13670+ }
13671+
13672+ func jsonData() throws -> Data {
13673+ return try newJSONEncoder().encode(self)
13674+ }
13675+
13676+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
13677+ return String(data: try self.jsonData(), encoding: encoding)
13678+ }
13679+}
13680+
1368913681 // MARK: - Select
1369013682 struct Select: Codable, Sendable {
1369113683 let select: Int
@@ -15666,103 +15658,18 @@ extension UnmarshalJSON {
1566615658 }
1566715659 }
1566815660
15669-// MARK: - Unsafe
15670-struct Unsafe: Codable, Sendable {
15671- let unsafe: Int
15672-
15673- enum CodingKeys: String, CodingKey {
15674- case unsafe = "unsafe"
15675- }
15676-}
15677-
15678-// MARK: Unsafe convenience initializers and mutators
15679-
15680-extension Unsafe {
15681- init(data: Data) throws {
15682- self = try newJSONDecoder().decode(Unsafe.self, from: data)
15683- }
15684-
15685- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
15686- guard let data = json.data(using: encoding) else {
15687- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
15688- }
15689- try self.init(data: data)
15690- }
15691-
15692- init(fromURL url: URL) throws {
15693- try self.init(data: try Data(contentsOf: url))
15694- }
15695-
15696- func with(
15697- unsafe: Int? = nil
15698- ) -> Unsafe {
15699- return Unsafe(
15700- unsafe: unsafe ?? self.unsafe
15701- )
15702- }
15703-
15704- func jsonData() throws -> Data {
15705- return try newJSONEncoder().encode(self)
15706- }
15707-
15708- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
15709- return String(data: try self.jsonData(), encoding: encoding)
15710- }
15711-}
15712-
15713-// MARK: - UseSerializers
15714-struct UseSerializers: Codable, Sendable {
15715- let useSerializers: Int
15716-
15717- enum CodingKeys: String, CodingKey {
15718- case useSerializers = "UseSerializers"
15719- }
15720-}
15721-
15722-// MARK: UseSerializers convenience initializers and mutators
15723-
15724-extension UseSerializers {
15725- init(data: Data) throws {
15726- self = try newJSONDecoder().decode(UseSerializers.self, from: data)
15727- }
15728-
15729- init(_ json: String, using encoding: String.Encoding = .utf8) throws {
15730- guard let data = json.data(using: encoding) else {
15731- throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
15732- }
15733- try self.init(data: data)
15734- }
15735-
15736- init(fromURL url: URL) throws {
15737- try self.init(data: try Data(contentsOf: url))
15738- }
15739-
15740- func with(
15741- useSerializers: Int? = nil
15742- ) -> UseSerializers {
15743- return UseSerializers(
15744- useSerializers: useSerializers ?? self.useSerializers
15745- )
15746- }
15747-
15748- func jsonData() throws -> Data {
15749- return try newJSONEncoder().encode(self)
15750- }
15751-
15752- func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
15753- return String(data: try self.jsonData(), encoding: encoding)
15754- }
15755-}
15756-
1575715661 // MARK: - Obj6
1575815662 struct Obj6: Codable, Sendable {
1575915663 let dummy: Int
15664+ let obj6Unowned: Unowned
1576015665 let obj6Var: Var
1576115666 let obj6Weak: Weak
1576215667 let obj6Where: Where
1576315668 let obj6While: While
1576415669 let obj6WillSet: WillSet
15670+ let unsafe: Unsafe
1576515671 let unsigned: Unsigned
15672+ let useSerializers: UseSerializers
1576615673 let ushort: Ushort
1576715674 let using: Using
1576815675 let utf8JSONReader: Utf8JSONReader
@@ -15780,12 +15687,15 @@ struct Obj6: Codable, Sendable {
1578015687
1578115688 enum CodingKeys: String, CodingKey {
1578215689 case dummy = "dummy"
15690+ case obj6Unowned = "unowned"
1578315691 case obj6Var = "var"
1578415692 case obj6Weak = "weak"
1578515693 case obj6Where = "where"
1578615694 case obj6While = "while"
1578715695 case obj6WillSet = "willSet"
15696+ case unsafe = "unsafe"
1578815697 case unsigned = "unsigned"
15698+ case useSerializers = "UseSerializers"
1578915699 case ushort = "ushort"
1579015700 case using = "using"
1579115701 case utf8JSONReader = "Utf8JsonReader"
@@ -15823,12 +15733,15 @@ extension Obj6 {
1582315733
1582415734 func with(
1582515735 dummy: Int? = nil,
15736+ obj6Unowned: Unowned? = nil,
1582615737 obj6Var: Var? = nil,
1582715738 obj6Weak: Weak? = nil,
1582815739 obj6Where: Where? = nil,
1582915740 obj6While: While? = nil,
1583015741 obj6WillSet: WillSet? = nil,
15742+ unsafe: Unsafe? = nil,
1583115743 unsigned: Unsigned? = nil,
15744+ useSerializers: UseSerializers? = nil,
1583215745 ushort: Ushort? = nil,
1583315746 using: Using? = nil,
1583415747 utf8JSONReader: Utf8JSONReader? = nil,
@@ -15846,12 +15759,15 @@ extension Obj6 {
1584615759 ) -> Obj6 {
1584715760 return Obj6(
1584815761 dummy: dummy ?? self.dummy,
15762+ obj6Unowned: obj6Unowned ?? self.obj6Unowned,
1584915763 obj6Var: obj6Var ?? self.obj6Var,
1585015764 obj6Weak: obj6Weak ?? self.obj6Weak,
1585115765 obj6Where: obj6Where ?? self.obj6Where,
1585215766 obj6While: obj6While ?? self.obj6While,
1585315767 obj6WillSet: obj6WillSet ?? self.obj6WillSet,
15768+ unsafe: unsafe ?? self.unsafe,
1585415769 unsigned: unsigned ?? self.unsigned,
15770+ useSerializers: useSerializers ?? self.useSerializers,
1585515771 ushort: ushort ?? self.ushort,
1585615772 using: using ?? self.using,
1585715773 utf8JSONReader: utf8JSONReader ?? self.utf8JSONReader,
@@ -15878,6 +15794,50 @@ extension Obj6 {
1587815794 }
1587915795 }
1588015796
15797+// MARK: - Unowned
15798+struct Unowned: Codable, Sendable {
15799+ let unownedUnowned: Int
15800+
15801+ enum CodingKeys: String, CodingKey {
15802+ case unownedUnowned = "unowned"
15803+ }
15804+}
15805+
15806+// MARK: Unowned convenience initializers and mutators
15807+
15808+extension Unowned {
15809+ init(data: Data) throws {
15810+ self = try newJSONDecoder().decode(Unowned.self, from: data)
15811+ }
15812+
15813+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
15814+ guard let data = json.data(using: encoding) else {
15815+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
15816+ }
15817+ try self.init(data: data)
15818+ }
15819+
15820+ init(fromURL url: URL) throws {
15821+ try self.init(data: try Data(contentsOf: url))
15822+ }
15823+
15824+ func with(
15825+ unownedUnowned: Int? = nil
15826+ ) -> Unowned {
15827+ return Unowned(
15828+ unownedUnowned: unownedUnowned ?? self.unownedUnowned
15829+ )
15830+ }
15831+
15832+ func jsonData() throws -> Data {
15833+ return try newJSONEncoder().encode(self)
15834+ }
15835+
15836+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
15837+ return String(data: try self.jsonData(), encoding: encoding)
15838+ }
15839+}
15840+
1588115841 // MARK: - Var
1588215842 struct Var: Codable, Sendable {
1588315843 let varVar: Int
@@ -16098,6 +16058,50 @@ extension WillSet {
1609816058 }
1609916059 }
1610016060
16061+// MARK: - Unsafe
16062+struct Unsafe: Codable, Sendable {
16063+ let unsafe: Int
16064+
16065+ enum CodingKeys: String, CodingKey {
16066+ case unsafe = "unsafe"
16067+ }
16068+}
16069+
16070+// MARK: Unsafe convenience initializers and mutators
16071+
16072+extension Unsafe {
16073+ init(data: Data) throws {
16074+ self = try newJSONDecoder().decode(Unsafe.self, from: data)
16075+ }
16076+
16077+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
16078+ guard let data = json.data(using: encoding) else {
16079+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
16080+ }
16081+ try self.init(data: data)
16082+ }
16083+
16084+ init(fromURL url: URL) throws {
16085+ try self.init(data: try Data(contentsOf: url))
16086+ }
16087+
16088+ func with(
16089+ unsafe: Int? = nil
16090+ ) -> Unsafe {
16091+ return Unsafe(
16092+ unsafe: unsafe ?? self.unsafe
16093+ )
16094+ }
16095+
16096+ func jsonData() throws -> Data {
16097+ return try newJSONEncoder().encode(self)
16098+ }
16099+
16100+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
16101+ return String(data: try self.jsonData(), encoding: encoding)
16102+ }
16103+}
16104+
1610116105 // MARK: - Unsigned
1610216106 struct Unsigned: Codable, Sendable {
1610316107 let unsigned: Int
@@ -16142,6 +16146,50 @@ extension Unsigned {
1614216146 }
1614316147 }
1614416148
16149+// MARK: - UseSerializers
16150+struct UseSerializers: Codable, Sendable {
16151+ let useSerializers: Int
16152+
16153+ enum CodingKeys: String, CodingKey {
16154+ case useSerializers = "UseSerializers"
16155+ }
16156+}
16157+
16158+// MARK: UseSerializers convenience initializers and mutators
16159+
16160+extension UseSerializers {
16161+ init(data: Data) throws {
16162+ self = try newJSONDecoder().decode(UseSerializers.self, from: data)
16163+ }
16164+
16165+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
16166+ guard let data = json.data(using: encoding) else {
16167+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
16168+ }
16169+ try self.init(data: data)
16170+ }
16171+
16172+ init(fromURL url: URL) throws {
16173+ try self.init(data: try Data(contentsOf: url))
16174+ }
16175+
16176+ func with(
16177+ useSerializers: Int? = nil
16178+ ) -> UseSerializers {
16179+ return UseSerializers(
16180+ useSerializers: useSerializers ?? self.useSerializers
16181+ )
16182+ }
16183+
16184+ func jsonData() throws -> Data {
16185+ return try newJSONEncoder().encode(self)
16186+ }
16187+
16188+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
16189+ return String(data: try self.jsonData(), encoding: encoding)
16190+ }
16191+}
16192+
1614516193 // MARK: - Ushort
1614616194 struct Ushort: Codable, Sendable {
1614716195 let ushort: Int
Mtypescript-effect-schemadefault / TopLevel.ts+40 −35
@@ -83,13 +83,28 @@ export class Ushort extends S.Class<Ushort>("Ushort")({
8383 "ushort": S.Int,
8484 }) {}
8585
86+export class UseSerializers extends S.Class<UseSerializers>("UseSerializers")({
87+ "UseSerializers": S.Int,
88+}) {}
89+
8690 export class Unsigned extends S.Class<Unsigned>("Unsigned")({
8791 "unsigned": S.Int,
8892 }) {}
8993
94+export class Unsafe extends S.Class<Unsafe>("Unsafe")({
95+ "unsafe": S.Int,
96+}) {}
97+
98+export class Unowned extends S.Class<Unowned>("Unowned")({
99+ "unowned": S.Int,
100+}) {}
101+
90102 export class Obj6 extends S.Class<Obj6>("Obj6")({
91103 "dummy": S.Int,
104+ "unowned": Unowned,
105+ "unsafe": Unsafe,
92106 "unsigned": Unsigned,
107+ "UseSerializers": UseSerializers,
93108 "ushort": Ushort,
94109 "using": Using,
95110 "Utf8JsonReader": Utf8JsonReader,
@@ -111,18 +126,6 @@ export class Obj6 extends S.Class<Obj6>("Obj6")({
111126 "yield": Yield,
112127 }) {}
113128
114-export class UseSerializers extends S.Class<UseSerializers>("UseSerializers")({
115- "UseSerializers": S.Int,
116-}) {}
117-
118-export class Unsafe extends S.Class<Unsafe>("Unsafe")({
119- "unsafe": S.Int,
120-}) {}
121-
122-export class Unowned extends S.Class<Unowned>("Unowned")({
123- "unowned": S.Int,
124-}) {}
125-
126129 export class UnmarshalJson extends S.Class<UnmarshalJson>("UnmarshalJson")({
127130 "UnmarshalJSON": S.Int,
128131 }) {}
@@ -352,6 +355,14 @@ export class Select extends S.Class<Select>("Select")({
352355 "select": S.Int,
353356 }) {}
354357
358+export class Sel extends S.Class<Sel>("Sel")({
359+ "SEL": S.Int,
360+}) {}
361+
362+export class Sealed extends S.Class<Sealed>("Sealed")({
363+ "sealed": S.Int,
364+}) {}
365+
355366 export class PrimitiveKind extends S.Class<PrimitiveKind>("PrimitiveKind")({
356367 "PrimitiveKind": S.Int,
357368 }) {}
@@ -379,6 +390,8 @@ export class Obj5 extends S.Class<Obj5>("Obj5")({
379390 "true": TrueClass,
380391 "type": TypeClass,
381392 "PrimitiveKind": PrimitiveKind,
393+ "sealed": Sealed,
394+ "SEL": Sel,
382395 "select": Select,
383396 "Self": Self,
384397 "Sendable": Sendable,
@@ -436,20 +449,9 @@ export class Obj5 extends S.Class<Obj5>("Obj5")({
436449 "undefined": Undefined,
437450 "union": Union,
438451 "UnmarshalJSON": UnmarshalJson,
439- "unowned": Unowned,
440- "unsafe": Unsafe,
441- "UseSerializers": UseSerializers,
442452 }) {}
443453 Object.defineProperty(Obj5.prototype, "toString", { writable: true });
444454
445-export class Sel extends S.Class<Sel>("Sel")({
446- "SEL": S.Int,
447-}) {}
448-
449-export class Sealed extends S.Class<Sealed>("Sealed")({
450- "sealed": S.Int,
451-}) {}
452-
453455 export class Sbyte extends S.Class<Sbyte>("Sbyte")({
454456 "sbyte": S.Int,
455457 }) {}
@@ -698,8 +700,18 @@ export class NoSuchMethod extends S.Class<NoSuchMethod>("NoSuchMethod")({
698700 "noSuchMethod": S.Int,
699701 }) {}
700702
703+export class No extends S.Class<No>("No")({
704+ "NO": S.Int,
705+}) {}
706+
707+export class Nil extends S.Class<Nil>("Nil")({
708+ "nil": S.Int,
709+}) {}
710+
701711 export class Obj4 extends S.Class<Obj4>("Obj4")({
702712 "dummy": S.Int,
713+ "nil": Nil,
714+ "NO": No,
703715 "noSuchMethod": NoSuchMethod,
704716 "noexcept": Noexcept,
705717 "nonatomic": Nonatomic,
@@ -762,16 +774,6 @@ export class Obj4 extends S.Class<Obj4>("Obj4")({
762774 "runtimeType": RuntimeType,
763775 "s": SClass,
764776 "sbyte": Sbyte,
765- "sealed": Sealed,
766- "SEL": Sel,
767-}) {}
768-
769-export class No extends S.Class<No>("No")({
770- "NO": S.Int,
771-}) {}
772-
773-export class Nil extends S.Class<Nil>("Nil")({
774- "nil": S.Int,
775777 }) {}
776778
777779 export class Newtonsoft extends S.Class<Newtonsoft>("Newtonsoft")({
@@ -818,6 +820,10 @@ export class Map extends S.Class<Map>("Map")({
818820 "map": S.Int,
819821 }) {}
820822
823+export class MakeDictEncoder extends S.Class<MakeDictEncoder>("MakeDictEncoder")({
824+ "makeDictEncoder": S.Int,
825+}) {}
826+
821827 export class Long extends S.Class<Long>("Long")({
822828 "long": S.Int,
823829 }) {}
@@ -1080,6 +1086,7 @@ export class Obj3 extends S.Class<Obj3>("Obj3")({
10801086 "Locale": Locale,
10811087 "lock": Lock,
10821088 "long": Long,
1089+ "makeDictEncoder": MakeDictEncoder,
10831090 "map": Map,
10841091 "MapEntry": MapEntry,
10851092 "MarshalJSON": MarshalJson,
@@ -1091,8 +1098,6 @@ export class Obj3 extends S.Class<Obj3>("Obj3")({
10911098 "native": Native,
10921099 "new": New,
10931100 "newtonsoft": Newtonsoft,
1094- "nil": Nil,
1095- "NO": No,
10961101 }) {}
10971102
10981103 export class FalseClass extends S.Class<FalseClass>("FalseClass")({
Mtypescript-zoddefault / TopLevel.ts+28 −22
@@ -907,6 +907,11 @@ export const LongSchema = z.object({
907907 });
908908 export type Long = z.infer<typeof LongSchema>;
909909
910+export const MakeDictEncoderSchema = z.object({
911+ "makeDictEncoder": z.number().int(),
912+});
913+export type MakeDictEncoder = z.infer<typeof MakeDictEncoderSchema>;
914+
910915 export const MapSchema = z.object({
911916 "map": z.number().int(),
912917 });
@@ -1282,16 +1287,6 @@ export const SbyteSchema = z.object({
12821287 });
12831288 export type Sbyte = z.infer<typeof SbyteSchema>;
12841289
1285-export const SealedSchema = z.object({
1286- "sealed": z.number().int(),
1287-});
1288-export type Sealed = z.infer<typeof SealedSchema>;
1289-
1290-export const SelSchema = z.object({
1291- "SEL": z.number().int(),
1292-});
1293-export type Sel = z.infer<typeof SelSchema>;
1294-
12951290 export const KSerializerSchema = z.object({
12961291 "KSerializer": z.number().int(),
12971292 });
@@ -1317,6 +1312,16 @@ export const PrimitiveKindSchema = z.object({
13171312 });
13181313 export type PrimitiveKind = z.infer<typeof PrimitiveKindSchema>;
13191314
1315+export const SealedSchema = z.object({
1316+ "sealed": z.number().int(),
1317+});
1318+export type Sealed = z.infer<typeof SealedSchema>;
1319+
1320+export const SelSchema = z.object({
1321+ "SEL": z.number().int(),
1322+});
1323+export type Sel = z.infer<typeof SelSchema>;
1324+
13201325 export const SelectSchema = z.object({
13211326 "select": z.number().int(),
13221327 });
@@ -1612,16 +1617,16 @@ export const UnsafeSchema = z.object({
16121617 });
16131618 export type Unsafe = z.infer<typeof UnsafeSchema>;
16141619
1615-export const UseSerializersSchema = z.object({
1616- "UseSerializers": z.number().int(),
1617-});
1618-export type UseSerializers = z.infer<typeof UseSerializersSchema>;
1619-
16201620 export const UnsignedSchema = z.object({
16211621 "unsigned": z.number().int(),
16221622 });
16231623 export type Unsigned = z.infer<typeof UnsignedSchema>;
16241624
1625+export const UseSerializersSchema = z.object({
1626+ "UseSerializers": z.number().int(),
1627+});
1628+export type UseSerializers = z.infer<typeof UseSerializersSchema>;
1629+
16251630 export const UshortSchema = z.object({
16261631 "ushort": z.number().int(),
16271632 });
@@ -1909,6 +1914,7 @@ export const Obj3Schema = z.object({
19091914 "Locale": LocaleSchema,
19101915 "lock": LockSchema,
19111916 "long": LongSchema,
1917+ "makeDictEncoder": MakeDictEncoderSchema,
19121918 "map": MapSchema,
19131919 "MapEntry": MapEntrySchema,
19141920 "MarshalJSON": MarshalJsonSchema,
@@ -1920,13 +1926,13 @@ export const Obj3Schema = z.object({
19201926 "native": NativeSchema,
19211927 "new": NewSchema,
19221928 "newtonsoft": NewtonsoftSchema,
1923- "nil": NilSchema,
1924- "NO": NoSchema,
19251929 });
19261930 export type Obj3 = z.infer<typeof Obj3Schema>;
19271931
19281932 export const Obj4Schema = z.object({
19291933 "dummy": z.number().int(),
1934+ "nil": NilSchema,
1935+ "NO": NoSchema,
19301936 "noSuchMethod": NoSuchMethodSchema,
19311937 "noexcept": NoexceptSchema,
19321938 "nonatomic": NonatomicSchema,
@@ -1989,8 +1995,6 @@ export const Obj4Schema = z.object({
19891995 "runtimeType": RuntimeTypeSchema,
19901996 "s": SSchema,
19911997 "sbyte": SbyteSchema,
1992- "sealed": SealedSchema,
1993- "SEL": SelSchema,
19941998 });
19951999 export type Obj4 = z.infer<typeof Obj4Schema>;
19962000
@@ -2001,6 +2005,8 @@ export const Obj5Schema = z.object({
20012005 "true": TrueClassSchema,
20022006 "type": TypeClassSchema,
20032007 "PrimitiveKind": PrimitiveKindSchema,
2008+ "sealed": SealedSchema,
2009+ "SEL": SelSchema,
20042010 "select": SelectSchema,
20052011 "Self": SelfSchema,
20062012 "Sendable": SendableSchema,
@@ -2058,15 +2064,15 @@ export const Obj5Schema = z.object({
20582064 "undefined": UndefinedSchema,
20592065 "union": UnionSchema,
20602066 "UnmarshalJSON": UnmarshalJsonSchema,
2061- "unowned": UnownedSchema,
2062- "unsafe": UnsafeSchema,
2063- "UseSerializers": UseSerializersSchema,
20642067 });
20652068 export type Obj5 = z.infer<typeof Obj5Schema>;
20662069
20672070 export const Obj6Schema = z.object({
20682071 "dummy": z.number().int(),
2072+ "unowned": UnownedSchema,
2073+ "unsafe": UnsafeSchema,
20692074 "unsigned": UnsignedSchema,
2075+ "UseSerializers": UseSerializersSchema,
20702076 "ushort": UshortSchema,
20712077 "using": UsingSchema,
20722078 "Utf8JsonReader": Utf8JsonReaderSchema,
Mtypescriptdefault / TopLevel.ts+68 −59
@@ -686,7 +686,6 @@ export interface Obj3 {
686686 Locale: Locale;
687687 MapEntry: MapEntry;
688688 MarshalJSON: MarshalJSON;
689- NO: No;
690689 dummy: number;
691690 goto: Goto;
692691 guard: Guard;
@@ -724,6 +723,7 @@ export interface Obj3 {
724723 list: List;
725724 lock: Lock;
726725 long: Long;
726+ makeDictEncoder: MakeDictEncoder;
727727 map: Map;
728728 metadata_property_handling: MetadataPropertyHandling;
729729 module: Module;
@@ -733,7 +733,6 @@ export interface Obj3 {
733733 native: Native;
734734 new: New;
735735 newtonsoft: Newtonsoft;
736- nil: Nil;
737736 }
738737
739738 export interface Hashable {
@@ -808,10 +807,6 @@ export interface MarshalJSON {
808807 MarshalJSON: number;
809808 }
810809
811-export interface No {
812- NO: number;
813-}
814-
815810 export interface Goto {
816811 goto: number;
817812 }
@@ -956,6 +951,10 @@ export interface Long {
956951 long: number;
957952 }
958953
954+export interface MakeDictEncoder {
955+ makeDictEncoder: number;
956+}
957+
959958 export interface Map {
960959 map: number;
961960 }
@@ -992,11 +991,8 @@ export interface Newtonsoft {
992991 newtonsoft: number;
993992 }
994993
995-export interface Nil {
996- nil: number;
997-}
998-
999994 export interface Obj4 {
995+ NO: No;
1000996 NSError: NSError;
1001997 NSObject: NSObject;
1002998 NSString: NSString;
@@ -1005,8 +1001,8 @@ export interface Obj4 {
10051001 ObjectMapper: ObjectMapper;
10061002 Protocol: Protocol;
10071003 RegExp: RegExp;
1008- SEL: Sel;
10091004 dummy: number;
1005+ nil: Nil;
10101006 noSuchMethod: NoSuchMethod;
10111007 noexcept: Noexcept;
10121008 nonatomic: Nonatomic;
@@ -1061,7 +1057,10 @@ export interface Obj4 {
10611057 runtimeType: RuntimeType;
10621058 s: S;
10631059 sbyte: Sbyte;
1064- sealed: Sealed;
1060+}
1061+
1062+export interface No {
1063+ NO: number;
10651064 }
10661065
10671066 export interface NSError {
@@ -1096,8 +1095,8 @@ export interface RegExp {
10961095 RegExp: string;
10971096 }
10981097
1099-export interface Sel {
1100- SEL: number;
1098+export interface Nil {
1099+ nil: number;
11011100 }
11021101
11031102 export interface NoSuchMethod {
@@ -1316,13 +1315,10 @@ export interface Sbyte {
13161315 sbyte: number;
13171316 }
13181317
1319-export interface Sealed {
1320- sealed: number;
1321-}
1322-
13231318 export interface Obj5 {
13241319 KSerializer: KSerializer;
13251320 PrimitiveKind: PrimitiveKind;
1321+ SEL: Sel;
13261322 Self: Self;
13271323 Sendable: Sendable;
13281324 SerialDescriptor: SerialDescriptor;
@@ -1339,8 +1335,8 @@ export interface Obj5 {
13391335 True: True;
13401336 Type: Type;
13411337 UnmarshalJSON: UnmarshalJSON;
1342- UseSerializers: UseSerializers;
13431338 dummy: number;
1339+ sealed: Sealed;
13441340 select: Select;
13451341 self: SelfClass;
13461342 serialize: Serialize;
@@ -1385,8 +1381,6 @@ export interface Obj5 {
13851381 unchecked: Unchecked;
13861382 undefined: Undefined;
13871383 union: Union;
1388- unowned: Unowned;
1389- unsafe: Unsafe;
13901384 }
13911385
13921386 export interface KSerializer {
@@ -1397,6 +1391,10 @@ export interface PrimitiveKind {
13971391 PrimitiveKind: number;
13981392 }
13991393
1394+export interface Sel {
1395+ SEL: number;
1396+}
1397+
14001398 export interface Self {
14011399 Self: number;
14021400 }
@@ -1461,8 +1459,8 @@ export interface UnmarshalJSON {
14611459 UnmarshalJSON: number;
14621460 }
14631461
1464-export interface UseSerializers {
1465- UseSerializers: number;
1462+export interface Sealed {
1463+ sealed: number;
14661464 }
14671465
14681466 export interface Select {
@@ -1641,20 +1639,15 @@ export interface Union {
16411639 union: number;
16421640 }
16431641
1644-export interface Unowned {
1645- unowned: number;
1646-}
1647-
1648-export interface Unsafe {
1649- unsafe: number;
1650-}
1651-
16521642 export interface Obj6 {
16531643 UUID: UUID;
1644+ UseSerializers: UseSerializers;
16541645 Utf8JsonReader: Utf8JSONReader;
16551646 Utf8JsonWriter: Utf8JSONWriter;
16561647 YES: Yes;
16571648 dummy: number;
1649+ unowned: Unowned;
1650+ unsafe: Unsafe;
16581651 unsigned: Unsigned;
16591652 ushort: Ushort;
16601653 using: Using;
@@ -1677,6 +1670,10 @@ export interface UUID {
16771670 UUID: number;
16781671 }
16791672
1673+export interface UseSerializers {
1674+ UseSerializers: number;
1675+}
1676+
16801677 export interface Utf8JSONReader {
16811678 Utf8JsonReader: number;
16821679 }
@@ -1689,6 +1686,14 @@ export interface Yes {
16891686 YES: number;
16901687 }
16911688
1689+export interface Unowned {
1690+ unowned: number;
1691+}
1692+
1693+export interface Unsafe {
1694+ unsafe: number;
1695+}
1696+
16921697 export interface Unsigned {
16931698 unsigned: number;
16941699 }
@@ -1849,7 +1854,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
18491854 if (val === null || typeof val !== "object" || Array.isArray(val)) {
18501855 return invalidValue(l(ref || "object"), val, key, parent);
18511856 }
1852- const result: any = {};
1857+ const result: any = Object.create(null);
18531858 Object.getOwnPropertyNames(props).forEach(key => {
18541859 const prop = props[key];
18551860 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -1860,7 +1865,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
18601865 result[key] = transform(val[key], additional, getProps, key, ref);
18611866 }
18621867 });
1863- return result;
1868+ return Object.setPrototypeOf(result, Object.prototype);
18641869 }
18651870
18661871 if (typ === "any") return val;
@@ -2487,7 +2492,6 @@ const typeMap: any = {
24872492 { json: "Locale", js: "Locale", typ: r("Locale") },
24882493 { json: "MapEntry", js: "MapEntry", typ: r("MapEntry") },
24892494 { json: "MarshalJSON", js: "MarshalJSON", typ: r("MarshalJSON") },
2490- { json: "NO", js: "NO", typ: r("No") },
24912495 { json: "dummy", js: "dummy", typ: i(0) },
24922496 { json: "goto", js: "goto", typ: r("Goto") },
24932497 { json: "guard", js: "guard", typ: r("Guard") },
@@ -2525,6 +2529,7 @@ const typeMap: any = {
25252529 { json: "list", js: "list", typ: r("List") },
25262530 { json: "lock", js: "lock", typ: r("Lock") },
25272531 { json: "long", js: "long", typ: r("Long") },
2532+ { json: "makeDictEncoder", js: "makeDictEncoder", typ: r("MakeDictEncoder") },
25282533 { json: "map", js: "map", typ: r("Map") },
25292534 { json: "metadata_property_handling", js: "metadata_property_handling", typ: r("MetadataPropertyHandling") },
25302535 { json: "module", js: "module", typ: r("Module") },
@@ -2534,7 +2539,6 @@ const typeMap: any = {
25342539 { json: "native", js: "native", typ: r("Native") },
25352540 { json: "new", js: "new", typ: r("New") },
25362541 { json: "newtonsoft", js: "newtonsoft", typ: r("Newtonsoft") },
2537- { json: "nil", js: "nil", typ: r("Nil") },
25382542 ], false),
25392543 "Hashable": o([
25402544 { json: "Hashable", js: "Hashable", typ: i(0) },
@@ -2590,9 +2594,6 @@ const typeMap: any = {
25902594 "MarshalJSON": o([
25912595 { json: "MarshalJSON", js: "MarshalJSON", typ: i(0) },
25922596 ], false),
2593- "No": o([
2594- { json: "NO", js: "NO", typ: i(0) },
2595- ], false),
25962597 "Goto": o([
25972598 { json: "goto", js: "goto", typ: i(0) },
25982599 ], false),
@@ -2701,6 +2702,9 @@ const typeMap: any = {
27012702 "Long": o([
27022703 { json: "long", js: "long", typ: i(0) },
27032704 ], false),
2705+ "MakeDictEncoder": o([
2706+ { json: "makeDictEncoder", js: "makeDictEncoder", typ: i(0) },
2707+ ], false),
27042708 "Map": o([
27052709 { json: "map", js: "map", typ: i(0) },
27062710 ], false),
@@ -2728,10 +2732,8 @@ const typeMap: any = {
27282732 "Newtonsoft": o([
27292733 { json: "newtonsoft", js: "newtonsoft", typ: i(0) },
27302734 ], false),
2731- "Nil": o([
2732- { json: "nil", js: "nil", typ: i(0) },
2733- ], false),
27342735 "Obj4": o([
2736+ { json: "NO", js: "NO", typ: r("No") },
27352737 { json: "NSError", js: "NSError", typ: r("NSError") },
27362738 { json: "NSObject", js: "NSObject", typ: r("NSObject") },
27372739 { json: "NSString", js: "NSString", typ: r("NSString") },
@@ -2740,8 +2742,8 @@ const typeMap: any = {
27402742 { json: "ObjectMapper", js: "ObjectMapper", typ: r("ObjectMapper") },
27412743 { json: "Protocol", js: "Protocol", typ: r("Protocol") },
27422744 { json: "RegExp", js: "RegExp", typ: r("RegExp") },
2743- { json: "SEL", js: "SEL", typ: r("Sel") },
27442745 { json: "dummy", js: "dummy", typ: i(0) },
2746+ { json: "nil", js: "nil", typ: r("Nil") },
27452747 { json: "noSuchMethod", js: "noSuchMethod", typ: r("NoSuchMethod") },
27462748 { json: "noexcept", js: "noexcept", typ: r("Noexcept") },
27472749 { json: "nonatomic", js: "nonatomic", typ: r("Nonatomic") },
@@ -2796,7 +2798,9 @@ const typeMap: any = {
27962798 { json: "runtimeType", js: "runtimeType", typ: r("RuntimeType") },
27972799 { json: "s", js: "s", typ: r("S") },
27982800 { json: "sbyte", js: "sbyte", typ: r("Sbyte") },
2799- { json: "sealed", js: "sealed", typ: r("Sealed") },
2801+ ], false),
2802+ "No": o([
2803+ { json: "NO", js: "NO", typ: i(0) },
28002804 ], false),
28012805 "NSError": o([
28022806 { json: "NSError", js: "NSError", typ: i(0) },
@@ -2822,8 +2826,8 @@ const typeMap: any = {
28222826 "RegExp": o([
28232827 { json: "RegExp", js: "RegExp", typ: { uuid: "" } },
28242828 ], false),
2825- "Sel": o([
2826- { json: "SEL", js: "SEL", typ: i(0) },
2829+ "Nil": o([
2830+ { json: "nil", js: "nil", typ: i(0) },
28272831 ], false),
28282832 "NoSuchMethod": o([
28292833 { json: "noSuchMethod", js: "noSuchMethod", typ: i(0) },
@@ -2987,12 +2991,10 @@ const typeMap: any = {
29872991 "Sbyte": o([
29882992 { json: "sbyte", js: "sbyte", typ: i(0) },
29892993 ], false),
2990- "Sealed": o([
2991- { json: "sealed", js: "sealed", typ: i(0) },
2992- ], false),
29932994 "Obj5": o([
29942995 { json: "KSerializer", js: "KSerializer", typ: r("KSerializer") },
29952996 { json: "PrimitiveKind", js: "PrimitiveKind", typ: r("PrimitiveKind") },
2997+ { json: "SEL", js: "SEL", typ: r("Sel") },
29962998 { json: "Self", js: "Self", typ: r("Self") },
29972999 { json: "Sendable", js: "Sendable", typ: r("Sendable") },
29983000 { json: "SerialDescriptor", js: "SerialDescriptor", typ: r("SerialDescriptor") },
@@ -3009,8 +3011,8 @@ const typeMap: any = {
30093011 { json: "True", js: "True", typ: r("True") },
30103012 { json: "Type", js: "Type", typ: r("Type") },
30113013 { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: r("UnmarshalJSON") },
3012- { json: "UseSerializers", js: "UseSerializers", typ: r("UseSerializers") },
30133014 { json: "dummy", js: "dummy", typ: i(0) },
3015+ { json: "sealed", js: "sealed", typ: r("Sealed") },
30143016 { json: "select", js: "select", typ: r("Select") },
30153017 { json: "self", js: "self", typ: r("SelfClass") },
30163018 { json: "serialize", js: "serialize", typ: r("Serialize") },
@@ -3055,8 +3057,6 @@ const typeMap: any = {
30553057 { json: "unchecked", js: "unchecked", typ: r("Unchecked") },
30563058 { json: "undefined", js: "undefined", typ: r("Undefined") },
30573059 { json: "union", js: "union", typ: r("Union") },
3058- { json: "unowned", js: "unowned", typ: r("Unowned") },
3059- { json: "unsafe", js: "unsafe", typ: r("Unsafe") },
30603060 ], false),
30613061 "KSerializer": o([
30623062 { json: "KSerializer", js: "KSerializer", typ: i(0) },
@@ -3064,6 +3064,9 @@ const typeMap: any = {
30643064 "PrimitiveKind": o([
30653065 { json: "PrimitiveKind", js: "PrimitiveKind", typ: i(0) },
30663066 ], false),
3067+ "Sel": o([
3068+ { json: "SEL", js: "SEL", typ: i(0) },
3069+ ], false),
30673070 "Self": o([
30683071 { json: "Self", js: "Self", typ: i(0) },
30693072 ], false),
@@ -3112,8 +3115,8 @@ const typeMap: any = {
31123115 "UnmarshalJSON": o([
31133116 { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: i(0) },
31143117 ], false),
3115- "UseSerializers": o([
3116- { json: "UseSerializers", js: "UseSerializers", typ: i(0) },
3118+ "Sealed": o([
3119+ { json: "sealed", js: "sealed", typ: i(0) },
31173120 ], false),
31183121 "Select": o([
31193122 { json: "select", js: "select", typ: i(0) },
@@ -3247,18 +3250,15 @@ const typeMap: any = {
32473250 "Union": o([
32483251 { json: "union", js: "union", typ: i(0) },
32493252 ], false),
3250- "Unowned": o([
3251- { json: "unowned", js: "unowned", typ: i(0) },
3252- ], false),
3253- "Unsafe": o([
3254- { json: "unsafe", js: "unsafe", typ: i(0) },
3255- ], false),
32563253 "Obj6": o([
32573254 { json: "UUID", js: "UUID", typ: r("UUID") },
3255+ { json: "UseSerializers", js: "UseSerializers", typ: r("UseSerializers") },
32583256 { json: "Utf8JsonReader", js: "Utf8JsonReader", typ: r("Utf8JSONReader") },
32593257 { json: "Utf8JsonWriter", js: "Utf8JsonWriter", typ: r("Utf8JSONWriter") },
32603258 { json: "YES", js: "YES", typ: r("Yes") },
32613259 { json: "dummy", js: "dummy", typ: i(0) },
3260+ { json: "unowned", js: "unowned", typ: r("Unowned") },
3261+ { json: "unsafe", js: "unsafe", typ: r("Unsafe") },
32623262 { json: "unsigned", js: "unsigned", typ: r("Unsigned") },
32633263 { json: "ushort", js: "ushort", typ: r("Ushort") },
32643264 { json: "using", js: "using", typ: r("Using") },
@@ -3279,6 +3279,9 @@ const typeMap: any = {
32793279 "UUID": o([
32803280 { json: "UUID", js: "UUID", typ: i(0) },
32813281 ], false),
3282+ "UseSerializers": o([
3283+ { json: "UseSerializers", js: "UseSerializers", typ: i(0) },
3284+ ], false),
32823285 "Utf8JSONReader": o([
32833286 { json: "Utf8JsonReader", js: "Utf8JsonReader", typ: i(0) },
32843287 ], false),
@@ -3288,6 +3291,12 @@ const typeMap: any = {
32883291 "Yes": o([
32893292 { json: "YES", js: "YES", typ: i(0) },
32903293 ], false),
3294+ "Unowned": o([
3295+ { json: "unowned", js: "unowned", typ: i(0) },
3296+ ], false),
3297+ "Unsafe": o([
3298+ { json: "unsafe", js: "unsafe", typ: i(0) },
3299+ ], false),
32913300 "Unsigned": o([
32923301 { json: "unsigned", js: "unsigned", typ: i(0) },
32933302 ], false),
Mtypescriptprefer-types-true--df33e18681f9 / TopLevel.ts+68 −59
@@ -686,7 +686,6 @@ export type Obj3 = {
686686 Locale: Locale;
687687 MapEntry: MapEntry;
688688 MarshalJSON: MarshalJSON;
689- NO: No;
690689 dummy: number;
691690 goto: Goto;
692691 guard: Guard;
@@ -724,6 +723,7 @@ export type Obj3 = {
724723 list: List;
725724 lock: Lock;
726725 long: Long;
726+ makeDictEncoder: MakeDictEncoder;
727727 map: Map;
728728 metadata_property_handling: MetadataPropertyHandling;
729729 module: Module;
@@ -733,7 +733,6 @@ export type Obj3 = {
733733 native: Native;
734734 new: New;
735735 newtonsoft: Newtonsoft;
736- nil: Nil;
737736 }
738737
739738 export type Hashable = {
@@ -808,10 +807,6 @@ export type MarshalJSON = {
808807 MarshalJSON: number;
809808 }
810809
811-export type No = {
812- NO: number;
813-}
814-
815810 export type Goto = {
816811 goto: number;
817812 }
@@ -956,6 +951,10 @@ export type Long = {
956951 long: number;
957952 }
958953
954+export type MakeDictEncoder = {
955+ makeDictEncoder: number;
956+}
957+
959958 export type Map = {
960959 map: number;
961960 }
@@ -992,11 +991,8 @@ export type Newtonsoft = {
992991 newtonsoft: number;
993992 }
994993
995-export type Nil = {
996- nil: number;
997-}
998-
999994 export type Obj4 = {
995+ NO: No;
1000996 NSError: NSError;
1001997 NSObject: NSObject;
1002998 NSString: NSString;
@@ -1005,8 +1001,8 @@ export type Obj4 = {
10051001 ObjectMapper: ObjectMapper;
10061002 Protocol: Protocol;
10071003 RegExp: RegExp;
1008- SEL: Sel;
10091004 dummy: number;
1005+ nil: Nil;
10101006 noSuchMethod: NoSuchMethod;
10111007 noexcept: Noexcept;
10121008 nonatomic: Nonatomic;
@@ -1061,7 +1057,10 @@ export type Obj4 = {
10611057 runtimeType: RuntimeType;
10621058 s: S;
10631059 sbyte: Sbyte;
1064- sealed: Sealed;
1060+}
1061+
1062+export type No = {
1063+ NO: number;
10651064 }
10661065
10671066 export type NSError = {
@@ -1096,8 +1095,8 @@ export type RegExp = {
10961095 RegExp: string;
10971096 }
10981097
1099-export type Sel = {
1100- SEL: number;
1098+export type Nil = {
1099+ nil: number;
11011100 }
11021101
11031102 export type NoSuchMethod = {
@@ -1316,13 +1315,10 @@ export type Sbyte = {
13161315 sbyte: number;
13171316 }
13181317
1319-export type Sealed = {
1320- sealed: number;
1321-}
1322-
13231318 export type Obj5 = {
13241319 KSerializer: KSerializer;
13251320 PrimitiveKind: PrimitiveKind;
1321+ SEL: Sel;
13261322 Self: Self;
13271323 Sendable: Sendable;
13281324 SerialDescriptor: SerialDescriptor;
@@ -1339,8 +1335,8 @@ export type Obj5 = {
13391335 True: True;
13401336 Type: Type;
13411337 UnmarshalJSON: UnmarshalJSON;
1342- UseSerializers: UseSerializers;
13431338 dummy: number;
1339+ sealed: Sealed;
13441340 select: Select;
13451341 self: SelfClass;
13461342 serialize: Serialize;
@@ -1385,8 +1381,6 @@ export type Obj5 = {
13851381 unchecked: Unchecked;
13861382 undefined: Undefined;
13871383 union: Union;
1388- unowned: Unowned;
1389- unsafe: Unsafe;
13901384 }
13911385
13921386 export type KSerializer = {
@@ -1397,6 +1391,10 @@ export type PrimitiveKind = {
13971391 PrimitiveKind: number;
13981392 }
13991393
1394+export type Sel = {
1395+ SEL: number;
1396+}
1397+
14001398 export type Self = {
14011399 Self: number;
14021400 }
@@ -1461,8 +1459,8 @@ export type UnmarshalJSON = {
14611459 UnmarshalJSON: number;
14621460 }
14631461
1464-export type UseSerializers = {
1465- UseSerializers: number;
1462+export type Sealed = {
1463+ sealed: number;
14661464 }
14671465
14681466 export type Select = {
@@ -1641,20 +1639,15 @@ export type Union = {
16411639 union: number;
16421640 }
16431641
1644-export type Unowned = {
1645- unowned: number;
1646-}
1647-
1648-export type Unsafe = {
1649- unsafe: number;
1650-}
1651-
16521642 export type Obj6 = {
16531643 UUID: UUID;
1644+ UseSerializers: UseSerializers;
16541645 Utf8JsonReader: Utf8JSONReader;
16551646 Utf8JsonWriter: Utf8JSONWriter;
16561647 YES: Yes;
16571648 dummy: number;
1649+ unowned: Unowned;
1650+ unsafe: Unsafe;
16581651 unsigned: Unsigned;
16591652 ushort: Ushort;
16601653 using: Using;
@@ -1677,6 +1670,10 @@ export type UUID = {
16771670 UUID: number;
16781671 }
16791672
1673+export type UseSerializers = {
1674+ UseSerializers: number;
1675+}
1676+
16801677 export type Utf8JSONReader = {
16811678 Utf8JsonReader: number;
16821679 }
@@ -1689,6 +1686,14 @@ export type Yes = {
16891686 YES: number;
16901687 }
16911688
1689+export type Unowned = {
1690+ unowned: number;
1691+}
1692+
1693+export type Unsafe = {
1694+ unsafe: number;
1695+}
1696+
16921697 export type Unsigned = {
16931698 unsigned: number;
16941699 }
@@ -1849,7 +1854,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
18491854 if (val === null || typeof val !== "object" || Array.isArray(val)) {
18501855 return invalidValue(l(ref || "object"), val, key, parent);
18511856 }
1852- const result: any = {};
1857+ const result: any = Object.create(null);
18531858 Object.getOwnPropertyNames(props).forEach(key => {
18541859 const prop = props[key];
18551860 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -1860,7 +1865,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
18601865 result[key] = transform(val[key], additional, getProps, key, ref);
18611866 }
18621867 });
1863- return result;
1868+ return Object.setPrototypeOf(result, Object.prototype);
18641869 }
18651870
18661871 if (typ === "any") return val;
@@ -2487,7 +2492,6 @@ const typeMap: any = {
24872492 { json: "Locale", js: "Locale", typ: r("Locale") },
24882493 { json: "MapEntry", js: "MapEntry", typ: r("MapEntry") },
24892494 { json: "MarshalJSON", js: "MarshalJSON", typ: r("MarshalJSON") },
2490- { json: "NO", js: "NO", typ: r("No") },
24912495 { json: "dummy", js: "dummy", typ: i(0) },
24922496 { json: "goto", js: "goto", typ: r("Goto") },
24932497 { json: "guard", js: "guard", typ: r("Guard") },
@@ -2525,6 +2529,7 @@ const typeMap: any = {
25252529 { json: "list", js: "list", typ: r("List") },
25262530 { json: "lock", js: "lock", typ: r("Lock") },
25272531 { json: "long", js: "long", typ: r("Long") },
2532+ { json: "makeDictEncoder", js: "makeDictEncoder", typ: r("MakeDictEncoder") },
25282533 { json: "map", js: "map", typ: r("Map") },
25292534 { json: "metadata_property_handling", js: "metadata_property_handling", typ: r("MetadataPropertyHandling") },
25302535 { json: "module", js: "module", typ: r("Module") },
@@ -2534,7 +2539,6 @@ const typeMap: any = {
25342539 { json: "native", js: "native", typ: r("Native") },
25352540 { json: "new", js: "new", typ: r("New") },
25362541 { json: "newtonsoft", js: "newtonsoft", typ: r("Newtonsoft") },
2537- { json: "nil", js: "nil", typ: r("Nil") },
25382542 ], false),
25392543 "Hashable": o([
25402544 { json: "Hashable", js: "Hashable", typ: i(0) },
@@ -2590,9 +2594,6 @@ const typeMap: any = {
25902594 "MarshalJSON": o([
25912595 { json: "MarshalJSON", js: "MarshalJSON", typ: i(0) },
25922596 ], false),
2593- "No": o([
2594- { json: "NO", js: "NO", typ: i(0) },
2595- ], false),
25962597 "Goto": o([
25972598 { json: "goto", js: "goto", typ: i(0) },
25982599 ], false),
@@ -2701,6 +2702,9 @@ const typeMap: any = {
27012702 "Long": o([
27022703 { json: "long", js: "long", typ: i(0) },
27032704 ], false),
2705+ "MakeDictEncoder": o([
2706+ { json: "makeDictEncoder", js: "makeDictEncoder", typ: i(0) },
2707+ ], false),
27042708 "Map": o([
27052709 { json: "map", js: "map", typ: i(0) },
27062710 ], false),
@@ -2728,10 +2732,8 @@ const typeMap: any = {
27282732 "Newtonsoft": o([
27292733 { json: "newtonsoft", js: "newtonsoft", typ: i(0) },
27302734 ], false),
2731- "Nil": o([
2732- { json: "nil", js: "nil", typ: i(0) },
2733- ], false),
27342735 "Obj4": o([
2736+ { json: "NO", js: "NO", typ: r("No") },
27352737 { json: "NSError", js: "NSError", typ: r("NSError") },
27362738 { json: "NSObject", js: "NSObject", typ: r("NSObject") },
27372739 { json: "NSString", js: "NSString", typ: r("NSString") },
@@ -2740,8 +2742,8 @@ const typeMap: any = {
27402742 { json: "ObjectMapper", js: "ObjectMapper", typ: r("ObjectMapper") },
27412743 { json: "Protocol", js: "Protocol", typ: r("Protocol") },
27422744 { json: "RegExp", js: "RegExp", typ: r("RegExp") },
2743- { json: "SEL", js: "SEL", typ: r("Sel") },
27442745 { json: "dummy", js: "dummy", typ: i(0) },
2746+ { json: "nil", js: "nil", typ: r("Nil") },
27452747 { json: "noSuchMethod", js: "noSuchMethod", typ: r("NoSuchMethod") },
27462748 { json: "noexcept", js: "noexcept", typ: r("Noexcept") },
27472749 { json: "nonatomic", js: "nonatomic", typ: r("Nonatomic") },
@@ -2796,7 +2798,9 @@ const typeMap: any = {
27962798 { json: "runtimeType", js: "runtimeType", typ: r("RuntimeType") },
27972799 { json: "s", js: "s", typ: r("S") },
27982800 { json: "sbyte", js: "sbyte", typ: r("Sbyte") },
2799- { json: "sealed", js: "sealed", typ: r("Sealed") },
2801+ ], false),
2802+ "No": o([
2803+ { json: "NO", js: "NO", typ: i(0) },
28002804 ], false),
28012805 "NSError": o([
28022806 { json: "NSError", js: "NSError", typ: i(0) },
@@ -2822,8 +2826,8 @@ const typeMap: any = {
28222826 "RegExp": o([
28232827 { json: "RegExp", js: "RegExp", typ: { uuid: "" } },
28242828 ], false),
2825- "Sel": o([
2826- { json: "SEL", js: "SEL", typ: i(0) },
2829+ "Nil": o([
2830+ { json: "nil", js: "nil", typ: i(0) },
28272831 ], false),
28282832 "NoSuchMethod": o([
28292833 { json: "noSuchMethod", js: "noSuchMethod", typ: i(0) },
@@ -2987,12 +2991,10 @@ const typeMap: any = {
29872991 "Sbyte": o([
29882992 { json: "sbyte", js: "sbyte", typ: i(0) },
29892993 ], false),
2990- "Sealed": o([
2991- { json: "sealed", js: "sealed", typ: i(0) },
2992- ], false),
29932994 "Obj5": o([
29942995 { json: "KSerializer", js: "KSerializer", typ: r("KSerializer") },
29952996 { json: "PrimitiveKind", js: "PrimitiveKind", typ: r("PrimitiveKind") },
2997+ { json: "SEL", js: "SEL", typ: r("Sel") },
29962998 { json: "Self", js: "Self", typ: r("Self") },
29972999 { json: "Sendable", js: "Sendable", typ: r("Sendable") },
29983000 { json: "SerialDescriptor", js: "SerialDescriptor", typ: r("SerialDescriptor") },
@@ -3009,8 +3011,8 @@ const typeMap: any = {
30093011 { json: "True", js: "True", typ: r("True") },
30103012 { json: "Type", js: "Type", typ: r("Type") },
30113013 { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: r("UnmarshalJSON") },
3012- { json: "UseSerializers", js: "UseSerializers", typ: r("UseSerializers") },
30133014 { json: "dummy", js: "dummy", typ: i(0) },
3015+ { json: "sealed", js: "sealed", typ: r("Sealed") },
30143016 { json: "select", js: "select", typ: r("Select") },
30153017 { json: "self", js: "self", typ: r("SelfClass") },
30163018 { json: "serialize", js: "serialize", typ: r("Serialize") },
@@ -3055,8 +3057,6 @@ const typeMap: any = {
30553057 { json: "unchecked", js: "unchecked", typ: r("Unchecked") },
30563058 { json: "undefined", js: "undefined", typ: r("Undefined") },
30573059 { json: "union", js: "union", typ: r("Union") },
3058- { json: "unowned", js: "unowned", typ: r("Unowned") },
3059- { json: "unsafe", js: "unsafe", typ: r("Unsafe") },
30603060 ], false),
30613061 "KSerializer": o([
30623062 { json: "KSerializer", js: "KSerializer", typ: i(0) },
@@ -3064,6 +3064,9 @@ const typeMap: any = {
30643064 "PrimitiveKind": o([
30653065 { json: "PrimitiveKind", js: "PrimitiveKind", typ: i(0) },
30663066 ], false),
3067+ "Sel": o([
3068+ { json: "SEL", js: "SEL", typ: i(0) },
3069+ ], false),
30673070 "Self": o([
30683071 { json: "Self", js: "Self", typ: i(0) },
30693072 ], false),
@@ -3112,8 +3115,8 @@ const typeMap: any = {
31123115 "UnmarshalJSON": o([
31133116 { json: "UnmarshalJSON", js: "UnmarshalJSON", typ: i(0) },
31143117 ], false),
3115- "UseSerializers": o([
3116- { json: "UseSerializers", js: "UseSerializers", typ: i(0) },
3118+ "Sealed": o([
3119+ { json: "sealed", js: "sealed", typ: i(0) },
31173120 ], false),
31183121 "Select": o([
31193122 { json: "select", js: "select", typ: i(0) },
@@ -3247,18 +3250,15 @@ const typeMap: any = {
32473250 "Union": o([
32483251 { json: "union", js: "union", typ: i(0) },
32493252 ], false),
3250- "Unowned": o([
3251- { json: "unowned", js: "unowned", typ: i(0) },
3252- ], false),
3253- "Unsafe": o([
3254- { json: "unsafe", js: "unsafe", typ: i(0) },
3255- ], false),
32563253 "Obj6": o([
32573254 { json: "UUID", js: "UUID", typ: r("UUID") },
3255+ { json: "UseSerializers", js: "UseSerializers", typ: r("UseSerializers") },
32583256 { json: "Utf8JsonReader", js: "Utf8JsonReader", typ: r("Utf8JSONReader") },
32593257 { json: "Utf8JsonWriter", js: "Utf8JsonWriter", typ: r("Utf8JSONWriter") },
32603258 { json: "YES", js: "YES", typ: r("Yes") },
32613259 { json: "dummy", js: "dummy", typ: i(0) },
3260+ { json: "unowned", js: "unowned", typ: r("Unowned") },
3261+ { json: "unsafe", js: "unsafe", typ: r("Unsafe") },
32623262 { json: "unsigned", js: "unsigned", typ: r("Unsigned") },
32633263 { json: "ushort", js: "ushort", typ: r("Ushort") },
32643264 { json: "using", js: "using", typ: r("Using") },
@@ -3279,6 +3279,9 @@ const typeMap: any = {
32793279 "UUID": o([
32803280 { json: "UUID", js: "UUID", typ: i(0) },
32813281 ], false),
3282+ "UseSerializers": o([
3283+ { json: "UseSerializers", js: "UseSerializers", typ: i(0) },
3284+ ], false),
32823285 "Utf8JSONReader": o([
32833286 { json: "Utf8JsonReader", js: "Utf8JsonReader", typ: i(0) },
32843287 ], false),
@@ -3288,6 +3291,12 @@ const typeMap: any = {
32883291 "Yes": o([
32893292 { json: "YES", js: "YES", typ: i(0) },
32903293 ], false),
3294+ "Unowned": o([
3295+ { json: "unowned", js: "unowned", typ: i(0) },
3296+ ], false),
3297+ "Unsafe": o([
3298+ { json: "unsafe", js: "unsafe", typ: i(0) },
3299+ ], false),
32913300 "Unsigned": o([
32923301 { json: "unsigned", js: "unsigned", typ: i(0) },
32933302 ], false),
Test case

test/inputs/json/priority/kotlin-enum-class-case-collision.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/priority/list.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/json/priority/name-style.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Test case

test/inputs/json/priority/nbl-stats.json

5 generated files · +56 −30
Melmdefault / QuickType.elm+20 −12
@@ -436,9 +436,9 @@ encodeQuickType x =
436436 , ("periodLengthREGULAR", Jenc.int x.periodLengthREGULAR)
437437 , ("periodType", encodePerType x.periodType)
438438 , ("periodsMax", Jenc.int x.periodsMax)
439- , ("scorers", Jenc.dict identity (Jenc.list encodeScorer) x.scorers)
439+ , ("scorers", makeDictEncoder identity (Jenc.list encodeScorer) x.scorers)
440440 , ("timeline", Jenc.list identity x.timeline)
441- , ("tm", Jenc.dict identity encodeTm x.tm)
441+ , ("tm", makeDictEncoder identity encodeTm x.tm)
442442 , ("totalTimeAdded", Jenc.int x.totalTimeAdded)
443443 , ("totallds", encodeTotallds x.totallds)
444444 ]
@@ -878,7 +878,7 @@ encodeTm x =
878878 , ("p2_score", Jenc.int x.p2Score)
879879 , ("p3_score", Jenc.int x.p3Score)
880880 , ("p4_score", Jenc.int x.p4Score)
881- , ("pl", Jenc.dict identity encodePl x.pl)
881+ , ("pl", makeDictEncoder identity encodePl x.pl)
882882 , ("score", Jenc.int x.score)
883883 , ("scoring", Jenc.list encodeScorer x.scoring)
884884 , ("shortName", Jenc.string x.shortName)
@@ -945,11 +945,11 @@ lds =
945945 encodeLds : Lds -> Jenc.Value
946946 encodeLds x =
947947 Jenc.object
948- [ ("sAssists", Jenc.dict identity encodeScorer x.sAssists)
948+ [ ("sAssists", makeDictEncoder identity encodeScorer x.sAssists)
949949 , ("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)
953953 ]
954954
955955 sBlocks : Jdec.Decoder SBlocks
@@ -1163,15 +1163,23 @@ totallds =
11631163 encodeTotallds : Totallds -> Jenc.Value
11641164 encodeTotallds x =
11651165 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)
11711171 ]
11721172
11731173 --- encoder helpers
11741174
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+
11751183 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
11761184 makeNullableEncoder f m =
11771185 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -439,7 +439,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
439439 if (val === null || typeof val !== "object" || Array.isArray(val)) {
440440 return invalidValue(l(ref || "object"), val, key, parent);
441441 }
442- const result: any = {};
442+ const result: any = Object.create(null);
443443 Object.getOwnPropertyNames(props).forEach(key => {
444444 const prop = props[key];
445445 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
450450 result[key] = transform(val[key], additional, getProps, key, ref);
451451 }
452452 });
453- return result;
453+ return Object.setPrototypeOf(result, Object.prototype);
454454 }
455455
456456 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+30 −12
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export const LeaddatumEnum = S.Literal(
523 "",
@@ -222,11 +240,11 @@ export class Pbp extends S.Class<Pbp>("Pbp")({
222240 }) {}
223241
224242 export class Totallds extends S.Class<Totallds>("Totallds")({
225- "sAssists": S.Record({ key: S.String, value: Scorer}),
226- "sBlocks": S.Record({ key: S.String, value: Scorer}),
227- "sPoints": S.Record({ key: S.String, value: Scorer}),
228- "sReboundsTotal": S.Record({ key: S.String, value: Scorer}),
229- "sSteals": S.Record({ key: S.String, value: Scorer}),
243+ "sAssists": mapSchema(Scorer),
244+ "sBlocks": mapSchema(Scorer),
245+ "sPoints": mapSchema(Scorer),
246+ "sReboundsTotal": mapSchema(Scorer),
247+ "sSteals": mapSchema(Scorer),
230248 }) {}
231249
232250 export class Team extends S.Class<Team>("Team")({
@@ -266,9 +284,9 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
266284 "periodLengthREGULAR": S.Int,
267285 "periodType": PerType,
268286 "periodsMax": S.Int,
269- "scorers": S.Record({ key: S.String, value: S.Array(Scorer)}),
287+ "scorers": mapSchema(S.Array(Scorer)),
270288 "timeline": S.Array(S.Any),
271- "tm": S.Record({ key: S.String, value: S.suspend(() => Tm)}),
289+ "tm": mapSchema(S.suspend(() => Tm)),
272290 "totalTimeAdded": S.Int,
273291 "totallds": Totallds,
274292 }) {}
@@ -278,11 +296,11 @@ export class SBlocks extends S.Class<SBlocks>("SBlocks")({
278296 }) {}
279297
280298 export class Lds extends S.Class<Lds>("Lds")({
281- "sAssists": S.Record({ key: S.String, value: Scorer}),
299+ "sAssists": mapSchema(Scorer),
282300 "sBlocks": SBlocks,
283- "sPoints": S.Record({ key: S.String, value: Scorer}),
284- "sReboundsTotal": S.Record({ key: S.String, value: Scorer}),
285- "sSteals": S.Record({ key: S.String, value: Scorer}),
301+ "sPoints": mapSchema(Scorer),
302+ "sReboundsTotal": mapSchema(Scorer),
303+ "sSteals": mapSchema(Scorer),
286304 }) {}
287305
288306 export class Tm extends S.Class<Tm>("Tm")({
@@ -298,7 +316,7 @@ export class Tm extends S.Class<Tm>("Tm")({
298316 "p2_score": S.Int,
299317 "p3_score": S.Int,
300318 "p4_score": S.Int,
301- "pl": S.Record({ key: S.String, value: Pl}),
319+ "pl": mapSchema(Pl),
302320 "score": S.Int,
303321 "scoring": S.Array(Scorer),
304322 "shortName": S.String,
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -384,7 +384,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
384384 if (val === null || typeof val !== "object" || Array.isArray(val)) {
385385 return invalidValue(l(ref || "object"), val, key, parent);
386386 }
387- const result: any = {};
387+ const result: any = Object.create(null);
388388 Object.getOwnPropertyNames(props).forEach(key => {
389389 const prop = props[key];
390390 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
395395 result[key] = transform(val[key], additional, getProps, key, ref);
396396 }
397397 });
398- return result;
398+ return Object.setPrototypeOf(result, Object.prototype);
399399 }
400400
401401 if (typ === "any") return val;
Test case

test/inputs/json/priority/nested-objects.json

6 generated files · +38 −12
Melmdefault / QuickType.elm+10 −2
@@ -47,12 +47,20 @@ quickType =
4747 encodeQuickType : QuickType -> Jenc.Value
4848 encodeQuickType x =
4949 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)
5252 ]
5353
5454 --- encoder helpers
5555
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+
5664 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
5765 makeNullableEncoder f m =
5866 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mjavascriptconverters-all-objects--3a443babd1cb / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+20 −2
@@ -1,7 +1,25 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
5- "a": S.Record({ key: S.String, value: S.Int}),
6- "b": S.Record({ key: S.String, value: S.Int}),
23+ "a": mapSchema(S.Int),
24+ "b": mapSchema(S.Int),
725 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/json/priority/no-classes.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 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
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 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
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Test case

test/inputs/json/priority/nst-test-suite.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -247,7 +247,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
247247 if (val === null || typeof val !== "object" || Array.isArray(val)) {
248248 return invalidValue(l(ref || "object"), val, key, parent);
249249 }
250- const result: any = {};
250+ const result: any = Object.create(null);
251251 Object.getOwnPropertyNames(props).forEach(key => {
252252 const prop = props[key];
253253 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
258258 result[key] = transform(val[key], additional, getProps, key, ref);
259259 }
260260 });
261- return result;
261+ return Object.setPrototypeOf(result, Object.prototype);
262262 }
263263
264264 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
244244 if (val === null || typeof val !== "object" || Array.isArray(val)) {
245245 return invalidValue(l(ref || "object"), val, key, parent);
246246 }
247- const result: any = {};
247+ const result: any = Object.create(null);
248248 Object.getOwnPropertyNames(props).forEach(key => {
249249 const prop = props[key];
250250 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
255255 result[key] = transform(val[key], additional, getProps, key, ref);
256256 }
257257 });
258- return result;
258+ return Object.setPrototypeOf(result, Object.prototype);
259259 }
260260
261261 if (typ === "any") return val;
Test case

test/inputs/json/priority/number-map.json

7 generated files · +38 −12
Melmdefault / QuickType.elm+9 −1
@@ -45,11 +45,19 @@ quickType =
4545 encodeQuickType : QuickType -> Jenc.Value
4646 encodeQuickType x =
4747 Jenc.object
48- [ ("foo", Jenc.dict identity Jenc.float x.foo)
48+ [ ("foo", makeDictEncoder identity Jenc.float x.foo)
4949 ]
5050
5151 --- encoder helpers
5252
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+
5361 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
5462 makeNullableEncoder f m =
5563 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 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
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Mflowreadonly-true--24da4fc107df / TopLevel.js+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 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
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,6 +1,24 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
5- "foo": S.Record({ key: S.String, value: S.Number}),
23+ "foo": mapSchema(S.Number),
624 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 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
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Mtypescriptreadonly-true--24da4fc107df / TopLevel.ts+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 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
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Test case

test/inputs/json/priority/omit-empty.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/priority/optional-union.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/priority/php-mixed-union.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Test case

test/inputs/json/priority/php-validation.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/priority/recursive.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -226,7 +226,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
226226 if (val === null || typeof val !== "object" || Array.isArray(val)) {
227227 return invalidValue(l(ref || "object"), val, key, parent);
228228 }
229- const result: any = {};
229+ const result: any = Object.create(null);
230230 Object.getOwnPropertyNames(props).forEach(key => {
231231 const prop = props[key];
232232 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
237237 result[key] = transform(val[key], additional, getProps, key, ref);
238238 }
239239 });
240- return result;
240+ return Object.setPrototypeOf(result, Object.prototype);
241241 }
242242
243243 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
226226 if (val === null || typeof val !== "object" || Array.isArray(val)) {
227227 return invalidValue(l(ref || "object"), val, key, parent);
228228 }
229- const result: any = {};
229+ const result: any = Object.create(null);
230230 Object.getOwnPropertyNames(props).forEach(key => {
231231 const prop = props[key];
232232 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
237237 result[key] = transform(val[key], additional, getProps, key, ref);
238238 }
239239 });
240- return result;
240+ return Object.setPrototypeOf(result, Object.prototype);
241241 }
242242
243243 if (typ === "any") return val;
Test case

test/inputs/json/priority/simple-identifiers.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/json/priority/union-constructor-clash.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/json/priority/unions.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Test case

test/inputs/json/priority/url.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/json/priority/uuids.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/json/samples/bitcoin-block.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/samples/copy-with-property.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/json/samples/getting-started.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/json/samples/github-events.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -395,7 +395,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
395395 if (val === null || typeof val !== "object" || Array.isArray(val)) {
396396 return invalidValue(l(ref || "object"), val, key, parent);
397397 }
398- const result: any = {};
398+ const result: any = Object.create(null);
399399 Object.getOwnPropertyNames(props).forEach(key => {
400400 const prop = props[key];
401401 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
406406 result[key] = transform(val[key], additional, getProps, key, ref);
407407 }
408408 });
409- return result;
409+ return Object.setPrototypeOf(result, Object.prototype);
410410 }
411411
412412 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
393393 if (val === null || typeof val !== "object" || Array.isArray(val)) {
394394 return invalidValue(l(ref || "object"), val, key, parent);
395395 }
396- const result: any = {};
396+ const result: any = Object.create(null);
397397 Object.getOwnPropertyNames(props).forEach(key => {
398398 const prop = props[key];
399399 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
404404 result[key] = transform(val[key], additional, getProps, key, ref);
405405 }
406406 });
407- return result;
407+ return Object.setPrototypeOf(result, Object.prototype);
408408 }
409409
410410 if (typ === "any") return val;
Test case

test/inputs/json/samples/kitchen-sink.json

5 generated files · +36 −10
Melmdefault / QuickType.elm+10 −2
@@ -105,10 +105,10 @@ encodeQuickType x =
105105 , ("differentThings", Jenc.list encodeDifferentThingElement x.differentThings)
106106 , ("doubleValue", Jenc.float x.doubleValue)
107107 , ("intValue", Jenc.int x.intValue)
108- , ("mapValue", Jenc.dict identity (makeNullableEncoder Jenc.int) x.mapValue)
108+ , ("mapValue", makeDictEncoder identity (makeNullableEncoder Jenc.int) x.mapValue)
109109 , ("name with spaces", always Jenc.null x.nameWithSpaces)
110110 , ("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)
112112 , ("people", Jenc.list encodePersonElement x.people)
113113 , ("person", encodePurplePerson x.person)
114114 , ("stringValue", Jenc.string x.stringValue)
@@ -183,6 +183,14 @@ encodePurplePerson x =
183183
184184 --- encoder helpers
185185
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+
186194 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
187195 makeNullableEncoder f m =
188196 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
139139 if (val === null || typeof val !== "object" || Array.isArray(val)) {
140140 return invalidValue(l(ref || "object"), val, key, parent);
141141 }
142- const result: any = {};
142+ const result: any = Object.create(null);
143143 Object.getOwnPropertyNames(props).forEach(key => {
144144 const prop = props[key];
145145 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
150150 result[key] = transform(val[key], additional, getProps, key, ref);
151151 }
152152 });
153- return result;
153+ return Object.setPrototypeOf(result, Object.prototype);
154154 }
155155
156156 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+20 −2
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class PurplePerson extends S.Class<PurplePerson>("PurplePerson")({
523 "intOrString": S.Int,
@@ -22,10 +40,10 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
2240 "differentThings": S.Array(S.Union(S.Int, S.NumberFromString.pipe(S.int()), DifferentThingClass)),
2341 "doubleValue": S.Number,
2442 "intValue": S.Int,
25- "mapValue": S.Record({ key: S.String, value: S.NullOr(S.Int)}),
43+ "mapValue": mapSchema(S.NullOr(S.Int)),
2644 "name with spaces": S.Null,
2745 "nullValue": S.Null,
28- "nullableMapValue": S.Record({ key: S.String, value: S.NullOr(S.Int)}),
46+ "nullableMapValue": mapSchema(S.NullOr(S.Int)),
2947 "people": S.Array(PersonElement),
3048 "person": PurplePerson,
3149 "stringValue": S.String,
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
139139 if (val === null || typeof val !== "object" || Array.isArray(val)) {
140140 return invalidValue(l(ref || "object"), val, key, parent);
141141 }
142- const result: any = {};
142+ const result: any = Object.create(null);
143143 Object.getOwnPropertyNames(props).forEach(key => {
144144 const prop = props[key];
145145 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
150150 result[key] = transform(val[key], additional, getProps, key, ref);
151151 }
152152 });
153- return result;
153+ return Object.setPrototypeOf(result, Object.prototype);
154154 }
155155
156156 if (typ === "any") return val;
Test case

test/inputs/json/samples/null-safe.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 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
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 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
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Test case

test/inputs/json/samples/objc-control-characters.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/json/samples/pokedex.json

4 generated files · +8 −8
Mflowdefault / TopLevel.js+2 −2
@@ -159,7 +159,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
159159 if (val === null || typeof val !== "object" || Array.isArray(val)) {
160160 return invalidValue(l(ref || "object"), val, key, parent);
161161 }
162- const result: any = {};
162+ const result: any = Object.create(null);
163163 Object.getOwnPropertyNames(props).forEach(key => {
164164 const prop = props[key];
165165 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
170170 result[key] = transform(val[key], additional, getProps, key, ref);
171171 }
172172 });
173- return result;
173+ return Object.setPrototypeOf(result, Object.prototype);
174174 }
175175
176176 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
136136 if (val === null || typeof val !== "object" || Array.isArray(val)) {
137137 return invalidValue(l(ref || "object"), val, key, parent);
138138 }
139- const result: any = {};
139+ const result: any = Object.create(null);
140140 Object.getOwnPropertyNames(props).forEach(key => {
141141 const prop = props[key];
142142 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
147147 result[key] = transform(val[key], additional, getProps, key, ref);
148148 }
149149 });
150- return result;
150+ return Object.setPrototypeOf(result, Object.prototype);
151151 }
152152
153153 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
136136 if (val === null || typeof val !== "object" || Array.isArray(val)) {
137137 return invalidValue(l(ref || "object"), val, key, parent);
138138 }
139- const result: any = {};
139+ const result: any = Object.create(null);
140140 Object.getOwnPropertyNames(props).forEach(key => {
141141 const prop = props[key];
142142 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
147147 result[key] = transform(val[key], additional, getProps, key, ref);
148148 }
149149 });
150- return result;
150+ return Object.setPrototypeOf(result, Object.prototype);
151151 }
152152
153153 if (typ === "any") return val;
Test case

test/inputs/json/samples/reddit.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -248,7 +248,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
248248 if (val === null || typeof val !== "object" || Array.isArray(val)) {
249249 return invalidValue(l(ref || "object"), val, key, parent);
250250 }
251- const result: any = {};
251+ const result: any = Object.create(null);
252252 Object.getOwnPropertyNames(props).forEach(key => {
253253 const prop = props[key];
254254 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
259259 result[key] = transform(val[key], additional, getProps, key, ref);
260260 }
261261 });
262- return result;
262+ return Object.setPrototypeOf(result, Object.prototype);
263263 }
264264
265265 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
233233 if (val === null || typeof val !== "object" || Array.isArray(val)) {
234234 return invalidValue(l(ref || "object"), val, key, parent);
235235 }
236- const result: any = {};
236+ const result: any = Object.create(null);
237237 Object.getOwnPropertyNames(props).forEach(key => {
238238 const prop = props[key];
239239 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
244244 result[key] = transform(val[key], additional, getProps, key, ref);
245245 }
246246 });
247- return result;
247+ return Object.setPrototypeOf(result, Object.prototype);
248248 }
249249
250250 if (typ === "any") return val;
Test case

test/inputs/json/samples/simple-object.json

4 generated files · +8 −8
Mflowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mflowreadonly-true--24da4fc107df / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/json/samples/spotify-album.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -177,7 +177,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
177177 if (val === null || typeof val !== "object" || Array.isArray(val)) {
178178 return invalidValue(l(ref || "object"), val, key, parent);
179179 }
180- const result: any = {};
180+ const result: any = Object.create(null);
181181 Object.getOwnPropertyNames(props).forEach(key => {
182182 const prop = props[key];
183183 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
188188 result[key] = transform(val[key], additional, getProps, key, ref);
189189 }
190190 });
191- return result;
191+ return Object.setPrototypeOf(result, Object.prototype);
192192 }
193193
194194 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
177177 if (val === null || typeof val !== "object" || Array.isArray(val)) {
178178 return invalidValue(l(ref || "object"), val, key, parent);
179179 }
180- const result: any = {};
180+ const result: any = Object.create(null);
181181 Object.getOwnPropertyNames(props).forEach(key => {
182182 const prop = props[key];
183183 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
188188 result[key] = transform(val[key], additional, getProps, key, ref);
189189 }
190190 });
191- return result;
191+ return Object.setPrototypeOf(result, Object.prototype);
192192 }
193193
194194 if (typ === "any") return val;
Test case

test/inputs/json/samples/us-avg-temperatures.json

5 generated files · +34 −8
Melmdefault / QuickType.elm+9 −1
@@ -61,7 +61,7 @@ quickType =
6161 encodeQuickType : QuickType -> Jenc.Value
6262 encodeQuickType x =
6363 Jenc.object
64- [ ("data", Jenc.dict identity encodeDatum x.data)
64+ [ ("data", makeDictEncoder identity encodeDatum x.data)
6565 , ("description", encodeDescription x.description)
6666 ]
6767
@@ -97,6 +97,14 @@ encodeDescription x =
9797
9898 --- encoder helpers
9999
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+
100108 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
101109 makeNullableEncoder f m =
102110 case m of
Mflowdefault / TopLevel.js+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 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
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mtypescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class Description extends S.Class<Description>("Description")({
523 "base_period": S.String,
@@ -14,6 +32,6 @@ export class Datum extends S.Class<Datum>("Datum")({
1432 }) {}
1533
1634 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
17- "data": S.Record({ key: S.String, value: Datum}),
35+ "data": mapSchema(Datum),
1836 "description": Description,
1937 }) {}
Mtypescriptdefault / TopLevel.ts+2 −2
@@ -120,7 +120,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 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
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Test case

test/inputs/json/samples/us-senators.json

3 generated files · +6 −6
Mflowdefault / TopLevel.js+2 −2
@@ -212,7 +212,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
212212 if (val === null || typeof val !== "object" || Array.isArray(val)) {
213213 return invalidValue(l(ref || "object"), val, key, parent);
214214 }
215- const result: any = {};
215+ const result: any = Object.create(null);
216216 Object.getOwnPropertyNames(props).forEach(key => {
217217 const prop = props[key];
218218 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
223223 result[key] = transform(val[key], additional, getProps, key, ref);
224224 }
225225 });
226- return result;
226+ return Object.setPrototypeOf(result, Object.prototype);
227227 }
228228
229229 if (typ === "any") return val;
Mjavascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
189189 if (val === null || typeof val !== "object" || Array.isArray(val)) {
190190 return invalidValue(l(ref || "object"), val, key, parent);
191191 }
192- const result: any = {};
192+ const result: any = Object.create(null);
193193 Object.getOwnPropertyNames(props).forEach(key => {
194194 const prop = props[key];
195195 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
200200 result[key] = transform(val[key], additional, getProps, key, ref);
201201 }
202202 });
203- return result;
203+ return Object.setPrototypeOf(result, Object.prototype);
204204 }
205205
206206 if (typ === "any") return val;
Test case

test/inputs/schema/accessors.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/schema/all-of-additional-properties-false.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 if (val === null || typeof val !== "object" || Array.isArray(val)) {
120120 return invalidValue(l(ref || "object"), val, key, parent);
121121 }
122- const result: any = {};
122+ const result: any = Object.create(null);
123123 Object.getOwnPropertyNames(props).forEach(key => {
124124 const prop = props[key];
125125 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
130130 result[key] = transform(val[key], additional, getProps, key, ref);
131131 }
132132 });
133- return result;
133+ return Object.setPrototypeOf(result, Object.prototype);
134134 }
135135
136136 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/schema/any.schema

5 generated files · +34 −8
Mschema-elmdefault / QuickType.elm+9 −1
@@ -48,11 +48,19 @@ encodeQuickType : QuickType -> Jenc.Value
4848 encodeQuickType x =
4949 Jenc.object
5050 [ ("foo", identity x.foo)
51- , ("values", Jenc.dict identity identity x.values)
51+ , ("values", makeDictEncoder identity identity x.values)
5252 ]
5353
5454 --- encoder helpers
5555
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+
5664 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
5765 makeNullableEncoder f m =
5866 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
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,7 +1,25 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
523 "foo": S.Any,
6- "values": S.Record({ key: S.String, value: S.Any}),
24+ "values": mapSchema(S.Any),
725 }) {}
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/schema/bool-string.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 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
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 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
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/schema/boolean-subschema.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/camelCase.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/schema/class-map-union.schema

5 generated files · +34 −8
Mschema-elmdefault / QuickType.elm+9 −1
@@ -57,7 +57,7 @@ quickType =
5757 encodeQuickType : QuickType -> Jenc.Value
5858 encodeQuickType x =
5959 Jenc.object
60- [ ("union", makeNullableEncoder (Jenc.dict identity encodeUnionValue) x.union)
60+ [ ("union", makeNullableEncoder (makeDictEncoder identity encodeUnionValue) x.union)
6161 ]
6262
6363 unionValue : Jdec.Decoder UnionValue
@@ -89,6 +89,14 @@ encodeUnionClass x =
8989
9090 --- encoder helpers
9191
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+
92100 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
93101 makeNullableEncoder f m =
94102 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
124124 if (val === null || typeof val !== "object" || Array.isArray(val)) {
125125 return invalidValue(l(ref || "object"), val, key, parent);
126126 }
127- const result: any = {};
127+ const result: any = Object.create(null);
128128 Object.getOwnPropertyNames(props).forEach(key => {
129129 const prop = props[key];
130130 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
135135 result[key] = transform(val[key], additional, getProps, key, ref);
136136 }
137137 });
138- return result;
138+ return Object.setPrototypeOf(result, Object.prototype);
139139 }
140140
141141 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,10 +1,28 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class UnionClass extends S.Class<UnionClass>("UnionClass")({
523 "quux": S.optional(S.Int),
624 }) {}
725
826 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
9- "union": S.optional(S.Record({ key: S.String, value: S.Union(S.Boolean, S.Number, S.String, UnionClass)})),
27+ "union": S.optional(mapSchema(S.Union(S.Boolean, S.Number, S.String, UnionClass))),
1028 }) {}
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -124,7 +124,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
124124 if (val === null || typeof val !== "object" || Array.isArray(val)) {
125125 return invalidValue(l(ref || "object"), val, key, parent);
126126 }
127- const result: any = {};
127+ const result: any = Object.create(null);
128128 Object.getOwnPropertyNames(props).forEach(key => {
129129 const prop = props[key];
130130 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
135135 result[key] = transform(val[key], additional, getProps, key, ref);
136136 }
137137 });
138- return result;
138+ return Object.setPrototypeOf(result, Object.prototype);
139139 }
140140
141141 if (typ === "any") return val;
Test case

test/inputs/schema/class-with-additional.schema

7 generated files · +38 −12
Mschema-elmdefault / QuickType.elm+9 −1
@@ -50,7 +50,7 @@ quickType =
5050 encodeQuickType : QuickType -> Jenc.Value
5151 encodeQuickType x =
5252 Jenc.object
53- [ ("map", makeNullableEncoder (Jenc.dict identity encodeMap) x.map)
53+ [ ("map", makeNullableEncoder (makeDictEncoder identity encodeMap) x.map)
5454 ]
5555
5656 map : Jdec.Decoder Map
@@ -67,6 +67,14 @@ encodeMap x = case x of
6767
6868 --- encoder helpers
6969
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+
7078 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
7179 makeNullableEncoder f m =
7280 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mschema-flowreadonly-true--24da4fc107df / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,6 +1,24 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
5- "map": S.optional(S.Record({ key: S.String, value: S.Union(S.Boolean, S.Number)})),
23+ "map": S.optional(mapSchema(S.Union(S.Boolean, S.Number))),
624 }) {}
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mschema-typescriptreadonly-true--24da4fc107df / TopLevel.ts+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/schema/comment-injection-enum-nested-comment.schema

4 generated files · +8 −8
Mcomment-injection-typescriptdefault / TopLevel.ts+2 −2
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 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
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 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
122122 if (val === null || typeof val !== "object" || Array.isArray(val)) {
123123 return invalidValue(l(ref || "object"), val, key, parent);
124124 }
125- const result: any = {};
125+ const result: any = Object.create(null);
126126 Object.getOwnPropertyNames(props).forEach(key => {
127127 const prop = props[key];
128128 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
133133 result[key] = transform(val[key], additional, getProps, key, ref);
134134 }
135135 });
136- return result;
136+ return Object.setPrototypeOf(result, Object.prototype);
137137 }
138138
139139 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 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
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 if (typ === "any") return val;
Test case

test/inputs/schema/comment-injection-enum.schema

4 generated files · +8 −8
Mcomment-injection-typescriptdefault / TopLevel.ts+2 −2
@@ -127,7 +127,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
127127 if (val === null || typeof val !== "object" || Array.isArray(val)) {
128128 return invalidValue(l(ref || "object"), val, key, parent);
129129 }
130- const result: any = {};
130+ const result: any = Object.create(null);
131131 Object.getOwnPropertyNames(props).forEach(key => {
132132 const prop = props[key];
133133 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
138138 result[key] = transform(val[key], additional, getProps, key, ref);
139139 }
140140 });
141- return result;
141+ return Object.setPrototypeOf(result, Object.prototype);
142142 }
143143
144144 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
128128 if (val === null || typeof val !== "object" || Array.isArray(val)) {
129129 return invalidValue(l(ref || "object"), val, key, parent);
130130 }
131- const result: any = {};
131+ const result: any = Object.create(null);
132132 Object.getOwnPropertyNames(props).forEach(key => {
133133 const prop = props[key];
134134 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
139139 result[key] = transform(val[key], additional, getProps, key, ref);
140140 }
141141 });
142- return result;
142+ return Object.setPrototypeOf(result, Object.prototype);
143143 }
144144
145145 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
127127 if (val === null || typeof val !== "object" || Array.isArray(val)) {
128128 return invalidValue(l(ref || "object"), val, key, parent);
129129 }
130- const result: any = {};
130+ const result: any = Object.create(null);
131131 Object.getOwnPropertyNames(props).forEach(key => {
132132 const prop = props[key];
133133 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
138138 result[key] = transform(val[key], additional, getProps, key, ref);
139139 }
140140 });
141- return result;
141+ return Object.setPrototypeOf(result, Object.prototype);
142142 }
143143
144144 if (typ === "any") return val;
Test case

test/inputs/schema/comment-injection-nested-comment.schema

4 generated files · +8 −8
Mcomment-injection-typescriptdefault / TopLevel.ts+2 −2
@@ -119,7 +119,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
119119 if (val === null || typeof val !== "object" || Array.isArray(val)) {
120120 return invalidValue(l(ref || "object"), val, key, parent);
121121 }
122- const result: any = {};
122+ const result: any = Object.create(null);
123123 Object.getOwnPropertyNames(props).forEach(key => {
124124 const prop = props[key];
125125 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
130130 result[key] = transform(val[key], additional, getProps, key, ref);
131131 }
132132 });
133- return result;
133+ return Object.setPrototypeOf(result, Object.prototype);
134134 }
135135
136136 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
119119 if (val === null || typeof val !== "object" || Array.isArray(val)) {
120120 return invalidValue(l(ref || "object"), val, key, parent);
121121 }
122- const result: any = {};
122+ const result: any = Object.create(null);
123123 Object.getOwnPropertyNames(props).forEach(key => {
124124 const prop = props[key];
125125 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
130130 result[key] = transform(val[key], additional, getProps, key, ref);
131131 }
132132 });
133- return result;
133+ return Object.setPrototypeOf(result, Object.prototype);
134134 }
135135
136136 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
119119 if (val === null || typeof val !== "object" || Array.isArray(val)) {
120120 return invalidValue(l(ref || "object"), val, key, parent);
121121 }
122- const result: any = {};
122+ const result: any = Object.create(null);
123123 Object.getOwnPropertyNames(props).forEach(key => {
124124 const prop = props[key];
125125 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
130130 result[key] = transform(val[key], additional, getProps, key, ref);
131131 }
132132 });
133- return result;
133+ return Object.setPrototypeOf(result, Object.prototype);
134134 }
135135
136136 if (typ === "any") return val;
Test case

test/inputs/schema/comment-injection.schema

4 generated files · +8 −8
Mcomment-injection-typescriptdefault / TopLevel.ts+2 −2
@@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
147147 if (val === null || typeof val !== "object" || Array.isArray(val)) {
148148 return invalidValue(l(ref || "object"), val, key, parent);
149149 }
150- const result: any = {};
150+ const result: any = Object.create(null);
151151 Object.getOwnPropertyNames(props).forEach(key => {
152152 const prop = props[key];
153153 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
158158 result[key] = transform(val[key], additional, getProps, key, ref);
159159 }
160160 });
161- return result;
161+ return Object.setPrototypeOf(result, Object.prototype);
162162 }
163163
164164 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
147147 if (val === null || typeof val !== "object" || Array.isArray(val)) {
148148 return invalidValue(l(ref || "object"), val, key, parent);
149149 }
150- const result: any = {};
150+ const result: any = Object.create(null);
151151 Object.getOwnPropertyNames(props).forEach(key => {
152152 const prop = props[key];
153153 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
158158 result[key] = transform(val[key], additional, getProps, key, ref);
159159 }
160160 });
161- return result;
161+ return Object.setPrototypeOf(result, Object.prototype);
162162 }
163163
164164 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
147147 if (val === null || typeof val !== "object" || Array.isArray(val)) {
148148 return invalidValue(l(ref || "object"), val, key, parent);
149149 }
150- const result: any = {};
150+ const result: any = Object.create(null);
151151 Object.getOwnPropertyNames(props).forEach(key => {
152152 const prop = props[key];
153153 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
158158 result[key] = transform(val[key], additional, getProps, key, ref);
159159 }
160160 });
161- return result;
161+ return Object.setPrototypeOf(result, Object.prototype);
162162 }
163163
164164 if (typ === "any") return val;
Test case

test/inputs/schema/const-non-string.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/schema/constructor.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/cut-enum.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/date-time-or-string.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Test case

test/inputs/schema/date-time.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/schema/default-value.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/description-with-double-quotes.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/schema/description.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
146146 if (val === null || typeof val !== "object" || Array.isArray(val)) {
147147 return invalidValue(l(ref || "object"), val, key, parent);
148148 }
149- const result: any = {};
149+ const result: any = Object.create(null);
150150 Object.getOwnPropertyNames(props).forEach(key => {
151151 const prop = props[key];
152152 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
157157 result[key] = transform(val[key], additional, getProps, key, ref);
158158 }
159159 });
160- return result;
160+ return Object.setPrototypeOf(result, Object.prototype);
161161 }
162162
163163 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
144144 if (val === null || typeof val !== "object" || Array.isArray(val)) {
145145 return invalidValue(l(ref || "object"), val, key, parent);
146146 }
147- const result: any = {};
147+ const result: any = Object.create(null);
148148 Object.getOwnPropertyNames(props).forEach(key => {
149149 const prop = props[key];
150150 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
155155 result[key] = transform(val[key], additional, getProps, key, ref);
156156 }
157157 });
158- return result;
158+ return Object.setPrototypeOf(result, Object.prototype);
159159 }
160160
161161 if (typ === "any") return val;
Test case

test/inputs/schema/direct-union.schema

5 generated files · +37 −11
Mschema-elmdefault / QuickType.elm+10 −2
@@ -61,7 +61,7 @@ quickType =
6161 encodeQuickType : QuickType -> Jenc.Value
6262 encodeQuickType x =
6363 Jenc.object
64- [ ("stuff", Jenc.dict identity encodeThing x.stuff)
64+ [ ("stuff", makeDictEncoder identity encodeThing x.stuff)
6565 ]
6666
6767 thing : Jdec.Decoder Thing
@@ -97,10 +97,18 @@ encodeAnything x = case x of
9797 NullInAnything -> Jenc.null
9898 StringInAnything y -> Jenc.string y
9999 DoubleInAnything y -> Jenc.float y
100- AnythingMapInAnything y -> Jenc.dict identity identity y
100+ AnythingMapInAnything y -> makeDictEncoder identity identity y
101101
102102 --- encoder helpers
103103
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+
104112 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
105113 makeNullableEncoder f m =
106114 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
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescript-effect-schemadefault / TopLevel.ts+21 −3
@@ -1,11 +1,29 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class Thing extends S.Class<Thing>("Thing")({
5- "optional": S.optional(S.Union(S.Array(S.Any), S.Boolean, S.Number, S.Int, S.Record({ key: S.String, value: S.Any}), S.String, S.Null)),
6- "required": S.Union(S.Array(S.Any), S.Boolean, S.Number, S.Int, S.Record({ key: S.String, value: S.Any}), S.String, S.Null),
23+ "optional": S.optional(S.Union(S.Array(S.Any), S.Boolean, S.Number, S.Int, mapSchema(S.Any), S.String, S.Null)),
24+ "required": S.Union(S.Array(S.Any), S.Boolean, S.Number, S.Int, mapSchema(S.Any), S.String, S.Null),
725 }) {}
826
927 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
10- "stuff": S.Record({ key: S.String, value: Thing}),
28+ "stuff": mapSchema(Thing),
1129 }) {}
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/schema/empty-object.schema

5 generated files · +34 −8
Mschema-elmdefault / QuickType.elm+9 −1
@@ -36,10 +36,18 @@ quickType : Jdec.Decoder QuickType
3636 quickType = Jdec.dict Jdec.value
3737
3838 quickTypeToString : QuickType -> String
39-quickTypeToString r = Jenc.encode 0 (Jenc.dict identity identity r)
39+quickTypeToString r = Jenc.encode 0 (makeDictEncoder identity identity r)
4040
4141 --- encoder helpers
4242
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+
4351 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
4452 makeNullableEncoder f m =
4553 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
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 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
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,4 +1,22 @@
11 import * as S from "effect/Schema";
22
3-export const TopLevel = S.Record({ key: S.String, value: S.Any});
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
21+export const TopLevel = mapSchema(S.Any);
422 export type TopLevel = S.Schema.Type<typeof TopLevel>;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 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
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Test case

test/inputs/schema/enum-large.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
136136 if (val === null || typeof val !== "object" || Array.isArray(val)) {
137137 return invalidValue(l(ref || "object"), val, key, parent);
138138 }
139- const result: any = {};
139+ const result: any = Object.create(null);
140140 Object.getOwnPropertyNames(props).forEach(key => {
141141 const prop = props[key];
142142 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
147147 result[key] = transform(val[key], additional, getProps, key, ref);
148148 }
149149 });
150- return result;
150+ return Object.setPrototypeOf(result, Object.prototype);
151151 }
152152
153153 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Test case

test/inputs/schema/enum-with-null.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/schema/enum-with-values.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/enum.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -129,7 +129,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
129129 if (val === null || typeof val !== "object" || Array.isArray(val)) {
130130 return invalidValue(l(ref || "object"), val, key, parent);
131131 }
132- const result: any = {};
132+ const result: any = Object.create(null);
133133 Object.getOwnPropertyNames(props).forEach(key => {
134134 const prop = props[key];
135135 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
140140 result[key] = transform(val[key], additional, getProps, key, ref);
141141 }
142142 });
143- return result;
143+ return Object.setPrototypeOf(result, Object.prototype);
144144 }
145145
146146 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
120120 if (val === null || typeof val !== "object" || Array.isArray(val)) {
121121 return invalidValue(l(ref || "object"), val, key, parent);
122122 }
123- const result: any = {};
123+ const result: any = Object.create(null);
124124 Object.getOwnPropertyNames(props).forEach(key => {
125125 const prop = props[key];
126126 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
131131 result[key] = transform(val[key], additional, getProps, key, ref);
132132 }
133133 });
134- return result;
134+ return Object.setPrototypeOf(result, Object.prototype);
135135 }
136136
137137 if (typ === "any") return val;
Test case

test/inputs/schema/fractional-bounds.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/go-schema-pattern-properties.schema

5 generated files · +34 −8
Mschema-elmdefault / QuickType.elm+9 −1
@@ -45,11 +45,19 @@ quickType =
4545 encodeQuickType : QuickType -> Jenc.Value
4646 encodeQuickType x =
4747 Jenc.object
48- [ ("map", Jenc.dict identity Jenc.int x.map)
48+ [ ("map", makeDictEncoder identity Jenc.int x.map)
4949 ]
5050
5151 --- encoder helpers
5252
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+
5361 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
5462 makeNullableEncoder f m =
5563 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
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,6 +1,24 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
5- "map": S.Record({ key: S.String, value: S.Int}),
23+ "map": mapSchema(S.Int),
624 }) {}
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/haskell-enum-forbidden.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/id-no-address.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/id-root.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/ie-suffix-singularization.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/schema/implicit-all-of.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/implicit-class-array-union.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/schema/implicit-one-of.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/integer-before-number.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/integer-float-union.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/integer-string.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 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
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 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
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/schema/integer-type.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -116,7 +116,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 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
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
116116 if (val === null || typeof val !== "object" || Array.isArray(val)) {
117117 return invalidValue(l(ref || "object"), val, key, parent);
118118 }
119- const result: any = {};
119+ const result: any = Object.create(null);
120120 Object.getOwnPropertyNames(props).forEach(key => {
121121 const prop = props[key];
122122 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
127127 result[key] = transform(val[key], additional, getProps, key, ref);
128128 }
129129 });
130- return result;
130+ return Object.setPrototypeOf(result, Object.prototype);
131131 }
132132
133133 if (typ === "any") return val;
Test case

test/inputs/schema/intersection-nested.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 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
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 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
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Test case

test/inputs/schema/intersection.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Test case

test/inputs/schema/issue2680-top-level-array.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 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
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 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
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Test case

test/inputs/schema/keyword-enum.schema

34 generated files · +86 −18
Mschema-cjsondefault / TopLevel.c+2 −0
@@ -188,6 +188,7 @@ enum Enum cJSON_GetEnumValue(const cJSON * j) {
188188 else if (!strcmp(cJSON_GetStringValue(j), "Locale")) x = ENUM_LOCALE;
189189 else if (!strcmp(cJSON_GetStringValue(j), "lock")) x = ENUM_LOCK;
190190 else if (!strcmp(cJSON_GetStringValue(j), "long")) x = ENUM_LONG;
191+ else if (!strcmp(cJSON_GetStringValue(j), "makeDictEncoder")) x = ENUM_MAKE_DICT_ENCODER;
191192 else if (!strcmp(cJSON_GetStringValue(j), "map")) x = ENUM_MAP;
192193 else if (!strcmp(cJSON_GetStringValue(j), "MarshalJSON")) x = ENUM_MARSHAL_JSON;
193194 else if (!strcmp(cJSON_GetStringValue(j), "MapEntry")) x = ENUM_MAP_ENTRY;
@@ -538,6 +539,7 @@ cJSON * cJSON_CreateEnum(const enum Enum x) {
538539 case ENUM_LOCALE: j = cJSON_CreateString("Locale"); break;
539540 case ENUM_LOCK: j = cJSON_CreateString("lock"); break;
540541 case ENUM_LONG: j = cJSON_CreateString("long"); break;
542+ case ENUM_MAKE_DICT_ENCODER: j = cJSON_CreateString("makeDictEncoder"); break;
541543 case ENUM_MAP: j = cJSON_CreateString("map"); break;
542544 case ENUM_MARSHAL_JSON: j = cJSON_CreateString("MarshalJSON"); break;
543545 case ENUM_MAP_ENTRY: j = cJSON_CreateString("MapEntry"); break;
Mschema-cjsondefault / TopLevel.h+1 −0
@@ -229,6 +229,7 @@ enum Enum {
229229 ENUM_LOCALE,
230230 ENUM_LOCK,
231231 ENUM_LONG,
232+ ENUM_MAKE_DICT_ENCODER,
232233 ENUM_MAP,
233234 ENUM_MARSHAL_JSON,
234235 ENUM_MAP_ENTRY,
Mschema-cplusplusdefault / quicktype.hpp+3 −1
@@ -89,7 +89,7 @@ namespace quicktype {
8989 }
9090 #endif
9191
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 };
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, MAKE_DICT_ENCODER, 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 };
9393
9494 class TopLevel {
9595 public:
@@ -306,6 +306,7 @@ namespace quicktype {
306306 {"Locale", Enum::LOCALE},
307307 {"lock", Enum::LOCK},
308308 {"long", Enum::LONG},
309+ {"makeDictEncoder", Enum::MAKE_DICT_ENCODER},
309310 {"map", Enum::MAP},
310311 {"MarshalJSON", Enum::MARSHAL_JSON},
311312 {"MapEntry", Enum::MAP_ENTRY},
@@ -659,6 +660,7 @@ namespace quicktype {
659660 case Enum::LOCALE: j = "Locale"; break;
660661 case Enum::LOCK: j = "lock"; break;
661662 case Enum::LONG: j = "long"; break;
663+ case Enum::MAKE_DICT_ENCODER: j = "makeDictEncoder"; break;
662664 case Enum::MAP: j = "map"; break;
663665 case Enum::MARSHAL_JSON: j = "MarshalJSON"; break;
664666 case Enum::MAP_ENTRY: j = "MapEntry"; break;
Mschema-csharp-recordsdefault / QuickType.cs+6 −1
@@ -29,7 +29,7 @@ namespace QuickType
2929 public Enum? Enum { get; set; }
3030 }
3131
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 };
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, MakeDictEncoder, 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 };
3333
3434 public partial record TopLevel
3535 {
@@ -425,6 +425,8 @@ namespace QuickType
425425 return Enum.Lock;
426426 case "long":
427427 return Enum.Long;
428+ case "makeDictEncoder":
429+ return Enum.MakeDictEncoder;
428430 case "map":
429431 return Enum.Map;
430432 case "MarshalJSON":
@@ -1305,6 +1307,9 @@ namespace QuickType
13051307 case Enum.Long:
13061308 serializer.Serialize(writer, "long");
13071309 return;
1310+ case Enum.MakeDictEncoder:
1311+ serializer.Serialize(writer, "makeDictEncoder");
1312+ return;
13081313 case Enum.Map:
13091314 serializer.Serialize(writer, "map");
13101315 return;
Mschema-csharp-SystemTextJsondefault / QuickType.cs+6 −1
@@ -27,7 +27,7 @@ namespace QuickType
2727 public Enum? Enum { get; set; }
2828 }
2929
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 };
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, MakeDictEncoder, 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 };
3131
3232 public partial class TopLevel
3333 {
@@ -422,6 +422,8 @@ namespace QuickType
422422 return Enum.Lock;
423423 case "long":
424424 return Enum.Long;
425+ case "makeDictEncoder":
426+ return Enum.MakeDictEncoder;
425427 case "map":
426428 return Enum.Map;
427429 case "MarshalJSON":
@@ -1296,6 +1298,9 @@ namespace QuickType
12961298 case Enum.Long:
12971299 JsonSerializer.Serialize(writer, "long", options);
12981300 return;
1301+ case Enum.MakeDictEncoder:
1302+ JsonSerializer.Serialize(writer, "makeDictEncoder", options);
1303+ return;
12991304 case Enum.Map:
13001305 JsonSerializer.Serialize(writer, "map", options);
13011306 return;
Mschema-csharpdefault / QuickType.cs+6 −1
@@ -29,7 +29,7 @@ namespace QuickType
2929 public Enum? Enum { get; set; }
3030 }
3131
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 };
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, MakeDictEncoder, 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 };
3333
3434 public partial class TopLevel
3535 {
@@ -425,6 +425,8 @@ namespace QuickType
425425 return Enum.Lock;
426426 case "long":
427427 return Enum.Long;
428+ case "makeDictEncoder":
429+ return Enum.MakeDictEncoder;
428430 case "map":
429431 return Enum.Map;
430432 case "MarshalJSON":
@@ -1305,6 +1307,9 @@ namespace QuickType
13051307 case Enum.Long:
13061308 serializer.Serialize(writer, "long");
13071309 return;
1310+ case Enum.MakeDictEncoder:
1311+ serializer.Serialize(writer, "makeDictEncoder");
1312+ return;
13081313 case Enum.Map:
13091314 serializer.Serialize(writer, "map");
13101315 return;
Mschema-dartdefault / TopLevel.dart+2 −0
@@ -205,6 +205,7 @@ enum Enum {
205205 LOCALE,
206206 LOCK,
207207 LONG,
208+ MAKE_DICT_ENCODER,
208209 MAP,
209210 MARSHAL_JSON,
210211 MAP_ENTRY,
@@ -551,6 +552,7 @@ final enumValues = EnumValues({
551552 "Locale": Enum.LOCALE,
552553 "lock": Enum.LOCK,
553554 "long": Enum.LONG,
555+ "makeDictEncoder": Enum.MAKE_DICT_ENCODER,
554556 "map": Enum.MAP,
555557 "MarshalJSON": Enum.MARSHAL_JSON,
556558 "MapEntry": Enum.MAP_ENTRY,
Mschema-elixirdefault / QuickType.ex+1 −0
@@ -187,6 +187,7 @@ defmodule EnumEnum do
187187 :Locale,
188188 :lock,
189189 :long,
190+ :makeDictEncoder,
190191 :map,
191192 :MarshalJSON,
192193 :MapEntry,
Mschema-elmdefault / QuickType.elm+3 −0
@@ -208,6 +208,7 @@ type EnumEnum
208208 | Locale
209209 | Lock
210210 | Long
211+ | MakeDictEncoder
211212 | Map
212213 | MarshalJSON
213214 | MapEntry
@@ -579,6 +580,7 @@ enumEnum =
579580 "Locale" -> Jdec.succeed Locale
580581 "lock" -> Jdec.succeed Lock
581582 "long" -> Jdec.succeed Long
583+ "makeDictEncoder" -> Jdec.succeed MakeDictEncoder
582584 "map" -> Jdec.succeed Map
583585 "MarshalJSON" -> Jdec.succeed MarshalJSON
584586 "MapEntry" -> Jdec.succeed MapEntry
@@ -927,6 +929,7 @@ encodeEnumEnum x = case x of
927929 Locale -> Jenc.string "Locale"
928930 Lock -> Jenc.string "lock"
929931 Long -> Jenc.string "long"
932+ MakeDictEncoder -> Jenc.string "makeDictEncoder"
930933 Map -> Jenc.string "map"
931934 MarshalJSON -> Jenc.string "MarshalJSON"
932935 MapEntry -> Jenc.string "MapEntry"
Mschema-flowdefault / TopLevel.js+4 −2
@@ -195,6 +195,7 @@ export type Enum =
195195 | "Locale"
196196 | "lock"
197197 | "long"
198+ | "makeDictEncoder"
198199 | "map"
199200 | "MarshalJSON"
200201 | "MapEntry"
@@ -453,7 +454,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
453454 if (val === null || typeof val !== "object" || Array.isArray(val)) {
454455 return invalidValue(l(ref || "object"), val, key, parent);
455456 }
456- const result: any = {};
457+ const result: any = Object.create(null);
457458 Object.getOwnPropertyNames(props).forEach(key => {
458459 const prop = props[key];
459460 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -464,7 +465,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
464465 result[key] = transform(val[key], additional, getProps, key, ref);
465466 }
466467 });
467- return result;
468+ return Object.setPrototypeOf(result, Object.prototype);
468469 }
469470
470471 if (typ === "any") return val;
@@ -728,6 +729,7 @@ const typeMap: any = {
728729 "Locale",
729730 "lock",
730731 "long",
732+ "makeDictEncoder",
731733 "map",
732734 "MarshalJSON",
733735 "MapEntry",
Mschema-golangdefault / quicktype.go+2 −1
@@ -205,6 +205,7 @@ const (
205205 Locale EnumEnum = "Locale"
206206 Lock EnumEnum = "lock"
207207 Long EnumEnum = "long"
208+ MakeDictEncoder EnumEnum = "makeDictEncoder"
208209 Map EnumEnum = "map"
209210 MarshalJSON EnumEnum = "MarshalJSON"
210211 MapEntry EnumEnum = "MapEntry"
@@ -377,7 +378,7 @@ func (x *EnumEnum) UnmarshalJSON(data []byte) error {
377378 var value string
378379 if err := json.Unmarshal(data, &value); err != nil { return err }
379380 switch EnumEnum(value) {
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
381+ 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, MakeDictEncoder, 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
381382 }
382383 return invalidEnumEnum(value)
383384 }
Mschema-haskelldefault / QuickType.hs+3 −0
@@ -198,6 +198,7 @@ data EnumEnum
198198 | LocaleEnumEnum
199199 | LockEnumEnum
200200 | LongEnumEnum
201+ | MakeDictEncoderEnumEnum
201202 | MapEnumEnum
202203 | MarshalJSONEnumEnum
203204 | MapEntryEnumEnum
@@ -557,6 +558,7 @@ instance ToJSON EnumEnum where
557558 toJSON LocaleEnumEnum = "Locale"
558559 toJSON LockEnumEnum = "lock"
559560 toJSON LongEnumEnum = "long"
561+ toJSON MakeDictEncoderEnumEnum = "makeDictEncoder"
560562 toJSON MapEnumEnum = "map"
561563 toJSON MarshalJSONEnumEnum = "MarshalJSON"
562564 toJSON MapEntryEnumEnum = "MapEntry"
@@ -904,6 +906,7 @@ instance FromJSON EnumEnum where
904906 parseText "Locale" = return LocaleEnumEnum
905907 parseText "lock" = return LockEnumEnum
906908 parseText "long" = return LongEnumEnum
909+ parseText "makeDictEncoder" = return MakeDictEncoderEnumEnum
907910 parseText "map" = return MapEnumEnum
908911 parseText "MarshalJSON" = return MarshalJSONEnumEnum
909912 parseText "MapEntry" = return MapEntryEnumEnum
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / Enum.java+3 −1
@@ -4,7 +4,7 @@ import java.io.IOException;
44 import com.fasterxml.jackson.annotation.*;
55
66 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_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;
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, MAKE_DICT_ENCODER, 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;
88
99 @JsonValue
1010 public String toValue() {
@@ -189,6 +189,7 @@ public enum Enum {
189189 case LOCALE: return "Locale";
190190 case LOCK: return "lock";
191191 case LONG: return "long";
192+ case MAKE_DICT_ENCODER: return "makeDictEncoder";
192193 case MAP: return "map";
193194 case MARSHAL_JSON: return "MarshalJSON";
194195 case MAP_ENTRY: return "MapEntry";
@@ -538,6 +539,7 @@ public enum Enum {
538539 if (value.equals("Locale")) return LOCALE;
539540 if (value.equals("lock")) return LOCK;
540541 if (value.equals("long")) return LONG;
542+ if (value.equals("makeDictEncoder")) return MAKE_DICT_ENCODER;
541543 if (value.equals("map")) return MAP;
542544 if (value.equals("MarshalJSON")) return MARSHAL_JSON;
543545 if (value.equals("MapEntry")) return MAP_ENTRY;
Mschema-java-lombokdefault / src / main / java / io / quicktype / Enum.java+3 −1
@@ -4,7 +4,7 @@ import java.io.IOException;
44 import com.fasterxml.jackson.annotation.*;
55
66 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_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;
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, MAKE_DICT_ENCODER, 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;
88
99 @JsonValue
1010 public String toValue() {
@@ -189,6 +189,7 @@ public enum Enum {
189189 case LOCALE: return "Locale";
190190 case LOCK: return "lock";
191191 case LONG: return "long";
192+ case MAKE_DICT_ENCODER: return "makeDictEncoder";
192193 case MAP: return "map";
193194 case MARSHAL_JSON: return "MarshalJSON";
194195 case MAP_ENTRY: return "MapEntry";
@@ -538,6 +539,7 @@ public enum Enum {
538539 if (value.equals("Locale")) return LOCALE;
539540 if (value.equals("lock")) return LOCK;
540541 if (value.equals("long")) return LONG;
542+ if (value.equals("makeDictEncoder")) return MAKE_DICT_ENCODER;
541543 if (value.equals("map")) return MAP;
542544 if (value.equals("MarshalJSON")) return MARSHAL_JSON;
543545 if (value.equals("MapEntry")) return MAP_ENTRY;
Mschema-javadefault / src / main / java / io / quicktype / Enum.java+3 −1
@@ -4,7 +4,7 @@ import java.io.IOException;
44 import com.fasterxml.jackson.annotation.*;
55
66 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_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;
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, MAKE_DICT_ENCODER, 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;
88
99 @JsonValue
1010 public String toValue() {
@@ -189,6 +189,7 @@ public enum Enum {
189189 case LOCALE: return "Locale";
190190 case LOCK: return "lock";
191191 case LONG: return "long";
192+ case MAKE_DICT_ENCODER: return "makeDictEncoder";
192193 case MAP: return "map";
193194 case MARSHAL_JSON: return "MarshalJSON";
194195 case MAP_ENTRY: return "MapEntry";
@@ -538,6 +539,7 @@ public enum Enum {
538539 if (value.equals("Locale")) return LOCALE;
539540 if (value.equals("lock")) return LOCK;
540541 if (value.equals("long")) return LONG;
542+ if (value.equals("makeDictEncoder")) return MAKE_DICT_ENCODER;
541543 if (value.equals("map")) return MAP;
542544 if (value.equals("MarshalJSON")) return MARSHAL_JSON;
543545 if (value.equals("MapEntry")) return MAP_ENTRY;
Mschema-javascript-prop-typesdefault / toplevel.js+1 −1
@@ -13,7 +13,7 @@
1313 import PropTypes from "prop-types";
1414
1515 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_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+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', 'makeDictEncoder', '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']);
1717 _TopLevel = PropTypes.shape({
1818 "enum": PropTypes.oneOfType([_Enum, PropTypes.oneOf([null])]),
1919 });
Mschema-javascriptdefault / TopLevel.js+3 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
@@ -376,6 +376,7 @@ const typeMap = {
376376 "Locale",
377377 "lock",
378378 "long",
379+ "makeDictEncoder",
379380 "map",
380381 "MarshalJSON",
381382 "MapEntry",
Mschema-kotlin-jacksondefault / TopLevel.kt+2 −0
@@ -221,6 +221,7 @@ enum class EnumEnum(val value: String) {
221221 Locale("Locale"),
222222 Lock("lock"),
223223 EnumLong("long"),
224+ MakeDictEncoder("makeDictEncoder"),
224225 EnumMap("map"),
225226 MarshalJSON("MarshalJSON"),
226227 MapEntry("MapEntry"),
@@ -567,6 +568,7 @@ enum class EnumEnum(val value: String) {
567568 "Locale" -> Locale
568569 "lock" -> Lock
569570 "long" -> EnumLong
571+ "makeDictEncoder" -> MakeDictEncoder
570572 "map" -> EnumMap
571573 "MarshalJSON" -> MarshalJSON
572574 "MapEntry" -> MapEntry
Mschema-kotlindefault / TopLevel.kt+2 −0
@@ -208,6 +208,7 @@ enum class EnumEnum(val value: String) {
208208 Locale("Locale"),
209209 Lock("lock"),
210210 EnumLong("long"),
211+ MakeDictEncoder("makeDictEncoder"),
211212 EnumMap("map"),
212213 MarshalJSON("MarshalJSON"),
213214 MapEntry("MapEntry"),
@@ -554,6 +555,7 @@ enum class EnumEnum(val value: String) {
554555 "Locale" -> Locale
555556 "lock" -> Lock
556557 "long" -> EnumLong
558+ "makeDictEncoder" -> MakeDictEncoder
557559 "map" -> EnumMap
558560 "MarshalJSON" -> MarshalJSON
559561 "MapEntry" -> MapEntry
Mschema-kotlinxdefault / TopLevel.kt+1 −0
@@ -197,6 +197,7 @@ enum class EnumEnum(val value: String) {
197197 @SerialName("Locale") Locale("Locale"),
198198 @SerialName("lock") Lock("lock"),
199199 @SerialName("long") EnumLong("long"),
200+ @SerialName("makeDictEncoder") MakeDictEncoder("makeDictEncoder"),
200201 @SerialName("map") EnumMap("map"),
201202 @SerialName("MarshalJSON") MarshalJSON("MarshalJSON"),
202203 @SerialName("MapEntry") MapEntry("MapEntry"),
Mschema-objective-cdefault / QTTopLevel.h+1 −0
@@ -195,6 +195,7 @@ NS_ASSUME_NONNULL_BEGIN
195195 + (QTEnum *)locale;
196196 + (QTEnum *)lock;
197197 + (QTEnum *)enumLong;
198++ (QTEnum *)makeDictEncoder;
198199 + (QTEnum *)map;
199200 + (QTEnum *)marshalJSON;
200201 + (QTEnum *)mapEntry;
Mschema-objective-cdefault / QTTopLevel.m+2 −0
@@ -198,6 +198,7 @@ NS_ASSUME_NONNULL_BEGIN
198198 @"Locale": [[QTEnum alloc] initWithValue:@"Locale"],
199199 @"lock": [[QTEnum alloc] initWithValue:@"lock"],
200200 @"long": [[QTEnum alloc] initWithValue:@"long"],
201+ @"makeDictEncoder": [[QTEnum alloc] initWithValue:@"makeDictEncoder"],
201202 @"map": [[QTEnum alloc] initWithValue:@"map"],
202203 @"MarshalJSON": [[QTEnum alloc] initWithValue:@"MarshalJSON"],
203204 @"MapEntry": [[QTEnum alloc] initWithValue:@"MapEntry"],
@@ -544,6 +545,7 @@ NS_ASSUME_NONNULL_BEGIN
544545 + (QTEnum *)locale { return QTEnum.values[@"Locale"]; }
545546 + (QTEnum *)lock { return QTEnum.values[@"lock"]; }
546547 + (QTEnum *)enumLong { return QTEnum.values[@"long"]; }
548++ (QTEnum *)makeDictEncoder { return QTEnum.values[@"makeDictEncoder"]; }
547549 + (QTEnum *)map { return QTEnum.values[@"map"]; }
548550 + (QTEnum *)marshalJSON { return QTEnum.values[@"MarshalJSON"]; }
549551 + (QTEnum *)mapEntry { return QTEnum.values[@"MapEntry"]; }
Mschema-phpdefault / TopLevel.php+4 −0
@@ -293,6 +293,7 @@ class EnumEnum {
293293 public static EnumEnum $LOCALE;
294294 public static EnumEnum $LOCK;
295295 public static EnumEnum $LONG;
296+ public static EnumEnum $MAKE_DICT_ENCODER;
296297 public static EnumEnum $MAP;
297298 public static EnumEnum $MARSHAL_JSON;
298299 public static EnumEnum $MAP_ENTRY;
@@ -637,6 +638,7 @@ class EnumEnum {
637638 EnumEnum::$LOCALE = new EnumEnum('Locale');
638639 EnumEnum::$LOCK = new EnumEnum('lock');
639640 EnumEnum::$LONG = new EnumEnum('long');
641+ EnumEnum::$MAKE_DICT_ENCODER = new EnumEnum('makeDictEncoder');
640642 EnumEnum::$MAP = new EnumEnum('map');
641643 EnumEnum::$MARSHAL_JSON = new EnumEnum('MarshalJSON');
642644 EnumEnum::$MAP_ENTRY = new EnumEnum('MapEntry');
@@ -993,6 +995,7 @@ class EnumEnum {
993995 case EnumEnum::$LOCALE->enum: return 'Locale';
994996 case EnumEnum::$LOCK->enum: return 'lock';
995997 case EnumEnum::$LONG->enum: return 'long';
998+ case EnumEnum::$MAKE_DICT_ENCODER->enum: return 'makeDictEncoder';
996999 case EnumEnum::$MAP->enum: return 'map';
9971000 case EnumEnum::$MARSHAL_JSON->enum: return 'MarshalJSON';
9981001 case EnumEnum::$MAP_ENTRY->enum: return 'MapEntry';
@@ -1347,6 +1350,7 @@ class EnumEnum {
13471350 case 'Locale': return EnumEnum::$LOCALE;
13481351 case 'lock': return EnumEnum::$LOCK;
13491352 case 'long': return EnumEnum::$LONG;
1353+ case 'makeDictEncoder': return EnumEnum::$MAKE_DICT_ENCODER;
13501354 case 'map': return EnumEnum::$MAP;
13511355 case 'MarshalJSON': return EnumEnum::$MARSHAL_JSON;
13521356 case 'MapEntry': return EnumEnum::$MAP_ENTRY;
Mschema-pikedefault / TopLevel.pmod+2 −1
@@ -213,6 +213,7 @@ enum Enum {
213213 LOCALE = "Locale", // json: "Locale"
214214 LOCK = "lock", // json: "lock"
215215 LONG = "long", // json: "long"
216+ MAKE_DICT_ENCODER = "makeDictEncoder", // json: "makeDictEncoder"
216217 MAP = "map", // json: "map"
217218 MARSHAL_JSON = "MarshalJSON", // json: "MarshalJSON"
218219 MAP_ENTRY = "MapEntry", // json: "MapEntry"
@@ -379,5 +380,5 @@ enum Enum {
379380 }
380381
381382 Enum Enum_from_JSON(mixed 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;
383+ 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 != "makeDictEncoder"&&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;
383384 }
Mschema-pythondefault / quicktype.py+1 −0
@@ -212,6 +212,7 @@ class EnumEnum(Enum):
212212 LOCALE = "Locale"
213213 LOCK = "lock"
214214 LONG = "long"
215+ MAKE_DICT_ENCODER = "makeDictEncoder"
215216 MAP = "map"
216217 MARSHAL_JSON = "MarshalJSON"
217218 MAP_ENTRY = "MapEntry"
Mschema-rubydefault / TopLevel.rb+2 −1
@@ -17,7 +17,7 @@ module Types
1717
1818 Hash = Strict::Hash
1919 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_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")
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", "makeDictEncoder", "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")
2121 end
2222
2323 module Enum
@@ -201,6 +201,7 @@ module Enum
201201 Locale = "Locale"
202202 Lock = "lock"
203203 Long = "long"
204+ MakeDictEncoder = "makeDictEncoder"
204205 Map = "map"
205206 MarshalJSON = "MarshalJSON"
206207 MapEntry = "MapEntry"
Mschema-rustdefault / module_under_test.rs+3 −0
@@ -447,6 +447,9 @@ pub enum Enum {
447447
448448 Long,
449449
450+ #[serde(rename = "makeDictEncoder")]
451+ MakeDictEncoder,
452+
450453 Map,
451454
452455 #[serde(rename = "MarshalJSON")]
Mschema-scala3-upickledefault / TopLevel.scala+3 −0
@@ -263,6 +263,7 @@ enum EnumEnum :
263263 case Locale
264264 case Lock
265265 case EnumLong
266+ case MakeDictEncoder
266267 case EnumMap
267268 case MarshalJSON
268269 case MapEntry
@@ -609,6 +610,7 @@ given OptionPickler.ReadWriter[EnumEnum] = OptionPickler.readwriter[String].bima
609610 case EnumEnum.Locale => "Locale"
610611 case EnumEnum.Lock => "lock"
611612 case EnumEnum.EnumLong => "long"
613+ case EnumEnum.MakeDictEncoder => "makeDictEncoder"
612614 case EnumEnum.EnumMap => "map"
613615 case EnumEnum.MarshalJSON => "MarshalJSON"
614616 case EnumEnum.MapEntry => "MapEntry"
@@ -954,6 +956,7 @@ given OptionPickler.ReadWriter[EnumEnum] = OptionPickler.readwriter[String].bima
954956 case "Locale" => EnumEnum.Locale
955957 case "lock" => EnumEnum.Lock
956958 case "long" => EnumEnum.EnumLong
959+ case "makeDictEncoder" => EnumEnum.MakeDictEncoder
957960 case "map" => EnumEnum.EnumMap
958961 case "MarshalJSON" => EnumEnum.MarshalJSON
959962 case "MapEntry" => EnumEnum.MapEntry
Mschema-scala3default / TopLevel.scala+3 −0
@@ -192,6 +192,7 @@ enum EnumEnum :
192192 case Locale
193193 case Lock
194194 case EnumLong
195+ case MakeDictEncoder
195196 case EnumMap
196197 case MarshalJSON
197198 case MapEntry
@@ -537,6 +538,7 @@ given Decoder[EnumEnum] = Decoder.decodeString.emap {
537538 case "Locale" => scala.Right(EnumEnum.Locale)
538539 case "lock" => scala.Right(EnumEnum.Lock)
539540 case "long" => scala.Right(EnumEnum.EnumLong)
541+ case "makeDictEncoder" => scala.Right(EnumEnum.MakeDictEncoder)
540542 case "map" => scala.Right(EnumEnum.EnumMap)
541543 case "MarshalJSON" => scala.Right(EnumEnum.MarshalJSON)
542544 case "MapEntry" => scala.Right(EnumEnum.MapEntry)
@@ -883,6 +885,7 @@ given Encoder[EnumEnum] = Encoder.encodeString.contramap {
883885 case EnumEnum.Locale => "Locale"
884886 case EnumEnum.Lock => "lock"
885887 case EnumEnum.EnumLong => "long"
888+ case EnumEnum.MakeDictEncoder => "makeDictEncoder"
886889 case EnumEnum.EnumMap => "map"
887890 case EnumEnum.MarshalJSON => "MarshalJSON"
888891 case EnumEnum.MapEntry => "MapEntry"
Mschema-schemadefault / TopLevel.schema+1 −0
@@ -196,6 +196,7 @@
196196 "Locale",
197197 "lock",
198198 "long",
199+ "makeDictEncoder",
199200 "map",
200201 "MarshalJSON",
201202 "MapEntry",
Mschema-swiftdefault / quicktype.swift+1 −0
@@ -230,6 +230,7 @@ enum Enum: String, Codable {
230230 case locale = "Locale"
231231 case lock = "lock"
232232 case long = "long"
233+ case makeDictEncoder = "makeDictEncoder"
233234 case map = "map"
234235 case marshalJSON = "MarshalJSON"
235236 case mapEntry = "MapEntry"
Mschema-typescript-effect-schemadefault / TopLevel.ts+1 −0
@@ -182,6 +182,7 @@ export const Enum = S.Literal(
182182 "Locale",
183183 "lock",
184184 "long",
185+ "makeDictEncoder",
185186 "map",
186187 "MarshalJSON",
187188 "MapEntry",
Mschema-typescript-zoddefault / TopLevel.ts+1 −0
@@ -182,6 +182,7 @@ export const EnumSchema = z.enum([
182182 "Locale",
183183 "lock",
184184 "long",
185+ "makeDictEncoder",
185186 "map",
186187 "MarshalJSON",
187188 "MapEntry",
Mschema-typescriptdefault / TopLevel.ts+4 −3
@@ -12,7 +12,7 @@ export interface TopLevel {
1212 [property: string]: unknown;
1313 }
1414
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";
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" | "makeDictEncoder" | "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";
1616
1717 // Converts JSON strings to/from your types
1818 // 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
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
@@ -385,6 +385,7 @@ const typeMap: any = {
385385 "Locale",
386386 "lock",
387387 "long",
388+ "makeDictEncoder",
388389 "map",
389390 "MarshalJSON",
390391 "MapEntry",
Test case

test/inputs/schema/keyword-unions.schema

37 generated files · +1,350 −171
Mschema-cjsondefault / TopLevel.c+104 −0
@@ -5593,6 +5593,50 @@ void cJSON_DeleteUnionLock(struct UnionLock * x) {
55935593 }
55945594 }
55955595
5596+struct UnionMakeDictEncoder * cJSON_GetUnionMakeDictEncoderValue(const cJSON * j) {
5597+ struct UnionMakeDictEncoder * x = cJSON_malloc(sizeof(struct UnionMakeDictEncoder));
5598+ if (NULL != x) {
5599+ memset(x, 0, sizeof(struct UnionMakeDictEncoder));
5600+ if (cJSON_IsNumber(j)) {
5601+ x->type = cJSON_Number;
5602+ x->value.number = cJSON_GetNumberValue(j);
5603+ }
5604+ else if (cJSON_IsObject(j)) {
5605+ x->type = cJSON_Object;
5606+ x->value.make_dict_encoder = cJSON_GetMakeDictEncoderValue(j);
5607+ if (NULL == x->value.make_dict_encoder) x->type = 0;
5608+ }
5609+ if (0 == x->type) { cJSON_free(x); return NULL; }
5610+ }
5611+ return x;
5612+}
5613+struct UnionMakeDictEncoder * cJSON_ParseUnionMakeDictEncoder(const char * s) { cJSON * j = cJSON_Parse(s); struct UnionMakeDictEncoder * x = j ? cJSON_GetUnionMakeDictEncoderValue(j) : NULL; cJSON_Delete(j); return x; }
5614+char * cJSON_PrintUnionMakeDictEncoder(const struct UnionMakeDictEncoder * x) { cJSON * j = cJSON_CreateUnionMakeDictEncoder(x); char * s = j ? cJSON_Print(j) : NULL; cJSON_Delete(j); return s; }
5615+
5616+cJSON * cJSON_CreateUnionMakeDictEncoder(const struct UnionMakeDictEncoder * x) {
5617+ cJSON * j = NULL;
5618+ if (NULL != x) {
5619+ if (cJSON_Number == x->type) {
5620+ j = cJSON_CreateNumber(x->value.number);
5621+ }
5622+ else if (cJSON_Object == x->type) {
5623+ j = cJSON_CreateMakeDictEncoder(x->value.make_dict_encoder);
5624+ }
5625+ }
5626+ return j;
5627+}
5628+
5629+void cJSON_DeleteUnionMakeDictEncoder(struct UnionMakeDictEncoder * x) {
5630+ if (NULL != x) {
5631+ if (cJSON_Number == x->type) {
5632+ }
5633+ else if (cJSON_Object == x->type) {
5634+ cJSON_DeleteMakeDictEncoder(x->value.make_dict_encoder);
5635+ }
5636+ cJSON_free(x);
5637+ }
5638+}
5639+
55965640 struct UnionMap * cJSON_GetUnionMapValue(const cJSON * j) {
55975641 struct UnionMap * x = cJSON_malloc(sizeof(struct UnionMap));
55985642 if (NULL != x) {
@@ -21276,6 +21320,55 @@ void cJSON_DeleteLock(struct Lock * x) {
2127621320 }
2127721321 }
2127821322
21323+struct MakeDictEncoder * cJSON_ParseMakeDictEncoder(const char * s) {
21324+ struct MakeDictEncoder * x = NULL;
21325+ if (NULL != s) {
21326+ cJSON * j = cJSON_Parse(s);
21327+ if (NULL != j) {
21328+ x = cJSON_GetMakeDictEncoderValue(j);
21329+ cJSON_Delete(j);
21330+ }
21331+ }
21332+ return x;
21333+}
21334+
21335+struct MakeDictEncoder * cJSON_GetMakeDictEncoderValue(const cJSON * j) {
21336+ struct MakeDictEncoder * x = NULL;
21337+ if (NULL != j) {
21338+ if (NULL != (x = cJSON_malloc(sizeof(struct MakeDictEncoder)))) {
21339+ memset(x, 0, sizeof(struct MakeDictEncoder));
21340+ }
21341+ }
21342+ return x;
21343+}
21344+
21345+cJSON * cJSON_CreateMakeDictEncoder(const struct MakeDictEncoder * x) {
21346+ cJSON * j = NULL;
21347+ if (NULL != x) {
21348+ if (NULL != (j = cJSON_CreateObject())) {
21349+ }
21350+ }
21351+ return j;
21352+}
21353+
21354+char * cJSON_PrintMakeDictEncoder(const struct MakeDictEncoder * x) {
21355+ char * s = NULL;
21356+ if (NULL != x) {
21357+ cJSON * j = cJSON_CreateMakeDictEncoder(x);
21358+ if (NULL != j) {
21359+ s = cJSON_Print(j);
21360+ cJSON_Delete(j);
21361+ }
21362+ }
21363+ return s;
21364+}
21365+
21366+void cJSON_DeleteMakeDictEncoder(struct MakeDictEncoder * x) {
21367+ if (NULL != x) {
21368+ cJSON_free(x);
21369+ }
21370+}
21371+
2127921372 struct Map * cJSON_ParseMap(const char * s) {
2128021373 struct Map * x = NULL;
2128121374 if (NULL != s) {
@@ -32739,6 +32832,11 @@ struct TopLevel * cJSON_GetTopLevelValue(const cJSON * j) {
3273932832 x->top_level_long = cJSON_GetUnionLongValue(cJSON_GetObjectItemCaseSensitive(j, "long"));
3274032833 if (NULL == x->top_level_long) { cJSON_DeleteTopLevel(x); return NULL; }
3274132834 }
32835+ if (cJSON_HasObjectItem(j, "makeDictEncoder")) {
32836+ if (!cJSON_IsUnionMakeDictEncoder(cJSON_GetObjectItemCaseSensitive(j, "makeDictEncoder"))) { cJSON_DeleteTopLevel(x); return NULL; }
32837+ x->make_dict_encoder = cJSON_GetUnionMakeDictEncoderValue(cJSON_GetObjectItemCaseSensitive(j, "makeDictEncoder"));
32838+ if (NULL == x->make_dict_encoder) { cJSON_DeleteTopLevel(x); return NULL; }
32839+ }
3274232840 if (cJSON_HasObjectItem(j, "map")) {
3274332841 if (!cJSON_IsUnionMap(cJSON_GetObjectItemCaseSensitive(j, "map"))) { cJSON_DeleteTopLevel(x); return NULL; }
3274432842 x->map = cJSON_GetUnionMapValue(cJSON_GetObjectItemCaseSensitive(j, "map"));
@@ -34099,6 +34197,9 @@ cJSON * cJSON_CreateTopLevel(const struct TopLevel * x) {
3409934197 if (NULL != x->top_level_long) {
3410034198 cJSON_AddItemToObject(j, "long", cJSON_CreateUnionLong(x->top_level_long));
3410134199 }
34200+ if (NULL != x->make_dict_encoder) {
34201+ cJSON_AddItemToObject(j, "makeDictEncoder", cJSON_CreateUnionMakeDictEncoder(x->make_dict_encoder));
34202+ }
3410234203 if (NULL != x->map) {
3410334204 cJSON_AddItemToObject(j, "map", cJSON_CreateUnionMap(x->map));
3410434205 }
@@ -35147,6 +35248,9 @@ void cJSON_DeleteTopLevel(struct TopLevel * x) {
3514735248 if (NULL != x->top_level_long) {
3514835249 cJSON_DeleteUnionLong(x->top_level_long);
3514935250 }
35251+ if (NULL != x->make_dict_encoder) {
35252+ cJSON_DeleteUnionMakeDictEncoder(x->make_dict_encoder);
35253+ }
3515035254 if (NULL != x->map) {
3515135255 cJSON_DeleteUnionMap(x->map);
3515235256 }
Mschema-cjsondefault / TopLevel.h+25 −0
@@ -1445,6 +1445,17 @@ struct UnionLock {
14451445 } value;
14461446 };
14471447
1448+struct MakeDictEncoder {
1449+};
1450+
1451+struct UnionMakeDictEncoder {
1452+ int type;
1453+ union {
1454+ double number;
1455+ struct MakeDictEncoder * make_dict_encoder;
1456+ } value;
1457+};
1458+
14481459 struct Map {
14491460 };
14501461
@@ -3993,6 +4004,7 @@ struct TopLevel {
39934004 struct UnionLocale * locale;
39944005 struct UnionLock * lock;
39954006 struct UnionLong * top_level_long;
4007+ struct UnionMakeDictEncoder * make_dict_encoder;
39964008 struct UnionMap * map;
39974009 struct UnionMapEntry * map_entry;
39984010 struct UnionMarshalJson * marshal_json;
@@ -5045,6 +5057,13 @@ void cJSON_DeleteUnionLock(struct UnionLock * x);
50455057 struct UnionLock * cJSON_ParseUnionLock(const char * s);
50465058 char * cJSON_PrintUnionLock(const struct UnionLock * x);
50475059
5060+#define cJSON_IsUnionMakeDictEncoder(j) (cJSON_IsNumber(j) || cJSON_IsObject(j))
5061+struct UnionMakeDictEncoder * cJSON_GetUnionMakeDictEncoderValue(const cJSON * j);
5062+cJSON * cJSON_CreateUnionMakeDictEncoder(const struct UnionMakeDictEncoder * x);
5063+void cJSON_DeleteUnionMakeDictEncoder(struct UnionMakeDictEncoder * x);
5064+struct UnionMakeDictEncoder * cJSON_ParseUnionMakeDictEncoder(const char * s);
5065+char * cJSON_PrintUnionMakeDictEncoder(const struct UnionMakeDictEncoder * x);
5066+
50485067 #define cJSON_IsUnionMap(j) (cJSON_IsNumber(j) || cJSON_IsObject(j))
50495068 struct UnionMap * cJSON_GetUnionMapValue(const cJSON * j);
50505069 cJSON * cJSON_CreateUnionMap(const struct UnionMap * x);
@@ -7312,6 +7331,12 @@ cJSON * cJSON_CreateLock(const struct Lock * x);
73127331 char * cJSON_PrintLock(const struct Lock * x);
73137332 void cJSON_DeleteLock(struct Lock * x);
73147333
7334+struct MakeDictEncoder * cJSON_ParseMakeDictEncoder(const char * s);
7335+struct MakeDictEncoder * cJSON_GetMakeDictEncoderValue(const cJSON * j);
7336+cJSON * cJSON_CreateMakeDictEncoder(const struct MakeDictEncoder * x);
7337+char * cJSON_PrintMakeDictEncoder(const struct MakeDictEncoder * x);
7338+void cJSON_DeleteMakeDictEncoder(struct MakeDictEncoder * x);
7339+
73157340 struct Map * cJSON_ParseMap(const char * s);
73167341 struct Map * cJSON_GetMapValue(const cJSON * j);
73177342 cJSON * cJSON_CreateMap(const struct Map * x);
Mschema-cplusplusdefault / quicktype.hpp+60 −0
@@ -1613,6 +1613,18 @@ namespace quicktype {
16131613
16141614 using UnionLock = std::variant<Lock, double>;
16151615
1616+ class MakeDictEncoder {
1617+ public:
1618+ MakeDictEncoder() = default;
1619+ virtual ~MakeDictEncoder() = default;
1620+
1621+ private:
1622+
1623+ public:
1624+ };
1625+
1626+ using UnionMakeDictEncoder = std::variant<MakeDictEncoder, double>;
1627+
16161628 class Map {
16171629 public:
16181630 Map() = default;
@@ -4381,6 +4393,7 @@ namespace quicktype {
43814393 std::optional<UnionLocale> locale;
43824394 std::optional<UnionLock> lock;
43834395 std::optional<UnionLong> top_level_long;
4396+ std::optional<UnionMakeDictEncoder> make_dict_encoder;
43844397 std::optional<UnionMap> map;
43854398 std::optional<UnionMapEntry> map_entry;
43864399 std::optional<UnionMarshalJson> marshal_json;
@@ -5272,6 +5285,10 @@ namespace quicktype {
52725285 std::optional<UnionLong> & get_mutable_top_level_long() { return top_level_long; }
52735286 void set_top_level_long(const std::optional<UnionLong> & value) { this->top_level_long = value; }
52745287
5288+ const std::optional<UnionMakeDictEncoder> & get_make_dict_encoder() const { return make_dict_encoder; }
5289+ std::optional<UnionMakeDictEncoder> & get_mutable_make_dict_encoder() { return make_dict_encoder; }
5290+ void set_make_dict_encoder(const std::optional<UnionMakeDictEncoder> & value) { this->make_dict_encoder = value; }
5291+
52755292 const std::optional<UnionMap> & get_map() const { return map; }
52765293 std::optional<UnionMap> & get_mutable_map() { return map; }
52775294 void set_map(const std::optional<UnionMap> & value) { this->map = value; }
@@ -6300,6 +6317,9 @@ void to_json(json & j, const Locale & x);
63006317 void from_json(const json & j, Lock & x);
63016318 void to_json(json & j, const Lock & x);
63026319
6320+void from_json(const json & j, MakeDictEncoder & x);
6321+void to_json(json & j, const MakeDictEncoder & x);
6322+
63036323 void from_json(const json & j, Map & x);
63046324 void to_json(json & j, const Map & x);
63056325
@@ -7711,6 +7731,12 @@ struct adl_serializer<std::variant<quicktype::Lock, double>> {
77117731 static void to_json(json & j, const std::variant<quicktype::Lock, double> & x);
77127732 };
77137733
7734+template <>
7735+struct adl_serializer<std::variant<quicktype::MakeDictEncoder, double>> {
7736+ static void from_json(const json & j, std::variant<quicktype::MakeDictEncoder, double> & x);
7737+ static void to_json(json & j, const std::variant<quicktype::MakeDictEncoder, double> & x);
7738+};
7739+
77147740 template <>
77157741 struct adl_serializer<std::variant<quicktype::Map, double>> {
77167742 static void from_json(const json & j, std::variant<quicktype::Map, double> & x);
@@ -10399,6 +10425,17 @@ namespace quicktype {
1039910425 (void)x;
1040010426 }
1040110427
10428+ inline void from_json(const json & j, MakeDictEncoder& x) {
10429+ if (!j.is_object()) throw std::runtime_error("Expected object");
10430+ (void)j;
10431+ (void)x;
10432+ }
10433+
10434+ inline void to_json(json & j, const MakeDictEncoder & x) {
10435+ j = json::object();
10436+ (void)x;
10437+ }
10438+
1040210439 inline void from_json(const json & j, Map& x) {
1040310440 if (!j.is_object()) throw std::runtime_error("Expected object");
1040410441 (void)j;
@@ -13130,6 +13167,8 @@ namespace quicktype {
1313013167 x.set_lock(get_stack_optional<std::variant<Lock, double>>(j, "lock"));
1313113168 if (j.find("long") != j.end() && j.at("long").is_null()) throw std::runtime_error("Unexpected null");
1313213169 x.set_top_level_long(get_stack_optional<std::variant<Long, double>>(j, "long"));
13170+ if (j.find("makeDictEncoder") != j.end() && j.at("makeDictEncoder").is_null()) throw std::runtime_error("Unexpected null");
13171+ x.set_make_dict_encoder(get_stack_optional<std::variant<MakeDictEncoder, double>>(j, "makeDictEncoder"));
1313313172 if (j.find("map") != j.end() && j.at("map").is_null()) throw std::runtime_error("Unexpected null");
1313413173 x.set_map(get_stack_optional<std::variant<Map, double>>(j, "map"));
1313513174 if (j.find("MapEntry") != j.end() && j.at("MapEntry").is_null()) throw std::runtime_error("Unexpected null");
@@ -13638,6 +13677,7 @@ namespace quicktype {
1363813677 j["Locale"] = x.get_locale();
1363913678 j["lock"] = x.get_lock();
1364013679 j["long"] = x.get_top_level_long();
13680+ j["makeDictEncoder"] = x.get_make_dict_encoder();
1364113681 j["map"] = x.get_map();
1364213682 j["MapEntry"] = x.get_map_entry();
1364313683 j["MarshalJSON"] = x.get_marshal_json();
@@ -16342,6 +16382,26 @@ namespace nlohmann {
1634216382 }
1634316383 }
1634416384
16385+ inline void adl_serializer<std::variant<quicktype::MakeDictEncoder, double>>::from_json(const json & j, std::variant<quicktype::MakeDictEncoder, double> & x) {
16386+ if (j.is_number())
16387+ x = j.get<double>();
16388+ else if (j.is_object())
16389+ x = j.get<quicktype::MakeDictEncoder>();
16390+ else throw std::runtime_error("Could not deserialise!");
16391+ }
16392+
16393+ inline void adl_serializer<std::variant<quicktype::MakeDictEncoder, double>>::to_json(json & j, const std::variant<quicktype::MakeDictEncoder, double> & x) {
16394+ switch (x.index()) {
16395+ case 0:
16396+ j = std::get<quicktype::MakeDictEncoder>(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+
1634516405 inline void adl_serializer<std::variant<quicktype::Map, double>>::from_json(const json & j, std::variant<quicktype::Map, double> & x) {
1634616406 if (j.is_number())
1634716407 x = j.get<double>();
Mschema-crystaldefault / TopLevel.cr+10 −0
@@ -428,6 +428,9 @@ class TopLevel
428428
429429 property long : UnionLong?
430430
431+ @[JSON::Field(key: "makeDictEncoder")]
432+ property make_dict_encoder : UnionMakeDictEncoder?
433+
431434 property map : UnionMap?
432435
433436 @[JSON::Field(key: "MapEntry")]
@@ -1625,6 +1628,11 @@ class Long
16251628
16261629 end
16271630
1631+class MakeDictEncoder
1632+ include JSON::Serializable
1633+
1634+end
1635+
16281636 class Map
16291637 include JSON::Serializable
16301638
@@ -2849,6 +2857,8 @@ alias UnionLock = Float64 | Lock
28492857
28502858 alias UnionLong = Float64 | Long
28512859
2860+alias UnionMakeDictEncoder = Float64 | MakeDictEncoder
2861+
28522862 alias UnionMap = Float64 | Map
28532863
28542864 alias UnionMapEntry = Float64 | MapEntry
Mschema-csharp-recordsdefault / QuickType.cs+55 −0
@@ -571,6 +571,9 @@ namespace QuickType
571571 [JsonProperty("long", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
572572 public UnionLong? Long { get; set; }
573573
574+ [JsonProperty("makeDictEncoder", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
575+ public UnionMakeDictEncoder? MakeDictEncoder { get; set; }
576+
574577 [JsonProperty("map", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
575578 public UnionMap? Map { get; set; }
576579
@@ -1747,6 +1750,10 @@ namespace QuickType
17471750 {
17481751 }
17491752
1753+ public partial record MakeDictEncoder
1754+ {
1755+ }
1756+
17501757 public partial record Map
17511758 {
17521759 }
@@ -3980,6 +3987,15 @@ namespace QuickType
39803987 public static implicit operator UnionLong(Long Long) => new UnionLong { Long = Long };
39813988 }
39823989
3990+ public partial struct UnionMakeDictEncoder
3991+ {
3992+ public double? Double;
3993+ public MakeDictEncoder? MakeDictEncoder;
3994+
3995+ public static implicit operator UnionMakeDictEncoder(double Double) => new UnionMakeDictEncoder { Double = Double };
3996+ public static implicit operator UnionMakeDictEncoder(MakeDictEncoder MakeDictEncoder) => new UnionMakeDictEncoder { MakeDictEncoder = MakeDictEncoder };
3997+ }
3998+
39833999 public partial struct UnionMap
39844000 {
39854001 public double? Double;
@@ -5734,6 +5750,7 @@ namespace QuickType
57345750 UnionListConverter.Singleton,
57355751 UnionLockConverter.Singleton,
57365752 UnionLongConverter.Singleton,
5753+ UnionMakeDictEncoderConverter.Singleton,
57375754 UnionMapConverter.Singleton,
57385755 UnionMetadataPropertyHandlingConverter.Singleton,
57395756 UnionModuleConverter.Singleton,
@@ -14036,6 +14053,44 @@ namespace QuickType
1403614053 public static readonly UnionLongConverter Singleton = new UnionLongConverter();
1403714054 }
1403814055
14056+ internal class UnionMakeDictEncoderConverter : JsonConverter
14057+ {
14058+ public override bool CanConvert(Type t) => t == typeof(UnionMakeDictEncoder) || t == typeof(UnionMakeDictEncoder?);
14059+
14060+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
14061+ {
14062+ switch (reader.TokenType)
14063+ {
14064+ case JsonToken.Integer:
14065+ case JsonToken.Float:
14066+ var doubleValue = serializer.Deserialize<double>(reader);
14067+ return new UnionMakeDictEncoder { Double = doubleValue };
14068+ case JsonToken.StartObject:
14069+ var objectValue = serializer.Deserialize<MakeDictEncoder>(reader);
14070+ return new UnionMakeDictEncoder { MakeDictEncoder = objectValue };
14071+ }
14072+ throw new Exception("Cannot unmarshal type UnionMakeDictEncoder");
14073+ }
14074+
14075+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
14076+ {
14077+ var value = (UnionMakeDictEncoder)untypedValue;
14078+ if (value.Double != null)
14079+ {
14080+ serializer.Serialize(writer, value.Double.Value);
14081+ return;
14082+ }
14083+ if (value.MakeDictEncoder != null)
14084+ {
14085+ serializer.Serialize(writer, value.MakeDictEncoder);
14086+ return;
14087+ }
14088+ throw new Exception("Cannot marshal type UnionMakeDictEncoder");
14089+ }
14090+
14091+ public static readonly UnionMakeDictEncoderConverter Singleton = new UnionMakeDictEncoderConverter();
14092+ }
14093+
1403914094 internal class UnionMapConverter : JsonConverter
1404014095 {
1404114096 public override bool CanConvert(Type t) => t == typeof(UnionMap) || t == typeof(UnionMap?);
Mschema-csharp-SystemTextJsondefault / QuickType.cs+54 −0
@@ -750,6 +750,10 @@ namespace QuickType
750750 [JsonPropertyName("long")]
751751 public UnionLong? Long { get; set; }
752752
753+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
754+ [JsonPropertyName("makeDictEncoder")]
755+ public UnionMakeDictEncoder? MakeDictEncoder { get; set; }
756+
753757 [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
754758 [JsonPropertyName("map")]
755759 public UnionMap? Map { get; set; }
@@ -2095,6 +2099,10 @@ namespace QuickType
20952099 {
20962100 }
20972101
2102+ public partial class MakeDictEncoder
2103+ {
2104+ }
2105+
20982106 public partial class Map
20992107 {
21002108 }
@@ -4338,6 +4346,15 @@ namespace QuickType
43384346 public static implicit operator UnionLong(Long Long) => new UnionLong { Long = Long };
43394347 }
43404348
4349+ public partial struct UnionMakeDictEncoder
4350+ {
4351+ public double? Double;
4352+ public MakeDictEncoder? MakeDictEncoder;
4353+
4354+ public static implicit operator UnionMakeDictEncoder(double Double) => new UnionMakeDictEncoder { Double = Double };
4355+ public static implicit operator UnionMakeDictEncoder(MakeDictEncoder MakeDictEncoder) => new UnionMakeDictEncoder { MakeDictEncoder = MakeDictEncoder };
4356+ }
4357+
43414358 public partial struct UnionMap
43424359 {
43434360 public double? Double;
@@ -6072,6 +6089,7 @@ namespace QuickType
60726089 UnionListConverter.Singleton,
60736090 UnionLockConverter.Singleton,
60746091 UnionLongConverter.Singleton,
6092+ UnionMakeDictEncoderConverter.Singleton,
60756093 UnionMapConverter.Singleton,
60766094 UnionMetadataPropertyHandlingConverter.Singleton,
60776095 UnionModuleConverter.Singleton,
@@ -13946,6 +13964,42 @@ namespace QuickType
1394613964 public static readonly UnionLongConverter Singleton = new UnionLongConverter();
1394713965 }
1394813966
13967+ internal class UnionMakeDictEncoderConverter : JsonConverter<UnionMakeDictEncoder>
13968+ {
13969+ public override bool CanConvert(Type t) => t == typeof(UnionMakeDictEncoder);
13970+
13971+ public override UnionMakeDictEncoder Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
13972+ {
13973+ switch (reader.TokenType)
13974+ {
13975+ case JsonTokenType.Number:
13976+ var doubleValue1 = reader.GetDouble();
13977+ return new UnionMakeDictEncoder { Double = doubleValue1 };
13978+ case JsonTokenType.StartObject:
13979+ var objectValue = JsonSerializer.Deserialize<MakeDictEncoder>(ref reader, options);
13980+ return new UnionMakeDictEncoder { MakeDictEncoder = objectValue };
13981+ }
13982+ throw new JsonException("Cannot unmarshal type UnionMakeDictEncoder");
13983+ }
13984+
13985+ public override void Write(Utf8JsonWriter writer, UnionMakeDictEncoder value, JsonSerializerOptions options)
13986+ {
13987+ if (value.Double != null)
13988+ {
13989+ JsonSerializer.Serialize(writer, value.Double.Value, options);
13990+ return;
13991+ }
13992+ if (value.MakeDictEncoder != null)
13993+ {
13994+ JsonSerializer.Serialize(writer, value.MakeDictEncoder, options);
13995+ return;
13996+ }
13997+ throw new NotSupportedException("Cannot marshal type UnionMakeDictEncoder");
13998+ }
13999+
14000+ public static readonly UnionMakeDictEncoderConverter Singleton = new UnionMakeDictEncoderConverter();
14001+ }
14002+
1394914003 internal class UnionMapConverter : JsonConverter<UnionMap>
1395014004 {
1395114005 public override bool CanConvert(Type t) => t == typeof(UnionMap);
Mschema-csharpdefault / QuickType.cs+55 −0
@@ -571,6 +571,9 @@ namespace QuickType
571571 [JsonProperty("long", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
572572 public UnionLong? Long { get; set; }
573573
574+ [JsonProperty("makeDictEncoder", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
575+ public UnionMakeDictEncoder? MakeDictEncoder { get; set; }
576+
574577 [JsonProperty("map", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
575578 public UnionMap? Map { get; set; }
576579
@@ -1755,6 +1758,10 @@ namespace QuickType
17551758 {
17561759 }
17571760
1761+ public partial class MakeDictEncoder
1762+ {
1763+ }
1764+
17581765 public partial class Map
17591766 {
17601767 }
@@ -3998,6 +4005,15 @@ namespace QuickType
39984005 public static implicit operator UnionLong(Long Long) => new UnionLong { Long = Long };
39994006 }
40004007
4008+ public partial struct UnionMakeDictEncoder
4009+ {
4010+ public double? Double;
4011+ public MakeDictEncoder? MakeDictEncoder;
4012+
4013+ public static implicit operator UnionMakeDictEncoder(double Double) => new UnionMakeDictEncoder { Double = Double };
4014+ public static implicit operator UnionMakeDictEncoder(MakeDictEncoder MakeDictEncoder) => new UnionMakeDictEncoder { MakeDictEncoder = MakeDictEncoder };
4015+ }
4016+
40014017 public partial struct UnionMap
40024018 {
40034019 public double? Double;
@@ -5734,6 +5750,7 @@ namespace QuickType
57345750 UnionListConverter.Singleton,
57355751 UnionLockConverter.Singleton,
57365752 UnionLongConverter.Singleton,
5753+ UnionMakeDictEncoderConverter.Singleton,
57375754 UnionMapConverter.Singleton,
57385755 UnionMetadataPropertyHandlingConverter.Singleton,
57395756 UnionModuleConverter.Singleton,
@@ -14036,6 +14053,44 @@ namespace QuickType
1403614053 public static readonly UnionLongConverter Singleton = new UnionLongConverter();
1403714054 }
1403814055
14056+ internal class UnionMakeDictEncoderConverter : JsonConverter
14057+ {
14058+ public override bool CanConvert(Type t) => t == typeof(UnionMakeDictEncoder) || t == typeof(UnionMakeDictEncoder?);
14059+
14060+ public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
14061+ {
14062+ switch (reader.TokenType)
14063+ {
14064+ case JsonToken.Integer:
14065+ case JsonToken.Float:
14066+ var doubleValue = serializer.Deserialize<double>(reader);
14067+ return new UnionMakeDictEncoder { Double = doubleValue };
14068+ case JsonToken.StartObject:
14069+ var objectValue = serializer.Deserialize<MakeDictEncoder>(reader);
14070+ return new UnionMakeDictEncoder { MakeDictEncoder = objectValue };
14071+ }
14072+ throw new Exception("Cannot unmarshal type UnionMakeDictEncoder");
14073+ }
14074+
14075+ public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
14076+ {
14077+ var value = (UnionMakeDictEncoder)untypedValue;
14078+ if (value.Double != null)
14079+ {
14080+ serializer.Serialize(writer, value.Double.Value);
14081+ return;
14082+ }
14083+ if (value.MakeDictEncoder != null)
14084+ {
14085+ serializer.Serialize(writer, value.MakeDictEncoder);
14086+ return;
14087+ }
14088+ throw new Exception("Cannot marshal type UnionMakeDictEncoder");
14089+ }
14090+
14091+ public static readonly UnionMakeDictEncoderConverter Singleton = new UnionMakeDictEncoderConverter();
14092+ }
14093+
1403914094 internal class UnionMapConverter : JsonConverter
1404014095 {
1404114096 public override bool CanConvert(Type t) => t == typeof(UnionMap) || t == typeof(UnionMap?);
Mschema-dartdefault / TopLevel.dart+14 −0
@@ -191,6 +191,7 @@ class TopLevel {
191191 final dynamic locale;
192192 final dynamic lock;
193193 final dynamic long;
194+ final dynamic makeDictEncoder;
194195 final dynamic map;
195196 final dynamic mapEntry;
196197 final dynamic marshalJson;
@@ -536,6 +537,7 @@ class TopLevel {
536537 this.locale,
537538 this.lock,
538539 this.long,
540+ this.makeDictEncoder,
539541 this.map,
540542 this.mapEntry,
541543 this.marshalJson,
@@ -882,6 +884,7 @@ class TopLevel {
882884 locale: json["Locale"],
883885 lock: json["lock"],
884886 long: json["long"],
887+ makeDictEncoder: json["makeDictEncoder"],
885888 map: json["map"],
886889 mapEntry: json["MapEntry"],
887890 marshalJson: json["MarshalJSON"],
@@ -1228,6 +1231,7 @@ class TopLevel {
12281231 "Locale": locale,
12291232 "lock": lock,
12301233 "long": long,
1234+ "makeDictEncoder": makeDictEncoder,
12311235 "map": map,
12321236 "MapEntry": mapEntry,
12331237 "MarshalJSON": marshalJson,
@@ -2822,6 +2826,16 @@ class Long {
28222826 };
28232827 }
28242828
2829+class MakeDictEncoder {
2830+ MakeDictEncoder();
2831+
2832+ factory MakeDictEncoder.fromJson(Map<String, dynamic> json) => MakeDictEncoder(
2833+ );
2834+
2835+ Map<String, dynamic> toJson() => {
2836+ };
2837+}
2838+
28252839 class MapClass {
28262840 MapClass();
Mschema-elixirdefault / QuickType.ex+45 −1
@@ -4935,6 +4935,35 @@ defmodule Long do
49354935 end
49364936 end
49374937
4938+defmodule MakeDictEncoder do
4939+ defstruct []
4940+
4941+ @type t :: %__MODULE__{
4942+ }
4943+
4944+ def from_map(m) when is_map(m) do
4945+ %MakeDictEncoder{
4946+ }
4947+ end
4948+
4949+ def from_json(json) do
4950+ json
4951+ |> Jason.decode!()
4952+ |> from_map()
4953+ end
4954+
4955+ def to_map(_struct) do
4956+ %{
4957+ }
4958+ end
4959+
4960+ def to_json(struct) do
4961+ struct
4962+ |> to_map()
4963+ |> Jason.encode!()
4964+ end
4965+end
4966+
49384967 defmodule MapClass do
49394968 defstruct []
49404969
@@ -9924,7 +9953,7 @@ defmodule Yield do
99249953 end
99259954
99269955 defmodule TopLevel do
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]
9956+ 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, :make_dict_encoder, :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]
99289957
99299958 @type t :: %__MODULE__{
99309959 empty: Empty.t() | float() | nil,
@@ -10109,6 +10138,7 @@ defmodule TopLevel do
1010910138 locale: Locale.t() | float() | nil,
1011010139 lock: Lock.t() | float() | nil,
1011110140 long: Long.t() | float() | nil,
10141+ make_dict_encoder: MakeDictEncoder.t() | float() | nil,
1011210142 map: MapClass.t() | float() | nil,
1011310143 map_entry: MapEntry.t() | float() | nil,
1011410144 marshal_json: MarshalJSON.t() | float() | nil,
@@ -12452,6 +12482,18 @@ defmodule TopLevel do
1245212482 def encode_long(value) when is_nil(value), do: value
1245312483 def encode_long(_), do: {:error, "Unexpected type when encoding TopLevel.long"}
1245412484
12485+ def decode_make_dict_encoder(%{} = value), do: MakeDictEncoder.from_map(value)
12486+ def decode_make_dict_encoder(value) when is_float(value), do: value
12487+ def decode_make_dict_encoder(value) when is_integer(value), do: value
12488+ def decode_make_dict_encoder(value) when is_nil(value), do: value
12489+ def decode_make_dict_encoder(_), do: {:error, "Unexpected type when decoding TopLevel.make_dict_encoder"}
12490+
12491+ def encode_make_dict_encoder(%MakeDictEncoder{} = value), do: MakeDictEncoder.to_map(value)
12492+ def encode_make_dict_encoder(value) when is_float(value), do: value
12493+ def encode_make_dict_encoder(value) when is_integer(value), do: value
12494+ def encode_make_dict_encoder(value) when is_nil(value), do: value
12495+ def encode_make_dict_encoder(_), do: {:error, "Unexpected type when encoding TopLevel.make_dict_encoder"}
12496+
1245512497 def decode_map(%{} = value), do: MapClass.from_map(value)
1245612498 def decode_map(value) when is_float(value), do: value
1245712499 def decode_map(value) when is_integer(value), do: value
@@ -14568,6 +14610,7 @@ defmodule TopLevel do
1456814610 locale: decode_locale(m["Locale"]),
1456914611 lock: decode_lock(m["lock"]),
1457014612 long: decode_long(m["long"]),
14613+ make_dict_encoder: decode_make_dict_encoder(m["makeDictEncoder"]),
1457114614 map: decode_map(m["map"]),
1457214615 map_entry: decode_map_entry(m["MapEntry"]),
1457314616 marshal_json: decode_marshal_json(m["MarshalJSON"]),
@@ -14922,6 +14965,7 @@ defmodule TopLevel do
1492214965 "Locale" => encode_locale(struct.locale),
1492314966 "lock" => encode_lock(struct.lock),
1492414967 "long" => encode_long(struct.long),
14968+ "makeDictEncoder" => encode_make_dict_encoder(struct.make_dict_encoder),
1492514969 "map" => encode_map(struct.map),
1492614970 "MapEntry" => encode_map_entry(struct.map_entry),
1492714971 "MarshalJSON" => encode_marshal_json(struct.marshal_json),
Mschema-elmdefault / QuickType.elm+35 −0
@@ -178,6 +178,7 @@ module QuickType exposing
178178 , Locale
179179 , Lock
180180 , Long
181+ , MakeDictEncoder
181182 , Map
182183 , MapEntry
183184 , MarshalJSON
@@ -520,6 +521,7 @@ module QuickType exposing
520521 , UnionLocale(..)
521522 , UnionLock(..)
522523 , UnionLong(..)
524+ , UnionMakeDictEncoder(..)
523525 , UnionMap(..)
524526 , UnionMapEntry(..)
525527 , UnionMarshalJSON(..)
@@ -889,6 +891,7 @@ type alias QuickType =
889891 , locale : Maybe UnionLocale
890892 , lock : Maybe UnionLock
891893 , long : Maybe UnionLong
894+ , makeDictEncoder : Maybe UnionMakeDictEncoder
892895 , map : Maybe UnionMap
893896 , mapEntry : Maybe UnionMapEntry
894897 , marshalJSON : Maybe UnionMarshalJSON
@@ -2356,6 +2359,14 @@ type alias Long =
23562359 {
23572360 }
23582361
2362+type UnionMakeDictEncoder
2363+ = DoubleInUnionMakeDictEncoder Float
2364+ | MakeDictEncoderInUnionMakeDictEncoder MakeDictEncoder
2365+
2366+type alias MakeDictEncoder =
2367+ {
2368+ }
2369+
23592370 type UnionMap
23602371 = DoubleInUnionMap Float
23612372 | MapInUnionMap Map
@@ -3984,6 +3995,7 @@ quickType =
39843995 |> Jpipe.custom (optionalField "Locale" (Jdec.map Just unionLocale) Nothing)
39853996 |> Jpipe.custom (optionalField "lock" (Jdec.map Just unionLock) Nothing)
39863997 |> Jpipe.custom (optionalField "long" (Jdec.map Just unionLong) Nothing)
3998+ |> Jpipe.custom (optionalField "makeDictEncoder" (Jdec.map Just unionMakeDictEncoder) Nothing)
39873999 |> Jpipe.custom (optionalField "map" (Jdec.map Just unionMap) Nothing)
39884000 |> Jpipe.custom (optionalField "MapEntry" (Jdec.map Just unionMapEntry) Nothing)
39894001 |> Jpipe.custom (optionalField "MarshalJSON" (Jdec.map Just unionMarshalJSON) Nothing)
@@ -4331,6 +4343,7 @@ encodeQuickType x =
43314343 , ("Locale", makeNullableEncoder encodeUnionLocale x.locale)
43324344 , ("lock", makeNullableEncoder encodeUnionLock x.lock)
43334345 , ("long", makeNullableEncoder encodeUnionLong x.long)
4346+ , ("makeDictEncoder", makeNullableEncoder encodeUnionMakeDictEncoder x.makeDictEncoder)
43344347 , ("map", makeNullableEncoder encodeUnionMap x.map)
43354348 , ("MapEntry", makeNullableEncoder encodeUnionMapEntry x.mapEntry)
43364349 , ("MarshalJSON", makeNullableEncoder encodeUnionMarshalJSON x.marshalJSON)
@@ -8080,6 +8093,28 @@ encodeLong x =
80808093 [
80818094 ]
80828095
8096+unionMakeDictEncoder : Jdec.Decoder UnionMakeDictEncoder
8097+unionMakeDictEncoder =
8098+ Jdec.oneOf
8099+ [ Jdec.map DoubleInUnionMakeDictEncoder Jdec.float
8100+ , Jdec.map MakeDictEncoderInUnionMakeDictEncoder makeDictEncoder
8101+ ]
8102+
8103+encodeUnionMakeDictEncoder : UnionMakeDictEncoder -> Jenc.Value
8104+encodeUnionMakeDictEncoder x = case x of
8105+ DoubleInUnionMakeDictEncoder y -> Jenc.float y
8106+ MakeDictEncoderInUnionMakeDictEncoder y -> encodeMakeDictEncoder y
8107+
8108+makeDictEncoder : Jdec.Decoder MakeDictEncoder
8109+makeDictEncoder =
8110+ Jdec.dict Jdec.value |> Jdec.map (\_ -> MakeDictEncoder)
8111+
8112+encodeMakeDictEncoder : MakeDictEncoder -> Jenc.Value
8113+encodeMakeDictEncoder x =
8114+ Jenc.object
8115+ [
8116+ ]
8117+
80838118 unionMap : Jdec.Decoder UnionMap
80848119 unionMap =
80858120 Jdec.oneOf
Mschema-flowdefault / TopLevel.js+11 −2
@@ -192,6 +192,7 @@ export type TopLevel = {
192192 Locale?: UnionLocale;
193193 lock?: UnionLock;
194194 long?: UnionLong;
195+ makeDictEncoder?: UnionMakeDictEncoder;
195196 map?: UnionMap;
196197 MapEntry?: UnionMapEntry;
197198 MarshalJSON?: UnionMarshalJSON;
@@ -1431,6 +1432,11 @@ export type UnionLong = Long | number;
14311432 export type Long = {
14321433 };
14331434
1435+export type UnionMakeDictEncoder = MakeDictEncoder | number;
1436+
1437+export type MakeDictEncoder = {
1438+};
1439+
14341440 export type UnionMap = Map | number;
14351441
14361442 export type Map = {
@@ -2160,7 +2166,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
21602166 if (val === null || typeof val !== "object" || Array.isArray(val)) {
21612167 return invalidValue(l(ref || "object"), val, key, parent);
21622168 }
2163- const result: any = {};
2169+ const result: any = Object.create(null);
21642170 Object.getOwnPropertyNames(props).forEach(key => {
21652171 const prop = props[key];
21662172 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -2171,7 +2177,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
21712177 result[key] = transform(val[key], additional, getProps, key, ref);
21722178 }
21732179 });
2174- return result;
2180+ return Object.setPrototypeOf(result, Object.prototype);
21752181 }
21762182
21772183 if (typ === "any") return val;
@@ -2434,6 +2440,7 @@ const typeMap: any = {
24342440 { json: "Locale", js: "Locale", typ: u(undefined, u(r("Locale"), 3.14)) },
24352441 { json: "lock", js: "lock", typ: u(undefined, u(r("Lock"), 3.14)) },
24362442 { json: "long", js: "long", typ: u(undefined, u(r("Long"), 3.14)) },
2443+ { json: "makeDictEncoder", js: "makeDictEncoder", typ: u(undefined, u(r("MakeDictEncoder"), 3.14)) },
24372444 { json: "map", js: "map", typ: u(undefined, u(r("Map"), 3.14)) },
24382445 { json: "MapEntry", js: "MapEntry", typ: u(undefined, u(r("MapEntry"), 3.14)) },
24392446 { json: "MarshalJSON", js: "MarshalJSON", typ: u(undefined, u(r("MarshalJSON"), 3.14)) },
@@ -3026,6 +3033,8 @@ const typeMap: any = {
30263033 ], false),
30273034 "Long": o([
30283035 ], false),
3036+ "MakeDictEncoder": o([
3037+ ], false),
30293038 "Map": o([
30303039 ], false),
30313040 "MetadataPropertyHandling": o([
Mschema-golangdefault / quicktype.go+26 −0
@@ -204,6 +204,7 @@ type TopLevel struct {
204204 Locale *UnionLocale `json:"Locale"`
205205 Lock *UnionLock `json:"lock"`
206206 Long *UnionLong `json:"long"`
207+ MakeDictEncoder *UnionMakeDictEncoder `json:"makeDictEncoder"`
207208 Map *UnionMap `json:"map"`
208209 MapEntry *UnionMapEntry `json:"MapEntry"`
209210 MarshalJSON *UnionMarshalJSON `json:"MarshalJSON"`
@@ -895,6 +896,9 @@ type Lock struct {
895896 type Long struct {
896897 }
897898
899+type MakeDictEncoder struct {
900+}
901+
898902 type Map struct {
899903 }
900904
@@ -5265,6 +5269,28 @@ func (x *UnionLong) MarshalJSON() ([]byte, error) {
52655269 return marshalUnion(nil, x.Double, nil, nil, false, nil, x.Long != nil, x.Long, false, nil, false, nil, false)
52665270 }
52675271
5272+type UnionMakeDictEncoder struct {
5273+ Double *float64
5274+ MakeDictEncoder *MakeDictEncoder
5275+}
5276+
5277+func (x *UnionMakeDictEncoder) UnmarshalJSON(data []byte) error {
5278+ x.MakeDictEncoder = nil
5279+ var c MakeDictEncoder
5280+ object, err := unmarshalUnion(data, nil, &x.Double, nil, nil, false, nil, true, &c, false, nil, false, nil, false)
5281+ if err != nil {
5282+ return err
5283+ }
5284+ if object {
5285+ x.MakeDictEncoder = &c
5286+ }
5287+ return nil
5288+}
5289+
5290+func (x *UnionMakeDictEncoder) MarshalJSON() ([]byte, error) {
5291+ return marshalUnion(nil, x.Double, nil, nil, false, nil, x.MakeDictEncoder != nil, x.MakeDictEncoder, false, nil, false, nil, false)
5292+}
5293+
52685294 type UnionMap struct {
52695295 Double *float64
52705296 Map *Map
Mschema-haskelldefault / QuickType.hs+29 −1
@@ -167,6 +167,7 @@ module QuickType
167167 , Locale (..)
168168 , Lock (..)
169169 , Long (..)
170+ , MakeDictEncoder (..)
170171 , MapClass (..)
171172 , MapEntry (..)
172173 , MarshalJSON (..)
@@ -509,6 +510,7 @@ module QuickType
509510 , UnionLocale (..)
510511 , UnionLock (..)
511512 , UnionLong (..)
513+ , UnionMakeDictEncoder (..)
512514 , UnionMap (..)
513515 , UnionMapEntry (..)
514516 , UnionMarshalJSON (..)
@@ -879,6 +881,7 @@ data QuickType = QuickType
879881 , localeQuickType :: Maybe UnionLocale
880882 , lockQuickType :: Maybe UnionLock
881883 , longQuickType :: Maybe UnionLong
884+ , makeDictEncoderQuickType :: Maybe UnionMakeDictEncoder
882885 , mapQuickType :: Maybe UnionMap
883886 , mapEntryQuickType :: Maybe UnionMapEntry
884887 , marshalJSONQuickType :: Maybe UnionMarshalJSON
@@ -2518,6 +2521,15 @@ data Long = Long
25182521 {
25192522 } deriving (Show)
25202523
2524+data UnionMakeDictEncoder
2525+ = DoubleInUnionMakeDictEncoder Double
2526+ | MakeDictEncoderInUnionMakeDictEncoder MakeDictEncoder
2527+ deriving (Show)
2528+
2529+data MakeDictEncoder = MakeDictEncoder
2530+ {
2531+ } deriving (Show)
2532+
25212533 data UnionMap
25222534 = DoubleInUnionMap Double
25232535 | MapClassInUnionMap MapClass
@@ -4124,7 +4136,7 @@ decodeTopLevel :: ByteString -> Maybe QuickType
41244136 decodeTopLevel = decode
41254137
41264138 instance ToJSON QuickType where
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) =
4139+ 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 makeDictEncoderQuickType 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) =
41284140 object $ foldMap (maybe [] pure)
41294141 [ ("_" .=) <$> emptyQuickType
41304142 , ("_Bool" .=) <$> quickTypeBoolQuickType
@@ -4308,6 +4320,7 @@ instance ToJSON QuickType where
43084320 , ("Locale" .=) <$> localeQuickType
43094321 , ("lock" .=) <$> lockQuickType
43104322 , ("long" .=) <$> longQuickType
4323+ , ("makeDictEncoder" .=) <$> makeDictEncoderQuickType
43114324 , ("map" .=) <$> mapQuickType
43124325 , ("MapEntry" .=) <$> mapEntryQuickType
43134326 , ("MarshalJSON" .=) <$> marshalJSONQuickType
@@ -4655,6 +4668,7 @@ instance FromJSON QuickType where
46554668 <*> v .:! "Locale"
46564669 <*> v .:! "lock"
46574670 <*> v .:! "long"
4671+ <*> v .:! "makeDictEncoder"
46584672 <*> v .:! "map"
46594673 <*> v .:! "MapEntry"
46604674 <*> v .:! "MarshalJSON"
@@ -7113,6 +7127,20 @@ instance ToJSON Long where
71137127 instance FromJSON Long where
71147128 parseJSON (Object _) = return Long
71157129
7130+instance ToJSON UnionMakeDictEncoder where
7131+ toJSON (DoubleInUnionMakeDictEncoder x) = toJSON x
7132+ toJSON (MakeDictEncoderInUnionMakeDictEncoder x) = toJSON x
7133+
7134+instance FromJSON UnionMakeDictEncoder where
7135+ parseJSON xs@(Number _) = (fmap DoubleInUnionMakeDictEncoder . parseJSON) xs
7136+ parseJSON xs@(Object _) = (fmap MakeDictEncoderInUnionMakeDictEncoder . parseJSON) xs
7137+
7138+instance ToJSON MakeDictEncoder where
7139+ toJSON = \_ -> emptyObject
7140+
7141+instance FromJSON MakeDictEncoder where
7142+ parseJSON (Object _) = return MakeDictEncoder
7143+
71167144 instance ToJSON UnionMap where
71177145 toJSON (DoubleInUnionMap x) = toJSON x
71187146 toJSON (MapClassInUnionMap x) = toJSON x
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / MakeDictEncoder.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 MakeDictEncoder {
7+}
Mschema-java-datetime-legacydefault / src / main / java / io / quicktype / TopLevel.java+6 −0
@@ -185,6 +185,7 @@ public class TopLevel {
185185 private UnionLocale locale;
186186 private UnionLock lock;
187187 private UnionLong topLevelLong;
188+ private UnionMakeDictEncoder makeDictEncoder;
188189 private UnionMap map;
189190 private UnionMapEntry mapEntry;
190191 private UnionMarshalJSON marshalJSON;
@@ -1257,6 +1258,11 @@ public class TopLevel {
12571258 @JsonProperty("long")
12581259 public void setTopLevelLong(UnionLong value) { this.topLevelLong = value; }
12591260
1261+ @JsonProperty("makeDictEncoder")
1262+ public UnionMakeDictEncoder getMakeDictEncoder() { return makeDictEncoder; }
1263+ @JsonProperty("makeDictEncoder")
1264+ public void setMakeDictEncoder(UnionMakeDictEncoder value) { this.makeDictEncoder = value; }
1265+
12601266 @JsonProperty("map")
12611267 public UnionMap getMap() { return map; }
12621268 @JsonProperty("map")
Aschema-java-datetime-legacydefault / src / main / java / io / quicktype / UnionMakeDictEncoder.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 = UnionMakeDictEncoder.Deserializer.class)
11+@JsonSerialize(using = UnionMakeDictEncoder.Serializer.class)
12+public class UnionMakeDictEncoder {
13+ public Double doubleValue;
14+ public MakeDictEncoder makeDictEncoderValue;
15+
16+ static class Deserializer extends JsonDeserializer<UnionMakeDictEncoder> {
17+ @Override
18+ public UnionMakeDictEncoder deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ UnionMakeDictEncoder value = new UnionMakeDictEncoder();
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.makeDictEncoderValue = jsonParser.readValueAs(MakeDictEncoder.class);
29+ break;
30+ default: throw new IOException("Cannot deserialize UnionMakeDictEncoder");
31+ }
32+ return value;
33+ }
34+ }
35+
36+ static class Serializer extends JsonSerializer<UnionMakeDictEncoder> {
37+ @Override
38+ public void serialize(UnionMakeDictEncoder obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39+ if (obj.doubleValue != null) {
40+ jsonGenerator.writeObject(obj.doubleValue);
41+ return;
42+ }
43+ if (obj.makeDictEncoderValue != null) {
44+ jsonGenerator.writeObject(obj.makeDictEncoderValue);
45+ return;
46+ }
47+ jsonGenerator.writeNull();
48+ }
49+ }
50+}
Aschema-java-lombokdefault / src / main / java / io / quicktype / MakeDictEncoder.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 MakeDictEncoder {
7+}
Mschema-java-lombokdefault / src / main / java / io / quicktype / TopLevel.java+6 −0
@@ -185,6 +185,7 @@ public class TopLevel {
185185 private UnionLocale locale;
186186 private UnionLock lock;
187187 private UnionLong topLevelLong;
188+ private UnionMakeDictEncoder makeDictEncoder;
188189 private UnionMap map;
189190 private UnionMapEntry mapEntry;
190191 private UnionMarshalJSON marshalJSON;
@@ -1257,6 +1258,11 @@ public class TopLevel {
12571258 @JsonProperty("long")
12581259 public void setTopLevelLong(UnionLong value) { this.topLevelLong = value; }
12591260
1261+ @JsonProperty("makeDictEncoder")
1262+ public UnionMakeDictEncoder getMakeDictEncoder() { return makeDictEncoder; }
1263+ @JsonProperty("makeDictEncoder")
1264+ public void setMakeDictEncoder(UnionMakeDictEncoder value) { this.makeDictEncoder = value; }
1265+
12601266 @JsonProperty("map")
12611267 public UnionMap getMap() { return map; }
12621268 @JsonProperty("map")
Aschema-java-lombokdefault / src / main / java / io / quicktype / UnionMakeDictEncoder.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 = UnionMakeDictEncoder.Deserializer.class)
11+@JsonSerialize(using = UnionMakeDictEncoder.Serializer.class)
12+public class UnionMakeDictEncoder {
13+ public Double doubleValue;
14+ public MakeDictEncoder makeDictEncoderValue;
15+
16+ static class Deserializer extends JsonDeserializer<UnionMakeDictEncoder> {
17+ @Override
18+ public UnionMakeDictEncoder deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ UnionMakeDictEncoder value = new UnionMakeDictEncoder();
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.makeDictEncoderValue = jsonParser.readValueAs(MakeDictEncoder.class);
29+ break;
30+ default: throw new IOException("Cannot deserialize UnionMakeDictEncoder");
31+ }
32+ return value;
33+ }
34+ }
35+
36+ static class Serializer extends JsonSerializer<UnionMakeDictEncoder> {
37+ @Override
38+ public void serialize(UnionMakeDictEncoder obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39+ if (obj.doubleValue != null) {
40+ jsonGenerator.writeObject(obj.doubleValue);
41+ return;
42+ }
43+ if (obj.makeDictEncoderValue != null) {
44+ jsonGenerator.writeObject(obj.makeDictEncoderValue);
45+ return;
46+ }
47+ jsonGenerator.writeNull();
48+ }
49+ }
50+}
Aschema-javadefault / src / main / java / io / quicktype / MakeDictEncoder.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 MakeDictEncoder {
7+}
Mschema-javadefault / src / main / java / io / quicktype / TopLevel.java+6 −0
@@ -185,6 +185,7 @@ public class TopLevel {
185185 private UnionLocale locale;
186186 private UnionLock lock;
187187 private UnionLong topLevelLong;
188+ private UnionMakeDictEncoder makeDictEncoder;
188189 private UnionMap map;
189190 private UnionMapEntry mapEntry;
190191 private UnionMarshalJSON marshalJSON;
@@ -1257,6 +1258,11 @@ public class TopLevel {
12571258 @JsonProperty("long")
12581259 public void setTopLevelLong(UnionLong value) { this.topLevelLong = value; }
12591260
1261+ @JsonProperty("makeDictEncoder")
1262+ public UnionMakeDictEncoder getMakeDictEncoder() { return makeDictEncoder; }
1263+ @JsonProperty("makeDictEncoder")
1264+ public void setMakeDictEncoder(UnionMakeDictEncoder value) { this.makeDictEncoder = value; }
1265+
12601266 @JsonProperty("map")
12611267 public UnionMap getMap() { return map; }
12621268 @JsonProperty("map")
Aschema-javadefault / src / main / java / io / quicktype / UnionMakeDictEncoder.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 = UnionMakeDictEncoder.Deserializer.class)
11+@JsonSerialize(using = UnionMakeDictEncoder.Serializer.class)
12+public class UnionMakeDictEncoder {
13+ public Double doubleValue;
14+ public MakeDictEncoder makeDictEncoderValue;
15+
16+ static class Deserializer extends JsonDeserializer<UnionMakeDictEncoder> {
17+ @Override
18+ public UnionMakeDictEncoder deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
19+ UnionMakeDictEncoder value = new UnionMakeDictEncoder();
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.makeDictEncoderValue = jsonParser.readValueAs(MakeDictEncoder.class);
29+ break;
30+ default: throw new IOException("Cannot deserialize UnionMakeDictEncoder");
31+ }
32+ return value;
33+ }
34+ }
35+
36+ static class Serializer extends JsonSerializer<UnionMakeDictEncoder> {
37+ @Override
38+ public void serialize(UnionMakeDictEncoder obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
39+ if (obj.doubleValue != null) {
40+ jsonGenerator.writeObject(obj.doubleValue);
41+ return;
42+ }
43+ if (obj.makeDictEncoderValue != null) {
44+ jsonGenerator.writeObject(obj.makeDictEncoderValue);
45+ return;
46+ }
47+ jsonGenerator.writeNull();
48+ }
49+ }
50+}
Mschema-javascript-prop-typesdefault / toplevel.js+4 −0
@@ -228,6 +228,7 @@ let _Let;
228228 let _List;
229229 let _Lock;
230230 let _Long;
231+let _MakeDictEncoder;
231232 let _Map;
232233 let _MetadataPropertyHandling;
233234 let _Module;
@@ -785,6 +786,8 @@ _Lock = PropTypes.shape({
785786 });
786787 _Long = PropTypes.shape({
787788 });
789+_MakeDictEncoder = PropTypes.shape({
790+});
788791 _Map = PropTypes.shape({
789792 });
790793 _MetadataPropertyHandling = PropTypes.shape({
@@ -1222,6 +1225,7 @@ _TopLevel = PropTypes.shape({
12221225 "Locale": PropTypes.oneOfType([_Locale, PropTypes.number, PropTypes.oneOf([null])]),
12231226 "lock": PropTypes.oneOfType([_Lock, PropTypes.number, PropTypes.oneOf([null])]),
12241227 "long": PropTypes.oneOfType([_Long, PropTypes.number, PropTypes.oneOf([null])]),
1228+ "makeDictEncoder": PropTypes.oneOfType([_MakeDictEncoder, PropTypes.number, PropTypes.oneOf([null])]),
12251229 "map": PropTypes.oneOfType([_Map, PropTypes.number, PropTypes.oneOf([null])]),
12261230 "MapEntry": PropTypes.oneOfType([_MapEntry, PropTypes.number, PropTypes.oneOf([null])]),
12271231 "MarshalJSON": PropTypes.oneOfType([_MarshalJSON, PropTypes.number, PropTypes.oneOf([null])]),
Mschema-javascriptdefault / TopLevel.js+5 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
@@ -375,6 +375,7 @@ const typeMap = {
375375 { json: "Locale", js: "Locale", typ: u(undefined, u(r("Locale"), 3.14)) },
376376 { json: "lock", js: "lock", typ: u(undefined, u(r("Lock"), 3.14)) },
377377 { json: "long", js: "long", typ: u(undefined, u(r("Long"), 3.14)) },
378+ { json: "makeDictEncoder", js: "makeDictEncoder", typ: u(undefined, u(r("MakeDictEncoder"), 3.14)) },
378379 { json: "map", js: "map", typ: u(undefined, u(r("Map"), 3.14)) },
379380 { json: "MapEntry", js: "MapEntry", typ: u(undefined, u(r("MapEntry"), 3.14)) },
380381 { json: "MarshalJSON", js: "MarshalJSON", typ: u(undefined, u(r("MarshalJSON"), 3.14)) },
@@ -967,6 +968,8 @@ const typeMap = {
967968 ], false),
968969 "Long": o([
969970 ], false),
971+ "MakeDictEncoder": o([
972+ ], false),
970973 "Map": o([
971974 ], false),
972975 "MetadataPropertyHandling": o([
Mschema-objective-cdefault / QTTopLevel.h+5 −0
@@ -157,6 +157,7 @@
157157 @class QTList;
158158 @class QTLocale;
159159 @class QTLock;
160+@class QTMakeDictEncoder;
160161 @class QTMap;
161162 @class QTMapEntry;
162163 @class QTMarshalJSON;
@@ -543,6 +544,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
543544 @property (nonatomic, nullable, copy) id locale;
544545 @property (nonatomic, nullable, copy) id lock;
545546 @property (nonatomic, nullable, copy) id qtTopLevelLong;
547+@property (nonatomic, nullable, copy) id makeDictEncoder;
546548 @property (nonatomic, nullable, copy) id map;
547549 @property (nonatomic, nullable, copy) id mapEntry;
548550 @property (nonatomic, nullable, copy) id marshalJSON;
@@ -1164,6 +1166,9 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding en
11641166 @interface QTLock : NSObject
11651167 @end
11661168
1169+@interface QTMakeDictEncoder : NSObject
1170+@end
1171+
11671172 @interface QTMap : NSObject
11681173 @end
Mschema-objective-cdefault / QTTopLevel.m+45 −0
@@ -768,6 +768,11 @@ NS_ASSUME_NONNULL_BEGIN
768768 - (NSDictionary *)JSONDictionary;
769769 @end
770770
771+@interface QTMakeDictEncoder (JSONConversion)
772++ (instancetype)fromJSONDictionary:(NSDictionary *)dict;
773+- (NSDictionary *)JSONDictionary;
774+@end
775+
771776 @interface QTMap (JSONConversion)
772777 + (instancetype)fromJSONDictionary:(NSDictionary *)dict;
773778 - (NSDictionary *)JSONDictionary;
@@ -1946,6 +1951,7 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
19461951 @"Locale": @"locale",
19471952 @"lock": @"lock",
19481953 @"long": @"qtTopLevelLong",
1954+ @"makeDictEncoder": @"makeDictEncoder",
19491955 @"map": @"map",
19501956 @"MapEntry": @"mapEntry",
19511957 @"MarshalJSON": @"marshalJSON",
@@ -8060,6 +8066,45 @@ NSString *_Nullable QTTopLevelToJSON(QTTopLevel *topLevel, NSStringEncoding enco
80608066 }
80618067 @end
80628068
8069+@implementation QTMakeDictEncoder
8070++ (NSDictionary<NSString *, NSString *> *)properties
8071+{
8072+ static NSDictionary<NSString *, NSString *> *properties;
8073+ return properties = properties ? properties : @{
8074+ };
8075+}
8076+
8077++ (instancetype)fromJSONDictionary:(NSDictionary *)dict
8078+{
8079+ return [dict isKindOfClass:NSDictionary.class] ? [[QTMakeDictEncoder alloc] initWithJSONDictionary:dict] : nil;
8080+}
8081+
8082+- (instancetype)initWithJSONDictionary:(NSDictionary *)dict
8083+{
8084+ if (self = [super init]) {
8085+ [self setValuesForKeysWithDictionary:dict];
8086+ }
8087+ return self;
8088+}
8089+
8090+- (void)setValue:(nullable id)value forKey:(NSString *)key
8091+{
8092+ id resolved = QTMakeDictEncoder.properties[key];
8093+ if (resolved) [super setValue:value forKey:resolved];
8094+}
8095+
8096+- (void)setNilValueForKey:(NSString *)key
8097+{
8098+ id resolved = QTMakeDictEncoder.properties[key];
8099+ if (resolved) [super setValue:@(0) forKey:resolved];
8100+}
8101+
8102+- (NSDictionary *)JSONDictionary
8103+{
8104+ return [self dictionaryWithValuesForKeys:QTMakeDictEncoder.properties.allValues];
8105+}
8106+@end
8107+
80638108 @implementation QTMap
80648109 + (NSDictionary<NSString *, NSString *> *)properties
80658110 {
Mschema-phpdefault / TopLevel.php+290 −162
@@ -186,6 +186,7 @@ class TopLevel {
186186 private LocaleClass|float|null $locale; // json:Locale Optional
187187 private Lock|float|null $lock; // json:lock Optional
188188 private Long|float|null $long; // json:long Optional
189+ private MakeDictEncoder|float|null $makeDictEncoder; // json:makeDictEncoder Optional
189190 private Map|float|null $map; // json:map Optional
190191 private MapEntry|float|null $mapEntry; // json:MapEntry Optional
191192 private MarshalJSON|float|null $marshalJSON; // json:MarshalJSON Optional
@@ -531,6 +532,7 @@ class TopLevel {
531532 * @param LocaleClass|float|null $locale
532533 * @param Lock|float|null $lock
533534 * @param Long|float|null $long
535+ * @param MakeDictEncoder|float|null $makeDictEncoder
534536 * @param Map|float|null $map
535537 * @param MapEntry|float|null $mapEntry
536538 * @param MarshalJSON|float|null $marshalJSON
@@ -693,7 +695,7 @@ class TopLevel {
693695 * @param Yes|float|null $yes
694696 * @param YieldClass|float|null $yield
695697 */
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) {
698+ 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, MakeDictEncoder|float|null $makeDictEncoder, 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) {
697699 $this->empty = $empty;
698700 $this->topLevelBool = $topLevelBool;
699701 $this->complex = $complex;
@@ -876,6 +878,7 @@ class TopLevel {
876878 $this->locale = $locale;
877879 $this->lock = $lock;
878880 $this->long = $long;
881+ $this->makeDictEncoder = $makeDictEncoder;
879882 $this->map = $map;
880883 $this->mapEntry = $mapEntry;
881884 $this->marshalJSON = $marshalJSON;
@@ -14852,6 +14855,82 @@ class TopLevel {
1485214855 return Long::sample(); /*212:long*/
1485314856 }
1485414857
14858+ /**
14859+ * @param stdClass|float|null $value
14860+ * @throws Exception
14861+ * @return MakeDictEncoder|float|null
14862+ */
14863+ public static function fromMakeDictEncoder(stdClass|float|null $value): MakeDictEncoder|float|null {
14864+ if (is_null($value)) {
14865+ return $value; /*null*/
14866+ } elseif (is_object($value)) {
14867+ return MakeDictEncoder::from($value); /*class*/
14868+ } elseif (is_float($value) || is_int($value)) {
14869+ return $value; /*float*/
14870+ } else {
14871+ throw new Exception('Cannot deserialize union value in TopLevel');
14872+ }
14873+ }
14874+
14875+ /**
14876+ * @throws Exception
14877+ * @return stdClass|float|null
14878+ */
14879+ public function toMakeDictEncoder(): stdClass|float|null {
14880+ if (TopLevel::validateMakeDictEncoder($this->makeDictEncoder)) {
14881+ if (is_null($this->makeDictEncoder)) {
14882+ return $this->makeDictEncoder; /*null*/
14883+ } elseif ($this->makeDictEncoder instanceof MakeDictEncoder) {
14884+ return $this->makeDictEncoder->to(); /*class*/
14885+ } elseif (is_float($this->makeDictEncoder) || is_int($this->makeDictEncoder)) {
14886+ return $this->makeDictEncoder; /*float*/
14887+ } else {
14888+ throw new Exception('Union value has no matching member in TopLevel');
14889+ }
14890+ }
14891+ throw new Exception('never get to this TopLevel::makeDictEncoder');
14892+ }
14893+
14894+ /**
14895+ * @param MakeDictEncoder|float|null
14896+ * @return bool
14897+ * @throws Exception
14898+ */
14899+ public static function validateMakeDictEncoder(MakeDictEncoder|float|null $value): bool {
14900+ if (is_null($value)) {
14901+ if (!is_null($value)) {
14902+ throw new Exception("Attribute Error:TopLevel::makeDictEncoder");
14903+ }
14904+ } elseif ($value instanceof MakeDictEncoder) {
14905+ $value->validate();
14906+ } elseif (is_float($value) || is_int($value)) {
14907+ if (!is_float($value) && !is_int($value)) {
14908+ throw new Exception("Attribute Error:TopLevel::makeDictEncoder");
14909+ }
14910+ } else {
14911+ throw new Exception("Attribute Error:TopLevel::makeDictEncoder");
14912+ }
14913+ return true;
14914+ }
14915+
14916+ /**
14917+ * @throws Exception
14918+ * @return MakeDictEncoder|float|null
14919+ */
14920+ public function getMakeDictEncoder(): MakeDictEncoder|float|null {
14921+ if (TopLevel::validateMakeDictEncoder($this->makeDictEncoder)) {
14922+ return $this->makeDictEncoder;
14923+ }
14924+ throw new Exception('never get to getMakeDictEncoder TopLevel::makeDictEncoder');
14925+ }
14926+
14927+ /**
14928+ * @return MakeDictEncoder|float|null
14929+ */
14930+ public static function sampleMakeDictEncoder(): MakeDictEncoder|float|null {
14931+ return MakeDictEncoder::sample(); /*213:makeDictEncoder*/
14932+ }
14933+
1485514934 /**
1485614935 * @param stdClass|float|null $value
1485714936 * @throws Exception
@@ -14925,7 +15004,7 @@ class TopLevel {
1492515004 * @return Map|float|null
1492615005 */
1492715006 public static function sampleMap(): Map|float|null {
14928- return Map::sample(); /*213:map*/
15007+ return Map::sample(); /*214:map*/
1492915008 }
1493015009
1493115010 /**
@@ -15001,7 +15080,7 @@ class TopLevel {
1500115080 * @return MapEntry|float|null
1500215081 */
1500315082 public static function sampleMapEntry(): MapEntry|float|null {
15004- return MapEntry::sample(); /*214:mapEntry*/
15083+ return MapEntry::sample(); /*215:mapEntry*/
1500515084 }
1500615085
1500715086 /**
@@ -15077,7 +15156,7 @@ class TopLevel {
1507715156 * @return MarshalJSON|float|null
1507815157 */
1507915158 public static function sampleMarshalJSON(): MarshalJSON|float|null {
15080- return MarshalJSON::sample(); /*215:marshalJSON*/
15159+ return MarshalJSON::sample(); /*216:marshalJSON*/
1508115160 }
1508215161
1508315162 /**
@@ -15153,7 +15232,7 @@ class TopLevel {
1515315232 * @return MetadataPropertyHandling|float|null
1515415233 */
1515515234 public static function sampleMetadataPropertyHandling(): MetadataPropertyHandling|float|null {
15156- return MetadataPropertyHandling::sample(); /*216:metadataPropertyHandling*/
15235+ return MetadataPropertyHandling::sample(); /*217:metadataPropertyHandling*/
1515715236 }
1515815237
1515915238 /**
@@ -15229,7 +15308,7 @@ class TopLevel {
1522915308 * @return Module|float|null
1523015309 */
1523115310 public static function sampleModule(): Module|float|null {
15232- return Module::sample(); /*217:module*/
15311+ return Module::sample(); /*218:module*/
1523315312 }
1523415313
1523515314 /**
@@ -15305,7 +15384,7 @@ class TopLevel {
1530515384 * @return Mutable|float|null
1530615385 */
1530715386 public static function sampleMutable(): Mutable|float|null {
15308- return Mutable::sample(); /*218:mutable*/
15387+ return Mutable::sample(); /*219:mutable*/
1530915388 }
1531015389
1531115390 /**
@@ -15381,7 +15460,7 @@ class TopLevel {
1538115460 * @return Mutating|float|null
1538215461 */
1538315462 public static function sampleMutating(): Mutating|float|null {
15384- return Mutating::sample(); /*219:mutating*/
15463+ return Mutating::sample(); /*220:mutating*/
1538515464 }
1538615465
1538715466 /**
@@ -15457,7 +15536,7 @@ class TopLevel {
1545715536 * @return NamespaceClass|float|null
1545815537 */
1545915538 public static function sampleNamespace(): NamespaceClass|float|null {
15460- return NamespaceClass::sample(); /*220:namespace*/
15539+ return NamespaceClass::sample(); /*221:namespace*/
1546115540 }
1546215541
1546315542 /**
@@ -15533,7 +15612,7 @@ class TopLevel {
1553315612 * @return Native|float|null
1553415613 */
1553515614 public static function sampleNative(): Native|float|null {
15536- return Native::sample(); /*221:native*/
15615+ return Native::sample(); /*222:native*/
1553715616 }
1553815617
1553915618 /**
@@ -15609,7 +15688,7 @@ class TopLevel {
1560915688 * @return NewClass|float|null
1561015689 */
1561115690 public static function sampleNew(): NewClass|float|null {
15612- return NewClass::sample(); /*222:new*/
15691+ return NewClass::sample(); /*223:new*/
1561315692 }
1561415693
1561515694 /**
@@ -15685,7 +15764,7 @@ class TopLevel {
1568515764 * @return Newtonsoft|float|null
1568615765 */
1568715766 public static function sampleNewtonsoft(): Newtonsoft|float|null {
15688- return Newtonsoft::sample(); /*223:newtonsoft*/
15767+ return Newtonsoft::sample(); /*224:newtonsoft*/
1568915768 }
1569015769
1569115770 /**
@@ -15761,7 +15840,7 @@ class TopLevel {
1576115840 * @return Nil|float|null
1576215841 */
1576315842 public static function sampleNil(): Nil|float|null {
15764- return Nil::sample(); /*224:nil*/
15843+ return Nil::sample(); /*225:nil*/
1576515844 }
1576615845
1576715846 /**
@@ -15837,7 +15916,7 @@ class TopLevel {
1583715916 * @return No|float|null
1583815917 */
1583915918 public static function sampleNo(): No|float|null {
15840- return No::sample(); /*225:no*/
15919+ return No::sample(); /*226:no*/
1584115920 }
1584215921
1584315922 /**
@@ -15913,7 +15992,7 @@ class TopLevel {
1591315992 * @return Noexcept|float|null
1591415993 */
1591515994 public static function sampleNoexcept(): Noexcept|float|null {
15916- return Noexcept::sample(); /*226:noexcept*/
15995+ return Noexcept::sample(); /*227:noexcept*/
1591715996 }
1591815997
1591915998 /**
@@ -15989,7 +16068,7 @@ class TopLevel {
1598916068 * @return Nonatomic|float|null
1599016069 */
1599116070 public static function sampleNonatomic(): Nonatomic|float|null {
15992- return Nonatomic::sample(); /*227:nonatomic*/
16071+ return Nonatomic::sample(); /*228:nonatomic*/
1599316072 }
1599416073
1599516074 /**
@@ -16065,7 +16144,7 @@ class TopLevel {
1606516144 * @return NoneClass|float|null
1606616145 */
1606716146 public static function sampleTopLevelNone(): NoneClass|float|null {
16068- return NoneClass::sample(); /*228:topLevelNone*/
16147+ return NoneClass::sample(); /*229:topLevelNone*/
1606916148 }
1607016149
1607116150 /**
@@ -16141,7 +16220,7 @@ class TopLevel {
1614116220 * @return None|float|null
1614216221 */
1614316222 public static function sampleNone(): None|float|null {
16144- return None::sample(); /*229:none*/
16223+ return None::sample(); /*230:none*/
1614516224 }
1614616225
1614716226 /**
@@ -16217,7 +16296,7 @@ class TopLevel {
1621716296 * @return Nonlocal|float|null
1621816297 */
1621916298 public static function sampleNonlocal(): Nonlocal|float|null {
16220- return Nonlocal::sample(); /*230:nonlocal*/
16299+ return Nonlocal::sample(); /*231:nonlocal*/
1622116300 }
1622216301
1622316302 /**
@@ -16293,7 +16372,7 @@ class TopLevel {
1629316372 * @return Nonmutating|float|null
1629416373 */
1629516374 public static function sampleNonmutating(): Nonmutating|float|null {
16296- return Nonmutating::sample(); /*231:nonmutating*/
16375+ return Nonmutating::sample(); /*232:nonmutating*/
1629716376 }
1629816377
1629916378 /**
@@ -16369,7 +16448,7 @@ class TopLevel {
1636916448 * @return NoSuchMethod|float|null
1637016449 */
1637116450 public static function sampleNoSuchMethod(): NoSuchMethod|float|null {
16372- return NoSuchMethod::sample(); /*232:noSuchMethod*/
16451+ return NoSuchMethod::sample(); /*233:noSuchMethod*/
1637316452 }
1637416453
1637516454 /**
@@ -16445,7 +16524,7 @@ class TopLevel {
1644516524 * @return Not|float|null
1644616525 */
1644716526 public static function sampleNot(): Not|float|null {
16448- return Not::sample(); /*233:not*/
16527+ return Not::sample(); /*234:not*/
1644916528 }
1645016529
1645116530 /**
@@ -16521,7 +16600,7 @@ class TopLevel {
1652116600 * @return NotEq|float|null
1652216601 */
1652316602 public static function sampleNotEq(): NotEq|float|null {
16524- return NotEq::sample(); /*234:notEq*/
16603+ return NotEq::sample(); /*235:notEq*/
1652516604 }
1652616605
1652716606 /**
@@ -16597,7 +16676,7 @@ class TopLevel {
1659716676 * @return NSError|float|null
1659816677 */
1659916678 public static function sampleNSError(): NSError|float|null {
16600- return NSError::sample(); /*235:nsError*/
16679+ return NSError::sample(); /*236:nsError*/
1660116680 }
1660216681
1660316682 /**
@@ -16673,7 +16752,7 @@ class TopLevel {
1667316752 * @return NSObject|float|null
1667416753 */
1667516754 public static function sampleNSObject(): NSObject|float|null {
16676- return NSObject::sample(); /*236:nsObject*/
16755+ return NSObject::sample(); /*237:nsObject*/
1667716756 }
1667816757
1667916758 /**
@@ -16749,7 +16828,7 @@ class TopLevel {
1674916828 * @return NSString|float|null
1675016829 */
1675116830 public static function sampleNSString(): NSString|float|null {
16752- return NSString::sample(); /*237:nsString*/
16831+ return NSString::sample(); /*238:nsString*/
1675316832 }
1675416833
1675516834 /**
@@ -16825,7 +16904,7 @@ class TopLevel {
1682516904 * @return NULLClass|float|null
1682616905 */
1682716906 public static function sampleNull(): NULLClass|float|null {
16828- return NULLClass::sample(); /*238:null*/
16907+ return NULLClass::sample(); /*239:null*/
1682916908 }
1683016909
1683116910 /**
@@ -16901,7 +16980,7 @@ class TopLevel {
1690116980 * @return UnionNullNull|float|null
1690216981 */
1690316982 public static function sampleTopLevelNull(): UnionNullNull|float|null {
16904- return UnionNullNull::sample(); /*239:topLevelNull*/
16983+ return UnionNullNull::sample(); /*240:topLevelNull*/
1690516984 }
1690616985
1690716986 /**
@@ -16977,7 +17056,7 @@ class TopLevel {
1697717056 * @return Nullptr|float|null
1697817057 */
1697917058 public static function sampleNullptr(): Nullptr|float|null {
16980- return Nullptr::sample(); /*240:nullptr*/
17059+ return Nullptr::sample(); /*241:nullptr*/
1698117060 }
1698217061
1698317062 /**
@@ -17053,7 +17132,7 @@ class TopLevel {
1705317132 * @return Number|float|null
1705417133 */
1705517134 public static function sampleNumber(): Number|float|null {
17056- return Number::sample(); /*241:number*/
17135+ return Number::sample(); /*242:number*/
1705717136 }
1705817137
1705917138 /**
@@ -17129,7 +17208,7 @@ class TopLevel {
1712917208 * @return ObjectClass|float|null
1713017209 */
1713117210 public static function sampleObject(): ObjectClass|float|null {
17132- return ObjectClass::sample(); /*242:object*/
17211+ return ObjectClass::sample(); /*243:object*/
1713317212 }
1713417213
1713517214 /**
@@ -17205,7 +17284,7 @@ class TopLevel {
1720517284 * @return ObjectMapper|float|null
1720617285 */
1720717286 public static function sampleObjectMapper(): ObjectMapper|float|null {
17208- return ObjectMapper::sample(); /*243:objectMapper*/
17287+ return ObjectMapper::sample(); /*244:objectMapper*/
1720917288 }
1721017289
1721117290 /**
@@ -17281,7 +17360,7 @@ class TopLevel {
1728117360 * @return Of|float|null
1728217361 */
1728317362 public static function sampleOf(): Of|float|null {
17284- return Of::sample(); /*244:of*/
17363+ return Of::sample(); /*245:of*/
1728517364 }
1728617365
1728717366 /**
@@ -17357,7 +17436,7 @@ class TopLevel {
1735717436 * @return Oneway|float|null
1735817437 */
1735917438 public static function sampleOneway(): Oneway|float|null {
17360- return Oneway::sample(); /*245:oneway*/
17439+ return Oneway::sample(); /*246:oneway*/
1736117440 }
1736217441
1736317442 /**
@@ -17433,7 +17512,7 @@ class TopLevel {
1743317512 * @return Open|float|null
1743417513 */
1743517514 public static function sampleOpen(): Open|float|null {
17436- return Open::sample(); /*246:open*/
17515+ return Open::sample(); /*247:open*/
1743717516 }
1743817517
1743917518 /**
@@ -17509,7 +17588,7 @@ class TopLevel {
1750917588 * @return Operator|float|null
1751017589 */
1751117590 public static function sampleOperator(): Operator|float|null {
17512- return Operator::sample(); /*247:operator*/
17591+ return Operator::sample(); /*248:operator*/
1751317592 }
1751417593
1751517594 /**
@@ -17585,7 +17664,7 @@ class TopLevel {
1758517664 * @return Optional|float|null
1758617665 */
1758717666 public static function sampleOptional(): Optional|float|null {
17588- return Optional::sample(); /*248:optional*/
17667+ return Optional::sample(); /*249:optional*/
1758917668 }
1759017669
1759117670 /**
@@ -17661,7 +17740,7 @@ class TopLevel {
1766117740 * @return OrClass|float|null
1766217741 */
1766317742 public static function sampleOr(): OrClass|float|null {
17664- return OrClass::sample(); /*249:or*/
17743+ return OrClass::sample(); /*250:or*/
1766517744 }
1766617745
1766717746 /**
@@ -17737,7 +17816,7 @@ class TopLevel {
1773717816 * @return OrEq|float|null
1773817817 */
1773917818 public static function sampleOrEq(): OrEq|float|null {
17740- return OrEq::sample(); /*250:orEq*/
17819+ return OrEq::sample(); /*251:orEq*/
1774117820 }
1774217821
1774317822 /**
@@ -17813,7 +17892,7 @@ class TopLevel {
1781317892 * @return Out|float|null
1781417893 */
1781517894 public static function sampleOut(): Out|float|null {
17816- return Out::sample(); /*251:out*/
17895+ return Out::sample(); /*252:out*/
1781717896 }
1781817897
1781917898 /**
@@ -17889,7 +17968,7 @@ class TopLevel {
1788917968 * @return OverrideClass|float|null
1789017969 */
1789117970 public static function sampleOverride(): OverrideClass|float|null {
17892- return OverrideClass::sample(); /*252:override*/
17971+ return OverrideClass::sample(); /*253:override*/
1789317972 }
1789417973
1789517974 /**
@@ -17965,7 +18044,7 @@ class TopLevel {
1796518044 * @return Package|float|null
1796618045 */
1796718046 public static function samplePackage(): Package|float|null {
17968- return Package::sample(); /*253:package*/
18047+ return Package::sample(); /*254:package*/
1796918048 }
1797018049
1797118050 /**
@@ -18041,7 +18120,7 @@ class TopLevel {
1804118120 * @return Params|float|null
1804218121 */
1804318122 public static function sampleParams(): Params|float|null {
18044- return Params::sample(); /*254:params*/
18123+ return Params::sample(); /*255:params*/
1804518124 }
1804618125
1804718126 /**
@@ -18117,7 +18196,7 @@ class TopLevel {
1811718196 * @return Pass|float|null
1811818197 */
1811918198 public static function samplePass(): Pass|float|null {
18120- return Pass::sample(); /*255:pass*/
18199+ return Pass::sample(); /*256:pass*/
1812118200 }
1812218201
1812318202 /**
@@ -18193,7 +18272,7 @@ class TopLevel {
1819318272 * @return Port|float|null
1819418273 */
1819518274 public static function samplePort(): Port|float|null {
18196- return Port::sample(); /*256:port*/
18275+ return Port::sample(); /*257:port*/
1819718276 }
1819818277
1819918278 /**
@@ -18269,7 +18348,7 @@ class TopLevel {
1826918348 * @return Postfix|float|null
1827018349 */
1827118350 public static function samplePostfix(): Postfix|float|null {
18272- return Postfix::sample(); /*257:postfix*/
18351+ return Postfix::sample(); /*258:postfix*/
1827318352 }
1827418353
1827518354 /**
@@ -18345,7 +18424,7 @@ class TopLevel {
1834518424 * @return Precedence|float|null
1834618425 */
1834718426 public static function samplePrecedence(): Precedence|float|null {
18348- return Precedence::sample(); /*258:precedence*/
18427+ return Precedence::sample(); /*259:precedence*/
1834918428 }
1835018429
1835118430 /**
@@ -18421,7 +18500,7 @@ class TopLevel {
1842118500 * @return Prefix|float|null
1842218501 */
1842318502 public static function samplePrefix(): Prefix|float|null {
18424- return Prefix::sample(); /*259:prefix*/
18503+ return Prefix::sample(); /*260:prefix*/
1842518504 }
1842618505
1842718506 /**
@@ -18497,7 +18576,7 @@ class TopLevel {
1849718576 * @return PrimitiveKind|float|null
1849818577 */
1849918578 public static function samplePrimitiveKind(): PrimitiveKind|float|null {
18500- return PrimitiveKind::sample(); /*260:primitiveKind*/
18579+ return PrimitiveKind::sample(); /*261:primitiveKind*/
1850118580 }
1850218581
1850318582 /**
@@ -18573,7 +18652,7 @@ class TopLevel {
1857318652 * @return PrintClass|float|null
1857418653 */
1857518654 public static function samplePrint(): PrintClass|float|null {
18576- return PrintClass::sample(); /*261:print*/
18655+ return PrintClass::sample(); /*262:print*/
1857718656 }
1857818657
1857918658 /**
@@ -18649,7 +18728,7 @@ class TopLevel {
1864918728 * @return Printf|float|null
1865018729 */
1865118730 public static function samplePrintf(): Printf|float|null {
18652- return Printf::sample(); /*262:printf*/
18731+ return Printf::sample(); /*263:printf*/
1865318732 }
1865418733
1865518734 /**
@@ -18725,7 +18804,7 @@ class TopLevel {
1872518804 * @return PrintMembers|float|null
1872618805 */
1872718806 public static function samplePrintMembers(): PrintMembers|float|null {
18728- return PrintMembers::sample(); /*263:printMembers*/
18807+ return PrintMembers::sample(); /*264:printMembers*/
1872918808 }
1873018809
1873118810 /**
@@ -18801,7 +18880,7 @@ class TopLevel {
1880118880 * @return PrivateClass|float|null
1880218881 */
1880318882 public static function samplePrivate(): PrivateClass|float|null {
18804- return PrivateClass::sample(); /*264:private*/
18883+ return PrivateClass::sample(); /*265:private*/
1880518884 }
1880618885
1880718886 /**
@@ -18877,7 +18956,7 @@ class TopLevel {
1887718956 * @return ProtectedClass|float|null
1887818957 */
1887918958 public static function sampleProtected(): ProtectedClass|float|null {
18880- return ProtectedClass::sample(); /*265:protected*/
18959+ return ProtectedClass::sample(); /*266:protected*/
1888118960 }
1888218961
1888318962 /**
@@ -18953,7 +19032,7 @@ class TopLevel {
1895319032 * @return Protocol|float|null
1895419033 */
1895519034 public static function sampleProtocol(): Protocol|float|null {
18956- return Protocol::sample(); /*266:protocol*/
19035+ return Protocol::sample(); /*267:protocol*/
1895719036 }
1895819037
1895919038 /**
@@ -19029,7 +19108,7 @@ class TopLevel {
1902919108 * @return ProtocolClass|float|null
1903019109 */
1903119110 public static function sampleTopLevelProtocol(): ProtocolClass|float|null {
19032- return ProtocolClass::sample(); /*267:topLevelProtocol*/
19111+ return ProtocolClass::sample(); /*268:topLevelProtocol*/
1903319112 }
1903419113
1903519114 /**
@@ -19105,7 +19184,7 @@ class TopLevel {
1910519184 * @return PublicClass|float|null
1910619185 */
1910719186 public static function samplePublic(): PublicClass|float|null {
19108- return PublicClass::sample(); /*268:public*/
19187+ return PublicClass::sample(); /*269:public*/
1910919188 }
1911019189
1911119190 /**
@@ -19181,7 +19260,7 @@ class TopLevel {
1918119260 * @return Quicktype|float|null
1918219261 */
1918319262 public static function sampleQuicktype(): Quicktype|float|null {
19184- return Quicktype::sample(); /*269:quicktype*/
19263+ return Quicktype::sample(); /*270:quicktype*/
1918519264 }
1918619265
1918719266 /**
@@ -19257,7 +19336,7 @@ class TopLevel {
1925719336 * @return Raise|float|null
1925819337 */
1925919338 public static function sampleRaise(): Raise|float|null {
19260- return Raise::sample(); /*270:raise*/
19339+ return Raise::sample(); /*271:raise*/
1926119340 }
1926219341
1926319342 /**
@@ -19333,7 +19412,7 @@ class TopLevel {
1933319412 * @return Range|float|null
1933419413 */
1933519414 public static function sampleRange(): Range|float|null {
19336- return Range::sample(); /*271:range*/
19415+ return Range::sample(); /*272:range*/
1933719416 }
1933819417
1933919418 /**
@@ -19409,7 +19488,7 @@ class TopLevel {
1940919488 * @return ReadonlyClass|float|null
1941019489 */
1941119490 public static function sampleReadonly(): ReadonlyClass|float|null {
19412- return ReadonlyClass::sample(); /*272:readonly*/
19491+ return ReadonlyClass::sample(); /*273:readonly*/
1941319492 }
1941419493
1941519494 /**
@@ -19485,7 +19564,7 @@ class TopLevel {
1948519564 * @return Ref|float|null
1948619565 */
1948719566 public static function sampleRef(): Ref|float|null {
19488- return Ref::sample(); /*273:ref*/
19567+ return Ref::sample(); /*274:ref*/
1948919568 }
1949019569
1949119570 /**
@@ -19561,7 +19640,7 @@ class TopLevel {
1956119640 * @return RegExp|float|null
1956219641 */
1956319642 public static function sampleRegExp(): RegExp|float|null {
19564- return RegExp::sample(); /*274:regExp*/
19643+ return RegExp::sample(); /*275:regExp*/
1956519644 }
1956619645
1956719646 /**
@@ -19637,7 +19716,7 @@ class TopLevel {
1963719716 * @return Register|float|null
1963819717 */
1963919718 public static function sampleRegister(): Register|float|null {
19640- return Register::sample(); /*275:register*/
19719+ return Register::sample(); /*276:register*/
1964119720 }
1964219721
1964319722 /**
@@ -19713,7 +19792,7 @@ class TopLevel {
1971319792 * @return ReinterpretCast|float|null
1971419793 */
1971519794 public static function sampleReinterpretCast(): ReinterpretCast|float|null {
19716- return ReinterpretCast::sample(); /*276:reinterpretCast*/
19795+ return ReinterpretCast::sample(); /*277:reinterpretCast*/
1971719796 }
1971819797
1971919798 /**
@@ -19789,7 +19868,7 @@ class TopLevel {
1978919868 * @return Repeat|float|null
1979019869 */
1979119870 public static function sampleRepeat(): Repeat|float|null {
19792- return Repeat::sample(); /*277:repeat*/
19871+ return Repeat::sample(); /*278:repeat*/
1979319872 }
1979419873
1979519874 /**
@@ -19865,7 +19944,7 @@ class TopLevel {
1986519944 * @return RequireClass|float|null
1986619945 */
1986719946 public static function sampleRequire(): RequireClass|float|null {
19868- return RequireClass::sample(); /*278:require*/
19947+ return RequireClass::sample(); /*279:require*/
1986919948 }
1987019949
1987119950 /**
@@ -19941,7 +20020,7 @@ class TopLevel {
1994120020 * @return Required|float|null
1994220021 */
1994320022 public static function sampleRequired(): Required|float|null {
19944- return Required::sample(); /*279:required*/
20023+ return Required::sample(); /*280:required*/
1994520024 }
1994620025
1994720026 /**
@@ -20017,7 +20096,7 @@ class TopLevel {
2001720096 * @return Requires|float|null
2001820097 */
2001920098 public static function sampleRequires(): Requires|float|null {
20020- return Requires::sample(); /*280:requires*/
20099+ return Requires::sample(); /*281:requires*/
2002120100 }
2002220101
2002320102 /**
@@ -20093,7 +20172,7 @@ class TopLevel {
2009320172 * @return Restrict|float|null
2009420173 */
2009520174 public static function sampleRestrict(): Restrict|float|null {
20096- return Restrict::sample(); /*281:restrict*/
20175+ return Restrict::sample(); /*282:restrict*/
2009720176 }
2009820177
2009920178 /**
@@ -20169,7 +20248,7 @@ class TopLevel {
2016920248 * @return Retain|float|null
2017020249 */
2017120250 public static function sampleRetain(): Retain|float|null {
20172- return Retain::sample(); /*282:retain*/
20251+ return Retain::sample(); /*283:retain*/
2017320252 }
2017420253
2017520254 /**
@@ -20245,7 +20324,7 @@ class TopLevel {
2024520324 * @return Rethrows|float|null
2024620325 */
2024720326 public static function sampleRethrows(): Rethrows|float|null {
20248- return Rethrows::sample(); /*283:rethrows*/
20327+ return Rethrows::sample(); /*284:rethrows*/
2024920328 }
2025020329
2025120330 /**
@@ -20321,7 +20400,7 @@ class TopLevel {
2032120400 * @return ReturnClass|float|null
2032220401 */
2032320402 public static function sampleReturn(): ReturnClass|float|null {
20324- return ReturnClass::sample(); /*284:return*/
20403+ return ReturnClass::sample(); /*285:return*/
2032520404 }
2032620405
2032720406 /**
@@ -20397,7 +20476,7 @@ class TopLevel {
2039720476 * @return Right|float|null
2039820477 */
2039920478 public static function sampleRight(): Right|float|null {
20400- return Right::sample(); /*285:right*/
20479+ return Right::sample(); /*286:right*/
2040120480 }
2040220481
2040320482 /**
@@ -20473,7 +20552,7 @@ class TopLevel {
2047320552 * @return RuntimeType|float|null
2047420553 */
2047520554 public static function sampleRuntimeType(): RuntimeType|float|null {
20476- return RuntimeType::sample(); /*286:runtimeType*/
20555+ return RuntimeType::sample(); /*287:runtimeType*/
2047720556 }
2047820557
2047920558 /**
@@ -20549,7 +20628,7 @@ class TopLevel {
2054920628 * @return S|float|null
2055020629 */
2055120630 public static function sampleS(): S|float|null {
20552- return S::sample(); /*287:s*/
20631+ return S::sample(); /*288:s*/
2055320632 }
2055420633
2055520634 /**
@@ -20625,7 +20704,7 @@ class TopLevel {
2062520704 * @return Sbyte|float|null
2062620705 */
2062720706 public static function sampleSbyte(): Sbyte|float|null {
20628- return Sbyte::sample(); /*288:sbyte*/
20707+ return Sbyte::sample(); /*289:sbyte*/
2062920708 }
2063020709
2063120710 /**
@@ -20701,7 +20780,7 @@ class TopLevel {
2070120780 * @return Sealed|float|null
2070220781 */
2070320782 public static function sampleSealed(): Sealed|float|null {
20704- return Sealed::sample(); /*289:sealed*/
20783+ return Sealed::sample(); /*290:sealed*/
2070520784 }
2070620785
2070720786 /**
@@ -20777,7 +20856,7 @@ class TopLevel {
2077720856 * @return Sel|float|null
2077820857 */
2077920858 public static function sampleSel(): Sel|float|null {
20780- return Sel::sample(); /*290:sel*/
20859+ return Sel::sample(); /*291:sel*/
2078120860 }
2078220861
2078320862 /**
@@ -20853,7 +20932,7 @@ class TopLevel {
2085320932 * @return Select|float|null
2085420933 */
2085520934 public static function sampleSelect(): Select|float|null {
20856- return Select::sample(); /*291:select*/
20935+ return Select::sample(); /*292:select*/
2085720936 }
2085820937
2085920938 /**
@@ -20929,7 +21008,7 @@ class TopLevel {
2092921008 * @return SelfClass|float|null
2093021009 */
2093121010 public static function sampleSelf(): SelfClass|float|null {
20932- return SelfClass::sample(); /*292:self*/
21011+ return SelfClass::sample(); /*293:self*/
2093321012 }
2093421013
2093521014 /**
@@ -21005,7 +21084,7 @@ class TopLevel {
2100521084 * @return UnionSelfSelf|float|null
2100621085 */
2100721086 public static function sampleTopLevelSelf(): UnionSelfSelf|float|null {
21008- return UnionSelfSelf::sample(); /*293:topLevelSelf*/
21087+ return UnionSelfSelf::sample(); /*294:topLevelSelf*/
2100921088 }
2101021089
2101121090 /**
@@ -21081,7 +21160,7 @@ class TopLevel {
2108121160 * @return Sendable|float|null
2108221161 */
2108321162 public static function sampleSendable(): Sendable|float|null {
21084- return Sendable::sample(); /*294:sendable*/
21163+ return Sendable::sample(); /*295:sendable*/
2108521164 }
2108621165
2108721166 /**
@@ -21157,7 +21236,7 @@ class TopLevel {
2115721236 * @return SerialDescriptor|float|null
2115821237 */
2115921238 public static function sampleSerialDescriptor(): SerialDescriptor|float|null {
21160- return SerialDescriptor::sample(); /*295:serialDescriptor*/
21239+ return SerialDescriptor::sample(); /*296:serialDescriptor*/
2116121240 }
2116221241
2116321242 /**
@@ -21233,7 +21312,7 @@ class TopLevel {
2123321312 * @return SerializableClass|float|null
2123421313 */
2123521314 public static function sampleSerializable(): SerializableClass|float|null {
21236- return SerializableClass::sample(); /*296:serializable*/
21315+ return SerializableClass::sample(); /*297:serializable*/
2123721316 }
2123821317
2123921318 /**
@@ -21309,7 +21388,7 @@ class TopLevel {
2130921388 * @return Serialize|float|null
2131021389 */
2131121390 public static function sampleSerialize(): Serialize|float|null {
21312- return Serialize::sample(); /*297:serialize*/
21391+ return Serialize::sample(); /*298:serialize*/
2131321392 }
2131421393
2131521394 /**
@@ -21385,7 +21464,7 @@ class TopLevel {
2138521464 * @return SerializerProvider|float|null
2138621465 */
2138721466 public static function sampleSerializerProvider(): SerializerProvider|float|null {
21388- return SerializerProvider::sample(); /*298:serializerProvider*/
21467+ return SerializerProvider::sample(); /*299:serializerProvider*/
2138921468 }
2139021469
2139121470 /**
@@ -21461,7 +21540,7 @@ class TopLevel {
2146121540 * @return SerialName|float|null
2146221541 */
2146321542 public static function sampleSerialName(): SerialName|float|null {
21464- return SerialName::sample(); /*299:serialName*/
21543+ return SerialName::sample(); /*300:serialName*/
2146521544 }
2146621545
2146721546 /**
@@ -21537,7 +21616,7 @@ class TopLevel {
2153721616 * @return Set|float|null
2153821617 */
2153921618 public static function sampleSet(): Set|float|null {
21540- return Set::sample(); /*300:set*/
21619+ return Set::sample(); /*301:set*/
2154121620 }
2154221621
2154321622 /**
@@ -21613,7 +21692,7 @@ class TopLevel {
2161321692 * @return Short|float|null
2161421693 */
2161521694 public static function sampleShort(): Short|float|null {
21616- return Short::sample(); /*301:short*/
21695+ return Short::sample(); /*302:short*/
2161721696 }
2161821697
2161921698 /**
@@ -21689,7 +21768,7 @@ class TopLevel {
2168921768 * @return Signed|float|null
2169021769 */
2169121770 public static function sampleSigned(): Signed|float|null {
21692- return Signed::sample(); /*302:signed*/
21771+ return Signed::sample(); /*303:signed*/
2169321772 }
2169421773
2169521774 /**
@@ -21765,7 +21844,7 @@ class TopLevel {
2176521844 * @return SimpleModule|float|null
2176621845 */
2176721846 public static function sampleSimpleModule(): SimpleModule|float|null {
21768- return SimpleModule::sample(); /*303:simpleModule*/
21847+ return SimpleModule::sample(); /*304:simpleModule*/
2176921848 }
2177021849
2177121850 /**
@@ -21841,7 +21920,7 @@ class TopLevel {
2184121920 * @return Sizeof|float|null
2184221921 */
2184321922 public static function sampleSizeof(): Sizeof|float|null {
21844- return Sizeof::sample(); /*304:sizeof*/
21923+ return Sizeof::sample(); /*305:sizeof*/
2184521924 }
2184621925
2184721926 /**
@@ -21917,7 +21996,7 @@ class TopLevel {
2191721996 * @return Stackalloc|float|null
2191821997 */
2191921998 public static function sampleStackalloc(): Stackalloc|float|null {
21920- return Stackalloc::sample(); /*305:stackalloc*/
21999+ return Stackalloc::sample(); /*306:stackalloc*/
2192122000 }
2192222001
2192322002 /**
@@ -21993,7 +22072,7 @@ class TopLevel {
2199322072 * @return Standards|float|null
2199422073 */
2199522074 public static function sampleStandards(): Standards|float|null {
21996- return Standards::sample(); /*306:standards*/
22075+ return Standards::sample(); /*307:standards*/
2199722076 }
2199822077
2199922078 /**
@@ -22069,7 +22148,7 @@ class TopLevel {
2206922148 * @return StaticClass|float|null
2207022149 */
2207122150 public static function sampleStatic(): StaticClass|float|null {
22072- return StaticClass::sample(); /*307:static*/
22151+ return StaticClass::sample(); /*308:static*/
2207322152 }
2207422153
2207522154 /**
@@ -22145,7 +22224,7 @@ class TopLevel {
2214522224 * @return StaticAssert|float|null
2214622225 */
2214722226 public static function sampleStaticAssert(): StaticAssert|float|null {
22148- return StaticAssert::sample(); /*308:staticAssert*/
22227+ return StaticAssert::sample(); /*309:staticAssert*/
2214922228 }
2215022229
2215122230 /**
@@ -22221,7 +22300,7 @@ class TopLevel {
2222122300 * @return StaticCast|float|null
2222222301 */
2222322302 public static function sampleStaticCast(): StaticCast|float|null {
22224- return StaticCast::sample(); /*309:staticCast*/
22303+ return StaticCast::sample(); /*310:staticCast*/
2222522304 }
2222622305
2222722306 /**
@@ -22297,7 +22376,7 @@ class TopLevel {
2229722376 * @return StdDeserializer|float|null
2229822377 */
2229922378 public static function sampleStdDeserializer(): StdDeserializer|float|null {
22300- return StdDeserializer::sample(); /*310:stdDeserializer*/
22379+ return StdDeserializer::sample(); /*311:stdDeserializer*/
2230122380 }
2230222381
2230322382 /**
@@ -22373,7 +22452,7 @@ class TopLevel {
2237322452 * @return StdSerializer|float|null
2237422453 */
2237522454 public static function sampleStdSerializer(): StdSerializer|float|null {
22376- return StdSerializer::sample(); /*311:stdSerializer*/
22455+ return StdSerializer::sample(); /*312:stdSerializer*/
2237722456 }
2237822457
2237922458 /**
@@ -22449,7 +22528,7 @@ class TopLevel {
2244922528 * @return Strictfp|float|null
2245022529 */
2245122530 public static function sampleStrictfp(): Strictfp|float|null {
22452- return Strictfp::sample(); /*312:strictfp*/
22531+ return Strictfp::sample(); /*313:strictfp*/
2245322532 }
2245422533
2245522534 /**
@@ -22525,7 +22604,7 @@ class TopLevel {
2252522604 * @return StringClass|float|null
2252622605 */
2252722606 public static function sampleString(): StringClass|float|null {
22528- return StringClass::sample(); /*313:string*/
22607+ return StringClass::sample(); /*314:string*/
2252922608 }
2253022609
2253122610 /**
@@ -22601,7 +22680,7 @@ class TopLevel {
2260122680 * @return Struct|float|null
2260222681 */
2260322682 public static function sampleStruct(): Struct|float|null {
22604- return Struct::sample(); /*314:struct*/
22683+ return Struct::sample(); /*315:struct*/
2260522684 }
2260622685
2260722686 /**
@@ -22677,7 +22756,7 @@ class TopLevel {
2267722756 * @return Subscript|float|null
2267822757 */
2267922758 public static function sampleSubscript(): Subscript|float|null {
22680- return Subscript::sample(); /*315:subscript*/
22759+ return Subscript::sample(); /*316:subscript*/
2268122760 }
2268222761
2268322762 /**
@@ -22753,7 +22832,7 @@ class TopLevel {
2275322832 * @return Super|float|null
2275422833 */
2275522834 public static function sampleSuper(): Super|float|null {
22756- return Super::sample(); /*316:super*/
22835+ return Super::sample(); /*317:super*/
2275722836 }
2275822837
2275922838 /**
@@ -22829,7 +22908,7 @@ class TopLevel {
2282922908 * @return SwitchClass|float|null
2283022909 */
2283122910 public static function sampleSwitch(): SwitchClass|float|null {
22832- return SwitchClass::sample(); /*317:switch*/
22911+ return SwitchClass::sample(); /*318:switch*/
2283322912 }
2283422913
2283522914 /**
@@ -22905,7 +22984,7 @@ class TopLevel {
2290522984 * @return Symbol|float|null
2290622985 */
2290722986 public static function sampleSymbol(): Symbol|float|null {
22908- return Symbol::sample(); /*318:symbol*/
22987+ return Symbol::sample(); /*319:symbol*/
2290922988 }
2291022989
2291122990 /**
@@ -22981,7 +23060,7 @@ class TopLevel {
2298123060 * @return Synchronized|float|null
2298223061 */
2298323062 public static function sampleSynchronized(): Synchronized|float|null {
22984- return Synchronized::sample(); /*319:synchronized*/
23063+ return Synchronized::sample(); /*320:synchronized*/
2298523064 }
2298623065
2298723066 /**
@@ -23057,7 +23136,7 @@ class TopLevel {
2305723136 * @return System|float|null
2305823137 */
2305923138 public static function sampleSystem(): System|float|null {
23060- return System::sample(); /*320:system*/
23139+ return System::sample(); /*321:system*/
2306123140 }
2306223141
2306323142 /**
@@ -23133,7 +23212,7 @@ class TopLevel {
2313323212 * @return Template|float|null
2313423213 */
2313523214 public static function sampleTemplate(): Template|float|null {
23136- return Template::sample(); /*321:template*/
23215+ return Template::sample(); /*322:template*/
2313723216 }
2313823217
2313923218 /**
@@ -23209,7 +23288,7 @@ class TopLevel {
2320923288 * @return Then|float|null
2321023289 */
2321123290 public static function sampleThen(): Then|float|null {
23212- return Then::sample(); /*322:then*/
23291+ return Then::sample(); /*323:then*/
2321323292 }
2321423293
2321523294 /**
@@ -23285,7 +23364,7 @@ class TopLevel {
2328523364 * @return This|float|null
2328623365 */
2328723366 public static function sampleTopLevelThis(): This|float|null {
23288- return This::sample(); /*323:topLevelThis*/
23367+ return This::sample(); /*324:topLevelThis*/
2328923368 }
2329023369
2329123370 /**
@@ -23361,7 +23440,7 @@ class TopLevel {
2336123440 * @return ThreadLocal|float|null
2336223441 */
2336323442 public static function sampleThreadLocal(): ThreadLocal|float|null {
23364- return ThreadLocal::sample(); /*324:threadLocal*/
23443+ return ThreadLocal::sample(); /*325:threadLocal*/
2336523444 }
2336623445
2336723446 /**
@@ -23437,7 +23516,7 @@ class TopLevel {
2343723516 * @return ThrowClass|float|null
2343823517 */
2343923518 public static function sampleThrow(): ThrowClass|float|null {
23440- return ThrowClass::sample(); /*325:throw*/
23519+ return ThrowClass::sample(); /*326:throw*/
2344123520 }
2344223521
2344323522 /**
@@ -23513,7 +23592,7 @@ class TopLevel {
2351323592 * @return Throws|float|null
2351423593 */
2351523594 public static function sampleThrows(): Throws|float|null {
23516- return Throws::sample(); /*326:throws*/
23595+ return Throws::sample(); /*327:throws*/
2351723596 }
2351823597
2351923598 /**
@@ -23589,7 +23668,7 @@ class TopLevel {
2358923668 * @return TimeOnly|float|null
2359023669 */
2359123670 public static function sampleTimeOnly(): TimeOnly|float|null {
23592- return TimeOnly::sample(); /*327:timeOnly*/
23671+ return TimeOnly::sample(); /*328:timeOnly*/
2359323672 }
2359423673
2359523674 /**
@@ -23665,7 +23744,7 @@ class TopLevel {
2366523744 * @return TimeOnlyConverter|float|null
2366623745 */
2366723746 public static function sampleTimeOnlyConverter(): TimeOnlyConverter|float|null {
23668- return TimeOnlyConverter::sample(); /*328:timeOnlyConverter*/
23747+ return TimeOnlyConverter::sample(); /*329:timeOnlyConverter*/
2366923748 }
2367023749
2367123750 /**
@@ -23741,7 +23820,7 @@ class TopLevel {
2374123820 * @return TimeZone|float|null
2374223821 */
2374323822 public static function sampleTimeZone(): TimeZone|float|null {
23744- return TimeZone::sample(); /*329:timeZone*/
23823+ return TimeZone::sample(); /*330:timeZone*/
2374523824 }
2374623825
2374723826 /**
@@ -23817,7 +23896,7 @@ class TopLevel {
2381723896 * @return ToDict|float|null
2381823897 */
2381923898 public static function sampleToDict(): ToDict|float|null {
23820- return ToDict::sample(); /*330:toDict*/
23899+ return ToDict::sample(); /*331:toDict*/
2382123900 }
2382223901
2382323902 /**
@@ -23893,7 +23972,7 @@ class TopLevel {
2389323972 * @return ToJSON|float|null
2389423973 */
2389523974 public static function sampleToJSON(): ToJSON|float|null {
23896- return ToJSON::sample(); /*331:toJSON*/
23975+ return ToJSON::sample(); /*332:toJSON*/
2389723976 }
2389823977
2389923978 /**
@@ -23969,7 +24048,7 @@ class TopLevel {
2396924048 * @return TopLevelClass|float|null
2397024049 */
2397124050 public static function sampleTopLevel(): TopLevelClass|float|null {
23972- return TopLevelClass::sample(); /*332:topLevel*/
24051+ return TopLevelClass::sample(); /*333:topLevel*/
2397324052 }
2397424053
2397524054 /**
@@ -24045,7 +24124,7 @@ class TopLevel {
2404524124 * @return ToString|float|null
2404624125 */
2404724126 public static function sampleToString(): ToString|float|null {
24048- return ToString::sample(); /*333:toString*/
24127+ return ToString::sample(); /*334:toString*/
2404924128 }
2405024129
2405124130 /**
@@ -24121,7 +24200,7 @@ class TopLevel {
2412124200 * @return Transient|float|null
2412224201 */
2412324202 public static function sampleTransient(): Transient|float|null {
24124- return Transient::sample(); /*334:transient*/
24203+ return Transient::sample(); /*335:transient*/
2412524204 }
2412624205
2412724206 /**
@@ -24197,7 +24276,7 @@ class TopLevel {
2419724276 * @return TrueClass|float|null
2419824277 */
2419924278 public static function sampleTrue(): TrueClass|float|null {
24200- return TrueClass::sample(); /*335:true*/
24279+ return TrueClass::sample(); /*336:true*/
2420124280 }
2420224281
2420324282 /**
@@ -24273,7 +24352,7 @@ class TopLevel {
2427324352 * @return UnionTrueTrue|float|null
2427424353 */
2427524354 public static function sampleTopLevelTrue(): UnionTrueTrue|float|null {
24276- return UnionTrueTrue::sample(); /*336:topLevelTrue*/
24355+ return UnionTrueTrue::sample(); /*337:topLevelTrue*/
2427724356 }
2427824357
2427924358 /**
@@ -24349,7 +24428,7 @@ class TopLevel {
2434924428 * @return TryClass|float|null
2435024429 */
2435124430 public static function sampleTry(): TryClass|float|null {
24352- return TryClass::sample(); /*337:try*/
24431+ return TryClass::sample(); /*338:try*/
2435324432 }
2435424433
2435524434 /**
@@ -24425,7 +24504,7 @@ class TopLevel {
2442524504 * @return Type|float|null
2442624505 */
2442724506 public static function sampleType(): Type|float|null {
24428- return Type::sample(); /*338:type*/
24507+ return Type::sample(); /*339:type*/
2442924508 }
2443024509
2443124510 /**
@@ -24501,7 +24580,7 @@ class TopLevel {
2450124580 * @return TypeClass|float|null
2450224581 */
2450324582 public static function sampleTopLevelType(): TypeClass|float|null {
24504- return TypeClass::sample(); /*339:topLevelType*/
24583+ return TypeClass::sample(); /*340:topLevelType*/
2450524584 }
2450624585
2450724586 /**
@@ -24577,7 +24656,7 @@ class TopLevel {
2457724656 * @return Typealias|float|null
2457824657 */
2457924658 public static function sampleTypealias(): Typealias|float|null {
24580- return Typealias::sample(); /*340:typealias*/
24659+ return Typealias::sample(); /*341:typealias*/
2458124660 }
2458224661
2458324662 /**
@@ -24653,7 +24732,7 @@ class TopLevel {
2465324732 * @return Typedef|float|null
2465424733 */
2465524734 public static function sampleTypedef(): Typedef|float|null {
24656- return Typedef::sample(); /*341:typedef*/
24735+ return Typedef::sample(); /*342:typedef*/
2465724736 }
2465824737
2465924738 /**
@@ -24729,7 +24808,7 @@ class TopLevel {
2472924808 * @return Typeid|float|null
2473024809 */
2473124810 public static function sampleTypeid(): Typeid|float|null {
24732- return Typeid::sample(); /*342:typeid*/
24811+ return Typeid::sample(); /*343:typeid*/
2473324812 }
2473424813
2473524814 /**
@@ -24805,7 +24884,7 @@ class TopLevel {
2480524884 * @return Typename|float|null
2480624885 */
2480724886 public static function sampleTypename(): Typename|float|null {
24808- return Typename::sample(); /*343:typename*/
24887+ return Typename::sample(); /*344:typename*/
2480924888 }
2481024889
2481124890 /**
@@ -24881,7 +24960,7 @@ class TopLevel {
2488124960 * @return Typeof|float|null
2488224961 */
2488324962 public static function sampleTypeof(): Typeof|float|null {
24884- return Typeof::sample(); /*344:typeof*/
24963+ return Typeof::sample(); /*345:typeof*/
2488524964 }
2488624965
2488724966 /**
@@ -24957,7 +25036,7 @@ class TopLevel {
2495725036 * @return Uint|float|null
2495825037 */
2495925038 public static function sampleUint(): Uint|float|null {
24960- return Uint::sample(); /*345:uint*/
25039+ return Uint::sample(); /*346:uint*/
2496125040 }
2496225041
2496325042 /**
@@ -25033,7 +25112,7 @@ class TopLevel {
2503325112 * @return Ulong|float|null
2503425113 */
2503525114 public static function sampleUlong(): Ulong|float|null {
25036- return Ulong::sample(); /*346:ulong*/
25115+ return Ulong::sample(); /*347:ulong*/
2503725116 }
2503825117
2503925118 /**
@@ -25109,7 +25188,7 @@ class TopLevel {
2510925188 * @return Unchecked|float|null
2511025189 */
2511125190 public static function sampleUnchecked(): Unchecked|float|null {
25112- return Unchecked::sample(); /*347:unchecked*/
25191+ return Unchecked::sample(); /*348:unchecked*/
2511325192 }
2511425193
2511525194 /**
@@ -25185,7 +25264,7 @@ class TopLevel {
2518525264 * @return Undefined|float|null
2518625265 */
2518725266 public static function sampleUndefined(): Undefined|float|null {
25188- return Undefined::sample(); /*348:undefined*/
25267+ return Undefined::sample(); /*349:undefined*/
2518925268 }
2519025269
2519125270 /**
@@ -25261,7 +25340,7 @@ class TopLevel {
2526125340 * @return UnionClass|float|null
2526225341 */
2526325342 public static function sampleUnion(): UnionClass|float|null {
25264- return UnionClass::sample(); /*349:union*/
25343+ return UnionClass::sample(); /*350:union*/
2526525344 }
2526625345
2526725346 /**
@@ -25337,7 +25416,7 @@ class TopLevel {
2533725416 * @return UnmarshalJSON|float|null
2533825417 */
2533925418 public static function sampleUnmarshalJSON(): UnmarshalJSON|float|null {
25340- return UnmarshalJSON::sample(); /*350:unmarshalJSON*/
25419+ return UnmarshalJSON::sample(); /*351:unmarshalJSON*/
2534125420 }
2534225421
2534325422 /**
@@ -25413,7 +25492,7 @@ class TopLevel {
2541325492 * @return Unowned|float|null
2541425493 */
2541525494 public static function sampleUnowned(): Unowned|float|null {
25416- return Unowned::sample(); /*351:unowned*/
25495+ return Unowned::sample(); /*352:unowned*/
2541725496 }
2541825497
2541925498 /**
@@ -25489,7 +25568,7 @@ class TopLevel {
2548925568 * @return Unsafe|float|null
2549025569 */
2549125570 public static function sampleUnsafe(): Unsafe|float|null {
25492- return Unsafe::sample(); /*352:unsafe*/
25571+ return Unsafe::sample(); /*353:unsafe*/
2549325572 }
2549425573
2549525574 /**
@@ -25565,7 +25644,7 @@ class TopLevel {
2556525644 * @return Unsigned|float|null
2556625645 */
2556725646 public static function sampleUnsigned(): Unsigned|float|null {
25568- return Unsigned::sample(); /*353:unsigned*/
25647+ return Unsigned::sample(); /*354:unsigned*/
2556925648 }
2557025649
2557125650 /**
@@ -25641,7 +25720,7 @@ class TopLevel {
2564125720 * @return UseSerializers|float|null
2564225721 */
2564325722 public static function sampleUseSerializers(): UseSerializers|float|null {
25644- return UseSerializers::sample(); /*354:useSerializers*/
25723+ return UseSerializers::sample(); /*355:useSerializers*/
2564525724 }
2564625725
2564725726 /**
@@ -25717,7 +25796,7 @@ class TopLevel {
2571725796 * @return Ushort|float|null
2571825797 */
2571925798 public static function sampleUshort(): Ushort|float|null {
25720- return Ushort::sample(); /*355:ushort*/
25799+ return Ushort::sample(); /*356:ushort*/
2572125800 }
2572225801
2572325802 /**
@@ -25793,7 +25872,7 @@ class TopLevel {
2579325872 * @return Using|float|null
2579425873 */
2579525874 public static function sampleUsing(): Using|float|null {
25796- return Using::sample(); /*356:using*/
25875+ return Using::sample(); /*357:using*/
2579725876 }
2579825877
2579925878 /**
@@ -25869,7 +25948,7 @@ class TopLevel {
2586925948 * @return Utf8JSONReader|float|null
2587025949 */
2587125950 public static function sampleUtf8JSONReader(): Utf8JSONReader|float|null {
25872- return Utf8JSONReader::sample(); /*357:utf8JSONReader*/
25951+ return Utf8JSONReader::sample(); /*358:utf8JSONReader*/
2587325952 }
2587425953
2587525954 /**
@@ -25945,7 +26024,7 @@ class TopLevel {
2594526024 * @return Utf8JSONWriter|float|null
2594626025 */
2594726026 public static function sampleUtf8JSONWriter(): Utf8JSONWriter|float|null {
25948- return Utf8JSONWriter::sample(); /*358:utf8JSONWriter*/
26027+ return Utf8JSONWriter::sample(); /*359:utf8JSONWriter*/
2594926028 }
2595026029
2595126030 /**
@@ -26021,7 +26100,7 @@ class TopLevel {
2602126100 * @return UUID|float|null
2602226101 */
2602326102 public static function sampleUUID(): UUID|float|null {
26024- return UUID::sample(); /*359:uuid*/
26103+ return UUID::sample(); /*360:uuid*/
2602526104 }
2602626105
2602726106 /**
@@ -26097,7 +26176,7 @@ class TopLevel {
2609726176 * @return VarClass|float|null
2609826177 */
2609926178 public static function sampleVar(): VarClass|float|null {
26100- return VarClass::sample(); /*360:var*/
26179+ return VarClass::sample(); /*361:var*/
2610126180 }
2610226181
2610326182 /**
@@ -26173,7 +26252,7 @@ class TopLevel {
2617326252 * @return Virtual|float|null
2617426253 */
2617526254 public static function sampleVirtual(): Virtual|float|null {
26176- return Virtual::sample(); /*361:virtual*/
26255+ return Virtual::sample(); /*362:virtual*/
2617726256 }
2617826257
2617926258 /**
@@ -26249,7 +26328,7 @@ class TopLevel {
2624926328 * @return VoidClass|float|null
2625026329 */
2625126330 public static function sampleVoid(): VoidClass|float|null {
26252- return VoidClass::sample(); /*362:void*/
26331+ return VoidClass::sample(); /*363:void*/
2625326332 }
2625426333
2625526334 /**
@@ -26325,7 +26404,7 @@ class TopLevel {
2632526404 * @return Volatile|float|null
2632626405 */
2632726406 public static function sampleVolatile(): Volatile|float|null {
26328- return Volatile::sample(); /*363:volatile*/
26407+ return Volatile::sample(); /*364:volatile*/
2632926408 }
2633026409
2633126410 /**
@@ -26401,7 +26480,7 @@ class TopLevel {
2640126480 * @return WcharT|float|null
2640226481 */
2640326482 public static function sampleWcharT(): WcharT|float|null {
26404- return WcharT::sample(); /*364:wcharT*/
26483+ return WcharT::sample(); /*365:wcharT*/
2640526484 }
2640626485
2640726486 /**
@@ -26477,7 +26556,7 @@ class TopLevel {
2647726556 * @return Weak|float|null
2647826557 */
2647926558 public static function sampleWeak(): Weak|float|null {
26480- return Weak::sample(); /*365:weak*/
26559+ return Weak::sample(); /*366:weak*/
2648126560 }
2648226561
2648326562 /**
@@ -26553,7 +26632,7 @@ class TopLevel {
2655326632 * @return Where|float|null
2655426633 */
2655526634 public static function sampleWhere(): Where|float|null {
26556- return Where::sample(); /*366:where*/
26635+ return Where::sample(); /*367:where*/
2655726636 }
2655826637
2655926638 /**
@@ -26629,7 +26708,7 @@ class TopLevel {
2662926708 * @return WhileClass|float|null
2663026709 */
2663126710 public static function sampleWhile(): WhileClass|float|null {
26632- return WhileClass::sample(); /*367:while*/
26711+ return WhileClass::sample(); /*368:while*/
2663326712 }
2663426713
2663526714 /**
@@ -26705,7 +26784,7 @@ class TopLevel {
2670526784 * @return WillSet|float|null
2670626785 */
2670726786 public static function sampleWillSet(): WillSet|float|null {
26708- return WillSet::sample(); /*368:willSet*/
26787+ return WillSet::sample(); /*369:willSet*/
2670926788 }
2671026789
2671126790 /**
@@ -26781,7 +26860,7 @@ class TopLevel {
2678126860 * @return With|float|null
2678226861 */
2678326862 public static function sampleWith(): With|float|null {
26784- return With::sample(); /*369:with*/
26863+ return With::sample(); /*370:with*/
2678526864 }
2678626865
2678726866 /**
@@ -26857,7 +26936,7 @@ class TopLevel {
2685726936 * @return XorClass|float|null
2685826937 */
2685926938 public static function sampleXor(): XorClass|float|null {
26860- return XorClass::sample(); /*370:xor*/
26939+ return XorClass::sample(); /*371:xor*/
2686126940 }
2686226941
2686326942 /**
@@ -26933,7 +27012,7 @@ class TopLevel {
2693327012 * @return XorEq|float|null
2693427013 */
2693527014 public static function sampleXorEq(): XorEq|float|null {
26936- return XorEq::sample(); /*371:xorEq*/
27015+ return XorEq::sample(); /*372:xorEq*/
2693727016 }
2693827017
2693927018 /**
@@ -27009,7 +27088,7 @@ class TopLevel {
2700927088 * @return Yes|float|null
2701027089 */
2701127090 public static function sampleYes(): Yes|float|null {
27012- return Yes::sample(); /*372:yes*/
27091+ return Yes::sample(); /*373:yes*/
2701327092 }
2701427093
2701527094 /**
@@ -27085,7 +27164,7 @@ class TopLevel {
2708527164 * @return YieldClass|float|null
2708627165 */
2708727166 public static function sampleYield(): YieldClass|float|null {
27088- return YieldClass::sample(); /*373:yield*/
27167+ return YieldClass::sample(); /*374:yield*/
2708927168 }
2709027169
2709127170 /**
@@ -27275,6 +27354,7 @@ class TopLevel {
2727527354 || TopLevel::validateLocale($this->locale)
2727627355 || TopLevel::validateLock($this->lock)
2727727356 || TopLevel::validateLong($this->long)
27357+ || TopLevel::validateMakeDictEncoder($this->makeDictEncoder)
2727827358 || TopLevel::validateMap($this->map)
2727927359 || TopLevel::validateMapEntry($this->mapEntry)
2728027360 || TopLevel::validateMarshalJSON($this->marshalJSON)
@@ -27626,6 +27706,7 @@ class TopLevel {
2762627706 $out->{'Locale'} = $this->toLocale();
2762727707 $out->{'lock'} = $this->toLock();
2762827708 $out->{'long'} = $this->toLong();
27709+ $out->{'makeDictEncoder'} = $this->toMakeDictEncoder();
2762927710 $out->{'map'} = $this->toMap();
2763027711 $out->{'MapEntry'} = $this->toMapEntry();
2763127712 $out->{'MarshalJSON'} = $this->toMarshalJSON();
@@ -27979,6 +28060,7 @@ class TopLevel {
2797928060 ,TopLevel::fromLocale($obj->{'Locale'})
2798028061 ,TopLevel::fromLock($obj->{'lock'})
2798128062 ,TopLevel::fromLong($obj->{'long'})
28063+ ,TopLevel::fromMakeDictEncoder($obj->{'makeDictEncoder'})
2798228064 ,TopLevel::fromMap($obj->{'map'})
2798328065 ,TopLevel::fromMapEntry($obj->{'MapEntry'})
2798428066 ,TopLevel::fromMarshalJSON($obj->{'MarshalJSON'})
@@ -28330,6 +28412,7 @@ class TopLevel {
2833028412 ,TopLevel::sampleLocale()
2833128413 ,TopLevel::sampleLock()
2833228414 ,TopLevel::sampleLong()
28415+ ,TopLevel::sampleMakeDictEncoder()
2833328416 ,TopLevel::sampleMap()
2833428417 ,TopLevel::sampleMapEntry()
2833528418 ,TopLevel::sampleMarshalJSON()
@@ -36415,6 +36498,51 @@ class Long {
3641536498 }
3641636499 }
3641736500
36501+// This is an autogenerated file:MakeDictEncoder
36502+
36503+class MakeDictEncoder {
36504+
36505+ /**
36506+ */
36507+ public function __construct() {
36508+ }
36509+
36510+ /**
36511+ * @throws Exception
36512+ * @return bool
36513+ */
36514+ public function validate(): bool {
36515+ return true;
36516+ }
36517+
36518+ /**
36519+ * @return stdClass
36520+ * @throws Exception
36521+ */
36522+ public function to(): stdClass {
36523+ $out = new stdClass();
36524+ return $out;
36525+ }
36526+
36527+ /**
36528+ * @param stdClass $obj
36529+ * @return MakeDictEncoder
36530+ * @throws Exception
36531+ */
36532+ public static function from(stdClass $obj): MakeDictEncoder {
36533+ return new MakeDictEncoder(
36534+ );
36535+ }
36536+
36537+ /**
36538+ * @return MakeDictEncoder
36539+ */
36540+ public static function sample(): MakeDictEncoder {
36541+ return new MakeDictEncoder(
36542+ );
36543+ }
36544+}
36545+
3641836546 // This is an autogenerated file:Map
3641936547
3642036548 class Map {
Mschema-pikedefault / TopLevel.pmod+26 −0
@@ -195,6 +195,7 @@ class TopLevel {
195195 UnionLocale locale; // json: "Locale"
196196 UnionLock lock; // json: "lock"
197197 UnionLong long; // json: "long"
198+ UnionMakeDictEncoder make_dict_encoder; // json: "makeDictEncoder"
198199 UnionMap map; // json: "map"
199200 UnionMapEntry map_entry; // json: "MapEntry"
200201 UnionMarshalJson marshal_json; // json: "MarshalJSON"
@@ -541,6 +542,7 @@ class TopLevel {
541542 "Locale" : locale,
542543 "lock" : lock,
543544 "long" : long,
545+ "makeDictEncoder" : make_dict_encoder,
544546 "map" : map,
545547 "MapEntry" : map_entry,
546548 "MarshalJSON" : marshal_json,
@@ -1074,6 +1076,8 @@ TopLevel TopLevel_from_JSON(mixed json) {
10741076 retval.lock = json["lock"];
10751077 if (arrayp(json["long"])) error("Unexpected array");
10761078 retval.long = json["long"];
1079+ if (arrayp(json["makeDictEncoder"])) error("Unexpected array");
1080+ retval.make_dict_encoder = json["makeDictEncoder"];
10771081 if (arrayp(json["map"])) error("Unexpected array");
10781082 retval.map = json["map"];
10791083 if (arrayp(json["MapEntry"])) error("Unexpected array");
@@ -4744,6 +4748,28 @@ Long Long_from_JSON(mixed json) {
47444748 return retval;
47454749 }
47464750
4751+typedef float|MakeDictEncoder UnionMakeDictEncoder;
4752+
4753+UnionMakeDictEncoder UnionMakeDictEncoder_from_JSON(mixed json) {
4754+ return json;
4755+}
4756+
4757+class MakeDictEncoder {
4758+
4759+ string encode_json() {
4760+ mapping(string:mixed) json = ([
4761+ ]);
4762+
4763+ return Standards.JSON.encode(json);
4764+ }
4765+}
4766+
4767+MakeDictEncoder MakeDictEncoder_from_JSON(mixed json) {
4768+ MakeDictEncoder retval = MakeDictEncoder();
4769+
4770+ return retval;
4771+}
4772+
47474773 typedef float|Map UnionMap;
47484774
47494775 UnionMap UnionMap_from_JSON(mixed json) {
Mschema-pythondefault / quicktype.py+19 −1
@@ -2134,6 +2134,20 @@ class Long:
21342134 return result
21352135
21362136
2137+@dataclass
2138+class MakeDictEncoder:
2139+ pass
2140+
2141+ @staticmethod
2142+ def from_dict(obj: Any) -> 'MakeDictEncoder':
2143+ assert isinstance(obj, dict)
2144+ return MakeDictEncoder()
2145+
2146+ def to_dict(self) -> dict:
2147+ result: dict = {}
2148+ return result
2149+
2150+
21372151 @dataclass
21382152 class Map:
21392153 pass
@@ -5006,6 +5020,7 @@ class TopLevel:
50065020 locale: float | Locale | None = None
50075021 lock: float | Lock | None = None
50085022 long: float | Long | None = None
5023+ make_dict_encoder: float | MakeDictEncoder | None = None
50095024 map: float | Map | None = None
50105025 map_entry: float | MapEntry | None = None
50115026 marshal_json: float | MarshalJSON | None = None
@@ -5353,6 +5368,7 @@ class TopLevel:
53535368 locale = from_union([from_float, Locale.from_dict, from_none], obj.get("Locale"))
53545369 lock = from_union([from_float, Lock.from_dict, from_none], obj.get("lock"))
53555370 long = from_union([from_float, Long.from_dict, from_none], obj.get("long"))
5371+ make_dict_encoder = from_union([from_float, MakeDictEncoder.from_dict, from_none], obj.get("makeDictEncoder"))
53565372 map = from_union([from_float, Map.from_dict, from_none], obj.get("map"))
53575373 map_entry = from_union([from_float, MapEntry.from_dict, from_none], obj.get("MapEntry"))
53585374 marshal_json = from_union([from_float, MarshalJSON.from_dict, from_none], obj.get("MarshalJSON"))
@@ -5514,7 +5530,7 @@ class TopLevel:
55145530 xor_eq = from_union([from_float, XorEq.from_dict, from_none], obj.get("xor_eq"))
55155531 yes = from_union([from_float, Yes.from_dict, from_none], obj.get("YES"))
55165532 top_level_yield = from_union([from_float, Yield.from_dict, from_none], obj.get("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)
5533+ 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, make_dict_encoder, 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)
55185534
55195535 def to_dict(self) -> dict:
55205536 result: dict = {}
@@ -5882,6 +5898,8 @@ class TopLevel:
58825898 result["lock"] = from_union([to_float, lambda x: to_class(Lock, x), from_none], self.lock)
58835899 if self.long is not None:
58845900 result["long"] = from_union([to_float, lambda x: to_class(Long, x), from_none], self.long)
5901+ if self.make_dict_encoder is not None:
5902+ result["makeDictEncoder"] = from_union([to_float, lambda x: to_class(MakeDictEncoder, x), from_none], self.make_dict_encoder)
58855903 if self.map is not None:
58865904 result["map"] = from_union([to_float, lambda x: to_class(Map, x), from_none], self.map)
58875905 if self.map_entry is not None:
Mschema-ruby-syntaxdefault / TopLevel.rb+60 −0
@@ -9253,6 +9253,63 @@ class UnionLong < Dry::Struct
92539253 end
92549254 end
92559255
9256+class MakeDictEncoder < Dry::Struct
9257+
9258+ def self.from_dynamic!(d)
9259+ d = Types::Hash[d]
9260+ new(
9261+ )
9262+ end
9263+
9264+ def self.from_json!(json)
9265+ from_dynamic!(JSON.parse(json))
9266+ end
9267+
9268+ def to_dynamic
9269+ {
9270+ }
9271+ end
9272+
9273+ def to_json(options = nil)
9274+ JSON.generate(to_dynamic, options)
9275+ end
9276+end
9277+
9278+class UnionMakeDictEncoder < Dry::Struct
9279+ attribute :double, Types::Double.optional
9280+ attribute :make_dict_encoder, MakeDictEncoder.optional
9281+
9282+ def self.from_dynamic!(d)
9283+ if schema.key(:double).type.right.valid? d
9284+ return new(double: d, make_dict_encoder: nil)
9285+ end
9286+ begin
9287+ value = MakeDictEncoder.from_dynamic!(d)
9288+ if schema.key(:make_dict_encoder).type.right.valid? value
9289+ return new(make_dict_encoder: value, double: nil)
9290+ end
9291+ rescue
9292+ end
9293+ raise "Invalid union"
9294+ end
9295+
9296+ def self.from_json!(json)
9297+ from_dynamic!(JSON.parse(json))
9298+ end
9299+
9300+ def to_dynamic
9301+ if double != nil
9302+ double
9303+ elsif make_dict_encoder != nil
9304+ make_dict_encoder.to_dynamic
9305+ end
9306+ end
9307+
9308+ def to_json(options = nil)
9309+ JSON.generate(to_dynamic, options)
9310+ end
9311+end
9312+
92569313 class Map < Dry::Struct
92579314
92589315 def self.from_dynamic!(d)
@@ -19696,6 +19753,7 @@ class TopLevel < Dry::Struct
1969619753 attribute :locale, Types.Instance(UnionLocale).optional
1969719754 attribute :lock, Types.Instance(UnionLock).optional
1969819755 attribute :long, Types.Instance(UnionLong).optional
19756+ attribute :make_dict_encoder, Types.Instance(UnionMakeDictEncoder).optional
1969919757 attribute :map, Types.Instance(UnionMap).optional
1970019758 attribute :map_entry, Types.Instance(UnionMapEntry).optional
1970119759 attribute :marshal_json, Types.Instance(UnionMarshalJSON).optional
@@ -20043,6 +20101,7 @@ class TopLevel < Dry::Struct
2004320101 locale: d.key?("Locale") ? UnionLocale.from_dynamic!(d["Locale"]) : nil,
2004420102 lock: d.key?("lock") ? UnionLock.from_dynamic!(d["lock"]) : nil,
2004520103 long: d.key?("long") ? UnionLong.from_dynamic!(d["long"]) : nil,
20104+ make_dict_encoder: d.key?("makeDictEncoder") ? UnionMakeDictEncoder.from_dynamic!(d["makeDictEncoder"]) : nil,
2004620105 map: d.key?("map") ? UnionMap.from_dynamic!(d["map"]) : nil,
2004720106 map_entry: d.key?("MapEntry") ? UnionMapEntry.from_dynamic!(d["MapEntry"]) : nil,
2004820107 marshal_json: d.key?("MarshalJSON") ? UnionMarshalJSON.from_dynamic!(d["MarshalJSON"]) : nil,
@@ -20395,6 +20454,7 @@ class TopLevel < Dry::Struct
2039520454 "Locale" => locale&.to_dynamic,
2039620455 "lock" => lock&.to_dynamic,
2039720456 "long" => long&.to_dynamic,
20457+ "makeDictEncoder" => make_dict_encoder&.to_dynamic,
2039820458 "map" => map&.to_dynamic,
2039920459 "MapEntry" => map_entry&.to_dynamic,
2040020460 "MarshalJSON" => marshal_json&.to_dynamic,
Mschema-rubydefault / TopLevel.rb+60 −0
@@ -9253,6 +9253,63 @@ class UnionLong < Dry::Struct
92539253 end
92549254 end
92559255
9256+class MakeDictEncoder < Dry::Struct
9257+
9258+ def self.from_dynamic!(d)
9259+ d = Types::Hash[d]
9260+ new(
9261+ )
9262+ end
9263+
9264+ def self.from_json!(json)
9265+ from_dynamic!(JSON.parse(json))
9266+ end
9267+
9268+ def to_dynamic
9269+ {
9270+ }
9271+ end
9272+
9273+ def to_json(options = nil)
9274+ JSON.generate(to_dynamic, options)
9275+ end
9276+end
9277+
9278+class UnionMakeDictEncoder < Dry::Struct
9279+ attribute :double, Types::Double.optional
9280+ attribute :make_dict_encoder, MakeDictEncoder.optional
9281+
9282+ def self.from_dynamic!(d)
9283+ if schema.key(:double).type.right.valid? d
9284+ return new(double: d, make_dict_encoder: nil)
9285+ end
9286+ begin
9287+ value = MakeDictEncoder.from_dynamic!(d)
9288+ if schema.key(:make_dict_encoder).type.right.valid? value
9289+ return new(make_dict_encoder: value, double: nil)
9290+ end
9291+ rescue
9292+ end
9293+ raise "Invalid union"
9294+ end
9295+
9296+ def self.from_json!(json)
9297+ from_dynamic!(JSON.parse(json))
9298+ end
9299+
9300+ def to_dynamic
9301+ if double != nil
9302+ double
9303+ elsif make_dict_encoder != nil
9304+ make_dict_encoder.to_dynamic
9305+ end
9306+ end
9307+
9308+ def to_json(options = nil)
9309+ JSON.generate(to_dynamic, options)
9310+ end
9311+end
9312+
92569313 class Map < Dry::Struct
92579314
92589315 def self.from_dynamic!(d)
@@ -19696,6 +19753,7 @@ class TopLevel < Dry::Struct
1969619753 attribute :locale, Types.Instance(UnionLocale).optional
1969719754 attribute :lock, Types.Instance(UnionLock).optional
1969819755 attribute :long, Types.Instance(UnionLong).optional
19756+ attribute :make_dict_encoder, Types.Instance(UnionMakeDictEncoder).optional
1969919757 attribute :map, Types.Instance(UnionMap).optional
1970019758 attribute :map_entry, Types.Instance(UnionMapEntry).optional
1970119759 attribute :marshal_json, Types.Instance(UnionMarshalJSON).optional
@@ -20043,6 +20101,7 @@ class TopLevel < Dry::Struct
2004320101 locale: d.key?("Locale") ? UnionLocale.from_dynamic!(d["Locale"]) : nil,
2004420102 lock: d.key?("lock") ? UnionLock.from_dynamic!(d["lock"]) : nil,
2004520103 long: d.key?("long") ? UnionLong.from_dynamic!(d["long"]) : nil,
20104+ make_dict_encoder: d.key?("makeDictEncoder") ? UnionMakeDictEncoder.from_dynamic!(d["makeDictEncoder"]) : nil,
2004620105 map: d.key?("map") ? UnionMap.from_dynamic!(d["map"]) : nil,
2004720106 map_entry: d.key?("MapEntry") ? UnionMapEntry.from_dynamic!(d["MapEntry"]) : nil,
2004820107 marshal_json: d.key?("MarshalJSON") ? UnionMarshalJSON.from_dynamic!(d["MarshalJSON"]) : nil,
@@ -20395,6 +20454,7 @@ class TopLevel < Dry::Struct
2039520454 "Locale" => locale&.to_dynamic,
2039620455 "lock" => lock&.to_dynamic,
2039720456 "long" => long&.to_dynamic,
20457+ "makeDictEncoder" => make_dict_encoder&.to_dynamic,
2039820458 "map" => map&.to_dynamic,
2039920459 "MapEntry" => map_entry&.to_dynamic,
2040020460 "MarshalJSON" => marshal_json&.to_dynamic,
Mschema-rustdefault / module_under_test.rs+15 −0
@@ -446,6 +446,9 @@ pub struct TopLevel {
446446
447447 pub long: Option<UnionLong>,
448448
449+ #[serde(rename = "makeDictEncoder")]
450+ pub make_dict_encoder: Option<UnionMakeDictEncoder>,
451+
449452 pub map: Option<UnionMap>,
450453
451454 #[serde(rename = "MapEntry")]
@@ -2712,6 +2715,18 @@ pub enum UnionLong {
27122715 pub struct Long {
27132716 }
27142717
2718+#[derive(Debug, Clone, Serialize, Deserialize)]
2719+#[serde(untagged)]
2720+pub enum UnionMakeDictEncoder {
2721+ Double(f64),
2722+
2723+ MakeDictEncoder(MakeDictEncoder),
2724+}
2725+
2726+#[derive(Debug, Clone, Serialize, Deserialize)]
2727+pub struct MakeDictEncoder {
2728+}
2729+
27152730 #[derive(Debug, Clone, Serialize, Deserialize)]
27162731 #[serde(untagged)]
27172732 pub enum UnionMap {
Mschema-schemadefault / TopLevel.schema+19 −0
@@ -552,6 +552,9 @@
552552 "long": {
553553 "$ref": "#/definitions/UnionLong"
554554 },
555+ "makeDictEncoder": {
556+ "$ref": "#/definitions/UnionMakeDictEncoder"
557+ },
555558 "map": {
556559 "$ref": "#/definitions/UnionMap"
557560 },
@@ -2114,6 +2117,11 @@
21142117 "additionalProperties": false,
21152118 "title": "Long"
21162119 },
2120+ "MakeDictEncoder": {
2121+ "type": "object",
2122+ "additionalProperties": false,
2123+ "title": "MakeDictEncoder"
2124+ },
21172125 "Map": {
21182126 "type": "object",
21192127 "additionalProperties": false,
@@ -5114,6 +5122,17 @@
51145122 ],
51155123 "title": "UnionLong"
51165124 },
5125+ "UnionMakeDictEncoder": {
5126+ "anyOf": [
5127+ {
5128+ "$ref": "#/definitions/MakeDictEncoder"
5129+ },
5130+ {
5131+ "type": "number"
5132+ }
5133+ ],
5134+ "title": "UnionMakeDictEncoder"
5135+ },
51175136 "UnionMap": {
51185137 "anyOf": [
51195138 {
Mschema-swiftdefault / quicktype.swift+75 −0
@@ -189,6 +189,7 @@ struct TopLevel: Codable {
189189 let locale: UnionLocale?
190190 let lock: UnionLock?
191191 let long: UnionLong?
192+ let makeDictEncoder: UnionMakeDictEncoder?
192193 let map: UnionMap?
193194 let mapEntry: UnionMapEntry?
194195 let marshalJSON: UnionMarshalJSON?
@@ -534,6 +535,7 @@ struct TopLevel: Codable {
534535 case locale = "Locale"
535536 case lock = "lock"
536537 case long = "long"
538+ case makeDictEncoder = "makeDictEncoder"
537539 case map = "map"
538540 case mapEntry = "MapEntry"
539541 case marshalJSON = "MarshalJSON"
@@ -899,6 +901,7 @@ extension TopLevel {
899901 locale: UnionLocale?? = nil,
900902 lock: UnionLock?? = nil,
901903 long: UnionLong?? = nil,
904+ makeDictEncoder: UnionMakeDictEncoder?? = nil,
902905 map: UnionMap?? = nil,
903906 mapEntry: UnionMapEntry?? = nil,
904907 marshalJSON: UnionMarshalJSON?? = nil,
@@ -1244,6 +1247,7 @@ extension TopLevel {
12441247 locale: locale ?? self.locale,
12451248 lock: lock ?? self.lock,
12461249 long: long ?? self.long,
1250+ makeDictEncoder: makeDictEncoder ?? self.makeDictEncoder,
12471251 map: map ?? self.map,
12481252 mapEntry: mapEntry ?? self.mapEntry,
12491253 marshalJSON: marshalJSON ?? self.marshalJSON,
@@ -11073,6 +11077,77 @@ extension Long {
1107311077 }
1107411078 }
1107511079
11080+enum UnionMakeDictEncoder: Codable {
11081+ case double(Double)
11082+ case makeDictEncoder(MakeDictEncoder)
11083+
11084+ init(from decoder: Decoder) throws {
11085+ let container = try decoder.singleValueContainer()
11086+ if let x = try? container.decode(Double.self) {
11087+ self = .double(x)
11088+ return
11089+ }
11090+ if let x = try? container.decode(MakeDictEncoder.self) {
11091+ self = .makeDictEncoder(x)
11092+ return
11093+ }
11094+ throw DecodingError.typeMismatch(UnionMakeDictEncoder.self, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Wrong type for UnionMakeDictEncoder"))
11095+ }
11096+
11097+ func encode(to encoder: Encoder) throws {
11098+ var container = encoder.singleValueContainer()
11099+ switch self {
11100+ case .double(let x):
11101+ try container.encode(x)
11102+ case .makeDictEncoder(let x):
11103+ try container.encode(x)
11104+ }
11105+ }
11106+}
11107+
11108+// MARK: - MakeDictEncoder
11109+struct MakeDictEncoder: Codable {
11110+ private enum K: String, CodingKey { case unused }
11111+ init(from decoder: Decoder) throws {
11112+ _ = try decoder.container(keyedBy: K.self)
11113+ }
11114+ init() {
11115+ }
11116+}
11117+
11118+// MARK: MakeDictEncoder convenience initializers and mutators
11119+
11120+extension MakeDictEncoder {
11121+ init(data: Data) throws {
11122+ self = try newJSONDecoder().decode(MakeDictEncoder.self, from: data)
11123+ }
11124+
11125+ init(_ json: String, using encoding: String.Encoding = .utf8) throws {
11126+ guard let data = json.data(using: encoding) else {
11127+ throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
11128+ }
11129+ try self.init(data: data)
11130+ }
11131+
11132+ init(fromURL url: URL) throws {
11133+ try self.init(data: try Data(contentsOf: url))
11134+ }
11135+
11136+ func with(
11137+ ) -> MakeDictEncoder {
11138+ return MakeDictEncoder(
11139+ )
11140+ }
11141+
11142+ func jsonData() throws -> Data {
11143+ return try newJSONEncoder().encode(self)
11144+ }
11145+
11146+ func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
11147+ return String(data: try self.jsonData(), encoding: encoding)
11148+ }
11149+}
11150+
1107611151 enum UnionMap: Codable {
1107711152 case double(Double)
1107811153 case map(Map)
Mschema-typescript-effect-schemadefault / TopLevel.ts+4 −0
@@ -499,6 +499,9 @@ export class MapEntry extends S.Class<MapEntry>("MapEntry")(S.Struct({}).pipe(S.
499499 export class Map extends S.Class<Map>("Map")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value)))
500500 ) {}
501501
502+export class MakeDictEncoder extends S.Class<MakeDictEncoder>("MakeDictEncoder")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value)))
503+) {}
504+
502505 export class Long extends S.Class<Long>("Long")(S.Struct({}).pipe(S.filter(value => typeof value === "object" && value !== null && !Array.isArray(value)))
503506 ) {}
504507
@@ -1210,6 +1213,7 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
12101213 "Locale": S.optional(S.Union(S.Number, Locale)),
12111214 "lock": S.optional(S.Union(S.Number, Lock)),
12121215 "long": S.optional(S.Union(S.Number, Long)),
1216+ "makeDictEncoder": S.optional(S.Union(S.Number, MakeDictEncoder)),
12131217 "map": S.optional(S.Union(S.Number, Map)),
12141218 "MapEntry": S.optional(S.Union(S.Number, MapEntry)),
12151219 "MarshalJSON": S.optional(S.Union(S.Number, MarshalJson)),
Mschema-typescript-zoddefault / TopLevel.ts+5 −0
@@ -705,6 +705,10 @@ export const LongSchema = z.object({
705705 });
706706 export type Long = z.infer<typeof LongSchema>;
707707
708+export const MakeDictEncoderSchema = z.object({
709+});
710+export type MakeDictEncoder = z.infer<typeof MakeDictEncoderSchema>;
711+
708712 export const MapSchema = z.object({
709713 });
710714 export type Map = z.infer<typeof MapSchema>;
@@ -1552,6 +1556,7 @@ export const TopLevelSchema = z.preprocess(value => typeof value === "object" &&
15521556 "Locale": z.union([LocaleSchema, z.number()]).optional(),
15531557 "lock": z.union([LockSchema, z.number()]).optional(),
15541558 "long": z.union([LongSchema, z.number()]).optional(),
1559+ "makeDictEncoder": z.union([MakeDictEncoderSchema, z.number()]).optional(),
15551560 "map": z.union([MapSchema, z.number()]).optional(),
15561561 "MapEntry": z.union([MapEntrySchema, z.number()]).optional(),
15571562 "MarshalJSON": z.union([MarshalJsonSchema, z.number()]).optional(),
Mschema-typescriptdefault / TopLevel.ts+6 −2
@@ -190,6 +190,7 @@ export interface TopLevel {
190190 Locale?: UnionLocale;
191191 lock?: UnionLock;
192192 long?: UnionLong;
193+ makeDictEncoder?: UnionMakeDictEncoder;
193194 map?: UnionMap;
194195 MapEntry?: UnionMapEntry;
195196 MarshalJSON?: UnionMarshalJSON;
@@ -784,6 +785,8 @@ export type UnionLock = object | number;
784785
785786 export type UnionLong = object | number;
786787
788+export type UnionMakeDictEncoder = object | number;
789+
787790 export type UnionMap = object | number;
788791
789792 export type UnionMetadataPropertyHandling = object | number;
@@ -1134,7 +1137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
11341137 if (val === null || typeof val !== "object" || Array.isArray(val)) {
11351138 return invalidValue(l(ref || "object"), val, key, parent);
11361139 }
1137- const result: any = {};
1140+ const result: any = Object.create(null);
11381141 Object.getOwnPropertyNames(props).forEach(key => {
11391142 const prop = props[key];
11401143 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -1145,7 +1148,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
11451148 result[key] = transform(val[key], additional, getProps, key, ref);
11461149 }
11471150 });
1148- return result;
1151+ return Object.setPrototypeOf(result, Object.prototype);
11491152 }
11501153
11511154 if (typ === "any") return val;
@@ -1408,6 +1411,7 @@ const typeMap: any = {
14081411 { json: "Locale", js: "Locale", typ: u(undefined, u(m("any"), 3.14)) },
14091412 { json: "lock", js: "lock", typ: u(undefined, u(m("any"), 3.14)) },
14101413 { json: "long", js: "long", typ: u(undefined, u(m("any"), 3.14)) },
1414+ { json: "makeDictEncoder", js: "makeDictEncoder", typ: u(undefined, u(m("any"), 3.14)) },
14111415 { json: "map", js: "map", typ: u(undefined, u(m("any"), 3.14)) },
14121416 { json: "MapEntry", js: "MapEntry", typ: u(undefined, u(m("any"), 3.14)) },
14131417 { json: "MarshalJSON", js: "MarshalJSON", typ: u(undefined, u(m("any"), 3.14)) },
Test case

test/inputs/schema/light.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Test case

test/inputs/schema/list.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/schema/min-max-items.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -114,7 +114,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
114114 if (val === null || typeof val !== "object" || Array.isArray(val)) {
115115 return invalidValue(l(ref || "object"), val, key, parent);
116116 }
117- const result: any = {};
117+ const result: any = Object.create(null);
118118 Object.getOwnPropertyNames(props).forEach(key => {
119119 const prop = props[key];
120120 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
125125 result[key] = transform(val[key], additional, getProps, key, ref);
126126 }
127127 });
128- return result;
128+ return Object.setPrototypeOf(result, Object.prototype);
129129 }
130130
131131 if (typ === "any") return val;
Test case

test/inputs/schema/minmax-integer.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/schema/minmax.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/schema/minmaxlength.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Test case

test/inputs/schema/multi-type-enum.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/schema/mutually-recursive.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/schema/nested-intersection-union.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/schema/non-standard-ref.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/nullable-optional-one-of.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/schema/object-type-required.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/optional-any.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/optional-const-ref.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 if (val === null || typeof val !== "object" || Array.isArray(val)) {
119119 return invalidValue(l(ref || "object"), val, key, parent);
120120 }
121- const result: any = {};
121+ const result: any = Object.create(null);
122122 Object.getOwnPropertyNames(props).forEach(key => {
123123 const prop = props[key];
124124 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
129129 result[key] = transform(val[key], additional, getProps, key, ref);
130130 }
131131 });
132- return result;
132+ return Object.setPrototypeOf(result, Object.prototype);
133133 }
134134
135135 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
118118 if (val === null || typeof val !== "object" || Array.isArray(val)) {
119119 return invalidValue(l(ref || "object"), val, key, parent);
120120 }
121- const result: any = {};
121+ const result: any = Object.create(null);
122122 Object.getOwnPropertyNames(props).forEach(key => {
123123 const prop = props[key];
124124 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
129129 result[key] = transform(val[key], additional, getProps, key, ref);
130130 }
131131 });
132- return result;
132+ return Object.setPrototypeOf(result, Object.prototype);
133133 }
134134
135135 if (typ === "any") return val;
Test case

test/inputs/schema/optional-constraints.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/schema/optional-date-time.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/schema/optional-enum.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/optional-property.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -107,7 +107,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 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
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
107107 if (val === null || typeof val !== "object" || Array.isArray(val)) {
108108 return invalidValue(l(ref || "object"), val, key, parent);
109109 }
110- const result: any = {};
110+ const result: any = Object.create(null);
111111 Object.getOwnPropertyNames(props).forEach(key => {
112112 const prop = props[key];
113113 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
118118 result[key] = transform(val[key], additional, getProps, key, ref);
119119 }
120120 });
121- return result;
121+ return Object.setPrototypeOf(result, Object.prototype);
122122 }
123123
124124 if (typ === "any") return val;
Test case

test/inputs/schema/pattern.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -115,7 +115,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
115115 if (val === null || typeof val !== "object" || Array.isArray(val)) {
116116 return invalidValue(l(ref || "object"), val, key, parent);
117117 }
118- const result: any = {};
118+ const result: any = Object.create(null);
119119 Object.getOwnPropertyNames(props).forEach(key => {
120120 const prop = props[key];
121121 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
126126 result[key] = transform(val[key], additional, getProps, key, ref);
127127 }
128128 });
129- return result;
129+ return Object.setPrototypeOf(result, Object.prototype);
130130 }
131131
132132 if (typ === "any") return val;
Test case

test/inputs/schema/postman-collection.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 if (val === null || typeof val !== "object" || Array.isArray(val)) {
119119 return invalidValue(l(ref || "object"), val, key, parent);
120120 }
121- const result: any = {};
121+ const result: any = Object.create(null);
122122 Object.getOwnPropertyNames(props).forEach(key => {
123123 const prop = props[key];
124124 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
129129 result[key] = transform(val[key], additional, getProps, key, ref);
130130 }
131131 });
132- return result;
132+ return Object.setPrototypeOf(result, Object.prototype);
133133 }
134134
135135 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
118118 if (val === null || typeof val !== "object" || Array.isArray(val)) {
119119 return invalidValue(l(ref || "object"), val, key, parent);
120120 }
121- const result: any = {};
121+ const result: any = Object.create(null);
122122 Object.getOwnPropertyNames(props).forEach(key => {
123123 const prop = props[key];
124124 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
129129 result[key] = transform(val[key], additional, getProps, key, ref);
130130 }
131131 });
132- return result;
132+ return Object.setPrototypeOf(result, Object.prototype);
133133 }
134134
135135 if (typ === "any") return val;
Test case

test/inputs/schema/prefix-items.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/schema/recursive-union-flattening.schema

4 generated files · +27 −9
Mschema-flowdefault / TopLevel.js+2 −2
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 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
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescript-effect-schemadefault / TopLevel.ts+21 −3
@@ -1,13 +1,31 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class XClass extends S.Class<XClass>("XClass")({
5- "x": S.optional(S.Union(S.Array(S.Union(S.Array(S.Any), S.Boolean, S.Number, S.String, S.suspend(() => XClass), S.Null)), S.Boolean, S.Number, S.Record({ key: S.String, value: S.Any}), S.String, S.Null)),
23+ "x": S.optional(S.Union(S.Array(S.Union(S.Array(S.Any), S.Boolean, S.Number, S.String, S.suspend(() => XClass), S.Null)), S.Boolean, S.Number, mapSchema(S.Any), S.String, S.Null)),
624 }) {}
725
826 export class TopLevelClass extends S.Class<TopLevelClass>("TopLevelClass")({
9- "x": S.optional(S.Union(S.Array(S.Union(S.Array(S.Any), S.Boolean, S.Number, S.String, XClass, S.Null)), S.Boolean, S.Number, S.Record({ key: S.String, value: S.Any}), S.String, S.Null)),
27+ "x": S.optional(S.Union(S.Array(S.Union(S.Array(S.Any), S.Boolean, S.Number, S.String, XClass, S.Null)), S.Boolean, S.Number, mapSchema(S.Any), S.String, S.Null)),
1028 }) {}
1129
12-export const TopLevel = S.Union(S.Array(S.Union(S.Array(S.Any), S.Boolean, S.Number, S.String, TopLevelClass, S.Null)), S.Boolean, S.Number, S.Int, S.Record({ key: S.String, value: S.Any}), S.String, S.Null);
30+export const TopLevel = S.Union(S.Array(S.Union(S.Array(S.Any), S.Boolean, S.Number, S.String, TopLevelClass, S.Null)), S.Boolean, S.Number, S.Int, mapSchema(S.Any), S.String, S.Null);
1331 export type TopLevel = S.Schema.Type<typeof TopLevel>;
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -121,7 +121,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
121121 if (val === null || typeof val !== "object" || Array.isArray(val)) {
122122 return invalidValue(l(ref || "object"), val, key, parent);
123123 }
124- const result: any = {};
124+ const result: any = Object.create(null);
125125 Object.getOwnPropertyNames(props).forEach(key => {
126126 const prop = props[key];
127127 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
132132 result[key] = transform(val[key], additional, getProps, key, ref);
133133 }
134134 });
135- return result;
135+ return Object.setPrototypeOf(result, Object.prototype);
136136 }
137137
138138 if (typ === "any") return val;
Test case

test/inputs/schema/ref-id-files.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/ref-remote.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/schema/renaming-bug.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -210,7 +210,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
210210 if (val === null || typeof val !== "object" || Array.isArray(val)) {
211211 return invalidValue(l(ref || "object"), val, key, parent);
212212 }
213- const result: any = {};
213+ const result: any = Object.create(null);
214214 Object.getOwnPropertyNames(props).forEach(key => {
215215 const prop = props[key];
216216 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
221221 result[key] = transform(val[key], additional, getProps, key, ref);
222222 }
223223 });
224- return result;
224+ return Object.setPrototypeOf(result, Object.prototype);
225225 }
226226
227227 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
195195 if (val === null || typeof val !== "object" || Array.isArray(val)) {
196196 return invalidValue(l(ref || "object"), val, key, parent);
197197 }
198- const result: any = {};
198+ const result: any = Object.create(null);
199199 Object.getOwnPropertyNames(props).forEach(key => {
200200 const prop = props[key];
201201 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
206206 result[key] = transform(val[key], additional, getProps, key, ref);
207207 }
208208 });
209- return result;
209+ return Object.setPrototypeOf(result, Object.prototype);
210210 }
211211
212212 if (typ === "any") return val;
Test case

test/inputs/schema/required-draft3.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/required-non-properties.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/schema/required.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/rust-cycle-breaker-union.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -117,7 +117,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Test case

test/inputs/schema/schema-constraints.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -109,7 +109,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
109109 if (val === null || typeof val !== "object" || Array.isArray(val)) {
110110 return invalidValue(l(ref || "object"), val, key, parent);
111111 }
112- const result: any = {};
112+ const result: any = Object.create(null);
113113 Object.getOwnPropertyNames(props).forEach(key => {
114114 const prop = props[key];
115115 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
120120 result[key] = transform(val[key], additional, getProps, key, ref);
121121 }
122122 });
123- return result;
123+ return Object.setPrototypeOf(result, Object.prototype);
124124 }
125125
126126 if (typ === "any") return val;
Test case

test/inputs/schema/simple-ref.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/schema/strict-optional.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/top-level-array.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -111,7 +111,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
111111 if (val === null || typeof val !== "object" || Array.isArray(val)) {
112112 return invalidValue(l(ref || "object"), val, key, parent);
113113 }
114- const result: any = {};
114+ const result: any = Object.create(null);
115115 Object.getOwnPropertyNames(props).forEach(key => {
116116 const prop = props[key];
117117 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
122122 result[key] = transform(val[key], additional, getProps, key, ref);
123123 }
124124 });
125- return result;
125+ return Object.setPrototypeOf(result, Object.prototype);
126126 }
127127
128128 if (typ === "any") return val;
Test case

test/inputs/schema/top-level-enum.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 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
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Test case

test/inputs/schema/top-level-primitive-array.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -105,7 +105,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 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
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
105105 if (val === null || typeof val !== "object" || Array.isArray(val)) {
106106 return invalidValue(l(ref || "object"), val, key, parent);
107107 }
108- const result: any = {};
108+ const result: any = Object.create(null);
109109 Object.getOwnPropertyNames(props).forEach(key => {
110110 const prop = props[key];
111111 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
116116 result[key] = transform(val[key], additional, getProps, key, ref);
117117 }
118118 });
119- return result;
119+ return Object.setPrototypeOf(result, Object.prototype);
120120 }
121121
122122 if (typ === "any") return val;
Test case

test/inputs/schema/top-level-primitive.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -108,7 +108,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
108108 if (val === null || typeof val !== "object" || Array.isArray(val)) {
109109 return invalidValue(l(ref || "object"), val, key, parent);
110110 }
111- const result: any = {};
111+ const result: any = Object.create(null);
112112 Object.getOwnPropertyNames(props).forEach(key => {
113113 const prop = props[key];
114114 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
119119 result[key] = transform(val[key], additional, getProps, key, ref);
120120 }
121121 });
122- return result;
122+ return Object.setPrototypeOf(result, Object.prototype);
123123 }
124124
125125 if (typ === "any") return val;
Test case

test/inputs/schema/tuple.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/unevaluated-properties.schema

5 generated files · +34 −8
Mschema-elmdefault / QuickType.elm+9 −1
@@ -88,7 +88,7 @@ encodeConfig x =
8888 Jenc.object
8989 [ ("closed", makeNullableEncoder encodeClosed x.closed)
9090 , ("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)
9292 ]
9393
9494 closed : Jdec.Decoder Closed
@@ -138,6 +138,14 @@ encodeItem x =
138138
139139 --- encoder helpers
140140
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+
141149 makeNullableEncoder : (a -> Jenc.Value) -> Maybe a -> Jenc.Value
142150 makeNullableEncoder f m =
143151 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
126126 if (val === null || typeof val !== "object" || Array.isArray(val)) {
127127 return invalidValue(l(ref || "object"), val, key, parent);
128128 }
129- const result: any = {};
129+ const result: any = Object.create(null);
130130 Object.getOwnPropertyNames(props).forEach(key => {
131131 const prop = props[key];
132132 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
137137 result[key] = transform(val[key], additional, getProps, key, ref);
138138 }
139139 });
140- return result;
140+ return Object.setPrototypeOf(result, Object.prototype);
141141 }
142142
143143 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescript-effect-schemadefault / TopLevel.ts+19 −1
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321
422 export class Item extends S.Class<Item>("Item")({
523 "key": S.String,
@@ -12,7 +30,7 @@ export class ClosedClass extends S.Class<ClosedClass>("ClosedClass")(S.Struct({}
1230 export class Config extends S.Class<Config>("Config")({
1331 "closed": S.optional(S.Union(S.Array(S.Any), S.Boolean, S.Number, S.Int, S.String, ClosedClass, S.Null)),
1432 "name": S.optional(S.String),
15- "settings": S.optional(S.Record({ key: S.String, value: S.Array(Item)})),
33+ "settings": S.optional(mapSchema(S.Array(Item))),
1634 }) {}
1735
1836 export class TopLevel extends S.Class<TopLevel>("TopLevel")({
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -123,7 +123,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
123123 if (val === null || typeof val !== "object" || Array.isArray(val)) {
124124 return invalidValue(l(ref || "object"), val, key, parent);
125125 }
126- const result: any = {};
126+ const result: any = Object.create(null);
127127 Object.getOwnPropertyNames(props).forEach(key => {
128128 const prop = props[key];
129129 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
134134 result[key] = transform(val[key], additional, getProps, key, ref);
135135 }
136136 });
137- return result;
137+ return Object.setPrototypeOf(result, Object.prototype);
138138 }
139139
140140 if (typ === "any") return val;
Test case

test/inputs/schema/unicode-codepoint-length.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/union-int-double.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -110,7 +110,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
110110 if (val === null || typeof val !== "object" || Array.isArray(val)) {
111111 return invalidValue(l(ref || "object"), val, key, parent);
112112 }
113- const result: any = {};
113+ const result: any = Object.create(null);
114114 Object.getOwnPropertyNames(props).forEach(key => {
115115 const prop = props[key];
116116 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
121121 result[key] = transform(val[key], additional, getProps, key, ref);
122122 }
123123 });
124- return result;
124+ return Object.setPrototypeOf(result, Object.prototype);
125125 }
126126
127127 if (typ === "any") return val;
Test case

test/inputs/schema/union-list.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -113,7 +113,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
113113 if (val === null || typeof val !== "object" || Array.isArray(val)) {
114114 return invalidValue(l(ref || "object"), val, key, parent);
115115 }
116- const result: any = {};
116+ const result: any = Object.create(null);
117117 Object.getOwnPropertyNames(props).forEach(key => {
118118 const prop = props[key];
119119 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
124124 result[key] = transform(val[key], additional, getProps, key, ref);
125125 }
126126 });
127- return result;
127+ return Object.setPrototypeOf(result, Object.prototype);
128128 }
129129
130130 if (typ === "any") return val;
Test case

test/inputs/schema/union.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -112,7 +112,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
112112 if (val === null || typeof val !== "object" || Array.isArray(val)) {
113113 return invalidValue(l(ref || "object"), val, key, parent);
114114 }
115- const result: any = {};
115+ const result: any = Object.create(null);
116116 Object.getOwnPropertyNames(props).forEach(key => {
117117 const prop = props[key];
118118 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
123123 result[key] = transform(val[key], additional, getProps, key, ref);
124124 }
125125 });
126- return result;
126+ return Object.setPrototypeOf(result, Object.prototype);
127127 }
128128
129129 if (typ === "any") return val;
Test case

test/inputs/schema/uuid.schema

3 generated files · +6 −6
Mschema-flowdefault / TopLevel.js+2 −2
@@ -118,7 +118,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
118118 if (val === null || typeof val !== "object" || Array.isArray(val)) {
119119 return invalidValue(l(ref || "object"), val, key, parent);
120120 }
121- const result: any = {};
121+ const result: any = Object.create(null);
122122 Object.getOwnPropertyNames(props).forEach(key => {
123123 const prop = props[key];
124124 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
129129 result[key] = transform(val[key], additional, getProps, key, ref);
130130 }
131131 });
132- return result;
132+ return Object.setPrototypeOf(result, Object.prototype);
133133 }
134134
135135 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 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
117117 if (val === null || typeof val !== "object" || Array.isArray(val)) {
118118 return invalidValue(l(ref || "object"), val, key, parent);
119119 }
120- const result: any = {};
120+ const result: any = Object.create(null);
121121 Object.getOwnPropertyNames(props).forEach(key => {
122122 const prop = props[key];
123123 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
128128 result[key] = transform(val[key], additional, getProps, key, ref);
129129 }
130130 });
131- return result;
131+ return Object.setPrototypeOf(result, Object.prototype);
132132 }
133133
134134 if (typ === "any") return val;
Test case

test/inputs/schema/vega-lite.schema

4 generated files · +35 −17
Mschema-flowdefault / TopLevel.js+2 −2
@@ -6199,7 +6199,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
61996199 if (val === null || typeof val !== "object" || Array.isArray(val)) {
62006200 return invalidValue(l(ref || "object"), val, key, parent);
62016201 }
6202- const result: any = {};
6202+ const result: any = Object.create(null);
62036203 Object.getOwnPropertyNames(props).forEach(key => {
62046204 const prop = props[key];
62056205 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
62106210 result[key] = transform(val[key], additional, getProps, key, ref);
62116211 }
62126212 });
6213- return result;
6213+ return Object.setPrototypeOf(result, Object.prototype);
62146214 }
62156215
62166216 if (typ === "any") return val;
Mschema-javascriptdefault / TopLevel.js+2 −2
@@ -101,7 +101,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
101101 if (val === null || typeof val !== "object" || Array.isArray(val)) {
102102 return invalidValue(l(ref || "object"), val, key, parent);
103103 }
104- const result = {};
104+ const result = Object.create(null);
105105 Object.getOwnPropertyNames(props).forEach(key => {
106106 const prop = props[key];
107107 const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
@@ -112,7 +112,7 @@ function transform(val, typ, getProps, key = '', parent = '') {
112112 result[key] = transform(val[key], additional, getProps, key, ref);
113113 }
114114 });
115- return result;
115+ return Object.setPrototypeOf(result, Object.prototype);
116116 }
117117
118118 if (typ === "any") return val;
Mschema-typescript-effect-schemadefault / TopLevel.ts+29 −11
@@ -1,5 +1,23 @@
11 import * as S from "effect/Schema";
22
3+const objectSchema = <A>() =>
4+ S.declare(
5+ (input): input is Record<string, A> =>
6+ typeof input === "object" && input !== null && !Array.isArray(input)
7+ );
8+const mapSchema = <A, I, R>(value: S.Schema<A, I, R>) => {
9+ const entries = S.transform(objectSchema<unknown>(), S.Array(S.Tuple(S.String, value)), {
10+ strict: false,
11+ decode: Object.entries,
12+ encode: Object.fromEntries
13+ });
14+ return S.transform(entries, objectSchema<A>(), {
15+ strict: false,
16+ decode: Object.fromEntries,
17+ encode: Object.entries
18+ });
19+};
20+
321 // Determines how size calculation should be performed, one of `"content"` or `"padding"`.
422 // The default setting (`"content"`) interprets the width and height settings as the data
523 // rectangle (plotting) dimensions, to which padding is then added. In contrast, the
@@ -642,7 +660,7 @@ export class Projection extends S.Class<Projection>("Projection")({
642660 "fraction": S.optional(S.Number),
643661 "lobes": S.optional(S.Number),
644662 "parallel": S.optional(S.Number),
645- "precision": S.optional(S.Record({ key: S.String, value: S.Union(S.Number, S.String)})),
663+ "precision": S.optional(mapSchema(S.Union(S.Number, S.String))),
646664 "radius": S.optional(S.Number),
647665 "ratio": S.optional(S.Number),
648666 "rotate": S.optional(S.Array(S.Number)),
@@ -789,7 +807,7 @@ export class Header extends S.Class<Header>("Header")({
789807 }) {}
790808
791809 export class SelectionDef extends S.Class<SelectionDef>("SelectionDef")({
792- "bind": S.optional(S.Union(BindEnum, S.Record({ key: S.String, value: S.suspend(() => VgBinding)}))),
810+ "bind": S.optional(S.Union(BindEnum, mapSchema(S.suspend(() => VgBinding)))),
793811 "empty": S.optional(Empty),
794812 "encodings": S.optional(S.Array(SingleDefChannel)),
795813 "fields": S.optional(S.Array(S.String)),
@@ -989,7 +1007,7 @@ export class EncodingWithFacet extends S.Class<EncodingWithFacet>("EncodingWithF
9891007 }) {}
9901008
9911009 export class DataFormat extends S.Class<DataFormat>("DataFormat")({
992- "parse": S.optional(S.Union(ParseEnum, S.Record({ key: S.String, value: S.Any}))),
1010+ "parse": S.optional(S.Union(ParseEnum, mapSchema(S.Any))),
9931011 "type": S.optional(DataFormatType),
9941012 "property": S.optional(S.String),
9951013 "feature": S.optional(S.String),
@@ -999,7 +1017,7 @@ export class DataFormat extends S.Class<DataFormat>("DataFormat")({
9991017 export class Data extends S.Class<Data>("Data")({
10001018 "format": S.optional(DataFormat),
10011019 "url": S.optional(S.String),
1002- "values": S.optional(S.Union(S.Array(S.Union(S.Boolean, S.Number, S.Record({ key: S.String, value: S.Any}), S.String)), S.Record({ key: S.String, value: S.Any}), S.String)),
1020+ "values": S.optional(S.Union(S.Array(S.Union(S.Boolean, S.Number, mapSchema(S.Any), S.String)), mapSchema(S.Any), S.String)),
10031021 "name": S.optional(S.String),
10041022 }) {}
10051023
@@ -1139,7 +1157,7 @@ export class VgBinding extends S.Class<VgBinding>("VgBinding")({
11391157 }) {}
11401158
11411159 export class SingleSelectionConfig extends S.Class<SingleSelectionConfig>("SingleSelectionConfig")({
1142- "bind": S.optional(S.Record({ key: S.String, value: VgBinding})),
1160+ "bind": S.optional(mapSchema(VgBinding)),
11431161 "empty": S.optional(Empty),
11441162 "encodings": S.optional(S.Array(SingleDefChannel)),
11451163 "fields": S.optional(S.Array(S.String)),
@@ -1237,7 +1255,7 @@ export class ProjectionConfig extends S.Class<ProjectionConfig>("ProjectionConfi
12371255 "fraction": S.optional(S.Number),
12381256 "lobes": S.optional(S.Number),
12391257 "parallel": S.optional(S.Number),
1240- "precision": S.optional(S.Record({ key: S.String, value: S.Union(S.Number, S.String)})),
1258+ "precision": S.optional(mapSchema(S.Union(S.Number, S.String))),
12411259 "radius": S.optional(S.Number),
12421260 "ratio": S.optional(S.Number),
12431261 "rotate": S.optional(S.Array(S.Number)),
@@ -1474,14 +1492,14 @@ export class Config extends S.Class<Config>("Config")({
14741492 "padding": S.optional(S.Union(S.Number, PaddingClass)),
14751493 "point": S.optional(MarkConfig),
14761494 "projection": S.optional(ProjectionConfig),
1477- "range": S.optional(S.Record({ key: S.String, value: S.Union(S.Array(S.Union(S.Number, S.String)), VgScheme)})),
1495+ "range": S.optional(mapSchema(S.Union(S.Array(S.Union(S.Number, S.String)), VgScheme))),
14781496 "rect": S.optional(MarkConfig),
14791497 "rule": S.optional(MarkConfig),
14801498 "scale": S.optional(ScaleConfig),
14811499 "selection": S.optional(SelectionConfig),
14821500 "square": S.optional(MarkConfig),
14831501 "stack": S.optional(StackOffset),
1484- "style": S.optional(S.Record({ key: S.String, value: VgMarkConfig})),
1502+ "style": S.optional(mapSchema(VgMarkConfig)),
14851503 "text": S.optional(TextConfig),
14861504 "tick": S.optional(TickConfig),
14871505 "timeFormat": S.optional(S.String),
@@ -1524,7 +1542,7 @@ export class TopLevel extends S.Class<TopLevel>("TopLevel")({
15241542 "name": S.optional(S.String),
15251543 "padding": S.optional(S.Union(S.Number, PaddingClass)),
15261544 "projection": S.optional(Projection),
1527- "selection": S.optional(S.Record({ key: S.String, value: SelectionDef})),
1545+ "selection": S.optional(mapSchema(SelectionDef)),
15281546 "title": S.optional(S.Union(S.String, TitleParams)),
15291547 "transform": S.optional(S.Array(Transform)),
15301548 "width": S.optional(S.Number),
@@ -1550,7 +1568,7 @@ export class Spec extends S.Class<Spec>("Spec")({
15501568 "encoding": S.optional(Encoding),
15511569 "mark": S.optional(S.Union(Mark, MarkDef)),
15521570 "projection": S.optional(Projection),
1553- "selection": S.optional(S.Record({ key: S.String, value: SelectionDef})),
1571+ "selection": S.optional(mapSchema(SelectionDef)),
15541572 "facet": S.optional(FacetMapping),
15551573 "spec": S.optional(S.suspend(() => Spec)),
15561574 "repeat": S.optional(Repeat),
@@ -1571,5 +1589,5 @@ export class LayerSpec extends S.Class<LayerSpec>("LayerSpec")({
15711589 "encoding": S.optional(Encoding),
15721590 "mark": S.optional(S.Union(Mark, MarkDef)),
15731591 "projection": S.optional(Projection),
1574- "selection": S.optional(S.Record({ key: S.String, value: SelectionDef})),
1592+ "selection": S.optional(mapSchema(SelectionDef)),
15751593 }) {}
Mschema-typescriptdefault / TopLevel.ts+2 −2
@@ -5956,7 +5956,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any
59565956 if (val === null || typeof val !== "object" || Array.isArray(val)) {
59575957 return invalidValue(l(ref || "object"), val, key, parent);
59585958 }
5959- const result: any = {};
5959+ const result: any = Object.create(null);
59605960 Object.getOwnPropertyNames(props).forEach(key => {
59615961 const prop = props[key];
59625962 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
59675967 result[key] = transform(val[key], additional, getProps, key, ref);
59685968 }
59695969 });
5970- return result;
5970+ return Object.setPrototypeOf(result, Object.prototype);
59715971 }
59725972
59735973 if (typ === "any") return val;
No generated files match these filters.