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

[2주차] Easy 풀이 #5

Open
sbyeol3 opened this issue Aug 13, 2022 · 2 comments
Open

[2주차] Easy 풀이 #5

sbyeol3 opened this issue Aug 13, 2022 · 2 comments
Assignees

Comments

@sbyeol3
Copy link
Collaborator

sbyeol3 commented Aug 13, 2022

No description provided.

@hyunahOh
Copy link
Collaborator

hyunahOh commented Aug 21, 2022

type MyPick<T, K extends keyof T> = {
  [SpecificKey in K]: T[SpecificKey]
}

type MyReadonly<T> = Readonly <T>

type TupleToObject<T extends readonly PropertyKey[]> = {
  [TIndex in T[number]]: TIndex
}

type First<T extends any[]> = T extends [infer TFirst, …any] ? TFirst : never;

type Length<T extends readonly any[]> = T['length']

type MyExclude<T, U> = T extends U ? never : T;

type MyAwaited<T extends Promise<any>> = T extends Promise<infer Inner> ? 
                  Inner extends Promise<any> ? MyAwaited<Inner> : Inner : never;

type If<C extends boolean, T, F> = C extends true ? T : F

type Concat<T extends any[], U extends any[]> = […T, …U]

[오답] : type Includes<T extends readonly any[], U> = U extends T[number] ? true : false;

type Push<T extends any[], U> = […T, U]

type Unshift<T extends any[], U> = [U, …T]

type MyParameters<T extends ( args: any[]) => any> = T extends (…args: infer F) => any ? F : never

@hyunahOh
Copy link
Collaborator

Includes 공부해오기

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

No branches or pull requests

2 participants