// @ts-check const div = document.createElement("div") const tagReplacement = { '&': '&', '<': '<', '>': '>', "'": ''', '"': '"' } function sanitizeText(value) { return value.toString().replace(/[&<>'"]/g, tag => tagReplacement[tag]) } export default sanitizeText