osury 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/IRGen.res.mjs +29 -14
package/package.json
CHANGED
package/src/IRGen.res.mjs
CHANGED
|
@@ -139,15 +139,22 @@ function convertToIrTypeDef(namedSchema, schemasDict, tagsDict, skipSchemaSet) {
|
|
|
139
139
|
} else {
|
|
140
140
|
let refName$1 = refName._0;
|
|
141
141
|
let other = schemasDict[refName$1];
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
142
|
+
if (other !== undefined) {
|
|
143
|
+
if (typeof other !== "object" || other._tag !== "Object") {
|
|
144
|
+
payload = convertType(other);
|
|
145
|
+
} else {
|
|
146
|
+
let filtered = other._0.filter(f => f.name !== tagName);
|
|
147
|
+
payload = {
|
|
148
|
+
TAG: "InlineRecord",
|
|
149
|
+
_0: filtered.map(convertField)
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
} else {
|
|
153
|
+
payload = {
|
|
148
154
|
TAG: "Named",
|
|
149
155
|
_0: CodegenHelpers.lcFirst(refName$1)
|
|
150
|
-
}
|
|
156
|
+
};
|
|
157
|
+
}
|
|
151
158
|
}
|
|
152
159
|
return {
|
|
153
160
|
tag: CodegenHelpers.ucFirst(c._tag),
|
|
@@ -203,15 +210,23 @@ function convertToIrTypeDef(namedSchema, schemasDict, tagsDict, skipSchemaSet) {
|
|
|
203
210
|
let tagValue = tagsDict[name];
|
|
204
211
|
let tag = tagValue !== undefined ? CodegenHelpers.ucFirst(tagValue) : CodegenHelpers.ucFirst(name);
|
|
205
212
|
let other = schemasDict[name];
|
|
206
|
-
let payload
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
213
|
+
let payload;
|
|
214
|
+
if (other !== undefined) {
|
|
215
|
+
if (typeof other !== "object" || other._tag !== "Object") {
|
|
216
|
+
payload = convertType(other);
|
|
217
|
+
} else {
|
|
218
|
+
let filtered = other._0.filter(f => f.name !== tagName);
|
|
219
|
+
payload = {
|
|
220
|
+
TAG: "InlineRecord",
|
|
221
|
+
_0: filtered.map(convertField)
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
} else {
|
|
225
|
+
payload = {
|
|
212
226
|
TAG: "Named",
|
|
213
227
|
_0: CodegenHelpers.lcFirst(name)
|
|
214
|
-
}
|
|
228
|
+
};
|
|
229
|
+
}
|
|
215
230
|
return {
|
|
216
231
|
tag: tag,
|
|
217
232
|
payload: payload
|