TypeScript 型の課題集


English | 简体中文 | 日本語 | 한국어

## はじめに

TypeScript のチューリング完全な型システムの力で

高品質な型は潜在的なバグを回避しつつ、プロジェクトの保守性を向上させるのに役立ちます。 TypeScriptには [ts-toolbelt](https://github.com/millsp/ts-toolbelt), [utility-types](https://github.com/piotrwitek/utility-types), [simplytyped](https://github.com/andnp/simplytyped) など優れた型ユーティリティライブラリがあり、私たちは多くの後押しを得ているはずです。 このプロジェクトは、型システムがどのように動作するのかを理解したり、独自の型ユーティリティを書いたり、課題へのチャレンジを楽しむことをサポートします。また、実際の業務で直面した問題を質問したり、その答えを得られるコミュニティを作りたいと考えています。 - そこでの問題が課題集に追加されるかもしれません! ## 課題集 > 以下のバッジをクリックすると、課題の詳細が表示されます。 1
13・Hello World

13
4・Pick 7・Readonly 11・Tuple to Object 14・First of Array 18・Length of Tuple 43・Exclude 189・Awaited 268・If 533・Concat 898・Includes 3057・Push 3060・Unshift 3312・Parameters

97
2・Get Return Type 3・Omit 8・Readonly 2 9・Deep Readonly 10・Tuple to Union 12・Chainable Options 15・Last of Array 16・Pop 20・Promise.all 62・Type Lookup 106・Trim Left 108・Trim 110・Capitalize 116・Replace 119・ReplaceAll 191・Append Argument 296・Permutation 298・Length of String 459・Flatten 527・Append to object 529・Absolute 531・String to Union 599・Merge 612・KebabCase 645・Diff 949・AnyOf 1042・IsNever 1097・IsUnion 1130・ReplaceKeys 1367・Remove Index Signature 1978・Percentage Parser 2070・Drop Char 2257・MinusOne 2595・PickByType 2688・StartsWith 2693・EndsWith 2757・PartialByKeys 2759・RequiredByKeys 2793・Mutable 2852・OmitByType 2946・ObjectEntries 3062・Shift 3188・Tuple to Nested Object 3192・Reverse 3196・Flip Arguments 3243・FlattenDepth 3326・BEM style string 3376・InorderTraversal 4179・Flip 4182・Fibonacci Sequence 4260・文字の組み合わせ 4425・Greater Than 4471・Zip 4484・IsTuple 4499・Chunk 4518・Fill 4803・Trim Right 5117・Without 5140・Trunc 5153・IndexOf 5310・Join 5317・LastIndexOf 5360・Unique 5821・MapTypes 7544・Construct Tuple 8640・Number Range 8767・Combination 8987・Subsequence 9142・CheckRepeatedChars 9286・FirstUniqueCharIndex 9616・Parse URL Params 9896・GetMiddleElement 9898・Appear only once 9989・Count Element Number To Object 10969・Integer 16259・ToPrimitive 17973・DeepMutable 18142・All 18220・Filter 21104・FindAll 21106・Combination key type 21220・Permutations of Tuple 25170・Replace First 25270・Transpose 26401・JSON Schema to TypeScript 27133・Square 27152・Triangular number 27862・CartesianProduct 27932・MergeAll 27958・CheckRepeatedTuple 28333・Public Type 29650・ExtractToObject 29785・Deep Omit 30301・IsOdd 30430・Tower of hanoi 30958・Pascal's triangle 30970・確定した文字列リテラル

49
6・Simple Vue 17・Currying 1 55・Union to Intersection 57・Get Required 59・Get Optional 89・Required Keys 90・Optional Keys 112・Capitalize Words 114・CamelCase 147・C-printf Parser 213・Vue Basic Props 223・IsAny 270・Typed Get 300・String to Number 399・Tuple Filter 472・Tuple to Enum Object 545・printf 553・Deep object to unique 651・Length of String 2 730・Union to Tuple 847・String Join 956・DeepPick 1290・Pinia 1383・Camelize 2059・Drop String 2822・Split 2828・ClassPublicKeys 2857・IsRequiredKey 2949・ObjectFromEntries 4037・IsPalindrome 5181・Mutable Keys 5423・Intersection 6141・Binary to Decimal 7258・Object Key Paths 8804・Two Sum 9155・ValidDate 9160・Assign 9384・Maximum 9775・Capitalize Nest Object Keys 13580・Replace Union 14080・FizzBuzz 14188・Run-length encoding 15260・Tree path array 19458・SnakeCase 25747・IsNegativeNumber 28143・OptionalUndefined 30575・BitwiseXOR 32427・Unbox 32532・Binary Addition

15
5・Get Readonly Keys 151・Query String Parser 216・Slice 274・Integers Comparator 462・Currying 2 476・Sum 517・Multiply 697・Tag 734・Inclusive Range 741・Sort 869・DistributeUnions 925・Assert Array Index 6228・JSON Parser 7561・Subtract 31447・CountReversePairs
タグ別
#JSON26401・JSON Schema to TypeScript
#application12・Chainable Options 8767・Combination 6・Simple Vue 213・Vue Basic Props
#arguments191・Append Argument 3196・Flip Arguments
#array14・First of Array 533・Concat 898・Includes 3057・Push 3060・Unshift 15・Last of Array 16・Pop 20・Promise.all 459・Flatten 949・AnyOf 3062・Shift 3243・FlattenDepth 4425・Greater Than 5117・Without 5153・IndexOf 5310・Join 5317・LastIndexOf 5360・Unique 8767・Combination 18142・All 18220・Filter 25270・Transpose 27133・Square 27152・Triangular number 27932・MergeAll 30430・Tower of hanoi 30958・Pascal's triangle 17・Currying 1 2822・Split 5423・Intersection 8804・Two Sum 9160・Assign 9384・Maximum 9775・Capitalize Nest Object Keys 14080・FizzBuzz 32427・Unbox 32532・Binary Addition 216・Slice 734・Inclusive Range 741・Sort 925・Assert Array Index
#built-in4・Pick 7・Readonly 43・Exclude 189・Awaited 3312・Parameters 2・Get Return Type 3・Omit
#conditional type21220・Permutations of Tuple
#deep9・Deep Readonly 17973・DeepMutable 553・Deep object to unique 956・DeepPick
#filter18220・Filter
#function32427・Unbox
#infer3312・Parameters 2・Get Return Type 10・Tuple to Union 2070・Drop Char 4260・文字の組み合わせ 9616・Parse URL Params 55・Union to Intersection 57・Get Required 59・Get Optional 399・Tuple Filter 730・Union to Tuple 2059・Drop String 14080・FizzBuzz 734・Inclusive Range 741・Sort
#json6228・JSON Parser
#map62・Type Lookup 5821・MapTypes
#math529・Absolute 2257・MinusOne 25270・Transpose 27133・Square 27152・Triangular number 30958・Pascal's triangle 6141・Binary to Decimal 8804・Two Sum 14080・FizzBuzz 274・Integers Comparator 476・Sum 517・Multiply
#number25747・IsNegativeNumber
#object599・Merge 645・Diff 2595・PickByType 2757・PartialByKeys 2759・RequiredByKeys 2852・OmitByType 2946・ObjectEntries 3188・Tuple to Nested Object 3376・InorderTraversal 4179・Flip 5821・MapTypes 27932・MergeAll 29650・ExtractToObject 2949・ObjectFromEntries 9160・Assign 9775・Capitalize Nest Object Keys
#object-keys7・Readonly 11・Tuple to Object 8・Readonly 2 9・Deep Readonly 527・Append to object 1130・ReplaceKeys 1367・Remove Index Signature 2793・Mutable 28333・Public Type 7258・Object Key Paths 5・Get Readonly Keys
#omit object-keys deep29785・Deep Omit
#promise189・Awaited 20・Promise.all 32427・Unbox
#readonly7・Readonly 8・Readonly 2 9・Deep Readonly 2793・Mutable 17973・DeepMutable
#recursion21220・Permutations of Tuple 1383・Camelize 32532・Binary Addition
#split2822・Split
#string531・String to Union 8767・Combination 9142・CheckRepeatedChars 9286・FirstUniqueCharIndex 9616・Parse URL Params 21104・FindAll 30301・IsOdd 2822・Split 4037・IsPalindrome 19458・SnakeCase
#template literal25747・IsNegativeNumber
#template-literal106・Trim Left 108・Trim 110・Capitalize 116・Replace 119・ReplaceAll 298・Length of String 529・Absolute 612・KebabCase 1978・Percentage Parser 2070・Drop Char 2688・StartsWith 2693・EndsWith 3326・BEM style string 4260・文字の組み合わせ 4803・Trim Right 5140・Trunc 9616・Parse URL Params 10969・Integer 21104・FindAll 112・Capitalize Words 114・CamelCase 147・C-printf Parser 270・Typed Get 300・String to Number 472・Tuple to Enum Object 545・printf 651・Length of String 2 2059・Drop String 19458・SnakeCase 151・Query String Parser 274・Integers Comparator 476・Sum 517・Multiply 6228・JSON Parser
#this6・Simple Vue 1290・Pinia
#tuple18・Length of Tuple 3312・Parameters 10・Tuple to Union 3188・Tuple to Nested Object 3192・Reverse 3326・BEM style string 4471・Zip 4484・IsTuple 4499・Chunk 4518・Fill 7544・Construct Tuple 21220・Permutations of Tuple 27133・Square 27152・Triangular number 399・Tuple Filter 472・Tuple to Enum Object 730・Union to Tuple 2822・Split 32427・Unbox 7561・Subtract
#union4・Pick 43・Exclude 3・Omit 10・Tuple to Union 62・Type Lookup 296・Permutation 531・String to Union 1042・IsNever 1097・IsUnion 3326・BEM style string 4260・文字の組み合わせ 5117・Without 8987・Subsequence 9142・CheckRepeatedChars 21220・Permutations of Tuple 27862・CartesianProduct 27932・MergeAll 730・Union to Tuple 1383・Camelize 5423・Intersection
#utils268・If 1042・IsNever 5821・MapTypes 55・Union to Intersection 57・Get Required 59・Get Optional 89・Required Keys 90・Optional Keys 223・IsAny 270・Typed Get 2828・ClassPublicKeys 2857・IsRequiredKey 5181・Mutable Keys 32427・Unbox 5・Get Readonly Keys
#vue6・Simple Vue 213・Vue Basic Props 1290・Pinia
          

プレーンテキストによる

お試し (1)

初級 (13)

中級 (97)

上級 (49)

最上級 (15)


> ✨ [今後の課題](https://github.com/type-challenges/type-challenges/issues?q=is%3Aissue+is%3Aopen+label%3Anew-challenge) ## おすすめの資料 ### 公式 (英語) - [The TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/intro.html) - [Unions and Intersection Types](https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html) - [Literal Types](https://www.typescriptlang.org/docs/handbook/literal-types.html) - [Utility Types](https://www.typescriptlang.org/docs/handbook/utility-types.html) - [Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html) - [The New Handbook](https://github.com/microsoft/TypeScript-New-Handbook) ### その他 (日本語) - [TypeScript Deep Dive - TypeScriptの型システム](https://typescript-jp.gitbook.io/deep-dive/type-system) ## コントリビュート方法 様々な方法でこのプロジェクトに貢献できます。 例: - 自分の解答を共有する - 新しい課題を提案する - 既存の課題にテストケースを追加する - 問題の解決方法に関する学習資料や、アイデアを提供する - 実際のプロジェクトで直面した課題を、解決策があるかどうかに関係なく共有する - コミュニティが助けになるでしょう - Issueの議論に参加して、他の人を助ける - このプロジェクトのインフラに貢献する [TODOs.md](./TODOs.md) [Issue](https://github.com/type-challenges/type-challenges/issues/new/choose) を開いてテンプレートを選択するだけです。是非チャレンジしてみて下さい! ## Thanks このプロジェクトは、[@hardfist](https://github.com/hardfist) と [@MeCKodo](https://github.com/MeCKodo) と一緒に実際の業務で型の課題を解決したことから生まれました。また、このプロジェクトに初期から多くのフィードバックを通して貢献してくれた [@sinoon](https://github.com/sinoon) に感謝します。 日本語のコミュニティの翻訳と維持について、[@kawamataryo](https://github.com/kawamataryo)に感謝します。 ### [Contributors](https://github.com/type-challenges/type-challenges/graphs/contributors) ![Contributors](https://contrib.rocks/image?repo=type-challenges/type-challenges) ## ライセンス MIT