UNPKG

@dark-engine/platform-server

Version:
25 lines (24 loc) 495 B
import { illegal as $illegal } from '@dark-engine/core'; import { LIB } from '../constants'; const illegal = x => $illegal(x, LIB); const escape = x => x .split('') .map(x => escapeChar(x)) .join(''); function escapeChar(x) { switch (x) { case '&': return '&amp;'; case '<': return '&lt;'; case '>': return '&gt;'; case '"': return '&quot;'; default: return x; } } export { illegal, escape }; //# sourceMappingURL=utils.js.map