JSPM

  • Created
  • Published
  • Downloads 29332496
  • Score
    100M100P100Q245753F
  • License MIT

Helper to wrap functions inside a function call.

Package Exports

  • @babel/helper-wrap-function

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@babel/helper-wrap-function) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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