Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-es2015-parameters

Package Overview
Dependencies
Maintainers
3
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-es2015-parameters

Compile ES2015 default and rest parameters to ES5

  • 7.0.0-alpha.10
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8M
increased by15.82%
Maintainers
3
Weekly downloads
 
Created

What is babel-plugin-transform-es2015-parameters?

The babel-plugin-transform-es2015-parameters package is a Babel plugin that transforms ES2015 (ES6) parameter features to ES5. This includes default parameters, rest parameters, and destructuring in function parameters.

What are babel-plugin-transform-es2015-parameters's main functionalities?

Default Parameters

This feature allows you to set default values for function parameters. If no argument is provided for the parameter, the default value is used.

function greet(name = 'World') { console.log('Hello ' + name); } greet(); // Hello World greet('Alice'); // Hello Alice

Rest Parameters

Rest parameters allow you to represent an indefinite number of arguments as an array. This is useful for functions that need to handle a variable number of arguments.

function sum(...numbers) { return numbers.reduce((acc, num) => acc + num, 0); } console.log(sum(1, 2, 3)); // 6

Destructuring in Parameters

Destructuring in function parameters allows you to unpack values from objects or arrays directly in the parameter list. This can make your code more readable and concise.

function printCoordinates({ x, y }) { console.log(`X: ${x}, Y: ${y}`); } printCoordinates({ x: 10, y: 20 }); // X: 10, Y: 20

Other packages similar to babel-plugin-transform-es2015-parameters

Keywords

FAQs

Package last updated on 25 May 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc