ArrayExpression.js 539 B

12345678910111213141516171819
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = extractValueFromArrayExpression;
  6. /**
  7. * Extractor function for an ArrayExpression type value node.
  8. * An array expression is an expression with [] syntax.
  9. *
  10. * @returns - An array of the extracted elements.
  11. */
  12. function extractValueFromArrayExpression(value) {
  13. // eslint-disable-next-line global-require
  14. var getValue = require('./index.js').default;
  15. return value.elements.map(function (element) {
  16. return getValue(element);
  17. });
  18. }