From 03439cfc02b6dae19d53328e29a65d2f3247dba6 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 3 Sep 2020 22:34:58 +0800 Subject: [PATCH] fix: typo --- questions/10-medium-tuple-to-union/README.md | 4 ++-- questions/11-easy-tuple-to-object/README.md | 4 ++-- questions/12-medium-chainable-options/README.md | 4 ++-- questions/12-medium-chainable-options/README.zh-CN.md | 4 ++-- questions/13-warm-hello-world/README.md | 4 ++-- questions/13-warm-hello-world/README.zh-CN.md | 4 ++-- questions/14-easy-first/README.md | 4 ++-- questions/15-medium-last/README.md | 4 ++-- questions/16-medium-pop/README.md | 4 ++-- questions/17-hard-currying-1/README.md | 4 ++-- questions/18-easy-tuple-length/README.md | 4 ++-- questions/2-medium-return-type/README.md | 4 ++-- questions/2-medium-return-type/README.zh-CN.md | 4 ++-- questions/3-medium-omit/README.md | 4 ++-- questions/3-medium-omit/README.zh-CN.md | 4 ++-- questions/4-easy-pick/README.md | 4 ++-- questions/43-easy-exclude/README.md | 4 ++-- questions/5-extreme-readonly-keys/README.md | 4 ++-- questions/55-hard-union-to-intersection/README.md | 4 ++-- questions/57-hard-get-required/README.md | 4 ++-- questions/59-hard-get-optional/README.md | 4 ++-- questions/6-hard-simple-vue/README.md | 4 ++-- questions/62-medium-type-lookup/README.md | 4 ++-- questions/7-easy-readonly/README.md | 4 ++-- questions/8-medium-readonly-2/README.md | 4 ++-- questions/9-medium-deep-readonly/README.md | 4 ++-- scripts/toUrl.ts | 2 +- 27 files changed, 53 insertions(+), 53 deletions(-) diff --git a/questions/10-medium-tuple-to-union/README.md b/questions/10-medium-tuple-to-union/README.md index 3e0b350f..49ddba7d 100644 --- a/questions/10-medium-tuple-to-union/README.md +++ b/questions/10-medium-tuple-to-union/README.md @@ -1,4 +1,4 @@ -

Tuple to Union medium #infer #tuple #union

by Anthony Fu @antfu

Take the Challenge

+

Tuple to Union medium #infer #tuple #union

by Anthony Fu @antfu

Take the Challenge

Implement a generic `TupleToUnion` which covers the values of a tuple to its values union. @@ -10,4 +10,4 @@ type Arr = ['1', '2', '3'] const a: TupleToUnion // expected to be '1' | '2' | '3' ``` -
Back Share your Solutions Check out Solutions \ No newline at end of file +
Back Share your Solutions Check out Solutions \ No newline at end of file diff --git a/questions/11-easy-tuple-to-object/README.md b/questions/11-easy-tuple-to-object/README.md index 94518348..3fbd70c3 100644 --- a/questions/11-easy-tuple-to-object/README.md +++ b/questions/11-easy-tuple-to-object/README.md @@ -1,4 +1,4 @@ -

Tuple to Object easy

by sinoon @sinoon

Take the Challenge

+

Tuple to Object easy

by sinoon @sinoon

Take the Challenge

Given an array, transform to a object type and the key/value must in the given array. @@ -10,4 +10,4 @@ const tuple = ['tesla', 'model 3', 'model X', 'model Y'] as const const result: TupleToObject // expected { tesla: 'tesla', 'model 3': 'model 3', 'model X': 'model X', 'model Y': 'model Y'} ``` -
Back Share your Solutions Check out Solutions +
Back Share your Solutions Check out Solutions diff --git a/questions/12-medium-chainable-options/README.md b/questions/12-medium-chainable-options/README.md index 71e8afd1..dd319f80 100644 --- a/questions/12-medium-chainable-options/README.md +++ b/questions/12-medium-chainable-options/README.md @@ -1,4 +1,4 @@ -

Chainable Options medium #application

by Anthony Fu @antfu

Take the Challenge    简体中文

+

Chainable Options medium #application

by Anthony Fu @antfu

Take the Challenge    简体中文

Chainable options are commonly used in Javascript. But when we switch to Typescript, can you properly type it? @@ -29,4 +29,4 @@ You don't need to write any js/ts logic to handle the problem - just in type lev You can assume that `key` only accept `string` and the `value` and be anything - just leave it as-is. Same `key` won't be passed twice. -
Back Share your Solutions Check out Solutions \ No newline at end of file +
Back Share your Solutions Check out Solutions \ No newline at end of file diff --git a/questions/12-medium-chainable-options/README.zh-CN.md b/questions/12-medium-chainable-options/README.zh-CN.md index 8931ef4c..927a40df 100644 --- a/questions/12-medium-chainable-options/README.zh-CN.md +++ b/questions/12-medium-chainable-options/README.zh-CN.md @@ -1,4 +1,4 @@ -

可串联构造器 中等 #application

by Anthony Fu @antfu

接受挑战    English

+

可串联构造器 中等 #application

by Anthony Fu @antfu

接受挑战    English

在 JavaScript 中我们很常会使用可串联(Chainable/Pipeline)的函数构造一个对象,但在 TypeScript 中,你能合理的给他附上类型吗? @@ -29,4 +29,4 @@ interface Result { 你可以假设 `key` 只接受字符串而 `value` 接受任何类型,你只需要暴露它传递的类型而不需要进行任何处理。同样的 `key` 只会被使用一次。 -
返回首页 分享你的解答 查看解答 \ No newline at end of file +
返回首页 分享你的解答 查看解答 \ No newline at end of file diff --git a/questions/13-warm-hello-world/README.md b/questions/13-warm-hello-world/README.md index 171c6109..8dd7e996 100644 --- a/questions/13-warm-hello-world/README.md +++ b/questions/13-warm-hello-world/README.md @@ -1,4 +1,4 @@ -

Hello World warm-up

by Anthony Fu @antfu

Take the Challenge    简体中文

+

Hello World warm-up

by Anthony Fu @antfu

Take the Challenge    简体中文

Hello, World! @@ -16,4 +16,4 @@ type test = Expect> Click the `Take the Challenge` button to start coding! Happy Hacking! -
Back Share your Solutions Check out Solutions \ No newline at end of file +
Back Share your Solutions Check out Solutions \ No newline at end of file diff --git a/questions/13-warm-hello-world/README.zh-CN.md b/questions/13-warm-hello-world/README.zh-CN.md index bf23e4a4..c3c8fe44 100644 --- a/questions/13-warm-hello-world/README.zh-CN.md +++ b/questions/13-warm-hello-world/README.zh-CN.md @@ -1,4 +1,4 @@ -

Hello World 热身

by Anthony Fu @antfu

接受挑战    English

+

Hello World 热身

by Anthony Fu @antfu

接受挑战    English

Hello, World! @@ -18,4 +18,4 @@ type test = Expect> 点击上方的 `接受挑战` 开始编码!旅途愉快! -
返回首页 分享你的解答 查看解答 \ No newline at end of file +
返回首页 分享你的解答 查看解答 \ No newline at end of file diff --git a/questions/14-easy-first/README.md b/questions/14-easy-first/README.md index 8da6893b..f185aa70 100644 --- a/questions/14-easy-first/README.md +++ b/questions/14-easy-first/README.md @@ -1,4 +1,4 @@ -

First of Array easy #array #4.0

by Anthony Fu @antfu

Take the Challenge

+

First of Array easy #array #4.0

by Anthony Fu @antfu

Take the Challenge

Implement a generic `First` that takes an Array `T` and returns it's first element's type. @@ -13,4 +13,4 @@ type head1 = First // expected to be 'a' type head2 = First // expected to be 3 ``` -
Back Share your Solutions Check out Solutions

Related Challenges

15・Last of Array \ No newline at end of file +
Back Share your Solutions Check out Solutions

Related Challenges

15・Last of Array \ No newline at end of file diff --git a/questions/15-medium-last/README.md b/questions/15-medium-last/README.md index b078e2eb..e0af538e 100644 --- a/questions/15-medium-last/README.md +++ b/questions/15-medium-last/README.md @@ -1,4 +1,4 @@ -

Last of Array medium #array #4.0

by Anthony Fu @antfu

Take the Challenge

+

Last of Array medium #array #4.0

by Anthony Fu @antfu

Take the Challenge

> TypeScript 4.0 is recommended in this challenge @@ -14,4 +14,4 @@ type tail1 = Last // expected to be 'c' type tail2 = Last // expected to be 1 ``` -
Back Share your Solutions Check out Solutions

Related Challenges

14・First of Array 16・Pop \ No newline at end of file +
Back Share your Solutions Check out Solutions

Related Challenges

14・First of Array 16・Pop \ No newline at end of file diff --git a/questions/16-medium-pop/README.md b/questions/16-medium-pop/README.md index c2248f82..56c9b492 100644 --- a/questions/16-medium-pop/README.md +++ b/questions/16-medium-pop/README.md @@ -1,4 +1,4 @@ -

Pop medium #array #4.0

by Anthony Fu @antfu

Take the Challenge

+

Pop medium #array #4.0

by Anthony Fu @antfu

Take the Challenge

> TypeScript 4.0 is recommended in this challenge @@ -16,4 +16,4 @@ type re2 = Pop // expected to be [3, 2] **Extra**: Similarly, can you implement `Shift`, `Push` and `Unshift` as well? -
Back Share your Solutions Check out Solutions

Related Challenges

14・First of Array 15・Last of Array \ No newline at end of file +
Back Share your Solutions Check out Solutions

Related Challenges

14・First of Array 15・Last of Array \ No newline at end of file diff --git a/questions/17-hard-currying-1/README.md b/questions/17-hard-currying-1/README.md index 28d4b698..5dd3ea9b 100644 --- a/questions/17-hard-currying-1/README.md +++ b/questions/17-hard-currying-1/README.md @@ -1,4 +1,4 @@ -

Currying 1 hard #array #4.0

by Anthony Fu @antfu

Take the Challenge

+

Currying 1 hard #array #4.0

by Anthony Fu @antfu

Take the Challenge

> TypeScript 4.0 is recommended in this challenge @@ -21,4 +21,4 @@ In this challenge, the curried function only accept one argument at a time. Once **Extra**: Similarly, can you implement `Shift`, `Push` and `Unshift` as well? -
Back Share your Solutions Check out Solutions

Related Challenges

14・First of Array 16・Pop \ No newline at end of file +
Back Share your Solutions Check out Solutions

Related Challenges

14・First of Array 16・Pop \ No newline at end of file diff --git a/questions/18-easy-tuple-length/README.md b/questions/18-easy-tuple-length/README.md index 36e66788..58dfcb23 100644 --- a/questions/18-easy-tuple-length/README.md +++ b/questions/18-easy-tuple-length/README.md @@ -1,4 +1,4 @@ -

Length of Tuple easy #tuple

by sinoon @sinoon

Take the Challenge

+

Length of Tuple easy #tuple

by sinoon @sinoon

Take the Challenge

For given a tuple, you need create a generic `Length`, pick the length of the tuple @@ -12,4 +12,4 @@ type teslaLength = Length // expected 4 type spaceXLength = Length // expected 5 ``` -
Back Share your Solutions Check out Solutions +
Back Share your Solutions Check out Solutions diff --git a/questions/2-medium-return-type/README.md b/questions/2-medium-return-type/README.md index 3301aaec..39836b0f 100644 --- a/questions/2-medium-return-type/README.md +++ b/questions/2-medium-return-type/README.md @@ -1,4 +1,4 @@ -

Get Return Type medium #infer #built-in

by Anthony Fu @antfu

Take the Challenge    简体中文

+

Get Return Type medium #infer #built-in

by Anthony Fu @antfu

Take the Challenge    简体中文

Implement the built-in `ReturnType` generic without using it. @@ -15,4 +15,4 @@ const fn = (v: boolean) => { type a = MyReturnType // should be "1 | 2" ``` -
Back Share your Solutions Check out Solutions \ No newline at end of file +
Back Share your Solutions Check out Solutions \ No newline at end of file diff --git a/questions/2-medium-return-type/README.zh-CN.md b/questions/2-medium-return-type/README.zh-CN.md index 4d97ca28..671f599e 100644 --- a/questions/2-medium-return-type/README.zh-CN.md +++ b/questions/2-medium-return-type/README.zh-CN.md @@ -1,4 +1,4 @@ -

获取函数返回类型 中等 #infer #built-in

by Anthony Fu @antfu

接受挑战    English

+

获取函数返回类型 中等 #infer #built-in

by Anthony Fu @antfu

接受挑战    English

不使用 `ReturnType` 实现 TypeScript 的 `ReturnType` 范型。 @@ -15,4 +15,4 @@ const fn = (v: boolean) => { type a = MyReturnType // 应推导出 "1 | 2" ``` -
返回首页 分享你的解答 查看解答 \ No newline at end of file +
返回首页 分享你的解答 查看解答 \ No newline at end of file diff --git a/questions/3-medium-omit/README.md b/questions/3-medium-omit/README.md index be4841a5..742f8c4e 100644 --- a/questions/3-medium-omit/README.md +++ b/questions/3-medium-omit/README.md @@ -1,4 +1,4 @@ -

Omit<T, K> medium #union #built-in

by Anthony Fu @antfu

Take the Challenge    简体中文

+

Omit<T, K> medium #union #built-in

by Anthony Fu @antfu

Take the Challenge    简体中文

Implement the built-in `Omit` generic without using it. @@ -20,4 +20,4 @@ const todo: TodoPreview = { } ``` -
Back Share your Solutions Check out Solutions

Related Challenges

4・Pick<T, K> \ No newline at end of file +
Back Share your Solutions Check out Solutions

Related Challenges

4・Pick<T, K> \ No newline at end of file diff --git a/questions/3-medium-omit/README.zh-CN.md b/questions/3-medium-omit/README.zh-CN.md index 1d47364e..dbb63c9e 100644 --- a/questions/3-medium-omit/README.zh-CN.md +++ b/questions/3-medium-omit/README.zh-CN.md @@ -1,4 +1,4 @@ -

实现 Omit<T, K> 中等 #union #built-in

by Anthony Fu @antfu

接受挑战    English

+

实现 Omit<T, K> 中等 #union #built-in

by Anthony Fu @antfu

接受挑战    English

不使用 `Omit` 实现 TypeScript 的 `Omit` 范型。 @@ -20,4 +20,4 @@ const todo: TodoPreview = { } ``` -
返回首页 分享你的解答 查看解答

相关挑战

4・实现 Pick<T, K> \ No newline at end of file +
返回首页 分享你的解答 查看解答

相关挑战

4・实现 Pick<T, K> \ No newline at end of file diff --git a/questions/4-easy-pick/README.md b/questions/4-easy-pick/README.md index 017b190f..a7937ad5 100644 --- a/questions/4-easy-pick/README.md +++ b/questions/4-easy-pick/README.md @@ -1,4 +1,4 @@ -

Pick<T, K> easy #union #built-in

by Anthony Fu @antfu

Take the Challenge

+

Pick<T, K> easy #union #built-in

by Anthony Fu @antfu

Take the Challenge

Implement the built-in `Pick` generic without using it. @@ -21,4 +21,4 @@ const todo: TodoPreview = { } ``` -
Back Share your Solutions Check out Solutions

Related Challenges

3・Omit<T, K> \ No newline at end of file +
Back Share your Solutions Check out Solutions

Related Challenges

3・Omit<T, K> \ No newline at end of file diff --git a/questions/43-easy-exclude/README.md b/questions/43-easy-exclude/README.md index 39055937..9101f1db 100644 --- a/questions/43-easy-exclude/README.md +++ b/questions/43-easy-exclude/README.md @@ -1,7 +1,7 @@ -

Exclude easy #built-in

by Zheeeng @zheeeng

Take the Challenge

+

Exclude easy #built-in

by Zheeeng @zheeeng

Take the Challenge

Implement the built-in Exclude > Exclude from T those types that are assignable to U -
Back Share your Solutions Check out Solutions \ No newline at end of file +
Back Share your Solutions Check out Solutions \ No newline at end of file diff --git a/questions/5-extreme-readonly-keys/README.md b/questions/5-extreme-readonly-keys/README.md index 702eea3c..3be9ac58 100644 --- a/questions/5-extreme-readonly-keys/README.md +++ b/questions/5-extreme-readonly-keys/README.md @@ -1,4 +1,4 @@ -

Get Readonly Keys extreme #utils #object-keys

by Anthony Fu @antfu

Take the Challenge

+

Get Readonly Keys extreme #utils #object-keys

by Anthony Fu @antfu

Take the Challenge

Implement a generic `GetReadonlyKeys` that returns a union of the readonly keys of an Object. @@ -14,4 +14,4 @@ interface Todo { type Keys = GetReadonlyKeys // expected to be "title" | "description" ``` -
Back Share your Solutions Check out Solutions \ No newline at end of file +
Back Share your Solutions Check out Solutions \ No newline at end of file diff --git a/questions/55-hard-union-to-intersection/README.md b/questions/55-hard-union-to-intersection/README.md index eb0f7a52..9b4f1352 100644 --- a/questions/55-hard-union-to-intersection/README.md +++ b/questions/55-hard-union-to-intersection/README.md @@ -1,4 +1,4 @@ -

Union to Intersection hard #utils #infer

by Zheeeng @zheeeng

Take the Challenge

+

Union to Intersection hard #utils #infer

by Zheeeng @zheeeng

Take the Challenge

Implement the advanced util type `UnionToIntersection` @@ -9,4 +9,4 @@ type I = Union2Intersection<'foo' | 42 | true> // expected to be 'foo' & 42 & tr ``` -
Back Share your Solutions Check out Solutions \ No newline at end of file +
Back Share your Solutions Check out Solutions \ No newline at end of file diff --git a/questions/57-hard-get-required/README.md b/questions/57-hard-get-required/README.md index 48e048fa..3154e9f4 100644 --- a/questions/57-hard-get-required/README.md +++ b/questions/57-hard-get-required/README.md @@ -1,4 +1,4 @@ -

Get Required hard #utils #infer

by Zheeeng @zheeeng

Take the Challenge

+

Get Required hard #utils #infer

by Zheeeng @zheeeng

Take the Challenge

Implement the advanced util type `GetRequired`, which remains all the required fields @@ -9,4 +9,4 @@ type I = GetRequired<{ foo: number, bar?: string }> // expected to be { foo: num ``` -
Back Share your Solutions Check out Solutions \ No newline at end of file +
Back Share your Solutions Check out Solutions \ No newline at end of file diff --git a/questions/59-hard-get-optional/README.md b/questions/59-hard-get-optional/README.md index 472babf6..0e929bf4 100644 --- a/questions/59-hard-get-optional/README.md +++ b/questions/59-hard-get-optional/README.md @@ -1,4 +1,4 @@ -

Get Optional hard #utils #infer

by Zheeeng @zheeeng

Take the Challenge

+

Get Optional hard #utils #infer

by Zheeeng @zheeeng

Take the Challenge

Implement the advanced util type `GetOptional`, which remains all the optional fields @@ -9,4 +9,4 @@ type I = GetOptional<{ foo: number, bar?: string }> // expected to be { bar?: st ``` -
Back Share your Solutions Check out Solutions \ No newline at end of file +
Back Share your Solutions Check out Solutions \ No newline at end of file diff --git a/questions/6-hard-simple-vue/README.md b/questions/6-hard-simple-vue/README.md index 5b6f538d..bb256e45 100644 --- a/questions/6-hard-simple-vue/README.md +++ b/questions/6-hard-simple-vue/README.md @@ -1,4 +1,4 @@ -

Simple Vue hard #this #application

by Anthony Fu @antfu

Take the Challenge

+

Simple Vue hard #this #application

by Anthony Fu @antfu

Take the Challenge

Implement a simpiled version of a Vue-like typing support. @@ -36,4 +36,4 @@ const instance = SimpleVue({ }) ``` -
Back Share your Solutions Check out Solutions \ No newline at end of file +
Back Share your Solutions Check out Solutions \ No newline at end of file diff --git a/questions/62-medium-type-lookup/README.md b/questions/62-medium-type-lookup/README.md index 738aab65..46fb3511 100644 --- a/questions/62-medium-type-lookup/README.md +++ b/questions/62-medium-type-lookup/README.md @@ -1,4 +1,4 @@ -

Type Lookup medium #union #map

by Anthony Fu @antfu

Take the Challenge

+

Type Lookup medium #union #map

by Anthony Fu @antfu

Take the Challenge

Sometimes, you may want to lookup for a type in a union to by their attributes. @@ -20,4 +20,4 @@ const MyDog = LookUp // expected to be `Dog` ``` -
Back Share your Solutions Check out Solutions \ No newline at end of file +
Back Share your Solutions Check out Solutions \ No newline at end of file diff --git a/questions/7-easy-readonly/README.md b/questions/7-easy-readonly/README.md index 057a6365..8a748670 100644 --- a/questions/7-easy-readonly/README.md +++ b/questions/7-easy-readonly/README.md @@ -1,4 +1,4 @@ -

Readonly<T> easy #built-in #readonly #object-keys

by Anthony Fu @antfu

Take the Challenge

+

Readonly<T> easy #built-in #readonly #object-keys

by Anthony Fu @antfu

Take the Challenge

Implement the built-in `Readonly` generic without using it. @@ -22,4 +22,4 @@ todo.title = "Hello" // Error: cannot reassign a readonly property todo.description = "barFoo" // Error: cannot reassign a readonly property ``` -
Back Share your Solutions Check out Solutions

Related Challenges

8・Readonly 2 9・Deep Readonly \ No newline at end of file +
Back Share your Solutions Check out Solutions

Related Challenges

8・Readonly 2 9・Deep Readonly \ No newline at end of file diff --git a/questions/8-medium-readonly-2/README.md b/questions/8-medium-readonly-2/README.md index 27430d31..78fee12c 100644 --- a/questions/8-medium-readonly-2/README.md +++ b/questions/8-medium-readonly-2/README.md @@ -1,4 +1,4 @@ -

Readonly 2 medium #readonly #object-keys

by Anthony Fu @antfu

Take the Challenge

+

Readonly 2 medium #readonly #object-keys

by Anthony Fu @antfu

Take the Challenge

Implement a generic `MyReadonly2` which takes two type argument `T` and `K`. @@ -24,4 +24,4 @@ todo.description = "barFoo" // Error: cannot reassign a readonly property todo.completed = true // OK ``` -
Back Share your Solutions Check out Solutions

Related Challenges

7・Readonly<T> 9・Deep Readonly \ No newline at end of file +
Back Share your Solutions Check out Solutions

Related Challenges

7・Readonly<T> 9・Deep Readonly \ No newline at end of file diff --git a/questions/9-medium-deep-readonly/README.md b/questions/9-medium-deep-readonly/README.md index 7ef199cf..d9f3b0af 100644 --- a/questions/9-medium-deep-readonly/README.md +++ b/questions/9-medium-deep-readonly/README.md @@ -1,4 +1,4 @@ -

Deep Readonly medium #readonly #object-keys #deep

by Anthony Fu @antfu

Take the Challenge

+

Deep Readonly medium #readonly #object-keys #deep

by Anthony Fu @antfu

Take the Challenge

Implement a generic `DeepReadonly` which make every parameter of an object - and its sub-objects recursively - readonly. @@ -26,4 +26,4 @@ type Expected = { const todo: DeepReadonly // should be same as `Expaceted` ``` -
Back Share your Solutions Check out Solutions

Related Challenges

7・Readonly<T> 8・Readonly 2 \ No newline at end of file +
Back Share your Solutions Check out Solutions

Related Challenges

7・Readonly<T> 8・Readonly 2 \ No newline at end of file diff --git a/scripts/toUrl.ts b/scripts/toUrl.ts index 44db4553..788d4022 100644 --- a/scripts/toUrl.ts +++ b/scripts/toUrl.ts @@ -4,7 +4,7 @@ import { defaultLocale } from './locales' import { resolveInfo } from './loader' export const REPO = 'https://github.com/type-challenges/type-challenges' -export const DOMAIN = 'https://tsch.js.org/' +export const DOMAIN = 'https://tsch.js.org' export const TYPESCRIPT_PLAYGROUND = 'https://www.typescriptlang.org/play' // https://github.com/microsoft/TypeScript-Website/tree/v2/packages/playground