Skip to content

Conversation

zhangxiaoyu713
Copy link

add exclude verify type of RegExp:
if exclude type is Function, it has a bug
eg:
postCssPxToRem({
exclude: (filePath) => {
const reg = /src/pages/m|src/components/m|share/components/m/;
return !reg.test(filePath);
},
})
if we got a filePath: '/project/src/components/m/Button.scss', exclude(filePath) return false, but isExcludeFile will be true;
because filePath.match(exclude) !== null

if we pass a function to math, it will be potential risks:
console.log('abc'.match(() => { const reg = /a|b|c/; }))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant