5 lines
208 B
JavaScript
5 lines
208 B
JavaScript
module.exports = function sanitizeForLog(input) {
|
|
if (typeof input !== "string") return input;
|
|
// remove newline, carriage return, tab — prevents log forging
|
|
return input.replace(/[\r\n\t]/g, " ");
|
|
}; |