Skip to content

Conversation

@marcj
Copy link
Owner

@marcj marcj commented Nov 6, 2025

Supports now expressions like these

type A = `Prefix_${Uppercase<'hello' | 'world'>}_Suffix`

which will be expanded to

type T = 'Prefix_HELLO_Suffix' | 'Prefix_WORLD_Suffix'

…pitalize

supports now expressions like these

```typescript
type A = `Prefix_${Uppercase<'hello' | 'world'>}_Suffix`
```

which will be expanded to

```typescript
type T = 'Prefix_HELLO_Suffix' | 'Prefix_WORLD_Suffix'
```
@marcj marcj requested a review from Copilot November 6, 2025 12:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for TypeScript's built-in string manipulation intrinsic types (Uppercase, Lowercase, Capitalize, and Uncapitalize) to the Deepkit type system. These intrinsics enable compile-time string transformations in the type reflection system.

  • Implements handling for the four string intrinsic types in both the compiler and runtime processor
  • Adds comprehensive test coverage for basic functionality including unions and template literals
  • Extends the extractPackStructOfTypeReference method signature to accept Identifier types for intrinsic processing

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/type/tests/intrinsics.spec.ts New test file covering basic intrinsic operations, unions, and template literal integration
packages/type/src/reflection/type.ts Adds a debugger statement (should be removed) in template literal stringification
packages/type/src/reflection/processor.ts Implements runtime handling for intrinsic operations with helper functions for each type, adds missing semicolon
packages/type-spec/src/type.ts Defines TypeIntrinsic enum and adds intrinsic operation to ReflectionOp
packages/type-compiler/tests/transpile.spec.ts Adds transpilation test for intrinsic types
packages/type-compiler/src/compiler.ts Implements compiler support for detecting and processing intrinsic keywords, refactors extractPackStructOfTypeReference to handle identifiers

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@marcj marcj merged commit ffd1bc7 into master Nov 7, 2025
14 of 16 checks passed
@Coderah
Copy link

Coderah commented Nov 24, 2025

amazing thank you for doing that so quickly! fully missed your discord chat but really appreciate the assistance :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants