Skip to content

Shorten iscommonjsmoduleRe using optional -typescript suffix - #1

Merged
mbrevda merged 1 commit into
patch-1from
copilot/shorten-line-regex
May 4, 2026
Merged

mbrevda merged 1 commit into
patch-1from
copilot/shorten-line-regex

Conversation

Copilot AI commented May 4, 2026

Copy link
Copy Markdown

The regex matching CommonJS/module format types listed all four variants explicitly, making the line unnecessarily long.

Change

Collapsed the four alternatives into a single pattern using an optional group:

// Before
const iscommonjsmoduleRe = /^(commonjs|commonjs-typescript|module|module-typescript)$/

// After
const iscommonjsmoduleRe = /^(commonjs|module)(-typescript)?$/

@mbrevda
mbrevda marked this pull request as ready for review May 4, 2026 17:09
@mbrevda
mbrevda merged commit 0653be1 into patch-1 May 4, 2026
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.

2 participants