/
lostSun
/
project-client-server-apps
Обзор
Документация
Войти
/
lostSun
/
project-client-server-apps
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
node_modules/jsx-ast-utils/src/values/JSXElement.js
15 строк
475 B
1lostsun
initial commit
05 май 2025, 11:35
05 май 2025, 11:35
fe8f535
Код
Авторство
О чём код?
/** * Extractor function for a JSXElement type value node. * * Returns self-closing element with correct name. */ export default function extractValueFromJSXElement(value) { // eslint-disable-next-line global-require const getValue = require('.').default; const Tag = value.openingElement.name.name; if (value.openingElement.selfClosing) { return `<${Tag} />`; } return `<${Tag}>${[].concat(value.children).map((x) => getValue(x)).join('')}</${Tag}>`; }