@openpkg-ts/sdk 0.47.1 → 0.47.2
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/dist/index.js +5 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3213,6 +3213,11 @@ class TypeRegistry {
|
|
|
3213
3213
|
if (type.flags & ts5.TypeFlags.Conditional) {
|
|
3214
3214
|
return { "x-ts-type": renderTypeText(type, checker) };
|
|
3215
3215
|
}
|
|
3216
|
+
const constraint = checker.getBaseConstraintOfType(type);
|
|
3217
|
+
const primitive = constraint && constraint.flags & ts5.TypeFlags.StringLike ? "string" : constraint && constraint.flags & ts5.TypeFlags.NumberLike ? "number" : constraint && constraint.flags & ts5.TypeFlags.BooleanLike ? "boolean" : undefined;
|
|
3218
|
+
if (primitive) {
|
|
3219
|
+
return { type: primitive, "x-ts-type": renderTypeText(type, checker) };
|
|
3220
|
+
}
|
|
3216
3221
|
return this.buildObjectSchemaFromProperties(type, checker, ctx);
|
|
3217
3222
|
}
|
|
3218
3223
|
buildEnumSchema(symbol, checker) {
|