Skip to content

Commit

Permalink
feat(EnumPropertyParser): add toString method (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
RealShadowNova committed Sep 12, 2022
1 parent 6a91232 commit defeb42
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/lib/structures/enum-parser/EnumPropertyParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,25 @@ export class EnumPropertyParser extends Parser {
};
}

/**
* Converts this parser to a string representation.
* @since 4.0.0
* @returns The string representation of this parser.
*/
public toString(): string {
return EnumPropertyParser.formatMessage(this);
}

/**
* Formats this type parser to a string.
* @since 4.0.0
* @param parser The parser to format.
* @returns The string representation of this parser.
*/
public static formatMessage = (parser: EnumPropertyParser): string => {
return `${parser.name} = ${parser.value}`;
};

/**
* Generates a new {@link EnumPropertyParser} instance from the given data.
* @since 1.0.0
Expand Down

0 comments on commit defeb42

Please sign in to comment.