mirror of
https://github.com/samsonjs/mit-license.git
synced 2026-04-14 12:45:58 +00:00
8 lines
261 B
JavaScript
8 lines
261 B
JavaScript
const tags = {
|
|
'<': '<',
|
|
'>': '>',
|
|
'&': '&',
|
|
};
|
|
exports.escapeTags = str => (str || '').replace(/[<>&]/g, m => tags[m]);
|
|
exports.stripTags = str => (str || '').replace(/<(?:.|\n)*?>/gm, '');
|
|
exports.validDomainId = str => /^[\w-_]+$/.test(str);
|