Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplication between the User Interface and class #1973

Closed
HCY123902 opened this issue Apr 3, 2023 · 0 comments · Fixed by #2093
Closed

Duplication between the User Interface and class #1973

HCY123902 opened this issue Apr 3, 2023 · 0 comments · Fixed by #2093

Comments

@HCY123902
Copy link
Contributor

HCY123902 commented Apr 3, 2023

What feature(s) would you like to see in RepoSense

As is mentioned in #1965, there are currently a TypeScript interface of User in types/types.ts and a JavaScript class of User in utils/User.ts. The difference between them is that the commits attribute in the interface is optional while it is not in the class. However, as the interface and the class are mostly equivalent, it will be reasonable to remove either of them.

Is the feature request related to a problem?

The interchangeable usage of the User Interface and class implies possible inconsistency.

If possible, describe the solution

Remove either the interface or the class. Removing the class seems to give more advantages considering the runtime.

If applicable, describe alternatives you've considered

Removing the interface may also be reasonable as it may allow more flexibility with class methods in a future context.

Additional context

@jonasongg jonasongg self-assigned this Jan 20, 2024
ckcherry23 pushed a commit that referenced this issue Jan 26, 2024
Remove utils/user.ts, replace with User interface from types.ts

The User class and interface are equivalent in their usage and their
redundancy seems to be a remnant when the code was migrated from JS to
TS.

Let's remove the User class for consistency and to improve runtime
performance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Closed/Completed
Development

Successfully merging a pull request may close this issue.

3 participants