@dark-engine/platform-server
Version:
Dark renderer for server
29 lines (28 loc) • 659 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
exports.escape = exports.illegal = void 0;
const core_1 = require('@dark-engine/core');
const constants_1 = require('../constants');
const illegal = x => (0, core_1.illegal)(x, constants_1.LIB);
exports.illegal = illegal;
const escape = x =>
x
.split('')
.map(x => escapeChar(x))
.join('');
exports.escape = escape;
function escapeChar(x) {
switch (x) {
case '&':
return '&';
case '<':
return '<';
case '>':
return '>';
case '"':
return '"';
default:
return x;
}
}
//# sourceMappingURL=utils.js.map