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

Version Path
immosquare-cleaner-0.1.52 node_modules/jsx-ast-utils/lib/values/JSXElement.js
immosquare-cleaner-0.1.51 node_modules/jsx-ast-utils/lib/values/JSXElement.js
immosquare-cleaner-0.1.50 node_modules/jsx-ast-utils/lib/values/JSXElement.js
immosquare-cleaner-0.1.49 node_modules/jsx-ast-utils/lib/values/JSXElement.js
immosquare-cleaner-0.1.48 node_modules/jsx-ast-utils/lib/values/JSXElement.js
immosquare-cleaner-0.1.47 node_modules/jsx-ast-utils/lib/values/JSXElement.js
immosquare-cleaner-0.1.46 node_modules/jsx-ast-utils/lib/values/JSXElement.js
immosquare-cleaner-0.1.45 node_modules/jsx-ast-utils/lib/values/JSXElement.js
decidim-0.26.8 packages/eslint-config/node_modules/jsx-ast-utils/lib/values/JSXElement.js