Skip to content

Commit

Permalink
fix(ProjectParser): use data.version if version is not passed
Browse files Browse the repository at this point in the history
  • Loading branch information
RealShadowNova committed Jul 30, 2022
1 parent c053e58 commit e8aaf5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/structures/ProjectParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class ProjectParser {
* Corresponds to the `version` property in your `package.json`
* @since 2.2.0
*/
public readonly version: string | null;
public readonly version: string | null = null;

/**
* An array of class parsers for this project.
Expand Down Expand Up @@ -88,12 +88,12 @@ export class ProjectParser {

this.id = id;
this.name = name;
this.version = version;

if ('classes' in data) {
const { typeDocJsonParserVersion, classes, constants, enums, functions, interfaces, namespaces, typeAliases } = data;

this.typeDocJsonParserVersion = typeDocJsonParserVersion;
this.version = version ?? data.version;
this.classes = classes.map((json) => ClassParser.generateFromJSON(json, this));
this.constants = constants.map((json) => ConstantParser.generateFromJSON(json, this));
this.enums = enums.map((json) => EnumParser.generateFromJSON(json, this));
Expand Down

0 comments on commit e8aaf5c

Please sign in to comment.