|
1 | 1 | import * as CompilerDOM from '@vue/compiler-dom';
|
2 | 2 | import { camelize } from '@vue/shared';
|
3 |
| -import { minimatch } from 'minimatch'; |
4 | 3 | import { toString } from 'muggle-string';
|
| 4 | +import { isMatch } from 'picomatch'; |
5 | 5 | import type { Code, VueCodeInformation, VueCompilerOptions } from '../../types';
|
6 | 6 | import { hyphenateAttr, hyphenateTag } from '../../utils/shared';
|
7 | 7 | import { codeFeatures } from '../codeFeatures';
|
@@ -92,7 +92,7 @@ export function* generateElementProps(
|
92 | 92 |
|
93 | 93 | if (
|
94 | 94 | propName === undefined
|
95 |
| - || options.vueCompilerOptions.dataAttributes.some(pattern => minimatch(propName!, pattern)) |
| 95 | + || options.vueCompilerOptions.dataAttributes.some(pattern => isMatch(propName!, pattern)) |
96 | 96 | ) {
|
97 | 97 | if (prop.exp && prop.exp.constType !== CompilerDOM.ConstantTypes.CAN_STRINGIFY) {
|
98 | 98 | failedPropExps?.push({ node: prop.exp, prefix: `(`, suffix: `)` });
|
@@ -180,7 +180,7 @@ export function* generateElementProps(
|
180 | 180 | }
|
181 | 181 | } else if (prop.type === CompilerDOM.NodeTypes.ATTRIBUTE) {
|
182 | 182 | if (
|
183 |
| - options.vueCompilerOptions.dataAttributes.some(pattern => minimatch(prop.name, pattern)) |
| 183 | + options.vueCompilerOptions.dataAttributes.some(pattern => isMatch(prop.name, pattern)) |
184 | 184 | // Vue 2 Transition doesn't support "persisted" property but `@vue/compiler-dom` always adds it (#3881)
|
185 | 185 | || (
|
186 | 186 | options.vueCompilerOptions.target < 3
|
@@ -354,7 +354,7 @@ function getShouldCamelize(
|
354 | 354 | || (prop.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && prop.arg.isStatic)
|
355 | 355 | )
|
356 | 356 | && hyphenateAttr(propName) === propName
|
357 |
| - && !options.vueCompilerOptions.htmlAttributes.some(pattern => minimatch(propName, pattern)); |
| 357 | + && !options.vueCompilerOptions.htmlAttributes.some(pattern => isMatch(propName, pattern)); |
358 | 358 | }
|
359 | 359 |
|
360 | 360 | function getPropsCodeInfo(
|
|
0 commit comments