Skip to content

Commit 011ff60

Browse files
committed
update docusaurus
1 parent 53c8f3a commit 011ff60

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

website/src/pages/index.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,9 @@ Key benefits:
253253
- Ensures the object conforms to a broader type without widening its inferred type.
254254
- Helps catch type mismatches at compile time while preserving narrowed inferred types.
255255

256+
Array constants:
257+
256258
```ts
257-
// Array constant
258259
type UserRole = 'admin' | 'editor' | 'moderator' | 'viewer' | 'guest';
259260

260261
// ❌ Avoid constant of wide type
@@ -265,8 +266,11 @@ const DASHBOARD_ACCESS_ROLES = ['admin', 'contributor', 'analyst'] as const;
265266

266267
// ✅ Use immutable constant of narrowed type
267268
const DASHBOARD_ACCESS_ROLES = ['admin', 'editor', 'moderator'] as const satisfies ReadonlyArray<UserRole>;
269+
```
268270

269-
// Object constant
271+
Object constants:
272+
273+
```ts
270274
type OrderStatus = {
271275
pending: 'pending' | 'idle';
272276
fulfilled: boolean;

0 commit comments

Comments
 (0)