GoScrobble/web/node_modules/jsx-ast-utils/lib/values/expressions/FunctionExpression.js

19 lines
558 B
JavaScript
Raw Normal View History

2022-04-25 02:47:15 +00:00
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = extractValueFromFunctionExpression;
/**
* Extractor function for a FunctionExpression type value node.
* Statically, we can't execute the given function, so just return a function
* to indicate that the value is present.
*
* @param - value - AST Value object with type `FunctionExpression`
* @returns - The extracted value converted to correct type.
*/
function extractValueFromFunctionExpression(value) {
return function () {
return value;
};
}