@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.
Files changed (2) hide show
  1. package/dist/index.js +5 -0
  2. 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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openpkg-ts/sdk",
3
- "version": "0.47.1",
3
+ "version": "0.47.2",
4
4
  "description": "TypeScript API extraction SDK - programmatic primitives for OpenPkg specs",
5
5
  "keywords": [
6
6
  "openpkg",