Skip to content

Commit

Permalink
chore: changed types to avoid casts everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlementlegen authored and gentlementlegen committed Mar 25, 2024
1 parent 7eda9de commit d8b189e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/parser/content-evaluator-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import OpenAI from "openai";
import configuration from "../configuration/config-reader";
import { OPENAI_API_KEY } from "../configuration/constants";
import { IssueActivity } from "../issue-activity";
import { GitHubIssue } from "../github-types";
import { GithubCommentScore, Module, Result } from "./processor";

/**
Expand All @@ -24,7 +23,7 @@ export class ContentEvaluatorModule implements Module {
for (const key of Object.keys(result)) {
const currentElement = result[key];
const comments = currentElement.comments || [];
const specificationBody = (data.self as GitHubIssue)?.body;
const specificationBody = data.self?.body;

if (specificationBody && comments.length) {
promises.push(this._processComment(comments, specificationBody));
Expand Down
4 changes: 2 additions & 2 deletions src/parser/user-extractor-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ export class UserExtractorModule implements Module {
for (const comment of data.allComments) {
if (comment.user && comment.body && this._checkEntryValidity(comment)) {
const task =
(data.self as GitHubIssue)?.assignee?.id === comment.user.id
data.self?.assignee?.id === comment.user.id
? {
reward: this._extractTaskPrice(data.self as GitHubIssue),
reward: this._extractTaskPrice(data.self),
}
: undefined;
result[comment.user.login] = {
Expand Down

0 comments on commit d8b189e

Please sign in to comment.