Hacker News new | ask | show | jobs
by delfaras 2519 days ago
Here's the complete source for anyone curious

``` exports = module.exports = trim;

function trim(str){ return str.replace(/^\s|\s$/g, ''); }

exports.left = function(str){ return str.replace(/^\s/, ''); };

exports.right = function(str){ return str.replace(/\s$/, ''); };

```

1 comments

That code doesn't match what actually happens. It will only trim a single character. Have asterisks been trimmed in your copy-paste or something?
Ah you're right, the asterisks have been interpreted as italics. Can't edit my comment, sorry

Here's a paste: https://pastebin.com/kBHprdyj