Skip to content

Воробьев #14

Open
garche wants to merge 1 commit into
RTF-Angular-2021:masterfrom
garche:master
Open

Воробьев #14
garche wants to merge 1 commit into
RTF-Angular-2021:masterfrom
garche:master

Conversation

@garche
Copy link
Copy Markdown

@garche garche commented Apr 1, 2021

No description provided.

Comment thread src/task_2/index.ts
{
return array.filter((x): x is FirstType | SecondType | ThirdType => typeof x === type);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Работать не будет, т.к. в рантайме у x будет тип Object => ни один объект не попадет результирующий массив

Comment thread src/task_1/index.ts
numbersOrDatesArrayProp: Array<number | Date>,
functionProp(flag: boolean): void,
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачтено на 3 балла

Comment thread src/task_3/index.ts
{
return x+y;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачтено на 3 балла

Comment thread src/task_4/index.ts
* interface можно изменять и расширять, при создании нового interface с уже использованным именем они сольются
* в один, interface представляет именнованный тип объекта
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачтено на 3 балла

Comment thread src/task_5/index.ts
export function filterUsers(persons: Person[], criteria: {type?: string, name?: string, age?: number, occupation?: string}): User[] {
return persons.filter(isUser).filter((user) => {
const criteriaKeys = Object.keys(criteria);
return criteriaKeys.every((fieldName) => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачтено на 3 балла

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants