2 * @fileoverview XML character escaper
7 //------------------------------------------------------------------------------
9 //------------------------------------------------------------------------------
12 * Returns the escaped value for a character
13 * @param {string} s string to examine
14 * @returns {string} severity level
17 module.exports = function(s) {
18 return (`${s}`).replace(/[<>&"'\x00-\x1F\x7F\u0080-\uFFFF]/gu, c => { // eslint-disable-line no-control-regex
31 return `&#${c.charCodeAt(0)};`;