Skip to content

Commit 419cbdf

Browse files
authored
Merge pull request #609 from lauripiisang/patch-1
nominalTyping: Fix unintended italics due to _
2 parents f1e4135 + e9eceb3 commit 419cbdf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/tips/nominalTyping.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ str = fooId;
7272
str = barId;
7373
```
7474

75-
Note how the brand enums, ``FooIdBrand`` and ``BarIdBrand`` above, each have single member (_) that maps to the empty string, as specified by ``{ _ = "" }``. This forces TypeScript to infer that these are string-based enums, with values of type ``string``, and not enums with values of type ``number``. This is necessary because TypeScript infers an empty enum (``{}``) to be a numeric enum, and as of TypeScript 3.6.2 the intersection of a numeric ``enum`` and ``string`` is ``never``.
75+
Note how the brand enums, ``FooIdBrand`` and ``BarIdBrand`` above, each have single member (`_`) that maps to the empty string, as specified by ``{ _ = "" }``. This forces TypeScript to infer that these are string-based enums, with values of type ``string``, and not enums with values of type ``number``. This is necessary because TypeScript infers an empty enum (``{}``) to be a numeric enum, and as of TypeScript 3.6.2 the intersection of a numeric ``enum`` and ``string`` is ``never``.
7676

7777
## Using Interfaces
7878

0 commit comments

Comments
 (0)