Files
babel/packages/babel-helper-wrap-function
Henry Zhu 66ec5263a4 Use Yarn Workspaces (#6056)
* update lerna and lerna-changelog

* Lerna: enable yarn, yarn workspaces [skip ci]

* use older version of Babel since it matches on semver (cannot be the same version)

* install yarn version

* revert node engine change

* update flow

* circle ci on 8

* update lock
2017-08-05 14:48:15 -04:00
..
2017-08-05 14:48:15 -04:00
2017-07-25 11:07:01 -04:00
2017-08-03 18:20:36 -04:00
2017-07-25 11:07:01 -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);