From 09d4eb0684eac96747778656fc4a8f8085c41388 Mon Sep 17 00:00:00 2001 From: Jacky Zhao <j.zhao2k19@gmail.com> Date: Tue, 08 Aug 2023 06:57:24 +0000 Subject: [PATCH] fix notes --- content/advanced/paths.md | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/advanced/paths.md b/content/advanced/paths.md index 2a5e09f..4965119 100644 --- a/content/advanced/paths.md +++ b/content/advanced/paths.md @@ -11,7 +11,7 @@ Luckily, we can mimic nominal typing using [brands](https://www.typescriptlang.org/play#example/nominal-typing). ```typescript -// instead of +// instead of type ClientSlug = string // we do @@ -21,7 +21,7 @@ const slug: ClientSlug = "some random slug" ``` -While this prevents most typing mistakes *within* our nominal typing system (e.g. mistaking a server slug for a client slug), it doesn't prevent us from *accidentally* mistaking a string for a client slug when we forcibly cast it. +While this prevents most typing mistakes _within_ our nominal typing system (e.g. mistaking a server slug for a client slug), it doesn't prevent us from _accidentally_ mistaking a string for a client slug when we forcibly cast it. Thus, we still need to be careful when casting from a string to one of these nominal types in the 'entrypoints', illustrated with hexagon shapes in the diagram below. -- Gitblit v1.10.0