17 lines
319 B
JavaScript
17 lines
319 B
JavaScript
'use strict';
|
|
|
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
|
const htmlEscapes = {
|
|
'&': '&',
|
|
'<': '<',
|
|
'>': '>',
|
|
'"': '"',
|
|
"'": ''',
|
|
};
|
|
function escape(str) {
|
|
return str.replace(/[&<>"']/g, match => htmlEscapes[match]);
|
|
}
|
|
|
|
exports.escape = escape;
|