Loading...
00114
CamelCase
type Alphabet = 'a'|'b'|'c'|'d'|'e'|'f'|'g'|'h'|'i'|'j'|'k'|'l'|'m'|'n'|'o'|'p'|'q'|'r'|'s'|'t'|'u'|'v'|'w'|'x'|'y'|'z'; type CanTransToCamel = `_${Alphabet | Uppercase<Alphabet>}` type IsCanTransToCamel<S extends string> = S extends `_${infer First}${infer Rest}` ? `_${First}` extends CanTransToCamel ? true : false : false; type TransToToCamel<S extends string>=IsCanTransToCamel<S> extends true ? S extends `_${infer First}${infer Rest}` ? `${Uppercase<First>}${Rest}` : never : S; type CamelCaseImplement<S extends string, U extends string = ''> = S['length'] extends 0 ? U: IsCanTransToCamel<S> extends true ? TransToToCamel<S> extends `${infer First}${infer Rest}` ? CamelCaseImplement<Rest, `${U}${First}`> : U : S extends `${infer First}${infer Rest}` ? CamelCaseImplement<Rest, `${U}${Lowercase<First>}`> : U type CamelCase<S extends string> = CamelCaseImplement<S>
Link

본 페이지는 상업적 목적이 아닌

개인 포트폴리오 공개용이며

코드는 깃허브에 모두 공개되어 있습니다.

NextJS Typescript react-query @chakra-ui 로 제작되었습니다.