7.0.0-alpha.16 • Published 7 years ago

babel-helper-wrap-function v7.0.0-alpha.16

Weekly downloads
2,692
License
MIT
Repository
github
Last release
7 years ago

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);