Sha256: 12b99c911fa6ec620f3a41572af97aaa5c6b646239e3353ca805759fb4439f9a

Contents?: true

Size: 657 Bytes

Versions: 9

Compression:

Stored size: 657 Bytes

Contents

'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = extractValueFromConditionalExpression;
/**
 * Extractor function for a ConditionalExpression type value node.
 *
 * @param - value - AST Value object with type `ConditionalExpression`
 * @returns - The extracted value converted to correct type.
 */
function extractValueFromConditionalExpression(value) {
  // eslint-disable-next-line global-require
  var getValue = require('.').default;
  var test = value.test,
      alternate = value.alternate,
      consequent = value.consequent;


  return getValue(test) ? getValue(consequent) : getValue(alternate);
}

Version data entries

9 entries across 9 versions & 2 rubygems

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