-
```ts
// your answers
type MyCapitalize = S extends `${infer F}${infer R}` ? `${Uppercase}${R}` : '';
```
-
```ts
type MyCapitalize = Capitalize
```
-
```ts
// your answers
type MyCapitalize = Capitalize
```
-
```ts
// 你的答案
type MyCapitalize = S extends `${ infer a }${infer L}`? Uppercase :never
```
-
```ts
interface Dic {
'a': 'A',
'b': 'B',
'c': 'C',
'd': 'D',
'e': 'E',
'f': 'F',
'g': 'G',
'h': 'H',
'i': 'I',
'j': 'J',
'k': 'K',
'l': 'L',
'm': 'M',
…
-
```ts
// your answers
type Capitalize =
S['length'] extends 0
? Uppercase
: S extends `${infer L}${infer R}`
? `${Uppercase}${R}`
: never;
```
ohxxx updated
2 years ago
-
Capitalize only the first letter of the first word. Ex: Segunda-feira, 20 de jul
Monday, 20 de jul
ghost updated
2 years ago
-
```ts
// your answers
type typical = {
f:"F",
F:'F',
//....
[k: string]: string
}
type Capitalize = S extends `${infer R}${infer Rest}`? `${typical[R] extends string ? typical[R]: …
-
```ts
type Alphabet = {
'f': 'F';
'F': 'F';
}
type ToUpper = T extends keyof Alphabet ? Alphabet[T] : T;
type Capitalize = S extends `${infer T}${infer P}` ? `${ToUpper}${P}` : S;
```
…
-
**Describe the bug**
In the CLI we currently have capitalization which is not consistent with the rest of the English language. For example, see the following output from when the user runs `ilab`:…