mirror of
https://github.com/type-challenges/type-challenges.git
synced 2026-01-18 14:36:47 +00:00
fix: glob
fix: typo fix
This commit is contained in:
parent
ccf901b505
commit
c00a542e44
5
.github/ISSUE_TEMPLATE/answer.md
vendored
5
.github/ISSUE_TEMPLATE/answer.md
vendored
@ -15,3 +15,8 @@ For example:
|
||||
|
||||
</details>
|
||||
|
||||
```ts
|
||||
// your answers
|
||||
```
|
||||
|
||||
<!--Some idea or thoughts about how to solve this problem-->
|
||||
@ -34,7 +34,7 @@ English | <a href='./README.zh-CN.md'>简体中文</a>
|
||||
> Click the following badges to see detail of the challenges!
|
||||
|
||||
<!--challenges-start-->
|
||||
<img src="https://img.shields.io/badge/easy-%20-90bb12" alt=" "/><br><a href="./questions/4-easy-pick/README.md" target="_blank"><img src="https://img.shields.io/badge/-%234%E3%83%BBPick%3CT%2C%20K%3E-90bb12" alt="#4・Pick<T, K>"/></a> <a href="./questions/7-easy-readonly/README.md" target="_blank"><img src="https://img.shields.io/badge/-%237%E3%83%BBReadonly%3CT%3E-90bb12" alt="#7・Readonly<T>"/></a> <br><br><img src="https://img.shields.io/badge/medium-%20-eaa648" alt=" "/><br><a href="./questions/2-medium-return-type/README.md" target="_blank"><img src="https://img.shields.io/badge/-%232%E3%83%BBGet%20Return%20Type-eaa648" alt="#2・Get Return Type"/></a> <a href="./questions/3-medium-omit/README.md" target="_blank"><img src="https://img.shields.io/badge/-%233%E3%83%BBOmit%3CT%2C%20K%3E-eaa648" alt="#3・Omit<T, K>"/></a> <a href="./questions/8-medium-readonly-2/README.md" target="_blank"><img src="https://img.shields.io/badge/-%238%E3%83%BBReadonly%202-eaa648" alt="#8・Readonly 2"/></a> <a href="./questions/9-medium-deep-readonly/README.md" target="_blank"><img src="https://img.shields.io/badge/-%239%E3%83%BBDeep%20Readonly-eaa648" alt="#9・Deep Readonly"/></a> <br><br><img src="https://img.shields.io/badge/hard-%20-red" alt=" "/><br><a href="./questions/5-hard-readonly-keys/README.md" target="_blank"><img src="https://img.shields.io/badge/-%235%E3%83%BBGet%20Readonly%20Keys-red" alt="#5・Get Readonly Keys"/></a> <br><br><img src="https://img.shields.io/badge/extreme-%20-b11b8d" alt=" "/><br><a href="./questions/6-extreme-simple-vue/README.md" target="_blank"><img src="https://img.shields.io/badge/-%236%E3%83%BBSimple%20Vue-b11b8d" alt="#6・Simple Vue"/></a>
|
||||
<img src="https://img.shields.io/badge/easy-%20-90bb12" alt=" "/><br><a href="./questions/4-easy-pick/README.md" target="_blank"><img src="https://img.shields.io/badge/-%234%E3%83%BBPick%3CT%2C%20K%3E-90bb12" alt="#4・Pick<T, K>"/></a> <a href="./questions/7-easy-readonly/README.md" target="_blank"><img src="https://img.shields.io/badge/-%237%E3%83%BBReadonly%3CT%3E-90bb12" alt="#7・Readonly<T>"/></a> <br><br><img src="https://img.shields.io/badge/medium-%20-eaa648" alt=" "/><br><a href="./questions/10-medium-tuple-to-union/README.md" target="_blank"><img src="https://img.shields.io/badge/-%2310%E3%83%BBTuple%20to%20Union-eaa648" alt="#10・Tuple to Union"/></a> <a href="./questions/2-medium-return-type/README.md" target="_blank"><img src="https://img.shields.io/badge/-%232%E3%83%BBGet%20Return%20Type-eaa648" alt="#2・Get Return Type"/></a> <a href="./questions/3-medium-omit/README.md" target="_blank"><img src="https://img.shields.io/badge/-%233%E3%83%BBOmit%3CT%2C%20K%3E-eaa648" alt="#3・Omit<T, K>"/></a> <a href="./questions/8-medium-readonly-2/README.md" target="_blank"><img src="https://img.shields.io/badge/-%238%E3%83%BBReadonly%202-eaa648" alt="#8・Readonly 2"/></a> <a href="./questions/9-medium-deep-readonly/README.md" target="_blank"><img src="https://img.shields.io/badge/-%239%E3%83%BBDeep%20Readonly-eaa648" alt="#9・Deep Readonly"/></a> <br><br><img src="https://img.shields.io/badge/hard-%20-red" alt=" "/><br><a href="./questions/5-hard-readonly-keys/README.md" target="_blank"><img src="https://img.shields.io/badge/-%235%E3%83%BBGet%20Readonly%20Keys-red" alt="#5・Get Readonly Keys"/></a> <br><br><img src="https://img.shields.io/badge/extreme-%20-b11b8d" alt=" "/><br><a href="./questions/6-extreme-simple-vue/README.md" target="_blank"><img src="https://img.shields.io/badge/-%236%E3%83%BBSimple%20Vue-b11b8d" alt="#6・Simple Vue"/></a>
|
||||
<!--challenges-end-->
|
||||
|
||||
## Recommended Readings
|
||||
|
||||
@ -28,7 +28,7 @@ TypeScript 类型体操姿势合集
|
||||
> 点击下方徽章查看题目内容
|
||||
|
||||
<!--challenges-start-->
|
||||
<img src="https://img.shields.io/badge/%E7%AE%80%E5%8D%95-%20-90bb12" alt=" "/><br><a href="./questions/4-easy-pick/README.md" target="_blank"><img src="https://img.shields.io/badge/-%234%E3%83%BB%E5%AE%9E%E7%8E%B0%20Pick%3CT%2C%20K%3E-90bb12" alt="#4・实现 Pick<T, K>"/></a> <a href="./questions/7-easy-readonly/README.md" target="_blank"><img src="https://img.shields.io/badge/-%237%E3%83%BB%E5%AE%9E%E7%8E%B0%20Readonly%3CT%3E-90bb12" alt="#7・实现 Readonly<T>"/></a> <br><br><img src="https://img.shields.io/badge/%E4%B8%AD%E7%AD%89-%20-eaa648" alt=" "/><br><a href="./questions/2-medium-return-type/README.zh-CN.md" target="_blank"><img src="https://img.shields.io/badge/-%232%E3%83%BB%E8%8E%B7%E5%8F%96%E5%87%BD%E6%95%B0%E8%BF%94%E5%9B%9E%E7%B1%BB%E5%9E%8B-eaa648" alt="#2・获取函数返回类型"/></a> <a href="./questions/3-medium-omit/README.md" target="_blank"><img src="https://img.shields.io/badge/-%233%E3%83%BB%E5%AE%9E%E7%8E%B0%20Omit%3CT%2C%20K%3E-eaa648" alt="#3・实现 Omit<T, K>"/></a> <a href="./questions/8-medium-readonly-2/README.md" target="_blank"><img src="https://img.shields.io/badge/-%238%E3%83%BBReadonly%202-eaa648" alt="#8・Readonly 2"/></a> <a href="./questions/9-medium-deep-readonly/README.md" target="_blank"><img src="https://img.shields.io/badge/-%239%E3%83%BB%E6%B7%B1%E5%BA%A6%20Readonly-eaa648" alt="#9・深度 Readonly"/></a> <br><br><img src="https://img.shields.io/badge/%E5%9B%B0%E9%9A%BE-%20-red" alt=" "/><br><a href="./questions/5-hard-readonly-keys/README.md" target="_blank"><img src="https://img.shields.io/badge/-%235%E3%83%BB%E8%8E%B7%E5%8F%96%E5%8F%AA%E8%AF%BB%E5%AD%97%E6%AE%B5-red" alt="#5・获取只读字段"/></a> <br><br><img src="https://img.shields.io/badge/%E5%9C%B0%E7%8B%B1-%20-b11b8d" alt=" "/><br><a href="./questions/6-extreme-simple-vue/README.md" target="_blank"><img src="https://img.shields.io/badge/-%236%E3%83%BB%E7%AE%80%E5%8D%95%E7%9A%84%20Vue%20%E7%B1%BB%E5%9E%8B-b11b8d" alt="#6・简单的 Vue 类型"/></a>
|
||||
<img src="https://img.shields.io/badge/%E7%AE%80%E5%8D%95-%20-90bb12" alt=" "/><br><a href="./questions/4-easy-pick/README.md" target="_blank"><img src="https://img.shields.io/badge/-%234%E3%83%BB%E5%AE%9E%E7%8E%B0%20Pick%3CT%2C%20K%3E-90bb12" alt="#4・实现 Pick<T, K>"/></a> <a href="./questions/7-easy-readonly/README.md" target="_blank"><img src="https://img.shields.io/badge/-%237%E3%83%BB%E5%AE%9E%E7%8E%B0%20Readonly%3CT%3E-90bb12" alt="#7・实现 Readonly<T>"/></a> <br><br><img src="https://img.shields.io/badge/%E4%B8%AD%E7%AD%89-%20-eaa648" alt=" "/><br><a href="./questions/10-medium-tuple-to-union/README.md" target="_blank"><img src="https://img.shields.io/badge/-%2310%E3%83%BB%E5%85%83%E7%BB%84%E8%BD%AC%E5%90%88%E9%9B%86-eaa648" alt="#10・元组转合集"/></a> <a href="./questions/2-medium-return-type/README.zh-CN.md" target="_blank"><img src="https://img.shields.io/badge/-%232%E3%83%BB%E8%8E%B7%E5%8F%96%E5%87%BD%E6%95%B0%E8%BF%94%E5%9B%9E%E7%B1%BB%E5%9E%8B-eaa648" alt="#2・获取函数返回类型"/></a> <a href="./questions/3-medium-omit/README.md" target="_blank"><img src="https://img.shields.io/badge/-%233%E3%83%BB%E5%AE%9E%E7%8E%B0%20Omit%3CT%2C%20K%3E-eaa648" alt="#3・实现 Omit<T, K>"/></a> <a href="./questions/8-medium-readonly-2/README.md" target="_blank"><img src="https://img.shields.io/badge/-%238%E3%83%BBReadonly%202-eaa648" alt="#8・Readonly 2"/></a> <a href="./questions/9-medium-deep-readonly/README.md" target="_blank"><img src="https://img.shields.io/badge/-%239%E3%83%BB%E6%B7%B1%E5%BA%A6%20Readonly-eaa648" alt="#9・深度 Readonly"/></a> <br><br><img src="https://img.shields.io/badge/%E5%9B%B0%E9%9A%BE-%20-red" alt=" "/><br><a href="./questions/5-hard-readonly-keys/README.md" target="_blank"><img src="https://img.shields.io/badge/-%235%E3%83%BB%E8%8E%B7%E5%8F%96%E5%8F%AA%E8%AF%BB%E5%AD%97%E6%AE%B5-red" alt="#5・获取只读字段"/></a> <br><br><img src="https://img.shields.io/badge/%E5%9C%B0%E7%8B%B1-%20-b11b8d" alt=" "/><br><a href="./questions/6-extreme-simple-vue/README.md" target="_blank"><img src="https://img.shields.io/badge/-%236%E3%83%BB%E7%AE%80%E5%8D%95%E7%9A%84%20Vue%20%E7%B1%BB%E5%9E%8B-b11b8d" alt="#6・简单的 Vue 类型"/></a>
|
||||
<!--challenges-end-->
|
||||
|
||||
## 推荐读物
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<!--info-header-start--><h1>Deep Readonly <img src="https://img.shields.io/badge/-medium-eaa648" alt="medium"/> <img src="https://img.shields.io/badge/-%23readonly-999" alt="#readonly"/> <img src="https://img.shields.io/badge/-%23object--keys-999" alt="#object-keys"/> <img src="https://img.shields.io/badge/-%23deep-999" alt="#deep"/></h1><blockquote><p>by Anthony Fu <a href="https://github.com/antfu" target="_blank">@antfu</a></p></blockquote><a href="https://type-challenges.netlify.app/case/9/play" target="_blank"><img src="https://img.shields.io/badge/-Take%20the%20Challenge-3178c6?logo=typescript" alt="Take the Challenge"/></a> <br><br><!--info-header-end-->
|
||||
<!--info-header-start--><h1>Tuple to Union <img src="https://img.shields.io/badge/-medium-eaa648" alt="medium"/> <img src="https://img.shields.io/badge/-%23infer-999" alt="#infer"/> <img src="https://img.shields.io/badge/-%23tuple-999" alt="#tuple"/> <img src="https://img.shields.io/badge/-%23union-999" alt="#union"/></h1><blockquote><p>by Anthony Fu <a href="https://github.com/antfu" target="_blank">@antfu</a></p></blockquote><a href="https://type-challenges.netlify.app/case/10/play" target="_blank"><img src="https://img.shields.io/badge/-Take%20the%20Challenge-3178c6?logo=typescript" alt="Take the Challenge"/></a> <br><br><!--info-header-end-->
|
||||
|
||||
Implement a generic `TupleToUnion<T>` which covers the values of a tuple to its values union.
|
||||
|
||||
@ -7,7 +7,7 @@ For example
|
||||
```ts
|
||||
type Arr = ['1', '2', '3']
|
||||
|
||||
const a: TupleToUnion<X> // expected to be '1' | '2' | '3'
|
||||
const a: TupleToUnion<Arr> // expected to be '1' | '2' | '3'
|
||||
```
|
||||
|
||||
<!--info-footer-start--><a href="../../README.md" target="_blank"><img src="https://img.shields.io/badge/-Back-grey" alt="Back"/></a> <a href="https://type-challenges.netlify.app/case/9/solutions" target="_blank"><img src="https://img.shields.io/badge/-Check%20out%20Solutions-de5a77?logo=awesome-lists&logoColor=white" alt="Check out Solutions"/></a> <a href="https://type-challenges.netlify.app/case/9/answer" target="_blank"><img src="https://img.shields.io/badge/-Share%20your%20Solutions-green" alt="Share your Solutions"/></a> <!--info-footer-end-->
|
||||
<!--info-footer-start--><a href="../../README.md" target="_blank"><img src="https://img.shields.io/badge/-Back-grey" alt="Back"/></a> <a href="https://type-challenges.netlify.app/case/10/solutions" target="_blank"><img src="https://img.shields.io/badge/-Check%20out%20Solutions-de5a77?logo=awesome-lists&logoColor=white" alt="Check out Solutions"/></a> <a href="https://type-challenges.netlify.app/case/10/answer" target="_blank"><img src="https://img.shields.io/badge/-Share%20your%20Solutions-green" alt="Share your Solutions"/></a> <!--info-footer-end-->
|
||||
@ -33,7 +33,7 @@ export function readmeCleanUp(text: string) {
|
||||
|
||||
export async function loadQuizes(): Promise<Quiz[]> {
|
||||
const root = path.resolve(__dirname, '../questions')
|
||||
const folders = await fg('{0..9}-*', {
|
||||
const folders = await fg('{0..9}*-*', {
|
||||
onlyDirectories: true,
|
||||
cwd: root,
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user