Skip to content

Commit

Permalink
perf(find-plugin): convert unused capture group to non-capture group (#…
Browse files Browse the repository at this point in the history
…435)

Signed-off-by: Frazer Smith <[email protected]>
  • Loading branch information
Fdawgs authored Jan 9, 2025
1 parent f26b988 commit 7397616
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/find-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,16 @@ function filterPath (path, filter) {
return filter(path)
}

const typescriptPattern = /\.(ts|mts|cts)$/iu
const typescriptPattern = /\.(?:ts|mts|cts)$/iu
function getScriptType (fname, packageType) {
return {
language: typescriptPattern.test(fname) ? 'typescript' : 'javascript',
type: determineModuleType(fname, packageType)
}
}

const modulePattern = /\.(mjs|mts)$/iu
const commonjsPattern = /\.(cjs|cts)$/iu
const modulePattern = /\.(?:mjs|mts)$/iu
const commonjsPattern = /\.(?:cjs|cts)$/iu
function determineModuleType (fname, defaultType) {
if (modulePattern.test(fname)) {
return 'module'
Expand Down

0 comments on commit 7397616

Please sign in to comment.