typescript-patterns

Installation
SKILL.md

Advanced TypeScript Patterns

Production-grade TypeScript patterns for building type-safe, maintainable, and scalable applications. This skill covers generics, utility types, conditional types, discriminated unions, branded types, and more.


1. Advanced Generics with Constraints

Basic Generic Constraints

// Constrain T to objects that have a .length property
function getLength<T extends { length: number }>(item: T): number {
  return item.length;
}
Installs
3
GitHub Stars
3
First Seen
Apr 14, 2026
typescript-patterns — 1mangesh1/dev-skills-collection