source: imaps-frontend/node_modules/jsx-ast-utils/lib/values/expressions/ArrayExpression.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 574 bytes
Line 
1'use strict';
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = extractValueFromArrayExpression;
7/**
8 * Extractor function for an ArrayExpression type value node.
9 * An array expression is an expression with [] syntax.
10 *
11 * @returns - An array of the extracted elements.
12 */
13function extractValueFromArrayExpression(value) {
14 // eslint-disable-next-line global-require
15 var getValue = require('.').default;
16 return value.elements.map(function (element) {
17 if (element === null) return undefined;
18 return getValue(element);
19 });
20}
Note: See TracBrowser for help on using the repository browser.