'use strict'; const entities = { "'": ''', '/': '/', '`': '`', '=': '=', '&': '&', '<': '<', '>': '>', '"': '"' } module.exports = (string) => { return string.replace(/[&<>"'`=\/]/g, s => entities[s]); }