Skip to content

Commit

Permalink
Optimize a regex (#539)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Feb 13, 2020
1 parent 9c0e75b commit 47c3f54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rules/no-hex-escape.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const getDocumentationUrl = require('./utils/get-documentation-url');
const replaceTemplateElement = require('./utils/replace-template-element');

function checkEscape(context, node, value) {
const fixedValue = value.replace(/(?<=(?:^|[^\\])(?:\\\\)*)\\x/g, '\\u00');
const fixedValue = value.replace(/(?<=(?:^|[^\\])(?:\\\\)*\\)x/g, 'u00');

if (value !== fixedValue) {
context.report({
Expand Down

0 comments on commit 47c3f54

Please sign in to comment.