-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
205e507
commit 3d41fb8
Showing
3 changed files
with
93 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "@total-typescript/tsconfig/tsc/no-dom/app" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
# Lab: Type Safe Creators | ||
# Lab: Type Safe Creators 🎬 | ||
|
||
> **Section 2: Improving Type Safety** | ||
## Requirements | ||
|
||
1. There are eight pesky type errors in the Step 1 section of `start.ts`. Use the `satisfies` operator to help you fix them. | ||
2. In the `for...of` loop in Step 2 section, `Array.isArray` is used to narrow the type for the `creator` variable. Refactor this code to use type predicates to narrow the type instead. | ||
1. Create two type predicate functions: `isDirector()` and `isProducer()` | ||
2. Hint: The return type for these functions should be a type predicate where the type is an intersection type. | ||
2. Hint: The return type for these functions should be a type predicate where the type is an *intersection type*. |