irc-radio-bot/helpers/strings.js

9 lines
226 B
JavaScript
Raw Normal View History

2019-12-25 12:47:09 +01:00
module.exports = {
formatString: function (string) {
if (string !== undefined && string !== null) {
return new RegExp('^' + string.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') + '$', 'i')
}
return ';'
}
}