ts-class-to-openapi 1.4.2 → 1.4.3
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.cjs +7 -2
- package/dist/index.mjs +7 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -258,14 +258,19 @@ var SchemaTransformer = class SchemaTransformer {
|
|
|
258
258
|
else {
|
|
259
259
|
const heritageClause = classNode.heritageClauses[0];
|
|
260
260
|
if (heritageClause && heritageClause.token === typescript.default.SyntaxKind.ExtendsKeyword) {
|
|
261
|
-
var _symbol$declarations;
|
|
262
261
|
const type = heritageClause.types[0];
|
|
263
262
|
let properties = [];
|
|
264
263
|
let baseProperties = [];
|
|
265
264
|
if (!type) return [];
|
|
266
265
|
const symbol = this.checker.getSymbolAtLocation(type.expression);
|
|
267
266
|
if (!symbol) return [];
|
|
268
|
-
const
|
|
267
|
+
const realSymbol = symbol && symbol.flags & typescript.default.SymbolFlags.Alias ? this.checker.getAliasedSymbol(symbol) : symbol;
|
|
268
|
+
let declaration;
|
|
269
|
+
if (realSymbol && realSymbol.links && realSymbol.links.type && realSymbol.links.type.symbol && realSymbol.links.type.symbol.declarations) declaration = realSymbol.links.type.symbol.declarations[0];
|
|
270
|
+
else {
|
|
271
|
+
var _realSymbol$declarati;
|
|
272
|
+
declaration = realSymbol === null || realSymbol === void 0 || (_realSymbol$declarati = realSymbol.declarations) === null || _realSymbol$declarati === void 0 ? void 0 : _realSymbol$declarati.find(typescript.default.isClassDeclaration);
|
|
273
|
+
}
|
|
269
274
|
if (declaration && typescript.default.isClassDeclaration(declaration)) {
|
|
270
275
|
const newGenericTypeMap = /* @__PURE__ */ new Map();
|
|
271
276
|
if (declaration.typeParameters && type.typeArguments) declaration.typeParameters.forEach((param, index) => {
|
package/dist/index.mjs
CHANGED
|
@@ -233,14 +233,19 @@ var SchemaTransformer = class SchemaTransformer {
|
|
|
233
233
|
else {
|
|
234
234
|
const heritageClause = classNode.heritageClauses[0];
|
|
235
235
|
if (heritageClause && heritageClause.token === ts.SyntaxKind.ExtendsKeyword) {
|
|
236
|
-
var _symbol$declarations;
|
|
237
236
|
const type = heritageClause.types[0];
|
|
238
237
|
let properties = [];
|
|
239
238
|
let baseProperties = [];
|
|
240
239
|
if (!type) return [];
|
|
241
240
|
const symbol = this.checker.getSymbolAtLocation(type.expression);
|
|
242
241
|
if (!symbol) return [];
|
|
243
|
-
const
|
|
242
|
+
const realSymbol = symbol && symbol.flags & ts.SymbolFlags.Alias ? this.checker.getAliasedSymbol(symbol) : symbol;
|
|
243
|
+
let declaration;
|
|
244
|
+
if (realSymbol && realSymbol.links && realSymbol.links.type && realSymbol.links.type.symbol && realSymbol.links.type.symbol.declarations) declaration = realSymbol.links.type.symbol.declarations[0];
|
|
245
|
+
else {
|
|
246
|
+
var _realSymbol$declarati;
|
|
247
|
+
declaration = realSymbol === null || realSymbol === void 0 || (_realSymbol$declarati = realSymbol.declarations) === null || _realSymbol$declarati === void 0 ? void 0 : _realSymbol$declarati.find(ts.isClassDeclaration);
|
|
248
|
+
}
|
|
244
249
|
if (declaration && ts.isClassDeclaration(declaration)) {
|
|
245
250
|
const newGenericTypeMap = /* @__PURE__ */ new Map();
|
|
246
251
|
if (declaration.typeParameters && type.typeArguments) declaration.typeParameters.forEach((param, index) => {
|
package/package.json
CHANGED