typescript-satisfies-operator
CommunityPreserve literal types with TypeScript's satisfies.
Software Engineering#typescript#type-safety#static-analysis#type-inference#satisfies-operator#literal-types
Authorflpbalada
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill helps TypeScript developers keep literal types when validating values, avoiding unwanted type widening that occurs with standard type annotations.
Core Features & Use Cases
- Preserve literal types in object literals by using the satisfies operator for type validation without changing the inferred type.
- Compare with colon annotations and as const to understand when to prefer each approach in real-world codebases.
- Use case: when constructing a config object that should remain a narrow union type for precise autocomplete and safety.
Quick Start
Create a TypeScript snippet that demonstrates validating an object with satisfies to preserve a literal type and contrasts it with a colon-annotated version.
Dependency Matrix
Required Modules
None requiredComponents
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: typescript-satisfies-operator Download link: https://github.com/flpbalada/my-opencode-config/archive/main.zip#typescript-satisfies-operator Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.