Skip to content

Commit

Permalink
chore: update micromatch (#27038)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoobdeebla committed Sep 26, 2020
1 parent 5619220 commit 75b6f39
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby-page-utils/package.json
Expand Up @@ -27,7 +27,7 @@
"gatsby-core-utils": "^1.3.20",
"glob": "^7.1.6",
"lodash": "^4.17.20",
"micromatch": "^3.1.10"
"micromatch": "^4.0.2"
},
"devDependencies": {
"@babel/cli": "^7.11.6",
Expand Down
8 changes: 4 additions & 4 deletions packages/gatsby-page-utils/src/ignore-path.ts
@@ -1,8 +1,8 @@
import * as mm from "micromatch"
import { isMatch, Options as mmOptions } from "micromatch"

interface IPathIgnoreOptions {
patterns?: string | ReadonlyArray<string>
options?: mm.Options
options?: mmOptions
}

export function ignorePath(
Expand All @@ -13,7 +13,7 @@ export function ignorePath(
if (!ignore) return false
const settings: {
patterns: string | ReadonlyArray<string>
options: mm.Options
options: mmOptions
} = {
patterns: ``,
options: {},
Expand All @@ -37,5 +37,5 @@ export function ignorePath(
settings.patterns = ignore.patterns
}
}
return mm.any(path, settings.patterns, settings.options)
return isMatch(path, settings.patterns, settings.options)
}
4 changes: 2 additions & 2 deletions packages/gatsby-page-utils/src/validate-path.ts
@@ -1,5 +1,5 @@
import { parse } from "path"
import * as mm from "micromatch"
import { isMatch } from "micromatch"

const tsDeclarationExtTest = /\.d\.tsx?$/
const jsonYamlExtTest = /\.(json|ya?ml)$/
Expand All @@ -11,7 +11,7 @@ function isTestFile(filePath: string): boolean {
`**/(*.)+(spec|test).(js|ts|jsx|tsx)`,
]

return mm.isMatch(filePath, testPatterns)
return isMatch(filePath, testPatterns)
}

export function validatePath(path: string): boolean {
Expand Down
3 changes: 2 additions & 1 deletion packages/gatsby/package.json
Expand Up @@ -102,7 +102,7 @@
"lodash": "^4.17.20",
"md5-file": "^3.2.3",
"meant": "^1.0.1",
"micromatch": "^3.1.10",
"micromatch": "^4.0.2",
"mime": "^2.4.6",
"mini-css-extract-plugin": "^0.11.2",
"mitt": "^1.2.0",
Expand Down Expand Up @@ -161,6 +161,7 @@
"@babel/cli": "^7.11.6",
"@babel/runtime": "^7.11.2",
"@types/hapi__joi": "^16.0.12",
"@types/micromatch": "^4.0.1",
"@types/normalize-path": "^3.0.0",
"@types/reach__router": "^1.3.5",
"@types/semver": "^7.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/src/redux/run-fast-filters.ts
@@ -1,7 +1,7 @@
import { IGatsbyNode } from "./types"
import { GatsbyGraphQLType } from "../.."
import { prepareRegex } from "../utils/prepare-regex"
const { makeRe } = require(`micromatch`)
import { makeRe } from "micromatch"
import { getValueAt } from "../utils/get-value-at"
import _ from "lodash"
import {
Expand Down

0 comments on commit 75b6f39

Please sign in to comment.