Initial content
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
"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;
|
||||
Reference in New Issue
Block a user