반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Tags
- javascript
- 타입 챌린지
- 소켓
- 프로그래머스 레벨 2
- BFS
- 그래프
- Node.js
- 쉬운 문제
- 수학
- 크롤링
- Crawling
- 알고리즘
- HTTP
- 문자열
- HTTP 완벽 가이드
- Nestjs
- ip
- Algorithm
- type challenge
- 백준
- dfs
- dp
- 가천대
- typescript
- 프로그래머스
- 자바스크립트
- 레벨 1
- socket
- TCP
- 타입스크립트
Archives
- Today
- Total
목록2023/12 (2)
kakasoo
Currying, 인자를 커링으로 변경하는 타입
이 정도는 가뿐했다. // your answers type Shift = T extends [infer F, ...infer Rest] ? Rest : never; declare function Currying(fn: T): T extends (...params: infer Params) => infer R ? Params['length'] extends 0 ? () => ReturnType : Params['length'] extends 1 ? (p: Params[0]) => ReturnType : (p: Params[0]) => ReturnType> : never;
프로그래밍/TypeScript
2023. 12. 3. 16:35
타입만으로 클래스의 메서드를 한 번만 호출 가능하게 만들기
type SingletonizeMethod, ExcludeKeys extends keyof T> = { [key in keyof T as key extends ExcludeKeys ? never : key]: T[key] } type OmittedExcute = SingletonizeMethod; class A { execute () : OmittedExcute { return new A(); } additional () : T extends true ? OmittedExcute : A { return new A(); } }
프로그래밍/TypeScript
2023. 12. 3. 15:50