Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions lib/util/get-convert-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
"use strict"

const { Minimatch } = require("minimatch")
const globrex = require("globrex")

/**
* @typedef PathConvertion
Expand Down Expand Up @@ -57,13 +57,10 @@ function normalizeValue(x) {

/**
* @param {string} pattern
* @return {Minimatch}
* @return {globrex.Results}
*/
function makeMatcher(pattern) {
const posix = pattern.replace(/\\/g, "/")
return new Minimatch(posix, {
allowWindowsEscape: true,
})
return globrex(pattern, { globstar: true })
}

/**
Expand All @@ -78,8 +75,8 @@ function createMatch(includePatterns, excludePatterns) {
const exclude = excludePatterns.map(makeMatcher)

return filePath =>
include.some(m => m.match(filePath)) &&
!exclude.some(m => m.match(filePath))
include.some(m => m.regex.test(filePath)) &&
!exclude.some(m => m.regex.test(filePath))
}

/**
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"globals": "^15.11.0",
"globrex": "^0.1.2",
"ignore": "^5.3.2",
"minimatch": "^9.0.5",
"semver": "^7.6.3",
"ts-declaration-location": "^1.0.6"
},
Expand Down
Loading