Skip to content

Commit c6eed6c

Browse files
committed
Fix formatting of titles
1 parent 53dc574 commit c6eed6c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pages/Utility Types.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ todo.title = 'Hello'; // Error: cannot reassign a readonly property
4848

4949
This utility is useful for representing assignment expressions that will fail at runtime (i.e. when attempting to reassign properties of a [frozen object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze)).
5050

51-
##### Object.freeze
51+
##### `Object.freeze`
5252

5353
```ts
5454
function freeze<T>(obj: T): Readonly<T>;
@@ -74,7 +74,7 @@ const x: Record<Page, PageInfo> = {
7474
};
7575
```
7676

77-
# Pick<T, K>
77+
# `Pick<T, K>`
7878

7979
Constructs a type by picking the set of properties `K` from `T`.
8080

@@ -95,7 +95,7 @@ const todo: TodoPreview = {
9595
};
9696
```
9797

98-
# Exclude<T, U>
98+
# `Exclude<T, U>`
9999

100100
Constructs a type by excluding from `T` all properties that are assignable to `U`.
101101

@@ -107,7 +107,7 @@ type T1 = Exclude<"a" | "b" | "c", "a" | "b">; // "c"
107107
type T2 = Exclude<string | number | (() => void), Function>; // string | number
108108
```
109109

110-
# Extract<T, U>
110+
# `Extract<T, U>`
111111

112112
Constructs a type by extracting from `T` all properties that are assignable to `U`.
113113

@@ -118,7 +118,7 @@ type T0 = Extract<"a" | "b" | "c", "a" | "f">; // "a"
118118
type T1 = Extract<string | number | (() => void), Function>; // () => void
119119
```
120120

121-
# NonNullable<T>
121+
# `NonNullable<T>`
122122

123123
Constructs a type by excluding `null` and `undefined` from `T`.
124124

@@ -129,7 +129,7 @@ type T0 = NonNullable<string | number | undefined>; // string | number
129129
type T1 = NonNullable<string[] | null | undefined>; // string[]
130130
```
131131

132-
# ReturnType<T>
132+
# `ReturnType<T>`
133133

134134
Constructs a type consisting of the return type of function `T`.
135135

@@ -147,7 +147,7 @@ type T7 = ReturnType<string>; // Error
147147
type T8 = ReturnType<Function>; // Error
148148
```
149149

150-
# InstanceType<T>
150+
# `InstanceType<T>`
151151

152152
Constructs a type consisting of the instance type of a constructor function type `T`.
153153

@@ -166,7 +166,7 @@ type T3 = InstanceType<string>; // Error
166166
type T4 = InstanceType<Function>; // Error
167167
```
168168

169-
# Required<T>
169+
# `Required<T>`
170170

171171
Constructs a type consisting of all properties of `T` set to required.
172172

@@ -183,7 +183,7 @@ const obj: Props = { a: 5 }; // OK
183183
const obj2: Required<Props> = { a: 5 }; // Error: property 'b' missing
184184
```
185185

186-
# ThisType<T>
186+
# `ThisType<T>`
187187

188188
This utility does not return a transformed type. Instead, it serves a marker for a contextual `this` type. Note that the `--noImplicitThis` flag must be enabled to use this utility.
189189

0 commit comments

Comments
 (0)