16 lines
436 B
JavaScript
16 lines
436 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.santizeValue = void 0;
|
|
const matchPattern = /[&<>="'`]/g;
|
|
const characterMappings = {
|
|
"&": "&",
|
|
"<": "<",
|
|
">": ">",
|
|
"\"": """,
|
|
"=": "=",
|
|
"'": "'",
|
|
"`": "`"
|
|
};
|
|
const santizeValue = (value) => value?.replace(matchPattern, match => characterMappings[match]);
|
|
exports.santizeValue = santizeValue;
|