Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libs: fix some RegExp nits #13536

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
libs: remove redundant RegExp parts
vsemozhetbyt committed Jun 7, 2017
commit a48371ca8720b4ba5d4d66e122d1c6b583349f17
2 changes: 1 addition & 1 deletion lib/dns.js
Original file line number Diff line number Diff line change
@@ -309,7 +309,7 @@ function setServers(servers) {
// servers cares won't have any servers available for resolution
const orig = cares.getServers();
const newSet = [];
const IPv6RE = /\[(.*)\](?::\d+)?/;
const IPv6RE = /\[(.*)\]/;
const addrSplitRE = /:\d+$/;

servers.forEach((serv) => {
4 changes: 2 additions & 2 deletions lib/repl.js
Original file line number Diff line number Diff line change
@@ -754,7 +754,7 @@ function complete(line, callback) {
const exts = Object.keys(this.context.require.extensions);
var indexRe = new RegExp('^index(' + exts.map(regexpEscape).join('|') +
')$');
var versionedFileNamesRe = /-\d+\.\d+(\.\d+)?/;
var versionedFileNamesRe = /-\d+\.\d+/;

completeOn = match[1];
var subdir = match[2] || '';
@@ -1068,7 +1068,7 @@ REPLServer.prototype.memory = function memory(cmd) {
self.lines.level.push({
line: self.lines.length - 1,
depth: depth,
isFunction: /\s*function\s*/.test(cmd)
isFunction: /\bfunction\b/.test(cmd)
});
} else if (depth < 0) {
// going... up.