( chapterId: string, lessonId: string, )
| 22 | ); |
| 23 | |
| 24 | function findLesson( |
| 25 | chapterId: string, |
| 26 | lessonId: string, |
| 27 | ): { chapter: Chapter; lesson: Lesson } | null { |
| 28 | const chapter = data.value?.chapters.find((c) => c.id === chapterId); |
| 29 | const lesson = chapter?.lessons.find((l) => l.id === lessonId); |
| 30 | return chapter && lesson ? { chapter, lesson } : null; |
| 31 | } |
| 32 | |
| 33 | function navigateTo(chapterId: string, lessonId: string) { |
| 34 | const found = findLesson(chapterId, lessonId); |
no outgoing calls
no test coverage detected