{"id":16972,"date":"2026-07-21T13:26:16","date_gmt":"2026-07-21T04:26:16","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=16972"},"modified":"2026-07-21T13:28:55","modified_gmt":"2026-07-21T04:28:55","slug":"typescript-capitalize%ec%97%90-%eb%8c%80%ed%95%98%ec%97%ac","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=16972","title":{"rendered":"TypeScript, Capitalize\uc5d0 \ub300\ud558\uc5ec"},"content":{"rendered":"<p>Capitalize\uc758 \uc0ac\uc6a9 \uc608\uc2dc \ucf54\ub4dc\ub85c \ub2e4\uc74c\uc774 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">\r\ntype Getters&lt;Type> = {\r\n  [Property in keyof Type as `get${Capitalize&lt;string & Property>}`]: () => Type[Property]\r\n};\r\n\r\ninterface Person {\r\n  name: string;\r\n  age: number;\r\n  location: string;\r\n}\r\n\r\ntype LazyPerson = Getters&lt;Person>;\r\n<\/pre>\n<p>\uc704\uc758 \ucf54\ub4dc\ub294 LazyPerson\uc5d0 \ub300\ud55c \ud0c0\uc785\uc744 \ub2e4\uc74c\ucc98\ub7fc \uc790\ub3d9\uc73c\ub85c \uad6c\uc131\ud574 \uc90d\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">\r\ntype LazyPerson = {\r\n  getName: () => string;\r\n  getAge: () => number;\r\n  getLocation: () => string;\r\n}\r\n<\/pre>\n<p>\uc704\uc758 \ucf54\ub4dc\uc5d0\uc11c \uc124\uba85\ud560 \ub0b4\uc6a9\uc774 \uc0b0\ub354\ubbf8 \uac19\uc9c0\ub9cc \uc77c\ub2e8 \uc9d1\uc911\ud558\uace0\uc790 \ud558\ub294 \uac83\uc740 Capitalize \uc785\ub2c8\ub2e4. Capitalize\ub294 TypeScript\ub85c \uc791\uc131\ub418\uc9c0 \uc54a\uc740 Native \ucf54\ub4dc\uc785\ub2c8\ub2e4. Capitalize\uac00 Native\ub85c \uc791\uc131\ub418\uc5c8\uc9c0\ub9cc TypeScript\ub85c\ub3c4 \uc791\uc131\ub420 \uc218 \uc788\ub294\ub370\uc694. TypeScript\ub85c \uc791\uc131\ub41c Capitalize\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">\r\ntype UpperMap = {\r\n  a: \"A\";\r\n  b: \"B\";\r\n  c: \"C\";\r\n  d: \"D\";\r\n  e: \"E\";\r\n  f: \"F\";\r\n  g: \"G\";\r\n  h: \"H\";\r\n  i: \"I\";\r\n  j: \"J\";\r\n  k: \"K\";\r\n  l: \"L\";\r\n  m: \"M\";\r\n  n: \"N\";\r\n  o: \"O\";\r\n  p: \"P\";\r\n  q: \"Q\";\r\n  r: \"R\";\r\n  s: \"S\";\r\n  t: \"T\";\r\n  u: \"U\";\r\n  v: \"V\";\r\n  w: \"W\";\r\n  x: \"X\";\r\n  y: \"Y\";\r\n  z: \"Z\";\r\n};\r\n\r\ntype MyCapitalize&lt;S extends string> =\r\n  S extends `${infer First}${infer Rest}`\r\n  ? `${First extends keyof UpperMap ? UpperMap[First] : First}${Rest}`\r\n  : S;\r\n\r\ntype A = MyCapitalize&lt;\"hello\">;      \/\/ \"Hello\"\r\ntype B = MyCapitalize&lt;\"typescript\">; \/\/ \"Typescript\"\r\ntype C = MyCapitalize&lt;\"\uc548\ub155?\">;     \/\/ \"\uc548\ub155\"\r\ntype D = MyCapitalize&lt;\"Hello\">;      \/\/ \"Hello\"\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Capitalize\uc758 \uc0ac\uc6a9 \uc608\uc2dc \ucf54\ub4dc\ub85c \ub2e4\uc74c\uc774 \uc788\uc2b5\ub2c8\ub2e4. type Getters&lt;Type> = { [Property in keyof Type as `get${Capitalize&lt;string &#038; Property>}`]: () => Type[Property] }; interface Person { name: string; age: number; location: string; } type LazyPerson = Getters&lt;Person>; \uc704\uc758 \ucf54\ub4dc\ub294 LazyPerson\uc5d0 \ub300\ud55c \ud0c0\uc785\uc744 \ub2e4\uc74c\ucc98\ub7fc \uc790\ub3d9\uc73c\ub85c \uad6c\uc131\ud574 \uc90d\ub2c8\ub2e4. type LazyPerson = { getName: () => string; getAge: () &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=16972\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;TypeScript, Capitalize\uc5d0 \ub300\ud558\uc5ec&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[157],"tags":[],"class_list":["post-16972","post","type-post","status-publish","format-standard","hentry","category-typescript"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/16972","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16972"}],"version-history":[{"count":7,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/16972\/revisions"}],"predecessor-version":[{"id":16978,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/16972\/revisions\/16978"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16972"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}