diff options
author | Simon Ser <contact@emersion.fr> | 2024-03-13 15:40:33 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2024-03-13 15:41:04 +0100 |
commit | 3584c1eb1042ca19aa2a35406075fe8dbb8803ce (patch) | |
tree | 4fc6795a1d2eaed94275d484b22362c73208868f | |
parent | c1c7c91c38febf635dcc61ccf87a7c8a9d8217e5 (diff) | |
download | gamja-3584c1eb1042ca19aa2a35406075fe8dbb8803ce.tar.gz gamja-3584c1eb1042ca19aa2a35406075fe8dbb8803ce.zip |
lib/irc: fix whitespace RegExp test in isURIPrefix
-rw-r--r-- | lib/irc.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -264,7 +264,7 @@ const alphaNum = (() => { return new RegExp(/^[a-zA-Z0-9]$/, "u"); } })(); -const space = new RegExp(/\s/); +const space = new RegExp(/^\s$/); function isWordBoundary(ch) { switch (ch) { @@ -279,7 +279,7 @@ function isWordBoundary(ch) { function isURIPrefix(text) { for (let i = text.length - 1; i >= 0; i--) { - if (text[i].search(space)) { + if (space.test(text[i])) { text = text.slice(i); break; } |