Sha256: 6ba6d64d49f0a875d7e37a998a6a413a9b3138ce8020ddf2deda833db252f0e4

Contents?: true

Size: 504 Bytes

Versions: 8

Compression:

Stored size: 504 Bytes

Contents

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

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

Version data entries

8 entries across 8 versions & 2 rubygems

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