From da855a2840fae80974eb9e3e9329ada4917db79f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samet=20=C3=87EL=C4=B0KBI=C3=87AK?= Date: Thu, 11 Jul 2024 09:14:24 +0300 Subject: [PATCH 1/2] Fix typo for visual represent. --- book-content/chapters/05-unions-literals-and-narrowing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book-content/chapters/05-unions-literals-and-narrowing.md b/book-content/chapters/05-unions-literals-and-narrowing.md index 506c7ee..1b14c2c 100644 --- a/book-content/chapters/05-unions-literals-and-narrowing.md +++ b/book-content/chapters/05-unions-literals-and-narrowing.md @@ -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; From 6ade929dd8a110b1820f1bdf28e7b8f50e439dfb Mon Sep 17 00:00:00 2001 From: Nicholas March Date: Thu, 11 Jul 2024 12:00:48 -0700 Subject: [PATCH 2/2] reference username instead of name --- book-content/chapters/05-unions-literals-and-narrowing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book-content/chapters/05-unions-literals-and-narrowing.md b/book-content/chapters/05-unions-literals-and-narrowing.md index 506c7ee..55499e4 100644 --- a/book-content/chapters/05-unions-literals-and-narrowing.md +++ b/book-content/chapters/05-unions-literals-and-narrowing.md @@ -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; }