"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.encodeJsxStringNode = void 0;
const tslib_1 = require("tslib");
const lodash_1 = tslib_1.__importDefault(require("lodash"));
// import { encode } from 'html-entities';
const SPECIAL_CHARS = '\n\r\'"<>&';
const SPECIAL_CHARS_REG = new RegExp(`[${SPECIAL_CHARS.split('')
    .map((c) => `\\x${lodash_1.default.padStart(c.charCodeAt(0).toString(16), 2, '0')}`)
    .join('')}]`, 'g');
function encodeJsxStringNode(str) {
    return str.replace(SPECIAL_CHARS_REG, (c) => `&#${c.charCodeAt(0)};`);
}
exports.encodeJsxStringNode = encodeJsxStringNode;
// export function encodeJsxStringNode(str: string): string {
//   return encode(str);
// }
//# sourceMappingURL=encodeJsxAttrString.js.map