Files
2024-05-29 18:54:49 +01:00

16 lines
436 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.santizeValue = void 0;
const matchPattern = /[&<>="'`]/g;
const characterMappings = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
"\"": "&quot;",
"=": "&#x3D;",
"'": "&#x27;",
"`": "&#x60;"
};
const santizeValue = (value) => value?.replace(matchPattern, match => characterMappings[match]);
exports.santizeValue = santizeValue;