Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ const palette: Record<Colors, string | RGB> = {
// ~~~~ The typo is now correctly detected
};

// But we now have an undesirable error here - 'palette.red' "could" be a string.
const redComponent = palette.red.at(0);
// But we now have an undesirable error here - 'palette.green' "could" be an array.
const greenNormalized = palette.green.toUpperCase();
```

The new `satisfies` operator lets us validate that the type of an expression matches some type, without changing the resulting type of that expression.
Expand Down