babel/packages/babel-helper-wrap-function
2017-10-30 16:55:46 -04:00
..
2017-07-25 11:07:01 -04:00
2017-10-30 16:55:46 -04:00

@babel/helper-wrap-function

This helper wraps a function within a call expression. It works with any function: statements, expressions and methods; both named and anonymous.

Example

In

(function () {
}());

Out

_wrapper(function () {
})();

Usage

import wrapFunction from "@babel/helper-wrap-function";

wrapFunction(nodePathOfTheFunction, nodeWhichReferencesToTheWrapper);