source: imaps-frontend/node_modules/jsx-ast-utils/src/values/JSXFragment.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 409 bytes
Line 
1/**
2 * Extractor function for a JSXFragment type value node.
3 *
4 * Returns self-closing element with correct name.
5 */
6export default function extractValueFromJSXFragment(value) {
7 // eslint-disable-next-line global-require
8 const getValue = require('.').default;
9
10 if (value.children.length === 0) {
11 return '<></>';
12 }
13 return `<>${[].concat(value.children).map((x) => getValue(x)).join('')}</>`;
14}
Note: See TracBrowser for help on using the repository browser.