← All Learning Paths

TypeScript Deep Dive

A TypeScript path through result types, typed events, caches, concurrency control, input validation, schema validation, and advanced type exercises.

technicalintermediate13 nodes12.75h total

A comprehensive TypeScript learning path covering type system, generics, type narrowing, decorators, module resolution, and advanced type patterns for type-safe development.

  1. Adapt "Typed Result Type Instead Of Throwing" to a second input and compare the new output with the behavior described in "the ok entry point".

    Completion criteria: Save two runs of "Typed Result Type Instead Of Throwing" side by side — the original input and one changed value — and annotate the line where the output diverges.

    Next step: Typed Event Emitter With Listener Limits

    ⏱ 0.75h

  2. Execute "Typed Event Emitter With Listener Limits", change one constant, and describe how the output diverges from "snapshot so removal during dispatch does not skip listeners".

    Prerequisites: Typed Result Type Instead Of Throwing

    Completion criteria: Attach the terminal transcript for "Typed Event Emitter With Listener Limits": command, exit code, and the printed result you used to confirm "snapshot so removal during dispatch does not skip listeners".

    Next step: LRU Cache With TTL Expiry

    ⏱ 0.75h

  3. Run the typescript snippet "LRU Cache With TTL Expiry", capture stdout, and show which line demonstrates the documented behavior: "A generic LRU cache with per-entry TTL that evicts least recently used keys and reports".

    Prerequisites: Typed Event Emitter With Listener Limits

    Completion criteria: Change one constant in "LRU Cache With TTL Expiry", rerun, and attach both stdout captures plus a one-line diff explaining what moved.

    Next step: Single Flight Dedupe For Concurrent Calls

    ⏱ 0.75h

  4. Adapt "Single Flight Dedupe For Concurrent Calls" to a second input and compare the new output with the behavior described in "A single-flight map that collapses concurrent identical calls into one in-flight request and".

    Prerequisites: LRU Cache With TTL Expiry

    Completion criteria: Paste the command, the exit code, and the output line matching "A single-flight map that collapses concurrent identical calls into one in-flight request and"; then show a second run with a changed parameter.

    Next step: Validate Untrusted Input At A Single Boundary

    ⏱ 0.75h

  5. Execute "Validate Untrusted Input At A Single Boundary", change one constant, and describe how the output diverges from "the checkConstraints entry point".

    Prerequisites: Single Flight Dedupe For Concurrent Calls

    Completion criteria: Save two runs of "Validate Untrusted Input At A Single Boundary" side by side — the original input and one changed value — and annotate the line where the output diverges.

    Next step: Resolve Config With Explicit Source Precedence

    ⏱ 0.75h

  6. Run the typescript snippet "Resolve Config With Explicit Source Precedence", capture stdout, and show which line demonstrates the documented behavior: "A configuration resolver that merges defaults, file, environment and CLI sources in a".

    Prerequisites: Validate Untrusted Input At A Single Boundary

    Completion criteria: Attach the terminal transcript for "Resolve Config With Explicit Source Precedence": command, exit code, and the printed result you used to confirm "A configuration resolver that merges defaults, file, environment and CLI sources in a".

    Next step: Typed Environment Validation At Startup

    ⏱ 0.75h

  7. Adapt "Typed Environment Validation At Startup" to a second input and compare the new output with the behavior described in "parseInt 等 parser 对无效输入返回 NaN 而不抛错,必须显式判定为解析失败".

    Prerequisites: Resolve Config With Explicit Source Precedence

    Completion criteria: Change one constant in "Typed Environment Validation At Startup", rerun, and attach both stdout captures plus a one-line diff explaining what moved.

    Next step: Minimal JSON Schema Validator

    ⏱ 0.75h

  8. Execute "Minimal JSON Schema Validator", change one constant, and describe how the output diverges from "the typeOf entry point".

    Prerequisites: Typed Environment Validation At Startup

    Completion criteria: Paste the command, the exit code, and the output line matching "the typeOf entry point"; then show a second run with a changed parameter.

    Next step: Safe Path Join Blocking Traversal

    ⏱ 0.75h

  9. Run the typescript snippet "Safe Path Join Blocking Traversal", capture stdout, and show which line demonstrates the documented behavior: "the PathTraversalError entry point".

    Prerequisites: Minimal JSON Schema Validator

    Completion criteria: Attach the terminal transcript for "Safe Path Join Blocking Traversal": command, exit code, and the printed result you used to confirm "A path resolver that joins untrusted segments onto a base directory and rejects any attempt".

    Next step: Branded Types for Nominal Typing

    ⏱ 0.75h

  10. Implement "Branded Types for Nominal Typing" so that Branded string types that cannot be accidentally mixed. yields Valid Email type, including the edge case in the second sample.

    Prerequisites: Safe Path Join Blocking Traversal

    Completion criteria: Show a test command that validates "Branded string types that cannot be accidentally mixed." and "Valid Email type" and passes after your fix.

    Next step: Conditional Types

    ⏱ 0.5h

  11. Complete "Conditional Types" by making Conditionally selected types produce string without hard-coding the sample.

    Prerequisites: Branded Types for Nominal Typing

    Completion criteria: Submit a solution that passes both samples (Conditionally selected types to string) and attach the failing case you fixed.

    Next step: Type-Safe Data Transformations with TypeScript

    ⏱ 0.5h

  12. Read "Type-Safe Data Transformations with TypeScript" for the "Total Parsers with Zod" argument, then name the decision in typescript work it would change.

    Prerequisites: Conditional Types

    Completion criteria: Attach a one-page summary that quotes "Total Parsers with Zod", lists two trade-offs, and links the commit where you applied it.

    Next step: Capstone: TypeScript Deep Dive

    ⏱ 1h

  13. Build "Build a JSON Schema Validator from Scratch" through its phases, keeping "Combinators allOf, anyOf, oneOf, and not with error aggregation explaining which branch" independently testable.

    Prerequisites: Type-Safe Data Transformations with TypeScript

    Completion criteria: Run the project's test command for "Build a JSON Schema Validator from Scratch", paste the passing output, and attach the acceptance note for "Combinators allOf, anyOf, oneOf, and not with error aggregation explaining which branch" with the test name.

    Next step: Run the capstone's tests, publish the repository, and demo it to a reviewer.

    ⏱ 4h