Open
Conversation
Toouren
reviewed
Apr 14, 2021
src/task_1/index.ts
Outdated
| export class MoneyRepository { | ||
| private _repository: any; | ||
| constructor(initialRepository: any) { | ||
| private _repository: Array<object>; |
Contributor
There was a problem hiding this comment.
Object в типизации - страшный грех, также как и any
Toouren
reviewed
Apr 14, 2021
src/task_1/index.ts
Outdated
|
|
||
| this._repository.forEach(i => | ||
| { | ||
| for (let key in i) |
Contributor
There was a problem hiding this comment.
Для обхода массива следует использовать методы массива
Toouren
reviewed
Apr 14, 2021
src/task_1/index.ts
Outdated
| { | ||
| for (let key in i) | ||
| { | ||
| if (i['moneyInfo']['currency']===currency && copy >= i['count'] && (rub.includes(i['count']) || doll.includes(i['count']))) |
Contributor
There was a problem hiding this comment.
Обращаться к объекту через скобки и строчную нотацию следует только в одном случае - когда название поля состоит из нескольких слова, но это полная жесть и так никто не делает
Toouren
reviewed
Apr 14, 2021
src/task_1/index.ts
Outdated
| return copy === 0; | ||
| } | ||
|
|
||
| public money (a: IMoneyUnit, b: IMoneyUnit): number |
Toouren
reviewed
Apr 14, 2021
|
|
||
| public authorize(userId: any, cardId: any, cardPin: any): any { | ||
|
|
||
| public authorize(userId: string, cardId: string, cardPin: string): boolean |
Contributor
There was a problem hiding this comment.
Этот метод всегда возвращает false
Toouren
reviewed
Apr 14, 2021
| { | ||
| return this.registerForUserNewCard(argsForChangeFunction); | ||
| } | ||
| } |
Toouren
reviewed
Apr 14, 2021
src/task_4/index.ts
Outdated
| { | ||
| moneyInfo: | ||
| { | ||
| denomination: (+moneyUnit.moneyInfo.denomination * c).toString(), |
Contributor
There was a problem hiding this comment.
Неявное преобразование - зло
Toouren
reviewed
Apr 14, 2021
src/task_5/index.ts
Outdated
|
|
||
| for (const moneyUnit of moneyUnits) | ||
| { | ||
| const factor = this._currentCard.currency === moneyUnit.moneyInfo.currency ? 1 : (this._currentCard.currency === Currency.RUB ? 70 : (1 / 70)) |
Contributor
There was a problem hiding this comment.
Опять мясо, нужно разбивать такое на более простую логику
Contributor
|
Пока 3 балла только за одну задачу, за все остальные 0
|
m-abrosimov
reviewed
May 26, 2021
| } | ||
| } | ||
| } No newline at end of file | ||
| } |
| } | ||
| } | ||
| } | ||
| } No newline at end of file |
| return false; | ||
| } | ||
| } No newline at end of file | ||
| } |
| return res; | ||
|
|
||
| } | ||
| } No newline at end of file |
|
+8 баллов |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.