Skip to content

Commit 7cc9063

Browse files
Use micromatch instead of picomatch (#109)
* Use micromatch instead of picomatch * fix typo * upgrade fast-glob to latest version (single patch bump). Align micromatch version with one from fast-glob
1 parent 6e95335 commit 7cc9063

3 files changed

Lines changed: 51 additions & 19 deletions

File tree

package-lock.json

Lines changed: 45 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
"chalk": "^2.4.2",
2121
"dateformat": "^3.0.3",
2222
"dayjs": "^1.11.0",
23-
"fast-glob": "^3.2.11",
23+
"fast-glob": "^3.2.12",
2424
"fs-extra": "^7.0.1",
2525
"is-glob": "^4.0.3",
2626
"jsonc-parser": "^2.3.0",
2727
"jszip": "^3.6.0",
28-
"picomatch": "^2.2.1",
28+
"micromatch": "^4.0.4",
2929
"moment": "^2.29.1",
3030
"parse-ms": "^2.1.0",
3131
"request": "^2.88.0",
@@ -36,6 +36,7 @@
3636
"@types/chai": "^4.2.22",
3737
"@types/fs-extra": "^5.0.1",
3838
"@types/is-glob": "^4.0.2",
39+
"@types/micromatch": "^4.0.2",
3940
"@types/mocha": "^9.0.0",
4041
"@types/node": "^16.11.3",
4142
"@types/request": "^2.47.0",

src/util.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import * as fsExtra from 'fs-extra';
33
import * as path from 'path';
44
import * as fs from 'fs';
5-
import * as picomatch from 'picomatch';
5+
import * as micromatch from 'micromatch';
66
import fastGlob = require("fast-glob")
77

88
export class Util {
@@ -135,7 +135,7 @@ export class Util {
135135
* Run a series of glob patterns, returning the matches in buckets corresponding to their pattern index.
136136
*/
137137
public async globAllByIndex(patterns: string[], cwd: string) {
138-
//force all path separators to unit style
138+
//force all path separators to unix style
139139
cwd = cwd.replace(/\\/g, '/');
140140

141141
const globResults = patterns.map(async (pattern) => {
@@ -179,7 +179,7 @@ export class Util {
179179
private filterPaths(pattern: string, filesByIndex: string[][], cwd: string, stopIndex: number) {
180180
//move the ! to the start of the string to negate the absolute path, replace windows slashes with unix ones
181181
let negatedPatternAbsolute = '!' + path.posix.join(cwd, pattern.replace(/^!/, ''));
182-
let filter = picomatch(negatedPatternAbsolute);
182+
let filter = micromatch.matcher(negatedPatternAbsolute);
183183
for (let i = 0; i <= stopIndex; i++) {
184184
if (filesByIndex[i]) {
185185
//filter all matches by the specified pattern

0 commit comments

Comments
 (0)