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