Skip to content

Commit

Permalink
fixes jsdoc issues
Browse files Browse the repository at this point in the history
  • Loading branch information
NetOpWibby committed Nov 19, 2024
1 parent dafa66c commit 4318ce9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"exports": "./mod.ts",
"license": "MIT",
"name": "@chronver/chronver",
"version": "1.0.1"
"version": "1.0.2"
}
20 changes: 10 additions & 10 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
//// export

export class ChronVer {
/** changeset number (0 if not specified) **/
/** changeset number (0 if not specified) */
readonly changeset: number;
/** day component (1-31) **/
/** day component (1-31) */
readonly day: number;
/** feature name (if specified) **/
/** feature name (if specified) */
readonly feature?: string;
/** whether this is a breaking change **/
/** whether this is a breaking change */
readonly isBreaking: boolean;
/** month component (1-12) **/
/** month component (1-12) */
readonly month: number;
/** year component **/
/** year component */
readonly year: number;

/** Creates a new version **/
/** Creates a new version */
constructor(version: string) {
const regex = /^(\d{4})\.(?:0[1-9]|1[0-2])\.(?:0[1-9]|[12]\d|3[01])(?:\.(\d+))?(?:-(break|[a-zA-Z0-9-]+)(?:\.(\d+))?)?$/;
const match = version.match(regex);
Expand All @@ -44,7 +44,7 @@ export class ChronVer {

/// methods

/** Compares versions **/
/** Compares versions */
compare(other: ChronVer): number {
const dateComparison = [
this.year - other.year,
Expand All @@ -63,7 +63,7 @@ export class ChronVer {
return 0;
}

/** Outputs a version in string format **/
/** Outputs a version in string format */
toString(): string {
const base = `${this.year}.${String(this.month).padStart(2, "0")}.${String(this.day).padStart(2, "0")}`;
const changesetStr = this.changeset > 0 ? `.${this.changeset}` : "";
Expand All @@ -75,7 +75,7 @@ export class ChronVer {

/// private method

/** Validates version **/
/** Validates version */
private validate(): void {
if (this.year < 1)
throw new Error("Year must be positive");
Expand Down

0 comments on commit 4318ce9

Please sign in to comment.