SequenceExpression.js 632 B

123456789101112131415161718192021
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = extractValueFromSequenceExpression;
  6. /**
  7. * Extractor function for a SequenceExpression type value node.
  8. * A Sequence expression is an object with an attribute named
  9. * expressions which contains an array of different types
  10. * of expression objects.
  11. *
  12. * @returns - An array of the extracted elements.
  13. */
  14. function extractValueFromSequenceExpression(value) {
  15. // eslint-disable-next-line global-require
  16. var getValue = require('.').default;
  17. return value.expressions.map(function (element) {
  18. return getValue(element);
  19. });
  20. }