mongez-reinforcements-types

Provide TypeScript type utilities for dot-notation paths and recursive transforms.

3|2|Updated Dec 20, 2021
One-click install
npx skills add https://github.com/hassanzohdy/reinforcements --skill mongez-reinforcements-types
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mongez-reinforcements-types
Source: https://github.com/hassanzohdy/reinforcements/tree/main/skills/types
Command: npx skills add https://github.com/hassanzohdy/reinforcements --skill mongez-reinforcements-types

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TypeScript-only exports provide precise type-level utilities for dot-notation paths and deep transforms, enabling safer modelling of complex objects without runtime cost.

Core Features & Use Cases

  • Path and PathValue for dot-notation typing across nested structures
  • DeepPartial, DeepRequired, DeepReadonly, DeepMutable for recursive transforms
  • Prettify, UnionToIntersection, Branded for improved ergonomics and nominal typing
  • Nullable, Maybe, Awaitable, NonEmptyArray, GenericObject, AlphaNumeric, Primitive for common helpers

Quick Start

Import these type utilities from @mongez/reinforcements and apply Path/PathValue to model safe, dot-notation access in your TypeScript types.

Frequently Asked Questions about mongez-reinforcements-types

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I type safe dot-notation paths for nested objects in TypeScript?

You can type safe dot-notation paths using the Path and PathValue utilities imported from @mongez/reinforcements, which provide precise type-level guarantees for nested structures without any runtime cost.

What is the best way to recursively transform nested TypeScript types?

The best way to recursively transform nested TypeScript types is by applying DeepPartial, DeepRequired, DeepReadonly, or DeepMutable utilities from @mongez/reinforcements to enforce structural rules.

Can I get the value type of a nested object property using a string path?

Yes, you can extract the exact value type of a deeply nested property by passing a dot-notation string path to the PathValue utility, ensuring type-safe access across complex object models.

Does @mongez/reinforcements add any runtime overhead when using type utilities?

No, @mongez/reinforcements adds zero runtime overhead because Path, PathValue, DeepPartial, and DeepReadonly are TypeScript-only exports that are completely erased during compilation.

How do I improve TypeScript type ergonomics for complex union and branded types?

You can improve type ergonomics by using the Prettify, UnionToIntersection, and Branded type utilities from @mongez/reinforcements to flatten intersections, merge unions, and enable nominal typing.

Why do I need type-level utilities for dot-notation access in my codebase?

You need type-level utilities to eliminate unsafe typing issues when accessing deeply nested structures, ensuring that string-based dot-notation paths are strictly validated against the object model.