Skip to main content

Practice ยท 1 of 3

DTO Validators

Write isTaskDTO(v) โ€” true only for objects with string id, non-empty string title, boolean done, and optional string due (absent or string). Write isTaskListDTO(v) โ€” true only for arrays where every element passes isTaskDTO.

Difficulty: intermediate

Back to lesson: Practice: Mini Build: Typed API Model