Skip to content

Commit

Permalink
refactor: use PullRequestApi in PullRequest class
Browse files Browse the repository at this point in the history
  • Loading branch information
jamacku committed Nov 8, 2023
1 parent 56379fd commit a392372
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions dist/pull-request.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/pull-request.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/schema/pull-request.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/schema/pull-request.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/schema/pull-request.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/pull-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ export class PullRequest {
readonly number: number;
readonly url: string;

title = '';
targetBranch = '';
title: PullRequestApi['title'] = '';
targetBranch: PullRequestApi['base'] = '';
mergeable: PullRequestApi['mergeable'] = null;
mergeableState = 'unknown';
draft: boolean | undefined;
currentLabels: string[] = [];
mergeableState: PullRequestApi['mergeable_state'] = 'unknown';
draft: PullRequestApi['draft'];
currentLabels: PullRequestApi['labels'] = [];

constructor(
metadata: PullRequestMetadata,
Expand Down
2 changes: 1 addition & 1 deletion src/schema/pull-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const pullRequestApiSchema = z.object({
labels: z.array(
z.object({ name: z.string() }).transform(label => label.name)
),
draft: z.boolean(),
draft: z.boolean().optional(),
merged: z.boolean(),
mergeable: z.boolean().nullable(),
mergeable_state: z.string(),
Expand Down

0 comments on commit a392372

Please sign in to comment.