control-union-distribution

Community

Master union distribution in conditional types.

Authorluyi985
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Conditional types in TypeScript distribute over unions by default, often producing surprising results. This skill explains how to control distribution so you can prevent it when undesired and enable it when needed.

Core Features & Use Cases

  • Understand distributive behavior of conditional types over unions.
  • Prevent distribution using one-tuple wrappers; force distribution with bare conditions.
  • Handle edge cases involving boolean and never, including recursive types that may misbehave.

Quick Start

Demonstrate how to prevent distribution over unions by wrapping the type in a one-tuple in a TypeScript example.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: control-union-distribution
Download link: https://github.com/luyi985/lyi-bash/archive/main.zip#control-union-distribution

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.