UNPKG

ts-json-schema-generator

Version:

Generate JSON schema from your Typescript sources

23 lines (18 loc) 449 B
import { BaseType } from "./BaseType.js"; export class DefinitionType extends BaseType { public constructor( private name: string | undefined, private type: BaseType, ) { super(); } public getId(): string { return `def-${this.type.getId()}`; } public getName(): string { return this.name || super.getName(); } public getType(): BaseType { return this.type; } }