* hasNonPrintables returns whether or not the given value * includes characters that are non-printable. * * @param {string} value - value to check for non-printables * @returns {Boolean} whether or not the value has non-printables
(value)
| 6 | * @returns {Boolean} whether or not the value has non-printables |
| 7 | */ |
| 8 | function hasNonPrintables(value) { |
| 9 | return Array.from(value).some(char => { |
| 10 | const codePoint = char.codePointAt(0); |
| 11 | return codePoint < 32 || codePoint === 127; |
| 12 | }); |
| 13 | } |
| 14 | |
| 15 | module.exports = { |
| 16 | hasNonPrintables, |
no outgoing calls
no test coverage detected