Socket
Socket
Sign inDemoInstall

@babel/plugin-proposal-function-sent

Package Overview
Dependencies
3
Maintainers
4
Versions
74
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-proposal-function-sent


Version published
Maintainers
4
Created

Package description

What is @babel/plugin-proposal-function-sent?

@babel/plugin-proposal-function-sent is a Babel plugin that allows you to use the `function.sent` meta-property within generator functions. This meta-property provides a way to access the value passed to the generator's `next` method, which can be useful for more advanced control flow within generator functions.

What are @babel/plugin-proposal-function-sent's main functionalities?

Accessing the value passed to the generator's next method

This feature allows you to access the value passed to the generator's `next` method using `function.sent`. In the example, the generator function logs the value received each time `next` is called.

function* generator() {
  let value = function.sent;
  while (true) {
    value = yield value;
    console.log('Received:', value);
  }
}

const gen = generator();
console.log(gen.next('First').value); // Logs: 'First'
console.log(gen.next('Second').value); // Logs: 'Second'

Other packages similar to @babel/plugin-proposal-function-sent

Changelog

Source

v7.22.5 (2023-06-08)

:bug: Bug Fix
  • babel-preset-env, babel-standalone
    • #15675 Fix using syntax-unicode-sets-regex in standalone (@nicolo-ribaudo)
:nail_care: Polish

Readme

Source

@babel/plugin-proposal-function-sent

Compile the function.sent meta property to valid ES2015 code

See our website @babel/plugin-proposal-function-sent for more information.

Install

Using npm:

npm install --save-dev @babel/plugin-proposal-function-sent

or using yarn:

yarn add @babel/plugin-proposal-function-sent --dev

Keywords

FAQs

Last updated on 08 Jun 2023

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc