Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@babel/plugin-transform-function-name
Advanced tools
Apply ES2015 function.name semantics to all functions
The @babel/plugin-transform-function-name package is a plugin for Babel, a JavaScript compiler, that helps in transforming anonymous function expressions into named function expressions. This can be particularly useful for debugging purposes, as it makes stack traces more informative by providing names for otherwise anonymous functions.
Naming anonymous function expressions
Automatically assigns names to anonymous function expressions, making them easier to identify in stack traces and debugging tools.
const square = function(x) { return x * x; }; // Transforms to: const square = function square(x) { return x * x; };
Enhancing debugging
Improves the debugging experience by ensuring that functions are named, which helps in identifying them in call stacks.
let add = function(a, b) { return a + b; }; // Transforms to: let add = function add(a, b) { return a + b; };
Transforms ES2015 arrow functions into function expressions. Similar in that it transforms function syntax for broader compatibility and improved debugging, but focuses on arrow functions instead of naming functions.
Transforms default parameters and rest parameters in functions to ES5. It's similar because it also deals with transforming aspects of functions for compatibility and optimization, but it focuses on parameters rather than naming.
Apply ES2015 function.name semantics to all functions
See our website @babel/plugin-transform-function-name for more information.
Using npm:
npm install --save-dev @babel/plugin-transform-function-name
or using yarn:
yarn add @babel/plugin-transform-function-name --dev
v7.25.1 (2024-07-28)
babel-plugin-transform-function-name
ensureFunctionName
may be undefined (@liuxingbaoyu)babel-plugin-transform-react-constant-elements
babel-traverse
FAQs
Apply ES2015 function.name semantics to all functions
The npm package @babel/plugin-transform-function-name receives a total of 20,408,355 weekly downloads. As such, @babel/plugin-transform-function-name popularity was classified as popular.
We found that @babel/plugin-transform-function-name demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.