From e21f0f9bb97cbc4bd59f6bce0e0fce451b6d2b01 Mon Sep 17 00:00:00 2001 From: Jacky Zhao <j.zhao2k19@gmail.com> Date: Wed, 09 Aug 2023 04:28:09 +0000 Subject: [PATCH] change reading time to content meta --- 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