diff options
author | Matt Godbolt <matt@godbolt.org> | 2019-03-21 20:31:42 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-21 20:31:42 -0500 |
commit | b87322568ed7f73a8583cdce707f68f07a0995dd (patch) | |
tree | 387ffc9ba2487bea8c6ab9eb7c40d03cd1e74dc6 /lib/utils.js | |
parent | b8815fbdb20261634919d976310c13e945249250 (diff) | |
parent | a47efe6d65f86024f46be5ef96139bb2f67dca73 (diff) | |
download | compiler-explorer-b87322568ed7f73a8583cdce707f68f07a0995dd.tar.gz compiler-explorer-b87322568ed7f73a8583cdce707f68f07a0995dd.zip |
Merge branch 'master' into llvm
Diffstat (limited to 'lib/utils.js')
-rw-r--r-- | lib/utils.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/utils.js b/lib/utils.js index a710a2997..585c4fced 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -88,6 +88,14 @@ function padRight(name, len) { exports.padRight = padRight; +function trimRight(name) { + var l = name.length; + while (l > 0 && name[l-1] === ' ') l -= 1; + return name.substr(0, l); +} + +exports.trimRight = trimRight; + /*** * Anonymizes given IP. * For IPv4, it removes the last octet |