Sha256: 409b38aa846a9c129b9a7d938be5609df9f1d7859dc317f3bb89fb73df01199b
Contents?: true
Size: 625 Bytes
Versions: 9
Compression:
Stored size: 625 Bytes
Contents
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = extractValueFromJSXElement; /** * Extractor function for a JSXElement type value node. * * Returns self-closing element with correct name. */ function extractValueFromJSXElement(value) { // eslint-disable-next-line global-require var getValue = require('.').default; var Tag = value.openingElement.name.name; if (value.openingElement.selfClosing) { return '<' + Tag + ' />'; } return '<' + Tag + '>' + [].concat(value.children).map(function (x) { return getValue(x); }).join('') + '</' + Tag + '>'; }
Version data entries
9 entries across 9 versions & 2 rubygems