Skip to content

feat: add string literal unions typescript generic parsing and test#208

Open
yilanboy wants to merge 1 commit intotempestphp:mainfrom
yilanboy:add-string-literal-unions-in-ts-generic
Open

feat: add string literal unions typescript generic parsing and test#208
yilanboy wants to merge 1 commit intotempestphp:mainfrom
yilanboy:add-string-literal-unions-in-ts-generic

Conversation

@yilanboy
Copy link
Copy Markdown

@yilanboy yilanboy commented May 7, 2026

Currently, I'm trying to add Svelte support to this package.

I really appreciate the TypeScript language support, so I can reuse it directly in Svelte.

I noticed that string-literal unions are missing from the generic pattern:

let filter: State<'all' | 'active' | 'done'> = 'all';

So I changed the generic regex pattern slightly:

// from
return '/(?<=\w)(?<match><[A-Z][\w\s,\.\[\]]*>)/';

// to
return '/(?<=\w)(?<match><[A-Z\'"][\w\s,\.\[\]\'"|]*>)/';

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.

1 participant