FunctionExpression.js 558 B

12345678910111213141516171819
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = extractValueFromFunctionExpression;
  6. /**
  7. * Extractor function for a FunctionExpression type value node.
  8. * Statically, we can't execute the given function, so just return a function
  9. * to indicate that the value is present.
  10. *
  11. * @param - value - AST Value object with type `FunctionExpression`
  12. * @returns - The extracted value converted to correct type.
  13. */
  14. function extractValueFromFunctionExpression(value) {
  15. return function () {
  16. return value;
  17. };
  18. }