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

[3주차] Medium 2, 3, 8, 9, 10 #9

Open
Choozii opened this issue Aug 21, 2022 · 1 comment
Open

[3주차] Medium 2, 3, 8, 9, 10 #9

Choozii opened this issue Aug 21, 2022 · 1 comment
Assignees

Comments

@Choozii
Copy link
Collaborator

Choozii commented Aug 21, 2022

No description provided.

@Choozii Choozii self-assigned this Aug 21, 2022
@Choozii
Copy link
Collaborator Author

Choozii commented Aug 24, 2022

type MyReturnType = T extends (...args:any) => infer Res? Res : never;

type MyOmit<T, K extends keyof T> = {[P in Exclude<keyof T, K>] : T[P]}

  • Exclude<T,U>는 첫번째 제네릭 타입 T 중에 두번째 제네릭 타입 U와 겹치는 타입을 제외하고 반환

type TupleToObject<T extends readonly any[]> = {
[P in T[number]] : P
}

type Length<T extends readonly string[]> = T["length"]

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

1 participant