Update checked-in dependencies

This commit is contained in:
github-actions[bot] 2024-12-03 18:37:29 +00:00
parent 49f7b34c3d
commit 5261a1223f
1640 changed files with 174830 additions and 182292 deletions

View file

@ -0,0 +1,30 @@
'use strict';
const hasDuplicateNamedGroups = s => /(\(\?<[_$\w]*?)>.*?\1>/.test(s)
module.exports = (context, badBrowser) => ({
'Literal[regex]'(node) {
if (hasDuplicateNamedGroups(node.regex.pattern)) {
context.report(node, `RegExp duplicate named groups are not supported in ${badBrowser}`)
}
},
'CallExpression[callee.name="RegExp"], NewExpression[callee.name="RegExp"]'(node) {
const [source] = node.arguments;
if (
source &&
(
(
source.type === 'Literal' &&
typeof source.value === 'string' &&
hasDuplicateNamedGroups(source.value)
) ||
(
source.type === 'TemplateLiteral' &&
source.quasis.some(({value: {raw}}) => hasDuplicateNamedGroups(raw))
)
)
) {
context.report(node, `RegExp duplicate named groups are not supported in ${badBrowser}`)
}
}
})