2019-12-25 13:10:13 +01:00
|
|
|
/**
|
|
|
|
* Fonction permettant d'être insensible à la casse
|
|
|
|
* @param {String} string
|
|
|
|
*/
|
|
|
|
function formatString (string) {
|
|
|
|
if (string !== undefined && string !== null) {
|
|
|
|
return new RegExp('^' + string.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') + '$', 'i')
|
2019-12-25 12:47:09 +01:00
|
|
|
}
|
2019-12-25 13:10:13 +01:00
|
|
|
return ';'
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
formatString: formatString
|
2019-12-25 12:47:09 +01:00
|
|
|
}
|