Skip to content

Commit

Permalink
js [nfc]: Align code with preference for using regex literals
Browse files Browse the repository at this point in the history
I caught this while experimenting with a new(ish) eslint rule:
  prefer-regex-literals
  https://eslint.org/docs/rules/prefer-regex-literals
  • Loading branch information
chrisbobbe committed May 26, 2022
1 parent 589429d commit 2ea03fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/webview/js/InboundEventLogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type ScrubbedInboundEventItem = {|
* it's visible.
*/
const placeholdersDivTagFromContent = (content: string): string | null => {
const match = new RegExp('<div id="message-loading" class="(?:hidden)?">').exec(content);
const match = /<div id="message-loading" class="(?:hidden)?">/.exec(content);
return match !== null ? match[0] : null;
};

Expand Down

0 comments on commit 2ea03fc

Please sign in to comment.