Skip to content

Commit

Permalink
Merge branch 'main' of github.com:total-typescript/total-typescript-book
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpocock committed Jul 17, 2024
2 parents 6b2cc39 + bc3cdf9 commit f3120fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions book-content/chapters/05-unions-literals-and-narrowing.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ type DigitalFormat = "MP3" | "FLAC";
type PhysicalFormat = "LP" | "CD" | "Cassette";
```

We could then specify `AlbumFormat` as a union of `DigitalFormat` and `PhysicalFormat:
We could then specify `AlbumFormat` as a union of `DigitalFormat` and `PhysicalFormat`:

```tsx
type AlbumFormat = DigitalFormat | PhysicalFormat;
Expand Down Expand Up @@ -577,7 +577,7 @@ In this case, if `username` is not a string, we know it's `null` and could retur

```typescript
function validateUsername(username: string | null | undefined): boolean {
if (typeof name !== "string") {
if (typeof username !== "string") {
return false;
}

Expand Down

0 comments on commit f3120fb

Please sign in to comment.