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